/* admin.css — 管理端 SPA（侧栏 + 顶栏 + 看板 / 批次） */
:root {
  --teal: #0f766e;
  --teal-d: #115e59;
  --teal-600: #0d9488;
  --teal-l: #ccfbf1;
  --teal-50: #f0fdfa;
  --amber: #f59e0b;
  --amber-d: #b45309;
  --bg: #f6f7f9;
  --card: #ffffff;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #5b6472;
  --line: #e5e9ef;
  --line-2: #d7dee7;
  --danger: #b91c1c;
  --danger-l: #fef2f2;
  --radius: 12px;
  --side-w: 240px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 2px 8px rgba(15, 23, 42, .06);
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  overflow-x: hidden;
}

body.no-scroll { overflow: hidden; }

[hidden] { display: none !important; }

button, input, textarea, select { font-family: inherit; }

a { color: var(--teal); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  padding: 10px 14px;
  background: #fff;
  color: var(--teal-d);
  border-radius: 0 0 8px 0;
  font-size: 13px;
}
.skip:focus { left: 0; }

:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

.ui-ic { width: 20px; height: 20px; display: block; flex: 0 0 auto; }

.input {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1.5px solid var(--line-2);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .12);
}
.input:disabled { background: #f8fafc; color: var(--muted); }

.fld { margin-bottom: 14px; }
.fld > label {
  display: block;
  margin-bottom: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
}
.fld-err { margin: 4px 0 0; font-size: 11.5px; color: var(--danger); }
.hint { margin: 0 0 14px; font-size: 11.5px; color: var(--muted); line-height: 1.6; }

.form-err {
  margin: 0 0 14px;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--danger-l);
  border: 1px solid #fecaca;
  color: var(--danger);
  font-size: 12.5px;
  line-height: 1.55;
}

/* ---------------------------------------------------------------- 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: #fff;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background .12s ease, border-color .12s ease, color .12s ease, transform .12s ease;
}
.btn:active { transform: scale(.985); }
.btn .ui-ic, .btn svg { width: 16px; height: 16px; flex: 0 0 auto; }
.btn.primary {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
  box-shadow: 0 3px 10px rgba(15, 118, 110, .22);
}
.btn.primary:hover { background: var(--teal-d); border-color: var(--teal-d); }
.btn.ghost { border-color: var(--line-2); background: #fff; color: var(--ink-2); }
.btn.ghost:hover { border-color: #9fd8cf; color: var(--teal-d); background: #f8fdfc; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { background: #991b1b; }
.btn.block { width: 100%; }
.btn.sm { min-height: 44px; padding: 0 12px; font-size: 12.5px; }
.btn.xs { min-height: 44px; padding: 0 9px; font-size: 12px; border-radius: 8px; }
.btn:disabled, .btn[disabled] {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn svg { display: block; }

/* ---------------------------------------------------------------- 登录 / 改密 */
.auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 18px;
  background:
    radial-gradient(1100px 520px at 8% -10%, #d9f5ef 0%, rgba(217, 245, 239, 0) 62%),
    radial-gradient(900px 480px at 102% 104%, #e6efff 0%, rgba(230, 239, 255, 0) 58%),
    var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 404px;
  background: #fff;
  border: 1px solid rgba(226, 232, 240, .9);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .12), 0 2px 8px rgba(15, 23, 42, .04);
  padding: 32px 30px 26px;
}
.auth-logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--teal), #0b5f59);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  box-shadow: 0 6px 16px rgba(15, 118, 110, .3);
}
.auth-logo svg { width: 28px; height: 28px; }
.auth-title {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .2px;
  color: #0b2b28;
  line-height: 1.4;
}
.auth-sub {
  margin: 0 0 22px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
}
.auth-foot {
  margin: 20px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: #64748b;
  text-align: center;
  line-height: 1.5;
}
.linkbtn {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 6px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.linkbtn:hover { color: var(--teal-d); }

/* ---------------------------------------------------------------- 框架 */
.shell { min-height: 100vh; }

.side {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--side-w);
  z-index: 60;
  display: flex;
  flex-direction: column;
  padding: 18px 14px 16px;
  color: #e8fffb;
  background:
    radial-gradient(360px 220px at 0% 0%, rgba(20, 184, 166, .22), rgba(20, 184, 166, 0) 70%),
    linear-gradient(180deg, #0f766e 0%, #0b4f4a 100%);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, .06);
}
.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .14);
  margin-bottom: 14px;
}
.brand-mark {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-txt { display: flex; flex-direction: column; min-width: 0; }
.brand-txt b { font-size: 14px; font-weight: 700; letter-spacing: .3px; white-space: nowrap; }
.brand-txt small { font-size: 10px; letter-spacing: 1px; color: #d1faf3; margin-top: 1px; }

.side-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #c6ece6;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.nav-item svg { width: 19px; height: 19px; flex: 0 0 auto; opacity: .9; }
.nav-item:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.nav-item.is-active {
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: 0; top: 9px; bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--amber);
}
.side-foot {
  margin-top: auto;
  padding: 14px 8px 0;
  border-top: 1px solid rgba(255, 255, 255, .14);
  font-size: 11px;
  color: #9fd4cd;
  line-height: 1.6;
}
.side-foot p { margin: 0 0 6px; }
.side-foot .ver { font-size: 10px; letter-spacing: 1px; color: #9fd4cd; }

.main-wrap {
  margin-left: var(--side-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 10px 24px;
  background: rgba(255, 255, 255, .96);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.page-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: .2px;
  white-space: nowrap;
}
.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.pick { position: relative; display: flex; align-items: center; gap: 8px; }
.pick label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.pick select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 44px;
  max-width: 260px;
  padding: 0 30px 0 11px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: #fff;
  color: var(--ink-2);
  font-size: 13px;
  cursor: pointer;
  text-overflow: ellipsis;
  outline: none;
}
.pick select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15, 118, 110, .12); }
.pick::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid #64748b;
  border-bottom: 1.5px solid #64748b;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.who { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); }
