/* ============================================================
   共享设计系统
   取向：白底、轻边框、大留白、单一强调色。
   移动优先编写，桌面通过媒体查询增强。
   ============================================================ */

:root {
  /* 中性色阶 */
  --c0: #ffffff;
  --c1: #f8fafc;
  --c2: #f1f5f9;
  --c3: #e8edf3;
  --c4: #cbd5e1;
  --c5: #94a3b8;
  --c6: #64748b;
  --c7: #475569;
  --c8: #1e293b;
  --c9: #0f172a;

  /* 强调色：克制的蓝 */
  --brand: #2563eb;
  --brand-hover: #1d4ed8;
  --brand-soft: #eff5ff;
  --brand-line: #c7dbfe;

  /* 语义色 */
  --ok: #15803d;
  --ok-soft: #f0fdf4;
  --ok-line: #bbf7d0;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --warn-line: #fde68a;
  --err: #dc2626;
  --err-soft: #fef2f2;
  --err-line: #fecaca;

  --text: var(--c8);
  --text-dim: var(--c6);
  --text-mute: var(--c5);
  --line: var(--c3);
  --bg: var(--c1);

  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --r-full: 999px;

  --sp1: 4px;
  --sp2: 8px;
  --sp3: 12px;
  --sp4: 16px;
  --sp5: 20px;
  --sp6: 24px;
  --sp8: 32px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .04);
  --shadow-lg: 0 8px 40px rgba(15, 23, 42, .12);

  --topbar-h: 52px;
  --tabbar-h: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro SC", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 { margin: 0; font-weight: 600; color: var(--c9); line-height: 1.4; }
h1 { font-size: 19px; }
h2 { font-size: 16px; }
h3 { font-size: 14.5px; }
h4, h5 { font-size: 13.5px; }
p { margin: 0 0 var(--sp3); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: var(--brand-soft); }

/* ---------------------------------------------------------- 文字工具 */
.muted { color: var(--text-dim); }
.mute2 { color: var(--text-mute); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.center { text-align: center; }
.right { text-align: right; }

/* ---------------------------------------------------------- 顶栏 */
.topbar {
  display: flex;
  align-items: center;
  gap: var(--sp3);
  height: var(--topbar-h);
  padding: 0 var(--sp4);
  background: var(--c0);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar .logo {
  display: flex;
  align-items: center;
  gap: var(--sp2);
  font-size: 15px;
  font-weight: 600;
  color: var(--c9);
}
.topbar .logo .dot {
  width: 22px; height: 22px;
  border-radius: 7px;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
}
.topbar .logo small { font-weight: 400; color: var(--text-mute); font-size: 12px; }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: 13px; color: var(--text-dim); }

/* 顶栏主导航：桌面端显示，移动端交给底部 .tabbar */
.navtabs { display: none; gap: var(--sp1); margin-left: var(--sp4); }
.navtabs button {
  border: 0;
  background: none;
  font: inherit;
  font-size: 13.5px;
  color: var(--text-dim);
  padding: 7px var(--sp3);
  border-radius: var(--r-sm);
  cursor: pointer;
  white-space: nowrap;
}
.navtabs button:hover { background: var(--c2); color: var(--c9); }
.navtabs button.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
@media (min-width: 760px) {
  .navtabs { display: flex; }
}

/* 面包屑：任何子页面都能看清自己在哪、怎么回去 */
.crumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-mute);
  margin-bottom: var(--sp3);
}
.crumb button {
  border: 0;
  background: none;
  font: inherit;
  font-size: 12.5px;
  color: var(--brand);
  padding: 2px 0;
  cursor: pointer;
}
.crumb button:hover { text-decoration: underline; }
.crumb .sep { color: var(--c4); }
.crumb .now { color: var(--text-dim); font-weight: 600; }
.crumb:empty { display: none; }

/* 子页面头部：返回按钮 + 标题 + 右侧操作，保证每页都有出口 */
.subhead {
  display: flex;
  align-items: center;
  gap: var(--sp3);
  margin-bottom: var(--sp4);
  flex-wrap: wrap;
}
.subhead .spacer { flex: 1; }
.subhead h2 { font-size: 17px; }

