/* ==================== 基础样式重置 ==================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 主题色 */
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --accent: #f59e0b;
    
    /* 背景色 */
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #252542;
    --bg-card: rgba(255, 255, 255, 0.03);
    
    /* 文字色 */
    --text-primary: #c0c0c0;
    --text-secondary: rgba(255, 255, 255, 0.55);
    --text-tertiary: rgba(255, 255, 255, 0.4);
    --text-muted: rgba(255, 255, 255, 0.3);
    
    /* 边框和阴影 */
    --border: rgba(255, 255, 255, 0.1);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.3);
    
    /* 字体 */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-serif: 'Noto Serif SC', Georgia, serif;
    
    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    
    /* 过渡 */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* 浅色模式 */
[data-theme="light"] {
    --bg-primary: #fafafa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f0f0f5;
    --bg-card: rgba(0, 0, 0, 0.02);
    --text-primary: #1a1a2e;
    --text-secondary: rgba(26, 26, 46, 0.7);
    --text-tertiary: rgba(26, 26, 46, 0.5);
    --text-muted: rgba(26, 26, 46, 0.4);
    --border: rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.1);
}

/* 护眼模式 */
[data-theme="sepia"] {
    --bg-primary: #f5f0e6;
    --bg-secondary: #faf6ed;
    --bg-tertiary: #ebe5d8;
    --text-primary: #433422;
    --text-secondary: rgba(67, 52, 34, 0.75);
    --border: rgba(67, 52, 34, 0.15);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ==================== 导航栏 ==================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(15, 15, 26, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.25rem;
}

.logo-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.5));
}

.logo-text {
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-links a {
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-toggle,
.menu-toggle {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
}

.theme-toggle:hover,
.menu-toggle:hover {
    background: var(--primary);
    color: white;
}

/* 导航栏主题切换按钮 */
.theme-toggle .theme-icon {
    width: auto;
    height: auto;
    border-radius: 0;
    margin: 0;
    border: none;
    font-size: 1.25rem;
    line-height: 1;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
}

.menu-toggle span {
    width: 20px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
}

/* ==================== 英雄区域 ==================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px 24px 80px;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse at 20% 80%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(236, 72, 153, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(245, 158, 11, 0.05) 0%, transparent 70%);
}

.hero-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.hero-particles::before,
.hero-particles::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: float 20s ease-in-out infinite;
}

.hero-particles::before {
    background: var(--primary);
    top: 20%;
    left: 10%;
}

.hero-particles::after {
    background: var(--secondary);
    bottom: 20%;
    right: 10%;
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 80px;
    align-items: center;
}

/* 书本展示 */
.book-showcase {
    perspective: 1000px;
    display: flex;
    justify-content: center;
}

.book-cover {
    position: relative;
    width: 280px;
    height: 400px;
    transform-style: preserve-3d;
    transform: rotateY(-15deg) rotateX(5deg);
    transition: transform 0.5s ease;
    animation: bookFloat 6s ease-in-out infinite;
}

.book-cover:hover {
    transform: rotateY(-5deg) rotateX(0deg) scale(1.02);
}

@keyframes bookFloat {
    0%, 100% { transform: rotateY(-15deg) rotateX(5deg) translateY(0); }
    50% { transform: rotateY(-15deg) rotateX(5deg) translateY(-10px); }
}

.book-spine {
    position: absolute;
    left: 0;
    width: 40px;
    height: 100%;
    background: linear-gradient(90deg, #1a1a3e, #2a2a5e);
    transform: rotateY(-90deg) translateZ(20px);
    border-radius: 4px 0 0 4px;
}

.book-front {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #1a1a3e 0%, #2d2d5a 50%, #1a1a3e 100%);
    border-radius: 4px 12px 12px 4px;
    overflow: hidden;
    box-shadow: 
        inset 0 0 60px rgba(99, 102, 241, 0.2),
        0 20px 60px rgba(0, 0, 0, 0.5);
}

.cover-art {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cover-bg {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 30% 70%, rgba(99, 102, 241, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 70% 30%, rgba(236, 72, 153, 0.2) 0%, transparent 50%);
}

.cover-sword {
    font-size: 120px;
    filter: drop-shadow(0 0 30px rgba(99, 102, 241, 0.8));
    animation: swordGlow 3s ease-in-out infinite;
}

@keyframes swordGlow {
    0%, 100% { filter: drop-shadow(0 0 30px rgba(99, 102, 241, 0.8)); }
    50% { filter: drop-shadow(0 0 50px rgba(99, 102, 241, 1)); }
}

.cover-effects {
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M50 10 L90 90 L10 90 Z' fill='none' stroke='rgba(255,255,255,0.03)' stroke-width='1'/%3E%3C/svg%3E");
    opacity: 0.5;
}

.cover-title {
    position: absolute;
    bottom: 60px;
    left: 0;
    right: 0;
    text-align: center;
    padding: 0 20px;
}

.cover-title h1 {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, #a5a5ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.cover-title h2 {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
    letter-spacing: 0.5em;
}

.cover-author {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.5);
}

.book-shadow {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 40px;
    background: radial-gradient(ellipse, rgba(0,0,0,0.4) 0%, transparent 70%);
    filter: blur(20px);
}

/* 英雄信息 */
.hero-info {
    max-width: 600px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.2), rgba(245, 158, 11, 0.2));
    border: 1px solid rgba(236, 72, 153, 0.3);
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--secondary);
    margin-bottom: 24px;
}

