/* ============================================================
   AI 视频课评价系统 · 视觉体系 v4（智研课堂风）
   设计定位：清新浅绿教研工作台（fresh sage console）
   - 参考「智研课堂」落地页配色：鼠尾草绿 #0b63ce 主轴，
     浅绿白底 #f5f9fd，冷绿灰中性阶，亮橙 #ff9f3f 作强调
   - 评分四档：绿 #2E9E6B / 蓝 #1F70F0 / 橙 #D98A00 / 红 #D6453A
   - 扁平优先：发丝描边 > 阴影；只有浮层才给投影
   - 4px 间距基数 + 4px 半档，节奏与设计稿一致
   - 全部交互元素满足 WCAG AA 对比度与 40px 以上触摸目标
   ============================================================ */

/* ---------------------------------------------------------- 设计令牌 */
:root {
  /* 品牌鼠尾草绿阶 */
  --brand-1: #eef5fe;
  --brand-2: #dcecfd;
  --brand-3: #b9d8f6;
  --brand-4: #6fa9e8;
  --brand-5: #0b63ce;
  --brand: #0b63ce;
  --brand-hover: #0755b5;
  --brand-active: #0a4c9e;
  --brand-dark: #183653;
  --brand-soft: #e3f0fe;
  --brand-ink: #123b75;

  /* 亮橙（强调，不用作大面积底色） */
  --accent: #ff9f3f;
  --accent-soft: #fff3e2;
  --accent-ink: #c97a2b;

  /* 中性阶（冷绿灰，配浅绿白底统一色调） */
  --bg: #f5f9fd;
  --bg-sunk: #edf3fb;
  --panel: #FFFFFF;
  --panel-2: #fafcfe;
  --ink: #183653;
  --ink-2: #2e4e70;
  --muted: #647b94;
  --ink-3: #9fb6cc;
  --line: #e3edf8;
  --line-2: #edf3fa;
  --line-strong: #d0dfee;

  /* 状态色（与 gradeColor() 的色阶严格一致） */
  --ok: #349566;
  --ok-soft: #EAF3EE;
  --ok-line: #CBE2D6;
  --warn: #D98A00;
  --warn-soft: #FDF4E0;
  --warn-line: #F1E3C0;
  --bad: #D6453A;
  --bad-soft: #FCEDEB;
  --bad-line: #F0CFCB;
  --teal: #349566;
  --teal-soft: #EAF3EE;
  --gold: #D9A62E;
  --gold-soft: #FBF6E4;

  /* 评分四档（唯一真源，见 app.js SCORE_SCALE） */
  --sc-ex: #2E9E6B;
  --sc-good: #1F70F0;
  --sc-ok: #D98A00;
  --sc-bad: #D6453A;

  /* 间距基数 4px */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px;

  /* 形状 */
  --radius: 14px;
  --radius-s: 10px;
  --radius-tag: 7px;
  --radius-pill: 999px;

  /* 层级：靠描边分层，不靠阴影（冷灰绿投影，不带褐调） */
  --shadow: 0 1px 2px rgba(52, 64, 58, .05);
  --shadow-md: 0 4px 16px rgba(52, 64, 58, .09);
  --shadow-lg: 0 18px 48px rgba(36, 48, 42, .20);
  --focus-ring: 0 0 0 3px rgba(106, 143, 114, .25);
  --focus-line: #6fa9e8;

  /* 动效 */
  --ease: cubic-bezier(.2, .8, .3, 1);
  --t-fast: 130ms var(--ease);
  --t: 220ms var(--ease);

  --topbar-h: 60px;
  --wrap-max: 1320px;

  --font: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans GB", "Source Han Sans SC", sans-serif;
  --mono: ui-monospace, Consolas, "SFMono-Regular", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
}
body.nav-open { overflow: hidden; }
h1, h2, h3, h4 { line-height: 1.35; color: var(--ink); }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); }
button { font-family: inherit; }
::selection { background: var(--brand-2); }

