/*!
 * 知行训练场 v2 · style.css
 * 设计语言：近黑画布 + 极光渐层 + 玻璃面板 + 渐变描边 + 光晕（参考 React Bits / Motionsites 一类动态站）
 * 零依赖 · 深色为主视觉，浅色为「日光工作室」 · 桌面侧边栏 + 移动底部导航
 */

/* ============================================================
   1. 设计令牌
   ============================================================ */

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text",
    "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei",
    "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display",
    "Segoe UI", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* —— 浅色：光学白 / 仪器面板（主视觉）—— */
  --bg: #f4f5f7;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #eef0f3;
  --line: rgba(10, 12, 16, .11);
  --line-2: rgba(10, 12, 16, .24);
  --text: #0a0c10;
  --text-2: rgba(10, 12, 16, .58);
  --text-3: rgba(10, 12, 16, .34);

  /* 结构强调 = 墨（不用彩色）；信号橙只给「现在」 */
  --accent: #0a0c10;
  --accent-2: #2a2f38;
  --accent-3: #6b7280;
  --accent-ink: #ffffff;
  --accent-soft: rgba(10, 12, 16, .05);
  --accent-line: rgba(10, 12, 16, .22);

  --signal: #ff4a17;
  --signal-soft: rgba(255, 74, 23, .10);
  --instrument: #1355c4;
  --instrument-soft: rgba(19, 85, 196, .09);
  --ambient: #1355c4;

  --ok: #0f7a4d;
  --ok-soft: rgba(15, 122, 77, .10);
  --warn: #b45309;
  --warn-soft: rgba(180, 83, 9, .10);
  --danger: #d7263d;
  --danger-soft: rgba(215, 38, 61, .09);
  --blue: #1355c4;
  --blue-soft: rgba(19, 85, 196, .09);
  --violet: #6d28d9;
  --violet-soft: rgba(109, 40, 217, .09);

  --track: rgba(10, 12, 16, .08);

  --shadow-1: 0 1px 2px rgba(10, 12, 16, .05);
  --shadow-2: 0 2px 4px rgba(10, 12, 16, .04), 0 12px 28px -14px rgba(10, 12, 16, .22);
  --shadow-3: 0 8px 20px -8px rgba(10, 12, 16, .14), 0 32px 64px -28px rgba(10, 12, 16, .3);
  --inner-hi: inset 0 1px 0 rgba(255, 255, 255, .9);

  /* 描边：浅色下靠发丝线分层，不靠发光 */
  --edge: linear-gradient(140deg, rgba(10, 12, 16, .17), rgba(10, 12, 16, .06) 46%, rgba(10, 12, 16, .14));
  --edge-strong: linear-gradient(140deg, rgba(10, 12, 16, .3), rgba(10, 12, 16, .12) 50%, rgba(10, 12, 16, .24));

  --glow: 0 1px 2px rgba(10, 12, 16, .05);
  --ring: 0 0 0 3px rgba(255, 74, 23, .22);

  --r-xl: 14px;
  --r-lg: 10px;
  --r: 7px;
  --r-sm: 5px;
  --r-xs: 4px;

  /* 更冷：收尾更重、几乎没有回弹、整体放慢 */
  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-spring: cubic-bezier(.3, 1.16, .6, 1);
  --ease-in-out: cubic-bezier(.4, 0, .2, 1);
  --dur-1: .16s;
  --dur-2: .3s;
  --dur-3: .6s;

  --sidebar-w: 250px;
  --glass: saturate(180%) blur(20px);
  --aurora-a: #5b8def;
  --aurora-b: #7dd3fc;
  --aurora-c: #93c5fd;
  --aurora-d: #a5b4fc;
  --aurora-opacity: .07;
  --grid-line: rgba(10, 12, 16, .03);
  --grid-size: 24px;
  --noise-opacity: 0;
  color-scheme: light;
}

/* —— 深色：可选主题（保留，但不是主视觉）—— */
[data-theme="dark"] {
  --bg: #08090d;
  --bg-2: #0c0d13;
  --surface: rgba(255, 255, 255, .04);
  --surface-solid: #101118;
  --surface-2: rgba(255, 255, 255, .065);
  --surface-3: rgba(255, 255, 255, .1);
  --line: rgba(255, 255, 255, .1);
  --line-2: rgba(255, 255, 255, .2);
  --text: #f2f3f7;
  --text-2: rgba(242, 243, 247, .62);
  --text-3: rgba(242, 243, 247, .38);

  --accent: #f2f3f7;
  --accent-2: #c9ccd6;
  --accent-3: #8b90a0;
  --accent-ink: #0a0c10;
  --accent-soft: rgba(255, 255, 255, .07);
  --accent-line: rgba(255, 255, 255, .24);

  --signal: #ff6b3d;
  --signal-soft: rgba(255, 107, 61, .14);
  --instrument: #6ba3ff;
  --instrument-soft: rgba(107, 163, 255, .14);
  --ambient: #ff6b3d;              /* 深色下环境光跟着恒星走，不用仪器蓝 */

  --ok: #3ddc97;
  --ok-soft: rgba(61, 220, 151, .13);
  --warn: #ffb340;
  --warn-soft: rgba(255, 179, 64, .13);
  --danger: #ff6b7a;
  --danger-soft: rgba(255, 107, 122, .13);
  --blue: #6ba3ff;
  --blue-soft: rgba(107, 163, 255, .13);
  --violet: #b79bff;
  --violet-soft: rgba(183, 155, 255, .13);

  --track: rgba(255, 255, 255, .09);

  --shadow-1: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-2: 0 6px 24px -12px rgba(0, 0, 0, .8), 0 2px 6px rgba(0, 0, 0, .5);
  --shadow-3: 0 24px 70px -24px rgba(0, 0, 0, .95), 0 8px 24px rgba(0, 0, 0, .6);
  --inner-hi: inset 0 1px 0 rgba(255, 255, 255, .06);

  --edge: linear-gradient(140deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, .04) 46%, rgba(255, 255, 255, .12));
  --edge-strong: linear-gradient(140deg, rgba(255, 255, 255, .32), rgba(255, 255, 255, .1) 50%, rgba(255, 255, 255, .22));

  --glow: 0 1px 2px rgba(0, 0, 0, .4);
  --ring: 0 0 0 3px rgba(255, 107, 61, .28);

  --aurora-a: #ff6b3d;
  --aurora-b: #8a6ea8;
  --aurora-c: #ff6b3d;
  --aurora-d: #6b5a8a;
  --aurora-opacity: .5;
  --grid-line: rgba(255, 255, 255, .06);
  --grid-size: 28px;
  --noise-opacity: .035;
  color-scheme: dark;
}

/* ============================================================
   2. 基础
   ============================================================ */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.02em; }
h1, h2 { font-family: var(--font-display); }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
code {
  font-family: var(--font-mono); font-size: .92em;
  background: var(--surface-2); padding: 1.5px 6px; border-radius: 6px;
  border: 1px solid var(--line);
}
kbd {
  font-family: var(--font-mono); font-size: 11px; padding: 2px 7px; border-radius: 7px;
  background: var(--surface-2); border: 1px solid var(--line);
  box-shadow: 0 1px 0 var(--line-2); white-space: nowrap;
}
::selection { background: var(--accent); color: #fff; }

* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb {
  background: var(--line-2); border-radius: 9px;
  border: 3.5px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-3); background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-xs); }

/* ============================================================
   3. 背景层：极光 / 网格 / 噪点
   ============================================================ */

.bg {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none; overflow: hidden;
  background: var(--bg);
}

/* 顶部极光带：四团色彩叠加后整体模糊，再用遮罩把边界化开 */
.bg-aurora {
  position: absolute; left: -25%; right: -25%; top: -55vh; height: 150vh;
  background:
    radial-gradient(42% 34% at 18% 46%, var(--aurora-a) 0%, transparent 62%),
    radial-gradient(36% 30% at 42% 38%, var(--aurora-b) 0%, transparent 64%),
    radial-gradient(40% 33% at 66% 48%, var(--aurora-c) 0%, transparent 62%),
    radial-gradient(32% 28% at 88% 40%, var(--aurora-d) 0%, transparent 64%);
  filter: blur(70px) saturate(1.35);
  opacity: var(--aurora-opacity);
  will-change: transform;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 26%, rgba(0, 0, 0, .55) 46%, transparent 68%);
  mask-image: linear-gradient(180deg, #000 0%, #000 26%, rgba(0, 0, 0, .55) 46%, transparent 68%);
  animation: aurora-drift 26s var(--ease-in-out) infinite alternate;
}
@keyframes aurora-drift {
  0%   { transform: translate3d(-3%, 0, 0) scale(1) rotate(0deg); }
  50%  { transform: translate3d(2%, 2vh, 0) scale(1.08) rotate(3deg); }
  100% { transform: translate3d(5%, -1vh, 0) scale(1.04) rotate(-2deg); }
}

/* 点阵网格：细网格 + 每 5 格的粗网格（工程图纸） */
.bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
}
.bg-grid::after {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(color-mix(in srgb, var(--text) 7%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--text) 7%, transparent) 1px, transparent 1px);
  background-size: calc(var(--grid-size) * 5) calc(var(--grid-size) * 5);
  -webkit-mask-image: radial-gradient(ellipse 96% 70% at 50% 0%, #000 10%, transparent 82%);
  mask-image: radial-gradient(ellipse 96% 70% at 50% 0%, #000 10%, transparent 82%);
}

/* —— 深色下的底 ——
   上一版是"四色极光 + 40px 发蓝的线格"，正是廉价感的来源：
   四团蓝紫青粉叠一起，像随处可见的"科技感"模板。
   现在换成一片干净的深空：
     · 极光撤成**一枚暖色尘埃**（信号橙），只在顶部中央，和恒星同一个光源；
     · 线格在深色下换成**点阵**（点比线安静得多，也不会有蓝边）。
   浅色主题完全不受影响（下面的规则只对深色生效）。 */
[data-theme="dark"] .bg-aurora {
  background:
    radial-gradient(46% 40% at 62% 34%, rgba(255, 107, 61, .55) 0%, transparent 66%),
    radial-gradient(38% 34% at 30% 26%, rgba(120, 96, 160, .30) 0%, transparent 70%);
  filter: blur(90px) saturate(.9);
  opacity: .5;
}

[data-theme="dark"] .bg-grid {
  background-image: radial-gradient(circle at 1px 1px,
    color-mix(in srgb, var(--text) 9%, transparent) 1px, transparent 0);
  background-size: var(--grid-size) var(--grid-size);
}
[data-theme="dark"] .bg-grid::after {
  background-image: radial-gradient(circle at 1px 1px,
    color-mix(in srgb, var(--text) 16%, transparent) 1.2px, transparent 0);
  background-size: calc(var(--grid-size) * 4) calc(var(--grid-size) * 4);
}

/* 噪点：只在深色下保留 */
.bg-noise {
  position: absolute; inset: -50%;
  display: none;
  opacity: var(--noise-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
[data-theme="dark"] .bg-noise { display: block; }

/* ============================================================
   4. 布局外壳
   ============================================================ */

#app {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

#sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 20px 14px 14px;
  overflow-y: auto; z-index: 40;
  background: color-mix(in srgb, var(--bg-2) 72%, transparent);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  border-right: 1px solid var(--line);
  view-transition-name: app-sidebar;
}
/* 侧边栏右边缘一道渐变高光 */
#sidebar::after {
  content: ''; position: absolute; top: 0; right: 0; width: 1px; height: 100%;
  background: linear-gradient(180deg, transparent, var(--accent-line) 30%, transparent 80%);
  opacity: .7;
}

#main { display: flex; flex-direction: column; min-width: 0; }

#topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 26px;
  background: color-mix(in srgb, var(--bg) 62%, transparent);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-2) var(--ease), background var(--dur-2) var(--ease);
  view-transition-name: app-topbar;
}
body.scrolled #topbar { border-bottom-color: var(--line); }

.topbar-title {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase; color: var(--text-3);
}
.topbar-actions { margin-left: auto; display: flex; gap: 4px; }

#view { flex: 1; min-width: 0; view-transition-name: app-view; }

.view-pad {
  max-width: 1140px; margin: 0 auto;
  padding: 10px 26px 92px;
  display: flex; flex-direction: column; gap: 22px;
}

#tabbar { display: none; view-transition-name: app-tabbar; }
.scrim { display: none; }
.icon-btn.only-mobile { display: none; }

/* 入场动画：从「下面一点 + 模糊」升起来 */
.anim { opacity: 0; }
.anim-in { animation: rise var(--dur-3) var(--ease) both; }
.anim-quick { animation: rise-quick .26s var(--ease) both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}
@keyframes rise-quick { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { transform: scale(.5); opacity: 0; } }

/* ============================================================
   5. 侧边栏
   ============================================================ */

.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 20px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--accent-2), var(--accent) 55%, var(--accent-3));
  color: #fff; font-weight: 700; font-size: 16px;
  box-shadow: 0 6px 22px -6px color-mix(in srgb, var(--accent) 85%, transparent), var(--inner-hi);
  transition: transform var(--dur-2) var(--ease-spring);
}
.brand:hover .brand-mark { transform: scale(1.07) rotate(-3deg); }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 14.5px; letter-spacing: -.02em; }
.brand-text span { font-size: 11px; color: var(--text-3); }

.nav { position: relative; display: flex; flex-direction: column; gap: 16px; flex: 1; }
.nav-group { display: flex; flex-direction: column; gap: 1px; }
.nav-group-title {
  font-size: 10.5px; font-weight: 600; letter-spacing: .09em;
  color: var(--text-3); text-transform: uppercase;
  padding: 0 10px 5px;
}

.nav-pill {
  position: absolute; left: 0; width: 100%; height: 34px;
  border-radius: var(--r-sm);
  background: linear-gradient(100deg, var(--accent-soft), rgba(34, 211, 238, .12));
  box-shadow: inset 0 0 0 1px var(--accent-line), 0 0 22px -8px var(--accent);
  opacity: 0; pointer-events: none; z-index: 0;
  transition: transform var(--dur-3) var(--ease-spring),
              height var(--dur-3) var(--ease-spring),
              opacity var(--dur-2) var(--ease);
}

.nav-item {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 10px;
  height: 34px; padding: 0 10px; border-radius: var(--r-sm);
  color: var(--text-2); font-size: 13.5px; font-weight: 500;
  transition: color var(--dur-1) var(--ease);
}
.nav-item .i { color: var(--text-3); transition: color var(--dur-1) var(--ease), transform var(--dur-2) var(--ease-spring); }
.nav-item:hover { color: var(--text); }
.nav-item:hover .i { color: var(--text-2); transform: scale(1.1); }
.nav-item.is-active { color: var(--text); font-weight: 600; }
.nav-item.is-active .i { color: var(--accent); filter: drop-shadow(0 0 8px color-mix(in srgb, var(--accent) 70%, transparent)); }