/* ---------------------------------------------------------- 页签 */
.tabs {
  display: flex;
  gap: var(--sp1);
  padding: 0 var(--sp4);
  background: var(--c0);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: var(--topbar-h);
  z-index: 29;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: none;
  border: 0;
  background: none;
  padding: 13px var(--sp3);
  font: inherit;
  font-size: 13.5px;
  color: var(--text-dim);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tabs button:hover { color: var(--c9); }
.tabs button.active { color: var(--brand); font-weight: 600; border-bottom-color: var(--brand); }

/* ---------------------------------------------------------- 页面容器 */
.page { max-width: 1200px; margin: 0 auto; padding: var(--sp4); }
.page.narrow { max-width: 720px; }
.page.mid { max-width: 880px; }
.view { display: none; }
.view.active { display: block; }

.stack > * + * { margin-top: var(--sp4); }
.row { display: flex; gap: var(--sp2); align-items: center; flex-wrap: wrap; }
.row.tight { gap: var(--sp1); }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.row .spacer { flex: 1; }

.grid { display: grid; gap: var(--sp3); }
.grid.c2 { grid-template-columns: 1fr 1fr; }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c4 { grid-template-columns: repeat(2, 1fr); }

@media (min-width: 760px) {
  .page { padding: var(--sp5); }
  .grid.c4 { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 759px) {
  .grid.c2, .grid.c3 { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------- 卡片 */
.card {
  background: var(--c0);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--sp4);
}
.card + .card { margin-top: var(--sp4); }
.card > header {
  display: flex;
  align-items: center;
  gap: var(--sp3);
  margin-bottom: var(--sp3);
  padding-bottom: var(--sp3);
  border-bottom: 1px solid var(--line);
}
.card > header.plain { border: 0; padding-bottom: 0; margin-bottom: var(--sp3); }
.card > header .spacer { flex: 1; }
.card .hint { color: var(--text-dim); font-size: 12.5px; margin: calc(-1 * var(--sp1)) 0 var(--sp3); }
.card.flat { border-radius: var(--r); }
.card.pad-lg { padding: var(--sp6); }

@media (min-width: 760px) {
  .card { padding: var(--sp5); }
}

/* ---------------------------------------------------------- 统计块 */
.stat {
  background: var(--c0);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--sp3) var(--sp4);
}
.stat .k { font-size: 12px; color: var(--text-dim); }
.stat .v { font-size: 22px; font-weight: 650; color: var(--c9); line-height: 1.35; letter-spacing: -.02em; }
.stat .v small { font-size: 12.5px; font-weight: 400; color: var(--text-mute); }
.stat .s { font-size: 11.5px; color: var(--text-mute); }

/* ---------------------------------------------------------- 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  min-height: 36px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: var(--r-sm);
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn:active { transform: translateY(.5px); }

.btn.ghost { background: var(--c0); color: var(--brand); border-color: var(--brand-line); }
.btn.ghost:hover { background: var(--brand-soft); border-color: var(--brand); }
.btn.subtle { background: var(--c0); color: var(--c7); border-color: var(--c4); }
.btn.subtle:hover { background: var(--c2); color: var(--c9); }
.btn.danger { background: var(--c0); color: var(--err); border-color: var(--err-line); }
.btn.danger:hover { background: var(--err-soft); }
.btn.link { background: none; border-color: transparent; color: var(--brand); padding: 4px 6px; min-height: 0; }
.btn.link:hover { background: var(--brand-soft); text-decoration: none; }

.btn.sm { padding: 4px 10px; min-height: 28px; font-size: 12.5px; }
.btn.lg { padding: 12px 20px; min-height: 46px; font-size: 15px; border-radius: var(--r); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:disabled:active { transform: none; }

/* ---------------------------------------------------------- 表单 */
.field { display: block; margin-bottom: var(--sp3); }
.field > span, .label {
  display: block;
  font-size: 12.5px;
  color: var(--text-dim);
  margin-bottom: 5px;
}
.field .req { color: var(--err); }

input[type="text"], input[type="password"], input[type="number"], input[type="url"],
input[type="date"], input[type="datetime-local"], input[type="tel"], input[type="email"],
select, textarea {
  width: 100%;
  padding: 9px 11px;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--c0);
  border: 1px solid var(--c4);
  border-radius: var(--r-sm);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
  appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%2364748b' stroke-width='1.5' d='M3 5l3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}
input::placeholder, textarea::placeholder { color: var(--text-mute); }
input:disabled, select:disabled, textarea:disabled { background: var(--c2); color: var(--text-mute); }
textarea { resize: vertical; min-height: 76px; line-height: 1.65; }

.check {
  display: flex;
  align-items: flex-start;
  gap: var(--sp2);
  font-size: 13.5px;
  margin-bottom: var(--sp3);
  cursor: pointer;
}
.check input { width: 16px; height: 16px; margin: 3px 0 0; flex: none; accent-color: var(--brand); }
.check span { color: var(--text); }

/* 开关 */
.switch { display: inline-flex; align-items: center; gap: var(--sp2); cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch i {
  width: 38px; height: 22px;
  border-radius: var(--r-full);
  background: var(--c4);
  position: relative;
  transition: background .18s;
  flex: none;
}
.switch i::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform .18s;
  box-shadow: var(--shadow-sm);
}
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { transform: translateX(16px); }

/* ---------------------------------------------------------- 表格 */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td {
  padding: 10px var(--sp3);
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.data th {
  background: var(--c1);
  color: var(--text-dim);
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--c1); }
table.data tr.on { background: var(--brand-soft); }
table.data td.num, table.data th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.data td.act { text-align: right; white-space: nowrap; }
table.data td.act .btn + .btn { margin-left: var(--sp1); }

/* 题型评分维度：给老师足够的编辑空间，避免输入框被表格内容挤窄。 */
.question-type-config-table { min-width: 860px; table-layout: fixed; }
.question-type-config-table th:nth-child(1), .question-type-config-table td:nth-child(1) { width: 22%; }
.question-type-config-table th:nth-child(2), .question-type-config-table td:nth-child(2) { width: 13%; }
.question-type-config-table th:nth-child(3), .question-type-config-table td:nth-child(3) { width: 15%; }
.question-type-config-table th:nth-child(4), .question-type-config-table td:nth-child(4) { width: 38%; }
.question-type-config-table th:nth-child(5), .question-type-config-table td:nth-child(5) { width: 12%; }
.question-type-config-table td { padding: 14px 12px; background: var(--c0); }
.question-type-config-table tbody tr:hover td { background: var(--brand-soft); }
.question-type-config-table input[type="text"], .question-type-config-table input[type="number"] { min-height: 42px; font-size: 14px; }
.question-type-config-table input[type="text"], .question-type-config-table input[type="number"] { width: 100%; box-sizing: border-box; }
.question-type-config-table textarea { width: 100%; min-height: 58px; box-sizing: border-box; resize: vertical; font-size: 14px; }
.question-type-config-table td:nth-child(4) input { min-width: 100%; }
.question-type-config-table .check { margin: 0; align-items: center; white-space: nowrap; }

/* ---------------------------------------------------------- 列表（移动端友好） */
.list { display: flex; flex-direction: column; gap: var(--sp2); }
.item {
  display: block;
  background: var(--c0);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--sp3) var(--sp4);
  text-decoration: none;
  color: inherit;
}
.item:hover { border-color: var(--brand-line); text-decoration: none; }
.item .t { font-size: 14.5px; font-weight: 600; color: var(--c9); }
.item .d { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; }
.item .r { margin-left: auto; text-align: right; flex: none; }
.item-row { display: flex; align-items: center; gap: var(--sp3); }