.hero-title {
    font-family: var(--font-serif);
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--text-primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.hero-description {
    font-size: 1.125rem;
    color: var(--text-tertiary);
    line-height: 1.8;
    margin-bottom: 32px;
}

.hero-stats {
    display: flex;
    gap: 40px;
    margin-bottom: 40px;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.hero-actions {
    display: flex;
    gap: 16px;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card);
    border-color: var(--primary);
}

.btn-icon {
    width: 20px;
    height: 20px;
}

/* ==================== 章节列表 ==================== */
.latest-chapters {
    padding: 100px 0;
    background: var(--bg-secondary);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
}

.section-title.center {
    justify-content: center;
}

.title-icon {
    font-size: 1.5rem;
}

.view-all {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-light);
    font-weight: 500;
    transition: gap var(--transition-fast);
}

.view-all:hover {
    gap: 12px;
}

.view-all svg {
    width: 18px;
    height: 18px;
}

.chapters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.chapter-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    cursor: pointer;
}

.chapter-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.chapter-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.chapter-info {
    flex: 1;
    min-width: 0;
}

.chapter-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chapter-desc {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.chapter-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.chapter-status {
    padding: 2px 8px;
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-light);
    border-radius: 100px;
}

/* ==================== 故事简介 ==================== */
.story-intro {
    padding: 100px 0;
    background: var(--bg-primary);
}

.intro-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.intro-block {
    margin-bottom: 32px;
}

.intro-block h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.intro-block p {
    color: var(--text-secondary);
    line-height: 1.8;
}

.intro-visual {
    display: flex;
    justify-content: center;
}

.world-map {
    position: relative;
    width: 400px;
    height: 300px;
}

.map-region {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    animation: fadeInUp 0.6s ease forwards;
    animation-delay: var(--delay);
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.map-region:nth-child(1) { top: 20%; left: 20%; }
.map-region:nth-child(2) { top: 50%; left: 10%; }
.map-region:nth-child(3) { top: 30%; right: 20%; }
.map-region:nth-child(4) { bottom: 20%; right: 30%; }

.region-icon {
    font-size: 2rem;
    filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.5));
}

.region-name {
    font-size: 0.875rem;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 4px 12px;
    border-radius: 100px;
}

.map-line {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 200px;
    border: 2px dashed var(--border);
    border-radius: 50%;
    opacity: 0.3;
}

/* ==================== 角色展示 ==================== */
.characters {
    padding: 100px 0;
    background: var(--bg-secondary);
}

.characters-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 40px;
}

.character-card {
    text-align: center;
    padding: 40px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
}

.character-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.character-avatar {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
}

.avatar-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, 
        hsl(calc(var(--hue, 250) + 20), 70%, 60%), 
        hsl(calc(var(--hue, 250) - 20), 70%, 50%));
    border-radius: 50%;
    filter: blur(20px);
    opacity: 0.5;
}