.nav-count {
  margin-left: auto; font-style: normal; font-size: 10.5px; font-weight: 700;
  min-width: 19px; height: 18px; padding: 0 6px; border-radius: 999px;
  display: none; place-items: center;
  background: var(--surface-3); color: var(--text-2);
}
.nav-count.is-on { display: grid; animation: pop-in var(--dur-3) var(--ease-spring); }
.nav-item.is-active .nav-count { background: var(--accent); color: #fff; box-shadow: var(--glow); }

.sidebar-foot {
  padding-top: 14px; margin-top: 12px;
  border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 10px;
}
.storage { display: flex; flex-direction: column; gap: 8px; }
.storage-row { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; color: var(--text-2); }
.storage-row span { display: inline-flex; align-items: center; gap: 5px; }
.storage-row b { font-variant-numeric: tabular-nums; font-weight: 600; }
.storage-bar { height: 3px; border-radius: 3px; background: var(--track); overflow: hidden; }
.storage-bar i {
  display: block; height: 100%; border-radius: 3px; width: 0;
  background: linear-gradient(90deg, var(--accent-2), var(--accent), var(--accent-3));
  transition: width .9s var(--ease);
}
.storage-hint { font-size: 10.5px; color: var(--text-3); }
.storage-hint.warn { color: var(--warn); }
.storage-hint a { text-decoration: underline; text-underline-offset: 2px; }
.foot-note { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--text-3); }

/* ============================================================
   6. 按钮与控件
   ============================================================ */

.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 15px; border-radius: var(--r-sm);
  border: 1px solid transparent; background: transparent;
  font-size: 13.5px; font-weight: 550; cursor: pointer; white-space: nowrap;
  letter-spacing: -.006em; overflow: hidden;
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease),
              box-shadow var(--dur-2) var(--ease), transform var(--dur-1) var(--ease),
              color var(--dur-1) var(--ease), opacity var(--dur-1) var(--ease);
}
.btn:active { transform: scale(.97); }
.btn[disabled], .btn.is-disabled { opacity: .42; cursor: not-allowed; transform: none; }
.btn .i { transition: transform var(--dur-2) var(--ease-spring); }
.btn:hover .i { transform: scale(1.1); }

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 1px 2px rgba(10, 12, 16, .18), inset 0 1px 0 rgba(255, 255, 255, .12);
  transition: background var(--dur-1) var(--ease), box-shadow var(--dur-2) var(--ease),
              transform var(--dur-1) var(--ease);
}
.btn-primary:hover {
  background: color-mix(in srgb, var(--accent) 86%, var(--instrument));
  box-shadow: 0 2px 6px rgba(10, 12, 16, .2), inset 0 1px 0 rgba(255, 255, 255, .14);
}
/* 掠过式高光（很克制，浅色下只是材质变化） */
.btn-primary::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 34%, rgba(255, 255, 255, .22) 48%, transparent 62%);
  transform: translateX(-130%);
  transition: transform .8s var(--ease);
}
.btn-primary:hover::after { transform: translateX(130%); }

/* 信号按钮：只用在「现在就要做」的动作上 */
.btn-signal {
  background: var(--signal);
  color: #fff;
  box-shadow: 0 1px 2px rgba(255, 74, 23, .3), inset 0 1px 0 rgba(255, 255, 255, .2);
}
.btn-signal:hover { background: color-mix(in srgb, var(--signal) 88%, #000); }

.btn-ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
  backdrop-filter: blur(10px);
}
.btn-ghost:hover { background: var(--surface-2); border-color: var(--line-2); box-shadow: var(--shadow-2); }

.btn-danger { background: linear-gradient(140deg, var(--danger), color-mix(in srgb, var(--danger) 70%, var(--accent-3))); color: #fff; }
.btn-danger-ghost { color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }

.btn-sm { height: 31px; padding: 0 12px; font-size: 12.5px; border-radius: 9px; }
.btn-xs { height: 26px; padding: 0 9px; font-size: 11.5px; border-radius: 8px; gap: 4px; }
.btn-row { display: flex; gap: 8px; align-items: center; }
.btn-row.wrap { flex-wrap: wrap; }

.icon-btn {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 10px;
  border: 1px solid transparent; background: transparent;
  color: var(--text-2); cursor: pointer;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease),
              border-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--line); color: var(--text); }
.icon-btn:active { transform: scale(.93); }
.icon-btn.xs { width: 22px; height: 22px; border-radius: 6px; }
.icon-btn.is-muted { color: var(--text-3); opacity: .7; }
.i { display: block; flex: none; }

/* ============================================================
   7. 玻璃面板
   ============================================================ */

/* 双层背景实现「渐变描边 + 实心内容」 */
.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 0;                     /* 直角 = 仪器；圆角 + 阴影 = 后台管理系统 */
  background: color-mix(in srgb, var(--surface) 58%, transparent);
  box-shadow: none;                     /* 不再"浮"在页面上，靠发丝线分层 */
  overflow: hidden;
  transition: border-color var(--dur-2) var(--ease), background var(--dur-2) var(--ease);
}
/* 光标跟随的高光（很淡，只作为材质变化） */
.card::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 0%),
    color-mix(in srgb, var(--text) 4%, transparent), transparent 64%);
  opacity: 0; transition: opacity var(--dur-3) var(--ease);
}
.card:hover::after { opacity: 1; }
.card:hover { border-color: var(--line-2); background: color-mix(in srgb, var(--surface) 72%, transparent); }

.card-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 20px; border-bottom: 1px solid var(--line);
}
.card-head h3 {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase; color: var(--text-3);
  display: flex; align-items: center; gap: 8px;
}
.card-head h3 .i { color: var(--text-3); }
.card-head .muted, .card-head .btn { margin-left: auto; }
.card-head .btn + .muted { margin-left: 0; }
.card-body { padding: 18px 20px; }
.card-body > * + * { margin-top: 14px; }
.card > * { position: relative; z-index: 1; }

/* 药丸徽章 */
.badge {
  display: inline-flex; align-items: center; height: 21px; padding: 0 9px;
  border-radius: 999px; font-size: 11px; font-weight: 650; white-space: nowrap;
  letter-spacing: .01em;
  background: var(--surface-2); color: var(--text-2);
  border: 1px solid var(--line);
}
.badge-green { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.badge-amber { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.badge-red { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.badge-blue { background: var(--blue-soft); color: var(--blue); border-color: color-mix(in srgb, var(--blue) 30%, transparent); }
.badge-violet { background: var(--violet-soft); color: var(--violet); border-color: color-mix(in srgb, var(--violet) 32%, transparent); }
.badge-neutral { background: var(--surface-2); color: var(--text-2); }

.muted { color: var(--text-2); }
.small { font-size: 12px; }
.ok { color: var(--ok); }
.bad { color: var(--danger); }
.warn { color: var(--warn); }

/* 页头 */
.page-head { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; padding: 8px 0 2px; }
.page-head-main { flex: 1; min-width: 240px; }
.page-eyebrow {
  font-size: 11.5px; font-weight: 650; letter-spacing: .1em; text-transform: uppercase;
  margin-bottom: 7px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent), var(--accent-3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.page-title {
  font-size: clamp(27px, 2.9vw, 38px);
  line-height: 1.1; letter-spacing: -.035em;
  display: flex; align-items: center; gap: 10px;
  /* 渐变文字：上白下灰，关键的「高级感」来源之一 */
  background: linear-gradient(180deg, var(--text) 42%, color-mix(in srgb, var(--text) 74%, transparent));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.page-title .badge { -webkit-text-fill-color: currentColor; }
.page-desc { color: var(--text-2); font-size: 14px; margin-top: 9px; max-width: 62ch; text-wrap: pretty; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* 统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(162px, 1fr)); gap: 12px; }
.stat-grid.mini { grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); }
.stat-card {
  position: relative;
  border: 0; border-top: 1px solid var(--line);   /* 不装盒，只留一条上发丝线 */
  border-radius: 0;
  padding: 16px 4px 14px;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  transition: border-color var(--dur-2) var(--ease);
}
.stat-card:hover { border-color: var(--line-2); }
.stat-card > * { position: relative; z-index: 1; }
.stat-head {
  display: flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  letter-spacing: .15em; text-transform: uppercase; color: var(--text-3);
}
.stat-head .i { color: var(--text-3); }
.stat-value {
  font-size: 30px; font-weight: 600; letter-spacing: -.045em; margin-top: 8px;
  font-variant-numeric: tabular-nums; font-family: var(--font-mono); line-height: 1.05;
}
.stat-sub { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.stat-warn .stat-value { color: var(--warn); }
.stat-ok .stat-value { color: var(--ok); }

/* 提示条 */
.callout {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 18px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--surface);
  backdrop-filter: blur(14px);
  font-size: 13px;
}
.callout > div { flex: 1; min-width: 200px; display: flex; flex-direction: column; }
.callout b { font-weight: 600; }
.callout span { color: var(--text-2); font-size: 12.5px; }
.callout-info { background: var(--blue-soft); border-color: color-mix(in srgb, var(--blue) 28%, transparent); }
.callout-info .i { color: var(--blue); }
.callout-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 28%, transparent); }
.callout-warn .i { color: var(--warn); }
.callout-ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 28%, transparent); }
.callout-ok .i { color: var(--ok); }

/* 空状态 */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 52px 24px; }
.empty-icon {
  width: 62px; height: 62px; border-radius: 20px;
  display: grid; place-items: center; margin-bottom: 16px;
  color: #fff;
  background: linear-gradient(140deg, var(--accent-2), var(--accent) 55%, var(--accent-3));
  box-shadow: 0 14px 40px -12px color-mix(in srgb, var(--accent) 95%, transparent);
  animation: float 5s var(--ease-in-out) infinite alternate;
}
@keyframes float { to { transform: translateY(-8px); } }
.empty-title { font-weight: 650; font-size: 16px; letter-spacing: -.02em; }
.empty-desc { color: var(--text-2); font-size: 13.5px; margin-top: 7px; max-width: 42ch; text-wrap: pretty; }
.empty-act { margin-top: 18px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* 列表 */
.list { display: flex; flex-direction: column; }
.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 12px; margin: 0 -12px;
  border-bottom: 1px solid var(--line);
  border-radius: var(--r-sm);
  transition: background var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--surface-2); box-shadow: inset 2px 0 0 var(--accent); }
.list-row-lg { align-items: flex-start; }
.list-main { flex: 1; min-width: 0; }
.list-title { font-size: 13.5px; font-weight: 500; word-break: break-word; text-wrap: pretty; }
.list-sub { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-3); margin-top: 5px; }
.list-side { display: flex; align-items: center; gap: 8px; flex: none; }
.list-side.col { flex-direction: column; align-items: flex-end; gap: 7px; }

/* ============================================================
   8. 表单
   ============================================================ */

.form { display: flex; flex-direction: column; gap: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid > .col-2 { grid-column: span 2; }
.form-foot { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.req { color: var(--danger); }
.field-hint { font-size: 11px; color: var(--text-3); }
.field-static { font-size: 13px; padding: 8px 0; }

.input {
  width: 100%; min-width: 0; height: 38px; padding: 0 12px;
  /* 用 background-color 而不是 background 简写：
     简写会把 background-repeat 重置成 repeat，于是 select 上的箭头图标
     在获得焦点（= 打开下拉）的一瞬间被平铺，框里塞满箭头。 */
  background-color: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  font-size: 13.5px; font-family: inherit; outline: none;
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-2) var(--ease),
              background-color var(--dur-1) var(--ease);
}
textarea.input { height: auto; padding: 10px 12px; line-height: 1.65; resize: vertical; }
.input:hover { border-color: var(--line-2); }
.input:focus {
  border-color: var(--accent);
  background-color: var(--bg-2);
  box-shadow: var(--ring);
}
.input::placeholder { color: var(--text-3); }
select.input {
  appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236c6c82' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
[data-theme="light"] select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b89a3' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

.checks { display: flex; flex-wrap: wrap; gap: 10px 18px; padding: 6px 0; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; transition: transform var(--dur-1) var(--ease-spring); }
.check input:active { transform: scale(.85); }
.check.only-check { padding: 2px; }

.switch-row { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; padding: 6px 0; }
.switch-row input { display: none; }
.switch { width: 38px; height: 21px; border-radius: 11px; background: var(--track); position: relative; transition: background var(--dur-2) var(--ease); flex: none; }
.switch::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
  transition: transform var(--dur-2) var(--ease-spring);
}
.switch-row input:checked + .switch { background: linear-gradient(120deg, var(--accent-2), var(--accent)); box-shadow: var(--glow); }
.switch-row input:checked + .switch::after { transform: translateX(17px); }
.switch-text { font-size: 12px; color: var(--text-3); }

.progress { height: 6px; border-radius: 999px; background: var(--track); overflow: hidden; }
.progress i {
  display: block; height: 100%; border-radius: 999px; width: 0;
  background: linear-gradient(90deg, var(--accent-2), var(--accent), var(--accent-3));
  box-shadow: 0 0 12px -2px var(--accent);
  transition: width 1s var(--ease);
}
.progress-warn i { background: linear-gradient(90deg, var(--warn), var(--danger)); box-shadow: none; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar .input { width: auto; min-width: 130px; }
.search-box { position: relative; flex: 1; min-width: 190px; }
.search-box .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search-box .input { padding-left: 34px; }

.bulk-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; border: 1px dashed var(--line-2);
  border-radius: var(--r); background: var(--surface-2);
  font-size: 12.5px;
}
.bulk-bar .muted { margin-right: auto; }

.load-more { display: flex; justify-content: center; padding: 4px 0 8px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(224px, 1fr)); gap: 12px; }
.quick-card {
  display: flex; align-items: center; gap: 13px; padding: 16px 18px;
  transition: transform var(--dur-3) var(--ease), box-shadow var(--dur-3) var(--ease);
}
.quick-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-3), var(--glow); }
.quick-card > .i:last-child { color: var(--text-3); margin-left: auto; transition: transform var(--dur-2) var(--ease), color var(--dur-2) var(--ease); }
.quick-card:hover > .i:last-child { transform: translateX(4px); color: var(--accent-2); }
.quick-icon {
  width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; flex: none;
  color: #fff;
  background: linear-gradient(140deg, var(--accent-2), var(--accent) 60%, var(--accent-3));
  box-shadow: 0 8px 24px -10px color-mix(in srgb, var(--accent) 95%, transparent);
}
.quick-text { display: flex; flex-direction: column; min-width: 0; }
.quick-text b { font-size: 13.5px; letter-spacing: -.012em; }
.quick-text span { font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(152px, 1fr)); gap: 10px; }
.kv {
  display: flex; flex-direction: column; gap: 3px; padding: 10px 12px;
  background: var(--surface-2); border-radius: var(--r-sm); border: 1px solid var(--line);
}
.kv span { font-size: 11px; color: var(--text-3); }
.kv b { font-size: 13px; font-weight: 600; word-break: break-all; font-variant-numeric: tabular-nums; }
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(152px, 1fr)); gap: 10px; }

