/* ============================================================
   古诗闯关 · 同屏成品视觉
   暖橙晨光 / 云山远影 / 奶油诗卷
   ============================================================ */
:root {
  --orange: #FF8A3D;
  --orange-bright: #FFA25C;
  --orange-deep: #F26B17;
  --orange-press: #E45E10;
  --orange-soft: #FFE8D2;
  --orange-pale: #FFF3E3;
  --gold: #E8A63A;
  --ink: #39281B;
  --ink-2: #6F5339;
  --ink-3: #A1856A;
  --paper: #FFFDF8;
  --paper-2: #FFF8EA;
  --paper-3: #FFF2DC;
  --line: #EEDCC0;
  --line-soft: #F4E7D2;
  --green: #43A966;
  --green-deep: #217A45;
  --red: #E5674F;
  --red-deep: #B23A2C;
  --shadow-sm: 0 4px 12px rgba(112, 68, 30, .10);
  --shadow-md: 0 12px 28px rgba(112, 68, 30, .13);
  --shadow-lg: 0 22px 52px rgba(90, 52, 22, .20);
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --serif: "STSong", "Songti SC", "Noto Serif CJK SC", "SimSun", serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html {
  height: 100%;
  background: #F1DFC5;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: var(--sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background:
    radial-gradient(90% 60% at 50% 0%, #FFF2DD 0%, #F2DFC4 70%, #EBD6B9 100%);
}

body.modal-open { overflow: hidden; }

button { font-family: inherit; }
ol, ul { margin: 0; padding: 0; list-style: none; }
img { display: block; }
::selection { background: rgba(255, 138, 61, .22); }

/* ---------- 竖屏舞台 ---------- */
.stage {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 100vh;
  height: 100dvh;
  min-height: 560px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px calc(env(safe-area-inset-bottom, 0px) + 10px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  isolation: isolate;
  background: #FFE9C6;
}

/* 成品底图：晨光、流云、远山（由成品图清理出的纯背景层） */
.scene-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(100% 52% at 50% 0%, rgba(255, 246, 226, .92) 0%, rgba(255, 246, 226, 0) 68%),
    linear-gradient(180deg, #FFE1B3 0%, #FFE8C5 30%, #FFF1DD 62%, #F8E5CA 100%);
  pointer-events: none;
}
.scene-clouds {
  position: absolute;
  top: 12.5%;
  left: -7%;
  width: 114%;
  height: 21%;
  background: url("images/gen/clouds.png") center / cover no-repeat;
  opacity: .5;
  filter: blur(.4px);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 20%, #000 74%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 20%, #000 74%, transparent 100%);
  animation: cloud-breathe 14s ease-in-out infinite alternate;
}
@keyframes cloud-breathe {
  from { transform: translate3d(-5px, 0, 0) scale(1.01); }
  to { transform: translate3d(6px, 4px, 0) scale(1.04); }
}
.scene-ridge {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: auto;
  aspect-ratio: 780 / 200;
  background: url("images/gen/ridge.png") center bottom / 100% 100% no-repeat;
  opacity: .94;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 32%, #000 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 32%, #000 100%);
}
.scene-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 249, 237, .10) 0%, rgba(255, 249, 237, 0) 32%, rgba(255, 244, 224, .06) 72%, rgba(255, 238, 212, .18) 100%),
    radial-gradient(120% 46% at 50% 0%, rgba(255, 255, 255, 0) 54%, rgba(255, 255, 255, .16) 100%);
}

