/* ============================================================================
 * 答题卡扫描系统 · G的阅卷小站  —— 样式
 * 主题：色彩全部走 CSS 变量；浅色为默认，深色用 html[data-theme=dark]
 * 约定：① [hidden] 必须永远生效（见文件顶部，曾因 .login-wrap{display:flex} 盖过 hidden
 *         导致"登录后登录页仍盖在上面，看起来点了没反应"）
 *      ② 新增颜色变量两套主题都要定义
 * ========================================================================== */
:root {
  --bg: #eef1f7;
  --bg2: #f7f9fc;
  --card: #ffffff;
  --card2: #f5f7fb;
  --line: #e3e8f0;
  --line2: #ccd5e3;
  --text: #17202c;
  --text2: #48566b;
  --muted: #8794a8;
  --accent: #3563e9;
  --accent2: #1f47c0;
  --accent-soft: #e8efff;
  --ok: #11875a;
  --ok-soft: #e3f6ec;
  --bad: #d93a2f;
  --bad-soft: #fdecea;
  --warn: #b5761a;
  --warn-soft: #fdf4e0;
  --info: #0b7285;
  --grad: linear-gradient(135deg, #3563e9 0%, #5b34d6 100%);
  --grad-hero: linear-gradient(125deg, #2f5ce0 0%, #6d3ce0 55%, #8b34c9 100%);
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 18px rgba(16, 24, 40, .07);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow-lg: 0 10px 46px rgba(16, 24, 40, .24);
  --radius: 14px;
  --radius-sm: 10px;
}
html[data-theme="dark"] {
  --bg: #0f1319;
  --bg2: #141922;
  --card: #1a212c;
  --card2: #212a37;
  --line: #2b3543;
  --line2: #3c4859;
  --text: #e8edf5;
  --text2: #b6c2d3;
  --muted: #8391a5;
  --accent: #6a93ff;
  --accent2: #8fb0ff;
  --accent-soft: #1d2b48;
  --ok: #4ecb92;
  --ok-soft: #14301f;
  --bad: #ff8078;
  --bad-soft: #3a1d1a;
  --warn: #e8bc63;
  --warn-soft: #352a12;
  --info: #55c0d4;
  --grad: linear-gradient(135deg, #4d7bff 0%, #8a5cf0 100%);
  --grad-hero: linear-gradient(125deg, #2a52b8 0%, #4a2e9e 55%, #6a2a95 100%);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 22px rgba(0, 0, 0, .34);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, .62);
}
* { box-sizing: border-box; }
/* ⚠️ 关键：hidden 属性必须优先（否则 flex 类会把它盖掉） */
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 8px; line-height: 1.3; }
code { background: var(--card2); padding: 1px 6px; border-radius: 6px; font-size: .92em; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 9px 18px; background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.brand { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.brand .logo {
  width: 30px; height: 30px; border-radius: 9px; background: var(--grad); color: #fff;
  display: grid; place-items: center; font-size: 16px; box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 35%, transparent);
}
.brand .bt { display: flex; align-items: baseline; gap: 7px; }
.brand em { font-style: normal; font-size: 11px; font-weight: 400; color: var(--muted); letter-spacing: .4px; }
.tabs { display: flex; gap: 4px; flex: 1 1 auto; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  border: 1px solid transparent; background: transparent; color: var(--text2);
  padding: 7px 13px; border-radius: 10px; cursor: pointer; white-space: nowrap; font-size: 13.5px;
  transition: background .16s, color .16s, box-shadow .16s;
}
.tabs button:hover { background: var(--card2); color: var(--text); }
.tabs button.on {
  background: var(--grad); color: #fff; font-weight: 600;
  box-shadow: 0 3px 12px color-mix(in srgb, var(--accent) 34%, transparent);
}
.tright { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.uchip {
  font-size: 13px; color: var(--text2); white-space: nowrap;
  background: var(--card2); border: 1px solid var(--line); padding: 3px 10px; border-radius: 20px;
}
.uchip b { color: var(--text); }
.iconbtn {
  border: 1px solid var(--line); background: var(--card); width: 34px; height: 34px;
  border-radius: 10px; cursor: pointer; line-height: 1; transition: background .15s, transform .1s;
}
.iconbtn:hover { background: var(--card2); }
.iconbtn:active { transform: scale(.95); }
.theme-fab {
  position: fixed; right: 14px; top: 14px; z-index: 60;
  box-shadow: var(--shadow); background: color-mix(in srgb, var(--card) 90%, transparent); backdrop-filter: blur(6px);
}

main { max-width: 1200px; margin: 0 auto; padding: 20px 16px 64px; }
main > * { animation: rise .28s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 20px 12px 34px; line-height: 2.1; }
.foot .police { display: inline-flex; align-items: center; gap: 3px; }
.foot .police img { width: 12px; height: 12px; }

/* ---------------- 卡片 / 栅格 ---------------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 17px; box-shadow: var(--shadow); margin-bottom: 16px;
}
.card > h3 { font-size: 15.5px; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.card > h3::before { content: ""; width: 4px; height: 15px; border-radius: 3px; background: var(--grad); }
.card > h3 .sub { font-size: 12.5px; font-weight: 400; color: var(--muted); }
.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.c3 { grid-template-columns: repeat(auto-fit, minmax(238px, 1fr)); }
.grid.c4 { grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.tight { gap: 6px; }
.spread { justify-content: space-between; }
.mut { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.mono { font-family: Consolas, "Courier New", monospace; }

/* 首页主视觉 */
.hero {
  background: var(--grad-hero); color: #fff; border-radius: 18px; padding: 22px 22px 20px;
  box-shadow: 0 14px 34px color-mix(in srgb, var(--accent) 30%, transparent);
  margin-bottom: 18px; position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -70px; top: -90px; width: 280px; height: 280px;
  border-radius: 50%; background: rgba(255, 255, 255, .13);
}
.hero::before {
  content: ""; position: absolute; right: 60px; bottom: -120px; width: 220px; height: 220px;
  border-radius: 50%; background: rgba(255, 255, 255, .09);
}
.hero h2 { font-size: 20px; margin: 0 0 6px; position: relative; }
.hero p { margin: 0 0 16px; opacity: .92; font-size: 13.5px; position: relative; max-width: 60ch; }
.hero .hact { display: flex; gap: 10px; flex-wrap: wrap; position: relative; }
.hero .btn.light {
  background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .34); color: #fff;
  backdrop-filter: blur(4px); font-weight: 600;
}
.hero .btn.light:hover { background: rgba(255, 255, 255, .3); }

/* 统计块 */
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 13px;
  transition: transform .14s, box-shadow .14s, border-color .14s;
}
.stat .ic {
  width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px; display: grid; place-items: center;
  font-size: 20px; background: var(--accent-soft); color: var(--accent2);
}
.stat .ic.g { background: var(--ok-soft); }
.stat .ic.o { background: var(--warn-soft); }
.stat .ic.p { background: color-mix(in srgb, #8b34c9 14%, var(--card)); }
.stat .k { font-size: 12.5px; color: var(--muted); }
.stat .v { font-size: 26px; font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 13px; font-weight: 400; color: var(--muted); }
.stat.link { cursor: pointer; }
.stat.link:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); transform: translateY(-2px); box-shadow: var(--shadow-lg); }

/* ---------------- 表单 ---------------- */
label.f { display: block; font-size: 12.5px; color: var(--text2); margin-bottom: 5px; font-weight: 600; }
input[type=text], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line2); border-radius: var(--radius-sm);
  background: var(--card); outline: none; transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line2)); }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent);
}
textarea { min-height: 110px; resize: vertical; font-family: inherit; }
.frow { display: flex; gap: 12px; flex-wrap: wrap; }
.frow > div { flex: 1 1 170px; min-width: 0; }
.chk { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; }
.chk input { width: 16px; height: 16px; accent-color: var(--accent); }
/* 带图标的输入行（登录页） */
.inp { position: relative; }
.inp .ico {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%); font-size: 14px; opacity: .7; pointer-events: none;
}
.inp input { padding-left: 34px; }
.field { margin-bottom: 12px; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line2); background: var(--card); color: var(--text);
  padding: 9px 15px; border-radius: var(--radius-sm); cursor: pointer; font-size: 13.5px;
  transition: background .15s, border-color .15s, transform .08s, box-shadow .15s, filter .15s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--card2); }
