:root {
    --ios-bg-color: #F2F2F7;
    --ios-card-bg: #FFFFFF;
    --ios-text-primary: #1C1C1E;
    --ios-text-secondary: #8E8E93;
    --ios-blue: #007AFF;
    --ios-orange: #FF9500;
    --ios-red: #FF3B30;
    --ios-green: #34C759;
    --ios-purple: #AF52DE;
    --ios-pink: #FF2D55;
    --ios-separator: rgba(60, 60, 67, 0.12);
    --ios-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --ios-radius: 16px;
    --header-height: 72px;
    --ios-hover-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    --ios-border: 1px solid rgba(0, 0, 0, 0.06);
    --ios-blur: 20px;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-accent: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

[data-theme="dark"] {
    --ios-bg-color: #1C1C1E;
    --ios-card-bg: #2C2C2E;
    --ios-text-primary: #FFFFFF;
    --ios-text-secondary: #98989F;
    --ios-separator: rgba(84, 84, 88, 0.65);
    --ios-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    --header-bg: rgba(44, 44, 46, 0.9);
}

[data-theme="dark"] .search-input {
    background-color: #374151;
    color: white;
}

[data-theme="dark"] .search-input:focus {
    background-color: #4B5563;
    border-color: var(--ios-blue);
}

[data-theme="dark"] .header {
    background-color: var(--header-bg);
}

[data-theme="dark"] .book-card:hover {
    background-color: var(--ios-card-bg);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .rank-number {
    background-color: #374151;
    color: #E5E7EB;
}

[data-theme="dark"] .badge-blue {
    background-color: rgba(59, 130, 246, 0.2);
    color: #60A5FA;
}

[data-theme="dark"] .badge-orange {
    background-color: rgba(249, 115, 22, 0.2);
    color: #FB923C;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: system-ui, sans-serif;
    background-color: var(--ios-bg-color);
    color: var(--ios-text-primary);
    line-height: 1.6;
    padding-top: var(--header-height);
    font-feature-settings: "kern" 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
}

a:active {
    opacity: 0.7;
}

/* Header / Navigation */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: saturate(180%) blur(var(--ios-blur));
    transition: all 0.3s ease;
    -webkit-backdrop-filter: saturate(180%) blur(var(--ios-blur));
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 24px;
    justify-content: center;
}

[data-theme="dark"] .header {
    background-color: rgba(28, 28, 30, 0.8);
}

.nav-container {
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    position: relative;
}

@media (min-width: 769px) {
    .logo {
        min-width: 200px;
    }

    .nav-links {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }

    .user-actions {
        min-width: 200px;
        justify-content: flex-end;
    }
}

.logo {
    font-weight: 700;
    font-size: 22px;
    background: linear-gradient(135deg, #34C759 0%, #059669 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo img {
    height: 42px !important;
    width: 42px !important;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-links {
    display: flex;
    gap: 4px;
    font-size: 15px;
    font-weight: 500;
    background-color: rgba(118, 118, 128, 0.12);
    border-radius: 10px;
    padding: 4px;
}

[data-theme="dark"] .nav-links {
    background-color: rgba(118, 118, 128, 0.24);
}

.nav-links a {
    padding: 8px 18px;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.nav-links a:hover {
    opacity: 0.8;
}

.nav-links a.active {
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* 导航链接不同颜色 - 首页（蓝色） */
.nav-links a[data-nav="home"] {
    color: #007AFF;
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.08), rgba(0, 122, 255, 0.05));
}

.nav-links a[data-nav="home"].active {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.15), rgba(0, 122, 255, 0.1));
    border: 1px solid rgba(0, 122, 255, 0.25);
}

/* 导航链接不同颜色 - 书架（绿色） */
.nav-links a[data-nav="bookshelf"] {
    color: #34C759;
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.08), rgba(52, 199, 89, 0.05));
}

.nav-links a[data-nav="bookshelf"].active {
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.15), rgba(52, 199, 89, 0.1));
    border: 1px solid rgba(52, 199, 89, 0.25);
}

/* 导航链接不同颜色 - 个人中心（橙色） */
.nav-links a[data-nav="profile"] {
    color: #FF9500;
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.08), rgba(255, 149, 0, 0.05));
}

.nav-links a[data-nav="profile"].active {
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.15), rgba(255, 149, 0, 0.1));
    border: 1px solid rgba(255, 149, 0, 0.25);
}

/* 导航链接不同颜色 - 作者中心（紫色） */
.nav-links a[data-nav="author"] {
    color: #AF52DE;
    background: linear-gradient(135deg, rgba(175, 82, 222, 0.08), rgba(175, 82, 222, 0.05));
}

.nav-links a[data-nav="author"].active {
    background: linear-gradient(135deg, rgba(175, 82, 222, 0.15), rgba(175, 82, 222, 0.1));
    border: 1px solid rgba(175, 82, 222, 0.25);
}

/* 深色模式下的导航颜色 */
[data-theme="dark"] .nav-links a[data-nav="home"] {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.15), rgba(0, 122, 255, 0.1));
}

[data-theme="dark"] .nav-links a[data-nav="home"].active {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.25), rgba(0, 122, 255, 0.15));
    border-color: rgba(0, 122, 255, 0.3);
}

[data-theme="dark"] .nav-links a[data-nav="bookshelf"] {
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.15), rgba(52, 199, 89, 0.1));
}

[data-theme="dark"] .nav-links a[data-nav="bookshelf"].active {
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.25), rgba(52, 199, 89, 0.15));
    border-color: rgba(52, 199, 89, 0.3);
}

[data-theme="dark"] .nav-links a[data-nav="profile"] {
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.15), rgba(255, 149, 0, 0.1));
}

[data-theme="dark"] .nav-links a[data-nav="profile"].active {
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.25), rgba(255, 149, 0, 0.15));
    border-color: rgba(255, 149, 0, 0.3);
}

