/* ============================================================
   企业成长学院 · Design System v3
   基于 .impeccable.md：单一强调色（钉钉蓝）、带蓝调中性色、
   固定 5 级字号、4pt 间距、克制的描边与阴影、拒绝万物皆卡片
   保留全部既有 class 名，仅替换视觉，不改任何 DOM 交互
   ============================================================ */

:root {
  color-scheme: light;

  /* Primary — 钉钉蓝，唯一强调色 */
  --blue-50: oklch(97% 0.014 255);
  --blue-100: oklch(93% 0.035 255);
  --blue-500: oklch(58% 0.155 256);
  --blue-600: oklch(51% 0.16 256);
  --blue-700: oklch(44% 0.145 256);

  /* Neutral — 带蓝调，非死灰 */
  --n-0: oklch(100% 0 0);
  --n-50: oklch(98.5% 0.003 255);
  --n-100: oklch(96.5% 0.005 255);
  --n-200: oklch(92% 0.007 255);
  --n-300: oklch(86% 0.009 255);
  --n-500: oklch(62% 0.012 255);
  --n-700: oklch(38% 0.014 255);
  --n-900: oklch(22% 0.018 255);

  /* Semantic — 仅状态处使用 */
  --green: oklch(52% 0.12 155);
  --green-bg: oklch(95% 0.03 155);
  --amber: oklch(62% 0.12 65);
  --amber-bg: oklch(96% 0.035 80);
  --red: oklch(55% 0.19 25);
  --red-bg: oklch(96% 0.03 25);

  /* Sidebar — 深蓝灰 */
  --side: oklch(23% 0.025 255);
  --side-hover: oklch(29% 0.03 255);

  /* Semantic aliases used across components */
  --ink: var(--n-900);
  --muted: var(--n-500);
  --line: var(--n-200);
  --border: var(--n-200);
  --deep: var(--side);
  --green-legacy: var(--green);
  --orange: var(--amber);
  --mint: var(--blue-100);

  --shadow: 0 1px 2px oklch(20% 0.02 255 / .04);
  --radius: 8px;

  /* Type scale — 固定 5 级 */
  --t-xs: .75rem;   /* 12 */
  --t-sm: .875rem;  /* 14 */
  --t-base: 1rem;   /* 16 */
  --t-lg: 1.25rem;  /* 20 */
  --t-xl: 1.75rem;  /* 28 */

  /* Spacing — 4pt base */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px;
  --s-6: 24px; --s-8: 32px; --s-12: 48px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-width: 320px; min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: var(--t-base); line-height: 1.5; color: var(--n-900);
  background: var(--n-50); -webkit-font-smoothing: antialiased; font-kerning: normal;
}
button, select, input, textarea { font: inherit; }
button { cursor: pointer; color: inherit; background: none; border: 0; }
a { color: inherit; }

/* ---------- Shell & Sidebar ---------- */
.shell { min-height: 100vh; display: grid; grid-template-columns: 232px 1fr; }
.sidebar {
  background: var(--side); color: var(--n-100); padding: 0;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 11px; height: 68px; padding: 0 20px; border-bottom: 1px solid oklch(100% 0 0/.07); flex: none; }
