/* ===========================================================
   风青云 · 考研数学真题长卷  —  水墨设计系统
   =========================================================== */
:root {
  /* 宣纸 · 昼 */
  --bg: #f1ede1;
  --bg-grad-a: #f4f0e5;
  --bg-grad-b: #ece7d8;
  --panel: #faf8f0;
  --panel-2: #f3efe3;
  --ink: #232b24;
  --ink-soft: #5a6258;
  --ink-faint: #717a6f;       /* 提升到 AA 对比的弱化文字 */
  --line: #ddd6c4;
  --line-soft: #e8e2d2;
  --accent: #2f5d4e;          /* 黛青松绿 */
  --accent-2: #47816d;
  --accent-soft: #e2eae2;
  --seal: #b03d30;            /* 朱砂 */
  --seal-soft: #f3e1dc;
  --gold: #97803f;
  --good: #2f7d52;
  --warn: #946615;
  --paper: #fbf9f1;
  --rice: #fbf9f1;            /* 宣纸印章底（昼） */
  --on-accent: #fbf9f1;      /* 填充控件（松绿等）上的文字：昼=宣纸白 / 夜=深墨 */
  --rod: #2c3530;             /* 卷杆漆色 */
  --shadow-card: 0 16px 38px -20px rgba(44, 58, 48, .5);
  --shadow-pop: 0 34px 80px -30px rgba(30, 42, 34, .6);
  --radius: 14px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-soft: cubic-bezier(.4, .14, .3, 1);
  --side-w: 248px;
  --dash-w: 312px;
  --bad: #b03d30;             /* 难题/警示，复用朱砂调 */
  --topbar-h: 64px;          /* 顶栏高度，sticky 偏移用 */
  --font-brush: "STKaiti", "KaiTi", "楷体", "FangSong", "仿宋", "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", "宋体", serif;
}
[data-theme="dark"] {
  /* 夜墨 */
  --bg: #0d1311;
  --bg-grad-a: #101715;
  --bg-grad-b: #0a0f0d;
  --panel: #161f1b;
  --panel-2: #121a16;
  --ink: #e6e4d6;
  --ink-soft: #a4ab9e;
  --ink-faint: #8b9183;
  --line: #27332c;
  --line-soft: #1d2722;
  --accent: #5d9c85;
  --accent-2: #79b39c;
  --accent-soft: #1c2b25;
  --seal: #c9564a;
  --seal-soft: #34201c;
  --gold: #b39a5a;
  --good: #57a87b;
  --paper: #18221d;
  --rice: #18221d;
  --on-accent: #0d1311;
  --rod: #060a08;
  --shadow-card: 0 18px 46px -22px rgba(0, 0, 0, .85);
  --shadow-pop: 0 40px 90px -30px rgba(0, 0, 0, .9);
}

* { box-sizing: border-box; }
html {
  height: 100%;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
}
body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  /* Solid base only. The parallax gradient lives on the fixed .ink-bg layer
     below, so we avoid the scroll-repaint cost of background-attachment:fixed. */
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-x: none;
  overflow-x: hidden;
}
@supports (overflow: clip) {
  html, body { overflow-x: clip; }
}
button { font-family: inherit; cursor: pointer; }

/* ───────── 键盘焦点环（全局，加在阴影之上，不影响布局）───────── */
:focus-visible {
  outline: 2.5px solid var(--accent-2);
  outline-offset: 2px;
}
:focus:not(:focus-visible) { outline: none; }

/* ───────── 水墨远山 + 云霭 ───────── */
.ink-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  /* The fixed gradient is painted once here instead of on the scrolling body. */
  background:
    radial-gradient(1100px 600px at 85% -10%, var(--accent-soft) 0%, transparent 55%),
    linear-gradient(165deg, var(--bg-grad-a), var(--bg-grad-b));
}
.ink-mountains { position: absolute; bottom: 0; left: 0; width: 100%; height: 38vh; opacity: .5; }
.ink-mountains path { fill: var(--accent); }
.ink-mountains .m1 { opacity: .10; }
.ink-mountains .m2 { opacity: .16; }
.ink-mountains .m3 { opacity: .07; }
.cloud {
  position: absolute; border-radius: 999px;
  /* Soft falloff gradient replaces the per-frame blur filter, so the drift is a
     pure GPU transform (no re-rasterization each frame). */
  background: radial-gradient(closest-side, color-mix(in srgb, var(--panel) 70%, transparent) 0%, transparent 78%);
  opacity: .5; will-change: transform;
}
.cloud.c1 { width: 440px; height: 64px; top: 18%; left: -140px; animation: drift 90s linear infinite; }
.cloud.c2 { width: 340px; height: 50px; top: 38%; left: -220px; animation: drift 120s linear infinite 12s; }
.cloud.c3 { width: 540px; height: 74px; top: 62%; left: -320px; animation: drift 105s linear infinite 30s; }
@keyframes drift {
  from { transform: translate3d(-10%, 0, 0); }
  to { transform: translate3d(120vw, 0, 0); }
}

.topbar, .layout, .reader { position: relative; z-index: 1; }
.topbar, .layout, .main, .dash { max-width: 100vw; }

/* ───────── Top bar ───────── */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 22px;
  padding: 10px 22px;
  /* More opaque panel + lighter blur: keeps the frosted look while cutting the
     per-scroll-frame backdrop-filter recompute cost. */
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  animation: dropIn .6s var(--ease) both;
}
/* .topbar prefix beats `.icon-btn { display: grid }`, so the ☰ stays hidden on
   desktop (where the 考点 sidebar is already inline). It only shows ≤880px. */
.topbar .menu-btn { display: none; flex: 0 0 auto; }
.drawer-scrim {
  position: fixed; inset: 0; z-index: 64;
  /* Dim overlay only — no backdrop blur (the "液态玻璃" frost). */
  background: rgba(16, 22, 18, .42);
  transition: opacity .2s var(--ease);
}
.drawer-scrim[hidden] { display: none; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-art {
  position: relative; width: 44px; height: 44px; border-radius: 10px; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--gold) 55%, var(--line));
  box-shadow: 0 6px 16px -6px rgba(30, 42, 34, .5);
  background: var(--rod);
}
.brand-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-art .brand-seal {
  display: none; position: absolute; inset: 0;
  font-family: var(--font-brush); font-size: 26px; font-weight: 700; color: #f5f1e6;
  background:
    radial-gradient(circle at 50% 42%, transparent 13px, color-mix(in srgb, #f5f1e6 22%, transparent) 14px, transparent 15px),
    linear-gradient(150deg, #233830, #16241e);
  text-align: center; line-height: 44px;
}
.brand-art.noimg img { display: none; }
.brand-art.noimg .brand-seal { display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.12; }
.brand-text strong { font-family: var(--font-brush); font-size: 21px; letter-spacing: 3px; }
.brand-text em { font-style: normal; font-size: 11px; color: var(--ink-faint); letter-spacing: 1px; }

.topnav { display: flex; gap: 6px; margin-left: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--ink-soft); border: 0; background: transparent;
  padding: 7px 13px; border-radius: 999px; cursor: pointer;
  transition: .25s var(--ease); white-space: nowrap;
}
.chip:hover { background: var(--accent-soft); color: var(--accent); }
.chip.is-active { color: var(--on-accent); background: var(--accent); box-shadow: 0 8px 18px -10px var(--accent); }
.chip i { width: 14px; height: 14px; display: inline-block; opacity: .85; }
.tutorial-chip {
  border: 1px solid color-mix(in srgb, var(--seal) 28%, transparent);
  color: var(--seal);
  background: color-mix(in srgb, var(--seal-soft) 52%, transparent);
}
.tutorial-chip:hover {
  color: var(--paper);
  background: var(--seal);
  border-color: var(--seal);
}
.mock-chip {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 58%, transparent);
}
.wrong-chip {
  color: var(--seal);
  background: color-mix(in srgb, var(--seal-soft) 46%, transparent);
}

.topctl { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.seg {
  position: relative; display: flex; padding: 4px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px;
}
.seg-btn {
  position: relative; z-index: 2; border: 0; background: transparent;
  color: var(--ink-soft); font-size: 13.5px; font-weight: 600;
  padding: 7px 16px; border-radius: 9px; transition: color .3s var(--ease);
  white-space: nowrap;
}
.seg-btn.is-active { color: #f5f1e6; }
.seg-glow {
  position: absolute; z-index: 1; top: 4px; left: 4px; height: calc(100% - 8px);
  border-radius: 9px; background: linear-gradient(140deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 18px -8px var(--accent);
  transition: transform .42s var(--ease), width .42s var(--ease);
}
.seg-glow.no-anim { transition: none; }  /* 首次定位与 resize 时不滑动 */
.icon-btn {
  width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--ink-soft);
  display: grid; place-items: center; transition: .25s var(--ease);
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
.access-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 38px;
  border: 1px solid var(--line); border-radius: 11px;
  background: var(--panel-2); color: var(--ink-soft);
  padding: 0 12px; font-size: 12.5px; font-weight: 700;
  white-space: nowrap; transition: .25s var(--ease);
}
.access-btn:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
.access-buy {
  display: inline-flex; align-items: center; justify-content: center;
  height: 38px; padding: 0 13px;
  border: 1px solid color-mix(in srgb, var(--seal) 34%, var(--line));
  border-radius: 11px;
  background: color-mix(in srgb, var(--seal-soft) 72%, var(--panel));
  color: var(--seal);
  font-size: 12.5px; font-weight: 800;
  text-decoration: none; white-space: nowrap;
  transition: .25s var(--ease);
}
.access-buy:hover {
  border-color: var(--seal);
  background: var(--seal);
  color: #f5f1e6;
  transform: translateY(-1px);
}
.access-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ink-faint); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink-faint) 14%, transparent);
}
.access-dot[data-status="paid"], .access-dot[data-status="trial"], .access-dot[data-status="trial_available"] {
  background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 16%, transparent);
}
.access-dot[data-status="expired"] {
  background: var(--seal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--seal) 16%, transparent);
}

/* ───────── Layout ───────── */
.layout { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr) var(--dash-w); align-items: start; }
.sidebar {
  position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h));
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 55%, transparent);
  display: flex; flex-direction: column;
  animation: slideRight .6s var(--ease) both;
}
.side-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
  padding: 16px 18px 10px; font-size: 13px; font-weight: 700; color: var(--ink-soft);
  letter-spacing: 2px; font-family: var(--font-brush);
}
.side-actions { display: flex; justify-content: flex-end; gap: 6px; flex-wrap: wrap; min-width: 0; }
.mini { border: 0; background: var(--seal-soft); color: var(--seal); font-size: 11.5px; padding: 4px 9px; border-radius: 7px; }
.mini.primary { background: var(--accent); color: var(--on-accent); }
.side-close { display: none; }
.side-scroll { overflow-y: auto; padding: 4px 8px 30px; scrollbar-width: thin; }
.loading { color: var(--ink-faint); font-size: 13px; padding: 16px; }