[data-theme="dark"] .nav-links a[data-nav="author"] {
    background: linear-gradient(135deg, rgba(175, 82, 222, 0.15), rgba(175, 82, 222, 0.1));
}

[data-theme="dark"] .nav-links a[data-nav="author"].active {
    background: linear-gradient(135deg, rgba(175, 82, 222, 0.25), rgba(175, 82, 222, 0.15));
    border-color: rgba(175, 82, 222, 0.3);
}

.search-bar {
    position: relative;
    width: 240px;
    margin: 0 16px;
}

.search-input {
    width: 100%;
    padding: 6px 12px 6px 32px;
    border-radius: 8px;
    border: none;
    background-color: rgba(0, 0, 0, 0.05);
    font-size: 13px;
    color: var(--ios-text-primary);
    outline: none;
    transition: all 0.2s ease;
}

[data-theme="dark"] .search-input {
    background-color: rgba(118, 118, 128, 0.24);
    color: var(--ios-text-primary);
}

.search-input:focus {
    background-color: var(--ios-card-bg);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.2);
}

.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ios-text-secondary);
    width: 14px;
    height: 14px;
    pointer-events: none;
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 20px;
    height: 14px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    z-index: 1002;
}

.mobile-menu-btn .bar {
    width: 100%;
    height: 2px;
    background-color: var(--ios-text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Mobile Menu */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    z-index: 1001;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    bottom: 0;
    background: var(--ios-card-bg);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    z-index: 1002;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    padding: 20px;
    border-left: 1px solid var(--ios-separator);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
}

.mobile-menu.show {
    transform: translateX(-280px);
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--ios-separator);
}

.mobile-menu-title {
    font-size: 20px;
    font-weight: 700;
}

.mobile-menu-close {
    background: none;
    border: none;
    color: var(--ios-text-secondary);
    cursor: pointer;
    padding: 4px;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-nav-links a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--ios-text-primary);
    font-weight: 500;
    transition: background-color 0.2s;
}

.mobile-nav-links a:hover,
.mobile-nav-links a.active {
    background-color: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .mobile-nav-links a:hover,
[data-theme="dark"] .mobile-nav-links a.active {
    background-color: rgba(255, 255, 255, 0.1);
}

.mobile-nav-links .nav-icon {
    width: 20px;
    height: 20px;
    color: var(--ios-text-secondary);
}

.mobile-search {
    margin-bottom: 20px;
}

.mobile-search-input {
    width: 100%;
    padding: 10px 16px;
    border-radius: 10px;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    color: var(--ios-text-primary);
    font-size: 15px;
}

[data-theme="dark"] .mobile-search-input {
    background: rgba(255, 255, 255, 0.1);
}

.user-actions {
    display: flex;
    gap: 12px;
    font-size: 14px;
    align-items: center;
}

.admin-switch-mode .nav-container {
    justify-content: space-between;
    gap: 24px;
}

.admin-switch-mode .logo {
    min-width: 240px;
    max-width: min(32vw, 360px);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.admin-switch-mode .nav-links {
    flex: 0 0 auto;
    min-width: 0;
    max-width: max-content;
    overflow-x: auto;
    scrollbar-width: none;
}

.admin-switch-mode .nav-links::-webkit-scrollbar {
    display: none;
}

.admin-switch-mode .nav-links a {
    flex: 0 0 auto;
    padding-left: 14px;
    padding-right: 14px;
}

.admin-switch-mode .user-actions {
    flex: 0 0 auto;
    min-width: 0;
    margin-left: auto;
    justify-content: flex-end;
    gap: 10px;
}

.admin-switch-notice {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
    max-width: none;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #ffeeba;
    background: #fff3cd;
    color: #856404;
    line-height: 1.35;
    white-space: nowrap;
    flex: 0 0 auto;
}

.admin-switch-notice span {
    display: none;
}

.admin-switch-notice a {
    color: #007AFF;
    font-weight: 700;
    padding: 0;
    border-radius: 0;
    flex-shrink: 0;
}

.admin-switch-notice a:hover {
    background: transparent;
    color: #0066CC;
}

.user-actions .admin-switch-notice a {
    padding: 0;
    border-radius: 0;
    color: #007AFF;
    font-weight: 700;
}

.user-actions .admin-switch-notice a:hover {
    background: transparent;
    color: #0066CC;
}

@media (min-width: 769px) {
    .admin-switch-mode .nav-links {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }

    .admin-switch-mode .user-actions {
        min-width: 240px;
    }
}

/* 主题切换按钮样式 */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(118, 118, 128, 0.12);
    border: none;
    border-radius: 10px;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--ios-text-secondary);
    gap: 4px;
}

.theme-toggle:hover {
    background: rgba(118, 118, 128, 0.2);
    color: var(--ios-text-primary);
}

[data-theme="dark"] .theme-toggle {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .theme-toggle:hover {
    background: rgba(255, 255, 255, 0.18);
}



.user-actions .theme-toggle {
    margin-right: 4px;
}

.user-actions a {
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.2s ease;
    color: var(--ios-text-secondary);
    border: none;
}

.user-actions a:hover {
    color: var(--ios-blue);
    background-color: rgba(59, 130, 246, 0.08);
}

.user-actions .user-nickname {
    font-weight: 600;
    color: var(--ios-text-primary);
    padding: 8px 12px;
}

.user-actions .user-nickname:hover {
    color: var(--ios-blue);
}

.user-actions .user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 12px;
    transition: all 0.2s ease;
    text-decoration: none;
    color: var(--ios-text-primary);
}

