/* 议论文分层进阶工坊 · 主题 V4「深墨」
   深色数据台：低亮度底 + 高对比正文 + 发光的数据层。
   类名与 V3 一致，只换皮并新增可视化组件样式。 */

:root {
  /* ---------- 底与面 ---------- */
  --bg: #0a0d12;
  --paper: #0a0d12;
  --surface: #11151c;
  --surface-2: #161b24;
  --surface-3: #1c222d;
  --surface-4: #232a36;
  --ink: #e8eaef;
  --ink-2: #b6bdc9;
  --muted: #858d9c;
  --line: rgba(255, 255, 255, .07);
  --line-strong: rgba(255, 255, 255, .14);

  /* ---------- 强调 ---------- */
  --accent: #5eead4;
  --accent-2: #38bdf8;
  --accent-3: #2a3b4d;
  --accent-soft: rgba(94, 234, 212, .10);
  --amber: #f0b429;
  --amber-soft: rgba(240, 180, 41, .12);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, .12);
  --ok: #4ade80;
  --ok-soft: rgba(74, 222, 128, .12);

  --t-basic: #f0b429;
  --t-basic-soft: rgba(240, 180, 41, .13);
  --t-mid: #38bdf8;
  --t-mid-soft: rgba(56, 189, 248, .13);
  --t-high: #a78bfa;
  --t-high-soft: rgba(167, 139, 250, .14);

  --serif: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;

  /* ---------- 字号刻度 ---------- */
  --fs-micro: 11.5px;
  --fs-meta: 12.5px;
  --fs-small: 13.5px;
  --fs-body: 15px;
  --fs-lead: 16px;
  --fs-h3: 17px;
  --fs-h2: 21px;
  --fs-h1: 28px;
  --fs-display: 40px;
  --fs-stat: 30px;

  --lh-tight: 1.34;
  --lh-body: 1.85;

  /* ---------- 间距 ---------- */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 32px;
  --sp-8: 40px;
  --sp-9: 56px;

  /* ---------- 圆角 ---------- */
  --r-xs: 6px;
  --r-sm: 9px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-pill: 999px;

  /* ---------- 光 ---------- */
  --sh-1: 0 1px 2px rgba(0, 0, 0, .4);
  --sh-2: 0 4px 16px -6px rgba(0, 0, 0, .6);
  --sh-3: 0 24px 70px -18px rgba(0, 0, 0, .8);
  --shine: inset 0 1px 0 rgba(255, 255, 255, .05);
  --ring: 0 0 0 3px rgba(94, 234, 212, .18);
  --glow: 0 10px 30px -12px rgba(94, 234, 212, .45);

  /* ---------- 按钮与描边 ---------- */
  --on-accent: #04120f;
  --line-hover: rgba(255, 255, 255, .22);
  --btn-a: #6ff0dc;
  --btn-b: #35d3bb;

  /* ---------- 图表专用（浅色主题会覆盖） ---------- */
  --chart-grid: rgba(255, 255, 255, .09);
  --chart-axis: rgba(255, 255, 255, .07);
  --chart-ink: #e8eaef;
  --chart-label: #8a8780;
  --chart-track: rgba(255, 255, 255, .06);
  --chart-muted: #4b5563;
  --track-shadow: inset 0 1px 2px rgba(0, 0, 0, .45);
  --mask: rgba(4, 6, 10, .72);
  --face-grad: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, 0) 46%);
  --face-edge: inset 0 1px 0 rgba(255, 255, 255, .06);
  --zebra: color-mix(in srgb, var(--surface-2) 60%, transparent);
  --hover-face: color-mix(in srgb, var(--surface-3) 80%, transparent);
  --bubble-me-bg: linear-gradient(180deg, rgba(94, 234, 212, .13), rgba(56, 189, 248, .07));

  /* ---------- 动效 ---------- */
  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --dur-1: .12s;
  --dur-2: .2s;
  --dur-3: .32s;
  --dur-4: .5s;
}

/* ========== 主题：素纸（浅色） ========== */
:root[data-theme="light"] {
  --bg: #efeae0;
  --paper: #efeae0;
  --surface: #fffefb;
  --surface-2: #faf7f0;
  --surface-3: #f1ece1;
  --surface-4: #e6e0d2;
  --ink: #1a1d24;
  --ink-2: #454b57;
  --muted: #767d8b;
  --line: rgba(26, 29, 36, .11);
  --line-strong: rgba(26, 29, 36, .2);
  --line-hover: rgba(26, 29, 36, .32);

  /* 强调色在白底上要压深，否则对比度不够 */
  --accent: #0f766e;
  --accent-2: #0369a1;
  --accent-3: #cfe8e4;
  --accent-soft: rgba(15, 118, 110, .09);
  --amber: #b45309;
  --amber-soft: rgba(180, 83, 9, .1);
  --danger: #b91c1c;
  --danger-soft: rgba(185, 28, 28, .09);
  --ok: #15803d;
  --ok-soft: rgba(21, 128, 61, .1);

  --t-basic: #b45309;
  --t-basic-soft: rgba(180, 83, 9, .1);
  --t-mid: #0369a1;
  --t-mid-soft: rgba(3, 105, 161, .1);
  --t-high: #6d28d9;
  --t-high-soft: rgba(109, 40, 217, .1);

  --on-accent: #ffffff;
  --btn-a: #14907f;
  --btn-b: #0f766e;

  --chart-grid: rgba(26, 29, 36, .1);
  --face-grad: linear-gradient(180deg, #ffffff, #fdfbf6 62%);
  --face-edge: inset 0 1px 0 rgba(255, 255, 255, .9);
  --zebra: rgba(26, 29, 36, .022);
  --hover-face: rgba(26, 29, 36, .045);
  --chart-axis: rgba(26, 29, 36, .08);
  --chart-ink: #1a1d24;
  --chart-label: #6b7280;
  --chart-track: rgba(26, 29, 36, .07);
  --chart-muted: #c3c8d0;
  --track-shadow: inset 0 1px 2px rgba(26, 29, 36, .08);
  --mask: rgba(26, 29, 36, .34);
  --bubble-me-bg: linear-gradient(180deg, rgba(15, 118, 110, .09), rgba(3, 105, 161, .05));

  --sh-1: 0 1px 2px rgba(26, 29, 36, .06);
  --sh-2: 0 4px 16px -6px rgba(26, 29, 36, .12);
  --sh-3: 0 24px 70px -18px rgba(26, 29, 36, .18);
  --shine: inset 0 1px 0 rgba(255, 255, 255, .9);
  --ring: 0 0 0 3px rgba(15, 118, 110, .18);
  --glow: 0 10px 30px -12px rgba(15, 118, 110, .35);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 深色底光：两团冷光 + 一团暖光，极慢漂移 */
body::before {
  content: "";
  position: fixed;
  inset: -10%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(1300px 900px at 10% 6%, rgba(56, 189, 248, .13), transparent 64%),
    radial-gradient(1200px 820px at 92% 12%, rgba(167, 139, 250, .11), transparent 62%),
    radial-gradient(1250px 860px at 52% 96%, rgba(240, 180, 41, .07), transparent 66%);
  will-change: transform;
  animation: aurora 60s var(--ease) infinite alternate;
}
@keyframes aurora {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(-2%, 1.5%, 0) scale(1.06); }
  100% { transform: translate3d(2%, -1.2%, 0) scale(1.03); }
}

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; margin: 0; letter-spacing: .01em; line-height: var(--lh-tight); }
p { margin: 0 0 var(--sp-2); }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
img { max-width: 100%; display: block; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-xs); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: none; }
::selection { background: var(--accent-soft); color: var(--ink); }

/* ---------- 动效基元 ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes pop {
  from { opacity: 0; transform: translateY(6px) scale(.985); }
  to { opacity: 1; transform: none; }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sp { to { transform: rotate(360deg); } }
@keyframes breathe { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }

#view.enter > * { animation: rise var(--dur-3) var(--ease-out) both; }
#view.enter > *:nth-child(1) { animation-delay: 0s; }
#view.enter > *:nth-child(2) { animation-delay: .045s; }
#view.enter > *:nth-child(3) { animation-delay: .09s; }
#view.enter > *:nth-child(4) { animation-delay: .135s; }
#view.enter > *:nth-child(5) { animation-delay: .18s; }
#view.enter > *:nth-child(n+6) { animation-delay: .22s; }

#view.enter .class-grid > *,
#view.enter .grid-3 > *,
#view.enter .grid-4 > *,
#view.enter .stat { animation: rise var(--dur-4) var(--ease-out) both; animation-delay: calc(var(--i, 0) * 26ms); }

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

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-8) var(--sp-7);
  position: relative;
  z-index: 1;
  overflow: hidden;
}
.login-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1040px;
  display: grid;
  grid-template-columns: 1fr 384px;
  gap: clamp(var(--sp-7), 5vw, 76px);
  align-items: center;
}
.login-hero { position: relative; padding: var(--sp-6) 0; }
.login-wrap::after {
  content: "";
  position: absolute; left: -200px; bottom: -240px;
  width: 560px; height: 560px; border-radius: 50%;
  border: 1px solid var(--line);
  box-shadow: 0 0 0 54px rgba(94, 234, 212, .03), 0 0 0 55px var(--line);
  opacity: .8;
  pointer-events: none;
  z-index: 0;
}
.login-kicker {
  font-size: var(--fs-micro); letter-spacing: .26em; color: var(--muted);
  display: flex; align-items: center; gap: var(--sp-3);
}
.login-kicker::before { content: ""; width: 26px; height: 1px; background: var(--accent); opacity: .6; flex: none; }
.login-title {
  font-size: clamp(34px, 3.2vw, 46px); line-height: 1.24; margin: var(--sp-4) 0 var(--sp-4);
  letter-spacing: .02em;
}
.login-title em {
  font-style: normal;
  background: linear-gradient(96deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.login-lede { max-width: 27em; color: var(--ink-2); font-size: var(--fs-lead); line-height: 1.9; }

.ladder { display: flex; flex-direction: column; gap: var(--sp-3); margin-top: var(--sp-6); }
.ladder-row {
  display: grid; grid-template-columns: 84px 1fr; gap: var(--sp-4); align-items: center;
  padding: var(--sp-3) var(--sp-5);
  border: 1px solid var(--line); border-left: 3px solid var(--line-strong);
  border-radius: var(--r-md); background: var(--surface);
  box-shadow: var(--shine);
  transition: transform var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease), background var(--dur-2) var(--ease);
}
.ladder-row:hover { transform: translateY(-2px); background: var(--surface-2); }
.ladder-row.lv-basic { border-left-color: var(--t-basic); }
.ladder-row.lv-mid { border-left-color: var(--t-mid); }
.ladder-row.lv-high { border-left-color: var(--t-high); }
.ladder-row .lv {
  font-family: var(--serif); font-size: var(--fs-lead);
  display: flex; flex-direction: column; gap: 1px;
}
.ladder-row .lv .step {
  font-family: var(--sans); font-size: 10px; letter-spacing: .16em; color: var(--muted); line-height: 1.4;
}
.ladder-row .dsc { font-size: var(--fs-meta); color: var(--muted); line-height: 1.72; }
.login-hero .hero-foot {
  margin-top: var(--sp-7);
  font-size: var(--fs-micro); color: var(--muted);
  display: flex; gap: var(--sp-4); flex-wrap: wrap;
}

.login-panel { display: flex; align-items: center; justify-content: center; }
.login-card {
  width: 100%;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--sp-7);
  box-shadow: var(--shine), var(--sh-3);
}
.login-card h2 { font-size: var(--fs-h2); margin-bottom: var(--sp-1); }
.login-card .sub { color: var(--muted); font-size: var(--fs-meta); margin-bottom: var(--sp-6); }

.tabs {
  display: flex; gap: var(--sp-1); background: var(--surface-3);
  padding: 4px; border-radius: var(--r-sm); margin-bottom: var(--sp-5);
}
.tabs button {
  flex: 1; border: 0; background: transparent; padding: 9px 0; border-radius: var(--r-xs);
  cursor: pointer; color: var(--muted); font-size: var(--fs-small);
  transition: background var(--dur-2) var(--ease), color var(--dur-2) var(--ease);
}
.tabs button:hover { color: var(--ink-2); }
.tabs button.on { background: var(--surface-4); color: var(--ink); font-weight: 600; box-shadow: var(--shine); }

.field { margin-bottom: var(--sp-4); }
.field label { display: block; font-size: var(--fs-meta); color: var(--ink-2); margin-bottom: var(--sp-2); }
.field .hint { font-size: var(--fs-micro); color: var(--muted); margin-top: var(--sp-2); line-height: 1.7; }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line-strong); background: var(--surface-2);
  border-radius: var(--r-sm); padding: 10px 13px; outline: none; color: var(--ink);
  transition: border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease), background var(--dur-2) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: #5c6472; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-hover); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent); box-shadow: var(--ring); background: var(--surface-3);
}
.textarea { resize: vertical; line-height: var(--lh-body); min-height: 120px; }
.select {
  appearance: none; padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}

.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  border: 1px solid transparent; border-radius: var(--r-sm);
  padding: 10px 18px; cursor: pointer; font-size: var(--fs-small); font-weight: 600;
  color: var(--on-accent);
  background: linear-gradient(180deg, var(--btn-a, #6ff0dc), var(--btn-b, #35d3bb));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), var(--sh-1);
  transition: transform var(--dur-1) var(--ease), box-shadow var(--dur-2) var(--ease), filter var(--dur-2) var(--ease);
  white-space: nowrap;
}
.btn::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 34%, rgba(255, 255, 255, .45) 46%, transparent 58%);
  transform: translateX(-130%);
  transition: transform var(--dur-4) var(--ease);
}
.btn:hover { filter: brightness(1.05); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), var(--glow); }
.btn:hover::after { transform: translateX(130%); }
.btn:active { transform: translateY(1px); box-shadow: var(--sh-1); }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.btn-ghost {
  background: var(--surface-2); color: var(--ink-2); border-color: var(--line-strong);
  box-shadow: var(--shine); font-weight: 500;
}
.btn-ghost::after { display: none; }
.btn-ghost:hover { background: var(--surface-3); color: var(--ink); border-color: var(--line-hover); filter: none; }
.btn-soft { background: var(--accent-soft); color: var(--accent); box-shadow: none; font-weight: 500; }
.btn-soft::after { display: none; }
.btn-soft:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); filter: none; }
.btn-sm { padding: 7px 12px; font-size: var(--fs-meta); }
.btn-block { width: 100%; }
.btn-danger { background: transparent; color: var(--danger); border-color: rgba(248, 113, 113, .32); box-shadow: none; font-weight: 500; }
.btn-danger::after { display: none; }
.btn-danger:hover { background: var(--danger-soft); filter: none; box-shadow: none; }

.msg {
  font-size: var(--fs-meta); padding: 9px 13px; border-radius: var(--r-sm);
  margin-bottom: var(--sp-3); display: none; animation: pop var(--dur-2) var(--ease-out);
}
.msg.show { display: block; }
.msg.err { background: var(--danger-soft); color: #fca5a5; border: 1px solid rgba(248, 113, 113, .3); }
.msg.ok { background: var(--ok-soft); color: #86efac; border: 1px solid rgba(74, 222, 128, .28); }

.notice {
  display: flex; gap: var(--sp-3); align-items: flex-start;
  font-size: var(--fs-meta); line-height: 1.72; color: var(--ink-2);
  background: var(--amber-soft); border: 1px solid rgba(240, 180, 41, .26); border-left: 3px solid var(--amber);
  border-radius: var(--r-sm); padding: 10px 13px; margin-bottom: var(--sp-4);
  animation: pop var(--dur-3) var(--ease-out);
}
.notice .ni { flex: none; font-family: var(--serif); color: var(--amber); font-size: var(--fs-small); line-height: 1.6; }

/* ---------- 应用外壳 ---------- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; position: relative; z-index: 1; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: var(--sp-5) var(--sp-4) var(--sp-4);
  display: flex; flex-direction: column;
}
.brand { display: flex; gap: var(--sp-3); align-items: center; padding: 0 var(--sp-2) var(--sp-5); border-bottom: 1px solid var(--line); }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  display: grid; place-items: center; font-family: var(--serif);
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 22%, transparent), color-mix(in srgb, var(--accent-2) 10%, transparent));
  color: var(--accent); font-size: 19px; letter-spacing: 0;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  box-shadow: 0 0 20px -6px color-mix(in srgb, var(--accent) 45%, transparent);
}
.brand-name { font-family: var(--serif); font-size: var(--fs-small); line-height: 1.4; }
.brand-sub {
  font-size: var(--fs-micro); color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 168px;
}

.nav { display: flex; flex-direction: column; gap: 2px; padding: var(--sp-4) 0; flex: 1; }
.nav a {
  position: relative;
  display: flex; align-items: center; gap: var(--sp-3); padding: 9px 11px;
  border-radius: var(--r-sm); color: var(--ink-2); font-size: var(--fs-small);
  transition: background var(--dur-2) var(--ease), color var(--dur-2) var(--ease);
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.on {
  background: linear-gradient(90deg, var(--accent-soft), transparent);
  color: var(--accent); font-weight: 600;
  box-shadow: inset 2px 0 0 var(--accent);
}
.nav-i {
  width: 22px; height: 22px; flex: none; border-radius: var(--r-xs); display: grid; place-items: center;
  font-family: var(--serif); font-size: var(--fs-micro); color: var(--muted);
  border: 1px solid var(--line); background: var(--surface-2);
  transition: color var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease);
}
.nav a.on .nav-i { border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: var(--accent-soft); color: var(--accent); }
.nav .dot {
  margin-left: auto; width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger); display: none; box-shadow: 0 0 0 3px var(--danger-soft);
}
.nav .dot.on { display: block; animation: breathe 2.4s var(--ease) infinite; }

.side-foot { border-top: 1px solid var(--line); padding-top: var(--sp-3); }
.who { padding: 0 var(--sp-2) 10px; }
.who-name { font-size: var(--fs-small); font-weight: 600; }
.who-meta { font-size: var(--fs-micro); color: var(--muted); }
.side-foot .btn { width: 100%; }

.main {
  padding: var(--sp-6) var(--sp-8) var(--sp-9);
  max-width: 1480px;
  margin-inline: auto;
  width: 100%;
}
@media (min-width: 1440px) {
  :root { --fs-h1: 32px; --fs-stat: 34px; }
  .main { padding: var(--sp-7) var(--sp-9) var(--sp-9); }
}
@media (min-width: 1900px) {
  .main { max-width: 1640px; }
}
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-5);
  padding: var(--sp-4) 0;
  margin: calc(var(--sp-6) * -1) 0 var(--sp-5);
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-2) var(--ease);
}
.topbar.stuck { border-bottom-color: var(--line); }
.page-title { font-size: var(--fs-h1); letter-spacing: .015em; }
.page-sub { color: var(--muted); font-size: var(--fs-meta); margin-top: 2px; }
.topbar-right { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; padding-bottom: 4px; }

/* ---------- 指针光斑 ---------- */
.card, .stu-card, .stat, .tier-card, .mentor-tab { position: relative; }
.card::before, .stu-card::before, .stat::before, .tier-card::before, .mentor-tab::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, -30%),
              rgba(94, 234, 212, .10), rgba(94, 234, 212, .03) 45%, transparent 72%);
  opacity: 0;
  transition: opacity var(--dur-3) var(--ease);
}
.card:hover::before, .stu-card:hover::before, .stat:hover::before,
.tier-card:hover::before, .mentor-tab:hover::before { opacity: 1; }
.card:hover, .tier-card:hover, .mentor-tab:hover {
  border-color: color-mix(in srgb, var(--accent) 24%, transparent);
  box-shadow: var(--shine), var(--sh-2), 0 0 0 1px var(--accent-soft);
}
.stu-card:hover { border-color: color-mix(in srgb, var(--accent) 24%, transparent); box-shadow: var(--shine), var(--sh-2), 0 0 0 1px var(--accent-soft); }

