/* 《童话奇妙闯关》马卡龙梦幻童趣主题 · 专为平板触控大屏深度优化 */
:root {
  --sky-top: #d9f3ff;
  --sky-mid: #f4e6ff;
  --sky-bottom: #ffe6f1;

  --macaron-pink: #ff8fb8;
  --macaron-pink-deep: #f06292;
  --macaron-pink-soft: #ffe5f0;

  --macaron-blue: #7acbff;
  --macaron-blue-deep: #3ea8f4;
  --macaron-blue-soft: #e4f6ff;

  --macaron-yellow: #ffd966;
  --macaron-yellow-deep: #f6b324;
  --macaron-yellow-soft: #fff7d6;

  --macaron-mint: #6be2b6;
  --macaron-mint-deep: #24b883;
  --macaron-mint-soft: #e0fbf0;

  --macaron-lavender: #c29dff;
  --macaron-lavender-deep: #8b5cf6;
  --macaron-lavender-soft: #f2ebff;

  --macaron-peach: #ffad87;
  --macaron-peach-deep: #f97352;
  --macaron-peach-soft: #ffede5;

  --cream-card: rgba(255, 253, 249, 0.94);
  --text-dark: #4a355d;
  --text-mid: #6e5885;
  --text-light: #8e7aa3;

  --shadow-card: 0 18px 42px rgba(154, 114, 198, 0.18), 0 4px 12px rgba(255, 166, 201, 0.15);
  --shadow-btn: 0 8px 0;
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei Rounded", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  color: var(--text-dark);
  background: linear-gradient(160deg, var(--sky-top) 0%, var(--sky-mid) 52%, var(--sky-bottom) 100%);
  touch-action: manipulation;
}

/* ==================== 梦幻天空飘浮装饰层 ==================== */
.dream-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.soft-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(55px);
  opacity: 0.55;
  animation: pulseGlow 8s ease-in-out infinite alternate;
}
.glow-1 { width: 420px; height: 420px; background: #ffd2e6; top: -120px; left: -100px; }
.glow-2 { width: 460px; height: 460px; background: #c2eeff; bottom: -140px; right: -100px; animation-delay: -3s; }
.glow-3 { width: 320px; height: 320px; background: #fff0b3; top: 38%; left: 42%; opacity: 0.35; animation-delay: -5s; }

@keyframes pulseGlow {
  0% { transform: scale(1) translate(0, 0); }
  100% { transform: scale(1.12) translate(18px, -14px); }
}

.cloud-svg {
  position: absolute;
  opacity: 0.78;
  filter: drop-shadow(0 8px 18px rgba(176, 152, 214, 0.18));
  animation: driftCloud linear infinite;
}
.cloud-a { top: 6%; left: -180px; width: 170px; animation-duration: 54s; }
.cloud-b { top: 22%; left: -240px; width: 220px; animation-duration: 72s; animation-delay: -22s; opacity: 0.65; }
.cloud-c { bottom: 10%; left: -200px; width: 190px; animation-duration: 62s; animation-delay: -38s; opacity: 0.72; }

@keyframes driftCloud {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(100vw + 420px)); }
}

.twinkle-star {
  position: absolute;
  font-size: 24px;
  animation: starTwinkle 2.8s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(255, 217, 102, 0.75));
}
.s1 { top: 9%; left: 12%; font-size: 26px; animation-delay: 0s; }
.s2 { top: 15%; right: 14%; font-size: 22px; animation-delay: 0.7s; }
.s3 { top: 48%; left: 4%; font-size: 20px; animation-delay: 1.4s; }
.s4 { top: 58%; right: 5%; font-size: 28px; animation-delay: 0.4s; }
.s5 { bottom: 12%; left: 16%; font-size: 22px; animation-delay: 1.8s; }
.s6 { bottom: 16%; right: 18%; font-size: 24px; animation-delay: 1.1s; }

@keyframes starTwinkle {
  0%, 100% { transform: scale(0.88) rotate(-8deg); opacity: 0.55; }
  50% { transform: scale(1.18) rotate(10deg); opacity: 1; }
}