/* ---------------------------------------------------------- 标签 */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-size: 11.5px;
  line-height: 1.7;
  border: 1px solid transparent;
  white-space: nowrap;
}
.tag.b { background: var(--brand-soft); color: var(--brand); border-color: var(--brand-line); }
.tag.g { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.tag.r { background: var(--err-soft); color: var(--err); border-color: var(--err-line); }
.tag.a { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.tag.n { background: var(--c2); color: var(--text-dim); border-color: var(--c3); }

/* ---------------------------------------------------------- 提示条 */
.alert {
  padding: 10px var(--sp3);
  border-radius: var(--r-sm);
  border: 1px solid var(--brand-line);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13px;
  margin-bottom: var(--sp3);
}
.alert.success { border-color: var(--ok-line); background: var(--ok-soft); color: var(--ok); }
.alert.error { border-color: var(--err-line); background: var(--err-soft); color: var(--err); }
.alert.warn { border-color: var(--warn-line); background: var(--warn-soft); color: var(--warn); }
.alert:empty { display: none; }

/* ---------------------------------------------------------- 空状态 */
.empty {
  padding: var(--sp8) var(--sp4);
  text-align: center;
  color: var(--text-mute);
  font-size: 13px;
}
.empty .ico { font-size: 28px; opacity: .35; margin-bottom: var(--sp2); }

/* ---------------------------------------------------------- 进度 */
.bar { height: 6px; background: var(--c2); border-radius: var(--r-full); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: var(--r-full); transition: width .4s ease; }
.bar.thin { height: 4px; }

/* ---------------------------------------------------------- 分隔 */
.hr { height: 1px; background: var(--line); border: 0; margin: var(--sp4) 0; }

/* ---------------------------------------------------------- 弹层 */
.mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .4);
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fade .16s ease;
}
.mask[hidden] { display: none; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }

