:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #111111;
  --muted: #667085;
  --border: #e4e7ec;
  --primary: #1a56db;
  --primary-dark: #14409b;
  --record: #b42318;
  --ok: #027a48;
  --err: #b42318;
  --warn: #b54708;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

.topbar {
  background: #0f172a;
  color: #fff;
  padding: 14px 20px;
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.topbar .brand { font-size: 18px; font-weight: 700; }
.topbar .tagline { font-size: 12px; color: #94a3b8; }

.container { max-width: 860px; margin: 0 auto; padding: 16px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 18px; margin-bottom: 16px; }
.section-title { margin: 0 0 12px; font-size: 16px; font-weight: 700; }

.btn {
  display: inline-block;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 11px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: #fff; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: #f2f4f7; }

.dz-hint { font-size: 12px; color: var(--muted); margin-top: 8px; }

.upload-progress { margin-top: 14px; }
.bar { height: 8px; background: #e4e7ec; border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: var(--primary); transition: width .2s; }
.bar-text { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ---------- 录音器 ---------- */
.recorder { text-align: center; padding: 8px 0; }
.rec-status { font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.rec-timer { font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 1px; margin: 4px 0 10px; }
.rec-controls { display: flex; align-items: center; justify-content: center; gap: 28px; }
.rec-main {
  width: 76px; height: 76px;
  border-radius: 50%;
  border: 2px solid var(--record);
  background: #fff;
  color: var(--record);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  padding: 0;
}
.rec-main:active { background: #fdeceb; }
.rec-main.recording { background: #fdeceb; }
.rec-stop {
  width: 52px; height: 52px;
  border-radius: 14px;
  border: 2px solid #111;
  background: #fff;
  color: #111;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  padding: 0;
}
.rec-stop:disabled { opacity: 0.3; cursor: default; }

/* ---------- 任务列表 ---------- */
.empty { color: var(--muted); text-align: center; padding: 24px 0; }
.job-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; cursor: pointer;
}
.job-item:hover { background: #fafbfc; }
.job-main { flex: 1; min-width: 0; }
.job-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-meta { font-size: 12px; color: var(--muted); }
.badge { font-size: 12px; padding: 2px 10px; border-radius: 20px; white-space: nowrap; font-weight: 600; }
.badge.queued, .badge.transcribing, .badge.extracting, .badge.generating, .badge.rendering { background: #fff4e5; color: var(--warn); }
.badge.done { background: #e7f7ef; color: var(--ok); }
.badge.error { background: #fdeceb; color: var(--err); }

/* ---------- 详情 ---------- */
.detail-head { display: flex; align-items: center; justify-content: space-between; }
.status-line { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.status-line.error { color: var(--err); }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.tab { border: none; background: none; padding: 9px 14px; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.content-box {
  background: #fafafa; border: 1px solid var(--border); border-radius: 8px; padding: 14px;
  max-height: 60vh; overflow: auto; white-space: pre-wrap; word-break: break-word; font-size: 14px; font-family: inherit; margin: 0;
}
.content-box.md { white-space: normal; }
.md h1, .md h2, .md h3 { margin: 14px 0 6px; font-size: 15px; }
.md h2 { border-left: 4px solid var(--primary); padding-left: 8px; }
.md ul { margin: 4px 0; padding-left: 20px; }
.md li { margin: 3px 0; }
.md p { margin: 6px 0; }
.md strong { font-weight: 700; }

.exam-toolbar { display: flex; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.exam-frame { width: 100%; height: 70vh; border: 1px solid var(--border); border-radius: 8px; background: #fff; }

/* ---------- 手机端 ---------- */
@media (max-width: 600px) {
  body { font-size: 15px; }
  .container { padding: 10px; }
  .card { padding: 14px; border-radius: 10px; }
  .topbar { padding: 12px 14px; }
  .btn { width: 100%; text-align: center; }
  .exam-toolbar .btn { width: 100%; }
  .content-box { max-height: 55vh; }
  .exam-frame { height: 60vh; }
}

/* 墨水屏（高对比、去动画） */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
