:root {
  --primary: #14324e;
  --primary-light: #1f4a70;
  --gold: #c9a227;
  --gold-light: #e6c55a;
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #243342;
  --muted: #7a8794;
  --border: #e3e8ef;
  --green: #1f9d55;
  --red: #d64545;
  --blue: #2b6cb0;
  --purple: #6b46c1;
  --radius: 12px;
  --shadow: 0 4px 18px rgba(20, 50, 78, 0.08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  background: linear-gradient(180deg, #eef2f7 0%, var(--bg) 100%);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
a { color: var(--primary-light); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 13px; }

/* header */
.site-header { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); color: #fff; box-shadow: 0 2px 12px rgba(20,50,78,.25); position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 17px; }
.brand:hover { text-decoration: none; }
.brand-badge { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 17px; box-shadow: 0 2px 8px rgba(201,162,39,.4); }
.site-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.site-nav a { color: #dce7f3; padding: 6px 10px; border-radius: 8px; font-size: 14px; }
.site-nav a:hover { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.site-nav .nav-user { color: var(--gold-light); font-size: 14px; padding: 0 8px; }
.nav-toggle { display: none; background: none; border: 0; color: #fff; font-size: 24px; cursor: pointer; padding: 0 6px; }

/* footer */
.site-footer { margin-top: auto; background: var(--primary); color: #b8c7d8; text-align: center; padding: 18px 0; font-size: 13px; }

/* page */
.page-body { padding-top: 28px; padding-bottom: 40px; }
.page-title { font-size: 24px; margin-bottom: 20px; color: var(--primary); }
.section-title { font-size: 18px; margin: 28px 0 14px; color: var(--primary); }

/* 旧 tab（已被 .exam-seg 取代，保留兼容旧 HTML 不报错）*/
.exam-type-tabs,
.exam-type-tab,
.exam-type-hint { display: none; }

/* ========= 考试大厅（保留视觉层次，去游戏化元素） ========= */
.home-hero {
  position: relative;
  margin: 0 0 24px;
  padding: 26px 28px 22px;
  border-radius: 14px;
  background:
    radial-gradient(700px 200px at 0% 0%, rgba(201,162,39,.08) 0%, rgba(201,162,39,0) 60%),
    radial-gradient(600px 180px at 100% 0%, rgba(20,50,78,.06) 0%, rgba(20,50,78,0) 60%),
    linear-gradient(135deg, #ffffff 0%, #f6f9fc 100%);
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(20,50,78,.04);
  overflow: hidden;
}
.home-hero-head { margin-bottom: 16px; }
.home-hero .page-title { margin-bottom: 4px; }
.home-hero-sub {
  font-size: 13px; color: var(--muted); letter-spacing: .3px;
}

/* ----- 分段选择器（含平滑滑块，幅度更克制）----- */
.exam-seg {
  position: relative;
  display: inline-flex;
  background: #eef2f7;
  border: 1px solid #dde3eb;
  border-radius: 999px;
  padding: 4px;
  box-shadow: inset 0 1px 2px rgba(20,50,78,.05);
  max-width: 100%;
}
.exam-seg-thumb {
  position: absolute;
  top: 4px; bottom: 4px; left: 0;
  width: 0; /* JS 设置 */
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 999px;
  box-shadow:
    0 2px 8px rgba(20,50,78,.30),
    0 1px 0 rgba(255,255,255,.10) inset;
  transition: transform .28s cubic-bezier(.4,.6,.2,1), width .28s cubic-bezier(.4,.6,.2,1);
  z-index: 0;
  will-change: transform, width;
}
.exam-seg-btn {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 20px;
  font-size: 13.5px; font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-radius: 999px;
  white-space: nowrap;
  transition: color .2s;
}
.exam-seg-btn:hover { color: var(--primary); }
.exam-seg-btn.active { color: #fff; }
.exam-seg-icon { display: inline-flex; }

/* ----- 卡片：进阶课程用左侧色条 + 顶角小徽章（不用丝带）----- */
.exam-card { position: relative; transition: transform .18s, box-shadow .18s, border-color .18s; }
.exam-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(20,50,78,.10);
}
.exam-card-advanced {
  border-color: rgba(20,50,78,.25);
  background:
    linear-gradient(135deg, rgba(20,50,78,.03) 0%, rgba(255,255,255,0) 50%),
    var(--card);
}
.exam-card-advanced::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--gold) 100%);
  border-radius: 3px 0 0 3px;
}
.exam-card-badge {
  position: absolute; top: 12px; right: 12px;
  font-size: 11px; font-weight: 600; letter-spacing: 1px;
  color: #fff;
  background: var(--primary);
  padding: 3px 9px;
  border-radius: 4px;
}

/* cards */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card.narrow { max-width: 640px; margin: 0 auto 24px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.exam-card h3 { color: var(--primary); margin-bottom: 10px; font-size: 17px; }
.exam-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.exam-meta { list-style: none; margin: 0 0 16px; }
.exam-meta li { padding: 4px 0; color: var(--muted); font-size: 14px; }
.exam-meta b { color: var(--text); }

/* buttons */
.btn { display: inline-block; border: 0; cursor: pointer; border-radius: 10px; padding: 10px 18px; font-size: 15px; font-weight: 600; transition: all .15s ease; text-align: center; }
.btn-primary { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); color: #fff; box-shadow: 0 3px 10px rgba(20,50,78,.25); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(20,50,78,.35); text-decoration: none; }
.btn-danger { background: linear-gradient(135deg, #e0504b, #cf3c37); color: #fff; box-shadow: 0 4px 14px rgba(208,69,69,.3); }
.btn-danger:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(208,69,69,.4); text-decoration: none; }
.btn-secondary { background: #eef1f5; color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: #e4e9ef; text-decoration: none; }
.btn-submit { background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%); color: var(--primary); }
.btn-block {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  text-align: center;
}
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* forms */
.form .form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 15px; font-family: inherit; background: #fff; }
.input:focus { outline: none; border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(31,74,112,.12); }
textarea.input { resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { display: flex; gap: 10px; margin-top: 20px; }

/* alerts / pills / tags */
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }
.alert-error { background: #fdecec; color: #b02a2a; border: 1px solid #f5c2c2; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
/* nowrap 关键：CJK 字符（单/多选、判断题）在 inline-block 里默认每字换行 */
.pill-green { background: #e2f6ea; color: var(--green); }
.pill-red { background: #fde9e9; color: var(--red); }
.pill-blue { background: #e7effa; color: var(--blue); }
.pill-gray { background: #eef0f2; color: #66737f; }
.pill-gold { background: #f8efd4; color: #8a6d14; }
.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.tag-gold { background: #f8efd4; color: #8a6d14; }

/* auth（员工登录/注册 · 全屏现代版） */
.auth-page {
  background: radial-gradient(1200px 600px at 20% -10%, #1e4a76 0%, #10243f 55%, #0b1c33 100%);
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
}
.auth-wrap { max-width: 420px; margin: 40px auto; }
.auth-card {
  width: 100%; max-width: 400px; background: #fff; border-radius: 20px;
  box-shadow: 0 24px 80px rgba(6,20,40,.5); padding: 40px 36px;
}
.auth-logo { text-align: center; margin-bottom: 26px; }
.auth-badge {
  width: 62px; height: 62px; margin: 0 auto 14px; border-radius: 18px;
  background: linear-gradient(135deg, var(--gold), #e8cf6b); color: var(--primary);
  font-size: 30px; font-weight: 800; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(201,162,39,.4);
}
.auth-logo h1 { font-size: 20px; color: var(--primary); }
.auth-logo p { color: var(--muted); font-size: 13px; margin-top: 6px; }
.auth-alt { text-align: center; margin-top: 18px; font-size: 14px; color: var(--muted); }

/* tables */
.table-wrap { overflow-x: auto; background: var(--card); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; min-width: 560px; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
.table th { background: #f7f9fb; color: var(--muted); font-weight: 600; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #fafbfd; }
.cell-text { max-width: 360px; }
.cell-actions { white-space: nowrap; }
.cell-actions .inline-form { display: inline-block; margin-right: 4px; }
.link { color: var(--primary-light); font-size: 13px; }
.link-btn { background: none; border: 0; color: var(--primary-light); cursor: pointer; font-size: 13px; padding: 0 2px; font-family: inherit; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--red); }

/* toolbar / pagination / empty */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.batch-bar { margin-bottom: 12px; gap: 10px; }
.batch-select-all { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.danger-text { color: var(--red); }
.inline-form { display: inline-flex; gap: 8px; align-items: center; }
.inline-form select.input, .inline-form input.input { width: auto; }
.pagination { display: flex; gap: 6px; margin-top: 18px; flex-wrap: wrap; }
.page-link { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border); background: #fff; font-size: 14px; }
.page-link.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.empty-state { text-align: center; color: var(--muted); padding: 60px 0; }

/* 自定义确认弹窗 */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(10, 26, 44, .55);
  display: flex; align-items: center; justify-content: center;
  z-index: 400; padding: 20px;
  opacity: 0; transition: opacity .2s ease;
}
.modal-overlay.open { opacity: 1; }
.modal {
  background: #fff; border-radius: 18px; width: 100%; max-width: 380px;
  padding: 30px 26px 22px; text-align: center;
  box-shadow: 0 24px 80px rgba(6,20,40,.4);
  transform: scale(.94) translateY(10px);
  transition: transform .22s ease;
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal-icon {
  width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 800;
}
.modal-warn .modal-icon { background: #fdf0d5; color: #b8860b; }
.modal-danger .modal-icon { background: #fdecec; color: #cf3c37; }
.modal-success .modal-icon { background: #e2f6ea; color: #1f9d55; }
.modal h3 { font-size: 18px; color: var(--text); margin-bottom: 8px; }
.modal p { font-size: 14px; color: var(--muted); line-height: 1.6; margin-bottom: 22px; word-break: break-word; }
.modal-actions { display: flex; gap: 12px; }
.modal-actions .btn { flex: 1; }

/* toast 轻提示 */
.toast {
  position: fixed; top: 24px; left: 50%;
  transform: translateX(-50%) translateY(-14px);
  background: linear-gradient(135deg, #16324f, #0d2440);
  color: #fff; padding: 12px 22px; border-radius: 14px;
  font-size: 14px; font-weight: 500; letter-spacing: .3px;
  box-shadow: 0 12px 32px rgba(10, 30, 55, .35);
  display: flex; align-items: center; gap: 10px;
  z-index: 300; opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  max-width: calc(100vw - 40px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast .toast-ico {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.toast-warn .toast-ico { background: linear-gradient(135deg, #c9a227, #e6c55a); color: #3c2f08; }
.toast-success .toast-ico { background: linear-gradient(135deg, #1f9d55, #48bb78); color: #fff; }

/* notice */
.notice { background: #f0f7ff; border: 1px solid #cfe3fb; color: #20577a; border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; font-size: 14px; }

/* stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { border-radius: var(--radius); padding: 20px; color: #fff; box-shadow: var(--shadow); }
.stat-card.blue { background: linear-gradient(135deg, #2b6cb0, #4299e1); }
.stat-card.green { background: linear-gradient(135deg, #1f9d55, #48bb78); }
.stat-card.gold { background: linear-gradient(135deg, #b8860b, #e6c55a); }
.stat-card.purple { background: linear-gradient(135deg, #6b46c1, #9f7aea); }
.stat-num { font-size: 30px; font-weight: 800; }
.stat-label { font-size: 14px; opacity: .9; }
.stat-sub { font-size: 12px; opacity: .75; margin-top: 4px; }
.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

/* exam page */
.exam-page { max-width: 1100px; margin: 0 auto; }
.exam-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.exam-header h1 { font-size: 20px; color: var(--primary); }
.exam-header-right { display: inline-flex; align-items: center; gap: 10px; }
.exam-timer { background: var(--primary); color: #fff; padding: 8px 16px; border-radius: 999px; font-size: 18px; font-weight: 700; letter-spacing: 1px; display: inline-flex; align-items: center; gap: 8px; }
.btn-pause {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 20px;
  background: #fff; color: var(--primary);
  border: 1px solid var(--border); border-radius: 10px;
  font-size: 15px; font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  font-family: inherit;
}
.btn-pause svg { width: 15px; height: 15px; }
.btn-pause:hover { background: #f6f8fa; border-color: var(--primary-light); color: var(--primary-light); }
.btn-pause-mobile { width: 100%; justify-content: center; border-radius: 10px; }

/* 暂停弹层 */
.pause-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.pause-modal[hidden] { display: none; }
.pause-modal-mask { position: absolute; inset: 0; background: rgba(15, 35, 60, .45); }
.pause-modal-card {
  position: relative;
  width: min(420px, calc(100% - 32px));
  background: #fff; border-radius: 12px;
  padding: 28px 28px 22px;
  box-shadow: 0 24px 80px rgba(0,0,0,.25);
}
.pause-modal-title { font-size: 17px; font-weight: 700; color: var(--primary); margin-bottom: 12px; }
.pause-modal-desc { font-size: 14px; color: #4a5a6c; line-height: 1.7; margin-bottom: 22px; }
.pause-modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* 考试大厅草稿提示 */
.home-flash {
  background: #fff7df; border: 1px solid #f0d77a; color: #6f4f0a;
  border-radius: 8px; padding: 11px 16px;
  font-size: 13px;
  margin-bottom: 18px;
}

/* 橙色按钮 —— 用于「继续作答」（草稿状态） */
.btn-orange {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px;
  background: linear-gradient(135deg, #f29423 0%, #e87412 100%);
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  border: 0;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(242,148,35,.30);
  transition: transform .15s, box-shadow .15s;
  text-decoration: none;
  font-weight: 600;
}
.btn-orange.btn-block { display: flex; }
.btn-orange:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(242,148,35,.40);
  color: #fff; text-decoration: none;
}
.btn-orange:active { transform: translateY(0); }

/* 草稿提示行（方块内）—— 字体与 .btn（开始考试）一致：15px / 600 */
.exam-draft-hint {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 4px 8px;
  padding: 8px 12px;
  margin: 4px 0 12px;
  background: #fff7e8;
  border: 1px solid #f3d29b;
  border-radius: 7px;
  font-size: 15px;
  font-weight: 600;
  color: #8a5a16;
  line-height: 1.5;
}
.exam-draft-paused { color: #8a5a16; }
.exam-draft-sep { color: #d4a866; }
.exam-draft-remaining b {
  color: #c97a0c;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  margin: 0 1px;
}
.exam-draft-icon { display: inline-flex; color: #c97a0c; margin-right: 2px; }

.exam-draft-discard { margin-top: 4px; text-align: center; }
.btn-link-muted {
  background: none; border: 0; padding: 4px 10px;
  color: #98a3b3;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.btn-link-muted:hover { color: #6b7888; text-decoration: underline; }

/* 旧草稿区样式保留以防万一（已被方块取代） */
.btn-ghost-danger {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 14px;
  font-size: 13px; font-weight: 500;
  color: #6b7888;
  background: #fff;
  border: 1px solid #d6dfeb;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, border-color .15s, color .15s;
}
.btn-ghost-danger:hover {
  background: #f6f8fa;
  border-color: #b8c4d3;
  color: #4a5a6c;
}
.btn-ghost-danger:active { background: #eef2f7; }
.btn-ghost-danger:focus-visible {
  outline: 2px solid rgba(20,50,78,.20);
  outline-offset: 2px;
}
.btn-ghost-danger svg { display: block; }
.exam-layout { display: grid; grid-template-columns: 1fr 220px; gap: 20px; align-items: start; }
.exam-main { min-width: 0; }
.question-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 16px; }
.question-card.active { display: block; }
.question-card:not(.active) { display: none; }
.q-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.q-num { background: var(--primary); color: #fff; width: 26px; height: 26px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.q-type { background: #eef1f5; color: var(--muted); padding: 2px 10px; border-radius: 999px; font-size: 12px; }
.q-tip { display: inline-block; margin-bottom: 8px; padding: 4px 10px; background: #fff7e6; color: #8a6d14; border-radius: 6px; font-size: 12px; font-weight: 600; }
.q-text { font-size: 16px; margin-bottom: 16px; white-space: pre-wrap; }
.q-options { display: flex; flex-direction: column; gap: 10px; }
.option { display: flex; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; transition: all .12s ease; align-items: flex-start; }
.option:hover { border-color: var(--primary-light); background: #f7fafc; }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option:has(input:checked) { border-color: var(--primary-light); background: #eef4fa; }
.option-mark { flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
/* 多选题把圆形标记换成方形，和单选/判断区分 */
.option:has(input[type=checkbox]) .option-mark { border-radius: 4px; }
.option-text { white-space: pre-wrap; font-size: 15px; }
.option.is-answer { border-color: var(--green); background: #e9f8ef; }
.option.is-answer .option-mark { background: var(--green); }
.option.is-chosen { border-color: var(--red); background: #fdeeee; }
.option.is-chosen .option-mark { background: var(--red); }
.option-static { display: flex; gap: 12px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; align-items: flex-start; }
.option-static.is-answer { border-color: var(--green); background: #e9f8ef; }
.option-static.is-answer .option-mark { background: var(--green); }
.option-static.is-chosen { border-color: var(--red); background: #fdeeee; }
.option-static.is-chosen .option-mark { background: var(--red); }
.analysis { margin-top: 12px; background: #f0f7ff; border: 1px solid #cfe3fb; border-radius: 10px; padding: 12px 14px; font-size: 14px; color: #20577a; white-space: pre-wrap; }
.exam-nav-buttons { display: flex; justify-content: center; gap: 16px; margin: 30px 0 12px; }
.exam-nav-buttons .btn { min-width: 120px; }

/* answer sheet */
.exam-side { position: sticky; top: 76px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.exam-side h3 { font-size: 15px; color: var(--primary); margin-bottom: 12px; }
.answer-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 12px; }
.answer-cell { border: 1px solid var(--border); background: #fff; border-radius: 8px; padding: 8px 0; font-size: 14px; cursor: pointer; text-align: center; }
.answer-cell.current { background: var(--primary); color: #fff; border-color: var(--primary); }
.answer-cell.answered { background: var(--gold-light); color: var(--primary); border-color: var(--gold); font-weight: 700; }
.answer-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.cell-dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; border: 1px solid var(--border); }
.cell-dot.answered { background: var(--gold-light); border-color: var(--gold); }
.cell-dot.current { background: var(--primary); border-color: var(--primary); }
.sheet-handle { display: none; width: 44px; height: 5px; border-radius: 999px; background: var(--border); margin: 0 auto 12px; }
.mobile-actions { display: none; gap: 10px; position: sticky; bottom: 0; background: rgba(255,255,255,.96); padding: 12px 0 16px; z-index: 80; }
.mobile-actions .btn { flex: 1; }
.sheet-overlay { display: none; }
.mobile-submit { display: none; width: 100%; margin-top: 14px; }

/* result */
.result-card { border-radius: 16px; padding: 32px; text-align: center; color: #fff; margin-bottom: 24px; }
.result-card.passed { background: linear-gradient(135deg, #1f9d55, #48bb78); }
.result-card.failed { background: linear-gradient(135deg, #d64545, #ee7777); }
.result-score { font-size: 64px; font-weight: 800; line-height: 1; }
.result-score small { font-size: 22px; font-weight: 600; }
.result-meta { margin-top: 12px; }
.result-meta h2 { font-size: 20px; }
.result-meta p { opacity: .92; margin-top: 4px; }
.result-card .pill { background: rgba(255,255,255,.9); }
.actions { display: flex; gap: 10px; }

/* practice */
.practice-box { max-width: 720px; margin: 0 auto; }
.practice-topbar { display: flex; justify-content: space-between; margin-bottom: 12px; color: var(--muted); font-size: 14px; }
.practice-feedback { margin-top: 16px; background: var(--card); border-radius: 12px; border: 1px solid var(--border); padding: 16px; }
.fb-title { font-weight: 700; font-size: 16px; }
.fb-ok { color: var(--green); }
.fb-no { color: var(--red); }
.fb-analysis { margin-top: 8px; color: var(--text); font-size: 14px; white-space: pre-wrap; }
.practice-actions { display: flex; gap: 10px; margin-top: 16px; }

/* admin layout */
.admin-body { background: #eef1f5; }
.admin-header { position: static; }
.admin-layout { display: grid; grid-template-columns: 200px 1fr; gap: 20px; padding-top: 24px; padding-bottom: 40px; }
.admin-nav { display: flex; flex-direction: column; gap: 4px; }
.admin-nav a { padding: 11px 16px; border-radius: 10px; color: var(--text); font-size: 15px; font-weight: 600; }
.admin-nav a:hover { background: #e4e9ef; text-decoration: none; }
.admin-nav a.active { background: var(--primary); color: #fff; box-shadow: 0 3px 10px rgba(20,50,78,.25); }
.admin-main { min-width: 0; }

/* responsive */
@media (max-width: 900px) {
  .exam-layout { grid-template-columns: 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
}

/* 桌面端：答题卡侧栏始终可见，不需要关闭按钮 */
.sheet-close { display: none; }
.sheet-head { display: flex; align-items: center; gap: 8px; }
.sheet-head h3 { margin: 0; }

@media (max-width: 640px) {
  /* ====== 基础栅格 ====== */
  .container { padding: 0 12px; }
  .topbar { padding: 0 12px; }
  .topbar-inner { height: 56px; }
  .page { padding: 16px 0 24px; }

  /* ====== 导航：抽屉化 ====== */
  .nav-toggle { display: flex; }
  .site-nav {
    display: none;
    position: fixed; top: 56px; left: 0; right: 0;
    background: var(--primary-light);
    flex-direction: column;
    align-items: stretch;
    padding: 8px 12px 12px;
    z-index: 60;
    box-shadow: 0 4px 12px rgba(0,0,0,.10);
    max-height: calc(100vh - 56px); overflow-y: auto;
  }
  .site-nav.open { display: flex; }
  .site-nav .nav-link {
    padding: 12px 12px;
    border-bottom: 1px solid rgba(255,255,255,.10);
    font-size: 15px;
  }
  .site-nav .nav-link:last-of-type { border-bottom: 0; }
  .site-nav .nav-user {
    padding: 10px 12px 0;
    border-top: 1px solid rgba(255,255,255,.15);
    margin-top: 6px;
    font-size: 13px;
  }

  /* ====== 表单 ====== */
  .form-row { grid-template-columns: 1fr; gap: 12px; }
  .form-row label { font-size: 13px; }
  .input, .form-row input, .form-row select, .form-row textarea {
    width: 100%; font-size: 15px; padding: 10px 12px;
    border-radius: 8px;
  }
  .toolbar { flex-direction: column; align-items: stretch; gap: 8px; }
  .inline-form { width: 100%; }
  .inline-form .input { flex: 1; }

  /* ====== 卡片网格 ====== */
  .card-grid { grid-template-columns: 1fr; gap: 12px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .card { padding: 16px; border-radius: 10px; }
  .card .card-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .card .card-head .actions { width: 100%; }

  /* ====== 首页 Hero ====== */
  .home-hero { padding: 18px 16px 16px; border-radius: 12px; margin-bottom: 16px; }
  .home-hero .page-title { font-size: 20px; margin-bottom: 4px; }
  .home-hero-sub { font-size: 12px; }
  .home-hero-head { margin-bottom: 14px; }

  /* ====== 分段选择器 ====== */
  .exam-seg { padding: 3px; width: 100%; }
  .exam-seg-btn { padding: 7px 14px; font-size: 13px; flex: 1 1 0; justify-content: center; }
  .exam-seg-icon { display: none; }   /* 窄屏省空间 */

  /* ====== 草稿方块（移动端微调） ====== */
  .exam-draft-hint { padding: 8px 12px; }

  /* ====== 考试作答页 ====== */
  .exam-page { padding: 0 12px 24px; }
  .exam-header {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    flex-wrap: nowrap;
  }
  .exam-header h1 { font-size: 15px; line-height: 1.35; flex: 1; min-width: 0; word-break: break-word; }
  .exam-header-right { flex-shrink: 0; gap: 6px; }
  .exam-timer { padding: 6px 10px; font-size: 13px; gap: 4px; }
  .exam-timer .timer-icon { font-size: 14px; }
  .btn-pause { padding: 10px 18px; font-size: 14px; gap: 6px; }
  .btn-pause-mobile { display: none; }  /* 顶部已经有，不重复 */

  /* 题目卡片 */
  .question-card { padding: 16px; border-radius: 10px; margin-bottom: 12px; }
  .q-num { width: 24px; height: 24px; font-size: 13px; border-radius: 6px; }
  .q-type { font-size: 11px; padding: 2px 8px; }
  .q-tip { font-size: 11px; padding: 3px 8px; margin-bottom: 8px; }
  .q-text { font-size: 15px; line-height: 1.55; margin-bottom: 14px; }
  .q-options { gap: 8px; }
  /* 选项触控区域 ≥44px（Apple HIG） */
  .option { padding: 12px 12px; min-height: 48px; gap: 10px; border-radius: 8px; }
  .option-mark { width: 22px; height: 22px; font-size: 12px; }
  .option-text { font-size: 14px; line-height: 1.5; }

  /* 抽屉：抽开后高度更克制，且不挡 mobile-actions */
  .exam-side {
    display: block;
    position: fixed;
    left: 0; right: 0;
    bottom: 0; top: auto;
    max-height: 58vh;
    overflow-y: auto;
    border-radius: 16px 16px 0 0;
    transform: translateY(105%);
    transition: transform .28s cubic-bezier(.4,.6,.2,1);
    z-index: 92;
    padding: 12px 16px 80px;       /* 底部留空间给 mobile-actions */
    box-shadow: 0 -8px 30px rgba(0,0,0,.16);
  }
  .exam-side.open { transform: translateY(0); }
  .sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
  .sheet-head h3 { margin: 0; }
  .sheet-close {
    background: none; border: 0; padding: 4px;
    color: var(--muted); cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 6px;
    transition: background .15s, color .15s;
  }
  .sheet-close:hover { background: var(--bg-soft); color: var(--primary); }
  .sheet-handle { display: block; margin: -4px auto 8px; }
  .exam-side h3 { font-size: 14px; margin-bottom: 10px; }
  .answer-grid { gap: 6px; margin-bottom: 10px; }
  .answer-cell { padding: 9px 0; font-size: 13px; border-radius: 6px; }
  .answer-legend { font-size: 11px; margin-bottom: 10px; gap: 10px; }
  /* 抽屉里的交卷按钮突出 */
  .exam-side #submitBtn { padding: 12px; font-size: 15px; }
  .exam-nav-buttons { display: none; }

  /* 底部固定栏：抽屉打开时让位 */
  .mobile-actions {
    display: flex;
    position: fixed;
    left: 0; right: 0;
    bottom: 0;
    gap: 8px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    background: rgba(255,255,255,.96);
    backdrop-filter: saturate(140%) blur(8px);
    box-shadow: 0 -4px 14px rgba(15,42,71,.08);
    align-items: stretch;
    z-index: 88;       /* 抽屉 z=92，所以抽屉打开时盖在上面 */
    transition: transform .25s ease, opacity .25s ease;
  }
  /* 抽屉打开 → bottom bar 隐藏，让抽屉内的交卷按钮接管 */
  body.sheet-open .mobile-actions { transform: translateY(120%); opacity: 0; pointer-events: none; }
  .mobile-actions .btn {
    flex: 1 1 0; min-width: 0;
    padding: 11px 6px;
    font-size: 13.5px;
    white-space: nowrap;
    border-radius: 8px;
  }
  .mobile-actions #mobilePrevBtn { flex-grow: 1.1; }
  .mobile-actions #mobileNextBtn { flex-grow: 1.4; }
  .mobile-actions .sheet-btn { flex-grow: 0.9; }
  /* 移动端不再额外显示交卷（抽屉里已有），避免重复 */
  .mobile-actions #mobileSubmitBtn { display: none; }
  .sheet-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(15,42,71,.45);
    z-index: 89;
  }
  .sheet-overlay.open { display: block; }
  .mobile-submit { display: none; }

  /* 暂停弹层 */
  .pause-modal-card { width: calc(100% - 24px); padding: 22px 20px; border-radius: 14px; }
  .pause-modal-title { font-size: 17px; }
  .pause-modal-desc { font-size: 14px; line-height: 1.6; }
  .pause-modal-actions { flex-direction: column-reverse; gap: 10px; }
  .pause-modal-actions .btn { width: 100%; padding: 12px; }

  /* ====== 表格 → 卡片 ====== */
  .table-wrap { border: 0; background: transparent; }
  .table { display: block; min-width: 0 !important; }
  .table thead { display: none; }
  .table tbody { display: block; }
  .table tr {
    display: block;
    padding: 12px 14px;
    margin-bottom: 10px;
    background: #fff;
    border: 1px solid var(--border, #e0e6ee);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(20,50,78,.04);
  }
  .table td {
    display: flex;
    padding: 5px 0;
    border: 0;
    align-items: baseline;
    gap: 8px;
    font-size: 13px;
    line-height: 1.5;
  }
  .table td::before {
    content: attr(data-label);
    flex: 0 0 70px;
    font-size: 12px;
    color: var(--muted, #6b7888);
    font-weight: 500;
  }
  .table td.cell-actions {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 10px;
    margin-top: 8px;
    border-top: 1px solid var(--border, #e0e6ee);
  }
  .table td.cell-actions::before { display: none; }
  .table td.cell-actions .link,
  .table td.cell-actions .link-btn {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border, #e0e6ee);
    background: #f8fafc;
    font-size: 12.5px;
  }
  .table td.cell-actions .link-btn.danger { color: var(--red); border-color: #f5cccc; background: #fdf3f3; }
  .table td.cell-text { font-size: 14px; }
  .table td[colspan] { text-align: center !important; padding: 30px 16px !important; }
  .table td[colspan]::before { display: none; }

  /* ====== 浮层/卡片内的列表也堆叠 ====== */
  .row-2col { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  /* 小屏 SE (375) 的微调 */
  .exam-header h1 { font-size: 14px; }
  .exam-timer { padding: 5px 8px; font-size: 12px; }
  .btn-pause { padding: 10px 16px; font-size: 14px; gap: 6px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .mobile-actions .btn { font-size: 12.5px; padding: 10px 4px; }
  .answer-cell { padding: 8px 0; font-size: 12.5px; }
  .answer-grid { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 560px) {
  .hide-sm { display: none !important; }
}
