:root {
  --bg: #f9f8f5;
  --surface: #ffffff;
  --surface-2: #eef1ee;
  --line: #dde2dd;
  --line-soft: #e9ede9;
  --ink: #191c1a;
  --muted: #626b66;
  --accent: #1d5c4f;
  --accent-ink: #ffffff;
  --accent-soft: #e4efea;
  --link: #2f5d8c;
  --ok: #1f7a4d;
  --bad: #a33232;
  --ok-soft: #e3f2e8;
  --bad-soft: #f8e6e4;
  --shadow: 0 1px 2px rgba(20, 30, 26, .05), 0 8px 24px -16px rgba(20, 30, 26, .3);
  --serif: "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif CJK SC", "SimSun", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 10px;
  --wrap: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121513;
    --surface: #191d1b;
    --surface-2: #222825;
    --line: #313734;
    --line-soft: #272c2a;
    --ink: #e7eae7;
    --muted: #949c98;
    --accent: #6dbfa7;
    --accent-ink: #10201b;
    --accent-soft: #1b2a26;
    --link: #8ab4e8;
    --ok: #7cc79a;
    --bad: #e08a7c;
    --ok-soft: #1a2b21;
    --bad-soft: #2c1e1c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -16px rgba(0, 0, 0, .7);
  }
}

:root[data-theme="dark"] {
  --bg: #121513;
  --surface: #191d1b;
  --surface-2: #222825;
  --line: #313734;
  --line-soft: #272c2a;
  --ink: #e7eae7;
  --muted: #949c98;
  --accent: #6dbfa7;
  --accent-ink: #10201b;
  --accent-soft: #1b2a26;
  --link: #8ab4e8;
  --ok: #7cc79a;
  --bad: #e08a7c;
  --ok-soft: #1a2b21;
  --bad-soft: #2c1e1c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -16px rgba(0, 0, 0, .7);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */

.site-head {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-head .wrap { display: flex; align-items: center; gap: 16px; min-height: 60px; flex-wrap: wrap; }

.brand { display: flex; align-items: baseline; gap: 10px; margin-right: auto; }
.brand-mark {
  font-family: var(--serif); font-size: 15px; line-height: 1;
  padding: 7px 8px 6px; background: var(--accent); color: var(--accent-ink);
  border-radius: 4px; letter-spacing: .06em;
}
.brand-name { font-family: var(--serif); font-size: 19px; font-weight: 600; letter-spacing: .02em; color: var(--ink); }
.brand-name:hover { text-decoration: none; }
.brand-sub { font-size: 12px; color: var(--muted); }

.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a, .nav button {
  font: inherit; font-size: 13.5px; color: var(--muted);
  background: none; border: 0; padding: 6px 10px; border-radius: 7px; cursor: pointer;
}
.nav a:hover, .nav button:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav a.on { color: var(--ink); background: var(--surface-2); }
.nav .admin-on { color: var(--accent); font-weight: 600; }
.nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 17px; height: 17px; margin-left: 5px; padding: 0 5px;
  border-radius: 999px; background: var(--bad); color: #fff;
  font-size: 10.5px; line-height: 1; font-weight: 700;
}
.nav-badge[hidden] { display: none; }

/* ---------- generic ---------- */

main { padding: 0 0 96px; }

.hero { padding: 56px 0 36px; border-bottom: 1px solid var(--line-soft); margin-bottom: 40px; }
.hero h1 { font-family: var(--serif); font-size: 38px; line-height: 1.3; margin: 0 0 10px; letter-spacing: .01em; }
.hero .lede { font-size: 16px; color: var(--muted); max-width: 62ch; margin: 0 0 20px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 12.5px; color: var(--muted); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px 11px; background: var(--surface);
}
.chip strong { color: var(--ink); font-weight: 600; }

h2.sec {
  font-family: var(--serif); font-size: 15px; font-weight: 600; letter-spacing: .16em;
  color: var(--muted); margin: 44px 0 18px; display: flex; align-items: center; gap: 12px;
}
h2.sec::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- section grid ---------- */

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }

