/* === 基础重置与变量 === */
:root {
  --primary: #2B5EA7;
  --primary-light: #4A90D9;
  --accent: #F5A623;
  --accent-light: #FFF3E0;
  --bg: #F0F2F5;
  --card-bg: #FFFFFF;
  --text: #1A1A2E;
  --text-light: #5A6377;
  --border: #D6DCE5;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --font-body: 'Noto Sans SC', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-title: 'ZCOOL KuaiLe', 'Noto Sans SC', -apple-system, sans-serif;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  padding: 24px;
  min-height: 100vh;
}

/* === 纸张容器 === */
.paper-wrapper {
  max-width: 840px;
  margin: 0 auto;
}

.paper {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 48px 56px;
  position: relative;
}

.paper::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: var(--radius) var(--radius) 0 0;
}

/* === 卷头 === */
.header {
  text-align: center;
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: 2px dashed var(--border);
}

.header .badge {
  display: inline-block;
  background: var(--accent-light);
  color: #B87D00;
  font-size: 13px;
  font-weight: 600;
  padding: 2px 14px;
  border-radius: 20px;
  margin-bottom: 10px;
  letter-spacing: 1px;
}

.header h1 {
  font-family: var(--font-title);
  font-size: 28px;
  color: var(--primary);
  margin-bottom: 4px;
  letter-spacing: 2px;
}

.header .sub {
  color: var(--text-light);
  font-size: 15px;
}

.header .sub span {
  margin: 0 12px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.info-row .field {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-light);
}

.info-row .field .line {
  display: inline-block;
  width: 100px;
  border-bottom: 1px solid var(--border);
  margin-left: 4px;
}

.info-row .score-summary {
  font-size: 13px;
  color: var(--text-light);
  background: #F7F8FA;
  padding: 4px 14px;
  border-radius: 6px;
}

/* === 题型标题 === */
.section-title {
  font-family: var(--font-title);
  font-size: 18px;
  color: var(--primary);
  margin: 28px 0 16px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--primary-light);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title .score-tag {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  color: #fff;
  background: var(--primary-light);
  padding: 0 12px;
  border-radius: 10px;
  margin-left: auto;
}

/* === 题目样式 === */
.question {
  margin-bottom: 14px;
  padding: 10px 16px;
  border-radius: 8px;
  transition: background 0.2s;
}

.question:hover {
  background: #FAFBFC;
}

.question .q-num {
  font-weight: 700;
  color: var(--primary);
  margin-right: 4px;
}

/* 填空题 —— 下划线留空 */
.fill-blank {
  display: inline-block;
  width: 80px;
  border-bottom: 2px solid var(--primary-light);
  margin: 0 4px;
  text-align: center;
}

.fill-blank-lg {
  width: 120px;
}

/* 选择/判断 选项列表 */
.options {
  margin-top: 6px;
  padding-left: 24px;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.options li {
  font-size: 14px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: default;
  transition: all 0.15s;
}

.options li:hover {
  border-color: var(--primary-light);
  background: #F0F5FF;
}

.options li .label {
  font-weight: 600;
  color: var(--primary);
  margin-right: 4px;
}

/* === 计算题（竖式/脱式） === */
.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 24px;
}

.calc-item {
  padding: 8px 0;
  font-size: 15px;
  font-family: 'Courier New', monospace;
  letter-spacing: 1px;
}

/* === 应用题 === */
.problem-text {
  margin-bottom: 8px;
  line-height: 1.8;
}

.answer-area {
  height: 48px;
  margin: 6px 0 0 20px;
  border-bottom: 1px dashed var(--border);
}

/* === 附加题 === */
.bonus {
  background: linear-gradient(135deg, #FFFDF5, #FFF8E1);
  border: 1px solid #FFE082;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-top: 20px;
}

.bonus .section-title {
  color: #B87D00;
  border-bottom-color: #FFE082;
}

.bonus .section-title .score-tag {
  background: #F5A623;
}

/* === 答案区域 === */
.answer-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 2px dashed var(--border);
}

.answer-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 28px;
  font-size: 15px;
  font-family: var(--font-body);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.answer-toggle:hover {
  background: #1E4A8A;
}

.answer-toggle:active {
  transform: scale(0.97);
}

.answer-toggle .icon {
  font-size: 18px;
  transition: transform 0.3s;
}

.answer-toggle.show .icon {
  transform: rotate(90deg);
}

.answer-content {
  display: none;
  margin-top: 20px;
  padding: 20px 24px;
  background: #F8F9FE;
  border-radius: var(--radius);
  border: 1px solid #E8ECF4;
}

.answer-content.visible {
  display: block;
  animation: fadeIn 0.3s ease;
}

.answer-content .ans-group {
  margin-bottom: 16px;
}

.answer-content .ans-group:last-child {
  margin-bottom: 0;
}

.answer-content .ans-group h4 {
  font-size: 14px;
  color: var(--primary);
  margin-bottom: 6px;
}

.answer-content .ans-group p {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.8;
}

/* === 打印样式 === */
@media print {
  body {
    background: #fff;
    padding: 0;
  }
  .paper-wrapper { max-width: 100%; }
  .paper {
    box-shadow: none;
    border-radius: 0;
    padding: 40px 48px;
  }
  .paper::before { display: none; }
  .question:hover { background: none; }
  .answer-toggle { display: none; }
  .answer-content { display: none !important; }
}

/* === 移动端适配 === */
@media (max-width: 640px) {
  body { padding: 12px; }
  .paper { padding: 24px 20px; }
  .header h1 { font-size: 22px; }
  .info-row { flex-direction: column; align-items: flex-start; }
  .calc-grid { grid-template-columns: 1fr; }
  .options { gap: 6px 10px; }
  .options li { font-size: 13px; padding: 3px 8px; }
}

/* === 动画 === */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