/* ---------- 通用组件 ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: var(--sp-5) var(--sp-6);
  box-shadow: var(--shine), var(--sh-1);
}
.card + .card { margin-top: var(--sp-4); }
.grid-2 > .card + .card,
.grid-3 > .card + .card,
.grid-4 > .card + .card,
.class-grid > .card + .card { margin-top: 0; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-4); }
.card-title { font-family: var(--serif); font-size: var(--fs-h3); }
.card-sub { color: var(--muted); font-size: var(--fs-meta); margin-top: 2px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap .table { min-width: 660px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px; border-radius: var(--r-pill);
  font-size: var(--fs-micro); line-height: 1.75; font-weight: 500;
  background: var(--surface-3); color: var(--ink-2); border: 1px solid transparent;
}
.chip.basic { background: var(--t-basic-soft); color: var(--t-basic); }
.chip.mid { background: var(--t-mid-soft); color: var(--t-mid); }
.chip.high { background: var(--t-high-soft); color: var(--t-high); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.danger { background: var(--danger-soft); color: var(--danger); }
.chip.line { background: transparent; border-color: var(--line-strong); color: var(--muted); }

.stat-row {
  display: grid; grid-template-columns: repeat(5, 1fr);
  margin-bottom: var(--sp-5);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--shine), var(--sh-1); overflow: hidden;
}
.stat {
  position: relative;
  background: transparent; border: 0; border-right: 1px solid var(--line); border-radius: 0;
  padding: var(--sp-4) var(--sp-5); box-shadow: none;
  transition: background var(--dur-2) var(--ease);
}
.stat:last-child { border-right: 0; }
.stat:hover { background: var(--surface-2); }
.stat .n { font-family: var(--serif); font-size: var(--fs-stat); line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat .l { font-size: var(--fs-micro); color: var(--muted); margin-top: 2px; }
.stat.warn .n { color: var(--danger); }

.empty {
  text-align: center; padding: var(--sp-8) var(--sp-5); color: var(--muted); font-size: var(--fs-meta);
  border: 1px dashed var(--line-strong); border-radius: var(--r-md); background: var(--surface-2);
}
.empty .em {
  display: block; font-family: var(--serif); font-size: 18px; color: var(--line-strong);
  margin-bottom: var(--sp-2); letter-spacing: .2em;
}
.hr { height: 1px; background: var(--line); border: 0; margin: var(--sp-5) 0; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-meta); }
.mono { font-variant-numeric: tabular-nums; }

/* ---------- 可视化组件 ---------- */
.viz-grid { display: grid; gap: var(--sp-4); }
.viz-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.viz-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* 画像卡三栏：雷达 / 六维条 / 关键数字竖排，铺满整行不留空 */
.viz-hero { grid-template-columns: 300px minmax(0, 1fr) 250px; align-items: center; }
.kpi-col { display: flex; flex-direction: column; gap: var(--sp-2); }
.kpi-col .kpi { padding: var(--sp-2) var(--sp-4); }

.viz-card { display: flex; flex-direction: column; }
/* 画像卡横跨整页时，图表不要跟着无限拉宽 */
.viz-card .viz-grid.viz-hero { column-gap: var(--sp-6); }
.viz-card .viz-body { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; }
.viz-card .viz-body.top { align-items: flex-start; }

.legend { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); margin-top: var(--sp-3); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-micro); color: var(--muted); }
.legend-dot { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.legend-item b { color: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums; }

.bars { display: flex; flex-direction: column; gap: 9px; width: 100%; }
.bar-row { display: grid; grid-template-columns: 46px minmax(0, 1fr) 46px; gap: var(--sp-3); align-items: center; }
.bar-lb { font-size: var(--fs-meta); color: var(--ink-2); }
.bar-track {
  height: 8px; border-radius: var(--r-pill); background: var(--chart-track); overflow: hidden;
  box-shadow: var(--track-shadow, inset 0 1px 2px rgba(0, 0, 0, .35));
}
.bar-fill {
  display: block; height: 100%; border-radius: var(--r-pill);
  transition: width var(--dur-4) var(--ease-out);
}
.bar-vl { font-size: var(--fs-micro); color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

.chart { width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-radar { max-width: 300px; margin: 0 auto; }
/* 环形图不写死尺寸，跟着卡片走但不超过 190 */
.viz-body > svg[aria-label="占比环形图"] { max-width: 190px; }
.legend-col { flex-direction: column; gap: 7px; margin-top: 0; }
.legend-col .legend-item { width: 100%; font-size: var(--fs-meta); }
.legend-pct { color: var(--muted); font-size: var(--fs-micro); min-width: 34px; text-align: right; }
/* 曲线不铺满整卡：太宽会把折线拉成缓坡，读不出变化 */
/* 字数曲线铺满卡片宽度；viewBox 1400x175 保证高度不被拉高 */
.chart.growth { max-width: 900px; margin: 0 auto; }

.kpi-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); }
.kpi {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: var(--sp-3) var(--sp-4);
}
.kpi .kv { font-family: var(--serif); font-size: 22px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi .kl { font-size: var(--fs-micro); color: var(--muted); margin-top: 2px; }

/* ---------- 对话 ---------- */
.chat-box { display: flex; flex-direction: column; gap: var(--sp-4); }
.bubble-row { display: flex; gap: var(--sp-3); align-items: flex-start; }
.bubble-row.me { flex-direction: row-reverse; }
.chat-box .bubble-row:last-child { animation: pop var(--dur-3) var(--ease-out) both; }
.avatar {
  width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center;
  font-size: var(--fs-meta); font-family: var(--serif); border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink-2); box-shadow: var(--shine);
}
.bubble-row.me .avatar { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 34%, transparent); }
.bubble {
  max-width: min(660px, 76%); padding: 11px 15px; border-radius: 4px 14px 14px 14px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: var(--fs-body); line-height: var(--lh-body);
  box-shadow: var(--shine), var(--sh-1);
  white-space: pre-wrap; word-break: break-word;
}
.bubble-row.me .bubble {
  border-radius: 14px 4px 14px 14px;
  background: var(--bubble-me-bg);
  border-color: color-mix(in srgb, var(--accent) 28%, transparent); color: var(--ink);
  box-shadow: var(--shine), var(--sh-1);
}
.bubble .bubble-name { font-size: var(--fs-micro); color: var(--muted); margin-bottom: 3px; }
.bubble.typing { color: var(--muted); font-style: italic; }
.bubble strong { font-weight: 600; color: var(--ink); }

.composer {
  display: flex; gap: var(--sp-3); align-items: flex-end;
  border-top: 1px solid var(--line); padding-top: var(--sp-4); margin-top: var(--sp-5);
}
.composer .textarea { min-height: 54px; max-height: 190px; padding: 10px 13px; }
.composer-actions { display: flex; flex-direction: column; gap: 6px; }

.quick-replies { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-top: var(--sp-3); }
.quick-replies button {
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink-2);
  border-radius: var(--r-pill); padding: 5px 12px; font-size: var(--fs-meta); cursor: pointer;
  transition: border-color var(--dur-2) var(--ease), color var(--dur-2) var(--ease), background var(--dur-2) var(--ease);
}
.quick-replies button:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ---------- 导师工坊 ---------- */
.studio { display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: var(--sp-5); align-items: start; }
.mentor-tabs { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-4); flex-wrap: wrap; }
.mentor-tab {
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-md);
  padding: 9px 14px; cursor: pointer; text-align: left;
  box-shadow: var(--shine), var(--sh-1);
  transition: transform var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease), background var(--dur-2) var(--ease);
}
.mentor-tab:hover { transform: translateY(-2px); background: var(--surface-2); }
.mentor-tab .mt-name { font-size: var(--fs-small); font-weight: 600; }
.mentor-tab .mt-role { font-size: var(--fs-micro); color: var(--muted); }
.mentor-tab.on { border-color: color-mix(in srgb, var(--accent) 42%, transparent); background: var(--accent-soft); }
.mentor-tab.on .mt-role { color: var(--accent); }
.mentor-tab .lock { font-size: var(--fs-micro); color: var(--amber); margin-left: 6px; }

.draft-panel { position: sticky; top: 84px; display: flex; flex-direction: column; gap: var(--sp-4); }
.version-list { display: flex; flex-direction: column; gap: 6px; max-height: 236px; overflow: auto; }
.version-item {
  display: flex; align-items: center; gap: var(--sp-3); padding: 8px 10px;
  border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer;
  font-size: var(--fs-meta); background: var(--surface-2);
  transition: transform var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease), background var(--dur-2) var(--ease);
}
.version-item:hover { transform: translateX(2px); border-color: var(--line-strong); background: var(--surface-3); }
.version-item.on { border-color: color-mix(in srgb, var(--accent) 42%, transparent); background: var(--accent-soft); }
.version-item .v { font-family: var(--serif); color: var(--accent); }
.version-item .meta { margin-left: auto; color: var(--muted); }

/* ---------- 教师端 ---------- */
.stu-card[data-tier="basic"]:not(.stuck) { border-left-color: var(--t-basic); }
.stu-card[data-tier="mid"]:not(.stuck) { border-left-color: var(--t-mid); }
.stu-card[data-tier="high"]:not(.stuck) { border-left-color: var(--t-high); }

.filter-bar {
  position: sticky; top: 96px; z-index: 18;
  background: var(--surface);
  box-shadow: var(--shine), var(--sh-2);
}
.class-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(212px, 1fr)); gap: var(--sp-3); }
.class-grid > * { min-height: 108px; }
.stu-card {
  position: relative;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 12px 14px; cursor: pointer; border-left: 3px solid transparent;
  box-shadow: var(--shine), var(--sh-1);
  transition: transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease);
}
.stu-card:hover { transform: translateY(-3px); box-shadow: var(--shine), var(--sh-2); }
.stu-card.stuck { border-left-color: var(--danger); background: linear-gradient(180deg, var(--danger-soft), var(--surface)); }
.stu-card.done { opacity: .72; }
.stu-head { display: flex; align-items: baseline; gap: var(--sp-2); }
.stu-no { font-family: var(--serif); font-size: var(--fs-micro); color: var(--muted); }
.stu-name { font-size: var(--fs-small); font-weight: 600; }
.stu-row { display: flex; align-items: center; gap: 6px; margin-top: var(--sp-2); flex-wrap: wrap; }
.stu-meta { font-size: var(--fs-micro); color: var(--muted); margin-top: 6px; display: flex; gap: 10px; flex-wrap: wrap; }
.stu-weak {
  margin-top: 7px; padding-top: 7px; border-top: 1px dashed var(--line);
  font-size: var(--fs-micro); color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stu-weak.empty-weak { color: var(--muted); opacity: .72; }
.stuck-flag {
  position: absolute; top: 10px; right: 12px; font-size: 10.5px; color: var(--danger);
  background: var(--danger-soft); border-radius: var(--r-pill); padding: 1px 8px;
}

.detail-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: var(--sp-5); align-items: start; }
.seg {
  display: inline-flex; background: var(--surface-3); padding: 3px;
  border-radius: var(--r-sm); gap: 3px;
}
.seg button {
  border: 0; background: transparent; padding: 6px 13px; border-radius: var(--r-xs);
  font-size: var(--fs-meta); color: var(--muted); cursor: pointer;
  transition: background var(--dur-2) var(--ease), color var(--dur-2) var(--ease);
}
.seg button:hover { color: var(--ink-2); }
.seg button.on { background: var(--surface-4); color: var(--ink); font-weight: 600; box-shadow: var(--shine); }

