/* ===== 基础 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-light: #eff6ff;
  --green: #16a34a;
  --green-light: #f0fdf4;
  --red: #dc2626;
  --red-light: #fef2f2;
  --orange: #ea580c;
  --text: #1f2937;
  --text-sub: #6b7280;
  --border: #e5e7eb;
  --bg: #f3f4f6;
  --card: #ffffff;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 14px rgba(0,0,0,.05);
}
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== 顶栏 ===== */
.topbar {
  background: linear-gradient(135deg, #1e40af, #2563eb);
  color: #fff;
  box-shadow: var(--shadow);
}
.topbar-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  /* 有 logo 之后改成 center:baseline 会让图标吊在文字基线上,视觉上偏高一截 */
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.brand {
  color: #fff; text-decoration: none; font-size: 20px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 9px;
}
/* logo 自带蓝色圆角底,压在同色系的顶栏上会糊掉,所以描一圈半透明白边把它拎出来 */
.brand-logo {
  width: 30px; height: 30px; flex: none; border-radius: 8px;
  box-shadow: 0 0 0 1.5px rgba(255,255,255,.5);
}
.brand-sub { font-size: 13px; opacity: .85; }
.brand-nav {
  color: #fff; text-decoration: none; font-size: 14px; opacity: .82;
  padding: 4px 12px; border-radius: 999px; transition: background .15s, opacity .15s;
}
.brand-nav:hover { opacity: 1; background: rgba(255,255,255,.14); }
.brand-nav.active { opacity: 1; background: rgba(255,255,255,.2); font-weight: 600; }

/* 栏目多了之后顶栏放不下。让位顺序是有讲究的:
   先砍副标题(它只是说明,不是入口),再让栏目自己换行 ——
   栏目是导航,任何情况下都不能被挤没或挤到看不见。 */
@media (max-width: 900px) {
  .brand-sub { display: none; }
}
@media (max-width: 620px) {
  .topbar-inner { padding: 12px 14px; gap: 8px; row-gap: 6px; }
  /* 窄屏上 flex:1 的占位符会把导航整体推到第二行,反而更整齐 */
  .brand-nav { font-size: 13.5px; padding: 4px 10px; }
}

.container { max-width: 960px; width: 100%; margin: 0 auto; padding: 24px 16px 40px; flex: 1; }

.footer { text-align: center; padding: 18px 16px 26px; color: var(--text-sub); font-size: 12px; }
.footer .beian { margin-top: 6px; }
.footer a { color: var(--text-sub); text-decoration: none; }
.footer a:hover { color: var(--blue); text-decoration: underline; }
.footer .ft-links { margin-top: 10px; }
/* 条款链接比免责声明重一点:它们是要被点的,而上面那句是读的 */
.footer .ft-links a { color: var(--text); }
.footer .ft-org { margin-top: 6px; }
/* 窄屏上「公司电话 · 公司地址」会折行,折了之后行首挂一个居中的「·」很难看,
   所以分隔符在窄屏直接隐藏,靠换行本身分隔。 */
@media (max-width: 560px) {
  .footer .ft-sep { display: none; }
  .footer .ft-org, .footer .beian { line-height: 1.9; }
}

/* ===== 条款类页面(关于我们 / 隐私政策 / 服务条款 / 用户协议)===== */
.doc { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 30px; }
.doc h1 { font-size: 24px; margin-bottom: 6px; }
.doc .doc-meta { color: var(--text-sub); font-size: 13px; margin-bottom: 20px; }
.doc h2 { font-size: 17px; margin: 24px 0 8px; padding-left: 10px; border-left: 3px solid var(--blue); }
.doc p { margin-bottom: 10px; font-size: 15px; }
.doc ul { margin: 0 0 12px 22px; }
.doc li { margin-bottom: 6px; font-size: 15px; }
.doc dl { margin-bottom: 12px; }
.doc dt { font-weight: 600; margin-top: 10px; }
.doc dd { margin-left: 0; color: var(--text-sub); font-size: 14.5px; }
.doc .doc-note { background: var(--blue-light); border-radius: 8px; padding: 12px 14px; font-size: 14px; color: #1e40af; margin: 16px 0; }
.doc table { width: 100%; border-collapse: collapse; margin-bottom: 14px; font-size: 14.5px; }
.doc th, .doc td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; }
.doc th { background: var(--bg); font-weight: 600; }
/* 带序号圆点的操作步骤(考试预约页用)。
   自己画序号而不是用 <ol> 默认的数字:默认样式的序号跟正文一样大、贴着文字,
   一屏六步扫下来分不清哪行是新的一步。 */
.doc-steps { list-style: none; margin: 0 0 14px; counter-reset: docstep; }
.doc-steps li {
  position: relative; counter-increment: docstep;
  padding-left: 38px; margin-bottom: 14px; font-size: 15px; line-height: 1.85;
}
.doc-steps li::before {
  content: counter(docstep);
  position: absolute; left: 0; top: 3px;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--blue); color: #fff;
  font-size: 13px; font-weight: 700; line-height: 24px; text-align: center;
}
/* 竖线把相邻步骤连起来,视觉上成为一条流程。最后一步不画。 */
.doc-steps li::after {
  content: ""; position: absolute; left: 11.5px; top: 30px; bottom: -12px;
  width: 1px; background: var(--border);
}
.doc-steps li:last-child { margin-bottom: 0; }
.doc-steps li:last-child::after { display: none; }

