/* ==========================================================================
   刷题机 — 样式表
   离线静态站：不引用任何网络字体，全部走系统字体栈。
   层级靠字重 + 字距撑；数字一律 tabular-nums，防止计时器与题号跳动。
   ========================================================================== */

/* ---------------------------------------------------------------- 设计令牌 */
:root {
  /* 冷调靛蓝系。刻意避开暖米色+陶土、近黑+酸绿两套 AI 默认配色。 */
  --paper:      #F3F6FB;
  --surface:    #FFFFFF;
  --surface-2:  #FAFBFE;
  --sunk:       #EDF1F8;

  --ink:        #111629;
  --ink-2:      #39425A;
  --muted:      #6A7488;

  --line:       #E0E6F1;
  --line-2:     #C9D2E3;

  --brand:      #3B4FD8;
  --brand-ink:  #2B3BAE;
  --brand-soft: #ECEFFE;
  /* 被主色填充的面（按钮、主卡片）与其前景色。
     深色模式下 --brand 会变浅（用作文字/描边），
     直接拿它当底再配白字会掉到 2:1 上下，所以填充面单独给一组。 */
  --brand-fill: #3B4FD8;
  --brand-fill-hover: #2F41BE;
  --brand-on:   #FFFFFF;

  --ok:         #0E7F55;
  --ok-soft:    #E4F4ED;
  --ok-line:    #B3DFCB;
  --ok-fill:    #0E7F55;

  --bad:        #C0392F;
  --bad-soft:   #FBEBE9;
  --bad-line:   #EFC1BC;
  --bad-fill:   #C0392F;

  --flag:       #9C6410;
  --flag-soft:  #FAF1DE;
  --flag-line:  #E8D3A8;

  --code-bg:    #F6F8FC;
  --code-kw:    #7838A8;
  --code-str:   #0A6E4A;
  --code-num:   #A5561C;
  --code-type:  #2A56C6;
  --code-com:   #7C8698;

  --r-lg: 16px;
  --r-md: 10px;
  --r-sm: 6px;

  /* 描边优先；阴影只用于真正的浮层（toast / 悬浮面板） */
  --lift: 0 10px 30px -14px rgba(17, 22, 41, .34);
  --lift-sm: 0 3px 10px -4px rgba(17, 22, 41, .22);

  --sans: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei",
          "Noto Sans SC", "Source Han Sans SC", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Mono", "Cascadia Code", Consolas, "JetBrains Mono", "SF Mono",
          "DejaVu Sans Mono", "Courier New", monospace;

  --sp: 8px;
  --maxw: 940px;
  --topbar-h: 58px;
}

[data-theme="dark"] {
  --paper:      #0C0F16;
  --surface:    #141924;
  --surface-2:  #19202C;
  --sunk:       #10151E;

  --ink:        #E9ECF5;
  --ink-2:      #C2CADB;
  --muted:      #8D97AC;

  --line:       #232B3A;
  --line-2:     #333D50;

  --brand:      #93A1FF;
  --brand-ink:  #B4BEFF;
  --brand-soft: #1B2240;
  --brand-fill: #4657E0;   /* 白字约 5.7:1 */
  --brand-fill-hover: #3745C4;
  --brand-on:   #FFFFFF;

  --ok:         #56D3A4;
  --ok-soft:    #0F2D20;
  --ok-line:    #1F5340;
  --ok-fill:    #10704C;   /* 白字约 6.1:1 */

  --bad:        #FF8F84;
  --bad-soft:   #331B18;
  --bad-line:   #5C2B26;
  --bad-fill:   #B3352C;   /* 白字约 6.0:1 */

  --flag:       #E9B75E;
  --flag-soft:  #2C2314;
  --flag-line:  #574321;

  --code-bg:    #111722;
  --code-kw:    #CE9BFF;
  --code-str:   #7FD9AC;
  --code-num:   #EFB072;
  --code-type:  #93B8FF;
  --code-com:   #6E7A90;

  --lift: 0 12px 34px -14px rgba(0, 0, 0, .8);
  --lift-sm: 0 3px 12px -4px rgba(0, 0, 0, .6);
}

/* ---------------------------------------------------------------- 基础 */
* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.32; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.16rem; }
h3 { font-size: 1rem; }
p  { margin: 0; }