/* ============================================================
   9. 首页 · 整版仪表面（Face）
   ------------------------------------------------------------
   刻意不做成卡片：去掉外框，发丝线通栏，两个入口用一条竖线切开。
   形状上做区分——左边是「单位阵列」，右边是一个圆弧。
   ============================================================ */

.face-pad {
  max-width: 1080px;
  padding: 4px 26px 84px;
  gap: 0;
}

.face {
  position: relative;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 46%, transparent);
}
/* 顶部刻度齿 + 四角定位角标 */
.face::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 6px;
  background-image: repeating-linear-gradient(90deg,
    color-mix(in srgb, var(--text) 20%, transparent) 0 1px, transparent 1px 9px);
  background-position: left top; background-size: 100% 3px; background-repeat: no-repeat;
  opacity: .5; pointer-events: none;
}
.face::after {
  content: ''; position: absolute; inset: 10px; pointer-events: none; z-index: 3;
  --tk: color-mix(in srgb, var(--text) 22%, transparent);
  background-image:
    linear-gradient(var(--tk), var(--tk)), linear-gradient(var(--tk), var(--tk)),
    linear-gradient(var(--tk), var(--tk)), linear-gradient(var(--tk), var(--tk)),
    linear-gradient(var(--tk), var(--tk)), linear-gradient(var(--tk), var(--tk)),
    linear-gradient(var(--tk), var(--tk)), linear-gradient(var(--tk), var(--tk));
  background-repeat: no-repeat;
  background-size: 8px 1px, 1px 8px, 8px 1px, 1px 8px, 8px 1px, 1px 8px, 8px 1px, 1px 8px;
  background-position: left top, left top, right top, right top,
    left bottom, left bottom, right bottom, right bottom;
  pointer-events: none;
}
.face > * { position: relative; z-index: 1; }

.face-bar {
  display: flex; align-items: center; gap: 14px;
  height: 46px; padding: 0 22px;
}
.face-bar .face-spacer { flex: 1; }

/* —— 任何页面用同一块仪表面时：分区一律靠发丝线，不靠卡片 —— */
.face > * + * { border-top: 1px solid var(--line); }

/* 主读数区（首页 / 统计页共用） */
.face-hero {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: clamp(36px, 5.4vh, 62px) 24px clamp(26px, 3.4vh, 40px);
}
.face-hero-num { display: flex; align-items: baseline; gap: 10px; margin-top: 18px; }
.face-hero-num .inst-num {
  font-family: var(--font-mono); font-weight: 600;
  font-size: clamp(64px, 9vw, 118px); line-height: .84;
  letter-spacing: -.06em; font-variant-numeric: tabular-nums;
}
.face-hero-num .inst-unit { font-size: 16px; color: var(--text-2); }
.readout-row {
  margin-top: 22px;
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 14px;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .04em; color: var(--text-3);
}
.readout-row b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.readout-row .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-2); }

.face-sec { padding: 20px 22px 22px; }
.face-sec-head {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.face-sec-tail { margin-left: auto; font-size: 11.5px; color: var(--text-3); }
.face-sec-body { min-width: 0; }
.split-2 { display: grid; grid-template-columns: 1fr 1fr; }
.split-2 > * + * { border-left: 1px solid var(--line); }

/* —— 序号 + 英文小标（两个入口共用） —— */
.choice-idx {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  color: var(--text-3); letter-spacing: .1em;
}
.choice-kicker {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--text-3);
}

/* —— 主入口：占满宽度的大块 —— */
.primary {
  position: relative; width: 100%;
  display: grid; grid-template-columns: minmax(0, 1fr) 260px;
  align-items: center; gap: 32px;
  padding: 44px 42px 42px;
  border: 0; background: transparent; cursor: pointer; text-align: left;
  transition: background var(--dur-2) var(--ease);
}
.primary::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--text); transform: scaleX(0); transform-origin: left;
  transition: transform var(--dur-3) var(--ease);
}
.primary.is-signal::after { background: var(--signal); }
.primary:hover { background: color-mix(in srgb, var(--text) 2.4%, transparent); }
.primary:hover::after { transform: scaleX(1); }
.primary:focus-visible { box-shadow: inset var(--ring); }

.primary-main { display: flex; flex-direction: column; min-width: 0; }
.primary-top { display: flex; align-items: baseline; gap: 12px; }
.primary-figure { display: flex; align-items: baseline; gap: 14px; margin-top: 22px; }
.primary-num {
  font-family: var(--font-mono); font-weight: 600;
  font-size: clamp(60px, 7.4vw, 104px); line-height: .84;
  letter-spacing: -.058em; font-variant-numeric: tabular-nums;
}
.primary-unit { font-size: 14px; color: var(--text-2); }
.primary-desc {
  margin-top: 16px; max-width: 46ch;
  font-size: 13.5px; line-height: 1.85; color: var(--text-2);
}
.primary-desc b { color: var(--text); font-weight: 600; }
.primary .btn { margin-top: 28px; align-self: flex-start; pointer-events: none; }
.primary-side { flex: none; display: flex; align-items: center; justify-content: center; }

/* —— 次入口：一行窄条 —— */
.rowlink {
  width: 100%; display: flex; align-items: center; gap: 16px;
  padding: 19px 42px;
  border: 0;
  background: transparent; cursor: pointer; text-align: left;
  transition: background var(--dur-2) var(--ease);
}
.rowlink:hover { background: color-mix(in srgb, var(--text) 2.4%, transparent); }
.rowlink:hover .rowlink-go { transform: translateX(4px); color: var(--text); }
.rowlink:focus-visible { box-shadow: inset var(--ring); }
.rowlink-title { font-size: 16px; font-weight: 600; letter-spacing: -.022em; font-family: var(--font-display); }
.rowlink-meta { font-size: 12.5px; color: var(--text-3); }
.rowlink .units { margin-left: auto; }
.rowlink-go {
  margin-left: 14px; color: var(--text-3); display: flex;
  transition: transform var(--dur-2) var(--ease), color var(--dur-2) var(--ease);
}

/* 左：单位阵列（每道题一个小方块，做过的是淡的） */
.units { display: flex; flex-wrap: wrap; gap: 5px; max-width: 288px; }
.units i { display: block; width: 7px; height: 7px; background: var(--text); }
.units i.is-done { background: var(--line-2); }
.units i.is-hot { background: var(--signal); }
.units.is-lg { max-width: 260px; gap: 8px; }
.units.is-lg i { width: 13px; height: 13px; }

/* 右：圆弧（全站唯一的曲线元素） */
.arc { position: relative; width: 128px; height: 128px; }
.arc svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.arc-track { fill: none; stroke: var(--track); stroke-width: 1.5; }
.arc-val {
  fill: none; stroke: var(--signal); stroke-width: 1.5; stroke-linecap: butt;
  stroke-dasharray: var(--len); stroke-dashoffset: var(--off);
  transition: stroke-dashoffset 1.1s var(--ease);
}
.arc-num {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 40px; font-weight: 600;
  letter-spacing: -.05em; font-variant-numeric: tabular-nums; line-height: 1;
  transform: translateX(-.02em);
}
.arc-cap {
  position: absolute; left: 0; right: 0; bottom: -2px; text-align: center;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .16em; color: var(--text-3);
}

.choice-go {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 14px; font-weight: 550; color: var(--text);
}
.choice-go .i { transition: transform var(--dur-2) var(--ease); }
.choice:hover .choice-go .i { transform: translateX(5px); }
.choice.is-signal .choice-go { color: var(--signal); }

/* —— 一行状态 + 底部入口（都是无框的裸排版） —— */
.face-status {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 16px; padding: 17px 22px;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .04em; color: var(--text-3);
}
.face-status b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.face-status .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-2); }

.face-foot {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  padding: 6px 14px 6px 8px;
}
.face-foot .face-spacer { flex: 1; }

/* —— 开盘编排 —— */
.face.boot .face-bar { animation: rise .5s var(--ease) .06s both; }
.face.boot .primary { animation: rise .62s var(--ease) .16s both; }
.face.boot .primary-num { animation: figure-in .8s var(--ease) .3s both; }
.face.boot .primary-side { animation: fade-in .6s var(--ease) .34s both; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.face.boot .arc-val { animation: arc-draw 1.1s var(--ease) .5s both; }
@keyframes arc-draw { from { stroke-dashoffset: var(--len); } to { stroke-dashoffset: var(--off); } }
.face.boot .units i { animation: pop-in .32s var(--ease) both; animation-delay: calc(var(--i, 0) * 9ms + 380ms); }
.face.boot .rowlink { animation: rise .5s var(--ease) .6s both; }
.face.boot .face-status { animation: rise .5s var(--ease) .7s both; }
.face.boot .face-foot { animation: rise .5s var(--ease) .8s both; }

/* —— 空状态的一行引导 —— */
.face-empty {
  padding: 22px 22px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--text-2);
}
.face-empty a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 880px) {
  .face-pad { padding: 4px 16px 100px; }
  .primary { grid-template-columns: 1fr; gap: 26px; padding: 28px 22px 26px; }
  .primary-side { justify-content: flex-start; }
  .primary-num { font-size: 62px; }
  .primary-figure { margin-top: 16px; }
  .primary-desc { margin-top: 12px; }
  .primary .btn { margin-top: 22px; }
  .rowlink { padding: 16px 22px; gap: 12px; flex-wrap: wrap; }
  .rowlink .units { margin-left: 0; order: 9; width: 100%; max-width: none; }
  .rowlink-go { margin-left: auto; }
  .arc { width: 104px; height: 104px; }
  .arc-num { font-size: 32px; }
  .units.is-lg i { width: 11px; height: 11px; }
  .face-status { gap: 12px; font-size: 11px; }
  .split-2 { grid-template-columns: 1fr; }
  .split-2 > * + * { border-left: 0; }
  .face-sec { padding: 16px 18px 18px; }
  .face-hero { padding: 30px 18px 24px; }
  .face-sec-tail { margin-left: 0; width: 100%; }
}

.inst {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  overflow: hidden;
}
/* 盘面内部的细网格（工程图纸）—— 很淡，只在盘面上半部分 */
.inst::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(color-mix(in srgb, var(--text) 3.2%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--text) 3.2%, transparent) 1px, transparent 1px);
  background-size: 20px 20px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .3) 42%, transparent 72%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .3) 42%, transparent 72%);
}
.inst > * { position: relative; z-index: 1; }

/* 通用：等宽小标签 */
.inst-label {
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase; color: var(--text-3);
  white-space: nowrap;
}

/* —— 顶部状态条（带刻度齿）—— */
.inst-bar {
  display: flex; align-items: center; gap: 14px;
  height: 44px; padding: 0 20px;
  border-bottom: 1px solid var(--line);
}
.inst-brand { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; color: var(--text); font-weight: 600; }
.inst-bar .inst-spacer { flex: 1; }
.inst-stamp { font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; color: var(--text-3); }
/* 沿顶边的刻度：仪器感的第一来源 */
.inst-ticks {
  height: 7px;
  background-image: repeating-linear-gradient(90deg,
    color-mix(in srgb, var(--text) 22%, transparent) 0 1px, transparent 1px 10px);
  background-position: bottom;
  background-size: 100% 4px;
  background-repeat: no-repeat;
  border-bottom: 1px solid var(--line);
}

/* —— 主读数区 —— */
.inst-main { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); }
.inst-readout {
  padding: 24px 22px 22px;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 8px;
}
.inst-figure { display: flex; align-items: baseline; gap: 8px; }
.inst-num {
  font-family: var(--font-mono); font-weight: 600;
  font-size: clamp(54px, 6.4vw, 82px); line-height: .88;
  letter-spacing: -.055em; font-variant-numeric: tabular-nums;
}
/* 数字滚动用的内层容器：只负责"这个数字会变"，不改变任何排版。
   <i> 默认是斜体，而它可能被塞进 .inst-num / .primary-num / .face-status 里，
   所以这些重置必须写全 —— 否则大读数会变成斜体。 */
