/* novel-ui.css - 定制的現代化CSS框架 */

/* === 基礎重置 === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 62.5%;
    scroll-behavior: smooth;
}

body {
    font-family: 'PingFang TC', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', '微軟正黑體', sans-serif;
    font-size: 1.6rem;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-top: 9rem;
}

a {
    color: #5c7cfa;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #4263eb;
}

img {
    max-width: 100%;
    height: auto;
}

ul, ol {
    list-style: none;
}

button {
    cursor: pointer;
}

/* === 容器 === */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* === 標題樣式 === */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: #343a40;
}

h1 { font-size: 3.2rem; }
h2 { 
    font-size: 2.8rem;
    border-bottom: 2px solid #f8f9fa;
    padding-bottom: 0.8rem;
    position: relative;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 8rem;
    height: 2px;
    background-color: #5c7cfa;
}

h3 { font-size: 2.4rem; }
h4 { font-size: 2rem; }
h5 { font-size: 1.8rem; }
h6 { font-size: 1.6rem; }

/* === 主要內容區域 === */
#main-content {
    /* padding: 3rem 0; */
    min-height: 60vh;
}

/* === 修正後的Header系統 === */

/* 基礎Header樣式 */
        #site-header {
            background-color: #fff;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            z-index: 1000;
            transition: all 0.3s ease;
            padding: 0 0 1rem 0;
        }

/* 滾動時的緊湊模式 */
#site-header.scrolled {
    padding: 0.8rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

        .header-content {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 2rem;
            max-width: 1400px;
            margin: 0 auto;
        }

/* === Logo區域優化 === */
.logo {
    flex-shrink: 0;
    margin-right: 2rem;
    z-index: 1001;
}

.logo img {
    height: 4rem;
    width: auto;
    transition: height 0.3s ease;
}

#site-header.scrolled .logo img {
    height: 3.5rem;
}

/* === 主導航系統 - 加強優先級 === */
.main-nav {
    display: flex !important;
    align-items: center !important;
    flex-grow: 1 !important;
    justify-content: center !important;
    position: relative !important;
}

.nav-menu {
    display: flex !important;
    align-items: center !important;
    list-style: none !important;
    gap: 0.5rem !important;
    margin: 0 !important;
    padding: 0 !important;
}

.nav-logo {
    align-items: center !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: center !important;
}

/* 導航項目 - 關鍵優化點 */
.nav-item {
    position: relative !important;
    display: block !important;
    margin: 0 !important;
}

.nav-link {
    display: flex !important;
    align-items: center !important;
    padding: 1.2rem 1rem 0rem 1rem !important;
    color: #2c3e50 !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    font-size: 1.5rem !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
    white-space: nowrap !important;
    position: relative !important;
    z-index: 2 !important;
    background: none !important;
    border: none !important;
}

.nav-link:hover {
    background-color: rgba(92, 124, 250, 0.1) !important;
    color: #5c7cfa !important;
    transform: translateY(-1px) !important;
    text-decoration: none !important;
}

.nav-link.active {
    background-color: rgba(92, 124, 250, 0.15) !important;
    color: #5c7cfa !important;
    font-weight: 600 !important;
    text-decoration: none !important;
}

/* 下拉箭頭 */
.nav-link.has-dropdown::after {
    content: '▼' !important;
    margin-left: 0.8rem !important;
    font-size: 0.8rem !important;
    transition: transform 0.3s ease !important;
    text-decoration: none !important;
}

/* === 關鍵優化：超穩定的下拉選單系統 === */
.dropdown-menu {
    position: absolute !important;
    top: calc(100% - 8px) !important; /* 增加重疊，確保無間隙 */
    left: 0 !important;
    background-color: #fff !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15) !important;
    padding: 1.5rem 0 !important;
    min-width: 240px !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-15px) !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    z-index: 10000 !important; /* 確保在UIKit之上 */
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    pointer-events: none !important;
    margin: 0 !important;
    
    /* 覆蓋可能的UIKit樣式 */
    display: block !important;
    width: auto !important;
    height: auto !important;
    max-width: none !important;
    max-height: none !important;
}

/* 超級穩定的hover機制 */
.nav-item:hover .dropdown-menu,
.nav-item.hover-active .dropdown-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
}

.nav-item:hover .nav-link.has-dropdown::after,
.nav-item.hover-active .nav-link.has-dropdown::after {
    transform: rotate(180deg) !important;
}

/* 擴大hover區域 - 解決從下方進入的問題 */
.nav-item::before {
    content: '' !important;
    position: absolute !important;
    top: -15px !important;    /* 向上擴展更多 */
    left: -15px !important;   /* 向左擴展 */
    right: -15px !important;  /* 向右擴展 */
    bottom: -30px !important; /* 向下擴展更多，確保覆蓋間隙 */
    z-index: 1 !important;
    pointer-events: none !important; /* 不干擾其他交互 */
}

/* 下拉選單項目 */
.dropdown-item {
    display: flex !important;
    align-items: center !important;
    padding: 1rem 1rem 0.5rem 1rem !important;
    color: #495057 !important;
    text-decoration: none !important;
    font-size: 1.1rem !important;
    transition: all 0.25s ease !important;
    border-left: 3px solid transparent !important;
    white-space: nowrap !important;
    margin: 0 !important;
    border-radius: 0 !important;
    background: none !important;
    width: auto !important;
    height: auto !important;
}

.dropdown-item:hover {
    background-color: rgba(92, 124, 250, 0.08) !important;
    color: #5c7cfa !important;
    border-left-color: #5c7cfa !important;
    transform: translateX(5px) !important;
    text-decoration: none !important;
}

.dropdown-item.active {
    background-color: rgba(92, 124, 250, 0.12) !important;
    color: #5c7cfa !important;
    font-weight: 600 !important;
    border-left-color: #5c7cfa !important;
}

/* 圖標樣式 */
.dropdown-item::before {
    content: '';
    width: 1.6rem;
    height: 1.6rem;
    margin-right: 1rem;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* 特殊樣式：多欄下拉選單 */
.dropdown-menu.multi-column {
    min-width: 480px !important;
    padding: 2rem !important;
}

.dropdown-columns {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 3rem !important;
}

.dropdown-column h4 {
    font-size: 1.4rem;
    color: #343a40;
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid #e9ecef;
    position: relative;
}

.dropdown-column h4::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 3rem;
    height: 2px;
    background-color: #5c7cfa;
}

