@charset "UTF-8";

/* 【AI博主期中考试】考试页样式 — 学校试卷风(米色纸面 + 红笔批改 + 手写批注)
   视觉规范见 文档/设计文档/UI交互设计规范.md */

:root {
  --ink: #23252b;          /* 印刷黑 */
  --pen: #2b3a67;          /* 蓝黑钢笔 */
  --red: #d43a3a;          /* 红笔 */
  --red-light: #fdeeee;
  --paper: #fffdf6;        /* 米白纸张 */
  --bg: #ece8df;           /* 桌面 */
  --line: #d9d4c7;
  --font-print: "SimSun", "宋体", "Songti SC", serif;
  --font-head: "黑体", "SimHei", "Noto Sans CJK SC", sans-serif;
  --font-hand: "KaiTi", "楷体", "STKaiti", "Kaiti SC", cursive;
}

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

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-print);
  font-size: 16px;
  line-height: 1.9;
  padding: 16px 12px 96px;
}

/* ===== 纸张 ===== */

.paper {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  background: var(--paper);
  padding: 32px 20px 48px;
  box-shadow: 0 6px 24px rgba(60, 50, 30, 0.18);
  border-radius: 3px;
}

/* ===== 试卷头 ===== */

.top-notes {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  color: #777;
}

.top-notes .volume {
  font-size: 16px;
  color: var(--ink);
  font-family: var(--font-head);
  letter-spacing: 4px;
}

.exam-title {
  font-family: var(--font-head);
  font-size: 30px;
  font-weight: bold;
  text-align: center;
  letter-spacing: 4px;
  margin: 14px 0 4px;
}

.student-line {
  display: flex;
  justify-content: center;
  gap: 14px;
  color: var(--pen);
  font-size: 15px;
  margin: 12px 0 4px;
}

.student-line .field {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  position: relative;
  white-space: nowrap;
}

.student-line .blank {
  display: inline-block;
  width: 56px;
  border-bottom: 1px solid var(--pen);
}

.pen-note {
  font-family: var(--font-hand);
  font-style: normal;
  color: var(--red);
  font-size: 14px;
  position: absolute;
  right: -14px;
  top: -16px;
  transform: rotate(-6deg);
  white-space: nowrap;
}

.hand-note {
  font-family: var(--font-hand);
  color: var(--red);
  font-size: 14px;
  transform: rotate(-3deg);
  display: inline-block;
  margin-left: 8px;
}

/* ===== 注意事项 ===== */

.notices {
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  margin: 18px 0 8px;
  padding: 16px 18px;
  position: relative;
}

.notices h2 {
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: bold;
  text-align: center;
  margin-bottom: 6px;
}

.notices ol {
  padding-left: 1.5em;
  font-size: 14px;
  line-height: 1.8;
}

/* ===== 大题区块 ===== */

.exam-section {
  margin-top: 30px;
}

.section-title {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 4px;
}

.section-intro {
  font-size: 14px;
  color: #666;
  margin-bottom: 10px;
}

.question {
  margin: 20px 0;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--line);
}

.question.missing {
  outline: 2px solid var(--red);
  outline-offset: 4px;
}

.stem {
  text-align: justify;
  margin-bottom: 8px;
  white-space: pre-line;
}

.stem .qno {
  font-family: var(--font-head);
  margin-right: 2px;
}

.stem-link {
  color: var(--red);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.q-hint {
  font-size: 13px;
  color: #999;
  margin: 4px 0;
}

/* ===== 选项(蓝黑钢笔色与印刷题干区分;选中 = 红笔圈字母) ===== */

.option {
  display: block;
  width: 100%;
  text-align: left;
  font-family: var(--font-print);
  font-size: 15px;
  line-height: 1.8;
  padding: 10px 6px 10px 1em;
  margin: 2px 0;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--pen);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.option:hover {
  background: rgba(43, 58, 103, 0.05);
}

.option .letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55em;
  height: 1.55em;
  margin-right: 0.25em;
  vertical-align: -0.35em;
  font-family: var(--font-head);
  font-weight: bold;
  color: var(--pen);
}

