/* ===================== 设计变量 ===================== */
:root {
  --bg: #f5f6fa;
  --bg-soft: #eef0f7;
  --card: #ffffff;
  --text: #14161c;
  --text-2: #3f4450;
  --muted: #7b8291;
  --line: #e6e8ef;
  --line-2: #f0f1f6;
  --brand: #4f46e5;
  --brand-2: #6366f1;
  --brand-soft: #eef0ff;
  --ok: #0f9d58;
  --ok-soft: #e7f6ee;
  --bad: #dc2626;
  --bad-soft: #fdeaea;
  --warn: #d97706;
  --warn-soft: #fef4e6;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px -12px rgba(16, 24, 40, .12);
  --shadow-lg: 0 12px 40px -12px rgba(16, 24, 40, .22);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro SC", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { overscroll-behavior-y: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }

.app { min-height: 100vh; display: flex; flex-direction: column; }

/* ===================== 顶栏 ===================== */
.appbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo {
  width: 34px; height: 34px; flex: 0 0 34px;
  border-radius: 11px;
  background: linear-gradient(140deg, #6366f1, #4f46e5 60%, #4338ca);
  color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 6px 14px -6px rgba(79, 70, 229, .8);
}
.logo svg { width: 20px; height: 20px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong { font-size: 15.5px; letter-spacing: .2px; }
.brand-text span { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.topnav { display: none; gap: 4px; margin-left: auto; }
.nav-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 11px;
  background: transparent; border: 0; cursor: pointer;
  color: var(--text-2); font-weight: 600; font-size: 14px;
  transition: background .15s, color .15s;
}
.nav-btn svg { width: 18px; height: 18px; }
.nav-btn:hover { background: var(--line-2); }
.nav-btn.active { background: var(--brand-soft); color: var(--brand); }

.topbar-side { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--ok);
  background: var(--ok-soft); padding: 5px 10px; border-radius: 999px;
  white-space: nowrap;
}
.status-pill.off { color: var(--bad); background: var(--bad-soft); }
.status-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ===================== 主体 ===================== */
.main {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 16px calc(88px + var(--safe-b));
}
.view { animation: fade .22s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin: 4px 0 16px;
}
.page-head h1 { font-size: 22px; letter-spacing: -.3px; }
.page-head p { margin-top: 4px; font-size: 13.5px; }
.head-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ===================== 卡片 ===================== */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-bottom: 12px;
}
.card-head h2 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.card-head h3, .card h3 { font-size: 14.5px; }
.pill {
  font-size: 11.5px; font-weight: 700; color: var(--brand);
  background: var(--brand-soft); border-radius: 999px; padding: 2px 9px;
}

/* ===================== Hero ===================== */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  padding: 22px 18px;
  margin-bottom: 16px;
  background:
    radial-gradient(900px 300px at 100% -20%, rgba(99, 102, 241, .18), transparent 60%),
    linear-gradient(160deg, #ffffff 0%, #f7f7ff 100%);
  border: 1px solid #e3e4f5;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 18px;
}
.hero h1 { font-size: 24px; letter-spacing: -.6px; line-height: 1.25; }
.hero-copy > p { margin-top: 8px; color: var(--text-2); font-size: 14px; max-width: 44em; }
.hero-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.hero-tip { font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.hero-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  background: rgba(255, 255, 255, .7);
  border: 1px solid var(--line);
  border-radius: 14px; padding: 12px;
}
.hero-stats > div { display: flex; flex-direction: column; align-items: center; }
.hero-stats b { font-size: 19px; letter-spacing: -.4px; }
.hero-stats span { font-size: 11.5px; color: var(--muted); }

/* ===================== 按钮 ===================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-weight: 600; font-size: 14.5px;
  cursor: pointer;
  transition: transform .06s, box-shadow .15s, background .15s, border-color .15s;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn:hover { border-color: #d6d9e6; background: #fcfcfe; }
.btn:active { transform: scale(.985); }
.btn.primary {
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
  border-color: transparent; color: #fff;
  box-shadow: 0 8px 18px -10px rgba(79, 70, 229, .9);
}
.btn.primary:hover { filter: brightness(1.04); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); border-color: #f3c9c9; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.lg { min-height: 48px; padding: 0 20px; font-size: 15px; border-radius: 14px; }
.btn.big { min-height: 52px; flex: 1; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.busy { position: relative; color: transparent !important; }
.btn.busy::after {
  content: ""; position: absolute; width: 18px; height: 18px;
  border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff;
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.link {
  background: none; border: 0; padding: 4px 2px; cursor: pointer;
  color: var(--brand); font-weight: 600; font-size: 13px;
}
.link:hover { text-decoration: underline; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 10px; border: 0; background: var(--line-2);
  color: var(--text-2); display: grid; place-items: center; cursor: pointer;
}
.icon-btn svg { width: 17px; height: 17px; }
.file-btn { cursor: pointer; }

/* ===================== 表单 ===================== */
.mini-field { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.mini-field select, .mini-field input, .mini-select {
  border: 1px solid var(--line); border-radius: 9px; padding: 6px 8px;
  background: #fff; font-size: 13px; color: var(--text); min-height: 34px;
}
.mini-field input { width: 64px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; color: var(--text-2); font-weight: 600; }
.field input, .field select, .field textarea {
  border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px;
  background: #fff; font-size: 14.5px; width: 100%;
}
.field textarea { resize: vertical; line-height: 1.55; }
.field input:focus, .field textarea:focus, .field select:focus,
.mini-field select:focus, .mini-field input:focus {
  outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(99, 102, 241, .14);
}
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ===================== 布局 ===================== */
.grid-main { display: grid; grid-template-columns: 1fr; gap: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 16px; }
.side { display: flex; flex-direction: column; }

/* ===================== 密钥 ===================== */
.key-row { display: flex; gap: 8px; align-items: stretch; }
.key-row input { flex: 1; min-width: 0; }
.key-row .btn { flex: 0 0 auto; min-height: 44px; }
.banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap;
  background: var(--warn-soft);
  border: 1px solid #f6dfb8;
  color: #8a5a00;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 13.5px;
  font-weight: 600;
}
.banner .link { color: #8a5a00; text-decoration: underline; }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.msg-err { color: var(--bad); }
.msg-ok { color: var(--ok); }

/* ===================== 上传区 ===================== */
.dropzone {
  border: 1.6px dashed #d3d6e4;
  border-radius: 16px;
  padding: 22px 14px;
  text-align: center;
  background: #fbfbfe;
  transition: border-color .15s, background .15s;
  margin-bottom: 14px;
  cursor: pointer;
}
.dropzone.hover { border-color: var(--brand); background: var(--brand-soft); }
.dz-icon { width: 26px; height: 26px; color: var(--brand); margin-bottom: 6px; }
.dz-inner p { font-size: 14px; }
.dz-inner .muted { font-size: 12.5px; margin-top: 2px; }
.dz-touch { display: none; }
@media (hover: none) {
  .dz-touch { display: block; }
  .dz-desktop, .hero-tip { display: none; }
}

.queue { display: flex; flex-direction: column; gap: 10px; }
.q-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px; border: 1px solid var(--line); border-radius: 14px;
  background: #fff;
}
.q-thumb {
  width: 60px; height: 60px; flex: 0 0 60px; border-radius: 10px;
  object-fit: cover; background: var(--bg-soft); border: 1px solid var(--line);
}
.q-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.q-name { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-item select {
  border: 1px solid var(--line); border-radius: 9px; padding: 6px 8px;
  font-size: 13px; max-width: 100%; min-height: 34px; background: #fff;
}
.q-status { font-size: 12px; font-weight: 600; white-space: nowrap; }
.q-status.idle { color: var(--muted); }
.q-status.grading { color: var(--brand); }
.q-status.done { color: var(--ok); }
.q-status.error { color: var(--bad); }
.q-del { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px; }
.q-del svg { width: 18px; height: 18px; }

.actions-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-2);
}
.actions-bar .muted { font-size: 12.5px; }