.dropdown-column .dropdown-item {
    padding: 0.6rem 1rem !important;
    font-size: 1.1rem !important;
}

/* === 右側工具欄 === */
.header-tools {
    display: flex !important;
    align-items: center !important;
    gap: 1rem !important;
    flex-shrink: 0 !important;
}

/* 語言切換 */
.language-switcher {
    display: flex !important;
    background-color: #f8f9fa !important;
    border-radius: 8px !important;
    overflow: hidden !important;
}

.lang-btn {
    padding: 0.5rem 0.5rem !important;
    border: none !important;
    background-color: transparent !important;
    color: #495057 !important;
    font-weight: 600 !important;
    font-size: 1.2rem !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.lang-btn:hover {
    background-color: #5c7cfa !important;
    color: #fff !important;
}

.lang-btn.active {
    background-color: #5c7cfa !important;
    color: #fff !important;
}

/* === 用戶下拉選單 === */
/* === 用戶下拉選單 - 仿照導航選單的純CSS模式 === */
.user-dropdown {
    position: relative !important;
}

/* 擴大hover檢測區域 - 仿照導航選單模式 */
.user-dropdown::before {
    content: '' !important;
    position: absolute !important;
    top: -15px !important;    /* 向上擴展更多 */
    left: -15px !important;   /* 向左擴展 */
    right: -15px !important;  /* 向右擴展 */
    bottom: -30px !important; /* 向下擴展更多，確保覆蓋間隙 */
    z-index: 1 !important;
    pointer-events: none !important; /* 不干擾其他交互 */
}

.user-trigger {
    display: flex !important;
    align-items: center !important;
    padding: 0.2rem 0.2rem !important;
    background-color: #f8f9fa !important;
    border-radius: 8px !important;
    color: #343a40 !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    border: 2px solid transparent !important;
    position: relative !important;
    z-index: 2 !important;
}

.user-trigger:hover,
.user-dropdown:hover .user-trigger {
    background-color: #e9ecef !important;
    border-color: #5c7cfa !important;
}

.user-avatar {
    width: 2rem !important;
    height: 2rem !important;
    border-radius: 50% !important;
    background-color: #5c7cfa !important;
    color: #fff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-right: 1rem !important;
    font-weight: 600 !important;
    font-size: 1.2rem !important;
}

.user-name {
    max-width: 120px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    margin-right: 0.8rem !important;
}

.user-dropdown-arrow {
    font-size: 0.8rem !important;
    transition: transform 0.3s ease !important;
}

/* 用戶下拉選單 - 完全仿照導航選單的CSS hover機制 */
.user-dropdown-menu {
    position: absolute !important;
    top: calc(100% - 8px) !important; /* 增加重疊，確保無間隙 */
    right: 0 !important;
    background-color: #fff !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15) !important;
    padding: 1.5rem 0 !important;
    min-width: 260px !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-15px) !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    z-index: 10000 !important; /* 確保在UIKit之上 */
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    pointer-events: none !important;
    margin: 0 !important;
    
    /* 覆蓋可能的UIKit樣式 */
    display: block !important;
    width: auto !important;
    height: auto !important;
    max-width: none !important;
    max-height: none !important;
}

/* 超級穩定的CSS hover機制 - 完全仿照導航選單 */
.user-dropdown:hover .user-dropdown-menu,
.user-dropdown.hover-active .user-dropdown-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
}

.user-dropdown:hover .user-dropdown-arrow,
.user-dropdown.hover-active .user-dropdown-arrow {
    transform: rotate(180deg) !important;
}

.user-dropdown-item {
    display: flex !important;
    align-items: center !important;
    padding: 1rem 2rem !important;
    color: #495057 !important;
    text-decoration: none !important;
    font-size: 1.4rem !important;
    transition: all 0.25s ease !important;
    border-left: 3px solid transparent !important;
    white-space: nowrap !important;
    margin: 0 !important;
    border-radius: 0 !important;
    background: none !important;
    width: auto !important;
    height: auto !important;
}

.user-dropdown-item:hover {
    background-color: rgba(92, 124, 250, 0.08) !important;
    color: #5c7cfa !important;
    border-left-color: #5c7cfa !important;
    transform: translateX(5px) !important;
    text-decoration: none !important;
}

.user-dropdown-item .icon {
    margin-right: 1.2rem !important;
    font-size: 1.6rem !important;
}

/* 特殊項目樣式 */
.user-dropdown-item.signin {
    color: #28a745 !important;
}

.user-dropdown-item.signin:hover {
    color: #1e7e34 !important;
    background-color: rgba(40, 167, 69, 0.08) !important;
    border-left-color: #28a745 !important;
}

.user-dropdown-item.gold {
    color: #ffc107 !important;
}

.user-dropdown-item.gold:hover {
    color: #e0a800 !important;
    background-color: rgba(255, 193, 7, 0.08) !important;
    border-left-color: #ffc107 !important;
}

.user-dropdown-item.logout {
    color: #dc3545 !important;
    border-top: 1px solid #e9ecef !important;
    margin-top: 0.5rem !important;
}

.user-dropdown-item.logout:hover {
    color: #c82333 !important;
    background-color: rgba(220, 53, 69, 0.08) !important;
    border-left-color: #dc3545 !important;
}

/* 搜索和登入按鈕 */
.search-trigger, .btn-login {
    padding: 0.7rem 0.7rem !important;
    background-color: #5c7cfa !important;
    color: #fff !important;
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
    font-weight: 600 !important;
}

.search-trigger:hover, .btn-login:hover {
    background-color: #4c63d2 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(92, 124, 250, 0.3) !important;
}

.btn-register {
    padding: 0.7rem 0.7rem !important;
    background-color: transparent !important;
    color: #5c7cfa !important;
    border: 2px solid #5c7cfa !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
}

.btn-register:hover {
    background-color: #5c7cfa !important;
    color: #fff !important;
    transform: translateY(-1px) !important;
}