.brand-mark { width: 30px; height: 30px; display: grid; place-items: center; background: var(--blue-500); color: #fff; border-radius: 8px; font-weight: 700; font-size: 15px; flex: none; }
.brand strong { font-size: 15px; color: #fff; font-weight: 600; letter-spacing: .01em; }
.brand span { display: none; }

.nav { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 12px 0; }
.nav::-webkit-scrollbar { width: 4px; }
.nav::-webkit-scrollbar-thumb { background: oklch(100% 0 0/.14); border-radius: 4px; }
.nav-group { display: grid; gap: 2px; margin-bottom: 10px; }
.nav-group-title {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px 8px; color: oklch(74% 0.01 255);
  font-size: var(--t-xs); font-weight: 600; letter-spacing: .1em;
}
.nav-group-title:hover { color: #fff; }
.nav-group-title b { font-size: 14px; font-weight: 500; }
.nav-group-items { display: grid; gap: 2px; }
.nav-group-items[hidden] { display: none; }
.nav button:not(.nav-group-title) {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 20px; border-radius: 0; color: oklch(82% .008 255);
  font-size: var(--t-sm); text-align: left; position: relative; transition: background .15s, color .15s;
}
.nav button:not(.nav-group-title):hover { background: var(--side-hover); color: #fff; }
.nav button.active { background: var(--blue-600) !important; color: #fff !important; font-weight: 500; }
.nav button.active::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: oklch(80% .1 255); }
.nav i { width: 7px; height: 7px; border: 1.5px solid currentColor; border-radius: 50%; flex: none; opacity: .7; }

.profile { margin-top: auto; padding: 14px 20px; border-top: 1px solid oklch(100% 0 0/.07); }
.profile label { color: oklch(70% .01 255); font-size: var(--t-xs); display: block; margin-bottom: 7px; }
.profile select {
  width: 100%; color: #fff; background: var(--side-hover);
  border: 1px solid oklch(100% 0 0/.12); border-radius: 6px; padding: 9px 10px; font-size: var(--t-sm);
}

/* ---------- Main & Topbar ---------- */
.main { padding: 0; overflow: hidden; }
.topbar {
  height: 68px; padding: 0 40px; background: var(--n-0);
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; gap: 20px; align-items: center;
  position: sticky; top: 0; z-index: 10; margin-bottom: 0;
}
.crumb { color: var(--n-500); font-size: var(--t-sm); }
.person { display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: oklch(88% .05 210); color: var(--n-900); display: grid; place-items: center; font-weight: 600; font-size: var(--t-sm); flex: none; }
.person strong { font-size: var(--t-sm); display: block; font-weight: 500; }
.person span { font-size: var(--t-xs); color: var(--n-500); }

/* 内容区统一内边距（各 view 直接位于 main 内） */
.main > .page-title, .main > .hero, .main > .section-head, .main > .course-grid,
.main > .metrics, .main > .panel, .main > .grid, .main > div:not(.topbar) {
  /* 由下面的 .view-scope 处理，这里不强制 */
}

/* 由于 app.js 的视图直接挂在 main 下，用统一 wrapper 内边距 */
.main { --pad-x: 40px; }
.main > section, .main > article, .main > div:not(.topbar) { }
/* 让所有页面顶层内容有左右内边距：用 main 的 padding 实现，topbar 负边距抵消 */
.main { padding: 0 var(--pad-x) 64px; }
.topbar { margin: 0 calc(var(--pad-x) * -1); padding: 0 var(--pad-x); }

/* ---------- Page title ---------- */
.page-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding: 36px 0 0; margin-bottom: 28px; }
.page-title h1 { font-size: var(--t-xl); font-weight: 650; letter-spacing: -.02em; line-height: 1.25; margin: 0; }
.page-title p { color: var(--n-500); font-size: var(--t-sm); margin: 8px 0 0; line-height: 1.6; }
.page-title > div { display: grid; gap: 2px; }

/* ---------- Hero → 焦点任务（白底 + 蓝左边框，去深色大卡） ---------- */
.hero {
  position: relative; overflow: hidden; margin-top: 36px;
  background: var(--n-0); color: var(--ink);
  border: 1px solid var(--border); border-left: 3px solid var(--blue-500);
  border-radius: var(--radius); padding: 28px 32px; box-shadow: var(--shadow);
}
.hero::after { display: none; }
.eyebrow { color: var(--blue-600); font-size: var(--t-xs); font-weight: 600; letter-spacing: .06em; }
.hero h1 { font-size: var(--t-lg); line-height: 1.35; max-width: 60ch; margin: 12px 0 10px; letter-spacing: -.01em; font-weight: 600; }
.hero p { color: var(--n-500); max-width: 68ch; line-height: 1.7; margin: 0; font-size: var(--t-sm); }
.hero-stats { margin-top: 24px; display: flex; gap: 40px; }
.hero-stats strong { font-size: var(--t-lg); font-weight: 650; display: block; color: var(--n-900); font-variant-numeric: tabular-nums; }
.hero-stats span { font-size: var(--t-xs); color: var(--n-500); }

/* ---------- Section head ---------- */
.section-head { display: flex; justify-content: space-between; align-items: flex-end; margin: 36px 0 16px; }
.section-head h2 { font-size: var(--t-lg); font-weight: 600; letter-spacing: -.01em; margin: 0; }
.section-head p { margin: 4px 0 0; color: var(--n-500); font-size: var(--t-xs); }
.link-btn { color: var(--blue-600); font-weight: 500; font-size: var(--t-sm); }
.link-btn:hover { color: var(--blue-700); }

/* ---------- Buttons ---------- */
.primary {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 6px; background: var(--blue-500); color: #fff;
  padding: 9px 16px; font-size: var(--t-sm); font-weight: 500; line-height: 1.4;
  transition: background .15s;
}
.primary:hover:not(:disabled) { background: var(--blue-600); }
.primary:disabled, .secondary:disabled { cursor: not-allowed; opacity: .45; }
.secondary {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 6px; background: var(--n-0); color: var(--n-700);
  padding: 8px 15px; font-size: var(--t-sm); font-weight: 500; transition: border-color .15s, color .15s;
}
.secondary:hover { border-color: var(--blue-500); color: var(--blue-600); }

/* ---------- Tags / status ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--blue-50); color: var(--blue-700);
  border-radius: 4px; padding: 3px 9px; font-size: var(--t-xs); font-weight: 500; line-height: 1.6;
}
.tag::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: none; }
.tag.green { background: var(--green-bg); color: var(--green); }
.status { font-size: var(--t-xs); font-weight: 600; border-radius: 4px; padding: 3px 9px; display: inline-block; }
.status::before { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: 1px; }
.status.completed { background: var(--green-bg); color: var(--green); }
.status.pending_exam { background: var(--amber-bg); color: var(--amber); }
.status.learning { background: var(--blue-50); color: var(--blue-700); }
.status.not_started, .status.locked { background: var(--n-100); color: var(--n-500); }
.status.available { background: var(--amber-bg); color: var(--amber); }

/* ---------- Progress ---------- */
.progress { height: 6px; background: var(--n-200); border-radius: 3px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--blue-500); border-radius: 3px; transition: width .4s cubic-bezier(.22,1,.36,1); }

/* ---------- Task card（首页优先任务） ---------- */
.task-card {
  display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center;
  background: var(--n-0); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px 28px; box-shadow: var(--shadow);
}
.task-card h3 { font-size: var(--t-lg); font-weight: 600; margin: 14px 0 8px; }
.meta { display: flex; gap: 20px; flex-wrap: wrap; color: var(--n-500); font-size: var(--t-xs); }
.task-action { min-width: 120px; text-align: right; display: grid; justify-items: end; gap: 12px; }
.task-action strong { font-size: var(--t-xl); font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* ---------- Metrics → 数字条（去卡片、竖线分隔） ---------- */
.metrics {
  display: grid; grid-template-columns: repeat(4, 1fr);
  margin: 24px 0 8px; background: var(--n-0);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.metric { padding: 22px 26px; position: relative; background: var(--n-0); border: 0; border-radius: 0; }
.metric + .metric::before { content: ""; position: absolute; left: 0; top: 22px; bottom: 22px; width: 1px; background: var(--border); }
.metric span { display: block; color: var(--n-500); font-size: var(--t-sm); }
.metric strong { font-size: var(--t-xl); display: block; margin-top: 6px; letter-spacing: -.02em; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.1; }

/* ---------- Panel（通用容器，弱描边） ---------- */
.panel { background: var(--n-0); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 26px; margin-top: 18px; box-shadow: var(--shadow); }
.panel .section-head { margin-top: 0; }

/* ---------- Course cards ---------- */
.course-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 20px; }
.course-card {
  background: var(--n-0); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0; overflow: hidden; transition: border-color .18s, transform .18s;
}
.course-card:hover { border-color: var(--blue-500); transform: translateY(-2px); }
.course-cover {
  height: 92px; padding: 16px 18px; display: flex; align-items: flex-start; justify-content: space-between;
  background: var(--blue-50); color: var(--blue-600); border-bottom: 1px solid var(--border);
}
.course-cover.store { background: var(--green-bg); color: var(--green); }
.course-cover.play { background: var(--amber-bg); color: var(--amber); }
.course-cover .tag { background: var(--n-0); }
.course-cover .tag::before { display: none; }
.type-chip { background: var(--n-0); color: var(--n-700); border-radius: 4px; padding: 3px 8px; font-size: var(--t-xs); }
.cover-icon { width: 40px; height: 40px; border: 1px solid currentColor; border-radius: 9px; display: grid; place-items: center; font-size: 18px; align-self: flex-end; opacity: .85; }
.course-card h3 { font-size: var(--t-base); line-height: 1.45; margin: 16px 18px 6px; font-weight: 600; }
.course-card p { color: var(--n-500); font-size: var(--t-xs); line-height: 1.65; min-height: 38px; margin: 0 18px; }
.course-card .progress { margin: 16px 18px 0; }
.course-foot { display: flex; justify-content: space-between; align-items: center; margin: 12px 18px 18px; font-size: var(--t-xs); color: var(--n-500); }

/* ---------- Exam ---------- */
.exam-head { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; }
.exam-head h2 { margin: 12px 0 8px; font-size: var(--t-lg); font-weight: 600; }
.question { padding: 24px 0; border-top: 1px solid var(--border); }
.question:first-of-type { margin-top: 20px; }
.question h3 { font-size: var(--t-base); line-height: 1.6; font-weight: 500; }
.option { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--border); border-radius: 6px; margin: 8px 0; cursor: pointer; font-size: var(--t-sm); transition: border-color .15s, background .15s; }
.option:hover { border-color: var(--blue-500); }
.option:has(input:checked) { border-color: var(--blue-500); background: var(--blue-50); }
.exam-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.result { background: var(--green-bg); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.result.fail { background: var(--red-bg); }

/* ---------- Tables ---------- */
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th, td { text-align: left; border-bottom: 1px solid var(--n-100); padding: 14px 14px; font-size: var(--t-sm); }
th { color: var(--n-500); font-weight: 600; background: var(--n-50); border-bottom: 1px solid var(--border); font-size: var(--t-xs); }
tbody tr:last-child td { border-bottom: 0; }
.empty { padding: 60px 20px; text-align: center; color: var(--n-500); }

/* ---------- Learning map ---------- */
.map-summary {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px;
  background: var(--n-0); color: var(--ink); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 24px; margin-top: 22px; box-shadow: var(--shadow);
}
.map-summary span { color: var(--n-500); font-size: var(--t-sm); }
.map-summary strong { font-size: var(--t-lg); font-weight: 650; display: block; margin-top: 3px; font-variant-numeric: tabular-nums; }
.map-summary .progress { margin: 0; background: var(--n-200); }
.learning-map { position: relative; display: grid; gap: 12px; margin-top: 18px; }
.learning-map::before { content: ""; position: absolute; left: 31px; top: 40px; bottom: 40px; width: 1px; background: var(--n-200); }
.stage-card {
  position: relative; display: grid; grid-template-columns: 48px 1fr auto; gap: 18px; align-items: center;
  background: var(--n-0); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px 20px 16px;
}
.stage-card.completed { background: var(--n-0); }
.stage-card.locked { background: var(--n-50); color: var(--n-500); }
.stage-card.available { border-color: var(--blue-500); }
.stage-index { position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--n-100); color: var(--n-500); font-weight: 600; font-size: var(--t-sm); }
.stage-card.completed .stage-index { background: var(--green-bg); color: var(--green); }
.stage-card.available .stage-index { background: var(--blue-500); color: #fff; }
.stage-copy h2 { font-size: var(--t-base); font-weight: 600; margin: 0 0 5px; }
.stage-copy p { color: var(--n-500); font-size: var(--t-sm); margin: 0 0 12px; }
.requirement { display: inline-flex; gap: 7px; align-items: center; font-size: var(--t-xs); color: var(--n-500); background: var(--n-50); border: 1px solid var(--border); border-radius: 4px; padding: 4px 9px; }
.requirement.done { color: var(--green); background: var(--green-bg); border-color: transparent; font-weight: 500; }
.stage-action { min-width: 120px; text-align: right; display: grid; justify-items: end; gap: 4px; }
.stage-action strong { color: var(--blue-600); font-size: var(--t-base); font-weight: 600; }
.stage-action span { color: var(--n-500); font-size: var(--t-xs); margin-bottom: 8px; }

/* ---------- Certificate / ledger ---------- */
.certificate { display: flex; align-items: center; gap: 20px; background: var(--green-bg); border: 1px solid oklch(85% .04 155); border-radius: var(--radius); padding: 20px; }
.cert-seal { width: 72px; height: 72px; border: 1.5px solid var(--green); color: var(--green); border-radius: 50%; display: grid; place-items: center; font-weight: 700; flex: none; }
.certificate h3 { margin: 10px 0 4px; font-size: var(--t-base); }
.certificate p { margin: 0; color: var(--n-700); font-size: var(--t-xs); line-height: 1.7; }
.ledger > div { display: flex; justify-content: space-between; align-items: center; padding: 14px 2px; border-bottom: 1px solid var(--n-100); }
.ledger > div:last-child { border-bottom: 0; }
.ledger span { font-size: var(--t-sm); }
.ledger small { display: block; color: var(--n-500); margin-top: 4px; }
.ledger strong { color: var(--green); font-variant-numeric: tabular-nums; }

/* ---------- Instructor / application ---------- */
.review-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.review-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; background: var(--n-0); }
.review-checks { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.review-checks span { font-size: var(--t-xs); background: var(--n-100); color: var(--n-500); border-radius: 4px; padding: 4px 9px; }
.review-checks span.done { background: var(--green-bg); color: var(--green); }
.review-result { display: grid; gap: 8px; }
.review-result small { color: var(--n-500); line-height: 1.5; }
.instructor-hero { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 32px; margin-top: 22px; border: 1px solid var(--border); border-left: 3px solid var(--blue-500); border-radius: var(--radius); background: var(--n-0); }
.instructor-hero h2 { margin: 12px 0 8px; font-size: var(--t-xl); font-weight: 650; }
.instructor-hero p { color: var(--n-500); margin: 0; font-size: var(--t-sm); }
.instructor-badge { width: 84px; height: 84px; display: grid; place-items: center; border: 1px solid var(--blue-100); border-radius: 50%; color: var(--blue-600); font-size: 34px; font-weight: 700; flex: none; }
.application-panel { margin-top: 18px; }
.step-pill { padding: 4px 9px; border-radius: 4px; color: var(--blue-700); background: var(--blue-50); font-size: var(--t-xs); font-weight: 600; }
.application-steps { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin: 20px 0; }
.application-steps span { display: grid; gap: 8px; padding: 16px; border-radius: var(--radius); background: var(--n-50); color: var(--n-500); font-size: var(--t-xs); border: 1px solid var(--border); }
.application-steps b { color: var(--blue-600); font-size: var(--t-lg); }
.application-status { display: grid; gap: 7px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); }
.application-status small, .submission-row span, .instructor-review-card p { color: var(--n-500); line-height: 1.6; font-size: var(--t-xs); }
.submission-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--n-100); }
.submission-row:last-child { border-bottom: 0; }
.submission-row div { display: grid; gap: 6px; }
.review-list { display: grid; gap: 12px; }
.instructor-review-card { display: grid; gap: 14px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); }
.review-meta { display: flex; align-items: center; gap: 12px; }
.material-preview { display: grid; gap: 8px; padding: 14px; border-radius: 6px; background: var(--n-50); color: var(--n-500); font-size: var(--t-xs); }
.admin-resource-panel { margin-top: 20px; }

