:root {
  --paper: #ffffff;
  --bg: #e7eaef;
  --ink: #12161c;
  --ink-2: #4c5563;
  --muted: #6c7686;
  --line: #c9d0d9;
  --line-soft: #e3e7ec;
  --tint: #f7f9fb; /* 提示面底色：随 --bg 一起构成灰阶，不引入第二种色相 */
  --accent: #1747b8;
  --accent-dark: #0f317f;
  --seal: #c0362c;
  --notice: #f2c200;
  --ok: #0f7a52;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", "PingFang SC", "HarmonyOS Sans SC", "Source Han Sans SC", "Noto Sans CJK SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --serif: "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC", "STSong", "SimSun", "Georgia", serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, "Courier New", monospace;
}

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

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  /* 用 margin:auto 而不是 justify-content:center —— 内容超出视口时
     顶部不会被裁掉，长页面的「开始考试」按钮始终够得着 */
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 20px 40px;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* 表单控件保留可选中能力，否则改错字都无法用鼠标定位 */
input,
textarea,
select {
  -webkit-user-select: text;
  user-select: text;
}

/* 考试页整体豁免：作答界面内允许正常选中文字（防作弊限制只作用于场外页面） */
#self-exam-screen,
#self-exam-screen * {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

h2 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-wrap: balance;
}

.screen {
  display: none;
  width: 100%;
  max-width: 560px;
  /* 内容不满屏时垂直居中，超出时顶部不被裁切 */
  margin-top: auto;
  margin-bottom: auto;
}

.screen.active {
  display: block;
  animation: rise 0.18s ease-out;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  background: var(--paper);
  border: 2px solid var(--ink);
  padding: 28px 32px 26px;
  text-align: left;
}

.ticket-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px dashed var(--line);
  margin-bottom: 20px;
}

.ticket-head h2 {
  margin-top: 6px;
}

.stamp {
  flex: none;
  width: 54px;
  height: 54px;
  border: 2px solid var(--seal);
  color: var(--seal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  transform: rotate(-6deg);
}

.subtitle {
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.75;
  margin-bottom: 22px;
}

.input-note {
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--ink-2);
  background: var(--tint);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  padding: 9px 12px;
  margin-bottom: 20px;
}

.field-label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.field-hint {
  font-family: var(--sans);
  font-size: 11.5px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
  margin-left: 8px;
}

.ticket-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--ink);
  background: var(--paper);
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--ink);
  text-transform: uppercase;
}

.ticket-input::placeholder {
  color: #aab2bd;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: none;
}

.ticket-input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: inset 0 0 0 2px var(--accent);
}

.ticket-input.shake {
  animation: shake 0.34s ease;
  border-color: var(--seal);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  50% { transform: translateX(7px); }
  75% { transform: translateX(-4px); }
}

.error-text {
  display: none;
  font-size: 13px;
  line-height: 1.7;
  color: var(--seal);
  margin-top: 10px;
  padding-left: 12px;
  border-left: 3px solid var(--seal);
}

.error-text.show {
  display: block;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

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

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.btn-block {
  width: 100%;
  margin-top: 18px;
}

.btn-secondary {
  background: var(--paper);
  border-color: var(--ink);
  color: var(--ink);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--ink);
  color: var(--paper);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
}

.btn-ghost:hover:not(:disabled) {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.btn-download {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}

.btn-download:hover:not(:disabled) {
  background: #0a5c3d;
  border-color: #0a5c3d;
}

.btn-icon {
  width: 17px;
  height: 17px;
}

.card-foot {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px dashed var(--line);
}

.staff-notice {
  display: inline-block;
  background: #fff6d6;
  border: 2px solid var(--notice);
  border-left-width: 6px;
  border-left-color: var(--seal);
  color: #6a4d00;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 6px 10px;
  margin: 8px 0 10px;
}

.foot-note {
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
  margin: 8px 0 12px;
}

.note-line {
  display: none;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-2);
  margin-top: 10px;
  padding-left: 12px;
  border-left: 3px solid var(--line);
}

.note-line.show {
  display: block;
}

.note-line.ok { border-left-color: var(--ok); color: var(--ok); }
.note-line.err { border-left-color: var(--seal); color: var(--seal); }