/* === 修正：移動端選單 === */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    width: 2rem;
    height: 2rem;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.mobile-menu-toggle:hover {
    background-color: rgba(92, 124, 250, 0.1);
}

.mobile-menu-toggle span {
    display: block;
    width: 2.4rem;
    height: 3px;
    background-color: #343a40;
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

/* === 移動端覆蓋層和面板 === */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    opacity: 1;
}

.mobile-menu-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 320px;
    height: 100vh;
    background-color: #fff;
    z-index: 1000;
    transition: right 0.3s ease;
    overflow-y: auto;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
}

.mobile-menu-panel.active {
    right: 0;
}

.mobile-menu-header {
    padding: 1.5rem 2rem; /* 減少內邊距 */
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8f9fa;
}

.mobile-close-btn {
    background: none;
    border: none;
    font-size: 2.4rem;
    color: #495057;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.mobile-close-btn:hover {
    background-color: rgba(92, 124, 250, 0.1);
}

/* === 修正：移動端導航區塊 - 解決間距過大問題 === */
.mobile-nav-section {
    padding: 1.2rem 2rem; /* 大幅減少內邊距 */
}

.mobile-nav-section:not(:last-child) {
    border-bottom: 1px solid #f0f0f0; /* 添加分隔線 */
}

.mobile-nav-section h3 {
    color: #343a40;
    margin-bottom: 0.8rem; /* 減少標題下邊距 */
    font-size: 1.4rem; /* 稍微縮小字體 */
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0.5rem;
}

.mobile-nav-item {
    margin-bottom: 0.2rem; /* 大幅減少項目間距 */
}

.mobile-nav-link {
    display: block;
    padding: 0.8rem 1rem; /* 減少內邊距 */
    color: #495057;
    text-decoration: none;
    font-size: 1.4rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    background-color: rgba(92, 124, 250, 0.1);
    color: #5c7cfa;
}

/* === 內容限制通知優化 === */
.content-restriction-notice {
    background: linear-gradient(135deg, #fff4e6 0%, #ffeaa7 100%);
    border: none;
    padding: 1.2rem 2rem;
    margin: 0 0 0 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin: 0 0 0.5rem 0;
}

.content-restriction-notice::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.content-restriction-notice p {
    margin: 0;
    color: #d68910;
    font-weight: 600;
    font-size: 1rem;
}

.content-restriction-notice .highlight {
    color: #b7701a;
    text-decoration: underline;
    font-weight: 700;
}

/* === 響應式設計 === */
@media (max-width: 1200px) {
    .header-content {
        padding: 0 1rem !important;
    }
    
    .nav-link {
        padding: 0.5rem 0.5rem 0rem 0.5rem !important;
        font-size: 1.4rem !important;
    }
    
    .dropdown-menu.multi-column {
        min-width: 380px !important; /* 在中等螢幕上稍微縮小 */
    }
}

@media (max-width: 992px) {
    .main-nav .nav-menu {
        gap: 0.2rem !important;
    }
    
    .nav-link {
        padding: 0.4rem 0.8rem 0rem 0.4rem !important;
        font-size: 1.3rem !important;
    }
    
    .user-name {
        max-width: 80px !important;
    }

    .dropdown-menu.multi-column {
        min-width: 350px !important;
        padding: 1.5rem !important;
    }

    .dropdown-columns {
        gap: 2rem !important;
    }
}

@media (max-width: 768px) {
    .main-nav {
        display: none !important; /* 添加 !important 確保優先級 */
    }
    
    .mobile-menu-toggle {
        display: flex !important; /* 添加 !important 確保優先級 */
    }
    
    .user-name {
        display: none !important;
    }
    
    .header-tools {
        gap: 0.5rem !important;
    }
    
    .language-switcher {
        order: -1 !important;
    }

    /* 移動端進一步優化間距 */
    .mobile-nav-section {
        padding: 1rem 1.5rem !important;
    }

    .mobile-nav-section h3 {
        font-size: 1.3rem !important;
        margin-bottom: 0.6rem !important;
    }

    .mobile-nav-item {
        margin-bottom: 0.1rem !important;
    }

    .mobile-nav-link {
        padding: 0.7rem 0.8rem !important;
        font-size: 1.3rem !important;
    }
}

@media (max-width: 576px) {
    #site-header {
        padding: 0.8rem 0 !important;
    }
    
    .header-content {
        padding: 0 1rem !important;
    }
    
    .logo img {
        height: 3.5rem !important;
        max-width: 140px !important;
    }
    
    .lang-btn {
        padding: 0.5rem 0.5rem !important;
        font-size: 1.1rem !important;
    }
    
    .content-restriction-notice {
        padding: 1rem !important;
        font-size: 1.2rem !important;
        margin: 0 0 0.5rem 0 !important;
    }

    /* 超小螢幕進一步優化 */
    .mobile-menu-panel {
        width: 280px !important;
    }

    .mobile-nav-section {
        padding: 0.8rem 1.2rem !important;
    }

    .mobile-nav-section h3 {
        font-size: 1.2rem !important;
        margin-bottom: 0.5rem !important;
    }

    .mobile-nav-link {
        padding: 0.6rem !important;
        font-size: 1.2rem !important;
    }
}

/* === 按鈕樣式 === */
.btn {
    display: inline-block;
    padding: 0.8rem 1.6rem;
    border-radius: 4px;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    line-height: 1.4;
    cursor: pointer;
    margin: 0.5rem;
}

.btn-primary {
    background-color: #5c7cfa;
    color: #fff;
    margin: 0.5rem;
}

.btn-primary:hover {
    background-color: #4263eb;
    color: #fff;
}

.btn-secondary {
    background-color: #c9c9c9;
    color: #495057;
}

.btn-secondary:hover {
    background-color: #dee2e6;
    color: #fff;
}

.btn-secondary {
    background: #b7b7b7;
    color: white;
    margin: 0.5rem;
}

.btn-secondary:hover {
    background: #4b5563;
    transform: translateY(-1px);
    color: white;
}

.btn-tertiary {
    background: #10b981;
    color: white;
}

.btn-tertiary:hover {
    background: #059669;
    transform: translateY(-1px);
    color: white;
}


