/* 学员管理系统 V6：唯一的工作台样式表（替换 workspace-demo.css + workspace.css）。
   规格：字重 400 / 500 / 600；字号 12 / 13 / 14 / 16 / 20 / 24；圆角 6 / 10；
   边框只用一种细线。颜色只表达状态：绿=主操作与选中，黄=需要留意，红=紧急。 */
:root {
  color-scheme: light;
  --ink: #1c1b18;
  --ink-2: #57544b;
  --muted: #8b857a;
  --line: #e6dfce;
  --line-strong: #d6ccb6;
  --canvas: #f4efe4;
  --surface: #fdfbf5;
  --soft: #efe9db;
  --brand: #2f5d50;
  --brand-hover: #244a40;
  --brand-soft: #e3ece7;
  --warn: #8a5a12;
  --warn-soft: #f8ecd2;
  --danger: #a63a24;
  --danger-soft: #f6e3dc;
  --r-sm: 6px;
  --r: 10px;
  --fs-xs: 12px; --fs-sm: 13px; --fs: 14px; --fs-md: 16px; --fs-lg: 20px; --fs-xl: 24px;
  /* 宣纸底、墨字、朱砂做警示、松绿做主操作；宋体用系统自带的，不依赖外网字体。 */
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "SimSun", "Songti TC", serif;
}

