﻿
  @font-face {
    font-family: 'WorkSans';
    src: url('../fonts/WorkSans-Regular.ttf') format('truetype');
    font-weight: 400;
    font-display: swap;
  }
  @font-face {
    font-family: 'WorkSans';
    src: url('../fonts/WorkSans-Bold.ttf') format('truetype');
    font-weight: 700;
    font-display: swap;
  }
  @font-face {
    font-family: 'Mono408';
    src: url('../fonts/JetBrainsMono-Regular.ttf') format('truetype');
    font-weight: 400;
    font-display: swap;
  }
  @font-face {
    font-family: 'Mono408';
    src: url('../fonts/JetBrainsMono-Bold.ttf') format('truetype');
    font-weight: 700;
    font-display: swap;
  }

  :root {
    --bg: #f5f1e8;
    --bg2: #fffdf9;
    --ink: #171a1f;
    --muted: #5b6472;
    --rule: #ded5c4;
    --accent: #2450b3;
    --accent2: #c2410c;
    --accent3: #0f766e;
    --mark: #fbe08a;
    --font: 'WorkSans', "PingFang SC", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
    --font-mono: 'Mono408', "Cascadia Code", Consolas, "Courier New", monospace;
    --max: 1480px;
    --content: 820px;
    --radius: 12px;
  }

  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

  html { font-size: 16px; scroll-behavior: smooth; scrollbar-gutter: stable; }

  body {
    font-family: var(--font);
    color: var(--ink);
    background:
      radial-gradient(1100px 620px at 8% -8%, rgba(36, 80, 179, 0.07), transparent 62%),
      radial-gradient(900px 520px at 102% 2%, rgba(194, 65, 12, 0.055), transparent 58%),
      var(--bg);
    line-height: 1.86;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  /* ---------- 基础可访问性 ---------- */
  ::selection { background: rgba(36, 80, 179, .18); }
  :focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
  }
  a { -webkit-tap-highlight-color: transparent; }
  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
      transition-duration: .01ms !important;
      animation-duration: .01ms !important;
    }
  }

  /* ---------- reading progress ---------- */
  .progress {
    position: fixed; top: 0; left: 0; height: 3px; width: 100%;
    transform: scaleX(0); transform-origin: left center;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    z-index: 85; pointer-events: none;
  }

  .sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
  }
  .skip-link {
    position: fixed; top: .65rem; left: 1rem; z-index: 120;
    padding: .55rem .85rem; border-radius: 7px;
    background: var(--ink); color: var(--bg2); text-decoration: none;
    font-size: .85rem; font-weight: 700;
    transform: translateY(-180%); transition: transform .15s;
  }
  .skip-link:focus { transform: translateY(0); }

  .back-to-top {
    position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 70;
    min-width: 3rem; min-height: 3rem; padding: .55rem .75rem;
    display: flex; align-items: center; justify-content: center; gap: .35rem;
    border: 1px solid var(--rule); border-radius: 999px;
    background: var(--bg2); color: var(--ink);
    box-shadow: 0 5px 20px rgba(23, 26, 31, .12);
    font-family: var(--font); font-size: .8rem; font-weight: 700;
    cursor: pointer; opacity: 0; visibility: hidden; pointer-events: none;
    transform: translateY(8px); transition: opacity .18s, transform .18s, visibility .18s;
  }
  .back-to-top.visible { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); }
  .back-to-top:hover { border-color: var(--accent); color: var(--accent); }

  .wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.75rem; }

  /* ---------- hero ---------- */
  .hero {
    padding: 3.6rem 0 3rem;
    border-bottom: 1px solid var(--rule);
  }
  .hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 3rem;
    align-items: center;
  }
  .eyebrow {
    display: flex; flex-wrap: wrap; gap: .45rem; align-items: center;
    font-size: .78rem; letter-spacing: .1em; text-transform: uppercase;
    color: var(--muted); font-weight: 700; margin-bottom: 1.1rem;
  }
  .eyebrow .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--accent2); }
  .hero h1 {
    font-size: clamp(2.3rem, 5vw, 3.5rem);
    line-height: 1.14;
    letter-spacing: -0.025em;
    font-weight: 700;
    margin-bottom: .7rem;
  }
  .hero h1 .thin { color: var(--muted); font-weight: 400; }
  .hero-sub {
    font-size: 1.08rem; color: var(--ink); margin-bottom: 1.1rem; max-width: 42em;
  }
  .hero-sub strong { color: var(--accent); }
  .hero-lede {
    font-size: .95rem; color: var(--muted); max-width: 44em; margin-bottom: 1.6rem;
  }
  .chips { display: flex; flex-wrap: wrap; gap: .5rem; }
  .chip {
    display: inline-flex; align-items: center; gap: .4rem;
    font-size: .8rem; font-weight: 700;
    padding: .32rem .7rem; border-radius: 999px;
    background: var(--bg2); border: 1px solid var(--rule); color: var(--muted);
  }
  .chip b { color: var(--ink); font-size: .95rem; }
  .chip.hot { border-color: rgba(194, 65, 12, .35); color: var(--accent2); background: rgba(194, 65, 12, .06); }

  .chip-figure { display: flex; justify-content: center; }
  .chip-figure svg { width: 100%; max-width: 270px; height: auto; }

  /* ---------- layout ---------- */
  .layout {
    display: grid;
    grid-template-columns: 232px minmax(0, var(--content));
    justify-content: center;
    gap: 3rem;
    padding-top: 2.6rem;
    padding-bottom: 4rem;
  }

  /* ---------- toc ---------- */
  .toc {
    position: sticky; top: 1.6rem; align-self: start;
    max-height: calc(100vh - 3.2rem); overflow: auto;
    font-size: .86rem;
    padding-right: .4rem;
  }
  .toc-title {
    font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
    color: var(--muted); font-weight: 700; margin-bottom: .9rem;
  }
  .toc ol { list-style: none; }
  .toc li { margin-bottom: .1rem; }
  .toc a {
    display: flex; gap: .6rem; align-items: baseline;
    color: var(--muted); text-decoration: none;
    padding: .34rem .5rem; border-radius: 7px;
    border-left: 2px solid transparent;
    transition: color .15s, background .15s, border-color .15s;
    line-height: 1.5;
  }
  .toc a .n { font-family: var(--font-mono); font-size: .72rem; color: var(--rule); }
  .toc a:hover { color: var(--ink); background: rgba(36, 80, 179, .05); }
  .toc a.active {
    color: var(--accent); font-weight: 700;
    background: rgba(36, 80, 179, .07);
    border-left-color: var(--accent);
  }
  .toc a.active .n { color: var(--accent); }
  .toc-filter {
    margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--rule);
  }
  .switch {
    display: flex; align-items: center; gap: .55rem;
    font-size: .8rem; color: var(--muted); cursor: pointer; user-select: none;
  }
  .switch input { accent-color: var(--accent2); width: 15px; height: 15px; cursor: pointer; }

  /* ---------- content ---------- */
  main { min-width: 0; }
  .chapter {
    padding: 3.2rem 0 3.4rem;
    scroll-margin-top: 1.2rem;
  }
  .chapter:first-of-type { padding-top: 0; }

  .chap-head {
    display: flex; gap: 1.2rem; align-items: flex-start;
    margin-bottom: 1.6rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--rule);
  }
  .chap-num {
    font-family: var(--font-mono);
    font-size: 1rem; font-weight: 700;
    color: var(--bg2);
    background: var(--accent);
    width: 2.5rem; height: 2.5rem; flex: 0 0 2.5rem;
    display: flex; align-items: center; justify-content: center;
    border-radius: 9px;
    margin-top: .28rem;
  }
  .chap-kicker {
    font-size: .76rem; font-weight: 700; letter-spacing: .08em;
    color: var(--accent2); text-transform: uppercase; margin-bottom: .2rem;
  }
  .chapter h2 {
    font-size: clamp(1.7rem, 3.2vw, 2.2rem);
    line-height: 1.3; letter-spacing: -0.015em;
  }
  .badges { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .65rem; }
  .badge {
    font-size: .74rem; font-weight: 700; padding: .2rem .6rem;
    border-radius: 6px; background: var(--bg2);
    border: 1px solid var(--rule); color: var(--muted);
  }
  .badge.stars { color: var(--accent2); border-color: rgba(194, 65, 12, .3); background: rgba(194, 65, 12, .06); letter-spacing: .06em; }
  .badge.type { color: var(--accent); border-color: rgba(36, 80, 179, .28); background: rgba(36, 80, 179, .06); }

  h3 {
    font-size: 1.14rem; line-height: 1.5; margin: 2.2rem 0 .75rem;
    padding-left: .75rem; border-left: 3px solid var(--accent);
  }
  h4 {
    font-size: 1rem; margin: 1.35rem 0 .45rem; color: var(--ink);
  }
  p { margin-bottom: 1rem; }
  p:last-child { margin-bottom: 0; }
  ul, ol { margin: 0 0 1rem 0; padding-left: 1.4rem; }
  li { margin-bottom: .4rem; }
  li::marker { color: var(--accent); }
  strong { font-weight: 700; }
  em { font-style: normal; color: var(--accent2); font-weight: 700; }

  mark {
    background: linear-gradient(transparent 62%, var(--mark) 62%);
    color: inherit; padding: 0 .08em;
  }
  mark.plain { background: rgba(36, 80, 179, .1); padding: .05em .3em; border-radius: 4px; }

  code {
    font-family: var(--font-mono); font-size: .88em;
    background: rgba(36, 80, 179, .08);
    padding: .1em .35em; border-radius: 4px;
    color: var(--accent);
  }
  .mono { font-family: var(--font-mono); }

  /* ---------- callouts ---------- */
  .key, .warn, .note, .exam {
    padding: .95rem 1.15rem;
    border-radius: 0 10px 10px 0;
    margin: 1.2rem 0;
    font-size: .94rem;
  }
  .key {
    border-left: 4px solid var(--accent);
    background: linear-gradient(90deg, rgba(36, 80, 179, .08), rgba(36, 80, 179, .015));
  }
  .key::before {
    content: "一句话结论"; display: block;
    font-size: .7rem; font-weight: 700; letter-spacing: .1em;
    color: var(--accent); margin-bottom: .35rem;
  }
  .warn {
    border-left: 4px solid var(--accent2);
    background: rgba(194, 65, 12, .055);
  }
  .warn::before {
    content: "易错点"; display: block;
    font-size: .7rem; font-weight: 700; letter-spacing: .1em;
    color: var(--accent2); margin-bottom: .35rem;
  }
  .note {
    border-left: 4px solid var(--accent3);
    background: rgba(15, 118, 110, .055);
  }
  .note::before {
    content: "记忆钩子"; display: block;
    font-size: .7rem; font-weight: 700; letter-spacing: .1em;
    color: var(--accent3); margin-bottom: .35rem;
  }
  .exam {
    border: 1px solid var(--rule);
    border-left: 4px solid var(--ink);
    background: var(--bg2);
    border-radius: 0 10px 10px 0;
  }
  .exam::before {
    content: "真题怎么考"; display: block;
    font-size: .7rem; font-weight: 700; letter-spacing: .1em;
    color: var(--ink); margin-bottom: .35rem;
  }
  .exam p, .exam li { font-size: .92rem; }

  /* ---------- cards & grids ---------- */
  .card {
    background: var(--bg2);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 1.15rem 1.3rem;
    margin: 1.15rem 0;
  }
  .card h4 { margin-top: 0; }
  .grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 1.2rem 0; }
  .grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; margin: 1.2rem 0; }
  .grid2 > .card, .grid3 > .card { margin: 0; }
  .grid2 > *, .grid3 > * { min-width: 0; }

  .mini-label {
    font-size: .72rem; font-weight: 700; letter-spacing: .08em;
    color: var(--muted); text-transform: uppercase; margin-bottom: .3rem;
  }

  /* ---------- tables ---------- */
  .table-wrap {
    overflow: auto; max-height: 600px;
    border: 1px solid var(--rule);
    border-radius: 10px;
    background: var(--bg2);
    margin: 1.2rem 0;
  }
  table { width: 100%; border-collapse: collapse; font-size: .88rem; }
  th, td { padding: .6rem .75rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
  th {
    background: rgba(36, 80, 179, .06);
    font-size: .79rem; font-weight: 700; color: var(--ink);
    position: sticky; top: 0; backdrop-filter: blur(6px);
  }
  tr:last-child td { border-bottom: none; }
  td:first-child { font-weight: 700; white-space: nowrap; }

  /* ---------- steps ---------- */
  .steps { list-style: none; padding: 0; counter-reset: step; margin: 1.1rem 0; }
  .steps > li {
    position: relative; padding-left: 2.3rem; margin-bottom: .7rem;
    counter-increment: step;
  }
  .steps > li::before {
    content: counter(step);
    position: absolute; left: 0; top: .18rem;
    width: 1.55rem; height: 1.55rem; border-radius: 50%;
    background: rgba(36, 80, 179, .1); color: var(--accent);
    font-family: var(--font-mono); font-size: .78rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
  }

  /* ---------- formula ---------- */
  .formula {
    font-family: var(--font-mono);
    background: var(--bg2);
    border: 1px solid var(--rule);
    border-left: 3px solid var(--accent3);
    border-radius: 0 10px 10px 0;
    padding: .85rem 1.1rem;
    margin: 1rem 0;
    font-size: .9rem;
    overflow-x: auto;
    white-space: pre;
    line-height: 1.8;
  }
  .formula em { color: var(--accent2); }

  /* ---------- details / self test ---------- */
  details {
    border: 1px solid var(--rule);
    border-radius: 10px;
    background: var(--bg2);
    padding: .75rem 1rem;
    margin: .8rem 0;
  }
  summary {
    cursor: pointer; font-weight: 700; font-size: .92rem;
    list-style: none; display: flex; gap: .6rem; align-items: baseline;
  }
  summary::-webkit-details-marker { display: none; }
  summary::before {
    content: "?";
    flex: 0 0 1.3rem; height: 1.3rem;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; background: rgba(36, 80, 179, .1);
    color: var(--accent); font-family: var(--font-mono); font-size: .75rem;
  }
  details[open] summary { margin-bottom: .7rem; color: var(--accent); }
  details[open] summary::before { content: "✓"; background: rgba(15, 118, 110, .12); color: var(--accent3); }
  details p, details li { font-size: .9rem; }
  details .ans { color: var(--muted); }

  /* ---------- figures ---------- */
  figure { margin: 1.8rem 0; }
  figure svg { display: block; width: 100%; height: auto; }
  figcaption {
    font-size: .8rem; color: var(--muted);
    margin-top: .55rem; line-height: 1.65;
  }
  .diagram-frame {
    background: var(--bg2);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 1.1rem .9rem .7rem;
  }
  .chart-box { width: 100%; height: 380px; }
  .chart-box.short { height: 300px; }
  .mermaid { background: transparent; font-family: var(--font) !important; }
  .mermaid svg { max-width: 100%; height: auto; }

  /* ---------- misc ---------- */
  .hr { height: 1px; background: var(--rule); margin: 2rem 0; border: none; }
  .tag-row { display: flex; flex-wrap: wrap; gap: .4rem; margin: .6rem 0; }
  .tag {
    font-size: .72rem; font-weight: 700; padding: .16rem .5rem;
    border-radius: 5px; background: rgba(36, 80, 179, .08); color: var(--accent);
  }
  .tag.red { background: rgba(194, 65, 12, .09); color: var(--accent2); }
  .tag.green { background: rgba(15, 118, 110, .1); color: var(--accent3); }
  .lead { font-size: 1.02rem; color: var(--ink); }
  .small { font-size: .86rem; color: var(--muted); }
  .divider-dot { text-align: center; color: var(--rule); margin: 1.8rem 0; letter-spacing: .6em; }

  footer {
    border-top: 1px solid var(--rule);
    padding: 2.4rem 0 3.6rem;
    font-size: .85rem;
    color: var(--muted);
  }
  footer .sources h2 { font-size: 1.05rem; margin-bottom: .8rem; color: var(--ink); }
  footer .sources ol { padding-left: 1.2rem; font-size: .85rem; color: var(--muted); }
  footer .sources li { margin-bottom: .5rem; overflow-wrap: break-word; }
  footer .sources .src-title { color: var(--ink); }
  footer .sources .src-url { display: block; margin-top: .15rem; font-size: .82rem; color: var(--accent); word-break: break-all; }
  .footer-note { margin-top: 1.6rem; font-size: .78rem; color: var(--muted); }

  /* ---------- filter mode ---------- */
  body.only-hot .chapter[data-freq="2"],
  body.only-hot .chapter[data-freq="3"] { display: none; }

  /* ---------- responsive ---------- */
  @media (max-width: 1000px) {
    .layout { grid-template-columns: minmax(0, 1fr); gap: 1.2rem; padding-top: 1.2rem; }
    .toc {
      position: sticky; top: 49px; z-index: 40;
      min-width: 0; width: 100%;
      max-height: none; overflow: visible;
      display: flex; align-items: center; gap: .6rem;
      border: 1px solid var(--rule); border-radius: var(--radius);
      background: rgba(255, 253, 249, .96); padding: .55rem .65rem;
      box-shadow: 0 5px 16px rgba(23, 26, 31, .05);
    }
    .toc-title { display: none; }
    .toc-filter { flex: 0 0 auto; margin: 0; padding: 0; border: 0; }
    .toc-filter .switch { min-height: 40px; gap: .3rem; font-size: .74rem; }
    .toc-filter .switch span { display: none; }
    .toc-filter .switch::after { content: "只看高频"; }
    .toc > nav { flex: 1 1 auto; min-width: 0; }
    .toc ol {
      display: flex; gap: .4rem;
      overflow-x: auto; padding: 0;
      scrollbar-width: none;
    }
    .toc ol::-webkit-scrollbar { display: none; }
    .toc li { flex: 0 0 auto; margin: 0; }
    .toc li[hidden] { display: none; }
    .toc a {
      min-height: 40px; align-items: center;
      white-space: nowrap;
      border: 1px solid var(--rule);
      background: var(--bg2);
    }
    .toc a.active { border-color: var(--accent); }
    .toc-quiz { flex: 0 0 auto; margin: 0; padding: 0; border: 0; }
    .toc-quiz-title, .toc-quiz-meta { display: none; }
    .quiz-open { width: auto; min-height: 40px; white-space: nowrap; }
    .chapter { scroll-margin-top: 7rem; }
    .hero-grid { grid-template-columns: 1fr; gap: 1.4rem; }
    .chip-figure { display: none; }
  }
  @media (max-width: 720px) {
    html { font-size: 15.5px; }
    .wrap { padding: 0 1.1rem; }
    .hero { padding: 2.2rem 0 1.8rem; }
    .grid2, .grid3 { grid-template-columns: 1fr; }
    .chap-head { gap: .9rem; }
    .chap-num { width: 2.1rem; height: 2.1rem; flex-basis: 2.1rem; font-size: .85rem; }
    .table-wrap { max-height: none; }
    table { min-width: 560px; }
    .chart-box { height: 320px; }
  }

  @media print {
    .progress, .toc, .toc-filter { display: none; }
    .layout { display: block; }
    body { background: #fff; }
    .chapter { break-inside: avoid-page; }
  }

  /* ============ 全站导航 ============ */
  .site-nav {
    position: sticky; top: 0; z-index: 80;
    background: rgba(245, 241, 232, .88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--rule);
  }
  .site-nav .nav-inner {
    max-width: var(--max); margin: 0 auto;
    padding: .55rem 1.75rem;
    display: flex; align-items: center; gap: 1.4rem;
  }
  .brand {
    display: flex; align-items: center; gap: .55rem;
    text-decoration: none; color: var(--ink); flex: 0 0 auto;
  }
  .brand-mark {
    width: 2rem; height: 2rem; border-radius: 8px;
    background: var(--accent); color: var(--bg2);
    font-family: var(--font-mono); font-weight: 700; font-size: .76rem;
    display: flex; align-items: center; justify-content: center;
  }
  .brand-text { font-weight: 700; font-size: .92rem; letter-spacing: .02em; }
  .nav-links {
    display: flex; gap: .2rem; margin-left: auto;
    overflow-x: auto; scrollbar-width: none;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a {
    font-size: .84rem; color: var(--muted); text-decoration: none;
    padding: .4rem .7rem; border-radius: 7px; white-space: nowrap;
  }
  .nav-links a:hover { color: var(--ink); background: rgba(36, 80, 179, .06); }
  .nav-links a.active { color: var(--accent); background: rgba(36, 80, 179, .09); font-weight: 700; }

  /* ============ 首页 ============ */
  .home-hero { padding: 3.6rem 0 2.8rem; }
  .home-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 3.2rem;
    align-items: center;
  }
  .hero-index {
    position: relative;
    background: var(--bg2);
    border: 1px solid var(--rule);
    border-radius: 14px;
    padding: 1.4rem 1.3rem 1.2rem;
  }
  .hero-index::after {
    content: "";
    position: absolute; inset: 7px;
    border: 1px dashed var(--rule);
    border-radius: 10px;
    pointer-events: none;
  }
  .hero-index-num {
    font-family: var(--font-mono);
    font-size: clamp(3.2rem, 5.6vw, 4.6rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -.06em;
    color: var(--accent);
    position: relative; z-index: 1;
  }
  .hero-index-sub {
    margin-top: .35rem;
    font-size: .68rem; letter-spacing: .16em;
    text-transform: uppercase; color: var(--muted);
    position: relative; z-index: 1;
  }
  .hero-index-list {
    display: flex; gap: .35rem; margin-top: 1rem;
    position: relative; z-index: 1;
  }
  .hero-index-list span {
    flex: 1; text-align: center;
    font-family: var(--font-mono); font-size: .68rem; font-weight: 700;
    padding: .32rem 0; border-radius: 5px;
    background: rgba(36, 80, 179, .08); color: var(--accent);
  }
  .hero-index p {
    margin-top: .7rem; font-size: .72rem; color: var(--muted);
    position: relative; z-index: 1;
  }
  .sec-no {
    font-family: var(--font-mono);
    font-size: .75rem; font-weight: 700;
    color: var(--accent2); letter-spacing: .08em;
    margin-right: .55rem; vertical-align: .12em;
  }
  .home-hero h1 {
    font-size: clamp(2.4rem, 5.4vw, 4rem);
    line-height: 1.1; letter-spacing: -.03em; margin-bottom: 1rem;
  }
  .home-hero h1 .thin { color: var(--muted); font-weight: 400; display: block; font-size: .52em; letter-spacing: -.01em; margin-top: .5rem; }
  .home-hero .home-lede { font-size: 1.02rem; max-width: 44em; color: var(--muted); }
  .home-stats { display: flex; flex-wrap: wrap; gap: 2.4rem; margin-top: 2.2rem; }
  .home-stat b {
    display: block; font-family: var(--font-mono);
    font-size: 1.7rem; color: var(--accent); line-height: 1.2;
  }
  .home-stat span { font-size: .78rem; color: var(--muted); }

  .subject-grid {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.1rem; margin: 1.8rem 0;
  }
  .subject-card {
    display: flex; flex-direction: column; gap: .65rem;
    background: var(--bg2); border: 1px solid var(--rule);
    border-radius: var(--radius); padding: 1.4rem;
    text-decoration: none; color: var(--ink);
    position: relative; overflow: hidden;
    transition: border-color .15s, transform .15s;
  }
  .subject-card::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    background: var(--rule);
  }
  .subject-card.s-active::before { background: var(--accent); }
  .subject-card:hover { border-color: var(--accent); transform: translateY(-2px); }
  .subject-card .subj-code { font-family: var(--font-mono); font-size: .72rem; color: var(--muted); letter-spacing: .08em; }
  .subject-card h3 { font-size: 1.25rem; border: none; padding: 0; margin: 0; }
  .subject-card p { font-size: .87rem; color: var(--muted); margin: 0; }
  .subject-card .subj-meta { display: flex; flex-wrap: wrap; gap: .4rem; }
  .subject-card .go { margin-top: auto; padding-top: .6rem; font-size: .8rem; font-weight: 700; color: var(--accent); }
  .subject-card.s-active { border-color: rgba(36, 80, 179, .4); background: linear-gradient(180deg, rgba(36, 80, 179, .05), var(--bg2) 42%); }

  /* ============ 科目页 ============ */
  .subject-hero { padding: 2.8rem 0 2.2rem; border-bottom: 1px solid var(--rule); }
  .subject-hero h1 { font-size: clamp(2rem, 4.4vw, 3rem); line-height: 1.15; letter-spacing: -.02em; }
  .subject-hero .subject-lede { max-width: 46em; color: var(--muted); margin-top: .9rem; font-size: .98rem; }
  .subject-hero .chips { margin-top: 1.2rem; }
  .subject-body { max-width: 1180px; margin: 0 auto; padding: 2.2rem 1.75rem 4rem; }

  .chapter-list { display: flex; flex-direction: column; gap: .65rem; margin: 1.1rem 0 2rem; }
  .chapter-row {
    display: grid; grid-template-columns: 3rem minmax(0, 1fr) auto;
    gap: 1rem; align-items: center;
    background: var(--bg2); border: 1px solid var(--rule);
    border-radius: 12px; padding: .9rem 1.1rem;
    text-decoration: none; color: var(--ink);
    transition: border-color .15s, background .15s;
  }
  a.chapter-row { position: relative; overflow: hidden; }
  a.chapter-row::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    background: var(--accent);
  }
  a.chapter-row:hover { border-color: var(--accent); background: rgba(36, 80, 179, .03); }
  a.chapter-row:hover h3 { color: var(--accent); }
  .chapter-row .c-no { font-family: var(--font-mono); font-size: .82rem; color: var(--muted); }
  .chapter-row h3 { margin: 0; padding: 0; border: none; font-size: 1rem; line-height: 1.45; }
  .chapter-row .c-desc { font-size: .8rem; color: var(--muted); margin-top: .15rem; }
  .chapter-row .c-meta { display: flex; align-items: center; gap: .55rem; }
  .chapter-row.locked { opacity: .58; }
  .stars-sm { color: var(--accent2); font-size: .78rem; letter-spacing: .05em; white-space: nowrap; }
  .status { font-size: .7rem; font-weight: 700; padding: .15rem .45rem; border-radius: 4px; white-space: nowrap; }
  .status.live { color: var(--accent3); background: rgba(15, 118, 110, .1); }
  .status.soon { color: var(--muted); background: rgba(91, 100, 114, .12); }

  /* ============ 章节页外层 ============ */
  .crumbs { max-width: var(--max); margin: 0 auto; padding: 1rem 1.75rem 0; font-size: .78rem; color: var(--muted); }
  .crumbs a { color: var(--muted); text-decoration: none; }
  .crumbs a:hover { color: var(--accent); }
  .crumbs .sep { margin: 0 .45rem; color: var(--rule); }
  .chapter-nav { display: flex; justify-content: space-between; gap: 1rem; margin: 2.2rem 0 0; padding-top: 1.4rem; border-top: 1px solid var(--rule); }
  .chapter-nav a {
    flex: 1; max-width: 48%; text-decoration: none;
    background: var(--bg2); border: 1px solid var(--rule);
    border-radius: 10px; padding: .8rem 1rem;
    color: var(--ink); font-size: .85rem;
  }
  .chapter-nav a:hover { border-color: var(--accent); }
  .chapter-nav .dir { display: block; font-size: .7rem; color: var(--muted); margin-bottom: .2rem; }
  .chapter-nav .next { text-align: right; margin-left: auto; }
  .chapter-nav .disabled {
    flex: 1; max-width: 48%;
    border: 1px dashed var(--rule); border-radius: 10px;
    padding: .8rem 1rem; color: var(--muted); font-size: .85rem;
  }

  /* ============ 首页区块 ============ */
  .home-section { border-top: 1px solid var(--rule); padding: 2.5rem 0; }
  .home-section h2 { font-size: 1.45rem; margin-bottom: .7rem; }
  .path-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
  .path-card { background: var(--bg2); border: 1px solid var(--rule); border-radius: 12px; padding: 1.1rem 1.2rem; }
  a.path-card { display: block; color: inherit; text-decoration: none; transition: border-color .15s; }
  a.path-card:hover { border-color: var(--accent); }
  .path-card b { display: block; font-size: .95rem; margin-bottom: .3rem; }
  .path-card p { font-size: .84rem; color: var(--muted); margin: 0; }

  @media (max-width: 820px) {
    .subject-grid, .path-grid { grid-template-columns: 1fr; }
    .home-hero-grid { grid-template-columns: 1fr; gap: 1.6rem; }
    .hero-index { display: none; }
    .site-nav .nav-inner { padding: .5rem 1.1rem; gap: .7rem; }
    .brand-text { display: none; }
    .chapter-row { grid-template-columns: 2.4rem minmax(0, 1fr); }
    .chapter-row .c-meta { grid-column: 2; justify-content: flex-start; }
    .crumbs { padding: .8rem 1.1rem 0; }
    .subject-body { padding: 1.8rem 1.1rem 3rem; }
    .home-hero { padding: 2.4rem 0 2rem; }
  }
  @media print {
    .site-nav, .crumbs, .chapter-nav { display: none; }
  }

  /* ============ 本章真题抽屉 ============ */
  .toc-quiz {
    margin: 0 0 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--rule);
  }
  .toc-quiz-title {
    font-size: .72rem; font-weight: 700; letter-spacing: .12em;
    text-transform: uppercase; color: var(--muted);
  }
  .toc-quiz-meta {
    margin: .3rem 0 .6rem;
    font-size: .78rem; color: var(--muted);
  }
  .quiz-open {
    width: 100%;
    padding: .5rem .7rem;
    border: 1px solid var(--accent);
    border-radius: 8px;
    background: var(--accent);
    color: var(--bg2);
    font-family: var(--font);
    font-size: .82rem; font-weight: 700;
    cursor: pointer;
  }
  .quiz-open:hover { filter: brightness(1.08); }

  .quiz-overlay {
    position: fixed; inset: 0;
    background: rgba(23, 26, 31, .38);
    opacity: 0; pointer-events: none;
    transition: opacity .2s;
    z-index: 90;
  }
  .quiz-overlay.open { opacity: 1; pointer-events: auto; }

  .quiz-drawer {
    position: fixed; top: 0; right: 0;
    width: 460px; max-width: 94vw; height: 100%; height: 100dvh;
    display: flex; flex-direction: column;
    background: var(--bg2);
    border-left: 1px solid var(--rule);
    transform: translateX(102%); visibility: hidden;
    transition: transform .25s ease;
    z-index: 95;
  }
  .quiz-drawer.open { transform: translateX(0); visibility: visible; }

  .quiz-head {
    flex: 0 0 auto;
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--rule);
  }
  .quiz-kicker {
    font-size: .7rem; font-weight: 700; letter-spacing: .1em;
    color: var(--accent2); text-transform: uppercase;
  }
  .quiz-title { font-size: 1.2rem; line-height: 1.3; margin-top: .15rem; }
  .quiz-close {
    flex: 0 0 auto;
    width: 2rem; height: 2rem;
    border: 1px solid var(--rule); border-radius: 8px;
    background: var(--bg); color: var(--muted);
    font-size: 1.1rem; line-height: 1; cursor: pointer;
  }
  .quiz-close:hover { color: var(--ink); border-color: var(--accent); }

  .quiz-toolbar {
    flex: 0 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    gap: .8rem; flex-wrap: wrap;
    padding: .65rem 1.2rem;
    border-bottom: 1px solid var(--rule);
    font-size: .78rem; color: var(--muted);
  }
  .quiz-year-label { display: flex; align-items: center; gap: .4rem; }
  .quiz-year {
    font-family: var(--font); font-size: .78rem;
    padding: .25rem .4rem;
    border: 1px solid var(--rule); border-radius: 6px;
    background: var(--bg); color: var(--ink);
  }
  .quiz-stats { font-size: .76rem; }
  .quiz-clear {
    padding: .22rem .5rem;
    border: 1px solid var(--rule); border-radius: 5px;
    background: transparent; color: var(--muted);
    font-family: var(--font); font-size: .72rem;
    cursor: pointer;
  }
  .quiz-clear:hover:not([disabled]) { color: var(--accent2); border-color: var(--accent2); }
  .quiz-clear.armed { color: var(--accent2); border-color: var(--accent2); background: rgba(194, 65, 12, .06); }
  .quiz-clear[disabled] { opacity: .45; cursor: default; }

  .quiz-body { flex: 1 1 auto; overflow: auto; }
  .quiz-content { padding: 1.1rem 1.2rem 2rem; }

  .quiz-qmeta {
    display: flex; flex-wrap: wrap; align-items: center; gap: .45rem;
    margin-bottom: .7rem;
    font-size: .72rem; color: var(--muted);
  }
  .quiz-year-tag, .quiz-topic, .quiz-index {
    padding: .14rem .45rem; border-radius: 4px;
  }
  .quiz-year-tag { background: rgba(36, 80, 179, .08); color: var(--accent); }
  .quiz-topic { background: rgba(194, 65, 12, .08); color: var(--accent2); }
  .quiz-index { margin-left: auto; }

  .quiz-stem {
    font-size: .94rem; line-height: 1.8;
    margin-bottom: .95rem;
  }
  .quiz-stem code, .quiz-option code, .quiz-exp code {
    font-family: var(--font-mono); font-size: .86em;
    background: rgba(36, 80, 179, .08);
    padding: .08em .3em; border-radius: 4px;
  }

  .quiz-option {
    display: flex; align-items: flex-start; gap: .6rem;
    width: 100%;
    padding: .62rem .75rem;
    margin-bottom: .5rem;
    border: 1px solid var(--rule);
    border-radius: 9px;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: .89rem; line-height: 1.7;
    text-align: left;
    cursor: pointer;
    transition: border-color .12s, background .12s;
  }
  .quiz-option:hover:not([disabled]) { border-color: var(--accent); background: rgba(36, 80, 179, .04); }
  .quiz-option .k {
    flex: 0 0 1.3rem;
    font-family: var(--font-mono); font-weight: 700;
    color: var(--accent);
  }
  .quiz-option .txt { min-width: 0; }
  .quiz-option.correct {
    border-color: var(--accent3);
    background: rgba(15, 118, 110, .09);
  }
  .quiz-option.correct .k { color: var(--accent3); }
  .quiz-option.wrong {
    border-color: var(--accent2);
    background: rgba(194, 65, 12, .07);
  }
  .quiz-option.wrong .k { color: var(--accent2); }
  .quiz-option[disabled] { cursor: default; }

  .quiz-exp {
    margin-top: .9rem;
    padding: .85rem .95rem;
    border-left: 3px solid var(--accent3);
    border-radius: 0 8px 8px 0;
    background: rgba(15, 118, 110, .05);
    font-size: .87rem; line-height: 1.85;
  }
  .quiz-exp[hidden] { display: none; }
  .quiz-exp-label {
    font-size: .7rem; font-weight: 700; letter-spacing: .1em;
    color: var(--accent3); margin-bottom: .35rem;
  }

  .quiz-foot {
    flex: 0 0 auto;
    display: flex; align-items: center; justify-content: space-between; gap: .6rem;
    padding: .7rem 1.2rem;
    border-top: 1px solid var(--rule);
    background: var(--bg2);
  }
  .quiz-foot button {
    padding: .42rem .75rem;
    border: 1px solid var(--rule); border-radius: 7px;
    background: var(--bg); color: var(--ink);
    font-family: var(--font); font-size: .8rem;
    cursor: pointer;
  }
  .quiz-foot button:hover:not([disabled]) { border-color: var(--accent); }
  .quiz-foot button[disabled] { opacity: .45; cursor: default; }
  .quiz-src {
    font-size: .74rem; color: var(--muted);
    text-decoration: underline; text-underline-offset: 2px;
  }
  .quiz-src:hover { color: var(--accent); }

  body.quiz-lock { overflow: hidden; }

  @media (max-width: 720px) {
    .back-to-top { right: .85rem; bottom: .85rem; min-width: 2.75rem; min-height: 2.75rem; }
    .back-to-top-text { display: none; }
    .nav-links a { min-height: 40px; display: inline-flex; align-items: center; }
    .quiz-drawer { width: 100%; max-width: 100%; border-left: none; }
    .quiz-head { padding: .75rem 1rem; }
    .quiz-close { width: 2.75rem; height: 2.75rem; }
    .quiz-toolbar { padding: .55rem 1rem; gap: .55rem; }
    .quiz-year, .quiz-clear { min-height: 36px; }
    .quiz-content { padding: 1rem 1rem 1.6rem; }
    .quiz-option { padding: .75rem; }
    .quiz-foot { padding: .65rem 1rem; padding-bottom: max(.65rem, env(safe-area-inset-bottom)); }
    .quiz-foot button { min-height: 42px; }
    .quiz-title { font-size: 1.1rem; }
  }

  @media print {
    .back-to-top, .skip-link, .quiz-overlay, .quiz-drawer { display: none !important; }
  }

  /* ============ 数学一 ============ */
  .math {
    font-family: "Cambria Math", "Times New Roman", "STIX Two Math", serif;
    font-style: italic;
  }
  .math .rm, .math .op { font-style: normal; }
  .math-table td, .math-table th { font-size: .85rem; }
  .math-table td:first-child { white-space: normal; }
  .math-block {
    margin: 1.1rem 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: .15rem 0;
  }
  .math-block .katex-display { margin: .35em 0; }
  .katex { font-size: 1.03em; }
  .katex-display > .katex { font-size: 1.06em; }

  /* ============ 2026 整站结构 ============ */
  :root {
    --track: var(--accent);
    --track-soft: rgba(36, 80, 179, .08);
    --nav-h: 56px;
    --track-h: 44px;
  }
  body[data-track="math"] {
    --track: var(--accent3);
    --track-soft: rgba(15, 118, 110, .09);
  }
  body[data-track="cs408"] {
    --track: var(--accent);
    --track-soft: rgba(36, 80, 179, .08);
  }
  body[data-track="english"] {
    --track: var(--accent2);
    --track-soft: rgba(194, 65, 12, .08);
  }
  html { scroll-padding-top: calc(var(--nav-h) + var(--track-h) + 1.1rem); }

  /* ---------- 顶栏 ---------- */
  .site-nav { background: rgba(245, 241, 232, .92); }
  .site-nav .nav-inner { min-height: var(--nav-h); padding-top: .45rem; padding-bottom: .45rem; }
  .brand-mark { background: var(--ink); color: var(--bg2); }
  .nav-primary {
    display: flex; align-items: center; gap: .15rem; margin-left: auto;
    overflow-x: auto; scrollbar-width: none;
  }
  .nav-primary::-webkit-scrollbar { display: none; }
  .nav-primary a {
    font-size: .86rem; color: var(--muted); text-decoration: none;
    padding: .42rem .72rem; border-radius: 7px; white-space: nowrap;
  }
  .nav-primary a:hover { color: var(--ink); background: rgba(36, 80, 179, .06); }
  .nav-primary a.active { color: var(--track); background: var(--track-soft); font-weight: 700; }
  .menu-toggle {
    display: none;
    margin-left: .4rem;
    padding: .48rem .8rem;
    border: 1px solid var(--rule); border-radius: 8px;
    background: var(--bg2); color: var(--ink);
    font-family: var(--font); font-size: .82rem; font-weight: 700;
    cursor: pointer; white-space: nowrap;
  }
  .menu-toggle:hover { border-color: var(--track); color: var(--track); }

  /* ---------- 上下文栏 ---------- */
  .track-bar {
    position: sticky; top: var(--nav-h); z-index: 75;
    background: rgba(255, 253, 249, .94);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--rule);
  }
  .track-bar-inner {
    max-width: var(--max); margin: 0 auto;
    padding: .35rem 1.75rem;
    display: flex; align-items: center; gap: .2rem;
    overflow-x: auto; scrollbar-width: none;
  }
  .track-bar-inner::-webkit-scrollbar { display: none; }
  .track-tab {
    padding: .38rem .68rem; border-radius: 7px;
    font-size: .8rem; color: var(--muted); text-decoration: none; white-space: nowrap;
  }
  .track-tab:hover { color: var(--ink); background: rgba(36, 80, 179, .05); }
  .track-tab.active { color: var(--track); background: var(--track-soft); font-weight: 700; }

  /* ---------- 章节切换器 ---------- */
  .chap-switch {
    margin-left: auto; flex: 0 0 auto;
    display: flex; align-items: center; gap: .25rem;
  }
  .cs-step, .cs-toggle {
    height: 32px; border: 1px solid var(--rule); border-radius: 7px;
    background: var(--bg2); color: var(--ink);
    display: inline-flex; align-items: center; justify-content: center;
    font-family: var(--font); text-decoration: none; cursor: pointer;
  }
  .cs-step { width: 32px; font-size: 1.15rem; line-height: 1; }
  .cs-step.off { color: var(--rule); cursor: default; }
  .cs-toggle { gap: .45rem; padding: 0 .65rem; font-size: .8rem; max-width: 22rem; }
  .cs-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cs-label b { font-family: var(--font-mono); font-size: .72rem; color: var(--track); margin-right: .4rem; }
  .cs-caret { font-size: .7rem; color: var(--muted); }
  a.cs-step:hover, .cs-toggle:hover, .cs-toggle[aria-expanded="true"] { border-color: var(--track); color: var(--track); }
  .chap-panel {
    position: absolute; left: 0; right: 0; top: 100%; z-index: 90;
    background: var(--bg2); border-bottom: 1px solid var(--rule);
    box-shadow: 0 14px 30px rgba(23, 26, 31, .12);
    max-height: calc(100vh - var(--nav-h) - var(--track-h)); overflow-y: auto;
  }
  .chap-panel[hidden] { display: none; }
  .chap-panel-inner {
    max-width: var(--max); margin: 0 auto; padding: 1rem 1.75rem .6rem;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .4rem 1.4rem;
  }
  .cp-title {
    display: block; font-weight: 700; font-size: .86rem; color: var(--ink); text-decoration: none;
    padding: .3rem .5rem; margin-bottom: .2rem; border-bottom: 1px solid var(--rule);
  }
  .cp-group.here .cp-title { color: var(--track); border-bottom-color: var(--track); }
  .cp-title:hover { color: var(--track); }
  .cp-item {
    display: flex; align-items: baseline; gap: .5rem;
    padding: .34rem .5rem; border-radius: 6px;
    font-size: .8rem; color: var(--muted); text-decoration: none;
  }
  .cp-item:hover, .cp-item:focus-visible { color: var(--ink); background: var(--track-soft); outline: none; }
  .cp-item.on { color: var(--track); background: var(--track-soft); font-weight: 700; }
  .cp-no { font-family: var(--font-mono); font-size: .7rem; color: var(--rule); width: 1.2rem; flex: 0 0 auto; }
  .cp-item.on .cp-no { color: var(--track); }
  .cp-hot { margin-left: auto; font-size: .68rem; color: var(--accent2, #c2410c); }
  .chap-panel-foot {
    max-width: var(--max); margin: 0 auto; padding: .2rem 1.75rem .8rem;
    font-size: .72rem; color: var(--muted);
  }
  .chap-panel-foot kbd {
    font-family: var(--font-mono); font-size: .68rem;
    border: 1px solid var(--rule); border-bottom-width: 2px; border-radius: 4px; padding: 0 .3rem; background: var(--bg);
  }
  .menu-chapter.on { color: var(--track); font-weight: 700; }
  @media (max-width: 700px) {
    .chap-switch { position: sticky; right: 0; padding-left: .4rem; background: var(--bg2); }
    .cs-toggle { max-width: 9.5rem; }
    .cs-label b { display: none; }
    .chap-panel-foot { display: none; }
  }

  /* ---------- 移动目录 ---------- */
  .mobile-menu {
    position: fixed; inset: 0; z-index: 130;
    background: rgba(23, 26, 31, .42);
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity .18s, visibility .18s;
    display: flex; justify-content: flex-end;
  }
  .mobile-menu.open { opacity: 1; visibility: visible; pointer-events: auto; }
  .mobile-menu-panel {
    width: min(92vw, 430px); height: 100%; max-height: 100dvh;
    background: var(--bg2); border-left: 1px solid var(--rule);
    display: flex; flex-direction: column;
    transform: translateX(102%); transition: transform .22s ease;
    box-shadow: -18px 0 50px rgba(23, 26, 31, .16);
  }
  .mobile-menu.open .mobile-menu-panel { transform: translateX(0); }
  .mobile-menu-head {
    flex: 0 0 auto;
    display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
    padding: 1.1rem 1.2rem; border-bottom: 1px solid var(--rule);
  }
  .mobile-menu-head h2 { font-size: 1.15rem; line-height: 1.3; }
  .mobile-menu-close {
    width: 2.6rem; height: 2.6rem; flex: 0 0 auto;
    border: 1px solid var(--rule); border-radius: 9px;
    background: var(--bg); color: var(--muted); font-size: 1.2rem; cursor: pointer;
  }
  .mobile-menu-close:hover { color: var(--ink); border-color: var(--track); }
  .mobile-menu-body { flex: 1 1 auto; overflow: auto; padding: 1rem 1.2rem 2.4rem; }
  .menu-home {
    display: block; padding: .7rem .8rem; margin-bottom: .9rem;
    border: 1px solid var(--rule); border-radius: 9px;
    color: var(--ink); text-decoration: none; font-weight: 700; font-size: .88rem;
  }
  .menu-home:hover { border-color: var(--track); color: var(--track); }
  .menu-section { margin-bottom: 1.2rem; }
  .menu-section-title {
    display: flex; align-items: baseline; justify-content: space-between;
    padding: .45rem .2rem; border-bottom: 1px solid var(--rule);
    color: var(--ink); text-decoration: none; font-weight: 700; font-size: .9rem;
  }
  .menu-section-title span { font-size: .7rem; color: var(--muted); font-weight: 400; }
  .menu-subject, .menu-chapter {
    display: flex; align-items: baseline; gap: .55rem;
    padding: .5rem .2rem; border-bottom: 1px dashed rgba(222, 213, 196, .7);
    color: var(--ink); text-decoration: none; font-size: .84rem;
  }
  .menu-subject b { font-family: var(--font-mono); font-size: .7rem; color: var(--track); width: 2.1rem; }
  .menu-subject span { flex: 1 1 auto; }
  .menu-subject em { font-style: normal; font-size: .72rem; color: var(--muted); }
  .menu-module { margin-top: .6rem; }
  .menu-module-title {
    display: flex; justify-content: space-between;
    font-size: .74rem; font-weight: 700; color: var(--muted);
    padding: .35rem .2rem;
  }
  .menu-chapter { font-size: .8rem; color: var(--muted); padding-left: .8rem; }
  .menu-chapter:hover, .menu-subject:hover { color: var(--track); }
  body.menu-lock { overflow: hidden; }

  /* ---------- 首页学习台 ---------- */
  .dash-hero {
    padding: 3.2rem 0 2.6rem;
    border-bottom: 1px solid var(--rule);
  }
  .dash-hero-grid {
    display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
    gap: 3rem; align-items: center;
  }
  .dash-kicker {
    font-size: .76rem; font-weight: 700; letter-spacing: .1em;
    text-transform: uppercase; color: var(--muted); margin-bottom: 1rem;
  }
  .dash-kicker b { color: var(--accent2); }
  .dash-hero h1 {
    font-size: clamp(2.2rem, 4.6vw, 3.6rem);
    line-height: 1.08; letter-spacing: -.035em; margin-bottom: .9rem;
  }
  .dash-hero h1 .thin { display: block; color: var(--muted); font-weight: 400; font-size: .48em; letter-spacing: -.01em; margin-top: .45rem; }
  .dash-lede { font-size: 1rem; color: var(--muted); max-width: 42em; margin-bottom: 1.5rem; }
  .dash-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
  .dash-btn {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .62rem 1rem; border-radius: 9px;
    border: 1px solid var(--rule); background: var(--bg2); color: var(--ink);
    text-decoration: none; font-size: .86rem; font-weight: 700;
  }
  .dash-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--bg2); }
  .dash-btn:hover { border-color: var(--accent); }
  .dash-btn.primary:hover { filter: brightness(1.08); }

  .progress-board {
    background: var(--bg2); border: 1px solid var(--rule);
    border-radius: 14px; padding: 1.1rem 1.2rem;
    position: relative;
  }
  .progress-board::after {
    content: ""; position: absolute; inset: 6px;
    border: 1px dashed var(--rule); border-radius: 10px; pointer-events: none;
  }
  .progress-board-title {
    font-size: .72rem; font-weight: 700; letter-spacing: .1em;
    text-transform: uppercase; color: var(--muted); margin-bottom: .8rem;
    position: relative; z-index: 1;
  }
  .progress-item { position: relative; z-index: 1; margin-bottom: .85rem; }
  .progress-item:last-child { margin-bottom: 0; }
  .progress-top { display: flex; justify-content: space-between; align-items: baseline; gap: .8rem; margin-bottom: .3rem; }
  .progress-top b { font-size: .86rem; }
  .progress-top span { font-size: .74rem; color: var(--muted); font-family: var(--font-mono); }
  .progress-bar { height: 5px; background: var(--rule); border-radius: 999px; overflow: hidden; }
  .progress-fill { display: block; height: 100%; border-radius: 999px; background: var(--track); }
  .progress-fill.math { background: var(--accent3); }
  .progress-fill.english { background: var(--accent2); }
  .progress-fill.exam { background: #6d28d9; }

  .home-board { padding: 2.4rem 0; border-bottom: 1px solid var(--rule); }
  .home-board-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
  .home-board-head h2 { font-size: 1.35rem; }
  .home-board-head p { font-size: .84rem; color: var(--muted); margin: 0; }
  .track-panels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
  .track-panel {
    background: var(--bg2); border: 1px solid var(--rule);
    border-radius: 12px; padding: 1.15rem 1.2rem;
    border-top: 3px solid var(--track);
  }
  .track-panel:nth-child(2) { border-top-color: var(--accent3); }
  .track-panel:nth-child(3), .track-panel.t-english { border-top-color: var(--accent2); }
  .track-panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: .35rem; }
  .track-panel-head h3 { font-size: 1.2rem; margin: 0; padding: 0; border: none; }
  .panel-link { font-size: .78rem; font-weight: 700; color: var(--track); text-decoration: none; white-space: nowrap; }
  .track-panel:nth-child(2) .panel-link { color: var(--accent3); }
  .track-panel:nth-child(3) .panel-link, .track-panel.t-english .panel-link { color: var(--accent2); }
  .panel-link:hover { text-decoration: underline; text-underline-offset: 3px; }
  .subject-lines { margin-top: .7rem; }
  .subject-line {
    display: grid; grid-template-columns: 2.6rem minmax(0, 1fr) auto;
    gap: .7rem; align-items: center;
    padding: .62rem .2rem; border-bottom: 1px dashed rgba(222, 213, 196, .75);
    color: var(--ink); text-decoration: none;
  }
  .subject-line:last-child { border-bottom: none; }
  .subject-line:hover .sl-main b { color: var(--track); }
  .track-panel:nth-child(2) .subject-line:hover .sl-main b { color: var(--accent3); }
  .track-panel:nth-child(3) .subject-line:hover .sl-main b,
  .track-panel.t-english .subject-line:hover .sl-main b { color: var(--accent2); }
  .sl-code { font-family: var(--font-mono); font-size: .68rem; font-weight: 700; color: var(--muted); }
  .sl-main { min-width: 0; }
  .sl-main b { display: block; font-size: .88rem; line-height: 1.35; }
  .sl-main span { display: block; font-size: .74rem; color: var(--muted); line-height: 1.45; }
  .sl-score { font-family: var(--font-mono); font-size: .74rem; color: var(--muted); }

  /* ---------- 全部章节索引 ---------- */
  .index-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-bottom: .8rem; }
  .filter-chip {
    padding: .34rem .65rem; border: 1px solid var(--rule); border-radius: 999px;
    background: var(--bg2); color: var(--muted);
    font-family: var(--font); font-size: .76rem; font-weight: 700; cursor: pointer;
  }
  .filter-chip:hover { border-color: var(--track); color: var(--track); }
  .filter-chip.active { background: var(--track); border-color: var(--track); color: var(--bg2); }
  .index-count { margin-left: auto; font-size: .76rem; color: var(--muted); font-family: var(--font-mono); }
  .index-wrap { max-height: none; }
  .index-table { font-size: .84rem; }
  .index-table th { white-space: nowrap; }
  .index-table td { vertical-align: middle; }
  .index-table td:first-child { white-space: nowrap; }
  .index-table a { color: var(--ink); text-decoration: none; font-weight: 700; }
  .index-table a:hover { color: var(--track); }
  .index-table tr[hidden] { display: none; }
  .index-table .stars-sm { font-size: .72rem; }

  /* ---------- 真题区 ---------- */
  .exam-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
  .exam-card {
    background: var(--bg2); border: 1px solid var(--rule);
    border-radius: 12px; padding: 1.2rem 1.3rem;
    display: flex; flex-direction: column; gap: .45rem;
  }
  .exam-card .subj-code { font-family: var(--font-mono); font-size: .7rem; color: var(--muted); letter-spacing: .08em; }
  .exam-card h3 { margin: 0; padding: 0; border: none; font-size: 1.15rem; }
  .exam-card p { font-size: .85rem; color: var(--muted); margin: 0; }
  .exam-actions { margin-top: auto; padding-top: .7rem; display: flex; gap: .6rem; flex-wrap: wrap; }
  .exam-actions a { font-size: .8rem; font-weight: 700; color: var(--accent); text-decoration: none; }
  .exam-actions a:hover { text-decoration: underline; text-underline-offset: 3px; }

  /* ---------- 复习主线 ---------- */
  .route-block { margin-bottom: 1.3rem; }
  .route-block:last-child { margin-bottom: 0; }
  .route-label { font-size: .74rem; font-weight: 700; letter-spacing: .08em; color: var(--muted); margin-bottom: .45rem; }
  .route-line { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
  .route-node {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .38rem .6rem; border: 1px solid var(--rule); border-radius: 7px;
    background: var(--bg2); color: var(--ink); text-decoration: none; font-size: .8rem;
  }
  .route-node b { font-family: var(--font-mono); font-size: .68rem; color: var(--track); }
  .route-node:hover { border-color: var(--track); }
  .route-arrow { color: var(--rule); font-size: .8rem; }

  /* ---------- 科目台 ---------- */
  .subject-masthead { padding: 2.6rem 0 1.8rem; border-bottom: 1px solid var(--rule); }
  .subject-masthead-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2rem; align-items: end; }
  .subject-masthead h1 { font-size: clamp(2rem, 4vw, 2.8rem); line-height: 1.12; letter-spacing: -.02em; margin: .25rem 0 .55rem; }
  .subject-masthead .subject-lede { max-width: 46em; color: var(--muted); font-size: .94rem; margin: 0; }
  .subject-facts { display: flex; gap: 1.4rem; flex-wrap: wrap; }
  .subject-fact b { display: block; font-family: var(--font-mono); font-size: 1.15rem; color: var(--track); line-height: 1.2; }
  .subject-fact span { font-size: .72rem; color: var(--muted); }
  .subject-layout {
    display: grid; grid-template-columns: 240px minmax(0, 1fr);
    gap: 2.4rem; max-width: 1320px; margin: 0 auto;
    padding: 2rem 1.75rem 4rem;
    align-items: start;
  }
  .subject-aside { position: sticky; top: calc(var(--nav-h) + var(--track-h) + 1.2rem); display: flex; flex-direction: column; gap: .8rem; }
  .aside-card { background: var(--bg2); border: 1px solid var(--rule); border-radius: 11px; padding: .95rem 1rem; }
  .aside-card h3 { font-size: .84rem; margin: 0 0 .5rem; padding: 0; border: none; }
  .aside-stats { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; }
  .aside-stat b { display: block; font-family: var(--font-mono); font-size: 1.05rem; color: var(--track); line-height: 1.2; }
  .aside-stat span { font-size: .68rem; color: var(--muted); }
  .aside-list { list-style: none; padding: 0; margin: 0; }
  .aside-list li { display: flex; justify-content: space-between; gap: .6rem; padding: .3rem 0; border-bottom: 1px dashed rgba(222, 213, 196, .7); font-size: .78rem; }
  .aside-list li:last-child { border-bottom: none; }
  .aside-list a { color: var(--ink); text-decoration: none; }
  .aside-list a:hover { color: var(--track); }
  .aside-actions { display: flex; flex-direction: column; gap: .45rem; }
  .aside-actions a, .aside-actions button {
    display: block; text-align: center; padding: .45rem .6rem;
    border: 1px solid var(--rule); border-radius: 7px;
    background: var(--bg); color: var(--ink); text-decoration: none;
    font-family: var(--font); font-size: .78rem; font-weight: 700; cursor: pointer;
  }
  .aside-actions a.primary, .aside-actions button.primary { background: var(--track); border-color: var(--track); color: var(--bg2); }
  .aside-actions a:hover, .aside-actions button:hover { border-color: var(--track); }
  .subject-main { min-width: 0; }
  .subject-main > section { margin-bottom: 2.2rem; }
  .subject-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .7rem; }
  .subject-section-head h2 { font-size: 1.3rem; }
  .subject-section-head p { font-size: .78rem; color: var(--muted); margin: 0; }
  .chapter-group-label { margin: 1.1rem 0 .35rem; scroll-margin-top: calc(var(--nav-h) + var(--track-h) + 1rem); }
  .chapter-group-label:first-child { margin-top: 0; }
  .subject-main .chapter-row { background: var(--bg2); }
  .subject-main .chapter-row h3 { font-size: .95rem; }
  .subject-main .path-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  /* 408 hub */
  .hub-hero { padding: 2.6rem 0 1.8rem; border-bottom: 1px solid var(--rule); }
  .hub-hero h1 { font-size: clamp(2rem, 4vw, 2.8rem); line-height: 1.12; letter-spacing: -.02em; margin: .25rem 0 .55rem; }
  .hub-hero p { max-width: 48em; color: var(--muted); font-size: .94rem; margin: 0; }
  .hub-subjects { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; margin: 0 0 2rem; }
  .hub-subject {
    display: block; background: var(--bg2); border: 1px solid var(--rule);
    border-radius: 11px; padding: .9rem 1rem; color: var(--ink); text-decoration: none;
  }
  .hub-subject:hover { border-color: var(--track); }
  .hub-subject .subj-code { font-size: .66rem; }
  .hub-subject h3 { font-size: .98rem; margin: .2rem 0 .25rem; padding: 0; border: none; }
  .hub-subject p { font-size: .74rem; color: var(--muted); margin: 0; }
  .hub-subject .status { margin-top: .45rem; display: inline-block; }
  .hub-body { max-width: 1320px; margin: 0 auto; padding: 1.4rem 1.75rem 4rem; }
  .hub-section { margin-bottom: 2.2rem; }
  .hub-section h2 { font-size: 1.3rem; margin-bottom: .6rem; }

  /* ---------- 章节页三栏 ---------- */
  .toc { top: calc(var(--nav-h) + var(--track-h) + 1.2rem); }
  .layout-3col {
    grid-template-columns: 196px minmax(0, 1fr) 232px;
    grid-template-areas: "toc main rail";
    gap: 1.8rem;
  }
  .layout-3col .toc { grid-area: toc; }
  .layout-3col main { grid-area: main; }
  .layout-3col .chapter-rail { grid-area: rail; }
  .chapter-rail {
    position: sticky; top: calc(var(--nav-h) + var(--track-h) + 1.2rem);
    align-self: start;
    max-height: calc(100vh - var(--nav-h) - var(--track-h) - 2.4rem);
    overflow: auto;
    display: flex; flex-direction: column; gap: .65rem;
    font-size: .82rem;
  }
  .toc-quiz .quiz-open { background: var(--track); border-color: var(--track); }
  .score-table th { white-space: nowrap; }
  .score-table td:nth-child(2), .score-table td:nth-child(3) { white-space: nowrap; }
  .rail-card {
    background: var(--bg2); border: 1px solid var(--rule);
    border-radius: 10px; padding: .85rem .95rem;
  }
  .rail-label {
    font-size: .66rem; font-weight: 700; letter-spacing: .11em;
    text-transform: uppercase; color: var(--muted); margin-bottom: .4rem;
  }
  .rail-body { line-height: 1.72; color: var(--ink); }
  .rail-body p { margin-bottom: .45rem; }
  .rail-body p:last-child { margin-bottom: 0; }
  .rail-body strong { font-weight: 700; }
  .rail-body ul { margin: 0; padding-left: 1rem; }
  .rail-body li { margin-bottom: .35rem; }
  .rail-more { color: var(--muted); font-size: .74rem; }
  .rail-quiz-btn, .rail-quiz-link {
    display: inline-flex; align-items: center; justify-content: center;
    width: 100%; margin-top: .25rem; padding: .45rem .6rem;
    border: 1px solid var(--track); border-radius: 7px;
    background: var(--track); color: var(--bg2);
    font-family: var(--font); font-size: .78rem; font-weight: 700;
    text-decoration: none; cursor: pointer;
  }
  .rail-quiz-link { background: var(--bg); color: var(--track); }
  .rail-quiz-btn:hover, .rail-quiz-link:hover { filter: brightness(1.05); }
  .rail-nav-links a {
    display: block; padding: .45rem 0;
    border-bottom: 1px dashed rgba(222, 213, 196, .7);
    color: var(--ink); text-decoration: none;
  }
  .rail-nav-links a:last-child { border-bottom: none; }
  .rail-nav-links a span { display: block; font-size: .66rem; color: var(--muted); font-weight: 400; }
  .rail-nav-links a:hover { color: var(--track); }
  .chapter-cta {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1.2rem; flex-wrap: wrap;
    background: var(--bg2); border: 1px solid var(--rule);
    border-left: 3px solid var(--track);
    border-radius: 0 10px 10px 0;
    padding: 1rem 1.15rem; margin: 2rem 0 0;
  }
  .chapter-cta h3 { margin: .1rem 0 .25rem; padding: 0; border: none; font-size: 1.05rem; }
  .chapter-cta p { margin: 0; }
  .cta-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
  .cta-primary, .cta-secondary {
    display: inline-flex; align-items: center;
    padding: .5rem .8rem; border-radius: 8px;
    font-size: .8rem; font-weight: 700; text-decoration: none;
    border: 1px solid var(--track); background: var(--track); color: var(--bg2);
    cursor: pointer; font-family: var(--font);
  }
  .cta-secondary { background: var(--bg); color: var(--ink); border-color: var(--rule); }
  .cta-secondary:hover { border-color: var(--track); color: var(--track); }

  /* ---------- 新结构响应式 ---------- */
  @media (max-width: 1239px) {
    .layout-3col {
      grid-template-columns: minmax(0, 1fr);
      grid-template-areas: "toc" "rail" "main";
      gap: 1.2rem;
    }
    .layout-3col .toc {
      position: sticky; top: calc(var(--nav-h) + var(--track-h));
      z-index: 40; width: 100%; max-height: none; overflow: visible;
      display: flex; align-items: center; gap: .6rem;
      border: 1px solid var(--rule); border-radius: 12px;
      background: rgba(255, 253, 249, .96); padding: .5rem .6rem;
      box-shadow: 0 5px 16px rgba(23, 26, 31, .05);
    }
    .layout-3col .toc-title { display: none; }
    .layout-3col .toc-filter { flex: 0 0 auto; margin: 0; padding: 0; border: 0; }
    .layout-3col .toc-filter .switch { min-height: 40px; gap: .3rem; font-size: .74rem; }
    .layout-3col .toc-filter .switch span { display: none; }
    .layout-3col .toc-filter .switch::after { content: "只看高频"; }
    .layout-3col .toc > nav { flex: 1 1 auto; min-width: 0; }
    .layout-3col .toc ol {
      display: flex; gap: .4rem; overflow-x: auto; padding: 0; scrollbar-width: none;
    }
    .layout-3col .toc ol::-webkit-scrollbar { display: none; }
    .layout-3col .toc li { flex: 0 0 auto; margin: 0; }
    .layout-3col .toc a {
      min-height: 40px; align-items: center; white-space: nowrap;
      border: 1px solid var(--rule); background: var(--bg2);
    }
    .layout-3col .toc a.active { border-color: var(--track); }
    .layout-3col .chapter-rail {
      position: static; max-height: none; overflow: visible;
      display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: .65rem;
    }
    .layout-3col .chapter { scroll-margin-top: 7rem; }
  }
  @media (max-width: 1000px) {
    .toc { top: calc(var(--nav-h) + var(--track-h)); }
    .site-nav .brand-text { display: inline; }
    .dash-hero-grid { grid-template-columns: 1fr; gap: 1.6rem; }
    .track-panels, .exam-grid { grid-template-columns: 1fr; }
    .hub-subjects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .subject-layout { grid-template-columns: 1fr; gap: 1.2rem; padding: 1.4rem 1.1rem 3rem; }
    .subject-aside { position: static; }
    .subject-masthead-grid { grid-template-columns: 1fr; gap: .8rem; }
    .subject-facts { gap: 1.2rem; }
    .subject-main .path-grid { grid-template-columns: 1fr; }
    .nav-primary { display: none; }
    .menu-toggle { display: inline-flex; margin-left: auto; }
  }
  @media (max-width: 720px) {
    .dash-hero { padding: 2.2rem 0 1.8rem; }
    .dash-hero h1 { font-size: clamp(2rem, 9vw, 2.7rem); }
    .home-board { padding: 1.8rem 0; }
    .home-board-head { display: block; }
    .home-board-head p { margin-top: .2rem; }
    .subject-line { grid-template-columns: 2.2rem minmax(0, 1fr) auto; gap: .5rem; }
    .index-table { min-width: 0; }
    .index-table thead { display: none; }
    .index-table, .index-table tbody, .index-table tr, .index-table td { display: block; width: 100%; }
    .index-table tr {
      border: 1px solid var(--rule); border-radius: 10px;
      background: var(--bg2); margin-bottom: .55rem; padding: .5rem .7rem;
    }
    .index-table td { border: none; padding: .15rem 0; display: flex; gap: .6rem; }
    .index-table td::before {
      content: attr(data-label);
      flex: 0 0 3.2rem; font-size: .7rem; color: var(--muted); font-weight: 700;
    }
    .index-table td:first-child { border: none; padding-top: .1rem; }
    .index-table td:first-child::before { content: none; }
    .index-table td:last-child { padding-bottom: .1rem; }
    .layout-3col .chapter-rail { grid-template-columns: 1fr; }
    .chapter-cta { display: block; }
    .cta-actions { margin-top: .7rem; }
    .hub-subjects { grid-template-columns: 1fr; }
    .route-line { gap: .3rem; }
  }

  @media print {
    .track-bar, .mobile-menu, .chapter-rail, .chapter-cta, .menu-toggle { display: none !important; }
  }