/* 三级标题。比 h2 轻一档:h2 带蓝色竖条是章,h3 只是章内的小节,
   再加竖条会让层级看不出来。 */
.doc .doc-h3 {
  font-size: 15px; font-weight: 700; color: var(--text);
  margin: 18px 0 8px;
}

/* 文档页里的插图 */
.doc-fig { margin: 4px 0 18px; }
.doc-fig img {
  width: 100%; height: auto; display: block;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
}
.doc-fig figcaption {
  color: var(--text-sub); font-size: 12.5px; line-height: 1.7; margin-top: 8px; text-align: center;
}

@media (max-width: 700px) {
  .doc { padding: 20px 16px; }
  /* 表格与流程图在手机上横向滚,不要把整页撑宽。
     流程图是四屏并排的,缩到 375px 宽会小到看不清按钮名,所以给它一个最小宽度让它横滚。 */
  .doc table { display: block; overflow-x: auto; white-space: nowrap; }
  .doc-fig { overflow-x: auto; }
  .doc-fig img { min-width: 560px; }
}

/* ===== 首页 ===== */
.home-intro { text-align: center; margin-bottom: 22px; }
.home-intro h2 { font-size: 24px; margin-bottom: 6px; }
.home-intro p { color: var(--text-sub); font-size: 14px; }

.home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.subject-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.subject-card h3 { font-size: 20px; display: flex; align-items: center; gap: 8px; }
.subject-card .sub-desc { color: var(--text-sub); font-size: 13px; margin: 4px 0 14px; }
.sub-stats { display: flex; gap: 16px; margin-bottom: 16px; font-size: 13px; color: var(--text-sub); flex-wrap: wrap; }
.sub-stats b { color: var(--text); font-size: 16px; }

.mode-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: 10px; cursor: pointer;
  font-size: 15px; padding: 11px 16px; font-family: inherit;
  transition: transform .06s, box-shadow .15s, background .15s;
  text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: #15803d; }