/* === 麵包屑導航 === */
.breadcrumb {
    background-color: #f8f9fa;
    padding: 1.5rem 0;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 2rem;
}

.breadcrumb ul {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.breadcrumb li {
    position: relative;
    padding-right: 2rem;
    margin-right: 1rem;
}

.breadcrumb li:not(:last-child)::after {
    content: '›';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    font-size: 2rem;
}

.breadcrumb a {
    color: #5c7cfa;
}

.breadcrumb li:last-child {
    color: #495057;
    font-weight: 500;
}

/* === 首頁網格佈局 === */
.section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.section-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.section-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.section-card h2 {
    padding: 1.5rem 2rem;
    margin: 0;
    background-color: #f8f9fa;
    color: #343a40;
    font-size: 1.2rem;
    border-bottom: 1px solid #e9ecef;
}

.card-content {
    padding: 2rem;
}

.card-footer {
    padding: 1.5rem 2rem;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    text-align: right;
}

.card-footer a {
    color: #5c7cfa;
    font-weight: 500;
}

.card-footer a:hover {
    text-decoration: underline;
}

/* === 新聞列表樣式 === */
.news-list {
    max-height: 35rem;
    overflow-y: auto;
}

.news-item {
    border-bottom: 1px solid #e9ecef;
    padding: 1.2rem 0;
    position: relative;
}

.news-item:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    width: 80%;
    height: 1px;
    background: linear-gradient(to right, transparent, #adb5bd, transparent);
}

.news-item:last-child {
    border-bottom: none;
}

.news-item:hover {
    background-color: rgba(92, 124, 250, 0.05);
}

.mr-2 {
    padding: 0.5rem 0.5rem;
}

.news-item a {
    display: block;
    color: #343a40;
    font-weight: 200;
    margin-bottom: 0.8rem;
    padding: 0.5rem 0.5rem;
    transition: color 0.3s ease;
}

.news-item a:hover {
    color: #5c7cfa;
    text-decoration: none;
}

.news-date {
    color: #adb5bd;
    font-size: 1.2rem;
    margin-left: 0.5rem;
}
  
  /* === 用戶統計區域 === */
  .user-stats {
    margin-bottom: 2rem;
  }
  
  .stat-item {
    display: flex;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #e9ecef;
  }
  
  .stat-label {
    font-weight: 500;
    margin-right: 0.5rem;
    width: 8rem;
  }
  
  .stat-value {
    color: #ff6b6b;
    font-weight: 700;
    margin-right: 1rem;
  }
  
  .stat-info {
    color: #868e96;
    font-size: 1.3rem;
  }
  
  .stat-note {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background-color: #fff4e6;
    border-radius: 4px;
    font-size: 1.3rem;
  }
  
  .stat-note p {
    margin-bottom: 0.5rem;
  }
  
  .stat-note p:last-child {
    margin-bottom: 0;
  }
    
  /* === 廣告區域 === */
  .ad-section {
    margin: 2rem 0;
    text-align: center;
  }
  
  .ad-label {
    font-size: 1.2rem;
    color: #adb5bd;
    margin-bottom: 1rem;
  }
  
  /* === 書籍推薦區域 === */
  .book-recommendations {
    margin-bottom: 4rem;
  }
  
  .recommendation-section {
    margin-bottom: 3rem;
  }
  
  .recommendation-section h2 {
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
  }
  
  .recommendation-section h2::before {
    content: '';
    display: inline-block;
    width: 0.6rem;
    height: 2.8rem;
    background-color: #5c7cfa;
    margin-right: 1rem;
    border-radius: 3px;
  }

  /* Special styling for recommendation items */
.recommendation-item {
  padding: 2rem;
}

.recommendation-text {
  margin-top: 1.5rem;
  font-size: 1.4rem;
  line-height: 1.6;
  color: #495057;
}

.book-cover-mini {
  width: 60px;
  height: 80px;
  margin-right: 1.5rem;
  overflow: hidden;
  border-radius: 4px;
  flex-shrink: 0;
}

.book-cover-mini img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ranking-book-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
  
  .book-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 2rem;
  }
  
  .book-item {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }
  
  .book-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  }
  
  .book-cover {
    position: relative;
    overflow: hidden;
    padding-top: 150%;
  }
  
  .book-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
  }
  
  .book-item:hover .book-cover img {
    transform: scale(1.05);
  }
  
  .book-info {
    padding: 1.5rem;
  }
  
  .book-title {
    font-size: 1.2rem;
    font-weight: 200;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    /* height: 4.4rem; */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2; /* 标准属性 */
    -webkit-box-orient: vertical;
  }
  
  .book-author {
    color: #868e96;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
  }
  
  .book-stats {
    display: flex;
    align-items: center;
    font-size: 1.2rem;
    color: #adb5bd;
  }
  
  .book-rating {
    margin-right: 1rem;
    display: flex;
    align-items: center;
  }
  
  .book-rating-stars {
    color: #fcc419;
    margin-right: 0.5rem;
  }
  
  .book-views {
    display: flex;
    align-items: center;
  }
  
  .book-views-icon {
    margin-right: 0.5rem;
  }
  
  /* === 底部導航 === */
  .bottom-nav {
    background-color: #f8f9fa;
    padding: 2rem 0;
    border-top: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
  }
  
  .bottom-nav ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .bottom-nav li {
    margin: 0 1rem;
  }
  
  .bottom-nav a {
    color: #495057;
    font-weight: 500;
    font-size: 1rem;
  }
  
  .bottom-nav a:hover {
    color: #5c7cfa;
  }
  
  /* === 頁腳 === */
  #site-footer {
    background-color: #343a40;
    color: #adb5bd;
    padding: 4rem 0 2rem;
  }
  
  .footer-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 4rem;
  }
  
  .footer-section h3 {
    color: #fff;
    margin-bottom: 2rem;
    font-size: 1.8rem;
  }
  
  .footer-links li {
    margin-bottom: 1rem;
  }
  
  .footer-links a {
    color: #adb5bd;
    transition: color 0.3s ease;
  }
  
  .footer-links a:hover {
    color: #fff;
  }
  
  .footer-ad {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 8px;
  }
  
  .copyright {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .copyright p {
    margin-bottom: 1rem;
    color: #e0e0e0;
  }
  
  .footer-logo {
    margin-top: 2rem;
  }
  
  .footer-logo img {
    height: 4rem;
    opacity: 0.8;
  }
  
  /* === 閱讀模式 === */
  .reading-mode {
    background-color: #f8f8f8;
  }
  
  .reading-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(52, 58, 64, 0.9);
    backdrop-filter: blur(10px);
    padding: 1.5rem 0;
    z-index: 1000;
  }
  
  .controls-group {
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  .control-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 2rem;
    color: #f8f9fa;
    transition: color 0.3s ease;
  }
  
  .control-btn:hover {
    color: #fff;
  }
  
  .control-btn.disabled {
    color: #868e96;
    cursor: not-allowed;
  }
  
  .control-btn span {
    display: block;
  }
  
  .control-btn .label {
    font-size: 1.2rem;
    margin-top: 0.5rem;
  }
  
  .chapter-info {
    text-align: center;
    margin-top: 1rem;
    color: #f8f9fa;
    font-size: 1.2rem;
  }
  
  /* === 回到頂部按鈕 === */
  .back-to-top {
    position: fixed;
    bottom: 10rem;
    right: 2rem;
    width: 4rem;
    height: 4rem;
    background-color: rgba(92, 124, 250, 0.8);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: background-color 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    opacity: 0;
  }
  
  .back-to-top::before {
    content: '';
    width: 1.2rem;
    height: 1.2rem;
    border-top: 3px solid #fff;
    border-left: 3px solid #fff;
    transform: rotate(45deg) translate(2px, 2px);
  }
  
  .back-to-top:hover {
    background-color: #4263eb;
  }
  
  .menu-toggle {
    position: fixed;
    bottom: 10rem;
    right: 7rem;
    padding: 0.8rem 1.5rem;
    background-color: rgba(52, 58, 64, 0.8);
    color: #fff;
    border-radius: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: background-color 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    opacity: 0;
  }
  
  .menu-toggle .icon-menu {
    display: inline-block;
    width: 1.8rem;
    height: 1.8rem;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="18" x2="21" y2="18"></line></svg>');
    background-repeat: no-repeat;
    background-size: contain;
    margin-right: 0.5rem;
  }
  
  .menu-toggle .label {
    font-size: 1.4rem;
  }
  
  .menu-toggle:hover {
    background-color: #343a40;
  }
  
  /* === 模態框 === */
  .modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    overflow-y: auto;
  }
  
  .modal.show {
    display: block;
  }
  
  .modal-content {
    background-color: #fff;
    border-radius: 8px;
    margin: 5rem auto;
    width: 90%;
    max-width: 60rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s;
  }
  
  @keyframes modalFadeIn {
    from {
      opacity: 0;
      transform: translateY(-50px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .modal-header {
    padding: 2rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  
  .modal-header h2 {
    margin: 0;
    font-size: 2.2rem;
    border: none;
  }
  
  .modal-header h2::after {
    display: none;
  }
  
  .modal-body {
    padding: 2rem;
  }
  
  .modal-footer {
    padding: 2rem;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
  }
  
  .modal-footer .btn:not(:last-child) {
    margin-right: 1rem;
  }
  
  .modal-note {
    padding: 1.5rem 2rem;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    font-size: 1.2rem;
    color: #868e96;
    text-align: center;
  }
  
  .warning-icon {
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 0 auto 2rem;
  }
  
  /* === 通知樣式 === */
  .notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 1.5rem 2rem;
    width: 350px;
    border-radius: 8px;
    background-color: #343a40;
    color: #fff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 3000;
    display: flex;
    align-items: center;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
  }
  
  .notification.show {
    opacity: 1;
    transform: translateY(0);
  }
  
  .notification-icon {
    margin-right: 1rem;
    flex-shrink: 0;
  }
  
  .notification-message {
    font-size: 1.4rem;
  }
  
  .notification-success {
    background-color: #51cf66;
  }
  
  .notification-warning {
    background-color: #ff922b;
  }
  
  .notification-error {
    background-color: #ff6b6b;
  }
  
  /* === 跑馬燈樣式優化 === */
#marquee-container {
  position: relative;
  background-color: #fff4e6;
  border: 2px solid #fd7e14;
  border-radius: 8px;
  width: 100%;
  height: 4.5rem; /* 減少高度，讓它只有一行 */
  margin: 0 0 0.5rem 0;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: none;
  padding: 0 1.5rem;
}

#marquee-messages {
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  animation: marquee 30s linear infinite;
  height: 100%;
  display: flex;
  align-items: center;
}

@keyframes marquee {
  0% {
    left: 100%;
  }
  100% {
    left: -200%;
  }
}

#marquee-container a.info {
  position: absolute;
  bottom: 5px;
  right: 10px;
  font-size: 1rem;
  color: #fd7e14;
  text-decoration: underline;
}