.badge {
  width: 44px;
  height: 44px;
  border: 2px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.badge svg {
  width: 22px;
  height: 22px;
}

.badge-warn { background: var(--notice); }
.badge-seal { background: var(--seal); border-color: var(--seal); color: #fff; }

.card h2 + .subtitle {
  margin-top: 10px;
}

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--line);
  border-top-color: var(--ink);
  margin-bottom: 20px;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.info-box {
  border: 2px solid var(--ink);
  border-left-width: 6px;
  padding: 14px 16px;
  margin: 18px 0;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--ink-2);
}

.info-box strong {
  color: var(--ink);
}

.info-box.warning {
  background: #fff6d6;
  border-color: var(--notice);
  border-left-color: var(--seal);
  color: #6a4d00;
}

.info-box.warning strong {
  color: #4a3500;
}

.detail-note {
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
  margin-bottom: 4px;
}

.download-section {
  margin: 22px 0 4px;
}

.download-section h3 {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
}

.download-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.download-options .btn {
  flex: 1 1 150px;
}

.help-text {
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
  margin-top: 12px;
}

.steps {
  margin: 18px 0 0;
  padding-left: 20px;
  font-size: 14px;
  line-height: 2;
  color: var(--ink-2);
}

.steps li::marker {
  font-family: var(--mono);
  color: var(--accent);
}

.contact-box {
  border-top: 1px dashed var(--line);
  padding-top: 16px;
  margin-top: 22px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--muted);
}

.tech-note {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}

.screen-read {
  max-width: 700px;
}

.welcome-h {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin: 4px 0 4px;
  padding-left: 11px;
  border-left: 4px solid var(--accent);
}

.prep-item {
  display: flex;
  gap: 13px;
  padding: 16px 0;
  border-bottom: 1px dashed var(--line);
}

.prep-item:last-of-type {
  border-bottom: 0;
  padding-bottom: 4px;
}

.prep-num {
  flex: none;
  width: 26px;
  height: 26px;
  border: 2px solid var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.prep-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 5px;
}

.prep-desc {
  font-size: 13px;
  line-height: 1.8;
  color: var(--ink-2);
}

.prep-item .download-options {
  margin: 12px 0 0;
}

.prep-item .download-options .btn {
  padding: 9px 18px;
  font-size: 13.5px;
}

.agreement-scroll {
  max-height: 52vh;
  overflow-y: auto;
  border: 2px solid var(--ink);
  padding: 20px 22px;
  background: var(--paper);
}

.agreement-scroll:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.agreement-preamble {
  font-size: 14px;
  line-height: 1.95;
  color: var(--ink-2);
  text-align: justify;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px dashed var(--line);
}

.agreement-article {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin: 20px 0 10px;
  padding-left: 11px;
  border-left: 4px solid var(--accent);
  line-height: 1.5;
}

.agreement-article:first-of-type {
  margin-top: 0;
}

.agreement-item {
  font-size: 13.5px;
  line-height: 1.95;
  color: var(--ink-2);
  text-align: justify;
  margin-bottom: 6px;
}

.agreement-penalty {
  font-size: 13.5px;
  line-height: 1.95;
  color: #8a2b22;
  text-align: justify;
  margin: 10px 0 0;
  padding-left: 12px;
  border-left: 3px solid var(--seal);
}

.agreement-foot {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
}

.agreement-tip {
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
  text-align: center;
  margin-bottom: 12px;
}

.agreement-tip.ready {
  color: var(--ok);
  font-weight: 700;
}

/* 考场内的防作弊提醒条（内置答题界面复用） */
.exam-warning {
  background: var(--notice);
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: center;
  padding: 11px 18px;
  border-bottom: 2px solid var(--ink);
}

.noscript {
  max-width: 560px;
  margin: 0 auto;
  background: #fff6d6;
  border: 2px solid var(--notice);
  border-left-width: 6px;
  border-left-color: var(--seal);
  color: #6a4d00;
  padding: 16px 18px;
  font-size: 14px;
  line-height: 1.75;
}

