:root {
  --bg: #F5F3EF;
  --surface: #FFFFFF;
  --surface-2: #FAF8F5;
  --ink: #1C2128;
  --ink-2: #48505C;
  --muted: #7A818C;
  --line: #E7E2DA;
  --line-2: #F0ECE6;
  --accent: #E8772E;
  --accent-ink: #B3561A;
  --accent-soft: #FDF0E6;
  --good: #2E8B57;
  --good-soft: #E7F4EC;
  --warn: #C98A12;
  --bad: #C8473B;
  --bad-soft: #FBEAE8;
  --side: #1D232D;
  --side-ink: #C9CED6;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(28,33,40,.05), 0 4px 16px rgba(28,33,40,.05);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Noto Sans Thai", "Sarabun", "Leelawadee UI", "Tahoma", sans-serif;
}
* { 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.55; -webkit-font-smoothing: antialiased; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 14px; }
.num { font-variant-numeric: tabular-nums; }

/* 按钮与表单 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--surface-2); border-color: #D9D2C7; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #D96B24; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); border-color: #F0C9C4; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--line-2); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.input, select.input, textarea.input { width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; outline: none; transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232,119,46,.15); }
.field { display: block; }
.field > span { display: block; font-size: 13px; font-weight: 550; color: var(--ink-2); margin-bottom: 6px; }
.field > span em { font-style: normal; color: var(--muted); font-weight: 400; margin-left: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.form-error { color: var(--bad); font-size: 13px; min-height: 20px; }
.chips-select { display: flex; flex-wrap: wrap; gap: 8px; }
.chips-select label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: 13px; background: var(--surface); }
.chips-select label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.chips-select input { display: none; }

/* 卡片、标签、进度条 */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; }
.chip.good { background: var(--good-soft); color: var(--good); }
.chip.accent { background: var(--accent-soft); color: var(--accent-ink); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.bar { position: relative; height: 6px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.bar > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--accent); }
.bar.good > i { background: var(--good); }
.barline { display: flex; align-items: center; gap: 10px; min-width: 140px; }
.barline .bar { flex: 1; }
.barline b { font-size: 12.5px; font-weight: 600; min-width: 36px; text-align: right; font-variant-numeric: tabular-nums; }