.empty {
  text-align: center; color: var(--muted); font-size: 13.5px;
  padding: 22px 12px; border: 1px dashed var(--line); border-radius: 14px; background: #fcfcfe;
}
.empty.big { padding: 56px 20px; font-size: 14.5px; }

/* ===================== 班级卡 ===================== */
.class-card .class-body { display: flex; flex-direction: column; gap: 10px; }
.class-select {
  width: 100%; border: 1px solid var(--line); border-radius: 11px;
  padding: 10px; font-size: 14px; background: #fff; min-height: 42px;
}
.roster-mini { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 12px; padding: 4px 9px; border-radius: 999px;
  background: var(--bg-soft); color: var(--text-2); font-weight: 600;
}
.chip.more { background: var(--brand-soft); color: var(--brand); }
.tips ul { margin: 8px 0 0; padding-left: 18px; color: var(--text-2); font-size: 13.5px; }
.tips li { margin-bottom: 4px; }

/* ===================== 结果 ===================== */
.results { display: flex; flex-direction: column; gap: 12px; }
#results-card { scroll-margin-top: 76px; }
.rc {
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #fff;
}
.rc-head { display: flex; align-items: center; gap: 12px; padding: 12px; cursor: pointer; }
.ring { width: 54px; height: 54px; flex: 0 0 54px; position: relative; }
.ring svg { transform: rotate(-90deg); width: 54px; height: 54px; }
.ring b {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 15px; letter-spacing: -.3px;
}
.rc-meta { flex: 1; min-width: 0; }
.rc-meta h3 { font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rc-meta p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.badge { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.badge.ok { color: var(--ok); background: var(--ok-soft); }
.badge.bad { color: var(--bad); background: var(--bad-soft); }
.badge.mid { color: var(--warn); background: var(--warn-soft); }
.chev { transition: transform .2s; color: var(--muted); }
.rc.open .chev { transform: rotate(180deg); }
.rc-body { display: none; padding: 0 12px 14px; border-top: 1px solid var(--line-2); }
.rc.open .rc-body { display: block; }
.rc-summary { font-size: 13.5px; color: var(--text-2); padding: 12px 0; }
.qrow {
  display: grid; grid-template-columns: 26px 1fr; gap: 8px;
  padding: 9px 0; border-bottom: 1px dashed var(--line);
  font-size: 13px;
}
.qrow:last-child { border-bottom: 0; }
.qno { font-weight: 700; color: var(--muted); font-size: 12.5px; padding-top: 1px; }
.qbody { min-width: 0; }
.qans { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 3px; color: var(--text-2); font-size: 12.5px; }
.qans s { color: var(--bad); text-decoration-thickness: 1px; }
.qans em { font-style: normal; color: var(--ok); font-weight: 600; }
.qtags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tag {
  font-size: 11.5px; padding: 2px 8px; border-radius: 6px;
  background: var(--bg-soft); color: var(--text-2);
}
.tag.kp { background: var(--brand-soft); color: var(--brand); }
.rc-foot { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; }
.foot-block { font-size: 13px; }
.foot-block b { font-size: 12.5px; color: var(--muted); font-weight: 700; display: block; margin-bottom: 3px; }
.foot-block ul { margin: 0; padding-left: 17px; color: var(--text-2); }
.rc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* ===================== 名单 ===================== */
.roster-list { display: flex; flex-direction: column; gap: 6px; }
.r-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 11px; background: #fcfcfe; border: 1px solid var(--line-2);
}
.r-no {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 9px;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: var(--brand-soft); color: var(--brand);
}
.r-name { flex: 1; font-size: 14px; font-weight: 600; }
.r-item .icon-btn { width: 30px; height: 30px; }

/* ===================== 报告 ===================== */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
.kpi {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 2px;
}
.kpi span { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi b { font-size: 24px; letter-spacing: -.6px; }

.chart { min-height: 150px; }
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut { width: 150px; height: 150px; flex: 0 0 150px; }
.donut-legend { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.donut-legend .lg { display: flex; align-items: center; gap: 8px; }
.donut-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.hbars { display: flex; flex-direction: column; gap: 11px; }
.hb { font-size: 13px; }
.hb-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.hb-top span { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-top b { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.hb-track { height: 8px; border-radius: 99px; background: var(--bg-soft); overflow: hidden; }
.hb-fill { height: 100%; border-radius: 99px; transition: width .5s ease; }

.wrong-list { display: flex; flex-direction: column; gap: 10px; }
.wrong-item {
  padding: 10px 12px; border-radius: 12px; background: #fdfafa; border: 1px solid #f4e6e6;
  font-size: 13px;
}
.wrong-item .w-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.wrong-item b { color: var(--text); }
.wrong-item .w-body { color: var(--text-2); margin-top: 4px; font-size: 12.5px; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 0; }
.table th, .table td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.table th { font-size: 12px; color: var(--muted); font-weight: 700; background: #fcfcfe; }
.table td.num { font-variant-numeric: tabular-nums; }
@media (max-width: 620px) {
  .table th:nth-child(5), .table td:nth-child(5),
  .table th:nth-child(6), .table td:nth-child(6) { display: none; }
  .table th, .table td { padding: 8px 6px; font-size: 12.5px; }
  .table th:nth-child(2), .table td:nth-child(2) { max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
  .head-tools .btn { min-height: 38px; font-size: 13.5px; padding: 0 12px; }
  .page-head .head-tools { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .page-head .head-tools > * { width: 100%; min-width: 0; }
  .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

.kv { display: flex; flex-direction: column; gap: 9px; margin-bottom: 10px; }
.kv > div { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; }
.kv span { color: var(--muted); flex: 0 0 auto; }
.kv b { font-weight: 600; text-align: right; word-break: break-all; }

/* ===================== 底部标签栏 ===================== */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; justify-content: space-around; align-items: stretch;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-top: 1px solid var(--line);
  padding: 6px 6px calc(6px + var(--safe-b));
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: 0; padding: 7px 0; border-radius: 12px;
  color: var(--muted); font-size: 11px; font-weight: 600; cursor: pointer;
}
.tab svg { width: 21px; height: 21px; }
.tab.active { color: var(--brand); background: var(--brand-soft); }

/* ===================== 拍照弹层 ===================== */
.modal {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(12, 14, 22, .72);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 14px;
}
.modal-card {
  width: 100%; max-width: 560px; background: #fff; border-radius: 20px;
  padding: 14px; box-shadow: var(--shadow-lg);
  max-height: 92vh; overflow: auto;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.modal-head h3 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.cam-stage {
  position: relative; background: #0b0d14; border-radius: 14px; overflow: hidden;
  aspect-ratio: 3 / 4; max-height: 56vh; display: grid; place-items: center;
}
#cam-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-fallback { color: #fff; text-align: center; padding: 20px; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.modal-actions { display: flex; gap: 10px; margin-top: 12px; }
.hint { font-size: 12px; color: var(--muted); text-align: center; margin-top: 8px; }

/* ===================== Toast ===================== */
.toast {
  position: fixed; left: 50%; bottom: calc(84px + var(--safe-b)); transform: translateX(-50%);
  background: #14161c; color: #fff; padding: 10px 16px; border-radius: 12px;
  font-size: 13.5px; z-index: 120; box-shadow: var(--shadow-lg); max-width: 86vw;
  animation: pop .2s ease;
}
@keyframes pop { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ===================== 桌面端 ===================== */
@media (min-width: 900px) {
  .appbar { padding: 12px 24px; }
  .topnav { display: flex; margin-left: 8px; margin-right: auto; }
  .tabbar { display: none; }
  .main { padding: 24px 24px 40px; }
  .hero { flex-direction: row; align-items: center; padding: 26px; }
  .hero-copy { flex: 1; }
  .hero h1 { font-size: 27px; }
  .hero-stats { grid-template-columns: 1fr; gap: 12px; padding: 16px 20px; min-width: 150px; }
  .hero-stats > div { flex-direction: row; align-items: baseline; gap: 8px; }
  .hero-stats b { font-size: 20px; }
  .grid-main { grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
  .side { position: sticky; top: 84px; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .kpis { grid-template-columns: repeat(5, 1fr); }
  .kpi b { font-size: 26px; }
  .wrong-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .roster-list { max-height: 560px; overflow: auto; }
  .toast { bottom: 28px; }
  .page-head h1 { font-size: 25px; }
}

/* ===================== 打印 ===================== */
@media print {
  .appbar, .tabbar, .hero, #view-grade, #view-roster, #view-settings, .head-tools { display: none !important; }
  body { background: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .main { max-width: none; padding: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  #view-report { display: block !important; }
  .kpis { grid-template-columns: repeat(5, 1fr); }
  .table-wrap { overflow: visible; }
  @page { margin: 14mm; }
}
