/* ============================================================
   考研数学一教程 - 共享样式表
   ============================================================ */

/* ---------- CSS 变量 ---------- */
:root {
    /* 主色调 - 学术深蓝 */
    --primary: #2b4cb8;
    --primary-light: #4a6fd0;
    --primary-dark: #1a3290;
    --primary-bg: #eef2fc;

    /* 辅助色 */
    --accent: #e8590c;
    --accent-light: #ff922b;
    --accent-bg: #fff4e6;

    /* 语义色 */
    --success: #2b8a3e;
    --success-bg: #ebfbef;
    --warning: #e67700;
    --warning-bg: #fff9db;
    --danger: #c92a2a;
    --danger-bg: #fff5f5;
    --info: #1971c2;
    --info-bg: #e7f5ff;

    /* 中性色 */
    --bg: #f5f6fa;
    --surface: #ffffff;
    --ink: #1a1a2e;
    --muted: #6c7293;
    --border: #e0e3eb;
    --border-light: #f0f1f5;

    /* 尺寸 */
    --sidebar-w: 280px;
    --header-h: 64px;
    --max-content: 860px;
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 16px;

    /* 阴影 */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --shadow-primary: 0 4px 20px rgba(43,76,184,0.15);

    /* 过渡 */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- 重置 ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
}

/* ---------- 顶部导航栏 ---------- */
.top-bar {
    position: fixed; top: 0; left: 0; right: 0; height: var(--header-h);
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #fff; z-index: 1000;
    display: flex; align-items: center; padding: 0 24px;
    box-shadow: var(--shadow);
}
.top-bar .logo {
    font-size: 1.15rem; font-weight: 800; letter-spacing: 1px;
    display: flex; align-items: center; gap: 8px; cursor: pointer;
    text-decoration: none; color: #fff;
}
.top-bar .logo .icon { font-size: 1.4rem; }
.top-bar .nav-links { margin-left: auto; display: flex; gap: 4px; }
.top-bar .nav-links a {
    color: rgba(255,255,255,0.85); text-decoration: none;
    padding: 8px 16px; border-radius: var(--radius-sm); font-size: 0.9rem;
    transition: var(--transition);
}
.top-bar .nav-links a:hover { background: rgba(255,255,255,0.15); color: #fff; }
.top-bar .menu-toggle { display: none; background: none; border: none; color: #fff; font-size: 1.5rem; cursor: pointer; }

/* ---------- 侧边栏 ---------- */
.sidebar {
    position: fixed; top: var(--header-h); left: 0; bottom: 0;
    width: var(--sidebar-w); background: var(--surface);
    border-right: 1px solid var(--border); overflow-y: auto;
    padding: 20px 0; z-index: 900; transition: var(--transition);
}
.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
.sidebar-section { margin-bottom: 8px; }
.sidebar-section-title {
    font-size: 0.75rem; font-weight: 700; color: var(--muted);
    text-transform: uppercase; letter-spacing: 1px; padding: 12px 24px 6px;
}
.sidebar a {
    display: block; padding: 10px 24px; text-decoration: none;
    color: var(--ink); font-size: 0.9rem; transition: var(--transition);
    border-left: 3px solid transparent; line-height: 1.5;
}
.sidebar a:hover { background: var(--primary-bg); color: var(--primary); }
.sidebar a.active {
    background: var(--primary-bg); color: var(--primary);
    border-left-color: var(--primary); font-weight: 600;
}
.sidebar a .ch-num { font-size: 0.78rem; color: var(--muted); margin-right: 6px; }
.sidebar a.active .ch-num { color: var(--primary-light); }

/* ---------- 主内容区 ---------- */
.main-content {
    margin-left: var(--sidebar-w); margin-top: var(--header-h);
    padding: 40px 48px 80px; min-height: calc(100vh - var(--header-h));
}
.main-content .content-wrap { max-width: var(--max-content); margin: 0 auto; }

/* ---------- 章节头部 ---------- */
.chapter-header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    color: #fff; border-radius: var(--radius-lg); padding: 48px 40px;
    margin-bottom: 40px; position: relative; overflow: hidden;
    box-shadow: var(--shadow-primary);
}
.chapter-header::before {
    content: ''; position: absolute; top: -50%; right: -10%;
    width: 300px; height: 300px; border-radius: 50%;
    background: rgba(255,255,255,0.08);
}
.chapter-header::after {
    content: ''; position: absolute; bottom: -30%; right: 20%;
    width: 200px; height: 200px; border-radius: 50%;
    background: rgba(255,255,255,0.05);
}
.chapter-header .ch-label {
    font-size: 0.85rem; opacity: 0.8; letter-spacing: 2px; text-transform: uppercase;
    margin-bottom: 8px; position: relative; z-index: 1;
}
.chapter-header h1 {
    font-size: 2.2rem; font-weight: 800; margin-bottom: 12px;
    position: relative; z-index: 1; line-height: 1.3;
}
.chapter-header .subtitle {
    font-size: 1.05rem; opacity: 0.85; position: relative; z-index: 1;
}
.chapter-header .meta-tags {
    margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap;
    position: relative; z-index: 1;
}
.chapter-header .meta-tag {
    background: rgba(255,255,255,0.15); padding: 4px 14px;
    border-radius: 20px; font-size: 0.8rem; backdrop-filter: blur(4px);
}

/* ---------- 进度条 ---------- */
.progress-bar-container {
    background: var(--surface); border-radius: var(--radius);
    padding: 16px 24px; margin-bottom: 32px;
    box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 16px;
}
.progress-bar-container .progress-label { font-size: 0.85rem; color: var(--muted); white-space: nowrap; }
.progress-bar-container .progress-track {
    flex: 1; height: 8px; background: var(--border-light);
    border-radius: 10px; overflow: hidden;
}
.progress-bar-container .progress-fill {
    height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 10px; transition: width 0.5s ease;
}
.progress-bar-container .progress-percent { font-size: 0.9rem; font-weight: 700; color: var(--primary); }

/* ---------- 章节内导航(目录) ---------- */
.chapter-toc {
    background: var(--surface); border-radius: var(--radius);
    padding: 20px 24px; margin-bottom: 32px; box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary);
}
.chapter-toc .toc-title { font-size: 0.85rem; font-weight: 700; color: var(--muted); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 1px; }
.chapter-toc ol { list-style: none; counter-reset: toc; }
.chapter-toc ol li { counter-increment: toc; padding: 4px 0; }
.chapter-toc ol li::before {
    content: counter(toc); display: inline-block; width: 24px; height: 24px;
    background: var(--primary-bg); color: var(--primary); border-radius: 50%;
    text-align: center; line-height: 24px; font-size: 0.75rem; font-weight: 700;
    margin-right: 10px;
}
.chapter-toc ol li a { color: var(--ink); text-decoration: none; font-size: 0.92rem; transition: var(--transition); }
.chapter-toc ol li a:hover { color: var(--primary); }