.t-lv1 { margin-top: 6px; }
.t-lv1 > .t-row { font-weight: 700; color: var(--ink); font-size: 13.5px; }
.t-row {
  display: flex; align-items: center; gap: 8px; width: 100%;
  text-align: left; border: 0; background: transparent; color: var(--ink-soft);
  padding: 8px 10px; border-radius: 9px; font-size: 13px; transition: .2s var(--ease);
}
.t-row:hover { background: var(--accent-soft); color: var(--accent); }
.t-row .caret { width: 12px; transition: transform .25s var(--ease); opacity: .6; font-size: 10px; }
.t-row.open .caret { transform: rotate(90deg); }
.t-row .cnt { margin-left: auto; font-size: 11px; color: var(--ink-faint);
  background: var(--line-soft); padding: 1px 7px; border-radius: 999px; }
.t-children { overflow: hidden; }
.t-lv2 > .t-row { font-weight: 600; color: var(--ink); }
.t-lv3 { padding-left: 22px; }
.t-leaf {
  display: flex; align-items: center; gap: 7px; width: 100%; text-align: left;
  border: 0; background: transparent; color: var(--ink-soft);
  padding: 6px 10px; border-radius: 8px; font-size: 12.5px; transition: .18s var(--ease);
}
.t-leaf:hover { background: var(--accent-soft); color: var(--accent); transform: translateX(2px); }
.t-leaf.active { background: var(--accent); color: var(--paper); }
.t-leaf .cnt { margin-left: auto; font-size: 10.5px; opacity: .8; }
.t-leaf.active .cnt { color: var(--paper); }

/* ───────── Hero · 卷首 ───────── */
.main { padding: 24px 30px 60px; min-width: 0; }
.hero {
  position: relative; display: flex; align-items: stretch; gap: 22px;
  padding: 18px 22px; margin-bottom: 16px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--panel) 92%, transparent), color-mix(in srgb, var(--panel-2) 80%, transparent));
  overflow: hidden; animation: rise .6s var(--ease) both;
}
.hero::after { /* 墨圈 */
  content: ""; position: absolute; right: -60px; top: -90px; width: 280px; height: 280px;
  border: 14px solid color-mix(in srgb, var(--accent) 14%, transparent);
  border-radius: 50%; transform: rotate(-12deg); pointer-events: none;
  mask-image: linear-gradient(200deg, #000 55%, transparent 78%);
}
.hero-scroll-title {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 6px 10px 8px; border-right: 1px dashed var(--line);
}
.vtitle {
  writing-mode: vertical-rl; font-family: var(--font-brush);
  font-size: 30px; font-weight: 700; letter-spacing: 8px; color: var(--ink);
}
.vseal {
  writing-mode: vertical-rl; font-family: var(--font-brush);
  font-size: 12px; letter-spacing: 3px; color: #f5f1e6;
  background: var(--seal); border-radius: 4px; padding: 7px 4px;
  box-shadow: 0 4px 10px -4px var(--seal);
}
.hero-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.hero-row { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.hero h1 { margin: 0; font-size: 24px; letter-spacing: 1px; font-family: var(--font-brush); }
.hero-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  font-size: 12px; font-weight: 600; color: var(--accent);
  background: var(--accent-soft); padding: 4px 11px; border-radius: 999px;
}
.pill.ghost { background: transparent; border: 1px dashed var(--seal); color: var(--seal); }
.pill.good { color: var(--good); background: color-mix(in srgb, var(--good) 12%, transparent); }
.hero-sub { margin: 8px 0 0; color: var(--ink-faint); font-size: 13px; letter-spacing: .5px; }
.hero-plaque {
  align-self: center; flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--gold) 60%, var(--line));
  border-radius: 8px; padding: 10px 14px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--panel) 85%, var(--gold) 6%), var(--panel-2));
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 35%, transparent), 0 8px 18px -12px rgba(30,42,34,.6);
}
.hero-plaque span {
  font-family: var(--font-brush); font-size: 19px; font-weight: 700;
  letter-spacing: 6px; color: var(--ink);
  border-bottom: 2px solid var(--seal); padding-bottom: 3px;
}

/* ───────── 长卷 · 挂轴墙 ───────── */
.wall-wrap {
  position: relative; margin: 4px -6px 0; max-width: 100%; overflow-x: clip;
  perspective: 1150px; perspective-origin: 50% 42%;
}
.spine { /* 时间轴脊线 */
  position: absolute; left: 6px; right: 6px; top: 26px; height: 2px; z-index: 0;
  background: repeating-linear-gradient(90deg, var(--line) 0 14px, transparent 14px 22px);
  pointer-events: none;
}
.wall {
  position: relative; z-index: 1;
  display: flex; align-items: flex-start; gap: 12px; padding: 18px 26px 36px;
  overflow-x: auto; overflow-y: hidden; scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  transform-style: preserve-3d;
}
.wall::-webkit-scrollbar { height: 10px; }
.wall::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }

.col {
  position: relative;
  scroll-snap-align: center; flex: 0 0 212px; display: flex; flex-direction: column; align-items: center;
  /* Skip layout/paint of off-screen year columns (only ~6 of 40 are visible),
     so building the wall and scrolling stay cheap. Cards are fixed-size, so the
     reserved intrinsic size is exact and won't cause scroll jumps. */
  content-visibility: auto;
  contain-intrinsic-size: 212px 380px;
  transform-style: preserve-3d;
  isolation: isolate;
}
.col::after {
  content: "";
  position: absolute; left: 16px; right: 16px; top: 330px; height: 24px; z-index: -1;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(40, 50, 44, .24), transparent 72%);
  filter: blur(5px);
  opacity: calc(.42 - var(--deck-dim, .12));
  transform: translateX(var(--deck-x, 0px)) scaleX(calc(1.08 - var(--deck-dim, .1)));
  pointer-events: none;
}
.col-year { /* 年份印章节点 */
  position: relative; z-index: 2;
  font-family: var(--font-brush); font-weight: 700; font-size: 15px; letter-spacing: 1px;
  color: var(--seal); background: var(--paper);
  border: 1.5px solid var(--seal); border-radius: 6px;
  padding: 3px 10px; margin-bottom: 14px;
  box-shadow: 0 3px 8px -4px var(--seal);
  transition: .3s var(--ease);
}
.col-year.mock-year {
  max-width: 176px;
  min-height: 31px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: normal;
  line-height: 1.15;
  font-size: 13px;
  letter-spacing: .5px;
}
.col.match .col-year { color: #f5f1e6; background: var(--seal); }
.col.dim { opacity: .3; filter: grayscale(.5); }

.card { /* 挂轴 */
  position: relative; width: 190px; height: 318px; border-radius: 4px 4px 12px 12px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.22), transparent 15%, transparent 84%, rgba(38,49,42,.08)),
    var(--paper);
  border: 1px solid color-mix(in srgb, var(--line) 88%, var(--ink) 8%);
  box-shadow:
    0 20px 42px -30px rgba(25, 34, 29, .72),
    -8px 0 18px -18px rgba(25, 34, 29, .55),
    8px 0 18px -18px rgba(25, 34, 29, .42);
  overflow: visible; cursor: pointer;
  transform-origin: top center;
  transform:
    translate3d(var(--deck-x, 0px), var(--deck-y, 0px), var(--deck-z, 0px))
    rotateX(var(--rx, 0deg))
    rotateY(calc(var(--deck-ry, 0deg) + var(--ry, 0deg)))
    rotateZ(var(--deck-rz, 0deg))
    scale(var(--deck-scale, 1));
  filter: saturate(calc(1 - var(--deck-dim, 0) * .55)) brightness(calc(1 - var(--deck-dim, 0) * .26));
  transition:
    transform .42s cubic-bezier(.2,.72,.18,1),
    filter .42s var(--ease),
    box-shadow .42s var(--ease),
    border-color .3s var(--ease);
  animation: scrollDown .56s var(--ease) both;
  will-change: transform;
  backface-visibility: hidden;
  contain: layout;
}
/* On filter/type rebuilds the cascade is suppressed so switching feels instant. */
.wall.no-card-anim .card { animation: none; }
/* The 3D tilt context only matters on hover-capable devices; keeping it off
   touch devices drops ~40 always-composited layers (a big mobile win). */
@media (hover: hover) { .card { transform-style: preserve-3d; } }
.card::before { /* 卷杆 */
  content: ""; position: absolute; left: -10px; right: -10px; top: -7px; height: 10px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--rod) 80%, #fff 12%), var(--rod));
  border-radius: 999px; z-index: 7;
  box-shadow: 0 3px 6px -2px rgba(0,0,0,.4);
}
.card::after { /* 卷尾纸色渐隐 */
  content: ""; position: absolute; inset: auto 0 0 0; height: 110px;
  background: linear-gradient(to top, var(--paper) 14%, transparent);
  pointer-events: none; z-index: 3; border-radius: 0 0 12px 12px;
}
.card:hover {
  transform:
    translate3d(var(--deck-x, 0px), calc(var(--deck-y, 0px) - 12px), calc(var(--deck-z, 0px) + 74px))
    rotateX(calc(var(--rx, 0deg) + 2deg))
    rotateY(calc(var(--deck-ry, 0deg) + var(--ry, 0deg)))
    rotateZ(var(--deck-rz, 0deg))
    scale(1.035);
  filter: saturate(1.02) brightness(1);
  box-shadow:
    0 34px 66px -34px rgba(24, 34, 29, .78),
    0 14px 28px -24px var(--accent),
    -10px 0 22px -20px rgba(25, 34, 29, .48),
    10px 0 22px -20px rgba(25, 34, 29, .38);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}
.card.all-done { border-color: color-mix(in srgb, var(--good) 55%, var(--line)); }
.card.is-mock {
  border-color: color-mix(in srgb, var(--accent) 36%, var(--line));
  background:
    linear-gradient(90deg, rgba(255,255,255,.2), transparent 15%, transparent 84%, rgba(47,93,78,.08)),
    var(--paper);
}
.card.is-mock .card-head b { color: var(--accent); }
.card .sheen {
  position: absolute; inset: 0; z-index: 4; pointer-events: none; opacity: 0; border-radius: inherit;
  background: radial-gradient(420px circle at var(--mx,50%) var(--my,0%), rgba(255,252,240,.55), transparent 42%);
  transition: opacity .3s var(--ease);
}
.card:hover .sheen { opacity: .9; }
[data-theme="dark"] .card .sheen { background: radial-gradient(420px circle at var(--mx,50%) var(--my,0%), rgba(120,170,150,.16), transparent 42%); }