#marquee-messages span {
  display: inline-block;
  margin-right: 5rem; /* 增加間距 */
  font-size: 1.8rem; /* 增加文字大小 */
  color: #e67700;
  font-weight: 500;
  line-height: 4.5rem; /* 確保垂直居中 */
}
  
  /* === 閱讀區域樣式 === */
  #colorpanel {
    padding: 2rem;
    margin: 2rem auto;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-size: 16pt;
    line-height: 1.8;
    color: #343a40;
    max-width: 100%;
  }
  
  /* === 留言區域樣式 === */
  .comment-section {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #e9ecef;
  }
  
  .comment-section h3 {
    margin-bottom: 2rem;
  }
  
  .comment-form {
    margin-bottom: 3rem;
  }
  
  .comment-form textarea {
    width: 100%;
    height: 15rem;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    resize: vertical;
    font-family: inherit;
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
  }
  
  .comment-list {
    margin-top: 3rem;
  }
  
  .comment-item {
    border-bottom: 1px solid #e9ecef;
    padding: 2rem 0;
  }
  
  .comment-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
  }
  
  .comment-avatar {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 1.5rem;
  }
  
  .comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  .comment-info {
    flex-grow: 1;
  }
  
  .comment-author {
    font-weight: 700;
    margin-bottom: 0.5rem;
  }
  
  .comment-date {
    font-size: 1.2rem;
    color: #adb5bd;
  }
  
  .comment-content {
    margin-left: 5.5rem;
    font-size: 1.4rem;
    line-height: 1.6;
  }
  
  .comment-actions {
    margin-top: 1.5rem;
    margin-left: 5.5rem;
    display: flex;
  }
  
  .comment-action {
    margin-right: 2rem;
    font-size: 1.3rem;
    color: #868e96;
    cursor: pointer;
  }
  
  .comment-action:hover {
    color: #5c7cfa;
  }
  
  .comment-reply-form {
    margin: 2rem 0 2rem 5.5rem;
  }
  
  /* === 閱讀設置面板 === */
  .reading-settings {
    padding: 2rem;
  }
  
  .setting-group {
    margin-bottom: 2rem;
  }
  
  .setting-group h3 {
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
  }
  
  .setting-item {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
  }
  
  .setting-label {
    width: 10rem;
    font-weight: 500;
  }
  
  .setting-control {
    flex-grow: 1;
  }
  
  .setting-control input[type="range"] {
    width: 100%;
  }
  
  .color-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
  }
  
  .color-option {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease;
    border: 2px solid transparent;
  }
  
  .color-option:hover {
    transform: scale(1.1);
  }
  
  .color-option.active {
    border-color: #5c7cfa;
  }
  
  .method-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 8px;
    overflow: hidden;
    margin-right: 2rem;
  }
  
  .method-info {
    flex-grow: 1;
  }
  
  .method-name {
    font-weight: 700;
    margin-bottom: 0.5rem;
  }
  
  .method-description {
    font-size: 1.3rem;
    color: #868e96;
  }
  
  /* === 排行榜樣式 === */
  /* 排行榜列表容器 */