.table { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table th { font-size: var(--fs-micro); color: var(--muted); font-weight: 500; background: var(--surface-2); letter-spacing: .02em; }
.table tbody tr { transition: background var(--dur-1) var(--ease); }
.table tbody tr:hover td { background: var(--surface-2); }

.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 1px; background: var(--line-strong); }
.tl-item { position: relative; padding-bottom: var(--sp-4); }
.tl-item::before {
  content: ""; position: absolute; left: -20px; top: 7px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong);
  transition: border-color var(--dur-2) var(--ease), background var(--dur-2) var(--ease);
}
.tl-item.on::before { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.tl-title { font-size: var(--fs-small); font-weight: 600; }
.tl-meta { font-size: var(--fs-micro); color: var(--muted); }
.tl-body { margin-top: var(--sp-2); font-size: var(--fs-small); color: var(--ink-2); line-height: var(--lh-body); white-space: pre-wrap; }

.note-item { border-left: 2px solid color-mix(in srgb, var(--accent) 34%, transparent); padding: 2px 0 2px 12px; margin-bottom: var(--sp-4); }
.note-item .nh { display: flex; gap: var(--sp-2); align-items: center; font-size: var(--fs-micro); color: var(--muted); }
.note-item .nb { font-size: var(--fs-small); margin-top: 3px; white-space: pre-wrap; }

.report { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shine), var(--sh-1); background: var(--surface); }
.report-head {
  padding: var(--sp-5) var(--sp-6); background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: var(--sp-4); align-items: center;
}
.report-body { padding: var(--sp-5) var(--sp-6); }
.wk { padding: var(--sp-3) 0; border-bottom: 1px dashed var(--line); }
.wk:last-child { border-bottom: 0; }
.wk-t { font-size: var(--fs-small); font-weight: 600; display: flex; gap: var(--sp-2); align-items: center; }
.wk-t .idx { font-family: var(--serif); color: var(--accent); font-size: var(--fs-micro); }
.wk-d { font-size: var(--fs-small); color: var(--ink-2); margin-top: 2px; line-height: var(--lh-body); }

.check-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.check-item {
  display: flex; gap: var(--sp-3); align-items: flex-start; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2);
  font-size: var(--fs-small); line-height: 1.8; cursor: pointer;
  transition: background var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease);
}
.check-item:hover { border-color: color-mix(in srgb, var(--accent) 34%, transparent); }
.check-item input { margin-top: 5px; accent-color: var(--accent); }
.check-item.done { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }

.check-list.bare { gap: 0; }
.check-list.bare .check-item {
  border: 0; border-bottom: 1px dashed var(--line); border-radius: 0;
  background: transparent; padding: 11px 2px;
}
.check-list.bare .check-item:last-child { border-bottom: 0; }
.check-list.bare .check-item:hover { background: var(--surface-2); border-color: transparent; }
.tool-count {
  font-size: var(--fs-micro); color: var(--muted); font-variant-numeric: tabular-nums;
  background: var(--surface-3); border-radius: var(--r-pill); padding: 1px 9px;
  transition: background var(--dur-2) var(--ease), color var(--dur-2) var(--ease);
}
.tool-foot { display: flex; align-items: center; justify-content: space-between; margin-top: var(--sp-3); }
.tool-card { display: flex; flex-direction: column; }
.tool-card .check-list { flex: 1; }
.tool-card .tool-foot { margin-top: auto; padding-top: var(--sp-3); }

.tier-card {
  display: flex; flex-direction: column;
  transition: transform var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease);
}
.tier-card:hover { transform: translateY(-2px); }
.tier-card .tier-foot { margin-top: auto; padding-top: var(--sp-3); }

.modal-mask {
  position: fixed; inset: 0; background: var(--mask);
  display: none; align-items: center; justify-content: center; padding: var(--sp-6); z-index: 60;
}
.modal-mask.on { display: flex; animation: fade var(--dur-2) var(--ease); }
.modal {
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-lg); width: min(620px, 100%);
  max-height: 84vh; display: flex; flex-direction: column;
  box-shadow: var(--sh-3);
  animation: pop var(--dur-3) var(--ease-out);
}
.modal-head { padding: var(--sp-5) var(--sp-6); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: var(--sp-5) var(--sp-6); overflow: auto; }
.modal-foot { padding: var(--sp-4) var(--sp-6); border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: var(--sp-3); }

.toast {
  position: fixed; left: 50%; bottom: 30px;
  transform: translateX(-50%) translateY(14px) scale(.98);
  background: var(--surface-4); color: var(--ink); border: 1px solid var(--line-strong);
  padding: 10px 18px; border-radius: var(--r-pill);
  font-size: var(--fs-meta); opacity: 0; pointer-events: none; z-index: 90;
  box-shadow: var(--sh-3);
  transition: opacity var(--dur-3) var(--ease-out), transform var(--dur-3) var(--ease-out);
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
.toast.err { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 42%, transparent); color: var(--danger); }

.spin {
  width: 14px; height: 14px; border: 2px solid color-mix(in srgb, var(--on-accent) 30%, transparent); border-top-color: var(--on-accent);
  border-radius: 50%; animation: sp .7s linear infinite;
}

/* 前测提交进度：一次取证一格，宽度跟着服务端事件走 */
.cq-prog { margin: 4px 0 12px; max-width: 460px; }
.cq-track {
  height: 6px; border-radius: 999px; overflow: hidden;
  background: color-mix(in srgb, var(--ink-1) 10%, transparent);
}
.cq-track > i {
  display: block; height: 100%; width: 0; border-radius: 999px;
  background: var(--accent); transition: width var(--dur-3) var(--ease-out);
}
.cq-text { margin-top: 6px; font-variant-numeric: tabular-nums; }

/* ---------- 响应式 ---------- */
@media (max-width: 1120px) {
  .studio, .detail-grid, .grid-2 { grid-template-columns: 1fr; }
  .viz-2, .viz-hero { grid-template-columns: 1fr; }
  .kpi-col { flex-direction: row; }
  .login-inner { grid-template-columns: 1fr 360px; gap: var(--sp-7); }
  .draft-panel { position: static; }
  .stat-row { grid-template-columns: repeat(3, 1fr); }
  .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .main { padding: var(--sp-5) var(--sp-6) var(--sp-8); }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: sticky; height: auto; flex-direction: row; align-items: center;
    padding: var(--sp-2) var(--sp-3); gap: var(--sp-2);
    background: var(--surface);
  }
  .brand { border: 0; padding: 0; }
  .brand-name, .brand-sub { display: none; }
  .brand-mark { width: 32px; height: 32px; font-size: 16px; border-radius: 9px; }
  .nav {
    flex-direction: row; overflow-x: auto; padding: 0 6px 0 0; gap: 2px;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent 100%);
    mask-image: linear-gradient(90deg, #000 88%, transparent 100%);
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; padding: 7px 9px; font-size: var(--fs-meta); }
  .nav a .nav-i { display: none; }
  .nav a.on { box-shadow: inset 0 -2px 0 var(--accent); background: transparent; }
  .side-foot { border: 0; padding: 0; display: flex; align-items: center; margin-left: auto; }
  .who { display: none; }
  .side-foot .btn { width: auto; }
  .main { padding: var(--sp-3) var(--sp-4) var(--sp-8); }
  /* 窄屏顶栏：标题一行，右侧状态 chips 折到下一行，不再被裁出屏幕 */
  .topbar {
    padding: var(--sp-3) 0; margin: calc(var(--sp-3) * -1) 0 var(--sp-4);
    flex-wrap: wrap; align-items: flex-start; gap: var(--sp-2);
  }
  .topbar-right { padding-bottom: 0; }
  .page-title { font-size: 22px; }
  .login-wrap { padding: var(--sp-4); }
  .login-inner { grid-template-columns: 1fr; gap: var(--sp-5); }
  .login-hero { display: none; }
  .grid-3, .grid-4, .viz-3 { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .card { padding: var(--sp-4); }
  .report-head, .report-body { padding: var(--sp-4); }
  .bubble { max-width: 84%; }
  .kpi-row { gap: var(--sp-2); }
  .kpi { padding: var(--sp-2) var(--sp-3); }
  .kpi .kv { font-size: 18px; }
}

/* ========== 主题切换按钮 ========== */
.theme-toggle {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; padding: 0;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 14px; line-height: 1;
  cursor: pointer;
  transition: color var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease),
              background var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
}
.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: rotate(-12deg);
}
.theme-toggle .theme-icon { display: block; transition: transform var(--dur-3) var(--ease); }

/* 登录页右上角的切换按钮 */
.login-theme {
  position: absolute; top: 20px; right: 22px; z-index: 5;
}
@media (max-width: 720px) {
  .login-theme { top: 14px; right: 14px; }
}

/* 浅色主题微调：装饰环在白底上会显脏，压到极淡 */
:root[data-theme="light"] .login-wrap::after {
  opacity: .35;
}
:root[data-theme="light"] .btn:hover { filter: brightness(1.08); }

/* ========== 小测实时进度 ========== */
.quiz-progress {
  display: flex; align-items: center; gap: var(--sp-5);
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
}
.qp-ring { flex: none; display: grid; place-items: center; }
.qp-body { flex: 1; min-width: 0; max-width: 720px; }
.qp-line { font-size: var(--fs-small); color: var(--ink-2); }
.qp-line b { font-size: var(--fs-h3); color: var(--ink); font-variant-numeric: tabular-nums; }
.qp-pct { float: right; font-size: var(--fs-meta); color: var(--muted); font-variant-numeric: tabular-nums; }
.qp-bar {
  height: 4px; margin: 7px 0 10px;
  border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden;
}
.qp-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width var(--dur-3) var(--ease); }
.qp-dims { display: flex; flex-wrap: wrap; gap: 6px; }
.dim-chip {
  padding: 2px 9px; border-radius: var(--r-pill);
  border: 1px solid var(--line);
  font-size: var(--fs-micro); color: var(--muted);
  transition: all var(--dur-2) var(--ease);
}
.dim-chip.done {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: var(--accent-soft); color: var(--accent); font-weight: 600;
}

/* ========== 工坊本轮状态 ========== */
.studio-stats {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px; margin-bottom: var(--sp-4);
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--line); overflow: hidden;
}
.ss-cell { padding: var(--sp-3) var(--sp-4); background: var(--surface); }
.ss-v {
  font-family: var(--serif); font-size: 22px; color: var(--ink);
  font-variant-numeric: tabular-nums; line-height: 1.25;
}
.ss-v.sm { font-family: var(--sans); font-size: var(--fs-small); font-weight: 600; }
.ss-v.ok { color: var(--ok); }
.ss-v.warn { color: var(--amber); }
.ss-k { margin-top: 2px; font-size: var(--fs-micro); color: var(--muted); }

@media (max-width: 720px) {
  .quiz-progress { flex-direction: column; align-items: flex-start; gap: var(--sp-3); }
  .studio-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ========== 用户管理 ========== */
.field-label {
  display: block; font-size: var(--fs-micro); color: var(--muted);
  margin-bottom: 6px; letter-spacing: .02em;
}
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.row-acts { display: flex; gap: 4px; flex-wrap: nowrap; }
.btn-xs {
  padding: 3px 9px; font-size: var(--fs-micro); font-weight: 500; border-radius: var(--r-xs);
}
.danger-text { color: var(--danger) !important; }
.danger-text:hover { border-color: var(--danger) !important; background: var(--danger-soft) !important; }
.warn-text { color: var(--amber); }

.import-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--sp-5); }
.radio-col { display: flex; flex-direction: column; gap: 6px; }
.radio-col .check-item { padding: 8px 10px; font-size: var(--fs-meta); line-height: 1.65; }

.import-out {
  margin-top: var(--sp-4); padding-top: var(--sp-4);
  border-top: 1px dashed var(--line);
}
.cred {
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  color: var(--accent); font-weight: 600; letter-spacing: .04em;
}
.notice-line {
  font-size: var(--fs-meta); color: var(--ink-2); line-height: 1.85;
  padding: 8px 12px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--line);
}
.notice-line.warn {
  background: var(--amber-soft);
  border-color: color-mix(in srgb, var(--amber) 32%, transparent);
  color: var(--amber);
}

.stat-row .stat.warn .n { color: var(--danger); }

@media (max-width: 980px) {
  .import-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   V5 精修：材质、指标条、表格、图例、空态
   只做覆盖与叠加，不改任何类名与结构
   ========================================================= */

/* ---------- 卡片材质：一层极淡的面光，让卡片有厚度 ---------- */
.card, .stu-card, .stat-row, .tier-card, .mentor-tab {
  background-image: var(--face-grad);
  box-shadow: var(--shine), var(--face-edge), var(--sh-1);
}
.card:hover, .tier-card:hover, .mentor-tab:hover, .stu-card:hover {
  box-shadow: var(--shine), var(--face-edge), var(--sh-2), 0 0 0 1px var(--accent-soft);
}

/* ---------- 标题：字重与字距再收一点 ---------- */
.card-title { font-weight: 600; letter-spacing: .005em; }
.card-sub { letter-spacing: .01em; }
.card-head { margin-bottom: var(--sp-4); }

/* ---------- 指标条：顶部一道短促的强调线 + 更大数字 ---------- */
.stat-row { grid-auto-rows: 1fr; }
.stat-row .stat {
  display: flex; flex-direction: column; justify-content: center; gap: 3px;
  padding: 15px var(--sp-5) 17px;
  overflow: hidden;
}
.stat-row .stat::after {
  content: ""; position: absolute; left: var(--sp-5); top: 0;
  width: 28px; height: 2px; border-radius: 0 0 3px 3px;
  background: var(--accent); opacity: .6;
  transition: width var(--dur-3) var(--ease), opacity var(--dur-3) var(--ease);
}
.stat-row .stat:hover::after { width: calc(100% - var(--sp-5) * 2); opacity: .85; }
.stat-row .stat.warn::after { background: var(--danger); opacity: .8; }
.stat-row .stat .n {
  font-size: 34px; line-height: 1.06; letter-spacing: -.015em;
  color: var(--ink);
}
.stat-row .stat .l {
  font-size: var(--fs-meta); color: var(--muted);
  letter-spacing: .02em; line-height: 1.4;
}
.stat-row .stat.warn .n { color: var(--danger); }

/* ---------- 表格：粘性表头 + 斑马 + 更利落的行高 ---------- */
.table thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line-strong);
  padding-top: 9px; padding-bottom: 9px;
  letter-spacing: .04em;
}
.table tbody tr:nth-child(even) td { background: var(--zebra); }
.table tbody tr:hover td { background: var(--hover-face); }
.table td { padding: 11px 12px; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .mono { font-variant-numeric: tabular-nums; letter-spacing: .01em; }

/* ---------- 图例：数值与占比各占固定列，不再参差 ---------- */
.legend-col {
  display: flex; flex-direction: column; gap: 9px;
  margin-top: 0; width: 100%;
}
.legend-col .legend-item {
  display: grid; grid-template-columns: 9px minmax(0, 1fr) auto 40px;
  align-items: center; gap: 9px;
  font-size: var(--fs-meta); color: var(--ink-2);
}
.legend-col .legend-item b { font-size: var(--fs-small); }
.legend-col .legend-pct {
  text-align: right; color: var(--muted);
  font-variant-numeric: tabular-nums; font-size: var(--fs-micro);
}

/* ---------- 空态与载入：不再是一句灰字 ---------- */
.empty {
  position: relative; overflow: hidden;
  background-image: var(--face-grad);
}
.empty::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, var(--accent-soft) 50%, transparent 80%);
  transform: translateX(-100%);
  animation: emptySheen 2.9s var(--ease) infinite;
  pointer-events: none;
}
@keyframes emptySheen { 0% { transform: translateX(-100%); } 55%, 100% { transform: translateX(100%); } }