.option.selected {
  color: var(--red);
}

.option.selected .letter {
  color: var(--red);
  border: 2px solid var(--red);
  border-radius: 48% 52% 55% 45% / 55% 48% 52% 45%;
  transform: rotate(-6deg);
}

/* ===== 填空 / 写作 ===== */

.fill-input {
  width: 100%;
  font-family: var(--font-print);
  font-size: 15px;
  color: var(--pen);
  padding: 8px 4px;
  border: none;
  border-bottom: 1px solid var(--pen);
  background: transparent;
  outline: none;
}

.essay-input {
  width: 100%;
  font-family: var(--font-print);
  font-size: 15px;
  color: var(--pen);
  line-height: 1.9;
  padding: 12px;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  background: repeating-linear-gradient(transparent, transparent 33px, #e8e2d2 34px);
  resize: vertical;
  min-height: 200px;
  outline: none;
}

.fill-input:focus {
  border-bottom-color: var(--red);
}

.essay-input:focus {
  border-color: var(--pen);
}

.essay-counter {
  text-align: right;
  font-size: 13px;
  color: #999;
}

/* ===== 年龄轴 ===== */

.axis-sub {
  margin: 14px 0;
}

.axis-scale {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #999;
  border-top: 1px solid var(--ink);
  padding-top: 4px;
  margin: 8px 0;
}

.axis-slider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
  font-size: 13px;
}

.axis-slider-label {
  color: #666;
  min-width: 4.5em;
}

.axis-slider input[type="range"] {
  flex: 1;
  height: 24px;
  accent-color: var(--red);
  cursor: pointer;
}

.axis-value {
  min-width: 2.2em;
  text-align: right;
  color: var(--pen);
  font-size: 15px;
}

/* ===== 分类题(连线) ===== */

.pool-note {
  font-size: 13px;
  color: #999;
  margin-bottom: 6px;
}

.classify-task {
  margin: 18px 0;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--line);
}

.match-hint {
  font-size: 13px;
  color: #999;
  margin: 8px 0;
}

.match-area {
  position: relative;
  margin-top: 8px;
}

.match-cols {
  display: grid;
  grid-template-columns: 46% 1fr;
  column-gap: 20px;
  align-items: stretch;
}

.match-col-left,
.match-col-right {
  height: 100%;
  justify-content: space-between;
}

.match-col-left {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: stretch;
}

.match-col-right {
  display: flex;
  flex-direction: column;
}

.match-col-left .chip {
  width: 100%;
  text-align: left;
}

.chip {
  display: inline-block;
  font-family: var(--font-print);
  font-size: 14px;
  border: 1.5px solid #a39d8c;
  border-radius: 15px 4px 14px 4px / 4px 14px 4px 15px;
  background: var(--paper);
  color: var(--ink);
  padding: 8px 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.chip.selected {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-light);
}

.chip.matched {
  border-color: var(--pen);
  color: var(--pen);
}

.match-node {
  font-size: 14px;
  line-height: 1.6;
  padding: 13px 8px;
  border-bottom: 1px dashed var(--line);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.match-node:hover {
  background: rgba(43, 58, 103, 0.05);
}

.match-area.has-selection .match-node {
  outline: 1.5px dashed var(--red);
  outline-offset: 2px;
}

.match-lines {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
  z-index: 2;
}

.match-lines path {
  pointer-events: none;
}

/* ===== 交卷(手机端只显示吸底栏,桌面端只显示页内按钮) ===== */

.submit-wrap {
  display: none;
  text-align: center;
  margin-top: 36px;
}

.submit-progress {
  font-size: 14px;
  color: #777;
  margin-bottom: 10px;
}

.submit-note {
  font-size: 13px;
  color: #999;
  margin-top: 10px;
}

.btn-primary {
  font-family: var(--font-head);
  font-size: 17px;
  letter-spacing: 4px;
  color: var(--paper);
  background: var(--red);
  border: none;
  border-radius: 225px 18px 255px 18px / 18px 255px 18px 225px;
  padding: 12px 48px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary:active {
  opacity: 0.85;
}

.btn-ghost {
  font-family: var(--font-head);
  font-size: 15px;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 15px 225px 15px 255px / 255px 15px 225px 15px;
  padding: 10px 20px;
  cursor: pointer;
}

/* ===== 吸底栏 ===== */

.sticky-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--paper);
  border-top: 1.5px dashed #b9b2a2;
  padding: 10px 16px;
  font-size: 14px;
  z-index: 10;
}

