/* =========================================================
   幼見 KidSight — Prototype design system
   Static HTML prototype · Hong Kong kindergarten assessment
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  --brand-950: #062a24;
  --brand-900: #0a3a31;
  --brand-800: #0f4f42;
  --brand-700: #146b5a;
  --brand-600: #1a806b;
  --brand-500: #2a9a82;
  --brand-200: #b9ddcf;
  --brand-100: #dff0e9;
  --brand-50: #f0f8f4;

  --amber-700: #a86c1e;
  --amber-600: #c98a32;
  --amber-500: #e0a54a;
  --amber-100: #faedda;
  --amber-50: #fdf7ec;

  --danger-600: #b54a3c;
  --danger-500: #cf6253;
  --danger-100: #fbe9e6;
  --info-600: #376d9c;
  --info-100: #e7f0f8;
  --plum-600: #7a5a8c;
  --plum-100: #f1eaf5;

  /* 營運後台（內部）：冷色調，與學校介面的暖綠分開。
     只在 ops 頁面使用；狀態 badge 仍然用上面的語意色。 */
  --ops-950: #0b1a2b;
  --ops-900: #102437;
  --ops-800: #17334d;
  --ops-700: #2b5f8a;
  --ops-600: #3978a8;
  --ops-500: #5f9ac4;
  --ops-200: #b7d2e6;
  --ops-100: #dceaf5;
  --ops-50: #f2f7fb;
  --ops-bg: #f2f5f8;

  --ink-900: #17231f;
  --ink-800: #22322c;
  --ink-700: #33453f;
  --ink-600: #53665f;
  --ink-500: #667a73;
  --ink-400: #879791;
  --ink-300: #a7b3ae;

  --line: #e3e7e1;
  --line-strong: #d3dbd4;
  --bg: #f4f6f2;
  --surface: #ffffff;
  --surface-2: #fafbf8;
  --surface-3: #f1f4ef;

  --r-xs: 6px;
  --r-sm: 9px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-full: 999px;

  --shadow-xs: 0 1px 2px rgba(18, 42, 34, 0.05);
  --shadow-sm: 0 2px 6px rgba(18, 42, 34, 0.05);
  --shadow: 0 14px 34px -14px rgba(18, 42, 34, 0.18), 0 2px 6px rgba(18, 42, 34, 0.04);
  --shadow-lg: 0 30px 70px -24px rgba(6, 30, 24, 0.32), 0 6px 18px rgba(6, 30, 24, 0.08);

  --sidebar-w: 248px;
  --topbar-h: 64px;
  --font: "Noto Sans HK", "PingFang HK", "Microsoft JhengHei", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-num: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-900);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
ul, ol { margin: 0; padding: 0; list-style: none; }
hr { border: 0; border-top: 1px solid var(--line); margin: 0; }
::selection { background: var(--brand-200); color: var(--brand-900); }