.dialog {
  background: var(--c0);
  width: 100%;
  max-height: 92vh;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  display: flex;
  flex-direction: column;
  animation: up .22s cubic-bezier(.32, .72, 0, 1);
}
@keyframes up { from { transform: translateY(4%) } to { transform: none } }

.dialog > header {
  display: flex;
  align-items: center;
  gap: var(--sp3);
  padding: var(--sp4);
  border-bottom: 1px solid var(--line);
  flex: none;
}
.dialog > header .spacer { flex: 1; }
.dialog > .body { padding: var(--sp4); overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; }
.dialog > footer {
  display: flex;
  gap: var(--sp2);
  padding: var(--sp3) var(--sp4) calc(var(--sp3) + var(--safe-b));
  border-top: 1px solid var(--line);
  background: var(--c0);
  flex: none;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.dialog > footer .btn { flex: 1; }
.x {
  border: 0; background: none; padding: 4px;
  font-size: 22px; line-height: 1; color: var(--text-mute); cursor: pointer;
}
.x:hover { color: var(--text); }

@media (min-width: 760px) {
  /* 桌面：居中、固定高度、内容区内部滚动，头尾始终可见 */
  .mask { align-items: center; padding: var(--sp5) var(--sp4); }
  .dialog {
    max-width: 760px;
    border-radius: var(--r-lg);
    height: min(86vh, 920px);
    max-height: 86vh;
    animation: pop .18s ease;
  }
  .dialog.narrow { max-width: 520px; }
  .dialog.wide { max-width: 1040px; }
  /* 内容不多时不必撑满，按内容高度显示 */
  .dialog.auto { height: auto; }
  .dialog > footer { padding-bottom: var(--sp3); }
  .dialog > footer .btn { flex: none; }
  @keyframes pop { from { opacity: 0; transform: scale(.98) } to { opacity: 1; transform: none } }
}

/* 嵌套弹层：从一个弹窗里再打开配置弹窗时压在上层 */
.mask.layer2 { z-index: 70; background: rgba(15, 23, 42, .46); }

/* ---------------------------------------------------------- 登录页 */
.auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp5) var(--sp4);
  background: var(--bg);
}
.auth-box { width: 100%; max-width: 380px; }
.auth-box .brand {
  text-align: center;
  margin-bottom: var(--sp5);
}
.auth-box .brand .dot {
  width: 44px; height: 44px;
  border-radius: 13px;
  background: var(--brand);
  color: #fff;
  display: grid; place-items: center;
  font-size: 20px; font-weight: 700;
  margin: 0 auto var(--sp3);
}
.auth-box .brand h1 { font-size: 20px; }
.auth-box .brand p { color: var(--text-dim); font-size: 13px; margin: 4px 0 0; }
.auth-switch { text-align: center; margin-top: var(--sp4); font-size: 13px; color: var(--text-dim); }