.user-actions .user-menu:hover {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .user-actions .user-menu:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-actions .user-menu .user-nickname {
    font-weight: 600;
}

.user-actions .user-menu .user-balance {
    font-size: 13px;
    color: var(--ios-text-secondary);
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
}

[data-theme="dark"] .user-actions .user-menu .user-balance {
    background: rgba(255, 255, 255, 0.1);
}

.user-actions .admin-link {
    color: var(--ios-orange);
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 10px;
    background: rgba(249, 115, 22, 0.1);
}

.user-actions .admin-link:hover {
    background: rgba(249, 115, 22, 0.2);
    color: var(--ios-orange);
}

.user-actions .btn-login {
    color: var(--ios-blue);
    font-weight: 600;
    background-color: transparent;
}

.user-actions .btn-login:hover {
    background-color: rgba(0, 122, 255, 0.1);
}

.user-actions .btn-register {
    background: var(--ios-blue);
    color: #FFFFFF !important;
    font-weight: 600;
    border-radius: 20px;
    padding: 8px 16px !important;
}

.user-actions .btn-register:hover {
    background: #0066CC;
    transform: scale(1.02);
}

/* 余额显示样式 */
.balance-display {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px !important;
    background: linear-gradient(135deg, #F59E0B, #D97706) !important;
    color: #FFFFFF !important;
    border: none !important;
    border-radius: 20px !important;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.balance-display:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4) !important;
    background: linear-gradient(135deg, #FBBF24, #F59E0B) !important;
    border-color: transparent !important;
    color: #FFFFFF !important;
}

.balance-display svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

/* Main Layout */
.main-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 24px;
    display: grid;
    gap: 48px;
    flex: 1;
    /* 让主内容区域占满剩余空间，将footer推到底部 */
    width: 100%;
}

/* Footer - Sticky Bottom */
footer,
.footer {
    margin-top: auto;
    /* 确保footer始终在底部 */
}

/* Carousel Section */
.hero-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.banner {
    width: 100%;
    height: 300px;
    background-color: var(--ios-gray);
    border-radius: var(--ios-radius);
    overflow: hidden;
    position: relative;
    box-shadow: var(--ios-shadow);
}

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

.banner-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
    color: white;
}

.banner-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.banner-desc {
    font-size: 16px;
    opacity: 0.9;
    max-width: 600px;
}

/* Section Title */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--ios-text-primary);
    letter-spacing: -0.5px;
}

.section-more {
    font-size: 15px;
    font-weight: 500;
    color: var(--ios-blue);
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.section-more:hover {
    opacity: 0.7;
}

.section-more::after {
    content: '→';
    font-size: 16px;
}

/* Grid Layouts */
.book-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    justify-content: start;
}

/* Book Card */
.book-card {
    background: var(--ios-card-bg);
    border-radius: var(--ios-radius);
    transition: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    padding: 6px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15), 0 5px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    position: relative;
    overflow: hidden;
    min-width: 0;
    transform: translateY(0);
    border: 1px solid var(--ios-border);
}

.book-card::before {
    display: none;
    /* 移除光效 */
}

.book-card:hover {
    /* 保持常驻状态，无变化 */
    transform: none;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15), 0 5px 15px rgba(0, 0, 0, 0.1);
}

.book-card:hover::before {
    opacity: 0;
}

.book-cover {
    width: 100%;
    aspect-ratio: 3/4;
    border-radius: 12px;
    overflow: hidden;
    /* 增强3D阴影效果 */
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.25), 0 5px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 12px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* 移除图片缩放过渡，或者保持 */
    transition: transform 0.35s ease;
}

.book-card:hover .book-cover img {
    /* 取消图片悬停缩放 */
    transform: none;
}

.book-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, var(--ios-orange), #FF6B35);
    color: white;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(255, 149, 0, 0.4);
    letter-spacing: 0.3px;
}

.book-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--ios-text-primary);
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    min-height: 24px;
    margin: -2px 0 10px;
}

.book-type-tag {
    max-width: 100%;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(0, 122, 255, 0.1);
    color: var(--ios-blue);
    border: 1px solid rgba(0, 122, 255, 0.16);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

[data-theme="dark"] .book-type-tag {
    background: rgba(10, 132, 255, 0.16);
    border-color: rgba(10, 132, 255, 0.28);
}

.book-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 12px;
}

.book-author {
    font-size: 15px;
    color: var(--ios-text-secondary);
    margin-bottom: 12px;
    font-weight: 500;
}

.book-author::before {
    content: '';
}

.book-desc {
    font-size: 12px;
    color: var(--ios-text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-read-btn {
    display: inline-block;
    padding: 6px 0;
    width: 66%;
    align-self: center;
    text-align: center;
    background: linear-gradient(135deg, var(--ios-blue), #0066CC);
    color: white;
    font-size: 13px;
    font-weight: 600;
    border-radius: 15px;
    margin-bottom: 12px;
    box-shadow: 0 4px 10px rgba(0, 122, 255, 0.3);
    transition: all 0.2s ease;
}

.book-read-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0, 122, 255, 0.4);
}

.book-latest {
    font-size: 13px;
    color: var(--ios-green);
    font-weight: 500;
    padding: 8px 12px;
    background-color: rgba(52, 199, 89, 0.1);
    border-radius: 8px;
    margin-top: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-theme="dark"] .book-latest {
    background-color: rgba(52, 199, 89, 0.15);
}

/* Author Application Entry */
.author-entry-section {
    width: 100%;
}

.author-entry-section-detail {
    margin-top: -34px;
    margin-bottom: -20px;
}

.author-entry-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 22px 24px;
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.08), rgba(52, 199, 89, 0.08));
    border: 1px solid rgba(0, 122, 255, 0.16);
    border-radius: 12px;
    box-shadow: var(--ios-shadow);
}

.author-entry-section-detail .author-entry-card {
    gap: 14px;
    padding: 16px 20px;
}

.author-entry-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ios-blue);
    background: var(--ios-card-bg);
    border: 1px solid var(--ios-separator);
    box-shadow: 0 8px 18px rgba(0, 122, 255, 0.12);
}

.author-entry-section-detail .author-entry-icon {
    width: 42px;
    height: 42px;
}

.author-entry-icon svg {
    width: 24px;
    height: 24px;
}