footer {
  margin-top: 30px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (max-width: 600px) {
  body { padding: 16px 12px 32px; }
  .card { padding: 22px 18px; }
  h2 { font-size: 20px; }
  .stamp { width: 46px; height: 46px; font-size: 13px; }
  .ticket-input { font-size: 20px; padding: 12px 13px; }
  .exam-warning { font-size: 13px; padding: 10px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ============================================================
   考生作答界面（自建试卷）
   —— 沿用卷面语言：白纸、墨线、朱红印章、等宽标签；
      正文字号与行距按"要看清题目"重新定标，卡片放宽到可读宽度。
   ============================================================ */

/* 需要宽松排版的屏（考前须知、试卷、交卷） */
.screen-roomy { max-width: 940px; }

/* ---------- 考前须知 ---------- */
.notice-card { padding: 0; }

.notice-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 30px 20px;
  border-bottom: 2px solid var(--ink);
  background: var(--tint);
}

.notice-head h2 {
  font-size: 27px;
  line-height: 1.32;
  margin-top: 7px;
}

.notice-body { padding: 22px 30px 26px; }

.notice-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(152px, 1fr));
  border: 1px solid var(--line);
  margin-bottom: 22px;
}

.notice-cell {
  padding: 12px 16px;
  border-right: 1px dashed var(--line);
}

.notice-cell:last-child { border-right: 0; }

.notice-k {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.notice-v {
  font-size: 18px;
  font-weight: 700;
  margin-top: 5px;
  font-variant-numeric: tabular-nums;
}

.notice-v small {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  margin-left: 3px;
}

.notice-sec { margin-bottom: 20px; }

.notice-sec-t {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  padding-left: 11px;
  border-left: 4px solid var(--accent);
  margin-bottom: 12px;
}

.notice-tex {
  white-space: pre-wrap;
  font-size: 15px;
  line-height: 2;
  color: var(--ink-2);
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  padding: 16px 18px;
}

.notice-empty { color: var(--muted); }

.notice-rules {
  list-style: none;
  display: grid;
  gap: 9px;
}

.notice-rules li {
  position: relative;
  padding-left: 26px;
  font-size: 14px;
  line-height: 1.85;
  color: var(--ink-2);
}

.notice-rules li::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 11px;
  width: 7px;
  height: 7px;
  background: var(--ink);
  transform: rotate(45deg);
}

.notice-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 2px dashed var(--line);
}

.notice-foot .btn {
  flex: 1 1 280px;
  padding: 16px 26px;
  font-size: 16px;
}

.notice-foot-note {
  flex: 1 1 240px;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--muted);
}

/* ---------- 试卷 ---------- */
.paper-wrap { position: relative; z-index: 1; padding: 0; }

/* 顶部提示条（网络/时间提醒） */
.self-toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2147483000;
  max-width: min(680px, 92vw);
  background: var(--ink);
  color: var(--paper);
  padding: 13px 22px;
  border: 2px solid var(--ink);
  font-family: var(--sans);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.6;
  text-align: center;
  display: none;
}

/* 顶部整块（工具条 + 可展开的答题卡）整体吸顶：
   答题卡展开后固定在试卷顶部，滚动卷面时始终可见 */
.paper-top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
}

/* 顶部工具条：标题 / 进度 / 倒计时 / 答题卡开关 */
.paper-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 22px;
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
}

.paper-bar-main {
  min-width: 0;
  margin-right: auto;
}

.paper-bar h2 {
  font-size: 20px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.paper-progress {
  margin-top: 3px;
  font-family: var(--sans);
  font-size: 12.5px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.paper-progress b {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--accent);
}

/* 倒计时：宽体 + 底部进度条，剩余不足 1/4 转朱红警示 */
.paper-timer {
  position: relative;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 122px;
  padding: 7px 16px 9px;
  border: 2px solid var(--ink);
  background: var(--tint);
  overflow: hidden;
}

.paper-timer-k {
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.paper-timer b {
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.paper-timer-track {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  background: var(--line-soft);
}

.paper-timer-fill {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--accent);
  transition: width 0.9s linear;
}

.paper-timer.is-warn {
  border-color: var(--seal);
  background: #fdf4f3;
  animation: timerPulse 2s ease-in-out infinite;
}

.paper-timer.is-warn b,
.paper-timer.is-warn .paper-timer-k { color: var(--seal); }

.paper-timer.is-warn .paper-timer-fill { background: var(--seal); }

@keyframes timerPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(192, 54, 44, 0); }
  50% { box-shadow: 0 0 0 4px rgba(192, 54, 44, 0.13); }
}

