/* Lab-Training — 两套皮肤：暗色（默认跟随系统）/ 亮色。所有颜色走变量。 */
:root {
  --bg: #f4f6fb; --bg-2: #eaeef6; --surface: #ffffff; --surface-2: #f7f9fc; --glass: rgba(255,255,255,.78);
  --line: #dde3ee; --line-2: #c9d2e1;
  --text: #0f172a; --text-2: #475569; --text-3: #7b8799;
  --primary: #0e7490; --primary-2: #0891b2; --primary-soft: #e0f4f8; --on-primary: #ffffff;
  --accent: #7c3aed; --accent-soft: #efe7ff;
  --ok: #15803d; --ok-soft: #e3f5ea; --warn: #b45309; --warn-soft: #fdf1dc; --danger: #c2410c; --danger-soft: #fde8df;
  --shadow: 0 1px 2px rgba(15,23,42,.05), 0 8px 24px -12px rgba(15,23,42,.14);
  --radius: 14px; --radius-sm: 9px;
  --glow: 0 0 0 transparent;
  --grid-line: rgba(14,116,144,.06);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #060a13; --bg-2: #0a1020; --surface: #0e1627; --surface-2: #121c31; --glass: rgba(14,22,39,.72);
  --line: #1c2842; --line-2: #2a3a5c;
  --text: #e6edf7; --text-2: #a3b1c8; --text-3: #6e7f9b;
  --primary: #22d3ee; --primary-2: #67e8f9; --primary-soft: rgba(34,211,238,.12); --on-primary: #03141a;
  --accent: #a78bfa; --accent-soft: rgba(167,139,250,.14);
  --ok: #4ade80; --ok-soft: rgba(74,222,128,.12); --warn: #fbbf24; --warn-soft: rgba(251,191,36,.12); --danger: #fb7185; --danger-soft: rgba(251,113,133,.13);
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 10px 30px -14px rgba(0,0,0,.7);
  --glow: 0 0 24px -6px rgba(34,211,238,.45);
  --grid-line: rgba(34,211,238,.05);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text); min-height: 100vh;
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", sans-serif;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px; background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.3; font-weight: 650; letter-spacing: .01em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
.muted { color: var(--text-2); } .dim { color: var(--text-3); } .small { font-size: .86rem; } .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- 顶栏 ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: var(--glass); backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1320px; margin: 0 auto; height: 60px; display: flex; align-items: center; gap: 18px; padding: 0 20px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-logo { width: 38px; height: 38px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,.9), var(--glow); object-fit: contain; }
.brand-name { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name b { font-size: 1rem; letter-spacing: .04em; }
.brand-name span { font-size: .7rem; color: var(--text-3); font-weight: 500; }
.mainnav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.mainnav::-webkit-scrollbar { display: none; }
.mainnav a, .navbtn { color: var(--text-2); padding: 7px 12px; border-radius: 8px; white-space: nowrap; font-size: .93rem; background: none; border: 0; cursor: pointer; font-family: inherit; }
.mainnav a:hover, .navbtn:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.mainnav a.on { color: var(--primary); background: var(--primary-soft); font-weight: 600; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.iconbtn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2);
  display: inline-grid; place-items: center; cursor: pointer; }
.iconbtn:hover { color: var(--primary); border-color: var(--primary); }
.iconbtn svg { width: 18px; height: 18px; }
.theme-sun { display: none; } :root[data-theme="dark"] .theme-sun { display: block; } :root[data-theme="dark"] .theme-moon { display: none; }
.dropdown { position: relative; }
.dropdown > .menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 190px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow); padding: 6px; display: none; z-index: 60; }
.dropdown.open > .menu { display: block; }
.menu a, .menu button { display: flex; width: 100%; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 8px; color: var(--text); background: none;
  border: 0; font: inherit; font-size: .92rem; cursor: pointer; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--surface-2); text-decoration: none; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 0; }
.menu .menu-head { padding: 8px 10px; font-size: .8rem; color: var(--text-3); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: .9rem;
  background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; border: 0; cursor: pointer; }