.author-entry-section-detail .author-entry-icon svg {
    width: 21px;
    height: 21px;
}

.author-entry-copy {
    min-width: 0;
}

.author-entry-kicker {
    display: block;
    margin-bottom: 4px;
    color: var(--ios-blue);
    font-size: 13px;
    line-height: 1.3;
    font-weight: 700;
}

.author-entry-title {
    margin: 0;
    color: var(--ios-text-primary);
    font-size: 22px;
    line-height: 1.3;
    font-weight: 800;
}

.author-entry-section-detail .author-entry-title {
    font-size: 20px;
}

.author-entry-desc {
    margin: 6px 0 0;
    color: var(--ios-text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

.author-entry-link {
    min-height: 44px;
    padding: 0 18px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #fff;
    background: linear-gradient(135deg, var(--ios-blue), #2563EB);
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 5px 14px rgba(0, 122, 255, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.author-entry-section-detail .author-entry-link {
    min-height: 40px;
    padding: 0 16px;
}

.author-entry-link:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 7px 18px rgba(0, 122, 255, 0.36);
}

.author-entry-link svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
}

[data-theme="dark"] .author-entry-card {
    background: linear-gradient(135deg, rgba(10, 132, 255, 0.16), rgba(48, 209, 88, 0.12));
    border-color: rgba(10, 132, 255, 0.28);
}

/* Ranking List */
.rank-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.rank-column {
    background: var(--ios-card-bg);
    border-radius: var(--ios-radius);
    padding: 20px;
    box-shadow: var(--ios-shadow);
}

.rank-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 0.5px solid var(--ios-gray);
}

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

.rank-number {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    margin-right: 16px;
    color: var(--ios-text-secondary);
    background-color: #F3F4F6;
    border-radius: 8px;
}

.rank-number.top-1 {
    color: #FFF;
    background: linear-gradient(135deg, #FFD700, #F59E0B);
}

.rank-number.top-2 {
    color: #FFF;
    background: linear-gradient(135deg, #9CA3AF, #4B5563);
}

.rank-number.top-3 {
    color: #FFF;
    background: linear-gradient(135deg, #FDBA74, #EA580C);
}

.rank-info {
    flex: 1;
}

.rank-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--ios-text-primary);
    margin-bottom: 2px;
}

.rank-meta {
    font-size: 12px;
    color: var(--ios-text-secondary);
}

/* Theme Toggle */
.theme-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--ios-text-secondary);
    padding: 8px 16px;
    border-radius: 10px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
}

.theme-toggle:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--ios-text-primary);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
}

[data-theme="dark"] .theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.theme-toggle.mobile-only {
    display: none;
}

/* Tags/Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    margin-right: 8px;
    letter-spacing: 0.3px;
}

.badge-blue {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.25));
    color: var(--ios-blue);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-orange {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.15), rgba(249, 115, 22, 0.25));
    color: var(--ios-orange);
    border: 1px solid rgba(249, 115, 22, 0.3);
}

/* ========================================
   自定义弹窗组件样式
   ======================================== */

/* 弹窗遮罩层 */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-modal-overlay.show {
    opacity: 1;
}

/* 弹窗容器 */
.custom-modal {
    background: var(--ios-card-bg);
    border-radius: 20px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.custom-modal.show {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* 弹窗内容 */
.custom-modal-content {
    text-align: center;
}

/* 弹窗图标 */
.custom-modal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.2));
    color: var(--ios-blue);
}

.custom-modal-icon-warning {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.1), rgba(249, 115, 22, 0.2));
    color: var(--ios-orange);
}

.custom-modal-icon-input {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.2));
    color: var(--ios-green);
}

/* 弹窗消息 */
.custom-modal-message {
    font-size: 16px;
    line-height: 1.6;
    color: var(--ios-text-primary);
    margin-bottom: 24px;
    word-break: break-word;
}

/* 弹窗输入框 */
.custom-modal-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--ios-separator);
    border-radius: 12px;
    font-size: 16px;
    color: var(--ios-text-primary);
    background: var(--ios-bg-color);
    outline: none;
    transition: all 0.2s ease;
    margin-bottom: 24px;
}

.custom-modal-input:focus {
    border-color: var(--ios-blue);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

[data-theme="dark"] .custom-modal-input {
    background: #374151;
    border-color: #4B5563;
}

[data-theme="dark"] .custom-modal-input:focus {
    border-color: var(--ios-blue);
}

/* 弹窗按钮容器 */
.custom-modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* 弹窗按钮 */
.custom-modal-btn {
    padding: 12px 28px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
    min-width: 100px;
}

.custom-modal-btn-primary {
    background: linear-gradient(135deg, var(--ios-blue), #2563EB);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.custom-modal-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.45);
}

.custom-modal-btn-primary:active {
    transform: translateY(0);
}

.custom-modal-btn-secondary {
    background: var(--ios-bg-color);
    color: var(--ios-text-secondary);
    border: 2px solid var(--ios-separator);
}

.custom-modal-btn-secondary:hover {
    background: var(--ios-separator);
    color: var(--ios-text-primary);
}

[data-theme="dark"] .custom-modal-btn-secondary {
    background: #374151;
    border-color: #4B5563;
}

[data-theme="dark"] .custom-modal-btn-secondary:hover {
    background: #4B5563;
}

/* ========================================
   Toast 通知样式
   ======================================== */

.custom-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.custom-toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--ios-card-bg);
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: auto;
    border-left: 4px solid var(--ios-blue);
}

.custom-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.custom-toast-success {
    border-left-color: var(--ios-green);
}

.custom-toast-success .custom-toast-icon {
    color: var(--ios-green);
}

.custom-toast-error {
    border-left-color: var(--ios-red);
}

.custom-toast-error .custom-toast-icon {
    color: var(--ios-red);
}

.custom-toast-warning {
    border-left-color: var(--ios-orange);
}