.card-head {
  position: relative; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 11px 8px; border-bottom: 1px dashed var(--line);
}
.card-head b { font-size: 12.5px; color: var(--ink); font-family: var(--font-brush); letter-spacing: 1px; }
.card-head .qn { font-size: 10.5px; color: var(--ink-faint); padding-right: 18px; }
.card-mini {
  position: absolute; inset: 78px 0 0 0; padding: 10px 12px;
  font-size: 6.6px; line-height: 1.55; color: var(--ink-soft);
  overflow: hidden; z-index: 1;
}
.card-mini .q { display: flex; gap: 4px; margin-bottom: 5px; min-width: 0; }
.card-mini .q-no {
  flex: 0 0 auto; width: 11px; height: 11px; font-size: 6.5px; border-radius: 2px;
  background: var(--seal-soft); color: var(--seal); display: grid; place-items: center; font-weight: 700;
}
.card-mini .q-body {
  min-width: 0;
  overflow: hidden;
  overflow-wrap: break-word;
  word-break: keep-all;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.card-mini .katex { font-size: .92em; }
.card-mini .ph { color: var(--ink-faint); }
.card-mini img {
  display: block; max-width: 72px; max-height: 48px;
  object-fit: contain; margin: 2px 0;
  border: 1px solid var(--line-soft); border-radius: 3px;
  background: #fff;
}
.card-mini .katex-display { margin: 2px 0; overflow: hidden; }
.card-progress {
  position: absolute; left: 10px; right: 10px; bottom: 36px; height: 4px; z-index: 6;
  background: var(--line-soft); border-radius: 999px; overflow: hidden;
}
.card-progress span { display: block; height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--good), var(--accent-2)); transition: width .5s var(--ease); }
.card-tags { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 6; display: flex; gap: 4px; flex-wrap: wrap; }
.tag { font-size: 9px; padding: 2px 6px; border-radius: 5px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.tag.ana { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.tag.done { background: var(--line-soft); color: var(--ink-soft); }
.tag.marked { background: var(--seal-soft); color: var(--seal); }
.card .open-hint {
  position: absolute; z-index: 8; left: 50%; bottom: 14px; transform: translate(-50%, 10px);
  background: var(--accent); color: #f5f1e6; font-size: 11.5px; font-weight: 600;
  font-family: var(--font-brush); letter-spacing: 4px;
  padding: 6px 16px; border-radius: 999px; opacity: 0;
  transition: .3s var(--ease); box-shadow: 0 10px 22px -10px var(--accent);
}
.card:hover .open-hint { opacity: 1; transform: translate(-50%, 0); }
.year-badge {
  position: absolute; top: 34px; right: 8px; z-index: 8;
  min-width: 22px; height: 22px; padding: 0 5px; border-radius: 5px;
  background: var(--seal); color: #f5f1e6; font-size: 11.5px; font-weight: 700;
  display: grid; place-items: center; box-shadow: 0 6px 14px -6px var(--seal);
  animation: stamp .35s var(--ease) both;
}

.scroll-arr {
  position: absolute; top: 52%; z-index: 12; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: color-mix(in srgb, var(--panel) 90%, transparent);
  backdrop-filter: blur(6px); color: var(--ink-soft); font-size: 22px; line-height: 1;
  box-shadow: var(--shadow-card); transition: .25s var(--ease); opacity: 0;
}
.wall-wrap:hover .scroll-arr { opacity: 1; }
.scroll-arr:hover { color: var(--accent); transform: scale(1.08); }
.scroll-arr.left { left: -2px; } .scroll-arr.right { right: -2px; }

@media (hover: none), (max-width: 880px) {
  .wall-wrap { perspective: none; overflow-x: hidden; }
  .wall {
    gap: 14px;
    padding: 12px 10px 30px;
    transform-style: flat;
    scroll-snap-type: x mandatory;
  }
  .col {
    flex-basis: 202px;
    transform-style: flat;
    contain-intrinsic-size: 202px 368px;
  }
  .col::after {
    opacity: .22;
    transform: translateY(-2px);
  }
  .card {
    transform: translateY(var(--deck-y, 0px)) scale(var(--deck-scale, 1));
    filter: none;
    transition: transform .24s var(--ease), box-shadow .24s var(--ease), border-color .2s var(--ease);
    will-change: auto;
  }
  .card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
  }
}

@media (prefers-reduced-motion: reduce) {
  .wall-wrap { perspective: none; }
  .wall { transform-style: flat; }
  .col { transform-style: flat; }
  .card {
    transform: none !important;
    filter: none !important;
    will-change: auto;
  }
}

/* ───────── 考点分值排行 ───────── */
.progress { margin-top: 14px; padding: 18px 20px; border: 1px solid var(--line);
  border-radius: var(--radius); background: color-mix(in srgb, var(--panel) 62%, transparent); }
.prog-head { display: flex; justify-content: space-between; align-items: center;
  font-size: 13.5px; font-weight: 700; color: var(--ink-soft); margin-bottom: 12px;
  font-family: var(--font-brush); letter-spacing: 1.5px; }
.legend { display: inline-flex; align-items: center; gap: 6px; font-weight: 500;
  color: var(--ink-faint); font-family: inherit; font-size: 12px; letter-spacing: 0; }
.legend .dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.bars { display: flex; flex-direction: column; gap: 6px; }
.topic-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  border: 1px solid transparent; background: transparent; text-align: left;
  padding: 8px 10px; border-radius: 10px; transition: .22s var(--ease);
}
.topic-row:hover { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.topic-row.active { background: var(--accent-soft); border-color: var(--accent); }
.topic-rank {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 6px;
  display: grid; place-items: center;
  font-size: 11.5px; font-weight: 800; color: var(--seal);
  border: 1px solid color-mix(in srgb, var(--seal) 45%, transparent);
  font-family: var(--font-brush);
}
.topic-row.active .topic-rank { background: var(--seal); color: #f5f1e6; }
.topic-main { flex: 0 0 220px; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.topic-main strong { font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topic-main em { font-style: normal; font-size: 11px; color: var(--ink-faint); }
.topic-score { flex: 0 0 64px; font-size: 13px; font-weight: 700; color: var(--accent); text-align: right; }
.topic-meter {
  flex: 1 1 auto; position: relative; height: 10px; border-radius: 999px;
  background: var(--line-soft); overflow: hidden;
}
.topic-meter i { position: absolute; inset: 0 auto 0 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); opacity: .35; }
.topic-meter b { position: absolute; inset: 0 auto 0 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--good), var(--accent-2)); }
.topic-meter em {
  position: absolute; top: 0; bottom: 0; border-radius: inherit;
  display: block; transition: width .5s var(--ease), left .5s var(--ease);
}
.topic-meter .seg-correct { left: 0; background: var(--good); }
.topic-meter .seg-wrong { background: var(--seal); }
.topic-pct { flex: 0 0 76px; font-size: 11.5px; color: var(--ink-faint); text-align: right; }

/* ───────── 站内公告 ───────── */
.site-announcement {
  position: fixed; inset: 0; z-index: 100100;
  display: grid; place-items: center; padding: 24px;
}
.site-announcement[hidden] { display: none; }
.site-announcement-scrim {
  position: absolute; inset: 0;
  background: color-mix(in srgb, #111813 58%, transparent);
  backdrop-filter: blur(8px);
}
.site-announcement-sheet {
  position: relative; width: min(460px, calc(100vw - 48px));
  border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--line));
  border-radius: 12px; overflow: hidden;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--panel) 96%, transparent), color-mix(in srgb, var(--panel-2) 98%, transparent)),
    var(--panel);
  box-shadow: var(--shadow-pop);
  padding: 18px;
  animation: cardIn .28s var(--ease) both;
}
.site-announcement.is-closing .site-announcement-sheet { animation: cardOut .22s var(--ease) both; }
.site-announcement-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid var(--line);
}
.site-announcement-kicker {
  display: block; margin-bottom: 3px; font-size: 12px; color: var(--seal);
}
.site-announcement-head h2 {
  margin: 0; font-family: var(--font-brush); font-size: 25px; letter-spacing: 2px;
}
.site-announcement p {
  margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.8;
}
.site-announcement a { color: var(--accent); font-weight: 800; text-decoration: none; }
.site-announcement a:hover { text-decoration: underline; }
.site-announcement-actions {
  display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px;
}
.site-announcement-actions button {
  min-width: 92px; height: 38px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink-soft);
  font-size: 13px; font-weight: 800; transition: .18s var(--ease);
}
.site-announcement-actions button:hover { border-color: var(--accent); color: var(--accent); }
.site-announcement-actions #announcementDismissToday {
  border-color: var(--accent); background: var(--accent); color: var(--on-accent);
}
.site-announcement-actions #announcementDismissToday:hover { filter: brightness(1.03); color: var(--on-accent); }