.who .who-name { font-weight: 600; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--teal-50);
  border: 1px solid #d5f2ec;
  color: var(--teal-d);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.view {
  flex: 1;
  width: 100%;
  max-width: 1440px;
  padding: 22px 24px 44px;
  outline: none;
}

/* ---------------------------------------------------------------- 通用卡片 */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.card-title { margin: 0; font-size: 15.5px; font-weight: 700; color: var(--ink); letter-spacing: .2px; }
.card-sub { margin: 3px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.card-head-r { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.view-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.vh-title {
  margin: 0 0 6px;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: .2px;
  color: #0b2b28;
  line-height: 1.35;
  word-break: break-word;
}
.vh-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.vh-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid transparent;
  white-space: nowrap;
}
.st-live { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.st-closed { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.st-draft { background: #fffbeb; color: var(--amber-d); border-color: #fde68a; }
.st-scheduled { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }

.grade {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  border: 1px solid transparent;
  white-space: nowrap;
}
.g-excellent { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.g-good { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.g-fair { background: #fffbeb; color: var(--amber-d); border-color: #fde68a; }
.g-poor { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.g-bad { background: #fef2f2; color: var(--danger); border-color: #fecaca; }

.mini-grade { font-size: 11px; font-weight: 700; margin-left: 4px; }

.chip-soft {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border-radius: 5px;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

/* ---------------------------------------------------------------- 图表（SVG / 堆叠条） */
.ring { display: block; overflow: visible; }
.ring-track { stroke: #eef2f6; }
.ring-arc { transition: stroke-dashoffset .9s cubic-bezier(.22, .8, .3, 1); }
.ring-num, .ring-cap { font-family: inherit; }

.bar-svg { display: block; width: 100%; height: 10px; }
.bar-track { fill: #eef2f6; }

.stack {
  display: flex;
  width: 100%;
  height: 14px;
  border-radius: 5px;
  overflow: hidden;
  background: #eef2f6;
}
.stack-seg { height: 100%; min-width: 0; }
.stack-seg.s5 { background: #15803d; }
.stack-seg.s4 { background: #86efac; }
.stack-seg.s3 { background: #facc15; }
.stack-seg.s2 { background: #fb923c; }
.stack-seg.s1 { background: #dc2626; }
.stack-empty { border: 1px dashed var(--line-2); background: #f8fafc; }

/* ---------------------------------------------------------------- 总览 */
.overview {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}
.score-side {
  flex: 0 0 auto;
  width: 186px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.ov-label { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.ov-raw { font-size: 10.5px; color: #64748b; }
.stat-grid {
  flex: 1 1 380px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.stat {
  background: #f8fafc;
  border: 1px solid #eef2f6;
  border-radius: 10px;
  padding: 12px 14px;
  min-width: 0;
}
.stat-l { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.stat-l svg { width: 13px; height: 13px; opacity: .7; }
.stat-v {
  margin-top: 4px;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}
.stat-v.sm { font-size: 14.5px; font-weight: 600; }
.stat-u { font-size: 11px; color: var(--muted); font-weight: 500; margin-left: 3px; }
.stat-sub { font-size: 10.5px; color: #64748b; margin-top: 2px; }

/* ---------------------------------------------------------------- 维度 */
.dim-list { display: flex; flex-direction: column; gap: 8px; }
.dim-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.dim-row {
  width: 100%;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 170px;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 10px 14px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .12s ease;
}
.dim-row:hover { background: #fafcfb; }
.dim-row:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }
.dim-main { display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; }
.dim-name { font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.dim-cnt { font-size: 11px; color: var(--muted); }
.dim-rank {
  font-size: 10px;
  font-weight: 700;
  padding: 0 5px;
  border-radius: 4px;
  line-height: 1.7;
}
.dim-rank.min { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.dim-rank.max { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.dim-bar { min-width: 0; }
.dim-bar .bar-svg { height: 9px; }
.dim-val { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.dim-score { font-size: 16px; font-weight: 700; color: var(--teal-d); font-variant-numeric: tabular-nums; }
.dim-diff {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.dim-diff.up { background: #ecfdf5; color: #047857; }
.dim-diff.down { background: #fef2f2; color: var(--danger); }
.dim-diff.flat { background: #f1f5f9; color: var(--muted); }
.dim-chev {
  width: 16px; height: 16px;
  flex: 0 0 auto;
  color: #64748b;
  transition: transform .15s ease;
}
.dim-row[aria-expanded="true"] .dim-chev { transform: rotate(180deg); }
.dim-detail {
  border-top: 1px dashed var(--line-2);
  background: #fbfcfd;
  padding: 10px 14px 12px;
}
.dim-q {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) 78px 86px;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px dashed #eef2f6;
  font-size: 12px;
}
.dim-q:last-child { border-bottom: 0; }
.dim-q-n { color: var(--muted); font-weight: 600; white-space: nowrap; }
.dim-q-t { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dim-q-m { color: var(--ink); font-weight: 600; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dim-q-l { color: var(--muted); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dim-q-l.hot { color: var(--danger); font-weight: 700; }
.dim-note { margin: 4px 0 8px; font-size: 11px; color: var(--muted); }

/* ---------------------------------------------------------------- 逐题 */
.qgrid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.qcard {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 13px 14px 12px;
  background: #fff;
  min-width: 0;
}
.qc-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.qno {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--teal-50);
  border: 1px solid #d5f2ec;
  color: var(--teal-d);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.chip-dim {
  display: inline-flex;
  padding: 1px 7px;
  border-radius: 5px;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 10.5px;
  white-space: nowrap;
}
.low-badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px;
  border-radius: 5px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--danger);
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}
.qc-title {
  margin: 0 0 9px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink-2);
  word-break: break-word;
}
.qc-bar { margin: 2px 0 8px; }
.qc-bar .stack { height: 13px; }
.qc-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11.5px; color: var(--muted); }
.qc-meta b { color: var(--ink-2); font-weight: 700; font-variant-numeric: tabular-nums; }
.qc-meta .hot { color: var(--danger); }
.qc-legend { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 7px; font-size: 10px; color: #64748b; }
.qc-lg { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.dot { width: 7px; height: 7px; border-radius: 2px; display: inline-block; }
.d5 { background: #15803d; }
.d4 { background: #86efac; }
.d3 { background: #facc15; }
.d2 { background: #fb923c; }
.d1 { background: #dc2626; }

/* ---------------------------------------------------------------- 非计分题 */
.ns-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.ns-block {
  border: 1px solid #eef2f6;
  background: #f8fafc;
  border-radius: 10px;
  padding: 12px 14px;
  min-width: 0;
}
.ns-title { margin: 0; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.ns-sub { margin: 2px 0 8px; font-size: 10.5px; color: var(--muted); }
.ns-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 82px;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  font-size: 11.5px;
}
.ns-label { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ns-bar .bar-svg { height: 7px; }
.ns-val { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ns-empty { margin: 6px 0 0; font-size: 11.5px; color: #64748b; }

/* ---------------------------------------------------------------- 意见 */
.op-grid {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}
.op-grid > .card { margin-bottom: 0; }
.imp-list { display: flex; flex-direction: column; gap: 9px; }
.imp-row { min-width: 0; }
.imp-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 12px; }
.imp-label { color: var(--ink-2); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-val { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 11px; }
.imp-bar { margin: 3px 0 0; }
.imp-bar .bar-svg { height: 8px; }
.imp-empty { padding: 22px 0; text-align: center; font-size: 12px; color: #64748b; }
.texts-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.txt-count { font-size: 11.5px; color: var(--muted); }
.switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
}
.switch input {
  width: 17px;
  height: 17px;
  accent-color: var(--teal);
  margin: 0;
  cursor: pointer;
}
.texts-note { margin: 0 0 4px; font-size: 10.5px; color: #64748b; }
.txt-list { display: flex; flex-direction: column; }
.txt-item { padding: 10px 0; border-top: 1px dashed var(--line-2); }
.txt-item:first-child { border-top: 0; }
.txt-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 10.5px; color: #64748b; }
.txt-no { font-weight: 700; color: var(--teal-d); }
.txt-score {
  display: inline-flex;
  padding: 0 6px;
  border-radius: 4px;
  background: #f1f5f9;
  color: var(--ink-2);
  font-weight: 600;
}
.txt-score.low { background: #fef2f2; color: var(--danger); }
.txt-body {
  margin: 4px 0 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-2);
  white-space: pre-wrap;
  word-break: break-word;
}
.txt-empty { padding: 24px 0; text-align: center; font-size: 12px; color: #64748b; }
.txt-more { width: 100%; margin-top: 10px; }

/* ---------------------------------------------------------------- 分组表 */
.groups-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.groups-grid > .card { margin-bottom: 0; }
.tbl-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: #f8fafc;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.tbl td {
  padding: 8px 10px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--ink-2);
  vertical-align: middle;
}
.tbl tbody tr:nth-child(even) { background: #fafbfc; }
.tbl tbody tr:hover { background: #f8fdfc; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .strong { font-weight: 700; color: var(--ink); }
.tag-warn {
  display: inline-flex;
  margin-left: 5px;
  padding: 0 5px;
  border-radius: 4px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: var(--amber-d);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.table-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.empty-cell { padding: 26px 10px; text-align: center; color: #64748b; font-size: 12px; }

/* ---------------------------------------------------------------- 批次表单 */
.form-card { display: block; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
}
.form-grid .span2 { grid-column: 1 / -1; }
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
}
.check input { width: 17px; height: 17px; accent-color: var(--teal); margin: 0; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.form-note { margin: 0 0 10px; font-size: 11.5px; color: var(--muted); line-height: 1.6; }

.form-card .fld > label { font-size: 12px; }

/* ---------------------------------------------------------------- 二维码弹层 */
.qr-box {
  width: 240px;
  height: 240px;
  margin: 2px auto 12px;
  border: 1px dashed var(--line-2);
  border-radius: 12px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}
.qr-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.qr-skel { font-size: 12px; color: var(--muted); text-align: center; padding: 0 12px; line-height: 1.6; }
.qr-tip { margin: 0 0 14px; text-align: center; font-size: 12px; color: var(--muted); }
.link-row { display: flex; gap: 8px; margin-bottom: 12px; }
.link-input { flex: 1 1 auto; min-width: 0; font-size: 12px; height: 42px; color: var(--ink-2); background: #f8fafc; }
.qr-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.qr-actions .btn { flex: 1 1 96px; }
.qr-note { margin: 10px 0 0; text-align: center; font-size: 11px; color: #64748b; line-height: 1.6; }

/* ---------------------------------------------------------------- 空态 / 加载 */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 42px 20px;
}
.empty-ic {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: linear-gradient(180deg, #f0fdfa, #e7f7f4);
  color: #14b8a6;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.empty-svg { width: 40px; height: 40px; stroke-width: 1.5; }
.empty-t { margin: 0 0 4px; font-size: 15px; font-weight: 700; color: var(--ink-2); }
.empty-d { margin: 0; font-size: 12.5px; color: var(--muted); max-width: 380px; line-height: 1.7; }
.empty-btn { margin-top: 14px; }

.loading-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 56px 20px;
  color: var(--muted);
}
.loading-t { margin: 0; font-size: 12.5px; }
.spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 2.5px solid #d8e3e1;
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  vertical-align: middle;
}
.spinner.lg { width: 30px; height: 30px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- toast */
.toasts {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1200;
  width: calc(100% - 28px);
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 11px 13px;
  border-radius: 10px;
  background: #1e293b;
  color: #fff;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .22);
  border-left: 3px solid #64748b;
  animation: toastIn .22s ease;
  word-break: break-word;
}
.toast-ok { border-left-color: #34d399; }
.toast-err { border-left-color: #f87171; }
.toast-info { border-left-color: #38bdf8; }
.toast-ic { width: 18px; height: 18px; margin-top: 1px; color: #cbd5e1; }
.toast-msg { flex: 1 1 auto; }
.toast.out { opacity: 0; transform: translateY(-6px); transition: opacity .22s ease, transform .22s ease; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------------- 弹层 */
.modal-mask {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, .46);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  opacity: 0;
  transition: opacity .18s ease;
}
.modal-mask.in { opacity: 1; }
.modal {
  width: 100%;
  max-width: 440px;
  max-height: 88vh;
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .3);
  animation: modalIn .2s ease;
}
.modal-wide { max-width: 560px; }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 18px 4px; }
.modal-title { flex: 1 1 auto; margin: 0; font-size: 17px; font-weight: 700; line-height: 1.4; color: var(--ink); }
.modal-x {
  flex: 0 0 auto;
  width: 44px; height: 44px;
  margin: -8px -10px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.modal-x:hover { background: #f1f5f9; color: var(--ink); }
.modal-body { padding: 8px 18px 4px; font-size: 13.5px; line-height: 1.65; color: var(--ink-2); }
.modal-msg { margin: 0 0 8px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 18px 18px; }
.modal-foot .btn { min-width: 84px; }
.modal-field { margin: 8px 0 2px; }
.modal-field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.modal-err {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--danger-l);
  border: 1px solid #fecaca;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.5;
}
.modal-note { margin: 6px 0 0; font-size: 11.5px; color: var(--muted); }

/* ---------------------------------------------------------------- 状态页 */
.fatal { padding: 8px 0; }
.copy-sink { position: fixed !important; top: -1000px !important; }

/* ---------------------------------------------------------------- 响应式 */
@media (min-width: 1200px) {
  .qgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qgrid { grid-template-columns: 1fr; }
  .dim-row { grid-template-columns: 132px minmax(0, 1fr) 150px; }
  .ns-grid { grid-template-columns: 1fr; }
  .ns-row { grid-template-columns: 86px minmax(0, 1fr) 96px; }
  .op-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .side {
    position: static;
    width: auto;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    overflow-x: auto;
  }
  .side-brand {
    padding: 0 10px 0 0;
    margin: 0;
    border-bottom: 0;
    border-right: 1px solid rgba(255, 255, 255, .16);
    flex: 0 0 auto;
  }
  .brand-mark { width: 32px; height: 32px; border-radius: 9px; }
  .brand-mark svg { width: 18px; height: 18px; }
  .brand-txt b { font-size: 12.5px; }
  .brand-txt small { display: none; }
  .side-nav { flex: 1 1 auto; flex-direction: row; gap: 4px; }
  .nav-item { width: auto; min-height: 44px; padding: 0 12px; font-size: 12.5px; white-space: nowrap; }
  .nav-item.is-active::before { left: 8px; right: 8px; top: auto; bottom: 0; width: auto; height: 2px; border-radius: 2px 2px 0 0; }
  .side-foot { display: none; }
  .main-wrap { margin-left: 0; }
  .topbar { padding: 10px 14px; min-height: 56px; gap: 10px; flex-wrap: wrap; }
  .page-title { font-size: 15px; }
  .view { padding: 14px 14px 34px; }
  .card { padding: 15px 14px; }
  .vh-title { font-size: 18px; }
  .overview { gap: 18px; }
  .score-side { width: 150px; }
  .groups-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dim-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    row-gap: 7px;
    padding: 10px 12px;
  }
  .dim-main { grid-column: 1; grid-row: 1; }
  .dim-val { grid-column: 2; grid-row: 1; }
  .dim-bar { grid-column: 1 / -1; grid-row: 2; }
  .dim-detail { padding: 10px 12px; }
  .dim-q { grid-template-columns: 52px minmax(0, 1fr) auto; }
  .dim-q-t { grid-column: 1 / -1; grid-row: 2; white-space: normal; }
  .dim-q-m { grid-column: 2; grid-row: 1; text-align: right; }
  .dim-q-l { grid-column: 3; grid-row: 1; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span2 { grid-column: auto; }

  .tbl.resp { display: block; }
  .tbl.resp thead { display: none; }
  .tbl.resp tbody { display: block; }
  .tbl.resp tr {
    display: block;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff !important;
    margin-bottom: 10px;
    padding: 4px 12px;
  }
  .tbl.resp td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px dashed #eef2f6;
    text-align: right;
  }
  .tbl.resp td:last-child { border-bottom: 0; }
  .tbl.resp td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 500;
    text-align: left;
  }
  .tbl.resp td.table-actions { flex-wrap: wrap; justify-content: flex-end; }
  .tbl.resp td.table-actions::before { align-self: center; }
  .table-actions .btn { flex: 0 0 auto; }
  .qr-box { width: 214px; height: 214px; }
}

@media (max-width: 560px) {
  .topbar { padding: 8px 12px; }
  .top-actions { gap: 8px; width: 100%; justify-content: space-between; }
  .pick { flex: 1 1 auto; min-width: 0; }
  .pick select { width: 100%; max-width: none; min-height: 44px; }
  .who { font-size: 11.5px; }
  .who .role { display: none; }
  .who .who-name { max-width: 70px; }
  .btn.sm { min-height: 44px; padding: 0 10px; }
  .btn.sm span { display: none; }
  .btn.sm svg { width: 18px; height: 18px; }
  .view { padding: 12px 12px 30px; }
  .card { padding: 14px 12px; border-radius: 11px; }
  .vh-title { font-size: 17px; }
  .vh-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .vh-actions .btn { width: 100%; }
  .vh-actions .btn:last-child { grid-column: 1 / -1; }
  .score-side { width: 100%; }
  .overview { gap: 12px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stat { padding: 10px 11px; }
  .stat-v { font-size: 18px; }
  .ov-raw { display: none; }
  .ns-row { grid-template-columns: 68px minmax(0, 1fr) 76px; font-size: 11px; }
  .imp-label { max-width: 56vw; }
  .modal-mask { padding: 12px; align-items: flex-end; }
  .modal { border-radius: 16px 16px 0 0; max-height: 90vh; }
  .qr-actions .btn { flex: 1 1 100%; }
  .auth-card { padding: 26px 20px 22px; }
  .auth-title { font-size: 18px; }
}

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