.ranking-list {
    background-color: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

/* 排行榜標題 */
.ranking-header {
    padding: 0.8rem 1rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-weight: 500;
    font-size: 1rem;
    color: #343a40;
    text-align: center;
}

/* 網格容器 - 響應式設計 */
.ranking-grid {
    display: block; /* 改為block，更適合窄屏幕 */
}

/* 排行榜項目 */
.ranking-item {
    display: flex;
    align-items: flex-start;
    padding: 0.8rem;
    border-bottom: 1px solid #f1f3f4;
    transition: background-color 0.2s ease;
    position: relative;
    min-height: 60px;
}

.ranking-item:last-child {
    border-bottom: none;
}

.ranking-item:hover {
    background-color: #f8f9fa;
}

/* 排名數字 - 大幅縮小，不再突兀 */
.ranking-number {
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 50%;
    background-color: #6c757d;
    color: #fff;
    font-weight: 600;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.8rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.ranking-number.top1 {
    background-color: #ffc107;
    color: #000;
}

.ranking-number.top2 {
    background-color: #adb5bd;
    color: #fff;
}

.ranking-number.top3 {
    background-color: #cd7f32;
    color: #fff;
}

/* 書籍資訊區域 */
.ranking-book-info {
    flex-grow: 1;
    min-width: 0;
    margin-right: 0.5rem;
}

/* 書籍標題 - 優化文字省略 */
.ranking-book-title {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.3;
    margin-bottom: 0.3rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2; /* 标准属性 */
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}

.ranking-book-title a {
    color: #333;
    text-decoration: none;
}

.ranking-book-title a:hover {
    color: #5c7cfa;
}

/* 作者和分類資訊 */
.ranking-book-author {
    font-size: 0.75rem;
    color: #6c757d;
    margin-bottom: 0.2rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
}

.ranking-book-author a {
    color: #6c757d;
    text-decoration: none;
}

.ranking-book-author a:hover {
    color: #5c7cfa;
}

/* 分類標籤 - 縮小尺寸 */
.ranking-book-category {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    background-color: #e9ecef;
    border-radius: 2px;
    font-size: 0.65rem;
    color: #495057;
    white-space: nowrap;
}

/* 章節連結 */
.ranking-book-info > div:last-child {
    font-size: 0.75rem;
    margin-top: 0.2rem;
}

.ranking-book-info > div:last-child a {
    color: #5c7cfa;
    text-decoration: none;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1; /* 标准属性 */
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}

/* 統計資訊 - 縮小並優化對齊 */
.ranking-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-start;
    flex-shrink: 0;
    text-align: right;
    min-width: 4rem;
}

.ranking-vote-count {
    font-weight: 600;
    font-size: 0.7rem;
    color: #dc3545;
    margin-bottom: 0.2rem;
    white-space: nowrap;
}

.ranking-update-time {
    font-size: 0.65rem;
    color: #adb5bd;
    white-space: nowrap;
}

/* 專門針對Top 10的樣式 */
.daily-top .ranking-grid {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1200px) {
  .daily-top .ranking-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 992px) {
  .daily-top .ranking-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .daily-top .ranking-grid {
    grid-template-columns: 1fr;
  }
}

/* 確保每一項的邊框正確顯示 */
.ranking-grid .ranking-item:nth-child(3n) {
  border-right: 1px solid #f1f3f4;
}

@media (max-width: 991px) {
  .ranking-grid .ranking-item:nth-child(3n) {
    border-right: 1px solid #f1f3f4;
  }
  
  .ranking-grid .ranking-item:nth-child(2n) {
    border-right: none;
  }
}

@media (max-width: 767px) {
  .ranking-grid .ranking-item {
    border-right: 1px solid #f1f3f4;
  }
}

/* 確保最後一行的項目底部沒有邊框 */
.ranking-grid .ranking-item:nth-last-child(-n+3) {
  border-bottom: 1px solid #f1f3f4;
}

@media (max-width: 991px) {
  .ranking-grid .ranking-item:nth-last-child(-n+3) {
    border-bottom: 1px solid #f1f3f4;
  }
  
  .ranking-grid .ranking-item:nth-last-child(-n+2) {
    border-bottom: 1px solid #f1f3f4;
  }
}

@media (max-width: 767px) {
  .ranking-grid .ranking-item:nth-last-child(-n+2) {
    border-bottom: 1px solid #f1f3f4;
  }
  
  .ranking-grid .ranking-item:last-child {
    border-bottom: 1px solid #f1f3f4;
  }
}

/* 日榜、周榜、月榜按鈕 */
.ranking-tabs {
  display: flex;
  margin-bottom: 1.5rem;
  background-color: #f8f9fa;
  border-radius: 8px;
  overflow: hidden;
}

.ranking-tab {
  flex: 1;
  padding: 1rem;
  text-align: center;
  font-weight: 500;
  color: #495057;
  cursor: pointer;
  transition: all 0.3s ease;
  border-bottom: 2px solid transparent;
}

.ranking-tab:hover {
  color: #5c7cfa;
  background-color: rgba(92, 124, 250, 0.05);
}

.ranking-tab.active {
  color: #5c7cfa;
  border-bottom-color: #5c7cfa;
  background-color: rgba(92, 124, 250, 0.1);
}

/* 查看更多按鈕 */
.see-more {
    display: block;
    text-align: center;
    padding: 0.6rem;
    background-color: #f8f9fa;
    color: #5c7cfa;
    font-weight: 500;
    font-size: 0.8rem;
    border-top: 1px solid #e9ecef;
    transition: all 0.2s ease;
    text-decoration: none;
}

.see-more:hover {
    background-color: #e9ecef;
    color: #4263eb;
}

/* 響應式設計 */

/* 中等寬度 (400px - 768px) */
@media (min-width: 400px) and (max-width: 768px) {
    .ranking-header {
        font-size: 1.1rem;
        padding: 1rem;
    }
    
    .ranking-item {
        padding: 1rem;
        min-height: 70px;
    }
    
    .ranking-number {
        width: 2rem;
        height: 2rem;
        font-size: 0.8rem;
        margin-right: 1rem;
    }
    
    .ranking-book-title {
        font-size: 1rem;
    }
    
    .ranking-book-author {
        font-size: 0.8rem;
    }
    
    .ranking-vote-count {
        font-size: 0.75rem;
    }
    
    .ranking-update-time {
        font-size: 0.7rem;
    }
}

/* 大螢幕 (768px+) */
@media (min-width: 768px) {
    .ranking-header {
        font-size: 1.2rem;
        padding: 1.2rem;
    }
    
    .ranking-item {
        padding: 1.2rem;
        min-height: 80px;
    }
    
    .ranking-number {
        width: 2.2rem;
        height: 2.2rem;
        font-size: 0.9rem;
        margin-right: 1.2rem;
    }
    
    .ranking-book-title {
        font-size: 1.1rem;
    }
    
    .ranking-book-author {
        font-size: 0.85rem;
    }
    
    .ranking-vote-count {
        font-size: 0.8rem;
    }
    
    .ranking-update-time {
        font-size: 0.75rem;
    }
    
    /* 大螢幕下可以使用網格佈局 */
    .daily-top .ranking-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 0;
    }
    
    .daily-top .ranking-item {
        border-right: 1px solid #f1f3f4;
        border-bottom: 1px solid #f1f3f4;
    }
    
    .daily-top .ranking-item:nth-child(even) {
        border-right: 1px solid #f1f3f4;
    }
}