/* ---------- 焦点态：键盘走查时看得见 ---------- */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 68%, transparent);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* ---------- 按钮：主按钮加一层内高光，次按钮 hover 更明确 ---------- */
.btn { box-shadow: var(--face-edge); }
.btn-ghost { box-shadow: none; }
.btn-ghost:hover { background: var(--surface-3); border-color: var(--line-hover); }

/* ---------- 学生卡片：层级色条更粗，姓名与元信息分得更清 ---------- */
.stu-card { padding: 13px 15px; }
.stu-card .stu-name { letter-spacing: .01em; }
.stu-card .stu-meta { line-height: 1.65; }

/* ---------- 分栏卡片：让三卡等高，底部对齐 ---------- */
.viz-3 { align-items: stretch; }
.viz-card .viz-body { padding-top: 2px; }

/* ---------- 页面标题区：加一条渐隐分隔，收住视线 ---------- */
.page-head { position: relative; }
.page-head::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: calc(var(--sp-4) * -1);
  height: 1px;
  background: linear-gradient(90deg, var(--line-strong), transparent 72%);
  opacity: .55;
}

/* ---------- 学生卡片：层级用左侧色条直接标出来，扫一眼就能分组 ---------- */
.class-grid { grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); }
.stu-card .stu-head { gap: 7px; align-items: center; }
.stu-card .stu-no {
  font-family: var(--ui-mono, ui-monospace, Consolas, monospace);
  font-size: 10.5px; color: var(--muted);
  padding: 1px 5px; border-radius: var(--r-xs);
  background: var(--surface-3); border: 1px solid var(--line);
}
.stu-card .stu-name { font-size: var(--fs-body); font-weight: 600; letter-spacing: .01em; }
.stu-card .stu-row { margin-top: 9px; gap: 5px; }
.stu-card .stu-meta {
  margin-top: 8px; font-size: var(--fs-micro);
  color: var(--muted); gap: 12px;
  font-variant-numeric: tabular-nums;
}
.stu-card .stu-weak {
  margin-top: 7px; font-size: var(--fs-micro);
  color: var(--ink-2);
}
.stu-card[data-tier="basic"] { border-left-color: var(--t-basic); }
.stu-card[data-tier="mid"] { border-left-color: var(--t-mid); }
.stu-card[data-tier="high"] { border-left-color: var(--t-high); }
.stu-card.done:not(.stuck) { border-left-color: var(--ok); }
.stu-card.stuck { border-left-color: var(--danger); }

/* ---------- 三卡等高：把图例沉到底部，卡片底边对齐 ---------- */
.viz-card .legend { margin-top: auto; padding-top: var(--sp-3); }
.viz-card .kpi-row { margin-top: auto; }

/* ---------- 画像卡：三栏与折线之间的空隙收紧 ---------- */
.viz-card .viz-grid.viz-hero { margin-bottom: var(--sp-4); }
.viz-card .chart.growth { margin-top: var(--sp-2); }
.viz-hero { grid-template-columns: 300px minmax(0, 1fr) 250px; row-gap: var(--sp-4); }

/* ---------- 画像三栏：雷达居中收小，侧边标签留出呼吸 ---------- */
.viz-hero { align-items: center; }
.viz-hero .chart-radar { display: flex; justify-content: center; }
.viz-hero .chart-radar svg { max-width: 268px; }
.viz-hero .chart-radar { padding-left: 10px; }

/* ---------- 名册导入：两栏高度对齐，主按钮不铺满整列 ---------- */
.import-grid { align-items: start; column-gap: var(--sp-6); }
.import-grid .textarea { min-height: 196px; }
.import-grid #doImport { width: auto; min-width: 168px; margin-top: var(--sp-4); }
.import-grid .radio-col { margin-bottom: var(--sp-1); }
.import-grid > div + div {
  padding-left: var(--sp-6);
  border-left: 1px solid var(--line);
}
@media (max-width: 980px) {
  .import-grid > div + div { padding-left: 0; border-left: 0; }
}

/* ---------- 页面标题：副标题与标题拉近，右侧状态不抢视线 ---------- */
.page-head h1 { letter-spacing: -.012em; }

/* ---------- 图表容器：在 flex 卡片里撑满，避免被压成小图 ---------- */
.chart { width: 100%; }
.chart-radar { width: 100%; display: flex; justify-content: center; }
.chart-radar svg { width: 100%; height: auto; }
.viz-body .chart-radar { max-width: 300px; margin: 0 auto; }

/* ---------- 登录页提示：是说明不是告警，降为安静的注释条 ---------- */
.notice {
  background: var(--surface-2) !important;
  border: 1px solid var(--line) !important;
  color: var(--ink-2) !important;
  border-radius: var(--r-sm);
  font-size: var(--fs-micro);
  line-height: 1.7;
  padding: 9px 12px;
  display: flex; gap: 8px; align-items: flex-start;
}
.notice b { color: var(--ink); font-weight: 600; }
.notice .ni {
  color: var(--accent); flex: none;
  font-size: 9px; line-height: 1.9; opacity: .8;
}

/* ---------- 顶栏切班器：带多个班的教师按班看数据 ---------- */
.class-switch {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 0 0 var(--sp-4);
  padding: 5px; width: fit-content;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-pill);
  box-shadow: var(--shine), var(--face-edge);
}
.cs-pill {
  appearance: none; border: 0; cursor: pointer;
  padding: 5px 14px; border-radius: var(--r-pill);
  font: inherit; font-size: var(--fs-micro); font-weight: 500;
  color: var(--muted); background: transparent;
  transition: background var(--dur-2) var(--ease), color var(--dur-2) var(--ease);
}
.cs-pill:hover { color: var(--ink-2); background: var(--surface-3); }
.cs-pill.on {
  color: var(--on-accent);
  background: linear-gradient(180deg, var(--btn-a), var(--btn-b));
  box-shadow: 0 1px 0 rgba(255,255,255,.18) inset;
}

/* ---------- 任课班级勾选：一眼看出带几个班 ---------- */
.cls-boxes { display: flex; flex-wrap: wrap; gap: 6px; }
.cls-box {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--surface-2); font-size: var(--fs-micro); color: var(--muted);
  transition: all var(--dur-2) var(--ease);
}
.cls-box input { display: none; }
.cls-box:hover { border-color: var(--line-hover); color: var(--ink-2); }
.cls-box.on {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--accent-soft);
}

/* ---------- 环形图：窄屏时图例落到下方，避免文字被挤成竖排 ---------- */
.viz-donut { display: flex; flex-direction: row; align-items: center; gap: var(--sp-4); }
.viz-donut-ring { flex: none; }
.viz-donut-legend { flex: 1; min-width: 0; }
.legend-col .legend-item > span:not(.legend-pct) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 1420px) {
  .viz-donut { flex-direction: column; align-items: stretch; }
  .viz-donut-ring { align-self: center; }
  .viz-donut-legend { width: 100%; }
}

/* ---------- 教师账号行：停用态整行变灰 ---------- */
.row-off > td { opacity: .55; }
.row-off b { text-decoration: line-through; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.chip.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); background: var(--ok-soft); }
.chip.warn { color: var(--t-basic); border-color: color-mix(in srgb, var(--t-basic) 38%, transparent); background: var(--t-basic-soft); }
.row-acts { display: flex; gap: 4px; flex-wrap: wrap; }

/* ---------- 用户管理：分类卡（学生 / 教师 / 班级） ---------- */
.cat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--sp-3);
}
.cat-card {
  position: relative; overflow: hidden;
  display: grid; gap: 2px;
  padding: 16px 18px 15px 22px;
  text-align: left; cursor: pointer;
  font: inherit; color: var(--ink);
  background: var(--face-grad), var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shine), var(--face-edge);
  transition: border-color var(--dur-2) var(--ease), transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}
.cat-card:hover { border-color: var(--line-hover); transform: translateY(-1px); }
.cat-card.on {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: var(--shine), var(--face-edge), 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
}
.cat-bar {
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  opacity: .45; transition: opacity var(--dur-2) var(--ease), width var(--dur-2) var(--ease);
}
.cat-card:hover .cat-bar { opacity: .8; }
.cat-card.on .cat-bar { opacity: 1; width: 4px; }
.cat-n {
  font-size: 30px; font-weight: 600; line-height: 1.1;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}
.cat-l { font-size: var(--fs-sm); font-weight: 550; color: var(--ink-2); }
.cat-sub { font-size: var(--fs-micro); color: var(--muted); margin-top: 3px; }

/* ---------- 层级释义（诊断结果页 + 首页可展开） ---------- */
.tier-def {
  margin: 0 0 var(--sp-4);
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.tier-def-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.tier-def-title { font-size: var(--fs-sm); font-weight: 600; color: var(--ink); }
.tier-def-text {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: 1.95;
  color: var(--ink-2);
  max-width: 62ch;          /* 一行别超过 62 字，长段落读起来才不累 */
  text-align: justify;
}
.tier-def-foot {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: var(--fs-micro); color: var(--muted);
}
.tier-more { margin-top: 10px; }
.tier-more summary {
  cursor: pointer; font-size: var(--fs-micro); color: var(--accent);
  list-style: none;
}
.tier-more summary::-webkit-details-marker { display: none; }
.tier-more summary::before { content: "＋ "; }
.tier-more[open] summary::before { content: "－ "; }
.tier-more p {
  margin: 8px 0 0; font-size: var(--fs-micro); line-height: 1.9;
  color: var(--ink-2); max-width: 62ch; text-align: justify;
}

/* ---------- 前测问卷 ---------- */
.quiz-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: var(--sp-4);
}
.quiz-title { font-family: var(--serif); font-size: 24px; margin: 0 0 6px; }
.quiz-sub { margin: 0; font-size: var(--fs-sm); color: var(--muted); max-width: 58ch; line-height: 1.8; }
.qsec-title {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--fs-sm); font-weight: 600; color: var(--ink);
  margin-bottom: 16px;
}
.qsec-idx {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  font-size: 12px; font-weight: 600;
}
.qitem + .qitem { border-top: 1px solid var(--line); padding-top: 16px; }
.qtext { font-size: var(--fs-sm); line-height: 1.85; margin-bottom: 10px; color: var(--ink); }
.qpassage {
  margin: 0 0 14px; padding: 14px 16px;
  border-left: 2px solid var(--line-hover);
  background: var(--surface-2); border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-family: var(--serif); font-size: var(--fs-sm); line-height: 1.95;
  color: var(--ink-2); max-width: 66ch;
}
.skel { display: flex; flex-direction: column; gap: 8px; }
.skel-row { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 10px; align-items: center; }
.skel-label { font-size: var(--fs-micro); color: var(--muted); line-height: 1.5; }
.quiz-foot { display: flex; align-items: center; gap: 14px; margin-top: 18px; }

@media (max-width: 900px) {
  .skel-row { grid-template-columns: 1fr; gap: 4px; }
}

/* 表格里的状态 chip 不折行（如「3 台设备」） */
.table td .chip { white-space: nowrap; }
.table td .row-acts .btn { white-space: nowrap; }

/* ---------- 课堂任务 ---------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px 16px;
}
.form-grid .field { margin-bottom: 0; }
.form-grid .field > span {
  display: block;
  font-size: var(--fs-micro);
  color: var(--muted);
  margin-bottom: 6px;
}
.input-sm { padding: 6px 10px; font-size: var(--fs-micro); }

.empty-card { text-align: center; padding: 42px 20px; }
.empty-card .card-title { margin-bottom: 6px; }

.task-card .card-head { align-items: flex-start; }
.tier-ask {
  margin-top: 12px;
  padding: 10px 14px;
  border-left: 2px solid var(--accent);
  background: var(--surface-2);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: var(--fs-sm);
  line-height: 1.85;
  color: var(--ink-2);
}
.task-comment {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px dashed var(--line-hover);
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  line-height: 1.85;
  color: var(--ink-2);
}
.task-comment-h {
  font-size: var(--fs-micro);
  color: var(--accent);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}
.task-tiers { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.task-tier {
  font-size: var(--fs-micro);
  line-height: 1.8;
  color: var(--ink-2);
  padding: 8px 12px;
  background: var(--surface-2);
  border-radius: var(--r-sm);
}
.task-cell {
  max-width: 380px;
  font-size: var(--fs-micro);
  line-height: 1.8;
  color: var(--ink-2);
}

/* ---------- 学情折线 ---------- */
.trend-chart { margin-top: 6px; }
.trend-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.tc-grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.tc-y, .tc-x { fill: var(--muted); font-size: 10px; }
.tc-val { fill: var(--ink); font-size: 11px; font-weight: 600; }
.tc-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.tc-area { fill: var(--accent); opacity: 0.1; }
.tc-dot { fill: var(--card); stroke: var(--accent); stroke-width: 2; }
.chart-legend {
  display: flex; justify-content: space-between;
  font-size: var(--fs-micro); color: var(--muted); margin-top: 6px;
}
.chart-empty {
  padding: 26px 0; text-align: center;
  font-size: var(--fs-sm); color: var(--muted);
}