/* ---------- Resource rows / plans ---------- */
.resource-row, .plan-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--n-100); }
.resource-row:last-child, .plan-row:last-child { border-bottom: 0; }
.resource-row > div, .plan-row > div { display: flex; align-items: center; gap: 12px; }
.resource-row > div:first-child { display: grid; gap: 6px; }
.resource-row span, .plan-row p, .plan-row div:last-child span { color: var(--n-500); font-size: var(--t-xs); }
.plan-row h3 { margin: 8px 0 4px; font-size: var(--t-base); }
.plan-row p { margin: 0; }
.plan-row div:last-child { display: grid; justify-items: end; gap: 5px; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px; background: oklch(20% .02 255/.42); }
.review-modal, .learn-modal {
  width: min(520px, 100%); display: grid; gap: 16px; background: var(--n-0);
  border: 1px solid var(--border); border-radius: 12px; padding: 24px; box-shadow: 0 20px 60px oklch(20% .02 255/.18);
}
.learn-modal { width: min(680px, 100%); }
.review-modal label { display: grid; gap: 7px; color: var(--n-700); font-size: var(--t-xs); font-weight: 600; }
.review-modal input, .review-modal select, .review-modal textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px;
  background: var(--n-0); color: var(--n-900); font-size: var(--t-sm); resize: vertical;
}
.review-modal input:focus, .review-modal select:focus, .review-modal textarea:focus { outline: 0; border-color: var(--blue-500); box-shadow: 0 0 0 3px var(--blue-50); }

