/* 夜 Nocturne Glass 令牌:深墨底 + 无色玻璃(借魔环折射) + 香槟强调 + 衬线标题 */
:root {
  /* 字体:夜用系统衬线(Georgia/宋体)模拟 Playfair 优雅,正文无衬线 */
  --font-display: "Playfair Display", Georgia, "Songti SC", "STSong", "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  /* Type Scale(两主题共用数值;--fs-2xl/--fs-xl 由 town/town-home.css 消费) */
  --fs-2xl: 40px; --fs-xl: 28px; --fs-lg: 22px; --fs-bs: 16px; --fs-sm: 13px; --fs-xs: 12px;
  --lh-base: 1.5;
  --bg: #0B1322;
  --card: rgba(255, 255, 255, 0.08);  /* 无色玻璃 white/8(替着色块) */
  --card-solid: #0B1322;
  --border: rgba(255, 255, 255, 0.15);
  --text: #E6EDF6;
  --text2: #8B9BB4;
  --accent: #E4B863;            /* 香槟:唯一品牌强调色 */
  --accent-rgb: 228, 184, 99;
  --good: #3fb950;
  --good-rgb: 63, 185, 80;
  --bad: #f85149;
  --bad-rgb: 248, 81, 73;
  --warn: #d29922;
  --bar: rgba(255, 255, 255, 0.08);
  --btn-text: #0B1322;
  --btn-sec-bg: rgba(255, 255, 255, 0.06);
  --glass-blur: blur(40px) saturate(180%);
  /* 方向性边光:顶亮底暗(玻璃质感核心) */
  --shadow-glass: 0 16px 40px rgba(3, 7, 18, 0.5),
                  inset 0 1px 0 rgba(255, 255, 255, 0.22),
                  inset 0 -1px 0 rgba(2, 6, 16, 0.35);
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  /* 配色(语义呼应) */
  --c-start: #E4B863;     /* 开始训练:香槟 */
}
/* 日 Minimalist Flat 令牌:纯白纸 + 近黑 + 纯色面 + 零玻璃零影零渐变 + 900 黑体 */
body.light {
  /* 字体:日统一无衬线,靠 900 字重体现 Inter 黑体力量 */
  --font-display: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: var(--font-display);
  --bg: #FAFAFA;
  --card: #FFFFFF;
  --card-solid: #FFFFFF;
  --border: #0A0A0A;        /* 近黑硬边 */
  --text: #0A0A0A;
  --text2: #6B7280;
  --accent: #FF3366;        /* Coral:主CTA/错误/重点 */
  --accent-rgb: 255, 51, 102;
  --good: #00D4AA;         /* Teal:成功/对 */
  --good-rgb: 0, 212, 170;
  --bad: #FF3366;          /* Coral:错误 */
  --bad-rgb: 255, 51, 102;
  --warn: #FFCC00;         /* Yellow:警告 */
  --bar: #E5E5E5;
  --btn-text: #FFFFFF;
  --btn-sec-bg: #FFFFFF;
  --glass-blur: none;
  --shadow-glass: none;    /* 零阴影 */
  --ease-spring: cubic-bezier(0.4, 0, 0.2, 1);  /* 硬切偏直 */
  --c-start: #FF3366;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* 全局焦点环(A2:键盘用户可见焦点位置) */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
body.light :focus-visible { outline-color: #0A0A0A; }  /* 日模式黑焦点环 */
html, body { margin: 0; padding: 0; }
body {
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-bs);
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  /* 流动渐变背景(动态):两层径向渐变缓慢漂移 */
  background: var(--bg);
  position: relative;
  overflow-x: hidden;
  transition: color .3s ease;
}
body::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: -1;
  background:
    radial-gradient(40% 50% at 18% 22%, rgba(51, 81, 122, 0.55), transparent 70%),
    radial-gradient(45% 55% at 82% 72%, rgba(124, 156, 196, 0.30), transparent 70%),
    radial-gradient(38% 42% at 50% 95%, rgba(228, 184, 99, 0.14), transparent 70%);
  background-color: var(--bg);
  transition: background-color .3s ease;
}
body.light::before { display: none; }  /* 日模式纯色底,无光井 */