/* 过程性评价（仅教师端） */
.process-box {
  margin-top: 10px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface-2);
}
.process-score { font-size: 26px; font-family: var(--serif); color: var(--ink); }
.process-score small { font-size: 12px; color: var(--muted); margin-left: 4px; }
.process-dims { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-top: 10px; }
.process-dim { font-size: var(--fs-micro); color: var(--ink-2); }
.process-dim b { display: block; color: var(--muted); font-weight: 500; margin-bottom: 2px; }
.process-note { font-size: var(--fs-micro); color: var(--ink-2); line-height: 1.8; margin-top: 10px; }
.process-only-tag { font-size: var(--fs-micro); color: var(--warn, #b8862f); }

/* 课堂监控 */
.mon-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.mon-item:last-child { border-bottom: 0; }
.mon-flags { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- 校门印记与印章（只做图形，不引入新色） ---------- */
.sd-watermark {
  position: fixed;
  right: 26px;
  bottom: 14px;
  width: 176px;
  color: var(--ink);
  opacity: 0.12;
  pointer-events: none;
  z-index: 0;
  /* 硬边错位阴影：压出石刻浮雕感 */
  filter: drop-shadow(1px 1px 0 rgba(0, 0, 0, 0.3)) drop-shadow(-1px -1px 0 rgba(255, 255, 255, 0.12));
}
.sd-watermark path, .sd-watermark rect { fill: currentColor; }
.sd-watermark path[stroke-width], .sd-watermark rect[stroke-width] {
  fill: none;
  stroke: currentColor;
}
.sd-watermark .g-tile path, .sd-watermark .g-arch path { fill: none; stroke: currentColor; stroke-width: 1.1; }
.sd-watermark .g-arch path { stroke-width: 1.4; }
.sd-watermark .g-roof path, .sd-watermark .g-wall path,
.sd-watermark .g-wallside path, .sd-watermark .g-step path { stroke: none; }
.sd-watermark .sd-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  opacity: 0.7;
}
:root[data-theme="light"] .sd-watermark { opacity: 0.16; }
/* 应用内：印记放进侧栏，任何页面都看得见且不会被卡片盖住 */
/* 侧栏底部：印记与印章排成一块"版权页"，上方加一道细线 */
.sidebar .sd-watermark {
  position: static;
  width: 96px;
  margin: var(--sp-4) auto 0;
  opacity: 0.24;
}
.sidebar .sd-watermark + .sd-seal { margin-top: var(--sp-2); }
:root[data-theme="light"] .sidebar .sd-watermark { opacity: 0.18; }

.sd-watermark.sd-page {
  position: fixed;
  right: 20px;
  bottom: 8px;
  width: 232px;
  opacity: 0.045;
  z-index: 0;
}
:root[data-theme="light"] .sd-watermark.sd-page { opacity: 0.06; }

/* 登录页单独放大一档，像压在纸角的印章 */
.login-wrap > .sd-watermark { width: 248px; right: 34px; bottom: 26px; opacity: 0.2; }
:root[data-theme="light"] .login-wrap > .sd-watermark { opacity: 0.26; }

/* 印章：门形 + 竖排两字，宋体拉长做篆意 */
.sd-seal {
  display: block;
  width: 26px;
  height: 62px;
  margin: 0 auto var(--sp-2);
  color: var(--muted);
}
.sd-seal-f { fill: none; stroke: currentColor; stroke-width: 1.6; opacity: 0.6; }
.sd-seal-i { fill: none; stroke: currentColor; stroke-width: 0.7; opacity: 0.3; }
.sd-seal-t path {
  fill: currentColor;
  opacity: 0.86;
  /* 篆书笔画细，小尺寸下加一圈描边补厚，看起来才像刻出来的 */
  stroke: currentColor;
  stroke-width: 0.38;
  stroke-linejoin: round;
  stroke-linecap: round;
}
/* 登录页：印章放右上角 */
.login-wrap > .sd-seal {
  position: fixed;
  top: 34px;
  left: 40px;
  z-index: 2;
  width: 33px;
  height: 78px;
  margin: 0;
}

/* 侧栏品牌标里的门形（实心剪影） */
.brand-mark .sd-mark { width: 24px; height: 24px; color: var(--accent); }
.brand-mark .sd-mark path { fill: currentColor; }
.brand-mark {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -1px 0 rgba(0, 0, 0, 0.26),
    inset 1px 0 0 rgba(255, 255, 255, 0.07),
    inset -1px 0 0 rgba(0, 0, 0, 0.14),
    0 1px 0 rgba(0, 0, 0, 0.18),
    0 0 20px -6px color-mix(in srgb, var(--accent) 45%, transparent);
}

@media (max-width: 1180px) {
  .sd-watermark { width: 150px; right: 18px; bottom: 12px; opacity: 0.05; }
}
@media (max-width: 780px) {
  .sd-watermark { display: none; }
}

/* ---------- 使用说明 ---------- */
.help-card { padding-bottom: var(--sp-5); }
.help-sec { border-top: 1px solid var(--line); padding-top: var(--sp-4); margin-top: var(--sp-4); }
.help-sec:first-of-type { border-top: 0; padding-top: 0; margin-top: var(--sp-4); }
.help-h {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0 0 var(--sp-3);
  color: var(--ink);
}
.help-p { margin: 0 0 var(--sp-3); font-size: 13.5px; line-height: 1.85; color: var(--ink); }
.help-p:last-child { margin-bottom: 0; }
.help-ul, .help-ol { margin: 0 0 var(--sp-3); padding-left: 20px; }
.help-ul li, .help-ol li { font-size: 13.5px; line-height: 1.85; margin-bottom: 6px; }
.help-ul li::marker { color: var(--accent); }
.help-ol li::marker { color: var(--accent); font-family: var(--serif); }
.help-note {
  margin: var(--sp-3) 0;
  padding: 10px 12px;
  border-left: 2px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--muted);
}
.help-table-wrap { margin: var(--sp-3) 0; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-sm); }
.help-table-wrap .table { margin: 0; }
.help-qa { margin: 0 0 var(--sp-3); }
.help-q { font-size: 13.5px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.help-q::before { content: "问 "; color: var(--accent); font-family: var(--serif); font-weight: 400; }
.help-a { font-size: 13px; line-height: 1.8; color: var(--muted); }

/* ==========================================================================
   视觉升级 · 玻璃材质 / 底光 / 光效 / 动效
   规则：只动 transform 与 opacity；每个动效都有 reduced-motion 兜底。
   ========================================================================== */

:root {
  /* 玻璃：一层半透明的面 + 一层极淡的顶部高光，边缘用 1px 冷白 */
  --glass-1: rgba(19, 24, 32, .58);
  --glass-2: rgba(24, 30, 39, .66);
  --glass-3: rgba(30, 37, 48, .74);
  --glass-edge: rgba(255, 255, 255, .085);
  --glass-edge-strong: rgba(255, 255, 255, .16);
  --glass-blur: 20px;
  --glass-sheen: linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .012) 42%, rgba(255, 255, 255, 0));
  --glass-card: rgba(18, 23, 31, .78);
  --side-grad: linear-gradient(180deg, rgba(16, 20, 27, .86), rgba(13, 17, 23, .92));
  --nav-on-grad: linear-gradient(90deg, rgba(94, 234, 212, .13), rgba(94, 234, 212, .02) 60%, transparent);
  --halo: 0 0 0 1px rgba(94, 234, 212, .22), 0 10px 40px -18px rgba(94, 234, 212, .45);
  --lift: translateY(-2px);
}

/* ---------- 动态底光：三团冷光缓慢漂移，外加一层极细颗粒 ---------- */
body::before {
  content: "";
  position: fixed;
  inset: -20% -10%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(38% 42% at 22% 18%, rgba(94, 234, 212, .16), transparent 70%),
    radial-gradient(34% 38% at 82% 12%, rgba(56, 189, 248, .13), transparent 72%),
    radial-gradient(46% 50% at 68% 92%, rgba(94, 234, 212, .07), transparent 74%),
    radial-gradient(30% 34% at 8% 88%, rgba(56, 189, 248, .08), transparent 76%);
  filter: blur(6px);
  animation: aurora 46s ease-in-out infinite alternate;
  will-change: transform;
}

/* 颗粒：让大面积深色不显得"塑料"，也不吃对比度 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .42;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

@keyframes aurora {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(2.5%, -2%, 0) scale(1.06); }
  100% { transform: translate3d(-2%, 2.5%, 0) scale(1.03); }
}

/* 内容都浮在底光之上 */
.shell, .login-wrap { position: relative; z-index: 1; }

/* ---------- 卡片：玻璃 ---------- */
.card {
  background: var(--glass-sheen), var(--glass-2);
  border: 1px solid var(--glass-edge);
  border-radius: var(--r-md);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .055),
    0 1px 2px rgba(0, 0, 0, .35),
    0 24px 60px -34px rgba(0, 0, 0, .9);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.18);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.18);
  transition: border-color var(--dur-2) var(--ease), transform var(--dur-2) var(--ease),
              box-shadow var(--dur-2) var(--ease);
}

/* 可点的卡片（列表项、任务、学生行）才有抬升与描边高光 */
.card.is-live { cursor: pointer; }
.card.is-live:hover {
  transform: var(--lift);
  border-color: var(--glass-edge-strong);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .08),
    0 2px 4px rgba(0, 0, 0, .3),
    0 34px 70px -34px rgba(0, 0, 0, .95);
}

/* ---------- 侧栏：同样的玻璃，压在内容之上 ---------- */
.sidebar {
  background: var(--glass-sheen), var(--side-grad);
  border-right: 1px solid var(--glass-edge);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
}

/* 导航：左侧一条 2px 指示条 + 一层柔光，替代整块的渐变底 */
.nav a { transition: background var(--dur-2) var(--ease), color var(--dur-2) var(--ease), transform var(--dur-1) var(--ease); }
.nav a:hover { transform: translateX(1px); }
.nav a.on {
  background: var(--nav-on-grad);
  color: var(--ink);
  box-shadow: inset 2px 0 0 var(--accent);
}

/* ---------- 顶栏 / 模态：玻璃 ---------- */
.topbar { background: transparent; }
.modal {
  background: var(--glass-sheen), var(--glass-3);
  border: 1px solid var(--glass-edge-strong);
  backdrop-filter: blur(30px) saturate(1.2);
  -webkit-backdrop-filter: blur(30px) saturate(1.2);
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .95), inset 0 1px 0 rgba(255, 255, 255, .07);
}
.modal-mask.on { backdrop-filter: blur(3px) saturate(.9); -webkit-backdrop-filter: blur(3px) saturate(.9); }

/* ---------- 光效：主按钮、数字、统计条 ---------- */
.btn:not(.btn-ghost) {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .35),
    0 8px 24px -10px rgba(94, 234, 212, .55);
  transition: transform var(--dur-1) var(--ease), box-shadow var(--dur-2) var(--ease), filter var(--dur-2) var(--ease);
}
.btn:not(.btn-ghost):hover { filter: brightness(1.05); box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 12px 32px -10px rgba(94,234,212,.7); }
.btn:not(.btn-ghost):active { transform: translateY(1px); }

.stat-num, .stat-value, .kpi-num {
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  text-shadow: 0 0 22px rgba(94, 234, 212, .18);
}

/* ---------- 动效：入场依次抬升，最多 6 拍 ---------- */
@keyframes riseIn {
  from { opacity: 0; transform: translate3d(0, 10px, 0); }
  to   { opacity: 1; transform: none; }
}
#view.enter > * { animation: riseIn .34s var(--ease-out, cubic-bezier(.22,.61,.36,1)) both; }
#view.enter > :nth-child(1) { animation-delay: .02s; }
#view.enter > :nth-child(2) { animation-delay: .06s; }
#view.enter > :nth-child(3) { animation-delay: .1s; }
#view.enter > :nth-child(4) { animation-delay: .14s; }
#view.enter > :nth-child(5) { animation-delay: .18s; }
#view.enter > :nth-child(n+6) { animation-delay: .2s; }

/* 键盘可达性：所有可交互元素都有一条即时可见的焦点环 */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* ---------- 浅色主题：玻璃要反过来调 ---------- */
:root[data-theme="light"], [data-theme="light"] {
  --glass-1: rgba(255, 255, 255, .74);
  --glass-2: rgba(255, 255, 255, .88);
  --glass-3: rgba(255, 255, 255, .94);
  --glass-edge: rgba(15, 23, 42, .07);
  --glass-edge-strong: rgba(15, 23, 42, .14);
  --glass-sheen: linear-gradient(180deg, rgba(255, 255, 255, .7), rgba(255, 255, 255, .25) 48%, rgba(255, 255, 255, .1));
  --glass-card: rgba(255, 255, 253, .92);
  --side-grad: linear-gradient(180deg, rgba(255, 255, 252, .9), rgba(246, 242, 232, .94));
  --nav-on-grad: linear-gradient(90deg, rgba(15, 118, 110, .11), rgba(15, 118, 110, .02) 60%, transparent);
}
:root[data-theme="light"] body::before, [data-theme="light"] body::before {
  opacity: .5;
  filter: blur(8px) saturate(.9);
}
:root[data-theme="light"] body::after, [data-theme="light"] body::after { opacity: .25; }
:root[data-theme="light"] .sidebar, [data-theme="light"] .sidebar {
  background: var(--glass-sheen), linear-gradient(180deg, rgba(255,255,255,.82), rgba(248,250,252,.9));
}

/* ---------- 减少动态 ---------- */
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
  .bgfx > i { animation: none; }
  #view.enter > * { animation: none; }
  .card, .nav a, .btn { transition: none; }
}

/* ---------- 登录页：去掉渐变字，改成克制的排版 ---------- */
.login-title {
  font-size: clamp(32px, 3vw, 42px);
  line-height: 1.22;
  letter-spacing: .012em;
  font-weight: 600;
  margin: var(--sp-3) 0 var(--sp-4);
  text-wrap: balance;
  color: var(--ink);
}
.login-lede { max-width: 30em; color: var(--ink-2); font-size: var(--fs-lead); line-height: 1.85; margin: 0 0 var(--sp-5); }

/* 三级台阶：序号 + 层级名 + 一句现状，左边一条 2px 色线 */
.ladder { display: grid; gap: var(--sp-2); margin-top: var(--sp-2); }
.ladder-row {
  display: grid;
  grid-template-columns: 30px 74px 1fr;
  align-items: center;
  gap: var(--sp-3);
  padding: 11px var(--sp-4);
  border: 1px solid var(--glass-edge);
  border-radius: var(--r-sm);
  background: var(--glass-sheen), rgba(255, 255, 255, .022);
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  box-shadow: inset 2px 0 0 var(--lv, var(--line-strong));
  transition: transform var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease), background var(--dur-2) var(--ease);
}
.ladder-row:hover { transform: translateX(2px); border-color: var(--glass-edge-strong); }
.ladder-row.lv-basic { --lv: var(--t-basic); }
.ladder-row.lv-mid   { --lv: var(--t-mid); }
.ladder-row.lv-high  { --lv: var(--t-high); }
.ladder-row .idx {
  font-size: 11px; letter-spacing: .1em; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.ladder-row .lv { font-size: var(--fs-small); font-weight: 600; color: var(--lv); letter-spacing: .02em; }
.ladder-row .dsc { font-size: var(--fs-small); color: var(--ink-2); line-height: 1.6; }
.hero-foot { font-size: var(--fs-meta); color: var(--muted); letter-spacing: .02em; }

/* 登录卡片：更宽的气口，玻璃更实一点，避免背后底光把文字冲淡 */
.login-card {
  background: var(--glass-sheen), var(--glass-card);
  border: 1px solid var(--glass-edge);
  backdrop-filter: blur(26px) saturate(1.2);
  -webkit-backdrop-filter: blur(26px) saturate(1.2);
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, .95), inset 0 1px 0 rgba(255, 255, 255, .06);
}
.login-card h2 { letter-spacing: .01em; }

/* 身份切换：下划线，不用整块底（只作用于登录卡，别影响页面内的分段控件） */
.login-card .tabs { background: transparent; border-bottom: 1px solid var(--line); border-radius: 0; padding: 0; gap: 32px; }
.login-card .tabs button {
  background: transparent; border: 0; border-radius: 0;
  padding: 8px 0 10px; color: var(--muted); font-weight: 500;
  box-shadow: none; flex: 0 0 auto;
}
.login-card .tabs button.on { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .ladder-row, .ladder-row:hover { transition: none; transform: none; }
}

/* ---------- 登录页细节收尾 ---------- */
/* 原来左下那个大圆环去掉，换成一团很淡的冷光，跟底光连成一片 */
.login-wrap::after {
  content: "";
  position: absolute; left: -240px; bottom: -280px;
  width: 720px; height: 720px; border-radius: 50%;
  border: 0;
  background: radial-gradient(circle at 50% 50%, rgba(94, 234, 212, .07), transparent 62%);
  box-shadow: none;
  pointer-events: none;
  opacity: .9;
}

/* 主题开关做成一颗玻璃圆钮，不再是一个孤零零的符号 */
.login-theme, .theme-toggle {
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-grid; place-items: center;
  border: 1px solid var(--glass-edge);
  background: var(--glass-sheen), rgba(255, 255, 255, .04);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  color: var(--ink-2); cursor: pointer;
  transition: transform var(--dur-1) var(--ease), border-color var(--dur-2) var(--ease), color var(--dur-2) var(--ease);
}
.login-theme:hover, .theme-toggle:hover { transform: translateY(-1px); border-color: var(--glass-edge-strong); color: var(--ink); }
.login-theme { position: fixed; top: 26px; right: 28px; z-index: 3; }