.sticky-bar .btn-primary {
  padding: 8px 32px;
  font-size: 15px;
  letter-spacing: 2px;
}

/* ===== 交卷确认弹窗 ===== */

.confirm-mask {
  position: fixed;
  inset: 0;
  background: rgba(35, 37, 43, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  padding: 20px;
}

.confirm-card {
  background: var(--paper);
  max-width: 420px;
  width: 100%;
  padding: 24px 20px;
  border: 1.5px solid var(--ink);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  transform: rotate(-0.6deg);
}

.confirm-text {
  font-size: 15px;
  margin-bottom: 18px;
  white-space: pre-line;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.confirm-actions .btn-primary {
  padding: 10px 24px;
  font-size: 15px;
  letter-spacing: 2px;
}

/* ===== 顶部错误提示 ===== */

.top-error {
  position: sticky;
  top: 0;
  background: var(--red);
  color: var(--paper);
  font-size: 14px;
  padding: 10px 14px;
  margin-bottom: 12px;
  z-index: 5;
}

.dash-rule {
  border: none;
  border-top: 1.5px dashed #b9b2a2;
  margin: 14px 0 0;
}

/* ===== 成绩单(红笔批改风) ===== */

.result-sub {
  text-align: center;
  font-family: var(--font-head);
  font-size: 20px;
  letter-spacing: 8px;
  margin: 6px 0 0;
}

.result-meta {
  margin: 20px 0;
  font-size: 15px;
}

.result-meta .row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 8px 2px;
}

.score-block {
  text-align: center;
  margin: 30px 0 24px;
}

.score-label {
  font-family: var(--font-head);
  font-size: 16px;
  letter-spacing: 4px;
  margin-bottom: 10px;
}

.score-circle {
  display: inline-block;
  padding: 6px 30px;
  border: 3px solid var(--red);
  border-radius: 48% 52% 55% 45% / 55% 48% 52% 45%;
  transform: rotate(-3deg);
}

.score-value {
  font-family: var(--font-head);
  color: var(--red);
  font-size: 72px;
  font-weight: bold;
  line-height: 1.2;
}

.score-comment {
  font-family: var(--font-hand);
  color: var(--red);
  font-size: 17px;
  margin-top: 12px;
  transform: rotate(-1.5deg);
}

.score-disclaimer {
  text-align: center;
  font-size: 13px;
  color: #999;
}

/* ===== 参考答案面板 ===== */

.answer-toggle {
  display: block;
  margin: 20px auto 0;
}

.answer-panel {
  border: 1.5px dashed var(--red);
  padding: 14px 16px;
  margin-top: 16px;
  text-align: left;
  font-size: 14px;
}

.ans-grid {
  font-family: var(--font-head);
  color: var(--red);
  line-height: 1.8;
  margin-bottom: 8px;
}

.ans-note {
  color: #666;
  font-size: 13px;
}

.restart-btn {
  display: block;
  margin: 32px auto 0;
  background: none;
  border: none;
  font-family: var(--font-print);
  font-size: 14px;
  color: #999;
  text-decoration: underline;
  cursor: pointer;
}

/* ===== 桌面端放宽 ===== */

@media (min-width: 768px) {
  body {
    padding: 40px 20px 40px;
  }

  .paper {
    padding: 48px 48px 64px;
  }

  .exam-title {
    font-size: 36px;
    letter-spacing: 8px;
  }

  .chip {
    font-size: 15px;
  }

  .match-node {
    font-size: 15px;
  }

  .sticky-bar {
    display: none;
  }

  .submit-wrap {
    display: block;
  }
}