/* ───────── Reader · 展卷 ───────── */
.reader { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; }
.reader[hidden] { display: none; }
.reader-scrim { position: absolute; inset: 0; background: rgba(16, 22, 18, .5); backdrop-filter: blur(4px); animation: fade .35s var(--ease) both; }
.sheet {
  position: relative; width: min(940px, calc(100vw - 36px)); height: min(92vh, 1000px);
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px 6px 18px 18px;
  box-shadow: var(--shadow-pop); display: flex; flex-direction: column; overflow: visible;
  animation: unroll .55s var(--ease) both; transform-origin: top center;
}
.sheet-rod {
  position: absolute; left: -14px; right: -14px; top: -9px; height: 13px; z-index: 5;
  background: linear-gradient(180deg, color-mix(in srgb, var(--rod) 80%, #fff 14%), var(--rod));
  border-radius: 999px; box-shadow: 0 4px 10px -3px rgba(0,0,0,.5);
}
.sheet-rod::before, .sheet-rod::after {
  content: ""; position: absolute; top: -3px; width: 18px; height: 19px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, color-mix(in srgb, var(--gold) 80%, #fff 25%), var(--gold));
}
.sheet-rod::before { left: -8px; } .sheet-rod::after { right: -8px; }
.sheet-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 12px; border-bottom: 1px dashed var(--line);
  background: color-mix(in srgb, var(--panel-2) 75%, transparent);
  border-radius: 6px 6px 0 0;
}
.sheet-id { display: flex; align-items: baseline; gap: 10px; }
.sheet-year {
  font-size: 21px; font-weight: 800; letter-spacing: 1px; color: #f5f1e6;
  font-family: var(--font-brush); background: var(--seal);
  border-radius: 6px; padding: 2px 11px; box-shadow: 0 5px 12px -5px var(--seal);
}
.sheet-type { font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.sheet-tools { display: flex; align-items: center; gap: 8px; }
.tool { border: 1px solid var(--line); background: var(--panel-2); color: var(--ink-soft);
  font-size: 12.5px; padding: 7px 12px; border-radius: 9px; transition: .2s var(--ease); }
.tool:hover { color: var(--accent); border-color: var(--accent); }
.tool.toggle.on { background: var(--accent); color: #f5f1e6; border-color: var(--accent); }
.tool.close { width: 36px; padding: 0; font-size: 15px; }
.reader-mode {
  display: inline-flex; align-items: center; gap: 3px; flex: none;
  padding: 3px; border: 1px solid var(--line); border-radius: 10px;
  background: color-mix(in srgb, var(--panel-2) 86%, transparent);
}
.mode-btn {
  border: 0; background: transparent; color: var(--ink-soft); cursor: pointer;
  border-radius: 7px; padding: 5px 9px; font-size: 12px; font-weight: 700;
  white-space: nowrap; transition: .18s var(--ease);
}
.mode-btn:hover { color: var(--accent); background: var(--accent-soft); }
.mode-btn.is-active { background: var(--accent); color: #f5f1e6; box-shadow: 0 6px 14px -10px var(--accent); }

.sheet-scroll { overflow-y: auto; padding: 30px clamp(20px, 5vw, 64px) 40px; scroll-behavior: smooth; }
.paper { max-width: 760px; margin: 0 auto; color: var(--ink); }
.paper-end { text-align: center; padding: 28px 0 50px; }
.end-seal {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  font-family: var(--font-brush); font-size: 20px; font-weight: 700; color: var(--seal);
  border: 2px solid var(--seal); border-radius: 8px; transform: rotate(-6deg);
  opacity: .75;
}

/* ───────── 使用教程视频 ───────── */
.tutorial-modal {
  position: fixed; inset: 0; z-index: 92;
  display: grid; place-items: center; padding: 24px;
}
.tutorial-modal[hidden] { display: none; }
.tutorial-scrim {
  position: absolute; inset: 0;
  background: color-mix(in srgb, #111813 58%, transparent);
  backdrop-filter: blur(8px);
}
.tutorial-sheet {
  position: relative; width: min(1080px, calc(100vw - 48px));
  border: 1px solid color-mix(in srgb, var(--gold) 35%, var(--line));
  border-radius: 12px; overflow: hidden;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--panel) 96%, transparent), color-mix(in srgb, var(--panel-2) 98%, transparent)),
    var(--panel);
  box-shadow: var(--shadow-pop);
}
.tutorial-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 16px 12px; border-bottom: 1px solid var(--line);
}
.tutorial-kicker {
  display: block; margin-bottom: 2px; font-size: 12px; color: var(--seal);
}
.tutorial-head h2 {
  margin: 0; font-family: var(--font-brush); font-size: 24px; letter-spacing: 2px;
}
.tutorial-close { flex: 0 0 auto; }
.tutorial-video-wrap {
  width: 100%; aspect-ratio: 16 / 9; background: #0d1311;
}
.tutorial-video {
  display: block; width: 100%; height: 100%;
  object-fit: contain; background: #0d1311;
}

/* ───────── 真题墙访问 / 兑换 ───────── */
.access-modal {
  position: fixed; inset: 0; z-index: 94;
  display: grid; place-items: center; padding: 24px;
}
.access-modal[hidden] { display: none; }
.access-scrim {
  position: absolute; inset: 0;
  background: color-mix(in srgb, #111813 54%, transparent);
  backdrop-filter: blur(8px);
}
.access-sheet {
  position: relative; width: min(440px, calc(100vw - 48px));
  border: 1px solid color-mix(in srgb, var(--gold) 35%, var(--line));
  border-radius: 12px; overflow: hidden;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--panel) 96%, transparent), color-mix(in srgb, var(--panel-2) 98%, transparent)),
    var(--panel);
  box-shadow: var(--shadow-pop);
}
.access-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 16px 12px; border-bottom: 1px solid var(--line);
}
.access-kicker {
  display: block; margin-bottom: 2px; font-size: 12px; color: var(--seal);
}
.access-head h2 {
  margin: 0; font-family: var(--font-brush); font-size: 24px; letter-spacing: 2px;
}
.access-body { padding: 16px; }
.access-state {
  display: flex; flex-direction: column; gap: 5px;
  padding: 13px 14px; border: 1px solid var(--line);
  border-radius: 10px; background: color-mix(in srgb, var(--accent-soft) 42%, transparent);
}
.access-state strong { color: var(--accent); font-size: 16px; }
.access-state[data-status="expired"] strong { color: var(--seal); }
.access-state span { color: var(--ink-soft); font-size: 13px; line-height: 1.6; }
.access-user {
  margin: 12px 2px 14px; color: var(--ink-faint); font-size: 12.5px;
}
.access-buy-wide {
  display: flex; align-items: center; justify-content: center;
  height: 40px; margin: 0 0 14px;
  border: 1px solid color-mix(in srgb, var(--seal) 42%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--seal-soft) 78%, var(--panel));
  color: var(--seal);
  font-size: 13px; font-weight: 850;
  text-decoration: none;
  transition: .2s var(--ease);
}
.access-buy-wide:hover {
  border-color: var(--seal);
  background: var(--seal);
  color: #f5f1e6;
}
.access-redeem-form label {
  display: block; margin-bottom: 7px; color: var(--ink-soft);
  font-size: 12.5px; font-weight: 700;
}
.access-input-row { display: flex; gap: 8px; }
.access-input-row input {
  min-width: 0; flex: 1 1 auto; height: 40px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--paper); color: var(--ink);
  padding: 0 12px; font: inherit; outline: none;
}
.access-input-row input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.access-input-row button {
  flex: 0 0 auto; height: 40px; border: 0; border-radius: 10px;
  padding: 0 16px; background: var(--accent); color: var(--on-accent);
  font-weight: 800;
}
.access-input-row button:disabled { opacity: .65; cursor: wait; }
.access-feedback {
  min-height: 20px; margin-top: 10px; font-size: 12.5px; color: var(--ink-faint);
}
.access-feedback[data-tone="ok"] { color: var(--good); }
.access-feedback[data-tone="bad"] { color: var(--seal); }

.paper .p-title { font-size: 22px; font-weight: 800; text-align: center; margin: 0 0 6px; line-height: 1.45; font-family: var(--font-brush); letter-spacing: 1px; }
.paper .p-meta { text-align: center; font-size: 12.5px; color: var(--ink-faint); margin: 0 0 10px; }
.paper .p-sec {
  display: flex; align-items: baseline; gap: 10px;
  font-size: 17.5px; font-weight: 800; color: var(--accent);
  font-family: var(--font-brush); letter-spacing: 1.5px;
  margin: 34px 0 16px; padding-left: 12px; border-left: 4px solid var(--seal);
  scroll-margin-top: 12px;
}
.paper .p-sec + .q { margin-top: 6px; }
.paper[data-reader-mode="objective"] .p-section[data-kind="solve"],
.paper[data-reader-mode="solve"] .p-section[data-kind="choice"],
.paper[data-reader-mode="solve"] .p-section[data-kind="blank"] {
  display: none;
}
.paper .sec-note { font-size: 12px; font-weight: 500; color: var(--ink-faint); font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; letter-spacing: 0; }
.paper .p-note { font-size: 13px; color: var(--ink-faint); margin: 2px 0 14px; }
.paper .md-h { font-size: 14.5px; font-weight: 700; margin: 10px 0 4px; }
.paper .q { display: flex; gap: 12px; margin: 18px 0; padding: 2px 0; animation: qIn .5s var(--ease) both; }
.paper .q.is-done > .q-no { background: var(--good); color: #f5f1e6; }
.paper .q.is-correct > .q-no { background: var(--good); color: #f5f1e6; box-shadow: 0 0 0 2px color-mix(in srgb, var(--good) 26%, transparent); }
.paper .q.is-wrong > .q-no { background: var(--seal); color: #f5f1e6; box-shadow: 0 0 0 2px color-mix(in srgb, var(--seal) 30%, transparent); }
.paper .q.is-marked > .q-no { box-shadow: 0 0 0 2px var(--seal); }
.paper .q-no { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 7px;
  background: var(--seal-soft); color: var(--seal); font-weight: 800; font-size: 13.5px;
  display: grid; place-items: center; font-family: var(--font-brush); }
.paper .q-body { flex: 1 1 auto; min-width: 0; line-height: 1.85; font-size: 15.5px; }
/* 松紧分层：题干正文保持疏朗，选项/徽标等短行收紧成可扫读的块 */
.paper .opts, .paper .opts li { line-height: 1.5; }
.paper .q-badges, .paper .q-actions { line-height: 1.3; }
.paper .opts { list-style: none; margin: 10px 0 0; padding: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; }
.paper .opts li { position: relative; display: grid; grid-template-columns: 20px minmax(0, 1fr) 28px; align-items: center; gap: 8px; min-height: 38px; padding: 7px 10px; border-radius: 9px;
  background: var(--panel-2); border: 1px solid var(--line-soft); transition: .2s var(--ease); }
.paper .opts li.choice-option { cursor: pointer; user-select: none; }
.paper .opts li.choice-option:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.paper .q.is-answered .choice-option { cursor: default; opacity: .82; transform: none; }
.paper .q.is-answered .choice-option:hover { transform: none; border-color: var(--line-soft); background: var(--panel-2); }
.paper .choice-option.is-picked { border-color: var(--accent); background: var(--accent-soft); opacity: 1; }
.paper .choice-option.is-right-pick,
.paper .choice-option.is-correct-choice {
  border-color: var(--good); background: color-mix(in srgb, var(--good) 12%, var(--panel-2));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--good) 16%, transparent);
}
.paper .choice-option.is-wrong-choice {
  border-color: var(--seal); background: color-mix(in srgb, var(--seal) 12%, var(--panel-2));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--seal) 16%, transparent);
  animation: choiceShake .28s var(--ease) both;
}
.paper .choice-stamp {
  position: relative; justify-self: center; align-self: center;
  width: 25px; height: 25px; border-radius: 7px;
  display: grid; place-items: center;
  pointer-events: none;
  opacity: 0; transform: scale(.86); transform-origin: 50% 50%;
  background: color-mix(in srgb, var(--rice) 82%, transparent);
  font-family: var(--font-brush), "KaiTi", "STKaiti", serif;
  font-size: 18px; line-height: 1; font-weight: 900;
}
.paper .choice-stamp::before {
  content: "";
  display: block;
  transform: translateY(-.5px);
}
.paper .choice-option.is-right-pick .choice-stamp,
.paper .choice-option.is-correct-choice .choice-stamp,
.paper .choice-option.is-wrong-choice .choice-stamp {
  opacity: 1;
  transform-origin: 50% 50%;
  animation: choiceStamp .28s var(--ease) both;
}
.paper .choice-option.is-right-pick .choice-stamp,
.paper .choice-option.is-correct-choice .choice-stamp {
  color: var(--good); border: 1.5px solid var(--good);
}
.paper .choice-option.is-right-pick .choice-stamp::before,
.paper .choice-option.is-correct-choice .choice-stamp::before {
  content: "✓";
}
.paper .choice-option.is-wrong-choice .choice-stamp::before {
  content: "✗";
}
.paper .choice-option.is-wrong-choice .choice-stamp {
  color: var(--seal); border: 1.5px solid var(--seal);
}
.paper .opts .ok { font-weight: 800; color: var(--accent); }
.paper .opts .choice-text { min-width: 0; overflow-wrap: break-word; word-break: keep-all; }
.paper img { max-width: 100%; border-radius: 10px; border: 1px solid var(--line); margin: 10px 0; }
.paper .inline-img { display: block; width: auto; max-height: 240px; object-fit: contain; background: #fff; }
.paper .opts .inline-img { max-width: min(100%, 300px); margin: 2px 0; }
.paper p { margin: 6px 0; }
/* 概率分布表 / GFM 表格 */
.md-table-wrap { overflow-x: auto; margin: 10px 0; }
.md-table { border-collapse: collapse; font-size: 14px; min-width: min(100%, 280px); background: var(--panel); }
.md-table th, .md-table td {
  border: 1px solid var(--line); padding: 5px 12px; text-align: center; white-space: nowrap;
}
.md-table thead th { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.md-table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--panel-2) 60%, transparent); }
.ana-text .md-table-wrap { margin: 8px 0; }
.katex { font-size: 1.0em; }
.katex-display {
  overflow-x: auto; overflow-y: hidden; padding: 4px 0;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}