/* ---------- 答题卡 ---------- */
.paper-card-btn {
  flex: none;
  white-space: nowrap;
}

.paper-card-btn.is-on {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.paper-cardpanel {
  display: none;
  padding: 16px 22px 18px;
  border-bottom: 2px solid var(--ink);
  background: var(--tint);
  /* 展开后吸收顶、并限高可滚动：题量再多也不会盖满整屏 */
  max-height: 46vh;
  overflow-y: auto;
  box-shadow: 0 12px 20px -16px rgba(18, 22, 28, 0.6);
}

.paper-cardpanel[hidden] { display: none; }
.paper-cardpanel:not([hidden]) { display: block; }

.paper-cardgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
  gap: 8px;
}

.paper-cardcell {
  position: relative;
  height: 42px;
  border: 2px solid var(--line);
  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}

.paper-cardcell:hover { border-color: var(--ink); color: var(--ink); }

/* 已答：实心墨块 */
.paper-cardcell.is-done {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

/* 未答：右上角朱红角标，交卷前一眼看到漏答 */
.paper-cardcell::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--seal);
  opacity: 1;
}

.paper-cardcell.is-done::after { opacity: 0; }

/* 当前题：朱红描边，与未答角标同一色 */
.paper-cardcell.is-cur {
  border-color: var(--seal);
  box-shadow: inset 0 0 0 1px var(--seal);
  color: var(--seal);
}

.paper-cardcell.is-done.is-cur { background: var(--ink); }

.paper-cardlegend {
  display: flex;
  gap: 18px;
  margin-top: 12px;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}

.paper-cardlegend span { display: inline-flex; align-items: center; gap: 6px; }

.paper-cardlegend i {
  width: 11px;
  height: 11px;
  border: 2px solid var(--line);
  background: var(--paper);
}

.paper-cardlegend .dot-done { border-color: var(--ink); background: var(--ink); }
.paper-cardlegend .dot-todo { position: relative; }
.paper-cardlegend .dot-todo::after {
  content: '';
  position: absolute;
  top: -3px;
  right: -3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--seal);
}

.paper-body { padding: 8px 22px 4px; }

.paper-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 16px 22px 20px;
  border-top: 2px dashed var(--line);
  scroll-margin-top: 100px;
}

.paper-foot .btn {
  padding: 15px 28px;
  font-size: 16px;
  flex: none;
}

.paper-foot-note {
  flex: 1 1 240px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
}

/* ---------- 题末导航 ---------- */
.q-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-soft);
}

.q-nav-btn {
  padding: 8px 16px;
  border: 2px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}

.q-nav-btn:hover {
  border-color: var(--ink);
  background: var(--tint);
  color: var(--ink);
}

.q-nav-btn.is-off {
  border-color: transparent;
  color: #b3bac4;
  cursor: default;
}

.q-nav-btn.is-off:hover {
  border-color: transparent;
  background: transparent;
  color: #b3bac4;
}