.countup {
  font-style: normal; font: inherit; color: inherit;
  font-variant-numeric: tabular-nums; letter-spacing: inherit;
}
@keyframes figure-in {
  from { clip-path: inset(0 0 100% 0); transform: translateY(8px); }
  to { clip-path: inset(0 0 0 0); transform: none; }
}
.inst-unit { font-size: 13px; color: var(--text-2); }
.inst-note { font-size: 12px; color: var(--text-3); }
.inst-note.is-signal { color: var(--signal); font-weight: 600; }
.inst-note.is-ok { color: var(--ok); }
.inst-actions { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.inst-eta { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }

/* 今日进度（填满读数区下方，同时是有用的信息） */
.inst-goal { margin-top: auto; padding-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.inst-goal-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.inst-goal-row b {
  font-family: var(--font-mono); font-size: 13px; font-weight: 600;
  font-variant-numeric: tabular-nums; letter-spacing: -.01em;
}

/* —— 到期标尺 —— */
.inst-ruler { display: flex; flex-direction: column; }
.inst-ruler-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px 10px;
}
.inst-ruler-head .inst-tail { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }
.inst-buckets {
  flex: 1; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px; background: var(--line);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.inst-bucket {
  background: var(--surface); padding: 12px 12px 0;
  display: flex; flex-direction: column; gap: 8px; min-height: 128px;
}
.inst-bucket-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.inst-bucket b {
  font-family: var(--font-mono); font-size: 15px; font-weight: 600;
  font-variant-numeric: tabular-nums; color: var(--text-2);
}
.inst-bucket i { font-style: normal; font-family: var(--font-mono); font-size: 10px; color: var(--text-3); }
.inst-bucket.is-now b { color: var(--signal); }
.inst-bucket.is-now i { color: var(--signal); }
.inst-col { flex: 1; display: flex; align-items: flex-end; }
.inst-col::after {
  content: ''; display: block; width: 100%; height: var(--h, 0%);
  min-height: 2px; background: var(--text-2); border-radius: 1px;
}
.inst-bucket.is-now .inst-col::after { background: var(--signal); }
.inst-bucket.is-empty .inst-col::after { background: var(--track); }
.inst-axis {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  padding: 7px 12px 0;
}
.inst-axis span { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .1em; color: var(--text-3); }

/* —— 下半：曲线 + 读数 —— */
.inst-split { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); border-top: 1px solid var(--line); }
.inst-trace { padding: 16px 20px 18px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.inst-meters { padding: 16px 20px 18px; display: flex; flex-direction: column; gap: 12px; }
.inst-panel-head { display: flex; align-items: baseline; gap: 12px; }
.inst-panel-head .inst-figure-inline {
  margin-left: auto; font-family: var(--font-mono); font-size: 17px; font-weight: 600;
  font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.inst-trace svg { display: block; width: 100%; height: auto; }
.inst-trace .trace-grid { stroke: var(--grid-line); stroke-width: 1; }
.inst-trace .trace-axis { stroke: var(--line); stroke-width: 1; }
.inst-trace .trace-line {
  fill: none; stroke: var(--text); stroke-width: 2;
  stroke-linejoin: round; stroke-linecap: round;
}
.inst-trace .trace-pt { fill: var(--surface); stroke: var(--text); stroke-width: 1.2; }
.inst-trace .trace-pt.is-now { fill: var(--signal); stroke: var(--signal); }
.inst-trace .trace-foot { display: flex; gap: 14px; font-family: var(--font-mono); font-size: 10px; color: var(--text-3); }

.meter { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.meter span { font-family: var(--font-mono); font-size: 10px; letter-spacing: .13em; color: var(--text-3); }
.meter b { font-family: var(--font-mono); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.meter-track { position: relative; height: 3px; background: var(--track); border-radius: 0; overflow: hidden; }
.meter-track::after {
  content: ''; position: absolute; inset: 0 auto 0 0; width: var(--w, 0%);
  background: var(--text); border-radius: 0;
}
.meter.is-signal .meter-track::after { background: var(--signal); }
.meter.is-ok .meter-track::after { background: var(--ok); }
@keyframes grow-x { from { width: 0; } to { width: var(--w, 0%); } }

/* —— 今日计划：横向紧凑条 —— */
.inst-plan { border-top: 1px solid var(--line); padding: 16px 20px 18px; display: flex; flex-direction: column; gap: 12px; }
.inst-plan-head { display: flex; align-items: center; gap: 12px; }
.inst-plan-head .btn { margin-left: auto; }
.inst-plan-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.inst-plan-list .plan-cell {
  background: var(--surface); padding: 11px 13px;
  display: flex; align-items: flex-start; gap: 10px;
  transition: background var(--dur-1) var(--ease);
}
.inst-plan-list .plan-cell:hover { background: var(--surface-2); }
.inst-plan-list .plan-cell.is-done .plan-title { color: var(--text-3); text-decoration: line-through; }
.plan-main { flex: 1; min-width: 0; }
.plan-title { font-size: 13px; line-height: 1.45; }
.plan-meta { font-family: var(--font-mono); font-size: 10px; color: var(--text-3); margin-top: 3px; letter-spacing: .04em; }

/* —— 底部：快捷入口（一行，极简） —— */
.inst-foot {
  border-top: 1px solid var(--line);
  padding: 0 20px; height: 46px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.inst-link {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--text-2); padding: 6px 10px; border-radius: var(--r-sm);
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.inst-link:hover { background: var(--surface-2); color: var(--text); }
.inst-link .i { color: var(--text-3); }
.inst-foot .inst-spacer { flex: 1; }
.inst-foot .inst-label { letter-spacing: .12em; }

/* —— 主读数：整块居中，一屏只说一件事 —— */
.inst-hero {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: clamp(44px, 7vh, 86px) 24px clamp(36px, 5vh, 62px);
  gap: 0;
}
.inst-hero-num { display: flex; align-items: baseline; gap: 12px; margin-top: 18px; }
.inst-hero .inst-num { font-size: clamp(84px, 15vw, 168px); line-height: .84; letter-spacing: -.06em; }
.inst-hero .inst-unit { font-size: 14px; color: var(--text-2); }
.inst-hero-note {
  margin-top: 18px; max-width: 34ch;
  font-size: 13.5px; line-height: 1.85; color: var(--text-2);
}
.inst-hero .inst-actions { margin-top: 30px; justify-content: center; }
.btn-lg { height: 48px; padding: 0 26px; font-size: 14.5px; border-radius: 999px; gap: 10px; }

/* —— 七天节奏：极细的柱子，只有今天用信号橙 —— */
.rhythm { border-top: 1px solid var(--line); padding: 18px 22px 20px; }
.rhythm-head { margin-bottom: 16px; }
.rhythm-cells { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); }
.rhythm-cell {
  background: var(--surface); padding: 0 10px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.rhythm-bar {
  display: block; width: 3px; height: var(--h, 0%); min-height: 3px;
  background: var(--text-3); border-radius: 2px;
  align-self: center;
  animation: grow-y .7s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 60ms);
}
.rhythm-cell { height: 92px; justify-content: flex-end; }
.rhythm-cell.is-today .rhythm-bar { background: var(--signal); width: 4px; }
.rhythm-cell.is-empty .rhythm-bar {
  width: 7px; height: 2px; min-height: 2px; border-radius: 1px;
  background: var(--line-2); animation: none;
}
.rhythm-n {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  font-variant-numeric: tabular-nums; color: var(--text-3); line-height: 1;
}
.rhythm-cell.is-today .rhythm-n { color: var(--signal); }
.rhythm-l { font-size: 11px; color: var(--text-3); line-height: 1; }
.rhythm-cell.is-today .rhythm-l { color: var(--text-2); }

/* —— 一行状态 —— */
.inst-meta {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 14px; padding: 16px 22px;
  border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--text-3);
}
.inst-meta b {
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 600;
  color: var(--text); font-variant-numeric: tabular-nums;
}
.inst-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-2); }

/* 主读数只在开盘时揭开（配合 .boot） */
.inst.boot .inst-hero { animation: rise .6s var(--ease) .22s both; }
.inst.boot .inst-hero-num .inst-num { animation: figure-in .8s var(--ease) .34s both; }
.inst.boot .rhythm { animation: rise .6s var(--ease) .62s both; }
.inst.boot .rhythm-bar { animation-delay: calc(700ms + var(--i, 0) * 60ms); }
.inst.boot .inst-meta { animation: rise .6s var(--ease) .82s both; }
.inst.boot .inst-foot { animation: rise .6s var(--ease) .92s both; }

/* —— 开场编排：像绘图仪一样「画」出来，而不是「淡入」 ——
   t=0    盘面出现
   120ms  顶部刻度从左向右画出
   280ms  主读数区浮现
   340ms  大数字遮罩揭开
   520ms  六根到期柱依次长出
   620ms  保持率曲线描边绘制
   700ms  状态读数条依次拉长
   820ms  今日计划 / 底部入口浮现
   —— 只在本次会话第一次打开首页时播放（JS 加 .boot） */
.inst.boot .inst-ticks { animation: ticks-in .8s var(--ease) .12s both; }
.inst.boot .inst-readout { animation: rise .5s var(--ease) .28s both; }
.inst.boot .inst-num { animation: figure-in .72s var(--ease) .34s both; }
.inst.boot .inst-ruler-head { animation: rise .5s var(--ease) .3s both; }
.inst.boot .inst-col::after {
  animation: grow-y .7s var(--ease) both;
  animation-delay: calc(520ms + var(--i, 0) * 70ms);
}
.inst.boot .inst-axis { animation: rise .5s var(--ease) .68s both; }
.inst.boot .inst-trace { animation: rise .5s var(--ease) .56s both; }
.inst.boot .inst-meters { animation: rise .5s var(--ease) .66s both; }
.inst.boot .meter-track::after {
  animation: grow-x .8s var(--ease) both;
  animation-delay: calc(700ms + var(--i, 0) * 80ms);
}
.inst.boot .inst-plan { animation: rise .5s var(--ease) .82s both; }
.inst.boot .inst-foot { animation: rise .5s var(--ease) .94s both; }

@keyframes ticks-in { from { background-size: 0 4px; } to { background-size: 100% 4px; } }

/* ============================================================
   10. 答题界面
   ============================================================ */

.runner { max-width: 870px; margin: 0 auto; padding: 12px 26px 100px; display: flex; flex-direction: column; gap: 18px; }
.runner-bar { display: flex; flex-direction: column; gap: 9px; }
.runner-progress { height: 4px; border-radius: 999px; background: var(--track); overflow: hidden; }
.runner-progress i, #runnerProgress {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent), var(--accent-3));
  box-shadow: 0 0 14px -2px var(--accent);
  transition: width var(--dur-3) var(--ease);
}
.runner-info { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--text-3); }
.runner-info .icon-btn:first-of-type { margin-left: auto; }
.runner-done { padding: 3px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }

.qz {
  position: relative;
  border: 1px solid transparent; border-radius: var(--r-xl);
  background:
    linear-gradient(var(--surface-solid), var(--surface-solid)) padding-box,
    var(--edge) border-box;
  box-shadow: var(--shadow-3);
  padding: 26px 28px;
}
.qz-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-3); margin-bottom: 14px; }
.qz-index { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--text-2); }
.qz-course { color: var(--text-3); }
.qz-mark { display: inline-flex; align-items: center; gap: 4px; color: var(--warn); }
.qz-stem {
  font-size: 19px; line-height: 1.55; font-weight: 550; letter-spacing: -.016em;
  word-break: break-word; white-space: pre-wrap; text-wrap: pretty;
}
.qz-short { margin-top: 16px; }
.qz-options { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.qz-option {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 14px 16px; border-radius: var(--r);
  border: 1.5px solid var(--line);
  background: var(--surface-2);
  cursor: pointer;
  transition: transform var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease),
              background var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}
.qz-option:hover:not([disabled]) {
  transform: translateY(-2px);
  border-color: var(--accent-line);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-2));
  box-shadow: 0 10px 30px -14px var(--accent);
}
.qz-option:active:not([disabled]) { transform: scale(.99); }
.qz-option.is-selected {
  border-color: var(--accent);
  background: linear-gradient(120deg, var(--accent-soft), color-mix(in srgb, var(--accent-2) 12%, transparent));
  box-shadow: var(--glow), inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent);
}
.qz-option.is-answer { border-color: var(--ok); background: var(--ok-soft); }
.qz-option.is-wrong { border-color: var(--danger); background: var(--danger-soft); }
.qz-key {
  width: 26px; height: 26px; border-radius: 9px; flex: none;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: var(--surface-3); color: var(--text-2); border: 1px solid var(--line);
  transition: background var(--dur-2) var(--ease), color var(--dur-2) var(--ease),
              transform var(--dur-2) var(--ease-spring), box-shadow var(--dur-2) var(--ease);
}
.qz-option:hover .qz-key { transform: scale(1.08); }
.qz-option.is-selected .qz-key { background: linear-gradient(140deg, var(--accent-2), var(--accent)); color: #fff; border-color: transparent; box-shadow: var(--glow); }
.qz-option.is-answer .qz-key { background: var(--ok); color: #04231a; border-color: transparent; }
.qz-option.is-wrong .qz-key { background: var(--danger); color: #2a060c; border-color: transparent; }
.qz-opt-text { flex: 1; font-size: 14.5px; }
.qz-tag { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; animation: pop-in var(--dur-3) var(--ease-spring); }
.qz-tag.ok { background: var(--ok-soft); color: var(--ok); }
.qz-tag.bad { background: var(--danger-soft); color: var(--danger); }

.qz-result {
  display: flex; gap: 12px; align-items: flex-start; margin-top: 18px;
  padding: 14px 16px; border-radius: var(--r); font-size: 13.5px;
  animation: rise var(--dur-3) var(--ease) both;
}
.qz-result.ok { background: var(--ok-soft); color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); }
.qz-result.bad { background: var(--danger-soft); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); }
.qz-result.neutral { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); }
.qz-result b { display: block; font-size: 14px; }
.qz-answer { font-size: 12.5px; color: var(--text-2); margin-top: 3px; }
.qz-answer strong { color: var(--text); }
.qz-explain {
  margin-top: 16px; padding: 15px 17px; border-radius: var(--r);
  background: var(--surface-2); border: 1px solid var(--line);
  animation: rise var(--dur-3) var(--ease) both;
}
.qz-explain-title { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; color: var(--accent-2); margin-bottom: 7px; }
.qz-explain-body { font-size: 13.5px; line-height: 1.8; color: var(--text); }
.qz-source { margin-top: 11px; font-size: 11.5px; color: var(--text-3); }
.qz-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.grade-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: 100%; }
.grade-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 13px 8px; border-radius: var(--r); border: 1.5px solid var(--line);
  background: var(--surface-2); cursor: pointer;
  transition: transform var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease),
              background var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}