/* 校门印记在登录页稍微提一点，别糊成一块黑 */
.login-wrap > .sd-watermark { opacity: .24; }
[data-theme="light"] .login-wrap > .sd-watermark { opacity: .3; }

/* 提示条：一条安静的说明，不用方块底 */
.notice {
  display: flex; gap: var(--sp-2); align-items: flex-start;
  padding: 10px 0 10px var(--sp-3);
  border: 0; border-left: 2px solid var(--line-strong); border-radius: 0;
  background: transparent;
  font-size: var(--fs-meta); line-height: 1.7; color: var(--muted);
}
.notice b { color: var(--ink-2); font-weight: 600; }
.notice .ni { display: none; }

/* ==========================================================================
   登录页构图重排：两栏顶对齐、标题放大、卡片加宽
   ========================================================================== */
.login-wrap { padding: clamp(48px, 7vh, 96px) var(--sp-7); align-items: center; }

.login-inner {
  max-width: 1280px;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: clamp(56px, 6vw, 112px);
  align-items: start;
}

.login-hero { padding: 0; display: flex; flex-direction: column; justify-content: space-between; min-height: 520px; }
.login-kicker {
  font-size: 11.5px; letter-spacing: .16em; color: var(--muted);
  padding-bottom: var(--sp-5); margin-bottom: var(--sp-6);
  border-bottom: 1px solid var(--line);
}
.login-kicker::before { width: 18px; height: 1px; background: var(--accent); opacity: .85; }

.login-title {
  font-size: clamp(40px, 3.6vw, 58px);
  line-height: 1.14;
  letter-spacing: -.005em;
  font-weight: 600;
  margin: 0 0 var(--sp-4);
  max-width: 13em;
}

.login-lede { font-size: 16.5px; line-height: 1.8; color: var(--ink-2); max-width: 30em; margin: 0 0 var(--sp-6); }

.ladder { gap: 10px; margin-top: var(--sp-2); max-width: 560px; }
.ladder-row {
  grid-template-columns: 26px 68px 1fr;
  gap: var(--sp-4);
  padding: 13px var(--sp-4) 13px var(--sp-4);
  border-radius: 10px;
}
.ladder-row .idx { font-size: 10.5px; letter-spacing: .12em; opacity: .8; }
.ladder-row .lv { font-size: 13.5px; letter-spacing: .04em; }
.ladder-row .dsc { font-size: 13px; line-height: 1.65; color: var(--ink-2); }

.hero-foot {
  margin-top: var(--sp-7); padding-top: var(--sp-4);
  border-top: 1px solid var(--line);
  font-size: 12px; letter-spacing: .04em; color: var(--muted);
}

.login-panel { align-items: start; padding-top: 4px; }
.login-card { padding: 30px 28px 26px; border-radius: 18px; }
.login-card h2 { font-size: 20px; letter-spacing: .01em; }
.login-card .sub { font-size: 12.5px; color: var(--muted); margin: 6px 0 var(--sp-5); }

.tabs { margin-bottom: var(--sp-4); }
.field { margin-bottom: var(--sp-3); }
.field label { font-size: 12px; color: var(--ink-2); letter-spacing: .02em; }
.input { padding: 11px 13px; font-size: 14px; }

.btn-block { padding: 12px 18px; font-size: 14px; letter-spacing: .02em; margin-top: var(--sp-2); }

/* 窄屏：单栏，卡片上移 */
@media (max-width: 1080px) {
  .login-inner { grid-template-columns: minmax(0, 1fr); gap: var(--sp-7); max-width: 620px; }
  .login-hero { min-height: 0; }
  .login-title { font-size: clamp(32px, 7vw, 44px); }
  .login-panel { padding-top: 0; }
}

/* 统一正文与台阶的宽度，避免两块左边对齐、右边参差 */
.login-lede, .ladder { max-width: 520px; }

/* 身份切换靠左排，不要拉伸成两半 */
.login-card .tabs { justify-content: flex-start; }
.login-card .tabs button:hover { color: var(--ink-2); }

/* 提示条与下方表单拉开一档 */
.notice { margin: 0 0 var(--sp-4); }
.notice + .msg { margin-top: 0; }

/* 校门印记上移一点，别被视口下沿切掉 */
.login-wrap > .sd-watermark { bottom: 40px; opacity: .28; }

/* ---------- 统计条：标签高度统一，数字与单位对齐 ---------- */
.stat { display: flex; flex-direction: column; justify-content: space-between; }
.stat .n { font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1.1; }
.stat .l { font-size: 12px; line-height: 1.4; min-height: 2.8em; display: flex; align-items: flex-end; color: var(--muted); }
.stat + .stat { border-left: 1px solid var(--line); }

/* ---------- 长文档：限制行宽，读起来不累 ---------- */
.help-card { max-width: 900px; }
.help-p, .help-ul li, .help-ol li, .help-note { max-width: 46em; }

/* ---------- 课堂练习监控：点 + 谁 + 什么状况 ---------- */
.mon-item {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--sp-3);
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.mon-item:first-of-type { border-top: 0; }
.mon-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 4px var(--amber-soft);
}
.mon-who { display: flex; align-items: baseline; gap: var(--sp-2); min-width: 0; }
.mon-who b { font-weight: 600; font-size: var(--fs-small); }
.mon-meta { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mon-what { display: flex; align-items: baseline; gap: var(--sp-3); justify-self: end; }
.mon-flag { font-size: 12px; color: var(--amber); }
.mon-idle { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* 分布柱：贴着卡片宽度，别让 SVG 撑出横向滚动 */
.hist { display: block; overflow: visible; }

/* ==========================================================================
   窄屏：侧栏折成图标栏，主区拿到完整宽度
   ========================================================================== */
@media (max-width: 980px) {
  .shell { grid-template-columns: 72px minmax(0, 1fr); }
  .sidebar { padding: 14px 8px 10px; border-right: 1px solid var(--glass-edge); }
  .brand { justify-content: center; padding: 0 0 var(--sp-4); }
  .brand-text, .brand-sub, .brand-class, #brandClass { display: none; }
  .nav a { justify-content: center; padding: 11px 0; gap: 0; }
  .nav a > span:not(.nav-i):not(.dot) { display: none; }
  .nav a { position: relative; }
  .nav a .nav-i { font-size: 15px; }
  .nav a .dot { position: absolute; top: 7px; right: 18px; }
  .nav a.on { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
  .side-foot { padding-top: var(--sp-3); align-items: center; }
  .side-foot .who { display: none; }
  #logoutBtn { padding: 6px 0; font-size: 11px; width: 100%; }
  .sidebar .sd-watermark, .sidebar .sd-seal { display: none; }
  .main { padding: var(--sp-5) var(--sp-5) var(--sp-8); }
  .page-title { font-size: 24px; }
  .mon-item { grid-template-columns: 8px minmax(0, 1fr) auto; }
  .mon-item .btn { grid-column: 3; }
  .mon-what { gap: var(--sp-2); }
}

@media (max-width: 720px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: sticky; top: 0; height: auto; z-index: 20;
    flex-direction: row; align-items: center; gap: var(--sp-2);
    padding: 10px var(--sp-3);
    overflow-x: auto; scrollbar-width: none;
  }
  .sidebar::-webkit-scrollbar { display: none; }
  .brand { padding: 0 var(--sp-2) 0 0; border: 0; margin: 0; }
  .nav { display: flex; gap: 4px; }
  .nav a { padding: 8px 10px; white-space: nowrap; }
  .nav a > span:not(.nav-i):not(.dot) { display: inline; font-size: 12.5px; }
  .nav a .dot { position: static; }
  .nav a.on { box-shadow: inset 0 -2px 0 var(--accent); border-radius: var(--r-sm); }
  .side-foot { padding: 0; border: 0; }
  .main { padding: var(--sp-4) var(--sp-4) var(--sp-7); }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .topbar { flex-wrap: wrap; gap: var(--sp-2); }
}

/* 三栏图表卡：先两栏再单栏，避免窄屏把每张卡压到 220px */
@media (max-width: 1120px) { .viz-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px)  { .viz-3 { grid-template-columns: minmax(0, 1fr); } .stat-row { grid-template-columns: repeat(2, 1fr); } }

/* ==========================================================================
   登录页：随视口放大 + 台阶改成一行三列
   ========================================================================== */
.login-inner {
  max-width: clamp(1040px, 60vw, 1760px);
  grid-template-columns: minmax(0, 1fr) clamp(380px, 21vw, 520px);
  gap: clamp(48px, 4.4vw, 128px);
  align-items: start;
}
.login-hero { padding: 0; }
.login-kicker { font-size: clamp(11.5px, .82vw, 14px); letter-spacing: .24em; }
.login-title {
  font-size: clamp(40px, 3.2vw, 112px);
  line-height: 1.08;
  letter-spacing: -.005em;
  max-width: 12em;
  margin: var(--sp-3) 0 var(--sp-4);
}
.login-lede {
  font-size: clamp(16px, 1.02vw, 19.5px);
  line-height: 1.85;
  max-width: 33em;
  color: var(--ink-2);
}

/* 台阶：序号 | 层级 | 一句现状，同一行对齐，字号跟着屏宽走 */
.ladder { max-width: none; margin-top: clamp(28px, 2.6vw, 44px); gap: clamp(8px, .8vw, 14px); }
.ladder-row {
  grid-template-columns: clamp(28px, 2vw, 40px) clamp(104px, 8vw, 150px) minmax(0, 1fr);
  gap: clamp(14px, 1.4vw, 26px);
  padding: clamp(14px, 1.05vw, 20px) clamp(16px, 1.3vw, 24px);
  border-left-width: 3px;
  border-left-color: var(--row-accent, var(--line-strong));
  background: var(--glass-sheen), var(--glass-1);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
}
.ladder-row.lv-basic { --row-accent: var(--t-basic); }
.ladder-row.lv-mid   { --row-accent: var(--t-mid); }
.ladder-row.lv-high  { --row-accent: var(--t-high); }
.ladder-row .idx {
  font-size: clamp(11px, .78vw, 13px);
  letter-spacing: .08em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.ladder-row .lv {
  font-family: var(--serif);
  font-size: clamp(15.5px, .95vw, 24px);
  font-weight: 600;
  letter-spacing: .04em;
  line-height: 1.3;
}
.ladder-row .dsc {
  font-size: clamp(13px, .78vw, 17px);
  line-height: 1.6;
  color: var(--ink-2);
}
.ladder-row:hover { transform: translateY(-1px); border-color: var(--row-accent, var(--line-strong)); }
.ladder-row:hover .dsc { color: var(--ink); }

.hero-foot { margin-top: clamp(20px, 2vw, 34px); font-size: clamp(11.5px, .82vw, 13.5px); }

/* 登录卡：卡片本身也随屏宽放大 */
.login-card { padding: clamp(26px, 1.9vw, 40px); }
.login-card h2 { font-size: clamp(22px, 1.5vw, 30px); }
.login-card .sub { font-size: clamp(12.5px, .9vw, 14.5px); }
.login-card .input { height: clamp(40px, 2.6vw, 48px); font-size: clamp(13.5px, .95vw, 15.5px); }
.login-card .btn { height: clamp(42px, 2.7vw, 50px); font-size: clamp(14px, .95vw, 15.5px); }

/* 窄屏回退：台阶恢复两列堆叠 */
@media (max-width: 860px) {
  .ladder-row {
    grid-template-columns: clamp(28px, 5vw, 40px) minmax(0, 1fr);
    grid-template-areas: "idx lv" "idx dsc";
    row-gap: 4px;
    align-items: start;
  }
  .ladder-row .idx { grid-area: idx; }
  .ladder-row .lv { grid-area: lv; }
  .ladder-row .dsc { grid-area: dsc; }
}

/* ==========================================================================
   浅色：底光要看得见
   ========================================================================== */
:root[data-theme="light"] body::before {
  background:
    radial-gradient(1360px 900px at 14% 10%, rgba(15, 118, 110, .21), transparent 62%),
    radial-gradient(1200px 820px at 86% 18%, rgba(3, 105, 161, .16), transparent 60%),
    radial-gradient(1300px 860px at 52% 90%, rgba(180, 83, 9, .13), transparent 64%),
    linear-gradient(116deg, transparent 33%, rgba(255, 255, 255, .5) 48%, transparent 65%);
  animation-duration: 78s;
}
:root[data-theme="light"] body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(rgba(26, 29, 36, .055) 0.5px, transparent 0.5px);
  background-size: 4px 4px;
  opacity: .5;
}
/* 浅色下阴影别用近黑的，否则卡片像压在黑框里 */
:root[data-theme="light"] .login-card,
:root[data-theme="light"] .card,
:root[data-theme="light"] .sidebar,
:root[data-theme="light"] .stat-row {
  box-shadow:
    0 1px 2px rgba(26, 29, 36, .05),
    0 22px 46px -26px rgba(26, 29, 36, .28),
    inset 0 1px 0 #fff;
}
:root[data-theme="light"] .ladder-row {
  box-shadow: 0 1px 2px rgba(26, 29, 36, .04), inset 0 1px 0 #fff;
}

/* ==========================================================================
   再一层细节：引导线、卡片高光、输入聚焦
   ========================================================================== */
.login-kicker::after {
  content: "";
  flex: 1;
  height: 1px;
  max-width: clamp(40px, 6vw, 120px);
  background: linear-gradient(90deg, var(--line-strong), transparent);
  margin-left: var(--sp-2);
  transform-origin: left;
  animation: kicker-line .8s var(--ease-out) both;
}
@keyframes kicker-line { from { transform: scaleX(0); opacity: 0; } to { transform: scaleX(1); opacity: 1; } }

.login-card { position: relative; overflow: hidden; }
.login-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-edge-strong) 22%, var(--glass-edge-strong) 78%, transparent);
}
.login-card::after {
  content: "";
  position: absolute;
  top: -40%;
  left: -20%;
  width: 60%;
  height: 180%;
  pointer-events: none;
  background: linear-gradient(104deg, transparent, rgba(255, 255, 255, .05) 45%, transparent 70%);
}

.field .input:focus-visible,
.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field label { transition: color var(--dur-2) var(--ease); }
.field:focus-within label { color: var(--ink); }

/* 浅色卡片：一层很薄的暖边，把白卡从暖底上分出来 */
:root[data-theme="light"] .card,
:root[data-theme="light"] .login-card,
:root[data-theme="light"] .ladder-row {
  border-color: rgba(120, 100, 70, .13);
}
/* 身份切换的下划线跟着变，别硬切 */
.login-card .tabs button { transition: color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease); }

/* ---------- 墨尘粒子层 ---------- */
.fx-particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .9;
}
:root[data-theme="light"] .fx-particles { opacity: .75; }

/* 四周一圈很淡的暗角，把注意力收进画面中央 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 42%, transparent 58%, rgba(0, 0, 0, .32) 100%);
}
:root[data-theme="light"] body::after {
  background: radial-gradient(120% 92% at 50% 42%, transparent 60%, rgba(90, 74, 46, .13) 100%);
  background-image: radial-gradient(120% 92% at 50% 42%, transparent 60%, rgba(90, 74, 46, .13) 100%),
                    radial-gradient(rgba(26, 29, 36, .05) 0.5px, transparent 0.5px);
  background-size: 100% 100%, 4px 4px;
}

/* 主按钮：悬停时一道光从左边扫过去 */
.btn:not(.btn-ghost) { position: relative; overflow: hidden; }
.btn:not(.btn-ghost)::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .28), transparent);
  transform: skewX(-14deg);
  pointer-events: none;
  transition: left .55s var(--ease-out);
}
.btn:not(.btn-ghost):hover::after { left: 118%; }