/* ---------- Storage / upload ---------- */
.storage-badge { margin-bottom: 14px; padding: 10px 14px; border-radius: 6px; background: var(--blue-50); color: var(--blue-700); font-size: var(--t-xs); }
.file-drop { display: grid; gap: 6px; place-items: center; padding: 22px; border: 1.5px dashed var(--n-300); border-radius: var(--radius); background: var(--n-50); color: var(--n-700); cursor: pointer; text-align: center; font-size: var(--t-sm); }
.file-drop small { color: var(--n-500); font-size: var(--t-xs); }
.upload-progress { display: grid; gap: 6px; margin-top: 10px; }
.upload-progress span { display: block; height: 5px; width: 0; border-radius: 3px; background: var(--blue-500); transition: width .2s; }
.upload-progress em { color: var(--n-500); font-size: var(--t-xs); font-style: normal; }
.signed-link { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 12px; font-size: var(--t-xs); }
.signed-link a { color: var(--blue-600); font-weight: 500; }
.signed-link span { color: var(--n-500); }
.attachment-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; color: var(--n-500); font-size: var(--t-xs); }
.attachment { padding: 5px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--n-50); }

/* ---------- Learn modal / reader ---------- */
.learn-body { position: relative; overflow: hidden; border-radius: var(--radius); }
.learn-body::after { content: attr(data-watermark); position: absolute; inset: 0; pointer-events: none; opacity: .06; font-size: 18px; font-weight: 700; color: var(--n-700); transform: rotate(-24deg); word-break: break-all; line-height: 3.2; text-align: center; }
.video-stage { display: grid; place-items: center; gap: 12px; padding: 48px 20px; border-radius: var(--radius); background: var(--side); color: #fff; text-align: center; }
.play-glyph { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; background: oklch(100% 0 0/.1); border: 1px solid oklch(100% 0 0/.3); font-size: 24px; padding-left: 4px; }
.video-title { font-size: var(--t-lg); font-weight: 600; }
.video-meta { color: oklch(80% 0 0); font-size: var(--t-xs); }
.video-stage .progress { width: 100%; max-width: 420px; background: oklch(100% 0 0/.2); }
.video-stage .progress span { background: var(--blue-500); }
.reader-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; }
.reader-actions span { color: var(--n-500); font-size: var(--t-xs); }
.doc-reader { padding: 4px; }
.doc-page { min-height: 220px; padding: 22px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--n-50); }
.doc-lines { display: grid; gap: 8px; margin-bottom: 18px; }
.doc-lines span { height: 6px; border-radius: 3px; background: var(--n-200); }
.doc-lines span:nth-child(2) { width: 82%; }
.doc-lines span:nth-child(3) { width: 91%; }
.doc-lines span:nth-child(4) { width: 64%; }
.doc-page h3 { margin: 0 0 10px; font-size: var(--t-base); }
.doc-page p { color: var(--n-500); line-height: 1.7; font-size: var(--t-sm); }
.chapter-list { display: grid; gap: 10px; }
.chapter-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 6px; font-size: var(--t-sm); }
.chapter-row.done { background: var(--green-bg); }
.chapter-index { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--n-100); color: var(--n-500); font-weight: 600; font-size: var(--t-xs); }
.chapter-row.done .chapter-index { background: var(--green-bg); color: var(--green); }
.chapter-row > div { display: grid; gap: 5px; flex: 1; }
.chapter-row span { color: var(--n-500); font-size: var(--t-xs); }

