/* ============================================================
   国情知识在线答题 — 样式表
   红金主题 | 电脑端适配 | 简约整洁
   ============================================================ */

/* -------------------- CSS 变量 -------------------- */
:root {
  --bg:            #FDFAF5;      /* 暖米白背景 */
  --card-bg:       #FFFFFF;      /* 卡片白色 */
  --red:           #C41E3A;      /* 中国红 */
  --red-dark:      #A01830;      /* 深红 (hover) */
  --red-light:     #FDE8EC;      /* 浅红背景 */
  --gold:          #C8963E;      /* 金色点缀 */
  --gold-light:    #FBF3DB;      /* 浅金背景 */
  --green:         #2E7D32;      /* 正确绿 */
  --green-light:   #EDF7ED;      /* 浅绿背景 */
  --text:          #1A1A1A;      /* 主文字 */
  --text-muted:    #6B6560;      /* 次要文字 */
  --border:        #E8E0D5;      /* 边框色 */
  --radius:        8px;          /* 统一圆角 */
  --shadow:        0 2px 12px rgba(0,0,0,0.06); /* 卡片阴影 */
  --transition:    200ms ease;   /* 统一过渡 */
}

/* -------------------- 全局重置 -------------------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB',
               'Noto Sans SC', -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 20px;

  /* 背景纹理：极淡的金色径向光晕 */
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(200,150,62,0.06) 0%, transparent 70%),
    radial-gradient(ellipse at 50% 100%, rgba(196,30,58,0.03) 0%, transparent 70%);
  background-attachment: fixed;
}

/* -------------------- 主容器 -------------------- */
.container {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
}

/* -------------------- 阶段切换 -------------------- */
.screen {
  transition: opacity 300ms ease;
}
.screen.hidden {
  display: none;
}

/* -------------------- 卡片 -------------------- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 40px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

/* 顶部金色装饰线 */
.card-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--red), var(--gold));
}

/* -------------------- 开始页 -------------------- */
.start-card {
  text-align: center;
  padding-top: 48px;
}

.title {
  font-size: 32px;
  font-weight: 700;
  color: var(--red);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.subtitle {
  font-size: 16px;
  color: var(--gold);
  letter-spacing: 0.12em;
  margin-bottom: 28px;
}

.rules {
  text-align: left;
  background: var(--gold-light);
  border-radius: 6px;
  padding: 16px 24px;
  margin-bottom: 32px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 2;
}
.rules strong {
  color: var(--text);
}

/* -------------------- 按钮 -------------------- */
.btn {
  display: inline-block;
  border: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  padding: 12px 48px;
  border-radius: 6px;
  transition: background-color var(--transition),
              transform var(--transition);
  letter-spacing: 0.05em;
  outline: none;
}
.btn:active {
  transform: scale(0.98);
}

/* 主按钮：红底白字 */
.btn-primary {
  background-color: var(--red);
  color: #FFFFFF;
}
.btn-primary:hover {
  background-color: var(--red-dark);
}

/* 禁用状态 */
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* -------------------- 答题页 -------------------- */
.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding: 0 4px;
}

.progress-text {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

.score-text {
  font-size: 14px;
  color: var(--text-muted);
}
.score-text strong {
  color: var(--red);
  font-size: 18px;
}

/* 进度条 */
.progress-bar {
  width: 100%;
  height: 6px;
  background: #EDE8E0;
  border-radius: 3px;
  margin-bottom: 24px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--red), var(--gold));
  border-radius: 3px;
  transition: width 400ms ease;
  width: 0%;
}

.quiz-card {
  padding: 32px 36px;
}

/* 分类标签 */
.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--gold-light);
  padding: 4px 12px;
  border-radius: 99px;
  margin-bottom: 16px;
}

/* 题目文字 */
.question-text {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 28px;
}

/* -------------------- 选项 -------------------- */
.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border: 2px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color var(--transition),
              background-color var(--transition),
              transform var(--transition);
  user-select: none;
}
.option:hover {
  border-color: var(--gold);
  background-color: #FFFDF8;
}

/* 选项序号标记 */
.option-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #F5F2EC;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: background-color var(--transition),
              color var(--transition);
}

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

/* 选项状态：正确 */
.option.correct {
  border-color: var(--green);
  background-color: var(--green-light);
}
.option.correct .option-marker {
  background: var(--green);
  color: #FFFFFF;
}

/* 选项状态：错误（用户选错的那个） */
.option.wrong {
  border-color: var(--red);
  background-color: var(--red-light);
}
.option.wrong .option-marker {
  background: var(--red);
  color: #FFFFFF;
}

/* 选项状态：展示正确答案（用户选了错的，标出对的） */
.option.show-correct {
  border-color: var(--green);
  background-color: var(--green-light);
}
.option.show-correct .option-marker {
  background: var(--green);
  color: #FFFFFF;
}

/* 已选择后所有选项不可点击 */
.options.disabled .option {
  cursor: default;
  pointer-events: none;
}

/* -------------------- 反馈区 -------------------- */
.feedback {
  margin-top: 24px;
  padding: 16px 20px;
  border-radius: 6px;
  font-size: 15px;
  line-height: 1.6;
}
.feedback.correct-fb {
  background-color: var(--green-light);
  color: var(--green);
}
.feedback.wrong-fb {
  background-color: var(--red-light);
  color: var(--red);
}
.feedback.hidden {
  display: none;
}

.correct-answer {
  margin-top: 8px;
  font-weight: 600;
}
.correct-answer.hidden {
  display: none;
}

/* 下一题按钮居中 */
#btn-next {
  display: block;
  margin: 24px auto 0;
}

/* -------------------- 结果页 -------------------- */
.result-card {
  text-align: center;
  padding-top: 48px;
}

/* 分数圆形展示 */
.score-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  font-weight: 700;
  color: #FFFFFF;
  background: linear-gradient(135deg, var(--red), var(--gold));
  box-shadow: 0 4px 20px rgba(196,30,58,0.25);
}

.score-label {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
  letter-spacing: 0.1em;
}

/* 评价语 */
.evaluation {
  font-size: 22px;
  font-weight: 700;
  color: var(--red);
  margin-bottom: 16px;
}

/* 统计 */
.stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 28px;
  font-size: 15px;
  color: var(--text-muted);
}
.stats strong {
  font-size: 18px;
  color: var(--text);
}

/* 错题回顾 */
.review-section {
  text-align: left;
  margin-bottom: 24px;
}
.review-section.hidden {
  display: none;
}

.review-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--red);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--red-light);
}

.review-list {
  list-style: none;
}

.review-item {
  background: #FAFAF8;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 18px;
  margin-bottom: 10px;
}
.review-item .review-question {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.review-item .review-choice {
  font-size: 13px;
  color: var(--red);
  margin-bottom: 2px;
}
.review-item .review-answer {
  font-size: 13px;
  color: var(--green);
}

/* 重新开始按钮 */
#btn-restart {
  margin-top: 8px;
}

/* -------------------- 响应式微调 -------------------- */
@media (max-width: 520px) {
  body {
    padding: 20px 12px;
  }
  .card {
    padding: 24px 20px;
  }
  .title {
    font-size: 24px;
  }
  .question-text {
    font-size: 16px;
  }
  .option {
    padding: 12px 14px;
  }
}