.card {
  display: block; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 18px 15px; color: inherit;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.card:hover { border-color: var(--accent); box-shadow: var(--shadow); }

.card-top { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.badge {
  font-family: var(--serif); font-size: 12px; padding: 2px 8px; border-radius: 4px;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); white-space: nowrap;
}
.card-weeks { font-size: 12px; color: var(--muted); margin-left: auto; font-variant-numeric: tabular-nums; }
.card h3 { font-family: var(--serif); font-size: 19px; margin: 0 0 4px; font-weight: 600; line-height: 1.4; }
.card .sub { font-size: 13px; color: var(--muted); margin: 0 0 14px; }
.card-acts { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- section page ---------- */

.crumb { font-size: 13px; color: var(--muted); padding-top: 26px; }
.page-head { padding: 8px 0 26px; border-bottom: 1px solid var(--line-soft); margin-bottom: 30px; }
.page-head h1 { font-family: var(--serif); font-size: 31px; margin: 6px 0 6px; line-height: 1.32; }
.page-head .sub { color: var(--muted); font-size: 15px; margin: 0 0 14px; }

.dev {
  margin-top: 11px; padding: 9px 13px; border-left: 2px solid var(--accent);
  background: var(--accent-soft); border-radius: 0 6px 6px 0; font-size: 13px;
}
.dev .k { font-size: 11.5px; color: var(--accent); font-weight: 600; margin-right: 8px; }

.topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.topic {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 15px;
}
.topic .t { font-family: var(--serif); font-size: 15px; font-weight: 600; margin-bottom: 3px; }
.topic .d { font-size: 13px; color: var(--muted); line-height: 1.65; }

.empty {
  border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 26px; text-align: center; color: var(--muted); font-size: 13.5px;
}

/* ---------- 面板与表单 ---------- */

.panel {
  margin-top: 28px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 18px;
}
.panel h3 { font-family: var(--serif); font-size: 16px; margin: 0 0 4px; }
.panel .hint { font-size: 12.5px; color: var(--muted); margin: 0 0 14px; }
.form-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.field { display: flex; flex-direction: column; gap: 4px; flex: 1 1 180px; }
.field.wide { flex: 1 1 100%; }
.field label { font-size: 12px; color: var(--muted); }
select, input[type="text"], input[type="password"], textarea {
  font: inherit; font-size: 14px; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 7px; padding: 7px 10px; width: 100%;
}
textarea { line-height: 1.6; resize: vertical; }
textarea.code { font-family: var(--mono); font-size: 12.5px; }
select:focus, input:focus, textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 1px;
}
.btn {
  font: inherit; font-size: 14px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink);
  border: 1px solid transparent; border-radius: 7px; padding: 8px 18px;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
a.btn { display: inline-block; text-align: center; }
.btn[disabled] { opacity: .5; cursor: default; filter: none; }
.btn.ghost { background: none; color: var(--muted); border-color: var(--line); }
.btn.ghost:hover { color: var(--ink); border-color: var(--muted); filter: none; }
.btn.small { font-size: 12.5px; padding: 4px 12px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- quiz ---------- */

.quiz-cta {
  margin: 0 0 26px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 18px 20px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.quiz-cta .qc-text { flex: 1; min-width: 220px; }
.quiz-cta h3 { font-family: var(--serif); font-size: 17px; margin: 0 0 3px; }
.quiz-cta p { font-size: 13px; color: var(--muted); margin: 0; }

.runner { max-width: 760px; margin: 0 auto; }
.progress { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; font-size: 12.5px; color: var(--muted); }
.progress .bar { flex: 1; height: 4px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress .bar i { display: block; height: 100%; background: var(--accent); transition: width .25s; }
.progress .nums { font-variant-numeric: tabular-nums; white-space: nowrap; }

.qcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
.qtype {
  display: inline-block; font-size: 11.5px; color: var(--accent); background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: 4px; padding: 1px 8px; margin-bottom: 10px;
}
.qstem { font-family: var(--serif); font-size: 18px; line-height: 1.7; margin-bottom: 18px; }
.opts { display: grid; gap: 8px; }
.opt {
  display: flex; gap: 11px; align-items: flex-start; text-align: left; width: 100%;
  font: inherit; font-size: 14.5px; line-height: 1.65; color: var(--ink); cursor: pointer;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 11px 14px;
  transition: border-color .12s, background .12s;
}
.opt:hover:not(:disabled) { border-color: var(--accent); }
.opt:disabled { cursor: default; }
.opt .mk {
  flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 12px; color: var(--muted); background: var(--surface);
}
.opt.picked { border-color: var(--accent); background: var(--accent-soft); }
.opt.picked .mk { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.opt.right { border-color: var(--ok); background: var(--ok-soft); }
.opt.right .mk { background: var(--ok); color: #fff; border-color: transparent; }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt.wrong .mk { background: var(--bad); color: #fff; border-color: transparent; }
.opt.missed { border: 1px dashed var(--ok); }
.opt.missed .mk { color: var(--ok); border-color: var(--ok); }
.opt .miss-tag {
  flex: none; margin-left: auto; align-self: center; font-size: 11.5px; color: var(--ok);
  border: 1px solid var(--ok); border-radius: 4px; padding: 0 6px;
}

.verdict { margin-top: 16px; border-radius: 8px; padding: 13px 16px; font-size: 14px; }
.verdict.right { background: var(--ok-soft); border-left: 3px solid var(--ok); }
.verdict.wrong { background: var(--bad-soft); border-left: 3px solid var(--bad); }
.verdict .vh { font-weight: 600; margin-bottom: 4px; }
.verdict.right .vh { color: var(--ok); }
.verdict.wrong .vh { color: var(--bad); }
.verdict .ve { color: var(--ink); line-height: 1.7; }
.verdict .ve b { font-weight: 600; }
.verdict .vt { margin-top: 6px; font-size: 12px; color: var(--muted); }

.qfoot { display: flex; gap: 10px; align-items: center; margin-top: 18px; flex-wrap: wrap; }
.qfoot .spacer { flex: 1; }

.score { text-align: center; padding: 30px 0 10px; }
.score .n { font-family: var(--serif); font-size: 54px; line-height: 1; color: var(--accent); }
.score .n small { font-size: 20px; color: var(--muted); }
.score .t { font-size: 14px; color: var(--muted); margin-top: 8px; }

.review { display: grid; gap: 10px; margin-top: 24px; }
.review .sec { margin: 6px 0 2px; }
.rev { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.rev.right { border-left-color: var(--ok); }
.rev.wrong { border-left-color: var(--bad); }
.rev .rstatus { font-size: 12px; font-weight: 600; margin-bottom: 5px; }
.rev.right .rstatus { color: var(--ok); }
.rev.wrong .rstatus { color: var(--bad); }
.rev .rs { font-family: var(--serif); font-size: 15px; margin-bottom: 6px; }
.rev .ra { font-size: 13px; color: var(--muted); }
.rev .ra b { color: var(--ok); font-weight: 600; }
.rev .re { font-size: 13px; color: var(--ink); margin-top: 6px; line-height: 1.7; }
.rev .re b { font-weight: 600; }

/* ---------- quiz admin ---------- */

.qlist { display: grid; gap: 8px; }
.qrow {
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: 11px 14px; display: flex; gap: 12px; align-items: flex-start;
}
.qrow .qi { font-family: var(--mono); font-size: 11px; color: var(--muted); flex: none; padding-top: 3px; }
.qrow .qb { flex: 1; min-width: 0; }
.qrow .qs { font-size: 14px; line-height: 1.6; }
.qrow .qm { font-size: 12px; color: var(--muted); margin-top: 2px; }
.qrow .qa { display: flex; gap: 4px; flex: none; }
.qrow .qa button {
  font: inherit; font-size: 12px; color: var(--muted); background: none;
  border: 1px solid var(--line); border-radius: 6px; padding: 2px 9px; cursor: pointer;
}
.qrow .qa button:hover { color: var(--ink); border-color: var(--muted); }
.qrow .qa .del:hover { color: var(--bad); border-color: var(--bad); }

.optedit { display: grid; gap: 6px; }
.optline { display: flex; gap: 8px; align-items: center; }
.optline .oi { font-family: var(--mono); font-size: 12px; color: var(--muted); width: 16px; flex: none; }
.optline input[type="checkbox"] { width: 16px; height: 16px; flex: none; accent-color: var(--accent); }
.optline .rm {
  font: inherit; font-size: 12px; color: var(--muted); background: none; flex: none;
  border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; cursor: pointer;
}
.optline .rm:hover { color: var(--bad); border-color: var(--bad); }

.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.filters button {
  font: inherit; font-size: 12.5px; color: var(--muted); background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; cursor: pointer;
}
.filters button:hover { color: var(--ink); }
.filters button.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

/* ---------- 主观题 ---------- */

.qcard textarea {
  width: 100%; margin: 4px 0 2px; min-height: 130px;
  font-family: inherit; font-size: 14.5px; line-height: 1.75;
}

.refans {
  margin-top: 16px; border-left: 2px solid var(--accent);
  background: var(--accent-soft); border-radius: 0 8px 8px 0; padding: 13px 16px;
}
.refans .rh { font-family: var(--serif); font-size: 14.5px; font-weight: 600; color: var(--accent); margin-bottom: 8px; }
.refans .rp { margin: 0; padding-left: 20px; }
.refans .rp li { font-size: 14px; line-height: 1.75; margin-bottom: 6px; }
.refans .rp li:last-child { margin-bottom: 0; }
.refans .re { margin-top: 9px; font-size: 13px; color: var(--muted); line-height: 1.7; }
.refans .vt { margin-top: 8px; font-size: 12px; color: var(--muted); }

.myans {
  margin: 8px 0 10px; padding: 10px 13px; background: var(--surface-2);
  border-radius: 8px; font-size: 13.5px; line-height: 1.75; white-space: pre-wrap;
}
.myans .k { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.myans.empty-note { color: var(--muted); }

.review .refans { margin-top: 10px; }

/* ---------- 账号 · 记录 · 名单 ---------- */

.statline {
  display: flex; flex-wrap: wrap; gap: 8px 22px; margin-bottom: 16px;
  font-size: 13.5px; color: var(--muted);
}
.statline b { color: var(--ink); font-size: 16px; font-variant-numeric: tabular-nums; margin: 0 2px; }

.runlist { display: grid; gap: 6px; }
.runrow {
  display: flex; align-items: center; gap: 12px; font-size: 13px;
  padding: 9px 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px;
}
.runrow .rl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.runrow .rn { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.runrow .rbar { width: 90px; height: 4px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.runrow .rbar i { display: block; height: 100%; background: var(--accent); }
.runrow .rp { width: 40px; text-align: right; font-variant-numeric: tabular-nums; }
.runrow .rt { color: var(--muted); font-size: 12px; white-space: nowrap; }

code.code {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: .06em;
  background: var(--accent-soft); color: var(--accent); border-radius: 5px;
  padding: 2px 8px; margin-left: 9px; user-select: all;
}
.qrow .sno { color: var(--muted); font-weight: 400; font-size: 13px; }
.qrow.off { opacity: .5; }
.offtag { font-size: 11.5px; color: var(--bad); margin-left: 9px; }

.newcodes { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px; }
.newcodes .nh { font-size: 12.5px; color: var(--muted); margin-bottom: 9px; }
.codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 5px; }
.cline {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 13px; padding: 5px 10px; background: var(--surface-2); border-radius: 7px;
}
.cline .cn { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#code-input { font-family: var(--mono); letter-spacing: .1em; text-align: center; font-size: 16px; }
dialog code { font-family: var(--mono); background: var(--surface-2); border-radius: 4px; padding: 1px 5px; }

/* ---------- 每道题的正确率 ---------- */

.filters .fgap { flex: 1; min-width: 12px; }

.qstats { display: grid; gap: 8px; }
.qstat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 13px 16px;
}
.qs-head { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; }
.qs-type { font-size: 12px; color: var(--muted); }
.qs-rate {
  margin-left: auto; font-size: 17px; font-weight: 600;
  font-variant-numeric: tabular-nums; letter-spacing: .01em;
}
.qs-rate.good { color: var(--ok); }
.qs-rate.mid  { color: #b7791f; }
.qs-rate.bad  { color: var(--bad); }
.qs-rate.none { font-size: 12.5px; font-weight: 400; color: var(--muted); }

.qs-stem { font-size: 14.5px; line-height: 1.65; margin-bottom: 8px; }
.qs-opts { display: grid; gap: 4px; margin-bottom: 8px; }
.qs-opt { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; line-height: 1.6; padding: 3px 8px; border-radius: 6px; }
.qs-opt .mk {
  flex: none; width: 19px; height: 19px; margin-top: 2px; border-radius: 50%; border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 11px; color: var(--muted);
}
.qs-opt.ok { background: var(--ok-soft); }
.qs-opt.ok .mk { background: var(--ok); color: #fff; border-color: transparent; }
.qs-ans { font-size: 13px; line-height: 1.65; margin-bottom: 8px; }
.qs-ans b { color: var(--ok); }
.qs-ex { color: var(--muted); }
.qs-bar { height: 5px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-bottom: 7px; }
.qs-bar i { display: block; height: 100%; background: var(--ok); }
.qs-bar i.mid { background: #b7791f; }
.qs-bar i.bad { background: var(--bad); }
.qs-meta { font-size: 12.5px; color: var(--muted); }

/* ---------- 领取登录码 ---------- */

.claimcard {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 26px 24px; text-align: center;
}
.cc-hi { font-size: 15px; color: var(--muted); margin-bottom: 14px; }
.cc-code {
  font-family: var(--mono); font-size: clamp(30px, 8vw, 46px); font-weight: 600;
  letter-spacing: .12em; color: var(--accent); background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: 12px; padding: 18px 10px; margin-bottom: 18px; user-select: all;
  word-break: break-all;
}
.cc-warn {
  font-size: 13.5px; line-height: 1.75; color: var(--muted);
  max-width: 46ch; margin: 0 auto 20px; text-align: left;
}
.cc-warn b { color: var(--bad); }
.claimcard .btn-row { justify-content: center; }

.claim-err {
  font-size: 13.5px; color: var(--bad); background: color-mix(in srgb, var(--bad) 8%, transparent);
  border-radius: 8px; padding: 9px 13px; margin-bottom: 12px;
}

.dlg-link { font-size: 12.5px; color: var(--muted); margin-right: auto; align-self: center; }
.dlg-link:hover { color: var(--accent); }

/* ---------- 留言板 ---------- */

.board { max-width: 820px; }
.board-login p { margin: 0 0 14px; }
.board-login .btn-row { justify-content: center; }
.message-compose { margin-top: 0; }
.compose-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px;
}
.char-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.message-list { display: grid; gap: 12px; }
.message-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px;
}
.message-card.answered { border-left: 3px solid var(--accent); }
.message-meta { font-size: 12px; color: var(--muted); margin-bottom: 7px; }
.message-body { font-size: 14.5px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-reply {
  margin-top: 14px; padding: 12px 14px; border-radius: 8px;
  background: var(--accent-soft); font-size: 14px; line-height: 1.75; white-space: pre-wrap;
}
.reply-label { font-size: 11.5px; color: var(--accent); font-weight: 600; margin-bottom: 4px; }
.waiting { margin-top: 11px; font-size: 12px; color: var(--muted); }
.teacher-reply { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.teacher-reply textarea { margin-bottom: 8px; }
.reply-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.publish-option { font-size: 12.5px; color: var(--muted); cursor: pointer; }
.publish-option input { accent-color: var(--accent); vertical-align: middle; }
.public-tag {
  margin-left: 8px; padding: 1px 7px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: 11px;
}

/* ---------- 课程资料 ---------- */

.playerbox {
  background: #000; border-radius: var(--radius); overflow: hidden;
  margin: 8px 0 22px; box-shadow: var(--shadow);
}
video.player { display: block; width: 100%; max-height: 72vh; background: #000; }

.vcard {
  display: block; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; color: inherit;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.vcard:hover {
  text-decoration: none; border-color: var(--accent);
  transform: translateY(-1px); box-shadow: var(--shadow);
}
.vthumb {
  position: relative; aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, var(--surface-2)), var(--surface-2));
  display: flex; align-items: center; justify-content: center;
}
.vplay {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; padding-left: 3px;
}
.vcard:hover .vplay { filter: brightness(1.1); }
.book-thumb { aspect-ratio: 4 / 3; }
.book-icon {
  display: flex; align-items: center; justify-content: center;
  width: 70px; height: 86px; border-radius: 5px 9px 9px 5px;
  background: var(--accent); color: var(--accent-ink); font: 700 16px var(--sans);
  box-shadow: -5px 0 0 color-mix(in srgb, var(--accent) 60%, var(--surface-2));
}
.book-card:hover .book-icon { filter: brightness(1.1); }
.book-card .vmeta { display: flex; flex-direction: column; }
.ppt-icon { width: 86px; border-radius: 7px; box-shadow: none; }
.link-card .vmeta { display: flex; flex-direction: column; }
.link-thumb { aspect-ratio: 16 / 9; }
.link-icon {
  min-width: 74px; padding: 14px 18px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font: 600 15px var(--sans); text-align: center;
}
.link-card:hover .link-icon { filter: brightness(1.1); }
.book-actions { margin-top: 12px; }
.section-note { margin: -13px 0 14px; color: var(--muted); font-size: 13px; }
.material-empty { margin: 0 0 18px; padding: 14px 16px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); font-size: 13px; }
.vtime {
  position: absolute; right: 8px; bottom: 8px;
  background: rgba(0,0,0,.72); color: #fff; font-size: 11.5px;
  padding: 1px 7px; border-radius: 4px; font-variant-numeric: tabular-nums;
}
.vmeta { padding: 12px 14px 14px; }
.vmeta h3 { font-family: var(--serif); font-size: 16px; margin: 0 0 4px; font-weight: 600; line-height: 1.45; }
.vmeta p { font-size: 12.5px; color: var(--muted); margin: 0; }

.vlist { margin-top: 16px; border-top: 1px dashed var(--line); padding-top: 14px; display: grid; gap: 6px; }
.vrow {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px; background: var(--surface-2); border-radius: 8px;
}
.vrow .vb { flex: 1; min-width: 0; }
.vrow .vt { font-size: 13.5px; word-break: break-word; }
.vrow .vm { font-size: 11.5px; color: var(--muted); }
.vrow .qa { display: flex; gap: 4px; }
.vrow .qa button, .vrow .qa a {
  font: inherit; font-size: 12px; color: var(--muted); background: none;
  border: 1px solid var(--line); border-radius: 6px; padding: 2px 9px; cursor: pointer;
}
.vrow .qa button:hover, .vrow .qa a:hover { color: var(--ink); border-color: var(--muted); text-decoration: none; }
.vrow .qa .del:hover { color: var(--bad); border-color: var(--bad); }

.drop {
  border: 1.5px dashed var(--line); border-radius: 9px; padding: 26px 18px;
  text-align: center; color: var(--muted); font-size: 13.5px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.drop b { color: var(--ink); }

.queue { margin-top: 12px; display: grid; gap: 6px; }
.qitem { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 6px 10px; background: var(--surface-2); border-radius: 7px; }
.qitem .qname { flex: 1; min-width: 0; word-break: break-word; }
.qitem .qstat { font-size: 12px; color: var(--muted); white-space: nowrap; }
.qitem.ok .qstat { color: var(--ok); }
.qitem.err .qstat { color: var(--bad); }

/* ---------- dialog / toast ---------- */

dialog {
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink);
  padding: 22px; max-width: 380px; width: calc(100% - 40px); box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(12, 20, 16, .45); backdrop-filter: blur(2px); }
dialog h3 { font-family: var(--serif); font-size: 17px; margin: 0 0 6px; }
dialog p { font-size: 13px; color: var(--muted); margin: 0 0 14px; }
.dlg-acts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); font-size: 13.5px;
  padding: 9px 18px; border-radius: 999px; z-index: 60; box-shadow: var(--shadow);
}

footer.site-foot { border-top: 1px solid var(--line); padding: 22px 0 40px; font-size: 12.5px; color: var(--muted); }
.site-disclaimer { max-width: 820px; margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.site-disclaimer strong { color: var(--ink); font-weight: 600; }

@media (max-width: 700px) {
  .hero { padding: 34px 0 26px; }
  .hero h1 { font-size: 28px; }
  .page-head h1 { font-size: 24px; }
  .brand-sub { display: none; }
  .qcard { padding: 18px 16px; }
  .qstem { font-size: 16.5px; }
}