/* ---------- 标题 ---------- */
.content-wrap h2 {
    font-size: 1.6rem; font-weight: 800; color: var(--ink);
    margin: 48px 0 20px; padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-bg);
    display: flex; align-items: center; gap: 10px;
}
.content-wrap h2 .section-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; background: var(--primary); color: #fff;
    border-radius: var(--radius-sm); font-size: 1rem;
}
.content-wrap h3 {
    font-size: 1.25rem; font-weight: 700; color: var(--primary-dark);
    margin: 32px 0 14px;
}
.content-wrap h4 {
    font-size: 1.05rem; font-weight: 600; color: var(--ink);
    margin: 24px 0 10px;
}
.content-wrap p { margin-bottom: 14px; font-size: 1rem; color: var(--ink); }
.content-wrap strong { color: var(--primary-dark); font-weight: 700; }
.content-wrap mark { background: var(--accent-bg); color: var(--accent); padding: 1px 4px; border-radius: 3px; }

/* ---------- 数学公式 ---------- */
.math-inline {
    font-family: "Cambria Math", "Latin Modern Math", Georgia, serif;
    font-style: italic; font-size: 1.05em;
}
.math-block {
    font-family: "Cambria Math", "Latin Modern Math", Georgia, serif;
    background: var(--primary-bg); border-left: 4px solid var(--primary);
    padding: 16px 24px; margin: 16px 0; border-radius: var(--radius-sm);
    font-size: 1.1rem; text-align: center; overflow-x: auto;
    color: var(--primary-dark); font-weight: 500;
}
.math-block .formula-label {
    display: inline-block; background: var(--primary); color: #fff;
    padding: 2px 10px; border-radius: 4px; font-size: 0.75rem;
    margin-left: 12px; vertical-align: middle; font-style: normal;
}