.floating-fairy {
  position: absolute;
  top: 13%;
  right: 7%;
  width: 78px;
  height: 78px;
  animation: fairyFloat 4.2s ease-in-out infinite;
  filter: drop-shadow(0 8px 16px rgba(240, 98, 146, 0.25));
}

@keyframes fairyFloat {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-16px) rotate(6deg); }
}

/* ==================== 页面切换容器 ==================== */
.app-shell {
  position: relative;
  z-index: 1;
  width: 100vw;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 28px;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.97);
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.screen.active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

/* ==================== 1. 欢迎首页（平板酷炫童趣开场） ==================== */
.welcome-screen {
  padding: 22px 32px;
}

.welcome-card {
  position: relative;
  width: min(980px, 95vw);
  height: min(670px, 90dvh);
  border-radius: 40px;
  overflow: hidden;
  border: 6px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 24px 60px rgba(139, 92, 246, 0.22), 0 8px 24px rgba(255, 143, 184, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 30px 40px 34px;
  background: linear-gradient(180deg, #dff4ff 0%, #ffeaf4 100%);
}

.welcome-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
  transform: scale(1.02);
  animation: gentleZoom 16s ease-in-out infinite alternate;
}

@keyframes gentleZoom {
  0% { transform: scale(1.01); }
  100% { transform: scale(1.06); }
}

.welcome-bg-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(255, 252, 255, 0.72) 0%,
    rgba(255, 250, 253, 0.34) 44%,
    rgba(255, 248, 252, 0.84) 100%
  );
  z-index: 1;
}

.welcome-top,
.welcome-middle,
.welcome-bottom {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.book-ribbon {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  background: rgba(255, 255, 255, 0.9);
  border: 2.5px solid #ffd5e8;
  border-radius: 999px;
  padding: 8px 22px;
  box-shadow: 0 8px 20px rgba(240, 98, 146, 0.14);
  margin-bottom: 14px;
}

.book-pill {
  font-size: 17px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 999px;
}
.book-pill.ats { background: #e3f5ff; color: #1976b5; }
.book-pill.gl { background: #ffe4f0; color: #c73c76; }
.book-pill.dcr { background: #fff3c7; color: #b77700; }

.hero-title-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.hero-title {
  font-size: clamp(46px, 6.2vw, 72px);
  font-weight: 900;
  letter-spacing: 5px;
  color: #fff;
  text-shadow:
    0 4px 0 #ff7eb3,
    0 8px 0 #d95a94,
    0 14px 26px rgba(154, 72, 136, 0.34),
    -3px -3px 0 #ff8fb8,
    3px -3px 0 #ff8fb8,
    -3px 3px 0 #ff8fb8,
    3px 3px 0 #ff8fb8;
  line-height: 1.15;
  animation: titleBob 3.2s ease-in-out infinite;
}

@keyframes titleBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

.hero-subtitle {
  margin-top: 12px;
  font-size: 21px;
  font-weight: 800;
  color: #5c3f7a;
  background: rgba(255, 255, 255, 0.88);
  padding: 7px 24px;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(139, 92, 246, 0.12);
}

/* 中间可爱小角色预览气泡 */
.mini-cast {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 8px 0;
}

.cast-bubble {
  width: 96px;
  height: 96px;
  border-radius: 28px;
  border: 4px solid #ffffff;
  overflow: hidden;
  background: #fffdf9;
  box-shadow: 0 12px 24px rgba(122, 92, 168, 0.22);
  transition: transform 0.25s ease;
  animation: bubbleFloat 3.6s ease-in-out infinite;
}
.cast-bubble:nth-child(2) { animation-delay: 0.45s; transform: translateY(-8px); }
.cast-bubble:nth-child(3) { animation-delay: 0.9s; }
.cast-bubble:nth-child(4) { animation-delay: 1.35s; }
.cast-bubble img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@keyframes bubbleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}

.rules-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-bottom: 22px;
}

.rule-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.93);
  border: 2.5px solid #e6d7ff;
  font-size: 18px;
  font-weight: 800;
  color: #5a4078;
  box-shadow: 0 6px 14px rgba(139, 92, 246, 0.12);
}

