/* 在线考试答题页 - 复刻 WELL 机考界面（居中固定宽度版） */
* { margin: 0; padding: 0; box-sizing: border-box; }

body.exam-page {
  font-family: "Segoe UI", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: #e7e6e6;
  color: #333;
  min-height: 100vh;
  padding: 0 5vw;
}

.exam-wrapper {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0;
  height: 100vh;
  background: #d9d9d9;
  overflow: hidden;
  position: relative;
  /* 整页 300 留白已上移到 body（见 exam.html 内联 style 块），让站点头部+wrapper 一起缩进 */
}

/* ---------- 顶部黑色栏 ---------- */
.exam-top-bar {
  background: #000000;
  color: #fff;
  padding: 6px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  flex-shrink: 0;
}

.exam-top-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 120px;
}

.exam-top-left .q-label {
  font-size: 13px;
  font-weight: 400;
}

.exam-top-left .q-label span { font-weight: 400; }

.exam-top-left .section-label {
  font-size: 10px;
  color: #ccc;
  margin-top: 2px;
}

.exam-top-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 420px;
  margin: 0 20px;
}

.exam-timer-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 400;
  color: #fff;
  margin-bottom: 4px;
}

.exam-timer-row .clock-icon {
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-radius: 50%;
  position: relative;
}

.exam-timer-row .clock-icon::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 2px;
  background: #fff;
  transform: translate(-1px, -2px) rotate(45deg);
  transform-origin: left center;
}

.exam-timer-row .clock-icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 2px;
  background: #fff;
  transform: translate(-1px, -2px) rotate(-30deg);
  transform-origin: left center;
}

.exam-progress-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.exam-progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #ddd;
}

.exam-progress-bar {
  width: 100%;
  height: 10px;
  background: #666;
  border-radius: 5px;
  overflow: hidden;
}

.exam-progress-bar .exam-progress-fill {
  height: 100%;
  background: #70ad47;
  width: 0%;
  transition: width 0.3s ease;
}

.exam-top-right {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 120px;
  justify-content: flex-end;
}