.space-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  min-height: 100vh;
  min-height: 100dvh;
}
/* 首页:窄列垂直居中,给 logo/入场动画用 */
body.home main {
  max-width: 420px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 24px;
  padding-bottom: 24px;
}

.theme-bar {
  position: fixed; top: calc(12px + env(safe-area-inset-top, 0px)); left: calc(12px + env(safe-area-inset-left, 0px)); z-index: 50;
  display: flex; align-items: center; gap: 2px;
  padding: 4px;
  background: var(--card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: 999px;
}
/* 主题栏(日夜切换+返回门户)仅首页出现;做题卡/反馈视图隐藏 */
body:not(.home) .theme-bar { display: none; }
.theme-btn {
  width: 40px; height: 40px; border: none; padding: 0;
  background: transparent; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text2);
  transition: background .2s var(--ease-spring), color .2s, transform .12s;
}
.theme-btn .icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-btn:active { transform: scale(.9); }
.theme-bar .portal-back { margin-right: 6px; }  /* 返回门户钮与主题钮视觉分隔(平台规范 §4.5) */
.theme-btn.active {
  background: var(--bar);  /* 选中加深:实色填充 + 主前景色 */
  color: var(--text);
}
body.light .theme-btn { color: #0A0A0A; }  /* 日模式图标黑,保 WCAG 4.5:1 */

/* 玻璃卡片(夜核心:无色面 + 方向性边光 + 顶部高光扫光) */
.card {
  position: relative;
  background: var(--card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-glass);
  transition: border-color .2s var(--ease-spring), background .2s;
}
/* 顶部高光扫光(玻璃质感:顶亮渐隐) */
.card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(rgba(255, 255, 255, 0.12), transparent 50%);
  opacity: .8;
}

/* 首页视图已由 town/town-home 承接,原 home 英雄卡/进度环/波浪标题样式移除 */

h1 { font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 500; margin: 8px 0 14px; text-align: center; letter-spacing: -.02em; }
h2 { font-family: var(--font-display); font-size: var(--fs-sm); font-weight: 500; margin: 4px 0 10px; color: var(--text2); text-transform: uppercase; letter-spacing: .04em; }
body.light h1, body.light h2 { font-weight: 900; letter-spacing: -.03em; }

/* 按钮 */
.btn {
  display: block; width: 100%; padding: 14px 16px; margin: 8px 0;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--btn-sec-bg); color: var(--text);
  font-size: var(--fs-bs); font-weight: 500; cursor: pointer;
  transition: opacity .15s, transform .12s, box-shadow .2s, background .2s, color .2s, border-color .2s;
}
.btn:hover { background: var(--border); }
.btn:active { opacity: .8; transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--c-start); color: #0B1322; border-color: transparent; }
.btn.primary:hover { filter: brightness(1.08); background: var(--c-start); }
.btn.primary:disabled { opacity: .55; }
/* 首页配色按钮 */
/* 「开始训练」:夜=香槟玻璃态(静态,零呼吸) */
.btn[data-act="start"] {
  background: var(--c-start);
  color: #0B1322;
  border: 2px solid transparent;
  font-weight: 600;
}
.btn[data-act="start"]:hover { filter: brightness(1.1); }

.muted { color: var(--text2); font-size: var(--fs-sm); }
.row { display: flex; gap: 8px; }
.row .btn { margin: 8px 0 0; }

/* 4 格进度条(纯视觉,设计 §7.3):宽度由 #view-quiz .quiz-frame > .qbar 定 */
.qbar {
  display: flex; gap: 6px; margin-bottom: 14px;
  align-self: center;
}
.qbar .cell {
  flex: 1; height: 8px; border-radius: 4px; background: var(--bar);
  transition: background .25s, opacity .25s;
}
.qbar .cell.done { background: var(--good); }
.qbar .cell.cur { background: var(--good); opacity: .45; }

/* 题干:14px(介于选项 fs-sm 13 与 fs-bs 16 之间),行高 1.5 保日模式粗体多行长文可读 */
#q-stem { font-family: var(--font-display); font-size: 14px; font-weight: 500; line-height: var(--lh-base); letter-spacing: -.01em; }
body.light #q-stem { font-weight: 700; }