.btn:active { transform: translateY(1px); }
.btn.pri {
  background: var(--grad); border-color: transparent; color: #fff; font-weight: 600;
  box-shadow: 0 3px 12px color-mix(in srgb, var(--accent) 32%, transparent);
}
.btn.pri:hover { filter: brightness(1.07); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; font-weight: 600; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 38%, var(--line2)); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.ghost { border-color: transparent; color: var(--text2); }
.btn.ghost:hover { background: var(--card2); color: var(--text); }
.btn.sm { padding: 5px 11px; font-size: 12.5px; border-radius: 9px; }
.btn.lg { padding: 12px 22px; font-size: 15px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; box-shadow: none; filter: none; }
.btn.hero { padding: 15px 18px; font-size: 15.5px; border-radius: 14px; flex-direction: column; gap: 3px; align-items: flex-start; }
.btn.hero small { font-size: 11.5px; opacity: .85; font-weight: 400; }
.btn.loading::before {
  content: ""; width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- 表格 ---------------- */
table.tb { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tb th, table.tb td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
table.tb th {
  font-size: 12.5px; color: var(--muted); font-weight: 700; background: var(--card2);
  position: sticky; top: 0; z-index: 1; white-space: nowrap;
}
table.tb tbody tr:nth-child(even) td, table.tb tr:nth-child(even) td { background: color-mix(in srgb, var(--card2) 55%, transparent); }
table.tb tr:hover td { background: var(--accent-soft); }
table.tb td.num, table.tb th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbwrap { max-height: 60vh; overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }

/* 标签 / 徽章 */
.tag { display: inline-block; padding: 1px 9px; border-radius: 20px; font-size: 12px; background: var(--card2); color: var(--text2); border: 1px solid var(--line); }
.tag.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.tag.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.tag.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.tag.info { background: var(--accent-soft); color: var(--accent2); border-color: transparent; }
.pill { font-size: 12.5px; padding: 3px 11px; border-radius: 20px; background: var(--card2); border: 1px solid var(--line); }
.pill b { font-variant-numeric: tabular-nums; }

/* 进度条 */
.bar { height: 8px; background: var(--card2); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--grad); border-radius: 5px; transition: width .3s; }
.bar.ok > i { background: linear-gradient(90deg, #16a06a, #12894a); }
.bar.warn > i { background: linear-gradient(90deg, #e0a63c, #b7791f); }

/* 空状态 */
.empty { text-align: center; color: var(--muted); padding: 38px 12px; }
.empty .big { font-size: 40px; margin-bottom: 8px; }

/* ---------------- 弹窗 / 提示 ---------------- */
.modal {
  position: fixed; inset: 0; background: rgba(10, 15, 25, .5); z-index: 90;
  display: flex; align-items: center; justify-content: center; padding: 14px;
  animation: fade .16s ease both;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.mbox {
  background: var(--card); border-radius: 16px; box-shadow: var(--shadow-lg);
  width: min(680px, 100%); max-height: 92vh; overflow: auto; padding: 20px;
  animation: pop .2s cubic-bezier(.2, .9, .3, 1.3) both;
}
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }
.mbox.wide { width: min(1000px, 100%); }
.mbox .mtitle { font-size: 16.5px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.mbox .mfoot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.toast {
  position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%);
  background: #1d2735; color: #fff; padding: 11px 20px; border-radius: 12px;
  z-index: 200; box-shadow: var(--shadow-lg); max-width: 88vw; font-size: 13.5px;
  animation: up .22s ease both;
}
@keyframes up { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
.toast.err { background: #b3271e; }
.toast.ok { background: #0e7a42; }

/* ---------------- 登录页 ---------------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px 16px 40px;
  background:
    radial-gradient(1100px 520px at 12% -12%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 62%),
    radial-gradient(900px 520px at 112% 112%, color-mix(in srgb, #8b34c9 18%, transparent), transparent 62%),
    linear-gradient(180deg, var(--bg2), var(--bg));
}
.login-card { width: min(430px, 100%); }
.login-card .lt { text-align: center; margin-bottom: 18px; }
.login-card .logo-badge {
  width: 62px; height: 62px; border-radius: 19px; background: var(--grad); color: #fff;
  display: inline-grid; place-items: center; font-size: 31px; margin-bottom: 12px;
  box-shadow: 0 12px 28px color-mix(in srgb, var(--accent) 38%, transparent);
}
.login-card .lt h1 { font-size: 23px; margin: 0 0 4px; letter-spacing: .5px; }
.login-card .lt p { margin: 0; color: var(--muted); font-size: 12.8px; }
.login-box { padding: 20px; border-radius: 18px; }
.seg { display: flex; background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 16px; }
.seg button {
  flex: 1; border: 0; background: transparent; padding: 8px; border-radius: 9px; cursor: pointer;
  color: var(--text2); transition: background .15s, color .15s, box-shadow .15s; font-size: 13.5px;
}
.seg button.on { background: var(--card); color: var(--text); font-weight: 700; box-shadow: var(--shadow-sm); }
.errline {
  background: var(--bad-soft); color: var(--bad); border-radius: 10px; padding: 8px 12px;
  font-size: 13px; margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
}
.login-foot { text-align: center; color: var(--muted); font-size: 12.3px; margin-top: 16px; }

/* ---------------- 考试 / 班级 卡片 ---------------- */
.excard {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 15px; background: var(--card);
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 9px;
  transition: transform .14s, box-shadow .14s, border-color .14s;
}
.excard:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.excard h4 { margin: 0; font-size: 15px; }
.excard .meta { color: var(--muted); font-size: 12.5px; display: flex; gap: 10px; flex-wrap: wrap; }
.excard .ops { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------------- 题目/答案 编辑 ---------------- */
.qgrid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 6px;
  max-height: 46vh; overflow: auto; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--card2);
}
.qitem { display: flex; align-items: center; gap: 5px; background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 4px 7px; }
.qitem .qn { width: 32px; text-align: right; color: var(--muted); font-size: 12px; flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.qitem .opts { display: flex; gap: 3px; flex: 1; }
.qitem .opts b {
  flex: 1; text-align: center; border: 1px solid var(--line2); border-radius: 7px;
  font-weight: 500; font-size: 12.5px; cursor: pointer; padding: 2px 0; user-select: none;
  transition: background .12s, border-color .12s, color .12s, transform .08s;
}
.qitem .opts b:hover { border-color: var(--accent); background: var(--accent-soft); }
.qitem .opts b:active { transform: scale(.94); }
.qitem .opts b.on { background: var(--grad); border-color: transparent; color: #fff; font-weight: 700; box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 30%, transparent); }
.qitem.multi .opts b.on { background: linear-gradient(135deg, #0f8ea8, #0b7285); }
.qitem .tagm { font-size: 11px; color: var(--info); flex: 0 0 auto; }
.qitem.noans .qn { color: var(--bad); font-weight: 700; }

/* 知识点 / 分块工具条 */
.blockrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; align-items: end; }

/* ---------------- 答题卡预览 / 打印 ---------------- */
.paperbox { display: flex; flex-wrap: wrap; gap: 16px; }
.paperbox .pgsv {
  background: #fff; box-shadow: var(--shadow-lg); border: 1px solid var(--line);
  width: min(660px, 100%); border-radius: 8px; overflow: hidden;   /* 横向 A4（297×210） */
}
.paperbox .pgsv svg { display: block; width: 100%; height: auto; }
#printArea { display: none; }
@media print {
  body { background: #fff; }
  #login, #app, .modal, .toast, .theme-fab { display: none !important; }
  #printArea { display: block; }
  #printArea .page { page-break-after: always; break-after: page; }
  #printArea .page:last-child { page-break-after: auto; break-after: auto; }
  #printArea svg { display: block; width: 297mm; height: 210mm; }
  @page { size: A4 landscape; margin: 0; }
}

/* ---------------- 扫描页 ---------------- */
.scan-wrap { display: grid; grid-template-columns: minmax(300px, 1.15fr) minmax(320px, 1fr); gap: 14px; }
@media (max-width: 900px) { .scan-wrap { grid-template-columns: 1fr; } }
.cam-box { position: relative; background: #0d1219; border-radius: 14px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.cam-box video { width: 100%; display: block; max-height: 62vh; object-fit: contain; background: #0d1219; }
.cam-hint {
  position: absolute; left: 12px; top: 12px; background: rgba(6, 12, 20, .62); color: #fff;
  padding: 5px 12px; border-radius: 20px; font-size: 12.5px; max-width: 84%;
  backdrop-filter: blur(4px); border: 1px solid rgba(255, 255, 255, .12);
}
.cam-hint.ok { background: rgba(12, 120, 68, .88); border-color: transparent; }
.cam-hint.bad { background: rgba(170, 42, 32, .9); border-color: transparent; }
/* 四角取景框（比虚线框好看，也更像相机） */
.cam-guide { position: absolute; inset: 5.5%; pointer-events: none; }
.cam-guide i {
  position: absolute; width: 30px; height: 30px; border: 3px solid rgba(255, 255, 255, .75); border-radius: 4px;
}
.cam-guide i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; }
.cam-guide i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; }
.cam-guide i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; }
.cam-guide i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; }
.cam-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.cam-bar select { width: auto; min-width: 130px; }
.shotbox { position: relative; }
.shotbox canvas { width: 100%; display: block; border-radius: 12px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.rev-list { max-height: 40vh; overflow: auto; }
.qmini { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 4px; }
.qmini b {
  display: block; text-align: center; border: 1px solid var(--line2); border-radius: 8px;
  font-size: 12px; font-weight: 500; padding: 3px 0; cursor: pointer; user-select: none; background: var(--card);
  transition: transform .08s, filter .12s;
}
.qmini b:hover { filter: brightness(.97); }
.qmini b:active { transform: scale(.94); }
.qmini b.ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.qmini b.bad { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.qmini b.blank { color: var(--muted); background: var(--card2); }
.qmini b.part { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.qmini b.multi { background: var(--accent-soft); border-color: transparent; color: var(--accent2); }

/* 分析：分布图 */
.chart { width: 100%; height: 200px; display: block; }
.optbar { display: flex; height: 15px; border-radius: 5px; overflow: hidden; min-width: 90px; border: 1px solid var(--line); background: var(--card2); }
.optbar i { display: block; height: 100%; }
.optbar i.on { background: linear-gradient(180deg, #1aa36e, #12894a); }
.optbar i.off { background: color-mix(in srgb, var(--bad) 52%, var(--card2)); }
.disc { font-variant-numeric: tabular-nums; }

/* 帮助页 */
.help h3 { margin-top: 22px; font-size: 15.5px; display: flex; align-items: center; gap: 8px; }
.help h3::before { content: ""; width: 4px; height: 15px; border-radius: 3px; background: var(--grad); }
.help ol, .help ul { padding-left: 20px; }
.help li { margin: 5px 0; }
.kbd { border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; font-size: 12px; background: var(--card2); }
.note { background: var(--accent-soft); border-left: 3px solid var(--accent); padding: 9px 13px; border-radius: 10px; font-size: 13px; margin: 10px 0; }
.note.warn { background: var(--warn-soft); border-color: var(--warn); }

/* 小屏适配 */
@media (max-width: 720px) {
  main { padding: 13px 10px 54px; }
  .topbar { padding: 8px 10px; gap: 6px; }
  .brand { font-size: 15px; }
  .brand em { display: none; }
  .brand .logo { width: 27px; height: 27px; font-size: 14px; }
  .card { padding: 13px; border-radius: 12px; }
  .stat { padding: 12px 13px; gap: 10px; }
  .stat .ic { width: 36px; height: 36px; flex-basis: 36px; font-size: 17px; }
  .stat .v { font-size: 21px; }
  .mbox { padding: 15px; border-radius: 14px; }
  .btn { padding: 8px 12px; }
  .hero { padding: 18px 16px; border-radius: 16px; }
  .hero h2 { font-size: 17.5px; }
  .hero .hact .btn { flex: 1 1 calc(50% - 5px); }
  .qgrid { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }
}
@media (max-width: 400px) {
  .qgrid { grid-template-columns: 1fr 1fr; }
  .qmini { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); }
  .hero .hact .btn { flex: 1 1 100%; }
}