.grade-btn b { font-size: 13.5px; font-weight: 650; }
.grade-btn span { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.grade-btn:hover { transform: translateY(-3px); }
.grade-btn:active { transform: translateY(-1px) scale(.98); }
.grade-again:hover { border-color: var(--danger); background: var(--danger-soft); box-shadow: 0 12px 30px -14px var(--danger); }
.grade-hard:hover { border-color: var(--warn); background: var(--warn-soft); box-shadow: 0 12px 30px -14px var(--warn); }
.grade-good:hover { border-color: var(--accent); background: var(--accent-soft); box-shadow: var(--glow); }
.grade-easy:hover { border-color: var(--ok); background: var(--ok-soft); box-shadow: 0 12px 30px -14px var(--ok); }

.result { max-width: 870px; margin: 0 auto; padding: 20px 26px 100px; display: flex; flex-direction: column; gap: 18px; }
.result-hero {
  position: relative; display: flex; align-items: center; gap: 26px; padding: 28px;
  border: 1px solid transparent; border-radius: var(--r-xl);
  background:
    linear-gradient(var(--surface-solid), var(--surface-solid)) padding-box,
    var(--edge-strong) border-box;
  box-shadow: var(--shadow-3); overflow: hidden;
}
.result-hero::after {
  content: ''; position: absolute; inset: -40% -10%;
  background: radial-gradient(38% 46% at 10% 20%, color-mix(in srgb, var(--ok) 40%, transparent), transparent 64%);
  filter: blur(50px); opacity: .5; pointer-events: none;
}
.result-hero > * { position: relative; z-index: 1; }
.result-main h2 { font-size: 25px; letter-spacing: -.035em; font-family: var(--font-display); }
.result-main p { color: var(--text-2); font-size: 13.5px; margin-top: 6px; }
.result-actions { display: flex; gap: 9px; flex-wrap: wrap; }

/* ============================================================
   11. 课程 / 题库 / 导入
   ============================================================ */

.course-grid { display: flex; flex-direction: column; gap: 12px; }
.course-head {
  display: flex; align-items: center; gap: 13px;
  padding: 16px 22px; cursor: pointer; user-select: none;
  transition: background var(--dur-1) var(--ease);
}
.course-head:hover { background: var(--surface-2); }
.course-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 14%, transparent), 0 0 14px currentColor; }
.course-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.course-title b { font-size: 14.5px; letter-spacing: -.018em; }
.course-title span { font-size: 12px; color: var(--text-3); }
.course-meta { display: flex; gap: 13px; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.course-head > .i:last-child { color: var(--text-3); transition: transform var(--dur-2) var(--ease); }
.course-head:hover > .i:last-child { transform: translateX(3px); color: var(--accent-2); }
.course-body { display: none; padding: 0 22px 18px; }
.course-card.is-open .course-body { display: block; animation: rise var(--dur-3) var(--ease) both; }
.course-stats { display: flex; gap: 26px; margin-bottom: 14px; }
.mini-stat { display: flex; flex-direction: column; }
.mini-stat b { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; font-family: var(--font-display); }
.mini-stat span { font-size: 11px; color: var(--text-3); }
.course-actions { display: flex; gap: 7px; margin-top: 15px; flex-wrap: wrap; }

.chapter-list { margin-top: 16px; border-top: 1px solid var(--line); }
.chapter-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.chapter-row:last-child { border-bottom: 0; }
.chapter-order {
  width: 23px; height: 23px; border-radius: 8px; flex: none;
  background: var(--surface-2); border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 11.5px; color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.chapter-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chapter-main b { font-size: 13.5px; }
.chapter-main span { font-size: 11.5px; color: var(--text-3); }
.chapter-ops { display: flex; gap: 2px; opacity: .5; transition: opacity var(--dur-2) var(--ease); }
.chapter-row:hover .chapter-ops { opacity: 1; }
.chapter-empty {
  margin-top: 16px; padding: 18px; text-align: center;
  border: 1px dashed var(--line-2); border-radius: var(--r);
  font-size: 12.5px; color: var(--text-3);
}

.opt-editor { display: flex; flex-direction: column; gap: 8px; margin-bottom: 9px; }
.opt-row { display: flex; align-items: center; gap: 9px; }
.opt-key {
  width: 24px; height: 24px; border-radius: 8px; flex: none;
  background: var(--surface-2); border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 11.5px; font-weight: 700; color: var(--text-2);
}

.import-help { margin-bottom: 14px; }
.import-formats { display: flex; gap: 6px; margin-bottom: 10px; }
.tab-btn {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface-2); font-size: 12.5px; cursor: pointer;
  transition: all var(--dur-2) var(--ease);
}
.tab-btn:hover { border-color: var(--line-2); }
.tab-btn.is-on {
  background: linear-gradient(120deg, var(--accent-soft), color-mix(in srgb, var(--accent-2) 14%, transparent));
  border-color: var(--accent-line); color: var(--text); font-weight: 650; box-shadow: var(--glow);
}
.import-area { font-family: var(--font-mono); font-size: 12.5px; line-height: 1.85; }
.import-row { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 14px; }
.field-inline { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--text-2); }
.field-inline .input { min-width: 152px; }
.import-preview { margin-top: 16px; max-height: 250px; overflow: auto; }
.prev-head { font-size: 12.5px; margin-bottom: 9px; }
.prev-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.prev-mark { width: 16px; flex: none; text-align: center; }
.prev-row.ok .prev-mark { color: var(--ok); }
.prev-row.bad .prev-mark { color: var(--danger); }
.prev-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prev-note { color: var(--text-3); font-size: 11.5px; flex: none; }

/* ============================================================
   12. AI 出题
   ============================================================ */

.ai-layout { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 18px; align-items: start; }
.ai-result { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.seg { display: inline-flex; gap: 3px; padding: 3px; margin-bottom: 16px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; }
.seg-btn {
  padding: 7px 16px; border: 0; background: transparent; border-radius: 999px;
  font-size: 12.5px; cursor: pointer; color: var(--text-2);
  transition: all var(--dur-2) var(--ease);
}
.seg-btn.is-on { background: linear-gradient(120deg, var(--accent-soft), color-mix(in srgb, var(--accent-2) 14%, transparent)); color: var(--text); font-weight: 650; box-shadow: var(--glow); }
.gen-status { display: flex; align-items: center; gap: 13px; }
.gen-status b { font-size: 13.5px; display: block; }
.gen-status span { font-size: 12px; color: var(--text-3); }
.spinner {
  width: 19px; height: 19px; border-radius: 50%; flex: none;
  border: 2px solid var(--track); border-top-color: var(--accent-2);
  animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.raw-out {
  max-height: 300px; overflow: auto; margin: 0; padding: 14px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm);
  font-family: var(--font-mono); font-size: 11.5px; line-height: 1.75;
  white-space: pre-wrap; word-break: break-word;
}
.cand-list { display: flex; flex-direction: column; gap: 10px; }
.cand {
  display: flex; gap: 12px; padding: 15px 16px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface-2);
  transition: border-color var(--dur-2) var(--ease), background var(--dur-2) var(--ease),
              box-shadow var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
}
.cand:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: var(--shadow-2); }
.cand.is-on { border-color: var(--accent-line); background: linear-gradient(120deg, var(--accent-soft), transparent); box-shadow: var(--glow); }
.cand-main { flex: 1; min-width: 0; }
.cand-q { font-size: 14px; font-weight: 550; white-space: pre-wrap; text-wrap: pretty; }
.cand-opts { display: flex; flex-direction: column; gap: 3px; margin-top: 8px; }
.cand-opt { font-size: 12.5px; color: var(--text-2); padding: 2px 9px; border-radius: 6px; }
.cand-opt.is-answer { background: var(--ok-soft); color: var(--ok); font-weight: 650; }
.cand-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-3); margin-top: 9px; }
.cand-exp { font-size: 12.5px; color: var(--text-2); margin-top: 8px; padding-left: 11px; border-left: 2px solid var(--accent-line); }
.cand-ops { display: flex; flex-direction: column; gap: 4px; }
.save-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.save-bar .btn { margin-left: auto; }

/* ============================================================
   13. 计划 / 笔记 / 统计
   ============================================================ */

.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.day-col {
  display: flex; flex-direction: column; gap: 9px; min-height: 190px; padding: 13px;
  border: 1px solid transparent; border-radius: var(--r);
  background:
    linear-gradient(var(--surface-solid), var(--surface-solid)) padding-box,
    var(--edge) border-box;
  box-shadow: var(--shadow-1);
  transition: transform var(--dur-3) var(--ease), box-shadow var(--dur-3) var(--ease);
}
.day-col:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.day-col.is-today { box-shadow: var(--shadow-2), 0 0 0 3px var(--accent-soft), var(--glow); }
.day-head { display: flex; flex-direction: column; gap: 3px; }
.day-head b { font-size: 12.5px; letter-spacing: -.012em; }
.day-due { font-size: 10.5px; color: var(--accent-2); font-variant-numeric: tabular-nums; font-weight: 600; }
.day-tasks { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.day-empty { color: var(--text-3); font-size: 12px; text-align: center; padding: 10px 0; }
.mini-task { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.mini-task.is-done .mini-task-title { text-decoration: line-through; color: var(--text-3); }
.mini-task-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-foot { display: flex; gap: 4px; flex-wrap: wrap; }

.task-list { display: flex; flex-direction: column; }
.task {
  display: flex; align-items: center; gap: 11px; padding: 10px 8px; margin: 0 -8px;
  border-bottom: 1px solid var(--line); border-radius: var(--r-sm);
  transition: background var(--dur-1) var(--ease);
}
.task:hover { background: var(--surface-2); }
.task:last-child { border-bottom: 0; }
.task-check {
  width: 20px; height: 20px; border-radius: 7px; flex: none; padding: 0;
  border: 1.5px solid var(--line-2); background: transparent;
  display: grid; place-items: center; cursor: pointer; color: #fff;
  transition: background var(--dur-2) var(--ease-spring), border-color var(--dur-2) var(--ease), transform var(--dur-1) var(--ease);
}
.task-check:hover { border-color: var(--accent); box-shadow: var(--glow); }
.task-check:active { transform: scale(.86); }
.task-check svg { animation: pop-in var(--dur-2) var(--ease-spring); }
.task-check.sm { width: 16px; height: 16px; border-radius: 5px; }
.task.is-done .task-check, .day-col .task-check:has(svg) {
  background: linear-gradient(140deg, var(--accent-2), var(--accent));
  border-color: transparent; box-shadow: var(--glow);
}
.task-main { flex: 1; min-width: 0; }
.task-title { font-size: 13.5px; }
.task.is-done .task-title { text-decoration: line-through; color: var(--text-3); }
.task-sub { font-size: 11.5px; color: var(--text-3); }
.review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.review-wide { grid-column: span 2; padding: 12px 14px; background: var(--surface-2); border-radius: var(--r-sm); border: 1px solid var(--line); }
.review-wide b { font-size: 11.5px; color: var(--text-3); display: block; margin-bottom: 4px; }
.review-wide p { font-size: 13px; white-space: pre-wrap; }

.notes-layout { display: grid; grid-template-columns: minmax(0, 302px) minmax(0, 1fr); gap: 18px; align-items: start; }
.notes-list .card-body { padding: 14px; }
.notes-editor { display: flex; flex-direction: column; }
.note-items { display: flex; flex-direction: column; gap: 3px; margin-top: 11px; max-height: 62vh; overflow-y: auto; }
.note-item {
  display: flex; flex-direction: column; gap: 3px; text-align: left;
  padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid transparent;
  background: transparent; cursor: pointer;
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
.note-item:hover { background: var(--surface-2); }
.note-item.is-on { background: linear-gradient(120deg, var(--accent-soft), transparent); border-color: var(--accent-line); }
.note-item b { font-size: 13px; }
.note-item span { font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-item em { font-size: 10.5px; color: var(--text-3); font-style: normal; }
.note-editor { display: flex; flex-direction: column; gap: 12px; }
.input-title {
  height: 48px; font-size: 20px; font-weight: 700; letter-spacing: -.03em;
  font-family: var(--font-display);
  border-color: transparent; background: transparent; padding-left: 0; box-shadow: none;
}
.input-title:focus { border-color: var(--line-2); background: var(--surface-2); padding-left: 12px; box-shadow: var(--ring); }
.note-meta-row { display: flex; gap: 10px; flex-wrap: wrap; }
.note-meta-row .input { flex: 1; min-width: 140px; width: auto; }
.note-content { font-size: 14px; line-height: 1.9; min-height: 320px; }
.note-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.mastery-list { display: flex; flex-direction: column; gap: 16px; }
.mastery-row { display: flex; flex-direction: column; gap: 7px; }
.mastery-head { display: flex; align-items: baseline; gap: 10px; justify-content: space-between; }
.mastery-head b { font-size: 13.5px; }
.mastery-foot { display: flex; gap: 14px; font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.diff-list { display: flex; flex-direction: column; gap: 13px; }
.diff-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) 54px 62px; align-items: center; gap: 10px; }
.diff-name { font-size: 12.5px; color: var(--text-2); }
.diff-val { font-size: 12.5px; font-variant-numeric: tabular-nums; text-align: right; font-weight: 650; }

/* —— 图表 —— */
.chart-bars { display: flex; align-items: flex-end; gap: 4px; }
.cb-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.cb-track { width: 100%; display: flex; align-items: flex-end; }
.cb-track i {
  display: block; width: 100%; height: var(--h, 0);
  background: linear-gradient(180deg, var(--accent-2), var(--accent) 55%, color-mix(in srgb, var(--accent) 55%, transparent));
  border-radius: 6px 6px 3px 3px; min-height: 3px;
  box-shadow: 0 0 14px -4px color-mix(in srgb, var(--accent) 85%, transparent);
  animation: grow-y .72s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 22ms);
  transition: filter var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
}
.cb-col:hover .cb-track i { filter: brightness(1.2) saturate(1.2); transform: scaleX(1.14); }
.cb-track i.cb-hi { background: linear-gradient(180deg, var(--accent-3), var(--accent)); }
.cb-track i.cb-zero { height: 3px; background: var(--track); animation: none; box-shadow: none; }
.cb-label { font-size: 9.5px; color: var(--text-3); font-variant-numeric: tabular-nums; height: 12px; }

.chart-line { display: block; overflow: visible; }
.chart-path {
  fill: none; stroke: var(--accent-2); stroke-width: 2.2;
  stroke-linejoin: round; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: draw 1.25s var(--ease) .08s forwards;
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--accent-2) 75%, transparent));
}
.chart-area { fill: color-mix(in srgb, var(--accent) 16%, transparent); stroke: none; animation: fade .9s var(--ease) .35s both; }
.chart-dot { fill: var(--bg); stroke: var(--accent-2); stroke-width: 1.8; animation: pop-in .5s var(--ease-spring) .55s both; }
.chart-legend { display: flex; gap: 16px; font-size: 11.5px; color: var(--text-3); margin-top: 8px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.empty-mini { font-size: 12.5px; color: var(--text-3); padding: 30px 0; text-align: center; }

.heatmap { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 11px); gap: 3px; justify-content: start; overflow-x: auto; padding-bottom: 2px; }
.hm-cell {
  width: 11px; height: 11px; border-radius: 3px; background: var(--track); flex: none;
  animation: pop-in .45s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 5ms);
  transition: transform var(--dur-1) var(--ease-spring), box-shadow var(--dur-1) var(--ease);
}
.hm-cell:hover { transform: scale(1.4); box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--accent-line); }
.hm-0 { background: var(--track); }
.hm-1 { background: color-mix(in srgb, var(--accent) 34%, var(--track)); }
.hm-2 { background: color-mix(in srgb, var(--accent) 58%, var(--track)); }
.hm-3 { background: color-mix(in srgb, var(--accent) 80%, var(--track)); }
.hm-4 { background: linear-gradient(140deg, var(--accent-2), var(--accent)); box-shadow: 0 0 10px -2px var(--accent); }
.hm-legend { display: flex; align-items: center; gap: 4px; justify-content: flex-end; margin-top: 11px; font-size: 10.5px; color: var(--text-3); }
.hm-legend i { width: 11px; height: 11px; display: block; border-radius: 3px; animation: none; }

.donut { display: block; overflow: visible; }
.donut .donut-track { stroke: var(--track); }
.donut .donut-val {
  stroke-linecap: round;
  stroke: url(#zxGrad);
  animation: donut-sweep 1.15s var(--ease) .12s both;
}
.donut-text { font-size: 17px; font-weight: 700; fill: var(--text); font-family: var(--font-display); letter-spacing: -.035em; }
@keyframes donut-sweep {
  from { stroke-dasharray: 0 var(--len); }
  to { stroke-dasharray: var(--on) var(--len); }
}

/* 设置 */
.preset-row { display: flex; gap: 7px; flex-wrap: wrap; }
.preset {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface-2); font-size: 12.5px; cursor: pointer;
  transition: all var(--dur-2) var(--ease);
}
.preset:hover { border-color: var(--accent-line); background: var(--accent-soft); transform: translateY(-1px); box-shadow: var(--glow); }
.snap-list { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 9px; }
.snap-title { font-size: 12px; color: var(--text-2); font-weight: 600; }
.snap-row { display: flex; align-items: center; gap: 12px; font-size: 12.5px; }
.snap-row .btn { margin-left: auto; }