[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--canvas); color: var(--ink); }
body { font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif; font-size: var(--fs); line-height: 1.6; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
a { color: var(--brand); text-decoration: none; }
h1, h2, h3 { color: var(--ink); font-weight: 600; letter-spacing: 0; }
h2 { font-size: var(--fs-md); }
h3 { font-size: var(--fs); font-weight: 500; }
p { margin: 6px 0; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
:is(a, button, summary, input, select, textarea):focus-visible { outline: 2px solid #6aa38f; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }

/* ---------- 外框：浅色侧栏 + 细顶栏 ---------- */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 212px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 12px 14px; background: #f9f4e8; border-right: 1px solid var(--line); }
.sidebar-scrim { display: none; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; }
.brand-mark { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: #fff; border: 1px solid var(--line); }
.brand-name { font-size: var(--fs-md); font-weight: 600; }
.brand-sub { color: var(--muted); font-size: var(--fs-xs); }
.nav-group { display: grid; gap: 2px; }
.nav-label { padding: 0 10px 6px; color: var(--muted); font-size: var(--fs-xs); }
.nav-button { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 8px 10px; border-radius: var(--r-sm); color: var(--ink-2); font-size: var(--fs); }
.nav-button:hover { background: var(--soft); color: var(--ink); }
.nav-button.active { background: var(--brand-soft); color: var(--brand); font-weight: 500; }
.nav-icon { width: 18px; text-align: center; font-size: 15px; opacity: .8; }
.sidebar-bottom { margin-top: auto; }
.identity-card { padding: 10px; border-top: 1px solid var(--line); }
.identity-name { font-weight: 500; }
.identity-role { color: var(--muted); font-size: var(--fs-xs); }

.workspace { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; padding: 8px 28px; background: rgba(244,239,228,.92); backdrop-filter: blur(8px); }
.topbar-start { display: flex; align-items: center; gap: 10px; }
.crumb { color: var(--muted); font-size: var(--fs-sm); }
.top-actions { display: flex; align-items: center; gap: 4px; }
.top-actions .btn { border-color: transparent; background: transparent; color: var(--ink-2); min-height: 32px; padding: 4px 10px; }
.top-actions .btn:hover { background: var(--soft); }
.top-actions .muted { font-size: var(--fs-xs); margin-right: 6px; }
.mobile-menu { display: none; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; }

.page { max-width: 1240px; margin: 0 auto; padding: 8px 28px 48px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 8px 0 20px; }
.page-head > div:first-child { min-width: 0; }
.page-head h1 { margin: 0; font-size: var(--fs-xl); line-height: 1.3; }
.page-head p { margin: 4px 0 0; color: var(--ink-2); font-size: var(--fs); }
.eyebrow { color: var(--muted); font-size: var(--fs-xs); font-weight: 400; }

/* ---------- 基础零件 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: #fff; color: var(--ink); font-size: var(--fs); font-weight: 400; line-height: 1.3; text-align: center; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.btn:hover { background: var(--soft); }
.btn.primary, .btn.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover, .btn.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--soft); color: var(--ink); }
.btn.danger { border-color: #ecc9c5; background: #fff; color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.active { background: var(--brand-soft); border-color: transparent; color: var(--brand); font-weight: 500; }
.link-button { color: var(--ink); }
.link-button:hover { color: var(--brand); }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.actions-end { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

.card, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.card { padding: 20px; margin-bottom: 16px; }
.card-pad, .panel.card-pad { padding: 20px; }
.card h2, .panel h2 { margin: 0 0 8px; }
.card-pad p { color: var(--ink-2); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.section-head h2 { margin: 0; font-size: var(--fs-md); }
.section-head .muted, .section-head small { font-size: var(--fs-sm); }

.badge { display: inline-flex; align-items: center; width: fit-content; padding: 1px 8px; border-radius: var(--r-sm); background: var(--soft); color: var(--ink-2); font-size: var(--fs-xs); font-weight: 400; line-height: 1.7; white-space: nowrap; }
.badge.medium { background: var(--warn-soft); color: var(--warn); }
.badge.high, .badge.error { background: var(--danger-soft); color: var(--danger); }
.badge.low, .badge.positive { background: var(--brand-soft); color: var(--brand); }
.notice { padding: 10px 14px; border-radius: var(--r-sm); background: var(--warn-soft); color: var(--warn); }
.notice p { margin: 2px 0 0; }
.inline-error { color: var(--danger); }
.empty { display: grid; place-items: center; min-height: 96px; padding: 24px 16px; color: var(--muted); text-align: center; }
.data-freshness { margin: -12px 0 16px; color: var(--muted); font-size: var(--fs-xs); }

.field { display: grid; gap: 4px; min-width: 0; color: var(--ink-2); font-size: var(--fs-sm); font-weight: 400; }
.field + .field { margin-top: 12px; }
.field input, .field select, .field textarea, .filter, .team-filter select, .student-search input {
  width: 100%; min-width: 0; min-height: 36px; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: #fff; color: var(--ink); font-size: var(--fs);
}
.field textarea { min-height: 88px; resize: vertical; }
.field small { color: var(--muted); font-size: var(--fs-xs); line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus, .filter:focus, .student-search input:focus { border-color: var(--brand); outline: 3px solid rgba(15,90,71,.1); }
.field input[type=file]::file-selector-button { margin-right: 10px; padding: 5px 10px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: #fff; color: var(--ink); cursor: pointer; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin: 16px 0; }
.form-grid label { display: grid; gap: 4px; color: var(--ink-2); font-size: var(--fs-sm); }
.form-grid input, .form-grid select { width: 100%; min-height: 36px; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: #fff; }
.choice-list { display: grid; gap: 6px; margin: 12px 0; }
.choice-list label { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer; }
.choice-list label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }

.tabs { display: flex; align-items: center; gap: 20px; margin: 0 0 16px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs .btn { min-height: 38px; padding: 8px 0; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--ink-2); }
.tabs .btn:hover { background: transparent; color: var(--ink); }
.tabs .btn.active { border-bottom-color: var(--ink); background: transparent; color: var(--ink); font-weight: 500; }

/* 通用行：靠细分隔线分行，不再每行一张卡片。 */
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row h3 { margin: 0 0 2px; font-size: var(--fs); font-weight: 500; }
.list-row p { margin: 2px 0; color: var(--ink-2); }
.list-row.selected { background: var(--brand-soft); }
.record { padding: 14px 0; border-bottom: 1px solid var(--line); line-height: 1.7; overflow-wrap: anywhere; }
.record:last-child { border-bottom: 0; }
.record > .muted, .record > small { font-size: var(--fs-xs); }
.record blockquote { margin: 10px 0 0; padding: 8px 12px; border-left: 2px solid var(--line-strong); background: var(--soft); }
.record h3 { margin: 0 0 4px; }
.list-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 16px 0 4px; color: var(--muted); font-size: var(--fs-sm); }

table { width: 100%; border-collapse: collapse; }
.table-wrap { max-width: 100%; overflow-x: auto; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: var(--fs-xs); font-weight: 400; white-space: nowrap; }
td { font-size: var(--fs); }
tr:last-child td { border-bottom: 0; }

dialog { width: min(560px, calc(100vw - 28px)); max-height: calc(100dvh - 40px); overflow-y: auto; padding: 0 20px 20px; border: 1px solid var(--line); border-radius: var(--r); color: var(--ink); box-shadow: 0 20px 60px rgba(20,40,34,.18); }
dialog::backdrop { background: rgba(20,32,28,.32); }
.dialog-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0 12px; background: #fff; }
.dialog-head h2 { margin: 0; font-size: var(--fs-md); }
.dialog-head .btn { border-color: transparent; color: var(--ink-2); }
dialog form > .btn.primary, dialog form > .actions { margin-top: 16px; }
.delete-target { padding: 12px 14px; border-radius: var(--r-sm); background: var(--soft); overflow-wrap: anywhere; }
.delete-target p { margin: 4px 0; }
.grant-list { display: grid; gap: 4px; max-height: 50vh; overflow: auto; margin: 12px 0; }
.grant-list label { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.form-grid + .btn, .form-grid ~ .btn { margin-top: 4px; }

#toast { position: fixed; left: 50%; bottom: 24px; z-index: 90; transform: translateX(-50%); max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: var(--r-sm); background: #24302c; color: #fff; font-size: var(--fs); box-shadow: 0 10px 30px rgba(0,0,0,.18); }
#toast:empty { display: none; }

/* ---------- 今日工作 ---------- */
.work-summary { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; margin: 0 0 20px; }
@media (max-width: 1100px) { .work-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); } .work-summary > div:last-child { grid-column: span 2; } }
.work-summary > div { min-width: 0; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); transition: border-color .15s, background-color .15s; }
.work-summary > div:hover { border-color: var(--ink-2); background: #fff; }
.work-summary a { display: grid; padding: 12px 14px; color: inherit; cursor: pointer; }
.work-summary span, .work-summary small { display: block; }
.work-summary span { font-size: var(--fs-xl); font-weight: 500; line-height: 1.3; font-variant-numeric: tabular-nums; }
.work-summary small { color: var(--muted); font-size: var(--fs-sm); }
.work-summary a:hover small { color: var(--ink); text-decoration: underline; }
.work-layout { display: grid; grid-template-columns: minmax(0, 1fr) 264px; align-items: start; gap: 20px; }
.work-layout > *, .overview-grid > *, .student-overview-grid > * { min-width: 0; }
.work-layout aside .panel { padding: 16px 18px; }
.work-layout aside h2 { margin: 0 0 4px; font-size: var(--fs); }
.work-layout aside > section > p { color: var(--muted); font-size: var(--fs-xs); }
.team-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 8px; color: var(--ink-2); font-size: var(--fs-sm); }
.team-filter select { width: auto; min-height: 32px; padding: 4px 8px; }
.team-filter label { display: flex; align-items: center; gap: 6px; }
.student-avatar { display: none; }
.focus-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 14px 0; }
.focus-row h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; font-size: var(--fs); }
.focus-row h3 a { color: var(--ink); font-weight: 500; }
.focus-row h3 a:hover { color: var(--brand); }
.focus-row h3 a.muted { color: var(--muted); font-size: var(--fs-xs); font-weight: 400; }
.focus-row p { margin: 4px 0 0; color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.6; }
.focus-row small { display: block; margin-top: 2px; color: var(--muted); font-size: var(--fs-xs); }
.row-owner { color: var(--ink-2); }
.task-quote { color: var(--ink-2); }
.task-actions { display: flex; align-items: center; gap: 4px; }
.task-actions .btn { min-height: 32px; padding: 4px 10px; font-size: var(--fs-sm); }
.exam-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.exam-row:last-of-type { border-bottom: 0; }
.exam-row > div { min-width: 0; }
.exam-row strong { font-weight: 500; }
.exam-row p { margin: 2px 0 0; color: var(--muted); font-size: var(--fs-xs); }
.exam-row .btn { min-height: 28px; padding: 2px 8px; font-size: var(--fs-xs); }

