:root {
  --ink: #1c2725;
  --ink-soft: #4b5a56;
  --muted: #7b8783;
  --line: #e2e8e4;
  --line-strong: #cfd8d2;
  --paper: #f4f6f2;
  --card: #ffffff;
  --teal: #0f766e;
  --teal-deep: #0b5c55;
  --teal-soft: #e6f4f1;
  --teal-ink: #0c514b;
  --amber: #b45309;
  --amber-soft: #fdf3e5;
  --red: #b91c1c;
  --red-soft: #fdecec;
  --blue: #1d4ed8;
  --blue-soft: #eef2ff;
  --sidebar: #0f1f1d;
  --sidebar-soft: #17302c;
  --shadow-sm: 0 1px 2px rgba(15, 31, 29, 0.05);
  --shadow: 0 10px 30px -18px rgba(15, 31, 29, 0.25);
  --shadow-lg: 0 24px 60px -30px rgba(15, 31, 29, 0.4);
  --radius: 16px;
  --radius-sm: 11px;
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Hiragino Sans GB", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Songti SC", "Noto Serif SC", "SimSun", "STSong", Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(1100px 500px at 100% -10%, rgba(15, 118, 110, 0.08), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(180, 83, 9, 0.05), transparent 55%),
    var(--paper);
  font-size: 14.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
h1, h2, h3, h4, p { margin: 0; }
::selection { background: rgba(15, 118, 110, 0.18); }

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 248px;
  padding: 22px 16px 18px;
  color: #d9e6e2;
  background:
    radial-gradient(400px 240px at 10% 0%, rgba(31, 122, 110, 0.35), transparent 70%),
    linear-gradient(180deg, #10221f 0%, #0c1917 100%);
  display: flex;
  flex-direction: column;
  z-index: 40;
  border-right: 1px solid rgba(255,255,255,0.05);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 8px 22px;
}
.brand-mark {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 12px;
  color: #fff;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 21px;
  background: linear-gradient(135deg, #159589, #0b5c55);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18), 0 8px 20px -10px rgba(0,0,0,0.7);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 17px; letter-spacing: 0.12em; color: #f0f7f4; }
.brand-text small { font-size: 10.5px; color: #8fb0a9; letter-spacing: 0.16em; margin-top: 3px; }
.nav-label {
  padding: 6px 12px 8px;
  font-size: 10.5px;
  letter-spacing: 0.2em;
  color: #728f88;
}
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #a9c2bc;
  font-size: 13.5px;
  border: 1px solid transparent;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.nav-item svg { opacity: .8; flex: none; }
.nav-item:hover { background: rgba(255,255,255,0.05); color: #eaf4f1; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(21, 149, 137, 0.24), rgba(21, 149, 137, 0.06));
  border-color: rgba(72, 187, 173, 0.22);
  color: #f2fbf8;
  box-shadow: inset 3px 0 0 #2eb3a4;
}
.nav-item.active svg { opacity: 1; color: #57d3c4; }
.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  color: #cfe6e1;
  font-size: 10.5px;
  display: grid; place-items: center;
}
.sidebar-footer { margin-top: auto; display: flex; flex-direction: column; gap: 9px; }
.mode-card {
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 13px;
  padding: 12px 13px;
}
.mode-card-top { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: #e6f2ef; font-weight: 600; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #eab308; box-shadow: 0 0 0 3px rgba(234,179,8,.15); display: inline-block; }
.dot.live { background: #34d399; box-shadow: 0 0 0 3px rgba(52,211,153,.16); }
.mode-card p { margin: 5px 0 9px; font-size: 11px; line-height: 1.55; color: #89a7a0; }
.mode-link { font-size: 11px; color: #5ed0c1; display: inline-flex; gap: 5px; align-items: center; }
.mode-link:hover { color: #8ce6da; }
.sidebar-help {
  display: flex; align-items: center; justify-content: space-between;
  background: transparent; border: 0; color: #9db8b1;
  padding: 8px 6px; font-size: 12px; border-radius: 8px;
}
.sidebar-help:hover { background: rgba(255,255,255,0.04); color: #dcebe7; }
.kbd {
  font-size: 10px; width: 18px; height: 18px; display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,0.16); border-radius: 5px; color: #8ba8a1;
}
.sidebar-meta { padding: 2px 6px; font-size: 10px; color: #5c7a73; letter-spacing: .06em; }

.app-main { margin-left: 248px; flex: 1; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: 64px;
  display: flex; align-items: center; gap: 14px;
  padding: 0 30px;
  background: rgba(244, 246, 242, 0.84);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(207, 216, 210, 0.7);
}
.crumb { font-size: 13px; color: var(--ink-soft); font-weight: 600; letter-spacing: 0.02em; }
.crumb span::before { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--teal); margin-right: 9px; vertical-align: 3px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.mode-chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; color: var(--ink-soft);
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.7);
}
.mode-chip .dot { width: 6px; height: 6px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; font-size: 13px; font-weight: 600;
  background: linear-gradient(135deg, #285b54, #0f766e);
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(15,31,29,.18);
}
.menu-btn { display: none !important; }
.icon-btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
}
.view { padding: 28px 32px 70px; max-width: 1420px; margin: 0 auto; }
.page-loading { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 70px 0; justify-content: center; }

/* ---------- Typography / page head ---------- */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; margin-bottom: 22px; flex-wrap: wrap;
}
.page-head h1 { font-size: 25px; letter-spacing: -0.01em; line-height: 1.3; font-weight: 700; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 5px; }
.page-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.eyebrow { font-size: 10.5px; letter-spacing: .18em; color: var(--teal); font-weight: 700; text-transform: uppercase; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line-strong);
  background: #fff; color: var(--ink);
  padding: 8px 14px; border-radius: 10px;
  font-size: 13px; font-weight: 500; line-height: 1.4;
  transition: all .16s ease; white-space: nowrap;
}
.btn:hover { border-color: #aebbb4; background: #fbfcfb; transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn svg { flex: none; }
.btn-primary { background: var(--teal); border-color: var(--teal); color: #fff; box-shadow: 0 8px 18px -12px rgba(15,118,110,.8); }
.btn-primary:hover { background: var(--teal-deep); border-color: var(--teal-deep); }
.btn-soft { background: var(--teal-soft); border-color: transparent; color: var(--teal-ink); }
.btn-soft:hover { background: #d7ede8; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: rgba(15,31,29,.05); border-color: transparent; }
.btn-danger { background: #fff; border-color: #f0caca; color: var(--red); }
.btn-danger:hover { background: var(--red-soft); border-color: #e6a8a8; }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 8px; }
.btn-lg { padding: 11px 20px; font-size: 14px; border-radius: 11px; }
.btn-wide { width: 100%; }
.link-btn { border: 0; background: none; color: var(--teal); padding: 0; font-size: inherit; }
.link-btn:hover { text-decoration: underline; }
.action-icon {
  width: 30px; height: 30px; display: inline-grid; place-items: center;
  border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
}
.action-icon:hover { color: var(--teal); border-color: #b9d8d2; background: var(--teal-soft); }
.action-icon.danger:hover { color: var(--red); border-color: #eec5c5; background: var(--red-soft); }

/* ---------- Cards / layout ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 18px 20px 0;
}
.card-title { font-size: 15px; font-weight: 700; }
.card-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.card-body { padding: 18px 20px 20px; }
.card-actions { display: flex; align-items: center; gap: 8px; }
.grid { display: grid; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }

/* ---------- Chips / tags ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; line-height: 1.6;
  background: #f1f4f2; color: var(--ink-soft);
  border: 1px solid transparent;
}
.chip-teal { background: var(--teal-soft); color: var(--teal-ink); }
.chip-amber { background: var(--amber-soft); color: var(--amber); }
.chip-red { background: var(--red-soft); color: var(--red); }
.chip-blue { background: var(--blue-soft); color: var(--blue); }
.chip-slate { background: #f1f4f2; color: #52605b; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #9aa6a1; }
.status.reviewed { color: var(--teal); }
.status.reviewed::before { background: var(--teal); }
.status.graded { color: var(--amber); }
.status.graded::before { background: #d97706; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 12px; font-weight: 600; color: var(--ink-soft); display: flex; align-items: center; gap: 6px; }
.label .optional { color: var(--muted); font-weight: 400; font-size: 11px; }
.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #fcfdfc;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13.5px;
  color: var(--ink);
  outline: none;
  transition: border .15s ease, box-shadow .15s ease, background .15s ease;
}
.textarea { resize: vertical; min-height: 110px; line-height: 1.75; }
.input:focus, .select:focus, .textarea:focus {
  border-color: #74b6ac;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}
.input::placeholder, .textarea::placeholder { color: #a4afaa; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237b8783' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.hint { font-size: 11.5px; color: var(--muted); line-height: 1.55; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.field-row-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.input-group { display: flex; gap: 8px; }
.input-group > .input { flex: 1; }
.textarea-count { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 2px; }
.segmented {
  display: inline-flex; gap: 3px; padding: 3px;
  background: #edf1ee; border-radius: 10px; border: 1px solid var(--line);
}
.segment {
  border: 0; background: transparent; color: var(--ink-soft);
  padding: 6px 14px; border-radius: 7px; font-size: 12.5px; font-weight: 500;
}
.segment.active { background: #fff; color: var(--teal-ink); box-shadow: var(--shadow-sm); font-weight: 600; }
.switch { position: relative; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #d3dbd6; transition: .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--teal); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 13px 0; border-bottom: 1px dashed var(--line); }
.switch-row:last-child { border-bottom: 0; }
.switch-row strong { display: block; font-size: 13px; font-weight: 600; }
.switch-row p { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ---------- Callouts / empty ---------- */
.callout {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 12px 14px; border-radius: 12px;
  background: #f3f7f5; border: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-soft); line-height: 1.6;
}
.callout svg { flex: none; margin-top: 2px; }
.callout.info { background: var(--blue-soft); border-color: #dbe3ff; color: #33427a; }
.callout.warn { background: var(--amber-soft); border-color: #f3ddba; color: #7c4b0d; }
.callout.good { background: var(--teal-soft); border-color: #cbe7e1; color: var(--teal-ink); }
.callout.danger { background: var(--red-soft); border-color: #f3cccc; color: #8a1c1c; }
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 56px 20px; text-align: center; color: var(--muted);
}
.empty-icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: #eef3f0; color: var(--teal); margin-bottom: 4px; }
.empty-state strong { color: var(--ink); font-size: 14px; }
.empty-state p { font-size: 12.5px; max-width: 320px; }

/* ---------- Dashboard ---------- */
.dash-hero {
  position: relative; overflow: hidden;
  border-radius: 20px;
  padding: 30px 34px;
  color: #eaf6f2;
  background:
    radial-gradient(600px 300px at 88% 20%, rgba(94, 208, 193, 0.24), transparent 60%),
    radial-gradient(400px 300px at 20% 120%, rgba(217, 119, 6, 0.16), transparent 60%),
    linear-gradient(120deg, #122a26 0%, #0e211e 55%, #12332d 100%);
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; justify-content: space-between; gap: 30px;
  margin-bottom: 20px;
}
.dash-hero::after {
  content: "文"; position: absolute; right: 24px; bottom: -46px;
  font-family: var(--serif); font-size: 190px; line-height: 1;
  color: rgba(255,255,255,0.035); pointer-events: none;
}
.hero-copy { position: relative; z-index: 1; max-width: 640px; }
.hero-copy .eyebrow { color: #74d7c8; }
.hero-copy h2 { font-size: 26px; margin-top: 8px; letter-spacing: .01em; color: #f5fbf8; font-weight: 650; }
.hero-copy p { margin-top: 8px; color: #a9c6bf; font-size: 13px; line-height: 1.7; }
.hero-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.hero-actions .btn-primary { background: #19a394; border-color: #19a394; box-shadow: 0 10px 24px -14px #2dd4bf; }
.hero-actions .btn-primary:hover { background: #21b3a2; }
.hero-actions .btn { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.18); color: #eaf6f2; }
.hero-actions .btn:hover { background: rgba(255,255,255,0.14); }
.hero-art { position: relative; z-index: 1; display: flex; gap: 12px; }
.hero-stat {
  width: 112px; padding: 13px 14px; border-radius: 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(6px);
}
.hero-stat b { display: block; font-size: 24px; color: #fff; line-height: 1.2; }
.hero-stat span { font-size: 10.5px; color: #9cbcb5; letter-spacing: .04em; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 17px; display: flex; gap: 13px; align-items: flex-start;
  box-shadow: var(--shadow-sm);
}
.stat-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--teal-soft); color: var(--teal); }
.stat-icon.amber { background: var(--amber-soft); color: var(--amber); }
.stat-icon.blue { background: var(--blue-soft); color: var(--blue); }
.stat-icon.red { background: var(--red-soft); color: var(--red); }
.stat-label { font-size: 11.5px; color: var(--muted); }
.stat-value { font-size: 23px; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; }
.stat-value small { font-size: 11px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.stat-foot { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.quick-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.quick-card {
  display: flex; gap: 13px; align-items: center;
  padding: 14px; border-radius: 12px; border: 1px solid var(--line);
  background: #fbfcfb; transition: .16s ease;
}
.quick-card:hover { border-color: #b9d8d2; background: #f6fbf9; transform: translateY(-1px); }
.quick-icon { width: 40px; height: 40px; border-radius: 11px; background: var(--teal-soft); display: grid; place-items: center; color: var(--teal); flex: none; }
.quick-icon.blue { background: var(--blue-soft); color: var(--blue); }
.quick-card strong { display: block; font-size: 13px; }
.quick-card span { font-size: 11.5px; color: var(--muted); }
.quick-card .arrow { margin-left: auto; color: var(--muted); }
.trend-chart { display: flex; align-items: flex-end; gap: 12px; height: 140px; padding: 10px 2px 0; }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.trend-bar { width: 100%; max-width: 34px; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, #38a99b, #0f766e); min-height: 3px; position: relative; transition: .2s; }
.trend-col:hover .trend-bar { filter: brightness(1.1); }
.trend-bar span { position: absolute; top: -19px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--muted); }
.trend-label { font-size: 10px; color: var(--muted); }
.tip-list { display: flex; flex-direction: column; gap: 12px; }
.tip-item { display: flex; gap: 10px; font-size: 12px; color: var(--ink-soft); line-height: 1.6; }
.tip-num { width: 21px; height: 21px; border-radius: 7px; background: var(--teal-soft); color: var(--teal-ink); font-size: 10.5px; font-weight: 700; display: grid; place-items: center; flex: none; margin-top: 1px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--line); }
.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 620px; background: #fff; }
.data-table th {
  text-align: left; font-weight: 600; font-size: 11px; color: var(--muted);
  letter-spacing: .04em; padding: 10px 14px; background: #f8faf8;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.data-table td { padding: 11px 14px; border-bottom: 1px solid #eef2ef; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .12s; }
.data-table tbody tr:hover { background: #fafcfb; }
.data-table tbody tr.clickable { cursor: pointer; }
.cell-title { font-weight: 600; color: var(--ink); }
.cell-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
.cell-score { font-weight: 700; font-size: 15px; }
.cell-score small { font-size: 10px; font-weight: 400; color: var(--muted); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.table-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 4px 0; font-size: 12px; color: var(--muted); }
.filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.search-box { position: relative; flex: 1; min-width: 200px; max-width: 340px; }
.search-box svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box .input { padding-left: 34px; }
.filters .select { width: auto; min-width: 120px; }

/* ---------- Stepper / grade flow ---------- */
.stepper { display: flex; align-items: center; gap: 0; margin-bottom: 22px; }
.step { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12.5px; }
.step-num {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid var(--line-strong); background: #fff; font-size: 11px; font-weight: 700;
}
.step.active { color: var(--teal-ink); font-weight: 600; }
.step.active .step-num { background: var(--teal); border-color: var(--teal); color: #fff; }
.step.done { color: var(--teal); }
.step.done .step-num { background: var(--teal-soft); border-color: #9fd2ca; color: var(--teal); }
.step-line { width: 56px; height: 1px; background: var(--line-strong); margin: 0 12px; }
.grade-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.grade-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 84px; }
.subject-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.subject-tile {
  display: flex; align-items: center; gap: 13px; text-align: left;
  padding: 15px 16px; border-radius: 13px; border: 1.5px solid var(--line);
  background: #fff; transition: .16s ease;
}
.subject-tile:hover { border-color: #b9d8d2; }
.subject-tile.active { border-color: var(--teal); background: #f5fbf9; box-shadow: 0 0 0 3px rgba(15,118,110,.08); }
.subject-tile .subject-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal); flex: none; }
.subject-tile.english .subject-icon { background: var(--blue-soft); color: var(--blue); }
.subject-tile strong { display: block; font-size: 14px; }
.subject-tile span { font-size: 11.5px; color: var(--muted); }
.subject-tile .check { margin-left: auto; opacity: 0; color: var(--teal); }
.subject-tile.active .check { opacity: 1; }
.form-card { padding: 20px; }
.form-section + .form-section { margin-top: 20px; padding-top: 18px; border-top: 1px dashed var(--line); }
.form-section-title { font-size: 13px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.form-section-title svg { color: var(--teal); }
.dropzone {
  border: 1.5px dashed #c4d2cc; border-radius: 13px; background: #fafcfb;
  padding: 26px 18px; text-align: center; cursor: pointer; transition: .16s ease;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--teal); background: #f4fbf9; }
.dropzone-icon { width: 46px; height: 46px; border-radius: 14px; background: var(--teal-soft); color: var(--teal); display: grid; place-items: center; margin: 0 auto 10px; }
.dropzone strong { display: block; font-size: 13.5px; }
.dropzone p { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.dropzone .mini { font-size: 10.5px; color: #9aa6a1; margin-top: 8px; }
.thumb-grid { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.thumb { position: relative; width: 82px; height: 104px; border-radius: 9px; overflow: hidden; border: 1px solid var(--line); background: #eef2ef; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-remove {
  position: absolute; top: 4px; right: 4px; width: 20px; height: 20px;
  border: 0; border-radius: 50%; background: rgba(15,31,29,.72); color: #fff;
  display: grid; place-items: center; font-size: 12px; line-height: 1;
}
.thumb-remove:hover { background: var(--red); }
.thumb-tag { position: absolute; bottom: 0; left: 0; right: 0; padding: 3px 5px; font-size: 9px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.55)); }
.or-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0 12px; color: var(--muted); font-size: 11px; }
.or-divider::before, .or-divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.review-layout { display: grid; grid-template-columns: 330px minmax(0,1fr); gap: 18px; align-items: start; }
.review-images { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 10px; }
.review-image { border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.review-image img { display: block; width: 100%; }
.review-image-meta { padding: 7px 10px; font-size: 10.5px; color: var(--muted); display: flex; justify-content: space-between; }
.review-editor .textarea { min-height: 430px; font-size: 14px; line-height: 1.9; padding: 16px; }
.review-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.mini-stats { display: flex; gap: 16px; color: var(--muted); font-size: 11.5px; }
.mini-stats b { color: var(--ink); font-size: 13px; }
.step-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; }
.step-actions .right { display: flex; gap: 9px; margin-left: auto; }
.form-summary { display: flex; flex-wrap: wrap; gap: 7px; }
.form-summary .chip { background: #f4f7f5; }

/* ---------- Progress overlay ---------- */
.progress-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(12, 25, 23, 0.56); backdrop-filter: blur(5px);
  display: grid; place-items: center; padding: 20px;
}
.progress-card {
  width: min(430px, 100%); background: #fff; border-radius: 18px;
  padding: 28px; box-shadow: var(--shadow-lg); text-align: center;
}
.progress-orb {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 16px;
  display: grid; place-items: center; color: var(--teal);
  background: var(--teal-soft); animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(15,118,110,.18);} 50% { transform: scale(1.05); box-shadow: 0 0 0 12px rgba(15,118,110,0);} }
.progress-card h3 { font-size: 16px; }
.progress-card > p { color: var(--muted); font-size: 12px; margin-top: 4px; }
.progress-steps { display: flex; flex-direction: column; gap: 9px; text-align: left; margin: 20px 0 4px; }
.progress-step { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.progress-step .p-dot { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; flex: none; font-size: 9px; }
.progress-step.active { color: var(--ink); font-weight: 600; }
.progress-step.active .p-dot { border-color: var(--teal); color: var(--teal); background: var(--teal-soft); }
.progress-step.done { color: var(--teal); }
.progress-step.done .p-dot { border-color: var(--teal); background: var(--teal); color: #fff; }

/* ---------- Report ---------- */
.report-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  max-width: 960px; margin: 0 auto 16px; flex-wrap: wrap;
}
.report-toolbar-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.report-toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.report-paper {
  max-width: 960px; margin: 0 auto; background: #fff;
  border: 1px solid #e7e4db; border-radius: 3px;
  box-shadow: 0 30px 70px -45px rgba(30, 35, 30, 0.45), 0 2px 5px rgba(0,0,0,.04);
  padding: 44px 50px 34px;
  position: relative;
}
.report-paper::before {
  content: ""; position: absolute; inset: 12px; border: 1px solid #efece3; pointer-events: none;
}
.paper-head { text-align: center; padding-bottom: 20px; border-bottom: 2px solid var(--ink); position: relative; }
.paper-kicker { font-size: 10px; letter-spacing: .32em; color: var(--teal); font-weight: 700; }
.paper-title { font-family: var(--serif); font-size: 27px; font-weight: 700; margin-top: 7px; letter-spacing: .04em; }
.paper-school { font-size: 11.5px; color: var(--muted); margin-top: 7px; letter-spacing: .08em; }
.paper-info {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  margin: 20px 0 0; border: 1px solid var(--line);
}
.paper-info div { padding: 9px 12px; border-right: 1px solid var(--line); }
.paper-info div:last-child { border-right: 0; }
.paper-info span { display: block; font-size: 9.5px; color: var(--muted); letter-spacing: .06em; }
.paper-info strong { display: block; font-size: 12.5px; margin-top: 1px; font-weight: 600; }
.paper-score-row { display: grid; grid-template-columns: 180px minmax(0,1fr); gap: 26px; margin-top: 22px; align-items: stretch; }
.paper-score {
  border: 1px solid var(--line); border-radius: 4px; padding: 18px 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  background: #fbfcfa;
}
.paper-score .value { font-family: var(--serif); font-size: 54px; line-height: 1; font-weight: 700; color: var(--teal-deep); }
.paper-score .value small { font-size: 14px; color: var(--muted); font-weight: 400; }
.paper-score .band { margin-top: 6px; font-size: 12.5px; font-weight: 600; color: var(--amber); }
.paper-score .conf { margin-top: 3px; font-size: 10px; color: var(--muted); }
.paper-bars { display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.paper-bar-row { display: grid; grid-template-columns: 92px minmax(0,1fr) 52px; gap: 10px; align-items: center; font-size: 11px; }
.paper-bar-row .name { color: var(--ink-soft); }
.paper-bar-row .track { display: block; height: 7px; border-radius: 999px; background: #edf1ee; overflow: hidden; }
.paper-bar-row .fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #38a99b, #0f766e); }
.paper-bar-row .score { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.paper-bar-row .score b { color: var(--ink); }
.paper-section { margin-top: 24px; }
.paper-section-title {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--serif); font-size: 15px; font-weight: 700; letter-spacing: .06em;
  padding-bottom: 7px; border-bottom: 1px solid var(--line); margin-bottom: 11px;
}
.paper-section-title::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: var(--teal); }
.paper-section-title .en { font-family: var(--sans); font-size: 9px; letter-spacing: .14em; color: #a4afaa; font-weight: 500; }
.paper-text { font-family: var(--serif); font-size: 13px; line-height: 1.95; color: #2a3532; text-align: justify; }
.paper-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.paper-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 7px; }
.paper-list li { position: relative; padding-left: 19px; font-size: 12px; line-height: 1.7; color: var(--ink-soft); }
.paper-list li::before { content: ""; position: absolute; left: 0; top: 7px; width: 8px; height: 8px; border-radius: 2px; background: var(--teal-soft); border: 1px solid #9fd2ca; }
.paper-list.amber li::before { background: var(--amber-soft); border-color: #e7c48f; }
.paper-list.numbered { counter-reset: item; }
.paper-list.numbered li { padding-left: 22px; }
.paper-list.numbered li::before { counter-increment: item; content: counter(item); width: 16px; height: 16px; border-radius: 50%; background: var(--teal); border: 0; color: #fff; font-size: 9px; display: grid; place-items: center; top: 3px; }
.paper-list.numbered li::before { content: counter(item); }
.paper-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.paper-table th { text-align: left; font-size: 9.5px; letter-spacing: .08em; color: var(--muted); font-weight: 600; padding: 7px 9px; border-bottom: 1px solid var(--line-strong); background: #fafbf9; }
.paper-table td { padding: 8px 9px; border-bottom: 1px solid #eef1ed; vertical-align: top; line-height: 1.65; }
.paper-table tr:last-child td { border-bottom: 0; }
.paper-table .part { font-weight: 600; white-space: nowrap; }
.paper-table .bad-type { color: var(--amber); font-weight: 600; white-space: nowrap; }
.paper-table .bad-original { color: var(--red); }
.paper-table .bad-suggestion { color: var(--teal-deep); }
.issue-empty { font-size: 12px; color: var(--muted); padding: 8px 0; }
.quote-list { display: flex; flex-direction: column; gap: 6px; }
.quote { font-family: var(--serif); font-size: 12px; line-height: 1.7; color: var(--ink-soft); padding: 7px 11px; background: #f8faf7; border-left: 3px solid #b9d8d2; }
.teacher-box {
  margin-top: 8px; border: 1px solid var(--line); border-radius: 4px; padding: 13px 15px;
  background: #fbfcfa; min-height: 76px; font-family: var(--serif); font-size: 12.5px; line-height: 1.9;
}
.teacher-box .empty-note { color: var(--muted); font-family: var(--sans); font-size: 11px; }
.paper-sign { display: flex; justify-content: space-between; margin-top: 24px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.paper-footer { margin-top: 22px; text-align: center; font-size: 9px; color: #a4afaa; letter-spacing: .04em; }
.paper-source-images { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.paper-source-images figure { margin: 0; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; background: #f7f8f5; }
.paper-source-images img { display: block; width: 100%; }
.paper-source-images figcaption { padding: 5px 8px; font-size: 9.5px; color: var(--muted); display: flex; justify-content: space-between; }
.report-side-actions { display: flex; flex-direction: column; gap: 10px; }
.report-topline { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.report-badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.edit-inline { border: 0; background: none; color: var(--teal); font-size: 11px; padding: 0; }
.edit-inline:hover { text-decoration: underline; }
.teacher-note-editor { width: 100%; min-height: 90px; font-family: var(--serif); font-size: 12.5px; border: 1px solid var(--line-strong); border-radius: 4px; padding: 10px 12px; background: #fff; }

/* ---------- Annotator ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(12, 25, 23, 0.58); backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 18px;
}
.modal-card {
  width: min(1080px, 100%); max-height: 92vh; background: #fff;
  border-radius: 17px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden;
}
.modal-card.small { width: min(540px, 100%); }
.modal-card.medium { width: min(720px, 100%); }
.modal-head { padding: 17px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.modal-head h3 { font-size: 16px; font-weight: 700; }
.modal-head p { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.modal-close { border: 0; background: #f3f6f4; color: var(--ink-soft); width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.modal-close:hover { background: #e9eeeb; }
.modal-body { padding: 20px; overflow: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 9px; background: #fbfcfb; }
.annotate-layout { display: grid; grid-template-columns: minmax(0,1fr) 220px; gap: 16px; align-items: start; }
.annotate-stage { background: #eef1ed; border-radius: 12px; padding: 12px; display: flex; justify-content: center; overflow: auto; max-height: 68vh; }
.canvas-wrap { position: relative; display: inline-block; line-height: 0; box-shadow: 0 4px 20px rgba(0,0,0,.1); }
.canvas-wrap img { display: block; max-width: 100%; max-height: 62vh; width: auto; height: auto; }
.canvas-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.tool-panel { display: flex; flex-direction: column; gap: 14px; }
.tool-group { display: flex; flex-direction: column; gap: 6px; }
.tool-label { font-size: 10.5px; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; font-weight: 600; }
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tool-btn {
  display: flex; align-items: center; gap: 7px; padding: 8px 9px;
  border-radius: 8px; border: 1px solid var(--line); background: #fff;
  font-size: 11.5px; color: var(--ink-soft);
}
.tool-btn:hover { border-color: #b9d8d2; background: var(--teal-soft); }
.tool-btn.active { border-color: var(--teal); background: var(--teal-soft); color: var(--teal-ink); font-weight: 600; }
.tool-btn.full { grid-column: 1 / -1; justify-content: center; }
.color-row { display: flex; gap: 7px; }
.color-dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-strong); }
.color-dot.active { box-shadow: 0 0 0 2px var(--teal); }
.annotate-note { font-size: 11px; color: var(--muted); line-height: 1.6; background: #f6f8f5; padding: 10px; border-radius: 8px; }

/* ---------- Modal forms ---------- */
.form-grid { display: grid; gap: 14px; }
.modal-note { font-size: 11.5px; color: var(--muted); }

/* ---------- Records / samples / roster / settings ---------- */
.record-list { display: flex; flex-direction: column; gap: 10px; }
.samples-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.sample-card { padding: 17px; display: flex; flex-direction: column; gap: 9px; height: 100%; }
.sample-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sample-title { font-size: 13.5px; font-weight: 700; line-height: 1.4; }
.sample-excerpt {
  font-size: 11.5px; color: var(--ink-soft); line-height: 1.7;
  font-family: var(--serif); background: #fafbf9; padding: 9px 11px; border-radius: 8px;
  flex: 1; min-height: 0; overflow: hidden;
}
.sample-excerpt-text {
  display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden;
}
.sample-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sample-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px dashed var(--line); padding-top: 9px; margin-top: 2px; }
.roster-grid { display: grid; grid-template-columns: minmax(300px, .85fr) minmax(0, 1.15fr); gap: 16px; align-items: start; }
.roster-list { display: flex; flex-direction: column; }
.roster-item { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.roster-item:last-child { border-bottom: 0; }
.roster-avatar { width: 33px; height: 33px; border-radius: 10px; background: #f0f4f1; color: var(--teal); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.roster-name { font-size: 13px; font-weight: 600; }
.roster-sub { font-size: 10.5px; color: var(--muted); }
.roster-stat { margin-left: auto; text-align: right; font-size: 10.5px; color: var(--muted); }
.roster-stat b { display: block; font-size: 14px; color: var(--ink); }
.inline-form { display: flex; gap: 8px; margin-bottom: 12px; }
.inline-form .input { flex: 1; }
.settings-layout { max-width: 980px; display: flex; flex-direction: column; gap: 16px; }
.settings-card { padding: 20px 22px; }
.settings-section-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.settings-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--teal-soft); color: var(--teal); display: grid; place-items: center; flex: none; }
.settings-section-head h3 { font-size: 14.5px; font-weight: 700; }
.settings-section-head p { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.settings-grid .full { grid-column: 1 / -1; }
.mode-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.mode-option { border: 1.5px solid var(--line); border-radius: 12px; padding: 14px; background: #fbfcfb; text-align: left; transition: .16s; }
.mode-option:hover { border-color: #b9d8d2; }
.mode-option.active { border-color: var(--teal); background: #f5fbf9; box-shadow: 0 0 0 3px rgba(15,118,110,.07); }
.mode-option strong { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.mode-option p { font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.55; }
.mode-option .mode-badge { margin-left: auto; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; padding: 3px 8px; border-radius: 999px; background: #f1f4f2; color: var(--muted); }
.status-pill.ok { background: var(--teal-soft); color: var(--teal-ink); }
.status-pill.warn { background: var(--amber-soft); color: var(--amber); }
.rubric-preview { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.rubric-mini { border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; background: #fbfcfb; }
.rubric-mini strong { font-size: 12px; display: flex; justify-content: space-between; }
.rubric-mini span { font-size: 10.5px; color: var(--muted); line-height: 1.55; display: block; margin-top: 3px; }
.settings-actions { display: flex; align-items: center; gap: 10px; justify-content: flex-end; padding: 4px 0 30px; }

/* ---------- Toasts / misc ---------- */
.toast-root { position: fixed; z-index: 100; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 9px; pointer-events: none; }
.toast {
  min-width: 240px; max-width: 380px; padding: 11px 14px;
  border-radius: 11px; background: #15302b; color: #eaf6f2;
  box-shadow: var(--shadow-lg); font-size: 12.5px; line-height: 1.55;
  display: flex; gap: 9px; align-items: flex-start;
  animation: toastIn .22s ease; pointer-events: auto;
}
.toast.success { background: #0f5f57; }
.toast.error { background: #7f1d1d; }
.toast.warn { background: #7c4a12; }
.toast svg { flex: none; margin-top: 1px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.spinner {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(15,118,110,.2); border-top-color: var(--teal);
  display: inline-block; animation: spin .8s linear infinite; vertical-align: -2px;
}
.spinner.white { border-color: rgba(255,255,255,.3); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }
.print-only { display: none; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.dot-sep::before { content: "·"; margin: 0 6px; color: #b5beb9; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .samples-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .hero-art { display: none; }
  .grade-layout { grid-template-columns: minmax(0,1fr) 290px; }
  .report-paper { padding: 36px 38px 30px; }
}
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; width: 260px; }
  .sidebar.open { transform: none; box-shadow: 30px 0 60px rgba(0,0,0,.2); }
  .app-main { margin-left: 0; }
  .menu-btn { display: grid !important; }
  .view { padding: 20px 18px 60px; }
  .topbar { padding: 0 16px; }
  .dashboard-grid, .grade-layout, .review-layout, .roster-grid { grid-template-columns: 1fr; }
  .grade-side, .review-images { position: static; }
  .review-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .report-paper { padding: 28px 24px; }
  .paper-info { grid-template-columns: repeat(2, 1fr); }
  .paper-info div:nth-child(2) { border-right: 0; }
  .paper-info div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .paper-score-row { grid-template-columns: 1fr; }
  .paper-score { padding: 14px; }
  .paper-score .value { font-size: 44px; }
  .annotate-layout { grid-template-columns: 1fr; }
  .tool-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 680px) {
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 13px; gap: 10px; }
  .stat-value { font-size: 19px; }
  .dash-hero { padding: 22px; }
  .hero-copy h2 { font-size: 21px; }
  .grid-2, .grid-3, .grid-4, .subject-switch, .field-row, .field-row-3, .mode-options, .settings-grid, .rubric-preview, .paper-two-col, .samples-grid { grid-template-columns: 1fr; }
  .paper-head .paper-title { font-size: 21px; }
  .paper-info { grid-template-columns: 1fr 1fr; }
  .paper-bars { gap: 7px; }
  .paper-bar-row { grid-template-columns: 76px minmax(0,1fr) 46px; }
  .paper-table { font-size: 10.5px; }
  .page-head h1 { font-size: 21px; }
  .page-actions { width: 100%; }
  .report-toolbar-right { width: 100%; }
  .report-toolbar-right .btn { flex: 1; }
  .step-line { width: 24px; margin: 0 6px; }
  .step span:not(.step-num) { display: none; }
  .toast-root { left: 14px; right: 14px; bottom: 14px; }
  .toast { max-width: none; }
  .modal-body { padding: 15px; }
  .annotate-layout { gap: 10px; }
  .tool-grid { grid-template-columns: 1fr 1fr; }
  .inline-form { flex-direction: column; }
  .paper-source-images { grid-template-columns: 1fr; }
}

/* ---------- Print ---------- */
@page { size: A4; margin: 12mm 11mm 12mm; }
@media print {
  html, body { background: #fff !important; font-size: 10.5pt; }
  .sidebar, .topbar, .report-toolbar, .no-print, .toast-root, .modal-backdrop, .progress-overlay, #overlay-root, #modal-root, #toast-root { display: none !important; }
  .app-main { margin-left: 0 !important; }
  .view { padding: 0 !important; max-width: none !important; }
  .report-paper { max-width: none; width: 100%; border: 0; box-shadow: none; padding: 0; margin: 0; }
  .report-paper::before { display: none; }
  .paper-section { break-inside: avoid; }
  .paper-table tr, .paper-score-row, .paper-two-col { break-inside: avoid; }
  .paper-source-images { break-before: page; }
  .paper-footer { margin-top: 14px; }
  .print-only { display: block; }
  a { text-decoration: none; }
  .paper-score .value { color: #0b5c55 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .paper-bar-row .fill { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .chip, .paper-section-title::before { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
/* ---------- Auth / multi-teacher ---------- */
.auth-root { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 0.95fr; background: var(--paper); }
.auth-brand-pane {
  position: relative; overflow: hidden; padding: 54px 58px; color: #eaf6f2;
  background:
    radial-gradient(700px 500px at 80% 10%, rgba(45, 212, 191, 0.2), transparent 60%),
    radial-gradient(500px 400px at 10% 100%, rgba(217, 119, 6, 0.14), transparent 60%),
    linear-gradient(150deg, #102622, #0b1816 70%);
  display: flex; flex-direction: column; justify-content: space-between;
}
.auth-brand-pane::after {
  content: "文"; position: absolute; right: -20px; bottom: -70px;
  font-family: var(--serif); font-size: 280px; line-height: 1;
  color: rgba(255,255,255,0.035); pointer-events: none;
}
.auth-brand-pane .brand { padding: 0; position: relative; z-index: 1; }
.auth-pitch { position: relative; z-index: 1; max-width: 480px; }
.auth-pitch h1 { font-family: var(--serif); font-size: 42px; line-height: 1.28; letter-spacing: .02em; color: #f7fbf9; font-weight: 700; }
.auth-pitch h1 em { font-style: normal; color: #62d3c3; }
.auth-pitch p { margin-top: 18px; color: #9fbcb5; font-size: 14px; line-height: 1.9; }
.auth-points { margin-top: 28px; display: flex; flex-direction: column; gap: 13px; }
.auth-point { display: flex; gap: 11px; align-items: flex-start; font-size: 12.5px; color: #b9d1cb; }
.auth-point span:first-child { width: 22px; height: 22px; border-radius: 7px; background: rgba(45,212,191,.14); color: #6ee0d1; display: grid; place-items: center; font-size: 10px; flex: none; margin-top: 1px; }
.auth-foot { position: relative; z-index: 1; font-size: 10.5px; color: #5f7f78; letter-spacing: .05em; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 28px; }
.auth-card {
  width: min(420px, 100%); background: #fff; border: 1px solid var(--line);
  border-radius: 20px; padding: 34px 32px 28px; box-shadow: var(--shadow-lg);
}
.auth-kicker { font-size: 10.5px; letter-spacing: .18em; color: var(--teal); font-weight: 700; }
.auth-card h2 { font-size: 23px; margin-top: 8px; letter-spacing: -.01em; }
.auth-card > p { color: var(--muted); font-size: 12.5px; margin-top: 5px; line-height: 1.7; }
.auth-form { display: flex; flex-direction: column; gap: 14px; margin-top: 22px; }
.auth-submit { width: 100%; margin-top: 4px; }
.auth-switch { margin-top: 16px; font-size: 12px; color: var(--muted); text-align: center; }
.auth-switch button { border: 0; background: none; color: var(--teal); font-weight: 600; padding: 0; }
.auth-divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 10.5px; margin: 4px 0; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-error { display: none; padding: 9px 12px; border-radius: 9px; background: var(--red-soft); color: var(--red); font-size: 12px; line-height: 1.6; }
.auth-error.show { display: block; }

.user-card { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 12px; background: rgba(255,255,255,0.045); border: 1px solid rgba(255,255,255,0.07); }
.user-avatar { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, #1c8f82, #0b5c55); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.user-info { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.user-info strong { font-size: 12.5px; color: #eaf6f2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-info span { font-size: 10px; color: #7e9d96; margin-top: 2px; }
.user-logout { margin-left: auto; border: 1px solid rgba(255,255,255,.12); background: transparent; color: #8daaa3; border-radius: 7px; padding: 4px 7px; font-size: 10px; }
.user-logout:hover { color: #ffb4b4; border-color: rgba(255,120,120,.35); background: rgba(255,90,90,.08); }

/* ---------- Batch workflow ---------- */
.batch-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.batch-side { display: flex; flex-direction: column; gap: 14px; }
.batch-drop { border: 1.5px dashed #c4d2cc; border-radius: 13px; background: #fafcfb; padding: 22px; text-align: center; cursor: pointer; }
.batch-drop:hover, .batch-drop.dragover { border-color: var(--teal); background: #f4fbf9; }
.batch-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.batch-row { display: grid; grid-template-columns: 46px minmax(0,1fr) 160px 30px; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfb; }
.batch-row img { width: 46px; height: 60px; object-fit: cover; border-radius: 6px; background: #eef2ef; }
.batch-row-name { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.batch-row-sub { font-size: 10px; color: var(--muted); margin-top: 2px; }
.batch-row select { padding: 6px 8px; font-size: 11.5px; }
.batch-row .action-icon { width: 26px; height: 26px; }
.batch-summary { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 11px 13px; border-radius: 11px; background: var(--teal-soft); color: var(--teal-ink); font-size: 12px; }
.batch-progress { height: 8px; border-radius: 999px; background: #e7eeea; overflow: hidden; }
.batch-progress > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg,#38a99b,#0f766e); transition: width .3s ease; }
.batch-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.batch-stat { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fbfcfb; }
.batch-stat span { display: block; font-size: 10.5px; color: var(--muted); }
.batch-stat b { font-size: 19px; }
.batch-table .err { color: var(--red); font-size: 10.5px; max-width: 280px; }
.batch-empty { padding: 30px 18px; text-align: center; color: var(--muted); font-size: 12px; }

/* ---------- Admin ---------- */
.admin-summary { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 16px; }
.admin-card { padding: 16px 18px; border-radius: 13px; background: #fff; border: 1px solid var(--line); }
.admin-card span { font-size: 11px; color: var(--muted); }
.admin-card b { display: block; font-size: 25px; margin-top: 3px; }
.admin-table .role-admin { color: var(--teal); font-weight: 600; }
.admin-table .muted-small { font-size: 10.5px; color: var(--muted); }
.status-pill.queued { background: #eef2ff; color: var(--blue); }
.status-pill.processing { background: var(--amber-soft); color: var(--amber); }
.status-pill.completed { background: var(--teal-soft); color: var(--teal-ink); }
.status-pill.partial { background: var(--red-soft); color: var(--red); }

@media (max-width: 960px) {
  .auth-root { grid-template-columns: 1fr; }
  .auth-brand-pane { display: none; }
  .auth-main { min-height: 100vh; }
  .batch-layout { grid-template-columns: 1fr; }
  .batch-side { position: static; }
  .admin-summary { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 680px) {
  .batch-row { grid-template-columns: 40px minmax(0,1fr) 1fr 26px; }
  .batch-row img { width: 40px; height: 52px; }
  .batch-stat-grid { grid-template-columns: 1fr 1fr; }
  .auth-card { padding: 26px 22px; }
  .auth-pitch h1 { font-size: 32px; }
}
.status.failed { color: var(--red); }
.status.failed::before { background: var(--red); }
.status.queued { color: var(--blue); }
.status.queued::before { background: var(--blue); }
.status.processing { color: var(--amber); }
.status.processing::before { background: var(--amber); }
.status-pill.graded { background: var(--teal-soft); color: var(--teal-ink); }
.report-paper.pending::after {
  content: "待教师复核";
  position: absolute; left: 50%; top: 44%;
  transform: translate(-50%, -50%) rotate(-24deg);
  font-family: var(--serif); font-size: 118px; font-weight: 700;
  letter-spacing: .08em; color: rgba(185, 28, 28, 0.075);
  white-space: nowrap; pointer-events: none; z-index: 2;
}
.report-paper.pending { position: relative; }
/* ---------- Capture station ---------- */
.capture-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: 18px; align-items: start; }
.capture-stage { position: relative; border-radius: 14px; overflow: hidden; background: #0d1917; aspect-ratio: 4 / 3; display: grid; place-items: center; }
.capture-stage video, .capture-stage canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.capture-placeholder { color: #8aa39c; text-align: center; padding: 30px; }
.capture-placeholder strong { display: block; color: #d9e8e4; font-size: 14px; margin-top: 10px; }
.capture-placeholder p { font-size: 11px; margin-top: 5px; line-height: 1.6; }
.capture-toolbar { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 12px; }
.capture-status { margin-top: 10px; font-size: 11.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 10px; }
.capture-queue { display: flex; flex-direction: column; gap: 6px; max-height: 420px; overflow: auto; margin-top: 10px; }
.capture-student { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line); background: #fbfcfb; cursor: pointer; }
.capture-student.active { border-color: var(--teal); background: var(--teal-soft); }
.capture-student.done { opacity: .72; }
.capture-student .avatar-mini { width: 26px; height: 26px; border-radius: 8px; background: #eef3f0; display: grid; place-items: center; font-size: 10px; font-weight: 700; color: var(--teal); flex: none; }
.capture-student .name { font-size: 12.5px; font-weight: 600; }
.capture-student .pages { margin-left: auto; font-size: 10.5px; color: var(--muted); }
.capture-thumbs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.capture-thumbs img { width: 58px; height: 74px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.capture-current { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 11px; background: #f6faf8; border: 1px solid var(--line); margin-bottom: 8px; }
.capture-current strong { font-size: 15px; }
.capture-current span { font-size: 11px; color: var(--muted); }
@media (max-width: 960px) { .capture-layout { grid-template-columns: 1fr; } .capture-stage { aspect-ratio: 3 / 4; } }
/* ---------- Scan correction ---------- */
.scan-layout { display: grid; grid-template-columns: minmax(0,1fr) 280px; gap: 18px; align-items: start; }
.scan-stage { background: #eef1ed; border-radius: 12px; padding: 12px; display: flex; justify-content: center; max-height: 70vh; overflow: auto; }
.scan-canvas-wrap { position: relative; display: inline-block; line-height: 0; max-width: 100%; }
.scan-canvas-wrap img { display: block; max-width: 100%; max-height: 66vh; width: auto; height: auto; }
.scan-canvas-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.scan-panel { display: flex; flex-direction: column; gap: 12px; }
.scan-status { font-size: 11.5px; color: var(--muted); line-height: 1.6; background: #f6f8f5; padding: 9px 11px; border-radius: 9px; }
.scan-switch { display: flex; gap: 8px; align-items: flex-start; font-size: 11.5px; color: var(--ink-soft); }
.scan-switch input { margin-top: 2px; }
.scan-range-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 11px; color: var(--muted); }
.scan-range-row input { flex: 1; }
.scan-tip { font-size: 11px; color: var(--muted); line-height: 1.65; background: #fafbf9; border: 1px solid var(--line); border-radius: 9px; padding: 10px 11px; }
.scan-tip strong { color: var(--ink-soft); }
.scan-tip p { margin-top: 4px; }
@media (max-width: 800px) { .scan-layout { grid-template-columns: 1fr; } .scan-stage { max-height: 48vh; } }
/* ---------- Phone handoff QR ---------- */
.remote-empty { text-align: center; padding: 8px 4px 14px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.remote-empty-icon { width: 44px; height: 44px; border-radius: 13px; background: var(--teal-soft); color: var(--teal); display: grid; place-items: center; margin: 0 auto 8px; }
.remote-empty strong { display: block; color: var(--ink); font-size: 13px; margin-bottom: 3px; }
.remote-empty p { max-width: 260px; margin: 0 auto 12px; }
.remote-body { display: flex; gap: 16px; align-items: flex-start; }
.remote-qr { width: 146px; height: 146px; border-radius: 10px; border: 1px solid var(--line); background: #fff; padding: 5px; flex: none; image-rendering: pixelated; }
.remote-info { min-width: 0; flex: 1; }
.remote-label { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.remote-link { font-size: 10.5px; color: var(--ink-soft); word-break: break-all; background: #f6f8f5; border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; max-height: 46px; overflow: hidden; margin-bottom: 7px; line-height: 1.45; }
.remote-hint { font-size: 10px; color: var(--muted); line-height: 1.55; margin-top: 7px; }
.remote-progress { height: 7px; border-radius: 999px; background: #edf1ee; overflow: hidden; margin-top: 14px; }
.remote-progress > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg,#38a99b,#0f766e); }
.remote-stats { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); margin-top: 6px; }
.remote-thumbs { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.remote-thumbs img { width: 44px; height: 56px; object-fit: cover; border-radius: 5px; border: 1px solid var(--line); }
.remote-actions { display: flex; gap: 7px; margin-top: 12px; flex-wrap: wrap; }