.custom-toast-warning .custom-toast-icon {
    color: var(--ios-orange);
}

.custom-toast-info {
    border-left-color: var(--ios-blue);
}

.custom-toast-info .custom-toast-icon {
    color: var(--ios-blue);
}

.custom-toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.custom-toast-message {
    font-size: 14px;
    font-weight: 500;
    color: var(--ios-text-primary);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .search-bar {
        display: none;
    }

    /* 移动端 header 优化 - Mac风格毛玻璃 */
    .header {
        height: 72px;
        padding: 0 16px;
        background: rgba(255, 255, 255, 0.72);
        backdrop-filter: saturate(180%) blur(20px);
        -webkit-backdrop-filter: saturate(180%) blur(20px);
        border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
        box-shadow: 0 0.5px 0 rgba(255, 255, 255, 0.5) inset,
            0 1px 3px rgba(0, 0, 0, 0.02);
    }

    [data-theme="dark"] .header {
        background: rgba(28, 28, 30, 0.78);
        border-bottom: 0.5px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 0.5px 0 rgba(255, 255, 255, 0.05) inset,
            0 1px 3px rgba(0, 0, 0, 0.1);
    }

    body {
        padding-top: 72px;
    }

    /* 显示顶部导航链接 - 与PC端统一 - 居中更显眼 */
    .nav-links {
        display: flex;
        min-width: 0;
        background: rgba(118, 118, 128, 0.12);
        padding: 5px;
        gap: 4px;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        border: 1px solid rgba(0, 0, 0, 0.04);
    }

    [data-theme="dark"] .nav-links {
        background: rgba(118, 118, 128, 0.24);
        border-color: rgba(255, 255, 255, 0.06);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }

    .nav-links a {
        flex: 0 0 auto;
        white-space: nowrap;
        line-height: 1;
        padding: 8px 16px;
        font-size: 15px;
        font-weight: 600;
        border-radius: 8px;
        color: var(--ios-text-secondary);
        transition: all 0.2s ease;
        letter-spacing: -0.1px;
        border: 1px solid transparent;
    }

    .nav-links a.active {
        background: var(--ios-card-bg);
        color: var(--ios-text-primary);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    }

    /* 移动端导航链接不同颜色 - 更显眼 */
    .nav-links a[data-nav="home"].active {
        color: #007AFF;
        background: linear-gradient(135deg, rgba(0, 122, 255, 0.18), rgba(0, 122, 255, 0.1));
        border-color: rgba(0, 122, 255, 0.3);
        box-shadow: 0 2px 8px rgba(0, 122, 255, 0.2);
    }

    .nav-links a[data-nav="bookshelf"].active {
        color: #34C759;
        background: linear-gradient(135deg, rgba(52, 199, 89, 0.18), rgba(52, 199, 89, 0.1));
        border-color: rgba(52, 199, 89, 0.3);
        box-shadow: 0 2px 8px rgba(52, 199, 89, 0.2);
    }

    .nav-links a[data-nav="profile"].active {
        color: #FF9500;
        background: linear-gradient(135deg, rgba(255, 149, 0, 0.18), rgba(255, 149, 0, 0.1));
        border-color: rgba(255, 149, 0, 0.3);
        box-shadow: 0 2px 8px rgba(255, 149, 0, 0.2);
    }

    .nav-links a[data-nav="author"].active {
        color: #AF52DE;
        background: linear-gradient(135deg, rgba(175, 82, 222, 0.18), rgba(175, 82, 222, 0.1));
        border-color: rgba(175, 82, 222, 0.3);
        box-shadow: 0 2px 8px rgba(175, 82, 222, 0.2);
    }

    /* 当导航项较多时（4个），缩小字体和间距避免挤占 */
    .nav-links:has(a[data-nav="author"]) a {
        padding: 8px 10px;
        font-size: 13px;
    }

    /* 移动端 User Actions - 只显示必要的按钮 */
    .user-actions {
        display: flex;
        gap: 6px;
    }

    /* 隐藏余额和用户名，只保留按钮 */
    .user-actions .balance-display,
    .user-actions .user-nickname,
    .user-actions a:not(.theme-toggle):not(.btn-login):not(.btn-register) {
        display: none;
    }

    /* 隐藏按钮文字，只保留图标 */
    .theme-toggle-text {
        display: none !important;
    }

    /* 紧凑的按钮样式 - 优化移动端主题按钮外观 */
    .user-actions .theme-toggle {
        display: flex !important;
        padding: 6px 12px;
        border-radius: 10px;
        background: rgba(118, 118, 128, 0.08);
        margin-left: 4px;
        transition: all 0.2s ease;
    }

    .user-actions .theme-toggle:active {
        background: rgba(118, 118, 128, 0.15);
    }

    [data-theme="dark"] .user-actions .theme-toggle {
        background: rgba(255, 255, 255, 0.1);
    }


    /* 隐藏汉堡菜单按钮 */
    .mobile-menu-btn {
        display: none;
    }

    /* Logo 样式优化 */
    .logo {
        font-size: 0;
        padding: 4px;
        border-radius: 8px;
        transition: background 0.2s ease;
    }

    .logo:hover,
    .logo:active {
        background: rgba(0, 0, 0, 0.04);
    }

    [data-theme="dark"] .logo:hover,
    [data-theme="dark"] .logo:active {
        background: rgba(255, 255, 255, 0.08);
    }

    .logo img {
        margin-right: 0;
        height: 32px !important;
        width: 32px !important;
        border-radius: 50%;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }

    /* 主题切换按钮优化 */
    .theme-toggle.mobile-only {
        display: flex;
        margin-right: 0;
        margin-left: 8px;
        width: auto;
        height: auto;
        padding: 6px 12px;
        border-radius: 10px;
        background: rgba(118, 118, 128, 0.08);
        transition: all 0.2s ease;
    }

    .theme-toggle.mobile-only:hover,
    .theme-toggle.mobile-only:active {
        background: rgba(118, 118, 128, 0.15);
    }

    [data-theme="dark"] .theme-toggle.mobile-only {
        background: rgba(255, 255, 255, 0.1);
    }

    [data-theme="dark"] .theme-toggle.mobile-only:hover,
    [data-theme="dark"] .theme-toggle.mobile-only:active {
        background: rgba(255, 255, 255, 0.18);
    }

    .theme-toggle.mobile-only svg {
        width: 18px;
        height: 18px;
    }


    .nav-container {
        padding: 0;
        gap: 12px;
    }

    .banner {
        height: 180px;
        margin-bottom: 24px;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    }

    .banner-content {
        padding: 16px;
    }

    .banner-title {
        font-size: 20px;
    }

    .banner-desc {
        font-size: 13px;
        line-height: 1.4;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .book-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        padding: 0 8px;
        justify-content: center;
    }

    .book-card {
        width: 100%;
        max-width: 400px;
        min-width: 160px;
        padding: 14px;
        flex-shrink: 0;
        margin: 0 auto;
    }

    /* 单本书时更大 */
    .book-grid .book-card:only-child {
        width: 100%;
        max-width: 400px;
    }

    .book-card .book-cover {
        margin-bottom: 12px;
        aspect-ratio: 3/4;
    }

    .book-card .book-title {
        font-size: 17px;
        margin-bottom: 8px;
    }

    .book-card .book-author {
        font-size: 14px;
        margin-bottom: 10px;
    }

    .book-card .book-latest {
        font-size: 13px;
        padding: 8px 10px;
        margin-top: 10px;
    }

    .author-entry-card {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
        gap: 14px;
        padding: 20px 18px;
    }

    .author-entry-title {
        font-size: 20px;
    }

    .author-entry-desc {
        font-size: 13px;
    }

    .author-entry-link {
        width: 100%;
        min-height: 46px;
    }

    .author-entry-section-detail {
        margin-top: -28px;
        margin-bottom: -18px;
    }

    .author-entry-section-detail .author-entry-card {
        grid-template-columns: auto minmax(0, 1fr) auto;
        justify-items: stretch;
        text-align: left;
        gap: 12px;
        padding: 14px 16px;
    }

    .author-entry-section-detail .author-entry-icon {
        width: 38px;
        height: 38px;
    }

    .author-entry-section-detail .author-entry-title {
        font-size: 18px;
    }

    .author-entry-section-detail .author-entry-desc {
        margin-top: 4px;
        line-height: 1.5;
    }

    .author-entry-section-detail .author-entry-link {
        width: auto;
        min-height: 38px;
        padding: 0 14px;
        font-size: 14px;
    }

    /* 移动端禁用悬停效果 */
    .book-card:hover {
        transform: none;
        box-shadow: var(--ios-shadow);
    }

    .book-card:hover::before {
        opacity: 0;
    }

    .book-card:hover .book-cover img {
        transform: none;
    }

    .rank-section {
        grid-template-columns: 1fr;
    }

    .section-header {
        margin-bottom: 16px;
    }

    .section-title {
        font-size: 20px;
    }

    /* 弹窗响应式 */
    .custom-modal {
        padding: 24px;
        margin: 16px;
    }

    .custom-modal-buttons {
        flex-direction: column-reverse;
    }

    .custom-modal-btn {
        width: 100%;
    }

    /* Toast 响应式 */
    .custom-toast-container {
        left: 16px;
        right: 16px;
        top: auto;
        bottom: 20px;
    }

    .custom-toast {
        transform: translateY(120%);
    }

    .custom-toast.show {
        transform: translateY(0);
    }
}

