/* Frontend Quest — 像素勇者手册(FC/SNES RPG 菜单风)
 * 设计主张:龙泉大陆的游戏机菜单——深夜蓝底、白描双线窗体、
 * 缝合像素字体(OFL,本地 lib/fonts/)、▶ 菜单光标、硬阴影按钮、扫描线。
 * 标题/界面用像素字,长段正文保留系统字体保证可读性。
 * (上一版「宣纸古籍」主题备份在 css/theme-paper.css.bak)
 */
@font-face {
  font-family: 'PixelZH';
  src: url('../lib/fonts/pixel-zh.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'PixelLatin';
  src: url('../lib/fonts/pixel-latin.woff2') format('woff2');
  font-display: swap;
}

:root {
  --bg: #10122b;            /* 深夜蓝 */
  --panel: #171a3d;         /* 窗体 */
  --panel-deep: #0c0e24;    /* 凹陷/输入底 */
  --line: #e9ecf5;          /* 白描边 */
  --line-dim: #3c4170;      /* 暗界线 */
  --text: #e9ecf5;
  --text-dim: #9aa1c9;
  --gold: #f5c542;          /* 金币/XP/试炼 */
  --red: #ff6b5e;           /* 错误/危险 */
  --green: #6fe08c;         /* 正确 */
  --blue: #7db4ff;          /* 链接/选中 */
  --purple: #c792ea;        /* Boss */
  --shadow: #05060f;
  --font-pixel: 'PixelZH', 'PixelLatin', 'PingFang SC', sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { image-rendering: pixelated; }
img { image-rendering: pixelated; }

body {
  background:
    radial-gradient(1.5px 1.5px at 18% 24%, rgba(233, 236, 245, 0.28) 50%, transparent 51%),
    radial-gradient(1px 1px at 64% 12%, rgba(233, 236, 245, 0.2) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 82% 60%, rgba(245, 197, 66, 0.25) 50%, transparent 51%),
    radial-gradient(1px 1px at 35% 78%, rgba(233, 236, 245, 0.16) 50%, transparent 51%),
    var(--bg);
  background-size: 520px 420px, 520px 420px, 520px 420px, 520px 420px, auto;
  color: var(--text);
  font: 15px/1.8 -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  min-height: 100vh;
}
/* CRT 扫描线(极淡) */
body::after {
  content: ''; position: fixed; inset: 0; z-index: 99; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(5, 6, 15, 0.10) 0 1px, transparent 1px 3px);
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
svg { vertical-align: -2px; }
::selection { background: rgba(245, 197, 66, 0.35); }
button { font-family: inherit; }

/* ---------- 像素窗体基元:白描双线框 ---------- */
/* 外白线 + 缝 + 内暗线,方角 */
.card, .modal, .toast, .stage-card {
  border: 2px solid var(--line);
  border-radius: 0;
  box-shadow: 0 0 0 2px var(--shadow), inset 0 0 0 2px var(--panel-deep), 4px 4px 0 var(--shadow);
  background: var(--panel);
}

/* ---------- 顶栏(游戏 HUD) ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px;
  background: var(--panel-deep);
  border-bottom: 2px solid var(--line);
  box-shadow: 0 2px 0 var(--shadow);
}
.logo {
  font-family: var(--font-pixel); font-size: 18px; letter-spacing: 1px; color: var(--text);
  text-shadow: 2px 2px 0 var(--shadow);
}
.logo span { color: var(--gold); }
.logo:hover { text-decoration: none; }
.hud { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hud-item {
  padding: 3px 12px;
  border: 2px solid var(--line-dim); border-radius: 0;
  font-family: var(--font-pixel); font-size: 13px; color: var(--text-dim);
  background: var(--panel);
  display: inline-flex; align-items: center; gap: 5px;
}
.hud-item.accent { color: var(--gold); border-color: var(--gold); font-variant-numeric: tabular-nums; text-shadow: 1px 1px 0 var(--shadow); }
#hud-rank { color: #10122b; background: var(--gold); border-color: var(--line); letter-spacing: 2px; }
.hud-item.link { color: var(--text-dim); cursor: pointer; }
.hud-item.link:hover { color: var(--blue); border-color: var(--blue); text-decoration: none; }
.mute-btn { cursor: pointer; }
.mute-btn:hover { color: var(--gold); border-color: var(--gold); }
.mute-btn .ic-off { display: none; }
.mute-btn.muted .ic-on { display: none; }
.mute-btn.muted .ic-off { display: inline; }

/* ---------- 布局 ---------- */
#app { max-width: 880px; margin: 0 auto; padding: 26px 16px 70px; }
.card { padding: 20px 22px; margin-bottom: 20px; }
.center { text-align: center; }
.muted { color: var(--text-dim); font-size: 13px; }
.pane-title {
  font-family: var(--font-pixel); font-size: 13px; letter-spacing: 2px; color: var(--gold);
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 10px;
}
.pane-title::before { content: '◆'; font-size: 10px; }
.pane-title::after { content: ''; flex: 1; height: 2px; background: var(--line-dim); }

/* ---------- 按钮(像素按键:硬阴影,按下凹陷) ---------- */
.btn {
  display: inline-block; padding: 8px 20px; border-radius: 0;
  border: 2px solid var(--line); background: var(--panel); color: var(--text);
  font-family: var(--font-pixel); font-size: 14px; letter-spacing: 1px; cursor: pointer;
  box-shadow: 0 4px 0 var(--shadow);
  transition: transform 0.06s, box-shadow 0.06s, background 0.15s;
}
.btn:hover { text-decoration: none; background: #212553; }
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--shadow); }
.btn.primary { background: var(--gold); border-color: var(--line); color: #10122b; }
.btn.primary:hover { background: #ffd45e; color: #10122b; }
.btn.primary:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: 0 4px 0 var(--shadow); }
.btn.ghost { background: transparent; }
.btn.danger { background: transparent; border-color: var(--red); color: var(--red); }
.btn.danger:hover { background: rgba(255, 107, 94, 0.12); }
.btn.big { padding: 12px 34px; font-size: 16px; }
.btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* ---------- 路线 Tab(顶栏内) ---------- */
.path-tabs { display: flex; gap: 2px; margin: 0 auto 0 12px; }
.path-tab {
  padding: 4px 12px; border: 2px solid var(--line-dim); background: transparent;
  font-family: var(--font-pixel); font-size: 12px; letter-spacing: 1px;
  color: var(--text-dim); cursor: pointer; transition: all 0.12s;
}
.path-tab:hover { color: var(--text); border-color: var(--line); }
.path-tab.active {
  color: var(--gold); border-color: var(--gold);
  background: rgba(245, 197, 66, 0.10);
  text-shadow: 1px 1px 0 var(--shadow);
}

/* ---------- 地图(WORLD SELECT) ---------- */
.map-wrap { display: flex; flex-direction: column; gap: 22px; margin-bottom: 20px; }
.map-wrap::before { display: none; }
.stage-card { position: relative; padding: 0; overflow: visible; }
.stage-card::before { display: none; }
.stage-card.locked { opacity: 0.55; filter: saturate(0.4); }
/* 窗体标题条 */
.stage-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 18px;
  background: var(--panel-deep);
  border-bottom: 2px solid var(--line-dim);
}
.stage-no { font-family: var(--font-pixel); font-size: 12px; color: var(--text-dim); letter-spacing: 2px; }
.stage-title {
  font-family: var(--font-pixel); font-size: 20px; letter-spacing: 3px;
  text-shadow: 2px 2px 0 var(--shadow);
}
.stage-card:not(.locked):not(.done) .stage-title { color: var(--gold); }
.stage-rank {
  font-family: var(--font-pixel); font-size: 12px; padding: 2px 10px;
  letter-spacing: 2px; border: 2px solid var(--purple); color: var(--purple);
}
.stage-card.done .stage-rank { border-color: var(--green); color: var(--green); }
.stage-pct { margin-left: auto; font-family: var(--font-pixel); font-size: 13px; color: var(--gold); font-variant-numeric: tabular-nums; }
.stage-lock { margin-left: auto; color: var(--text-dim); }
.stage-bar { height: 10px; background: var(--panel-deep); margin: 12px 18px 4px; border: 2px solid var(--line-dim); }
.stage-bar-fill {
  height: 100%; transition: width 0.5s steps(12);
  background: repeating-linear-gradient(90deg, var(--gold) 0 8px, #d9a52e 8px 16px);
}
.stage-desc { margin: 6px 18px 12px; }
/* 关卡瓦片网格(LEVEL SELECT) */
.level-chips {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px; padding: 0 18px 18px;
}
.chip {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 12px; border-radius: 0; font-size: 13px;
  font-family: var(--font-pixel);
  background: var(--panel-deep); border: 2px solid var(--line-dim);
  color: var(--text);
  transition: all 0.12s; cursor: pointer;
  position: relative;
}
.chip:hover { text-decoration: none; border-color: var(--line); background: #1c2050; transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--shadow); }
.chip:hover::after { content: '▶'; position: absolute; right: 8px; color: var(--gold); font-size: 10px; animation: fq-blink 0.7s steps(1) infinite; }
@keyframes fq-blink { 50% { opacity: 0; } }
.chip.pass { border-color: var(--green); color: var(--green); }
.chip.locked { opacity: 0.4; cursor: not-allowed; }
.chip.locked:hover { transform: none; box-shadow: none; border-color: var(--line-dim); background: var(--panel-deep); }
.chip.locked:hover::after { display: none; }
.chip.boss { border-color: var(--purple); color: var(--purple); }
.chip.boss.pass { border-color: var(--green); color: var(--green); }
.chip.trial { border-color: var(--gold); color: var(--gold); }
.chip.trial.pass { border-color: var(--green); color: var(--green); }
.chip.opt { border-style: dashed; }
.chip-n { margin-left: auto; font-size: 11px; color: var(--text-dim); font-family: var(--mono); }

/* ---------- 成就(奖杯室) ---------- */
.ach-list { display: flex; flex-wrap: wrap; gap: 10px; }
.ach {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; font-family: var(--font-pixel); font-size: 13px;
  border: 2px dashed var(--line-dim); color: var(--text-dim);
}
.ach.got {
  border: 2px solid var(--gold); color: var(--gold);
  background: rgba(245, 197, 66, 0.08);
  text-shadow: 1px 1px 0 var(--shadow);
  box-shadow: 2px 2px 0 var(--shadow);
}

.footer { text-align: center; padding: 20px 0; border-top: 2px solid var(--line-dim); margin-top: 10px; }

/* ---------- 关卡页 ---------- */
.level-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.back { font-family: var(--font-pixel); font-size: 13px; color: var(--text-dim); white-space: nowrap; }
.back:hover { color: var(--gold); text-decoration: none; }
.level-title {
  font-family: var(--font-pixel); font-size: 19px; letter-spacing: 2px;
  text-shadow: 2px 2px 0 var(--shadow);
}
.dots { display: flex; gap: 7px; margin-left: auto; }
.dot {
  width: 12px; height: 12px; border-radius: 0;
  background: var(--panel-deep); border: 2px solid var(--line-dim); cursor: pointer;
  transition: all 0.12s;
}
.dot:hover { border-color: var(--gold); transform: scale(1.2); }
.dot.pass { background: var(--green); border-color: var(--green); }
.dot.cur { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(245, 197, 66, 0.35); }

.intro-card .links { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; }

.unit-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
  padding-bottom: 10px; border-bottom: 2px solid var(--line-dim); flex-wrap: wrap;
}
.unit-no { font-family: var(--font-pixel); font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.unit-title { font-family: var(--font-pixel); font-size: 16px; letter-spacing: 1px; }
.unit-xp { margin-left: auto; font-family: var(--font-pixel); font-size: 12px; color: var(--gold); }
.unit-passed { font-family: var(--font-pixel); font-size: 12px; color: var(--green); }

/* 课文小标题(mini-md 的 ### ) */
.md-h {
  font-family: var(--font-pixel); font-size: 15px; letter-spacing: 2px; color: var(--gold);
  margin: 18px 0 8px; padding-left: 10px;
  border-left: 4px solid var(--gold);
}
.md-h:first-child { margin-top: 0; }

.q-text { margin-bottom: 12px; }
.q-text p { margin-bottom: 8px; }

/* 代码块 */
.codeblock {
  background: var(--panel-deep); border: 2px solid var(--line-dim); border-radius: 0;
  padding: 13px 15px; overflow-x: auto; margin: 10px 0;
  font-family: var(--mono); font-size: 13px; line-height: 1.6; color: #cdd5ea;
  box-shadow: inset 2px 2px 0 var(--shadow);
}
code {
  font-family: var(--mono); font-size: 0.9em;
  background: rgba(125, 180, 255, 0.14); padding: 1px 5px;
  color: #ffd88a;
}
.codeblock code { background: none; padding: 0; color: inherit; }

/* 选项(RPG 菜单:▶ 光标) */
.options { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.option {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 14px 11px 30px; position: relative;
  border: 2px solid var(--line-dim); border-radius: 0;
  cursor: pointer; background: var(--panel-deep); transition: all 0.1s;
}
.option::before {
  content: '▶'; position: absolute; left: 10px; top: 13px;
  font-size: 10px; color: var(--gold); opacity: 0;
}
.option:hover { border-color: var(--line); }
.option:hover::before { opacity: 1; animation: fq-blink 0.7s steps(1) infinite; }
.option.selected { border-color: var(--blue); background: #182448; }
.option.selected::before { opacity: 1; color: var(--blue); animation: none; }
.option.correct { border-color: var(--green); background: rgba(111, 224, 140, 0.10); animation: fq-correct-pop 0.35s steps(3); }
.option.correct::before { opacity: 1; color: var(--green); content: '✔'; animation: none; }
@keyframes fq-correct-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.015); }
  100% { transform: scale(1); }
}
.option.wrong { border-color: var(--red); background: rgba(255, 107, 94, 0.09); }
.option.wrong::before { opacity: 1; color: var(--red); content: '✖'; animation: none; }
.answered .option { cursor: default; }
.answered .option:hover { border-color: var(--line-dim); }
.answered .option.correct:hover { border-color: var(--green); }
.answered .option.wrong:hover { border-color: var(--red); }
.answered .option:hover::before { opacity: 0; }
.answered .option.correct:hover::before, .answered .option.wrong:hover::before { opacity: 1; }
.opt-letter {
  flex: none; width: 22px; height: 22px; margin-top: 2px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--panel); border: 2px solid var(--line-dim);
  font-family: var(--font-pixel); font-size: 12px; color: var(--text-dim);
}
.option.selected .opt-letter { border-color: var(--blue); color: var(--blue); }
.option.correct .opt-letter { border-color: var(--green); color: #10122b; background: var(--green); }
.option.wrong .opt-letter { border-color: var(--red); color: #10122b; background: var(--red); }
.opt-text { flex: 1; }
.opt-text code { word-break: break-all; }

.unit-actions { margin-top: 14px; display: flex; gap: 12px; flex-wrap: wrap; }
.unit-actions.center { justify-content: center; }

/* 解析框(系统消息窗) */
.explain-box, .result-box {
  margin-top: 14px; padding: 14px 16px; font-size: 14px;
  border: 2px solid var(--line-dim); background: var(--panel-deep);
  animation: fq-rise 0.25s steps(4);
}
@keyframes fq-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.explain-box.good, .result-box.good { border-color: var(--green); }
.explain-box.bad, .result-box.bad { border-color: var(--red); }
.verdict { font-family: var(--font-pixel); font-weight: 400; margin-bottom: 6px; letter-spacing: 1px; }
.explain-box.good .verdict, .result-box.good .verdict { color: var(--green); }
.explain-box.bad .verdict, .result-box.bad .verdict { color: var(--red); }
.explain-text { color: var(--text); }
.explain-text p { margin: 6px 0; }
.source { margin-top: 10px; font-size: 12px; color: var(--text-dim); }
.hint { margin-top: 8px; color: var(--text-dim); }

/* 编码题 */
.code-layout { display: flex; flex-direction: column; gap: 12px; }
.code-layout.with-preview { flex-direction: row; }
.editor-pane, .preview-pane { flex: 1; min-width: 0; }
.code-editor {
  width: 100%; min-height: 260px; resize: vertical;
  background: var(--panel-deep); color: #cdd5ea;
  border: 2px solid var(--line-dim); border-radius: 0;
  font-family: var(--mono); font-size: 13px; line-height: 1.6; padding: 12px;
  tab-size: 2;
  box-shadow: inset 2px 2px 0 var(--shadow);
}
.code-editor:focus { outline: none; border-color: var(--gold); }
.preview {
  width: 100%; min-height: 260px; height: 100%;
  background: #fff; border: 2px solid var(--line-dim);
}
.logs-box { margin-top: 12px; }
.logs-box pre {
  background: var(--panel-deep); border: 2px solid var(--line-dim);
  padding: 10px 14px; font-family: var(--mono); font-size: 13px; overflow-x: auto; color: #cdd5ea;
}
@media (max-width: 700px) {
  .code-layout.with-preview { flex-direction: column; }
}

/* ---------- 移动端适配 ---------- */
@media (max-width: 600px) {
  .topbar {
    flex-direction: column; gap: 6px;
    padding: 8px 12px; text-align: center;
  }
  .path-tabs { margin: 0; justify-content: center; }
  .path-tab { font-size: 11px; padding: 3px 10px; }
  .hud { justify-content: center; gap: 5px; }
  .hud-item { padding: 2px 8px; font-size: 12px; }

  #app { padding: 16px 10px 50px; }
  .card { padding: 14px 12px; margin-bottom: 14px; }

  .stage-head { padding: 8px 12px; gap: 8px; }
  .stage-title { font-size: 16px; letter-spacing: 2px; }
  .stage-bar { margin: 10px 12px 4px; }
  .stage-desc { margin: 6px 12px 10px; }
  .level-chips { grid-template-columns: 1fr; padding: 0 12px 12px; }
  .chip { padding: 12px 14px; min-height: 44px; }

  .level-head { gap: 8px; margin-bottom: 12px; }
  .level-title { font-size: 16px; }
  .dots { gap: 5px; }
  .dot { width: 16px; height: 16px; }

  .option { padding: 12px 14px 12px 32px; min-height: 44px; }
  .option::before { top: 15px; }
  .btn { padding: 10px 18px; min-height: 44px; font-size: 13px; }
  .btn.big { padding: 12px 24px; font-size: 15px; }

  .code-editor { min-height: 200px; font-size: 13px; }
  .play-view { height: 260px; }

  .summary-big { font-size: 22px; letter-spacing: 3px; }
  .summary-seal { font-size: 20px; letter-spacing: 4px; padding: 8px 20px; }

  .wrong-item { gap: 8px; padding: 8px 10px; }
  .wrong-label { min-width: 0; }

  .modal { padding: 18px; max-width: calc(100vw - 24px); }

  .pane-title { font-size: 12px; }
  .unit-title { font-size: 14px; }
}

@media (max-width: 400px) {
  #app { padding: 12px 6px 40px; }
  .card { padding: 10px 8px; }
  .stage-head { padding: 6px 8px; }
  .level-chips { padding: 0 8px 8px; }
  .chip { font-size: 12px; }
  .hud-item { padding: 2px 6px; font-size: 11px; }
  .summary-big { font-size: 18px; }
}

/* play 试炼关(游戏画面窗) */
.play-stage {
  border: 2px solid var(--line); border-radius: 0; overflow: hidden;
  margin-bottom: 14px; background: #05060f;
  box-shadow: 0 0 0 2px var(--shadow), inset 0 0 0 2px var(--panel-deep), 4px 4px 0 var(--shadow);
  padding: 4px;
}
.play-view { display: block; width: 100%; height: 330px; border: 0; background: #0a0d14; }
.play-editor { min-height: 180px; margin-top: 4px; }

/* 传送门(异世界之门) */
.portal-card {
  border: 2px solid var(--purple); padding: 16px;
  background: rgba(199, 146, 234, 0.07); margin-bottom: 14px;
  box-shadow: 3px 3px 0 var(--shadow);
}
.portal-title { font-family: var(--font-pixel); color: var(--purple); margin-bottom: 8px; font-size: 16px; letter-spacing: 2px; }
.portal-confirm { display: flex; align-items: center; gap: 8px; cursor: pointer; margin: 12px 0; }
.portal-confirm input { accent-color: var(--purple); width: 16px; height: 16px; }
.portal-check { margin-top: 12px; padding-top: 12px; border-top: 2px dashed var(--line-dim); }

/* 任务清单(冒险日志) */
.task-steps { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.task-step {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 14px; border: 2px solid var(--line-dim);
  background: var(--panel-deep); cursor: pointer; transition: border-color 0.12s;
}
.task-step:hover { border-color: var(--blue); }
.task-step input { margin-top: 5px; accent-color: var(--green); width: 15px; height: 15px; }
.task-step:has(input:checked) { border-color: var(--green); }
.task-step:has(input:checked) .step-text { color: var(--text-dim); text-decoration: line-through; }
.step-text { flex: 1; }
.step-note { display: block; font-size: 12.5px; color: var(--text-dim); margin-top: 3px; text-decoration: none !important; }

/* 结算(STAGE CLEAR) */
.summary-card { padding: 44px 20px; }
.summary-big {
  font-family: var(--font-pixel); font-size: 30px; margin-bottom: 12px; letter-spacing: 4px;
  text-shadow: 3px 3px 0 var(--shadow);
}
.good-text { color: var(--green); }
.summary-card p { margin-bottom: 16px; color: var(--text-dim); }
.summary-seal {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 26px; margin-bottom: 18px;
  font-family: var(--font-pixel); font-size: 26px; letter-spacing: 6px;
  color: #10122b; background: var(--gold);
  border: 2px solid var(--line);
  box-shadow: 0 0 0 2px var(--shadow), 4px 4px 0 var(--shadow);
  animation: fq-clear-drop 0.5s cubic-bezier(0.2, 2.2, 0.4, 1);
  width: auto; height: auto; transform: none;
}
@keyframes fq-clear-drop {
  0% { transform: translateY(-40px) scale(1.6); opacity: 0; }
  60% { transform: translateY(2px) scale(0.96); opacity: 1; }
  100% { transform: none; }
}

/* 错题本(冒险者的耻辱柱) */
.wrong-list { display: flex; flex-direction: column; gap: 8px; }
.wrong-item {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  padding: 10px 14px; border: 2px solid var(--line-dim); border-left: 4px solid var(--red);
  background: var(--panel-deep); color: var(--text);
  transition: all 0.12s;
}
.wrong-item:hover { text-decoration: none; border-color: var(--line); transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--shadow); }
.wrong-where { font-family: var(--font-pixel); font-size: 12px; color: var(--text-dim); white-space: nowrap; }
.wrong-label { flex: 1; font-size: 14px; min-width: 200px; }
.wrong-count { font-family: var(--font-pixel); font-size: 12px; color: var(--red); white-space: nowrap; }

/* 数据页 */
.data-area {
  width: 100%; min-height: 140px; resize: vertical;
  background: var(--panel-deep); color: #cdd5ea; border: 2px solid var(--line-dim);
  font-family: var(--mono); font-size: 12px; padding: 10px;
}

/* toast(系统通知窗) */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translate(-50%, 20px);
  color: var(--text); font-family: var(--font-pixel); letter-spacing: 1px;
  padding: 12px 24px; font-size: 14px; z-index: 100;
  opacity: 0; transition: all 0.25s steps(5); max-width: 90vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* modal */
.modal-mask {
  position: fixed; inset: 0; background: rgba(5, 6, 15, 0.72); z-index: 90;
  display: flex; align-items: center; justify-content: center;
}
.modal { padding: 24px; max-width: 420px; width: calc(100vw - 40px); animation: fq-rise 0.2s steps(4); }
.modal-body { margin-bottom: 18px; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; }

/* 震屏(答错) */
.fx-shake { animation: fq-shake 0.4s steps(8); }
@keyframes fq-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  body::after { display: none; }
}