/* ---------- 布局 ---------- */
.container { max-width: 1320px; margin: 0 auto; padding: 26px 20px 60px; }
.narrow { max-width: 860px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--text-2); }
.crumbs { font-size: .85rem; color: var(--text-3); margin-bottom: 8px; }
.crumbs a { color: var(--text-3); }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 10px; }
.card-head h2, .card-head h3 { margin: 0; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- 统计块 ---------- */
.stat { padding: 18px 20px; position: relative; overflow: hidden; }
.stat .k { color: var(--text-3); font-size: .82rem; letter-spacing: .04em; }
.stat .v { font-size: 1.9rem; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: .95rem; color: var(--text-3); font-weight: 500; }
.stat::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle, var(--primary-soft), transparent 70%); }
.bar { height: 6px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 99px; }

/* ---------- 按钮 / 表单 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: inherit; font-size: .92rem; font-weight: 550;
  cursor: pointer; white-space: nowrap; transition: .15s; }
.btn:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); box-shadow: var(--glow); }
.btn.primary:hover { filter: brightness(1.08); color: var(--on-primary); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { height: 30px; padding: 0 11px; font-size: .84rem; border-radius: 8px; }
.btn.lg { height: 46px; padding: 0 26px; font-size: 1rem; border-radius: 12px; }
.btn[disabled], .btn.disabled { opacity: .45; pointer-events: none; }
.btn svg { width: 16px; height: 16px; }
.input, .form input[type=text], .form input[type=email], .form input[type=password], .form input[type=number], .form input[type=url],
.form input[type=datetime-local], .form select, .form textarea, select.input, textarea.input {
  width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
  font: inherit; font-size: .94rem; outline: none; transition: .15s; }
.input:focus, .form input:focus, .form select:focus, .form textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.form .field { margin-bottom: 16px; }
.form label.lbl, .form .field > label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.form .help { color: var(--text-3); font-size: .8rem; margin-top: 4px; }
.form .errorlist { list-style: none; margin: 4px 0 0; padding: 0; color: var(--danger); font-size: .84rem; }
.form ul[id$="groups"], .form div[id$="groups"] { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 0; margin: 0; list-style: none; }
.form input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); vertical-align: -3px; }
.form .checkline { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }
.searchbar { display: flex; gap: 8px; }
.searchbar .input { min-width: 220px; }

/* ---------- 标签 / 表格 ---------- */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: .76rem; font-weight: 600;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); white-space: nowrap; }
.tag.primary { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.tag.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.tag.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.tag.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.tag.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.table th, table.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.table th { font-size: .78rem; color: var(--text-3); font-weight: 600; letter-spacing: .04em; background: var(--surface-2); white-space: nowrap; }
table.table tr:last-child td { border-bottom: 0; }
table.table tr:hover td { background: color-mix(in srgb, var(--primary-soft) 40%, transparent); }
.empty { text-align: center; color: var(--text-3); padding: 40px 10px; }

/* ---------- 提示 ---------- */
.messages { list-style: none; padding: 0; margin: 0 0 18px; }
.messages li { padding: 11px 15px; border-radius: 10px; margin-bottom: 8px; background: var(--primary-soft); color: var(--text); border: 1px solid var(--line); }
.messages li.success { background: var(--ok-soft); } .messages li.error { background: var(--danger-soft); } .messages li.warning { background: var(--warn-soft); }
.callout { padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--line-2); color: var(--text-2); }