.detail-block + .detail-block { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.detail-block h4 { font-size: 13px; margin-bottom: 11px; color: var(--text-2); }
.detail-opt { display: flex; gap: 10px; padding: 8px 11px; border-radius: 9px; font-size: 13.5px; }
.detail-opt.is-answer { background: var(--ok-soft); color: var(--ok); }
.detail-opt b { width: 16px; flex: none; }
.detail-line { display: flex; gap: 10px; margin-top: 10px; font-size: 13.5px; }
.detail-line b { flex: none; width: 44px; color: var(--text-3); font-weight: 500; font-size: 12.5px; padding-top: 1px; }

/* ============================================================
   14. 弹窗 / Toast
   ============================================================ */

.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 22px;
  background: color-mix(in srgb, #04040a 62%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  opacity: 0; transition: opacity var(--dur-2) var(--ease);
}
.modal-overlay.in { opacity: 1; }
.modal {
  width: 100%; max-width: 560px; max-height: calc(100vh - 44px);
  display: flex; flex-direction: column;
  border: 1px solid transparent; border-radius: var(--r-xl);
  background:
    linear-gradient(var(--surface-solid), var(--surface-solid)) padding-box,
    var(--edge-strong) border-box;
  box-shadow: var(--shadow-3), 0 0 70px -30px var(--accent);
  transform: translateY(18px) scale(.96); opacity: 0;
  transition: transform var(--dur-3) var(--ease-spring), opacity var(--dur-2) var(--ease);
}
.modal-overlay.in .modal { transform: none; opacity: 1; }
.modal-lg { max-width: 780px; }
.modal-sm { max-width: 412px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-title { font-size: 16px; font-weight: 650; flex: 1; letter-spacing: -.022em; font-family: var(--font-display); }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 9px; padding: 15px 22px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 0 0 var(--r-xl) var(--r-xl); flex-wrap: wrap;
}
.modal-msg { font-size: 14px; text-wrap: pretty; }
.modal-detail { font-size: 12.5px; color: var(--text-3); margin-top: 9px; line-height: 1.75; }
body.modal-open { overflow: hidden; }
.quick-list { display: flex; flex-direction: column; gap: 4px; }
.quick-item {
  display: flex; align-items: center; gap: 13px; padding: 12px 13px; border-radius: var(--r);
  transition: background var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.quick-item:hover { background: var(--surface-2); transform: translateX(2px); }
.quick-item .i { color: var(--accent-2); }
.quick-item div { display: flex; flex-direction: column; }
.quick-item b { font-size: 13.5px; }
.quick-item span { font-size: 11.5px; color: var(--text-3); }

/* ============================================================
   14b. 命令面板（Ctrl/⌘ + K）
   ------------------------------------------------------------
   一个输入框 + 一份结果列表。刻意**不带任何装饰**：它出现的时间很短，
   读者需要的是"一眼扫到目标"，不是好看的容器。
   列表高度固定（约 7 条 + 半条），这样结果增减时弹窗不会跳来跳去。
   ============================================================ */

.pal-overlay .modal { max-width: 520px; }
.pal { display: flex; flex-direction: column; }
.pal-search {
  display: flex; align-items: center; gap: 10px;
  padding: 0 2px 12px;
  border-bottom: 1px solid var(--line);
}
.pal-search .i { color: var(--text-3); flex: none; }
.pal-input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  color: var(--text); font-size: 16px; font-family: inherit; letter-spacing: -.01em;
}
.pal-input::placeholder { color: var(--text-3); }

.pal-list {
  margin-top: 6px;
  max-height: 336px; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 1px;
}
.pal-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 9px 10px; border: 0; border-radius: var(--r-sm, 8px);
  background: transparent; text-align: left; cursor: pointer;
  transition: background var(--dur-1) var(--ease);
}
.pal-item.is-active { background: var(--surface-2); }
.pal-item.is-active .pal-kind { color: var(--text); border-color: var(--line-2); }
.pal-kind {
  flex: none; width: 26px; text-align: center;
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .08em;
  color: var(--text-3); border: 1px solid var(--line); border-radius: 5px;
  padding: 2px 0;
}
.pal-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pal-main b {
  font-size: 13.5px; font-weight: 550;
  /* 题干可能很长：只留一行，避免每条高度不一样导致列表"跳动" */
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pal-main span {
  font-size: 11px; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pal-item kbd {
  flex: none; font-family: var(--font-mono); font-size: 10px;
  color: var(--text-3); border: 1px solid var(--line); border-radius: 5px;
  padding: 1px 6px; min-width: 20px; text-align: center;
}
.pal-empty { padding: 22px 4px; font-size: 13px; color: var(--text-3); text-align: center; }
.pal-foot {
  display: flex; gap: 16px; margin-top: 12px; padding-top: 11px;
  border-top: 1px solid var(--line);
  font-size: 11px; color: var(--text-3);
}
.pal-foot span { display: inline-flex; align-items: center; gap: 5px; }
.pal-foot kbd {
  font-family: var(--font-mono); font-size: 10px;
  border: 1px solid var(--line); border-radius: 4px; padding: 0 5px;
}
.kbd-list { display: flex; flex-direction: column; gap: 10px; }
.kbd-row { display: flex; align-items: center; gap: 12px; }
.kbd-row span { font-size: 13px; color: var(--text-2); }

.toast-host { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 9px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px;
  max-width: 380px; padding: 12px 15px; border-radius: var(--r);
  background: color-mix(in srgb, var(--surface-solid) 88%, transparent);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  border: 1px solid var(--line); box-shadow: var(--shadow-3);
  font-size: 13px;
  animation: toast-in .42s var(--ease-spring);
}
.toast-success { border-color: color-mix(in srgb, var(--ok) 42%, transparent); }
.toast-success .i { color: var(--ok); }
.toast-error { border-color: color-mix(in srgb, var(--danger) 42%, transparent); }
.toast-error .i { color: var(--danger); }
.toast-warn { border-color: color-mix(in srgb, var(--warn) 42%, transparent); }
.toast-warn .i { color: var(--warn); }
.toast-info .i { color: var(--accent-2); }
.toast-out { animation: toast-out .24s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(18px) scale(.94); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(26px) scale(.97); } }

/* ============================================================
   15. 视图转场
   ============================================================ */

::view-transition-old(app-view),
::view-transition-new(app-view) {
  animation-duration: .4s;
  animation-timing-function: cubic-bezier(.22, 1, .36, 1);
  mix-blend-mode: normal;
}
::view-transition-old(app-view) { animation-name: vt-out; }
::view-transition-new(app-view) { animation-name: vt-in; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-8px) scale(.995); filter: blur(4px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(14px) scale(.995); filter: blur(6px); } }

::view-transition-old(app-sidebar), ::view-transition-new(app-sidebar),
::view-transition-old(app-topbar), ::view-transition-new(app-topbar),
::view-transition-old(app-tabbar), ::view-transition-new(app-tabbar) { animation: none; mix-blend-mode: normal; }
::view-transition-group(app-sidebar),
::view-transition-group(app-topbar),
::view-transition-group(app-tabbar) { animation: none; }

/* ============================================================
   16. 响应式
   ============================================================ */

@media (max-width: 1180px) {
  .ai-layout { grid-template-columns: 1fr; }
  .notes-layout { grid-template-columns: minmax(0, 262px) minmax(0, 1fr); }
}
@media (max-width: 1000px) {
  .two-col { grid-template-columns: 1fr; }
  .week-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 880px) {
  #app { grid-template-columns: minmax(0, 1fr); }

  #sidebar {
    position: fixed; top: 0; left: 0; width: 270px; height: 100vh;
    transform: translateX(-102%);
    transition: transform var(--dur-3) var(--ease);
    box-shadow: var(--shadow-3); z-index: 90;
    background: color-mix(in srgb, var(--bg-2) 94%, transparent);
    view-transition-name: none;
  }
  body.drawer-open #sidebar { transform: none; }
  .scrim {
    display: block; position: fixed; inset: 0; z-index: 80;
    background: color-mix(in srgb, #04040a 60%, transparent);
    backdrop-filter: blur(6px);
    opacity: 0; pointer-events: none; transition: opacity var(--dur-2) var(--ease);
  }
  body.drawer-open .scrim { opacity: 1; pointer-events: auto; }

  .only-mobile, .icon-btn.only-mobile { display: grid; }
  #topbar { padding: 9px 16px; }
  .topbar-title { font-size: 14.5px; color: var(--text); }

  #tabbar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 70;
    display: flex; justify-content: space-around; align-items: stretch;
    padding: 7px 6px calc(7px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--bg-2) 86%, transparent);
    backdrop-filter: var(--glass);
    -webkit-backdrop-filter: var(--glass);
    border-top: 1px solid var(--line);
  }
  .tab {
    position: relative; flex: 1;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 6px 2px; border-radius: 12px;
    color: var(--text-3); font-size: 10.5px;
    transition: color var(--dur-2) var(--ease);
  }
  .tab .i { transition: transform var(--dur-3) var(--ease-spring); }
  .tab.is-active { color: var(--text); }
  .tab.is-active .i { color: var(--accent); transform: translateY(-1px) scale(1.12); filter: drop-shadow(0 0 8px color-mix(in srgb, var(--accent) 70%, transparent)); }
  .tab-indicator {
    position: absolute; top: 0; height: 2.5px; border-radius: 2px;
    background: linear-gradient(90deg, var(--accent-2), var(--accent-3));
    box-shadow: 0 0 12px var(--accent);
    transition: transform var(--dur-3) var(--ease-spring), width var(--dur-3) var(--ease-spring);
  }

  .view-pad { padding: 10px 16px 106px; gap: 18px; }
  .runner, .result { padding: 10px 16px 118px; }
  body.in-session #tabbar { display: none; }
  body.in-session .view-pad, body.in-session .runner { padding-bottom: 44px; }

  .page-title { font-size: 25px; }
  .nav-item { height: 38px; }
  .nav-pill { height: 38px; }
}

@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid > .col-2 { grid-column: span 1; }
  .week-grid { grid-template-columns: 1fr 1fr; }
  .notes-layout { grid-template-columns: 1fr; }
  .note-items { max-height: 240px; }
  .notes-list .card-body { padding: 12px; }
  .grade-row { grid-template-columns: 1fr 1fr; }
  .hero-card { flex-direction: column; align-items: flex-start; gap: 18px; padding: 22px; }
  .hero-card { flex-direction: column; align-items: flex-start; gap: 18px; padding: 22px; }
  .result-hero { flex-direction: column; align-items: flex-start; gap: 20px; }
  .qz { padding: 20px; border-radius: var(--r-lg); }
  .qz-stem { font-size: 17px; }
  .stat-value { font-size: 24px; }
  .toolbar .input { flex: 1 1 45%; min-width: 0; }
  .search-box { flex: 1 1 100%; }
  .diff-row { grid-template-columns: 42px minmax(0, 1fr) 48px; }
  .diff-row .muted { display: none; }
  .review-grid { grid-template-columns: 1fr; }
  .review-wide { grid-column: span 1; }
  .toast-host { left: 14px; right: 14px; bottom: 90px; }
  .toast { max-width: none; }
  .modal-overlay { padding: 12px; align-items: flex-end; backdrop-filter: blur(8px); }
  .modal { max-height: calc(100vh - 26px); border-radius: var(--r-xl) var(--r-xl) var(--r) var(--r); }
  .course-meta { display: none; }
  .save-bar .btn { width: 100%; justify-content: center; }
  .card-body { padding: 17px 18px; }
  .card-head { padding: 14px 18px; }

  /* 仪器盘面在窄屏下改为纵向堆叠 */
  .inst-main { grid-template-columns: 1fr; }
  .inst-readout { border-right: 0; border-bottom: 1px solid var(--line); padding: 20px 18px; }
  .inst-ruler-head { padding: 12px 18px 9px; flex-wrap: wrap; }
  .inst-buckets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .inst-bucket { min-height: 104px; padding: 10px 10px 0; }
  .inst-axis { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 4px; }
  .inst-split { grid-template-columns: 1fr; }
  .inst-trace { border-right: 0; border-bottom: 1px solid var(--line); padding: 14px 18px 16px; }
  .inst-meters { padding: 14px 18px 16px; }
  .inst-plan { padding: 14px 18px 16px; }
  .inst-plan-list { grid-template-columns: 1fr; }
  .inst-foot { height: auto; padding: 10px 18px; }
  .meter { grid-template-columns: 68px minmax(0, 1fr) auto; gap: 10px; }
}

@media (max-width: 420px) {
  .week-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .inst-num { font-size: 46px; }
  .inst-buckets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inst-axis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============================================================
   17. 入口首屏（Gate）
   ------------------------------------------------------------
   一次完整的产品开场：微粒场 + 刻度盘 + 逐字标题。
   点击「进入」后快门式拉开，把外壳交出来。
   ============================================================ */

body.gated { overflow: hidden; }
body.gated #app { opacity: 0; }
#app { transition: opacity .62s var(--ease); }

.gate {
  position: fixed; inset: 0; z-index: 500;
  display: grid; place-items: center;
  background: var(--bg);
  overflow: hidden;
  isolation: isolate;
}
.gate::before {
  content: ''; position: absolute; inset: 0; z-index: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 20%, transparent 78%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 20%, transparent 78%);
}
.gate-field { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; }

/* 极淡的暗角：让画面有纵深，也是「宏大」的一半来源 */
.gate-vignette {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(ellipse 78% 68% at 50% 48%,
    transparent 42%, color-mix(in srgb, var(--text) 4%, transparent) 100%);
}

/* 遥测块：左上角的「轨道要素」读数。
   它存在的意义不是信息，是让画面的留白变成"有东西的留白"。 */
.gate-tele {
  position: absolute; left: 34px; top: 30px; z-index: 3;
  display: flex; flex-direction: column; gap: 7px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em;
  color: var(--text-3); white-space: nowrap;
  opacity: 0;
}
.gate.is-in .gate-tele { animation: rise .95s var(--ease) 1.18s both; }
.gate-tele-h {
  font-size: 9.5px; letter-spacing: .26em; text-transform: uppercase;
  color: var(--text-2); padding-bottom: 3px; margin-bottom: 2px;
  border-bottom: 1px solid var(--line);
}
.gate-tele-r { display: flex; align-items: baseline; gap: 14px; }
.gate-tele-r em { font-style: normal; letter-spacing: .16em; text-transform: uppercase; }
.gate-tele-r b {
  margin-left: auto; font-weight: 600; color: var(--text-2);
  font-variant-numeric: tabular-nums; letter-spacing: .04em;
}
.gate-tele-r.is-live b { color: var(--text); }

