:root {
  --bg: #0f1f17;
  --bg2: #142a20;
  --card: #1c3a2c;
  --card-2: #234636;
  --line: #2f5a45;
  --text: #eaf3ec;
  --muted: #9bb5a6;
  --green: #4caf6a;
  --green-d: #2e7d46;
  --red: #e0564f;
  --red-d: #b23a34;
  --amber: #e0a33e;
  --radius: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(120% 80% at 50% 0%, #1a3a2e 0%, var(--bg) 60%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
  line-height: 1.55;
}

.app {
  max-width: 520px; margin: 0 auto;
  padding: 20px 16px 40px; min-height: 100vh;
}

.view { animation: fade .3s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ===== 通用 ===== */
.card {
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin: 14px 0;
}
h1, h2, h3 { margin: 0; font-weight: 700; }
b { color: #fff; }

.btn-primary {
  width: 100%; min-height: 56px; border: none; border-radius: 14px;
  background: linear-gradient(180deg, var(--green), var(--green-d));
  color: #fff; font-size: 18px; font-weight: 700; cursor: pointer;
  box-shadow: 0 6px 18px rgba(46,125,70,.4);
  transition: transform .12s;
}
.btn-primary:active { transform: scale(.97); }

/* ===== 开始页 ===== */
.hero { text-align: center; padding: 24px 0 8px; }
.logo { font-size: 64px; filter: drop-shadow(0 4px 10px rgba(0,0,0,.4)); }
.hero h1 { font-size: 30px; margin-top: 6px; letter-spacing: 1px; }
.tagline { color: var(--muted); margin: 8px 0 0; font-size: 14px; }
.rules ul { margin: 8px 0 0; padding-left: 18px; }
.rules li { margin: 6px 0; font-size: 14px; color: #d6e6dc; }
.best { text-align: center; color: var(--amber); font-size: 15px; margin: 4px 0; }
.warn { text-align: center; color: var(--muted); font-size: 12px; margin-top: 16px; }

/* ===== 答题页 ===== */
.quiz-header {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 14px; color: var(--muted);
}
.streak { color: var(--amber); font-weight: 600; }
.progress-bar {
  height: 6px; background: var(--card); border-radius: 3px; margin: 8px 0 16px; overflow: hidden;
}
.progress-bar-fill {
  height: 100%; width: 0%; background: linear-gradient(90deg, var(--green), var(--amber));
  border-radius: 3px; transition: width .35s ease;
}

.mushroom-figure {
  margin: 0 auto; width: 100%; max-width: 420px;
  aspect-ratio: 1 / 1; border-radius: var(--radius); overflow: hidden;
  background: #000; border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.mushroom-figure img { width: 100%; height: 100%; object-fit: cover; display: block; }

.prompt { text-align: center; margin: 16px 0 10px; font-size: 16px; color: var(--muted); }

/* ── 选项 + 反馈 共用区：grid 同格，互斥显示，无需滚动 ── */
.action-area {
  display: grid;
  grid-template: 1fr / 1fr;
  min-height: 0;
}
.action-area > * {
  grid-area: 1 / 1;
}

.options { display: flex; flex-direction: column; gap: 12px; }
.opt {
  display: flex; align-items: center; gap: 14px;
  min-height: 64px; width: 100%;
  border: 2px solid var(--line); border-radius: 14px;
  background: var(--card); color: var(--text);
  font-size: 18px; font-weight: 700; cursor: pointer;
  padding: 0 20px; transition: all .15s;
}
.opt .opt-emoji { font-size: 26px; }
.opt:active { transform: scale(.98); }
.opt[data-class="A"] { border-color: var(--green-d); background: rgba(46,125,70,.15); }
.opt[data-class="B"] { border-color: var(--red-d); background: rgba(178,58,52,.12); }

.opt.correct {
  background: linear-gradient(180deg, var(--green), var(--green-d));
  border-color: var(--green); color: #fff;
}
.opt.wrong {
  background: linear-gradient(180deg, var(--red), var(--red-d));
  border-color: var(--red); color: #fff;
}
.opt.disabled { opacity: .3; pointer-events: none; filter: grayscale(.6); }
.options.locked .opt { pointer-events: none; }

/* ── 反馈卡片（替代选项显示，同一位置）── */
.feedback { text-align: center; animation: fade .25s ease; }
.feedback-icon { font-size: 40px; }
#fb-title { margin: 6px 0; font-size: 20px; }
.fb-body { color: #d6e6dc; font-size: 14px; margin: 6px 0 10px; }
.fb-ext { text-align: left; margin-top: 10px; }
.detail-row {
  display: grid; grid-template-columns: 52px 1fr; gap: 8px;
  font-size: 13px; margin: 6px 0; color: #d6e6dc;
}
.detail-row b { color: var(--amber); }
.feedback .btn-primary { margin-top: 12px; }

.hint-row { margin-top: 14px; text-align: center; }
.btn-hint {
  background: transparent; border: 1px dashed var(--line); color: var(--amber);
  padding: 8px 18px; border-radius: 20px; font-size: 14px; cursor: pointer;
}
.btn-hint:disabled { color: var(--muted); opacity: .5; cursor: default; }

/* ===== 结果页 ===== */
.result-hero { text-align: center; padding: 20px 0; }
.result-emoji { font-size: 72px; }
#result-title { font-size: 28px; margin-top: 6px; }
.result-score { font-size: 18px; margin: 10px 0 4px; }
.result-desc { color: var(--muted); font-size: 14px; }
.new-best { text-align: center; color: var(--amber); font-weight: 700; border-color: var(--amber); }

/* 错题列表 */
#recap-list { display: flex; flex-direction: column; gap: 12px; }
.recap-item { display: flex; gap: 14px; padding: 14px; align-items: flex-start; }
.recap-item img { width: 100px; height: 100px; object-fit: cover; border-radius: 10px; flex-shrink: 0; }
.recap-info { flex: 1; min-width: 0; }
.recap-name { font-size: 16px; font-weight: 700; }
.recap-lat { color: var(--muted); font-style: italic; font-size: 12px; margin-bottom: 6px; }
.recap-detail { font-size: 13px; color: #d6e6dc; margin: 2px 0; }
.recap-detail b { color: var(--amber); }

.result-actions { margin-top: 16px; }
.result-actions .best { margin-top: 14px; }

@media (min-width: 600px) {
  .app { padding-top: 32px; }
}