.ic {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.ic-sm { width: 15px; height: 15px; }
.ic-lg { width: 22px; height: 22px; }
.ic-xl { width: 28px; height: 28px; }

/* ---------- Utilities ---------- */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.col { flex-direction: column; }
.center { align-items: center; }
.between { justify-content: space-between; }
.end { justify-content: flex-end; }
.wrap { flex-wrap: wrap; }
.gap-2 { gap: 2px; } .gap-4 { gap: 4px; } .gap-6 { gap: 6px; }
.gap-8 { gap: 8px; } .gap-10 { gap: 10px; } .gap-12 { gap: 12px; }
.gap-16 { gap: 16px; } .gap-20 { gap: 20px; } .gap-24 { gap: 24px; }
.grow { flex: 1 1 auto; min-width: 0; }
.shrink-0 { flex: none; }
.muted { color: var(--ink-500); }
.faint { color: var(--ink-400); }
.small { font-size: 12.5px; }
.xs { font-size: 11.5px; }
.strong { font-weight: 650; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.mono { font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace; font-size: 12px; }
.hide { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.mt-2 { margin-top: 2px; } .mt-4 { margin-top: 4px; } .mt-6 { margin-top: 6px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; } .mb-24 { margin-bottom: 24px; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 5px;
  font-family: var(--font-num); font-size: 10.5px; font-weight: 600;
  color: var(--ink-500); background: var(--surface); border: 1px solid var(--line-strong);
  border-bottom-width: 2px; border-radius: 5px;
}

/* ---------- App shell ---------- */
.app { min-height: 100vh; }
.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.content {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 26px 30px 64px;
  flex: 1;
}

/* Sidebar */
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 60;
  width: var(--sidebar-w);
  display: flex; flex-direction: column;
  padding: 18px 14px 14px;
  color: #cfded8;
  background:
    radial-gradient(120% 60% at 10% 0%, rgba(45, 138, 116, 0.35), transparent 60%),
    linear-gradient(180deg, #0c3b32 0%, #082c25 55%, #07251f 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  overflow-y: auto;
}
.sidebar::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 180px;
  background: radial-gradient(80% 100% at 20% 100%, rgba(224, 165, 74, 0.08), transparent 70%);
  pointer-events: none;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 2px 8px 18px;
}
.brand img { width: 36px; height: 36px; border-radius: 11px; box-shadow: 0 6px 16px rgba(0,0,0,.25); }
.brand-name { font-size: 17px; font-weight: 750; letter-spacing: .06em; color: #fff; line-height: 1.15; }
.brand-en { display: block; font-family: var(--font-num); font-size: 9.5px; font-weight: 600; letter-spacing: .16em; color: rgba(215, 232, 224, .55); margin-top: 3px; }

.school-switch {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 11px; margin-bottom: 18px;
  color: #e7f1ed; text-align: left;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--r-md);
  transition: background .15s;
}
.school-switch:hover { background: rgba(255, 255, 255, 0.09); }
.school-badge {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: rgba(224, 165, 74, .16); color: #efc078;
}
.school-name { display: block; font-size: 12.5px; font-weight: 650; color: #fff; line-height: 1.3; }
.school-term { display: block; font-size: 10.5px; color: rgba(215, 232, 224, .55); margin-top: 2px; }
.school-switch > .ic { margin-left: auto; opacity: .5; }

.nav-group { margin-bottom: 18px; }
.nav-label {
  font-size: 10px; font-weight: 650; letter-spacing: .14em;
  color: rgba(215, 232, 224, .38);
  padding: 0 11px 7px;
}
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  height: 40px; padding: 0 11px; margin-bottom: 2px;
  border-radius: 9px;
  font-size: 13px; font-weight: 500; color: rgba(218, 233, 227, .74);
  transition: background .14s, color .14s;
}
.nav-item .ic { width: 18px; height: 18px; opacity: .8; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active {
  background: rgba(255, 255, 255, .105);
  color: #fff; font-weight: 650;
  box-shadow: inset 3px 0 0 var(--amber-500);
}
.nav-item.active .ic { opacity: 1; color: #f0c27a; }
.nav-badge {
  margin-left: auto; font-family: var(--font-num); font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 6px;
  display: grid; place-items: center;
  background: var(--amber-500); color: #3c2708;
}
.nav-soon {
  margin-left: auto; font-size: 9px; font-weight: 600; letter-spacing: .04em;
  color: rgba(215, 232, 224, .45); border: 1px solid rgba(255,255,255,.14);
  padding: 1px 5px; border-radius: 4px;
}
.sidebar-spacer { flex: 1 1 auto; min-height: 18px; }
.side-help {
  position: relative; overflow: hidden;
  margin: 0 2px 12px; padding: 13px;
  background: linear-gradient(145deg, rgba(224, 165, 74, .13), rgba(255, 255, 255, .04));
  border: 1px solid rgba(224, 165, 74, .18);
  border-radius: var(--r-md);
}
.side-help .ic { color: #efc078; margin-bottom: 7px; }
.side-help b { display: block; font-size: 12px; color: #f3e8d5; font-weight: 650; }
.side-help span { display: block; font-size: 10.5px; line-height: 1.5; color: rgba(224, 236, 231, .55); margin-top: 3px; }
.side-help a { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; color: #efc078; margin-top: 7px; }
.side-user {
  display: flex; align-items: center; gap: 9px;
  width: 100%; padding: 9px 8px; border: 0; border-top: 1px solid rgba(255, 255, 255, .08);
  background: transparent; color: inherit; text-align: left; border-radius: 8px;
}
.side-user:hover { background: rgba(255,255,255,.05); }
.side-user .avatar { width: 32px; height: 32px; font-size: 11px; border: 1px solid rgba(255,255,255,.2); }
.side-user-name { display: block; font-size: 12px; font-weight: 600; color: #fff; line-height: 1.3; }
.side-user-role { display: block; font-size: 10px; color: rgba(215, 232, 224, .5); }
.side-user .ic { margin-left: auto; opacity: .45; }

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 30px;
  background: rgba(250, 251, 248, .88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.menu-toggle { display: none; }
.topbar .menu-toggle { display: none; }
.crumb { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-400); white-space: nowrap; }
.crumb a:hover { color: var(--brand-700); }
.crumb .sep { color: var(--ink-300); }
.crumb b { color: var(--ink-700); font-weight: 600; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  position: relative;
  width: 36px; height: 36px; display: grid; place-items: center;
  color: var(--ink-500); background: transparent;
  border: 1px solid transparent; border-radius: 10px;
  transition: background .14s, color .14s, border-color .14s;
}
.icon-btn:hover { background: var(--surface); border-color: var(--line); color: var(--ink-800); }
.icon-btn .dot-alert {
  position: absolute; top: 8px; right: 8px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--danger-500); border: 1.5px solid #fafbf8;
}
.search-trigger {
  display: flex; align-items: center; gap: 9px;
  width: 226px; height: 36px; padding: 0 10px 0 11px;
  color: var(--ink-400); font-size: 12.5px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; text-align: left;
  transition: border-color .14s, box-shadow .14s;
}
.search-trigger:hover { border-color: var(--line-strong); box-shadow: var(--shadow-xs); }
.search-trigger .kbd { margin-left: auto; }
.term-btn {
  display: flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 11px;
  font-size: 12px; font-weight: 550; color: var(--ink-600);
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
}
.term-btn:hover { border-color: var(--line-strong); }
.term-btn .ic { width: 14px; height: 14px; color: var(--ink-400); }
.top-avatar { width: 34px; height: 34px; font-size: 11.5px; cursor: pointer; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }

/* Dropdowns */
.dd { position: relative; }
.menu {
  position: absolute; z-index: 90; top: calc(100% + 7px); right: 0;
  min-width: 190px; padding: 5px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(-4px) scale(.985);
  transition: opacity .13s, transform .13s, visibility .13s;
}
.menu.left { right: auto; left: 0; }
.menu.is-open { opacity: 1; visibility: visible; transform: none; }
.menu-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%; padding: 8px 9px;
  font-size: 12.5px; color: var(--ink-700); text-align: left;
  border: 0; background: transparent; border-radius: 7px;
}
.menu-item:hover { background: var(--surface-3); color: var(--ink-900); }
.menu-item .ic { width: 15px; height: 15px; color: var(--ink-400); }
.menu-item.danger { color: var(--danger-600); }
.menu-item.danger .ic { color: var(--danger-500); }
.menu-item .menu-check { margin-left: auto; color: var(--brand-600); }
.menu-sep { height: 1px; background: var(--line); margin: 5px 4px; }
.menu-label { padding: 7px 9px 4px; font-size: 10px; letter-spacing: .08em; color: var(--ink-400); font-weight: 650; }

/* Notifications */
.notif-pop { width: 330px; padding: 0; overflow: hidden; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.notif-head b { font-size: 13px; }
.notif-head button { font-size: 11px; color: var(--brand-700); border: 0; background: none; }
.notif-item { display: flex; gap: 10px; padding: 12px 15px; border-bottom: 1px solid var(--line); }
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: var(--surface-2); }
.notif-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.notif-item b { display: block; font-size: 12px; font-weight: 600; line-height: 1.45; }
.notif-item span { display: block; font-size: 10.5px; color: var(--ink-400); margin-top: 3px; }
.user-pop { width: 220px; }
.user-pop-head { padding: 11px 11px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.user-pop-head b { display: block; font-size: 13px; }
.user-pop-head span { font-size: 11px; color: var(--ink-400); }

/* ---------- Page header ---------- */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; margin-bottom: 22px;
}
.page-head h1 { font-size: 27px; font-weight: 750; letter-spacing: -.02em; line-height: 1.28; }
.page-head .sub { color: var(--ink-500); font-size: 13px; margin-top: 5px; max-width: 720px; }
.page-actions { display: flex; align-items: center; gap: 9px; flex: none; padding-bottom: 2px; }
.eyebrow {
  display: flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .1em;
  color: var(--brand-600); text-transform: uppercase; margin-bottom: 7px;
}
.eyebrow .dot { background: var(--amber-500); }

.page-head.compact { align-items: center; margin-bottom: 18px; }
.page-head.compact h1 { font-size: 23px; }

.backlink {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 550; color: var(--ink-500);
  margin-bottom: 10px;
}
.backlink:hover { color: var(--brand-700); }
.backlink .ic { width: 14px; height: 14px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 14px;
  font-size: 13px; font-weight: 600; line-height: 1;
  color: var(--ink-700); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 10px;
  white-space: nowrap;
  transition: background .14s, border-color .14s, box-shadow .14s, transform .08s;
}
.btn:hover { background: var(--surface-2); border-color: #c3cec5; box-shadow: var(--shadow-xs); }
.btn:active { transform: translateY(1px); }
.btn .ic { width: 16px; height: 16px; }
.btn-primary {
  color: #fff; background: linear-gradient(180deg, var(--brand-600), var(--brand-700));
  border-color: var(--brand-700);
  box-shadow: 0 4px 12px -4px rgba(20, 107, 90, .45), inset 0 1px 0 rgba(255,255,255,.14);
}
.btn-primary:hover { background: linear-gradient(180deg, var(--brand-500), var(--brand-600)); border-color: var(--brand-600); }
.btn-amber {
  color: #3c2a0c; background: linear-gradient(180deg, #ecc078, var(--amber-500));
  border-color: #d29b45; box-shadow: 0 4px 12px -5px rgba(201, 138, 50, .5);
}
.btn-amber:hover { background: #e8b45f; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-600); }
.btn-ghost:hover { background: var(--surface-3); border-color: transparent; box-shadow: none; }
.btn-danger { color: #fff; background: var(--danger-600); border-color: var(--danger-600); }
.btn-danger:hover { background: #a24034; border-color: #a24034; }
.btn-soft-danger { color: var(--danger-600); background: var(--danger-100); border-color: transparent; }
.btn-soft-danger:hover { background: #f8deda; border-color: transparent; }
.btn-sm { height: 32px; padding: 0 10px; font-size: 12px; border-radius: 8px; gap: 5px; }
.btn-sm .ic { width: 14px; height: 14px; }
.btn-xs { height: 27px; padding: 0 8px; font-size: 11px; border-radius: 7px; gap: 4px; }
.btn-lg { height: 44px; padding: 0 18px; font-size: 14px; border-radius: 11px; }
.btn-icon { width: 36px; padding: 0; }
.btn-icon.btn-sm { width: 30px; }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.btn-block { width: 100%; }
.link-btn { border: 0; background: none; padding: 0; font-size: 12px; font-weight: 600; color: var(--brand-700); display: inline-flex; align-items: center; gap: 4px; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Badges / chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 23px; padding: 0 8px;
  font-size: 10.5px; font-weight: 650; line-height: 1;
  border-radius: var(--r-full); white-space: nowrap;
  background: var(--surface-3); color: var(--ink-600);
}
.badge .dot { width: 5px; height: 5px; }
.badge-brand { background: var(--brand-100); color: var(--brand-800); }
.badge-amber { background: var(--amber-100); color: var(--amber-700); }
.badge-blue { background: var(--info-100); color: var(--info-600); }
.badge-plum { background: var(--plum-100); color: var(--plum-600); }
.badge-red { background: var(--danger-100); color: var(--danger-600); }
.badge-gray { background: #eef1ec; color: var(--ink-500); }
.badge-outline { background: transparent; border: 1px solid var(--line-strong); color: var(--ink-500); }
.st-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.st-draft { background: #e8ebe6; color: #5d6b66; }
.st-draft .st-dot, .st-dot.st-draft { background: #98a49f; }
.st-live { background: var(--brand-100); color: var(--brand-800); }
.st-live .st-dot, .st-dot.st-live { background: var(--brand-600); }
.st-review { background: var(--info-100); color: var(--info-600); }
.st-review .st-dot, .st-dot.st-review { background: var(--info-600); }
.st-done { background: #e8f1e8; color: #42724b; }
.st-done .st-dot, .st-dot.st-done { background: #5b9464; }
.st-warn { background: var(--amber-100); color: var(--amber-700); }
.st-warn .st-dot, .st-dot.st-warn { background: var(--amber-600); }
.st-archived { background: #eef1ec; color: #8c9893; }
.st-archived .st-dot, .st-dot.st-archived { background: #aab4af; }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  height: 21px; padding: 0 7px; border-radius: 5px;
  font-size: 10px; font-weight: 600; line-height: 1;
  background: var(--surface-3); color: var(--ink-500); white-space: nowrap;
}
.tag-red { background: var(--danger-100); color: var(--danger-600); }
.tag-amber { background: var(--amber-50); color: var(--amber-700); }
.tag-blue { background: var(--info-100); color: var(--info-600); }
.tag-green { background: var(--brand-50); color: var(--brand-700); }
.tag .dot { width: 4px; height: 4px; }

/* ---------- Avatars ---------- */
.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 36px; height: 36px; border-radius: 50%;
  font-size: 12px; font-weight: 700; letter-spacing: .02em;
  color: var(--brand-800); background: var(--brand-100);
  border: 1px solid rgba(20, 107, 90, .08);
  overflow: hidden; user-select: none;
}
.avatar.sm { width: 28px; height: 28px; font-size: 10px; }
.avatar.lg { width: 52px; height: 52px; font-size: 17px; }
.avatar.xl { width: 92px; height: 92px; font-size: 30px; border-width: 3px; border-color: #fff; }
.av-amber { background: #f8e8cd; color: #8a5a16; }
.av-blue { background: #e3edf7; color: #376d9c; }
.av-rose { background: #f7e5e3; color: #a64b3f; }
.av-lilac { background: #f0e9f5; color: #735689; }
.av-sand { background: #f2ebdc; color: #7d6538; }
.av-mint { background: #e0f0e7; color: #2c735b; }
.av-stack { display: flex; align-items: center; }
.av-stack .avatar { margin-left: -7px; border: 2px solid #fff; }
.av-stack .avatar:first-child { margin-left: 0; }
.av-stack .more {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  margin-left: -7px; background: var(--surface-3); color: var(--ink-500);
  border: 2px solid #fff; font-size: 9.5px; font-weight: 700;
}

/* ---------- Forms ---------- */
.field { margin-bottom: 15px; }
.field:last-child { margin-bottom: 0; }
.field > label, .label {
  display: block; font-size: 12px; font-weight: 650; color: var(--ink-700);
  margin-bottom: 6px;
}
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.label-row label { font-size: 12px; font-weight: 650; color: var(--ink-700); }
.required { color: var(--danger-500); margin-left: 2px; }
.input, .select, .textarea {
  width: 100%; padding: 9px 11px;
  font-size: 13px; color: var(--ink-900);
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 9px;
  transition: border-color .14s, box-shadow .14s;
}
.input::placeholder, .textarea::placeholder { color: var(--ink-300); }
.input:hover, .select:hover, .textarea:hover { border-color: #c3cec5; }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand-500);
  box-shadow: 0 0 0 3px var(--brand-100);
}
:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: none; }
.textarea { min-height: 86px; resize: vertical; line-height: 1.65; }
.select {
  appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667a73' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.input-sm { padding: 6px 9px; font-size: 12px; border-radius: 7px; }
.hint { font-size: 11px; color: var(--ink-400); margin-top: 5px; line-height: 1.5; }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: 9px 0 0 9px; }
.input-group .addon {
  display: flex; align-items: center; padding: 0 11px;
  font-size: 12px; color: var(--ink-500); background: var(--surface-3);
  border: 1px solid var(--line-strong); border-left: 0; border-radius: 0 9px 9px 0;
}
.input-wrap { position: relative; }
.input-wrap .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--ink-400); }
.input-wrap .input { padding-left: 34px; }
.check {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--ink-600); cursor: pointer; user-select: none;
}
.check input { width: 16px; height: 16px; accent-color: var(--brand-700); margin: 0; cursor: pointer; }
.check-block { display: flex; align-items: flex-start; gap: 9px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.check-block:hover { background: var(--surface-2); }
.check-block input { margin-top: 2px; width: 15px; height: 15px; accent-color: var(--brand-700); }
.check-block b { display: block; font-size: 12.5px; font-weight: 600; }
.check-block span { display: block; font-size: 11px; color: var(--ink-400); margin-top: 2px; }
.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; background: #d8e0d9; border-radius: 999px; transition: background .15s; pointer-events: none; }
.switch i::after {
  content: ""; position: absolute; left: 3px; top: 3px;
  width: 16px; height: 16px; background: #fff; border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.18); transition: transform .15s;
}
.switch input:checked + i { background: var(--brand-600); }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { box-shadow: 0 0 0 3px var(--brand-100); }
.seg {
  display: inline-flex; align-items: center; gap: 2px; padding: 3px;
  background: var(--surface-3); border: 1px solid var(--line); border-radius: 9px;
}
.seg button {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  height: 28px; padding: 0 11px; border: 0; border-radius: 6px;
  font-size: 11.5px; font-weight: 600; color: var(--ink-500); background: transparent;
  white-space: nowrap;
}
.seg button:hover { color: var(--ink-800); }
.seg button.on { background: var(--surface); color: var(--brand-800); box-shadow: var(--shadow-xs); }
.seg .ic { width: 14px; height: 14px; }
.seg-block { display: flex; width: 100%; }
.seg-block button { flex: 1; }

/* ---------- Cards / tables ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-xs); }
.card-pad { padding: 20px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.card-head h2, .card-head h3 { font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.card-head .sub { font-size: 11.5px; color: var(--ink-400); margin-top: 2px; }
.card-body { padding: 20px; }
.card-foot { padding: 13px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.card.flush { overflow: hidden; }

.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.table th {
  padding: 10px 14px; text-align: left; white-space: nowrap;
  font-size: 10.5px; font-weight: 650; letter-spacing: .03em; color: var(--ink-400);
  background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--ink-700); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: #fafcf9; }
.table tbody tr.selected { background: var(--brand-50); }
.table .cell-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.table .cell-main .t { font-size: 12.5px; font-weight: 600; color: var(--ink-900); line-height: 1.4; }
.table .cell-main .s { font-size: 10.5px; color: var(--ink-400); margin-top: 1px; }
.table .num { font-size: 12px; color: var(--ink-500); }
.table .actions { display: flex; align-items: center; gap: 2px; justify-content: flex-end; }
.table .row-link { color: var(--ink-700); }
.table .row-link:hover { color: var(--brand-700); }
.table td.tight { padding-top: 9px; padding-bottom: 9px; }
.table th.col-check, .table td.col-check {
  position: relative;
  width: 48px;
  padding: 0;
  vertical-align: middle;
}
/* Inline checkboxes sit on the text baseline, so a two-line row leaves them high. Pin to the cell center. */
.table .col-check input[type="checkbox"] {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  accent-color: var(--brand-700);
  cursor: pointer;
}
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--ink-400); }

.pager { display: flex; align-items: center; gap: 4px; }
.pager button {
  min-width: 28px; height: 28px; padding: 0 7px;
  font-size: 11px; font-weight: 600; color: var(--ink-500);
  background: transparent; border: 1px solid transparent; border-radius: 7px;
}
.pager button:hover { background: var(--surface-3); }
.pager button.on { background: var(--brand-700); color: #fff; border-color: var(--brand-700); }
.pager button:disabled { opacity: .35; cursor: default; }

/* Toolbar / filters */
.toolbar {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.toolbar .searchbox { flex: 1 1 220px; max-width: 320px; }
.searchbox { position: relative; }
.searchbox .ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--ink-400); }
.searchbox input {
  width: 100%; height: 34px; padding: 0 11px 0 32px;
  font-size: 12px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 8px;
}
.searchbox input:focus { outline: none; border-color: var(--brand-500); background: #fff; box-shadow: 0 0 0 3px var(--brand-100); }
.filter-chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 32px; padding: 0 10px;
  font-size: 11.5px; font-weight: 550; color: var(--ink-500);
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
}
.filter-chip:hover { border-color: var(--line-strong); color: var(--ink-800); }
.filter-chip.on { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.filter-chip .count { font-family: var(--font-num); font-size: 10px; opacity: .7; }
.view-toggle { display: inline-flex; padding: 2px; background: var(--surface-3); border-radius: 7px; }
.view-toggle button { width: 28px; height: 26px; display: grid; place-items: center; border: 0; background: transparent; border-radius: 5px; color: var(--ink-400); }
.view-toggle button.on { background: #fff; color: var(--brand-700); box-shadow: var(--shadow-xs); }
.view-toggle .ic { width: 14px; height: 14px; }

/* Stats */
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-md);
}
.stat-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.stat b { display: block; font-family: var(--font-num); font-size: 21px; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.stat span { display: block; font-size: 10.5px; color: var(--ink-400); margin-top: 3px; }
.bg-mint { background: var(--brand-50); color: var(--brand-700); }
.bg-amber { background: var(--amber-50); color: var(--amber-700); }
.bg-blue { background: var(--info-100); color: var(--info-600); }
.bg-rose { background: var(--danger-100); color: var(--danger-600); }
.bg-plum { background: var(--plum-100); color: var(--plum-600); }

/* Progress */
.bar { height: 6px; background: #edf1ec; border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand-600), var(--brand-500)); transition: width .3s; }
.bar.amber > i { background: linear-gradient(90deg, var(--amber-600), var(--amber-500)); }
.bar.blue > i { background: linear-gradient(90deg, #4b7fae, #6b9bc6); }
.bar.rose > i { background: linear-gradient(90deg, #b95a4c, #d07b6e); }
.bar.thin { height: 4px; }
.bar.thick { height: 9px; }
.progress-line { display: flex; align-items: center; gap: 9px; }
.progress-line .bar { flex: 1; min-width: 54px; }
.progress-line .pct { font-family: var(--font-num); font-size: 10.5px; font-weight: 650; color: var(--ink-500); width: 30px; text-align: right; }
.ring {
  --p: 0; --size: 40px; --track: #e9efe9; --fill: var(--brand-600);
  width: var(--size); height: var(--size); border-radius: 50%;
  background: conic-gradient(var(--fill) calc(var(--p) * 1%), var(--track) 0);
  display: grid; place-items: center; flex: none;
}
.ring::before { content: ""; width: calc(var(--size) - 8px); height: calc(var(--size) - 8px); border-radius: 50%; background: #fff; grid-area: 1 / 1; }
.ring span { grid-area: 1 / 1; z-index: 1; font-family: var(--font-num); font-size: 9px; font-weight: 700; color: var(--ink-600); }
.ring.lg { --size: 70px; }
.ring.lg span { font-size: 15px; }
.ring.amber { --fill: var(--amber-500); }

/* ---------- Tabs ---------- */
.tabs { display: flex; align-items: center; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  padding: 11px 13px; margin-bottom: -1px;
  font-size: 12.5px; font-weight: 550; color: var(--ink-500);
  background: none; border: 0; border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab:hover { color: var(--ink-800); }
.tab.on { color: var(--brand-800); border-bottom-color: var(--brand-700); font-weight: 650; }
.tab .count { font-family: var(--font-num); font-size: 10px; padding: 1px 5px; border-radius: 5px; background: var(--surface-3); color: var(--ink-500); }
.tab.on .count { background: var(--brand-100); color: var(--brand-700); }
.tab-panel { display: none; }
.tab-panel.on { display: block; animation: fadeUp .2s ease; }

/* ---------- Empty state ---------- */
.empty { padding: 46px 24px; text-align: center; }
.empty-ico { width: 54px; height: 54px; margin: 0 auto 13px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-400); }
.empty h3 { font-size: 14px; font-weight: 650; }
.empty p { font-size: 12px; color: var(--ink-400); margin: 5px auto 16px; max-width: 360px; }

/* ---------- Modal / toast / cmdk ---------- */
.modal { position: fixed; inset: 0; z-index: 120; display: none; }
.modal.is-open { display: grid; place-items: center; padding: 24px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(8, 28, 23, .46); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); animation: fadeIn .15s; }
.modal-card {
  position: relative; z-index: 1;
  width: min(540px, 100%); max-height: min(88vh, 820px);
  display: flex; flex-direction: column;
  background: var(--surface); border-radius: 20px;
  box-shadow: var(--shadow-lg);
  animation: popIn .18s cubic-bezier(.2,.8,.3,1);
}
.modal-card > form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.modal-card.lg { width: min(760px, 100%); }
.modal-card.xl { width: min(980px, 100%); }
.modal-head { display: flex; align-items: flex-start; gap: 14px; padding: 22px 24px 14px; }
.modal-head .modal-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.modal-head h2 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.modal-head p { font-size: 12px; color: var(--ink-400); margin-top: 4px; line-height: 1.55; }
.modal-close { margin-left: auto; flex: none; }
.modal-body { padding: 8px 24px 22px; overflow-y: auto; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 15px 24px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 20px 20px; }
.modal-foot .left { margin-right: auto; }
.modal-note { display: flex; gap: 9px; padding: 11px 12px; background: var(--amber-50); border: 1px solid #f2e4cd; border-radius: 9px; font-size: 11.5px; color: #7a5a25; line-height: 1.55; }
.modal-note .ic { color: var(--amber-600); margin-top: 1px; }
.modal-note.info { background: var(--brand-50); border-color: #d6e9df; color: var(--brand-800); }
.modal-note.info .ic { color: var(--brand-600); }

.toast-wrap { position: fixed; right: 22px; bottom: 22px; z-index: 200; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px;
  min-width: 260px; max-width: 380px; padding: 11px 13px;
  font-size: 12px; color: #eaf4ef; background: #123f35;
  border: 1px solid rgba(255,255,255,.08); border-radius: 11px;
  box-shadow: 0 16px 34px -12px rgba(5, 30, 24, .5);
  pointer-events: auto; animation: toastIn .22s cubic-bezier(.2,.8,.3,1);
}
.toast.out { animation: toastOut .2s forwards; }
.toast .t-ico { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.12); flex: none; }
.toast .t-ico.ok { background: rgba(96, 190, 150, .22); color: #a8e3c8; }
.toast .t-ico.warn { background: rgba(224, 165, 74, .2); color: #f0c987; }
.toast .t-ico.error { background: rgba(207, 98, 83, .25); color: #f0b0a7; }
.toast .t-msg { line-height: 1.5; }
.toast .t-action { margin-left: auto; font-size: 11px; font-weight: 700; color: #f0c987; border: 0; background: none; padding: 2px 4px; }
.toast .t-close { color: rgba(255,255,255,.4); border: 0; background: none; padding: 2px; }

.cmdk { position: fixed; inset: 0; z-index: 300; display: none; padding: 12vh 20px 20px; }
.cmdk.is-open { display: block; }
.cmdk-backdrop { position: absolute; inset: 0; background: rgba(8, 28, 23, .4); backdrop-filter: blur(4px); }
.cmdk-card {
  position: relative; width: min(560px, 100%); margin: 0 auto;
  background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg);
  overflow: hidden; animation: popIn .16s;
}
.cmdk-top { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.cmdk-top .ic { color: var(--ink-400); }
.cmdk-top input { flex: 1; border: 0; outline: 0; font-size: 14px; background: none; }
.cmdk-top .kbd { flex: none; }
.cmdk-list { max-height: 340px; overflow-y: auto; padding: 7px; }
.cmdk-group { padding: 8px 9px 4px; font-size: 9.5px; font-weight: 700; letter-spacing: .1em; color: var(--ink-400); }
.cmdk-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: 8px; text-align: left; }
.cmdk-item:hover, .cmdk-item.on { background: var(--brand-50); }
.cmdk-item .ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); color: var(--brand-700); flex: none; }
.cmdk-item b { display: block; font-size: 12.5px; font-weight: 600; }
.cmdk-item span { display: block; font-size: 10.5px; color: var(--ink-400); }
.cmdk-item .go { margin-left: auto; color: var(--ink-300); }
.cmdk-foot { display: flex; gap: 14px; padding: 9px 15px; font-size: 10px; color: var(--ink-400); border-top: 1px solid var(--line); background: var(--surface-2); }
.cmdk-empty { padding: 30px; text-align: center; font-size: 12px; color: var(--ink-400); }

/* ---------- Login ---------- */
.login-body { background: #f7f6f1; }
.login {
  min-height: 100vh;
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(460px, .92fr);
}
.login-brand {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  padding: 46px 56px 40px;
  color: #e9f3ef;
  background:
    radial-gradient(90% 90% at 100% 0%, rgba(58, 150, 126, .35), transparent 60%),
    radial-gradient(70% 60% at 0% 100%, rgba(224, 165, 74, .12), transparent 60%),
    linear-gradient(160deg, #0e4a3e 0%, #092f28 55%, #07231e 100%);
}
.login-brand::before {
  content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%;
  right: -210px; bottom: -230px; border: 1px solid rgba(255,255,255,.07);
  box-shadow: 0 0 0 60px rgba(255,255,255,.018), 0 0 0 140px rgba(255,255,255,.014);
  pointer-events: none;
}
.login-brand::after {
  content: ""; position: absolute; width: 320px; height: 320px; border-radius: 50%;
  left: -120px; top: 34%; background: radial-gradient(circle, rgba(224,165,74,.09), transparent 68%);
  pointer-events: none;
}
.login-top { position: relative; z-index: 1; display: flex; align-items: center; gap: 11px; }
.login-top img { width: 40px; height: 40px; border-radius: 12px; }
.login-top .n { font-size: 19px; font-weight: 750; letter-spacing: .06em; color: #fff; line-height: 1.1; }
.login-top .e { font-size: 9.5px; letter-spacing: .18em; color: rgba(220, 236, 229, .5); font-family: var(--font-num); }
.login-copy { position: relative; z-index: 1; margin-top: auto; padding-top: 40px; }
.login-kicker {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 9px; margin-bottom: 20px;
  font-size: 10px; font-weight: 650; letter-spacing: .08em; color: #f0c987;
  background: rgba(224, 165, 74, .1); border: 1px solid rgba(224, 165, 74, .2); border-radius: 999px;
}
.login-copy h1 {
  font-size: clamp(34px, 3.5vw, 50px); font-weight: 750; line-height: 1.3;
  letter-spacing: -.03em; color: #fdfbf6; max-width: 520px;
}
.login-copy h1 em { font-style: normal; color: #efc27c; }
.login-copy p { font-size: 14px; line-height: 1.85; color: rgba(220, 236, 229, .66); max-width: 440px; margin-top: 18px; }
.login-points { display: grid; gap: 13px; margin-top: 34px; max-width: 440px; }
.login-point { display: flex; gap: 11px; align-items: flex-start; }
.login-point .pi {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  display: grid; place-items: center; color: #f0c987;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08);
}
.login-point b { display: block; font-size: 12.5px; font-weight: 600; color: #eef6f2; }
.login-point span { display: block; font-size: 11px; color: rgba(214, 231, 223, .52); margin-top: 2px; line-height: 1.6; }
.login-foot {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 16px;
  margin-top: 44px; padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: 10.5px; color: rgba(214, 231, 223, .4);
}
.login-foot .sep { width: 1px; height: 12px; background: rgba(255,255,255,.12); }
.login-panel { position: relative; display: flex; flex-direction: column; padding: 30px 40px 24px; background: #fbfaf7; }
.login-lang { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.login-lang .seg { background: #f0efe9; }
.login-lang-note { margin: 0; color: var(--ink-500); font-size: 10.5px; line-height: 1.4; }
.login-form-wrap { width: min(392px, 100%); margin: auto; padding: 28px 0 26px; }
.login-form-wrap h2 { font-size: 25px; font-weight: 750; letter-spacing: -.02em; }
.login-form-wrap .lead { font-size: 12.5px; color: var(--ink-400); margin-top: 6px; margin-bottom: 26px; }
.login-form .field > label { font-size: 11.5px; }
.login-form .input { height: 43px; background: #fff; }
.login-form .input-wrap .ic { width: 16px; height: 16px; }
.login-form .input-wrap .input { padding-left: 38px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; display: grid; place-items: center; border: 0; background: none; color: var(--ink-400); border-radius: 7px; }
.pw-toggle:hover { background: var(--surface-3); color: var(--ink-700); }
.login-row { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 18px; }
.login-row .link-btn { font-size: 11.5px; min-height: 44px; }
.login-submit { height: 44px; font-size: 13.5px; }
.demo-card { margin-top: 22px; padding: 13px 14px; background: var(--brand-50); border: 1px dashed #c4dfd3; border-radius: 11px; }
.demo-card .dh { display: flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; color: var(--brand-700); margin-bottom: 9px; }
.demo-roles { display: flex; gap: 5px; }
.demo-role {
  flex: 1; padding: 7px 4px; text-align: center;
  font-size: 10.5px; font-weight: 600; color: var(--ink-600);
  background: #fff; border: 1px solid #d8e9e0; border-radius: 7px;
}
.demo-role:hover { border-color: var(--brand-500); color: var(--brand-700); }
.demo-role.on { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.demo-hint { font-size: 10px; color: var(--brand-700); opacity: .7; margin-top: 7px; }
.login-legal { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; font-size: 10px; color: var(--ink-300); padding-top: 10px; }
.login-legal a:hover { color: var(--ink-500); }
.login-version { position: absolute; left: 40px; bottom: 24px; font-family: var(--font-num); font-size: 9px; letter-spacing: .06em; color: var(--ink-300); }
.login-badge-demo {
  position: absolute; top: 30px; left: 40px;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 9.5px; letter-spacing: .05em; color: var(--amber-700);
  padding: 3px 8px; background: var(--amber-50); border: 1px solid #efdfc4; border-radius: 999px;
}

/* ---------- Dashboard ---------- */
.dash-hero {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 22px 24px; margin-bottom: 18px;
  color: #eaf4ef;
  background:
    radial-gradient(90% 140% at 92% -20%, rgba(224, 165, 74, .18), transparent 55%),
    linear-gradient(120deg, #0f4f42, #0a392f 70%);
  border-radius: var(--r-lg);
  box-shadow: 0 16px 36px -22px rgba(9, 48, 39, .7);
}
.dash-hero::after {
  content: ""; position: absolute; right: -40px; top: -80px;
  width: 260px; height: 260px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.07);
  box-shadow: 0 0 0 44px rgba(255,255,255,.022), 0 0 0 96px rgba(255,255,255,.014);
}
.dash-hero h1 { font-size: 25px; font-weight: 750; letter-spacing: -.02em; color: #fff; }
.dash-hero .sub { font-size: 12px; color: rgba(224, 238, 232, .62); margin-top: 5px; }
.dash-hero .termbox {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; min-width: 290px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: var(--r-md);
}
.dash-hero .termbox .lbl { font-size: 9.5px; letter-spacing: .08em; color: rgba(224,238,232,.5); }
.dash-hero .termbox b { display: block; font-size: 13px; color: #fff; margin-top: 2px; }
.dash-hero .termbox .bar { margin-top: 8px; background: rgba(255,255,255,.12); width: 170px; }
.dash-hero .termbox .bar > i { background: linear-gradient(90deg, #eac27c, #d9a24a); }
.dash-hero .termbox .days { text-align: center; padding-left: 14px; border-left: 1px solid rgba(255,255,255,.12); }
.dash-hero .termbox .days b { font-family: var(--font-num); font-size: 23px; line-height: 1; color: #f0c987; }
.dash-hero .termbox .days span { font-size: 9px; color: rgba(224,238,232,.55); }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 18px; }
.kpi { position: relative; padding: 17px 18px; overflow: hidden; }
.kpi .k-label { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--ink-500); }
.kpi .k-label .ic { width: 14px; height: 14px; color: var(--ink-400); }
.kpi .k-value { display: flex; align-items: baseline; gap: 7px; margin-top: 7px; }
.kpi .k-value b { font-family: var(--font-num); font-size: 30px; font-weight: 720; letter-spacing: -.03em; line-height: 1.1; }
.kpi .k-value span { font-size: 11px; color: var(--ink-400); }
.kpi .k-foot { display: flex; align-items: center; gap: 6px; margin-top: 7px; font-size: 10.5px; color: var(--ink-400); }
.kpi .delta { display: inline-flex; align-items: center; gap: 2px; padding: 1px 5px; border-radius: 4px; font-family: var(--font-num); font-size: 9.5px; font-weight: 650; }
.kpi .delta.up { color: var(--brand-700); background: var(--brand-50); }
.kpi .delta.down { color: var(--danger-600); background: var(--danger-100); }
.kpi .k-spark { position: absolute; right: 12px; bottom: 12px; opacity: .5; }
.kpi .k-spark svg { width: 68px; height: 26px; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.58fr) minmax(318px, .82fr); gap: 16px; align-items: start; }
.dash-stack { display: grid; gap: 16px; }
.chart-bars { display: grid; gap: 15px; }
.hbar { display: grid; grid-template-columns: 92px minmax(0, 1fr) 52px; align-items: center; gap: 12px; }
.hbar .hl { font-size: 11.5px; color: var(--ink-600); }
.hbar .hl b { display: block; font-size: 11px; font-weight: 600; }
.hbar .hl span { display: block; font-size: 9.5px; color: var(--ink-300); margin-top: 1px; }
.hbar .hv { font-family: var(--font-num); font-size: 12px; font-weight: 650; color: var(--ink-700); text-align: right; }
.hbar .bar { height: 8px; }
.hbar .bar > i { position: relative; }
.legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 10.5px; color: var(--ink-500); }
.legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 5px; }
.donut-wrap { display: flex; align-items: center; gap: 18px; }
.donut {
  --a: 40%; --b: 70%; --c: 100%;
  width: 108px; height: 108px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--brand-600) 0 var(--a), var(--amber-500) var(--a) var(--b), #c9d5ce var(--b) var(--c));
  display: grid; place-items: center; position: relative;
}
.donut::before { content: ""; width: 78px; height: 78px; background: #fff; border-radius: 50%; grid-area: 1/1; }
.donut .dt { grid-area: 1/1; z-index: 1; text-align: center; }
.donut .dt b { display: block; font-family: var(--font-num); font-size: 21px; font-weight: 720; line-height: 1.1; }
.donut .dt span { font-size: 9px; color: var(--ink-400); }
.donut-legend { display: grid; gap: 9px; flex: 1; }
.donut-legend .dl { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--ink-500); }
.donut-legend b { margin-left: auto; font-family: var(--font-num); font-size: 11px; color: var(--ink-800); }
.todo { display: grid; gap: 2px; }
.todo-item { display: flex; align-items: flex-start; gap: 10px; padding: 9px 7px; border-radius: 8px; }
.todo-item:hover { background: var(--surface-2); }
.todo-item input { width: 15px; height: 15px; margin-top: 3px; accent-color: var(--brand-700); flex: none; }
.todo-item .tt { font-size: 12px; font-weight: 550; line-height: 1.55; }
.todo-item .tm { font-size: 10px; color: var(--ink-400); margin-top: 2px; }
.todo-item.done .tt { text-decoration: line-through; color: var(--ink-300); }
.todo-item.done .tm { color: var(--ink-300); }
.todo-item input:checked ~ div .tt { text-decoration: line-through; color: var(--ink-300); }
.schedule { display: grid; gap: 2px; }
.sch-item { display: flex; gap: 12px; padding: 8px 4px; }
.sch-date { width: 38px; flex: none; text-align: center; padding-top: 1px; }
.sch-date b { display: block; font-family: var(--font-num); font-size: 16px; font-weight: 700; line-height: 1.1; color: var(--ink-800); }
.sch-date span { font-size: 8.5px; letter-spacing: .05em; color: var(--ink-400); }
.sch-body { padding-left: 12px; border-left: 1px solid var(--line); }
.sch-body b { display: block; font-size: 11.5px; font-weight: 600; line-height: 1.5; }
.sch-body span { display: block; font-size: 10px; color: var(--ink-400); margin-top: 2px; }
.insight {
  display: flex; align-items: flex-start; gap: 13px;
  padding: 15px 17px; margin-top: 16px;
  background: linear-gradient(110deg, #f2f8f4, #fbf8f0);
  border: 1px solid #e2ece5; border-radius: var(--r-md);
}
.insight .ii { width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; background: #fff; color: var(--amber-600); box-shadow: var(--shadow-xs); }
.insight b { font-size: 12px; font-weight: 650; color: var(--brand-900); }
.insight p { font-size: 11.5px; color: var(--ink-500); line-height: 1.7; margin-top: 2px; }
.insight .link-btn { margin-left: auto; flex: none; }
.teacher-load { display: grid; gap: 11px; }
.tl-row { display: flex; align-items: center; gap: 9px; }
.tl-row .avatar { width: 26px; height: 26px; font-size: 9px; }
.tl-row .tn { font-size: 11px; color: var(--ink-600); width: 62px; flex: none; }
.tl-row .bar { flex: 1; height: 5px; }
.tl-row .tv { font-family: var(--font-num); font-size: 9.5px; color: var(--ink-400); width: 30px; text-align: right; }

/* ---------- Blueprint list ---------- */
.bp-name { display: flex; align-items: center; gap: 10px; min-width: 250px; }
.bp-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none; color: var(--brand-700); background: var(--brand-50); border: 1px solid #dcece4; }
.bp-ico .ic { width: 18px; height: 18px; }
.bp-name .t { font-size: 12.5px; font-weight: 650; color: var(--ink-900); line-height: 1.45; }
.bp-name .t:hover { color: var(--brand-700); }
.bp-name .s { display: flex; align-items: center; gap: 7px; margin-top: 2px; font-size: 10px; color: var(--ink-400); }
.bp-name .s .dot { width: 3px; height: 3px; background: var(--ink-300); }
.bp-uses { display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--ink-400); }
.bp-uses b { font-family: var(--font-num); color: var(--ink-700); }
.bulkbar {
  position: fixed; left: 50%; bottom: 22px; z-index: 80;
  transform: translate(-50%, 20px);
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px 8px 16px;
  color: #eaf4ef; background: #103d33;
  border: 1px solid rgba(255,255,255,.08); border-radius: 12px;
  box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transition: all .2s;
}
.bulkbar.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.bulkbar b { font-family: var(--font-num); font-size: 12px; color: #f0c987; }
.bulkbar .btn { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.12); color: #eaf4ef; }
.bulkbar .btn:hover { background: rgba(255,255,255,.14); }
.bulkbar .btn.danger { color: #f2b4aa; }

/* Type cards (create item) */
.blueprint-preview-flag {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; margin-bottom: 14px;
  font-size: 11px; color: var(--brand-800);
  background: var(--brand-50); border: 1px dashed #bfdccf; border-radius: 9px;
}

/* ---------- Blueprint editor ---------- */
.bp-title-row { display: flex; align-items: center; gap: 8px; max-width: 100%; min-width: 0; }
.page-head > .grow { min-width: 0; }
.bp-title-input {
  font-size: 24px; font-weight: 750; letter-spacing: -.02em;
  color: var(--ink-900); background: transparent;
  border: 1px solid transparent; border-radius: 8px;
  padding: 2px 6px; margin-left: -6px; width: auto;
  field-sizing: content; min-width: 0; max-width: calc(100% - 44px);
}
.bp-title-input:hover { border-color: var(--line); background: #fff; }
.bp-title-input:focus { outline: none; border-color: var(--brand-500); background: #fff; box-shadow: 0 0 0 3px var(--brand-100); }
.bp-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 9px; font-size: 11px; color: var(--ink-400); }
.bp-meta .sep { width: 1px; height: 11px; background: var(--line-strong); }
.bp-meta b { color: var(--ink-600); font-weight: 600; }
.save-state { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--ink-400); }
.save-state .ic { width: 13px; height: 13px; color: var(--brand-600); }
.bp-layout { display: grid; grid-template-columns: minmax(0, 1fr) 382px; gap: 16px; align-items: start; }
.bp-layout.preview { grid-template-columns: minmax(0, 1fr); }
.bp-layout.preview .inspector { display: none; }
.editor { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-xs); overflow: hidden; }
.editor-toolbar {
  display: flex; align-items: center; gap: 8px; padding: 11px 14px;
  border-bottom: 1px solid var(--line); background: var(--surface-2);
}
.editor-toolbar .et-title { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--ink-500); white-space: nowrap; }
.editor-toolbar .drag-tip { font-size: 10px; color: var(--ink-400); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.editor-toolbar .right { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: none; }
.tree { padding: 14px; background: #fcfdfb; min-height: 400px; }
.tree-running { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--ink-400); padding: 0 2px 10px; }
.tree-running .ic { width: 13px; height: 13px; color: var(--brand-500); }
.cat {
  position: relative; margin-bottom: 10px; overflow: hidden;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-xs);
  transition: border-color .12s, box-shadow .12s;
}
.cat:last-child { margin-bottom: 0; }
.cat.dragging { opacity: .4; }
.cat.drop-into { border-color: var(--amber-500); box-shadow: 0 0 0 3px var(--amber-100); }
.cat-head {
  display: flex; align-items: center; gap: 7px;
  min-height: 44px; padding: 7px 9px 7px 6px;
  background: linear-gradient(180deg, #fbfcfa, #f7faf7);
  border-bottom: 1px solid transparent;
  cursor: pointer; user-select: none;
}
.cat.open > .cat-head { border-bottom-color: var(--line); }
.cat-head:hover { background: #f6faf7; }
.cat.selected > .cat-head { background: var(--brand-50); box-shadow: inset 3px 0 0 var(--brand-600); }
.grip {
  display: grid; place-items: center; width: 18px; height: 26px;
  color: var(--ink-300); cursor: grab; border-radius: 4px; flex: none;
}
.grip:hover { color: var(--ink-500); background: var(--surface-3); }
.grip:active { cursor: grabbing; }
.cat-caret { width: 22px; height: 22px; display: grid; place-items: center; border: 0; background: none; color: var(--ink-400); border-radius: 5px; flex: none; }
.cat-caret .ic { width: 14px; height: 14px; transition: transform .15s; }
.cat.open > .cat-head .cat-caret .ic { transform: rotate(90deg); }
.cat-folder { width: 24px; height: 24px; display: grid; place-items: center; color: var(--brand-600); flex: none; }
.cat-folder .ic { width: 17px; height: 17px; }
.cat-title { font-size: 12.5px; font-weight: 650; color: var(--ink-800); line-height: 1.4; min-width: 0; }
.cat-title .drag-hint { display: inline-block; margin-left: 6px; font-size: 9px; font-weight: 500; color: var(--ink-300); opacity: 0; transition: opacity .1s; }
.cat-head:hover .drag-hint { opacity: 1; }
.cat-counts { display: flex; align-items: center; gap: 5px; margin-left: 2px; flex: none; }
.cat-count { font-family: var(--font-num); font-size: 9px; color: var(--ink-400); background: var(--surface-3); border-radius: 4px; padding: 1px 5px; }
.cat-head .actions { margin-left: auto; display: flex; align-items: center; gap: 1px; flex: none; }
.cat-head .actions .icon-btn { width: 27px; height: 27px; border-radius: 6px; }
.cat-head .actions .ic { width: 14px; height: 14px; }
.cat-body { display: none; padding: 5px 8px 9px 30px; background: #fff; }
.cat.open > .cat-body { display: block; }
.cat-body > .cat { margin: 6px 0; background: #fcfdfb; box-shadow: none; }
.cat-body > .cat > .cat-head { background: #f8faf7; min-height: 38px; padding-top: 4px; padding-bottom: 4px; }
.cat-body > .cat > .cat-head .cat-title { font-size: 11.5px; font-weight: 600; }
.cat-body > .cat > .cat-body { padding-left: 18px; }
.cat-body > .cat.open > .cat-head { border-bottom-color: #edf1ec; }
.cat-foot { display: flex; align-items: center; gap: 8px; padding: 6px 4px 1px 2px; }
.cat-foot button {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; color: var(--ink-400); background: none; border: 0; padding: 3px 4px; border-radius: 5px;
}
.cat-foot button:hover { color: var(--brand-700); background: var(--brand-50); }
.cat-foot .ic { width: 12px; height: 12px; }
.item {
  position: relative; display: flex; align-items: center; gap: 8px;
  min-height: 46px; padding: 6px 7px 6px 4px; margin: 2px 0;
  background: #fff; border: 1px solid transparent; border-radius: 8px;
  cursor: pointer; transition: background .1s, border-color .1s, box-shadow .1s;
}
.item:hover { background: #f8fbf8; border-color: var(--line); }
.item.selected { background: var(--brand-50); border-color: #c6e2d5; box-shadow: inset 3px 0 0 var(--brand-600); }
.item.dragging { opacity: .35; }
.item.drop-before { box-shadow: inset 0 2px 0 var(--amber-500); }
.item.drop-after { box-shadow: inset 0 -2px 0 var(--amber-500); }
.item .grip { height: 28px; width: 16px; }
.item-type-ico { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; flex: none; }
.item-type-ico .ic { width: 14px; height: 14px; }
.type-rating { background: var(--brand-50); color: var(--brand-700); }
.item-main { flex: 1; min-width: 0; padding: 1px 0; }
.item-title { font-size: 12px; font-weight: 550; color: var(--ink-800); line-height: 1.45; }
.item-title .req { color: var(--danger-500); margin-left: 1px; }
.item-meta { display: flex; align-items: center; gap: 6px; margin-top: 1px; font-size: 9.5px; color: var(--ink-400); flex-wrap: wrap; }
.item-meta .m { display: inline-flex; align-items: center; gap: 3px; }
.item-meta .m .ic { width: 10px; height: 10px; }
.item-meta .sep { width: 1px; height: 8px; background: var(--line-strong); }
.item-flag { display: inline-flex; align-items: center; gap: 3px; font-size: 9px; color: var(--amber-700); }
.item .i-actions { display: flex; align-items: center; gap: 0; opacity: 0; transition: opacity .1s; flex: none; }
.item:hover .i-actions, .item.selected .i-actions { opacity: 1; }
.item .i-actions .icon-btn { width: 25px; height: 25px; border-radius: 6px; }
.item .i-actions .ic { width: 13px; height: 13px; }
.item-badge-required { color: var(--danger-500); font-size: 12px; line-height: 1; }
.cat-empty {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px; margin: 4px 0; font-size: 10.5px; color: var(--ink-300);
  border: 1px dashed var(--line-strong); border-radius: 8px;
}
.root-drop {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 44px; margin-top: 10px; padding: 10px;
  font-size: 11px; color: var(--ink-300);
  border: 1px dashed var(--line-strong); border-radius: 10px;
}
.root-drop.over { color: var(--amber-700); border-color: var(--amber-500); background: var(--amber-50); }
.inspector {
  position: sticky; top: 80px;
  max-height: calc(100vh - 100px);
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden;
}
.ins-head { display: flex; align-items: flex-start; gap: 10px; padding: 15px 15px 12px; border-bottom: 1px solid var(--line); flex: none; }
.ins-head .ins-ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.ins-head .ins-kicker { font-size: 9px; font-weight: 700; letter-spacing: .08em; color: var(--ink-400); }
.ins-head h3 { font-size: 13px; font-weight: 650; line-height: 1.4; margin-top: 1px; }
.ins-head .icon-btn { margin-left: auto; width: 28px; height: 28px; flex: none; }
.ins-body { padding: 14px 15px 20px; overflow-y: auto; }
.ins-sec { padding: 14px 0; border-top: 1px solid var(--line); }
.ins-sec:first-child { padding-top: 0; border-top: 0; }
.ins-sec-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; font-size: 9.5px; font-weight: 700; letter-spacing: .09em; color: var(--ink-400); }
.ins-sec-title .mini { font-size: 9px; font-weight: 500; letter-spacing: 0; color: var(--ink-300); }
.ins-body .field > label { font-size: 11px; font-weight: 600; }
.ins-body .input, .ins-body .select, .ins-body .textarea { font-size: 12px; padding: 7px 9px; }
.ins-body .textarea { min-height: 66px; }
.ins-body .hint { font-size: 9.5px; }
.scale-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) 48px 24px; align-items: center; gap: 5px; margin-bottom: 5px; }
.scale-row .lvl { font-family: var(--font-num); font-size: 9px; color: var(--ink-400); text-align: center; }
.scale-row .input { padding: 5px 7px; font-size: 11px; }
.scale-row .pts { text-align: center; }
.scale-row .del { width: 22px; height: 22px; display: grid; place-items: center; color: var(--ink-300); border: 0; background: none; border-radius: 5px; }
.scale-row .del:hover { color: var(--danger-600); background: var(--danger-100); }
.opt-row { display: grid; grid-template-columns: 16px minmax(0, 1fr) 24px; align-items: center; gap: 5px; margin-bottom: 5px; }
.opt-row .oc { width: 12px; height: 12px; border: 1.5px solid var(--line-strong); border-radius: 3px; }
.opt-row .oc.round { border-radius: 50%; }
.opt-row .input { padding: 5px 7px; font-size: 11px; }
.opt-row .del { width: 22px; height: 22px; display: grid; place-items: center; color: var(--ink-300); border: 0; background: none; border-radius: 5px; }
.opt-row .del:hover { color: var(--danger-600); background: var(--danger-100); }
.ins-add { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 600; color: var(--brand-700); background: none; border: 0; padding: 3px 0; }
.ins-add:hover { text-decoration: underline; text-underline-offset: 3px; }
.ins-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; }
.ins-toggle-row .tl { font-size: 11px; font-weight: 550; color: var(--ink-600); }
.ins-toggle-row .ts { font-size: 9.5px; color: var(--ink-400); margin-top: 1px; }
.ins-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ins-stat { padding: 9px 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; }
.ins-stat b { display: block; font-family: var(--font-num); font-size: 17px; font-weight: 700; line-height: 1.2; }
.ins-stat span { display: block; font-size: 9px; color: var(--ink-400); }
.ins-empty { padding: 10px 2px 4px; }
.ins-empty .ie-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-400); margin-bottom: 12px; }
.ins-empty h3 { font-size: 13px; font-weight: 650; }
.ins-empty p { font-size: 11px; color: var(--ink-400); line-height: 1.65; margin-top: 4px; }
.danger-link { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 600; color: var(--danger-600); background: none; border: 0; padding: 4px 0; }
.danger-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.inspector-empty { padding: 22px 18px; }
.preview-shell { padding: 26px; background: #fcfdfb; }
.preview-head { max-width: 860px; margin: 0 auto 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.preview-form { max-width: 860px; margin: 0 auto; display: grid; gap: 12px; }
.preview-cat { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.preview-cat-head { display: flex; align-items: center; gap: 8px; padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 650; }
.preview-cat-body { padding: 6px 14px 12px; }
.preview-item { padding: 12px 0; border-bottom: 1px dashed var(--line); }
.preview-item:last-child { border-bottom: 0; }
.preview-q { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.preview-q .qn { font-family: var(--font-num); font-size: 9.5px; color: var(--ink-300); padding-top: 2px; min-width: 14px; }
.preview-q .qt { font-size: 12px; font-weight: 550; }
.preview-q .req { color: var(--danger-500); }
.preview-remark { margin-top: 7px; font-size: 10.5px; color: var(--ink-400); display: flex; align-items: center; gap: 4px; }
.preview-note { max-width: 860px; margin: 16px auto 0; font-size: 10.5px; color: var(--ink-400); text-align: center; }
.preview-score { font-size: 10px; color: var(--ink-400); }

/* ---------- Students ---------- */
.stu-cell { display: flex; align-items: center; gap: 10px; min-width: 160px; }
.stu-cell .n { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-900); line-height: 1.4; }
.stu-cell .n:hover { color: var(--brand-700); }
.stu-cell .e { display: block; font-family: var(--font-num); font-size: 9px; letter-spacing: .02em; color: var(--ink-400); }
.stu-cell .avatar { width: 34px; height: 34px; font-size: 11.5px; }
.mini-progress { display: flex; align-items: center; gap: 7px; min-width: 100px; }
.mini-progress .bar { width: 58px; }
.mini-progress span { font-family: var(--font-num); font-size: 9.5px; color: var(--ink-400); }
.student-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 16px; }
.student-card { padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; transition: box-shadow .15s, border-color .15s, transform .15s; }
.student-card:hover { border-color: #c8d9cf; box-shadow: var(--shadow); transform: translateY(-1px); }
.student-card .top { display: flex; align-items: flex-start; gap: 10px; }
.student-card .avatar { width: 42px; height: 42px; font-size: 14px; }
.student-card .n { font-size: 13px; font-weight: 650; line-height: 1.35; }
.student-card .m { font-size: 10px; color: var(--ink-400); margin-top: 2px; }
.student-card .tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; min-height: 21px; }
.student-card .prog { margin-top: 12px; }
.student-card .prog .pl { display: flex; justify-content: space-between; font-size: 9.5px; color: var(--ink-400); margin-bottom: 4px; }
.student-card .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 9.5px; color: var(--ink-400); }
.student-card .foot .link-btn { font-size: 10px; }

/* ---------- Student detail ---------- */
.student-hero {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 20px;
  padding: 22px 24px; margin-bottom: 16px;
  background:
    radial-gradient(60% 140% at 100% 0%, rgba(224, 165, 74, .1), transparent 60%),
    linear-gradient(110deg, #f4faf6, #fffdf8);
  border: 1px solid #dfeae2; border-radius: var(--r-lg);
}
.student-hero::after {
  content: ""; position: absolute; right: 24%; top: -80px; width: 220px; height: 220px;
  border: 1px solid rgba(20, 107, 90, .05); border-radius: 50%;
  box-shadow: 0 0 0 40px rgba(20,107,90,.018), 0 0 0 88px rgba(20,107,90,.012);
  pointer-events: none;
}
.student-hero .avatar { box-shadow: 0 6px 20px -8px rgba(20,60,48,.3); }
.student-hero .sh-main { position: relative; z-index: 1; min-width: 0; }
.student-hero h1 { font-size: 25px; font-weight: 750; letter-spacing: -.02em; line-height: 1.25; }
.student-hero .en { font-family: var(--font-num); font-size: 10.5px; letter-spacing: .08em; color: var(--ink-400); margin-top: 2px; }
.student-hero .meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 9px; font-size: 11px; color: var(--ink-500); }
.student-hero .meta .sep { width: 1px; height: 10px; background: var(--line-strong); }
.student-hero .sh-actions { position: relative; z-index: 1; margin-left: auto; display: flex; gap: 7px; align-items: center; }
.student-tabs { margin-bottom: 16px; }
.stu-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .8fr); gap: 16px; align-items: start; }
.stu-stack { display: grid; gap: 16px; }
.radar-wrap { display: flex; align-items: center; justify-content: center; gap: 12px; }
.radar { width: 100%; max-width: 390px; }
.radar text { font-family: var(--font); }
.radar-legend { display: flex; gap: 14px; justify-content: center; margin-top: 4px; font-size: 10.5px; color: var(--ink-500); }
.radar-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 5px; }
.domain-list { display: grid; gap: 3px; }
.domain-row { display: flex; align-items: center; gap: 9px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.domain-row:last-child { border-bottom: 0; }
.domain-row .dn { width: 82px; flex: none; font-size: 10.5px; color: var(--ink-600); }
.domain-row .bar { flex: 1; height: 5px; }
.domain-row .dv { width: 34px; text-align: right; font-family: var(--font-num); font-size: 10px; font-weight: 600; color: var(--ink-500); }
.domain-row .tier { width: 56px; text-align: right; font-size: 9px; color: var(--ink-400); }
.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 5px; bottom: 5px; width: 1px; background: var(--line); }
.tl-entry { position: relative; padding: 0 0 16px 14px; }
.tl-entry:last-child { padding-bottom: 0; }
.tl-entry::before { content: ""; position: absolute; left: -17px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: #fff; border: 2px solid var(--brand-500); }
.tl-entry .tld { font-size: 9.5px; color: var(--ink-400); font-family: var(--font-num); }
.tl-entry b { display: block; font-size: 11.5px; font-weight: 600; margin-top: 2px; }
.tl-entry p { font-size: 11px; color: var(--ink-500); line-height: 1.7; margin-top: 2px; }
.tl-entry .ph { width: 100%; max-width: 250px; margin-top: 8px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.photo-grid .ph { position: relative; border-radius: 9px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 4/3; background: var(--surface-3); }
.photo-grid .ph img { width: 100%; height: 100%; object-fit: cover; }
.photo-grid .ph .cap { position: absolute; inset: auto 0 0 0; padding: 12px 8px 6px; font-size: 8.5px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.5)); }
.guardian { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.guardian:last-child { border-bottom: 0; }
.guardian .gn { font-size: 11.5px; font-weight: 600; }
.guardian .gr { font-size: 9.5px; color: var(--ink-400); }
.guardian .acts { margin-left: auto; display: flex; gap: 3px; }
.note-panel { padding: 12px 13px; background: var(--amber-50); border: 1px solid #f0e2cd; border-radius: 9px; }
.note-panel .nh { display: flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 700; color: var(--amber-700); margin-bottom: 5px; }
.note-panel p { font-size: 10.5px; color: #7c612f; line-height: 1.65; }
.info-list { display: grid; gap: 0; }
.info-row { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.info-row:last-child { border-bottom: 0; }
.info-row .k { width: 88px; flex: none; color: var(--ink-400); }
.info-row .v { color: var(--ink-700); }
.assessment-mini { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.assessment-mini:last-child { border-bottom: 0; }
.assessment-mini .am-ico { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); color: var(--brand-700); flex: none; }
.assessment-mini .am-t { font-size: 11.5px; font-weight: 550; }
.assessment-mini .am-s { font-size: 9.5px; color: var(--ink-400); margin-top: 1px; }
.assessment-mini .am-r { margin-left: auto; text-align: right; }

/* ---------- Assessments ---------- */
.assess-name { min-width: 250px; }
.assess-name .t { font-size: 12.5px; font-weight: 650; line-height: 1.45; }
.assess-name .t:hover { color: var(--brand-700); }
.assess-name .s { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 10px; color: var(--ink-400); }
.assess-name .s .dot { width: 3px; height: 3px; background: var(--ink-300); }
.assess-progress { min-width: 130px; }
.assess-progress .pl { display: flex; justify-content: space-between; margin-bottom: 4px; font-size: 9.5px; color: var(--ink-400); }
.assess-progress .pl b { font-family: var(--font-num); color: var(--ink-600); }
.steps { display: flex; align-items: center; gap: 0; margin-bottom: 20px; }
.step { display: flex; align-items: center; gap: 8px; flex: 1; }
.step .sn { width: 25px; height: 25px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-num); font-size: 10px; font-weight: 700; background: var(--surface-3); color: var(--ink-400); flex: none; }
.step b { font-size: 11px; font-weight: 600; color: var(--ink-400); }
.step.on .sn { background: var(--brand-700); color: #fff; }
.step.on b { color: var(--brand-800); }
.step.done .sn { background: var(--brand-100); color: var(--brand-700); }
.step.done b { color: var(--ink-600); }
.step .line { flex: 1; height: 1px; background: var(--line); margin: 0 10px; }
.blueprint-pick { display: grid; gap: 8px; }
.bp-pick {
  display: flex; align-items: center; gap: 11px; padding: 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
  transition: border-color .13s, background .13s;
}
.bp-pick:hover { border-color: var(--brand-400, #8fc7b5); background: var(--brand-50); }
.bp-pick.on { border-color: var(--brand-600); background: var(--brand-50); box-shadow: 0 0 0 2px var(--brand-100); }
.bp-pick .pick-radio { width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid var(--line-strong); flex: none; display: grid; place-items: center; }
.bp-pick.on .pick-radio { border-color: var(--brand-600); }
.bp-pick.on .pick-radio::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--brand-600); }
.bp-pick .pick-t { display: block; font-size: 12px; font-weight: 600; }
.bp-pick .pick-s { display: block; font-size: 9.5px; color: var(--ink-400); margin-top: 2px; }
.class-picks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.class-pick { display: flex; align-items: center; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.class-pick:hover { border-color: var(--brand-400, #8fc7b5); background: var(--brand-50); }
.class-pick input { width: 15px; height: 15px; accent-color: var(--brand-700); }
.class-pick b { font-size: 11.5px; }
.class-pick span { display: block; font-size: 9px; color: var(--ink-400); }
.assess-summary {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  padding: 14px 16px; background: var(--brand-50); border: 1px solid #d9eae1; border-radius: 10px;
}
.assess-summary b { display: block; font-family: var(--font-num); font-size: 20px; line-height: 1.2; color: var(--brand-900); }
.assess-summary span { font-size: 9.5px; color: var(--brand-700); opacity: .7; }
.progress-strip {
  display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: #edf1ec;
}
.progress-strip i { display: block; height: 100%; }
.ps-done { background: var(--brand-600); }
.ps-live { background: var(--amber-500); }
.ps-none { background: #dde5dd; }
.workload { display: grid; gap: 10px; }
.wl-row { display: flex; align-items: center; gap: 8px; }
.wl-row .avatar { width: 24px; height: 24px; font-size: 8.5px; }
.wl-row .wl-n { font-size: 10.5px; color: var(--ink-600); width: 56px; flex: none; }
.wl-row .bar { flex: 1; height: 4px; }
.wl-row .wl-v { font-family: var(--font-num); font-size: 9px; color: var(--ink-400); width: 44px; text-align: right; }
.report-gen { display: grid; gap: 14px; }
.gen-progress { padding: 18px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.gen-steps { display: grid; gap: 9px; margin-top: 12px; }
.gen-step { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--ink-400); }
.gen-step .gs { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--line-strong); flex: none; display: grid; place-items: center; }
.gen-step.done { color: var(--ink-600); }
.gen-step.done .gs { background: var(--brand-100); border-color: var(--brand-100); color: var(--brand-700); }
.gen-step.done .gs::after { content: ""; width: 5px; height: 3px; border-left: 1.5px solid var(--brand-700); border-bottom: 1.5px solid var(--brand-700); transform: rotate(-45deg); margin-top: -1px; }
.gen-step.active { color: var(--brand-800); font-weight: 600; }
.gen-step.active .gs { border-color: var(--brand-600); border-top-color: transparent; animation: spin .8s linear infinite; }
.report-list { display: grid; gap: 0; }
.report-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.report-row:last-child { border-bottom: 0; }
.report-row .ri { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--danger-100); color: var(--danger-600); flex: none; }
.report-row .rt { font-size: 11.5px; font-weight: 550; }
.report-row .rs { font-size: 9.5px; color: var(--ink-400); }

/* ---------- Assess execution ---------- */
.assess-layout { display: grid; grid-template-columns: 222px minmax(0, 1fr) 286px; gap: 14px; align-items: start; }
.assess-side { position: sticky; top: 78px; }
.rail { background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; max-height: calc(100vh - 96px); display: flex; flex-direction: column; }
.rail-head { padding: 11px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.rail-head .rh { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.rail-head b { font-size: 11px; font-weight: 650; }
.rail-head span { font-family: var(--font-num); font-size: 9.5px; color: var(--ink-400); }
.rail-list { overflow-y: auto; padding: 5px; flex: 1; }
.stu-item { display: flex; align-items: center; gap: 8px; padding: 7px 7px; border-radius: 8px; cursor: pointer; border: 1px solid transparent; }
.stu-item:hover { background: var(--surface-2); }
.stu-item.on { background: var(--brand-50); border-color: #cfe6da; }
.stu-item .avatar { width: 28px; height: 28px; font-size: 9.5px; }
.stu-item .sn { display: block; font-size: 11px; font-weight: 550; color: var(--ink-700); line-height: 1.35; }
.stu-item .ss { display: block; font-size: 8.5px; color: var(--ink-400); margin-top: 1px; }
.stu-item .st { margin-left: auto; text-align: right; flex: none; }
.stu-item .mini-ring { --size: 28px; flex: none; margin-left: auto; }
.stu-item .mini-ring span { font-size: 7.5px; }
.stu-item.done .sn::after { content: none; }
.assess-center { min-width: 0; }
.assess-head {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; margin-bottom: 10px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-md);
}
.assess-head .ah-main { flex: 1; min-width: 0; }
.assess-head .ah-title { font-size: 12px; font-weight: 650; line-height: 1.4; }
.assess-head .ah-sub { display: flex; align-items: center; gap: 6px; font-size: 9.5px; color: var(--ink-400); margin-top: 1px; }
.assess-head .save-state { flex: none; }
.assess-progress-top { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.assess-progress-top .bar { flex: 1; height: 5px; }
.assess-progress-top .lbl { font-family: var(--font-num); font-size: 10px; color: var(--ink-400); white-space: nowrap; }
.q-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: 10px; overflow: hidden; }
.q-head { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px 8px; }
.q-num { font-family: var(--font-num); font-size: 9px; font-weight: 650; color: var(--ink-400); background: var(--surface-3); border-radius: 4px; min-width: 20px; height: 18px; display: grid; place-items: center; flex: none; margin-top: 1px; }
.q-title { font-size: 12px; font-weight: 550; line-height: 1.55; color: var(--ink-800); flex: 1; }
.q-title .req { color: var(--danger-500); }
.q-head .q-tools { display: flex; gap: 1px; flex: none; }
.q-head .q-tools .icon-btn { width: 26px; height: 26px; }
.q-head .q-tools .ic { width: 14px; height: 14px; }
.q-body { padding: 0 12px 10px 40px; }
.q-done { color: var(--brand-600); }
.rating { display: flex; flex-wrap: wrap; gap: 5px; }
.rating button {
  display: inline-flex; align-items: center; gap: 5px;
  height: 31px; padding: 0 11px;
  font-size: 11px; font-weight: 550; color: var(--ink-500);
  background: #fff; border: 1px solid var(--line-strong); border-radius: 8px;
}
.rating button:hover { border-color: var(--ink-400); background: var(--surface-2); }
.rating button .k { font-family: var(--font-num); font-size: 8px; color: var(--ink-300); border: 1px solid var(--line); border-radius: 3px; padding: 0 3px; }
.rating button.on { color: #fff; border-color: transparent; box-shadow: 0 3px 8px -3px rgba(0,0,0,.2); }
.rating button.on .k { color: rgba(255,255,255,.65); border-color: rgba(255,255,255,.25); }
.rating button.on[data-tone="low"] { background: #b9584a; }
.rating button.on[data-tone="mid"] { background: #c08a3c; }
.rating button.on[data-tone="high"] { background: var(--brand-700); }
.rating button.on[data-tone="top"] { background: #2d5f7d; }
.remark-bubble { margin-top: 7px; padding: 8px 10px; font-size: 10.5px; color: var(--ink-500); background: var(--surface-2); border-left: 2px solid var(--line-strong); border-radius: 0 6px 6px 0; }
.remark-box { margin-top: 8px; }
/* 同一項目最近一次的評分（09 #55）：評分後才顯示，只作參考，不標示升跌 */
.prev-ref { display: flex; gap: 6px; align-items: flex-start; margin-top: 7px; padding: 6px 9px; font-size: 10.5px; line-height: 1.6; color: var(--ink-500); background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; }
.prev-ref .ic-sm { flex: none; margin-top: 2px; }
.prev-ref .pr-head { display: block; font-weight: 650; color: var(--ink-600); }
.prev-ref .pr-item { display: block; }
.prev-ref .pr-item b { font-weight: 650; color: var(--ink-700); }
.prev-ref .pr-note { display: block; color: var(--ink-400); }
.remark-box textarea { width: 100%; min-height: 54px; padding: 7px 9px; font-size: 10.5px; line-height: 1.6; background: #fff; border: 1px solid var(--line-strong); border-radius: 7px; resize: vertical; }
.remark-box textarea:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px var(--brand-100); }
.photo-strip { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.photo-thumb { position: relative; width: 54px; height: 42px; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-3); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-thumb button { position: absolute; top: 2px; right: 2px; width: 15px; height: 15px; border-radius: 50%; border: 0; background: rgba(0,0,0,.5); color: #fff; font-size: 9px; display: grid; place-items: center; }
.photo-add {
  width: 54px; height: 42px; border-radius: 6px; border: 1px dashed var(--line-strong);
  background: var(--surface-2); color: var(--ink-400); display: grid; place-items: center;
}
.photo-add:hover { border-color: var(--brand-500); color: var(--brand-700); background: var(--brand-50); }
.photo-add .ic { width: 15px; height: 15px; }
.q-links { display: flex; align-items: center; gap: 12px; margin-top: 7px; }
.q-link { display: inline-flex; align-items: center; gap: 3px; font-size: 9.5px; color: var(--ink-400); background: none; border: 0; padding: 0; }
.q-link:hover { color: var(--brand-700); }
.q-link .ic { width: 12px; height: 12px; }
.q-link.added { color: var(--brand-600); }
.assess-cat { display: flex; align-items: center; gap: 8px; padding: 8px 3px 6px; margin-top: 4px; }
.assess-cat .ic { width: 13px; height: 13px; color: var(--brand-600); }
.assess-cat b { font-size: 10px; font-weight: 700; letter-spacing: .04em; color: var(--ink-500); }
.assess-cat .line { flex: 1; height: 1px; background: var(--line); }
.assess-cat span { font-family: var(--font-num); font-size: 9px; color: var(--ink-300); }
.assess-actions {
  position: sticky; bottom: 12px; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px; margin-top: 12px;
  background: rgba(255,255,255,.9); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
}
.assess-actions .aa-info { font-size: 9.5px; color: var(--ink-400); margin-right: auto; padding-left: 4px; }
.assess-actions .aa-info b { color: var(--ink-600); font-family: var(--font-num); }
.context-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; margin-bottom: 12px; }
.context-head { padding: 13px; background: linear-gradient(135deg, var(--brand-50), #fbfaf5); border-bottom: 1px solid var(--line); }
.context-head .ch-top { display: flex; align-items: center; gap: 9px; }
.context-head .avatar { width: 40px; height: 40px; font-size: 13px; }
.context-head .cn { font-size: 13px; font-weight: 650; }
.context-head .cm { font-size: 9.5px; color: var(--ink-400); margin-top: 1px; }
.context-head .ctags { display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap; }
.context-body { padding: 12px 13px; }
.ctx-stat { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; font-size: 10.5px; color: var(--ink-500); border-bottom: 1px solid var(--line); }
.ctx-stat:last-child { border-bottom: 0; }
.ctx-stat b { font-family: var(--font-num); font-size: 11px; color: var(--ink-800); }
.ctx-quote { position: relative; margin-top: 2px; padding: 11px 12px; background: var(--amber-50); border: 1px solid #f1e4d0; border-radius: 8px; }
.ctx-quote .qh { display: flex; align-items: center; gap: 5px; font-size: 9px; font-weight: 700; color: var(--amber-700); margin-bottom: 4px; }
.ctx-quote p { font-size: 10px; line-height: 1.7; color: #745c31; }
.ctx-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.ctx-photos img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.ctx-photo-empty { display: grid; place-items: center; aspect-ratio: 4/3; border: 1px dashed var(--line-strong); border-radius: 6px; background: var(--surface-2); color: var(--ink-300); font-size: 9px; }
.camera-modal .modal-card { width: min(520px, 100%); background: #0b211c; border: 1px solid rgba(255,255,255,.08); }
.camera-modal .modal-head { color: #e9f3ef; padding-bottom: 10px; }
.camera-modal .modal-head h2 { color: #fff; }
.camera-modal .modal-head p { color: rgba(233,243,239,.5); }
.camera-modal .modal-close { color: #cfe0d9; }
.camera-view { position: relative; margin: 0 20px; border-radius: 12px; overflow: hidden; background: #123f35; aspect-ratio: 4/3; }
.camera-view img { width: 100%; height: 100%; object-fit: cover; }
.camera-view .grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px); background-size: 33.33% 33.33%; }
.camera-view .focus { position: absolute; left: 50%; top: 50%; width: 74px; height: 74px; transform: translate(-50%,-50%); border: 1.5px solid rgba(255,255,255,.75); border-radius: 8px; }
.camera-view .lv { position: absolute; top: 10px; left: 10px; display: flex; align-items: center; gap: 5px; font-family: var(--font-num); font-size: 9px; color: #fff; background: rgba(0,0,0,.35); padding: 3px 7px; border-radius: 4px; }
.camera-view .rec { width: 6px; height: 6px; border-radius: 50%; background: #ef6a58; }
.camera-controls { display: flex; align-items: center; justify-content: center; gap: 24px; padding: 16px 20px 20px; }
.cam-side { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.08); color: #dcebe5; border: 1px solid rgba(255,255,255,.1); }
.shutter { width: 62px; height: 62px; border-radius: 50%; border: 4px solid rgba(255,255,255,.85); background: transparent; padding: 4px; }
.shutter i { display: block; width: 100%; height: 100%; border-radius: 50%; background: #f4f1e8; transition: transform .1s; }
.shutter:active i { transform: scale(.9); }
.camera-hint { text-align: center; font-size: 9.5px; color: rgba(233,243,239,.4); padding-bottom: 14px; }
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.flash.on { animation: flash .28s; }

/* ---------- Report card ---------- */
.report-body { background: #e9ece6; }
.report-toolbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 22px;
  background: rgba(255,255,255,.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.report-toolbar .rt-brand { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; }
.report-toolbar .rt-brand img { width: 28px; height: 28px; border-radius: 8px; }
.report-toolbar .rt-sep { width: 1px; height: 20px; background: var(--line); }
.report-toolbar .rt-title { font-size: 12px; color: var(--ink-500); }
.report-toolbar .rt-actions { margin-left: auto; display: flex; gap: 7px; align-items: center; }
.report-scroll { padding: 22px 20px 50px; }
.paper {
  width: 210mm; min-height: 297mm; margin: 0 auto; padding: 14mm 15mm 12mm;
  background: #fff; color: #222e29;
  box-shadow: 0 24px 60px -24px rgba(15, 40, 32, .35);
  font-size: 10pt; line-height: 1.55;
  position: relative;
}
.paper.is-draft::after {
  content: '草稿 DRAFT';
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: var(--font-num);
  font-size: 54pt; font-weight: 800; letter-spacing: .06em;
  color: rgba(181, 74, 60, .13);
  transform: rotate(-24deg);
  pointer-events: none;
}
.paper-head { display: flex; align-items: flex-start; gap: 12px; padding-bottom: 10px; border-bottom: 2.5px solid var(--brand-800); }
.paper-logo { width: 38px; height: 38px; border-radius: 10px; }
.paper-school { font-size: 16pt; font-weight: 750; letter-spacing: .04em; color: var(--brand-900); line-height: 1.2; }
.paper-school-en { font-family: var(--font-num); font-size: 6.5pt; letter-spacing: .12em; color: #71837b; margin-top: 1px; }
.paper-doc { margin-left: auto; text-align: right; }
.paper-doc b { display: block; font-size: 11.5pt; font-weight: 700; letter-spacing: .02em; color: var(--brand-900); }
.paper-doc span { font-size: 7.5pt; color: #71837b; }
.paper-sub { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px solid #dfe7e1; font-size: 7.5pt; color: #71837b; }
.paper-sub b { color: #33453f; font-weight: 600; }
.stu-strip { display: flex; align-items: center; gap: 12px; padding: 11px 0 9px; }
.stu-photo { width: 62px; height: 76px; border: 1px solid #dfe7e1; border-radius: 6px; background: linear-gradient(160deg, #eef6f1, #f8f1e3); display: grid; place-items: center; color: var(--brand-700); font-size: 22px; font-weight: 700; flex: none; }
.stu-fields { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px 14px; flex: 1; }
.pf .pk { font-size: 6.8pt; color: #8a9a93; letter-spacing: .04em; }
.pf .pv { font-size: 9pt; font-weight: 600; color: #263b33; }
.paper-intro { font-size: 8pt; color: #5e7169; line-height: 1.75; padding: 8px 10px; background: #f6f9f6; border-left: 2px solid #bcd9cc; margin: 5px 0 11px; }
.paper-section-title { display: flex; align-items: center; gap: 7px; margin: 12px 0 6px; font-size: 9pt; font-weight: 700; color: var(--brand-900); }
.paper-section-title .no { width: 16px; height: 16px; border-radius: 4px; background: var(--brand-800); color: #fff; display: grid; place-items: center; font-family: var(--font-num); font-size: 6.5pt; }
.paper-section-title .rule { flex: 1; height: 1px; background: #dfe7e1; }
.domain-table { width: 100%; border-collapse: collapse; font-size: 8pt; }
.domain-table th { padding: 5px 7px; text-align: left; font-size: 6.8pt; font-weight: 650; letter-spacing: .03em; color: #6b7f76; background: #f3f7f3; border: 1px solid #e1e9e2; }
.domain-table td { padding: 6px 7px; border: 1px solid #e6ece5; vertical-align: top; }
.domain-table td.dn { font-weight: 650; color: #263b33; width: 21%; }
.domain-table td.dl { width: 20%; }
.domain-table td.dc { color: #55695f; font-size: 7.5pt; line-height: 1.6; }
.level { display: inline-flex; align-items: center; gap: 3px; }
.level i { width: 6px; height: 6px; border-radius: 50%; background: #dfe6e0; }
.level i.on { background: var(--brand-600); }
.level span { font-size: 7pt; color: #4f645b; margin-left: 3px; white-space: nowrap; }
.paper-2col { display: grid; grid-template-columns: 1.15fr .85fr; gap: 12px; }
.attitude { display: grid; gap: 4px; }
.att-row { display: flex; align-items: center; gap: 6px; font-size: 7.6pt; color: #55695f; }
.att-row .an { width: 60px; flex: none; }
.att-row .dots { display: flex; gap: 3px; }
.att-row .dots i { width: 7px; height: 7px; border-radius: 50%; background: #e3eae4; }
.att-row .dots i.on { background: var(--brand-600); }
.photo-record { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photo-record figure { margin: 0; border: 1px solid #e3eae4; border-radius: 5px; overflow: hidden; }
.photo-record img { width: 100%; height: 68px; object-fit: cover; }
.photo-record figcaption { padding: 3px 5px; font-size: 6.2pt; color: #6b7f76; }
.comment-box { min-height: 48px; padding: 7px 9px; border: 1px solid #e1e9e2; border-radius: 5px; background: #fcfdfb; font-size: 8pt; line-height: 1.8; color: #435a50; }
.comment-box .teacher-sign { display: block; text-align: right; font-size: 7pt; color: #7b8c84; margin-top: 4px; }
.parent-box { min-height: 44px; padding: 7px 9px; border: 1px dashed #cfdcd4; border-radius: 5px; background: #fbfcf9; font-size: 7.5pt; color: #8a9a93; }
.sign-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-top: 14px; }
.sign { padding-top: 20px; border-top: 1px solid #9fb3aa; font-size: 7pt; color: #71837b; }
.sign b { display: block; margin-top: 3px; color: #33453f; font-weight: 600; }
.paper-foot { display: flex; justify-content: space-between; margin-top: 13px; padding-top: 6px; border-top: 1px solid #e1e9e2; font-size: 6.3pt; color: #93a39c; }
.report-note { width: 210mm; margin: 12px auto 0; font-size: 10px; color: #83938b; text-align: center; }

/* ---------- 評估總表、主題評估、學習評估表（2026-10-21 改版） ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.form-grid > .field { grid-column: 1 / -1; margin-bottom: 13px; }
.form-grid > .field.half { grid-column: span 1; }
.form-error { margin-top: 6px; padding: 9px 11px; font-size: 11.5px; color: var(--danger-600); background: var(--danger-100); border-radius: 8px; }
.input.bad, .select.bad, .textarea.bad { border-color: var(--danger-500); }

.code-chip {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  min-width: 30px; height: 20px; padding: 0 6px;
  font-family: var(--font-num); font-size: 10.5px; font-weight: 700; letter-spacing: .02em;
  color: var(--brand-800); background: var(--brand-100); border-radius: 5px;
}
.code-chip.sub { min-width: 40px; color: var(--ink-600); background: var(--surface-3); font-weight: 650; }
.code-chip.off { color: var(--ink-400); background: var(--surface-3); }
.pill { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; font-size: 10px; font-weight: 600; border-radius: 999px; background: var(--surface-3); color: var(--ink-500); white-space: nowrap; }
.pill .ic { width: 11px; height: 11px; }
.pill.brand { background: var(--brand-50); color: var(--brand-700); }
.pill.amber { background: var(--amber-50); color: var(--amber-700); }
.pill.red { background: var(--danger-100); color: var(--danger-600); }
.pill.blue { background: var(--info-100); color: var(--info-600); }

.readonly-note { margin-bottom: 14px; }
.ms-tabs { margin: 2px 0 16px; overflow-y: hidden; }
.ms-tabs .tab { min-height: 44px; }
.ms-tabs .tab .tab-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.ms-tabs .tab .tab-dot.err { background: var(--danger-500); }
.ms-tabs .tab .tab-dot.ok { background: var(--brand-500); }

/* 結構樹 */
.tree-group { display: flex; align-items: center; gap: 8px; margin: 14px 2px 7px; font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--ink-400); }
.tree-group:first-of-type { margin-top: 2px; }
.tree-group .line { flex: 1; height: 1px; background: var(--line); }
.cat.is-off > .cat-head { background: var(--surface-3); }
.cat.is-off > .cat-head .cat-title .tt { color: var(--ink-400); text-decoration: line-through; text-decoration-color: var(--ink-300); }
.cat-head .edb { font-size: 9.5px; font-weight: 500; color: var(--ink-400); margin-left: 6px; }
.item .item-code { flex: none; }
.item .range { font-family: var(--font-num); }

/* 主題與細項 */
.theme-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-bottom: 14px; }
.theme-card { position: relative; padding: 13px 14px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-xs); }
.theme-card .tc-no { font-family: var(--font-num); font-size: 10px; font-weight: 700; letter-spacing: .06em; color: var(--brand-700); }
.theme-card h3 { font-size: 14px; font-weight: 700; margin: 2px 0 6px; padding-right: 36px; }
.theme-card .tc-row { display: flex; justify-content: space-between; gap: 8px; font-size: 10.5px; color: var(--ink-500); padding: 2px 0; }
.theme-card .tc-row b { font-weight: 600; color: var(--ink-700); font-family: var(--font-num); }
.theme-card .tc-edit { position: absolute; top: 8px; right: 8px; }
.theme-card.add { display: grid; place-items: center; min-height: 118px; border-style: dashed; background: var(--surface-2); color: var(--ink-400); font-size: 12px; font-weight: 600; width: 100%; }
.theme-card.add:hover { color: var(--brand-700); border-color: var(--brand-500); background: var(--brand-50); }
.matrix-wrap { overflow: auto; max-height: calc(100vh - 210px); border-top: 1px solid var(--line); }
.matrix { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 11.5px; }
.matrix th, .matrix td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); vertical-align: top; }
.matrix thead th { position: sticky; top: 0; z-index: 3; padding: 9px 10px; text-align: left; background: var(--surface-2); font-size: 10.5px; font-weight: 650; color: var(--ink-600); }
.matrix thead th .th-sub { display: block; font-weight: 500; font-size: 9.5px; color: var(--ink-400); margin-top: 1px; font-family: var(--font-num); }
.matrix .col-item { position: sticky; left: 0; z-index: 2; background: var(--surface); width: 300px; min-width: 260px; padding: 9px 10px; }
.matrix thead .col-item { z-index: 4; background: var(--surface-2); }
.matrix .row-area td { padding: 8px 10px; background: var(--brand-50); font-size: 11.5px; font-weight: 700; color: var(--brand-900); }
.matrix .row-area .muted { font-weight: 500; font-size: 10px; }
.matrix .row-sub td { padding: 6px 10px 6px 22px; background: var(--surface-2); font-size: 10.5px; font-weight: 650; color: var(--ink-500); }
.matrix .item-cell { display: flex; gap: 7px; align-items: flex-start; }
.matrix .item-cell .t { line-height: 1.5; color: var(--ink-800); }
.matrix .item-cell .r { display: block; margin-top: 2px; font-size: 9.5px; color: var(--ink-400); font-family: var(--font-num); }
.matrix td.cell { min-width: 220px; padding: 6px; background: var(--surface); }
.matrix td.cell.empty { background: repeating-linear-gradient(135deg, var(--surface), var(--surface) 6px, var(--surface-2) 6px, var(--surface-2) 12px); }
.sub-chip {
  display: flex; align-items: flex-start; gap: 6px; width: 100%; margin-bottom: 4px; padding: 6px 7px;
  text-align: left; font-size: 11px; line-height: 1.5; color: var(--ink-800);
  background: var(--surface); border: 1px solid var(--line); border-radius: 7px;
}
.sub-chip:hover { border-color: var(--brand-500); background: var(--brand-50); }
.sub-chip .code-chip { height: 18px; font-size: 9.5px; min-width: 36px; }
.sub-chip .k { display: block; margin-top: 2px; font-size: 9px; color: var(--ink-400); }
.sub-chip .k .ic { width: 10px; height: 10px; display: inline-block; vertical-align: -1px; }
.cell-slash { display: block; padding: 4px 2px 2px; font-family: var(--font-num); font-size: 13px; color: var(--ink-300); }
.cell-add { display: inline-flex; align-items: center; gap: 3px; min-height: 30px; padding: 0 7px; font-size: 10.5px; color: var(--ink-400); background: none; border: 1px dashed transparent; border-radius: 6px; }
.cell-add:hover { color: var(--brand-700); border-color: var(--brand-200); background: var(--brand-50); }
.cell-add .ic { width: 12px; height: 12px; }
.legend-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 10px 14px; font-size: 10.5px; color: var(--ink-500); }

/* 等級準則 */
.level-editor { display: grid; gap: 6px; max-width: 520px; }
.level-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) 32px; align-items: center; gap: 6px; }
.level-row .ln { font-family: var(--font-num); font-size: 11px; font-weight: 700; color: var(--brand-700); text-align: center; }
.bands-table td, .bands-table th { white-space: nowrap; }
.bands-table td.item-t { white-space: normal; min-width: 220px; }
.cut-cell { display: flex; flex-direction: column; gap: 3px; }
.cut-input { width: 62px; height: 36px; padding: 0 8px; font-family: var(--font-num); font-size: 13px; font-weight: 600; text-align: center; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); }
.cut-input:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px var(--brand-100); }
.cut-input.bad { border-color: var(--danger-500); background: var(--danger-100); }
.cut-input[readonly] { background: var(--surface-3); color: var(--ink-400); }
.cut-range { font-family: var(--font-num); font-size: 9.5px; color: var(--ink-400); }

/* 發佈前檢查 */
.check-list { display: grid; gap: 0; }
.check-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--ink-700); }
.check-row:last-child { border-bottom: 0; }
.check-row .ci { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.check-row .ci .ic { width: 13px; height: 13px; }
.check-row.ok .ci { background: var(--brand-100); color: var(--brand-700); }
.check-row.err .ci { background: var(--danger-100); color: var(--danger-600); }
.check-row .ct { flex: 1; line-height: 1.6; padding-top: 1px; }

/* 入評估：按範疇 → 副範疇 → 項目 → 細項 */
.theme-switch { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.theme-switch a {
  display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 6px 12px;
  font-size: 12px; font-weight: 600; color: var(--ink-600);
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
}
.theme-switch a:hover { border-color: var(--brand-500); }
.theme-switch a.on { color: var(--brand-900); background: var(--brand-50); border-color: var(--brand-600); box-shadow: 0 0 0 2px var(--brand-100); }
.theme-switch a .no { font-family: var(--font-num); font-size: 10px; color: var(--ink-400); }
.theme-switch a .badge { height: 20px; font-size: 9.5px; }
/* 入評估：按學生／按細項（09 #54；design-system §6.1） */
.view-switch-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 12px; }
.view-switch button { height: auto; min-height: 44px; padding: 0 16px; font-size: 12px; }
.view-switch button.on { color: var(--brand-800); }
.view-hint { font-size: 11px; color: var(--ink-500); }
.sub-pick .code-chip { flex: none; }
.sub-pick .sn { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.stu-line .stu-id { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.stu-line .stu-id .avatar { width: 30px; height: 30px; font-size: 10px; flex: none; }
.stu-line .stu-id b { display: block; font-size: 12px; font-weight: 650; color: var(--ink-800); }
.stu-line .stu-id small { display: block; font-size: 10px; color: var(--ink-400); }
.stu-line .lock-note { display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--ink-500); margin: -2px 0 8px; }
.area-head { display: flex; align-items: center; gap: 8px; padding: 10px 3px 6px; margin-top: 6px; }
.area-head .ah-name { font-size: 13px; font-weight: 750; color: var(--brand-900); }
.area-head .line { flex: 1; height: 1px; background: var(--line); }
.area-head .cnt { font-family: var(--font-num); font-size: 10px; color: var(--ink-400); }
.sub-head { font-size: 10.5px; font-weight: 650; letter-spacing: .04em; color: var(--ink-500); padding: 4px 3px 6px; }
.item-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: 10px; overflow: hidden; }
.item-card.done { border-color: #cfe6da; }
.item-card-head { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px 9px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.item-card-head .it { flex: 1; font-size: 12px; font-weight: 650; line-height: 1.55; color: var(--ink-800); }
.item-card-head .it small { display: block; font-size: 10px; font-weight: 500; color: var(--ink-400); margin-top: 1px; }
.item-card-head .icon-btn { width: 36px; height: 36px; flex: none; }
.item-card-head .icon-btn.on { color: var(--brand-700); background: var(--brand-50); }
.item-note { padding: 8px 12px 10px; border-bottom: 1px solid var(--line); background: var(--surface); }
.item-note textarea { width: 100%; min-height: 50px; padding: 7px 9px; font-size: 11.5px; line-height: 1.6; border: 1px solid var(--line-strong); border-radius: 7px; resize: vertical; }
.item-note textarea:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px var(--brand-100); }
.item-note .lbl { display: block; font-size: 10px; font-weight: 650; color: var(--ink-500); margin-bottom: 4px; }
.sub-row { padding: 10px 12px 11px; border-bottom: 1px dashed var(--line); }
.sub-row:last-child { border-bottom: 0; }
.sub-row.na { background: var(--surface-2); }
.sub-row-head { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.sub-row-head .st { flex: 1; font-size: 12px; line-height: 1.55; color: var(--ink-800); }
.sub-row-head .st .req { color: var(--danger-500); }
.sub-row-head .st .pill { margin-left: 4px; vertical-align: 1px; }
.sub-row-head .q-tools { display: flex; gap: 2px; flex: none; }
.sub-row-head .q-tools .icon-btn { width: 36px; height: 36px; }
.sub-row .rating button { min-height: 44px; height: auto; padding: 6px 13px; font-size: 12px; }
.sub-row .q-link { min-height: 32px; }
.score-sum { display: grid; gap: 0; }
.score-sum .ss-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 0; font-size: 10.5px; color: var(--ink-600); border-bottom: 1px solid var(--line); }
.score-sum .ss-row:last-child { border-bottom: 0; }
.score-sum .ss-row b { font-family: var(--font-num); color: var(--ink-800); }
.score-sum .ss-area { font-weight: 700; color: var(--brand-900); background: var(--brand-50); margin: 4px -13px 0; padding: 6px 13px; }

/* 主題評估列表 */
.ms-group { margin-bottom: 16px; }
.ms-group .card-head .t { font-size: 14px; font-weight: 700; }
.ms-group .card-head .s { font-size: 11px; color: var(--ink-400); margin-top: 2px; }
.term-report { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.theme-name { display: flex; align-items: center; gap: 9px; min-width: 200px; }
.theme-name .no { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; font-family: var(--font-num); font-size: 12px; font-weight: 700; color: var(--brand-700); background: var(--brand-50); border: 1px solid #dcece4; }
.theme-name .t { font-size: 12.5px; font-weight: 650; }
.theme-name .t:hover { color: var(--brand-700); }
.theme-name .s { font-size: 10px; color: var(--ink-400); margin-top: 1px; }

/* 學習評估表與成績表的評估表格（列印用） */
.eval-head { text-align: center; padding-bottom: 8px; border-bottom: 2.5px solid var(--brand-800); }
.eval-head .school { font-size: 15pt; font-weight: 750; letter-spacing: .06em; color: var(--brand-900); }
.eval-head .school-en { font-family: var(--font-num); font-size: 6.5pt; letter-spacing: .14em; color: #71837b; }
.eval-head .year { margin-top: 6px; font-size: 11pt; font-weight: 650; }
.eval-head .doc { font-size: 13pt; font-weight: 750; letter-spacing: .1em; color: var(--brand-900); }
.eval-info { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 22px; padding: 10px 0 9px; font-size: 9pt; }
.eval-info.with-photo { grid-template-columns: 1fr 1fr 74px; }
.eval-info .fi { display: flex; gap: 6px; border-bottom: 1px solid #dfe7e1; padding-bottom: 3px; }
.eval-info .fi span { color: #6b7f76; white-space: nowrap; }
.eval-info .fi b { font-weight: 600; color: #263b33; }
.eval-info .photo { grid-column: 3; grid-row: 1 / span 4; border: 1px solid #dfe7e1; border-radius: 4px; display: grid; place-items: center; color: var(--brand-700); font-size: 18pt; font-weight: 700; background: linear-gradient(160deg, #eef6f1, #f8f1e3); }
.eval-table { width: 100%; border-collapse: collapse; font-size: 8.3pt; }
.eval-table th, .eval-table td { border: 1px solid #b9c7bf; padding: 4px 6px; vertical-align: middle; }
.eval-table thead th { background: #f0f5f1; font-weight: 700; color: #33453f; text-align: center; font-size: 8pt; }
.eval-table td.grp, .eval-table td.area, .eval-table td.subarea { text-align: center; font-weight: 650; color: #263b33; background: #fbfcfa; }
.eval-table td.grp { writing-mode: vertical-rl; letter-spacing: .2em; width: 22px; padding: 6px 2px; }
.eval-table td.area { width: 76px; }
.eval-table td.subarea { width: 84px; font-weight: 600; font-size: 7.8pt; }
.eval-table td.it { line-height: 1.5; color: #263b33; }
.eval-table td.it .cd { font-family: var(--font-num); font-size: 6.8pt; font-weight: 700; color: var(--brand-700); margin-left: 3px; }
.eval-table td.lv { width: 26px; text-align: center; font-size: 10pt; color: var(--brand-800); }
.eval-table td.val { text-align: center; font-size: 8pt; color: #33453f; }
.eval-table td.na { text-align: center; font-size: 7.5pt; color: #8a9a93; }
.eval-table td.score, .eval-table th.score { width: 54px; white-space: nowrap; text-align: center; font-family: var(--font-num); font-size: 7.6pt; color: var(--amber-700); background: var(--amber-50); }
.eval-table tr.subtotal td { font-weight: 700; background: var(--amber-50); color: var(--amber-700); font-size: 7.6pt; }
.eval-table tr { page-break-inside: avoid; }
.eval-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 5px; font-size: 7pt; color: #6b7f76; }
.eval-legend b { color: #33453f; }
.eval-note { margin-top: 4px; font-size: 6.8pt; color: #8a9a93; line-height: 1.6; }
.report-toolbar .rt-select { height: 32px; padding: 0 30px 0 10px; font-size: 12px; width: auto; }
.report-toolbar .rt-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-600); }
.report-banner { width: 210mm; max-width: 100%; margin: 0 auto 12px; }
.comment-edit { width: 100%; min-height: 90px; font-size: 9pt; line-height: 1.8; }

/* ---------- 成績表樣式（原型試驗，待確認）----------
   rc-classic：現有置中抬頭（沿用學校樣本）
   rc-hk：香港常見中英正式版，校徽左置、黑白線框、明體標題、中英 label
   rc-modern：簡約清新，無直線表格、等級用圓點
   三款欄目與資料相同，只換視覺。 */
.paper .en { font-style: normal; display: block; font-family: var(--font-num); font-size: .78em; font-weight: 500; letter-spacing: .01em; color: var(--ink-500); line-height: 1.25; }

.rc-hk { --rc-serif: "Noto Serif HK", "PMingLiU", "MingLiU", "Songti TC", serif; color: var(--ink-900); }
.rc-head-hk { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding-bottom: 9px; border-bottom: 3px double var(--ink-900); }
.rc-head-hk .crest { width: 52px; height: 52px; border-radius: 50%; filter: grayscale(1); }
.rc-head-hk .school { font-family: var(--rc-serif); font-size: 17pt; font-weight: 700; letter-spacing: .12em; }
.rc-head-hk .school-en { font-family: Georgia, "Times New Roman", serif; font-size: 9pt; letter-spacing: .04em; font-variant: small-caps; }
.rc-head-hk .addr { font-size: 6.8pt; color: var(--ink-500); margin-top: 2px; }
.rc-head-hk .doc { text-align: right; border-left: 1px solid var(--ink-900); padding-left: 12px; }
.rc-head-hk .doc b { display: block; font-family: var(--rc-serif); font-size: 13pt; letter-spacing: .08em; }
.rc-head-hk .doc span { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 8pt; letter-spacing: .06em; text-transform: uppercase; }
.rc-head-hk .doc em { display: block; font-style: normal; font-size: 7.5pt; color: var(--ink-600); margin-top: 2px; }
.rc-hk .eval-info { gap: 0; padding: 0; margin: 10px 0; border: 1px solid var(--ink-900); border-right: 0; border-bottom: 0; }
.rc-hk .eval-info .fi { border: 0; border-right: 1px solid var(--ink-900); border-bottom: 1px solid var(--ink-900); padding: 4px 7px; align-items: center; }
.rc-hk .eval-info .fi span { min-width: 82px; color: var(--ink-700); font-size: 8pt; line-height: 1.2; }
.rc-hk .eval-info .photo { border: 0; border-right: 1px solid var(--ink-900); border-bottom: 1px solid var(--ink-900); border-radius: 0; background: var(--surface-3); color: var(--ink-600); }
.rc-hk .eval-table th, .rc-hk .eval-table td { border-color: var(--ink-900); }
.rc-hk .eval-table thead th { background: var(--surface-3); color: var(--ink-900); }
.rc-hk .eval-table td.grp, .rc-hk .eval-table td.area, .rc-hk .eval-table td.subarea { background: #fff; color: var(--ink-900); font-family: var(--rc-serif); }
.rc-hk .eval-table td.it { color: var(--ink-900); }
.rc-hk .eval-table td.lv { color: var(--ink-900); }
.rc-hk .paper-section-title { color: var(--ink-900); font-family: var(--rc-serif); }
.rc-hk .paper-section-title .no { display: none; }
.rc-hk .paper-section-title .rule { background: var(--ink-900); }
.rc-hk .paper-section-title .en { display: inline; margin-left: 6px; font-size: .85em; }
.rc-hk .comment-box, .rc-hk .parent-box { border: 1px solid var(--ink-900); border-radius: 0; background: #fff; color: var(--ink-800); }
.rc-hk .parent-box .en, .rc-hk .eval-legend .en { display: inline; margin-left: 3px; }
.rc-hk .sign { border-top-color: var(--ink-900); color: var(--ink-700); }
.rc-hk .paper-foot { border-top-color: var(--ink-900); color: var(--ink-500); }

.rc-modern .eval-head, .rc-head-modern { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-md); background: var(--brand-50); }
.rc-head-modern .crest { width: 40px; height: 40px; border-radius: 11px; }
.rc-head-modern .school { font-size: 15pt; font-weight: 750; color: var(--brand-900); letter-spacing: .04em; line-height: 1.2; }
.rc-head-modern .school-en { font-family: var(--font-num); font-size: 6.5pt; letter-spacing: .14em; color: var(--ink-500); }
.rc-head-modern .doc { margin-left: auto; text-align: right; }
.rc-head-modern .doc .yr { display: inline-block; padding: 1px 8px; border-radius: var(--r-full); background: #fff; color: var(--brand-700); font-size: 7.5pt; font-weight: 600; }
.rc-head-modern .doc b { display: block; margin-top: 3px; font-size: 12.5pt; color: var(--brand-900); letter-spacing: .04em; }
.rc-modern .eval-info { margin: 10px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); }
.rc-modern .eval-info .fi { border-bottom-style: dashed; }
.rc-modern .eval-info .photo { border-radius: var(--r-sm); border: 0; }
.rc-modern .eval-table { border-collapse: separate; border-spacing: 0; border: 1px solid var(--line-strong); border-radius: var(--r-sm); overflow: hidden; }
.rc-modern .eval-table th, .rc-modern .eval-table td { border: 0; border-bottom: 1px solid var(--line); }
.rc-modern .eval-table thead th { background: var(--brand-800); color: #fff; border-bottom: 0; }
.rc-modern .eval-table td.grp, .rc-modern .eval-table td.area, .rc-modern .eval-table td.subarea { background: var(--brand-50); color: var(--brand-900); border-right: 1px solid var(--line); }
.rc-modern .eval-table td.lv .mk { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: var(--brand-600); color: #fff; font-size: 7pt; font-weight: 700; }
.rc-modern .paper-section-title .no { border-radius: 50%; background: var(--brand-600); }
.rc-modern .paper-section-title .rule { background: var(--line); }
.rc-modern .comment-box, .rc-modern .parent-box { border-radius: var(--r-md); }
.rc-modern .sign { border-top-style: dashed; }

/* iPad 橫向（≤1320）：右欄的學生整體觀察備註與分數摘要不可隱藏，改放在中欄下方 */
@media (max-width: 1320px) {
  .assess-layout > .assess-side.right { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; grid-column: 2; position: static; }
  .assess-layout > .assess-side.right .context-card { margin-bottom: 0; }
}
@media (max-width: 900px) {
  .assess-layout > .assess-side.right { grid-column: auto; }
}
@media (max-width: 1180px) {
  .theme-cards { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}
@media (max-width: 900px) {
  .matrix .col-item { width: 220px; min-width: 200px; }
  .report-banner { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid > .field.half { grid-column: 1 / -1; }
}
@media print {
  .no-print, .report-banner { display: none !important; }
}

/* ---------- Index / prototype guide ---------- */
.index-body { background: #f6f5f0; }
.index-nav {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 16px;
  padding: 13px 40px;
  background: rgba(246, 245, 240, .88); backdrop-filter: blur(14px);
  border-bottom: 1px solid #e3e3da;
}
.index-nav .brand { padding: 0; }
.index-nav .brand-name { color: var(--ink-900); }
.index-nav .brand-en { color: var(--ink-400); }
.index-nav .idx-links { display: flex; gap: 18px; margin-left: 18px; font-size: 11.5px; color: var(--ink-500); }
.index-nav .idx-links a:hover { color: var(--brand-700); }
.index-nav .idx-actions { margin-left: auto; display: flex; gap: 7px; }
.index-hero {
  position: relative; overflow: hidden;
  padding: 72px 40px 54px;
  color: #eaf4ef;
  background:
    radial-gradient(70% 100% at 85% 0%, rgba(224, 165, 74, .14), transparent 60%),
    linear-gradient(150deg, #0e473b, #082e27 70%);
}
.index-hero::before {
  content: ""; position: absolute; right: -100px; bottom: -260px;
  width: 620px; height: 620px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.06);
  box-shadow: 0 0 0 60px rgba(255,255,255,.018), 0 0 0 150px rgba(255,255,255,.012);
}
.index-hero-inner { position: relative; z-index: 1; max-width: 1160px; margin: 0 auto; }
.index-kicker { display: inline-flex; align-items: center; gap: 7px; font-size: 10px; font-weight: 650; letter-spacing: .12em; color: #f0c987; padding: 4px 10px; border: 1px solid rgba(224,165,74,.25); background: rgba(224,165,74,.08); border-radius: 999px; }
.index-hero h1 { font-size: clamp(34px, 4.2vw, 54px); line-height: 1.26; letter-spacing: -.03em; font-weight: 750; max-width: 900px; margin-top: 20px; color: #fdfbf6; }
.index-hero h1 em { font-style: normal; color: #efc27c; }
.index-hero p { max-width: 620px; font-size: 14px; line-height: 1.9; color: rgba(220,236,229,.65); margin-top: 16px; }
.index-hero .idx-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.index-hero .idx-meta span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; font-size: 10.5px; color: rgba(233,244,239,.75); background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); border-radius: 999px; }
.index-wrap { max-width: 1160px; margin: 0 auto; padding: 34px 40px 70px; }
.index-sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 34px 0 16px; }
.index-sec-head:first-child { margin-top: 0; }
.index-sec-head h2 { font-size: 20px; font-weight: 750; letter-spacing: -.02em; }
.index-sec-head p { font-size: 12px; color: var(--ink-400); margin-top: 4px; }
.index-sec-head .idx-num { font-family: var(--font-num); font-size: 10px; letter-spacing: .1em; color: var(--ink-300); }
.proto-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.proto-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border: 1px solid #e1e2d9; border-radius: 14px;
  box-shadow: 0 1px 2px rgba(20,40,33,.04);
  transition: transform .16s, box-shadow .16s, border-color .16s;
}
.proto-card:hover { transform: translateY(-2px); border-color: #cfd9cf; box-shadow: 0 18px 36px -20px rgba(20,50,40,.28); }
.proto-card.wide { grid-column: 1 / -1; flex-direction: row; align-items: stretch; }
.proto-card.wide .proto-thumb { width: 38%; min-height: 220px; aspect-ratio: auto; border-bottom: 0; border-right: 1px solid #e5e7de; }
.proto-card.wide .proto-thumb img { object-position: top center; }
.proto-card.wide .proto-body { padding: 24px 28px; justify-content: center; }
.proto-card.wide .proto-body h3 { font-size: 18px; }
.proto-card.wide .proto-body p { font-size: 11.5px; max-width: 620px; flex: 0 0 auto; }
.proto-card.wide .proto-tags { margin-top: 12px; }
.proto-thumb { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: linear-gradient(135deg, #edf3ec, #e5eee7); border-bottom: 1px solid #e5e7de; }
.proto-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.proto-thumb .num { position: absolute; top: 10px; left: 10px; min-width: 24px; height: 22px; padding: 0 7px; display: grid; place-items: center; font-family: var(--font-num); font-size: 9px; font-weight: 700; color: #fff; background: rgba(15, 60, 49, .82); backdrop-filter: blur(4px); border-radius: 6px; }
.proto-thumb .in { position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px; font-size: 9px; color: #fff; background: rgba(15,60,49,.78); border-radius: 5px; opacity: 0; transition: opacity .15s; }
.proto-card:hover .in { opacity: 1; }
.proto-body { padding: 14px 15px 15px; display: flex; flex-direction: column; flex: 1; }
.proto-body h3 { font-size: 13.5px; font-weight: 700; letter-spacing: -.01em; }
.proto-body p { font-size: 10.5px; line-height: 1.65; color: var(--ink-400); margin-top: 4px; flex: 1; }
.proto-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.proto-tags span { font-size: 8.5px; color: var(--ink-500); background: var(--surface-3); padding: 2px 6px; border-radius: 4px; }
.idx-principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.idx-principle { padding: 16px; background: #fff; border: 1px solid #e4e5dc; border-radius: 12px; }
.idx-principle .ip { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-700); margin-bottom: 9px; }
.idx-principle b { font-size: 12px; font-weight: 650; }
.idx-principle p { font-size: 10.5px; color: var(--ink-400); line-height: 1.7; margin-top: 3px; }
.idx-note { display: flex; gap: 12px; padding: 16px 18px; background: #fff; border: 1px dashed #d7dccf; border-radius: 12px; font-size: 11px; color: var(--ink-500); line-height: 1.7; }
.idx-note .ic { color: var(--amber-600); margin-top: 1px; }
.idx-foot { padding: 24px 40px 40px; text-align: center; font-size: 10px; color: var(--ink-300); }

/* ---------- Animations ---------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes popIn { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes flash { 0% { opacity: 0; } 12% { opacity: .9; } 100% { opacity: 0; } }

/* ---------- Responsive ---------- */
@media (max-width: 1320px) {
  .assess-layout { grid-template-columns: 210px minmax(0, 1fr); }
  .assess-side.right { display: none; }
  .student-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-stack.cols { grid-template-columns: 1fr 1fr; }
  .bp-layout { grid-template-columns: minmax(0, 1fr) 340px; }
  .stu-layout { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .student-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .proto-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .proto-card.wide { grid-column: 1 / -1; flex-direction: column; }
  .proto-card.wide .proto-thumb { width: 100%; min-height: 0; aspect-ratio: 16/10; border-right: 0; border-bottom: 1px solid #e5e7de; }
  .proto-card.wide .proto-body { padding: 15px; }
  .proto-card.wide .proto-body h3 { font-size: 14px; }
}
/* 入評估：iPad 橫向（≤1180）收起側邊欄，讓細項有足夠闊度；用頂部選單按鈕開啟 */
@media (max-width: 1180px) {
  body[data-page="assess"] .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  body[data-page="assess"] .sidebar.open { transform: none; }
  body[data-page="assess"] .main { margin-left: 0; }
  body[data-page="assess"] .topbar .menu-toggle { display: grid; }
  body[data-page="assess"] .scrim { position: fixed; inset: 0; z-index: 55; background: rgba(8,28,23,.4); backdrop-filter: blur(2px); opacity: 0; visibility: hidden; transition: .2s; }
  body[data-page="assess"] .scrim.show { opacity: 1; visibility: visible; }
}
@media (max-width: 1024px) {
  :root { --sidebar-w: 232px; }
  .content { padding: 22px 22px 56px; }
  .topbar { padding: 0 22px; }
  .search-trigger { width: 180px; }
  .search-trigger span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .search-trigger .kbd { display: none; }
  .bp-layout { grid-template-columns: 1fr; }
  .inspector { position: static; max-height: none; }
  .ins-body { max-height: none; }
  .login { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-panel { min-height: 100vh; }
  .login-badge-demo { left: 30px; }
  .login-version { left: 30px; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .menu-toggle { display: grid; }
  .topbar .menu-toggle { display: grid; }
  .scrim { position: fixed; inset: 0; z-index: 55; background: rgba(8,28,23,.4); backdrop-filter: blur(2px); opacity: 0; visibility: hidden; transition: .2s; }
  .scrim.show { opacity: 1; visibility: visible; }
  .assess-layout { grid-template-columns: 1fr; }
  .assess-side { position: static; }
  .rail { max-height: 240px; }
  .assess-side.right { display: block; }
  .assess-actions { bottom: 8px; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .page-head > .grow { width: 100%; }
  .bp-title-input { font-size: 21px; }
  .page-actions { width: 100%; flex-wrap: wrap; }
  .student-hero { flex-wrap: wrap; }
  .student-hero .sh-actions { width: 100%; margin-left: 0; }
  .index-hero { padding: 54px 24px 40px; }
  .index-wrap { padding: 26px 24px 50px; }
  .index-nav { padding: 12px 22px; }
  .index-nav .idx-links { display: none; }
  .idx-principles { grid-template-columns: 1fr; }
  .paper { width: 100%; min-height: 0; padding: 22px; }
  .report-note { width: 100%; }
}
@media (max-width: 720px) {
  .content { padding: 18px 15px 48px; }
  .topbar { padding: 0 14px; gap: 8px; }
  .crumb { display: none; }
  .search-trigger { width: 36px; padding: 0; justify-content: center; }
  .search-trigger span, .search-trigger .kbd { display: none; }
  .term-btn { display: none; }
  .page-head h1 { font-size: 23px; }
  .kpi-grid { grid-template-columns: 1fr; }
  .dash-stack.cols { grid-template-columns: 1fr; }
  .dash-hero { flex-direction: column; align-items: flex-start; }
  .dash-hero .termbox { width: 100%; }
  .stat-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .student-grid { grid-template-columns: 1fr; }
  .proto-grid { grid-template-columns: 1fr; }
  .class-picks { grid-template-columns: 1fr 1fr; }
  .assess-summary { grid-template-columns: 1fr 1fr; }
  .assess-summary > div:last-child { grid-column: span 2; }
  .modal { padding: 10px; }
  .modal.is-open { padding: 10px; }
  .modal-head { padding: 18px 18px 12px; }
  .modal-body { padding: 6px 18px 18px; }
  .modal-foot { padding: 12px 18px; }
  .login-panel { padding: 22px 20px; }
  .login-form-wrap { padding-top: 10px; }
  .login-badge-demo { position: static; align-self: flex-start; margin-bottom: 8px; }
  .login-version { display: none; }
  .student-hero { padding: 18px; }
  .student-hero .avatar.xl { width: 68px; height: 68px; font-size: 22px; }
  .student-hero h1 { font-size: 21px; }
  .radar-wrap { flex-direction: column; }
  .paper-2col { grid-template-columns: 1fr; }
  .stu-fields { grid-template-columns: 1fr 1fr; }
  .paper { padding: 16px; }
  .paper-head { flex-wrap: wrap; }
  .paper-doc { margin-left: 0; text-align: left; width: 100%; }
  .report-toolbar { padding: 8px 12px; flex-wrap: wrap; }
  .report-toolbar .rt-title, .report-toolbar .rt-sep { display: none; }
  .report-toolbar .rt-actions .btn span { display: none; }
  .report-scroll { padding: 12px 8px 30px; }
}
@media (max-width: 520px) {
  .student-grid { grid-template-columns: 1fr; }
  .assess-layout { gap: 10px; }
  .rating button { flex: 1; justify-content: center; }
  .class-picks { grid-template-columns: 1fr; }
  .top-actions .icon-btn { display: none; }
  .top-actions .icon-btn:first-of-type { display: grid; }
}

/* ---------- Reduced motion / print ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media print {
  @page { size: A4; margin: 0; }
  body.report-body { background: #fff; }
  .report-toolbar, .report-note { display: none !important; }
  .report-scroll { padding: 0; }
  .paper {
    width: 210mm; min-height: 297mm; margin: 0; padding: 13mm 14mm 10mm;
    box-shadow: none; border-radius: 0;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .paper + .paper { page-break-before: always; }
}

/* ---------- 評估總表編輯器：不計入／停用／已刪除／分級檢查（09 #34–#43，2026-10-26） ---------- */
.ms-tabs .tab .tab-dot.warn { background: var(--amber-600); }
.ms-tabs .tab .count-chip, .card-head h3 .count-chip { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--surface-3); color: var(--ink-600); font-family: var(--font-num); font-size: 10.5px; font-weight: 700; }
.card-head h3 .count-chip { vertical-align: 2px; margin-left: 4px; }
.btn.tall { min-height: 44px; height: auto; }
.modal-foot .foot-left { margin-right: auto; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.item:focus-within .i-actions { opacity: 1; }
.item.is-off { background: var(--surface-2); }
.item.is-off .item-title { color: var(--ink-400); text-decoration: line-through; text-decoration-color: var(--ink-300); }
.item.is-off .item-code { background: var(--surface-3); color: var(--ink-400); }
.pill.amber .ic { color: var(--amber-700); }
.theme-card.is-off { background: var(--surface-2); border-style: dashed; }
.theme-card.is-off h3 { color: var(--ink-500); }
.theme-card .tc-note { margin-top: 8px; font-size: 10px; line-height: 1.5; color: var(--ink-500); }
.theme-card .tc-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.matrix tr.row-off td { background: var(--surface-2); }
.matrix tr.row-off .item-cell .t { color: var(--ink-500); }
.matrix td.cell.off { background: var(--surface-2); }
.matrix td.cell.off .sub-chip { background: transparent; border-style: dashed; color: var(--ink-500); }
.sub-chip.is-disabled { background: var(--surface-2); border-style: dashed; color: var(--ink-500); }
.sub-chip.is-disabled .pill { height: 17px; font-size: 9px; }
.sub-chip .lock-mark { display: inline-flex; vertical-align: -2px; color: var(--ink-400); }
.sub-chip .lock-mark .ic { width: 11px; height: 11px; }
.check-row.warn .ci { background: var(--amber-100); color: var(--amber-700); }
.check-row .ct .pill { margin-right: 4px; vertical-align: 1px; }
.bands-table td.wrap-cell { white-space: normal; min-width: 300px; }
.pending-list { list-style: disc; margin: 0 0 12px; padding-left: 18px; font-size: 12px; line-height: 1.7; color: var(--ink-700); }
.skip-list { display: grid; gap: 6px; }
.check-block.on { border-color: var(--brand-500); background: var(--brand-50); }
.check-block.fixed { cursor: default; background: var(--surface-2); color: var(--ink-500); }
.check-block.fixed:hover { background: var(--surface-2); }
.check-block input:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 2px; }
.report-banner .banner-list { margin: 6px 0 0; padding-left: 18px; line-height: 1.7; }
.internal-flag { color: var(--amber-700); font-size: 7pt; font-weight: 600; }
.eval-table td.it .unconfirmed { display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 4px; background: var(--amber-50); color: var(--amber-700); font-size: 6.8pt; font-weight: 700; white-space: nowrap; }
.eval-table td.lv.blank-grade { background: repeating-linear-gradient(135deg, var(--surface), var(--surface) 4px, var(--surface-3) 4px, var(--surface-3) 8px); }
.field > label .ic { display: inline-block; width: 12px; height: 12px; vertical-align: -1px; margin-left: 3px; color: var(--ink-400); }

/* ---------- 工作紙與網上作答（09 #105、#108–#110）---------- */
.ws-mark { display: inline-flex; vertical-align: -2px; color: var(--brand-700); }
.ws-mark .ic { width: 12px; height: 12px; }
.ws-file { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; margin-bottom: 8px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface-2); }
.ws-file-ico { width: 34px; height: 34px; display: grid; place-items: center; flex: none; border-radius: 8px; background: var(--brand-50); color: var(--brand-700); }
.ws-file b { display: block; font-size: 12.5px; color: var(--ink-800); word-break: break-all; }
.ws-file small { font-size: 11px; color: var(--ink-400); }
/* 入評估：細項的工作紙列、佐證縮圖 */
.sub-row .q-links { flex-wrap: wrap; }
.ws-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--brand-50); }
.ws-bar .ws-names { font-size: 11px; line-height: 1.6; color: var(--ink-600); }
.ws-bar .ws-names b { color: var(--ink-800); font-weight: 650; }
.ws-itembar { margin-bottom: 12px; }
.sub-row .q-link.ws-attach { min-height: 44px; }
.ws-err { margin-top: 8px; }
.photo-item { display: flex; flex-direction: column; gap: 3px; max-width: 96px; }
.photo-item .photo-others { font-size: 10px; line-height: 1.4; color: var(--ink-500); }
.ws-thumb { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 3px; width: 84px; min-height: 44px; padding: 0; background: none; border: 0; text-align: left; color: var(--ink-600); }
.ws-thumb img { width: 84px; height: 60px; object-fit: cover; border-radius: 6px; border: 2px solid var(--brand-500); background: var(--surface-3); }
.ws-thumb span { font-size: 10px; line-height: 1.3; font-weight: 650; color: var(--brand-800); }
.ws-thumb:hover img { border-color: var(--brand-700); }
.ws-view-body { padding: 4px 24px 8px; display: grid; place-items: center; }
.ws-view-body img { max-width: 100%; max-height: 62vh; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.ws-pick-list { display: grid; gap: 10px; padding: 4px 24px 8px; }
.ws-pick-list .btn { justify-content: flex-start; min-height: 52px; height: auto; white-space: normal; text-align: left; }
.ws-pick-list .btn small { display: block; font-weight: 400; color: var(--ink-500); margin-top: 2px; }
/* 相片佐證：相中其他學生 */
.po-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.po-chip { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; font-size: 13px; color: var(--ink-700); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-md); cursor: pointer; user-select: none; }
.po-chip:hover { background: var(--surface-2); }
.po-chip input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.po-chip::before { content: ""; width: 16px; height: 16px; border: 1.5px solid var(--ink-300); border-radius: 4px; flex: none; background: var(--surface); }
.po-chip:has(input:checked) { background: var(--brand-50); border-color: var(--brand-700); color: var(--brand-900); font-weight: 650; }
.po-chip:has(input:checked)::before { content: "✓"; display: grid; place-items: center; font-size: 12px; line-height: 1; color: var(--surface); background: var(--brand-700); border-color: var(--brand-700); }
.po-chip:has(input:focus-visible) { outline: 2px solid var(--brand-500); outline-offset: 2px; }
.pc-preview { display: block; width: 100%; max-height: 240px; object-fit: cover; border-radius: 10px; margin-bottom: 14px; background: var(--surface-3); }
/* 全螢幕作答畫面：覆蓋整個畫面，學生只能畫，結束要老師操作（09 #108） */
.ws-overlay { position: fixed; inset: 0; z-index: 160; display: flex; flex-direction: column; background: var(--surface-3); color: var(--ink-800); overscroll-behavior: contain; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.ws-top { flex: none; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 8px 14px; background: var(--surface); border-bottom: 1px solid var(--line-strong); }
.ws-who { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 200px; }
.ws-who b { display: block; font-size: 16px; }
.ws-who small { display: block; font-size: 12px; color: var(--ink-500); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ws-group { display: inline-flex; align-items: center; gap: 4px; padding: 0 6px; border-right: 1px solid var(--line); }
.ws-tools button { min-width: 44px; min-height: 44px; }
.ws-top .btn { min-height: 44px; height: auto; }
.ws-swatch, .ws-wd { display: inline-grid; place-items: center; border: 2px solid transparent; border-radius: 50%; background: none; padding: 0; }
.ws-swatch i { width: 24px; height: 24px; border-radius: 50%; display: block; border: 1px solid rgba(0,0,0,.2); }
.ws-wd i { display: block; border-radius: 50%; background: var(--ink-800); }
.ws-swatch[aria-pressed="true"], .ws-wd[aria-pressed="true"] { border-color: var(--brand-700); background: var(--brand-50); }
.ws-tools .btn:disabled { opacity: .45; }
.ws-stage { flex: 1 1 0; min-height: 0; display: grid; place-items: center; padding: 12px; overflow: hidden; }
.ws-page { position: relative; background: #fff; box-shadow: 0 6px 24px -10px rgba(0,0,0,.35); border-radius: 4px; overflow: hidden; }
.ws-page .ws-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; pointer-events: none; -webkit-user-drag: none; }
.ws-page .ws-ph { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px 20px; text-align: center; border: 2px solid var(--line); pointer-events: none; }
.ws-page .ws-ph b { font-size: 20px; color: var(--ink-800); word-break: break-all; }
.ws-page .ws-ph span { font-size: 14px; color: var(--ink-500); }
.ws-page canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.ws-dlg-wrap { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; padding: 20px; background: rgba(8, 28, 23, .5); }
.ws-dlg { width: min(460px, 100%); padding: 20px 22px; background: var(--surface); border-radius: var(--r-md); box-shadow: 0 20px 50px -12px rgba(0,0,0,.45); }
.ws-dlg h2 { font-size: 17px; margin: 0 0 6px; }
.ws-dlg p { margin: 0 0 16px; font-size: 13px; line-height: 1.6; color: var(--ink-600); }
.ws-dlg-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.ws-dlg-actions .btn { min-height: 44px; height: auto; }
@media (prefers-reduced-motion: reduce) { .ws-overlay * { transition: none !important; animation: none !important; } }