/* 实时速度读数：证明这条轨道是真算出来的，不是装饰 */
.gate-vel { display: inline-flex; align-items: center; gap: 8px; }

/* 背景音开关：浏览器不允许无手势自动播放，所以给一个明确的入口 */
.gate-amb {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px 5px 10px;
  border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--text-3);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em;
  cursor: pointer;
  transition: color var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease),
              background var(--dur-2) var(--ease);
}
.gate-amb:hover { color: var(--text-2); border-color: var(--line-2); background: color-mix(in srgb, var(--text) 3%, transparent); }
.gate-amb.is-on { color: var(--signal); border-color: color-mix(in srgb, var(--signal) 34%, transparent); }
.gate-amb svg { transition: transform var(--dur-2) var(--ease); }
.gate-amb.is-on svg { transform: scale(1.12); }
.gate-vel em { font-style: normal; letter-spacing: .22em; }
.gate-vel b {
  font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums;
  min-width: 26px; text-align: right;
}
.gate-vel-bar {
  display: block; width: 46px; height: 3px; background: var(--track);
  position: relative; overflow: hidden;
}
.gate-vel-bar s {
  position: absolute; inset: 0; background: var(--signal);
  transform-origin: left; transform: scaleX(0);
  transition: transform .12s linear;
}

/* 内容 */
.gate-inner {
  position: relative; z-index: 3;
  width: min(760px, calc(100vw - 48px));
  display: flex; flex-direction: column; align-items: center; text-align: center;
  /* 极小的 3D 视差：只在鼠标移动时被 JS 写入，静止时恒等于 0 */
  transform: perspective(1200px)
             translate3d(var(--tx, 0px), var(--ty, 0px), 0)
             rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .45s var(--ease);
  will-change: transform;
}
.gate-kicker {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  color: var(--text-3); opacity: 0;
  letter-spacing: .5em; text-indent: .5em;
}
/* 入场编排：每个元素只有一次机会，延迟与 app/gate.js 的 T 时间轴对齐 */
.gate.is-in .gate-kicker {
  animation: kicker-in 1.15s var(--ease) .62s both;
}
@keyframes kicker-in {
  from { opacity: 0; letter-spacing: .78em; }
  to { opacity: 1; letter-spacing: .34em; }
}

.gate-title, .gate-word {
  margin: 26px 0 0;
  display: flex; flex-wrap: wrap; justify-content: center;
  line-height: 1.04; font-weight: 600;
  font-family: var(--font-display);
  color: var(--text);
}
/* APHELION：等宽大字距的英文标，逐字揭开 */
.gate-word {
  font-family: var(--font-mono);
  font-size: clamp(34px, 6.6vw, 78px);
  letter-spacing: .26em; text-indent: .26em;
  font-weight: 500; text-transform: uppercase;
  margin-top: 0;
}
.gate-word i { font-style: normal; display: inline-block; }
.gate-word i { transform: translateY(.16em); }
.gate.is-in .gate-word i {
  animation: char-in 1.15s var(--ease) both;
  animation-delay: calc(var(--i) * 58ms + 790ms);
}
.gate-title i {
  font-style: normal; display: inline-block;
  transform: translateY(.16em);
}
.gate.is-in .gate-title i {
  animation: char-in 1.15s var(--ease) both;
  animation-delay: calc(var(--i) * 62ms + 420ms);
}
/* 逐字揭开：只做"抬起来 + 从下方擦出来"两件事。
   上一版还叠了 blur(6px)，逐字重绘滤镜是这条时间线上最贵的一笔，删掉。 */
@keyframes char-in {
  from { clip-path: inset(-10% -6% 118% -6%); transform: translateY(.16em); }
  to { clip-path: inset(-24% -14% -24% -14%); transform: none; }
}
.gd-comma { color: var(--signal); }

/* 首屏刻意不放任何说明文字——画面自己说 */
.gate-cta {
  position: relative; margin-top: 52px;
  display: inline-flex; align-items: center; gap: 12px;
  height: 52px; padding: 0 30px;
  border: 1px solid var(--line-2); border-radius: 999px;
  background: transparent; color: var(--text);
  font-size: 14.5px; font-weight: 550; letter-spacing: .02em;
  cursor: pointer; overflow: hidden;
  transform: translate(var(--mx, 0px), var(--my, 0px));
  transition: transform .28s var(--ease), background var(--dur-2) var(--ease),
              color var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease);
  opacity: 0;
}
.gate.is-in .gate-cta { animation: cta-in 1.05s var(--ease) 1.32s both; }
@keyframes cta-in {
  from { opacity: 0; transform: scale(.94) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.gate-cta svg { transition: transform var(--dur-2) var(--ease); }
.gate-cta::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: var(--text); transform: scaleY(0); transform-origin: bottom;
  transition: transform var(--dur-3) var(--ease); z-index: -1;
}
.gate-cta:hover { color: var(--accent-ink); border-color: var(--text); }
.gate-cta:hover::before { transform: scaleY(1); }
.gate-cta:hover svg { transform: translateX(4px); }
.gate-cta:active { transform: translate(var(--mx, 0px), var(--my, 0px)) scale(.97); }

.gate-foot {
  position: absolute; left: 0; right: 0; bottom: 22px; z-index: 3;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 26px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .22em; color: var(--text-3);
  opacity: 0;
}
.gate.is-in .gate-foot { animation: rise .95s var(--ease) 1.24s both; }

/* 入场编排跑完：交给一个稳定的"站位"，此后的动效只剩物理 */
.gate.is-ready .gate-inner { transition: transform .5s var(--ease); }


/* ============================================================
   18. 装饰与微交互（仪器质感）
   ============================================================ */

/* 盘面四角的定位角标 */
.inst { position: relative; }
.inst::after {
  content: ''; position: absolute; inset: 7px; pointer-events: none; z-index: 2;
  --tick: color-mix(in srgb, var(--text) 26%, transparent);
  background-image:
    linear-gradient(var(--tick), var(--tick)), linear-gradient(var(--tick), var(--tick)),
    linear-gradient(var(--tick), var(--tick)), linear-gradient(var(--tick), var(--tick)),
    linear-gradient(var(--tick), var(--tick)), linear-gradient(var(--tick), var(--tick)),
    linear-gradient(var(--tick), var(--tick)), linear-gradient(var(--tick), var(--tick));
  background-repeat: no-repeat;
  background-size: 9px 1px, 1px 9px, 9px 1px, 1px 9px, 9px 1px, 1px 9px, 9px 1px, 1px 9px;
  background-position: left top, left top, right top, right top,
    left bottom, left bottom, right bottom, right bottom;
  opacity: .75;
}

/* 链接下划线：从左画出来 */
.inst-link { position: relative; }
.inst-link::after {
  content: ''; position: absolute; left: 10px; right: 10px; bottom: 4px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: left;
  transition: transform var(--dur-2) var(--ease);
}
.inst-link:hover::after { transform: scaleX(1); }

/* 全局：跟随光标的极淡环境光（代替深色模式的极光）。
   颜色走独立令牌 --ambient：浅色下是仪器蓝，深色下换成信号橙 ——
   深色主题里唯一的光源是那颗恒星，环境光要是还发蓝，就又回到"廉价科技感"了。 */
.ambient {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(420px circle at var(--ax, 50%) var(--ay, 0%),
    color-mix(in srgb, var(--ambient) 7%, transparent), transparent 70%);
  opacity: 0; transition: opacity .8s var(--ease);
}
body.pointer-on .ambient { opacity: 1; }

/* 顶部刻度尺：贴在内容区顶部的一条细刻度 */
.rule-ticks {
  height: 6px; margin-bottom: 2px;
  background-image: repeating-linear-gradient(90deg,
    color-mix(in srgb, var(--text) 20%, transparent) 0 1px, transparent 1px 8px);
  background-position: left bottom;
  background-size: 100% 3px; background-repeat: no-repeat;
  opacity: .5;
}

/* ============================================================
   19. 响应式（补充）+ 减少动效
   ============================================================ */

@media (max-width: 720px) {
  .gate-word { font-size: 26px; letter-spacing: .16em; text-indent: .16em; margin-top: 22px; }
  .gate-cta { margin-top: 32px; height: 48px; padding: 0 26px; }
  .gate-inner { width: calc(100vw - 40px); }
  .gate-foot { padding: 0 18px; font-size: 9px; letter-spacing: .16em; }
  .gate-vel-bar { width: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  .gate-word i, .gate-title i { clip-path: none; transform: none; }
  .gate.is-in .gate-kicker, .gate.is-in .gate-cta, .gate.is-in .gate-tele,
  .gate.is-in .gate-foot, .gate.is-in .gate-word i { opacity: 1; animation: none; }
  .gate-inner { transform: none !important; }
}

/* ============================================================
   20. 减少动效 / 打印
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .anim { opacity: 1; }
  .bg-aurora, .empty-icon { animation: none; }
  ::view-transition-old(app-view), ::view-transition-new(app-view) { animation: none; }
}

@media print {
  #sidebar, #topbar, #tabbar, .toast-host, .bg { display: none; }
  .card { box-shadow: none; }
}

/* ============================================================
   沉浸式答题（覆盖前面的卡片式样式）
   ------------------------------------------------------------
   一屏一题：去掉题目卡片的框、去掉选项的盒子、去掉进度胶囊，
   只留一条通栏刻度、题面、发丝线分行的选项、底部动作。
   ============================================================ */

.runner {
  max-width: 780px;
  margin: 0 auto;
  padding: clamp(16px, 4.5vh, 52px) 26px 150px;
}

/* 顶部：一条通栏刻度 + 一行等宽小字，不再是"条" */
.runner-bar { display: flex; flex-direction: column; gap: 11px; }
.runner-progress {
  height: 2px; border-radius: 0; background: var(--line); overflow: hidden;
}
.runner-progress i, #runnerProgress {
  display: block; height: 100%; background: var(--text);
  transition: width .5s var(--ease);
}
.runner-info {
  display: flex; align-items: center; gap: 16px;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: .15em; text-transform: uppercase; color: var(--text-3);
}
.runner-info .icon-btn:first-of-type { margin-left: auto; }
.runner-info .icon-btn { width: 28px; height: 28px; border-radius: var(--r-xs); }
.runner-done {
  padding: 0; border: 0; border-radius: 0; background: transparent;
  color: var(--text-3); letter-spacing: inherit;
}

/* 题面：没有卡片，只有留白和字 */
.qz {
  position: relative;
  border: 0; border-radius: 0; background: transparent; box-shadow: none;
  padding: clamp(30px, 7vh, 76px) 0 0;
}
.qz::before, .qz::after { content: none; }
.qz-meta {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--text-3); margin-bottom: 22px;
}
.qz-index { color: var(--text-2); font-weight: 600; letter-spacing: .12em; }
.qz-stem {
  font-size: clamp(19px, 2.15vw, 25px);
  line-height: 1.6; font-weight: 550; letter-spacing: -.018em;
  word-break: break-word; white-space: pre-wrap; text-wrap: pretty;
}

/* 选项：发丝线分行的"清单"，不是一排盒子 */
.qz-options {
  display: flex; flex-direction: column; gap: 0;
  margin-top: 30px; border-top: 1px solid var(--line);
}
.qz-option {
  display: flex; align-items: center; gap: 16px; width: 100%; text-align: left;
  padding: 18px 6px 18px 2px;
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  background: transparent; cursor: pointer;
  transition: background var(--dur-1) var(--ease), padding-left var(--dur-2) var(--ease),
              border-color var(--dur-2) var(--ease);
}
.qz-option:hover:not([disabled]) {
  transform: none;
  background: color-mix(in srgb, var(--text) 3.2%, transparent);
  padding-left: 12px;
}
.qz-option:active:not([disabled]) { transform: none; }
.qz-option.is-selected {
  border-bottom-color: var(--text);
  background: color-mix(in srgb, var(--text) 4.5%, transparent);
}
.qz-option.is-selected .qz-key { color: var(--text); }
.qz-option.is-answer { border-bottom-color: var(--ok); background: var(--ok-soft); }
.qz-option.is-wrong { border-bottom-color: var(--danger); background: var(--danger-soft); }
.qz-key {
  flex: none; min-width: 20px;
  background: transparent; border: 0; border-radius: 0;
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  color: var(--text-3); text-align: left;
  transition: color var(--dur-1) var(--ease), transform var(--dur-2) var(--ease);
}
.qz-option:hover .qz-key { transform: none; color: var(--text-2); }
.qz-option.is-selected .qz-key,
.qz-option.is-answer .qz-key,
.qz-option.is-wrong .qz-key { background: transparent; }
.qz-option.is-answer .qz-key { color: var(--ok); }
.qz-option.is-wrong .qz-key { color: var(--danger); }
.qz-opt-text { flex: 1; font-size: 15px; line-height: 1.6; }
.qz-tag { border-radius: 0; padding: 0 0 0 10px; font-family: var(--font-mono); letter-spacing: .1em; font-size: 10px; }
.qz-short { margin-top: 22px; }

/* 对错与解析：一条左侧发丝线，不再是一块色块 */
.qz-result {
  margin-top: 30px; padding: 2px 0 2px 16px;
  border: 0; border-left: 2px solid var(--line-2); border-radius: 0;
  background: transparent;
}
.qz-result.ok { border-left-color: var(--ok); background: transparent; }
.qz-result.bad { border-left-color: var(--danger); background: transparent; }
.qz-result.neutral { border-left-color: var(--line-2); background: transparent; }
.qz-result b { font-size: 14.5px; }
.qz-explain {
  margin-top: 18px; padding: 0 0 0 16px;
  border: 0; border-left: 2px solid var(--line); border-radius: 0; background: transparent;
}
.qz-explain-title {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--text-3); font-weight: 500;
}

/* 底部动作：吸底、无框 */
.qz-actions {
  position: sticky; bottom: 0; z-index: 3;
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-top: 34px; padding: 16px 0 22px;
  background: linear-gradient(180deg, transparent, var(--bg) 42%);
}