/* ---------------------------------------------------------- 移动端底部导航 */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(1.6) blur(12px);
  border-top: 1px solid var(--line);
  display: flex;
  z-index: 40;
}
.tabbar button {
  flex: 1;
  border: 0;
  background: none;
  font: inherit;
  font-size: 10.5px;
  color: var(--text-mute);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tabbar button .ico { font-size: 19px; line-height: 1; }
.tabbar button.active { color: var(--brand); font-weight: 600; }
.has-tabbar { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + var(--sp4)); }

@media (min-width: 760px) {
  .tabbar { display: none; }
  .has-tabbar { padding-bottom: var(--sp5); }
}

/* ---------------------------------------------------------- 成绩展示 */
.score {
  text-align: center;
  padding: var(--sp5) var(--sp4);
  background: linear-gradient(180deg, var(--brand-soft), var(--c0));
  border: 1px solid var(--brand-line);
  border-radius: var(--r-lg);
}
.score .who { font-size: 13.5px; color: var(--text-dim); }
.score .n {
  font-size: 44px;
  font-weight: 700;
  color: var(--brand);
  line-height: 1.1;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.score .n small { font-size: 16px; font-weight: 500; color: var(--text-dim); letter-spacing: 0; }
.score .st { font-size: 18px; font-weight: 600; color: var(--c8); }

/* ---------------------------------------------------------- 详情块
   注意：该组件原名 .block，与按钮通栏修饰类 .btn.block 撞名，
   会把主按钮的默认态覆盖成白底，故统一改名为 .panel。
   新增组件类名时不要使用 block / sm / lg / ghost / subtle / danger / link，
   这些名字已被 .btn 的修饰类占用。 */
.panel {
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--c0);
}
.panel + .panel { margin-top: var(--sp3); }
.panel > header {
  display: flex;
  align-items: center;
  gap: var(--sp2);
  padding: 10px var(--sp4);
  background: var(--c1);
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--c9);
}
.panel > header .spacer { flex: 1; }
.panel > .body { padding: var(--sp4); }
.panel h5 { margin: var(--sp3) 0 6px; font-size: 12.5px; color: var(--text-dim); font-weight: 600; }
.panel h5:first-child { margin-top: 0; }

.quote {
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--c1);
  border-left: 2px solid var(--brand-line);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: var(--sp3);
  font-size: 13px;
  line-height: 1.75;
}
.source-draft-preview {
  max-height: 300px;
  overflow: auto;
  margin: 0;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.65;
}
.source-raw-preview {
  max-height: 220px;
  overflow: auto;
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
}
.source-raw { margin-top: 12px; }
.source-raw summary { cursor: pointer; color: var(--text-dim); font-size: 13px; padding: 6px 0; }
.q-material-details { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; background: var(--c1); }
.q-material-details summary { cursor: pointer; color: var(--text-dim); font-size: 13px; margin-bottom: 8px; }
.q-material-details[open] summary { color: var(--brand); }
.hint-box { min-height: 42px; display: flex; align-items: center; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--c1); color: var(--text-dim); font-size: 13px; line-height: 1.5; }
ul.tight { margin: 0 0 var(--sp2); padding-left: 18px; }
ul.tight li { margin-bottom: 3px; }