.btn-outline { background: var(--card); color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }
.btn-danger-outline { background: var(--card); color: var(--red); border: 1px solid #fecaca; }
.btn-danger-outline:hover { background: var(--red-light); }
.btn-lg { font-size: 16px; padding: 13px 26px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.exam-rule { background: var(--blue-light); border-radius: 8px; padding: 10px 12px; font-size: 12.5px; color: #1e40af; margin-top: 14px; }

/* ===== 答题页 ===== */
.quiz-head {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 18px; margin-bottom: 16px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.quiz-head .qh-title { font-weight: 700; font-size: 16px; }
.quiz-head .qh-mode { font-size: 12px; background: var(--blue-light); color: var(--blue); padding: 2px 10px; border-radius: 999px; }
.qh-spacer { flex: 1; }
.qh-progress { font-size: 14px; color: var(--text-sub); }
.qh-progress b { color: var(--blue); font-size: 17px; }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 18px; color: var(--green); }
.timer.warn { color: var(--red); animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: .45; } }

.q-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px; margin-bottom: 16px;
}
.q-type-badge {
  display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 999px;
  margin-right: 8px; vertical-align: 3px; white-space: nowrap;
}
.q-type-judge { background: #fef3c7; color: #92400e; }
.q-type-single { background: var(--blue-light); color: var(--blue); }
.q-type-multi { background: #fce7f3; color: #be185d; }
.q-text { font-size: 17px; font-weight: 600; display: inline; }

.q-img-wrap { margin-top: 14px; text-align: center; }
.q-img {
  max-width: min(100%, 500px); max-height: 320px;
  border-radius: 8px; border: 1px solid var(--border); background: #fff;
}
/* 动画题(mp4)。与 .q-img 共用尺寸约束,只补 <video> 特有的:
   display:block + margin auto —— video 是 inline 元素,父级的 text-align:center
   对它有效,但配合 max-width 后仍会在某些浏览器里贴左;
   背景给深色,视频加载出画面前不会闪一块白。 */
.q-video { display: block; margin: 0 auto; background: #1a1d21; }

/* 题干下方:选项在左、配图在右(窄屏时图在上) */
.q-body { display: flex; flex-direction: row-reverse; gap: 18px; align-items: flex-start; margin-top: 14px; }
.q-body .opts { flex: 1; margin-top: 0; }
.q-body .q-img-wrap { flex: none; max-width: 340px; margin-top: 0; }
@media (max-width: 700px) {
  .q-body { flex-direction: column; }
  .q-body .q-img-wrap { max-width: 100%; align-self: center; }
}

.opts { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.opt {
  display: flex; align-items: flex-start; gap: 10px;
  border: 1.5px solid var(--border); border-radius: 10px;
  padding: 11px 14px; cursor: pointer; font-size: 15.5px;
  background: #fff; transition: border-color .12s, background .12s;
  user-select: none;
}
.opt:hover { border-color: #93c5fd; }
.opt .opt-label {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  border: 1.5px solid var(--border); display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--text-sub); margin-top: 1px;
}
.opt.selected { border-color: var(--blue); background: var(--blue-light); }
.opt.selected .opt-label { background: var(--blue); border-color: var(--blue); color: #fff; }
.opt.correct { border-color: var(--green); background: var(--green-light); }
.opt.correct .opt-label { background: var(--green); border-color: var(--green); color: #fff; }
.opt.wrong { border-color: var(--red); background: var(--red-light); }
.opt.wrong .opt-label { background: var(--red); border-color: var(--red); color: #fff; }
.opt.disabled { cursor: default; }
.opt.disabled:hover { border-color: var(--border); }
.opt.correct:hover, .opt.wrong:hover, .opt.selected:hover { border-color: inherit; }

.multi-confirm { margin-top: 14px; }

.exp-box {
  margin-top: 16px; border-radius: 10px; padding: 13px 15px; font-size: 14.5px;
  border: 1px solid;
}
.exp-box.ok { background: var(--green-light); border-color: #bbf7d0; color: #166534; }
.exp-box.bad { background: var(--red-light); border-color: #fecaca; color: #991b1b; }
.exp-box .exp-verdict { font-weight: 700; margin-bottom: 4px; }
.exp-box .exp-skill { margin-top: 6px; padding-top: 6px; border-top: 1px dashed rgba(0,0,0,.12); }

.quiz-nav {
  display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px;
}
.quiz-nav .btn { flex: 1; min-width: 110px; }

/* 答题卡 */
.sheet-wrap {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px;
}
.sheet-title { font-size: 14px; font-weight: 700; margin-bottom: 10px; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.sheet-legend { display: flex; gap: 12px; font-size: 12px; color: var(--text-sub); font-weight: 400; }
.sheet-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.legend-answered i { background: var(--blue); }
.legend-correct i { background: var(--green); }
.legend-wrong i { background: var(--red); }
.legend-blank i { background: #fff; border: 1px solid var(--border); }
.sheet {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 7px;
  max-height: 300px; overflow-y: auto; padding: 2px;
}
.sheet-cell {
  border: 1px solid var(--border); border-radius: 7px; background: #fff;
  font-size: 13px; padding: 6px 0; text-align: center; cursor: pointer;
  transition: transform .06s;
}
.sheet-cell:hover { transform: scale(1.08); }
.sheet-cell.answered { background: var(--blue); border-color: var(--blue); color: #fff; }
.sheet-cell.correct { background: var(--green); border-color: var(--green); color: #fff; }
.sheet-cell.wrong { background: var(--red); border-color: var(--red); color: #fff; }
.sheet-cell.current { outline: 2.5px solid var(--orange); outline-offset: 1px; }

/* ===== 成绩页 ===== */
.result-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 34px 24px; text-align: center; margin-bottom: 20px;
}
.score-circle {
  width: 150px; height: 150px; border-radius: 50%; margin: 0 auto 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff;
}
.score-circle.pass { background: linear-gradient(145deg, #22c55e, #15803d); }
.score-circle.fail { background: linear-gradient(145deg, #f87171, #b91c1c); }
.score-circle .score-num { font-size: 46px; font-weight: 800; line-height: 1.1; }
.score-circle .score-unit { font-size: 13px; opacity: .9; }
.result-verdict { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.result-verdict.pass { color: var(--green); }
.result-verdict.fail { color: var(--red); }
.result-stats { display: flex; justify-content: center; gap: 26px; color: var(--text-sub); font-size: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.result-stats b { display: block; font-size: 20px; color: var(--text); }
.result-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

.review-title { font-size: 17px; font-weight: 700; margin: 26px 0 12px; }
.review-item {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; margin-bottom: 12px; font-size: 14.5px;
}
.review-item .rv-q { font-weight: 600; font-size: 15px; margin-bottom: 8px; }
.review-item .rv-row { margin: 3px 0; }
.rv-yours { color: var(--red); }
.rv-right { color: var(--green); }
.rv-exp { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); color: var(--text-sub); }
.rv-img { max-height: 200px; }

.empty-tip {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 40px 20px; text-align: center; color: var(--text-sub);
}

/* ===== 考试界面(仿真实机考系统) ===== */
.exam-ui { font-family: "SimSun", "宋体", "Microsoft YaHei", serif; }
.exam-window {
  background: #d4d0c8; border: 2px solid #0b3f95; border-radius: 4px;
  overflow: hidden; box-shadow: 0 6px 24px rgba(0,0,0,.28);
}
.exam-titlebar {
  background: linear-gradient(180deg, #3a7bd5, #0b3f95); color: #fff;
  font-weight: bold; padding: 7px 12px; font-size: 15px; letter-spacing: 2px;
  display: flex; justify-content: space-between; align-items: center;
}
.exam-titlebar-x {
  width: 20px; height: 20px; background: #c75050; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; border: 1px solid #fff; letter-spacing: 0;
}
.exam-subtitle { text-align: center; font-size: 18px; font-weight: bold; color: #0b3f95; padding: 10px 8px 4px; }

.exam-layout { display: flex; gap: 10px; padding: 10px; align-items: stretch; }
.exam-left { width: 172px; flex: none; background: #fff; border: 1px solid #7f9db9; padding: 10px; }
.exam-photo { width: 116px; margin: 0 auto 10px; border: 1px solid #7f9db9; text-align: center; font-size: 12px; color: #6c8cae; padding-bottom: 2px; }
.exam-photo svg { width: 100%; display: block; }
.exam-info-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.exam-info-table td { border: 1px solid #b8cbdd; padding: 4px 7px; }
.exam-info-table td:first-child { background: #eef4fa; color: #345a80; white-space: nowrap; }

.exam-center { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.exam-qhead { font-size: 15px; font-weight: bold; padding: 7px 12px; background: #eef4fa; border: 1px solid #7f9db9; border-bottom: none; }
.exam-qhead b { color: #c00; font-size: 17px; }
.exam-qarea { flex: 1; border: 1px solid #7f9db9; background: #fff; overflow: auto; }
.exam-qarea .q-card { box-shadow: none; border-radius: 0; padding: 16px 18px; margin: 0; }
.exam-qarea .q-text { font-size: 17px; }
.exam-ui .opt { border-radius: 2px; border-color: #b8cbdd; font-size: 16px; padding: 8px 12px; }
.exam-ui .opt.selected { background: #dbe9f9; border-color: #316ac5; }
.exam-ui .opt.disabled { opacity: .92; }
.exam-locked-tip { margin-top: 12px; font-size: 13px; color: #a00; }

.exam-right { width: 122px; flex: none; display: flex; flex-direction: column; gap: 10px; }
.exam-timer-box { background: #fff; border: 1px solid #7f9db9; text-align: center; font-size: 13px; padding: 7px 6px; color: #345a80; }
.exam-timer {
  background: #000; color: #f33; margin-top: 5px; padding: 2px 0;
  font: bold 24px/1.35 "Consolas", "Courier New", monospace; letter-spacing: 2px;
  font-variant-numeric: tabular-nums;
}
.exam-timer.warn { color: #ff5; animation: blink 1s step-end infinite; }

.exam-btn {
  font-family: inherit; background: #ece9d8; border: 2px outset #fdfdfd;
  padding: 9px 8px; font-size: 15px; cursor: pointer; color: var(--text);
}
.exam-btn:active { border-style: inset; }
.exam-btn:disabled { color: #999; cursor: not-allowed; }
.exam-btn-submit { color: #a00; font-weight: bold; }
.exam-btn-primary { background: #316ac5; color: #fff; border-color: #6a97dd #17408f #17408f #6a97dd; }
.exam-btn-confirm { padding: 7px 22px; }

.exam-sheet-panel { margin: 0 10px 10px; background: #fff; border: 1px solid #7f9db9; padding: 8px 10px; }
.exam-sheet-title { font-size: 14px; font-weight: bold; margin-bottom: 7px; display: flex; gap: 12px; align-items: center; }
.exam-sheet.sheet { max-height: 176px; }
.exam-ui .sheet-cell { border-radius: 2px; }
.exam-ui .sheet-cell.answered { background: #316ac5; border-color: #316ac5; }
.exam-ui .sheet-cell.current { outline-color: #d00; }
.exam-statusbar { background: #ece9d8; border-top: 1px solid #aaa; font-size: 12.5px; color: #444; padding: 6px 12px; }

/* 考试须知 */
.exam-intro { padding: 22px 26px 28px; background: #f6f8fb; }
.exam-intro-title { text-align: center; font-size: 20px; color: #0b3f95; margin-bottom: 16px; }
.exam-intro-table { margin: 0 auto 16px; border-collapse: collapse; font-size: 15px; min-width: min(360px, 100%); }
.exam-intro-table td { border: 1px solid #b8cbdd; padding: 6px 16px; background: #fff; }
.exam-intro-table td:first-child { background: #eef4fa; color: #345a80; white-space: nowrap; }
.exam-intro-rules { max-width: 640px; margin: 0 auto 20px; font-size: 14.5px; line-height: 1.9; background: #fff; border: 1px solid #b8cbdd; padding: 12px 18px; }
.exam-intro-rules ol { padding-left: 24px; margin-top: 4px; }
.exam-intro-actions { display: flex; gap: 16px; justify-content: center; }
.exam-intro-actions .exam-btn { min-width: 128px; padding: 10px 18px; font-size: 16px; }

@media (max-width: 760px) {
  .exam-layout { flex-wrap: wrap; }
  .exam-left { width: 100%; display: flex; gap: 10px; align-items: flex-start; }
  .exam-photo { width: 88px; flex: none; margin: 0; }
  .exam-info-table { flex: 1; }
  .exam-right { width: 100%; order: 2; flex-direction: row; }
  .exam-timer-box { flex: 1.4; }
  .exam-right .exam-btn { flex: 1; }
  .exam-center { width: 100%; order: 3; }
}

/* ===== 响应式 ===== */
@media (max-width: 560px) {
  .q-text { font-size: 16px; }
  .quiz-head { padding: 10px 14px; gap: 8px; }
  .mode-btns { grid-template-columns: 1fr 1fr; }
  .sheet { grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); }
  .result-stats { gap: 18px; }
}