/* ---------- 视频卡片 ---------- */
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.vcard { display: flex; flex-direction: column; color: var(--text); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  overflow: hidden; transition: transform .18s, box-shadow .18s, border-color .18s; }
.vcard:hover { transform: translateY(-3px); box-shadow: var(--shadow), var(--glow); border-color: var(--primary); text-decoration: none; }
.thumb { position: relative; aspect-ratio: 16 / 9; background: linear-gradient(135deg, #0b3a4a, #1e1b4b); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .ph { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,.85); }
.thumb .ph svg { width: 44px; height: 44px; opacity: .9; }
.thumb .ph::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
  linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 22px 22px; }
.thumb .dur { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.72); color: #fff; font-size: .74rem; padding: 1px 7px; border-radius: 6px; }
.thumb .badge { position: absolute; left: 8px; top: 8px; }
.thumb .prog { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.2); }
.thumb .prog i { display: block; height: 100%; background: var(--primary); }
.vbody { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.vtitle { font-weight: 620; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vmeta { font-size: .8rem; color: var(--text-3); display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 18px; scrollbar-width: thin; }
.chip { padding: 6px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); white-space: nowrap; font-size: .88rem; }
.chip:hover { text-decoration: none; border-color: var(--primary); color: var(--primary); }
.chip.on { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.chip small { opacity: .7; margin-left: 4px; }

/* ---------- 视频详情 ---------- */
.player { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; box-shadow: var(--shadow); }
.player video, .player iframe { width: 100%; height: 100%; display: block; border: 0; }
.vd-title { font-size: 1.35rem; margin: 16px 0 8px; }
.prose { color: var(--text); line-height: 1.75; }
.prose p { margin: .5em 0; }
.playlist { display: flex; flex-direction: column; gap: 4px; max-height: 520px; overflow: auto; }
.pl-item { display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; align-items: center; padding: 9px 10px; border-radius: 10px; color: var(--text); font-size: .9rem; }
.pl-item:hover { background: var(--surface-2); text-decoration: none; }
.pl-item.on { background: var(--primary-soft); }
.pl-item .i { color: var(--text-3); font-size: .8rem; text-align: center; }
.ring { --p: 0; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--primary) calc(var(--p) * 1%), var(--bg-2) 0); }
.ring > span { width: 60px; height: 60px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- 题目（视频测试 / 结果） ---------- */
.q { padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 14px; }
.q-head { display: flex; gap: 10px; align-items: baseline; margin-bottom: 10px; }
.q-no { font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }
.q-stem { font-weight: 560; white-space: pre-wrap; flex: 1; }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 13px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--surface-2); transition: .12s; }
.opt:hover { border-color: var(--primary); }
.opt input { margin-top: 4px; accent-color: var(--primary); }
.opt:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.opt .l { font-weight: 700; color: var(--text-2); min-width: 18px; }
.judge { flex-direction: row; }
.judge .opt { flex: 1; justify-content: center; }
.q textarea { min-height: 110px; resize: vertical; }
.fb { margin-top: 12px; padding: 11px 13px; border-radius: 10px; background: var(--surface-2); font-size: .9rem; border-left: 3px solid var(--line-2); }
.fb.ok { border-left-color: var(--ok); } .fb.bad { border-left-color: var(--danger); } .fb.part { border-left-color: var(--warn); }
.scorebig { font-size: 3rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, var(--primary), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line-2); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 页脚 ---------- */
.footer { text-align: center; color: var(--text-3); font-size: .8rem; padding: 26px 16px 34px; border-top: 1px solid var(--line); }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) { .split { grid-template-columns: minmax(0, 1fr) !important; } .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .topbar-in { padding: 0 12px; gap: 10px; }
  .brand-name span { display: none; }
  .brand-name b { font-size: .92rem; }
  .container { padding: 18px 16px 48px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .mainnav a { padding: 7px 9px; }
  .hide-sm { display: none !important; }
  h1 { font-size: 1.35rem; }
  .searchbar { width: 100%; } .searchbar .input { min-width: 0; flex: 1; }
  .vgrid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) { .g4 { grid-template-columns: 1fr 1fr; gap: 12px; } .stat .v { font-size: 1.5rem; } .brand-name { display: none; } }

/* ---------- 培训公告 ---------- */
.notice-list { display: flex; flex-direction: column; gap: 12px; }
.notice-item { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 16px; color: var(--text); padding: 16px 18px; transition: border-color .15s, box-shadow .15s; }
.notice-item:hover { text-decoration: none; border-color: var(--primary); box-shadow: var(--shadow), var(--glow); }
.ni-date { text-align: center; border-radius: 12px; background: var(--primary-soft); padding: 8px 0; align-self: start; }
.ni-date b { display: block; font-size: 1.5rem; line-height: 1.1; color: var(--primary); font-variant-numeric: tabular-nums; }
.ni-date span { font-size: .74rem; color: var(--text-3); }
.ni-title { font-weight: 650; font-size: 1.02rem; margin-bottom: 4px; }
.ni-sum { color: var(--text-2); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 6px; }
.mode-switch .chip { cursor: pointer; }
.mode-switch .chip input { display: none; }
.home-notice { display: block; padding: 10px 0; border-top: 1px solid var(--line); color: var(--text); }
.home-notice:hover { text-decoration: none; color: var(--primary); }
.prose.rich { line-height: 1.85; overflow-wrap: anywhere; }
.prose.rich h1, .prose.rich h2, .prose.rich h3, .prose.rich h4 { margin: 1.2em 0 .5em; }
.prose.rich img, .prose.rich video, .prose.rich iframe { max-width: 100%; height: auto; border-radius: 8px; }
.prose.rich table { border-collapse: collapse; width: 100%; margin: 1em 0; display: block; overflow-x: auto; }
.prose.rich th, .prose.rich td { border: 1px solid var(--line-2); padding: 7px 11px; }
.prose.rich th { background: var(--surface-2); }
.prose.rich blockquote { margin: 1em 0; padding: 8px 16px; border-left: 4px solid var(--primary); background: var(--surface-2); border-radius: 0 8px 8px 0; color: var(--text-2); }
.prose.rich pre { background: var(--surface-2); padding: 12px 14px; border-radius: 8px; overflow-x: auto; }
.prose.rich code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9em; }
.prose.rich hr { border: 0; border-top: 1px solid var(--line); margin: 1.5em 0; }
.EasyMDEContainer .CodeMirror, .editor-preview { background: var(--surface); color: var(--text); border-color: var(--line-2); }
.editor-toolbar { border-color: var(--line-2); background: var(--surface-2); }
.editor-toolbar button { color: var(--text-2) !important; }
@media (max-width: 760px) { .notice-item { grid-template-columns: 1fr; gap: 8px; } .ni-date { display: none; } article.card { padding: 18px 16px !important; } }