/* ---------------------------------------------------------- 上传 */
.drop {
  border: 1.5px dashed var(--c4);
  border-radius: var(--r);
  padding: var(--sp6) var(--sp4);
  text-align: center;
  color: var(--text-dim);
  background: var(--c0);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.drop .ico { font-size: 26px; opacity: .5; display: block; margin-bottom: var(--sp2); }
.drop .t { font-size: 14px; font-weight: 500; color: var(--c8); }
.drop .s { font-size: 12px; margin-top: 2px; }

.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: var(--sp2); margin-top: var(--sp3); }
.thumb { position: relative; }
.thumb img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  display: block;
  background: var(--c2);
}
.thumb .doc-face {
  aspect-ratio: 3 / 4;
  border-radius: var(--r-sm);
  border: 1px solid var(--brand-line);
  background: var(--brand-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  overflow: hidden;
  text-align: center;
}
.thumb .doc-face b { font-size: 15px; color: var(--brand); letter-spacing: .5px; }
.thumb .doc-face span {
  font-size: 10.5px;
  color: var(--text-dim);
  line-height: 1.35;
  word-break: break-all;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.thumb .nm { font-size: 10.5px; color: var(--text-mute); margin-top: 2px; word-break: break-all; line-height: 1.4; }
.thumb .del {
  position: absolute;
  top: -6px; right: -6px;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--c0);
  color: var(--err);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
}

/* ---------------------------------------------------------- 题目卡（学员看题） */
.qcard {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--sp4);
  background: var(--c0);
}
.qcard + .qcard { margin-top: var(--sp2); }
.qcard .hd { display: flex; align-items: center; gap: var(--sp2); margin-bottom: var(--sp2); }
.qcard .no {
  width: 22px; height: 22px;
  border-radius: var(--r-sm);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
  display: grid;
  place-items: center;
  flex: none;
}
.qcard .stem { font-size: 13.5px; line-height: 1.7; color: var(--text); white-space: pre-wrap; }
.qcard .meta { margin-top: var(--sp2); font-size: 12px; color: var(--text-mute); }

/* ---------------------------------------------------------- 折叠 */
details.fold {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--c0);
  overflow: hidden;
}
details.fold + details.fold { margin-top: var(--sp2); }
details.fold > summary {
  padding: var(--sp3) var(--sp4);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--c9);
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--sp2);
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after {
  content: "›";
  margin-left: auto;
  color: var(--text-mute);
  font-size: 18px;
  transition: transform .18s;
}
details.fold[open] > summary::after { transform: rotate(90deg); }
details.fold > summary:hover { background: var(--c1); }
details.fold > .fold-body { padding: 0 var(--sp4) var(--sp4); }

/* ---------------------------------------------------------- 加载 */
.spin {
  width: 16px; height: 16px;
  border: 2px solid var(--brand-line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: rot .7s linear infinite;
  display: inline-block;
  vertical-align: -3px;
}
@keyframes rot { to { transform: rotate(360deg) } }
.loading { text-align: center; padding: var(--sp6); color: var(--text-dim); font-size: 13px; }

/* ---------------------------------------------------------- 桌面增强 */
@media (min-width: 760px) {
  body { font-size: 14px; }
  .topbar { padding: 0 var(--sp5); }
  .tabs { padding: 0 var(--sp5); }
}

/* 移动端把宽表格的操作列压缩 */
@media (max-width: 759px) {
  table.data th, table.data td { padding: 9px var(--sp2); font-size: 12.5px; }
  .card > header { flex-wrap: wrap; }
  .btn { min-height: 38px; }
  .btn.sm { min-height: 30px; }
}

/* ---------------------------------------------------------- 采分点编辑器（管理端） */
.gbox {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--sp3);
  background: var(--c1);
}
.gbox + .gbox { margin-top: var(--sp2); }
.gbox > header {
  display: flex;
  gap: var(--sp2);
  align-items: center;
  margin-bottom: var(--sp2);
  flex-wrap: wrap;
}
.gbox > header input { flex: 1; min-width: 120px; background: var(--c0); }

.point-row {
  display: grid;
  grid-template-columns: 62px 1fr 76px 1fr 34px;
  gap: 6px;
  margin-bottom: 6px;
  align-items: center;
}
.point-row input { background: var(--c0); }
.point-row.head {
  font-size: 11.5px;
  color: var(--text-mute);
  margin-bottom: 4px;
}
@media (max-width: 860px) {
  .point-row { grid-template-columns: 1fr; }
  .point-row.head { display: none; }
  .point-row { padding: var(--sp2); border: 1px dashed var(--c4); border-radius: var(--r-sm); }
}