/* 输入聚焦时，整张卡透出一圈极淡的强调色 */
.login-card { transition: box-shadow var(--dur-3) var(--ease), border-color var(--dur-3) var(--ease); }
.login-card:focus-within {
  border-color: var(--accent);
  box-shadow:
    0 0 0 3px var(--accent-soft),
    var(--shine),
    0 26px 60px -30px rgba(0, 0, 0, .55);
}
:root[data-theme="light"] .login-card:focus-within {
  box-shadow:
    0 0 0 3px var(--accent-soft),
    inset 0 1px 0 #fff,
    0 22px 46px -26px rgba(26, 29, 36, .3);
}

/* ==========================================================================
   顶栏：滚动上来时压一层真玻璃，别再让正文从字缝里穿过去
   ========================================================================== */
:root { --topbar-face: rgba(10, 13, 18, .02); --main-px: var(--sp-8); }
:root[data-theme="light"] { --topbar-face: rgba(255, 255, 255, .03); }
@media (min-width: 1440px) { :root { --main-px: var(--sp-9); } }
@media (max-width: 1120px) { :root { --main-px: var(--sp-6); } }
@media (max-width: 980px)  { :root { --main-px: var(--sp-5); } }
@media (max-width: 720px)  { :root { --main-px: var(--sp-4); } }

/* 主区的左右内距统一由 --main-px 给，顶栏的负边距才不会多出来 */
.main { padding-left: var(--main-px); padding-right: var(--main-px); }

.topbar {
  background: var(--topbar-face);
  backdrop-filter: blur(24px) saturate(1.1);
  -webkit-backdrop-filter: blur(24px) saturate(1.1);
  padding: var(--sp-4) var(--main-px);
  margin: calc(var(--sp-6) * -1) calc(var(--main-px) * -1) var(--sp-5);
  border-bottom: 1px solid transparent;
}
/* 滚上来的内容被模糊糊住，靠一条细线收边，不再整块压色 */
.topbar.stuck {
  border-bottom-color: var(--glass-edge);
  box-shadow: 0 12px 26px -26px rgba(0, 0, 0, .9);
}

/* ==========================================================================
   侧栏：中置悬浮卡，不再从顶贯到底
   ========================================================================== */
:root { --nav-w: 268px; --nav-gap: 16px; }
:root[data-nav="mini"] { --nav-w: 96px; }

.shell { grid-template-columns: var(--nav-w) minmax(0, 1fr); }

.sidebar {
  top: var(--nav-gap);
  height: auto;
  max-height: calc(100vh - var(--nav-gap) * 2);
  margin: var(--nav-gap) 0 var(--nav-gap) var(--nav-gap);
  padding: var(--sp-3) var(--sp-3) var(--sp-3);
  border: 1px solid var(--glass-edge);
  border-radius: var(--r-lg);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
  box-shadow: 0 34px 60px -46px rgba(0, 0, 0, .95), inset 0 1px 0 rgba(255, 255, 255, .06);
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }
:root[data-theme="light"] .sidebar { box-shadow: 0 26px 46px -34px rgba(26, 29, 36, .34), inset 0 1px 0 #fff; }
.sidebar .brand { border-bottom-color: var(--line); padding: 0 var(--sp-2) var(--sp-4); }

/* 收起按钮 */
.nav-toggle {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 7px 10px; margin: var(--sp-3) 0 var(--sp-2);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: transparent; color: var(--muted);
  font: inherit; font-size: 12px; letter-spacing: .03em;
  cursor: pointer;
  transition: color var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease), background var(--dur-2) var(--ease);
}
.nav-toggle:hover { color: var(--ink); border-color: var(--line-strong); background: var(--accent-soft); }
.nav-toggle .ico { font-size: 14px; line-height: 1; font-family: var(--sans); }

/* 收起态 */
:root[data-nav="mini"] .brand { justify-content: center; padding: 0 0 var(--sp-3); border-bottom: 0; }
:root[data-nav="mini"] .brand > div:last-child { display: none; }
:root[data-nav="mini"] .nav-toggle { justify-content: center; padding: 7px 0; }
:root[data-nav="mini"] .nav-toggle .lbl { display: none; }
:root[data-nav="mini"] .nav a { justify-content: center; padding: 10px 0; gap: 0; position: relative; }
:root[data-nav="mini"] .nav a > span:not(.nav-i):not(.dot) { display: none; }
:root[data-nav="mini"] .nav a .dot { position: absolute; top: 7px; right: 17px; }
:root[data-nav="mini"] .nav a.on {
  background: var(--accent-soft);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  box-shadow: inset 2px 0 0 var(--accent);
}
:root[data-nav="mini"] .side-foot { align-items: center; }
:root[data-nav="mini"] .side-foot .who { display: none; }
:root[data-nav="mini"] #logoutBtn { width: 100%; padding: 6px 0; font-size: 11px; }
:root[data-nav="mini"] .sidebar .sd-watermark,
:root[data-nav="mini"] .sidebar .sd-seal { display: none; }

/* 主区要跟着侧栏宽度让位 */
@media (max-width: 1120px) {
  .shell { grid-template-columns: 96px minmax(0, 1fr); }
  .sidebar .brand { justify-content: center; padding: 0 0 var(--sp-3); border-bottom: 0; }
  .sidebar .brand > div:last-child { display: none; }
  .nav-toggle { display: none; }
  .nav a { justify-content: center; padding: 10px 0; position: relative; }
  .nav a > span:not(.nav-i):not(.dot) { display: none; }
  .nav a .dot { position: absolute; top: 7px; right: 17px; }
  .side-foot .who { display: none; }
  #logoutBtn { width: 100%; padding: 6px 0; font-size: 11px; }
}

/* 极窄：侧栏折成一条悬浮顶栏 */
@media (max-width: 720px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: sticky;
    top: 8px;
    left: 8px;
    right: 8px;
    z-index: 30;
    max-height: none;
    height: auto;
    margin: 8px 8px 0;
    flex-direction: row;
    align-items: center;
    gap: var(--sp-2);
    padding: 8px var(--sp-3);
    overflow-x: auto;
    overflow-y: hidden;
  }
  .sidebar .brand { padding: 0 var(--sp-2) 0 0; }
  .nav { display: flex; gap: 2px; }
  .nav a { padding: 8px 10px; white-space: nowrap; }
  .nav a > span:not(.nav-i):not(.dot) { display: inline; font-size: 12.5px; }
  .nav a.on { box-shadow: inset 0 -2px 0 var(--accent); border-radius: var(--r-sm); }
  .side-foot { border: 0; padding: 0; margin-left: auto; }
  .topbar { margin-top: calc(var(--sp-3) * -1); }
}

/* ==========================================================================
   侧栏：竖向居中、贴在左边、悬停展开
   ========================================================================== */
.shell { grid-template-columns: 128px minmax(0, 1fr); }

.sidebar {
  position: fixed;
  /* 主区是 1480 居中的，侧栏跟着它走，右边永远留 16px，
     屏幕越宽它越往右靠，不再在中间留一截空 */
  /* 不再完全贴着主区：左边留一道固定空档，--nav-gutter 一个数就能调，越大越靠左（16 贴边 / 48 折中 / 80 现在这档 / 120 更左） */
  left: clamp(16px, calc(50% - var(--main-max, 1480px) / 2 - var(--nav-gutter, 80px) - 32px), var(--nav-max-left, 220px));
  /* 顶边对齐切班器那一行，由 alignRail() 用 --nav-top 注入；不再做垂直居中 */
  top: var(--nav-top, 96px);
  width: 96px;
  height: auto;
  max-height: calc(100vh - var(--nav-top, 96px) - 16px);
  margin: 0;
  padding: 16px 10px 14px;
  border: 1px solid var(--glass-edge);
  border-radius: var(--r-lg);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  z-index: 30;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 30px 56px -42px rgba(0, 0, 0, .95), inset 0 1px 0 rgba(255, 255, 255, .06);
  transition: width .24s var(--ease), padding .24s var(--ease), box-shadow .24s var(--ease);
}
:root[data-theme="light"] .sidebar {
  box-shadow: 0 24px 44px -32px rgba(26, 29, 36, .32), inset 0 1px 0 #fff;
}

/* 顶部：收起时只留印章，品牌名随宽度淡入 */
.sidebar .brand {
  padding: 0 0 14px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
  gap: 10px;
  overflow: hidden;
}
.sidebar .brand { justify-content: center; }
.sidebar .brand > div:last-child { min-width: 0; overflow: hidden; display: none; }

/* 导航：收起时图标居中，展开时靠左 */
.nav { gap: 2px; }
.nav a {
  justify-content: center;
  gap: 10px;
  padding: 10px 0;
  border-radius: var(--r-sm);
  white-space: nowrap;
  overflow: hidden;
}
.nav a .nav-i { flex: 0 0 22px; text-align: center; }
.nav a > span:not(.nav-i):not(.dot) {
  display: none;
  white-space: nowrap;
}
.nav a.on { box-shadow: inset 2px 0 0 var(--accent); border-radius: var(--r-sm); }

/* 底部：收起时整块隐去，别往两头撑 */
.side-foot {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  min-height: 0;
}
.side-foot { display: none; white-space: nowrap; }
.sidebar .sd-watermark, .sidebar .sd-seal { display: none; }

/* 悬停：拉宽、文字浮出、图标回到左侧 */
.sidebar:hover, .sidebar:focus-within {
  width: 252px;
  padding: 16px 14px 14px;
  box-shadow: 0 34px 60px -38px rgba(0, 0, 0, .95), inset 0 1px 0 rgba(255, 255, 255, .07);
}
.sidebar:hover .brand, .sidebar:focus-within .brand { justify-content: flex-start; }
.sidebar:hover .nav a, .sidebar:focus-within .nav a { justify-content: flex-start; padding: 10px 10px; }
.sidebar:hover .brand > div:last-child,
.sidebar:hover .nav a > span:not(.nav-i):not(.dot),
.sidebar:hover .side-foot,
.sidebar:focus-within .brand > div:last-child,
.sidebar:focus-within .nav a > span:not(.nav-i):not(.dot),
.sidebar:focus-within .side-foot {
  display: block;
  animation: fade .2s var(--ease-out) both;
}

/* 窄屏：悬停展开在触屏上没有意义，直接给展开态 */
@media (max-width: 1120px) {
  .shell { grid-template-columns: 116px minmax(0, 1fr); }
  .sidebar { width: 84px; }
  .sidebar:hover, .sidebar:focus-within { width: 232px; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: sticky; left: auto; top: 8px;
    flex-direction: row;
    width: auto; max-height: none; margin: 8px 8px 0;
    flex-direction: row; align-items: center; gap: var(--sp-2);
    padding: 8px var(--sp-3); overflow-x: auto; z-index: 30;
  }
  .sidebar .brand { border: 0; margin: 0; padding: 0 var(--sp-2) 0 0; }
  .nav { display: flex; gap: 2px; }
  .nav a { padding: 8px 10px; justify-content: flex-start; }
  .nav a > span:not(.nav-i):not(.dot) { display: inline; font-size: 12.5px; }
  .sidebar .brand > div:last-child { display: block; }
  .side-foot { display: flex; }
  .side-foot { margin: 0 0 0 auto; padding: 0; border: 0; }
  .side-foot .who { display: none; }
}
.sidebar::-webkit-scrollbar { width: 0; }
.sidebar:hover::-webkit-scrollbar { width: 5px; }
.sidebar:hover::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }

/* 侧栏改成 fixed 后不在网格流里，主区必须显式落到第二列，
   否则会被自动排进第一列，整页被压成 128px —— 这就是"全乱"的根因 */
.shell > .main { grid-column: 2; }
@media (max-width: 820px) { .shell > .main { grid-column: 1 / -1; } }

/* ==========================================================================
   收起态（静止）：只用一根短竖条标当前页，不再整块压底色
   ========================================================================== */
.sidebar:not(:hover):not(:focus-within) .nav a.on {
  background: transparent;
  box-shadow: none;
  color: var(--accent);
  position: relative;
}
.sidebar:not(:hover):not(:focus-within) .nav a.on::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 16px;
  border-radius: 2px;
  background: var(--accent);
}
.sidebar:not(:hover):not(:focus-within) .nav a { color: var(--ink-2); }
.sidebar:not(:hover):not(:focus-within) .brand {
  border-bottom: 0;
  padding-bottom: 8px;
  margin-bottom: 6px;
}
/* 收起态：把带边框的小方块还原成纯字形，并且别再让行高把它撑破 */
.sidebar .nav a .nav-i { line-height: 1; }
.sidebar:not(:hover):not(:focus-within) .nav a .nav-i {
  width: 22px;
  height: auto;
  border: 0;
  background: none;
  font-size: 17px;
  line-height: 1.15;
  color: inherit;
}
/* 主区的宽度上限跟着断点变，侧栏的偏移量必须用同一个数算，否则超宽屏会压到内容上 */
:root { --main-max: 1480px; --nav-gutter: 80px; --nav-max-left: 220px; }
@media (min-width: 1900px) { :root { --main-max: 1640px; } }

/* ==========================================================================
   点五：层级附加分 + 评分异议
   ========================================================================== */
.score-main { font-family: var(--serif); font-size: 26px; line-height: 1; color: var(--ink); }
.score-main small { font-size: 12px; color: var(--muted); margin-left: 2px; }
.score-bonus {
  display: inline-flex; align-items: baseline; gap: 3px;
  font-size: 13px; color: var(--accent);
  padding: 3px 9px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
  background: var(--accent-soft);
}
.score-bonus b { font-family: var(--serif); font-size: 16px; font-weight: 600; }
.score-bonus small { font-size: 11px; opacity: .75; }

.eval-list { display: flex; flex-direction: column; }
.eval-row { padding: 14px 0; border-top: 1px solid var(--line); }
.eval-row:first-child { border-top: 0; padding-top: 4px; }
.eval-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.eval-when { font-size: 12.5px; color: var(--muted); }
.eval-scores { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.eval-note {
  margin-top: 8px; font-size: 13px; line-height: 1.85; color: var(--ink-2);
  padding: 9px 12px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--line);
}
.eval-changed { margin-top: 6px; font-size: 12.5px; color: var(--accent); }
.eval-review {
  margin-top: 8px; font-size: 13px; line-height: 1.8; color: var(--ink-2);
  padding: 9px 12px; border-radius: var(--r-sm);
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
  background: var(--accent-soft);
}
.eval-review b, .appeal-closed b { display: block; font-size: 11.5px; letter-spacing: .04em; text-transform: none; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.eval-foot { margin-top: 10px; display: flex; gap: 8px; }

.appeal-form {
  margin-top: 10px; padding: 12px; border-radius: var(--r-md);
  border: 1px dashed var(--line-strong); background: var(--surface-2);
  display: flex; flex-direction: column; gap: 8px;
}
.appeal-input { resize: vertical; min-height: 68px; font-size: 13px; }
.appeal-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.appeal-list { display: flex; flex-direction: column; gap: var(--sp-4); margin-top: var(--sp-4); }
.appeal-card .card-head { margin-bottom: 4px; }
.appeal-scores { display: flex; gap: 20px; align-items: flex-end; flex-wrap: wrap; padding: 10px 0 4px; }
.appeal-reason {
  margin-top: 10px; padding: 10px 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface-2);
  font-size: 13px; line-height: 1.85; color: var(--ink-2);
}
.appeal-draft { margin-top: 10px; }
.appeal-draft summary { cursor: pointer; font-size: 12.5px; color: var(--muted); }
.appeal-draft .draft-body {
  margin-top: 8px; max-height: 240px; overflow: auto; white-space: pre-wrap;
  font-size: 13px; line-height: 1.95; color: var(--ink-2);
  padding: 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface-2);
}
.appeal-review-form {
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 9px;
}
.appeal-inputs { display: flex; gap: 12px; flex-wrap: wrap; }
.appeal-inputs label { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.appeal-inputs .input { width: 92px; }
.appeal-closed {
  margin-top: 12px; padding: 10px 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface-2);
  font-size: 13px; line-height: 1.8; color: var(--ink-2);
}
.teacher-bonus { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }

