:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --border: #e3e6ea;
  --text: #1f2733;
  --muted: #6b7686;
  --primary: #2f6fed;
  --primary-dark: #1e56c8;
  --green: #1d9e75;
  --green-bg: #e1f5ee;
  --red: #d64545;
  --red-bg: #fcebeb;
  --amber: #b26a08;
  --amber-bg: #faeeda;
  --blue-bg: #e6f1fb;
  --radius: 10px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 左侧导航栏 ---------- */
:root { --nav-w: 224px; }
body.has-nav { padding-left: var(--nav-w); }   /* 内容区给固定导航让位 */

.nav {
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--nav-w); z-index: 10;
  background: var(--card); border-right: 1px solid var(--border);
  padding: 16px 12px 14px; display: flex; flex-direction: column; gap: 4px;
  overflow-y: auto; overflow-x: hidden;
}
.nav .brand { padding: 6px 10px 14px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.nav .brand-name { font-weight: 700; font-size: 17px; letter-spacing: .5px; color: var(--primary); }
.nav .brand-sub { font-size: 11px; color: var(--muted); margin-top: 3px; line-height: 1.45; }
.nav .nav-tabs { display: flex; flex-direction: column; gap: 3px; }
.nav a.tab {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px;
  color: var(--muted); font-weight: 500; white-space: nowrap;
}
.nav a.tab .ico { font-size: 16px; width: 20px; text-align: center; flex: 0 0 auto; }
.nav a.tab:hover { background: var(--bg); text-decoration: none; color: var(--text); }
.nav a.tab.active { background: var(--blue-bg); color: var(--primary); font-weight: 600; }
.nav .spacer { flex: 1 1 auto; min-height: 12px; }
.nav .nav-user {
  border-top: 1px solid var(--border); padding: 12px 10px 2px; margin-top: 4px;
}
.nav .who { color: var(--muted); font-size: 12.5px; line-height: 1.5; word-break: break-all; }
.nav button.linkbtn {
  margin-top: 8px; width: 100%; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--bg); color: var(--muted);
  cursor: pointer; font-size: 13px; font-family: inherit;
}
.nav button.linkbtn:hover { color: var(--red); border-color: var(--red); background: var(--red-bg); }

/* ---------- layout ---------- */
.page { max-width: 1080px; margin: 24px auto; padding: 0 24px; }
h2.page-title { font-size: 20px; margin-bottom: 16px; font-weight: 600; }
.cards { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 22px; min-width: 160px; flex: 1;
}
.stat-card .num { font-size: 26px; font-weight: 600; color: var(--primary); }
.stat-card .label { color: var(--muted); margin-top: 4px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; margin-bottom: 20px;
}
.card h3 { font-size: 15px; margin-bottom: 12px; font-weight: 600; }