/* ---------- 管理总览 ---------- */
.metric-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px; }
@media (max-width: 1100px) { .metric-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.metric-button { display: grid; gap: 2px; min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--muted); text-decoration: none; }
.metric-button:hover { border-color: var(--line-strong); }
.metric-button strong { color: var(--ink); font-size: var(--fs-xl); font-weight: 500; line-height: 1.3; font-variant-numeric: tabular-nums; }
.metric-button span { font-size: var(--fs-sm); }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, .75fr); gap: 16px; align-items: stretch; }
.attention-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.attention-link:last-child { border-bottom: 0; }
.attention-link strong { font-weight: 500; font-variant-numeric: tabular-nums; }
.attention-link:hover span { color: var(--brand); }
.chart-bars { display: flex; align-items: end; gap: clamp(6px, 2vw, 16px); min-height: 180px; padding: 20px 4px 0; border-bottom: 1px solid var(--line); }
.chart-bar { display: grid; grid-template-rows: 20px minmax(2px, 135px) 22px; align-items: end; justify-items: center; flex: 1; min-width: 0; color: var(--muted); text-decoration: none; }
.chart-bar b { color: var(--ink-2); font-size: var(--fs-xs); font-weight: 400; }
.chart-bar i { display: block; width: min(28px, 70%); min-height: 3px; border-radius: 4px 4px 0 0; background: #6ea592; }
.chart-bar:hover i { background: var(--brand); }
.chart-bar span { overflow: hidden; width: 100%; padding-top: 4px; font-size: var(--fs-xs); text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.teachers-panel { margin-top: 16px; }
.practice-ratio { display: grid; gap: 5px; min-width: 104px; }
.practice-ratio i { display: block; width: 100%; height: 4px; overflow: hidden; border-radius: 2px; background: var(--soft); }
.practice-ratio i b { display: block; height: 100%; background: #6ea592; }
.teachers-panel .btn { min-height: 28px; padding: 2px 10px; font-size: var(--fs-sm); }

/* ---------- 学员列表 ---------- */
.students-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 12px; }
.student-search { flex: 1 1 320px; }
.student-search .search-input-wrap { position: relative; display: block; }
.search-input-wrap input { padding-right: 40px; }
#search-clear { position: absolute; top: 2px; right: 2px; bottom: 2px; width: 34px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); font-size: 18px; }
#search-clear:hover { background: var(--soft); }
.filter-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; flex-basis: 100%; }
.filter-tabs .btn { min-height: 30px; padding: 3px 10px; border-color: transparent; background: transparent; color: var(--ink-2); font-size: var(--fs-sm); }
.filter-tabs .btn:hover { background: var(--soft); }
.filter-tabs .btn.active { background: var(--ink); color: #fff; font-weight: 400; }
.student-scope { margin: 0; }
.search-state { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: var(--fs-xs); }
.search-chip { padding: 2px 8px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: #fff; color: var(--ink-2); font-size: var(--fs-xs); cursor: pointer; }
.search-chip span { margin-left: 6px; }
.student-list-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.student-list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.student-list-head h2 { margin: 0; font-size: var(--fs); font-weight: 500; }
.student-list-head > span { color: var(--muted); font-size: var(--fs-xs); }
.student-directory { padding: 0; }
.student-list-row, .directory-clean .student-list-row { display: grid; grid-template-columns: minmax(200px, 1.4fr) minmax(200px, 1fr) minmax(120px, .6fr); align-items: center; gap: 20px; padding: 12px 18px; border-bottom: 1px solid var(--line); cursor: pointer; }
.student-list-row:last-child { border-bottom: 0; }
.student-list-row:hover { background: #fafbfa; }
.student-row-main { min-width: 0; }
.student-row-main h3 { margin: 0; font-size: var(--fs); font-weight: 500; }
.student-row-main p { margin: 1px 0 0; overflow: hidden; color: var(--ink-2); font-size: var(--fs-sm); text-overflow: ellipsis; white-space: nowrap; }
.student-row-main .archive-number { color: var(--muted); font-size: var(--fs-xs); }
.student-row-meta { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 1px 10px; color: var(--muted); font-size: var(--fs-xs); }
.student-row-meta b { min-width: 0; color: var(--ink-2); font-size: var(--fs-sm); font-weight: 400; }
.student-row-status { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; font-size: var(--fs-xs); }
.student-row-status small, .row-state { color: var(--muted); font-size: var(--fs-xs); }
.row-state.low { color: var(--danger); font-weight: 600; }
.directory-clean > .actions { padding: 12px 18px; border-top: 1px solid var(--line); }
.archive-number { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* ---------- 学员档案 ---------- */
.archive-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: -12px 0 16px; color: var(--ink-2); font-size: var(--fs-sm); }
.archive-summary .archive-number { color: var(--muted); font-weight: 400; }
.profile-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.profile-summary > div { min-width: 0; padding: 10px 14px; }
.profile-summary > div + div { border-left: 1px solid var(--line); }
.profile-summary small { display: block; color: var(--muted); font-size: var(--fs-xs); }
.profile-summary strong { display: block; overflow: hidden; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.profile-summary strong.is-empty { color: var(--muted); font-weight: 400; }
.profile-hero { display: flex; align-items: center; gap: 14px; margin: 0 0 16px; }
.student-overview-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, .75fr); align-items: start; gap: 16px; }
.priority-card, .exam-card { padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.priority-card > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.priority-card h2, .exam-card h2 { margin: 0; font-size: var(--fs-md); }
.priority-card .eyebrow, .exam-card .eyebrow { display: none; }
.priority-footnote { margin: 12px 0 0; color: var(--muted); font-size: var(--fs-xs); }
.quiet-notice { display: grid; gap: 2px; margin: 12px 0 0; }
.followed-up { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 10px 0; border-top: 1px solid var(--line); color: var(--ink-2); font-size: var(--fs-sm); }
.followed-up b { font-weight: 500; color: var(--ink); }
.followed-up small { color: var(--muted); font-size: var(--fs-xs); }
.task-detail-row { display: block; padding: 14px 0; }
.task-detail-row .grow > p { margin: 6px 0 0; color: var(--ink-2); overflow-wrap: anywhere; }
.task-detail-row .grow > p.muted { color: var(--muted); font-size: var(--fs-xs); }
.task-detail-row .actions { margin-top: 10px; gap: 4px; }
.task-detail-row .actions .btn { min-height: 32px; padding: 4px 10px; font-size: var(--fs-sm); }
.exam-card .exam-countdown { margin: 10px 0 2px; color: var(--ink); font-size: var(--fs-lg); font-weight: 500; }
.exam-card > p { color: var(--ink-2); font-size: var(--fs-sm); }
.exam-card .btn { margin-top: 6px; }
.profile-details { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.profile-details summary { color: var(--brand); cursor: pointer; font-size: var(--fs-sm); }
.profile-details summary + p { color: var(--ink-2); font-size: var(--fs-sm); }
.profile-details form { margin-top: 12px; }
.pause-fieldset { margin: 14px 0; padding: 10px 12px 12px; border: 1px solid #efdcb8; border-radius: var(--r-sm); background: var(--warn-soft); }
.pause-fieldset legend { padding: 0 4px; color: var(--warn); font-size: var(--fs-sm); font-weight: 500; }
.side-actions { display: grid; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.side-actions .btn { justify-content: flex-start; border-color: transparent; padding-left: 0; color: var(--brand); background: transparent; }
.side-actions .btn:hover { text-decoration: underline; background: transparent; }

/* 资料与开通 */
.material-record-card { padding: 0; overflow: hidden; }
.material-record-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.material-record-head h2 { margin: 0; font-size: var(--fs-md); }
.material-record-head p { margin: 2px 0 0; }
.material-record-body { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; }
.material-record-body strong { font-weight: 500; }
.material-record-body .actions { flex: 1; justify-content: flex-end; }
.material-delete-action { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 20px; border-top: 1px solid var(--line); background: #fcfcfc; }
.material-delete-action span { color: var(--muted); font-size: var(--fs-xs); }
.code-box { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px dashed var(--line-strong); border-radius: var(--r-sm); background: var(--soft); }
.code-box span { color: var(--ink); font-weight: 500; letter-spacing: .04em; word-break: break-all; }

/* 报告、附件 */
.report-content { border: 1px solid var(--line); border-radius: var(--r); background: #fff; overflow-wrap: anywhere; }
.report-content .report-document { padding-bottom: 20px; }
.report-content a, .record blockquote a { text-decoration: underline; text-underline-offset: 3px; }
.report-summary { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 16px; padding: 14px; }
.report-summary > div { padding: 2px 14px; border-right: 1px solid var(--line); }
.report-summary > div:last-child { border-right: 0; }
.report-summary span { display: block; color: var(--muted); font-size: var(--fs-xs); }
.report-summary strong { display: block; margin-top: 2px; font-weight: 500; }
.attachments img { border: 1px solid var(--line); border-radius: var(--r-sm); }
.file-attachment { display: inline-grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 8px; min-width: min(100%, 240px); padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; color: var(--ink); text-decoration: none !important; }
.file-attachment > span { grid-row: 1 / span 2; align-self: center; padding: 3px 6px; border-radius: 4px; background: var(--soft); color: var(--ink-2); font-size: 11px; }
.file-attachment strong { overflow: hidden; font-size: var(--fs-sm); font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.file-attachment small { color: var(--muted); font-size: 11px; }
.mono { font-size: var(--fs-md); letter-spacing: .04em; }

/* ---------- 新建资料流程 ---------- */
.stepper { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 20px; }
.step { position: relative; display: flex; align-items: center; gap: 8px; padding: 6px 0; color: var(--muted); font-size: var(--fs-sm); }
.step::after { content: ""; position: absolute; top: 50%; left: 36px; right: 8px; height: 1px; background: var(--line); z-index: -1; }
.step:last-child::after { display: none; }
.step span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--soft); font-size: var(--fs-xs); }
.step strong { font-weight: 400; }
.step.active { color: var(--ink); }
.step.active span { background: var(--brand); color: #fff; }
.step.active strong { font-weight: 500; }
.upload-layout, .completion-grid { position: relative; padding-bottom: 80px; }
.upload-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.completion-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.completion-grid .full-action { grid-column: 1 / -1; }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .8fr); gap: 16px; align-items: start; }
.full-action { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
.full-action strong { display: block; font-weight: 500; }
.full-action span { display: block; color: var(--muted); font-size: var(--fs-sm); }
.file-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 120px; margin-top: 16px; padding: 16px; border: 1px dashed var(--line-strong); border-radius: var(--r); background: #fbfcfb; color: var(--ink-2); }
.file-box.field { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: center; gap: 10px 14px; margin-bottom: 0; }
.file-box.field > input[type="file"] { width: 100%; min-width: 0; }
.file-box.field > small { grid-column: 1 / -1; }
.file-box.ready { border-style: solid; border-color: #b9d6ca; background: var(--brand-soft); color: var(--brand); }
.confirm-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(260px, .45fr); gap: 16px; }
.recent-materials { margin-top: 24px; color: var(--ink-2); }
.recent-materials > summary { cursor: pointer; }
.progress-panel { padding: 24px; }
.progress-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.progress-head h2 { margin: 4px 0; }
.progress-head p { color: var(--ink-2); }
.progress-head > strong { color: var(--ink); font-size: var(--fs-xl); font-weight: 500; }
.progress-track { height: 8px; margin: 20px 0; overflow: hidden; border-radius: 4px; background: var(--soft); }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--brand); transition: width .45s ease; }
.success-card { display: flex; align-items: flex-start; gap: 14px; padding: 20px; }
.success-mark { display: grid; place-items: center; flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 18px; }
.success-card h2 { margin: 2px 0; }
.success-card p { color: var(--ink-2); }

/* ---------- 登录 ---------- */
.login-screen { display: grid; grid-template-columns: minmax(0, 380px); place-content: center; min-height: 100dvh; padding: 24px; background: var(--canvas); }
.login-card { display: grid; gap: 16px; width: 100%; padding: 28px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
.login-card > .brand-mark { display: block; width: 44px; height: 44px; margin: 0 auto; }
.login-card h1 { margin: 0; font-size: var(--fs-lg); text-align: center; }
.login-card h1 + p { margin: 2px 0 0; text-align: center; }
.password-control { position: relative; }
.password-control input { padding-right: 60px; }
.password-toggle { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); border: 0; background: transparent; color: var(--brand); font-size: var(--fs-sm); }
.caps-hint { color: var(--warn) !important; }
.login-status { min-height: 20px; color: var(--danger); font-size: var(--fs-sm); }
.login-status:not(.visible) { visibility: hidden; }
.login-submit { width: 100%; min-height: 40px; }

/* ---------- 窄屏 ---------- */
@media (max-width: 1080px) {
  .student-list-row, .directory-clean .student-list-row { grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr); gap: 8px 16px; }
  .student-row-status { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .work-layout { grid-template-columns: minmax(0, 1fr) 232px; }
}
@media (max-width: 960px) {
  .overview-grid, .student-overview-grid { grid-template-columns: 1fr; }
  .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 30; top: 0; bottom: 0; width: min(80vw, 260px); height: 100dvh; transform: translateX(-105%); transition: transform .2s ease; box-shadow: 12px 0 30px rgba(0,0,0,.12); }
  .sidebar-scrim { position: fixed; z-index: 20; inset: 0; display: block; border: 0; background: rgba(20,32,28,.3); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  .app-shell.menu-open .sidebar { transform: translateX(0); }
  .app-shell.menu-open .sidebar-scrim { opacity: 1; pointer-events: auto; }
  .topbar { padding: 8px 14px; }
  .mobile-menu { display: grid; place-items: center; }
  .crumb, .top-actions .muted { display: none; }
  .page { padding: 4px 14px 36px; }
  .page-head { display: block; margin-bottom: 16px; }
  .page-head .actions { margin-top: 12px; }
  .work-layout, .two-col, .two-column, .confirm-layout, .completion-grid, .upload-layout { grid-template-columns: 1fr; }
  .work-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .focus-row { grid-template-columns: 1fr; gap: 8px; }
  .task-actions { flex-wrap: wrap; }
  .task-actions .btn, .task-detail-row .actions .btn { min-height: 40px; }
  .filter-tabs { flex-wrap: nowrap; overflow-x: auto; }
  .filter-tabs .btn { flex: 0 0 auto; }
  .student-list-row, .directory-clean .student-list-row { grid-template-columns: 1fr; padding: 12px 14px; }
  .profile-summary { grid-template-columns: 1fr 1fr; }
  .profile-summary > div + div { border-left: 0; }
  .profile-summary > div:nth-child(even) { border-left: 1px solid var(--line); }
  .profile-summary > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .list-row { align-items: flex-start; flex-wrap: wrap; }
  .list-row .actions { width: 100%; }
  .stepper { grid-template-columns: 1fr 1fr; }
  .step::after { display: none; }
  .full-action { position: static; flex-direction: column; align-items: stretch; margin-top: 14px; }
  .upload-layout, .completion-grid { padding-bottom: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .file-box.field { grid-template-columns: 1fr; }
  .file-box.field > small { grid-column: 1; }
  .code-box, .material-record-head, .material-record-body, .material-delete-action { flex-direction: column; align-items: stretch; }
  .report-summary { grid-template-columns: 1fr; }
  .report-summary > div { border-right: 0; border-bottom: 1px solid var(--line); padding: 8px 4px; }
  table.mobile-cards, table.mobile-cards tbody, table.mobile-cards tr, table.mobile-cards td { display: block; width: 100%; }
  table.mobile-cards thead { display: none; }
  table.mobile-cards tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.mobile-cards td { display: grid; grid-template-columns: minmax(96px, .7fr) minmax(0, 1fr); gap: 10px; padding: 4px 0; border: 0; text-align: right; }
  table.mobile-cards td::before { content: attr(data-label); color: var(--muted); font-size: var(--fs-xs); text-align: left; }
  table.mobile-cards td .btn { justify-self: end; }
}
@media (max-width: 420px) {
  .top-actions .btn:first-of-type { display: none; }
  .metric-strip { grid-template-columns: 1fr 1fr; }
}

/* 学员类型与训练次数 */
.badge.type-trial { background: var(--warn-soft); color: var(--warn); }
.badge.type-formal { background: var(--brand-soft); color: var(--brand); }
.badge.type-dormant, .badge.type-passed { background: var(--soft); color: var(--ink-2); }
.type-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 12px 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.type-picker legend { padding: 0 6px; color: var(--ink-2); font-size: var(--fs-sm); }
.type-picker label { display: inline-flex; align-items: center; gap: 6px; }
.type-picker small { flex-basis: 100%; }
.quota-line { margin: 8px 0 0; font-size: var(--fs-sm); color: var(--ink-2); }
.quota-now { margin: 4px 0 0; }

/* 宋体：只用在标题和大数字上 */
.page-head h1, .brand-name, .work-summary span, .metric-button strong, .exam-block h2, .exam-block .num, .prep-row .name { font-family: var(--serif); }
.page-head h1 { font-weight: 700; letter-spacing: .02em; }
.brand-name { letter-spacing: .06em; }

/* 备考作战图 */
.exam-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; margin: -6px 0 14px; color: var(--ink-2); font-size: var(--fs-sm); }
.exam-filters label { display: inline-flex; align-items: center; gap: 8px; }
.exam-filters select { min-height: 32px; padding: 3px 8px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); }
.exam-timeline { position: relative; display: flex; gap: 14px; margin: 0 0 18px; padding: 4px 0 6px; overflow-x: auto; }
.exam-timeline .stop { position: relative; flex: 0 0 210px; display: grid; gap: 2px; padding: 12px 14px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink); }
.exam-timeline .stop:hover { border-color: var(--line-strong); }
.exam-timeline .stop.on { border-color: var(--ink); box-shadow: inset 0 -3px 0 var(--danger); }
.exam-timeline .st { color: var(--muted); font-size: var(--fs-xs); }
.exam-timeline .st.announced { color: var(--danger); }
.exam-timeline .dot { width: 12px; height: 12px; margin: 2px 0; border-radius: 50%; border: 2px solid var(--ink); background: var(--canvas); box-sizing: border-box; }
.exam-timeline .dot.announced { border-color: var(--danger); background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.exam-timeline .dot.none { border-style: dashed; border-color: var(--muted); }
.exam-timeline b { font-family: var(--serif); font-size: var(--fs-md); }
.exam-timeline .sub, .prep-row .sub { color: var(--ink-2); font-size: var(--fs-sm); }
.exam-timeline .level-bar { margin-top: 6px; }
.level-bar { display: flex; overflow: hidden; border-radius: 999px; background: var(--soft); }
.level-bar i { display: block; height: 100%; }
.lv-ready { background: #2f5d50; } .lv-close { background: #c9a24a; } .lv-not_ready { background: var(--danger); }
.lv-text { font-weight: 600; }
.lv-text.lv-ready { color: #2f5d50; background: none; } .lv-text.lv-close { color: #8a6a1f; background: none; } .lv-text.lv-not_ready { color: var(--danger); background: none; }
.exam-block { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.exam-block > header { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 36px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.exam-block .days { display: flex; align-items: center; gap: 14px; }
.exam-block .num { color: var(--danger); font-size: 46px; font-weight: 700; line-height: 1; }
.exam-block h2 { margin: 0; font-size: var(--fs-lg); }
.exam-block .days p { margin: 2px 0 0; }
.exam-block .spread { flex: 1 1 280px; min-width: 0; }
.exam-block .spread-text { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 6px 0 0; color: var(--ink-2); font-size: var(--fs-sm); }
.prep-head, .prep-row { display: grid; grid-template-columns: minmax(170px, 1.2fr) 132px minmax(190px, 1.5fr) auto; align-items: center; gap: 16px; padding: 14px 22px; }
.prep-head { padding-top: 9px; padding-bottom: 9px; color: var(--muted); font-size: var(--fs-xs); border-bottom: 1px solid var(--line); }
.prep-row { border-bottom: 1px solid var(--line); }
.prep-row:last-of-type { border-bottom: 0; }
.prep-row .name { color: var(--ink); font-size: var(--fs-md); font-weight: 700; }
.prep-row .name:hover { color: var(--danger); }
.prep-row .sub { margin-top: 1px; }
.prep-row .late { color: var(--danger); }
.prep-row .gap b { font-size: var(--fs); }
.prep-row .act { display: grid; gap: 4px; justify-items: stretch; }
.prep-row .act .btn { min-height: 30px; padding: 3px 12px; font-size: var(--fs-sm); }
.grid9 { display: grid; grid-template-columns: repeat(3, 26px); gap: 4px; }
.grid9 i, .exam-legend .keys i { display: inline-block; height: 26px; border-radius: 3px; }
.exam-legend .keys i { width: 10px; height: 10px; border-radius: 2px; vertical-align: -1px; margin: 0 2px 0 10px; }
.m-mastered { background: #2f5d50; } .m-half { background: #9cbdb1; } .m-weak { background: #e7b8a8; } .m-none { background: #e2dbcc; }
.exam-legend { display: grid; gap: 6px; margin-top: 18px; color: var(--ink-2); font-size: var(--fs-xs); }
.exam-legend .keys { color: var(--ink-2); }
@media (max-width: 960px) {
  .prep-head { display: none; }
  .prep-row { grid-template-columns: 1fr auto; }
  .prep-row .gap { grid-column: 1 / -1; }
  .prep-row .act { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
}

/* CSP 不允许内联 style，间距都用类名 */
.pad-top { padding-top: 14px; }
.gap-top { margin-top: 16px; }
.notice.tight { margin: -6px 0 16px; }
.quota-h { margin: 18px 0 4px; }
.form-grid.flush { margin: 4px 0 0; }
#fill-profile { min-height: 0; padding: 0 4px; border: 0; background: transparent; color: var(--brand); text-decoration: underline; cursor: pointer; }

.num-link { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; border-bottom: 1px dotted var(--ink-2); }
.num-link:hover { color: var(--danger); border-bottom-color: var(--danger); }
.practice-ratio .num-link { justify-self: start; }
.teachers-panel td:first-child strong { white-space: nowrap; }

/* 学员类型与训练次数弹窗：还剩多少轮放大显示 */
.quota-hero { margin: 4px 0 8px; }
.quota-hero .num { font-family: var(--serif); font-size: 46px; font-weight: 700; line-height: 1.1; color: var(--brand); }
.quota-hero .unit { margin-left: 8px; color: var(--ink-2); }
.quota-hero .sub { margin: 2px 0 0; color: var(--ink-2); font-size: var(--fs-sm); }
.set-left { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex-basis: 100%; }
.set-left input { width: 84px; min-height: 32px; padding: 3px 8px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); }

/* 今日训练前 10 名 */
.board-panel { margin-top: 18px; }
.board-note { margin: 0 0 6px; font-size: var(--fs-xs); }
.board { list-style: none; margin: 8px 0 0; padding: 0; }
.board li { display: grid; grid-template-columns: 30px 110px minmax(0, 1fr) 56px; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.board li:last-child { border-bottom: 0; }
.board .rank { font-family: var(--serif); font-size: var(--fs-lg); color: var(--muted); }
.board .rank.rtop { color: var(--danger); }
.board .who { color: var(--ink); font-weight: 500; }
.board .who:hover { color: var(--danger); }
.board .bar { display: block; height: 8px; border-radius: 4px; background: #d68a76; }
.board li:nth-child(-n+3) .bar { background: var(--danger); }
.board .cnt { text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; }

.poster-preview { display: block; width: 100%; max-width: 420px; margin: 8px auto 12px; border: 1px solid var(--line); border-radius: var(--r-sm); }