/* ==========================================================================
   点六：月度复诊 / 自选模块 / 层级流水
   ========================================================================== */
.cyc-dots { display: flex; gap: 6px; margin: 12px 0 10px; }
.cyc-dot {
  width: 28px; height: 6px; border-radius: 3px;
  background: var(--line-strong);
  transition: background .2s var(--ease), box-shadow .2s var(--ease);
}
.cyc-dot.on { background: var(--accent); box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 45%, transparent); }
.cyc-cta { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cyc-module { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.cyc-module-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.cyc-mods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 980px) { .cyc-mods { grid-template-columns: 1fr; } }
.cyc-mod {
  text-align: left; display: flex; flex-direction: column; gap: 4px;
  padding: 11px 12px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--surface-2);
  color: var(--ink-2); cursor: pointer;
  transition: border-color .18s var(--ease), background .18s var(--ease), transform .18s var(--ease);
}
.cyc-mod:hover:not(:disabled) { border-color: color-mix(in srgb, var(--accent) 45%, transparent); transform: translateY(-1px); }
.cyc-mod.on { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.cyc-mod:disabled { opacity: .5; cursor: not-allowed; }
.cyc-mod-name { font-weight: 600; font-size: 13.5px; }
.cyc-mod-desc { font-size: 12px; line-height: 1.7; color: var(--muted); }
.retest-banner { border-left: 3px solid var(--accent); }

.tier-log { display: flex; flex-direction: column; }
.tier-log-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 0; border-top: 1px solid var(--line); font-size: 13px;
}
.tier-log-row:first-child { border-top: 0; }
.tier-log-move { color: var(--ink-2); }
.tier-log-move b { color: var(--accent); font-family: var(--serif); font-size: 14px; }

/* ---------- 底光 v2：浅色看得见、深色更会动 ----------
   两团底层色雾（.bgfx-a / .bgfx-b）+ 原来的颗粒层；只用 transform/opacity，不动布局
   浅色下用更高的不透明度与更饱和的色相，深色下加大漂移幅度与速度 */
.bgfx {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.bgfx > i {
  position: absolute;
  inset: -30% -22%;
  display: block;
  will-change: transform, opacity;
  backface-visibility: hidden;
}
/* 冷色主雾：青 + 天蓝，缓慢旋转漂移 */
.bgfx-a {
  background:
    radial-gradient(42% 46% at 18% 14%, rgba(94, 234, 212, .30), transparent 68%),
    radial-gradient(38% 42% at 84% 10%, rgba(56, 189, 248, .26), transparent 70%),
    radial-gradient(46% 50% at 70% 88%, rgba(167, 139, 250, .22), transparent 72%);
  filter: blur(12px) saturate(1.15);
  animation: bgDriftA 21s cubic-bezier(.45, .05, .55, .95) infinite alternate;
}
/* 暖色副雾：琥珀，反向漂移，让深色底不只是一片蓝 */
.bgfx-b {
  background:
    radial-gradient(34% 38% at 78% 78%, rgba(240, 180, 41, .18), transparent 72%),
    radial-gradient(30% 34% at 12% 84%, rgba(56, 189, 248, .16), transparent 74%);
  filter: blur(26px) saturate(1.1);
  mix-blend-mode: screen;
  animation: bgDriftB 27s cubic-bezier(.4, .06, .6, .94) infinite alternate;
}
@keyframes bgDriftA {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg) scale(1.03); opacity: .92; }
  35%  { transform: translate3d(-5.5%, 4.2%, 0) rotate(-3.6deg) scale(1.14); opacity: 1; }
  70%  { transform: translate3d(6%, -3.8%, 0) rotate(3.4deg) scale(1.08); opacity: .96; }
  100% { transform: translate3d(-3%, 5.4%, 0) rotate(-2deg) scale(1.18); opacity: 1; }
}
@keyframes bgDriftB {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg) scale(1.06); opacity: .8; }
  50%  { transform: translate3d(6.5%, -5%, 0) rotate(4deg) scale(1.2); opacity: 1; }
  100% { transform: translate3d(-5.5%, 6%, 0) rotate(-3.4deg) scale(1.1); opacity: .88; }
}

/* 原 body::before/::after 仍保留颗粒与一层底色，这里压低它们的权重，避免叠加过重 */
body::before { opacity: .55; }
body::after { opacity: .40; }

/* 浅色：色雾要更实才看得见，颗粒减弱避免脏 */
:root[data-theme="light"] .bgfx-a,
[data-theme="light"] .bgfx-a {
  background:
    radial-gradient(46% 50% at 16% 12%, rgba(13, 148, 136, .44), transparent 70%),
    radial-gradient(40% 44% at 86% 10%, rgba(14, 165, 233, .38), transparent 72%),
    radial-gradient(48% 52% at 72% 90%, rgba(99, 102, 241, .30), transparent 74%);
  filter: blur(10px) saturate(1.25);
}
:root[data-theme="light"] .bgfx-b,
[data-theme="light"] .bgfx-b {
  background:
    radial-gradient(36% 40% at 80% 76%, rgba(217, 119, 6, .34), transparent 72%),
    radial-gradient(32% 36% at 10% 86%, rgba(13, 148, 136, .30), transparent 74%);
  mix-blend-mode: multiply;
}
:root[data-theme="light"] body::before, [data-theme="light"] body::before { opacity: .35; filter: blur(10px) saturate(1); }
:root[data-theme="light"] body::after, [data-theme="light"] body::after { opacity: .22; }

/* 使用说明：正文块整体右移一点，和左侧留白更舒服 */
@media (min-width: 900px) {
  /* 说明页改为中心阅读列，这里不再做左内缩 */
}

/* ---------- 悬浮 AI 助手 ---------- */
.aichat { position: fixed; right: 22px; bottom: 22px; z-index: 80; }
.aichat-ball {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 52px;
  padding: 0 16px 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  box-shadow: 0 10px 28px rgb(0 0 0 / .18), 0 1px 0 rgb(255 255 255 / .06) inset;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.aichat-ball:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgb(0 0 0 / .24); }
.aichat-ball-ico { display: inline-flex; color: var(--accent); animation: aiSpin 9s linear infinite; }
.aichat-ball-txt { font-weight: 700; font-size: var(--t-sm); letter-spacing: .04em; }
.aichat-ball::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  opacity: .18;
  animation: aiPulse 3.2s ease-out infinite;
}
.aichat-ball.is-open::after { animation: none; opacity: 0; }
@keyframes aiSpin { to { transform: rotate(360deg); } }
@keyframes aiPulse {
  0% { transform: scale(.92); opacity: .28; }
  70% { transform: scale(1.12); opacity: 0; }
  100% { transform: scale(1.12); opacity: 0; }
}

.aichat-panel {
  position: absolute;
  right: 0;
  bottom: 66px;
  width: 380px;
  max-width: calc(100vw - 44px);
  height: 540px;
  max-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg, 16px);
  box-shadow: 0 24px 60px rgb(0 0 0 / .28);
  backdrop-filter: blur(8px);
  overflow: hidden;
  transform: translateY(8px) scale(.98);
  opacity: 0;
  pointer-events: none;
  transition: transform .2s ease, opacity .2s ease;
}
.aichat-panel.on { transform: none; opacity: 1; pointer-events: auto; }

.aichat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.aichat-head-txt { display: flex; align-items: center; gap: 8px; min-width: 0; }
.aichat-head-txt b { font-size: var(--t-sm); }
.aichat-scope {
  font-size: var(--t-3xs);
  color: var(--accent);
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 1px 7px;
  white-space: nowrap;
}
.aichat-scope-wrap { position: relative; }
.aichat-more { color: var(--accent); }
.aichat-more-menu {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 34px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  max-height: 220px;
  overflow-y: auto;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: 0 12px 30px rgb(0 0 0 / .22);
  backdrop-filter: blur(8px);
}
.aichat-more-menu[hidden] { display: none; }
.aichat-menu-item {
  text-align: left;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--foreground);
  font: inherit;
  font-size: var(--t-2xs);
  cursor: pointer;
}
.aichat-menu-item:hover { background: var(--surface-2); }
.aichat-menu-item.on { color: var(--accent); font-weight: 600; }
.aichat-scopes {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 12px 2px;
  scrollbar-width: none;
}
.aichat-scopes::-webkit-scrollbar { display: none; }
.aichat-pill {
  flex: 0 0 auto;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted-foreground);
  font-size: var(--t-3xs);
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.aichat-pill:hover { color: var(--foreground); }
.aichat-pill.on {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--accent) 12%, var(--card));
  font-weight: 600;
}
.aichat-head-acts { display: flex; gap: 4px; }
.aichat-head-acts .icon-btn {
  border: 0;
  background: transparent;
  color: var(--muted-foreground);
  font-size: var(--t-2xs);
  padding: 4px 6px;
  border-radius: 8px;
  cursor: pointer;
}
.aichat-head-acts .icon-btn:hover { background: var(--surface-2); color: var(--foreground); }

.aichat-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.aichat-empty { margin: auto; text-align: center; padding: 18px 8px; }
.aichat-empty-t { font-weight: 600; margin-bottom: 6px; }
.aichat-empty-s { font-size: var(--t-2xs); color: var(--muted-foreground); line-height: 1.6; }

.aichat-msg { display: flex; }
.aichat-msg.is-me { justify-content: flex-end; }
.aichat-bubble {
  max-width: 88%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: var(--t-xs);
  line-height: 1.65;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.aichat-bubble p { margin: 0; }
.aichat-bubble p + p { margin-top: 4px; }
.aichat-li { display: block; padding-left: 12px; position: relative; }
.aichat-li::before { content: "·"; position: absolute; left: 3px; color: var(--accent); }
.aichat-msg.is-me .aichat-bubble {
  background: color-mix(in srgb, var(--accent) 14%, var(--card));
  border-color: color-mix(in srgb, var(--accent) 34%, var(--border));
}

.aichat-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 8px; }
.aichat-chip {
  font-size: var(--t-3xs);
  color: var(--muted-foreground);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 9px;
  cursor: pointer;
}
.aichat-chip:hover { color: var(--foreground); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }

.aichat-input {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--border);
}
.aichat-input textarea {
  flex: 1;
  resize: none;
  min-height: 36px;
  max-height: 120px;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--background);
  color: var(--foreground);
  font: inherit;
  font-size: var(--t-xs);
  line-height: 1.5;
}
.aichat-input textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 1px; }
.aichat-input .btn { white-space: nowrap; }

@media (max-width: 560px) {
  .aichat { right: 14px; bottom: 14px; }
  .aichat-panel { width: calc(100vw - 28px); height: calc(100vh - 110px); }
}


/* =========================================================
   UI 精修 R2 · 手感与图表入场（2026-11）
   - 滚动条统一皮肤 + 预留槽位（换路由时宽度不跳）
   - 图表一次性入场：条形从左生长、柱形从底部长、环形描边、雷达缩放
   - 按压反馈：胶囊/筛选条/小按钮
   - 全部走 transform/opacity，prefers-reduced-motion 下静止
   ========================================================= */

/* ---------- 滚动条：细、圆、悬停加深 ---------- */
html { scrollbar-gutter: stable; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  background-clip: content-box;
  border: 2px solid transparent;
  border-radius: 999px;
  min-height: 36px;
}
*::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: content-box; }
*::-webkit-scrollbar-corner { background: transparent; }
.sidebar::-webkit-scrollbar { width: 6px; }

/* ---------- 图表入场 ---------- */
@keyframes barGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes histGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes donutIn { from { opacity: 0; stroke-width: 0; } }
@keyframes radarIn { from { opacity: 0; transform: scale(.86); } }

.bar-fill {
  transform-origin: left center;
  animation: barGrow .5s var(--ease-out, cubic-bezier(.22,.61,.36,1)) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}
.hist-bar {
  transform-box: fill-box;
  transform-origin: bottom center;
  animation: histGrow .45s var(--ease-out, cubic-bezier(.22,.61,.36,1)) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}
.donut-arc { animation: donutIn .5s var(--ease-out, cubic-bezier(.22,.61,.36,1)) both; animation-delay: calc(var(--i, 0) * 90ms); }
.radar-shape { transform-box: fill-box; transform-origin: center; animation: radarIn .55s var(--ease-out, cubic-bezier(.22,.61,.36,1)) both; }

/* ---------- 按压反馈：一层 0.97 的回弹，比颜色变化更“实” ---------- */
.chip[data-filter]:active,
.cs-pill:active,
.aichat-pill:active,
.aichat-menu-item:active,
.table .btn:active,
.btn-sm:active { transform: scale(.97); }
.chip[data-filter], .cs-pill, .aichat-pill, .aichat-menu-item, .btn-sm {
  transition: transform .12s var(--ease, cubic-bezier(.22,.61,.36,1)),
              background .16s var(--ease, cubic-bezier(.22,.61,.36,1)),
              color .16s var(--ease, cubic-bezier(.22,.61,.36,1)),
              border-color .16s var(--ease, cubic-bezier(.22,.61,.36,1)),
              box-shadow .16s var(--ease, cubic-bezier(.22,.61,.36,1));
}

/* ---------- 图标按钮/主题切换：给个可见的按压与悬停 ---------- */
.theme-toggle:hover { transform: translateY(-1px); }
.theme-toggle:active { transform: scale(.94); }


/* ---------- 垂直节奏：块与块之间统一 18px ---------- */
/* 实测原来首页各块间距 20 / 20 / 16 / 14 / 16 混着，读起来“不齐” */
#view > * + * { margin-top: 18px !important; }
#view > .stat-row + * { margin-top: 20px !important; }
.class-grid { gap: 16px; }

@media (prefers-reduced-motion: reduce) {
  .bar-fill, .hist-bar, .donut-arc, .radar-shape { animation: none !important; }
  .chip[data-filter]:active, .cs-pill:active, .aichat-pill:active,
  .aichat-menu-item:active, .table .btn:active, .btn-sm:active,
  .theme-toggle:hover, .theme-toggle:active { transform: none !important; }
}

/* ---------- 说明页：卡片占满整栏，正文居中成一条阅读列 ---------- */
/* 原来卡片 max-width:900 靠左，右侧留一大片空白，看着像没对齐。
   现在卡片与其它页一样铺满内容栏，各节（标题/列表/表格/提示框）统一居中 760px 一条线，
   左右留白相等，长文也好读。 */
/* 卡片本身收成一张居中的“纸”：比整栏窄，四周留白相等，正文直接吃满卡片内宽 */
.help-card { max-width: 780px; margin-left: auto; margin-right: auto; }
.help-sec { max-width: none; padding-left: 0; }
/* 段落/列表原来另有 46em 上限，会在列里再缩一截、右边缘参差；
   现在统一吃满这一列，标题、表格、提示框、正文共用同一条左右边线 */
.help-p, .help-ul li, .help-ol li, .help-note, .help-qa { max-width: none; }
@media (max-width: 860px) {
  .help-card { max-width: none; }
}