/* ---------- 氛围层：日晕、云、落花 ---------- */
.ambient {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}
.sun-glow {
  position: absolute;
  top: -148px;
  right: -104px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 229, 166, .92) 0%, rgba(255, 207, 128, .46) 38%, rgba(255, 197, 112, 0) 70%);
  animation: sun-breathe 9s ease-in-out infinite alternate;
}
@keyframes sun-breathe {
  from { transform: scale(.96); opacity: .86; }
  to { transform: scale(1.06); opacity: 1; }
}
.cloud {
  position: absolute;
  height: 42px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .58);
  filter: blur(2px);
  opacity: .72;
}
.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: inherit;
}
.cloud::before { width: 58%; height: 170%; left: 8%; bottom: 4%; }
.cloud::after { width: 46%; height: 210%; right: 9%; bottom: 2%; }
.c1 { top: 20%; left: -12%; width: 190px; animation: cloud-drift 26s ease-in-out infinite alternate; }
.c2 { top: 31%; right: -22%; width: 250px; height: 50px; opacity: .5; animation: cloud-drift 32s ease-in-out infinite alternate-reverse; }
.c3 { bottom: 19%; left: -18%; width: 220px; height: 38px; opacity: .42; animation: cloud-drift 38s ease-in-out infinite alternate; }
@keyframes cloud-drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(23px, 7px, 0); }
}
.petal {
  position: absolute;
  width: 11px;
  height: 7px;
  border-radius: 70% 30% 70% 30%;
  background: linear-gradient(135deg, #FFD1B6, #FF9B72);
  opacity: 0;
  animation: petal-fall 14s linear infinite;
}
.p1 { left: 7%; top: -5%; animation-delay: -1.5s; animation-duration: 15s; }
.p2 { left: 27%; top: -7%; animation-delay: -8s; animation-duration: 18s; transform: scale(.8); }
.p3 { left: 61%; top: -6%; animation-delay: -12s; animation-duration: 16s; transform: scale(1.05); }
.p4 { left: 82%; top: -9%; animation-delay: -5s; animation-duration: 20s; transform: scale(.72); }
.p5 { left: 93%; top: -3%; animation-delay: -16s; animation-duration: 17s; transform: scale(.9); }
@keyframes petal-fall {
  0% { transform: translate3d(0, -30px, 0) rotate(0deg); opacity: 0; }
  9% { opacity: .65; }
  55% { transform: translate3d(-26px, 54vh, 0) rotate(220deg); opacity: .55; }
  100% { transform: translate3d(18px, 106vh, 0) rotate(520deg); opacity: 0; }
}

/* ---------- 主布局 ---------- */
.game {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(7px, 1.25vh, 12px);
}
.game.level-in { animation: level-in .38s cubic-bezier(.2, .85, .3, 1); }
@keyframes level-in {
  from { opacity: .25; transform: translateY(9px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 顶部游戏状态 ---------- */
.hud {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.level-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  height: 52px;
  padding: 5px 16px 5px 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 253, 247, .90) 0%, rgba(255, 245, 228, .82) 100%);
  border: 1.5px solid rgba(255, 255, 255, .96);
  box-shadow: 0 8px 18px rgba(126, 78, 34, .13), inset 0 1px 0 #FFF;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.level-seal {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #FFF;
  background: linear-gradient(155deg, #FFB264 0%, #FF8A3D 52%, #F47422 100%);
  box-shadow: 0 3px 0 #DB6317, inset 0 1px 0 rgba(255, 255, 255, .5), 0 5px 12px rgba(228, 105, 28, .22);
}
.level-seal .mp-icon { width: 21px; height: 21px; }
.level-copy { display: flex; flex-direction: column; min-width: 0; line-height: 1.05; }
.level-copy b {
  font-size: 16.5px;
  font-weight: 900;
  letter-spacing: .01em;
  color: #4A311B;
  white-space: nowrap;
}
.level-copy small {
  margin-top: 4px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .12em;
  color: #A47B50;
  white-space: nowrap;
}
.hud-right { flex: none; display: flex; align-items: center; gap: 7px; }
.chip {
  height: 42px;
  min-width: 54px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 253, 247, .90), rgba(255, 247, 233, .82));
  border: 1.5px solid rgba(255, 255, 255, .96);
  box-shadow: 0 6px 14px rgba(126, 78, 34, .11), inset 0 1px 0 #FFF;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-variant-numeric: tabular-nums;
}
.chip .mp-icon { width: 17px; height: 17px; }
.score-chip .mp-icon { color: #FF8A3D; filter: drop-shadow(0 1px 0 #FFF); }
.score-chip b { color: #D9621B; }
.best-chip .mp-icon { color: #E1A02C; }
.best-chip b { color: #8B6526; }
.chip b {
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
  transition: transform .18s cubic-bezier(.2, 1.5, .4, 1);
}
.chip b.pop { transform: scale(1.28); }

/* ---------- 进度 ---------- */
.progress-row {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 4px;
}
.progress-track { flex: 1; display: flex; align-items: center; gap: 5px; }
.seg {
  position: relative;
  flex: 1;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(226, 200, 165, .52);
  box-shadow: inset 0 1px 2px rgba(150, 104, 54, .10), 0 1px 0 rgba(255, 255, 255, .55);
  transition: background .25s ease, box-shadow .25s ease;
}
.seg.done {
  background: linear-gradient(90deg, #FFB266 0%, #FF8A3D 100%);
  box-shadow: 0 2px 4px rgba(244, 112, 28, .22), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.seg.miss {
  background: linear-gradient(90deg, #F6B4A4 0%, #E5674F 100%);
  box-shadow: 0 2px 4px rgba(203, 84, 64, .2), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.seg.current {
  background: linear-gradient(90deg, #FFC48A 0%, #FF8A3D 52%, #F47422 100%);
  box-shadow: 0 2px 6px rgba(244, 112, 28, .32), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.seg.current::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 18%, rgba(255, 255, 255, .55) 46%, transparent 74%);
  transform: translateX(-110%);
  animation: seg-shine 2.2s ease-in-out infinite;
}
@keyframes seg-shine {
  0%, 20% { transform: translateX(-110%); }
  65%, 100% { transform: translateX(110%); }
}
.seg.pulse { animation: seg-pop .42s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes seg-pop {
  0% { transform: scaleY(.66); }
  58% { transform: scaleY(1.12); }
  100% { transform: scaleY(1); }
}
.progress-count {
  flex: none;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .03em;
  color: #A2805C;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ---------- 连对 ---------- */
.combo {
  position: absolute;
  z-index: 8;
  top: calc(env(safe-area-inset-top, 0px) + 110px);
  right: 2px;
  display: flex;
  align-items: center;
  gap: 3px;
  height: 28px;
  padding: 0 11px 0 8px;
  border-radius: 999px;
  color: #FFF;
  background: linear-gradient(180deg, #FFAE62 0%, #FF812F 58%, #F3711F 100%);
  border: 1.5px solid rgba(255, 239, 214, .95);
  box-shadow: 0 3px 0 #D9681B, 0 8px 18px rgba(220, 104, 30, .28);
  text-shadow: 0 1px 0 rgba(170, 66, 6, .25);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(.88);
  transition: opacity .2s ease, transform .24s cubic-bezier(.2, 1.4, .4, 1), visibility .2s;
  pointer-events: none;
}
.combo.show { opacity: 1; visibility: visible; transform: none; }
.combo .mp-icon { width: 14px; height: 14px; color: #FFEDB5; }
.combo b { font-size: 14.5px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.combo span { font-size: 9px; font-weight: 800; letter-spacing: .06em; opacity: .94; }
.combo.bump { animation: combo-bump .34s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes combo-bump {
  0% { transform: scale(.86); }
  58% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* ---------- 诗卷与选项 ---------- */
.board {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(8px, 1.35vh, 12px);
}

.poem-card {
  position: relative;
  flex: 0 0 auto;
  min-height: clamp(200px, 25vh, 232px);
  display: flex;
  flex-direction: column;
  padding: 16px 18px 14px;
  border-radius: 28px;
  overflow: hidden;
  background:
    radial-gradient(rgba(190, 148, 92, .05) 1px, transparent 1.3px),
    radial-gradient(120% 68% at 50% 0%, #FFFFFF 0%, rgba(255, 255, 255, 0) 62%),
    linear-gradient(180deg, #FFFEFB 0%, #FFF9EC 100%);
  background-size: 15px 15px, auto, auto;
  border: 1.5px solid rgba(255, 255, 255, .96);
  box-shadow:
    0 18px 38px rgba(112, 68, 30, .14),
    0 2px 0 #FFF inset,
    0 0 0 1px rgba(229, 201, 164, .30);
}
.poem-card::before {
  content: "";
  position: absolute;
  top: -70px;
  left: 50%;
  width: 300px;
  height: 190px;
  margin-left: -150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 196, 128, .20) 0%, rgba(255, 196, 128, 0) 70%);
  pointer-events: none;
}
.poem-card::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(207, 164, 103, .22);
  border-radius: 20px;
  pointer-events: none;
}
.poem-card.q-in { animation: q-in .36s cubic-bezier(.2, .9, .3, 1); }
@keyframes q-in {
  from { opacity: .32; transform: translateY(7px) scale(.996); }
  to { opacity: 1; transform: none; }
}
.poem-card.q-good { animation: card-good .5s ease; }
@keyframes card-good {
  0% { box-shadow: 0 18px 38px rgba(112, 68, 30, .14), 0 2px 0 #FFF inset, 0 0 0 1px rgba(229, 201, 164, .30); }
  40% { box-shadow: 0 20px 44px rgba(67, 169, 102, .22), 0 2px 0 #FFF inset, 0 0 0 2px rgba(122, 210, 152, .42); }
  100% { box-shadow: 0 18px 38px rgba(112, 68, 30, .14), 0 2px 0 #FFF inset, 0 0 0 1px rgba(229, 201, 164, .30); }
}

.poem-top {
  position: relative;
  z-index: 2;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: none;
  padding: 5px 10px 5px 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, #FFF4E5 0%, #FFE6CC 100%);
  border: 1px solid #FFD4AA;
  color: #B95410;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .05em;
  box-shadow: inset 0 1px 0 #FFF;
}
.tag .mp-icon { width: 13px; height: 13px; }
.source {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 68%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: right;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .02em;
  color: #A18463;
}

.poem {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 2px 2px;
  text-align: center;
  font-size: clamp(26px, 7.5vw, 34px);
  font-weight: 900;
  line-height: 1.44;
  letter-spacing: .035em;
  color: #342319;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .9);
  word-break: break-word;
  overflow: hidden;
}
.poem.is-long { font-size: clamp(21px, 6.1vw, 28px); line-height: 1.4; }
.poem.is-xlong { font-size: clamp(17.5px, 5.1vw, 23px); line-height: 1.36; letter-spacing: .01em; }
.poem-clause {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.poem-blank-line {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  width: 100%;
  max-width: 100%;
  margin-top: .06em;
  line-height: 1.2;
}
.poem-blank-line .tail {
  flex: none;
  padding-bottom: .04em;
  font-size: .9em;
  color: #5D4430;
}
.blank {
  position: relative;
  display: inline-block;
  flex: none;
  width: min(88%, var(--blank-w, 5.2em));
  height: 1.22em;
}
.blank::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: .10em;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, #FFC795 0%, #FF8A3D 50%, #FFC795 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .8), 0 2px 5px rgba(255, 138, 61, .18);
}
.blank::after {
  content: "?";
  position: absolute;
  left: 50%;
  bottom: .02em;
  transform: translateX(-50%);
  font-family: var(--sans);
  font-size: .54em;
  font-weight: 900;
  line-height: 1;
  color: #F19A54;
  text-shadow: 0 1px 0 #FFF;
}

.poem-foot {
  position: relative;
  z-index: 2;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-top: 2px;
}
.foot-line {
  width: 28px;
  height: 1px;
  background: linear-gradient(90deg, rgba(223, 193, 154, 0), rgba(223, 193, 154, .9), rgba(223, 193, 154, 0));
}
.poem-hint {
  flex: 0 1 auto;
  max-width: 190px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  color: #A08361;
}
.poem-seal {
  position: absolute;
  z-index: 2;
  right: 15px;
  bottom: 12px;
  width: 28px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1.5px solid rgba(221, 138, 100, .62);
  border-radius: 6px;
  color: #D37A4F;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  opacity: .82;
  transform: rotate(-5deg);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .5);
  pointer-events: none;
}

/* ---------- 选项 ---------- */
.options {
  position: relative;
  z-index: 2;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: clamp(7px, 1.05vh, 10px);
}
.opt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: clamp(50px, 7.2vh, 62px);
  padding: 6px 15px 6px 8px;
  border: 1.5px solid #F0DFC7;
  border-radius: 18px;
  background: linear-gradient(180deg, #FFFEFB 0%, #FFFAEF 100%);
  box-shadow: 0 6px 14px rgba(112, 68, 30, .09), 0 1px 0 #FFF inset, 0 2px 0 rgba(238, 220, 192, .55);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  opacity: 1;
  animation: opt-in .38s cubic-bezier(.2, .9, .3, 1) backwards;
  transition: transform .12s ease, background .16s ease, box-shadow .16s ease, border-color .16s ease, opacity .2s ease;
  touch-action: manipulation;
}
.opt:nth-child(1) { animation-delay: .02s; }
.opt:nth-child(2) { animation-delay: .06s; }
.opt:nth-child(3) { animation-delay: .10s; }
.opt:nth-child(4) { animation-delay: .14s; }
@keyframes opt-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@media (hover: hover) {
  .opt:not(:disabled):hover {
    border-color: #F5C795;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(160, 100, 40, .13), 0 1px 0 #FFF inset;
  }
}
.opt:active {
  transform: translateY(2px) scale(.995);
  box-shadow: 0 2px 4px rgba(112, 68, 30, .08), 0 1px 0 #FFF inset;
  background: #FFF4E1;
}
.opt:disabled { cursor: default; }
.opt-key {
  flex: none;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #C45A12;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: .01em;
  background: linear-gradient(180deg, #FFF0DE 0%, #FFDDBD 100%);
  border: 1px solid #FFD2A9;
  box-shadow: inset 0 1px 0 #FFF, 0 2px 4px rgba(200, 120, 60, .08);
  transition: background .18s, color .18s, box-shadow .18s;
}
.opt-text {
  flex: 1;
  min-width: 0;
  font-size: clamp(16px, 4.6vw, 18px);
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: .02em;
  color: #3E2B1A;
  overflow-wrap: anywhere;
}
.opt-arrow {
  flex: none;
  width: 17px;
  height: 17px;
  color: #D9C2A2;
  transition: color .18s, transform .18s;
}
.opt:active .opt-arrow { transform: translateX(2px); }
.opt.dim:not(.correct):not(.wrong) { opacity: .34; filter: grayscale(.3); }
.opt.correct {
  border-color: #A5E1B8;
  background: linear-gradient(180deg, #F7FEFA 0%, #EAF9EF 100%);
  box-shadow: 0 5px 14px rgba(67, 169, 102, .16), 0 0 0 1px rgba(90, 190, 120, .16) inset;
  animation: pop-correct .42s ease;
}
.opt.correct .opt-key {
  color: #FFF;
  background: linear-gradient(180deg, #6FCE8D 0%, #43A966 100%);
  border-color: #8CD9A4;
  box-shadow: 0 2px 0 #2E8B4C, inset 0 1px 0 rgba(255, 255, 255, .35);
}
.opt.correct .opt-text { color: #237A45; }
.opt.correct .opt-arrow { color: #43A966; }
.opt.wrong {
  border-color: #F4B7AA;
  background: linear-gradient(180deg, #FFF9F6 0%, #FFEDE7 100%);
  box-shadow: 0 5px 14px rgba(220, 100, 80, .12), 0 0 0 1px rgba(220, 100, 80, .12) inset;
  animation: shake .42s ease;
}
.opt.wrong .opt-key {
  color: #FFF;
  background: linear-gradient(180deg, #F39483 0%, #E36A55 100%);
  border-color: #F3B5A8;
  box-shadow: 0 2px 0 #BC4734, inset 0 1px 0 rgba(255, 255, 255, .32);
}
.opt.wrong .opt-text { color: #B23A2C; }
.opt.wrong .opt-arrow { color: #E36A55; }
@keyframes pop-correct {
  0% { transform: scale(.99); }
  55% { transform: scale(1.012); }
  100% { transform: scale(1); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

/* ---------- 底部提示 ---------- */
.tip {
  flex: none;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  max-width: 100%;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 251, 242, .55);
  border: 1px solid rgba(255, 255, 255, .7);
  box-shadow: 0 4px 10px rgba(90, 55, 20, .05), inset 0 1px 0 rgba(255, 255, 255, .7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 11px;
  line-height: 1.4;
  color: #80674F;
  letter-spacing: .02em;
  text-align: center;
}
.tip .mp-icon { flex: none; width: 14px; height: 14px; color: #DFA23A; }

/* ---------- 答错讲解 ---------- */
.sheet-mask {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(48, 34, 20, .44);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .24s ease, visibility .24s;
}
.sheet-mask.show { opacity: 1; visibility: visible; }

.feedback {
  position: fixed;
  z-index: 21;
  left: 50%;
  bottom: 0;
  width: 100%;
  max-width: 480px;
  transform: translate(-50%, 105%);
  visibility: hidden;
  padding: 10px 20px calc(env(safe-area-inset-bottom, 0px) + 18px);
  border-radius: 30px 30px 0 0;
  background:
    radial-gradient(110% 56% at 50% 0%, #FFFEFA 0%, rgba(255, 254, 250, 0) 66%),
    linear-gradient(180deg, #FFFBF1 0%, #FFF2D9 100%);
  border-top: 2px solid #FFF;
  box-shadow: 0 -22px 54px rgba(55, 36, 18, .32);
  transition: transform .32s cubic-bezier(.2, .9, .3, 1), visibility .32s;
}
.feedback.show { transform: translate(-50%, 0); visibility: visible; }
.sheet-grip {
  display: block;
  width: 42px;
  height: 4px;
  margin: 0 auto 14px;
  border-radius: 999px;
  background: #E6D0AF;
}
.fb-head { display: flex; align-items: center; gap: 11px; }
.fb-badge {
  flex: none;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: #C4550E;
  background: linear-gradient(150deg, #FFEBD7, #FFD6AD);
  border: 1px solid #FFD0A4;
  box-shadow: 0 3px 0 #F3C79C, inset 0 1px 0 #FFF;
}
.fb-badge .mp-icon { width: 23px; height: 23px; }
.fb-copy { min-width: 0; }
.fb-status { font-size: 17.5px; font-weight: 900; color: #B23A2C; letter-spacing: .015em; }
.fb-from { margin-top: 3px; font-size: 12px; color: var(--ink-3); }
.fb-line {
  position: relative;
  margin: 14px 0 12px;
  padding: 14px 15px;
  border-radius: 16px;
  background: #FFFDF7;
  border: 1px dashed #E8D0AA;
  font-size: 21px;
  font-weight: 900;
  line-height: 1.6;
  letter-spacing: .035em;
  color: #3B2A1F;
}
.fb-mean {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, #FFF3E2 0%, #FFEBD2 100%);
  border-left: 4px solid var(--orange);
}
.fb-mean-label {
  flex: none;
  padding-top: 2px;
  font-size: 10.5px;
  font-weight: 900;
  color: #C0560F;
  letter-spacing: .08em;
}
.fb-mean p { margin: 0; font-size: 13.5px; line-height: 1.7; color: #6D5543; }
.feedback .btn { margin-top: 16px; }

/* ---------- 按钮 ---------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  min-height: 54px;
  padding: 8px 16px;
  border: 0;
  border-radius: 18px;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: .04em;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform .1s ease, box-shadow .1s ease, background .15s;
}
.btn .mp-icon { width: 19px; height: 19px; }
.btn-primary {
  color: #FFF;
  background: linear-gradient(180deg, #FFAE64 0%, #FF8534 52%, #F47422 100%);
  box-shadow: 0 5px 0 #DC5F15, 0 13px 24px rgba(243, 113, 31, .30), inset 0 1px 0 rgba(255, 255, 255, .42);
  text-shadow: 0 1px 0 rgba(180, 72, 8, .25);
}
.btn-primary:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #DC5F15, 0 6px 12px rgba(243, 113, 31, .2);
}
.btn-ghost {
  min-height: 48px;
  margin-top: 10px;
  color: #8A6842;
  background: #FFF9EC;
  border: 1.5px solid #EED9BB;
  box-shadow: 0 3px 0 #F1E2CC;
  font-size: 15px;
}
.btn-ghost:active { transform: translateY(2px); box-shadow: 0 1px 0 #F1E2CC; }

/* ---------- 结算 ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(42, 30, 18, .52);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .26s ease, visibility .26s;
}
.overlay.show { opacity: 1; visibility: visible; }
.result {
  position: relative;
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  height: 92vh;
  height: 92dvh;
  max-height: 880px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 20px calc(env(safe-area-inset-bottom, 0px) + 16px);
  border-radius: 30px 30px 0 0;
  background:
    radial-gradient(120% 46% at 50% 0%, rgba(255, 202, 132, .34) 0%, rgba(255, 202, 132, 0) 64%),
    radial-gradient(100% 60% at 50% 100%, #FFFDF7 0%, rgba(255, 253, 247, 0) 70%),
    linear-gradient(180deg, #FFFCF2 0%, #FFF1D3 100%);
  border-top: 2px solid #FFF;
  box-shadow: 0 -22px 62px rgba(40, 28, 16, .38), 0 2px 0 #FFF inset;
  transform: translateY(26px);
  opacity: .6;
  transition: transform .34s cubic-bezier(.2, .9, .3, 1), opacity .28s;
}
.overlay.show .result { transform: none; opacity: 1; }
.result-head { flex: none; text-align: center; }
.medal {
  width: 70px;
  height: 70px;
  margin: 0 auto 10px;
  display: grid;
  place-items: center;
  color: #FFF;
  border-radius: 50%;
  background: linear-gradient(150deg, #FFD36B 0%, #FF9838 55%, #FF7A2E 100%);
  border: 4px solid #FFF;
  box-shadow: 0 12px 26px rgba(255, 138, 61, .40), 0 0 0 5px rgba(255, 199, 122, .28);
  animation: medal-pop .55s cubic-bezier(.2, 1.4, .4, 1) both .08s;
}
.medal .mp-icon { width: 35px; height: 35px; }
@keyframes medal-pop {
  0% { transform: scale(.4) rotate(-14deg); opacity: 0; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.result-title { font-size: 26px; font-weight: 900; letter-spacing: .05em; color: #3B2A1F; }
.result-sub { margin-top: 5px; font-size: 13.5px; line-height: 1.5; color: #8B7461; }
.record-badge {
  display: none;
  width: fit-content;
  margin: 8px auto 0;
  padding: 4px 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, #FFF0C9, #FFE2A0);
  border: 1px solid #F3CE74;
  color: #A96B0B;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .1em;
  box-shadow: 0 2px 0 #E9C46A;
}
.record-badge.show { display: block; animation: badge-in .4s ease both .2s; }
@keyframes badge-in {
  from { transform: scale(.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.result-stars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 9px;
}
.result-stars .mp-icon {
  width: 27px;
  height: 27px;
  color: #E3D0B3;
  opacity: .55;
  filter: grayscale(1);
  transform: scale(.9);
  transition: color .2s, opacity .2s, transform .2s, filter .2s;
}
.result-stars .mp-icon.lit {
  color: #FFB03F;
  opacity: 1;
  filter: drop-shadow(0 3px 6px rgba(255, 152, 46, .35));
  transform: scale(1);
  animation: star-bloom .48s cubic-bezier(.2, 1.5, .4, 1) both;
}
.result-stars .mp-icon.lit:nth-child(2) { animation-delay: .1s; }
.result-stars .mp-icon.lit:nth-child(3) { animation-delay: .2s; }
@keyframes star-bloom {
  0% { transform: scale(.3) rotate(-24deg); opacity: 0; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0 12px;
  flex: none;
}
.stat {
  padding: 10px 8px 9px;
  text-align: center;
  border-radius: 17px;
  background: linear-gradient(180deg, #FFFEFA 0%, #FFF8E9 100%);
  border: 1px solid #F1DEC0;
  box-shadow: 0 3px 0 rgba(242, 223, 199, .7), inset 0 1px 0 #FFF;
}
.stat b {
  display: block;
  font-size: 24px;
  line-height: 1.25;
  color: #E8701F;
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
}
.stat span { font-size: 11.5px; color: #9A836E; letter-spacing: .06em; }

.review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  flex: none;
}
.review-head > span {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13.5px;
  font-weight: 900;
  color: #5E4938;
  letter-spacing: .04em;
}
.review-head .mp-icon { width: 17px; height: 17px; color: var(--orange); }
.review-head em {
  flex: 0 1 auto;
  font-style: normal;
  font-size: 10.5px;
  line-height: 1.4;
  color: #B09A85;
  text-align: right;
}
.review-list {
  flex: 1 1 auto;
  min-height: 96px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -3px;
  padding-right: 2px;
  overscroll-behavior: contain;
}
.rv-item {
  display: flex;
  gap: 10px;
  padding: 8px 6px;
  border-bottom: 1px dashed #EBD8BE;
}
.rv-item:last-child { border-bottom: 0; }
.rv-no {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #F4E6D2;
  color: #A98461;
  font-size: 11px;
  font-weight: 900;
}
.rv-body { min-width: 0; flex: 1; }
.rv-line {
  font-size: 14.5px;
  font-weight: 800;
  line-height: 1.5;
  letter-spacing: .02em;
  color: #3B2A1F;
  word-break: break-word;
}
.rv-source {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: 10.5px;
  color: #A18A76;
}
.rv-tag {
  padding: 1px 5px;
  border-radius: 4px;
  background: #FDE0D9;
  color: #C24A39;
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: .06em;
}
.rv-mean { margin-top: 4px; font-size: 11.5px; line-height: 1.55; color: #8B7360; }
.rv-item.is-wrong {
  margin: 3px 0;
  padding: 8px 9px;
  border: 1px solid #FFD9CF;
  border-radius: 12px;
  background: #FFF7F3;
  border-bottom: 1px solid #FFD9CF;
}
.rv-item.is-wrong .rv-no { background: #FAD3CB; color: #B23A2C; }
.result-actions { flex: none; margin-top: 12px; }

/* ---------- 答对飘分 ---------- */
.toast {
  position: fixed;
  z-index: 25;
  top: calc(env(safe-area-inset-top, 0px) + 118px);
  left: 50%;
  transform: translate(-50%, -12px) scale(.94);
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100vw - 40px);
  padding: 9px 16px;
  border-radius: 999px;
  color: #237A45;
  background: rgba(247, 255, 250, .97);
  border: 1px solid #A9E3BE;
  box-shadow: 0 10px 24px rgba(63, 174, 105, .22);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .02em;
  opacity: 0;
  visibility: hidden;
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.toast .mp-icon { width: 18px; height: 18px; color: var(--green); }
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0) scale(1); }

/* ---------- 结算彩纸 ---------- */
.confetti {
  position: fixed;
  inset: 0;
  z-index: 31;
  overflow: hidden;
  pointer-events: none;
}
.confetti i {
  position: absolute;
  top: -16px;
  width: 8px;
  height: 13px;
  border-radius: 2px;
  opacity: .9;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(105vh) rotate(620deg); opacity: .15; }
}

/* ---------- 小屏适配 ---------- */
@media (max-height: 740px) {
  .stage { padding-top: calc(env(safe-area-inset-top, 0px) + 8px); padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 8px); }
  .level-pill { height: 48px; padding-right: 13px; }
  .level-seal { width: 37px; height: 37px; }
  .level-copy b { font-size: 15.5px; }
  .chip { height: 39px; min-width: 50px; padding: 0 10px; }
  .chip b { font-size: 16px; }
  .poem-card { padding: 14px 16px 12px; border-radius: 26px; }
  .poem { font-size: clamp(24px, 7vw, 31px); }
  .poem.is-long { font-size: clamp(20px, 5.8vw, 26px); }
  .poem.is-xlong { font-size: clamp(17px, 4.9vw, 21px); }
  .opt { min-height: 49px; gap: 10px; padding-right: 13px; border-radius: 16px; }
  .opt-key { width: 33px; height: 33px; border-radius: 11px; font-size: 15px; }
  .opt-text { font-size: clamp(15px, 4.4vw, 17px); }
  .tip { font-size: 10.5px; }
}
@media (max-height: 640px) {
  .stage { min-height: 540px; }
  .game { gap: 6px; }
  .level-pill { height: 44px; }
  .level-seal { width: 34px; height: 34px; }
  .level-seal .mp-icon { width: 18px; height: 18px; }
  .level-copy b { font-size: 14.5px; }
  .level-copy small { margin-top: 2px; }
  .chip { height: 36px; }
  .chip b { font-size: 15px; }
  .progress-row { padding: 0 2px; }
  .poem-card { min-height: 196px; padding: 12px 14px 10px; border-radius: 24px; }
  .poem-card::after { inset: 6px; border-radius: 18px; }
  .poem { font-size: clamp(22px, 6.5vw, 28px); padding-top: 2px; }
  .poem.is-long { font-size: clamp(19px, 5.5vw, 24px); }
  .poem.is-xlong { font-size: clamp(16px, 4.7vw, 20px); }
  .poem-seal { display: none; }
  .poem-foot { padding-top: 0; }
  .poem-hint { font-size: 10px; }
  .opt { min-height: 46px; border-radius: 15px; }
  .opt-key { width: 30px; height: 30px; border-radius: 10px; font-size: 14px; }
  .opt-text { font-size: clamp(14.5px, 4.2vw, 16px); }
  .tip { padding: 4px 10px; font-size: 10px; }
}
@media (max-height: 560px) {
  body { overflow-x: hidden; overflow-y: auto; }
  .stage { height: auto; min-height: 100dvh; overflow: visible; }
  .game, .board { flex: none; }
  .poem-card { min-height: 196px; }
}

@media (max-width: 360px) {
  .stage { padding-left: 12px; padding-right: 12px; }
  .level-pill { padding-right: 11px; }
  .level-copy b { font-size: 14.5px; }
  .level-copy small { font-size: 8.5px; letter-spacing: .06em; }
  .chip { min-width: 46px; padding: 0 8px; }
  .source { max-width: 60%; }
  .opt { gap: 8px; padding-right: 11px; }
  .opt-text { font-size: clamp(14.5px, 4.4vw, 16.5px); }
  .poem-hint { max-width: 150px; }
  .feedback { padding-left: 16px; padding-right: 16px; }
  .result { padding-left: 16px; padding-right: 16px; }
}
@media (min-width: 520px) {
  body { background: #EBD6B8; }
  .stage {
    box-shadow: 0 0 80px rgba(80, 45, 10, .22);
  }
  .stage { padding-left: 22px; padding-right: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .scene-clouds { animation: none; }
  .scene-ridge { opacity: .9; }
}