a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 2.5px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--brand-fill); color: var(--brand-on); padding: 10px 16px; border-radius: 0 0 var(--r-md) 0;
}
.skip:focus { left: 0; }

.num { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-in {
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: var(--topbar-h);
  padding: 0 18px;
  display: flex; align-items: center; gap: 12px;
}

.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); flex: 0 0 auto; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 27px; height: 27px; color: var(--brand); flex: 0 0 auto; }
.brand-name { font-weight: 700; font-size: .95rem; letter-spacing: -.01em; white-space: nowrap; }

.nav {
  margin-left: auto;
  display: flex; align-items: center; gap: 2px;
  overflow-x: auto; scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  flex: 0 0 auto;
  padding: 7px 11px;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-size: .885rem; font-weight: 520;
  white-space: nowrap;
}
.nav a:hover { background: var(--sunk); color: var(--ink); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-ink); font-weight: 650; }
.nav .tally {
  display: inline-block; margin-left: 5px;
  font-size: .72rem; font-variant-numeric: tabular-nums;
  padding: 1px 5px; border-radius: 20px;
  background: var(--sunk); color: var(--muted);
}
.nav a[aria-current="page"] .tally { background: var(--brand-fill); color: var(--brand-on); }

.icon-btn {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: transparent; border: 1px solid var(--line);
  border-radius: var(--r-sm); color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: var(--sunk); color: var(--ink); border-color: var(--line-2); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------------------------------------------------------------- 版心 */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 26px 18px 60px;
  min-height: 60vh;
}
.wrap:focus { outline: none; }

.foot {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px 18px 34px;
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between;
  color: var(--muted); font-size: .8rem;
}

/* ---------------------------------------------------------------- 排版零件 */
.page-head { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; margin-bottom: 18px; }
.page-head .sub { color: var(--muted); font-size: .875rem; }

/* 章节小标题：不用全大写、不用小圆点连接符 */
.sec-title {
  font-size: .8rem; font-weight: 620; color: var(--muted);
  letter-spacing: .04em; margin: 26px 0 10px;
}
.sec-title:first-child { margin-top: 0; }

/* ---------------------------------------------------------------- 卡片 */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
}
.card-tight { padding: 14px 16px; border-radius: var(--r-md); }

/* 主页启动器 */
.launch { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }

.launch-card {
  display: block; position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px 20px 20px;
  color: inherit;
  transition: border-color .16s ease, transform .16s ease;
}
.launch-card:hover { text-decoration: none; border-color: var(--line-2); transform: translateY(-1px); }
.launch-card:active { transform: translateY(0); }
.launch-card h3 { font-size: 1.12rem; font-weight: 680; }
.launch-card p { color: var(--muted); font-size: .855rem; margin-top: 5px; }
.launch-card .go { margin-top: 14px; display: inline-flex; align-items: center; gap: 6px; color: var(--brand-ink); font-size: .85rem; font-weight: 600; }
.launch-card.primary { background: var(--brand-fill); border-color: var(--brand-fill); color: var(--brand-on); }
.launch-card.primary p { color: rgba(255, 255, 255, .9); }
.launch-card.primary .go { color: var(--brand-on); }
.launch-card.primary:hover { border-color: var(--brand-on); }

.resume {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  background: var(--brand-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 26%, transparent);
  border-radius: var(--r-lg);
  padding: 14px 18px; margin-bottom: 16px;
}
.resume .t { font-weight: 620; }
.resume .d { color: var(--ink-2); font-size: .86rem; }
.resume .spacer { margin-left: auto; }

/* 次级入口 */
.mini-grid { display: grid; gap: 10px; grid-template-columns: repeat(4, 1fr); margin-top: 14px; }
.mini {
  display: block; padding: 13px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  color: inherit;
}
.mini:hover { text-decoration: none; border-color: var(--line-2); background: var(--surface-2); }
.mini .k { font-size: .84rem; font-weight: 620; }
.mini .v { color: var(--muted); font-size: .78rem; margin-top: 3px; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- 控件 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  font-size: .9rem; font-weight: 570;
  cursor: pointer;
  transition: background .14s ease, border-color .14s ease;
}
.btn:hover { background: var(--sunk); border-color: var(--muted); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-sm { padding: 6px 11px; font-size: .82rem; border-radius: var(--r-sm); }
.btn-primary { background: var(--brand-fill); border-color: var(--brand-fill); color: var(--brand-on); }
.btn-primary:hover { background: var(--brand-fill-hover); border-color: var(--brand-fill-hover); color: var(--brand-on); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--sunk); }
.btn-danger { color: var(--bad); border-color: var(--bad-line); background: var(--bad-soft); }
.btn-danger:hover { background: var(--bad-soft); border-color: var(--bad); }