.q-nav-pos {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.self-q {
  position: relative;
  padding: 20px 0 18px;
  border-bottom: 1px dashed var(--line);
}

.self-q:last-child { border-bottom: 0; }

/* 当前题：左侧朱红标记，滚动时一眼知道自己在哪 */
.self-q.is-cur::before {
  content: '';
  position: absolute;
  left: -22px;
  top: 18px;
  bottom: 16px;
  width: 3px;
  background: var(--seal);
}

.self-q.is-cur .q-num {
  background: var(--seal);
  border-color: var(--seal);
  color: var(--paper);
}

.q-head {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-wrap: wrap;
  margin-bottom: 13px;
}

.q-num {
  flex: none;
  width: 30px;
  height: 30px;
  border: 2px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
}

.q-kind {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.q-score {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}

.q-stem {
  font-size: 16.5px;
  line-height: 1.9;
  color: var(--ink);
  margin-bottom: 14px;
  word-break: break-word;
  text-wrap: pretty;
}

.q-stem p { margin: 0 0 6px; }
.q-stem ul, .q-stem ol { margin: 0 0 6px 20px; }
.q-stem strong { font-weight: 700; }

/* 数学/代码片段：等宽更易辨认 */
.q-stem code, .q-opt-text code {
  font-family: var(--mono);
  font-size: 0.94em;
  background: var(--tint);
  border: 1px solid var(--line);
  padding: 1px 5px;
}

/* 代码块：整块呈现（左侧墨蓝标线 + 连续块无缝拼接） */
.q-stem pre, .q-opt-text pre {
  margin: 10px 0;
  padding: 11px 14px;
  background: var(--tint);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}

/* 相邻代码块连成一体，中间不留缝 */
.q-stem pre + pre, .q-opt-text pre + pre {
  margin-top: -1px;
  border-top-color: transparent;
}

.q-stem pre code, .q-opt-text pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
}

/* 字体标记（工具栏字体下拉框生成，消毒器保留这些 class） */
.kaiti { font-family: "KaiTi", "STKaiti", "Kaiti SC", "楷体", serif; }
.songti { font-family: "SimSun", "Songti SC", "STSong", "宋体", serif; }
.heiti { font-family: "SimHei", "Heiti SC", "STHeiti", "黑体", sans-serif; }
.fangsong { font-family: "FangSong", "STFangsong", "FangSong SC", "仿宋", serif; }

/* 公式：KaTeX 输出 MathML，浏览器原生渲染 */
.q-stem math, .q-opt-text math { font-size: 1.05em; }

/* 题干中的插图 */
.q-stem img {
  max-width: 100%;
  max-height: 520px;
  height: auto;
  border: 1px solid var(--line);
  margin: 4px 0;
}

.q-opts { display: grid; gap: 8px; }

.q-opt {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 15px;
  border: 1px solid var(--line);
  background: var(--paper);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}

.q-opt:hover { border-color: var(--ink); background: var(--tint); }
.q-opt input { flex: none; width: 18px; height: 18px; margin-top: 3px; accent-color: var(--accent); cursor: pointer; }
.q-opt-body { display: flex; gap: 10px; align-items: flex-start; min-width: 0; flex: 1; }

/* 选项字母：朱红方章，扫读时最容易抓到的一个点 */
.q-opt-lab {
  flex: none;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--line);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.q-opt-text {
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--ink-2);
  word-break: break-word;
  padding-top: 1px;
}

/* 选项中的插图 */
.q-opt-text img {
  max-width: 100%;
  max-height: 420px;
  height: auto;
  border: 1px solid var(--line);
  margin: 4px 0;
}
/* 选中态：整行淡蓝底 + 字母朱红方章实心，整条答案一眼可辨 */
.q-opt input:checked + .q-opt-body .q-opt-lab {
  background: var(--seal);
  border-color: var(--seal);
  color: var(--paper);
}
.q-opt input:checked + .q-opt-body .q-opt-text { color: var(--ink); }
.q-opt:has(input:checked) { border-color: var(--seal); border-width: 2px; background: #fdf6f5; }

.q-inline {
  width: 210px;
  max-width: 100%;
  padding: 10px 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
}

.q-text {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  font-size: 15px;
  line-height: 1.85;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  resize: vertical;
}

.q-inline:focus, .q-text:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px rgba(23, 71, 184, 0.14);
}

.q-seq-show {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 10px;
  min-height: 22px;
}

.q-seq-btns { display: flex; flex-wrap: wrap; gap: 8px; }

.q-seq-btn {
  padding: 8px 13px;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
}

.q-seq-btn:hover { background: var(--ink); color: var(--paper); }
.q-seq-btn img { max-height: 76px; max-width: 100%; height: auto; vertical-align: middle; margin-right: 4px; }

.q-tools { display: flex; gap: 8px; margin-top: 10px; }

.q-tool {
  padding: 6px 12px;
  border: 2px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}

.q-tool:hover { border-color: var(--ink); color: var(--ink); }

/* ---------- 交卷结果（回执式） ---------- */
.finish-card { padding: 0; }

.finish-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 24px 30px 20px;
  border-bottom: 2px solid var(--ink);
  background: var(--tint);
}

.finish-head h2 { margin-top: 6px; }