/* ---------- 手机端：底部标签栏 + 防横向溢出 ---------- */
.tabbar { display: none; }
@media (max-width: 760px) {
  html, body { overflow-x: hidden; }
  .topbar .mainnav { display: none; }
  .topbar-in { justify-content: space-between; height: 54px; }
  .brand-name { display: flex !important; }
  .brand-name b { font-size: .95rem; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: var(--glass); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 6px; color: var(--text-3); font-size: .7rem; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a.on { color: var(--primary); font-weight: 600; }
  body.has-tabbar { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
  body.in-exam .tabbar { display: none; }
  .card-head { flex-wrap: wrap; }
  .page-head > .row, .page-head > .btn, .page-head > a.btn { width: 100%; }
  .page-head .row { flex-wrap: wrap; }
  .split, .grid { min-width: 0; }
  .card { padding: 16px; }
  .dropdown > .menu { position: fixed; right: 10px; left: auto; top: 58px; max-width: calc(100vw - 20px); }
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .form .row, .q .row { flex-wrap: wrap; }
  .chips { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 380px) { .brand-name { display: none !important; } }

/* 我的学习：三块纵向排列，个人资料字段横排 */
.profile-stack > * + * { margin-top: 18px; }
.profile-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; }
@media (max-width: 760px) { .profile-grid { grid-template-columns: 1fr; } }

/* 手机端表格改卡片：table.stack-sm，单元格用 data-label 做标签 */
@media (max-width: 760px) {
  table.stack-sm thead { display: none; }
  table.stack-sm, table.stack-sm tbody, table.stack-sm tr, table.stack-sm td { display: block; width: 100%; }
  table.stack-sm tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  table.stack-sm tr:last-child { border-bottom: 0; }
  table.stack-sm td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: right; }
  table.stack-sm td[data-label]::before { content: attr(data-label); color: var(--text-3); font-size: .82rem; flex: none; text-align: left; }
  table.stack-sm td[data-label] > .bar { flex: 1; max-width: 55%; margin-left: auto; }
  table.stack-sm td.cell-title { font-weight: 600; text-align: left; display: block; padding-bottom: 6px; }
  table.stack-sm td.cell-action { justify-content: flex-end; }
  table.stack-sm td.empty { display: block; text-align: center; }
  table.stack-sm tr:hover td { background: none; }
}

/* 个人资料：只读展示 + 悬停编辑 */
.pf { position: relative; padding: 12px 14px; border-radius: 12px; border: 1px solid transparent; transition: background .15s, border-color .15s; min-width: 0; }
.pf:hover, .pf.editing { background: var(--surface-2); border-color: var(--line); }
.pf-label { font-size: .8rem; color: var(--text-3); margin-bottom: 4px; }
.pf-view { display: flex; align-items: center; gap: 10px; min-height: 32px; }
.pf-value { font-size: 1.02rem; font-weight: 550; overflow-wrap: anywhere; }
.pf-value.is-empty { color: var(--text-3); font-weight: 400; }
.pf-edit { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 8px; font: inherit; font-size: .82rem;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--primary); cursor: pointer; opacity: 0; transform: translateX(4px);
  transition: opacity .15s, transform .15s; }