.start-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 20px 64px;
  border-radius: 999px;
  border: 4px solid #fff;
  background: linear-gradient(135deg, #ff85b3 0%, #ff6da3 50%, #ffb347 100%);
  color: #fff;
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 4px;
  cursor: pointer;
  box-shadow: 0 9px 0 #d94c84, 0 18px 34px rgba(240, 98, 146, 0.42);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
  animation: btnPulse 2.2s ease-in-out infinite;
}

.start-btn:hover {
  transform: translateY(-2px) scale(1.03);
}

.start-btn:active {
  transform: translateY(6px) scale(0.98);
  box-shadow: 0 3px 0 #d94c84, 0 8px 16px rgba(240, 98, 146, 0.32);
}

@keyframes btnPulse {
  0%, 100% { box-shadow: 0 9px 0 #d94c84, 0 16px 32px rgba(240, 98, 146, 0.4); }
  50% { box-shadow: 0 9px 0 #d94c84, 0 22px 44px rgba(255, 179, 71, 0.58); }
}

/* ==================== 2. 答题页（平板一屏完美适配，无滚动） ==================== */
.quiz-screen {
  justify-content: flex-start;
  padding: 16px 26px 18px;
  gap: 14px;
}

.quiz-header {
  width: min(1040px, 96vw);
  background: var(--cream-card);
  border: 3px solid #ffffff;
  border-radius: 26px;
  padding: 12px 20px;
  box-shadow: 0 10px 26px rgba(154, 114, 198, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  border: 2.5px solid #e9ddff;
  background: #faf6ff;
  color: #5b417a;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.18s ease;
}

.mini-btn:active {
  transform: scale(0.94);
}

.mini-btn.active-on {
  background: #e1fbf0;
  border-color: #7ee3bd;
  color: #147e58;
}

.progress-center {
  flex: 1;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 16px;
  font-weight: 800;
  color: #674b87;
  white-space: nowrap;
}

.progress-meta span {
  white-space: nowrap;
}

.progress-track {
  position: relative;
  width: 100%;
  height: 18px;
  border-radius: 999px;
  background: #f1e8ff;
  border: 2px solid #e4d4ff;
  overflow: visible;
}

.progress-fill {
  height: 100%;
  width: 5%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff99c8 0%, #ffd966 50%, #7ee3bd 100%);
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
}

.progress-star {
  position: absolute;
  right: -12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
  filter: drop-shadow(0 2px 6px rgba(246, 179, 36, 0.6));
}

.score-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff5c4, #ffe285);
  border: 2.5px solid #ffd04f;
  color: #9e5f00;
  font-size: 20px;
  font-weight: 900;
  box-shadow: 0 4px 10px rgba(246, 179, 36, 0.22);
}

/* 答题主卡片 */
.quiz-stage {
  width: min(1040px, 96vw);
  flex: 1;
  min-height: 0;
  background: var(--cream-card);
  border: 4px solid #ffffff;
  border-radius: 36px;
  box-shadow: var(--shadow-card);
  padding: 22px 30px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.question-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.book-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 18px;
  font-weight: 900;
}
.book-tag.ats { background: var(--macaron-blue-soft); color: #1976b5; border: 2px solid #b5e3ff; }
.book-tag.gl { background: var(--macaron-pink-soft); color: #c73c76; border: 2px solid #ffc0dc; }
.book-tag.dcr { background: var(--macaron-yellow-soft); color: #b57300; border: 2px solid #ffe08a; }

.speak-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  border-radius: 999px;
  border: 2.5px solid #bfe6ff;
  background: linear-gradient(135deg, #eef9ff, #d9f1ff);
  color: #1c78b8;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 0 #9bd4f8;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.speak-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #9bd4f8;
}

.speak-btn.speaking {
  background: linear-gradient(135deg, #fff4c2, #ffe082);
  border-color: #f6b324;
  color: #9b5b00;
  box-shadow: 0 4px 0 #e6a219;
}

/* 题目内容区 */
.question-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  flex-shrink: 0;
  margin-bottom: 14px;
}

.question-prompt-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  max-width: 920px;
}

.question-emoji-badge {
  width: 76px;
  height: 76px;
  border-radius: 24px;
  background: linear-gradient(135deg, #fff5d6, #ffe4f0);
  border: 3px solid #fff;
  box-shadow: 0 8px 18px rgba(240, 98, 146, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  flex-shrink: 0;
  animation: gentleBounce 2.6s ease-in-out infinite;
}

@keyframes gentleBounce {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-6px) rotate(3deg); }
}

.question-text {
  font-size: clamp(26px, 3vw, 35px);
  font-weight: 900;
  color: #462f5c;
  line-height: 1.38;
  letter-spacing: 0.5px;
}

/* 看图猜故事：题干大图 */
.question-hero-frame {
  width: 220px;
  height: 220px;
  border-radius: 30px;
  border: 5px solid #ffffff;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 14px 30px rgba(139, 92, 246, 0.2);
  flex-shrink: 0;
}

.question-hero-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 题型：横排图配文（看图猜故事在横屏平板上更舒展） */
.question-body.has-hero-img {
  flex-direction: row;
  text-align: left;
  gap: 28px;
  padding: 4px 12px;
}

/* ==================== 选项区 ==================== */
.options-grid {
  width: 100%;
  flex: 1;
  min-height: 0;
  display: grid;
  gap: 20px;
  align-items: stretch;
}

/* 1) 三张大图片选项（横排三列） */
.options-grid.mode-image-options {
  grid-template-columns: repeat(3, 1fr);
}

.option-card {
  position: relative;
  border-radius: 28px;
  border: 4px solid #ede2ff;
  background: #ffffff;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.2s ease, background 0.2s ease;
  box-shadow: 0 8px 0 #e2d2ff, 0 12px 24px rgba(139, 92, 246, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 14px;
}

.option-card:nth-child(1) { border-color: #ffc5df; box-shadow: 0 8px 0 #f7a6ca, 0 12px 24px rgba(240, 98, 146, 0.14); }
.option-card:nth-child(2) { border-color: #b7e4ff; box-shadow: 0 8px 0 #8fd0fb, 0 12px 24px rgba(62, 168, 244, 0.14); }
.option-card:nth-child(3) { border-color: #ffe094; box-shadow: 0 8px 0 #f5ca64, 0 12px 24px rgba(246, 179, 36, 0.16); }

.option-card:not(.disabled):active {
  transform: translateY(5px);
}

/* 识图选项卡片结构 */
.option-card.is-img-card {
  flex-direction: column;
  padding: 12px 12px 14px;
  gap: 10px;
}

.img-option-wrap {
  width: 100%;
  flex: 1;
  min-height: 0;
  aspect-ratio: 1 / 1;
  max-height: 255px;
  border-radius: 22px;
  overflow: hidden;
  background: #fdf8ff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-option-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.option-letter-badge {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 900;
  color: #fff;
  flex-shrink: 0;
}

.option-card:nth-child(1) .option-letter-badge { background: linear-gradient(135deg, #ff8eb8, #f06292); }
.option-card:nth-child(2) .option-letter-badge { background: linear-gradient(135deg, #6cc4ff, #369ef0); }
.option-card:nth-child(3) .option-letter-badge { background: linear-gradient(135deg, #ffd257, #f5a623); }

.img-card-footer {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.img-reveal-name {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 4;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  border: 2.5px solid #e6d7ff;
  font-size: 18px;
  font-weight: 900;
  color: #553b70;
  box-shadow: 0 4px 12px rgba(90, 64, 120, 0.16);
  opacity: 0;
  transform: scale(0.85);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.option-card.revealed .img-reveal-name {
  opacity: 1;
  transform: scale(1);
}

/* 2) 文字+大表情选项（大按钮三行或宽卡） */
.options-grid.mode-text-options {
  grid-template-columns: 1fr;
  gap: 16px;
}

.option-card.is-text-card {
  justify-content: flex-start;
  padding: 16px 26px;
  gap: 20px;
  min-height: 82px;
}

.option-emoji {
  font-size: 40px;
  flex-shrink: 0;
}

.option-label {
  font-size: clamp(24px, 2.7vw, 31px);
  font-weight: 900;
  color: #4a355d;
  text-align: left;
  line-height: 1.25;
}

/* 选中状态反馈 */
.option-card.disabled {
  pointer-events: none;
}

.option-card.is-correct {
  background: linear-gradient(135deg, #e2fcf1, #c6f7e2) !important;
  border-color: #26c289 !important;
  box-shadow: 0 8px 0 #1ea674, 0 14px 30px rgba(38, 194, 137, 0.34) !important;
  animation: correctPop 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.option-card.is-wrong {
  background: linear-gradient(135deg, #fff0ea, #ffdcd0) !important;
  border-color: #ff8a6b !important;
  box-shadow: 0 6px 0 #e96c4d !important;
  animation: gentleShake 0.42s ease;
}

.option-card.is-dimmed {
  opacity: 0.56;
  transform: scale(0.97);
}

.status-stamp {
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 34px;
  animation: stampIn 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes correctPop {
  0% { transform: scale(1); }
  45% { transform: scale(1.045); }
  100% { transform: scale(1); }
}

@keyframes gentleShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  50% { transform: translateX(8px); }
  75% { transform: translateX(-5px); }
}

@keyframes stampIn {
  0% { transform: scale(0) rotate(-25deg); opacity: 0; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

/* 底部即时反馈条（答对鼓励 / 答错提示与解析） */
.feedback-banner {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 18px;
  z-index: 20;
  border-radius: 26px;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 4px solid #fff;
  box-shadow: 0 16px 36px rgba(90, 64, 120, 0.24);
  transform: translateY(130%);
  opacity: 0;
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
  pointer-events: none;
}

.feedback-banner.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.feedback-banner.correct {
  background: linear-gradient(135deg, #d8fced 0%, #b5f5dc 100%);
  color: #0f6e4c;
}

.feedback-banner.wrong {
  background: linear-gradient(135deg, #fff1e6 0%, #ffe0d2 100%);
  color: #9e3d21;
}

.feedback-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.feedback-icon {
  font-size: 44px;
  flex-shrink: 0;
  animation: iconJump 0.6s ease infinite alternate;
}

@keyframes iconJump {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-5px) scale(1.08); }
}

.feedback-title {
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 3px;
}

.feedback-desc {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
}

.next-now-btn {
  padding: 12px 24px;
  border-radius: 999px;
  border: 3px solid #fff;
  background: rgba(255, 255, 255, 0.9);
  color: #5b3d7d;
  font-size: 19px;
  font-weight: 900;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 5px 12px rgba(91, 61, 125, 0.16);
}

.next-now-btn:active {
  transform: scale(0.95);
}

/* ==================== 3. 闯关结束页 ==================== */
.result-card {
  width: min(860px, 94vw);
  max-height: 92dvh;
  background: var(--cream-card);
  border: 5px solid #ffffff;
  border-radius: 38px;
  padding: 22px 36px 26px;
  box-shadow: 0 24px 54px rgba(139, 92, 246, 0.22);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 11px;
  position: relative;
  overflow: hidden;
}

.result-crown {
  font-size: 54px;
  line-height: 1;
  animation: titleBob 2.4s ease-in-out infinite;
  filter: drop-shadow(0 8px 16px rgba(246, 179, 36, 0.4));
}

.result-medal-badge {
  display: inline-block;
  padding: 7px 24px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffe285, #ffc357);
  color: #8c4d00;
  font-size: 22px;
  font-weight: 900;
  border: 3px solid #fff;
  box-shadow: 0 6px 16px rgba(246, 179, 36, 0.28);
}

.result-stars-row {
  display: flex;
  gap: 10px;
  font-size: 38px;
}

.result-star {
  opacity: 0.25;
  transform: scale(0.85);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease;
}

.result-star.lit {
  opacity: 1;
  transform: scale(1.1);
  filter: drop-shadow(0 4px 12px rgba(255, 193, 7, 0.6));
}

.result-score-box {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
}

.result-score-num {
  font-size: 72px;
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, #ff6fa5, #ff9f43);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.result-score-unit {
  font-size: 26px;
  font-weight: 900;
  color: #7c5c9c;
}

.result-sub-stat {
  font-size: 19px;
  font-weight: 800;
  color: #6b5285;
}

.result-comment {
  max-width: 680px;
  padding: 13px 22px;
  border-radius: 22px;
  background: linear-gradient(135deg, #f8f2ff, #fff0f7);
  border: 2.5px solid #eadbff;
  font-size: 20px;
  font-weight: 800;
  color: #553b73;
  line-height: 1.4;
}

.book-stats-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.book-stat-chip {
  padding: 8px 16px;
  border-radius: 18px;
  font-size: 16px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.book-stat-chip.ats { background: var(--macaron-blue-soft); color: #1976b5; }
.book-stat-chip.gl { background: var(--macaron-pink-soft); color: #c73c76; }
.book-stat-chip.dcr { background: var(--macaron-yellow-soft); color: #b57300; }

.result-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 4px;
}

.retry-btn {
  padding: 15px 40px;
  border-radius: 999px;
  border: 4px solid #fff;
  background: linear-gradient(135deg, #4fd9a4 0%, #2bc48a 100%);
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 2px;
  cursor: pointer;
  box-shadow: 0 7px 0 #1c986a, 0 14px 26px rgba(43, 196, 138, 0.35);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.retry-btn:active {
  transform: translateY(5px);
  box-shadow: 0 2px 0 #1c986a;
}

.home-btn {
  padding: 15px 30px;
  border-radius: 999px;
  border: 3px solid #e4d4ff;
  background: #faf5ff;
  color: #664988;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 6px 0 #dec8ff;
}

.home-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #dec8ff;
}

/* ==================== 星星礼花特效画布 ==================== */
#fxCanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 60;
}

/* ==================== 平板竖屏适配（768x1024 / 820x1180） ==================== */
@media (orientation: portrait) {
  .quiz-header {
    padding: 10px 14px;
    gap: 10px;
  }

  .mini-btn {
    height: 40px;
    padding: 0 12px;
    font-size: 15px;
  }

  .progress-meta .progress-subtitle {
    display: none;
  }

  .score-pill {
    padding: 6px 14px;
    font-size: 18px;
  }

  .welcome-card {
    height: min(860px, 88dvh);
    padding: 36px 28px 40px;
  }

  .cast-bubble {
    width: 108px;
    height: 108px;
  }

  .quiz-stage {
    padding: 24px 24px 26px;
  }

  .question-body.has-hero-img {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }

  .question-hero-frame {
    width: 240px;
    height: 240px;
  }

  .img-option-wrap {
    max-height: 210px;
  }

  .option-card.is-text-card {
    min-height: 102px;
    padding: 20px 26px;
  }
}

/* 矮横屏平板保护（如 1024x600 / 1024x700） */
@media (max-height: 700px) and (orientation: landscape) {
  .welcome-card {
    padding: 18px 30px 20px;
  }
  .mini-cast {
    margin: 2px 0;
  }
  .cast-bubble {
    width: 78px;
    height: 78px;
  }
  .rules-row {
    margin-bottom: 12px;
  }
  .start-btn {
    padding: 14px 52px;
    font-size: 27px;
  }
  .quiz-stage {
    padding: 14px 24px 16px;
  }
  .question-hero-frame {
    width: 168px;
    height: 168px;
  }
  .img-option-wrap {
    max-height: 200px;
  }
  .option-card.is-text-card {
    min-height: 68px;
    padding: 12px 22px;
  }
}