.paper code {
  white-space: normal;
  overflow-wrap: anywhere;
  color: var(--seal);
  background: color-mix(in srgb, var(--seal-soft) 42%, transparent);
  border-radius: 4px;
  padding: 1px 3px;
}

/* badges + 练习按钮 + 解析 */
.q-badges { display: flex; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.q-badge { font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.q-badge.topic { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink-soft); }
.q-badge.score { background: var(--accent-soft); color: var(--accent); }
.q-badge.origin { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.q-badge.also { background: var(--line-soft); color: var(--ink-faint); }
.q-badge.src { background: var(--seal-soft); color: var(--seal); }

.q-actions { display: inline-flex; gap: 6px; margin: 10px 8px 0 0; }
.q-mark {
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink-soft);
  font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 999px;
  transition: .2s var(--ease);
}
.q-mark:hover { border-color: var(--accent); color: var(--accent); }
.q-mark.done.on { background: var(--good); border-color: var(--good); color: #f5f1e6; }
.q-mark.star.on { background: var(--seal); border-color: var(--seal); color: #f5f1e6; }
.q-mark.eval.correct.on { background: var(--good); border-color: var(--good); color: #f5f1e6; }
.q-mark.eval.wrong.on { background: var(--seal); border-color: var(--seal); color: #f5f1e6; }
.q-mark.eval.correct.suggested:not(.on) {
  border-color: var(--good); color: var(--good);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--good) 14%, transparent);
}

.choice-feedback {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px;
  color: var(--ink-soft); font-size: 12px;
}
.choice-feedback[hidden] { display: none; }
.choice-feedback.is-correct .choice-msg { color: var(--good); }
.choice-feedback.is-wrong .choice-msg { color: var(--seal); }
.choice-reset {
  border: 0; background: transparent; color: var(--accent); cursor: pointer;
  padding: 2px 4px; font-size: 12px; font-weight: 700;
}
.choice-reset:hover { color: var(--seal); text-decoration: underline; }
.choice-reasons { width: 100%; margin-top: 2px; }

.ana-btn {
  margin-top: 10px; border: 1px solid var(--line); background: var(--panel-2);
  color: var(--accent); font-size: 12.5px; font-weight: 600;
  padding: 6px 14px; border-radius: 999px; transition: .22s var(--ease);
}
.ana-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.ana-btn.on { background: var(--accent); color: #f5f1e6; border-color: var(--accent); }
.ana-btn.has-new-result:not(.on)::after {
  content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 6px;
  border-radius: 50%; background: var(--seal); vertical-align: middle;
}

.fill-answer {
  margin-top: 10px; padding: 10px 12px; border: 1px dashed var(--line);
  border-radius: 10px; background: color-mix(in srgb, var(--panel-2) 76%, transparent);
}
.fill-answer label {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12.5px; font-weight: 700; color: var(--ink-soft);
}
.fill-input {
  flex: 1 1 180px; min-width: min(180px, 100%); max-width: 100%;
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel);
  color: var(--ink); padding: 7px 10px; font-size: 13px; outline: none;
}
.fill-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.fill-check {
  margin-left: 8px; border: 1px solid var(--accent); background: var(--accent-soft);
  color: var(--accent); border-radius: 8px; padding: 6px 11px; cursor: pointer;
  font-size: 12px; font-weight: 700; transition: .18s var(--ease);
}
.fill-check:hover { background: var(--accent); color: #f5f1e6; }
.fill-compare {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px;
  margin-top: 10px;
}
.fill-compare[hidden] { display: none; }
.fill-compare > div {
  min-width: 0; padding: 8px 9px; border-radius: 8px; border: 1px solid var(--line-soft);
  background: var(--panel);
}
.fill-label {
  display: block; margin-bottom: 3px; color: var(--ink-faint); font-size: 11px; font-weight: 700;
}
.fill-compare strong,
.fill-compare .fill-std {
  display: block; color: var(--ink); font-size: 13px;
  overflow-wrap: normal; word-break: keep-all;
}
.fill-compare .fill-std p { margin: 0; }
.fill-std-line {
  display: inline-block; max-width: 100%; overflow-x: auto; overflow-y: hidden;
  vertical-align: top; white-space: nowrap;
}
.fill-std-line + .fill-std-line { margin-left: 6px; }
.fill-std-display { display: block; margin: 0; white-space: normal; }
.fill-std-math .katex { white-space: nowrap; }
.fill-compare .fill-std .katex { color: var(--ink); }
.fill-compare .fill-std .katex-display {
  margin: 0; max-width: 100%; overflow-x: auto; overflow-y: hidden;
}
.fill-compare .fill-eval {
  grid-column: 1 / -1; padding: 0; border: 0; background: transparent;
}
.fill-compare .self-eval { margin: 0; padding: 0; border: 0; }
.fill-answer.is-exact .fill-mine { color: var(--good); }

.q-ana {
  margin-top: 12px; padding: 14px 16px; border-radius: 12px;
  background: var(--panel-2); border: 1px solid var(--line);
  animation: qIn .35s var(--ease) both;
}
.self-eval { margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.self-main { display: flex; flex-wrap: wrap; gap: 7px; }
.reason-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.reason-chips.is-hidden { display: none; }
.reason-chip,
.choice-reason-chip {
  border: 1px solid var(--line); background: var(--panel); color: var(--ink-soft);
  font-size: 11.5px; font-weight: 600; padding: 4px 9px; border-radius: 999px;
  transition: .18s var(--ease);
}
.reason-chip:hover,
.choice-reason-chip:hover { border-color: var(--seal); color: var(--seal); }
.reason-chip.on,
.choice-reason-chip.on { background: var(--seal-soft); border-color: var(--seal); color: var(--seal); }
.ana-source { font-size: 11px; color: var(--ink-faint); margin-bottom: 8px; letter-spacing: .5px; }
.ans-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.ans-k {
  flex: 0 0 auto; font-size: 11.5px; font-weight: 800; color: #f5f1e6;
  background: var(--good); padding: 2px 10px; border-radius: 999px;
}
.ans-v { font-weight: 600; }
.ans-v p { display: inline; margin: 0; }
.ana-pts { display: flex; flex-wrap: wrap; gap: 5px; margin: 4px 0 10px; }
.ana-pts .pt { font-size: 10.5px; color: var(--ink-soft); background: var(--line-soft); padding: 2px 8px; border-radius: 6px; }
.ana-part { margin-top: 10px; }
.ana-label {
  font-size: 12.5px; font-weight: 800; color: var(--accent);
  margin-bottom: 4px; letter-spacing: 2px; font-family: var(--font-brush);
}
.ana-text { font-size: 14px; line-height: 1.85; color: var(--ink); }
.ana-text p { margin: 5px 0; }

/* ───────── keyframes ───────── */
@keyframes dropIn { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
@keyframes slideRight { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes scrollDown { /* 挂轴垂落 */
  from { opacity: 0; transform: translateY(-14px) rotateX(20deg); }
  70% { opacity: 1; }
  to { opacity: 1; transform: none; }
}
@keyframes unroll {
  from { opacity: 0; transform: translateY(18px) scaleY(.92); }
  to { opacity: 1; transform: none; }
}
/* 收卷 / 关闭：与展开对称的退出动画，避免“瞬间消失” */
@keyframes cardIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes cardOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(14px); } }
@keyframes unrollOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(14px) scaleY(.94); } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
.reader.is-closing .sheet { animation: unrollOut .3s var(--ease-soft) both; }
.reader.is-closing .reader-scrim,
.tutorial-modal.is-closing .tutorial-scrim,
.access-modal.is-closing .access-scrim { animation: fadeOut .3s var(--ease) both; }
.tutorial-modal.is-closing .tutorial-sheet,
.access-modal.is-closing .access-sheet { animation: unrollOut .3s var(--ease-soft) both; }
@keyframes qIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes stamp {
  from { opacity: 0; transform: scale(1.6) rotate(8deg); }
  to { opacity: 1; transform: none; }
}
@keyframes choiceStamp {
  from { opacity: 0; transform: scale(1.32) rotate(-8deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes choiceShake {
  0%, 100% { transform: translateX(0); }
  28% { transform: translateX(-3px); }
  62% { transform: translateX(3px); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .05ms !important; }
  .cloud { display: none; }
}

/* ───────── 全局搜索 ───────── */
.search {
  position: relative; flex: 1 1 280px; max-width: 440px; min-width: 0;
  display: flex; align-items: center;
}
.search-ic { position: absolute; left: 12px; width: 15px; height: 15px; color: var(--ink-faint); pointer-events: none; }
.search input {
  width: 100%; border: 1px solid var(--line); background: var(--panel-2);
  color: var(--ink); border-radius: 10px; padding: 8px 12px 8px 34px;
  font-size: 13px; transition: .2s var(--ease); outline: none;
}
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search input::placeholder { color: var(--ink-faint); }
.search-pop {
  position: absolute; top: calc(100% + 7px); left: 0; right: 0; z-index: 60;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-pop); padding: 6px; max-height: 60vh; overflow-y: auto;
  animation: dropIn .25s var(--ease) both;
}
.sr-group { font-size: 10.5px; letter-spacing: 1px; color: var(--ink-faint); padding: 7px 10px 3px; }
.sr-item {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  border: 0; background: transparent; color: var(--ink); cursor: pointer;
  padding: 8px 10px; border-radius: 8px; font-size: 13px; transition: .15s var(--ease);
}
.sr-item:hover, .sr-item.active { background: var(--accent-soft); color: var(--accent); }
.sr-item .sr-tag {
  font-size: 10.5px; padding: 1px 7px; border-radius: 999px;
  background: var(--line-soft); color: var(--ink-faint); flex: none;
}
.sr-item .sr-sub { margin-left: auto; font-size: 11px; color: var(--ink-faint); }
.sr-empty { padding: 14px 10px; color: var(--ink-faint); font-size: 12.5px; text-align: center; }

/* ───────── 总览状态栏 ───────── */
.summary {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  margin: 16px 30px 0; padding: 14px 20px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--panel) 92%, transparent), color-mix(in srgb, var(--panel-2) 82%, transparent));
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  animation: dropIn .55s var(--ease) both;
}
.sum-id { display: flex; align-items: center; gap: 12px; }
.sum-seal {
  font-family: var(--font-brush); font-size: 13px; font-weight: 700; letter-spacing: 1px;
  color: var(--seal); border: 1.5px solid var(--seal); border-radius: 7px;
  padding: 6px 7px; writing-mode: vertical-rl; line-height: 1.1;
  background: color-mix(in srgb, var(--seal-soft) 55%, transparent);
}
.sum-id-text { display: flex; flex-direction: column; line-height: 1.25; }
.sum-id-text strong { font-family: var(--font-brush); font-size: 17px; letter-spacing: 1.5px; }
.sum-id-text span { font-size: 11.5px; color: var(--ink-faint); }
.sum-stats { display: flex; align-items: stretch; gap: 8px; flex: 1 1 auto; flex-wrap: wrap; }
.sum-cell {
  display: flex; flex-direction: column; gap: 1px; padding: 4px 14px;
  border-left: 1px solid var(--line); min-width: 76px;
}
.sum-cell:first-child { border-left: 0; }
.sum-cell b { font-size: 19px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.sum-cell b.accent { color: var(--accent); }
.sum-cell b.good { color: var(--good); }
.sum-cell b.seal { color: var(--seal); }
.sum-cell em { font-style: normal; font-size: 11px; color: var(--ink-faint); letter-spacing: .5px; }

/* ───────── 主区工具条：视图切换 + 筛选 ───────── */
.main-bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.view-tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 11px; }
.vtab {
  border: 0; background: transparent; color: var(--ink-soft); cursor: pointer;
  font-size: 13px; font-weight: 600; padding: 6px 14px; border-radius: 8px;
  transition: .2s var(--ease); white-space: nowrap;
}
.vtab:hover { color: var(--accent); }
.vtab.is-active { background: var(--accent); color: var(--on-accent); box-shadow: 0 8px 16px -10px var(--accent); }
.vtab.is-disabled,
.vtab:disabled { opacity: .45; cursor: not-allowed; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.fchip {
  border: 1px solid var(--line); background: var(--panel); color: var(--ink-soft);
  cursor: pointer; font-size: 12px; padding: 5px 12px; border-radius: 999px;
  transition: .18s var(--ease); white-space: nowrap;
}
.fchip:hover { border-color: var(--accent); color: var(--accent); }
.fchip.is-active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.wall-empty { padding: 40px 16px; text-align: center; color: var(--ink-faint); font-size: 13.5px; }

/* ───────── 右侧学习驾驶舱 ───────── */
.dash {
  position: sticky; top: var(--topbar-h); align-self: start;
  max-height: calc(100vh - var(--topbar-h)); overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px;
  padding: 16px 16px 30px; scrollbar-width: thin;
  border-left: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 40%, transparent);
  animation: slideLeft .6s var(--ease) both;
}
@keyframes slideLeft { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
.dash-card {
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 14px;
}
.dash-card h3 {
  margin: 0 0 10px; font-family: var(--font-brush); font-size: 14px; letter-spacing: 1.5px;
  color: var(--ink); display: flex; align-items: center; gap: 7px;
}
.dash-count { font-family: inherit; font-size: 11px; background: var(--seal-soft); color: var(--seal); padding: 1px 8px; border-radius: 999px; }
[data-theme="dark"] .dash-count { background: var(--accent-soft); color: var(--accent); }

.dash-today { display: flex; flex-direction: column; gap: 9px; }
.today-big { display: flex; align-items: baseline; gap: 6px; }
.today-big b { font-size: 30px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1; }
.today-big span { font-size: 12px; color: var(--ink-faint); }
.today-sub { font-size: 12px; color: var(--ink-soft); }
.today-sub b { color: var(--seal); }

.dash-overall { display: flex; flex-direction: column; gap: 8px; }
.ov-bar { height: 9px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.ov-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .6s var(--ease); }
.ov-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-soft); }
.ov-row b { color: var(--ink); font-variant-numeric: tabular-nums; }
.reason-bars { display: flex; flex-direction: column; gap: 6px; margin-top: 2px; }
.reason-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) 24px; align-items: center; gap: 8px; font-size: 11.5px; color: var(--ink-soft); }
.reason-row i { height: 6px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.reason-row i b { display: block; height: 100%; border-radius: inherit; background: var(--seal); }
.reason-row em { font-style: normal; color: var(--ink-faint); text-align: right; }

.ledger-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ledger-mode-control {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 34px; padding: 0 2px; color: var(--ink-soft); font-size: 11.5px;
}
.ledger-mode-control select {
  min-width: 0; max-width: 190px; height: 32px; padding: 0 24px 0 8px;
  border: 1px solid var(--line); border-radius: 7px; background: var(--panel);
  color: var(--ink); cursor: pointer; font: inherit; font-size: 11.5px;
}
.ledger-mode-control select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ledger-btn {
  min-height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel);
  color: var(--ink); cursor: pointer; font-size: 12px; white-space: nowrap;
  transition: .18s var(--ease);
}
.ledger-btn:hover { border-color: var(--accent); color: var(--accent); box-shadow: 0 8px 18px -14px var(--accent); }
.ledger-btn.ledger-wrong-pdf { grid-column: 1 / -1; color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.ledger-btn.ledger-wrong-pdf:hover { background: var(--accent-soft); border-color: var(--accent); }
.ledger-btn.danger { grid-column: 1 / -1; color: var(--seal); border-color: color-mix(in srgb, var(--seal) 32%, var(--line)); }
.ledger-btn.danger:hover { background: var(--seal-soft); border-color: var(--seal); }
.ledger-btn:disabled { opacity: .62; cursor: wait; transform: none; box-shadow: none; }
.ledger-btn i { width: 14px; height: 14px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ledger-status {
  grid-column: 1 / -1; min-height: 17px; color: var(--ink-faint); font-size: 11.5px;
  line-height: 1.45; overflow-wrap: anywhere;
}
.ledger-status[data-tone="ok"] { color: var(--good); }
.ledger-status[data-tone="bad"] { color: var(--seal); }

.reco-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  cursor: pointer; padding: 9px 11px; border-radius: 10px; margin-bottom: 7px;
  transition: .2s var(--ease);
}
.reco-item:last-child { margin-bottom: 0; }
.reco-item:hover { border-color: var(--accent); transform: translateX(2px); box-shadow: 0 8px 18px -12px var(--accent); }
.reco-ic { font-size: 17px; flex: none; }
.reco-tx { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.reco-tx strong { font-size: 12.5px; font-weight: 600; }
.reco-tx em { font-style: normal; font-size: 11px; color: var(--ink-faint); }
.dash-empty { font-size: 12px; color: var(--ink-faint); padding: 4px 2px; line-height: 1.6; }

.dash-marked { display: flex; flex-direction: column; gap: 5px; max-height: 230px; overflow-y: auto; scrollbar-width: thin; }
.mk-item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  border: 0; background: transparent; color: var(--ink-soft); cursor: pointer;
  padding: 6px 8px; border-radius: 8px; font-size: 12px; transition: .15s var(--ease);
}
.mk-item:hover { background: var(--seal-soft); color: var(--seal); }
.mk-item .mk-yr {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mk-item .mk-no { margin-left: auto; font-size: 11px; color: var(--ink-faint); }

/* ───────── 考频热力图 ───────── */
.heatmap-wrap {
  margin-top: 4px; padding: 16px 18px;
  background: color-mix(in srgb, var(--panel) 62%, transparent);
  border: 1px solid var(--line); border-radius: var(--radius);
  animation: dropIn .5s var(--ease) both;
}
.hm-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-family: var(--font-brush); font-size: 14px; letter-spacing: 1px; color: var(--ink); }
.heatmap {
  overflow-x: auto; scrollbar-width: thin; padding-bottom: 6px;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}
.hm-grid { display: grid; gap: 3px; min-width: max-content; }
.hm-cell {
  width: 26px; height: 26px; border-radius: 5px; display: grid; place-items: center;
  font-size: 10px; cursor: default; transition: transform .15s var(--ease);
  font-variant-numeric: tabular-nums;
}
.hm-cell.has:hover { transform: scale(1.22); z-index: 2; box-shadow: var(--shadow-card); cursor: pointer; }
.hm-colhead, .hm-rowhead { font-size: 10.5px; color: var(--ink-faint); display: flex; align-items: center; }
.hm-colhead { justify-content: center; height: 22px; writing-mode: vertical-rl; letter-spacing: 1px; }
.hm-rowhead { justify-content: flex-end; padding-right: 8px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-rowhead.subject { font-family: var(--font-brush); color: var(--accent); font-weight: 700; }
/* 横向滚动时把考点标签列钉在左侧，避免脱离行 */
.hm-rowhead, .hm-corner { position: sticky; left: 0; z-index: 3; background: var(--panel); }
.hm-corner { }

/* ───────── 考点完成度（左侧叶子节点） ───────── */
.t-leaf { flex-wrap: wrap; }
.t-leaf .leaf-main { display: flex; align-items: center; gap: 7px; width: 100%; }
.mastery {
  margin-left: auto; display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; color: var(--ink-faint); white-space: nowrap;
}
.mastery i { width: 7px; height: 7px; border-radius: 50%; background: var(--seal); display: inline-block; }
.mastery.fair i { background: var(--warn); }
.mastery.good i { background: var(--good); }
.mastery.excellent i { background: var(--accent); }
.t-row .mastery { margin-left: auto; }
.t-row .mastery + .cnt { margin-left: 4px; }
.t-leaf .mastery + .cnt { margin-left: 0; }
.t-leaf .leaf-bar {
  width: 100%; height: 4px; border-radius: 999px; background: var(--line-soft);
  overflow: hidden; margin: 3px 0 1px;
}
.t-leaf .leaf-bar i { display: block; height: 100%; border-radius: 999px; background: var(--good); transition: width .5s var(--ease); }
.t-leaf.has-done .cnt { color: var(--good); }

/* 难题徽章 + 卡片难度提示 */
.q-badge.hard { background: color-mix(in srgb, var(--seal) 16%, transparent); color: var(--seal); }
.card-hard {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10.5px; color: var(--seal);
}
.card.has-hard .card-head .qn::after {
  content: "难"; margin-left: 5px; font-size: 9.5px; color: var(--seal);
  border: 1px solid color-mix(in srgb, var(--seal) 45%, var(--line));
  border-radius: 4px; padding: 0 3px; vertical-align: middle;
}

/* 卡片快捷按钮 */
.card-acts { display: flex; gap: 6px; margin-top: 9px; }
.card-act {
  flex: 1 1 auto; border: 1px solid var(--line); background: var(--panel-2);
  color: var(--ink-soft); cursor: pointer; font-size: 11.5px; padding: 5px 0;
  border-radius: 8px; transition: .18s var(--ease); text-align: center;
}
.card-act:hover { border-color: var(--accent); color: var(--accent); }
.card-act.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.card-act.primary:hover { filter: brightness(1.07); color: var(--on-accent); }

/* ───────── responsive ───────── */
/* ≤1200px：收起右侧驾驶舱为主区下方横排卡片 */
@media (max-width: 1200px) {
  .layout { grid-template-columns: var(--side-w) minmax(0, 1fr); }
  .dash {
    grid-column: 1 / -1; position: static; max-height: none; border-left: 0;
    border-top: 1px solid var(--line);
    display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px; align-items: start;
    background: transparent; padding: 16px 30px 10px;
  }
  .dash-card { flex: initial; }
  .dash-marked { max-height: 160px; }
}
@media (max-width: 980px) {
  .topic-main { flex-basis: 150px; }
  .topic-pct { flex-basis: 64px; }
  /* 880–980 段：与主区 30px 内边距对齐，避免错位（窄到 880 再收紧） */
}
@media (max-width: 880px) {
  body {
    position: relative;
    min-width: 0;
    touch-action: pan-y;
  }
  .layout { grid-template-columns: 1fr; }
  /* Sticky topbar on mobile: keeps navigation accessible during scroll.
     Users need access to search, type switching, and other core features. */
  .topbar { gap: 10px; padding: 8px 10px; flex-wrap: wrap; position: sticky; top: 0; z-index: 40; }
  .topbar .menu-btn { display: grid; width: 36px; height: 36px; }
  .brand { min-width: 0; }
  .brand-art { width: 38px; height: 38px; }
  .brand-text strong { font-size: 18px; letter-spacing: 2px; }
  .brand-text em { display: none; }
  .topnav { order: 2; margin-left: 0; gap: 4px; }
  .chip {
    min-height: 44px;
    padding: 8px 12px;
    font-size: 12px;
  }
  .topctl { margin-left: auto; gap: 8px; }
  .access-btn { height: 36px; padding: 0 10px; font-size: 12px; }
  .access-buy { height: 36px; padding: 0 10px; font-size: 12px; }
  .seg-btn { padding: 6px 10px; font-size: 12px; }
  .icon-btn {
    width: 44px;
    height: 44px;
  }
  .sidebar {
    display: flex; position: fixed; top: 0; bottom: 0; left: 0; z-index: 90;
    width: min(82vw, 320px); height: auto; transform: translateX(-105%);
    background: color-mix(in srgb, var(--panel) 96%, transparent);
    box-shadow: var(--shadow-pop); transition: transform .32s var(--ease);
    animation: none;
  }
  .drawer-scrim {
    left: min(82vw, 320px);
    z-index: 80;
  }
  body.drawer-open .layout #sidebar { transform: translateX(0) !important; }
  .side-close { display: inline-flex; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .summary { margin: 12px 10px 0; padding: 12px; gap: 12px; }
  .sum-cell { min-width: 62px; padding: 4px 9px; }
  .sum-cell b { font-size: 17px; }
  .main { padding: 16px 14px 50px; }
  .dash { padding: 14px 14px 6px; }
  .dash-card { flex-basis: 100%; }
  .main-bar { gap: 10px; }
  .filters { margin-left: 0; }
  .wall, .filters, .heatmap, .sheet-tools, .katex-display {
    touch-action: pan-x pan-y;
  }
  .wall-wrap { overflow-x: hidden; }
  .topic-meter { display: none; }
  .topic-pct { flex-basis: auto; }
  .tutorial-modal { padding: 12px; }
  .tutorial-sheet { width: calc(100vw - 24px); }
  .tutorial-head { padding: 12px; }
  .tutorial-head h2 { font-size: 21px; }
  .access-modal { padding: 12px; }
  .access-sheet { width: calc(100vw - 24px); }
  .access-head { padding: 12px; }
  .access-head h2 { font-size: 21px; }
}
@media (max-width: 430px) {
  .topbar { gap: 8px; }
  .brand-text strong { font-size: 17px; }
  .topctl { width: 100%; justify-content: space-between; }
  .seg { flex: 1 1 auto; }
  .seg-btn { flex: 1 1 0; padding: 6px 6px; }
  .access-btn { flex: 0 0 auto; max-width: 128px; }
  .access-buy { flex: 0 0 auto; }
  .access-btn span:last-child { overflow: hidden; text-overflow: ellipsis; }
  .topnav {
    width: calc(100% - 44px);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }
  .topnav::-webkit-scrollbar { display: none; }
  .topnav .chip { flex: 0 0 auto; justify-content: center; }
  .topnav .chip i { flex: 0 0 auto; }
  .main { padding-left: 10px; padding-right: 10px; }
  .filters {
    width: 100%; max-width: 100%;
    overflow-x: auto; overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap; padding-bottom: 4px;
  }
  .wall-wrap { margin-left: 0; margin-right: 0; }
  .sheet { width: calc(100vw - 20px); height: 94vh; }
  .sheet-rod { left: 0; right: 0; }
  .sheet-rod::before { left: 0; }
  .sheet-rod::after { right: 0; }
  .sheet-bar { align-items: flex-start; gap: 8px; flex-direction: column; }
  .sheet-tools {
    width: 100%; max-width: 100%; min-width: 0;
    flex-wrap: wrap; gap: 6px;
    overflow-x: visible; overscroll-behavior-x: auto;
  }
  .sheet-tools .tool { flex: 0 1 auto; padding: 6px 9px; font-size: 12px; }
  .reader-mode { flex: 1 1 182px; min-width: 0; gap: 2px; }
  .mode-btn { flex: 1 1 0; min-width: 0; padding: 5px 6px; }
  .tool.close { margin-left: auto; }
  .paper .q { gap: 8px; }
  .paper .opts { grid-template-columns: 1fr; }
  .fill-compare { grid-template-columns: 1fr; }
}

/* ───────── 考点命中定位（点徽章直达该题） ───────── */
.year-badge { cursor: pointer; transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.year-badge:hover { transform: scale(1.18) rotate(-5deg); box-shadow: 0 10px 22px -6px var(--seal); }

.q.q-hit > .q-no {
  background: var(--seal); color: #f5f1e6;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--seal) 30%, transparent);
}
.q.q-hit-active { position: relative; z-index: 0; }
.q.q-hit-active::before {
  content: ""; position: absolute; inset: -8px -12px; z-index: -1; border-radius: 12px;
  background: color-mix(in srgb, var(--seal-soft) 60%, transparent);
  box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--seal) 28%, transparent);
  animation: hitPulse 1.5s var(--ease) both;
}
@keyframes hitPulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--seal) 60%, transparent); }
  55% { box-shadow: 0 0 0 14px transparent; }
  100% { box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--seal) 28%, transparent); }
}