/* 顶栏（学员端） */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1180px; margin: 0 auto; height: 60px; display: flex; align-items: center; gap: 14px; padding: 0 24px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; color: var(--ink); }
.logo:hover { text-decoration: none; }
.logo-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 800; letter-spacing: -.5px; }
.lang-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.lang-switch button { border: 0; background: transparent; padding: 0 10px; height: 30px; font: inherit; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.lang-switch button.on { background: var(--ink); color: #fff; }
.user-pill { display: flex; align-items: center; gap: 8px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.container { max-width: 1180px; margin: 0 auto; padding: 28px 24px 60px; }

/* 学员首页 */
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; margin-bottom: 26px; }
.hero > *, .two-col > *, .player-layout > *, .stack > * { min-width: 0; }
.hero-main { padding: 26px; display: flex; align-items: center; gap: 26px; }
.ring { --p: 0; width: 104px; height: 104px; border-radius: 50%; flex: none; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--line-2) 0); display: grid; place-items: center; }
.ring > div { width: 82px; height: 82px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 22px; font-weight: 750; font-variant-numeric: tabular-nums; }
.continue { padding: 22px 24px; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; background: linear-gradient(135deg, #2A303B, #1D232D); color: #fff; border: 0; }
.continue .muted { color: #A9B0BB; }
.continue h3 { font-size: 16px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs button { border: 0; background: transparent; padding: 10px 14px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.tabs button .count { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.course { margin-bottom: 16px; overflow: hidden; }
.course-head { display: flex; align-items: center; gap: 14px; padding: 16px 20px; cursor: pointer; }
.course-code { font-size: 12px; font-weight: 700; color: var(--accent-ink); background: var(--accent-soft); padding: 3px 8px; border-radius: 6px; font-variant-numeric: tabular-nums; }
.course-head .barline { width: 220px; }
.course-head .caret { transition: transform .2s; color: var(--muted); }
.course.open .caret { transform: rotate(90deg); }
.lesson-list { border-top: 1px solid var(--line-2); display: none; }
.course.open .lesson-list { display: block; }
.lesson-row { display: flex; align-items: center; gap: 14px; padding: 12px 20px 12px 24px; border-bottom: 1px solid var(--line-2); color: var(--ink); }
.lesson-row:last-child { border-bottom: 0; }
.lesson-row:hover { background: var(--surface-2); text-decoration: none; }
.lesson-row.disabled { pointer-events: none; opacity: .55; }
.lesson-idx { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: 12px; font-weight: 650; color: var(--muted); flex: none; }
.lesson-row.done .lesson-idx { background: var(--good); border-color: var(--good); color: #fff; }
.lesson-row.doing .lesson-idx { border-color: var(--accent); color: var(--accent-ink); }
.lesson-title { flex: 1; min-width: 0; }
.lesson-row .barline { width: 160px; min-width: 0; }

/* 播放页 */
.player-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.video-wrap { background: #0E1116; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16/9; position: relative; }
.video-wrap video { width: 100%; height: 100%; display: block; background: #000; }
.video-empty { position: absolute; inset: 0; display: grid; place-items: center; color: #9AA1AB; }
.notice { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-ink); font-size: 13px; }
.notice.good { background: var(--good-soft); color: var(--good); }
.side-list .lesson-row { padding: 11px 16px; }
.side-list .lesson-row.current { background: var(--accent-soft); }
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; margin-bottom: 14px; flex-wrap: wrap; }

/* 登录 */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-brand { background: linear-gradient(150deg, #262C37 0%, #1A1F27 100%); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-brand h1 { font-size: 32px; line-height: 1.25; max-width: 460px; }
.auth-brand p { color: #A9B0BB; max-width: 420px; font-size: 15px; }
.auth-brand .grid-art { position: absolute; right: -60px; bottom: -40px; opacity: .22; }
.auth-form { display: grid; place-items: center; padding: 40px; }
.auth-form .box { width: 100%; max-width: 360px; }

/* 管理后台 */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; background: linear-gradient(to right, var(--side) 232px, var(--bg) 232px); }
.side { background: var(--side); color: var(--side-ink); padding: 18px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.side .logo { color: #fff; padding: 4px 8px 18px; }
.side a.nav { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--side-ink); font-weight: 550; }
.side a.nav:hover { background: rgba(255,255,255,.06); text-decoration: none; color: #fff; }
.side a.nav.on { background: rgba(232,119,46,.16); color: #FFB27D; }
.side a.nav svg { width: 18px; height: 18px; flex: none; }
.side .foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,.08); padding-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.main { min-width: 0; }
.main-head { display: flex; align-items: center; gap: 12px; padding: 18px 32px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 10; }
.main-body { padding: 26px 32px 60px; }
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 22px; }
.stat { padding: 16px 18px; }
.stat .v { font-size: 26px; font-weight: 750; font-variant-numeric: tabular-nums; margin-top: 4px; }
.stat .l { font-size: 12.5px; color: var(--muted); }
.two-col { display: grid; grid-template-columns: 1fr 1.25fr; gap: 20px; }
.disc-row { display: grid; grid-template-columns: 140px 1fr 90px; align-items: center; gap: 14px; padding: 12px 20px; border-bottom: 1px solid var(--line-2); }
.disc-row:last-child { border-bottom: 0; }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .input { width: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); 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-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #FCFBF9; }
.table-wrap { overflow-x: auto; }
.who { display: flex; align-items: center; gap: 10px; }
.who b { font-weight: 600; display: block; }
.who small { color: var(--muted); }
.disc-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--line-2); margin: 2px 4px 2px 0; white-space: nowrap; }
.disc-tag i { width: 7px; height: 7px; border-radius: 2px; }

/* 课程管理 */
.admin-course { margin-bottom: 16px; }
.admin-course .card-head h3 { flex: 1; }
.admin-lesson { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line-2); }
.admin-lesson:last-child { border-bottom: 0; }
.vslots { display: flex; gap: 8px; }
.vslot { width: 132px; border: 1px dashed var(--line); border-radius: 8px; padding: 6px 8px; background: var(--surface-2); font-size: 12.5px; }
.vslot.has { border-style: solid; background: var(--surface); }
.vslot.has b::after { content: ' ✓'; color: var(--good); }
.upbar { height: 4px; border-radius: 999px; background: var(--line-2); overflow: hidden; margin-top: 6px; }
.upbar i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .2s; }

/* 进度矩阵 */
.matrix { border-collapse: separate; border-spacing: 0; }
.matrix th, .matrix td { border-bottom: 1px solid var(--line-2); padding: 8px 6px; text-align: center; }
.matrix th.sticky, .matrix td.sticky { position: sticky; left: 0; background: var(--surface); z-index: 1; text-align: left; padding-left: 16px; min-width: 190px; border-right: 1px solid var(--line); }
.matrix thead th { font-size: 11.5px; font-weight: 600; color: var(--muted); vertical-align: bottom; background: var(--surface-2); }
.matrix thead th.lh { min-width: 46px; max-width: 46px; height: 150px; padding: 8px 4px; }
.matrix thead th.lh span { writing-mode: vertical-rl; display: inline-block; text-align: left; white-space: nowrap; max-height: 140px; overflow: hidden; text-overflow: ellipsis; }
.cell { width: 34px; height: 26px; border-radius: 5px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 650; font-variant-numeric: tabular-nums; background: var(--line-2); color: transparent; }
.cell.p { color: var(--accent-ink); }
.cell.done { background: var(--good); color: #fff; }
.legend { display: flex; gap: 16px; align-items: center; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }

/* 弹窗与提示 */
.modal-mask { position: fixed; inset: 0; background: rgba(20,24,30,.45); display: grid; place-items: center; z-index: 100; padding: 20px; animation: fade .15s; }
.modal { width: 100%; max-width: 560px; max-height: calc(100vh - 40px); overflow: auto; background: var(--surface); border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line-2); }
.modal-head h2 { flex: 1; }
.modal-body { padding: 20px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line-2); background: var(--surface-2); border-radius: 0 0 14px 14px; }
.toast-box { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 13.5px; box-shadow: 0 8px 24px rgba(0,0,0,.2); animation: drop .2s; }
.toast.bad { background: var(--bad); }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.loading { padding: 60px; text-align: center; color: var(--muted); }
@keyframes fade { from { opacity: 0; } }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }

/* 手机适配 */
@media (max-width: 960px) {
  .hero, .player-layout, .two-col, .auth { grid-template-columns: 1fr; }
  .auth-brand { padding: 32px; min-height: 220px; }
  .auth-brand h1 { font-size: 24px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .shell { grid-template-columns: 1fr; background: var(--bg); }
  .hero-main { padding: 18px; gap: 16px; }
  .ring { width: 80px; height: 80px; }
  .ring > div { width: 62px; height: 62px; font-size: 17px; }
  .disc-tag { white-space: normal; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; padding: 10px; }
  .side .logo { width: 100%; padding-bottom: 8px; }
  .side .foot { margin: 0; border: 0; padding: 0; flex-direction: row; }
  .main-head, .main-body { padding-left: 16px; padding-right: 16px; }
  .course-head .barline, .lesson-row .barline { display: none; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .admin-lesson { grid-template-columns: 24px 1fr; }
  .admin-lesson > :nth-child(n+3) { grid-column: 2; }
  .vslots { flex-wrap: wrap; }
  .container { padding: 18px 14px 40px; }
  .topbar-in { padding: 0 14px; }
  .hide-sm { display: none; }
}

/* ================= V2 ================= */
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-good { color: var(--good); } .c-bad { color: var(--bad); }
.stack-lg > * + * { margin-top: 18px; }
.stack-sm > * + * { margin-top: 8px; }
.container.wide { max-width: 1240px; }
.container.narrow { max-width: 680px; }
.span2 { grid-column: span 2; } .span3 { grid-column: 1 / -1; }
.pill { display: inline-flex; align-items: center; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.topnav { display: flex; gap: 4px; margin-left: 6px; }
.topnav a { padding: 6px 10px; border-radius: 8px; color: var(--ink-2); font-weight: 550; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.topnav a:hover { background: var(--line-2); text-decoration: none; }
.topnav a.on { color: var(--accent-ink); background: var(--accent-soft); }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; margin-left: auto; }
.avatar.lg { width: 52px; height: 52px; font-size: 20px; }
.tag { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; background: var(--line-2); color: var(--ink-2); white-space: nowrap; flex: none; }
.tag.accent { background: var(--accent-soft); color: var(--accent-ink); }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.btn.danger-fill { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger-fill:hover { background: #B23C31; }
.clickable { cursor: pointer; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* 学员首页 */
.hero2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 18px; }
.hello { display: flex; flex-direction: column; gap: 18px; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; flex: 1; }
.tile { padding: 16px 18px; border-radius: 10px; background: var(--surface-2); display: flex; flex-direction: column; justify-content: center; }
.tile span { font-size: 12.5px; color: var(--muted); }
.tile b { font-size: 28px; font-weight: 750; font-variant-numeric: tabular-nums; }
.tile small { font-size: 14px; color: var(--muted); font-weight: 500; }
.todo-card { display: flex; flex-direction: column; gap: 10px; }
.todo { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 10px; border: 1px solid var(--line); color: var(--ink); }
.todo:hover { text-decoration: none; filter: brightness(.98); }
.todo .sub { display: block; font-size: 12px; color: var(--muted); }
.todo b { display: block; font-weight: 600; }
.todo.dark { background: var(--side); border-color: var(--side); color: #fff; }
.todo.dark .sub { color: #AAB1BC; }
.todo .play { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; flex: none; font-size: 13px; color: #fff; }
.todo.accent { background: var(--accent-soft); border-color: #F3D6C1; } .todo.accent .tag { background: #fff; color: var(--accent-ink); }
.todo.bad { background: var(--bad-soft); border-color: #F0C9C4; } .todo.bad .tag { background: #fff; color: var(--bad); }
.cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 18px; align-items: start; }
.cat { overflow: hidden; }
.cat-head { padding: 16px 18px 12px; display: flex; align-items: center; gap: 10px; }
.cat-head h2 { flex: 1; font-size: 16px; }
.cat-no { width: 26px; height: 26px; border-radius: 7px; background: var(--side); color: #fff; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; flex: none; }
.disc-tabs { display: flex; gap: 6px; padding: 0 18px 12px; flex-wrap: wrap; }
.disc-tab { padding: 3px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font: inherit; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.disc-tab.on { background: var(--accent-soft); color: var(--accent-ink); border-color: #F3D6C1; font-weight: 600; box-shadow: inset 3px 0 0 var(--c); }
.crow { border-top: 1px solid var(--line-2); }
.crow-head { width: 100%; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(60px, 1fr) auto 44px; gap: 12px; align-items: center; padding: 12px 18px; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.crow-head:hover { background: var(--surface-2); }
.crow-name { display: flex; gap: 8px; align-items: center; min-width: 0; }
.crow-name b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crow-lessons { display: none; background: var(--surface-2); border-top: 1px solid var(--line-2); }
.crow.open .crow-lessons { display: block; }
.abilities { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 0; }
.ab { padding: 14px 20px; border-bottom: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 6px; }

/* 播放器 */
.vwrap { position: relative; aspect-ratio: 16/9; background: #0E1116; border-radius: 12px; overflow: hidden; outline: none; user-select: none; -webkit-user-select: none; }
.vwrap video { width: 100%; height: 100%; display: block; background: #000; object-fit: contain; }
.vwrap:fullscreen, .vwrap:-webkit-full-screen { border-radius: 0; aspect-ratio: auto; width: 100%; height: 100%; }
.vwrap.pseudo-fs { position: fixed; inset: 0; z-index: 300; border-radius: 0; aspect-ratio: auto; width: 100vw; height: 100vh; height: 100dvh; }
body.no-scroll { overflow: hidden; }
.wm-grid { position: absolute; inset: -20%; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(4, 1fr); transform: rotate(-18deg); color: rgba(255,255,255,.07); font-size: 15px; font-weight: 600; pointer-events: none; }
.wm-grid span { display: grid; place-items: center; white-space: nowrap; }
.wm-float { position: absolute; color: rgba(255,255,255,.22); font-size: 13px; font-weight: 600; pointer-events: none; white-space: nowrap; transition: left 1.2s ease, top 1.2s ease; text-shadow: 0 0 2px rgba(0,0,0,.4); }
.big-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 72px; height: 72px; border-radius: 50%; border: 0; background: rgba(232,119,46,.92); color: #fff; font-size: 26px; cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,.35); padding-left: 5px; }
.vctrl { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 12px; padding: 18px 14px 10px; background: linear-gradient(transparent, rgba(0,0,0,.65)); color: #fff; transition: opacity .25s; }
.vwrap.playing:not(.show-ctrl) .vctrl { opacity: 0; }
.vwrap.playing:not(.show-ctrl) { cursor: none; }
.vbtn { border: 0; background: transparent; color: #fff; font-size: 16px; width: 32px; height: 32px; cursor: pointer; border-radius: 6px; flex: none; }
.vbtn:hover { background: rgba(255,255,255,.15); }
.vsel { background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 6px; height: 28px; font: inherit; font-size: 12.5px; }
.vsel option { color: #000; }
.track { position: relative; flex: 1; height: 18px; cursor: pointer; }
.track::before { content: ''; position: absolute; left: 0; right: 0; top: 7px; height: 4px; border-radius: 999px; background: rgba(255,255,255,.25); }
.track-max { position: absolute; left: 0; top: 7px; height: 4px; border-radius: 999px; background: rgba(255,255,255,.45); }
.track-cur { position: absolute; left: 0; top: 7px; height: 4px; border-radius: 999px; background: var(--accent); }
.qmark { position: absolute; top: 3px; width: 11px; height: 11px; transform: translateX(-5px) rotate(45deg); background: #fff; border: 2px solid #B9B2A7; pointer-events: none; }
.qmark.ok { background: var(--good); border-color: #fff; } .qmark.bad { background: var(--bad); border-color: #fff; }
.legend .dia { width: 9px; height: 9px; transform: rotate(45deg); border: 1.5px solid #B9B2A7; display: inline-block; border-radius: 0; }
.legend .dia.ok { background: var(--good); border-color: var(--good); } .legend .dia.bad { background: var(--bad); border-color: var(--bad); }
.quiz-overlay { position: absolute; inset: 0; background: rgba(15,18,23,.6); overflow-y: auto; display: flex; padding: 16px; z-index: 5; }
.quiz-card { margin: auto; width: 100%; max-width: 560px; background: #fff; border-radius: 14px; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.35); color: var(--ink); }
.quiz-card h2 { font-size: 17px; line-height: 1.5; }
.quiz-card fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.opt { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.opt input { accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.opt.sel { border-color: var(--accent); background: var(--accent-soft); }
.opt.right { border: 2px solid var(--good); background: var(--good-soft); }
.opt.wrongpick { border: 2px solid var(--bad); background: var(--bad-soft); }
.qres { padding: 10px 12px; border-radius: 10px; font-size: 13.5px; }
.qres.ok { background: var(--good-soft); color: #1F6B42; } .qres.bad { background: var(--bad-soft); color: #9B3329; }
.qres div { margin-top: 4px; color: var(--ink-2); }
.vl { padding: 5px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font: inherit; font-size: 13px; cursor: pointer; }
.vl.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.vl.off { border-style: dashed; color: #9AA0A9; cursor: default; }
.desc { margin: 0; color: var(--ink-2); white-space: pre-line; }
.task-cta { display: flex; align-items: center; gap: 12px; background: var(--accent-soft); border-color: #F3D6C1; }
.task-cta > div { flex: 1; }
.qrow { display: flex; gap: 10px; align-items: center; padding: 10px 18px; border-bottom: 1px solid var(--line-2); }
.qrow:last-child { border-bottom: 0; }
.qdot { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid #B9B2A7; display: grid; place-items: center; font-size: 12px; color: #fff; flex: none; }
.qdot.ok { background: var(--good); border-color: var(--good); } .qdot.bad { background: var(--bad); border-color: var(--bad); }

/* 课后题与批改 */
.task { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.task.returned { border-color: #F0C9C4; box-shadow: inset 4px 0 0 var(--bad); }
.task.flash { animation: flash 1.2s 2; }
@keyframes flash { 50% { box-shadow: 0 0 0 4px rgba(200,71,59,.35); } }
.task-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.task-no { width: 26px; height: 26px; border-radius: 50%; background: var(--side); color: #fff; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; flex: none; }
.task-prompt { font-size: 15px; font-weight: 550; white-space: pre-line; }
.blanks { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.files { display: flex; flex-direction: column; gap: 8px; }
.files:empty { display: none; }
.file { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); min-width: 0; }
.file audio { height: 34px; max-width: 260px; }
.ficon { font-size: 18px; flex: none; }
.grid-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.thumb { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; color: var(--ink); font-size: 12px; }
.thumb img { width: 100%; height: 140px; object-fit: cover; background: var(--line-2); display: block; }
.thumb span { padding: 4px 8px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comment { padding: 10px 12px; border-radius: 8px; background: var(--surface-2); border-left: 3px solid var(--accent); font-size: 13.5px; white-space: pre-line; }
.answer-text { padding: 10px 12px; background: var(--surface-2); border-radius: 8px; white-space: pre-line; }
.table.mini td, .table.mini th { padding: 6px 10px; }
.sticky-foot { position: sticky; bottom: 0; z-index: 8; display: flex; justify-content: flex-end; gap: 10px; padding: 12px 0; margin-top: 16px; background: linear-gradient(transparent, var(--bg) 30%); }
.score-big { font-size: 20px; color: var(--good); }
.grade-box { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px dashed var(--line); border-radius: 10px; background: #FFFDFB; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; align-self: flex-start; }
.seg label { cursor: pointer; }
.seg input { display: none; }
.seg span { display: inline-block; padding: 6px 14px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.seg label:first-child input:checked + span { background: var(--good); color: #fff; }
.seg label:last-child input:checked + span { background: var(--bad); color: #fff; }

/* 管理后台 */
.side .nav .badge { margin-left: auto; }
a.stat { color: inherit; display: block; }
a.stat:hover { text-decoration: none; border-color: #D9D2C7; }
.stats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.fchip { display: inline-flex; align-items: center; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font: inherit; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.fchip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.admin-lesson { grid-template-columns: 28px minmax(0, 1fr) auto auto auto; color: var(--ink); }
.admin-lesson:hover { background: var(--surface-2); text-decoration: none; }
.vs { display: inline-grid; place-items: center; min-width: 30px; height: 24px; padding: 0 6px; border-radius: 6px; border: 1px dashed #D6CFC4; font-size: 11.5px; font-weight: 700; color: #A7A097; }
.vs.has { border: 0; background: var(--good-soft); color: var(--good); }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.vgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 16px 20px; }
.vcard { border: 1px dashed var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); }
.vcard.has { border-style: solid; background: #fff; }
.pv-video { width: 100%; max-height: 420px; border-radius: 10px; background: #000; }
.timeline { position: relative; height: 26px; }
.tl-track { position: absolute; left: 0; right: 0; top: 11px; height: 4px; border-radius: 999px; background: var(--line-2); }
.tl-mark { position: absolute; top: 2px; transform: translateX(-11px); width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; cursor: pointer; padding: 0; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.task-admin { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line-2); }
.task-admin:last-child { border-bottom: 0; }
.tri { border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; background: var(--surface-2); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tri-label { grid-column: 1 / -1; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.tri-label em { color: var(--bad); font-style: normal; }
.tri-in span { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.opt-edit { display: grid; grid-template-columns: 54px repeat(3, minmax(0, 1fr)) 34px; gap: 8px; align-items: center; margin-bottom: 8px; }
.tree { display: flex; flex-direction: column; gap: 8px; }
.tree-cat { border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.tree-cat summary { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; list-style: none; }
.tree-cat summary::-webkit-details-marker { display: none; }
.tree-cat summary b { flex: 1; }
.tree-group { padding: 4px 12px 12px 38px; }
.tree-gname { margin: 4px 0 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.profile-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 16px; }
.photo { position: relative; width: 76px; height: 96px; border-radius: 10px; border: 1px solid var(--line); background: var(--accent-soft); color: var(--accent-ink); font-size: 30px; font-weight: 700; display: grid; place-items: center; overflow: hidden; cursor: pointer; padding: 0; flex: none; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo em { position: absolute; left: 0; right: 0; bottom: 0; font-style: normal; font-size: 11px; background: rgba(0,0,0,.5); color: #fff; padding: 2px; opacity: 0; transition: opacity .15s; }
.photo:hover em { opacity: 1; }
.mentor-scope { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 12px; align-items: start; padding-bottom: 12px; border-bottom: 1px solid var(--line-2); }
.mentor-scope:last-child { border-bottom: 0; }
.ms-name { font-weight: 600; padding-top: 5px; }
.ab-row td { padding-top: 0; border-top: 0; }
.table.report tr:has(+ .ab-row) td { border-bottom: 0; }
.ab-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.abc { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line-2); }
.abc b { font-weight: 600; }

@media (max-width: 960px) {
  .topnav { margin-left: 0; }
  .topnav a { padding: 6px 7px; font-size: 13px; }
  .crow-head { grid-template-columns: minmax(0, 1fr) auto 40px; }
  .crow-head > .bar { display: none; }
  .editor-grid, .vgrid, .tri, .mentor-scope { grid-template-columns: 1fr; }
  .opt-edit { grid-template-columns: 48px 1fr 30px; }
  .opt-edit input[data-ol=en], .opt-edit input[data-ol=th] { grid-column: 2; }
  .admin-lesson { grid-template-columns: 24px 1fr; }
  .span2 { grid-column: auto; }
  .tile b { font-size: 22px; }
  .vctrl { gap: 6px; padding: 14px 8px 6px; }
  .vsel { display: none; }
  .wm-float { font-size: 11px; }
  .big-play { width: 56px; height: 56px; font-size: 20px; }
}
@media (max-width: 560px) { .topbar-in { gap: 8px; } .lang-switch button { padding: 0 7px; } }
.lang-switch, .user-pill, .logo { flex: none; }
.topnav { min-width: 0; overflow-x: auto; scrollbar-width: none; }
.topnav::-webkit-scrollbar { display: none; }
@media (max-width: 700px) {
  .quiz-overlay { position: fixed; z-index: 400; padding: 12px; background: rgba(15,18,23,.72); }
  .player-layout h1.grow { flex: 1 1 100%; }
  .topbar-in .spacer { flex: 0 0 0; margin-left: auto; }
}