.exam-finish-btn {
  background: #b0b0b0;
  color: #222;
  border: none;
  padding: 8px 18px;
  font-size: 11px;
  font-weight: 400;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.exam-finish-btn:hover { background: #fff3cd; }

.exam-candidate {
  font-size: 11px;
  font-weight: 400;
  color: #fff;
}

/* ---------- 绿色标题栏 ---------- */
.exam-sub-header {
  background: #70ad47;
  color: #fff;
  padding: 7px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 400;
  min-height: 34px;
  flex-shrink: 0;
}

/* ---------- 主体区域 ---------- */
.exam-main-area {
  display: flex;
  height: calc(100vh - 58px - 34px - 52px);
  flex: none;
  overflow: hidden;
  justify-content: flex-start;   /* sidebar 紧贴 main-area 最左，题目内容紧随其后 */
  align-items: stretch;
  width: 100%;                   /* 整页 100% 全宽铺开（与设计原图一致）；超大屏不限制 */
  background: #d9d9d9;
}

/* ---------- 左侧题号导航 ---------- */
.exam-sidebar {
  width: 86px;
  background: #262626;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 0;
  overflow: hidden;
  flex-shrink: 0;                /* 题号列固定宽度不收缩 */
}

.exam-nav-arrow {
  color: #999;
  font-size: 12px;
  padding: 4px 0;
  cursor: pointer;
  user-select: none;
}

.exam-nav-arrow:hover { color: #fff; }

.exam-question-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 4px 0;
  scrollbar-width: thin;
  scrollbar-color: #666 #333;
}

.exam-question-nav::-webkit-scrollbar {
  width: 6px;
}

.exam-question-nav::-webkit-scrollbar-track {
  background: #333;
}

.exam-question-nav::-webkit-scrollbar-thumb {
  background: #666;
  border-radius: 3px;
}

.exam-question-nav::-webkit-scrollbar-thumb:hover {
  background: #888;
}

/* 题号列：单格单号（01、02、03…），原样式保留 */
.exam-q-btn {
  width: 56px;
  height: 30px;
  background: #d9d9d9;
  border: 1px solid #bfbfbf;
  color: #333;
  font-weight: 400;
  font-size: 12px;               /* 题号按钮 13→14，点选更清晰 */
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  position: relative;
  margin-bottom: 5px;
}

.exam-q-btn:hover { background: #fff3cd; }

.exam-q-btn.active {
  background: #70ad47;
  border-color: #5a8f3a;
  color: #fff;
}

.exam-q-btn.active::after {
  content: '';
  position: absolute;
  right: -7px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 7px 7px 7px 0;
  border-style: solid;
  border-color: transparent #70ad47 transparent transparent;
}

.exam-q-btn.answered { background: #808080; color: #fff; }

.exam-q-btn.flagged::before {
  content: '\1F6A9';
  position: absolute;
  top: -5px;
  right: -3px;
  font-size: 10px;
}

/* ---------- 题目内容区 ---------- */
.exam-content {
  flex: 1 1 auto;
  padding: 24px 32px;            /* 上下/左右各多 4px 呼吸感（只调间距，不动底色） */
  display: flex;                 /* 苏老师要求：整页无滚动条，题卡 / 选项各自独立滚 */
  flex-direction: column;
  overflow: hidden;              /* 整页内容区不再出现滚动条 */
  background: #d9d9d9;
  /* 取消 max-width:880，让内容跟 .exam-main-area 的 1200px 边界一起撑开；题卡 .exam-question-card 内部保留 max-width:720 自带居中 */
}

.exam-question-card {
  background: #d9d9d9;
  border: 1px solid #bfbfbf;
  border-radius: 4px;
  padding: 12px 16px;
  margin: 0 0 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  flex: 0 0 auto;                /* 高度跟随题干内容，不被压缩 */
  max-height: 72vh;              /* 题干超长时自身出现滚动条；题干短时不空出多余滚动条 */
  overflow-y: auto;             /* 题干内部独立滚动 */
  /* 占满 .exam-content 整个内容区，避免中间留大片灰色空白孤岛 */
}

.exam-question-title {
  display: flex;
  flex-wrap: wrap;               /* 题干超长时徽标与文本可自然换行 */
  gap: 12px;
  font-size: 13.5px;                /* 题干字号 15→16，提升阅读舒适度 */
  line-height: 1.45;              /* 题干行高 1.55→1.7，长句更松 */
  color: #333;
  overflow-wrap: break-word;
  word-break: break-word;        /* 长英文/无空格长串自动断行，不撑破布局 */
}

/* 题干文本容器：在标题 flex 内可收缩并自动换行 */
.exam-question-title .exam-q-texts {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}

.exam-q-badge {
  background: #70ad47;
  color: #fff;
  font-weight: 400;
  font-size: 12px;
  width: 34px;
  height: 30px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.exam-q-texts {
  flex: 1;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.exam-q-en {
  font-weight: 400;
  margin-bottom: 6px;
}

.exam-q-cn {
  color: #555;
  font-weight: 400;
}

/* 富文本题目渲染样式 */
.exam-q-texts p { margin: 0 0 4px; }
.exam-q-texts p:last-child { margin-bottom: 0; }
.exam-q-texts img { max-width: 100%; height: auto; border-radius: 4px; margin: 4px 0; }
.exam-q-texts ul, .exam-q-texts ol { padding-left: 22px; margin: 6px 0; }
.exam-q-texts li { margin: 2px 0; }
.exam-q-texts table { border-collapse: collapse; margin: 8px 0; max-width: 100%; }
.exam-q-texts td, .exam-q-texts th { border: 1px solid #ddd; padding: 4px 8px; }
.exam-q-texts a { color: #1B5E20; text-decoration: underline; }
.exam-q-texts blockquote { border-left: 3px solid #8CB83C; margin: 8px 0; padding: 4px 12px; color: #555; background: #f7faf2; }
.exam-q-texts code { background: #f0f0f0; padding: 1px 4px; border-radius: 3px; font-size: 92%; }
.exam-q-texts pre { background: #f5f5f5; padding: 8px 10px; border-radius: 4px; overflow-x: auto; }

.exam-options-list {
  display: flex;
  flex-direction: column;
  gap: 7px;                     /* 卡间距 12→14，选项块之间更松 */
  margin: 0;
  flex: 1 1 auto;                /* 占满题卡下方的剩余空间 */
  min-height: 0;                 /* 关键：允许 flex 子项收缩到内容以下，overflow 才会生效 */
  overflow-y: auto;              /* 选项多了自身出现滚动条 */
}

.exam-option-card {
  display: flex;
  background: #d9d9d9;
  border: 1px solid #bfbfbf;
  border-radius: 4px;
  padding: 9px 12px;             /* 选项卡内边距 14/16 → 16/18，点选区更舒展 */
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  align-items: flex-start;
  gap: 8px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.exam-option-card:hover {
  border-color: #70ad47;
  background: #c8c8c8;
}

.exam-option-card.selected {
  border-color: #70ad47;
  background: #fff3cd;
  box-shadow: 0 0 0 1px #70ad47 inset;
}

.exam-option-label {
  font-weight: 400;
  font-size: 13.5px;                /* 选项标签(A/B/C) 15→16，与选项文本同级 */
  color: #333;
  min-width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.exam-option-texts {
  flex: 1;
  min-width: 0;                  /* 允许收缩：长英文/长串换行而非撑破卡片 */
  overflow-wrap: break-word;
  word-break: break-word;
  font-size: 13.5px;                /* 选项文本 14→16，与题干预同级 */
  line-height: 1.45;             /* 选项行高 1.5→1.65 */
  color: #333;
}

.exam-option-en { font-weight: 400; margin-bottom: 4px; font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", "Noto Sans CJK SC", "WenQuanYi Micro Hei", "SimHei", sans-serif !important; overflow-wrap: break-word; word-break: break-word;
  margin-bottom: 2px;
}
.exam-option-cn {
  color: #555;
  font-weight: 400;
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", "Noto Sans CJK SC", "WenQuanYi Micro Hei", "SimHei", sans-serif !important;
  white-space: pre-wrap;
  overflow-wrap: break-word;     /* 长内容自动换行 */
}

/* ---------- 底部操作栏 ---------- */
/* 底栏：从 fixed 改为 absolute 相对 .exam-wrapper（width:100%），
   left:0/right:0 会铺满整宽（含题号列 86px），与上方的题目/选项卡同宽。
   z-index 9999：永远高于 .exam-modal-overlay(1000)，弹窗开启时 Back/Next
   仍醒目可见、按压正常，符合「优先显示」要求。 */
.exam-bottom-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #000000;
  color: #fff;
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 52px;
}

.exam-bottom-left { display: flex; gap: 14px; }

.exam-icon-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 17px;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
}

.exam-icon-btn:hover { opacity: 1; }

.exam-bottom-right { display: flex; gap: 10px; }

.exam-action-btn {
  border: none;
  padding: 7px 16px;
  font-size: 11px;
  font-weight: 400;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s;
}

.exam-action-btn.back {
  background: #70ad47;
  color: #fff;
}

.exam-action-btn.next {
  background: #5a8f3a;
  color: #fff;
}

.exam-action-btn:hover { filter: brightness(1.1); }

.exam-action-btn:disabled {
  background: #777;
  cursor: not-allowed;
  filter: none;
}

/* ---------- 弹窗 ---------- */
.exam-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.exam-modal-overlay.show { display: flex; }

.exam-modal-box {
  background: #fff;
  padding: 24px;
  border-radius: 8px;
  max-width: 400px;
  width: 90%;
  text-align: center;
}

.exam-modal-title {
  font-size: 15.5px;
  font-weight: 400;
  margin-bottom: 12px;
}

.exam-modal-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}

.exam-modal-btn {
  border: none;
  padding: 8px 20px;
  font-size: 12px;
  font-weight: 400;
  border-radius: 4px;
  cursor: pointer;
}

.exam-modal-btn.cancel { background: #e0e0e0; color: #333; }
.exam-modal-btn.confirm { background: #70ad47; color: #fff; }

/* ---------- 入口/结果/加载/错误页 ---------- */
.exam-page-card,
.exam-entry-card {
  max-width: 880px;
  margin: 56px auto;
  background: #fff;
  padding: 40px 48px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

/* 大屏（≥1024px）：5 项一行排满，卡片更饱满 */
@media (min-width: 1024px) {
  .exam-entry-icon { width: 64px; height: 64px; font-size: 13.5px; }
  .exam-entry-title { font-size: 20.5px; }
  .exam-entry-grid { grid-template-columns: repeat(5, 1fr); gap: 10px; }
  .exam-entry-item { min-width: 0; }
  .exam-entry-item { padding: 16px 18px; }
  .ee-value { font-size: 16px; }
  .exam-entry-notice { padding: 22px 26px; }
  .exam-entry-notice ul { font-size: 13px; line-height: 2; }
  .exam-entry-btn { padding: 14px 36px; font-size: 13.5px; min-width: 220px; }
}

/* ---------- 考试入口卡片（美化和信息丰富） ---------- */
.exam-entry-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e8f5e9;
  margin-bottom: 18px;
}

.exam-entry-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2D5A3D 0%, #4CAF50 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(45, 90, 61, 0.25);
}

.exam-entry-title {
  font-size: 18.5px;
  font-weight: 600;
  color: #1B3A2A;
  line-height: 1.3;
}

.exam-entry-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.ee-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  background: #f5f5f5;
  color: #555;
  border: 1px solid #eee;
}

.ee-tag-green { background: #e8f5e9; color: #2E7D32; border-color: #c8e6c9; }
.ee-tag-blue { background: #e3f2fd; color: #1565C0; border-color: #bbdefb; }
.ee-tag-orange { background: #fff3e0; color: #ef6c00; border-color: #ffe0b2; }

.exam-entry-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}

.exam-entry-item {
  background: #f8faf8;
  border: 1px solid #e8f5e9;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ee-label {
  font-size: 11px;
  color: #78909c;
}

.ee-value {
  font-size: 15.5px;
  font-weight: 600;
  color: #2D5A3D;
}

.exam-entry-notice {
  background: #f8faf8;
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 22px;
  border-left: 4px solid #4CAF50;
}

.ee-notice-title {
  font-size: 13px;
  font-weight: 600;
  color: #1B3A2A;
  margin-bottom: 10px;
}

.exam-entry-notice ul {
  margin: 0;
  padding-left: 18px;
  color: #555;
  font-size: 12px;
  line-height: 1.9;
}

.exam-entry-notice li strong { color: #2D5A3D; }

.exam-entry-desc {
  font-size: 12px;
  color: #666;
  line-height: 1.7;
  margin-bottom: 22px;
  padding: 12px 16px;
  background: #fafafa;
  border-radius: 8px;
}

.exam-entry-btn {
  width: 100%;
  background: linear-gradient(135deg, #2D5A3D 0%, #4CAF50 100%);
  color: #fff;
  border: none;
  padding: 14px 24px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(45, 90, 61, 0.3);
  transition: transform 0.15s, box-shadow 0.15s;
}

.exam-entry-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(45, 90, 61, 0.35);
}

.exam-page-title {
  font-size: 18.5px;
  font-weight: 400;
  margin-bottom: 16px;
  color: #333;
}

.exam-page-info {
  font-size: 13px;
  line-height: 1.8;
  color: #555;
  margin-bottom: 24px;
}

.exam-page-info strong { color: #333; }

.exam-primary-btn {
  background: #70ad47;
  color: #fff;
  border: none;
  padding: 10px 24px;
  font-size: 13px;
  font-weight: 400;
  border-radius: 4px;
  cursor: pointer;
}

.exam-primary-btn:hover { background: #5a8f3a; }

.exam-score-board {
  text-align: center;
  margin: 20px 0;
}

.exam-big-score {
  font-size: 41px;
  font-weight: 400;
  color: #5a8f3a;
}

.exam-pass-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  font-weight: 400;
  font-size: 12px;
  margin-top: 8px;
}

.exam-pass-badge.pass { background: #dcedc8; color: #33691e; }
.exam-pass-badge.fail { background: #ffebee; color: #b71c1c; }

/* ===== 错题回顾页 ===== */
.exam-wrong-card {
  max-width: 880px;
  text-align: left;
}
.wq-item {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 16px 18px;
  margin: 16px 0;
  background: #fafbfc;
}
.wq-num {
  font-size: 13px;
  font-weight: 700;
  color: #2D5A3D;
  margin-bottom: 8px;
}
.wq-stem {
  font-size: 13px;
  line-height: 1.6;
  color: #222;
  margin-bottom: 10px;
}
.wq-stem .exam-q-en { font-weight: 500; }
.wq-stem .exam-q-cn { color: #555; margin-top: 4px; }
.wq-options { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 12px; }
.wq-options .exam-option-card {
  margin: 0;
  cursor: default;
}
.wq-options .wq-option.wq-correct {
  border-color: #2D5A3D;
  background: #f0f7ec;
}
.wq-options .wq-option.wq-wrong {
  border-color: #B91C1C;
  background: #fef2f2;
}
.wq-summary {
  font-size: 12px;
  color: #333;
  line-height: 1.7;
  border-top: 1px dashed #e5e7eb;
  padding-top: 8px;
  margin-top: 8px;
}
.wq-explain {
  margin-top: 6px;
  padding: 8px 10px;
  background: #f5f7f6;
  border-left: 3px solid #70ad47;
  border-radius: 3px;
  color: #444;
  /* 解析支持多行排版：题干中文 / A-D 选项中文 / 正确答案 各占一行 */
  white-space: pre-wrap;
  word-break: break-word;
}
.wq-tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 10px;
  border-radius: 10px;
  font-weight: 600;
}
.wq-tag-correct { background: #dcedc8; color: #33691e; }
.wq-tag-wrong { background: #ffebee; color: #b71c1c; }
.wq-tag-both { background: #c8e6c9; color: #1b5e20; }

.exam-error-message {
  max-width: 500px;
  margin: 80px auto;
  text-align: center;
  padding: 32px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.exam-error-message h2 { color: #c62828; margin-bottom: 12px; }

.exam-loading {
  text-align: center;
  padding: 60px;
  color: #777;
}

/* ---------- 响应式：平板/手机全面适配 ---------- */

/* 平板：768-1024px */
@media (max-width: 1024px) and (min-width: 769px) {
  .exam-wrapper { max-width: 100%; }
  .exam-main-area { height: calc(100vh - 58px - 34px - 52px); }
}

/* 小/中屏：手机 + 小平板 */
@media (max-width: 768px) {
  /* 去点击延迟 + 防双击误触缩放（题目/选项/按钮全部受益） */
  .exam-option-card,
  .exam-icon-btn,
  .exam-action-btn,
  .exam-q-btn,
  .exam-finish-btn { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

  .exam-wrapper {
    max-width: 100%;
    padding-left: 0;            /* 窄屏/手机取消整页 300 留白，避免题目区被挤死 */
    padding-right: 0;
    height: 100vh;
    height: 100dvh;
  }

  /* ===== 顶部栏简化 ===== */
  .exam-top-bar {
    padding: 4px 10px;
    min-height: 48px;
    flex-wrap: nowrap;
  }
  .exam-top-left { min-width: auto; }
  .exam-top-left .q-label { font-size: 13px; }
  .exam-top-left .section-label { display: none; }
  .exam-top-center { max-width: none; margin: 0 8px; }
  .exam-timer-row { font-size: 11px; gap: 4px; }
  .exam-timer-row .clock-icon { width: 12px; height: 12px; }
  .exam-timer-label { display: none; } /* 移动端只留 ⏰ + 倒计时，防顶栏挤爆 */
  .exam-progress-header { font-size: 10px; }
  .exam-progress-bar { height: 7px; }

  /* 移动端显示 FINISH 按钮 */
  .exam-top-right {
    display: flex;
    min-width: auto;
  }
  .exam-finish-btn {
    padding: 6px 12px;
    font-size: 12px;
    min-height: 32px;
  }
  .exam-candidate { display: none; } /* 顶部姓名隐藏避免挤压 */

  /* 移动端隐藏桌面专属按钮（设置/帮助） */
  .exam-icon-desktop-only { display: none !important; }

  /* ===== 主体区域适配 ===== */
  .exam-main-area {
    height: calc(100vh - 48px - 34px - 48px);
    height: calc(100dvh - 48px - 34px - 48px);
    flex-direction: column;
  }

  /* 题目区/选项显式 100% 宽，防 max-width:720px 在窄屏产生误判 */
  .exam-question-card,
  .exam-options-list { max-width: 100%; }

  /* 防长英文/代码撑破整页横向滚动；窄屏下 max-width 改 100% 避免被压到 880px */
  .exam-content {
    padding: 12px;
    -webkit-overflow-scrolling: touch;
    overflow-x: hidden;
    max-width: 100%;
  }
}

@media (min-width: 769px) {
  .exam-icon-mobile-show { display: flex; }
}

@media (max-width: 768px) {
  .exam-sidebar { display: none; }

  /* 移动端题号网格遮罩 */
  .exam-sidebar.exam-sidebar-show {
    display: flex !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    width: 100%;
    background: rgba(0,0,0,0.85);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
  }
  .exam-sidebar.exam-sidebar-show .exam-nav-arrow { display: none; }
  .exam-sidebar.exam-sidebar-show .exam-question-nav {
    flex: none;
    max-height: 70vh;
    width: auto;
    max-width: 320px;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
  }
  .exam-sidebar.exam-sidebar-show .exam-q-btn {
    width: 46px;
    height: 40px;
    font-size: 14px;
  }
  .exam-sidebar.exam-sidebar-show .exam-q-btn.active::after { display: none; }
  .exam-sidebar.exam-sidebar-show::after {
    content: '点击题号跳转，点击空白关闭';
    display: block;
    color: #999;
    font-size: 12px;
    margin-top: 12px;
  }

  /* ===== 主体区域适配 ===== */
  .exam-main-area {
    height: calc(100dvh - 48px - 34px - 48px);
    flex-direction: column;
  }
  .exam-content {
    padding: 12px;
    -webkit-overflow-scrolling: touch;
  }

  /* ===== 题目卡片 ===== */
  .exam-question-card {
    padding: 14px 16px;
    margin-bottom: 14px;
  }
  .exam-question-title {
    font-size: 14px;
    gap: 8px;
  }
  .exam-q-badge {
    width: 28px;
    height: 26px;
    font-size: 12px;
  }

  /* ===== 选项卡片（加高触控区） ===== */
  .exam-options-list { gap: 10px; }
  .exam-option-card {
    padding: 14px 12px;
    min-height: 48px;
    gap: 10px;
  }
  .exam-option-label {
    font-size: 15px;
    min-width: 22px;
  }
  .exam-option-texts { font-size: 14px; }

  /* ===== 底部操作栏 ===== */
  .exam-bottom-bar {
    min-height: 48px;
    padding: 6px 10px;
  }
  .exam-bottom-left { gap: 8px; }
  .exam-icon-btn {
    font-size: 18px;
    padding: 8px;
    min-width: 44px;
    min-height: 38px;
  }
  .exam-bottom-right { gap: 8px; }
  .exam-action-btn {
    padding: 8px 14px;
    font-size: 13px;
    min-height: 38px;
  }

  /* ===== 入口卡片 ===== */
  .exam-entry-card {
    max-width: 100%;
    margin: 20px 12px;
    padding: 20px;
    border-radius: 10px;
  }
  .exam-entry-header { gap: 10px; }
  .exam-entry-icon {
    width: 44px;
    height: 44px;
    font-size: 13px;
  }
  .exam-entry-title { font-size: 18px; }

  .exam-entry-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .exam-entry-item { padding: 10px 12px; }
  .ee-value { font-size: 16px; }
  .exam-entry-notice { padding: 14px; }

  /* ===== 结果页 ===== */
  .exam-page-card {
    max-width: 100%;
    margin: 20px 12px;
    padding: 24px;
  }
  .exam-big-score { font-size: 38px; }

  /* ===== 错题回顾页（移动端） ===== */
  .exam-wrong-card { margin: 12px; padding: 16px; }
  .wq-item { padding: 12px; }
  .wq-num { font-size: 14px; }
  .wq-stem { font-size: 14px; }

  /* ===== 弹窗 ===== */
  .exam-modal-box {
    max-width: 90%;
    width: 100%;
    margin: 0 16px;
    padding: 20px;
  }

  /* ===== 加载/错误 ===== */
  .exam-loading { padding: 40px 20px; }
  .exam-error-message { margin: 40px 16px; padding: 24px; }
}

/* 小屏手机 (<420px) */
@media (max-width: 420px) {
  .exam-top-bar {
    padding: 3px 6px;
    min-height: 42px;
  }
  .exam-top-left .q-label { font-size: 12px; }
  .exam-timer-row { font-size: 10px; }

  .exam-main-area {
    height: calc(100vh - 42px - 30px - 44px);
    height: calc(100dvh - 42px - 30px - 44px);
  }
  .exam-content { padding: 8px; }
  .exam-question-card { padding: 10px 12px; }
  .exam-question-title { font-size: 13px; }
  .exam-option-card {
    padding: 12px 10px;
    min-height: 44px;
  }
  .exam-option-texts { font-size: 13px; }

  .exam-sub-header {
    padding: 5px 10px;
    min-height: 30px;
    font-size: 12px;
  }

  .exam-bottom-bar {
    min-height: 44px;
    padding: 4px 8px;
  }
  .exam-action-btn {
    padding: 6px 10px;
    font-size: 12px;
    min-height: 34px;
  }
  .exam-icon-btn {
    font-size: 16px;
    padding: 6px;
    min-width: 38px;
    min-height: 34px;
  }

  .exam-entry-card { padding: 16px; margin: 12px 8px; }
  .exam-entry-title { font-size: 16px; }
  .exam-entry-grid { grid-template-columns: 1fr; }
}

/* 横屏提醒 */
@media (max-height: 500px) and (orientation: landscape) {
  .exam-top-bar { min-height: 40px; padding: 3px 8px; }
  .exam-timer-row { font-size: 10px; }
  .exam-progress-bar { height: 6px; }
  .exam-progress-header { font-size: 10px; }
  .exam-bottom-bar { min-height: 40px; padding: 4px 10px; }
  .exam-main-area { height: calc(100dvh - 40px - 30px - 40px); }
  .exam-sidebar { width: 60px; }
  .exam-q-btn { width: 44px; height: 24px; font-size: 10px; }
  .exam-content { padding: 8px 12px; }
}

/* 安全区适配（刘海屏）：整页 300 留白已上移至 body（exam.html 内联 style），wrapper 无需再叠加 */

@supports (padding: max(0px)) {
  .exam-bottom-bar {
    padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));
  }
}

/* ===================================================================
   2026-08-31 P2 加固：防题目批量导出（水印 + 禁复制）
   1) 水印层：学员姓名斜向平铺。答题时 10% 透明度几乎无感，
      但截图/拍照外流后可据此溯源到具体学员，形成威慑。
      pointer-events:none 保证完全不挡点击与答题。
   2) 题面禁选中：配合 exam.js 的禁复制/右键/打印监听。
      作用域仅限 .exam-content（题干 + 选项），不波及输入框与按钮。
   =================================================================== */
.exam-watermark {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  align-content: space-around;
  justify-content: space-around;
  transform: rotate(-25deg) scale(1.35);
  opacity: 0.10;
  font-size: 14.5px;
  font-weight: 700;
  color: #000;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
}
.exam-watermark span { padding: 34px 46px; }

/* 题面禁选中（题干 + 选项） */
.exam-content, .exam-content * {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* ===================================================================
   2026-10-08 手机端答题体验修复（仅 ≤768px 生效，桌面版式零改动）
   实测根因：答题区高度用 100dvh 硬算，未扣除站头高度 →
     ① 文档多出 50px 幽灵滚动，滚动后黑色答题顶栏（题号/倒计时/
        进度条/Finish 交卷）被站头压住 50px，首屏看不到；
     ② 底栏被推到视口下方，需下拉才能点到 Back/Next。
   实测手机为「题干卡 + 选项区」两条独立内滚，SE 一屏只见约 2 个选项。
   =================================================================== */
@media (max-width: 768px) {
  /* ① 答题时隐藏站头：答题页自带黑色顶栏，站头既遮挡又无功能价值 */
  body.exam-active-exam .mobile-top-nav { display: none !important; }

  /* ② 整页单滚动：答题区不再锁死一屏，题干/选项随内容自然增长
     注意：wrapper 必须保留 overflow:hidden（水印层 rotate+scale 的视觉
     溢出靠它裁剪，改 visible 会把布局视口撑宽导致整页缩放） */
  body.exam-active-exam .exam-main-area {
    height: auto;
    min-height: 0;
  }
  body.exam-active-exam .exam-wrapper {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
  }
  body.exam-active-exam .exam-content {
    overflow: visible;
    padding: 12px;
    /* 给吸底栏让位（底栏约 56px + 底部安全区） */
    padding-bottom: 64px;
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  }
  body.exam-active-exam .exam-question-card {
    max-height: none;
    overflow: visible;
  }
  body.exam-active-exam .exam-options-list {
    min-height: 0;
    overflow: visible;
  }
  /* 底栏吸底：滚动到哪儿都能看到 Back/Next */
  body.exam-active-exam .exam-bottom-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
  }

  /* ③ 正文字号：手机不小于 15px（原 <420 断点降为 13px，iPhone 12~15 全命中） */
  .exam-question-title { font-size: 15px; }
  .exam-option-texts { font-size: 15px; }
  .exam-option-label { font-size: 16px; }

  /* ④ 触控热区：按钮一律 ≥44px */
  .exam-top-bar { min-height: 56px; }
  .exam-action-btn {
    min-height: 44px;
    padding: 10px 16px;
    font-size: 14px;
  }
  .exam-icon-btn {
    min-width: 44px;
    min-height: 44px;
    font-size: 20px;
  }
  .exam-finish-btn {
    min-height: 44px;
    padding: 8px 14px;
    font-size: 12.5px;
  }
  .exam-option-card { min-height: 48px; }

  /* ⑤ 题干图片点击放大层（机考图表细节在手机上需放大看） */
  .exam-img-zoom {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    touch-action: pinch-zoom;
  }
  .exam-img-zoom img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
  }
  .exam-img-zoom::after {
    content: '点击任意位置关闭';
    position: absolute;
    left: 0; right: 0;
    bottom: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
  }
}

/* ===================================================================
   2026-10-20 考试计算器（题干与选项之间的 🧮）
   =================================================================== */
.exam-calc-row { display:flex; justify-content:flex-start; margin:0 0 6px; }
.exam-calc-toggle {
  width:34px; height:34px; border-radius:8px; border:1px solid #bfbfbf;
  background:#f0f0f0; font-size:17px; cursor:pointer; line-height:1;
  display:inline-flex; align-items:center; justify-content:center; transition:.15s;
}
.exam-calc-toggle:hover { background:#e2e8e2; border-color:#70ad47; }
.exam-calc-overlay {
  position:fixed; inset:0; background:rgba(0,0,0,.45); z-index:9999;
  display:none; align-items:center; justify-content:center;
}
.exam-calc-overlay.show { display:flex; }
.exam-calc {
  background:#fff; border-radius:12px; width:min(320px, 92vw);
  box-shadow:0 12px 48px rgba(0,0,0,.32); overflow:hidden;
}
.exam-calc-head {
  display:flex; justify-content:space-between; align-items:center;
  padding:10px 14px; background:#f3f4f6; font-weight:700; color:#333;
}
.exam-calc-close { border:none; background:none; font-size:20px; cursor:pointer; color:#666; line-height:1; }
.exam-calc-close:hover { color:#c0392b; }
.exam-calc-display {
  background:#1b1f23; color:#eaffea; text-align:right; padding:14px 12px;
  font-size:22px; min-height:28px; word-break:break-all; font-family:Consolas,monospace;
}
.exam-calc-keys { display:grid; grid-template-columns:repeat(4,1fr); gap:6px; padding:10px; }
.exam-calc-keys button {
  padding:12px 0; font-size:17px; border:1px solid #ddd; border-radius:8px;
  background:#fafafa; cursor:pointer; transition:.1s;
}
.exam-calc-keys button:hover { background:#e8e8e8; }
.exam-calc-keys .op { background:#eef4ee; color:#1B5E20; font-weight:700; }
.exam-calc-keys .eq { background:#1B5E20; color:#fff; font-weight:700; }
.exam-calc-keys .clr { background:#fdecea; color:#c0392b; font-weight:700; }