@media (max-width: 560px) {
    .author-entry-section-detail {
        margin-top: -24px;
        margin-bottom: -14px;
    }

    .author-entry-section-detail .author-entry-card {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
        gap: 9px;
        padding: 14px;
    }

    .author-entry-section-detail .author-entry-kicker {
        margin-bottom: 2px;
    }

    .author-entry-section-detail .author-entry-title {
        font-size: 17px;
    }

    .author-entry-section-detail .author-entry-desc {
        line-height: 1.45;
    }

    .author-entry-section-detail .author-entry-link {
        width: 100%;
    }
}

/* ========================================
   客服泡泡组件样式
   ======================================== */

.customer-service-bubble {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
}

.cs-bubble-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.cs-bubble-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(16, 185, 129, 0.5);
}

.cs-bubble-btn:active {
    transform: scale(0.95);
}

.cs-bubble-btn svg {
    width: 28px;
    height: 28px;
    color: white;
    transition: transform 0.3s ease;
}

.cs-bubble-btn.active svg {
    transform: rotate(45deg);
}

/* 客服选项菜单 */
.cs-menu {
    position: absolute;
    bottom: 70px;
    right: 0;
    background: var(--ios-card-bg, #fff);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    padding: 8px;
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.95);
    transform-origin: bottom right;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cs-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.cs-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--ios-text-primary, #1C1C1E);
    transition: all 0.2s ease;
    cursor: pointer;
}

.cs-menu-item:hover {
    background: rgba(102, 126, 234, 0.1);
}

.cs-menu-item:active {
    background: rgba(102, 126, 234, 0.2);
}