/* 细滚动条：表格 / 转写 / 帧条 内部才出现 */
.tbl-wrap, .transcript, .shots, .modal .bd, .nav { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.tbl-wrap::-webkit-scrollbar, .transcript::-webkit-scrollbar, .shots::-webkit-scrollbar, .modal .bd::-webkit-scrollbar { width: 8px; height: 8px; }
.tbl-wrap::-webkit-scrollbar-thumb, .transcript::-webkit-scrollbar-thumb, .shots::-webkit-scrollbar-thumb, .modal .bd::-webkit-scrollbar-thumb {
  background: var(--line-strong); border-radius: 4px; border: 2px solid transparent; background-clip: content-box;
}
.tbl-wrap::-webkit-scrollbar-track, .shots::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------- 原子工具类 */
.muted { color: var(--muted); }
.small { font-size: 12.5px; line-height: 1.6; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.mono { font-family: var(--mono); }
.req { color: var(--bad); font-weight: 600; }
.c { text-align: center; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* 焦点可见性：键盘用户永远能看清落点 */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.btn:focus-visible, .nav button:focus-visible, .tabs button:focus-visible { outline: 0; box-shadow: var(--focus-ring); }

/* ---------------------------------------------------------- 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: var(--s4);
  padding: 0 var(--s6); height: var(--topbar-h);
  background: rgba(255, 255, 255, .90);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; min-width: 0; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 11px; flex: 0 0 auto;
  background: var(--brand);
  display: grid; place-items: center;
  box-shadow: none;
}
.brand .logo svg { display: block; }
#siteTitle { font-size: 15.5px; font-weight: 650; letter-spacing: .1px; white-space: nowrap; }
.brand .ver {
  font-size: 11px; font-weight: 500; color: var(--muted);
  background: var(--bg-sunk); padding: 2px 7px; border-radius: var(--radius-pill);
  font-variant-numeric: tabular-nums; flex: 0 0 auto;
}

.nav { display: flex; align-items: center; gap: 2px; min-width: 0; }
.nav button {
  display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 13px;
  border: 0; background: transparent; color: var(--ink-2);
  border-radius: var(--radius-s); cursor: pointer;
  font-size: 13.5px; font-weight: 500; white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast);
}
.nav button .ni { width: 16px; height: 16px; flex: 0 0 auto; opacity: .7; transition: opacity var(--t-fast); }
.nav button:hover { background: var(--bg-sunk); color: var(--ink); }
.nav button.active { background: #F0F4F0; color: var(--brand); font-weight: 600; }
.nav button.active .ni { opacity: 1; }
.nav button.active::after { content: none; }

.nav-toggle {
  display: none; width: 38px; height: 38px; flex: 0 0 auto;
  border: 1px solid var(--line); background: #fff; border-radius: var(--radius-s);
  color: var(--ink-2); cursor: pointer; place-items: center;
}
.nav-toggle svg { width: 20px; height: 20px; display: block; }
.nav-toggle:hover { background: var(--bg-sunk); color: var(--ink); }

.topbar .spacer { flex: 1 1 auto; min-width: 0; }
.netpill {
  display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto;
  font-size: 12.5px; color: var(--ok);
  background: var(--ok-soft); border: 1px solid var(--ok-line);
  border-radius: var(--radius-pill); padding: 4px 11px;
}
.netpill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); flex: 0 0 auto; }
.netpill.warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.netpill.warn .dot { background: var(--warn); }

/* ---------------------------------------------------------- 布局容器 */
.wrap { max-width: var(--wrap-max); margin: 0 auto; padding: var(--s6) var(--s6) 72px; }
.grid { display: grid; gap: var(--s4); }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.side { grid-template-columns: minmax(0, 1.5fr) minmax(340px, 1fr); align-items: start; }
.stack { display: block; }
.stack > div { min-width: 0; }
.stack .grid.c4, .stack .grid.c3 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

@media (max-width: 1140px) {
  .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.side { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .grid.c3, .grid.c2 { grid-template-columns: minmax(0, 1fr); }
}

/* ---------------------------------------------------------- 页头 */
.page-title {
  display: flex; align-items: center; gap: var(--s3);
  margin: 0 0 var(--s5); flex-wrap: wrap;
  min-height: 32px;
}
.page-title h2 { margin: 0; font-size: 19px; font-weight: 650; letter-spacing: -.1px; }
.page-title .sub { color: var(--muted); font-size: 12.5px; }
.page-title .spacer { flex: 1 1 auto; }
.page-title > div:has(> h2) { min-width: 0; }
.page-title > div > h2 { margin: 0; font-size: 19px; font-weight: 650; }

/* ---------------------------------------------------------- Hero（总览首屏） */
.hero {
  position: relative; overflow: hidden;
  border-radius: var(--radius);
  padding: var(--s5) var(--s6);
  margin-bottom: var(--s4);
  background: linear-gradient(112deg, #123b75 0%, var(--brand) 55%, #597B62 100%);
  color: #fff;
  display: flex; align-items: center; gap: var(--s5); flex-wrap: wrap;
}
.hero::before, .hero::after { content: none; }
.hero .hmark {
  width: 46px; height: 46px; border-radius: 13px; flex: 0 0 auto;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .28);
  display: grid; place-items: center;
}
.hero .hbody { min-width: 0; flex: 1 1 320px; }
.hero h2 { margin: 0 0 3px; font-size: 19px; font-weight: 650; letter-spacing: .2px; color: #fff; }
.hero .sub { font-size: 13px; color: rgba(255, 255, 255, .88); margin: 0; }
.hero .chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 11px; }
.hero .chip {
  font-size: 12px; padding: 3px 11px; border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .3);
  white-space: nowrap;
}

/* ---------------------------------------------------------- 卡片 */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card .hd {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--line-2);
  min-height: 52px;
}
.card .hd h3 { margin: 0; font-size: 14.5px; font-weight: 650; letter-spacing: -.05px; }
.card .hd::before {
  content: ""; width: 3px; height: 13px; border-radius: 2px; flex: 0 0 auto;
  background: var(--brand);
}
.card .hd .spacer { flex: 1 1 auto; }
.card .bd { padding: 18px; }
.card .bd.tight { padding: 12px 14px; }
.card .hd + .bd.tight { padding-top: 12px; }
.card .ft {
  padding: 12px 18px; border-top: 1px solid var(--line-2); background: var(--panel-2);
  border-radius: 0 0 var(--radius) var(--radius);
}
/* 卡片本身没有投影，只有真正浮起来的东西才有 */
.card.interactive:hover { border-color: var(--brand-3); box-shadow: var(--shadow); }

/* 统计卡 */
.stat {
  display: flex; align-items: center; gap: var(--s3);
  padding: 15px 17px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.stat .ic {
  width: 40px; height: 40px; border-radius: 11px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 19px; line-height: 1;
  background: var(--brand-soft);
}
.stat .ic.t { background: var(--ok-soft); }
.stat .ic.w { background: var(--warn-soft); }
.stat .ic.b { background: var(--accent-soft); }
.stat > div { min-width: 0; }
.stat .v {
  font-size: 23px; font-weight: 700; line-height: 1.15;
  letter-spacing: -.4px; font-variant-numeric: tabular-nums;
}
.stat .v .small { font-weight: 500; letter-spacing: 0; }
.stat .k { font-size: 12.5px; color: var(--ink-2); margin-top: 1px; }

/* ---------------------------------------------------------- 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px;
  border: 1px solid var(--line-strong); background: #fff; color: var(--ink);
  border-radius: var(--radius-s); cursor: pointer;
  font-size: 13.5px; font-weight: 500; white-space: nowrap;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.btn:hover { border-color: var(--brand-3); color: var(--brand-hover); background: var(--brand-1); }
.btn:active { background: var(--brand-2); }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn:disabled:hover, .btn[disabled]:hover { border-color: var(--line-strong); color: var(--ink); background: #fff; }
.btn.primary {
  background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600;
  box-shadow: 0 1px 2px rgba(89, 123, 98, .30);
}
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; }
.btn.primary:active { background: var(--brand-active); }
.btn.primary:disabled:hover { background: var(--brand); border-color: var(--brand); }
.btn.teal { background: var(--teal); border-color: var(--teal); color: #fff; font-weight: 600; }
.btn.teal:hover { filter: brightness(.94); color: #fff; }
.btn.danger { color: var(--bad); border-color: var(--bad-line); background: #fff; }
.btn.danger:hover { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--bg-sunk); border-color: transparent; color: var(--ink); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: var(--radius-tag); gap: 4px; }
.btn.link { border: 0; background: transparent; color: var(--brand); padding: 0 6px; height: 28px; }
.btn.link:hover { background: var(--brand-soft); }
.btn .spin { width: 13px; height: 13px; border-width: 2px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* 操作条：列表页顶部筛选 / 详情页动作区 */
.toolbar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  padding: 12px 14px; border-bottom: 1px solid var(--line-2);
}
.toolbar .grow { flex: 1 1 auto; }
.toolbar input[type=search], .toolbar select { width: auto; }
.toolbar input[type=search] { min-width: 200px; max-width: 300px; flex: 1 1 200px; }
.toolbar select { max-width: 170px; }

/* ---------------------------------------------------------- 表单 */
.field { margin-bottom: 15px; }
.field:last-child { margin-bottom: 0; }
.field > label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; font-weight: 500; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.65; }
input[type=text], input[type=password], input[type=number], input[type=search],
input[type=email], input[type=url], select, textarea {
  width: 100%; height: 36px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-s);
  font: inherit; font-size: 13.5px; color: var(--ink); background: #fff;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
textarea { height: auto; min-height: 96px; padding: 9px 12px; resize: vertical; line-height: 1.7; }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:hover, select:hover, textarea:hover { border-color: var(--brand-3); }
input:focus, select:focus, textarea:focus {
  outline: 0; border-color: var(--brand); box-shadow: var(--focus-ring); background: #fff;
}
input:disabled, select:disabled, textarea:disabled { background: var(--bg-sunk); color: var(--muted); cursor: not-allowed; }
select { appearance: none; cursor: pointer; padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A93A5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 15px;
}
input[type=file] { height: auto; padding: 7px 10px; font-size: 13px; }
input[type=checkbox], input[type=radio] { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; flex: 0 0 auto; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 780px) { .row2, .row3 { grid-template-columns: 1fr; } }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.check input { width: 16px; height: 16px; }

/* ---------------------------------------------------------- 表格 */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
table.tbl th {
  position: sticky; top: 0; z-index: 1;
  text-align: left; font-weight: 600; color: var(--ink-2); font-size: 12.5px;
  padding: 10px 14px; background: var(--panel-2); white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
table.tbl td {
  padding: 11px 14px; border-bottom: 1px solid var(--line-2);
  vertical-align: middle; transition: background var(--t-fast);
}
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl tbody tr:hover td { background: #F9FBF9; }
table.tbl td.right, table.tbl th.right { text-align: right; }
table.tbl td.c, table.tbl th.c { text-align: center; }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl td > b { font-weight: 650; }
/* 无表头的紧凑表（键值对型） */
table.tbl tbody th {
  position: static; background: transparent; border-bottom: 1px solid var(--line-2);
  font-weight: 600; color: var(--ink); font-size: 13.5px; padding: 11px 14px; white-space: normal;
}
table.tbl tbody tr:last-child th { border-bottom: 0; }
table.tbl tbody tr:hover th { background: #F9FBF9; }
table.tbl a { font-weight: 500; }
/* 评分单元格 */
.sc-cell { display: flex; align-items: baseline; gap: 6px; }
.sc-cell b { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sc-num { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sc-ex { color: var(--sc-ex); } .sc-good { color: var(--sc-good); }
.sc-ok { color: var(--sc-ok); } .sc-bad { color: var(--sc-bad); }

/* ---------------------------------------------------------- 标签 / 状态 */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: var(--radius-tag); border: 1px solid transparent;
  font-size: 12px; font-weight: 500; line-height: 1.7;
  background: var(--bg-sunk); color: var(--ink-2); white-space: nowrap;
}
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.pill.bad { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-line); }
.pill.brand { background: var(--brand-soft); color: var(--brand-ink); border-color: var(--brand-2); }
.pill.live { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-line); }
.pill.live .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--bad); animation: pulse 1.6s var(--ease) infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }

/* ---------------------------------------------------------- 分数环 */
.ring { position: relative; width: 132px; height: 132px; flex: 0 0 auto; }
.ring svg { transform: rotate(-90deg); display: block; }
.ring .val { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .val b { font-size: 33px; font-weight: 700; line-height: 1.05; display: block; letter-spacing: -1px; }
.ring .val span { font-size: 12px; color: var(--muted); }

/* ---------------------------------------------------------- 维度条 */
.dim { padding: 11px 0; border-bottom: 1px dashed var(--line); }
.dim:last-child { border-bottom: 0; }
.dim .top { display: flex; align-items: baseline; gap: 10px; margin-bottom: 7px; }
.dim .top .name { font-weight: 600; font-size: 13.5px; }
.dim .top .score { margin-left: auto; font-variant-numeric: tabular-nums; font-size: 13.5px; font-weight: 600; }
.dim .why { font-size: 12.5px; color: var(--ink-2); margin-top: 7px; line-height: 1.7; }
.bar { height: 7px; border-radius: 4px; background: var(--bg-sunk); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 4px; transition: width .55s var(--ease); }

/* ---------------------------------------------------------- 关键帧条 */
.shots { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; }
.shots figure { margin: 0; flex: 0 0 auto; cursor: pointer; }
.shots img {
  width: 132px; height: 76px; object-fit: cover; display: block;
  border-radius: var(--radius-s); border: 1px solid var(--line); background: #0d1220;
}
.shots figcaption { font-size: 11.5px; color: var(--muted); text-align: center; margin-top: 4px; font-variant-numeric: tabular-nums; }
.shots figure:hover img { border-color: var(--brand); }
.shots figure.active img { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-2); }

/* ---------------------------------------------------------- 视频 */
.video-box { background: #0C1020; border-radius: var(--radius); overflow: hidden; }
.video-box video { width: 100%; display: block; max-height: 480px; background: #0C1020; }
.video-empty { padding: 46px 20px; text-align: center; color: #9AA8B0; font-size: 13.5px; line-height: 1.7; }
.fmtbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 2px 2px; font-size: 12px; }
.fmtbar a { color: var(--brand); }
.convertbox { padding: 4px 2px 10px; }

/* ---------------------------------------------------------- 标签页 */
.tabs {
  display: flex; gap: 2px; border-bottom: 1px solid var(--line);
  padding: 0 4px; overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  border: 0; background: transparent; padding: 10px 14px; cursor: pointer;
  font-size: 13.5px; font-weight: 500; color: var(--ink-2);
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.tabs button:hover { color: var(--brand-hover); }
.tabs button.active { color: var(--brand-hover); border-bottom-color: var(--brand); font-weight: 600; }

/* ---------------------------------------------------------- 指标 / 键值 */
.findings { display: grid; gap: 9px; }
.finding {
  display: flex; gap: 11px; padding: 11px 13px;
  border-radius: var(--radius-s); background: var(--panel-2); border: 1px solid var(--line-2);
}
.finding .tag {
  flex: 0 0 auto; min-width: 46px; text-align: center;
  font-size: 11.5px; padding: 2px 7px; border-radius: var(--radius-tag);
  color: #fff; height: fit-content; font-weight: 600;
}
.finding .tag.ok, .finding .tag.t { background: var(--ok); }
.finding .tag.warn, .finding .tag.w { background: var(--warn); }
.finding .tag.bad, .finding .tag.b { background: var(--bad); }
.finding b { display: block; font-size: 13px; margin-bottom: 3px; font-weight: 600; }
.finding p { margin: 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.72; }

.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.kv .item { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--radius-s); padding: 10px 12px; }
.kv .item .k { font-size: 12px; color: var(--muted); }
.kv .item .v { font-size: 15px; font-weight: 650; margin-top: 3px; font-variant-numeric: tabular-nums; word-break: break-all; }

/* 一行式元信息条（总览页收敛后的形态） */
.meta-strip {
  display: flex; flex-wrap: wrap; gap: 0;
  border: 1px solid var(--line-2); border-radius: var(--radius-s);
  background: var(--panel-2); overflow: hidden;
}
.meta-strip .mi { flex: 1 1 130px; min-width: 0; padding: 9px 13px; border-right: 1px solid var(--line-2); }
.meta-strip .mi:last-child { border-right: 0; }
.meta-strip .mi .k { font-size: 11.5px; color: var(--muted); }
.meta-strip .mi .v { font-size: 13.5px; font-weight: 600; margin-top: 1px; word-break: break-all; }

/* 紧凑步骤列表 */
.steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.steps li { display: flex; gap: 9px; font-size: 12.5px; color: var(--ink-2); line-height: 1.7; }
.steps li .n {
  flex: 0 0 auto; width: 17px; height: 17px; border-radius: 50%; margin-top: 4px;
  background: var(--brand-soft); color: var(--brand-hover);
  font-size: 10.5px; font-weight: 700; display: grid; place-items: center;
}

/* ---------------------------------------------------------- 转写 */
.transcript { max-height: 340px; overflow-y: auto; font-size: 13px; line-height: 1.85; }
.transcript .seg { display: flex; gap: 10px; padding: 5px 0; border-bottom: 1px dashed var(--line-2); }
.transcript .seg:last-child { border-bottom: 0; }
.transcript .seg .t { flex: 0 0 52px; color: var(--brand); font-variant-numeric: tabular-nums; font-size: 12.5px; padding-top: 2px; }
.transcript .seg .x { color: var(--ink-2); }

/* ---------------------------------------------------------- 评分表 */
.score-tbl th, .score-tbl td { font-size: 13px; }
.score-tbl th.item-name, .score-tbl .item-name { width: 34%; }
.score-tbl input { width: 76px; text-align: center; padding: 0 8px; }
.score-tbl .dim-head td { background: var(--brand-1); font-weight: 650; color: var(--brand-ink); }
.score-tbl tbody tr:hover td { background: transparent; }
.score-tbl tbody tr:hover .dim-head td, .score-tbl tr.dim-head:hover td { background: var(--brand-1); }
.total-box {
  display: flex; align-items: center; gap: var(--s4);
  padding: 14px 18px; background: var(--brand-soft);
  border: 1px solid var(--brand-2); border-radius: var(--radius-s);
}
.total-box .n { font-size: 30px; font-weight: 700; color: var(--brand-hover); font-variant-numeric: tabular-nums; letter-spacing: -1px; }

/* ---------------------------------------------------------- 标准卡片 */
.std-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 17px; background: #fff;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.std-card:hover { border-color: var(--brand-3); box-shadow: var(--shadow); }
.std-card h4 { margin: 0 0 6px; font-size: 14.5px; font-weight: 650; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.std-card .meta { font-size: 12px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 9px; }
.std-card .meta span { position: relative; }
.std-card .meta span + span::before {
  content: "·"; position: absolute; left: -7px; color: var(--line-strong);
}
.std-card .desc { font-size: 13px; color: var(--ink-2); line-height: 1.72; }
.std-card.current { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-1); }

/* ---------------------------------------------------------- 二维码 / 链接框 */
.qr-box { display: flex; gap: var(--s5); align-items: center; flex-wrap: wrap; }
.qr-box .qr {
  /* 172 - 2(边框) - 16(内边距) = 154px 内容区，正好容纳 QR.svg 的原生尺寸，
     不缩放才不会出现模块半像素发虚（影响扫码识别率） */
  width: 172px; height: 172px; padding: 8px; flex: 0 0 auto;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
}
/* 只限制上限，不强制拉伸：尺寸合适时保持 1:1 渲染 */
.qr-box .qr svg { display: block; max-width: 100%; max-height: 100%; }
.qr-box > .qr-body { flex: 1 1 260px; min-width: 0; }
.url-box {
  display: flex; gap: 8px; align-items: center;
  background: var(--panel-2); border: 1px dashed var(--line-strong);
  border-radius: var(--radius-s); padding: 7px 10px;
}
.url-box code {
  flex: 1 1 auto; min-width: 0; font-family: var(--mono); font-size: 13px;
  color: var(--brand-hover); word-break: break-all; line-height: 1.5;
}
.url-box .btn { flex: 0 0 auto; }

/* ---------------------------------------------------------- 提示条 */
.note {
  display: flex; gap: 10px; padding: 11px 14px;
  border-radius: var(--radius-s); font-size: 13px; line-height: 1.7;
  border: 1px solid transparent;
}
.note > span { flex: 0 0 auto; line-height: 1.5; }
.note > div { min-width: 0; }
.note b { font-weight: 650; }
.note.info { background: var(--brand-soft); color: var(--brand-ink); border-color: var(--brand-2); }
.note.warn { background: var(--warn-soft); color: #8F5E00; border-color: var(--warn-line); }
.note.ok { background: var(--ok-soft); color: #2E9E6B; border-color: var(--ok-line); }
.note.bad { background: var(--bad-soft); color: #B23A31; border-color: var(--bad-line); }

/* ---------------------------------------------------------- 弹窗 */
.modal-mask {
  position: fixed; inset: 0; z-index: 200; padding: var(--s5);
  background: rgba(10, 18, 34, .48);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display: grid; place-items: center;
  animation: fadein 160ms var(--ease);
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg);
  width: min(760px, 100%); max-height: 88vh;
  display: flex; flex-direction: column; overflow: hidden;
  animation: popin 200ms var(--ease);
}
@keyframes popin { from { transform: translateY(10px) scale(.985); opacity: 0; } to { transform: none; opacity: 1; } }
.modal .hd { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.modal .hd h3 { margin: 0; font-size: 16px; font-weight: 650; }
.modal .hd .spacer { flex: 1 1 auto; }
.modal .bd { padding: 20px; overflow-y: auto; }
.modal .ft {
  padding: 13px 20px; border-top: 1px solid var(--line-2);
  display: flex; gap: 9px; justify-content: flex-end; background: var(--panel-2);
}

/* ---------------------------------------------------------- 轻提示 */
#toast { position: fixed; right: 22px; bottom: 24px; display: grid; gap: 9px; z-index: 300; pointer-events: none; }
.toast-item {
  display: flex; align-items: center; gap: 9px;
  background: #fff; color: var(--ink);
  padding: 11px 16px; border-radius: var(--radius-s); font-size: 13.5px;
  border: 1px solid var(--line); border-left: 3px solid var(--brand);
  box-shadow: var(--shadow-md); max-width: 380px;
  animation: slidein .2s var(--ease);
}
.toast-item.ok { border-left-color: var(--ok); }
.toast-item.bad { border-left-color: var(--bad); }
@keyframes slidein { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------------------------------------------------------- 进度 / 加载 / 空态 */
.progress { height: 6px; border-radius: 3px; background: var(--bg-sunk); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--brand); border-radius: 3px; transition: width .3s var(--ease); }
.spin {
  width: 15px; height: 15px; border-radius: 50%; display: inline-block;
  border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff;
  animation: spin .8s linear infinite;
}
.spin.dark { border-color: var(--brand-2); border-top-color: var(--brand); }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); font-size: 13.5px; line-height: 1.7; }
.empty .ic { font-size: 34px; opacity: .55; margin-bottom: 8px; line-height: 1; }
.skeleton {
  border-radius: var(--radius-s);
  background: linear-gradient(90deg, #edf3fa 25%, #f5f9fd 37%, #edf3fa 63%);
  background-size: 400% 100%; animation: sk 1.4s ease infinite;
}
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

details.fold { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 11px 14px; background: #fff; }
details.fold > summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--ink); }
details.fold > summary::marker { color: var(--brand); }
details.fold[open] > summary { margin-bottom: 11px; padding-bottom: 10px; border-bottom: 1px solid var(--line-2); }

/* ---------------------------------------------------------- 页脚 */
.site-foot {
  max-width: var(--wrap-max); margin: 0 auto; padding: 4px var(--s6) 26px;
  color: var(--muted); font-size: 12px; text-align: center;
}
.site-foot a { color: var(--ink-2); }

/* ---------------------------------------------------------- 课堂环节切片 */
.seg-row { cursor: pointer; }
.seg-row:hover td { background: #F7FAF7; }
.seg-row.active td { background: var(--brand-soft); }

/* 量规档位描述 */
.lv-list { list-style: decimal; padding-left: 20px; margin: 6px 0; }
.lv-list li { margin: 2px 0; font-size: 12.5px; color: var(--ink-2); }
.lv-list li b { color: var(--brand-dark); }

/* 自绘 SVG 图表区 */
.chartgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--s3); margin: 6px 0 0; }
.chartcard { border: 1px solid var(--line-2); border-radius: var(--radius); padding: 11px 13px 6px; background: #fff; }
.chartcard h4 { margin: 0 0 5px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.chartcard.wide { grid-column: 1 / -1; }
.chartcard svg { max-width: 100%; display: block; }

/* ---------------------------------------------------------- 响应式 */
@media (max-width: 1080px) {
  .nav button { padding: 0 10px; font-size: 13px; }
  .nav button .ni { display: none; }
}
@media (max-width: 900px) {
  .wrap { padding: var(--s4) var(--s4) 64px; }
  .topbar { padding: 0 var(--s4); gap: var(--s3); }
  .nav-toggle { display: grid; }
  .nav {
    display: none;
    position: fixed; top: var(--topbar-h); left: 0; right: 0; z-index: 49;
    flex-direction: column; align-items: stretch; gap: 3px;
    padding: 10px 12px 16px;
    background: #fff; border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    max-height: calc(100vh - var(--topbar-h)); overflow-y: auto;
  }
  .nav.open { display: flex; animation: dropin 180ms var(--ease); }
  @keyframes dropin { from { transform: translateY(-6px); opacity: 0; } to { transform: none; opacity: 1; } }
  .nav button {
    height: 44px; justify-content: flex-start; padding: 0 14px;
    font-size: 14.5px; border-radius: var(--radius-s);
  }
  .nav button .ni { display: block; width: 18px; height: 18px; }
  .nav button.active::after { content: none; }
  #siteTitle { font-size: 14.5px; }
  .brand .ver { display: none; }
}
@media (max-width: 620px) {
  .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 13px 14px; gap: 10px; }
  .stat .ic { width: 34px; height: 34px; border-radius: 9px; font-size: 16px; }
  .stat .v { font-size: 20px; }
  #netText { display: none; }
  .netpill { padding: 5px 9px; }
  .modal-mask { padding: 12px; place-items: end center; }
  .modal { max-height: 90vh; }
  .page-title h2, .page-title > div > h2 { font-size: 17px; }
  #toast { right: 12px; left: 12px; bottom: 16px; }
  .toast-item { max-width: none; }
}

/* ---------------------------------------------------------- 无障碍 / 动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}

/* ---------------------------------------------------------- 打印 */
@media print {
  .topbar, .site-foot, #toast, .nav-toggle, .btn, .tabs, .toolbar { display: none !important; }
  body { background: #fff; }
  .wrap { max-width: none; padding: 0; }
  .card, .stat { border-color: #ccc; box-shadow: none; break-inside: avoid; }
  .tbl-wrap { overflow: visible; }
  table.tbl th { position: static; }
  .grid.c2, .grid.c3, .grid.c4, .grid.side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  a { color: inherit; text-decoration: none; }
}

/* ---------------------------------------------------------- 高级设置折叠（设置页） */
details.adv {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  margin: 4px 0 10px;
}
details.adv > summary {
  cursor: pointer;
  list-style: none;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 10px;
}
details.adv > summary::-webkit-details-marker { display: none; }
details.adv > summary::before {
  content: "\203A";
  display: inline-block;
  font-size: 15px;
  line-height: 1;
  color: var(--muted);
  transition: transform .15s ease;
}
details.adv[open] > summary::before { transform: rotate(90deg); }
details.adv > summary:hover { color: var(--brand-hover); }
details.adv > summary:focus-visible { outline: 0; box-shadow: var(--focus-ring); }
details.adv[open] > summary { border-bottom: 1px solid var(--line); border-radius: 10px 10px 0 0; }
details.adv .adv-body { padding: 12px; }
details.adv .adv-body > *:last-child,
details.adv .adv-body .field:last-child { margin-bottom: 0; }
