/* ==========================================================================
   2026 银行业专业人员职业资格考试 (ATA机考 1:1 仿真系统) 样式表
   基准：遵循思源黑体 (Source Han Sans SC) 全局排版与 ATA 考场经典视觉规范
   ========================================================================== */

:root {
  --font-main: "Source Han Sans SC", "Noto Sans CJK SC", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --ata-navy: #164675;
  --ata-blue: #1c5fa8;
  --ata-blue-hover: #144982;
  --ata-light-bg: #f4f6fa;
  --ata-panel-bg: #ffffff;
  --border-color: #d8dee8;
  --text-primary: #1f2d3d;
  --text-secondary: #5c6b7d;
  --text-muted: #8c9ba5;
  --color-success: #52c41a;
  --color-danger: #f5222d;
  --color-warning: #fa8c16;
  --color-info: #1890ff;
  --q-answered-bg: #e6f7ff;
  --q-answered-border: #91d5ff;
  --q-answered-text: #096dd9;
  --q-active-border: #1d39c4;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-main);
  background-color: var(--ata-light-bg);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  height: 100vh;
  overflow: hidden;
  user-select: none;
}

/* 顶部考务深蓝信息栏 */
.exam-header {
  height: 60px;
  background: linear-gradient(180deg, #1d5b99 0%, #154677 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 100;
  flex-wrap: nowrap;
  gap: 12px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-shrink: 1;
}

.cba-emblem {
  width: 34px;
  height: 34px;
  min-width: 34px;
  background: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ata-navy);
  font-weight: 900;
  font-size: 15px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  border: 2px solid #ffd591;
}

.exam-title-group {
  min-width: 0;
}

.exam-title-group h1 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.exam-title-group .exam-subtitle {
  font-size: 11px;
  color: #d6e4ff;
  white-space: nowrap;
}

.author-watermark-tag {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  color: #e6f7ff;
  font-weight: 500;
  letter-spacing: 0.3px;
  white-space: nowrap;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  flex-shrink: 0;
}

.author-watermark-tag:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.45);
}

.footer-copyright-tag {
  display: inline-flex;
  align-items: center;
  background: #f0f5ff;
  border: 1px solid #d6e4ff;
  color: #2f54eb;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
}

.footer-copyright-tag:hover {
  background: #d6e4ff;
  color: #1d39c4;
}

.header-center {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.timer-badge {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  padding: 3px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.timer-digits {
  font-family: "Courier New", Courier, monospace, var(--font-main);
  font-size: 18px;
  font-weight: bold;
  color: #fffae6;
  letter-spacing: 1px;
}

.timer-digits.warning {
  color: #ff4d4f;
  animation: pulse-warn 1s infinite alternate;
}

@keyframes pulse-warn {
  from { opacity: 1; }
  to { opacity: 0.5; }
}

.mode-badge {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 12px;
  background: #fa8c16;
  color: #ffffff;
  font-weight: bold;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.candidate-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  padding: 3px 10px 3px 5px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.candidate-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #adc6ff;
  border: 1px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1d39c4;
  font-size: 13px;
  font-weight: bold;
}

.candidate-meta {
  line-height: 1.1;
}

.candidate-name {
  font-size: 12px;
  font-weight: 600;
}

.candidate-seat {
  font-size: 10px;
  color: #d6e4ff;
}

.header-action-btn {
  background: #ffffff;
  color: var(--ata-navy);
  border: none;
  border-radius: 4px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
  text-decoration: none;
}

.header-action-btn:hover {
  background: #e6f7ff;
  color: var(--ata-blue);
  transform: translateY(-1px);
}

.header-action-btn.submit-btn {
  background: #f5222d;
  color: #ffffff;
}

.header-action-btn.submit-btn:hover {
  background: #cf1322;
}

.header-action-btn.github-btn {
  background: #24292f;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  text-decoration: none;
}

.header-action-btn.github-btn:hover {
  background: #0969da;
  color: #ffffff;
  border-color: #0969da;
  transform: translateY(-1px);
}

.header-action-btn.github-btn svg {
  display: block;
}

/* 主考场工作区双栏布局 */
.exam-layout {
  display: flex;
  height: calc(100vh - 60px);
  background-color: var(--ata-light-bg);
}

/* 左侧试题结构与题号导航方阵 */
.exam-sidebar {
  width: 340px;
  min-width: 340px;
  background: var(--ata-panel-bg);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  padding: 12px 16px;
  background: #edf2f9;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ata-navy);
  margin-bottom: 8px;
}

.status-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  border: 1px solid #d9d9d9;
}

.legend-swatch.unanswered {
  background: #fafafa;
}

.legend-swatch.answered {
  background: var(--q-answered-bg);
  border-color: var(--q-answered-border);
}

.legend-swatch.flagged {
  background: #ffffff;
  position: relative;
}

.legend-swatch.flagged::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 9px 9px 0;
  border-color: transparent var(--color-warning) transparent transparent;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}