/* ---------- Anti-cheat ---------- */
.notice-bar, .anti-cheat-bar {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; margin: 20px 0 16px;
  border-radius: 6px; background: var(--blue-50); color: var(--blue-700); font-size: var(--t-sm); line-height: 1.6;
}
.anti-cheat-bar { justify-content: space-between; }
.ac-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--blue-500); box-shadow: 0 0 0 4px var(--blue-50); }
.violation-count { white-space: nowrap; font-weight: 600; }
.abnormal-note { display: block; margin-top: 8px; color: var(--red); }

/* ---------- Admin: progress / roles / contacts / onboarding ---------- */
.progress-list { display: grid; gap: 14px; }
.progress-card { display: grid; gap: 14px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--n-0); }
.progress-stats { display: flex; flex-wrap: wrap; gap: 24px; }
.progress-stats span { display: grid; gap: 4px; color: var(--n-500); font-size: var(--t-xs); }
.progress-stats b { color: var(--n-900); font-size: var(--t-lg); font-variant-numeric: tabular-nums; }
.progress-bars { display: grid; gap: 8px; }
.mini-progress { display: grid; grid-template-columns: 1fr 120px 40px; align-items: center; gap: 12px; font-size: var(--t-xs); }
.mini-progress em { color: var(--n-500); font-style: normal; text-align: right; }
.role-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 12px; }
.role-card { display: grid; gap: 8px; justify-items: start; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--n-0); }
.role-card p { margin: 0; color: var(--n-500); font-size: var(--t-xs); line-height: 1.5; }
.role-card small { color: var(--blue-600); font-size: var(--t-xs); word-break: break-all; }
.dept-list { display: grid; gap: 8px; }
.dept-row { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 6px; }
.dept-row > div { display: grid; gap: 4px; }
.dept-row span { color: var(--n-500); font-size: var(--t-xs); }
.dept-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 6px; background: var(--blue-50); color: var(--blue-600); font-size: 16px; }
.detail-section { display: grid; gap: 10px; }
.detail-section h3 { margin: 6px 0 0; font-size: var(--t-base); }

/* form controls in head areas */
.head-actions, .role-assign-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.head-actions select, .role-assign-form select, .filter-bar input, .filter-bar select {
  border: 1px solid var(--border); border-radius: 6px; padding: 8px 12px;
  background: var(--n-0); color: var(--n-900); font-size: var(--t-sm);
}
.head-actions select:focus, .role-assign-form select:focus, .filter-bar input:focus, .filter-bar select:focus { outline: 0; border-color: var(--blue-500); box-shadow: 0 0 0 3px var(--blue-50); }
.role-assign-form select { flex: 1 1 200px; min-width: 180px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 14px; }
.filter-bar input { flex: 1 1 220px; min-width: 180px; }
.cell-progress { display: flex; align-items: center; gap: 8px; min-width: 130px; }
.cell-progress .progress { flex: 1; }
.cell-progress em { color: var(--n-500); font-style: normal; font-size: var(--t-xs); white-space: nowrap; }
.pagination { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; padding: 18px 0 4px; }
.pagination button { min-width: 34px; padding: 7px 11px; border: 1px solid var(--border); border-radius: 6px; background: var(--n-0); color: var(--n-700); font-size: var(--t-sm); }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }
.pagination button.primary { background: var(--blue-500); color: #fff; border-color: var(--blue-500); }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 16px; margin: 20px 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .course-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { height: auto; position: static; padding: 0; flex-direction: row; align-items: center; overflow-x: auto; }
  .brand { height: auto; min-width: 170px; margin: 0 16px 0 0; padding: 14px 16px; border-bottom: 0; border-right: 1px solid oklch(100% 0 0/.07); }
  .nav { display: flex; flex: 0 1 auto; min-height: auto; overflow-y: visible; padding: 8px; }
  .nav-group { display: flex; align-items: center; margin: 0; gap: 6px; }
  .nav-group-title { padding: 6px 10px; white-space: nowrap; }
  .nav-group-items { display: flex; }
  .nav button:not(.nav-group-title) { width: auto; white-space: nowrap; padding: 8px 12px; }
  .profile { border: 0; border-left: 1px solid oklch(100% 0 0/.07); padding: 8px 12px; margin: 0 0 0 auto; min-width: 140px; }
  .main { --pad-x: 24px; }
  .metrics { grid-template-columns: repeat(2,1fr); }
  .metric:nth-child(3)::before { display: none; }
  .review-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .nav i { display: none; }
  .crumb { display: none; }
  .main { --pad-x: 18px; }
  .hero { padding: 22px 20px; }
  .hero-stats { gap: 20px; flex-wrap: wrap; }
  .task-card { grid-template-columns: 1fr; gap: 18px; }
  .task-action { text-align: left; justify-items: start; }
  .course-grid { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr; }
  .metric + .metric::before { display: none; }
  .metric + .metric { border-top: 1px solid var(--border); }
  .map-summary { grid-template-columns: 1fr; gap: 10px; }
  .instructor-hero { align-items: flex-start; padding: 22px; }
  .instructor-badge { width: 60px; height: 60px; font-size: 26px; }
  .application-steps { grid-template-columns: 1fr; }
  .resource-row, .plan-row { align-items: flex-start; flex-direction: column; }
  .resource-row > div:last-child, .plan-row div:last-child { justify-items: start; }
  .anti-cheat-bar { flex-wrap: wrap; }
  .reader-actions { flex-direction: column; align-items: stretch; }
  .chapter-row { flex-wrap: wrap; }
  .stage-card { grid-template-columns: 38px 1fr; }
  .stage-action { grid-column: 2; justify-items: start; text-align: left; }
}