.cs-menu-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.cs-menu-icon.email {
    background: linear-gradient(135deg, #FF6B6B, #EE5A24);
}

.cs-menu-icon.telegram {
    background: linear-gradient(135deg, #0088cc, #229ED9);
}

.cs-menu-icon.twitter {
    background: linear-gradient(135deg, #111827, #000);
    color: #fff;
}

.cs-menu-info {
    flex: 1;
    min-width: 0;
}

.cs-menu-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--ios-text-primary, #1C1C1E);
    margin-bottom: 2px;
}

.cs-menu-desc {
    font-size: 12px;
    color: var(--ios-text-secondary, #8E8E93);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cs-menu-arrow {
    color: var(--ios-text-secondary, #8E8E93);
    flex-shrink: 0;
}

/* 深色模式 */
[data-theme="dark"] .cs-menu {
    background: #2C2C2E;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .cs-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .customer-service-bubble {
        bottom: 16px;
        right: 16px;
    }

    .cs-bubble-btn {
        width: 50px;
        height: 50px;
    }

    .cs-bubble-btn svg {
        width: 24px;
        height: 24px;
    }

    .cs-menu {
        bottom: 60px;
        min-width: 200px;
    }

    .cs-menu-item {
        padding: 12px 14px;
    }

    .cs-menu-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
}

/* ========================================
   简化的交互过渡效果
   ======================================== */

/* 排行榜项悬停效果 */
.rank-item {
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.rank-item:hover {
    background-color: rgba(0, 122, 255, 0.05);
    border-radius: 12px;
    transform: translateX(4px);
}

[data-theme="dark"] .rank-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* 主题切换按钮效果 */
.theme-toggle svg {
    transition: transform 0.3s ease;
}

.theme-toggle:hover svg {
    transform: rotate(15deg) scale(1.1);
}

/* 深色模式切换平滑过渡 */
body,
.header,
.main-container,
.book-card,
.rank-column,
.nav-links,
.cs-menu {
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.section-title,
.book-title,
.book-author,
.rank-title,
.rank-meta,
.nav-links a {
    transition: color 0.3s ease;
}

/* 移动端菜单过渡 */
.mobile-menu {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-overlay {
    transition: opacity 0.3s ease;
}

/* 客服菜单过渡 */
.cs-menu {
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
}

/* 弹窗过渡 - 简化版 */
.custom-modal {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}

.custom-modal-overlay {
    transition: opacity 0.25s ease;
}

/* 弹窗关闭动画 */
.custom-modal-overlay.closing {
    opacity: 0;
}

.custom-modal.closing {
    transform: scale(0.95) translateY(10px);
    opacity: 0;
}

/* Toast过渡 - 简化版 */
.custom-toast {
    transition: transform 0.3s ease, opacity 0.25s ease;
}

/* 减少动画偏好支持 */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


/* ========================================
   搜索功能样式
   ======================================== */

/* 搜索区域容器 */
.search-section {
    width: 100%;
    margin-bottom: 32px;
}

/* 搜索框容器 */
.search-box-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

/* 搜索框 */
.search-input-main {
    width: 100%;
    padding: 16px 56px 16px 24px;
    font-size: 16px;
    border: 2px solid var(--ios-separator);
    border-radius: 16px;
    background: var(--ios-card-bg);
    color: var(--ios-text-primary);
    outline: none;
    transition: all 0.3s ease;
    box-shadow: var(--ios-shadow);
}

.search-input-main::placeholder {
    color: var(--ios-text-secondary);
}

.search-input-main:focus {
    border-color: var(--ios-blue);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.15);
}

/* 搜索按钮 */
.search-button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--ios-blue), #2563EB);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.search-button:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.search-button svg {
    width: 20px;
    height: 20px;
}

/* 搜索结果区域 */
.search-results-section {
    margin-top: 32px 0;
}

.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.search-results-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--ios-text-primary);
}

.search-results-count {
    font-size: 14px;
    color: var(--ios-text-secondary);
}

/* 搜索结果为空 */
.search-no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--ios-text-secondary);
}

.search-no-results svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.search-no-results p {
    font-size: 16px;
}

/* 搜索结果网格 */
.search-results-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