/* ---------- 卡片/提示框 ---------- */
.callout {
    border-radius: var(--radius); padding: 16px 20px; margin: 20px 0;
    border-left: 4px solid; position: relative;
}
.callout .callout-title {
    font-weight: 700; margin-bottom: 8px; font-size: 0.95rem;
    display: flex; align-items: center; gap: 8px;
}
.callout p:last-child { margin-bottom: 0; }
.callout-info { background: var(--info-bg); border-color: var(--info); }
.callout-info .callout-title { color: var(--info); }
.callout-tip { background: var(--success-bg); border-color: var(--success); }
.callout-tip .callout-title { color: var(--success); }
.callout-warning { background: var(--warning-bg); border-color: var(--warning); }
.callout-warning .callout-title { color: var(--warning); }
.callout-danger { background: var(--danger-bg); border-color: var(--danger); }
.callout-danger .callout-title { color: var(--danger); }

/* ---------- 定理/定义框 ---------- */
.theorem-box {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); margin: 20px 0; overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.theorem-box .theorem-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff; padding: 10px 20px; font-weight: 700; font-size: 0.95rem;
    display: flex; align-items: center; gap: 8px; cursor: pointer;
    user-select: none; transition: var(--transition);
}
.theorem-box .theorem-header:hover { filter: brightness(1.05); }
.theorem-box .theorem-header .toggle-icon { margin-left: auto; transition: transform 0.3s; }
.theorem-box.collapsed .theorem-header .toggle-icon { transform: rotate(-90deg); }
.theorem-box .theorem-body { padding: 16px 20px; transition: var(--transition); overflow: hidden; }
.theorem-box.collapsed .theorem-body { max-height: 0; padding-top: 0; padding-bottom: 0; }
.theorem-box .theorem-body p:last-child { margin-bottom: 0; }

/* 定义框 - 不同配色 */
.def-box { border-color: var(--accent); }
.def-box .theorem-header { background: linear-gradient(135deg, var(--accent), var(--accent-light)); }

/* ---------- 例题框 ---------- */
.example-box {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); margin: 24px 0; overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.example-box .example-header {
    background: var(--ink); color: #fff; padding: 10px 20px;
    font-weight: 700; font-size: 0.92rem; display: flex; align-items: center; gap: 8px;
}
.example-box .example-body { padding: 20px 24px; }
.example-box .example-body .problem { margin-bottom: 16px; font-size: 0.95rem; }
.example-box .example-body .solution-label {
    font-weight: 700; color: var(--primary); margin-bottom: 8px; font-size: 0.9rem;
}
.example-box .example-body .solution { font-size: 0.93rem; color: var(--ink); }
.example-box .example-body .solution p { margin-bottom: 10px; }