.avatar-icon {
    position: relative;
    font-size: 3rem;
    line-height: 100px;
}

.character-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.character-role {
    font-size: 0.875rem;
    color: var(--primary-light);
    margin-bottom: 16px;
}

.character-desc {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ==================== 页脚 ==================== */
.footer {
    padding: 60px 0 40px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border);
}

.footer-content {
    text-align: center;
}

.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 12px;
}

.footer-desc {
    color: var(--text-tertiary);
    margin-bottom: 24px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 24px;
}

.footer-links a {
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--primary-light);
}

.footer-copyright {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr;
        gap: 60px;
        text-align: center;
    }
    
    .book-showcase {
        order: -1;
    }
    
    .hero-stats {
        justify-content: center;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .intro-content {
        grid-template-columns: 1fr;
        gap: 60px;
    }
    
    .characters-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        flex-direction: column;
        padding: 20px;
        gap: 0;
        border-bottom: 1px solid var(--border);
        z-index: 999;
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .nav-links a {
        padding: 16px;
        border-bottom: 1px solid var(--border);
    }
    
    .nav-links a:last-child {
        border-bottom: none;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-stats {
        flex-wrap: wrap;
        gap: 24px;
    }
    
    .hero-actions {
        flex-direction: column;
    }
    
    .chapters-grid {
        grid-template-columns: 1fr;
    }
    
    .characters-grid {
        grid-template-columns: 1fr;
    }
    
    .world-map {
        width: 100%;
        max-width: 300px;
    }
}

/* ==================== 章节列表页面 ==================== */
.chapters-page {
    padding-top: 72px;
}

/* 章节头部 */
.chapters-header {
    padding: 60px 0 40px;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-bottom: 1px solid var(--border);
}

.chapters-header-content {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 32px;
}

.book-mini {
    flex-shrink: 0;
}

.mini-cover {
    width: 80px;
    height: 110px;
    background: linear-gradient(135deg, #1a1a3e, #2d2d5a);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.chapters-title h1 {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.chapters-title p {
    color: var(--text-tertiary);
    font-size: 1rem;
}

/* 阅读进度 */
.reading-progress {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px 24px;
}

.progress-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 100px;
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* 章节筛选 */
.chapters-list {
    padding: 40px 0 80px;
}

.chapters-filter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.filter-tabs {
    display: flex;
    gap: 8px;
}

.filter-tab {
    padding: 10px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.filter-tab:hover {
    border-color: var(--primary);
    color: var(--text-primary);
}

.filter-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* 搜索框 */
.search-box {
    position: relative;
    width: 280px;
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9375rem;
    transition: all var(--transition-fast);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-muted);
}

/* 时间线章节列表 */
.chapters-timeline {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.timeline-item {
    display: flex;
    gap: 20px;
    position: relative;
}

.timeline-marker {
    width: 16px;
    height: 16px;
    background: var(--bg-tertiary);
    border: 3px solid var(--primary);
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 24px;
    position: relative;
}

.timeline-marker::before {
    content: '';
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: calc(100% + 16px);
    background: var(--border);
}

.timeline-item:last-child .timeline-marker::before,
.timeline-item.hidden .timeline-marker::before,
.timeline-item[style*="display: none"] .timeline-marker::before {
    display: none;
}

.timeline-content {
    flex: 1;
    padding: 20px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
}

.timeline-content:hover {
    border-color: var(--primary);
    transform: translateX(8px);
    box-shadow: var(--shadow-md);
}

.timeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
}

.timeline-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.timeline-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.timeline-subtitle {
    font-size: 0.9375rem;
    color: var(--primary-light);
    margin-bottom: 8px;
    font-weight: 500;
}

.timeline-desc {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    line-height: 1.6;
}

.chapter-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    font-size: 0.75rem;
}

.chapter-meta .word-count {
    color: var(--text-muted);
}

.chapter-meta .chapter-status {
    color: var(--primary-light);
    background: rgba(99, 102, 241, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

/* 分页 */
.chapters-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
}

.page-numbers {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    font-weight: 500;
}

.page-current {
    color: var(--primary-light);
    font-size: 1.25rem;
}

/* 浮动按钮 */
.fab-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 100;
}

.fab {
    width: 56px;
    height: 56px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
    transition: all var(--transition-fast);
}

.fab:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5);
}