/* ---------- table ---------- */
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.tbl th { color: var(--muted); font-weight: 500; font-size: 13px; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover { background: #f7f9fc; }
.tbl th.stu-cbx, .tbl td.stu-cbx { width: 34px; text-align: center; padding-left: 8px; padding-right: 8px; }
.stu-batchbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.stu-batchbar .stu-selall { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.stu-grp-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stu-grp-acts { display: inline-flex; align-items: center; gap: 12px; font-weight: 400; font-size: 13px; }
.stu-selcls { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; color: var(--muted); }
/* ---------- 上课模式 ---------- */
.cl-root { display: flex; flex-direction: column; gap: 10px; height: calc(100vh - 140px); min-height: 460px; background: #fff; }
.cl-root:fullscreen { height: 100vh; padding: 10px; }
.cl-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cl-title { font-size: 17px; font-weight: 600; }
.cl-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cl-body { display: flex; gap: 12px; flex: 1; min-height: 0; }
.cl-list { width: 240px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; padding: 6px; flex-shrink: 0; }
.cl-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.cl-item:hover { background: #f4f7fb; }
.cl-item.on { background: var(--blue-bg); font-weight: 600; }
.cl-ico { font-size: 17px; flex-shrink: 0; }
.cl-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-stage { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 10px; overflow: auto; background: #fafbfd; display: flex; align-items: center; justify-content: center; }
.cl-frame { width: 100%; height: 100%; border: 0; }
.cl-imgbox { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 10px; }
.cl-imgbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.cl-videobox { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: #000; }
.cl-videobox video { max-width: 100%; max-height: 100%; }
.cl-audiobox, .cl-other { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 28px; text-align: center; }
.cl-big { font-size: 54px; }
.cl-oname { font-size: 15px; font-weight: 600; word-break: break-all; }
.cl-tip { font-size: 12px; }
.cl-office { width: 100%; height: 100%; display: flex; flex-direction: column; }
.cl-office .cl-frame { flex: 1; min-height: 0; }
.cl-office-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #fff; border-top: 1px solid var(--border); }
.cl-page-n { font-size: 13px; min-width: 58px; text-align: center; color: var(--text); }
.cl-office-tip { padding: 6px 10px; font-size: 12px; border-top: 1px solid var(--border); background: #fff; }
@media (max-width: 760px) { .cl-body { flex-direction: column; } .cl-list { width: auto; max-height: 150px; } }

/* ---------- badges ---------- */
.badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.b-ac { background: var(--green-bg); color: var(--green); }
.b-wa, .b-re { background: var(--red-bg); color: var(--red); }
.b-tle { background: var(--amber-bg); color: var(--amber); }
.b-ce { background: #eef0f3; color: var(--muted); }
.b-easy { background: var(--green-bg); color: var(--green); }
.b-mid { background: var(--blue-bg); color: var(--primary); }
.b-hard { background: var(--red-bg); color: var(--red); }
.b-tag { background: #eef0f3; color: var(--muted); }
.b-solved { background: var(--green); color: #fff; }

/* ---------- forms ---------- */
label.fld { display: block; margin-bottom: 12px; color: var(--muted); font-size: 13px; }
label.fld input, label.fld select, textarea.ta {
  display: block; width: 100%; margin-top: 5px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 8px; font-size: 14px;
  font-family: inherit; background: #fff; color: var(--text);
}
textarea.ta { font-family: Consolas, monospace; }
input:focus, select:focus, textarea.ta:focus { outline: none; border-color: var(--primary); }
.btn {
  display: inline-block; border: none; border-radius: 8px; padding: 8px 18px;
  background: var(--primary); color: #fff; font-size: 14px; cursor: pointer; font-weight: 500;
  white-space: nowrap;
}
.btn:hover { background: var(--primary-dark); }
.btn.secondary { background: #eef0f3; color: var(--text); }
.btn.secondary:hover { background: #e0e3e8; }
.btn.danger { background: var(--red-bg); color: var(--red); }
.btn.small { padding: 4px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 200px; }

/* ---------- 参与班级多选 ---------- */
.cls-actions { display: flex; gap: 8px; margin-bottom: 8px; }
button.mini {
  border: 1px solid var(--border); background: var(--card); border-radius: 7px;
  padding: 3px 11px; font-size: 12px; cursor: pointer; color: var(--muted);
}
button.mini:hover { color: var(--primary); border-color: var(--primary); }
.cls-box {
  border: 1px solid var(--border); border-radius: var(--radius); background: #fafbfc;
  padding: 8px 12px; max-height: 200px; overflow: auto;
}
.cls-box .cls-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 2px; cursor: pointer; font-size: 13.5px;
}
.cls-box .cls-item:hover { color: var(--primary); }
.cls-box .cls-item input { transform: scale(1.1); cursor: pointer; }
.cls-box .cls-empty { color: var(--muted); padding: 8px 2px; font-size: 13px; }
.cls-hint { color: var(--muted); font-size: 12px; margin-top: 7px; line-height: 1.6; }
.badge.b-all { background: var(--blue-bg); color: var(--primary); }
.tag-idx {
  display: inline-block; min-width: 22px; height: 22px; line-height: 22px; text-align: center;
  border-radius: 6px; background: var(--blue-bg); color: var(--primary);
  font-size: 12px; font-weight: 600; margin-right: 6px;
}

/* ---------- login ---------- */
.login-wrap { display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 20px; }
/* 左右两栏：左插画右表单（窄屏自动叠成上下） */
.login-box {
  display: flex; align-items: stretch; width: 860px; max-width: 100%;
  background: var(--card); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: 0 14px 40px rgba(31, 60, 120, .08); overflow: hidden;
}
.login-hero {
  flex: 1 1 46%; min-width: 0; position: relative; display: flex; align-items: center;
  justify-content: center; padding: 28px 18px;
  background: linear-gradient(165deg, #e9f1ff 0%, #f2efff 55%, #eafaf2 100%);
}
.login-hero img.hero-img { width: 92%; max-width: 340px; height: auto; display: block; }
/* 插画后面的淡淡装饰：圆点网格 + 漂浮的代码符号 */
.login-hero .dots {
  position: absolute; inset: 0; opacity: .5;
  background-image: radial-gradient(#c9d9f5 1.6px, transparent 1.6px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(circle at 50% 45%, #000 30%, transparent 78%);
  mask-image: radial-gradient(circle at 50% 45%, #000 30%, transparent 78%);
}
.login-hero .sym {
  position: absolute; font-family: Consolas, monospace; font-weight: 700;
  color: #2f6df6; opacity: .14; user-select: none; line-height: 1;
}
.login-hero .s1 { font-size: 44px; left: 7%; top: 12%; transform: rotate(-12deg); }
.login-hero .s2 { font-size: 30px; right: 9%; top: 20%; transform: rotate(10deg); color: #5b3df5; }
.login-hero .s3 { font-size: 26px; left: 12%; bottom: 12%; transform: rotate(8deg); color: #ff9f43; opacity: .2; }
.login-hero .s4 { font-size: 34px; right: 7%; bottom: 16%; transform: rotate(-8deg); }
.login-card {
  background: var(--card); border-radius: 0; border: none;
  padding: 40px 42px; width: 390px; flex: 0 0 390px;
}
.login-card h1 { font-size: 21px; margin-bottom: 6px; }
.login-card h1 span { color: var(--primary); }
.login-card .sub { color: var(--muted); margin-bottom: 24px; }
.login-card .hint {
  margin-top: 18px; padding: 12px; background: var(--blue-bg); border-radius: 8px;
  color: var(--muted); font-size: 13px; line-height: 1.8;
}
@media (max-width: 820px) {
  .login-box { flex-direction: column-reverse; width: 420px; }
  .login-hero { padding: 8px 16px 0; min-height: 0; }
  .login-hero img.hero-img { width: 62%; max-width: 240px; }
  .login-hero .sym, .login-hero .dots { display: none; }
  .login-card { flex: 1 1 auto; width: auto; padding: 26px 26px 30px; }
}
.err { color: var(--red); margin: 8px 0; font-size: 13px; min-height: 18px; }
.dl-btn {
  display: block; margin-top: 12px; padding: 9px 12px; border-radius: 8px;
  text-align: center; text-decoration: none; font-size: 13px;
  background: var(--blue-bg); color: var(--primary); border: 1px dashed var(--primary);
}
.dl-btn:hover { filter: brightness(0.97); }
.dl-meta { font-size: 12px; color: var(--muted); }
.dl-tip {
  margin-top: 8px; font-size: 12px; line-height: 1.6; color: var(--muted);
  background: var(--bg); border-radius: 8px; padding: 8px 10px;
}
.dl-tip b { color: var(--text); }

/* ---------- 学生主页欢迎横幅 ---------- */
.home-banner {
  display: flex; align-items: center; gap: 12px; margin-bottom: 18px;
  border-radius: 16px; padding: 6px 22px 0 24px; min-height: 158px; overflow: hidden;
  background: linear-gradient(120deg, #2f6df6 0%, #5b3df5 78%, #7b5df9 100%);
  color: #fff; position: relative;
}
.home-banner::before {
  content: ""; position: absolute; inset: 0; opacity: .16; pointer-events: none;
  background-image: radial-gradient(#fff 1.6px, transparent 1.6px);
  background-size: 24px 24px;
  -webkit-mask-image: linear-gradient(90deg, #000 40%, transparent 75%);
  mask-image: linear-gradient(90deg, #000 40%, transparent 75%);
}
.home-banner .hb-txt { flex: 1 1 auto; min-width: 0; padding: 20px 0; position: relative; }
.home-banner .hb-txt b { display: block; font-size: 21px; letter-spacing: .5px; }
.home-banner .hb-txt span {
  display: block; margin-top: 7px; font-size: 13.5px; opacity: .88; line-height: 1.6;
}
.home-banner .hb-txt a {
  display: inline-block; margin-top: 12px; padding: 7px 16px; border-radius: 999px;
  background: #fff; color: #2f6df6; font-size: 13px; font-weight: 600; text-decoration: none;
}
.home-banner .hb-txt a:hover { filter: brightness(.97); }
.home-banner img { flex: 0 0 auto; width: 218px; max-width: 42%; align-self: flex-end; display: block; }
@media (max-width: 640px) {
  .home-banner img { width: 132px; }
  .home-banner .hb-txt b { font-size: 17px; }
}

/* ---------- 闯关地图：世界图标 ---------- */
.world-card h3 { display: flex; align-items: center; gap: 12px; }
.world-ico {
  width: 46px; height: 46px; border-radius: 13px; flex: 0 0 auto; display: block;
  box-shadow: 0 3px 10px rgba(31, 60, 120, .14);
}
.world-card .w-meta { margin-left: auto; font-size: 12px; font-weight: 400; }
@media (max-width: 560px) { .world-ico { width: 38px; height: 38px; } }

/* ---------- problem page ---------- */
.prob-layout { display: flex; gap: 20px; align-items: flex-start; }
.prob-desc { flex: 1; min-width: 0; }
.prob-editor { flex: 1; min-width: 0; position: sticky; top: 16px; }
.desc-body { line-height: 1.9; white-space: pre-wrap; }
.desc-sec { margin: 14px 0; }
.desc-sec .sec-title { font-weight: 600; margin-bottom: 4px; }
pre.sample {
  background: #f7f8fa; border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; font-family: Consolas, monospace; font-size: 13px; white-space: pre-wrap;
}
.CodeMirror { height: 380px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; }
.editor-actions { display: flex; gap: 10px; margin: 12px 0; }
.cm-toolbar { display: flex; align-items: center; gap: 10px; margin: 14px 0 10px; }
.cmp-status { font-size: 13px; padding: 3px 12px; border-radius: 12px; background: #eef0f3; color: var(--muted); white-space: nowrap; }
.cmp-status.ok { background: var(--green-bg); color: var(--green); }
.cmp-status.err { background: var(--red-bg); color: var(--red); }
.cmp-status.running { background: #eaf2ff; color: #2b6fd6; }
.cmp-io { margin: 14px 0 8px; }
.cmp-io-title { font-size: 13px; font-weight: 600; color: var(--text); margin: 4px 2px 6px; }
.cmp-console-wrap { margin-top: 6px; }
.cmp-console {
  background: #1e2430; color: #d6f5e3; border-radius: 8px; padding: 12px 14px;
  font-family: Consolas, "Courier New", monospace; font-size: 13px; white-space: pre-wrap;
  min-height: 80px; max-height: 360px; overflow: auto; margin: 0; line-height: 1.5;
}
.cmp-console.ok { color: #9ff0c2; }
.cmp-console.err { color: #ff9b9b; }
.cmp-console.info { color: #cfe3ff; }
.judge-result {
  margin-top: 8px; padding: 12px 14px; border-radius: 8px; font-size: 13px;
  white-space: pre-wrap; display: none;
}
.jr-ac { background: var(--green-bg); color: var(--green); }
.jr-bad { background: var(--red-bg); color: var(--red); }
.jr-warn { background: var(--amber-bg); color: var(--amber); }
.jr-info { background: #eef0f3; color: var(--muted); }

/* ---------- misc ---------- */
.filter-bar { display: flex; gap: 10px; margin-bottom: 14px; align-items: center; }
.filter-bar select { padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.prob-title { color: var(--primary); text-decoration: none; font-weight: 500; }
.prob-title:hover { text-decoration: underline; }
.kv { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--border); }
.kv > b { width: 88px; flex: none; color: var(--muted); font-weight: 600; }
.kv.block { display: block; }
.kv.block > b { display: block; width: auto; margin-bottom: 6px; }
.mono { font-family: Consolas, monospace; }
.sample, .case pre { background: #fafbfc; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin: 6px 0 0; white-space: pre-wrap; font-family: Consolas, monospace; font-size: 13px; }
.case { background: #fafbfc; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; margin: 8px 0; }
.case .muted { font-size: 12px; margin-bottom: 2px; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }
.muted { color: var(--muted); }
.mt { margin-top: 14px; }
.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.tabs button {
  border: none; background: none; padding: 10px 18px; cursor: pointer; font-size: 14px;
  color: var(--muted); border-bottom: 2px solid transparent; font-weight: 500;
}
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.note {
  background: var(--amber-bg); color: var(--amber); padding: 10px 14px;
  border-radius: 8px; font-size: 13px; margin-bottom: 14px;
}
/* ---- 闯关地图（v1.2） ---- */
.map-chain{display:flex;flex-wrap:wrap;gap:12px;margin-top:12px}
.lv{width:150px;border-radius:12px;padding:12px 10px;text-align:center;cursor:pointer;border:1px solid #d0d7de;background:#fff;transition:transform .1s}
.lv:hover{transform:translateY(-2px)}
.lv-locked{opacity:.45;cursor:not-allowed;background:#f6f8fa}
.lv-done{background:#eaf3de;border-color:#3b6d11}
.lv-open{background:#e6f1fb;border-color:#185fa5}
.lv-t{font-size:13px;font-weight:500;color:#1f2328}
.lv-s{font-size:14px;color:#ba7517;margin-top:4px;letter-spacing:2px}
.lv-locked .lv-s{color:#57606a}
.lv-n{font-size:11px;color:#57606a;margin-top:2px}
.clear-banner{background:#eaf3de;border:1px solid #3b6d11;color:#27500a;border-radius:12px;padding:14px 16px;font-size:15px;margin-bottom:14px}
/* ---- 200 关的密集地图：网格版关卡格 ---- */
.lv-rule{background:#f6f8fa;border:1px solid #d0d7de;border-radius:10px;padding:10px 12px;font-size:14px;line-height:1.75;color:#1f2328}
.wbar{height:8px;border-radius:6px;background:#e6e8eb;overflow:hidden;margin-top:10px}
.wbar>i{display:block;height:100%;background:#1d9e75;transition:width .3s}
.map-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(102px,1fr));gap:8px;margin-top:12px}
.lv.sm{width:auto;padding:8px 6px;border-radius:10px}
.lv.sm .lv-t{font-size:15px;font-weight:600}
.lv.sm .lv-s{font-size:12px;letter-spacing:0;margin-top:2px}
.lv-tag{font-size:11px;color:#57606a;margin-top:1px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lv-prog{color:#ba7517;font-weight:600}
.lv-locked .lv-prog{color:#57606a}
@media (max-width:700px){ .map-grid{grid-template-columns:repeat(auto-fill,minmax(88px,1fr))} }

/* ---------- 学生查找 ---------- */
.stu-search { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stu-search input {
  flex: 1 1 320px; min-width: 200px; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: 8px; font-size: 14px;
  font-family: inherit; background: #fff; color: var(--text);
}
.stu-search input:focus { outline: none; border-color: var(--primary); }
.stu-search .btn { white-space: nowrap; }

/* ---------- 弹窗（编辑学生信息） ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(20, 28, 40, .38);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow: auto;
}
.modal {
  background: var(--card); border-radius: 14px; padding: 24px;
  width: 100%; max-width: 460px; text-align: left;
  box-shadow: 0 18px 48px rgba(20, 30, 60, .22);
}
.modal h3 { font-size: 17px; margin-bottom: 12px; font-weight: 600; }
.modal .fld input { font-size: 14px; }
.modal-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border);
}
.modal-err { color: var(--red); font-size: 13px; margin-top: 10px; min-height: 18px; }

/* ----- 家长查询码弹窗 ----- */
.pc-list { max-height: 52vh; overflow-y: auto; }
.pc-row { padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.pc-row:last-child { border-bottom: none; }
.pc-line { display: flex; align-items: center; gap: 8px; margin: 6px 0 3px; flex-wrap: wrap; }
.pc-code {
  font-size: 16px; font-weight: 700; letter-spacing: 2px;
  background: var(--bg, #f2f4f8); border: 1px solid var(--border);
  border-radius: 8px; padding: 3px 10px; font-family: Consolas, monospace;
}

@media (max-width: 560px) {
  .modal-mask { padding: 16px 10px; }
  .modal { padding: 18px; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .btn { width: 100%; }
}

/* ============================================================
   比赛答题页（学生端）—— 与「本地考试客户端」同一套观感
   左序号 / 右题目 + 顶部倒计时 + 只保存不回对错
   ============================================================ */
.page.wide { max-width: 1400px; }

.exam-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.exam-head h2 { font-size: 20px; }
.exam-head .head-right { text-align: right; }
.exam-head .clock {
  font-size: 26px; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums;
  letter-spacing: 1px; line-height: 1.2;
}

.countdown { text-align: center; padding: 34px 10px 26px; }
.countdown .big {
  font-size: 62px; font-weight: 700; letter-spacing: 3px; color: var(--primary);
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.countdown .hint { color: var(--muted); font-size: 14px; margin-top: 12px; }

.exam-body { display: flex; gap: 16px; align-items: flex-start; }
.exam-side {
  flex: 0 0 250px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 12px; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto;
}
.exam-side .side-head { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.exam-side .side-head .muted { font-weight: 400; margin-left: 4px; }
.exam-side .side-tip {
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border);
  font-size: 11.5px; color: var(--muted); line-height: 1.6;
}
.exam-main { flex: 1 1 auto; min-width: 0; }

button.side-item {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  border: 1px solid var(--border); background: #f8fafd; border-radius: 10px;
  padding: 8px 9px; margin-bottom: 7px; font-size: 13px; color: var(--text);
  font-family: inherit; cursor: pointer;
}
button.side-item:hover { background: #eef4ff; border-color: #c9d8f5; }
button.side-item.active { background: #e8f0ff; border-color: var(--primary); color: var(--primary-dark); font-weight: 600; }
.side-item .sn {
  flex: 0 0 26px; height: 26px; border-radius: 8px; background: #fff; border: 1px solid #dbe3f1;
  display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--primary);
}
.side-item.active .sn { background: var(--primary); color: #fff; border-color: var(--primary); }
.side-item .st { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-item .sk { flex: 0 0 auto; font-size: 11px; color: var(--muted); }
.side-item.active .sk { color: #5b78c0; }
/* 已提交过：序号背景变绿（放在 .active 之后，两个都命中时也显绿） */
button.side-item.done { background: #f2fbf5; border-color: #b7e4c7; }
button.side-item.done:hover { background: #e9f8ef; border-color: #8fd3a9; }
button.side-item.done .sn { background: var(--green); border-color: var(--green); color: #fff; }
button.side-item.done .sk { color: var(--green); font-weight: 600; }
button.side-item.active.done { background: #e9f8ef; border-color: var(--green); color: #14663a; }
button.side-item.active.done .sn { background: #14663a; border-color: #14663a; }

.exam-main h2 { font-size: 18px; }
h3.sec { font-size: 14px; margin: 18px 0 6px; font-weight: 600; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
pre.box {
  background: #f8fafc; border: 1px solid var(--border); border-radius: 9px; padding: 12px 14px;
  white-space: pre-wrap; word-break: break-word; font-family: Consolas, "Courier New", monospace;
  font-size: 13px; margin: 6px 0 14px; line-height: 1.6;
}
pre.box.plain { font-family: "PingFang SC", "Microsoft YaHei", sans-serif; }

.btn.sec { background: #eef2fa; color: #3a4a68; }
.btn.sec:hover { background: #e2e9f7; }

label.opt {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: 10px; margin-bottom: 9px; cursor: pointer; font-size: 14px;
}
label.opt:hover { background: #f7faff; border-color: #c9d8f5; }
label.opt input { transform: scale(1.15); cursor: pointer; }

.tag {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px;
  background: #eef2fa; color: #4a5568; margin-left: 6px; font-weight: 400; vertical-align: middle;
}
.tag.live { background: var(--green-bg); color: var(--green); }
.tag.pending { background: var(--amber-bg); color: var(--amber); }
.tag.done { background: #f0f1f4; color: var(--muted); }

.exam-main .result { margin-top: 14px; padding: 14px; border-radius: 10px; font-size: 14px; display: none; }
.exam-main .result.show { display: block; }
.exam-main .result.ok { background: #eefaf2; border: 1px solid #b7e4c7; color: #14663a; }
.exam-main .result.bad { background: var(--red-bg); border: 1px solid #f3c2c2; color: #9c2b2b; }
.exam-main .result.neutral { background: #eef4ff; border: 1px solid #c9d8f5; color: #24406e; }
.exam-main .result pre { margin: 8px 0 0; white-space: pre-wrap; font-size: 12.5px; font-family: Consolas, monospace; }

.empty-pick { text-align: center; color: var(--muted); padding: 70px 10px; line-height: 2; }
.loading { color: var(--muted); padding: 30px 0; text-align: center; }

/* 顶部提示条：提交成功/失败都冒一下，学生滚到哪儿都看得见 */
#toast {
  position: fixed; left: 50%; top: 18px; transform: translate(-50%, -24px);
  z-index: 9999; max-width: 82vw; padding: 12px 20px; border-radius: 12px;
  background: #14663a; color: #fff; font-size: 15px; font-weight: 600;
  box-shadow: 0 10px 26px rgba(20, 102, 58, .28);
  opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: #9c2b2b; box-shadow: 0 10px 26px rgba(156, 43, 43, .28); }

@media (max-width: 900px) {
  .exam-body { flex-direction: column; }
  .exam-side { position: static; flex: 1 1 auto; width: 100%; max-height: none; }
}

/* 窄屏：左侧竖排导航折回顶部横条（横向可滚动） */
@media (max-width: 900px) {
  body.has-nav { padding-left: 0; padding-top: 56px; }
  .nav {
    left: 0; right: 0; bottom: auto; width: auto; height: 56px;
    flex-direction: row; align-items: center; gap: 6px;
    padding: 0 10px; border-right: none; border-bottom: 1px solid var(--border);
    overflow-x: auto; overflow-y: hidden;
  }
  .nav .brand { border-bottom: none; padding: 0 10px 0 0; margin: 0; flex: 0 0 auto; }
  .nav .brand-sub { display: none; }
  .nav .brand-name { font-size: 15px; white-space: nowrap; }
  .nav .nav-tabs { flex-direction: row; gap: 2px; flex: 0 0 auto; }
  .nav a.tab { padding: 8px 10px; border-radius: 8px; }
  .nav a.tab .ico { width: auto; font-size: 15px; }
  .nav .spacer { display: none; }
  .nav .nav-user { border-top: none; padding: 0; margin: 0 0 0 4px; flex: 0 0 auto; }
  .nav .who { display: none; }
  .nav button.linkbtn { margin-top: 0; width: auto; padding: 7px 12px; white-space: nowrap; }
}

/* ================= 排课 / 备课 / 教案库（v1.4） ================= */

/* 表单网格：课程信息一行两三个字段，窄屏自动换行 */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px 14px; }
.form-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }
.form-grid .fg-2 { grid-column: span 2; }
.form-grid input, .form-grid select {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; color: var(--text); background: var(--card); outline: none;
}
.form-grid input:focus, .form-grid select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--blue-bg); }
.cp-modes { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.cp-slots { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.cp-slot { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cp-slot select, .cp-slot input { padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }

/* 课程元信息条 */
.course-meta {
  display: flex; gap: 8px 22px; flex-wrap: wrap; margin-bottom: 14px;
  padding: 11px 16px; background: var(--blue-bg); border-radius: var(--radius);
  font-size: 13.5px; color: var(--text);
}

/* 备课笔记编辑区 */
.prep-area {
  width: 100%; min-height: 300px; padding: 14px 16px; resize: vertical;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-family: inherit; font-size: 14px; line-height: 1.9; color: var(--text);
  background: var(--card); outline: none;
}
.prep-area:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--blue-bg); }

/* 上传区：点选 or 拖拽 */
.dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 26px 16px; text-align: center; cursor: pointer;
  background: var(--bg); transition: all .15s ease; margin-bottom: 12px;
}
.dropzone:hover { border-color: var(--primary); background: var(--blue-bg); }
.dropzone.over { border-color: var(--primary); background: var(--blue-bg); transform: scale(1.005); }
.dropzone .dz-ico { font-size: 30px; margin-bottom: 6px; }

/* 上传进度条 */
.prog-wrap { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.prog-bar { flex: 1; height: 8px; background: var(--border); border-radius: 99px; overflow: hidden; }
.prog-bar > i { display: block; height: 100%; width: 0; background: var(--primary); border-radius: 99px; transition: width .15s ease; }

/* 文件表格：文件名那一列别挤 */
.file-tbl td { vertical-align: middle; }
.file-tbl b { word-break: break-all; }
.link-go { color: var(--primary); font-weight: 600; font-size: 13px; }

/* 课程表「操作」列：备课/上课两个小按钮竖排，各占一行不挤 */
.op-cell { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.op-cell .btn { width: 100%; text-align: center; }

/* 教案库文件夹 chips */
.folder-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.folder-chip {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 7px 13px; border: 1px solid var(--border); border-radius: 99px;
  background: var(--card); font-size: 13.5px; transition: all .15s ease;
}
.folder-chip:hover { border-color: var(--primary); color: var(--primary); }
.folder-chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.folder-chip.on .muted { color: rgba(255, 255, 255, .82); }