/* ---------- 可折叠内容 ---------- */
.collapse-section {
    border: 1px solid var(--border); border-radius: var(--radius);
    margin: 16px 0; overflow: hidden; background: var(--surface);
}
.collapse-section .collapse-header {
    padding: 14px 20px; background: var(--primary-bg); cursor: pointer;
    font-weight: 600; font-size: 0.95rem; color: var(--primary-dark);
    display: flex; align-items: center; gap: 8px; user-select: none;
    transition: var(--transition);
}
.collapse-section .collapse-header:hover { background: var(--primary-light); color: #fff; }
.collapse-section .collapse-header .toggle-icon { margin-left: auto; transition: transform 0.3s; }
.collapse-section.collapsed .collapse-header .toggle-icon { transform: rotate(-90deg); }
.collapse-section .collapse-body { padding: 16px 20px; transition: var(--transition); overflow: hidden; }
.collapse-section.collapsed .collapse-body { max-height: 0; padding-top: 0; padding-bottom: 0; }

/* ---------- 代码块 ---------- */
pre {
    background: #1e1e2e; color: #e0e0e0; border-radius: var(--radius);
    padding: 18px 24px; overflow-x: auto; margin: 16px 0; font-size: 0.88rem;
    line-height: 1.6;
}
pre code { font-family: "Cascadia Code", "Fira Code", "Consolas", monospace; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; margin: 20px 0; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 0.92rem; }
thead { background: var(--primary); color: #fff; }
th { padding: 12px 16px; text-align: left; font-weight: 600; }
td { padding: 10px 16px; border-bottom: 1px solid var(--border-light); }
tbody tr:nth-child(even) { background: var(--bg); }
tbody tr:hover { background: var(--primary-bg); }

/* ---------- 自测练习 ---------- */
.quiz-section {
    background: var(--surface); border-radius: var(--radius-lg);
    padding: 32px; margin: 40px 0; box-shadow: var(--shadow);
    border: 2px solid var(--primary-bg);
}
.quiz-section .quiz-title {
    font-size: 1.3rem; font-weight: 800; color: var(--primary-dark);
    margin-bottom: 8px; display: flex; align-items: center; gap: 10px;
}
.quiz-section .quiz-desc { color: var(--muted); font-size: 0.9rem; margin-bottom: 24px; }
.quiz-question {
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 20px; margin-bottom: 16px; transition: var(--transition);
}
.quiz-question.answered.correct { border-color: var(--success); background: var(--success-bg); }
.quiz-question.answered.wrong { border-color: var(--danger); background: var(--danger-bg); }
.quiz-question .q-text { font-weight: 600; margin-bottom: 14px; font-size: 0.95rem; }
.quiz-question .q-num {
    display: inline-block; background: var(--primary); color: #fff;
    padding: 2px 10px; border-radius: 4px; font-size: 0.78rem; margin-right: 8px;
}
.quiz-options { list-style: none; }
.quiz-options li {
    padding: 10px 16px; margin-bottom: 8px; border: 2px solid var(--border);
    border-radius: var(--radius-sm); cursor: pointer; transition: var(--transition);
    font-size: 0.92rem; display: flex; align-items: center; gap: 10px;
}
.quiz-options li:hover { border-color: var(--primary-light); background: var(--primary-bg); }
.quiz-options li .option-label {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 50%; background: var(--border);
    font-weight: 700; font-size: 0.85rem; flex-shrink: 0; transition: var(--transition);
}
.quiz-options li:hover .option-label { background: var(--primary); color: #fff; }
.quiz-options li.selected { border-color: var(--primary); background: var(--primary-bg); }
.quiz-options li.selected .option-label { background: var(--primary); color: #fff; }
.quiz-options li.correct-answer { border-color: var(--success); background: var(--success-bg); }
.quiz-options li.correct-answer .option-label { background: var(--success); color: #fff; }
.quiz-options li.wrong-answer { border-color: var(--danger); background: var(--danger-bg); }
.quiz-options li.wrong-answer .option-label { background: var(--danger); color: #fff; }
.quiz-feedback {
    margin-top: 12px; padding: 12px 16px; border-radius: var(--radius-sm);
    font-size: 0.88rem; display: none;
}
.quiz-feedback.show { display: block; }
.quiz-feedback.correct { background: var(--success-bg); color: var(--success); }
.quiz-feedback.wrong { background: var(--danger-bg); color: var(--danger); }
.quiz-score {
    margin-top: 20px; padding: 16px 24px; border-radius: var(--radius);
    background: var(--primary-bg); text-align: center; font-weight: 700;
    color: var(--primary-dark); font-size: 1.05rem; display: none;
}
.quiz-score.show { display: block; }

/* ---------- 章节小结 ---------- */
.summary-box {
    background: linear-gradient(135deg, var(--primary-bg), var(--surface));
    border: 2px solid var(--primary-light); border-radius: var(--radius-lg);
    padding: 28px 32px; margin: 40px 0;
}
.summary-box h3 { color: var(--primary-dark); margin-top: 0; }
.summary-box ul { padding-left: 20px; }
.summary-box ul li { margin-bottom: 8px; font-size: 0.93rem; }

/* ---------- 上下章导航 ---------- */
.chapter-nav {
    display: flex; justify-content: space-between; gap: 16px;
    margin: 48px 0 24px;
}
.chapter-nav a {
    flex: 1; display: block; padding: 20px 24px; text-decoration: none;
    border-radius: var(--radius); background: var(--surface); color: var(--ink);
    box-shadow: var(--shadow-sm); transition: var(--transition);
    border: 1px solid var(--border);
}
.chapter-nav a:hover {
    box-shadow: var(--shadow-lg); border-color: var(--primary);
    transform: translateY(-2px);
}
.chapter-nav a .nav-label { font-size: 0.78rem; color: var(--muted); margin-bottom: 4px; }
.chapter-nav a .nav-title { font-weight: 700; color: var(--primary); font-size: 0.95rem; }
.chapter-nav a.next { text-align: right; }

/* ---------- 页脚 ---------- */
.footer {
    text-align: center; padding: 32px; color: var(--muted); font-size: 0.85rem;
    border-top: 1px solid var(--border); margin-top: 40px;
}

/* ---------- 首页特殊样式 ---------- */
.index-hero {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 40%, var(--primary-light) 100%);
    color: #fff; padding: 80px 48px; border-radius: 0; text-align: center;
    position: relative; overflow: hidden; margin-bottom: 0;
}
.index-hero::before, .index-hero::after {
    content: ''; position: absolute; border-radius: 50%; background: rgba(255,255,255,0.06);
}
.index-hero::before { width: 400px; height: 400px; top: -150px; right: -100px; }
.index-hero::after { width: 300px; height: 300px; bottom: -100px; left: -50px; }
.index-hero h1 { font-size: 3rem; font-weight: 900; margin-bottom: 16px; position: relative; z-index: 1; }
.index-hero .hero-sub { font-size: 1.2rem; opacity: 0.9; position: relative; z-index: 1; max-width: 640px; margin: 0 auto 24px; }
.index-hero .hero-stats { display: flex; justify-content: center; gap: 48px; position: relative; z-index: 1; margin-top: 32px; }
.index-hero .hero-stat { text-align: center; }
.index-hero .hero-stat .num { font-size: 2.5rem; font-weight: 900; }
.index-hero .hero-stat .label { font-size: 0.85rem; opacity: 0.8; }

.index-section { padding: 60px 48px; max-width: 1200px; margin: 0 auto; }
.index-section h2 { font-size: 1.8rem; font-weight: 800; margin-bottom: 8px; color: var(--ink); text-align: center; }
.index-section .section-sub { text-align: center; color: var(--muted); margin-bottom: 40px; font-size: 0.95rem; }

.chapter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.chapter-card {
    background: var(--surface); border-radius: var(--radius-lg); padding: 28px;
    text-decoration: none; color: var(--ink); box-shadow: var(--shadow-sm);
    border: 1px solid var(--border); transition: var(--transition);
    position: relative; overflow: hidden;
}
.chapter-card::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 4px;
    background: var(--card-color, var(--primary)); transform: scaleX(0); transform-origin: left;
    transition: transform 0.3s;
}
.chapter-card:hover {
    box-shadow: var(--shadow-lg); transform: translateY(-4px);
    border-color: var(--card-color, var(--primary));
}
.chapter-card:hover::before { transform: scaleX(1); }
.chapter-card .card-num {
    font-size: 2.5rem; font-weight: 900; color: var(--card-color, var(--primary));
    opacity: 0.15; position: absolute; top: 12px; right: 20px; line-height: 1;
}
.chapter-card .card-tag {
    display: inline-block; padding: 3px 12px; border-radius: 20px;
    font-size: 0.72rem; font-weight: 600; margin-bottom: 12px;
    background: var(--card-color-bg, var(--primary-bg));
    color: var(--card-color, var(--primary));
}
.chapter-card h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 8px; }
.chapter-card .card-desc { font-size: 0.88rem; color: var(--muted); line-height: 1.6; }
.chapter-card .card-topics { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.chapter-card .card-topics span {
    font-size: 0.72rem; padding: 2px 8px; background: var(--bg);
    border-radius: 4px; color: var(--muted);
}

.feature-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.feature-item { text-align: center; padding: 24px; }
.feature-item .feature-icon {
    width: 56px; height: 56px; border-radius: var(--radius); margin: 0 auto 16px;
    display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
    background: var(--primary-bg); color: var(--primary);
}
.feature-item h4 { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.feature-item p { font-size: 0.85rem; color: var(--muted); }

.exam-info-table { max-width: 800px; margin: 0 auto; }

/* ---------- 动画 ---------- */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeInUp 0.6s ease forwards; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.pulse { animation: pulse 2s ease infinite; }

/* ---------- 返回顶部 ---------- */
.back-to-top {
    position: fixed; bottom: 32px; right: 32px; width: 48px; height: 48px;
    background: var(--primary); color: #fff; border: none; border-radius: 50%;
    font-size: 1.3rem; cursor: pointer; box-shadow: var(--shadow-lg);
    opacity: 0; pointer-events: none; transition: var(--transition); z-index: 800;
}
.back-to-top.show { opacity: 1; pointer-events: auto; }
.back-to-top:hover { background: var(--primary-dark); transform: translateY(-4px); }

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 24px 20px 60px; }
    .top-bar .menu-toggle { display: block; }
    .top-bar .nav-links { display: none; }
}
@media (max-width: 768px) {
    .chapter-header { padding: 32px 24px; }
    .chapter-header h1 { font-size: 1.6rem; }
    .index-hero { padding: 48px 24px; }
    .index-hero h1 { font-size: 2rem; }
    .index-hero .hero-stats { gap: 24px; }
    .index-hero .hero-stat .num { font-size: 1.8rem; }
    .index-section { padding: 40px 20px; }
    .chapter-grid { grid-template-columns: 1fr; }
    .chapter-nav { flex-direction: column; }
    .content-wrap h2 { font-size: 1.3rem; }
    .quiz-section { padding: 20px; }
}

/* ---------- 打印 ---------- */
@media print {
    .top-bar, .sidebar, .back-to-top, .chapter-nav, .quiz-section, .progress-bar-container { display: none; }
    .main-content { margin: 0; padding: 0; }
    .chapter-header { background: #333; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
