﻿/* =========================================================================
   战码少年 · 课舱 (qucode.vip) 设计系统
   配色取自官方 LOGO：
     橙 #E0680B（主色） / 深靛 #303890（头盔） / 靛蓝 #484878
     天蓝 #4888B8（马甲） / 紫 #603088（盔尖） / 墨 #221714（描边）
   ========================================================================= */

:root {
  --brand: #e0680b;
  --brand-dark: #bf5505;
  --brand-light: #fdf0e4;
  --brand-soft: #f8dcbe;

  --indigo: #303890;
  --indigo-deep: #232a6b;
  --indigo-soft: #eef0fb;
  --indigo-mid: #484878;
  --violet: #603088;
  --sky: #4888b8;
  --sky-soft: #e8f2f9;

  --ink: #221714;
  --ink-2: #4a3b35;
  --muted: #857068;
  --line: #ecdfd4;
  --line-strong: #dcc9bb;

  --bg: #fbf7f3;
  --surface: #ffffff;
  --surface-2: #fdf9f5;

  --emerald: #0f8a5f;
  --emerald-soft: #e6f6ef;
  --amber: #b56a00;
  --amber-soft: #fdf1d8;
  --rose: #c02b4b;
  --rose-soft: #fde8ec;
  --slate: #6b7280;
  --slate-soft: #f1f0ef;
  --violet-soft: #f2ebf9;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(34, 23, 20, .06), 0 2px 8px rgba(34, 23, 20, .04);
  --shadow: 0 4px 16px rgba(34, 23, 20, .07), 0 1px 3px rgba(34, 23, 20, .05);
  --shadow-lg: 0 18px 48px rgba(34, 23, 20, .12);
  --sidebar-w: 248px;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC",
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-dark); text-decoration: none; }
a:hover { color: var(--brand); }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
h1 { font-size: 24px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { margin: 0 0 12px; }
img { max-width: 100%; }
code, pre, kbd { font-family: var(--mono); }
::selection { background: var(--brand-soft); }

/* ---------------------------------------------------------------- shell */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: linear-gradient(175deg, #2c2f74 0%, var(--indigo-deep) 52%, #1c2154 100%);
  color: #eff1ff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}
.sidebar::after {
  content: "";
  position: absolute;
  inset: auto -60px -90px auto;
  width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(224, 104, 11, .38), transparent 65%);
  pointer-events: none;
}

.brand-block {
  padding: 18px 16px 15px;
  display: block;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.brand-block img { height: 40px; width: auto; display: block; }
/* 品牌条：官方暗底版 Logo（Logo_w）直接放在深色侧栏上，不垫底板 */
.brand-plate {
  display: flex;
  width: 100%;
  align-items: center;
  padding: 2px 2px 2px 0;
}
.brand-plate img { width: 100%; max-width: 208px; height: auto; display: block; }
.brand-tag {
  margin-top: 11px;
  font-size: 11px;
  letter-spacing: .14em;
  color: #b9bdf0;
  text-transform: uppercase;
}

.nav { padding: 12px 10px; flex: 1; overflow-y: auto; }
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 11px;
  color: #ccd0f5;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 3px;
  transition: background .15s, color .15s;
  position: relative;
}
.nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav a.active {
  background: linear-gradient(100deg, var(--brand), #ef8a34);
  color: #fff;
  box-shadow: 0 6px 18px rgba(224, 104, 11, .35);
}
.nav a .ico { width: 18px; height: 18px; flex: 0 0 18px; opacity: .95; }
.nav a .badge-count {
  margin-left: auto;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 7px;
  min-width: 20px;
  text-align: center;
}
.nav a.active .badge-count { background: rgba(255, 255, 255, .25); }

.sidebar-foot {
  padding: 14px 16px 18px;
  border-top: 1px solid rgba(255, 255, 255, .1);
  font-size: 12px;
  color: #9ea4dd;
  line-height: 1.7;
}
.sidebar-foot strong { color: #ffd9b8; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 26px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar h1 { font-size: 17px; font-weight: 700; }
.topbar .crumb { color: var(--muted); font-size: 13px; }
.topbar .spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  position: relative;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  transition: .15s;
}
.icon-btn:hover { border-color: var(--brand-soft); background: var(--brand-light); color: var(--brand-dark); }
.icon-btn .dot {
  position: absolute; top: 7px; right: 8px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 2px #fff;
}

.user-menu { position: relative; }
.user-menu > summary { list-style: none; cursor: pointer; }
.user-menu > summary::-webkit-details-marker { display: none; }

.user-chip {
  height: 38px;
  display: flex; align-items: center; gap: 8px;
  padding: 0 10px 0 5px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: .15s;
  user-select: none;
}
.user-chip:hover { border-color: var(--brand-soft); background: var(--brand-light); }
.user-menu[open] .user-chip { border-color: var(--brand-soft); background: var(--brand-light); }

.user-chip .avatar {
  width: 28px; height: 28px; flex: 0 0 28px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--brand), #f2a152);
  color: #fff; font-weight: 700; font-size: 12.5px;
  display: grid; place-items: center;
}
.user-chip .who { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.user-chip .name { font-size: 12.5px; font-weight: 650; color: var(--ink); white-space: nowrap; }
.user-chip .roles { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.user-chip .chev { color: var(--muted); flex: 0 0 auto; transition: transform .15s; }
.user-menu[open] .chev { transform: rotate(180deg); }

.user-pop {
  position: absolute; right: 0; top: calc(100% + 10px);
  width: 248px; z-index: 60;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(34, 23, 20, .14);
  padding: 8px;
  animation: pop-in .12s ease-out;
}
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.user-pop-head { display: flex; align-items: center; gap: 10px; padding: 8px 8px 6px; }
.user-pop-head strong { font-size: 13.5px; display: block; }
.user-pop-head .avatar.lg {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%;
  background: linear-gradient(140deg, var(--brand), #f2a152);
  color: #fff; font-weight: 700; font-size: 14px;
  display: grid; place-items: center;
}
.user-pop-roles { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 8px 8px; }

.user-pop-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; padding: 8px 10px;
  border: none; background: none; border-radius: 9px;
  font-size: 13px; color: var(--ink-2); text-align: left; cursor: pointer;
  text-decoration: none;
}
.user-pop-item:hover { background: var(--brand-light); color: var(--brand-dark); }
.user-pop-item.danger { color: var(--rose); }
.user-pop-item.danger:hover { background: #fdeceb; color: #b3261e; }
.user-pop-item .badge-count { margin-left: auto; }
.user-pop-sep { height: 1px; background: var(--line); margin: 6px 8px; }

.content { padding: 26px 26px 34px; max-width: 1360px; width: 100%; flex: 1 0 auto; display: flex; flex-direction: column; }

/* ---------------------------------------------------------------- bits */
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.page-head .actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
}
.card-head h2 { font-size: 15px; }
.card-head .actions { margin-left: auto; display: flex; gap: 8px; }
.card-body { padding: 20px; }
.card-body.tight { padding: 0; }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr));   align-items: start;
}
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px;
  border-radius: 11px;
  border: 1px solid transparent;
  background: var(--brand);
  color: #fff;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: .16s;
  white-space: nowrap;
  font-family: inherit;
}
.btn:hover { background: var(--brand-dark); color: #fff; transform: translateY(-1px); }
.btn:active { transform: none; }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }
.btn.ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink-2); }
.btn.ghost:hover { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-light); }
.btn.indigo { background: var(--indigo); }
.btn.indigo:hover { background: var(--indigo-deep); }
.btn.danger { background: var(--rose); }
.btn.danger:hover { background: #9d1f3a; }
.btn.success { background: var(--emerald); }
.btn.sm { padding: 6px 12px; font-size: 12px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn.link { background: none; color: var(--brand-dark); padding: 4px 2px; }
.btn.link:hover { background: none; text-decoration: underline; transform: none; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.8;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge--slate { background: var(--slate-soft); color: var(--slate); border-color: #e3e2e1; }
.badge--amber { background: var(--amber-soft); color: var(--amber); border-color: #f5e0b4; }
.badge--violet { background: var(--violet-soft); color: var(--violet); border-color: #e2d3f0; }
.badge--emerald { background: var(--emerald-soft); color: var(--emerald); border-color: #bfe8d6; }
.badge--rose { background: var(--rose-soft); color: var(--rose); border-color: #f6c9d3; }
.badge--sky { background: var(--sky-soft); color: var(--sky); border-color: #c9e2f0; }
.badge--brand { background: var(--brand-light); color: var(--brand-dark); border-color: var(--brand-soft); }

.kpi { padding: 18px 20px; }
.kpi .label { font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.kpi .value { font-size: 30px; font-weight: 800; line-height: 1.15; margin-top: 6px; letter-spacing: -.02em; }
.kpi .value small { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.kpi .foot { font-size: 12px; color: var(--muted); margin-top: 6px; }
.kpi.accent { background: linear-gradient(140deg, #fff6ee, #fdecdc); border-color: #f7dcc4; }
.kpi.accent .value { color: var(--brand-dark); }

.progress { height: 7px; border-radius: 999px; background: #f0e6dd; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), #f2a152); }
.progress.emerald > span { background: linear-gradient(90deg, var(--emerald), #46c295); }
.progress.indigo > span { background: linear-gradient(90deg, var(--indigo), #6b74d6); }

.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; font-weight: 600; font-size: 12px; color: var(--muted);
  letter-spacing: .04em; text-transform: none;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  white-space: nowrap;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #fffaf5; }
.table .num { font-variant-numeric: tabular-nums; font-weight: 600; }
.table a.strong { font-weight: 600; color: var(--ink); }
.table a.strong:hover { color: var(--brand-dark); }
.table-wrap { overflow-x: auto; }

.empty { padding: 54px 20px; text-align: center; color: var(--muted); }
.empty img { width: 132px; opacity: .9; margin-bottom: 14px; }
.empty h3 { color: var(--ink-2); margin-bottom: 6px; }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex.wrap { flex-wrap: wrap; }
.flex.between { justify-content: space-between; }
.flex.col { flex-direction: column; align-items: stretch; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; } .mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }

/* ---------------------------------------------------------------- forms */
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink-2); }
.form-row .hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
input[type="text"], input[type="password"], input[type="email"], input[type="url"],
input[type="number"], input[type="search"], input[type="date"], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  font-family: inherit;
  font-size: 13.5px;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(224, 104, 11, .12);
}
textarea { min-height: 96px; resize: vertical; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; cursor: pointer; }
.check input { width: auto; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }

.filters {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end;
  padding: 14px 16px; margin-bottom: 16px;
}
.filters .field { min-width: 130px; }
.filters .field label { font-size: 11px; color: var(--muted); display: block; margin-bottom: 4px; }
.filters select, .filters input { padding: 7px 10px; font-size: 13px; }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs a {
  padding: 10px 16px; font-size: 13.5px; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a.active { color: var(--brand-dark); border-bottom-color: var(--brand); }
.tabs a:hover { color: var(--ink); }

/* ---------------------------------------------------------------- flash */
.flash-stack { position: fixed; top: 76px; right: 22px; z-index: 90; display: flex; flex-direction: column; gap: 10px; max-width: 420px; }
.flash {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-lg); font-size: 13px;
  animation: slideIn .22s ease-out;
}
.flash .bar { width: 4px; align-self: stretch; border-radius: 4px; background: var(--slate); }
.flash.success .bar { background: var(--emerald); }
.flash.error .bar { background: var(--rose); }
.flash.warning .bar { background: var(--amber); }
.flash.info .bar { background: var(--sky); }
.flash .close { margin-left: auto; cursor: pointer; color: var(--muted); background: none; border: none; font-size: 16px; line-height: 1; }
@keyframes slideIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- login */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; background: var(--bg); }
.login-brand {
  position: relative;
  background: radial-gradient(120% 120% at 10% 0%, #3a3f8f 0%, var(--indigo-deep) 45%, #191c47 100%);
  color: #fff;
  padding: 54px 56px;
  display: flex; flex-direction: column; justify-content: space-between;
  overflow: hidden;
}
.login-brand::before {
  content: ""; position: absolute; right: -110px; bottom: -130px;
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(224, 104, 11, .42), transparent 62%);
}
.login-brand::after {
  content: ""; position: absolute; left: -80px; top: -80px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(96, 48, 136, .55), transparent 65%);
}
.login-brand .logo img { height: 60px; }
.login-brand .logo-plaque {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .28);
}
.login-brand .logo-plaque img {
  height: 42px;
  width: auto;
  display: block;
}
.login-brand .hero { position: relative; z-index: 2; margin: 40px 0; max-width: 56%; }
.login-brand .hero h1 { font-size: clamp(24px, 2.2vw, 36px); line-height: 1.25; color: #fff; letter-spacing: -.02em; }
.login-brand .hero h1 em { font-style: normal; color: #ffb163; }
.login-brand .hero p { color: #c6c9ee; font-size: 14px; max-width: 24em; margin-top: 14px; }
.login-brand .mascot {
  position: absolute; right: 3.5%; bottom: 96px;
  width: 38%; max-width: 320px; opacity: .97;
  filter: drop-shadow(0 24px 40px rgba(0, 0, 0, .4));
  z-index: 1;
}
.login-brand .features { position: relative; z-index: 1; display: flex; gap: 20px; flex-wrap: wrap; }
.login-brand .features div { font-size: 12.5px; color: #b9bdf0; }
.login-brand .features strong { display: block; color: #fff; font-size: 20px; font-weight: 800; }

.login-panel { display: grid; place-items: center; padding: 40px; }
.login-card { width: 100%; max-width: 384px; }
.login-card .logo-mobile { display: none; }
.login-card h2 { font-size: 26px; margin-bottom: 6px; }
.login-card .sub { color: var(--muted); margin-bottom: 26px; }
.login-card .field { margin-bottom: 16px; }
.login-card .field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; }
.login-card input { padding: 12px 14px; font-size: 14px; }
.login-card .btn { padding: 12px; font-size: 14px; margin-top: 6px; }
.login-card .foot { margin-top: 26px; font-size: 12px; color: var(--muted); text-align: center; line-height: 1.9; }
.form-error {
  background: var(--rose-soft); border: 1px solid #f6c9d3; color: var(--rose);
  padding: 10px 12px; border-radius: 10px; font-size: 13px; margin-bottom: 14px;
}

/* ---------------------------------------------------------------- course */
.course-card { display: flex; flex-direction: column; gap: 12px; padding: 18px; transition: .18s; }
.course-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--brand-soft); }
.course-card .top { display: flex; gap: 12px; align-items: flex-start; }
.course-card .cover {
  width: 46px; height: 46px; border-radius: 13px; flex: 0 0 46px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--brand-light), #f9e3cc);
  color: var(--brand-dark); font-weight: 800; font-size: 17px;
  border: 1px solid var(--brand-soft);
}
.course-card h3 { font-size: 15.5px; line-height: 1.35; }
.course-card .meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.course-card .stats { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.course-card .stats b { color: var(--ink-2); }
.req-chips { display: flex; gap: 5px; flex-wrap: wrap; }
.chip {
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2);
}
.chip.off { color: #b6aca5; text-decoration: line-through; background: transparent; }

.outline { display: flex; flex-direction: column; gap: 20px; }
.chapter-block { }
.chapter-title { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.chapter-title .idx {
  width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center;
  background: var(--indigo-soft); color: var(--indigo); font-size: 12px; font-weight: 700;
}
.lesson-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); margin-bottom: 7px;
}
.lesson-row:hover { border-color: var(--brand-soft); background: #fffaf5; }
.lesson-row .order {
  font-family: var(--mono); font-size: 12px; color: var(--muted); width: 26px;
}
.lesson-row .title { font-weight: 600; font-size: 13.5px; }
.lesson-row .title a { color: var(--ink); }
.lesson-row .title a:hover { color: var(--brand-dark); }
.lesson-row .metrics { margin-left: auto; display: flex; gap: 10px; align-items: center; font-size: 12px; }
.dot-set { display: flex; gap: 4px; }
.dot {
  width: 18px; height: 18px; border-radius: 6px; display: grid; place-items: center;
  font-size: 9px; font-weight: 700; background: var(--slate-soft); color: var(--slate);
}
.dot.ok { background: var(--emerald-soft); color: var(--emerald); }
.dot.open { background: var(--amber-soft); color: var(--amber); }
.dot.bad { background: var(--rose-soft); color: var(--rose); }
.dot.none { background: #f6f1ec; color: #c0b3a9; }

/* ---------------------------------------------------------------- material */
.material-hero { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: start; }
.status-strip {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px;
  background: var(--line); border-radius: 12px; overflow: hidden; border: 1px solid var(--line);
}
.status-strip > div { background: var(--surface); padding: 12px 14px; }
.status-strip .k { font-size: 11px; color: var(--muted); }
.status-strip .v { font-weight: 700; font-size: 14px; margin-top: 2px; }

.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline-item { position: relative; padding: 0 0 16px 8px; }
.timeline-item::before {
  content: ""; position: absolute; left: -19px; top: 5px;
  width: 10px; height: 10px; border-radius: 50%; background: var(--brand);
  box-shadow: 0 0 0 3px #fff;
}
.timeline-item.is-muted::before { background: var(--line-strong); }
.timeline-item .t { font-size: 11px; color: var(--muted); }
.timeline-item .h { font-weight: 600; font-size: 13px; margin: 2px 0; }
.timeline-item .c { font-size: 12.5px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; margin-top: 5px; }

/* 预览：水印 + 沙箱 */
.preview-shell { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #fff; }
.preview-shell iframe { width: 100%; height: 72vh; border: 0; display: block; background: #fff; }
.watermark {
  position: absolute; inset: 0; pointer-events: none; z-index: 5;
  background-image: repeating-linear-gradient(
    -32deg, rgba(34, 23, 20, .055) 0 2px, transparent 2px 160px
  );
  display: flex; align-items: flex-end; justify-content: flex-end;
  padding: 14px; font-size: 11px; color: rgba(34, 23, 20, .32);
}
.markdown-body { padding: 34px 40px; max-width: 860px; margin: 0 auto; font-size: 15px; line-height: 1.8; color: #2b211d; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 { margin: 1.4em 0 .6em; line-height: 1.35; }
.markdown-body h1 { font-size: 26px; padding-bottom: .3em; border-bottom: 2px solid var(--brand-soft); }
.markdown-body h2 { font-size: 20px; padding-bottom: .25em; border-bottom: 1px solid var(--line); }
.markdown-body h3 { font-size: 17px; }
.markdown-body p, .markdown-body ul, .markdown-body ol { margin: 0 0 1em; }
.markdown-body ul, .markdown-body ol { padding-left: 1.6em; }
.markdown-body code { background: #f6efe8; padding: 1px 5px; border-radius: 5px; font-size: .9em; color: #b04a06; }
.markdown-body pre {
  background: #241d1a; color: #f6ece4; padding: 16px 18px; border-radius: 12px;
  overflow-x: auto; font-size: 13px; line-height: 1.6;
}
.markdown-body pre code { background: none; color: inherit; padding: 0; }
.markdown-body blockquote {
  margin: 1em 0; padding: 10px 16px; border-left: 4px solid var(--brand);
  background: var(--brand-light); border-radius: 0 10px 10px 0; color: var(--ink-2);
}
.markdown-body table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: 13.5px; }
.markdown-body th, .markdown-body td { border: 1px solid var(--line); padding: 8px 11px; text-align: left; }
.markdown-body th { background: var(--surface-2); font-weight: 600; }
.markdown-body img { border-radius: 10px; }
.markdown-body a { text-decoration: underline; text-underline-offset: 2px; }
.markdown-body hr { border: none; border-top: 1px dashed var(--line-strong); margin: 2em 0; }

.question-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; background: var(--surface); }
.question-card .stem { font-weight: 600; margin-bottom: 8px; }
.question-card .opt { display: flex; gap: 8px; font-size: 13px; padding: 4px 0; color: var(--ink-2); }
.question-card .opt b { color: var(--brand-dark); }
.answer-pill { display: inline-block; background: var(--emerald-soft); color: var(--emerald); border-radius: 8px; padding: 2px 8px; font-size: 12px; font-weight: 600; }

/* ---------------------------------------------------------------- review */
.review-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.review-side { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 14px; }
.review-frame { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.review-frame iframe { width: 100%; height: 68vh; border: 0; display: block; }
.meta-list { display: flex; flex-direction: column; gap: 9px; font-size: 13px; }
.meta-list .row { display: flex; gap: 10px; }
.meta-list .row .k { color: var(--muted); width: 72px; flex: 0 0 72px; }
.meta-list .row .v { font-weight: 600; word-break: break-all; }
.queue-row { display: flex; align-items: center; gap: 14px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.queue-row:last-child { border-bottom: none; }
.queue-row:hover { background: #fffaf5; }
.queue-row .who { width: 120px; flex: 0 0 120px; font-size: 12px; color: var(--muted); }

/* ---------------------------------------------------------------- misc */
.banner {
  display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px;
  font-size: 13px; border: 1px solid var(--line); background: var(--surface-2);
}
.banner.warn { background: var(--amber-soft); border-color: #f3dfb6; color: #7a4a00; }
.banner.danger { background: var(--rose-soft); border-color: #f6c9d3; color: #8f1e39; }
.banner.ok { background: var(--emerald-soft); border-color: #bfe8d6; color: #0b6b4a; }
.banner.info { background: var(--sky-soft); border-color: #c9e2f0; color: #2b5f80; }
.banner .ico { font-weight: 800; }

.pagination { display: flex; gap: 6px; justify-content: center; align-items: center; margin-top: 22px; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 34px; height: 34px; padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px; border: 1px solid var(--line); background: var(--surface);
  font-size: 13px; color: var(--ink-2);
}
.pagination .current { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }
.pagination .disabled { opacity: .45; pointer-events: none; }

.trend { display: flex; align-items: flex-end; gap: 10px; height: 140px; padding: 0 4px; }
.trend .bar-wrap { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; }
.trend .bar {
  width: 100%; max-width: 34px; border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, #f2a152, var(--brand));
  min-height: 4px; transition: height .3s;
}
.trend .bar.appr { background: linear-gradient(180deg, #6f78da, var(--indigo)); }
.trend .lbl { font-size: 10.5px; color: var(--muted); }
.trend-legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); }
.legend-dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 5px; }

.upload-zone {
  border: 1.5px dashed var(--line-strong); border-radius: 12px; padding: 18px;
  background: var(--surface-2); text-align: center; transition: .16s;
}
.upload-zone:hover, .upload-zone.drag { border-color: var(--brand); background: var(--brand-light); }
.upload-zone .hint { font-size: 12px; color: var(--muted); }
.upload-zone input[type="file"] { display: block; margin: 10px auto 0; font-size: 12px; }

details.card > summary {
  cursor: pointer; list-style: none; padding: 16px 20px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::before { content: "▸"; color: var(--muted); transition: .15s; }
details.card[open] > summary::before { transform: rotate(90deg); }
details.card > .card-body { border-top: 1px solid var(--line); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.mobile-only { display: none !important; }
@media (max-width: 820px) { .mobile-only { display: flex !important; } }


/* ---------------------------------------------------------------- 课程树 */
.overview {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}
.ov-item {
  padding: 12px 14px;
  box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line);
}
.ov-item .k { font-size: 11px; color: var(--muted); letter-spacing: .02em; }
.ov-item .v { font-size: 22px; font-weight: 800; line-height: 1.2; margin-top: 2px; }
.ov-item .v .em, .ov-item .v.em { color: var(--emerald); }
.ov-item .v.warn { color: var(--amber); }
.ov-item .v.danger { color: var(--rose); }
.ov-item .f { font-size: 11px; color: var(--muted); margin-top: 2px; }
.ov-bar { margin-top: 14px; }
.ov-bar-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 6px; }

.tree-toolbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 11px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.tree-filter { display: flex; gap: 6px; flex-wrap: wrap; }
.tree-filter a {
  font-size: 12.5px; padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
}
.tree-filter a b { font-weight: 700; margin-left: 3px; color: var(--muted); }
.tree-filter a:hover { border-color: var(--brand-soft); color: var(--brand-dark); }
.tree-filter a.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.tree-filter a.active b { color: rgba(255, 255, 255, .88); }
.tree-legend { margin-left: auto; display: flex; gap: 12px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.tree-legend .legend-dot { width: 8px; height: 8px; border-radius: 3px; }

.tree { display: flex; flex-direction: column; gap: 10px; }
.tree-chapter { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.chapter-summary {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; cursor: pointer; list-style: none;
  background: linear-gradient(180deg, #fdfaf7, var(--surface-2));
  border-bottom: 1px solid transparent;
}
details[open] > .chapter-summary { border-bottom-color: var(--line); }
.chapter-summary::-webkit-details-marker { display: none; }
.caret {
  width: 0; height: 0; flex: 0 0 auto;
  border-left: 5px solid var(--muted);
  border-top: 4px solid transparent; border-bottom: 4px solid transparent;
  transition: transform .15s;
}
details[open] > .chapter-summary .caret { transform: rotate(90deg); }
.chapter-name { font-weight: 700; font-size: 14px; }
.chapter-meta { display: flex; gap: 10px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.chapter-meta .em { color: var(--emerald); font-weight: 600; }
.chapter-meta .warn { color: var(--amber); font-weight: 600; }
.chapter-meta .danger { color: var(--rose); font-weight: 600; }
.chapter-progress { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.chapter-bar { width: 90px; height: 6px; border-radius: 999px; background: #efe3d8; overflow: hidden; display: block; }
.chapter-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--emerald), #46c295); border-radius: inherit; }
.chapter-progress b { font-size: 11.5px; color: var(--ink-2); }

.tree-list { list-style: none; margin: 0; padding: 6px 12px 10px 34px; position: relative; }
.tree-lesson { position: relative; padding: 9px 0 9px 16px; border-bottom: 1px dashed var(--line); }
.tree-lesson:last-child { border-bottom: none; }
.tree-lesson::before {
  content: ""; position: absolute; left: -18px; top: 0; bottom: 0; width: 1px; background: var(--line-strong);
}
.tree-lesson:last-child::before { bottom: auto; height: 26px; }
.tree-lesson::after {
  content: ""; position: absolute; left: -18px; top: 26px; width: 14px; height: 1px; background: var(--line-strong);
}
.lesson-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lesson-order { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.lesson-title { font-weight: 600; font-size: 13.5px; color: var(--ink); }
.lesson-title:hover { color: var(--brand-dark); }
.slot-set { display: flex; gap: 5px; }
.slot {
  min-width: 28px; height: 22px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center; gap: 3px;
  border-radius: 7px; font-size: 11px; font-weight: 700;
  border: 1px solid transparent; cursor: default;
}
.slot--emerald { background: var(--emerald-soft); color: var(--emerald); border-color: #bfe8d6; }
.slot--amber { background: var(--amber-soft); color: var(--amber); border-color: #f5e0b4; }
.slot--violet { background: var(--violet-soft); color: var(--violet); border-color: #e2d3f0; }
.slot--rose { background: var(--rose-soft); color: var(--rose); border-color: #f6c9d3; }
.slot--slate { background: var(--slate-soft); color: var(--slate); border-color: #e3e2e1; }
.slot--muted { background: transparent; color: #b7aba2; border: 1px dashed var(--line-strong); }
.slot-dot { width: 5px; height: 5px; border-radius: 50%; background: #c9bdb3; display: inline-block; }
.issue-flag {
  font-size: 11px; color: var(--amber); background: var(--amber-soft);
  border: 1px solid #f5e0b4; border-radius: 999px; padding: 1px 8px; cursor: help;
}
.lesson-enter { margin-left: auto; }
.lesson-sub { margin: 4px 0 0 26px; font-size: 11.5px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.lesson-sub .sep { color: var(--line-strong); }
.hint--reject { color: var(--rose); font-weight: 600; }
.hint--missing { color: var(--amber); font-weight: 600; }
.hint--pending { color: var(--violet); font-weight: 600; }
.hint--draft { color: var(--slate); font-weight: 600; }
.hint--ok { color: var(--emerald); }

@media (max-width: 1180px) {
  .overview { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tree-legend { display: none; }
  .chapter-progress { margin-left: 0; }
  .lesson-enter { margin-left: 0; }
  .tree-list { padding-left: 20px; }
}

.card-progress { display: flex; flex-direction: column; gap: 6px; }
.card-progress .progress { height: 6px; }
.card-progress b { color: var(--ink-2); }
.slot-mark { font-size: 10px; line-height: 1; opacity: .95; }

/* ---------------------------------------------------------------- 客观题作答 */
.answer-card { border-radius: 14px; }
.answer-stem { font-size: 15px; font-weight: 600; line-height: 1.7; margin-bottom: 14px; }
.answer-options { display: flex; flex-direction: column; gap: 8px; }
.answer-option {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 11px;
  border: 1px solid var(--line-strong); background: var(--surface);
  cursor: pointer; transition: .15s;
}
.answer-option:hover { border-color: var(--brand); background: var(--brand-light); }
.answer-option input { width: 16px; height: 16px; accent-color: var(--brand); }
.opt-letter {
  width: 22px; height: 22px; flex: 0 0 22px;
  display: inline-grid; place-items: center;
  border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line);
  font-size: 12px; font-weight: 700; color: var(--ink-2);
}
.answer-option.is-readonly { cursor: default; }
.answer-option.is-readonly:hover { border-color: var(--line-strong); background: var(--surface); }
.answer-option.is-correct { border-color: #bfe8d6; background: var(--emerald-soft); }
.answer-option.is-correct .opt-letter { background: #fff; border-color: #bfe8d6; color: var(--emerald); }
.answer-option.is-wrong { border-color: #f6c9d3; background: var(--rose-soft); }
.answer-option.is-wrong .opt-letter { background: #fff; border-color: #f6c9d3; color: var(--rose); }
.opt-tag {
  margin-left: auto; font-size: 11px; font-weight: 700;
  padding: 1px 8px; border-radius: 999px;
  background: var(--brand); color: #fff;
}
.opt-tag.ok { background: var(--emerald); }

.answer-review {
  border: 1px solid var(--line); border-left: 3px solid var(--line-strong);
  border-radius: 12px; padding: 14px 16px; margin-bottom: 14px;
}
.answer-review.ok { border-left-color: var(--emerald); }
.answer-review.bad { border-left-color: var(--rose); }

.result-hero { display: grid; grid-template-columns: 160px 1fr; gap: 24px; align-items: center; }
.result-score { text-align: center; }
.result-score .num { font-size: 48px; font-weight: 800; color: var(--brand); line-height: 1.05; }
.result-score .num small { font-size: 16px; color: var(--muted); font-weight: 600; margin-left: 4px; }
.result-score .lbl { font-size: 12px; color: var(--muted); margin-top: 4px; }
.result-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; }
.result-meta .row { display: flex; gap: 8px; font-size: 13px; }
.result-meta .k { color: var(--muted); width: 56px; }
.result-meta .v { font-weight: 600; }
.result-bar { grid-column: 1 / -1; }

@media (max-width: 760px) {
  .result-hero { grid-template-columns: 1fr; }
  .result-score { text-align: left; }
  .result-meta { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- 面包屑 */
.breadcrumb {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: -6px 0 16px;
  font-size: 12.5px;
  color: var(--muted);
}
.crumb-back {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px 4px 8px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink-2); font-weight: 600; font-size: 12px; white-space: nowrap;
  transition: .15s;
}
.crumb-back:hover { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-light); }
.crumb-list { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.crumb-list li { display: inline-flex; align-items: center; gap: 6px; }
.crumb-list li + li::before {
  content: "›"; color: var(--line-strong); font-size: 13px; margin-right: 0;
}
.crumb-list a { color: var(--muted); }
.crumb-list a:hover { color: var(--brand-dark); }
.crumb-list .current { color: var(--ink-2); font-weight: 600; }

/* 预览页（自有头部）里的面包屑与内容同宽 */
.preview-crumb { padding: 14px 22px 0; }
.preview-crumb .breadcrumb { margin: 0; }
@media (max-width: 760px) { .preview-crumb { padding: 12px 14px 0; } }

@media (max-width: 760px) {
  .breadcrumb { font-size: 12px; gap: 8px; }
  .crumb-list { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .crumb-list::-webkit-scrollbar { display: none; }
  .crumb-list li { white-space: nowrap; }
}

/* 基础数据页：选中行提示 */
.table tr.is-selected td { background: var(--brand-light); }
.table tr.is-selected td:first-child { box-shadow: inset 3px 0 0 var(--brand); }

.lesson-actions { margin-left: auto; display: flex; gap: 6px; }

/* 组织页：校区行内编辑 */
.campus-row { border-bottom: 1px dashed var(--line); padding: 8px 0; }
.campus-row:last-child { border-bottom: none; }
.campus-row > summary {
  cursor: pointer; list-style: none; gap: 10px; padding: 4px 0;
}
.campus-row > summary::-webkit-details-marker { display: none; }
.campus-row > summary:hover strong { color: var(--brand-dark); }
.campus-edit { padding: 10px 0 4px; border-top: 1px dashed var(--line); margin-top: 6px; }

/* 侧边栏分组 */
.nav-section {
  font-size: 10.5px;
  letter-spacing: .16em;
  color: #8d93cf;
  padding: 14px 12px 6px;
  text-transform: uppercase;
}
.nav-section:first-child { padding-top: 4px; }

/* ---------------------------------------------------------------- 页脚 / 备案 */
.site-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted);
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--brand-dark); }
.site-footer .sep { color: var(--line-strong); }
.sidebar-icp {
  font-size: 11px;
  color: #8a90cd;
  margin-top: 2px;
  letter-spacing: .01em;
}
@media (max-width: 760px) {
  .site-footer { font-size: 11.5px; }
}

/* ---------------------------------------------------------------- 多格式预览 */
.pdf-wrap iframe { width: 100%; height: 82vh; border: 0; display: block; background: #525659; }
.media-wrap { padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.media-wrap img { max-width: 100%; max-height: 76vh; border-radius: 10px; box-shadow: var(--shadow); }
.media-wrap video { width: 100%; max-height: 76vh; border-radius: 12px; background: #000; }
.file-card-wrap { padding: 40px 24px; }
.file-card {
  display: flex; align-items: center; gap: 16px;
  padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
}
.file-icon {
  width: 54px; height: 54px; border-radius: 12px; flex: 0 0 54px;
  display: grid; place-items: center; font-weight: 800; font-size: 13px;
  background: var(--brand-light); color: var(--brand-dark); border: 1px solid var(--brand-soft);
}
.file-meta { flex: 1; min-width: 0; }

/* 课程卡片序号 */
.course-order {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  color: var(--brand-dark);
  background: var(--brand-light);
  border: 1px solid var(--brand-soft);
  border-radius: 999px;
  padding: 2px 8px;
  align-self: flex-start;
}

/* 登录页辅助提示 */
.login-tip {
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
  background: var(--brand-light);
  border: 1px solid var(--brand-soft);
  border-radius: 10px;
  padding: 9px 12px;
  margin: 2px 0 14px;
}

/* ---------------------------------------------------------------- 组织与权限布局 */
.org-layout { gap: 24px; }
.org-main { display: grid; gap: 28px; align-content: start; }
.org-side { display: grid; gap: 16px; align-content: start; }
@media (max-width: 1180px) {
  .org-layout { grid-template-columns: minmax(0, 1fr) !important; }
}

/* ---------------------------------------------------------------- 可多份资料条目 */
.material-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
}
.material-item:last-of-type { border-bottom: none; }
.material-item-main { min-width: 0; flex: 1; }
.material-item-title {
  font-size: 13px; font-weight: 600; color: var(--ink);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 2px;
}
.material-item-actions { display: flex; gap: 6px; flex: 0 0 auto; }
@media (max-width: 760px) {
  .material-item { flex-wrap: wrap; }
  .material-item-actions { width: 100%; justify-content: flex-end; }
}

/* 课程树：同类多份数量角标 */
.slot-count {
  font-size: 9.5px; font-weight: 800; line-height: 1;
  color: var(--brand-dark);
  background: var(--brand-light);
  border-radius: 999px;
  padding: 2px 4px;
  margin-left: 2px;
  align-self: flex-start;
}

/* ---------------------------------------------------------------- 视频预览 + 播放列表 */
.video-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 0;
  min-height: 60vh;
}
.video-main {
  padding: 18px;
  display: flex; flex-direction: column; gap: 10px;
  background: #1a1c2b;
}
.video-main video {
  width: 100%;
  max-height: 68vh;
  border-radius: 12px;
  background: #000;
  display: block;
}
.video-caption {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  color: #e8e9f6; font-size: 13px;
}
.video-caption .muted { color: #9a9ec2; }

.video-playlist {
  border-left: 1px solid var(--line);
  background: var(--surface);
  display: flex; flex-direction: column;
  min-height: 0;
}
.playlist-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  font-size: 12.5px; font-weight: 700;
  border-bottom: 1px solid var(--line);
}
.playlist-body { overflow-y: auto; flex: 1; padding: 6px; max-height: 62vh; }
.playlist-item {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 9px 10px;
  border-radius: 10px;
  color: var(--ink-2);
  text-decoration: none;
}
.playlist-item:hover { background: var(--brand-light); }
.playlist-item.on {
  background: var(--brand-light);
  color: var(--brand-dark);
  box-shadow: inset 3px 0 0 var(--brand);
}
.playlist-idx {
  flex: 0 0 20px; height: 20px;
  display: grid; place-items: center;
  border-radius: 6px;
  font-size: 11px; font-weight: 700;
  background: rgba(48, 56, 144, .08);
  color: var(--ink-2);
}
.playlist-item.on .playlist-idx { background: var(--brand); color: #fff; }
.playlist-text { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.playlist-title {
  font-size: 13px; font-weight: 600; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.playlist-meta { font-size: 11px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.playlist-back {
  margin-top: auto;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--muted);
  text-decoration: none;
}
.playlist-back:hover { color: var(--brand-dark); }

@media (max-width: 860px) {
  .video-layout { grid-template-columns: minmax(0, 1fr); }
  .video-playlist { border-left: none; border-top: 1px solid var(--line); max-height: none; }
  .playlist-body { max-height: 40vh; }
}
/* ---------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-layout { grid-template-columns: 1fr; }
  .review-side { position: static; }
}
@media (max-width: 960px) {
  .shell { display: block; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 60;
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .content { padding: 18px 16px 60px; }
  .topbar { padding: 0 14px; gap: 10px; }
  .topbar > div:first-of-type { min-width: 0; flex: 1 1 auto; overflow: hidden; }
  .topbar h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
  .login-page { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-card .logo-mobile { display: block; margin-bottom: 22px; }
  .login-card .logo-mobile img { height: 46px; }
  .form-grid { grid-template-columns: 1fr; }
  .status-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flash-stack { left: 16px; right: 16px; max-width: none; }
  .grid[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
}
@media (max-width: 820px) {
  .topbar { height: 58px; }
  .topbar-actions { display: none; }
  .topbar .sub { display: none; }
  .user-chip .who, .user-chip .chev { display: none; }
  .user-chip { padding: 0 4px; }
}
@media (max-width: 640px) {
  .grid.cols-4 { grid-template-columns: 1fr; }
  .grid.cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { padding: 14px 16px; }
  .kpi .value { font-size: 24px; }
  .page-head { align-items: flex-start; }
  .page-head .actions { margin-left: 0; width: 100%; }
  .material-hero { grid-template-columns: 1fr; }
  .queue-row { flex-wrap: wrap; }
  .queue-row .who { width: auto; flex: none; }
  .markdown-body { padding: 20px 18px; }
  .trend { gap: 5px; }
  .content { padding: 14px 12px 60px; }
}