.fab svg {
    width: 24px;
    height: 24px;
}

/* 侧边栏章节 */
.sidebar-chapter {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.sidebar-chapter:hover {
    background: var(--bg-tertiary);
}

.sidebar-chapter.active {
    background: var(--primary);
    color: white;
}

.chapter-num {
    width: 28px;
    height: 28px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.sidebar-chapter.active .chapter-num {
    background: rgba(255, 255, 255, 0.2);
}

.chapter-name {
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 阅读器页面 */
.reader-page {
    padding-top: 0;
}

.reader-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    transition: transform 0.3s ease;
}

.reader-header.hidden {
    transform: translateY(-100%);
}

.reader-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    max-width: 800px;
    margin: 0 auto;
}

.reader-back {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.reader-back:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.reader-back svg {
    width: 24px;
    height: 24px;
}

.reader-info {
    text-align: center;
    flex: 1;
}

.reader-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.reader-book {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.reader-menu-toggle {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.reader-menu-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.reader-menu-toggle svg {
    width: 24px;
    height: 24px;
}

.reader-progress-bar {
    height: 3px;
    background: var(--bg-tertiary);
}

.reader-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 0%;
    transition: width 0.3s ease;
}

/* 阅读器内容 */
.reader-content {
    min-height: 100vh;
    padding: 100px 24px 120px;
    max-width: 800px;
    margin: 0 auto;
}

.chapter-content {
    font-family: var(--font-serif);
    font-size: 18px;
    line-height: 2;
}

.chapter-header {
    text-align: center;
    margin-bottom: 48px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
}

.chapter-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.chapter-subtitle {
    color: var(--text-tertiary);
    font-size: 1rem;
}

.chapter-body {
    color: var(--text-secondary);
}

.chapter-body p {
    margin-bottom: 1.5em;
    text-indent: 2em;
}

.chapter-footer {
    text-align: center;
    margin-top: 64px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
}

.placeholder-text {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.placeholder-text a {
    color: var(--primary-light);
    text-decoration: underline;
}

/* 阅读器底部导航 */
.reader-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    transition: transform 0.3s ease;
}

.reader-footer.hidden {
    transform: translateY(100%);
}

.reader-footer-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    max-width: 800px;
    margin: 0 auto;
}

.reader-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    max-width: 800px;
    margin: 0 auto;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.nav-btn:hover:not(:disabled) {
    background: var(--primary);
    color: white;
}

.nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.nav-btn svg {
    width: 20px;
    height: 20px;
}

.nav-center {
    background: var(--primary);
    color: white;
}

/* 阅读器设置 */
.reader-settings-toggle {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 48px;
    height: 48px;
    background: var(--bg-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    box-shadow: var(--shadow-md);
    z-index: 999;
    transition: all var(--transition-fast);
}

.reader-settings-toggle:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
}

.reader-settings-toggle svg {
    width: 22px;
    height: 22px;
}

.reader-settings {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 24px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.reader-settings.active {
    transform: translateY(0);
}

.settings-panel {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}

.settings-section {
    flex: 1;
    min-width: 150px;
}

.settings-section h3 {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.font-size-control,
.line-height-control {
    display: flex;
    gap: 8px;
}

.size-btn,
.lh-btn {
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.size-btn:hover,
.lh-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.size-btn.active,
.lh-btn.active {
    background: var(--primary);
    color: white;
}

.theme-options {
    display: flex;
    gap: 12px;
}

.theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.theme-option:hover {
    background: var(--bg-card);
}

.theme-option.active {
    background: var(--primary);
    color: white;
}

.theme-preview {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
}

.theme-preview.dark {
    background: #1a1a2e;
}

.theme-preview.light {
    background: #fafafa;
}

.theme-preview.sepia {
    background: #f5f0e6;
}

/* 侧边栏 */
.reader-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 320px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    z-index: 1002;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.reader-sidebar.active {
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
}

.sidebar-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
}

.sidebar-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sidebar-close svg {
    width: 20px;
    height: 20px;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

/* 遮罩层 */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 章节加载动画 */
.chapter-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bg-tertiary);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 移动端阅读器适配 */
@media (max-width: 768px) {
    .reader-header-content {
        padding: 10px 16px;
    }
    
    .reader-title {
        font-size: 0.9375rem;
    }
    
    .reader-book {
        font-size: 0.6875rem;
    }
    
    .reader-back,
    .reader-menu-toggle {
        width: 36px;
        height: 36px;
    }
    
    .reader-back svg,
    .reader-menu-toggle svg {
        width: 20px;
        height: 20px;
    }
    
    .reader-content {
        padding: 90px 16px 100px;
    }
    
    .chapter-heading {
        font-size: 1.5rem;
    }
    
    .chapter-meta {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .reader-sidebar {
        width: 280px;
    }
    
    .reader-footer-nav {
        padding: 10px 16px;
    }
    
    .nav-btn {
        padding: 8px 16px;
        font-size: 0.875rem;
    }
}

/* ==================== 阅读器设置面板 ==================== */
.reader-settings-btn {
    position: fixed;
    right: 20px;
    bottom: 100px;
    width: 48px;
    height: 48px;
    background: var(--primary);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    transition: all var(--transition-fast);
    z-index: 1000;
}

.reader-settings-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.reader-settings-btn svg {
    width: 24px;
    height: 24px;
}

.settings-panel {
    position: fixed;
    right: 20px;
    bottom: 160px;
    width: 280px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.settings-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.settings-panel h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.settings-section {
    margin-bottom: 20px;
}

.settings-section:last-child {
    margin-bottom: 0;
}

/* 主题选择 */
.theme-options {
    display: flex;
    gap: 12px;
}

.theme-option {
    flex: 1;
    padding: 12px;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: center;
    transition: all var(--transition-fast);
}

.theme-option:hover {
    border-color: var(--primary);
}

.theme-option.active {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.theme-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin: 0 auto 8px;
    border: 2px solid var(--border);
}

.theme-icon.dark {
    background: #1a1a2e;
}

.theme-icon.light {
    background: #fafafa;
}

.theme-icon.sepia {
    background: #f5f0e6;
}

.theme-name {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* 字体大小调节 */
.font-size-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.font-size-btn {
    width: 36px;
    height: 36px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.font-size-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.font-size-value {
    flex: 1;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* 行间距调节 */
.line-height-options {
    display: flex;
    gap: 8px;
}

.line-height-btn {
    flex: 1;
    padding: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.line-height-btn:hover {
    border-color: var(--primary);
    color: var(--text-primary);
}

.line-height-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 阅读宽度调节 */
.width-options {
    display: flex;
    gap: 8px;
}

.width-btn {
    flex: 1;
    padding: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.width-btn:hover {
    border-color: var(--primary);
    color: var(--text-primary);
}

.width-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 主题样式 - 护眼模式 */
[data-theme="sepia"] {
    --bg-primary: #f5f0e6;
    --bg-secondary: #ebe5d8;
    --bg-card: #f0ebe0;
    --text-primary: #5c4b37;
    --text-secondary: #7d6b55;
    --text-tertiary: #9a8b75;
    --border: #d9d0c1;
}

[data-theme="sepia"] .reader-header,
[data-theme="sepia"] .reader-footer {
    background: rgba(245, 240, 230, 0.95);
}

[data-theme="sepia"] .reader-sidebar {
    background: #f5f0e6;
}

/* 浅色主题 */
[data-theme="light"] {
    --bg-primary: #fafafa;
    --bg-secondary: #f0f0f0;
    --bg-card: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #555555;
    --text-tertiary: #888888;
    --border: #e0e0e0;
}

[data-theme="light"] .reader-header,
[data-theme="light"] .reader-footer {
    background: rgba(250, 250, 250, 0.95);
}

[data-theme="light"] .reader-sidebar {
    background: #fafafa;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .reader-settings-btn {
        right: 16px;
        bottom: 80px;
        width: 44px;
        height: 44px;
    }
    
    .settings-panel {
        right: 16px;
        left: 16px;
        bottom: 140px;
        width: auto;
    }
}