/* 选项 */
.opt {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px; margin: 6px 0; border: 2px solid var(--border);
  border-radius: 10px; min-height: 48px; cursor: pointer;
  background: rgba(255,255,255,.02);
  transition: border-color .15s, background .15s, transform .12s;
}
.opt:hover { border-color: var(--accent); }
.opt:active { transform: scale(.99); }
.opt .lbl {
  flex: 0 0 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--border); display: flex; align-items: center;
  justify-content: center; font-size: var(--fs-sm); font-weight: 600; color: var(--text2);
  transition: background .15s, color .15s, border-color .15s;
}
.opt.selected .lbl { background: var(--accent); color: #0B1322; border-color: var(--accent); }
.opt.selected { border-color: var(--accent); background: rgba(228,184,99,.12); }
.opt.correct { border-color: var(--good); background: rgba(63,185,80,.16); }
.opt.correct .lbl { background: var(--good); color: #fff; border-color: var(--good); }
.opt.wrong { border-color: var(--bad); background: rgba(248,81,73,.14); }
.opt.wrong .lbl { background: var(--bad); color: #fff; border-color: var(--bad); }
.opt.locked { pointer-events: none; }
.opt .body { flex: 1; word-break: break-word; padding-top: 2px; font-size: var(--fs-sm); line-height: 1.4; }

/* 判题结果 */
.verdict { padding: 10px 4px; border-radius: 8px; flex-direction: column; background: transparent; }  /* 透明:解析内容直接落玻璃面,避免与横条两个不透明深色块在玻璃卡上叠加重叠 */
.verdict.pinned { position: sticky; top: 0; max-height: calc(100dvh - 78px - env(safe-area-inset-bottom, 0px)); }  /* 横条被推到顶后:钉顶 + .v-body 独立滚动 */
.verdict > div { font-size: var(--fs-sm); line-height: 1.4; }  /* 标题(✓/✗) + 正确答案行 */
.verdict.ok { color: var(--good); }
.verdict.bad { color: var(--bad); }
/* 对错栏(.v-head 钉顶):大字结果 + 正解胶囊 + 顶光带(夜=结果色 glow;日=硬色块)。满宽贴边 + 不透明底遮盖上滚解析 */
.verdict .v-head {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 12px;
  margin: 0 -18px 8px;              /* 横向抵消 .verdict(4px)+.card(14px) padding 满宽贴边 */
  padding: 10px 14px;
  background: var(--card-solid);
  border-radius: 0;
  border-top: 3px solid var(--good);  /* 顶光带(对=绿),.bad 覆盖为红 */
  box-shadow: 0 6px 14px -6px rgba(0,0,0,.55);
}
.verdict.bad .v-head { border-top-color: var(--bad); box-shadow: 0 6px 14px -6px rgba(0,0,0,.55); }
.verdict .v-head .v-res { font-weight: 900; font-size: var(--fs-lg); line-height: 1; }  /* 大字 900 */
.verdict .v-head .v-ans { margin-right: auto; font-size: var(--fs-sm); padding: 3px 12px; border-radius: 999px; background: rgba(var(--good-rgb), .16); border: 1px solid rgba(var(--good-rgb), .5); color: var(--good); }  /* 正解胶囊 */
.verdict.bad .v-head .v-ans { background: rgba(var(--bad-rgb), .16); border-color: rgba(var(--bad-rgb), .5); color: var(--bad); }
.verdict .v-head .v-timer { color: var(--text2); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; opacity: .8; }  /* 读秒 */
.verdict .v-body { flex: 1; overflow-y: auto; min-height: 0; }  /* 解析独立滚动:横条钉 verdict 顶,首行在顶不被遮,后面溢出下滑查看 */
#q-next { flex-shrink: 0; }  /* 下一步固定 verdict 底部,不随解析滚动 */
/* 阶段A 读秒横条(无对错):香槟顶光带(静态),读秒居中 */
.verdict.reading .v-head { border-top-color: var(--accent); box-shadow: 0 6px 14px -6px rgba(0,0,0,.55); justify-content: center; }
.verdict.reading .v-head .v-timer { opacity: 1; font-size: var(--fs-sm); color: var(--accent); }
/* 日模式 Minimalist Bold:顶 6px 硬色块 + 大字 900 + 黑底反白硬胶囊,0 圆角零阴影零发光 */
body.light .verdict .v-head { background: var(--card-solid); box-shadow: none; border: 2px solid var(--text); border-top: 6px solid var(--good); border-radius: 0; }
body.light .verdict.bad .v-head { border-top-color: var(--bad); }
body.light .verdict .v-head .v-ans { background: var(--text); border-color: var(--text); color: var(--btn-text); border-radius: 0; }
body.light .verdict.bad .v-head .v-ans { background: var(--bad); border-color: var(--bad); }
body.light .verdict.reading .v-head { border-top-color: var(--text); box-shadow: none; }
body.light .verdict.reading .v-head .v-timer { color: var(--text); }
.verdict .reason { color: var(--text); margin: 4px 0; font-size: var(--fs-xs); line-height: 1.3; }

/* 结构化解析(答错题 verdict + retry 浮层共用):一句话 + 考点/思路/逐选项/易混淆/延伸 */
.brief { color: var(--text); margin: 4px 0; font-size: var(--fs-sm); line-height: 1.4; }
.verdict .brief { font-size: var(--fs-sm); line-height: 1.4; }  /* 覆盖 .verdict>div 的 fs-sm */
.analysis { margin: 6px 0 2px; }
.an-sec { margin: 6px 0; font-size: var(--fs-xs); line-height: 1.3; }
.an-lbl { display: inline-block; min-width: 3em; color: var(--text2); font-weight: 600; }
.an-txt { color: var(--text); }
.an-opt { margin: 2px 0 2px 1em; color: var(--text); }

/* 三选项浮层(设计 §7.4) */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 100;
  padding: 16px;
  animation: overlayIn .2s ease;
}
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
.overlay .panel {
  background: var(--card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: 14px; padding: 18px; width: 100%; max-width: 360px;
  box-shadow: var(--shadow-glass);
  animation: panelIn .25s var(--ease-spring);
}
@keyframes panelIn { from { opacity: 0; transform: scale(.92) translateY(8px); } to { opacity: 1; transform: none; } }
.overlay h3 { margin: 0 0 12px; text-align: center; }
.overlay .btn { margin: 6px 0; }

/* 反馈视图 */
.fitem {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.fitem .stem { flex: 1; color: var(--text); font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fitem .tag { color: var(--warn); font-size: var(--fs-xs); cursor: pointer; }
.fitem .btn { width: auto; margin: 0; padding: 4px 10px; }  /* 列表内行内按钮(重新答题/标记/取消标记) */

/* 本轮题目:行可点击展开完整题面(题干/选项/你的答案/对错,见 app.js toggleQview) */
.fitem-q { cursor: pointer; border-radius: 8px; }
.fitem-q:hover { background: var(--btn-sec-bg); }
.qmark { margin-right: 6px; font-weight: 700; }
.qmark.ok { color: var(--good); }
.qmark.bad { color: var(--bad); }
.qmark.none { color: var(--text2); }
.qview { padding: 10px 2px 14px; border-bottom: 1px solid var(--border); }
.qview[hidden] { display: none; }
.qv-meta { font-size: var(--fs-xs); color: var(--text2); margin-bottom: 8px; }
.qv-meta .ok { color: var(--good); font-weight: 600; }
.qv-meta .bad { color: var(--bad); font-weight: 600; }
.qv-stem { font-family: var(--font-display); font-size: 14px; font-weight: 500; line-height: 1.5; margin-bottom: 8px; white-space: pre-wrap; }  /* 与答题视图题干同规格 */
.qv-opt { font-size: var(--fs-sm); color: var(--text); line-height: 1.6; padding-left: 4px; }

.view { display: none; }
.view.active { display: block; animation: viewIn .25s var(--ease-spring); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 答题视图:进度条+题卡包在同一 80% 居中框内,左边天然对齐(本项要求) */
#view-quiz.active {
  /* 减去 main 上下 padding(顶16+底20)与底部安全区:使 main 恰为 100dvh、整页不滚动。
     题卡已自带卡内滚动(max-height+overflow-y:auto),整页滚动属冗余需去除。
     36px=main 纵向 padding 之和(不含 safe);日/夜通用(无主题选择器);移动端仅改横向 padding 故常量不变。
     不变式:qbar(22)+卡max(100dvh-78-safe)=100dvh-56-safe < 本值(100dvh-36-safe),frame 装得下、不反向撑高。 */
  min-height: calc(100vh - 36px - env(safe-area-inset-bottom, 0px));
  min-height: calc(100dvh - 36px - env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  justify-content: center;
}
#view-quiz .quiz-frame { width: 80%; margin: 0 auto; }  /* 80% 居中框 */
#view-quiz .quiz-frame > .qbar { flex-shrink: 0; width: 50%; }  /* 进度条占框 50%(=原 2/5),与题卡左边对齐 */
#view-quiz .card { width: 100%; text-align: justify; padding: 14px; }  /* 题干缩至14px后,框内留白同比收紧16->14(间距随密度);日/夜通用 */
/* 解析后:题卡随解析自然变长,但以"屏幕高度"为上限--顶到天花板即停,溢出内容在卡内下拉滚动;
   进度条在上、题卡在下,二者合计不超屏,故进度条始终可见(无需 sticky);
   [下一步]随内容排在末尾,滚到内容底即见。解析前内容短于上限,卡片自适应高度、不滚动。 */
#view-quiz .card {
  max-height: calc(100dvh - 78px - env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  scrollbar-width: thin;                                       /* Firefox:细滚动条 */
  scrollbar-color: var(--accent) rgba(255, 255, 255, 0.04);    /* Firefox:夜=香槟滑块+微轨道(日覆盖见下) */
  scrollbar-gutter: stable;                     /* 预留滚动条位,避免解析后出现/消失时内容横向跳动 */
  overscroll-behavior: contain;                 /* 卡内滚到边界不牵连外层页面/下拉刷新 */
}
/* 夜 Nocturne Glass:香槟玻璃滑块 + 软光晕(品牌强调色做滚动条,呼应玻璃质感) */
#view-quiz .card::-webkit-scrollbar { width: 10px; }
#view-quiz .card::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.04); border-radius: 8px; }
#view-quiz .card::-webkit-scrollbar-thumb {
  background: var(--accent);
  border: 2px solid transparent;
  background-clip: padding-box;       /* 透明边内缩,留细缝更精致 */
  border-radius: 8px;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .4);
  transition: filter .2s;
}
#view-quiz .card::-webkit-scrollbar-thumb:hover {
  filter: brightness(1.15);
}

/* 触屏(移动端):隐藏常驻滚动条 + 取消 gutter 占位,回归触屏滑动惯例。桌面保留上方自定义滚动条。
   ① 触屏滑动是本能交互,无需常驻条做"可滚"提示;② 自定义 ::-webkit-scrollbar 会令 webkit 从
   系统 overlay 切到 classic 常驻条(占布局、常驻),违背移动端 overlay 惯例;③ 自定义香槟滑块在
   iOS Safari 本就不生效(系统 overlay 取代),iOS 群体看不到、Android 反成常驻桌面条,两端皆失;
   ④ scrollbar-gutter:stable 仅服务桌面 classic 条,移动端 overlay 不占空间、无跳动,stable 反致
   卡内内容区不对称变窄。故触屏统一隐藏,桌面(hover+fine)不动。 */
@media (hover: none) and (pointer: coarse) {
  #view-quiz .card {
    scrollbar-width: none;        /* Firefox:不渲染滚动条 */
    scrollbar-gutter: auto;       /* 取消永久预留,回收右侧 10px */
  }
  #view-quiz .card::-webkit-scrollbar { display: none; }  /* Chrome/Safari/Android:不渲染 */
}

/* 判题/下一步/跳过:收窄 + 居中(三态一致,disabled 不变窄) */
#q-judge, #q-next, #q-skip {
  width: auto;
  min-width: 140px;
  max-width: 60%;
  padding: 10px 40px;
  margin: 14px auto 6px;
  white-space: nowrap;
  font-size: 14px;  /* 跟题干归并(16->14),双主题安全 */
}
/* 判题/下一步:夜=香槟玻璃态(静态) */
#q-judge, #q-next {
  background: var(--c-start);
  color: #0B1322;
  border: 2px solid transparent;
  font-weight: 600;
}
#q-judge:hover:not(:disabled), #q-next:hover:not(:disabled) { filter: brightness(1.1); }
/* 判题处理中:防重复点击(顺序锁兜底);读秒已由 verdict 横条 .v-timer 承担,按钮不再作顶栏 */
#q-judge.is-loading {
  opacity: 1;            /* loading ≠ disabled:保持满色 */
  pointer-events: none;  /* 防重复点击 */
  cursor: progress;
}
/* 新题流式期:判题按钮灰禁用(对应 is-loading 的 pointer-events 模式,不掺 disabled 属性) */
#q-judge.is-streaming {
  opacity: .5;
  pointer-events: none;
  cursor: progress;
}