/* ============================================================
   商管系统统一视觉
   浅灰工作区、白色导航与内容区、绿色操作、紧凑表格。
   仅覆盖视觉层，不改变既有 DOM、功能或权限逻辑。
   ============================================================ */
:root {
  --brand-green: #27833e;
  --brand-green-dark: #206f34;
  --brand-green-soft: #eff8f0;
  --work-bg: #f3f6fa;
  --work-head: #eef2f6;
  --surface: #ffffff;
  --ink: #444c55;
  --muted: #8b95a1;
  --line: #e6eaf0;
  --border: #e6eaf0;
  --blue-50: #eff8f0;
  --blue-100: #dcefe1;
  --blue-500: #27833e;
  --blue-600: #27833e;
  --blue-700: #206f34;
  --green: #27833e;
  --green-bg: #eff8f0;
  --side: #ffffff;
  --side-hover: #f2f7f3;
  --n-0: #ffffff;
  --n-50: #f8fafc;
  --n-100: #f3f6fa;
  --n-200: #e6eaf0;
  --n-300: #d7dde5;
  --n-500: #8b95a1;
  --n-700: #59646f;
  --n-900: #444c55;
  --shadow: none;
  --radius: 4px;
  --t-xs: .8125rem;
  --t-sm: .875rem;
  --t-base: 1rem;
  --t-lg: 1.25rem;
  --t-xl: 1.5rem;
}