.section-group {
  margin-bottom: 20px;
}

.section-header {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  padding: 6px 10px;
  background: #f0f5ff;
  border-left: 4px solid var(--ata-blue);
  border-radius: 0 4px 4px 0;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
}

.section-score-tag {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: normal;
}

.q-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.q-box {
  height: 34px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  background: #fafafa;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
}

.q-box:hover {
  border-color: var(--ata-blue);
  color: var(--ata-blue);
}

.q-box.answered {
  background: var(--q-answered-bg);
  border-color: var(--q-answered-border);
  color: var(--q-answered-text);
  font-weight: 700;
}

.q-box.active {
  outline: 2px solid var(--q-active-border);
  box-shadow: 0 0 5px rgba(29, 57, 196, 0.4);
  font-weight: 800;
}

.q-box.flagged::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 10px 10px 0;
  border-color: transparent var(--color-warning) transparent transparent;
}

.q-box.correct {
  background: #f6ffed !important;
  border-color: #b7eb8f !important;
  color: #389e0d !important;
}

.q-box.wrong {
  background: #fff1f0 !important;
  border-color: #ffa39e !important;
  color: #cf1322 !important;
}

/* 试题与作答主中心 */
.exam-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  overflow: hidden;
}

.q-container {
  flex: 1;
  overflow-y: auto;
  padding: 30px 40px;
}

.q-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--border-color);
  margin-bottom: 20px;
}

.q-type-badge {
  background: #e6f7ff;
  border: 1px solid #91d5ff;
  color: #096dd9;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
}

.q-number-indicator {
  font-size: 16px;
  font-weight: 700;
  color: var(--ata-navy);
}

.q-score-indicator {
  font-size: 13px;
  color: var(--text-secondary);
}

.q-stem {
  font-size: 17px;
  line-height: 1.7;
  color: #1f2d3d;
  font-weight: 500;
  margin-bottom: 28px;
  user-select: text;
  white-space: pre-wrap;
  word-break: break-word;
}

.q-options-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 30px;
}

.option-item {
  display: flex;
  align-items: flex-start;
  padding: 14px 18px;
  border: 1px solid #dbe2ea;
  border-radius: 6px;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: text;
}

.option-item:hover {
  background: #f7f9fc;
  border-color: #91d5ff;
}

.option-item.selected {
  background: #e6f7ff;
  border-color: #1890ff;
  box-shadow: 0 2px 6px rgba(24, 144, 255, 0.15);
}

.option-radio,
.option-checkbox {
  width: 18px;
  height: 18px;
  margin-right: 12px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: #1890ff;
}

.option-label {
  font-weight: 700;
  font-size: 15px;
  color: var(--ata-blue);
  margin-right: 10px;
  min-width: 22px;
}

.option-text {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-primary);
  flex: 1;
}

/* 即时解析与助记卡片（背题练习/考后复盘） */
.explanation-card {
  margin-top: 25px;
  padding: 20px;
  background: #fafafa;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  display: none;
}

.explanation-card.visible {
  display: block;
}