.pf-edit svg { width: 14px; height: 14px; }
.pf:hover .pf-edit, .pf-edit:focus-visible { opacity: 1; transform: none; }
@media (hover: none) { .pf-edit { opacity: 1; transform: none; } }
.pf-form .input { height: 38px; }
.pf-actions { margin-top: 8px; }
.pf-err { color: var(--danger); }
/* 通用确认框 LT.confirm */
.lt-modal { position: fixed; inset: 0; z-index: 200; background: rgba(3,7,18,.55); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; animation: ltfade .12s ease-out; }
.lt-modal .dialog { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.5); }
.lt-modal h3 { margin: 0 0 8px; font-size: 1.1rem; }
.lt-modal .body { color: var(--text-2); margin-bottom: 18px; overflow-wrap: anywhere; }
.lt-modal .diff { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; margin-top: 10px; font-size: .92rem; }
.lt-modal .diff .k { color: var(--text-3); }
.lt-modal .diff .old { text-decoration: line-through; color: var(--text-3); }
.lt-modal .diff .new { color: var(--text); font-weight: 600; }
.lt-modal .btns { display: flex; justify-content: flex-end; gap: 10px; }
@keyframes ltfade { from { opacity: 0; } }

.toast { position: fixed; left: 50%; top: 74px; transform: translateX(-50%); z-index: 220; background: var(--warn); color: #111; padding: 9px 16px;
  border-radius: 10px; font-weight: 600; box-shadow: var(--shadow); font-size: .9rem; max-width: calc(100vw - 32px); }

/* 学习任务：铃铛、弹窗、任务卡 */
.bell { position: relative; }
.bell .badge { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger);
  color: #fff; font-size: .7rem; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--surface); }