/* 复习四档评分：一格一格的仪表，不是四张卡 */
.grade-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  width: 100%; background: var(--line);
  border: 1px solid var(--line);
}
.grade-btn {
  border: 0; border-radius: 0; background: var(--surface);
  padding: 14px 10px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start;
  transition: background var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.grade-btn:hover { transform: none; background: color-mix(in srgb, var(--text) 4%, transparent); }
.grade-btn:active { transform: none; }
.grade-btn b { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .06em; }
.grade-btn span { font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; }

@media (max-width: 720px) {
  .runner { padding: 14px 18px 130px; }
  .qz { padding-top: 26px; }
  .qz-stem { font-size: 18.5px; }
  .qz-option { padding: 15px 4px; gap: 12px; }
  .qz-opt-text { font-size: 14.5px; }
  .grade-row { grid-template-columns: repeat(2, 1fr); }
}


/* ============================================================
   原生 select 的配色修正
   ------------------------------------------------------------
   <select> 的下拉列表和文字用的是**系统配色**，不是页面的 CSS 颜色。
   当系统主题和页面主题不一致（或 color-scheme 声明不完整）时，
   就会渲染成"黑底黑字"——看起来就是一个没有文字的黑色框。
   这里把颜色显式写死，两种情况都覆盖。
   ============================================================ */
select.input {
  color: var(--text);
  background-color: var(--surface-solid);
  border-color: var(--line);
}
select.input option,
select.input optgroup {
  background-color: var(--surface-solid);
  color: var(--text);
}
select.input:hover { border-color: var(--line-2); }
select.input:focus {
  color: var(--text);
  background-color: var(--surface-solid);
  border-color: var(--accent);
}
/* 深色主题下用实色，避免半透明叠出脏色 */
[data-theme="dark"] select.input,
[data-theme="dark"] select.input option {
  background-color: var(--surface-solid);
  color: var(--text);
}
/* 文本框/数字框同理，保证字色永远是页面字色 */
.input { color: var(--text); }
.input option { color: var(--text); background-color: var(--surface-solid); }


/* ============================================================
   把信号橙还给主操作
   ------------------------------------------------------------
   之前把 --accent 设成墨色，本意是"结构强调不用彩色"，
   结果把品牌色一起干掉了：没有到期题时整页一点橙都没有。
   这里让主按钮回到信号橙，但导航选中/分隔线仍然是墨 ——
   彩色只出现在"要你动手"的地方，不是满屏。
   ============================================================ */
.btn-primary {
  background: var(--signal);
  color: #fff;
  box-shadow: 0 1px 2px rgba(255, 74, 23, .3), inset 0 1px 0 rgba(255, 255, 255, .2);
}
.btn-primary:hover {
  background: color-mix(in srgb, var(--signal) 86%, #000);
  box-shadow: 0 2px 8px rgba(255, 74, 23, .32), inset 0 1px 0 rgba(255, 255, 255, .24);
}
.btn-primary .i, .btn-primary svg { color: #fff; }
/* 主按钮的聚焦环也跟着变橙，避免黑底配黑环 */
.btn-primary:focus-visible { box-shadow: var(--ring); }

/* 首页主入口底下那条"画出来"的线，也用信号橙 */
.primary::after { background: var(--signal); }

/* 进度条/评分的填充用橙，仪表刻度仍是墨 */
.runner-progress i, #runnerProgress { background: var(--signal); }


/* 同步状态指示（侧边栏底部） */
.sync-row { margin-top: 2px; }
.sync-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--line-2); vertical-align: middle; margin-right: 3px;
  transition: background var(--dur-2) var(--ease);
}
.sync-dot.is-ready { background: var(--ok); }
.sync-dot.is-syncing { background: var(--signal); animation: pulse-dot 1s ease-in-out infinite; }
.sync-dot.is-error { background: var(--danger); }
@keyframes pulse-dot { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
.sync-row b { font-family: var(--font-mono); font-size: 11px; font-weight: 600; }


/* ============================================================
   登录界面（唯一一套，旧的已删除）
   ============================================================ */
.auth-host { position: fixed; inset: 0; z-index: 420; }
.auth {
  position: fixed; inset: 0; z-index: 420;
  display: grid; place-items: center; padding: 24px;
  background: var(--bg);
}
.auth::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 46%, #000 10%, transparent 78%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 46%, #000 10%, transparent 78%);
}
.auth-face {
  position: relative; z-index: 1;
  width: min(400px, 100%);
  background: var(--surface-solid);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-2);
}
.auth-bar { display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 22px; }
.auth-ticks {
  height: 5px; margin-bottom: 2px;
  background-image: repeating-linear-gradient(90deg,
    color-mix(in srgb, var(--text) 22%, transparent) 0 1px, transparent 1px 8px);
  background-position: left top; background-size: 100% 3px; background-repeat: no-repeat;
  opacity: .45;
}

.auth-body { padding: 26px 30px 24px; }
.auth-eyebrow { font-family: var(--font-mono); font-size: 10px; letter-spacing: .2em; color: var(--text-3); }
.auth-title {
  margin-top: 14px;
  font-size: 25px; line-height: 1.36; font-weight: 600;
  letter-spacing: -.035em; font-family: var(--font-display);
}
.auth-sub { margin-top: 12px; font-size: 12.5px; line-height: 1.9; color: var(--text-2); }

/* —— 标签：纯文字 + 一条通栏底线 + 会滑动的橙条 —— */
.auth-tabs {
  position: relative; display: flex; gap: 24px;
  margin: 24px 0 0; background: none;
  border-bottom: 1px solid var(--line);
}
.auth-tab {
  flex: none; position: relative;
  border: 0; background: none; cursor: pointer;
  padding: 0 1px 11px; margin: 0;
  font-size: 13.5px; font-weight: 550; font-family: inherit;
  color: var(--text-3);
  transition: color var(--dur-2) var(--ease);
}
.auth-tab:hover { color: var(--text-2); }
.auth-tab.is-on { color: var(--text); }
.auth-tab-ind {
  position: absolute; left: 0; bottom: -1px; height: 2px; width: 0;
  background: var(--signal); border: 0;
  transition: transform var(--dur-3) var(--ease), width var(--dur-3) var(--ease);
}

/* —— 字段：标签在上，输入框在下，只有一条底线 —— */
.auth-form { display: flex; flex-direction: column; margin-top: 22px; }
.auth-field { display: block; margin-bottom: 16px; }
.auth-field > span {
  display: block; margin-bottom: 7px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--text-3);
  transition: color var(--dur-2) var(--ease);
}
.auth-field:focus-within > span { color: var(--signal); }
.auth-field input {
  display: block; width: 100%; height: 34px; padding: 0 0 8px;
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  background: none; outline: none;
  color: var(--text); font-size: 15px; font-family: inherit;
  transition: border-color var(--dur-2) var(--ease);
}
.auth-field:focus-within input { border-bottom-color: var(--signal); }
.auth-field input::placeholder { color: var(--text-3); opacity: .7; }

.auth-error { min-height: 17px; font-size: 12.5px; color: var(--danger); }
.auth-submit {
  width: 100%; height: 46px; margin-top: 6px;
  justify-content: center; gap: 9px;
  border-radius: 0;                 /* 和面板一样是直角，不是大药丸 */
}
.auth-submit svg { transition: transform var(--dur-2) var(--ease); }
.auth-submit:hover svg { transform: translateX(4px); }

.auth-foot {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 30px 14px; border-top: 1px solid var(--line);
}
.auth-note, .auth-solo {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; color: var(--text-3);
}
.auth-solo {
  margin-left: auto; border: 0; background: none; cursor: pointer; padding: 0;
  text-decoration: underline; text-underline-offset: 3px;
}
.auth-solo:hover { color: var(--text); }

/* 分段入场 */
.auth-host .auth-face { animation: rise .6s var(--ease) both; }
.auth-host .auth-eyebrow { animation: rise .45s var(--ease) .16s both; }
.auth-host .auth-title { animation: rise .5s var(--ease) .22s both; }
.auth-host .auth-sub { animation: rise .5s var(--ease) .28s both; }
.auth-host .auth-tabs { animation: rise .45s var(--ease) .34s both; }
.auth-host .auth-form { animation: rise .45s var(--ease) .4s both; }
.auth-host .auth-submit { animation: rise .45s var(--ease) .5s both; }
.auth-host .auth-foot { animation: rise .45s var(--ease) .58s both; }

@media (max-width: 560px) {
  .auth-body { padding: 22px 20px 20px; }
  .auth-foot { padding: 11px 20px 13px; }
  .auth-title { font-size: 22px; }
}


/* 收掉全局 focus 环：登录页的输入框只用「底线变橙」表达聚焦 */
.auth-field input,
.auth-field input:focus,
.auth-field input:focus-visible,
.auth-field input:active {
  outline: none !important;
  box-shadow: none !important;
  border-radius: 0;
  background: none;
}
.auth-field input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 40px var(--surface-solid) inset !important;
  -webkit-text-fill-color: var(--text);
}


/* ============================================================
   登录页的"技术含量"
   ============================================================ */
/* 1) 轨道背景：接着首屏的气口继续跑 */
.auth-orbit {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
  opacity: .9;
  -webkit-mask-image: radial-gradient(ellipse 78% 70% at 50% 50%, #000 30%, transparent 88%);
  mask-image: radial-gradient(ellipse 78% 70% at 50% 50%, #000 30%, transparent 88%);
}
.auth::before { z-index: 0; }

/* 2) 面板像快门一样从中缝拉开 */
.auth-face { overflow: hidden; }
.auth-host .auth-face { animation: auth-open .72s cubic-bezier(.16,1,.3,1) both; }
@keyframes auth-open {
  from { clip-path: inset(0 50% 0 50%); opacity: .35; }
  to   { clip-path: inset(0 0 0 0);   opacity: 1; }
}
/* 拉开之后再让内容分段浮起 */
.auth-host .auth-bar,
.auth-host .auth-ticks { animation-delay: .34s; }

/* 3) 输入框：聚焦时底线从左侧画出来 */
.auth-field { position: relative; }
.auth-field::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--signal);
  transform: scaleX(0); transform-origin: left center;
  transition: transform .5s cubic-bezier(.16,1,.3,1);
}
.auth-field:focus-within::after { transform: scaleX(1); }
.auth-field.is-filled:not(:focus-within)::after { transform: scaleX(1); background: var(--line-2); }

/* 4) 提交时的扫描线：一道光自上而下刷过面板 */
.auth-scan {
  position: absolute; left: 0; right: 0; top: 0; height: 120px;
  z-index: 3; pointer-events: none; opacity: 0;
  background: linear-gradient(180deg,
    transparent, rgba(255,74,23,.13) 45%, rgba(255,74,23,.55) 50%, rgba(255,74,23,.13) 55%, transparent);
}
.auth-face.is-busy .auth-scan { animation: auth-scan 1.05s linear infinite; }
@keyframes auth-scan {
  0%   { opacity: 1; transform: translateY(-120px); }
  100% { opacity: 1; transform: translateY(105%); }
}
/* 提交中：按钮上的字呼吸 */
.auth-face.is-busy .auth-submit { opacity: .82; }

/* 5) 通过验证：一次闪光 + 轻微弹开，然后交给首页 */
.auth-face.is-granted { animation: auth-granted .62s cubic-bezier(.16,1,.3,1) both; }
@keyframes auth-granted {
  0%   { box-shadow: 0 0 0 0 rgba(255,74,23,.55); }
  40%  { box-shadow: 0 0 0 10px rgba(255,74,23,0); }
  100% { box-shadow: var(--shadow-2); transform: scale(1.012); }
}

/* 6) 鼠标微视差（JS 写 --mx/--my） */
.auth-face { transform: translate3d(var(--mx, 0px), var(--my, 0px), 0); }
.auth-face.is-granted { transform: translate3d(var(--mx, 0px), var(--my, 0px), 0) scale(1.012); }

@media (prefers-reduced-motion: reduce) {
  .auth-host .auth-face, .auth-face.is-granted { animation: none; }
  .auth-face.is-busy .auth-scan { animation: none; }
}






/* ============================================================
   首屏退场 · 推镜（重写）
   ------------------------------------------------------------
   上一版是「超光速」：径向速度线 + 一次白闪 + 整屏 scale 到 6.2 倍。
   问题是它和天文题材是两套语言：白闪像加载失败，画面糊成一片。
   现在只有一件事：镜头冲向恒星。
     · 画布把恒星的辉光放大到铺满屏幕（和页面底色同色，交接不闪）
     · 速度线从恒星放射出去，越到后面越长、越亮
     · DOM 只做一次轻量放大（合成器友好，没有 filter）
   ============================================================ */
/* 缺陷修复：gate-fall 的关键帧里**不要**再补间 blur。
   原因：退场一开始就该整体失焦，而不是"清晰的画面被逐渐波及" ——
   后者会让淡出中的控件拖出一圈光晕（深色下尤其像鬼影）。
   模糊改由 filter 的过渡承担，DOM 也因此少了一条每帧都要重算的关键帧属性。 */
.gate.is-falling {
  /* 原点在屏幕中心：整屏轻微收缩，像素在"朝中心"划过 */
  transform-origin: 50% 50%;
  transform: scale(var(--gate-scale, 1));
  filter: blur(.6px);
  transition: filter .5s linear;
  animation: gate-fall 1.18s cubic-bezier(.5, 0, .92, .28) forwards;
  will-change: transform, filter;
  backface-visibility: hidden;
}
.gate.is-falling.ui-gone { filter: blur(5px); }
@keyframes gate-fall {
  0%   { transform: scale(1); }
  45%  { transform: scale(.996); }   /* 先"憋住" */
  76%  { transform: scale(.975); }
  100% { transform: scale(.955); }
}

/* 定格模式：动画不跑，用内联的 --gate-scale 表达"停在第几毫秒" */
.gate[data-freeze].is-falling { animation: none; }

/* 控件先走：界面不该跟着镜头一起被放大。
   淡出由 gate.js 用 Web Animations 驱动（见 exit()），这里只管定格模式的收尾。 */
.gate.ui-gone .gate-vignette { opacity: .4; transition: opacity .5s linear; }

@media (prefers-reduced-motion: reduce) {
  .gate.is-falling { animation: none; opacity: 0; }
  .gate.ui-gone .gate-tele, .gate.ui-gone .gate-foot, .gate.ui-gone .gate-word,
  .gate.ui-gone .gate-kicker, .gate.ui-gone .gate-cta { opacity: 0; }
}

/* 交棒：推镜的最后一帧铺满恒星的光，这一层让它在页面底色上再化开一次。
   它是首尾相接的那一笔 —— 少了它，进站会是一次突兀的硬切。
   两套主题两种底色：浅色是暖白，深色是深空（不是一片白闪）。 */
.warm-in {
  position: fixed; inset: 0; z-index: 900; pointer-events: none;
  animation: warm-in .56s cubic-bezier(.4, 0, .5, 1) forwards;
}
.warm-in.is-light {
  background: radial-gradient(ellipse 120% 100% at 68% 50%,
    #fffdfa 0%, #fbf7f3 42%, rgba(247, 245, 243, .92) 100%);
}
.warm-in.is-dark {
  background: radial-gradient(ellipse 120% 100% at 68% 50%,
    #16181f 0%, #0c0e14 46%, rgba(8, 9, 13, .92) 100%);
}
@keyframes warm-in {
  0%   { opacity: 0; }
  22%  { opacity: .92; }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .warm-in { animation: none; opacity: 0; } }