body { background: var(--work-bg); color: var(--ink); }
button:focus-visible, a:focus-visible { outline: 3px solid #9bc4a4; outline-offset: 2px; }

/* 框架与导航 */
.shell { grid-template-columns: 194px minmax(0, 1fr); }
.sidebar {
  background: #fff; color: #69727d; border-right: 1px solid var(--line);
  box-shadow: none;
}
.brand { height: 60px; padding: 0 16px; gap: 9px; border-bottom: 1px solid var(--line); }
.brand-logo { width: 34px; height: 34px; display: block; flex: none; border-radius: 6px; }
.brand strong { color: #36404a; font-size: 16px; font-weight: 650; letter-spacing: .02em; }
.brand span { display: block; margin-top: 2px; color: #a0a8b2; font-size: 10px; letter-spacing: .06em; }
.ui-icon {
  width: 18px; height: 18px; display: inline-grid; place-items: center;
  flex: none; line-height: 0;
}
.ui-icon svg {
  width: 100%; height: 100%; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.nav { padding: 12px; }
.nav-group { gap: 1px; margin-bottom: 14px; }
.nav-group-title {
  padding: 10px 8px 7px; color: #a3abb5; font-size: 12px;
  font-weight: 600; letter-spacing: 0;
}
.nav-group-title:hover { color: #6c7580; background: transparent; }
.nav-group-title b { color: #a3abb5; }
.nav button:not(.nav-group-title) {
  gap: 10px; padding: 10px 12px; border-radius: 4px;
  color: #69727d; font-size: 14px;
}
.nav button:not(.nav-group-title):hover { background: #f2f7f3; color: #4f5a64; }
.nav button.active {
  background: var(--brand-green-soft) !important; color: var(--brand-green) !important;
  font-weight: 600; padding-left: 12px;
}
.nav button.active::before { width: 3px; background: #57ba6a; }
.nav .ui-icon { width: 17px; height: 17px; color: #8d97a2; }
.nav button.active .ui-icon { color: var(--brand-green); }
.profile { border-top: 1px solid var(--line); padding: 14px 12px; }
.profile label { color: #98a1ab; font-size: 12px; }
.profile select {
  color: #59646f; background: #fff; border: 1px solid #dfe5eb;
  border-radius: 4px; padding: 8px 28px 8px 9px; font-size: 13px;
}

.main { --pad-x: 24px; padding-bottom: 28px; }
.topbar {
  height: 60px; background: #fff; border-bottom-color: var(--line);
  color: var(--ink);
}
.crumb { color: #9099a4; font-size: 13px; }
.topbar-location { display: inline-flex; align-items: center; gap: 8px; }
.topbar-location .ui-icon { width: 16px; height: 16px; color: #8ca090; }
.person { gap: 9px; }
.avatar { background: #eaf6ed; color: var(--brand-green); font-weight: 600; }
.person strong { color: #46515b; font-size: 14px; }
.person span { color: #9aa3ad; font-size: 12px; }

/* 标题与首页焦点区 */
.page-title {
  min-height: 76px; margin: 20px 0 16px; padding: 15px 20px;
  align-items: center; background: var(--work-head); border: 1px solid #e7ecf2;
  border-radius: 4px;
}
.page-title h1 { font-size: 20px; letter-spacing: 0; font-weight: 600; }
.page-title p { margin-top: 5px; color: #8e99a4; font-size: 13px; line-height: 1.5; }
.eyebrow { color: #8b9b8c; font-size: 12px; letter-spacing: .08em; }
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px;
  margin-top: 20px; padding: 20px; color: var(--ink); background: var(--work-head);
  border: 1px solid #e7ecf2; border-left: 1px solid #e7ecf2; border-radius: 4px;
}
.hero::after { display: none; }
.hero h1 { margin: 4px 0 7px; max-width: none; font-size: 22px; line-height: 1.35; letter-spacing: 0; font-weight: 600; }
.hero p { max-width: 720px; margin: 0; color: #8e99a4; font-size: 13px; line-height: 1.6; }
.hero-stats { grid-column: 2; grid-row: 1 / span 3; align-self: center; margin: 0; gap: 0; }
.hero-stats > div { min-width: 92px; padding: 5px 18px; border-left: 1px solid #dce2e9; }
.hero-stats strong { color: var(--brand-green); font-size: 24px; font-weight: 550; }
.hero-stats span { color: #8b95a1; font-size: 12px; }
.section-head { margin: 24px 0 12px; align-items: center; }
.section-head h2 { font-size: 16px; font-weight: 600; letter-spacing: 0; }
.section-head p { color: #98a1ab; font-size: 12px; }

/* 操作、标签与状态 */
.primary {
  border: 1px solid var(--brand-green); border-radius: 3px;
  background: var(--brand-green); color: #fff; padding: 8px 14px;
  box-shadow: none; font-size: 14px; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
}
.primary:hover { background: var(--brand-green-dark); border-color: var(--brand-green-dark); transform: none; }
.secondary {
  border: 1px solid #dfe5eb; border-radius: 3px;
  background: #fff; color: #59646f; padding: 8px 14px; font-size: 14px; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
}
.secondary:hover { background: #f3f6f4; }
.link-btn { color: var(--brand-green); font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.link-btn:hover { color: var(--brand-green-dark); text-decoration: underline; }
.tag, .status {
  border-radius: 3px; padding: 4px 8px; font-size: 12px; font-weight: 500;
}
.tag { color: #a16d25; background: #faf4e4; }
.tag.green, .status.completed { color: var(--brand-green); background: var(--brand-green-soft); }
.status.learning, .status.available { color: #688da7; background: #edf4f8; }
.status.pending_exam, .status.locked, .status.not_started { color: #8b95a1; background: #f1f4f7; }

/* 内容容器与任务 */
.panel, .task-card, .course-card, .review-card, .role-card, .progress-card {
  background: #fff; border: 1px solid var(--line); border-radius: 4px; box-shadow: none;
}
.panel { padding: 20px; margin-top: 14px; }
.task-card { padding: 18px 20px; gap: 22px; }
.task-card h3 { margin: 9px 0 6px; font-size: 16px; }
.task-action strong { color: var(--brand-green); font-size: 22px; }
.meta { color: #8b95a1; font-size: 12px; }
.progress { height: 5px; margin-top: 14px; background: #edf1f4; }
.progress span { background: #78a66f; }

/* 课程资源 */
.course-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.course-card { padding: 14px; transition: border-color .15s, background .15s; }
.course-card:hover { transform: none; border-color: #cbd8ce; box-shadow: none; background: #fcfefc; }
.course-cover { height: 104px; padding: 14px; border-radius: 4px; color: #50634f; background: #edf5e9; }
.course-cover.store { background: #f5f1e9; color: #8e795a; }
.course-cover.play { background: #eef1f6; color: #708095; }
.cover-icon { width: 36px; height: 36px; border-radius: 4px; font-size: 15px; }
.cover-icon .ui-icon { width: 20px; height: 20px; }
.course-foot .link-btn .ui-icon { width: 14px; height: 14px; transition: transform .15s ease; }
.course-foot .link-btn:hover .ui-icon { transform: translateX(2px); }
.type-chip { border-radius: 3px; background: #ffffffd9; font-size: 11px; }
.course-card h3 { margin: 12px 0 4px; font-size: 15px; }
.course-card p { min-height: 40px; color: #8b95a1; font-size: 13px; }
.course-foot { margin-top: 10px; color: #8b95a1; font-size: 12px; }

/* 指标与表格 */
.metrics, .metric-grid { gap: 1px; margin: 16px 0; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; background: var(--line); }
.metric { min-height: 94px; padding: 16px 20px; background: #fff; border: 0; border-radius: 0; }
.metric + .metric::before { display: none; }
.metric span { color: #8b95a1; font-size: 12px; }
.metric strong { color: #444c55; font-size: 23px; font-weight: 550; }
.table-wrap { margin: 0 -20px; border-top: 1px solid var(--line); }
.panel > .table-wrap:last-child { margin-bottom: -20px; }
table { font-size: 13px; }
thead { background: #f3f6fa; color: #8b96a2; }
th { padding: 10px 15px; border-color: #e9edf2; font-size: 12px; font-weight: 500; }
td { padding: 13px 15px; border-color: #edf0f4; }
tbody tr:hover { background: #f9fcfa; }
.filter-bar { margin: 0 0 16px; }
.filter-bar input, .filter-bar select, .head-actions select, .role-assign-form select {
  min-height: 36px; border-radius: 3px; border-color: #dfe5eb; font-size: 13px;
}
.filter-bar input:focus, .filter-bar select:focus, .head-actions select:focus, .role-assign-form select:focus {
  border-color: #72a77d; box-shadow: 0 0 0 2px #e8f4ea;
}
.pagination { padding-bottom: 0; }
.pagination button { border-radius: 3px; font-size: 13px; }
.pagination button.primary { background: var(--brand-green); border-color: var(--brand-green); }

/* 地图、证书与内训师 */
.map-summary { padding: 16px 20px; border-radius: 4px; }
.learning-map::before { background: #dfe5eb; }
.stage-card { border-radius: 4px; padding: 17px 20px 17px 14px; }
.stage-card.available { border-color: #78a982; box-shadow: inset 3px 0 0 #57ba6a; }
.stage-card.available .stage-index { background: var(--brand-green); }
.stage-action strong { color: var(--brand-green); }
.requirement { border-radius: 3px; }
.certificate { border-radius: 4px; background: #f4faf5; border-color: #dcebe0; }
.cert-seal { border-color: var(--brand-green); color: var(--brand-green); }
.instructor-hero { padding: 24px; border: 1px solid var(--line); border-left: 3px solid #57ba6a; border-radius: 4px; }
.instructor-badge { border-color: #dcebe0; color: var(--brand-green); }
.step-pill { color: var(--brand-green); background: var(--brand-green-soft); }
.application-steps span, .application-status, .instructor-review-card { border-radius: 4px; }
.application-steps b, .role-card small { color: var(--brand-green); }

/* 计划、资源、提示和文件 */
.resource-row, .plan-row { padding: 14px 0; }
.storage-badge, .notice-bar, .anti-cheat-bar {
  border: 1px solid #dcebe0; border-radius: 4px;
  background: #f1faf3; color: #497b54;
}
.ac-dot { background: var(--brand-green); box-shadow: 0 0 0 4px #e8f4ea; }
.file-drop { border-color: #cbd9d0; border-radius: 4px; background: #fafcfb; }
.file-drop:hover { background: #f2f8f3; border-color: #91b89a; }
.upload-progress span { background: var(--brand-green); }
.signed-link a { color: var(--brand-green); }
.attachment, .chapter-row, .dept-row { border-radius: 4px; }
.dept-icon { border-radius: 3px; color: var(--brand-green); background: var(--brand-green-soft); }

/* 学习器、考试与弹窗 */
.video-stage { border-radius: 4px; background: #263f38; }
.video-stage .progress span { background: #78b485; }
.doc-page { border-radius: 4px; background: #f8faf9; }
.result { border-radius: 4px; }
.option { border-radius: 3px; }
.option:hover { border-color: #9dbfa5; background: #f7fbf8; }
.option:has(input:checked) { border-color: #72a77d; background: #f1faf3; }
.review-modal, .learn-modal {
  border-radius: 4px; border-color: #dfe5eb; box-shadow: 0 20px 70px #13291c2b;
}
.review-modal input, .review-modal select, .review-modal textarea { border-radius: 3px; }
.review-modal input:focus, .review-modal select:focus, .review-modal textarea:focus {
  border-color: #72a77d; box-shadow: 0 0 0 2px #e8f4ea;
}
.modal-backdrop { background: #10291f60; backdrop-filter: blur(2px); }

@media (max-width: 1080px) {
  .course-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: 1fr; }
  .hero-stats { grid-column: 1; grid-row: auto; }
}

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    height: auto; position: static; flex-direction: row; align-items: center;
    overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line);
  }
  .brand { min-width: 180px; border-right: 1px solid var(--line); border-bottom: 0; }
  .nav { padding: 6px; }
  .nav-group { margin: 0; }
  .nav-group-title { padding: 7px 9px; }
  .nav button:not(.nav-group-title) { width: auto; padding: 8px 11px; white-space: nowrap; }
  .nav button.active::before { left: 0; right: 0; top: auto; bottom: 0; width: auto; height: 3px; }
  .profile { min-width: 150px; border-top: 0; border-left: 1px solid var(--line); }
  .main { --pad-x: 18px; }
}

@media (max-width: 620px) {
  .sidebar { display: block; overflow: visible; }
  .brand { min-width: 0; height: 54px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand span { display: none; }
  .nav { display: flex; overflow-x: auto; padding: 5px 8px; }
  .nav-group-title { display: none; }
  .nav-group-items { display: flex !important; }
  .profile { display: none; }
  .topbar { height: 54px; }
  .main { --pad-x: 12px; }
  .page-title { min-height: auto; margin-top: 12px; padding: 13px 14px; align-items: stretch; flex-direction: column; }
  .page-title h1 { font-size: 18px; }
  .hero { margin-top: 12px; padding: 16px; }
  .hero h1 { font-size: 19px; }
  .hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
  .hero-stats > div { min-width: 0; padding: 4px 10px; }
  .hero-stats > div:first-child { border-left: 0; padding-left: 0; }
  .hero-stats strong { font-size: 20px; }
  .task-card { grid-template-columns: 1fr; }
  .task-card > div { min-width: 0; }
  .task-card .meta { display: grid; gap: 4px; }
  .task-action { min-width: 0; }
  .course-grid { grid-template-columns: 1fr; }
  .metrics, .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric + .metric { border-top: 0; }
  .metric { min-height: 84px; padding: 13px 14px; }
  .panel { padding: 14px; }
  .table-wrap { margin: 0 -14px; }
  .panel > .table-wrap:last-child { margin-bottom: -14px; }
  .instructor-hero { padding: 18px; }
}