.finish-seal {
  flex: none;
  width: 54px;
  height: 54px;
  border: 2px solid var(--seal);
  color: var(--seal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  transform: rotate(-8deg);
}

.finish-body { padding: 22px 30px 26px; }

.finish-lead {
  font-size: 16px;
  line-height: 1.85;
  color: var(--ink);
  margin-bottom: 18px;
}

.finish-steps {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.finish-step {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-2);
  padding: 10px 13px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
}

.finish-step-no {
  flex: none;
  width: 22px;
  height: 22px;
  border: 2px solid var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.finish-note {
  font-size: 13.5px;
  line-height: 1.8;
  background: #fff6d6;
  border: 2px solid var(--notice);
  border-left-width: 6px;
  border-left-color: var(--seal);
  color: #6a4d00;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.finish-tail {
  font-size: 13px;
  line-height: 1.75;
  color: var(--muted);
}

/* 考前须知里的重要提醒条：与考场内提醒条同一套语言 */
.notice-warn {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  background: #fff6d6;
  border: 2px solid var(--notice);
  border-left-width: 6px;
  border-left-color: var(--seal);
  color: #6a4d00;
  font-size: 13.5px;
  line-height: 1.8;
  padding: 12px 16px;
  margin-bottom: 22px;
}

.notice-warn b {
  flex: none;
  color: #4a3500;
  font-weight: 700;
}

/* 考试进行中禁止打印 / 另存为 PDF */
@media print {
  body.exam-active #self-exam-screen,
  body.exam-active #self-notice-screen { display: none !important; }

  body.exam-active::after {
    content: '本页面正在考试中，禁止打印或另存为 PDF。';
    display: block;
    font-family: var(--sans);
    font-size: 16px;
    color: #12161c;
    padding: 40px;
  }
}

@media (max-width: 720px) {
  .notice-head { flex-direction: column-reverse; gap: 12px; padding: 20px 18px 16px; }
  .notice-head h2 { font-size: 22px; }
  .notice-body { padding: 18px 18px 22px; }
  .notice-cell { border-right: 0; border-bottom: 1px dashed var(--line); }
  .notice-cell:last-child { border-bottom: 0; }
/* 顶栏改为两行：标题一行，计时 + 答题卡一行 */
  .paper-bar {
    flex-wrap: wrap;
    padding: 11px 14px;
    row-gap: 10px;
  }
  .paper-bar-main { flex: 1 1 100%; }
  .paper-bar h2 { font-size: 17px; white-space: normal; }
  .paper-timer {
    flex: 1 1 auto;
    min-width: 0;
    flex-direction: row;
    justify-content: center;
    gap: 8px;
    padding: 7px 12px 9px;
  }
  .paper-timer b { font-size: 20px; }
  .paper-cardpanel { padding: 13px 14px 15px; }
  .paper-cardgrid { grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 6px; }
  .paper-cardcell { height: 38px; font-size: 13px; }
  .paper-body { padding: 6px 14px 4px; }
  .paper-foot { padding: 14px; }
  .paper-foot .btn { flex: 1 1 100%; }
  .q-stem { font-size: 16px; line-height: 1.85; }
  .q-opt-text { font-size: 15px; }

  /* 当前题的左侧标记在窄屏会顶到边框，改为内缩 */
  .self-q.is-cur::before { left: -14px; }
  .q-nav-btn { padding: 8px 12px; font-size: 13px; }
  .q-nav-pos { font-size: 11.5px; }
}
/* ---------- 考场内自绘右键菜单（复制 / 剪切 / 粘贴 / 全选） ---------- */
.exam-ctx {
  position: fixed;
  z-index: 2147483000;
  min-width: 148px;
  padding: 4px;
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 0 8px 22px -8px rgba(18, 22, 28, 0.55);
  font-family: var(--sans);
  -webkit-user-select: none;
  user-select: none;
}

.exam-ctx-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.exam-ctx-item:hover:not(.is-off) { background: var(--tint); }

.exam-ctx-item.is-off {
  color: #b3bac4;
  font-weight: 500;
  cursor: default;
}

.exam-ctx-key {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.exam-ctx-item.is-off .exam-ctx-key { color: #c6ccd4; }