/* 超小螢幕 (最大300px) 的特殊優化 - 重點優化 */
@media (max-width: 300px) {
    .ranking-header {
        padding: 0.6rem 0.5rem;
        font-size: 0.9rem;
    }
    
    .ranking-item {
        padding: 0.6rem 0.5rem;
        min-height: 55px;
    }
    
    .ranking-number {
        width: 1.5rem;
        height: 1.5rem;
        font-size: 0.7rem;
        margin-right: 0.6rem;
    }
    
    .ranking-book-title {
        font-size: 0.85rem;
        -webkit-line-clamp: 1; /* 窄屏幕只顯示一行 */
        line-clamp: 1; /* 标准属性 */
    }
    
    .ranking-book-author {
        font-size: 0.7rem;
        margin-bottom: 0.1rem;
    }
    
    .ranking-book-category {
        font-size: 0.6rem;
        padding: 0.05rem 0.3rem;
    }
    
    .ranking-vote-count {
        font-size: 0.65rem;
    }
    
    .ranking-update-time {
        font-size: 0.6rem;
    }
    
    .ranking-stats {
        min-width: 3rem;
    }
    
    .see-more {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
}

/* 覆寫原有的novel-ui.css中可能衝突的樣式 */
.ranking-list.user-recommend .ranking-grid,
.ranking-list.daily-top .ranking-grid {
    display: block;
}

@media (min-width: 768px) {
    .ranking-list.daily-top .ranking-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

/* 確保在所有螢幕尺寸下邊框都正確顯示 */
@media (min-width: 768px) {
    .daily-top .ranking-item:nth-child(3n) {
        border-right: 1px solid #f1f3f4;
    }
    
    .daily-top .ranking-item:nth-child(2n) {
        border-right: 1px solid #f1f3f4;
    }
}

@media (max-width: 767px) {
    .daily-top .ranking-item {
        border-right: 1px solid #f1f3f4 !important;
    }
}

/* 標題樣式 */
.section-title {
  display: flex;
  align-items: center;
  margin-bottom: 2rem;
  font-size: 2.2rem;
  font-weight: 500;
  color: #343a40;
  position: relative;
}

.section-title::before {
  content: '';
  display: inline-block;
  width: 0.6rem;
  height: 2.8rem;
  background-color: #5c7cfa;
  margin-right: 1rem;
  border-radius: 3px;
}

.section-title::after {
  content: '';
  flex-grow: 1;
  height: 1px;
  background: linear-gradient(to right, #adb5bd, transparent);
  margin-left: 1.5rem;
}

/* 編輯推薦區域 */
.editor-recommend {
  margin-bottom: 4rem;
}
  
  /* === 響應式設計 === */
  @media (max-width: 992px) {
    html {
      font-size: 60%;
    }
    
    .section-grid {
      grid-template-columns: 1fr;
    }
    
    .book-list {
      grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
  }
  
  @media (max-width: 768px) {
    html {
      font-size: 58%;
    }
    
    .header-content {
      /* padding: 1rem 0; */
      justify-content: center; /* 確保在手機模式下也是居中的 */
    }
    
    .logo {
      order: 1;
    }
    
    .main-nav {
      position: static; /* 改為靜態定位，不使用絕對定位 */
      width: auto;
      background-color: transparent;
      padding: 0;
      box-shadow: none;
      order: 2; /* 調整顯示順序 */
    }

    .main-nav ul {
      flex-direction: row; /* 保持水平排列 */
      flex-wrap: wrap; /* 允許在需要時換行 */
      justify-content: center; /* 居中對齊 */
    }
    
    .main-nav li {
      margin: 0.5rem; /* 提供統一的邊距 */
    }
    
    .mobile-menu-toggle {
      display: none; /* 隱藏手機菜單切換按鈕 */
    }
    
    .mobile-menu-toggle span {
      display: block;
      width: 100%;
      height: 2px;
      background-color: #343a40;
      transition: all 0.3s ease;
    }
    
    body.menu-open .mobile-menu-toggle span:nth-child(1) {
      transform: translateY(10px) rotate(45deg);
    }
    
    body.menu-open .mobile-menu-toggle span:nth-child(2) {
      opacity: 0;
    }
    
    body.menu-open .mobile-menu-toggle span:nth-child(3) {
      transform: translateY(-10px) rotate(-45deg);
    }
    
    .user-actions {
      order: 2;
    }
    
    .language-selector {
      display: none;
    }
    
    .search-box {
      display: none;
    }
    
    .footer-sections {
      grid-template-columns: 1fr;
    }
    
    .comment-header {
      flex-direction: column;
      align-items: flex-start;
    }
    
    .comment-avatar {
      margin-bottom: 1rem;
    }
    
    .comment-content,
    .comment-actions,
    .comment-reply-form {
      margin-left: 0;
    }
  }
  
  @media (max-width: 576px) {
    html {
      font-size: 55%;
    }
    
    .book-list {
      grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .modal-content {
      width: 95%;
    }
    
    .ranking-item {
      /* flex-direction: column; */
      align-items: flex-start;
    }
    
    .ranking-number {
      margin-bottom: 1rem;
    }
    
    .ranking-stats {
      margin-left: 0;
      margin-top: 1rem;
      align-items: flex-start;
    }
    
    .controls-group {
      flex-wrap: wrap;
    }
    
    .control-btn {
      margin: 0.5rem;
    }
  }
  
 
/* === 輔助類 === */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.hidden { display: none; }
.visible { display: block; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }

.p-0 { padding: 0; }
.p-1 { padding: 1rem; }
.p-2 { padding: 2rem; }
.p-3 { padding: 3rem; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.flex { display: flex; }
.flex-column { flex-direction: column; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.flex-grow { flex-grow: 1; }

/* Footer優化 - 深色背景適配版本 */

/* 主要容器樣式 */
.footer-links-container {
    margin: 2rem 0;
    padding: 1.5rem;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

/* 分區標題樣式 */
.footer-section-title {
    color: #fff;
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(92, 124, 250, 0.3);
    position: relative;
}

.footer-section-title::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 3rem;
    height: 2px;
    background-color: #5c7cfa;
}

/* 分區容器 */
.footer-links-section {
    margin-bottom: 3rem;
}

.footer-links-section:last-child {
    margin-bottom: 0;
}

/* 網格佈局 */
.footer-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

/* 聯絡我們區域 - 特殊樣式 */
.contact-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

/* 基本連結項目樣式 */
.footer-link-item {
    padding: 0.8rem 1rem;
    background-color: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
    color: #adb5bd; /* 預設文字顏色 */
}

.footer-link-item:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-left-color: #5c7cfa;
    transform: translateX(3px);
}

.footer-link-item a {
    color: #adb5bd;
    text-decoration: none;
    font-size: 1.4rem;
    transition: color 0.3s ease;
}

.footer-link-item a:hover {
    color: #fff;
}

/* 信箱項目 - 兩行顯示 */
.footer-link-item.email-item {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
}

.email-label {
    color: #e9ecef;
    font-size: 1.3rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.email-address {
    color: #5c7cfa;
    font-size: 1.4rem;
    font-weight: 400;
    transition: color 0.3s ease;
}

.email-address:hover {
    color: #4263eb;
    text-decoration: underline;
}

/* 圖標樣式調整 */
.footer-link-item.email-item .email-label::before {
    content: "✉";
    color: #5c7cfa;
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

.footer-link-item.service-item::before {
    content: "🔗";
    margin-right: 0.5rem;
}

.footer-link-item.ad-item::before {
    content: "📢";
    margin-right: 0.5rem;
}

/* 版權區域內的政策連結 */
.copyright-policies {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.copyright-policies a {
    color: #5c7cfa;
    text-decoration: none;
    font-size: 1.3rem;
    margin-left: 1rem;
    transition: color 0.3s ease;
}

.copyright-policies a:hover {
    color: #4263eb;
    text-decoration: underline;
}

.copyright-policies a::before {
    content: "📋";
    margin-right: 0.5rem;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .footer-links-grid,
    .contact-links-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .footer-section-title {
        font-size: 1.4rem;
        margin-bottom: 1rem;
    }
    
    .footer-links-section {
        margin-bottom: 2rem;
    }
    
    .footer-link-item.email-item {
        text-align: center;
        align-items: center;
    }
    
    .email-label {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .footer-links-container {
        padding: 1rem;
        margin: 1.5rem 0;
    }
    
    .footer-link-item {
        padding: 0.6rem 0.8rem;
    }
    
    .footer-link-item a {
        font-size: 1.2rem;
    }
    
    .email-label {
        font-size: 1.2rem;
    }
    
    .email-address {
        font-size: 1.3rem;
    }
    
    .footer-section-title {
        font-size: 1.3rem;
    }
}

/* 特殊優化：超窄屏幕 */
@media (max-width: 320px) {
    .footer-links-grid,
    .contact-links-grid {
        gap: 0.5rem;
    }
    
    .footer-link-item {
        padding: 0.5rem;
    }
    
    .footer-link-item a {
        font-size: 1.1rem;
    }
    
    .email-label {
        font-size: 1.1rem;
    }
    
    .email-address {
        font-size: 1.2rem;
    }
}