/* 响应式 - 搜索功能 */
@media (max-width: 1024px) {
    .search-results-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .search-section {
        margin-bottom: 24px;
    }

    .search-input-main {
        padding: 14px 52px 14px 20px;
        font-size: 15px;
    }

    .search-button {
        width: 40px;
        height: 40px;
        right: 6px;
    }

    .search-button svg {
        width: 18px;
        height: 18px;
    }

    .search-results-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .search-results-title {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .search-results-grid {
        grid-template-columns: 1fr;
    }
}

/* 深色模式适配 */
[data-theme="dark"] .search-input-main {
    background: #374151;
    border-color: rgba(84, 84, 88, 0.65);
}

[data-theme="dark"] .search-input-main:focus {
    border-color: var(--ios-blue);
}


/* 登录注册按钮样式 */
.btn-login,
.btn-register {
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.btn-login {
    color: var(--ios-text-primary);
    background: transparent;
}

.btn-login:hover {
    background: rgba(118, 118, 128, 0.12);
}

.btn-register {
    color: #fff !important;
    background: #007AFF;
    margin-left: 8px;
}

.btn-register:hover {
    background: #0062cc;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

[data-theme="dark"] .btn-login:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* 移动端适配 */
@media (max-width: 768px) {

    /* 移动端登录注册按钮适配 */
    .btn-login,
    .btn-register {
        padding: 5px 10px;
        font-size: 13px;
        border-radius: 14px;
    }

    .btn-register {
        margin-left: 4px;
    }

    /* 移动端左侧导航布局重构 - 导航响应式分布 */
    .nav-container {
        justify-content: space-between;
        gap: 4px;
        position: relative;
    }

    .logo {
        position: relative;
        left: auto;
        margin-right: 0;
        flex-shrink: 0;
    }

    .user-actions {
        position: relative;
        right: auto;
        margin-left: 0;
        flex-shrink: 0;
    }


    /* 移动端隐藏头部多余信息，腾出空间给按钮 */
    /* 只隐藏余额，保留用户昵称（仅显示图标） */
    .user-actions .balance-display,
    .user-actions .user-menu,
    .theme-toggle-text {
        display: none !important;
    }

    /* 移动端用户昵称样式 - 只显示图标 */
    .user-actions .user-nickname {
        display: flex !important;
        padding: 6px;
        margin-left: 4px;
        align-items: center;
    }

    .user-actions .user-nickname .user-name-text {
        display: none;
    }

    .user-actions .user-nickname svg {
        margin-right: 0 !important;
        width: 20px;
        height: 20px;
    }

    .user-actions {
        flex-shrink: 0;
    }

    .admin-switch-mode .nav-container {
        gap: 6px;
    }

    .admin-switch-mode .logo {
        max-width: 120px;
    }

    .admin-switch-mode .user-actions {
        flex: 0 0 auto;
        gap: 6px;
    }

    .admin-switch-notice {
        min-width: 0;
        max-width: none;
        padding: 6px 10px;
        font-size: 13px;
        flex: 0 0 auto;
    }

    .admin-switch-notice span {
        display: none;
    }

    .nav-links {
        flex: 1 1 auto;
        min-width: 0;
        flex-shrink: 1;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        /* Hide scrollbar for cleaner look */
    }

    .nav-links::-webkit-scrollbar {
        display: none;
    }


}


/* ===== 小屏幕手机优化 (< 420px) ===== */
@media (max-width: 420px) {

    /* 顶部导航更紧凑 */
    .header {
        padding: 0 8px;
        height: 72px;
    }

    body {
        padding-top: 72px;
    }

    .nav-container {
        gap: 6px;
    }

    /* Logo 更小 */
    .logo {
        left: 6px;
    }

    .logo img {
        height: 28px !important;
        width: 28px !important;
    }

    /* 导航链接与PC端统一 - 居中更显眼 */
    .nav-links {
        padding: 4px;
        gap: 3px;
        border-radius: 10px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    }

    .nav-links a {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 7px 10px;
        font-size: 14px;
        font-weight: 600;
        border-radius: 7px;
    }

    /* 主题按钮与PC端统一 */
    .theme-toggle.mobile-only {
        padding: 6px 12px;
        border-radius: 8px;
    }

    .theme-toggle.mobile-only svg {
        width: 18px;
        height: 18px;
    }
}

/* ===== 超小屏幕手机优化 (< 360px) ===== */
@media (max-width: 360px) {
    .header {
        padding: 0 6px;
    }

    .logo {
        left: 4px;
    }

    .user-actions {
        right: 4px;
    }

    .nav-links {
        padding: 3px;
        gap: 2px;
    }

    .nav-links a {
        padding: 6px 9px;
        font-size: 12px;
        font-weight: 600;
    }

    .theme-toggle.mobile-only {
        padding: 5px 10px;
    }
}

/* Desktop specific styles */
@media (min-width: 769px) {}

/* ========================================
   APK 下载推广弹窗
   ======================================== */

.apk-promo-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.apk-promo-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.apk-promo-overlay.closing {
    opacity: 0;
    pointer-events: none;
}

.apk-promo-modal {
    background: var(--ios-card-bg);
    border-radius: 24px;
    padding: 36px 28px 28px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.08);
    transform: scale(0.85) translateY(30px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
}

.apk-promo-overlay.show .apk-promo-modal {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.apk-promo-overlay.closing .apk-promo-modal {
    transform: scale(0.9) translateY(20px);
    opacity: 0;
}

.apk-promo-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    background: linear-gradient(135deg, #34C759, #30D158);
    color: #fff;
    box-shadow: 0 8px 24px rgba(52, 199, 89, 0.35);
}

.apk-promo-icon svg {
    width: 36px;
    height: 36px;
}

.apk-promo-content {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.apk-promo-line1 {
    font-size: 15px;
    font-weight: 600;
    color: var(--ios-text-primary);
    line-height: 1.65;
    margin-bottom: 12px;
}

.apk-promo-line2 {
    font-size: 13px;
    font-weight: 500;
    color: var(--ios-orange);
    line-height: 1.6;
    background: rgba(255, 149, 0, 0.08);
    border: 1px solid rgba(255, 149, 0, 0.15);
    border-radius: 10px;
    padding: 10px 14px;
}

[data-theme="dark"] .apk-promo-line2 {
    background: rgba(255, 149, 0, 0.12);
    border-color: rgba(255, 149, 0, 0.2);
}

.apk-promo-line-green {
    color: #22c55e !important;
    font-weight: 700;
    background: rgba(34, 197, 94, 0.08) !important;
    border-color: rgba(34, 197, 94, 0.2) !important;
}

[data-theme="dark"] .apk-promo-line-green {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.25);
}

.apk-promo-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.apk-promo-btn-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    background: linear-gradient(135deg, #34C759, #30B350);
    color: #fff !important;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 6px 20px rgba(52, 199, 89, 0.35);
    text-decoration: none;
}

.apk-promo-btn-download svg {
    width: 20px;
    height: 20px;
}

.apk-promo-btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(52, 199, 89, 0.45);
    background: linear-gradient(135deg, #30D158, #34C759);
}

.apk-promo-btn-download:active {
    transform: translateY(0);
}

.apk-promo-btn-dismiss {
    padding: 12px 28px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--ios-blue), #2563EB);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.apk-promo-btn-dismiss:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 122, 255, 0.4);
    background: linear-gradient(135deg, #2563EB, var(--ios-blue));
}

[data-theme="dark"] .apk-promo-btn-dismiss {
    background: linear-gradient(135deg, var(--ios-blue), #2563EB);
}

[data-theme="dark"] .apk-promo-btn-dismiss:hover {
    background: linear-gradient(135deg, #2563EB, var(--ios-blue));
}

@media (max-width: 480px) {
    .apk-promo-modal {
        padding: 28px 20px 20px;
        border-radius: 20px;
        width: 92%;
    }

    .apk-promo-icon {
        width: 60px;
        height: 60px;
        border-radius: 16px;
    }

    .apk-promo-icon svg {
        width: 30px;
        height: 30px;
    }

    .apk-promo-line1 {
        font-size: 14px;
    }

    .apk-promo-line2 {
        font-size: 12px;
    }

    .apk-promo-btn-download {
        padding: 12px 24px;
        font-size: 15px;
    }
}