.hit-nav {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  z-index: 9; display: flex; align-items: center; gap: 9px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  border: 1px solid var(--seal); border-radius: 999px;
  padding: 7px 15px; box-shadow: var(--shadow-pop);
  backdrop-filter: blur(8px); font-size: 12.5px; color: var(--ink-soft);
  animation: hitNavIn .45s var(--ease) both;
}
.hit-nav .hit-label {
  font-family: var(--font-brush); color: var(--seal); font-weight: 700; letter-spacing: 1px;
  max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hit-nav .hit-count { color: var(--ink-faint); }
.hit-nav .hit-pos { color: var(--seal); font-size: 14px; }
.hit-nav .hit-step {
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink-soft);
  width: 26px; height: 26px; border-radius: 50%; font-size: 15px; line-height: 1;
  transition: .2s var(--ease);
}
.hit-nav .hit-step:hover { color: var(--seal); border-color: var(--seal); transform: scale(1.12); }
@keyframes hitNavIn {
  from { opacity: 0; transform: translateX(-50%) translateY(16px); }
  to { opacity: 1; transform: translateX(-50%); }
}

/* ───────── 页脚 · 免责声明 ───────── */
.site-footer {
  position: relative; z-index: 1;
  margin: 8px auto 0; max-width: 1100px;
  padding: 26px 28px 40px; text-align: center;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
}
.foot-brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-brush); font-size: 16px; letter-spacing: 2px;
  color: var(--ink-soft); margin-bottom: 10px;
}
.foot-seal {
  display: inline-grid; place-items: center; width: 26px; height: 26px;
  font-size: 15px; color: #f5f1e6; border-radius: 6px;
  background: linear-gradient(150deg, var(--accent), var(--accent-2));
}
.foot-disclaim {
  max-width: 720px; margin: 0 auto 10px;
  font-size: 12.5px; line-height: 1.8; color: var(--ink-faint);
}
.foot-meta {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  font-size: 12px; color: var(--ink-faint); margin: 0;
}
.foot-meta .foot-dot { opacity: .5; }
@media (max-width: 880px) {
  .site-footer { padding: 22px 16px 34px; margin-top: 4px; }
  .foot-meta { gap: 4px; }
  .foot-meta .foot-dot { display: none; }
}