@media (min-width: 768px) {
  .opt:hover { border-color: var(--accent); }
  .btn:hover:not(:disabled) { filter: brightness(1.06); }
}

/* 移动端窄屏:题卡框放宽填充 + main padding 收窄(桌面不变) */
@media (max-width: 480px) {
  main { padding-left: 12px; padding-right: 12px; }
  #view-quiz .quiz-frame { width: 98%; }  /* 80% → 98%,窄屏填充 */
  #view-quiz .quiz-frame > .qbar { width: 60%; }  /* 进度条同比放宽,保持与题卡左边对齐 */
}

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

/* 胶片颗粒(夜:去塑料感 2.5%; 日藏) */
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  opacity: .025; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body.light .grain { display: none; }

/* ============================================================
   日模式 Minimalist Flat 覆盖块
   零阴影 / 零渐变 / 零模糊 / 黑硬边 / 圆角归零 / 悬停反转 / 硬切
   ============================================================ */
body.light .theme-bar { border-radius: 0; border-width: 2px; box-shadow: none; }
body.light .theme-btn { border-radius: 0; }

body.light .card,
body.light .overlay .panel {
  background: #FFFFFF;
  backdrop-filter: none; -webkit-backdrop-filter: none;
  border: 2px solid #0A0A0A;
  border-radius: 0;
  box-shadow: none;
}
body.light .card::after { display: none; }  /* 无高光扫光 */
/* 日 Minimalist Flat:滚动条=纯黑硬边矩形,零圆角/零光晕/零过渡(对齐硬切美学) */
body.light #view-quiz .card { scrollbar-color: #0A0A0A transparent; }
body.light #view-quiz .card::-webkit-scrollbar-track { background: transparent; }
body.light #view-quiz .card::-webkit-scrollbar-thumb {
  background: #0A0A0A;
  border: none;
  border-radius: 0;
  box-shadow: none;
  filter: none;
  transition: none;
}
/* 按钮:黑硬边,悬停反转;主CTA=Coral */
body.light .btn {
  background: #FFFFFF; color: #0A0A0A;
  border: 2px solid #0A0A0A; border-radius: 0;
  transition: background .075s linear, color .075s linear;
}
body.light .btn:hover:not(:disabled) { background: #0A0A0A; color: #FFFFFF; filter: none; }
body.light .btn:active { transform: none; opacity: 1; }
body.light .btn[data-act="start"],
body.light #q-judge,
body.light #q-next {
  background: #FF3366; color: #FFFFFF; border-color: #FF3366;
}
body.light .btn[data-act="start"]:hover,
body.light #q-judge:hover:not(:disabled),
body.light #q-next:hover:not(:disabled) {
  background: #0A0A0A; color: #FFFFFF; border-color: #0A0A0A; filter: none;
}
body.light .btn.primary { background: #FF3366; color: #FFFFFF; border-color: #FF3366; }

/* 选项:黑硬边,选中/对错纯色边,无半透底,悬停反转 */
body.light .opt {
  background: #FFFFFF; border: 2px solid #0A0A0A; border-radius: 0; box-shadow: none;
}
body.light .opt:hover { border-color: #0A0A0A; background: #0A0A0A; color: #FFFFFF; }
body.light .opt:hover .lbl { color: #FFFFFF; border-color: #FFFFFF; }  /* 悬停反转:字母随选项变白,否则黑字黑底不可见 */
body.light .opt .lbl { border: 2px solid #0A0A0A; border-radius: 0; color: #0A0A0A; }
body.light .opt.selected { border-color: #990026; background: #FFFFFF; color: #0A0A0A; }  /* 选中红加深约50%(#FF3366->#990026):强化选中,且与判错 wrong 的亮红区分 */
body.light .opt.selected .lbl { background: #990026; color: #FFFFFF; border-color: #990026; }
body.light .opt.correct { border-color: #00D4AA; background: #FFFFFF; }
body.light .opt.correct .lbl { background: #00D4AA; color: #FFFFFF; border-color: #00D4AA; }
body.light .opt.wrong { border-color: #FF3366; background: #FFFFFF; }
body.light .opt.wrong .lbl { background: #FF3366; color: #FFFFFF; border-color: #FF3366; }

/* qbar:硬边方块 */
body.light .qbar .cell { border-radius: 0; border: 2px solid #0A0A0A; background: #FFFFFF; }
body.light .qbar .cell.done { background: #0A0A0A; box-shadow: none; }
body.light .qbar .cell.cur { background: #FF3366; opacity: 1; border-color: #FF3366; }

/* 标签 Swiss 风:加宽字距 */
body.light h2 { letter-spacing: .1em; }


/* ============================================================
   重新答题浮层(LLM 双维复核) 夜模式
   ============================================================ */
.overlay .panel.rv-panel {
  max-width: 420px;
  max-height: calc(100dvh - 32px - env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.rv-sec { margin: 12px 0; padding-top: 10px; border-top: 1px solid var(--border); }
.rv-sec-title { font-size: var(--fs-xs); color: var(--text2); font-weight: 700; letter-spacing: .05em; margin-bottom: 6px; }
.rv-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border-radius: 999px;
  font-size: var(--fs-xs); font-weight: 700; line-height: 1.6;
}
.rv-badge.ok { background: rgba(var(--good-rgb), .16); border: 1px solid rgba(var(--good-rgb), .5); color: var(--good); }
.rv-badge.bad { background: rgba(var(--bad-rgb), .16); border: 1px solid rgba(var(--bad-rgb), .5); color: var(--bad); }
.rv-badge.field { background: var(--btn-sec-bg); border: 1px solid var(--border); color: var(--text2); }
.rv-issue { margin: 6px 0; padding: 8px 10px; border-radius: 8px; background: var(--btn-sec-bg); border: 1px solid var(--border); font-size: var(--fs-xs); line-height: 1.4; }
.rv-issue-problem { display: block; margin: 5px 0 3px; color: var(--text); }
.rv-issue-fix { display: block; color: var(--accent); font-size: var(--fs-xs); }
.rv-feedback {
  margin: 6px 0 4px; padding: 8px 10px;
  border-radius: 0 8px 8px 0;
  border-left: 3px solid var(--accent);
  background: rgba(var(--accent-rgb), .08);
  color: var(--text); font-size: var(--fs-sm); line-height: 1.5;
}
.overlay .rv-panel .btn { margin: 8px 0 0; }
.overlay .rv-panel .btn.primary { margin-top: 10px; }

/* 日模式 Minimalist Flat 覆盖(黑硬边 / 纯色 pill / 圆角归零) */
body.light .rv-sec { border-top-color: #0A0A0A; }
body.light .rv-sec-title { color: #6B7280; }
body.light .rv-badge { border-radius: 0; border-width: 2px; }
body.light .rv-badge.ok { background: #0A0A0A; border-color: #0A0A0A; color: #FFFFFF; }
body.light .rv-badge.bad { background: #FF3366; border-color: #FF3366; color: #FFFFFF; }
body.light .rv-badge.field { background: #FFFFFF; border-color: #0A0A0A; color: #0A0A0A; }
body.light .rv-issue { background: #FFFFFF; border: 1px solid #0A0A0A; border-radius: 0; }
body.light .rv-issue-fix { color: #FF3366; }
body.light .rv-feedback { background: #FFFFFF; border-left: 3px solid #FF3366; border-radius: 0; }