.btn-row { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }

input[type="text"], input[type="number"], select, textarea {
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  padding: 9px 12px;
  width: 100%;
}
input[type="text"]:focus, select:focus, textarea:focus { border-color: var(--brand); }
textarea { resize: vertical; min-height: 92px; line-height: 1.6; }

.field { display: grid; gap: 6px; }
.field > label { font-size: .82rem; font-weight: 600; color: var(--ink-2); }

/* 分段选择器 */
.seg { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px; background: var(--sunk); border-radius: var(--r-md); }
.seg button {
  border: 0; background: transparent; cursor: pointer;
  padding: 6px 12px; border-radius: 7px;
  font-size: .84rem; font-weight: 550; color: var(--ink-2);
  white-space: nowrap;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--brand-ink); font-weight: 650; box-shadow: var(--lift-sm); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.toolbar .grow { margin-left: auto; }

/* 徽标 */
.tag {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 20px;
  font-size: .74rem; font-weight: 600; letter-spacing: .01em;
  background: var(--sunk); color: var(--ink-2);
}
.tag-brand { background: var(--brand-soft); color: var(--brand-ink); }
.tag-ok    { background: var(--ok-soft);   color: var(--ok); }
.tag-bad   { background: var(--bad-soft);  color: var(--bad); }
.tag-flag  { background: var(--flag-soft); color: var(--flag); }
.tag-line  { background: transparent; border: 1px solid var(--line-2); color: var(--muted); }

/* ---------------------------------------------------------------- 题目 */
.qmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: .82rem; }
.qmeta .idx { font-variant-numeric: tabular-nums; font-weight: 620; color: var(--ink-2); }
.qmeta .spacer { margin-left: auto; }

.qstem { font-size: 1.06rem; line-height: 1.62; margin: 14px 0 18px; font-weight: 520; }
.qstem pre, .qstem code { font-family: var(--mono); }