.exp-header {
  font-size: 14px;
  font-weight: 700;
  color: var(--ata-navy);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.exp-correct-tag {
  color: var(--color-success);
  font-weight: 800;
  font-size: 16px;
}

.exp-body {
  font-size: 14px;
  line-height: 1.6;
  color: #333333;
  margin-bottom: 12px;
  user-select: text;
  white-space: pre-wrap;
  word-break: break-word;
}

.mnemonic-box {
  background: #fffbe6;
  border: 1px solid #ffe58f;
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 13px;
  color: #d46b08;
  font-weight: 600;
  white-space: pre-wrap;
  word-break: break-word;
}

.trap-box {
  background: #fff2f0;
  border: 1px solid #ffccc7;
  border-left: 4px solid #ff4d4f;
  padding: 10px 14px;
  border-radius: 4px;
  color: #cf1322;
  font-size: 13px;
  line-height: 1.6;
  margin-top: 10px;
  white-space: pre-wrap;
  word-break: break-word;
}

.reformed-tag {
  background: #f6ffed;
  color: #389e0d;
  border: 1px solid #b7eb8f;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}

/* 底部考务操作工具栏 */
.exam-footer {
  height: 60px;
  border-top: 1px solid var(--border-color);
  background: #edf2f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.flag-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
}

.flag-btn:hover {
  border-color: var(--color-warning);
  color: var(--color-warning);
}

.flag-btn.flagged {
  background: #fff7e6;
  border-color: var(--color-warning);
  color: var(--color-warning);
}

.footer-center {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-btn {
  padding: 8px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 4px;
  border: 1px solid #d9d9d9;
  background: #ffffff;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
}

.nav-btn:hover:not(:disabled) {
  background: #f0f5ff;
  border-color: var(--ata-blue);
  color: var(--ata-blue);
}

.nav-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.nav-btn.primary {
  background: var(--ata-blue);
  color: #ffffff;
  border-color: var(--ata-blue);
}

.nav-btn.primary:hover:not(:disabled) {
  background: var(--ata-blue-hover);
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ==========================================================================
   考场可拖拽浮动计算器 (科学模式 + TVM 理财金融模式)
   ========================================================================== */
.calc-window {
  position: absolute;
  top: 90px;
  right: 50px;
  width: 440px;
  background: #ffffff;
  border: 1px solid #c0c6cf;
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  z-index: 1000;
  display: none;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
}

.calc-window.active {
  display: flex;
}

.calc-header {
  height: 36px;
  background: linear-gradient(180deg, #2b578c 0%, #1c4270 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  cursor: move;
  font-weight: 600;
  font-size: 13px;
}

.calc-header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.calc-ctrl-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 2px;
}

.calc-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.calc-tabs {
  display: flex;
  background: #f0f2f5;
  border-bottom: 1px solid #d9d9d9;
}

.calc-tab-btn {
  flex: 1;
  padding: 8px 0;
  border: none;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.calc-tab-btn.active {
  background: #ffffff;
  color: var(--ata-blue);
  border-bottom: 2px solid var(--ata-blue);
}

.calc-body {
  padding: 14px;
  background: #f9fbfd;
}

/* 计算器屏幕 */
.calc-screen {
  background: #ffffff;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  padding: 10px 12px;
  margin-bottom: 12px;
  text-align: right;
}

.calc-expression {
  font-size: 12px;
  color: #8c8c8c;
  min-height: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calc-display {
  font-size: 24px;
  font-weight: bold;
  color: #1f2d3d;
  font-family: "Courier New", Courier, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 科学计算键盘 */
.calc-sci-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.calc-key {
  height: 36px;
  background: #ffffff;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  color: #333333;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s;
}

.calc-key:hover {
  background: #e6f7ff;
  border-color: #91d5ff;
}

.calc-key:active {
  background: #bae7ff;
}

.calc-key.sci-fn {
  background: #edf2fc;
  color: #1d39c4;
}

.calc-key.action {
  background: #fff7e6;
  color: #d46b08;
}

.calc-key.equal {
  background: #1890ff;
  color: #ffffff;
  border-color: #1890ff;
}

.calc-key.equal:hover {
  background: #40a9ff;
}

/* TVM 理财金融计算器面板 */
.tvm-panel {
  display: none;
  flex-direction: column;
  gap: 10px;
}

.tvm-panel.active {
  display: flex;
}

.tvm-mode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #e6f7ff;
  border: 1px solid #91d5ff;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
}

.tvm-toggle-btn {
  background: #1890ff;
  color: #ffffff;
  border: none;
  border-radius: 3px;
  padding: 3px 8px;
  font-weight: bold;
  cursor: pointer;
}

.tvm-input-row {
  display: grid;
  grid-template-columns: 80px 1fr 60px;
  align-items: center;
  gap: 8px;
}

.tvm-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ata-navy);
}

.tvm-input {
  height: 32px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  padding: 0 8px;
  font-size: 13px;
  text-align: right;
  font-family: monospace;
}

.tvm-input:focus {
  outline: none;
  border-color: var(--ata-blue);
  box-shadow: 0 0 4px rgba(24, 144, 255, 0.3);
}

.tvm-cpt-btn {
  height: 32px;
  background: #52c41a;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.tvm-cpt-btn:hover {
  background: #73d13d;
}

.tvm-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.tvm-action-btn {
  flex: 1;
  height: 32px;
  border: 1px solid #d9d9d9;
  background: #ffffff;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.tvm-action-btn:hover {
  border-color: var(--ata-blue);
  color: var(--ata-blue);
}

/* ==========================================================================
   官方全真机考专用四大系数表 (ATA 浮动窗口 · 支持拖拽与快速检索)
   ========================================================================== */
.coeff-window {
  position: absolute;
  top: 85px;
  right: 50px;
  width: 780px;
  max-width: 95vw;
  height: 600px;
  max-height: 85vh;
  background: #ffffff;
  border: 1px solid #c0c6cf;
  border-radius: 8px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
  z-index: 1002;
  display: none;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
  font-family: var(--font-family, "Source Han Sans SC", "Noto Sans CJK SC", "Noto Sans SC", sans-serif);
}

.coeff-window.active {
  display: flex;
}

.coeff-window.maximized {
  top: 55px !important;
  left: 20px !important;
  right: 20px !important;
  bottom: 20px !important;
  width: calc(100vw - 40px) !important;
  height: calc(100vh - 75px) !important;
  max-width: none !important;
  max-height: none !important;
  border-radius: 8px !important;
}

.coeff-header {
  height: 38px;
  background: linear-gradient(180deg, #1f4a7a 0%, #153860 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  cursor: move;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}

.coeff-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.coeff-header-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: normal;
}

.coeff-header-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.coeff-ctrl-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 13px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.coeff-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.coeff-quick-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  gap: 12px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.coeff-quick-inputs {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.coeff-quick-field {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}

.coeff-quick-field input {
  width: 65px;
  padding: 3px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 12px;
  font-family: inherit;
  background: #ffffff;
  color: #0f172a;
  outline: none;
}

.coeff-quick-field input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.coeff-quick-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.coeff-badge {
  background: #eff6ff;
  border: 1px solid rgba(59, 130, 246, 0.25);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  color: #1e40af;
}

.coeff-badge strong {
  color: #2563eb;
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
}

.coeff-tabs {
  display: flex;
  background: #f1f5f9;
  border-bottom: 1px solid #cbd5e1;
  overflow-x: auto;
  flex-shrink: 0;
}

.coeff-tab-btn {
  padding: 8px 14px;
  border: none;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  font-family: inherit;
}

.coeff-tab-btn:hover {
  color: #164675;
}

.coeff-tab-btn.active {
  background: #ffffff;
  color: #164675;
  border-bottom-color: #164675;
}

.coeff-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #ffffff;
  position: relative;
}

.coeff-tab-pane {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  padding: 10px 12px;
}

.coeff-tab-pane.active {
  display: flex;
}

.coeff-pane-desc {
  font-size: 12px;
  background: #f8fafc;
  border-left: 3px solid #164675;
  padding: 5px 10px;
  border-radius: 0 4px 4px 0;
  margin-bottom: 8px;
  color: #334155;
  flex-shrink: 0;
}

.coeff-table-wrap {
  flex: 1;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

table.coeff-data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  text-align: right;
}

table.coeff-data-table th, table.coeff-data-table td {
  padding: 5px 9px;
  border-bottom: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  white-space: nowrap;
}

table.coeff-data-table th {
  background: #f1f5f9;
  color: #164675;
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 10;
}

table.coeff-data-table .col-period-sticky {
  position: sticky;
  left: 0;
  background: #ffffff;
  z-index: 5;
  text-align: center;
  font-weight: 600;
  color: #334155;
  width: 75px;
}

table.coeff-data-table th.col-period-sticky {
  z-index: 15;
  background: #f1f5f9;
}

table.coeff-data-table tr:hover td {
  background-color: rgba(59, 130, 246, 0.05);
}

table.coeff-data-table tr.highlight-row td.col-period-sticky {
  background-color: #fef3c7;
  color: #b45309;
  font-weight: 700;
}

table.coeff-data-table td.highlight-cell {
  background-color: #fde68a !important;
  font-weight: 700;
  color: #b45309;
}

.coeff-rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
  overflow-y: auto;
  padding: 4px;
}

.coeff-rule-box {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 12px 14px;
  background: #f8fafc;
  font-size: 12px;
  line-height: 1.6;
}

.coeff-rule-title {
  font-weight: 700;
  color: #164675;
  margin-bottom: 6px;
  font-size: 13px;
}

.coeff-mnemonic {
  margin-top: 8px;
  padding: 4px 8px;
  background: rgba(217, 119, 6, 0.1);
  border-left: 3px solid #d97706;
  color: #b45309;
  font-weight: 600;
  border-radius: 0 4px 4px 0;
}

/* 题目元信息栏内专属系数表按钮 */
.q-coeff-btn {
  background: rgba(22, 70, 117, 0.08);
  border: 1px solid rgba(22, 70, 117, 0.25);
  color: var(--ata-blue);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
  font-family: inherit;
}

.q-coeff-btn:hover {
  background: var(--ata-blue);
  color: #ffffff;
}

/* ==========================================================================
   模态框系统 (考前核验、试题导入、交卷报告)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  max-width: 680px;
  width: 90%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modal-pop 0.2s ease-out;
}

@keyframes modal-pop {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 16px 24px;
  background: linear-gradient(180deg, #1d5b99 0%, #154677 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  font-size: 16px;
  font-weight: 700;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 20px;
  cursor: pointer;
  opacity: 0.8;
}

.modal-close-btn:hover {
  opacity: 1;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background: #f8fafc;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* 准考证核对卡片样式 */
.ticket-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.ticket-table th,
.ticket-table td {
  border: 1px solid #d9d9d9;
  padding: 10px 14px;
  font-size: 13px;
}

.ticket-table th {
  background: #f0f5ff;
  color: var(--ata-navy);
  font-weight: 700;
  width: 120px;
  text-align: right;
}

.ticket-photo-box {
  width: 110px;
  height: 140px;
  border: 1px dashed #adc6ff;
  border-radius: 4px;
  background: #f0f5ff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #1d39c4;
  margin: 0 auto;
}

.exam-rules-box {
  background: #fffbe6;
  border: 1px solid #ffe58f;
  padding: 14px 18px;
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.6;
  color: #873800;
}

.exam-rules-box ol {
  padding-left: 18px;
  margin-top: 6px;
}

/* 试题导入器面板样式 */
.import-tabs {
  display: flex;
  border-bottom: 1px solid #d9d9d9;
  margin-bottom: 16px;
}

.import-tab-btn {
  padding: 8px 16px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}

.import-tab-btn.active {
  color: var(--ata-blue);
  border-bottom: 2px solid var(--ata-blue);
}

.import-textarea {
  width: 100%;
  height: 220px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  padding: 12px;
  font-family: var(--font-main);
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
}

.import-textarea:focus {
  outline: none;
  border-color: var(--ata-blue);
}

.import-preview-badge {
  display: inline-block;
  background: #f6ffed;
  border: 1px solid #b7eb8f;
  color: #389e0d;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  margin-top: 8px;
}

/* 成绩报告单 (准考证官方风格) */
.report-card {
  text-align: center;
  padding: 10px 0;
}

.report-stamp {
  display: inline-block;
  padding: 8px 24px;
  border: 3px double #52c41a;
  border-radius: 8px;
  color: #52c41a;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 2px;
  margin-bottom: 16px;
  transform: rotate(-3deg);
}

.report-stamp.fail {
  border-color: #f5222d;
  color: #f5222d;
}

.score-display-box {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 20px;
}

.score-num {
  font-size: 56px;
  font-weight: 900;
  color: var(--ata-navy);
  font-family: var(--font-main);
}

.score-unit {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-secondary);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-item {
  background: #f4f6fa;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid #e1e6ed;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.stat-val {
  font-size: 18px;
  font-weight: 700;
  color: var(--ata-navy);
}

/* ==========================================================================
   响应式与移动端全分辨率自适应规范 (Mobile & Responsive Adaptation)
   ========================================================================== */

/* 桌面端默认隐藏的移动端专属控件 */
.mobile-drawer-btn,
.mobile-grid-btn,
.drawer-close-btn,
.drawer-backdrop,
.mobile-submit-btn {
  display: none;
}

/* 抽屉关闭按钮基本样式 */
.drawer-close-btn {
  background: rgba(0, 0, 0, 0.06);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 16px;
  font-weight: bold;
  color: var(--text-secondary);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.drawer-close-btn:hover {
  background: rgba(0, 0, 0, 0.12);
  color: #000;
}

/* 移动端题号指标胶囊按钮 */
.mobile-grid-btn {
  background: #f0f5ff;
  border: 1px solid #adc6ff;
  color: #1d39c4;
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.mobile-grid-btn:active {
  background: #d6e4ff;
  transform: scale(0.96);
}

/* ==========================================================================
   平板与窄屏过渡：屏幕宽度 <= 900px
   ========================================================================== */
@media (max-width: 900px) and (min-width: 769px) {
  .exam-sidebar {
    width: 260px;
    min-width: 260px;
  }
  .q-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ==========================================================================
   移动端断点：屏幕宽度 <= 768px (手机端主流分辨率)
   ========================================================================== */
@media (max-width: 768px) {
  /* 隐藏桌面端多余复杂元素 */
  .desktop-only {
    display: none !important;
  }

  /* 显示移动端专属控件 */
  .mobile-drawer-btn {
    display: inline-flex !important;
    background: #1890ff !important;
    color: #ffffff !important;
    padding: 5px 10px !important;
    font-size: 12px !important;
  }

  .mobile-grid-btn {
    display: inline-flex !important;
  }

  .drawer-close-btn {
    display: flex !important;
  }

  .mobile-submit-btn {
    display: inline-flex !important;
    padding: 6px 12px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
  }

  /* 顶栏响应式紧凑排版 */
  .exam-header {
    height: 52px;
    padding: 0 10px;
    gap: 8px;
  }

  .header-left {
    gap: 6px;
  }

  .exam-title-group h1 {
    font-size: 13px;
    max-width: 130px;
  }

  .header-center {
    gap: 6px;
  }

  .timer-badge {
    padding: 3px 8px;
    font-size: 11px;
    gap: 4px;
  }

  .timer-digits {
    font-size: 15px;
  }

  .header-right {
    gap: 6px;
  }

  .header-paper-select {
    max-width: 115px !important;
    font-size: 11px !important;
    padding: 4px 6px !important;
  }

  /* 主布局流式满宽 */
  body {
    overflow-y: auto !important;
    height: 100%;
    -webkit-overflow-scrolling: touch;
  }

  .exam-layout {
    display: block;
    height: auto;
    min-height: calc(100vh - 52px);
    position: relative;
    padding-bottom: 70px; /* 留出底部常驻操作栏高度 */
  }

  /* 抽屉全屏半透明遮罩 */
  .drawer-backdrop {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
    backdrop-filter: blur(2px);
  }

  .drawer-backdrop.active {
    opacity: 1;
    pointer-events: auto;
  }

  /* 题号方阵重构为底部平滑滑出抽屉 (Bottom Drawer) */
  .exam-sidebar {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    min-width: 100% !important;
    height: 78vh !important;
    max-height: 80vh !important;
    border-radius: 20px 20px 0 0 !important;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.35) !important;
    z-index: 1000 !important;
    transform: translateY(100%) !important;
    transition: transform 0.32s cubic-bezier(0.2, 0.9, 0.3, 1) !important;
    background: #ffffff !important;
    display: flex !important;
    flex-direction: column !important;
    border-right: none !important;
    border-top: 1px solid rgba(0, 0, 0, 0.1) !important;
  }

  .exam-sidebar.open {
    transform: translateY(0) !important;
  }

  .sidebar-header {
    padding: 14px 16px 10px 16px;
    border-bottom: 1px solid #f0f0f0;
  }

  .sidebar-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 14px 24px 14px;
  }

  .q-grid {
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 8px !important;
  }

  .q-grid-btn {
    height: 38px !important;
    font-size: 14px !important;
    border-radius: 6px !important;
  }

  /* 主答题中心 100% 满宽与触控优化 */
  .exam-main {
    padding: 14px 12px;
    width: 100%;
    box-sizing: border-box;
  }

  .q-container {
    padding: 16px 14px;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    margin-bottom: 20px;
  }

  .q-meta-bar {
    margin-bottom: 12px;
    padding-bottom: 10px;
    font-size: 12px;
  }

  .q-stem {
    font-size: 16px !important;
    line-height: 1.65 !important;
    font-weight: 500;
    margin-bottom: 18px !important;
    word-break: break-word;
  }

  .q-options-list {
    gap: 10px;
  }

  .option-item {
    min-height: 48px; /* 满足触摸屏防误触触控标准 */
    padding: 12px 14px;
    font-size: 15px;
    border-radius: 8px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    line-height: 1.45;
  }

  .option-label {
    font-size: 15px;
    min-width: 24px;
    font-weight: 700;
  }

  .option-text {
    font-size: 15px;
    word-break: break-word;
  }

  /* 底部固定考务操作栏 */
  .exam-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #ffffff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
    border-top: 1px solid #e8e8e8;
    z-index: 900;
    padding: 0 8px;
    justify-content: space-between;
    box-sizing: border-box;
  }

  .footer-left {
    min-width: 44px;
  }

  .flag-btn {
    padding: 6px 10px;
    font-size: 12px;
  }

  .footer-center {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .nav-btn {
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
  }

  .footer-right {
    min-width: 44px;
    gap: 0;
  }

  /* 考场计算器移动端 Bottom Sheet 模式 */
  .calc-window {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 20px 20px 0 0 !important;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.45) !important;
    z-index: 1005 !important;
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(0.2, 0.9, 0.3, 1);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
  }

  .calc-window.active {
    transform: translateY(0);
  }

  .calc-header {
    padding: 12px 16px;
    border-radius: 20px 20px 0 0;
    cursor: default !important;
  }

  .calc-tabs {
    padding: 8px 12px;
  }

  .calc-tab-btn {
    padding: 6px 12px;
    font-size: 12px;
  }

  .calc-body {
    padding: 12px 14px 20px 14px;
    overflow-y: auto;
  }

  .calc-key {
    height: 46px !important;
    font-size: 16px !important;
    border-radius: 8px !important;
  }

  /* 官方机考系数表移动端 Bottom Sheet 模式 */
  .coeff-window {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 20px 20px 0 0 !important;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.45) !important;
    z-index: 1006 !important;
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(0.2, 0.9, 0.3, 1);
    max-height: 85vh;
    height: 80vh !important;
    display: flex;
    flex-direction: column;
  }

  .coeff-window.active {
    transform: translateY(0);
  }

  .coeff-header {
    border-radius: 20px 20px 0 0;
    cursor: default !important;
    padding: 12px 16px;
  }

  .coeff-quick-bar {
    padding: 8px 10px;
  }

  .coeff-tabs {
    padding: 4px 6px;
  }

  .coeff-tab-btn {
    padding: 6px 10px;
    font-size: 11px;
  }

  .coeff-rules-grid {
    grid-template-columns: 1fr;
  }

  /* 模态弹窗移动端流式适配 (准考证/导入/成绩单) */
  .modal-overlay {
    padding: 10px;
    align-items: flex-end; /* 手机端贴近底部更容易单手点击 */
  }

  .modal-card {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 16px 16px 0 0 !important;
    max-height: 90vh !important;
    padding: 18px 16px !important;
    box-sizing: border-box;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .modal-header h2 {
    font-size: 15px !important;
  }

  .ticket-table th,
  .ticket-table td {
    padding: 6px 8px !important;
    font-size: 12px !important;
  }

  .ticket-photo-box {
    display: none !important; /* 手机小屏隐藏考场核验大头像，腾出阅读空间 */
  }

  .exam-rules-box {
    padding: 10px 12px !important;
    font-size: 12px !important;
  }

  .modal-footer {
    flex-direction: column-reverse;
    gap: 10px;
    align-items: stretch !important;
  }

  .modal-footer button,
  .modal-footer a {
    width: 100%;
    text-align: center;
    justify-content: center;
    padding: 10px !important;
    font-size: 13px !important;
  }

  /* 成绩单 4 宫格自适应为 2x2 网格 */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
}

/* ==========================================================================
   超窄小屏极限适配：屏幕宽度 <= 400px (如 iPhone SE / 迷你安卓)
   ========================================================================== */
@media (max-width: 400px) {
  .exam-title-group h1 {
    max-width: 100px;
    font-size: 12px;
  }

  .header-paper-select {
    max-width: 90px !important;
    font-size: 10px !important;
  }

  .nav-btn {
    padding: 6px 10px;
    font-size: 12px;
  }

  .mobile-grid-btn {
    padding: 5px 8px;
    font-size: 11px;
  }
}