/* ===========================================================
   Safari 兼容性降级方案
   =========================================================== */

/* color-mix() 降级 (Safari < 16.4) */
@supports not (background: color-mix(in srgb, red, blue)) {
  /* 云朵渐变 */
  .cloud {
    background: radial-gradient(closest-side, rgba(250, 248, 240, 0.70) 0%, transparent 78%);
  }
  [data-theme="dark"] .cloud {
    background: radial-gradient(closest-side, rgba(22, 31, 27, 0.70) 0%, transparent 78%);
  }

  /* 顶栏背景 */
  .topbar {
    background: rgba(250, 248, 240, 0.92);
  }
  [data-theme="dark"] .topbar {
    background: rgba(22, 31, 27, 0.92);
  }

  /* 品牌艺术边框 */
  .brand-art {
    border: 1px solid rgba(151, 128, 63, 0.65);
  }

  /* 品牌印章背景 */
  .brand-art .brand-seal {
    background: linear-gradient(150deg, #233830, #16241e);
  }

  /* 教程芯片 */
  .tutorial-chip {
    border: 1px solid rgba(176, 61, 48, 0.28);
    background: rgba(243, 225, 220, 0.52);
  }
  [data-theme="dark"] .tutorial-chip {
    background: rgba(52, 32, 28, 0.52);
  }

  /* 侧边栏背景 */
  .sidebar {
    background: rgba(250, 248, 240, 0.55);
  }
  [data-theme="dark"] .sidebar {
    background: rgba(22, 31, 27, 0.55);
  }

  /* 主题卡片背景 */
  .hero {
    background: linear-gradient(120deg, rgba(250, 248, 240, 0.92), rgba(243, 239, 227, 0.80));
  }
  [data-theme="dark"] .hero {
    background: linear-gradient(120deg, rgba(22, 31, 27, 0.92), rgba(18, 26, 22, 0.80));
  }

  /* 墨圈装饰 */
  .hero::after {
    border: 14px solid rgba(47, 93, 78, 0.14);
  }
  [data-theme="dark"] .hero::after {
    border: 14px solid rgba(93, 156, 133, 0.14);
  }

  /* 英雄牌匾 */
  .hero-plaque {
    border: 1px solid rgba(151, 128, 63, 0.70);
    background: linear-gradient(160deg, rgba(250, 248, 240, 0.90), #f3efe3);
  }
  [data-theme="dark"] .hero-plaque {
    border: 1px solid rgba(179, 154, 90, 0.70);
    background: linear-gradient(160deg, rgba(22, 31, 27, 0.90), #121a16);
  }

  /* 卷杆 */
  .card::before {
    background: linear-gradient(180deg, rgba(44, 53, 48, 0.92), #2c3530);
  }

  /* 卡片悬停边框 */
  .card:hover {
    border-color: rgba(47, 93, 78, 0.50);
  }
  [data-theme="dark"] .card:hover {
    border-color: rgba(93, 156, 133, 0.50);
  }

  /* 全部完成卡片 */
  .card.all-done {
    border-color: rgba(47, 125, 82, 0.55);
  }
  [data-theme="dark"] .card.all-done {
    border-color: rgba(87, 168, 123, 0.55);
  }

  /* 选项徽章印章 */
  .choice-stamp {
    background: rgba(251, 249, 241, 0.82);
  }

  /* 标签背景 */
  .tag.ana {
    background: rgba(47, 125, 82, 0.14);
  }
  [data-theme="dark"] .tag.ana {
    background: rgba(87, 168, 123, 0.14);
  }

  /* 进度面板 */
  .progress {
    background: rgba(250, 248, 240, 0.62);
  }
  [data-theme="dark"] .progress {
    background: rgba(22, 31, 27, 0.62);
  }

  /* 考点行悬停 */
  .topic-row:hover {
    border-color: rgba(47, 93, 78, 0.25);
  }
  [data-theme="dark"] .topic-row:hover {
    border-color: rgba(93, 156, 133, 0.25);
  }

  /* 考点徽章 */
  .topic-rank {
    border: 1px solid rgba(176, 61, 48, 0.45);
  }
  [data-theme="dark"] .topic-rank {
    border: 1px solid rgba(201, 86, 74, 0.45);
  }

  /* 滚轴竿 */
  .sheet-rod {
    background: linear-gradient(180deg, rgba(44, 53, 48, 0.92), #2c3530);
  }

  /* 卷轴杆金钮 */
  .sheet-rod::before, .sheet-rod::after {
    background: radial-gradient(circle at 35% 35%, rgba(151, 128, 63, 0.95), #97803f);
  }

  /* 卷轴工具栏 */
  .sheet-bar {
    background: rgba(243, 239, 227, 0.75);
  }
  [data-theme="dark"] .sheet-bar {
    background: rgba(18, 26, 22, 0.75);
  }

  /* 阅读模式按钮 */
  .reader-mode {
    background: rgba(243, 239, 227, 0.86);
  }
  [data-theme="dark"] .reader-mode {
    background: rgba(18, 26, 22, 0.86);
  }

  /* 教程弹窗遮罩 */
  .tutorial-scrim {
    background: rgba(17, 24, 19, 0.58);
  }

  /* 教程表头边框 */
  .tutorial-sheet {
    border: 1px solid rgba(151, 128, 63, 0.45);
  }

  /* 选项正确 */
  .paper .choice-option.is-right-pick,
  .paper .choice-option.is-correct-choice {
    background: rgba(47, 125, 82, 0.12);
    box-shadow: 0 0 0 2px rgba(47, 125, 82, 0.16);
  }
  [data-theme="dark"] .paper .choice-option.is-right-pick,
  [data-theme="dark"] .paper .choice-option.is-correct-choice {
    background: rgba(87, 168, 123, 0.12);
    box-shadow: 0 0 0 2px rgba(87, 168, 123, 0.16);
  }

  /* 选项错误 */
  .paper .choice-option.is-wrong-choice {
    background: rgba(176, 61, 48, 0.12);
    box-shadow: 0 0 0 2px rgba(176, 61, 48, 0.16);
  }
  [data-theme="dark"] .paper .choice-option.is-wrong-choice {
    background: rgba(201, 86, 74, 0.12);
    box-shadow: 0 0 0 2px rgba(201, 86, 74, 0.16);
  }

  /* 考点徽章 */
  .q-badge.topic {
    background: rgba(35, 43, 36, 0.08);
  }
  [data-theme="dark"] .q-badge.topic {
    background: rgba(230, 228, 214, 0.08);
  }

  /* 来源徽章 */
  .q-badge.origin {
    background: rgba(176, 122, 42, 0.14);
  }
  [data-theme="dark"] .q-badge.origin {
    background: rgba(179, 154, 90, 0.14);
  }

  /* 答案区域 */
  .fill-answer {
    background: rgba(243, 239, 227, 0.76);
  }
  [data-theme="dark"] .fill-answer {
    background: rgba(18, 26, 22, 0.76);
  }

  /* 自评正确提示 */
  .q-mark.eval.correct.suggested:not(.on) {
    box-shadow: 0 0 0 2px rgba(47, 125, 82, 0.14);
  }
  [data-theme="dark"] .q-mark.eval.correct.suggested:not(.on) {
    box-shadow: 0 0 0 2px rgba(87, 168, 123, 0.14);
  }

  /* 总览状态栏 */
  .summary {
    background: linear-gradient(120deg, rgba(250, 248, 240, 0.92), rgba(243, 239, 227, 0.82));
  }
  [data-theme="dark"] .summary {
    background: linear-gradient(120deg, rgba(22, 31, 27, 0.92), rgba(18, 26, 22, 0.82));
  }

  /* 总览印章 */
  .sum-seal {
    background: rgba(243, 225, 220, 0.55);
  }
  [data-theme="dark"] .sum-seal {
    background: rgba(52, 32, 28, 0.55);
  }

  /* 滚动箭头 */
  .scroll-arr {
    background: rgba(250, 248, 240, 0.90);
  }
  [data-theme="dark"] .scroll-arr {
    background: rgba(22, 31, 27, 0.90);
  }

  /* 学习驾驶舱 */
  .dash {
    background: rgba(250, 248, 240, 0.40);
  }
  [data-theme="dark"] .dash {
    background: rgba(22, 31, 27, 0.40);
  }

  /* 驾驶舱卡片 */
  .dash-card {
    background: rgba(250, 248, 240, 0.88);
  }
  [data-theme="dark"] .dash-card {
    background: rgba(22, 31, 27, 0.88);
  }

  /* 热力图包装 */
  .heatmap-wrap {
    background: rgba(250, 248, 240, 0.62);
  }
  [data-theme="dark"] .heatmap-wrap {
    background: rgba(22, 31, 27, 0.62);
  }

  /* 导航栏背景（移动端） */
  @media (max-width: 880px) {
    .sidebar {
      background: rgba(250, 248, 240, 0.96);
    }
    [data-theme="dark"] .sidebar {
      background: rgba(22, 31, 27, 0.96);
    }
  }

  /* 难题徽章 */
  .q-badge.hard {
    background: rgba(176, 61, 48, 0.16);
  }
  [data-theme="dark"] .q-badge.hard {
    background: rgba(201, 86, 74, 0.16);
  }

  /* 难题提示 */
  .card.has-hard .card-head .qn::after {
    border: 1px solid rgba(176, 61, 48, 0.45);
  }
  [data-theme="dark"] .card.has-hard .card-head .qn::after {
    border: 1px solid rgba(201, 86, 74, 0.45);
  }

  /* 考点命中背景 */
  .q.q-hit-active::before {
    background: rgba(243, 225, 220, 0.60);
    box-shadow: 0 0 0 1.5px rgba(176, 61, 48, 0.28);
  }
  [data-theme="dark"] .q.q-hit-active::before {
    background: rgba(52, 32, 28, 0.60);
    box-shadow: 0 0 0 1.5px rgba(201, 86, 74, 0.28);
  }

  /* 命中导航 */
  .hit-nav {
    background: rgba(250, 248, 240, 0.92);
  }
  [data-theme="dark"] .hit-nav {
    background: rgba(22, 31, 27, 0.92);
  }

  /* 简易表格背景 */
  .md-table tbody tr:nth-child(even) td {
    background: rgba(243, 239, 227, 0.60);
  }
  [data-theme="dark"] .md-table tbody tr:nth-child(even) td {
    background: rgba(18, 26, 22, 0.60);
  }

  /* 朱砂填空提示 */
  .paper code {
    background: rgba(243, 225, 220, 0.42);
  }
  [data-theme="dark"] .paper code {
    background: rgba(52, 32, 28, 0.42);
  }

  /* 账本危险按钮 */
  .ledger-btn.danger {
    border-color: rgba(176, 61, 48, 0.40);
  }
  [data-theme="dark"] .ledger-btn.danger {
    border-color: rgba(201, 86, 74, 0.40);
  }
}

/* backdrop-filter 降级 (Safari < 15.4) */
@supports not (backdrop-filter: blur(8px)) {
  /* 顶栏改为纯色背景 */
  .topbar {
    background: var(--panel);
  }

  /* 滚动箭头改为纯色 */
  .scroll-arr {
    background: var(--panel);
  }

  /* 阅读器遮罩改为纯色 */
  .reader-scrim {
    background: rgba(16, 22, 18, 0.70);
  }

  /* 教程遮罩改为纯色 */
  .tutorial-scrim {
    background: rgba(17, 24, 19, 0.72);
  }

  /* 命中导航改为纯色 */
  .hit-nav {
    background: var(--panel);
  }
}