/* 选项 */
.opts { display: grid; gap: 9px; }
.opt {
  display: flex; align-items: flex-start; gap: 12px;
  width: 100%; text-align: left;
  padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: border-color .13s ease, background .13s ease;
}
.opt:hover { border-color: var(--muted); background: var(--surface-2); }
.opt .key {
  flex: 0 0 auto;
  width: 25px; height: 25px; border-radius: 7px;
  display: grid; place-items: center;
  background: var(--sunk); color: var(--ink-2);
  font-size: .8rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.opt .body { flex: 1 1 auto; line-height: 1.58; }

.opt[data-picked="1"] { border-color: var(--brand); background: var(--brand-soft); }
.opt[data-picked="1"] .key { background: var(--brand-fill); color: var(--brand-on); }

.opt[data-state="right"] { border-color: var(--ok); background: var(--ok-soft); }
.opt[data-state="right"] .key { background: var(--ok-fill); color: #fff; }
.opt[data-state="wrong"] { border-color: var(--bad); background: var(--bad-soft); }
.opt[data-state="wrong"] .key { background: var(--bad-fill); color: #fff; }
.opt[data-state="miss"] { border-color: var(--ok-line); background: var(--ok-soft); }
.opt[data-state="miss"] .key { background: transparent; border: 1.5px dashed var(--ok); color: var(--ok); }
.opt[disabled] { cursor: default; }

.hint {
  font-size: .78rem; color: var(--muted); margin-top: 9px;
}
kbd {
  font-family: var(--mono); font-size: .76rem;
  padding: 1px 5px; border-radius: 5px;
  border: 1px solid var(--line-2); border-bottom-width: 2px;
  background: var(--surface-2); color: var(--ink-2);
}

/* 判定条 */
.verdict {
  margin-top: 16px; padding: 13px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.verdict.ok  { border-color: var(--ok-line);  background: var(--ok-soft); }
.verdict.bad { border-color: var(--bad-line); background: var(--bad-soft); }
.verdict.part{ border-color: var(--flag-line);background: var(--flag-soft); }
.verdict .head { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; font-weight: 640; }
.verdict .head .mark { font-size: 1.05rem; }
.verdict.ok  .head { color: var(--ok); }
.verdict.bad .head { color: var(--bad); }
.verdict.part .head { color: var(--flag); }
.verdict .detail { margin-top: 7px; font-size: .88rem; color: var(--ink-2); }
.verdict .detail b { color: var(--ink); }
.verdict .ref { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line-2); }
.verdict .ref .lbl { font-size: .78rem; font-weight: 620; color: var(--muted); margin-bottom: 4px; }

.answer-line { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; }
.answer-line .k { color: var(--muted); font-size: .82rem; }
.answer-line .v { font-family: var(--mono); font-weight: 650; }

/* 填空题输入 */
.blank-list { display: grid; gap: 10px; }
.blank-row { display: flex; align-items: center; gap: 10px; }
.blank-row .no {
  flex: 0 0 auto; font-size: .78rem; font-weight: 650; color: var(--muted);
  font-variant-numeric: tabular-nums; min-width: 46px;
}
.blank-row input { font-family: var(--mono); }

/* 代码块 */
.code {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.code-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
  font-size: .76rem; color: var(--muted); font-weight: 600;
}
.code-bar .spacer { margin-left: auto; }
.code pre {
  margin: 0; padding: 14px 16px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: .845rem; line-height: 1.75;
  tab-size: 2;
}
.code code { font-family: inherit; }

.blank-slot {
  display: inline-block;
  min-width: 4.2em;
  padding: 0 6px;
  margin: 0 2px;
  border-bottom: 2px solid var(--brand);
  background: color-mix(in srgb, var(--brand) 11%, transparent);
  border-radius: 3px 3px 0 0;
  color: var(--brand-ink);
  font-weight: 700; text-align: center;
}
.blank-slot.filled { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }

/* ArkTS 语法高亮 */
.tk-com { color: var(--code-com); font-style: italic; }
.tk-kw  { color: var(--code-kw); font-weight: 600; }
.tk-str { color: var(--code-str); }
.tk-num { color: var(--code-num); }
.tk-typ { color: var(--code-type); }
.tk-dec { color: var(--code-kw); font-weight: 650; }

/* 改错题 */
.fix-diff { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.point-list { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.point-list li {
  display: flex; align-items: flex-start; gap: 9px;
  font-size: .875rem; color: var(--ink-2);
}
.point-list .box {
  flex: 0 0 auto; width: 17px; height: 17px; margin-top: 3px;
  border-radius: 5px; border: 1.5px solid var(--line-2);
  display: grid; place-items: center; font-size: .68rem; color: transparent;
}
.point-list li[data-hit="1"] .box { background: var(--ok-fill); border-color: var(--ok-fill); color: #fff; }
.point-list li[data-hit="1"] { color: var(--ink); }
.point-list .kw {
  font-family: var(--mono); font-size: .78rem;
  color: var(--muted); margin-left: 6px;
}
.point-list li[data-hit="1"] .kw { color: var(--ok); }

/* ---------------------------------------------------------------- 考试 */
.exam-bar {
  position: sticky; top: var(--topbar-h); z-index: 30;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 13px 16px;
  margin-bottom: 16px;
}
.exam-bar .top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.exam-bar .title { font-weight: 680; }
.exam-bar .spacer { margin-left: auto; }

.clock { display: flex; align-items: baseline; gap: 7px; font-variant-numeric: tabular-nums; }
.clock .big { font-size: 1.3rem; font-weight: 700; letter-spacing: -.02em; }
.clock.warn .big { color: var(--flag); }
.clock.danger .big { color: var(--bad); }

/* 时间进度条（仅理论模拟考，用于把握 1 小时节奏） */
.timebar { margin-top: 11px; }
.timebar .track {
  height: 7px; border-radius: 20px; background: var(--sunk); overflow: hidden;
  display: flex;
}
.timebar .fill { background: var(--brand); transition: width .3s ease; }
.timebar .over { background: var(--bad); }
.timebar .legend {
  display: flex; justify-content: space-between;
  font-size: .76rem; color: var(--muted); margin-top: 5px;
  font-variant-numeric: tabular-nums;
}

/* 题号矩阵：全场唯一的“重音”元素 */
.palette { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.palette button {
  position: relative;
  width: 30px; height: 30px; padding: 0;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: .76rem; font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: transform .1s ease;
}
.palette button:hover { transform: translateY(-1px); border-color: var(--muted); }
.palette button[data-st="done"]  { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-ink); }
.palette button[data-st="flag"]  { background: var(--flag-soft); border-color: var(--flag); color: var(--flag); }
.palette button[data-st="now"]   { outline: 2.5px solid var(--brand); outline-offset: 1px; }
.palette .gap { width: 100%; height: 0; flex-basis: 100%; }

/* 收藏角标：即使这题同时是「当前题」也看得见 */
.palette button[data-flag="1"]::after {
  content: '';
  position: absolute; top: 3px; right: 3px;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--flag);
}

.palette-key { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; font-size: .77rem; color: var(--muted); }
.palette-key i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* 出分 */
.score-sheet { display: grid; gap: 12px; grid-template-columns: repeat(3, 1fr); }
.score-cell { padding: 15px 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.score-cell .k { font-size: .8rem; color: var(--muted); }
.score-cell .v { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; margin-top: 2px; }
.score-cell .s { font-size: .76rem; color: var(--muted); }
.score-cell.hero { grid-column: 1 / -1; background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 30%, transparent); }
.score-cell.hero .v { font-size: 2.2rem; color: var(--brand-ink); }

/* ---------------------------------------------------------------- 列表 */
.row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1 1 auto; min-width: 0; }
.row .stem { font-size: .93rem; line-height: 1.55; }
.row .meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; font-size: .78rem; color: var(--muted); }
.row .acts { flex: 0 0 auto; display: flex; gap: 6px; }

.empty {
  padding: 44px 22px; text-align: center;
  border: 1px dashed var(--line-2); border-radius: var(--r-lg);
  color: var(--muted);
}
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.empty p { font-size: .88rem; }

/* ---------------------------------------------------------------- 表单区 */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.panel + .panel { margin-top: 16px; }
.panel h2 { margin-bottom: 4px; }
.panel .lede { color: var(--muted); font-size: .87rem; margin-bottom: 16px; }

.grid-2 { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }

.spec { font-size: .84rem; }
.spec dt { font-weight: 640; color: var(--ink); margin-top: 12px; }
.spec dd { margin: 3px 0 0; color: var(--ink-2); }
.spec code { font-family: var(--mono); font-size: .92em; background: var(--sunk); padding: 1px 5px; border-radius: 4px; }

.note {
  display: flex; gap: 10px;
  padding: 12px 14px; border-radius: var(--r-md);
  background: var(--flag-soft); border: 1px solid var(--flag-line);
  font-size: .86rem; color: var(--ink-2);
}
.note.info { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 28%, transparent); }
.note .ico { flex: 0 0 auto; font-weight: 700; }

/* ---------------------------------------------------------------- toast */
.toast-host {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  display: grid; gap: 8px; z-index: 90; width: min(420px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  background: var(--ink); color: var(--paper);
  padding: 11px 16px; border-radius: var(--r-md);
  font-size: .875rem; font-weight: 540;
  box-shadow: var(--lift);
  animation: rise .22s ease both;
}
[data-theme="dark"] .toast { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line-2); }
@keyframes rise { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- 响应式 */
@media (max-width: 760px) {
  :root { --topbar-h: 52px; }
  .topbar-in { padding: 0 12px; gap: 8px; flex-wrap: wrap; }
  .brand-name { font-size: .88rem; }
  .nav { order: 3; width: 100%; margin-left: 0; padding-bottom: 6px; }
  .nav a { padding: 5px 9px; font-size: .83rem; }
  .wrap { padding: 18px 12px 48px; }
  .launch { grid-template-columns: 1fr; }
  .mini-grid { grid-template-columns: 1fr 1fr; }
  .fix-diff { grid-template-columns: 1fr; }
  .score-sheet { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .exam-bar { position: static; }
  .palette button { width: 27px; height: 27px; font-size: .72rem; }
  h1 { font-size: 1.28rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media print {
  .topbar, .foot, .nav, .icon-btn, .btn, .toast-host { display: none !important; }
  body { background: #fff; }
  .wrap { padding: 0; max-width: none; }
  .card, .panel { border: 0; padding: 0; }
}