.bell.has svg { animation: ring 2.4s ease-in-out 1s 2; transform-origin: 50% 10%; }
@keyframes ring { 0%,100% { transform: rotate(0); } 10%,30% { transform: rotate(14deg); } 20%,40% { transform: rotate(-14deg); } 50% { transform: rotate(0); } }
.popup-tasks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.popup-tasks li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; background: var(--surface-2); border-radius: 10px; }
.popup-tasks span { white-space: nowrap; color: var(--text-3); font-size: .85rem; }
.t-over { color: var(--danger) !important; font-weight: 600; } .t-urgent { color: var(--warn) !important; font-weight: 600; }
.task-card { padding: 20px; }
.task-card.overdue { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.task-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: .86rem; color: var(--text-2); margin: 6px 0 12px; }
.task-videos { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.task-video { display: grid; grid-template-columns: 26px minmax(0, 1fr) 110px auto; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 10px; background: var(--surface-2); color: var(--text); }
.task-video:hover { text-decoration: none; outline: 1px solid var(--primary); }
.task-video .ok { color: var(--ok); font-weight: 700; } .task-video .no { color: var(--text-3); }
.countdown { font-variant-numeric: tabular-nums; font-weight: 700; }
.task-banner { display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin-bottom: 18px; border-radius: 14px;
  background: linear-gradient(100deg, color-mix(in srgb, var(--warn) 14%, var(--surface)), var(--surface)); border: 1px solid color-mix(in srgb, var(--warn) 40%, var(--line)); }
.task-banner.over { background: linear-gradient(100deg, color-mix(in srgb, var(--danger) 14%, var(--surface)), var(--surface)); border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.task-banner svg { width: 26px; height: 26px; color: var(--warn); flex: none; } .task-banner.over svg { color: var(--danger); }
.picker-tools { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.picker-tools .input { max-width: 260px; height: 34px; }
.picklist { max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: var(--surface-2);
  display: flex !important; flex-direction: column; gap: 4px !important; }
.picklist label { display: flex; gap: 8px; align-items: center; font-weight: 400 !important; cursor: pointer; }
@media (max-width: 760px) { .task-video { grid-template-columns: 22px minmax(0, 1fr) auto; } .task-video .bar-col { display: none; } }

/* 防刷课播放器 */
.lp { position: relative; width: 100%; height: 100%; background: #000; outline: none; }
.lp video { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }
.lp:fullscreen, .lp:-webkit-full-screen { width: 100vw; height: 100vh; }
.lp-cover, .lp-stop, .lp-attn { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 10px; text-align: center; color: #fff; z-index: 3; }
.lp-cover { background: radial-gradient(circle at 50% 45%, rgba(0,0,0,.25), rgba(0,0,0,.75)); padding: 16px; }
.lp-cover b { font-size: 1.1rem; } .lp-cover span { font-size: .82rem; opacity: .8; }
.lp-start { width: 76px; height: 76px; border-radius: 50%; border: 0; background: var(--primary); color: var(--on-primary); cursor: pointer; display: grid; place-items: center; box-shadow: 0 0 0 10px rgba(255,255,255,.12), var(--glow); }
.lp-start svg { width: 34px; height: 34px; margin-left: 4px; }
.lp-stop, .lp-attn { background: rgba(3,7,18,.72); backdrop-filter: blur(4px); padding: 16px; }
.lp-dialog { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 16px; padding: 22px 24px; max-width: 440px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.6); }
.lp-dialog h3 { margin: 0 0 6px; } .lp-dialog p { color: var(--text-2); margin: 0 0 16px; }
.lp-attn .lp-dialog { border-color: var(--warn); } .lp-attn .n { color: var(--danger); font-size: 1.2em; }
.lp-bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; align-items: center; gap: 12px; padding: 22px 14px 10px;
  background: linear-gradient(transparent, rgba(0,0,0,.75)); color: #fff; opacity: 0; transition: opacity .2s; }
.lp:hover .lp-bar, .lp:focus-within .lp-bar, .lp:fullscreen .lp-bar { opacity: 1; }
@media (hover: none) { .lp-bar { opacity: 1; } }
.lp-btn { background: rgba(255,255,255,.12); border: 0; color: #fff; border-radius: 8px; height: 32px; padding: 0 10px; cursor: pointer; font: inherit; font-size: .82rem; display: grid; place-items: center; }
.lp-btn svg { width: 18px; height: 18px; }
.lp-play .i-pause, .lp-play.is-playing .i-play { display: none; } .lp-play.is-playing .i-pause { display: block; }
.lp-track { position: relative; flex: 1; height: 6px; border-radius: 3px; background: rgba(255,255,255,.2); cursor: pointer; }
.lp-track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; }
.lp-max { background: rgba(255,255,255,.45); } .lp-cur { background: var(--primary); }
.lp-time { font-size: .8rem; white-space: nowrap; }
.lp-vol { width: 80px; accent-color: var(--primary); }
.pass-step { display: flex; gap: 10px; align-items: center; padding: 8px 0; color: var(--text-2); }
.pass-step i { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: .8rem; font-weight: 700; background: var(--surface-2); border: 1px solid var(--line-2); }
.pass-step.done { color: var(--text); } .pass-step.done i { background: var(--ok); border-color: var(--ok); color: #fff; }
@media (max-width: 760px) { .lp-vol { display: none; } .lp-bar { gap: 8px; padding: 18px 10px 8px; } }
.task-video .tv-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) { .task-video .tv-title { white-space: normal; overflow: visible; line-height: 1.5; } }
