﻿/* ============================================================
   数学盲盒乐园 — 手绘涂鸦风 (Hand-Drawn Doodle) 视觉皮肤
   设计令牌：奶白纸 #fffef5 / 墨黑 #2c2c2c / 标记笔 红#ff6b6b 蓝绿#4ecdc4 黄#ffd93d
   规则：虚线边框、硬边偏移投影、细微旋转、笔记本纸与涂鸦装饰；禁用渐变与精确阴影
   ============================================================ */

:root {
  /* 手绘涂鸦调色板 */
  --paper: #fffef5;
  --paper-2: #fffdf0;
  --ink: #2c2c2c;
  --ink-soft: #5a5a52;
  --red: #ff6b6b;
  --teal: #4ecdc4;
  --yellow: #ffd93d;
  --blue-line: rgba(120, 170, 220, 0.22);
  --red-line: rgba(255, 107, 107, 0.30);

  --text-dark: #2c2c2c;
  --text-medium: #6b6b62;
  --text-light: #9a9a90;
  --white: #fffef5;

  /* 硬边偏移投影（涂鸦专属，无模糊） */
  --shadow-red: 4px 4px 0 var(--red);
  --shadow-teal: 4px 4px 0 var(--teal);
  --shadow-yellow: 4px 4px 0 var(--yellow);
  --shadow-ink: 4px 4px 0 var(--ink);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;

  --transition: 0.15s ease-out;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Nunito', 'ZCOOL KuaiLe', 'Fredoka', sans-serif;
  background-color: var(--paper);
  background-image:
    repeating-linear-gradient(transparent, transparent 31px, var(--blue-line) 31px, var(--blue-line) 32px);
  background-attachment: fixed;
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'ZCOOL KuaiLe', 'Fredoka', cursive;
  font-weight: 400;
  line-height: 1.3;
}

button {
  font-family: 'Nunito', 'Fredoka', sans-serif;
  border: none;
  cursor: pointer;
  background: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

button:focus-visible,
.big-btn:focus-visible,
.numkey:focus-visible,
.series-tab:focus-visible {
  outline: 3px dashed var(--red);
  outline-offset: 2px;
}

p { -webkit-user-select: text; user-select: text; }

button,
.nav-logo,
.nav-stats,
.mode-card,
.capsule,
.blind-box-card,
.hanging-char,
.answer-btn,
.series-tab,
.big-btn {
  -webkit-user-select: none;
  user-select: none;
}

.app-container {
  max-width: 640px;
  margin: 0 auto;
  position: relative;
}

/* 笔记本红色页边线 */
.app-container::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 22px;
  width: 2px;
  background: var(--red-line);
  z-index: 0;
  pointer-events: none;
}

.screen {
  display: none;
  opacity: 0;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  transform: translateY(20px) scale(0.98);
  transition: opacity 0.45s ease, transform 0.45s ease-out;
  padding: 18px 16px 110px;
  min-height: 100vh;
}

.screen.active {
  display: block;
  position: relative;
  opacity: 1;
  transform: translateY(0) scale(1);
  animation: pop-in 0.5s var(--transition);
}

/* GSAP 接管屏幕入场时，关闭 CSS 自身的 pop-in 以免双重动画 */
body.gsap-on .screen.active {
  animation: none;
}

.screen-title {
  font-size: 1.9rem;
  color: var(--ink);
  text-align: center;
  margin-bottom: 12px;
  text-shadow: 2px 2px 0 var(--yellow);
  transform: rotate(-1deg);
}

@keyframes pop-in {
  from { opacity: 0; transform: translateY(30px) scale(0.95) rotate(-1deg); }
  to { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}

/* Background doodle decorations */
.bg-decoration {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.cloud {
  position: absolute;
  font-size: 3.2rem;
  opacity: 0.7;
  animation: float 8s ease-in-out infinite;
  filter: drop-shadow(3px 3px 0 rgba(44, 44, 44, 0.12));
}

.cloud-1 { top: 6%; left: 4%; font-size: 3rem; animation-duration: 7s; }
.cloud-2 { top: 14%; right: 6%; font-size: 4rem; animation-duration: 9s; animation-delay: 1s; }
.cloud-3 { top: 48%; left: 2%; font-size: 2.5rem; opacity: 0.55; animation-duration: 10s; animation-delay: 2s; }

.star-deco {
  position: absolute;
  font-size: 1.6rem;
  animation: twinkle 3s ease-in-out infinite;
}

.star-1 { top: 22%; right: 14%; }
.star-2 { top: 58%; right: 4%; font-size: 1.3rem; animation-delay: 1s; }
.star-3 { top: 72%; left: 8%; font-size: 1.1rem; animation-delay: 2s; }

.balloon-deco {
  position: absolute;
  font-size: 2.2rem;
  animation: float 6s ease-in-out infinite;
}

.balloon-1 { top: 28%; right: 2%; animation-delay: 0.5s; animation-duration: 7s; }
.balloon-2 { top: 54%; left: 1%; font-size: 1.7rem; animation-delay: 1.5s; animation-duration: 8s; }

.math-deco {
  position: absolute;
  font-family: 'Fredoka', sans-serif;
  font-weight: 800;
  font-size: 2rem;
  color: rgba(44, 44, 44, 0.12);
  animation: float 7s ease-in-out infinite;
  pointer-events: none;
}

.math-deco-1 { top: 18%; left: 8%; animation-delay: 0s; }
.math-deco-2 { top: 38%; right: 10%; animation-delay: 1s; }
.math-deco-3 { top: 62%; left: 15%; font-size: 2.4rem; animation-delay: 2s; }
.math-deco-4 { top: 82%; right: 14%; animation-delay: 0.5s; }

/* Top navigation */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  margin: 10px 12px 6px;
  background: var(--paper);
  border: 2px dashed var(--ink);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-yellow);
}

.nav-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--paper);
  border: 2px dashed var(--ink);
  border-radius: var(--radius-xl);
  box-shadow: 3px 3px 0 var(--red);
  transition: var(--transition);
  white-space: nowrap;
}

.nav-back:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--red);
}

.nav-logo {
  font-family: 'ZCOOL KuaiLe', cursive;
  font-size: 1.2rem;
  color: var(--ink);
  white-space: nowrap;
  flex: 1;
  text-align: center;
  text-shadow: 1px 1px 0 var(--yellow);
  transform: rotate(-1deg);
}

.nav-stats {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-stat-item {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 5px 12px;
  background: var(--paper);
  border: 2px dashed var(--ink);
  border-radius: var(--radius-xl);
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  box-shadow: 2px 2px 0 var(--teal);
}

.nav-stat-icon { font-size: 1rem; }
.nav-stat-value { font-size: 1.05rem; color: var(--red); }
.nav-stat-total { font-size: 0.75rem; color: var(--text-light); }

.nav-sound {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background: var(--paper);
  border: 2px dashed var(--ink);
  border-radius: 50%;
  box-shadow: 2px 2px 0 var(--yellow);
  transition: var(--transition);
}

.nav-sound:active { transform: scale(0.9) rotate(-4deg); }

/* Hanging characters bar */
.hanging-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 110px;
  z-index: 90;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 14px;
  padding: 0 14px;
  overflow-x: auto;
  overflow-y: visible;
  pointer-events: none;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.hanging-bar::-webkit-scrollbar { display: none; }

.hanging-char {
  position: relative;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: auto;
  cursor: pointer;
  transform-origin: top center;
  animation: swing var(--swing-duration, 3s) ease-in-out infinite;
  animation-delay: var(--swing-delay, 0s);
}

.hanging-string {
  width: 3px;
  height: 44px;
  background: var(--ink);
  border-radius: 2px;
  position: relative;
}

.hanging-string::before {
  content: '';
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 9px;
  height: 9px;
  background: var(--red);
  border: 2px solid var(--ink);
  border-radius: 50%;
}

.hanging-char .char-standee {
  width: 54px;
  height: 54px;
  font-size: 2rem;
  border-width: 3px;
  box-shadow: 3px 3px 0 var(--yellow);
}

.hanging-char:active .char-standee { transform: scale(0.92) rotate(-3deg); }

.hanging-name {
  font-size: 0.68rem;
  font-family: 'ZCOOL KuaiLe', cursive;
  color: var(--paper);
  background: var(--ink);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  margin-top: 4px;
  white-space: nowrap;
  max-width: 64px;
  overflow: hidden;
  text-overflow: ellipsis;
  transform: rotate(-1.5deg);
}

.hanging-char.bouncing { animation: bounce-tap 0.6s ease-out; }

/* Character Standee */
.char-standee {
  width: 110px;
  height: 110px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.4rem;
  position: relative;
  background: var(--paper);
  border: 3px dashed var(--ink);
  box-shadow: var(--shadow-yellow);
  transition: transform var(--transition), box-shadow var(--transition);
  overflow: hidden;
}

.character-image {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  padding: 4px;
  border-radius: inherit;
  filter: drop-shadow(0 8px 10px rgba(47, 64, 53, 0.28));
}

/* 2.5D 漂浮感：开箱结果与详情里的角色轻轻浮动 */
.result-character .character-image,
.char-detail .character-image {
  animation: char-float 3.4s ease-in-out infinite;
}

@keyframes char-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-7px) rotate(-1.2deg); }
}

.char-standee::before,
.char-standee::after { display: none; }

.char-standee .emoji {
  position: relative;
  z-index: 3;
  filter: drop-shadow(2px 2px 0 rgba(44, 44, 44, 0.18));
  animation: standee-bob 3s ease-in-out infinite;
  transform: scale(1.12) translateY(-1px);
}


/* 有 2.5D 立绘时彻底隐藏 emoji，避免礼物盒遮挡 */
.char-standee.has-image .emoji,
.paper-doll-body.has-image .emoji {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  font-size: 0 !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  position: absolute !important;
  pointer-events: none !important;
}
.char-standee.has-image .character-image {
  position: relative;
  z-index: 2;
}
.paper-doll-body.has-image .paper-doll-img {
  z-index: 2;
}
.paper-doll-close,
.paper-doll-tip {
  pointer-events: auto;
}

.char-standee[data-rarity="common"] { box-shadow: var(--shadow-teal); }
.char-standee[data-rarity="rare"] { box-shadow: var(--shadow-red); }
.char-standee[data-rarity="epic"] { box-shadow: var(--shadow-yellow); }
.char-standee[data-rarity="legendary"] {
  box-shadow: var(--shadow-ink);
  animation: standee-bob 3s ease-in-out infinite, legendary-glow 2s ease-in-out infinite;
}

.char-standee.qmark { background: var(--paper) !important; border-color: var(--ink) !important; }

.char-standee.qmark .emoji { filter: drop-shadow(2px 2px 0 rgba(44, 44, 44, 0.15)); transform: scale(1); }

@keyframes standee-bob {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-4px) rotate(-1deg); }
}

@keyframes legendary-glow {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(44, 44, 44, 0)); }
  50% { filter: drop-shadow(0 0 6px rgba(255, 107, 107, 0.5)); }
}

/* Home screen */
.home-hero {
  text-align: center;
  padding: 30px 18px 20px;
}

.hero-mascot {
  position: relative;
  display: inline-block;
  margin-bottom: 18px;
}

.mascot-sparkle {
  position: absolute;
  font-size: 1.2rem;
  animation: sparkle-rotate 4s linear infinite;
}

.sparkle-1 { top: -8px; right: -10px; }
.sparkle-2 { bottom: 4px; left: -12px; animation-delay: 1s; }
.sparkle-3 { top: 50%; right: -18px; font-size: 0.9rem; animation-delay: 2s; }

.hero-mascot .char-standee {
  width: 140px;
  height: 140px;
  font-size: 4.5rem;
  box-shadow: var(--shadow-red);
  transform: rotate(-2deg);
}

.hero-mascot .char-standee .emoji { transform: scale(1.18) translateY(-2px); }

.hero-title {
  font-size: 2.6rem;
  color: var(--ink);
  margin-bottom: 8px;
  text-shadow: 3px 3px 0 var(--yellow);
  transform: rotate(-1.5deg);
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-medium);
  max-width: 340px;
  margin: 0 auto;
}

.home-progress-card {
  background: var(--paper);
  border: 3px dashed var(--ink);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin: 18px 16px 22px;
  box-shadow: var(--shadow-teal);
  position: relative;
  overflow: hidden;
}

.home-progress-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 8px;
  background: repeating-linear-gradient(90deg, var(--red) 0 14px, var(--teal) 14px 28px, var(--yellow) 28px 42px);
}

.progress-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.progress-card-title { font-family: 'ZCOOL KuaiLe', cursive; font-size: 1.15rem; color: var(--ink); }
.progress-card-count { font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 1.1rem; color: var(--red); }

.progress-bar-wrap {
  position: relative;
  height: 28px;
  background: var(--paper-2);
  border: 2px dashed var(--ink);
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: 18px;
  box-shadow: inset 2px 2px 0 rgba(44, 44, 44, 0.06);
}

.progress-bar-fill {
  height: 100%;
  background: var(--teal);
  border-radius: var(--radius-xl);
  transition: width 0.6s ease-out;
  position: relative;
  overflow: hidden;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(45deg, rgba(255,255,255,0.35) 0 8px, transparent 8px 16px);
  animation: progress-shine 2.2s ease-in-out infinite;
}

.progress-bar-sparkle {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  font-size: 1rem;
  z-index: 2;
  animation: twinkle 1.8s ease-in-out infinite;
}

.progress-card-info {
  display: flex;
  gap: 12px;
}

.progress-info-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 12px 8px;
  background: var(--paper-2);
  border: 2px dashed var(--ink);
  border-radius: var(--radius-md);
  box-shadow: 2px 2px 0 var(--yellow);
}

.info-icon { font-size: 1.4rem; }
.info-label { font-size: 0.78rem; color: var(--text-medium); }
.info-value { font-family: 'Fredoka', sans-serif; font-size: 1.1rem; font-weight: 800; color: var(--ink); }

.home-actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0 16px;
  margin-bottom: 22px;
}

.big-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 78px;
  padding: 16px 20px;
  border: 3px dashed var(--ink);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow-red);
  transition: var(--transition);
  text-align: left;
  position: relative;
  overflow: hidden;
}

.big-btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--red); }

.btn-learn { box-shadow: var(--shadow-red); }
.btn-collection { box-shadow: var(--shadow-teal); }
.btn-teach { box-shadow: var(--shadow-yellow); }
.btn-goto-gacha { box-shadow: var(--shadow-ink); }
.btn-continue-learn { box-shadow: var(--shadow-red); }

.btn-icon {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  border-radius: var(--radius-sm);
  background: var(--paper-2);
  border: 2px dashed var(--ink);
  box-shadow: 2px 2px 0 rgba(44, 44, 44, 0.12);
}

.btn-text { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.btn-title { font-family: 'ZCOOL KuaiLe', cursive; font-size: 1.25rem; color: var(--ink); }
.btn-sub { font-size: 0.82rem; color: var(--text-medium); line-height: 1.35; }
.btn-arrow { font-size: 1.2rem; color: var(--ink); }

.home-today-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 16px 30px;
  padding: 14px 18px;
  background: var(--paper);
  border: 2px dashed var(--ink);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-yellow);
  color: var(--text-medium);
  transition: var(--transition);
}

.home-today-status.unlocked {
  border: 2px dashed var(--teal);
  background: var(--paper-2);
  color: var(--ink);
  box-shadow: var(--shadow-teal);
}

.today-status-icon { font-size: 1.5rem; }
.today-status-text { font-size: 0.95rem; font-weight: 700; }

/* Learn screen */
.learn-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.learn-progress-info {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.progress-text {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  color: var(--text-medium);
  font-size: 1rem;
}

.learn-progress-bar {
  width: 100%;
  height: 14px;
  background: var(--paper-2);
  border: 2px dashed var(--ink);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: inset 2px 2px 0 rgba(44, 44, 44, 0.06);
}

.learn-progress-fill {
  height: 100%;
  background: var(--red);
  border-radius: var(--radius-xl);
  transition: width 0.5s ease-out;
}

/* 学段选择（幼儿园 / 一年级） */
.grade-select {
  padding: 8px 4px 20px;
}
.grade-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 12px;
}
.grade-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 200px;
  padding: 16px 14px;
  text-align: left;
  color: var(--ink);
  background: var(--paper);
  border: 3px dashed var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: 4px 4px 0 rgba(47, 64, 53, 0.16);
  font-family: 'Fredoka', 'ZCOOL KuaiLe', sans-serif;
  cursor: pointer;
  transition: var(--transition);
}
.grade-card:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 rgba(47, 64, 53, 0.16); }
.grade-card.selected,
.grade-card[data-grade="kindergarten"]:focus {
  border-color: var(--moss);
  box-shadow: 4px 4px 0 var(--moss);
}
.grade-card[data-grade="kindergarten"] { background: linear-gradient(160deg, #fffdf7 0%, #e8f6ec 100%); }
.grade-card[data-grade="grade1"] { background: linear-gradient(160deg, #fffdf7 0%, #fff3e0 100%); }
.grade-card-icon { font-size: 2.2rem; line-height: 1; margin-bottom: 4px; }
.grade-card-title { font-family: 'ZCOOL KuaiLe', cursive; font-size: 1.35rem; font-weight: 700; color: var(--ink); }
.grade-card-desc { font-size: 0.9rem; color: var(--moss); font-weight: 700; margin-bottom: 6px; }
.grade-card-list {
  margin: 0;
  padding-left: 1.1em;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-medium);
  list-style: disc;
}
.mode-select-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.grade-switch-btn {
  flex-shrink: 0;
  padding: 6px 12px;
  border: 2px dashed var(--ink);
  border-radius: var(--radius-xl);
  background: var(--paper-2);
  font-family: 'ZCOOL KuaiLe', cursive;
  font-size: 0.85rem;
  color: var(--ink);
  cursor: pointer;
}
.mode-card-progress {
  margin-top: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(86, 123, 96, 0.12);
  color: var(--moss);
  font-size: 0.8rem;
  font-weight: 800;
}
.mode-card.done {
  border-color: var(--teal);
  box-shadow: 3px 3px 0 var(--teal);
  opacity: 0.92;
}
.mode-card.done .mode-card-progress {
  background: var(--teal);
  color: #fffdf7;
}

.mode-select {
  background: var(--paper);
  border: 3px dashed var(--ink);
  border-radius: var(--radius-lg);
  padding: 22px 18px;
  margin: 0 4px 20px;
  box-shadow: var(--shadow-yellow);
}

.mode-select-title {
  font-size: 1.4rem;
  text-align: center;
  margin-bottom: 8px;
  color: var(--ink);
}

.mode-select-hint {
  text-align: center;
  color: var(--text-medium);
  font-size: 0.9rem;
  margin-bottom: 18px;
}

.mode-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.mode-card {
  background: var(--paper);
  border: 3px dashed var(--ink);
  border-radius: var(--radius-md);
  padding: 18px 12px;
  text-align: center;
  box-shadow: var(--shadow-teal);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  transform: rotate(-1deg);
}

.mode-card:nth-child(even) { transform: rotate(1deg); }

.mode-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 6px;
  background: repeating-linear-gradient(90deg, var(--ink) 0 10px, transparent 10px 20px);
  opacity: 0.5;
}

.mode-card[data-mode="add10"]::after { background: var(--red); }
.mode-card[data-mode="sub10"]::after { background: var(--teal); }
.mode-card[data-mode="add20"]::after { background: var(--yellow); }
.mode-card[data-mode="sub20"]::after { background: var(--ink); }

.mode-card:active { transform: translate(3px, 3px) rotate(0); box-shadow: 1px 1px 0 var(--teal); }

.mode-card-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  background: var(--paper-2);
  border: 2px dashed var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: 2px 2px 0 rgba(44, 44, 44, 0.1);
}

.mode-card-title { font-family: 'ZCOOL KuaiLe', cursive; font-size: 1.1rem; color: var(--ink); margin-bottom: 4px; }
.mode-card-desc { font-size: 0.8rem; color: var(--text-light); }
.mode-card-tag {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 10px;
  background: var(--paper-2);
  border: 2px dashed var(--ink);
  border-radius: var(--radius-xl);
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--red);
}

/* Quiz area */
.quiz-area { animation: pop-in 0.4s var(--transition); }

.question-card {
  background: var(--paper);
  border: 3px dashed var(--ink);
  border-radius: var(--radius-lg);
  padding: 22px 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-red);
  position: relative;
  overflow: hidden;
}

.question-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 8px;
  background: repeating-linear-gradient(90deg, var(--red) 0 14px, var(--teal) 14px 28px, var(--yellow) 28px 42px);
}

.question-mode-badge {
  display: inline-block;
  margin-bottom: 14px;
  padding: 6px 14px;
  background: var(--paper-2);
  border: 2px dashed var(--ink);
  border-radius: var(--radius-xl);
  color: var(--red);
  font-family: 'ZCOOL KuaiLe', cursive;
  font-size: 0.95rem;
  box-shadow: 2px 2px 0 var(--yellow);
}

.question-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.question-display .num,
.question-display .op,
.question-display .eq,
.question-display .qmark {
  font-family: 'Fredoka', sans-serif;
  font-weight: 900;
  font-size: 2.6rem;
  color: var(--ink);
  text-shadow: 2px 2px 0 rgba(44, 44, 44, 0.08);
}

.question-display .op { color: var(--red); font-size: 2.4rem; }
.question-display .eq { color: var(--teal); }
.question-display .qmark { color: var(--yellow); -webkit-text-stroke: 2px var(--ink); animation: qmark-bounce 1.2s ease-in-out infinite; }

@keyframes qmark-bounce {
  0%, 100% { transform: scale(1) rotate(-2deg); }
  50% { transform: scale(1.15) rotate(2deg); }
}

/* Visual aids */
.visual-aid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 16px;
  background: var(--paper-2);
  border: 2px dashed var(--ink);
  border-radius: var(--radius-md);
}

.obj-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 1.5rem;
}

.obj-group {
  display: inline-flex;
  gap: 3px;
  padding: 8px 12px;
  background: var(--paper);
  border: 2px dashed var(--ink);
  border-radius: var(--radius-md);
  box-shadow: 2px 2px 0 rgba(44, 44, 44, 0.08);
}

.obj-group.crossed { text-decoration: line-through; background: var(--paper-2); opacity: 0.7; }
.obj-plus { font-size: 1.6rem; color: var(--red); font-weight: 800; }
.obj-minus { font-size: 1.6rem; color: var(--teal); font-weight: 800; }
.obj-equal { font-size: 1.6rem; color: var(--ink); font-weight: 800; }
.obj-answer { font-family: 'Fredoka', sans-serif; font-weight: 900; font-size: 1.8rem; color: var(--ink); background: var(--paper); padding: 4px 14px; border: 2px dashed var(--ink); border-radius: var(--radius-sm); box-shadow: 2px 2px 0 var(--yellow); }
.obj-count {
  font-size: 0.95rem;
  color: var(--text-medium);
  font-weight: 700;
}

.tenframe {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  background: var(--paper);
  border: 2px dashed var(--ink);
  border-radius: var(--radius-md);
  box-shadow: 2px 2px 0 rgba(44, 44, 44, 0.08);
}

.tf-row { display: flex; gap: 6px; }

.tf-cell {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 2px dashed var(--ink);
  background: var(--paper-2);
  transition: var(--transition);
}

.tf-cell.filled {
  background: var(--teal);
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--red);
}

.tf-cell.filled.arrow { position: relative; }

.tf-cell.filled.arrow::after,
.tf-cell.empty.arrow::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid var(--ink);
}

.tenframe-label {
  font-size: 0.95rem;
  color: var(--text-medium);
  font-weight: 700;
  text-align: center;
  margin-top: 4px;
}

/* Math worksheet (凑十法 / 破十法) */
.calc-steps { margin-bottom: 18px; animation: pop-in 0.4s var(--transition); }

.worksheet {
  background: var(--paper);
  border: 2px dashed var(--ink);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-yellow);
  position: relative;
}

.worksheet::before {
  content: '数学作业纸';
  position: absolute;
  top: -11px;
  left: 14px;
  background: var(--yellow);
  color: var(--ink);
  border: 2px solid var(--ink);
  font-family: 'ZCOOL KuaiLe', cursive;
  font-size: 0.75rem;
  padding: 2px 10px;
  border-radius: var(--radius-xl);
  box-shadow: 2px 2px 0 var(--ink);
  transform: rotate(-2deg);
}

.worksheet-title {
  font-family: 'ZCOOL KuaiLe', cursive;
  font-size: 1.2rem;
  text-align: center;
  margin-bottom: 12px;
  color: var(--ink);
}

.worksheet-title .method-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-xl);
  font-size: 0.85rem;
  margin-left: 6px;
  border: 2px solid var(--ink);
}

.worksheet-title .method-tag.make-ten { background: var(--teal); color: var(--ink); }
.worksheet-title .method-tag.break-ten { background: var(--yellow); color: var(--ink); }

.ws-main-eq {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.9rem;
  font-weight: 900;
  margin-bottom: 16px;
  color: var(--ink);
}

.ws-blank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  background: var(--paper);
  border: 2px dashed var(--ink);
  border-radius: var(--radius-sm);
  color: var(--red);
  font-size: 1.6rem;
  animation: qmark-bounce 1.2s ease-in-out infinite;
}

.ws-blank.filled {
  border: 2px solid var(--ink);
  color: var(--ink);
  background: var(--paper-2);
  box-shadow: 2px 2px 0 var(--teal);
  animation: none;
}

.ws-blank.selected {
  border: 2px solid var(--teal) !important;
  color: var(--ink) !important;
  animation: none !important;
  background: var(--paper-2) !important;
  box-shadow: 2px 2px 0 var(--teal) !important;
}

.ws-blank.wrong-answer {
  border: 2px solid var(--red) !important;
  color: var(--red) !important;
  animation: shake-wrong 0.4s ease-in-out !important;
  background: var(--paper-2) !important;
}

.ws-tree {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.ws-tree-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: 100%;
}

.ws-split {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.ws-split-num {
  font-family: 'Fredoka', sans-serif;
  font-weight: 900;
  font-size: 1.5rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  border: 2px dashed var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: 2px 2px 0 rgba(44, 44, 44, 0.1);
  color: var(--ink);
}

.ws-split-label {
  font-size: 0.75rem;
  color: var(--text-medium);
  font-weight: 700;
}

.ws-connector {
  font-size: 1.4rem;
  color: var(--text-light);
  font-weight: 800;
}

.ws-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--paper);
  border: 2px dashed var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: 2px 2px 0 rgba(44, 44, 44, 0.08);
}

.ws-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
  color: var(--ink);
}

.ws-step-num {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--teal);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 50%;
  font-family: 'Fredoka', sans-serif;
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.ws-step.hl .ws-step-num { background: var(--yellow); }
.ws-step.hl { font-weight: 800; color: var(--ink); }

.ws-final {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px;
  background: var(--paper-2);
  border: 2px dashed var(--ink);
  border-radius: var(--radius-sm);
  font-family: 'Fredoka', sans-serif;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--teal);
}

/* Answer section */
.answer-prompt {
  text-align: center;
  font-family: 'ZCOOL KuaiLe', cursive;
  font-size: 1.1rem;
  color: var(--text-medium);
  margin-bottom: 10px;
}

.numpad {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.numkey {
  aspect-ratio: 1 / 1;
  min-height: 54px;
  border-radius: var(--radius-sm);
  font-family: 'Fredoka', sans-serif;
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--ink);
  background: var(--paper);
  border: 2px dashed var(--ink);
  box-shadow: 3px 3px 0 rgba(44, 44, 44, 0.18);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.numkey:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 rgba(44, 44, 44, 0.18); }
.numkey.selected {
  background: var(--red) !important;
  color: var(--paper) !important;
  border: 2px solid var(--ink) !important;
  box-shadow: 3px 3px 0 var(--ink) !important;
  transform: scale(1.05) rotate(-2deg);
}

.answer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.answer-clear, .answer-submit {
  padding: 14px;
  border: 2px dashed var(--ink);
  border-radius: var(--radius-xl);
  font-family: 'ZCOOL KuaiLe', cursive;
  font-size: 1.1rem;
  font-weight: 700;
  transition: var(--transition);
  box-shadow: 3px 3px 0 rgba(44, 44, 44, 0.2);
}

.answer-clear {
  background: var(--paper);
  color: var(--text-medium);
}
.answer-submit {
  background: var(--teal);
  color: var(--ink);
}
.answer-clear:active, .answer-submit:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 rgba(44, 44, 44, 0.2); }

.answer-clear:disabled, .answer-submit:disabled {
  opacity: 0.6;
  transform: none;
  box-shadow: none;
  cursor: not-allowed;
}

.answer-section {
  display: block;
  margin-bottom: 16px;
}

.question-display .qmark.selected {
  color: var(--ink);
  background: var(--paper-2);
  border: 2px dashed var(--ink);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  animation: none;
}
.question-display .qmark.filled {
  color: var(--ink);
  animation: none;
}
.question-display .qmark.wrong-answer {
  color: var(--red);
  background: var(--paper-2);
  border: 2px dashed var(--red);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  animation: shake-wrong 0.4s ease-in-out;
}

.answer-prompt { display: none; }

.feedback-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px;
  background: var(--paper-2);
  border: 2px dashed var(--teal);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  animation: pop-in 0.3s var(--transition);
  box-shadow: 3px 3px 0 var(--teal);
}

.feedback-area.wrong {
  background: var(--paper-2);
  border-color: var(--red);
  box-shadow: 3px 3px 0 var(--red);
}

.feedback-emoji { font-size: 2.2rem; animation: bounce 0.6s ease-in-out; }
.feedback-text { font-family: 'ZCOOL KuaiLe', cursive; font-size: 1.1rem; color: var(--ink); font-weight: 700; }
.feedback-area.wrong .feedback-text { color: var(--red); }

.solution-area {
  padding: 16px 18px;
  background: linear-gradient(180deg, #f3fbf4, #e8f6ec);
  border: 2px solid var(--moss);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  box-shadow: 3px 3px 0 rgba(86, 123, 96, 0.32);
}
.solution-title { font-family: 'ZCOOL KuaiLe', cursive; font-size: 1.05rem; color: var(--moss); font-weight: 700; margin-bottom: 6px; }
.solution-text { font-size: 1.02rem; line-height: 1.65; color: var(--ink); }

.next-btn {
  width: 100%;
  padding: 16px;
  border: 3px dashed var(--ink);
  border-radius: var(--radius-xl);
  font-family: 'ZCOOL KuaiLe', cursive;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--yellow);
  box-shadow: var(--shadow-red);
  transition: var(--transition);
}

.next-btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--red); }

/* Learn complete */
.learn-complete {
  text-align: center;
  animation: pop-in 0.5s var(--transition);
}

.complete-celebrate {
  background: var(--paper);
  border: 3px dashed var(--ink);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  box-shadow: var(--shadow-yellow);
}

.celebrate-emoji { font-size: 3rem; margin-bottom: 10px; animation: bounce 1s ease-in-out infinite; }
.complete-title { font-size: 2rem; color: var(--red); margin-bottom: 8px; text-shadow: 2px 2px 0 var(--yellow); transform: rotate(-1.5deg); }
.complete-text { font-size: 1.1rem; color: var(--text-medium); margin-bottom: 18px; }

.mode-progress-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--paper-2);
  border: 2px dashed var(--ink);
  border-radius: var(--radius-md);
  box-shadow: 2px 2px 0 rgba(44, 44, 44, 0.08);
}

.mode-prog-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
}

.mode-prog-name { flex: 0 0 110px; font-family: 'ZCOOL KuaiLe', cursive; text-align: left; color: var(--ink); }
.mode-prog-bar { flex: 1; height: 12px; background: var(--paper); border: 2px dashed var(--ink); border-radius: var(--radius-xl); overflow: hidden; }
.mode-prog-fill { height: 100%; border-radius: var(--radius-xl); transition: width 0.5s ease-out; background: var(--teal); }
.mode-prog-count { flex: 0 0 50px; font-family: 'Fredoka', sans-serif; font-weight: 800; text-align: right; color: var(--text-medium); }
.mode-prog-row.done .mode-prog-count { color: var(--teal); }

.complete-reward { font-size: 1.1rem; color: var(--ink); font-weight: 800; margin-bottom: 18px; }

/* Gacha screen */
.gacha-subtitle { text-align: center; color: var(--text-medium); margin-bottom: 20px; }

.gacha-machine {
  position: relative;
  max-width: 360px;
  margin: 0 auto 20px;
}

.gacha-dome {
  position: relative;
  height: 240px;
  background: var(--paper);
  border: 4px dashed var(--ink);
  border-radius: 140px 140px 30px 30px;
  box-shadow: var(--shadow-yellow), 0 0 0 6px var(--paper);
  overflow: hidden;
}

.gacha-dome-shine {
  position: absolute;
  top: 10px;
  left: 20px;
  width: 60px;
  height: 80px;
  background: rgba(255, 255, 255, 0.6);
  border: 2px dashed var(--ink);
  border-radius: 50%;
  transform: rotate(-20deg);
}

.capsules-container {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  padding: 10px;
}

.capsule {
  width: 54px;
  height: 70px;
  border-radius: var(--radius-md);
  position: relative;
  cursor: pointer;
  transition: transform 0.3s var(--transition), opacity 0.3s;
  border: 3px dashed var(--ink);
  background: var(--paper);
  box-shadow: 4px 4px 0 var(--red);
  animation: capsule-bob 2s ease-in-out infinite;
}

.capsule:nth-child(1) { animation-delay: 0s; box-shadow: 4px 4px 0 var(--red); }
.capsule:nth-child(2) { animation-delay: 0.2s; box-shadow: 4px 4px 0 var(--teal); }
.capsule:nth-child(3) { animation-delay: 0.4s; box-shadow: 4px 4px 0 var(--yellow); }
.capsule:nth-child(4) { animation-delay: 0.6s; box-shadow: 4px 4px 0 var(--ink); }
.capsule:nth-child(5) { animation-delay: 0.8s; box-shadow: 4px 4px 0 var(--teal); }

.capsule-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 38px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border-bottom: 2px dashed var(--ink);
  background: var(--paper-2);
}

.capsule-body {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 38px;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  background: var(--paper-2);
  border-top: 2px dashed var(--ink);
}

.capsule::after {
  content: '?';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Fredoka', sans-serif;
  font-weight: 900;
  font-size: 1.4rem;
  color: var(--ink);
  text-shadow: 1px 1px 0 var(--yellow);
}

.capsule:active { transform: scale(0.95) translateY(4px); }
.capsule.selected { animation: capsule-selected 0.6s ease-in-out infinite; transform: scale(1.1) rotate(-2deg); z-index: 10; box-shadow: 5px 5px 0 var(--red); }

@keyframes capsule-bob {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-6px) rotate(1deg); }
}

@keyframes capsule-selected {
  0%, 100% { transform: scale(1.1) rotate(-2deg); }
  50% { transform: scale(1.1) rotate(2deg); }
}

.gacha-body {
  height: 80px;
  background: var(--red);
  border: 4px solid var(--ink);
  border-radius: 0 0 24px 24px;
  margin-top: -8px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-ink);
}

.gacha-body-deco { font-size: 1.6rem; margin-right: 8px; }
.gacha-body-label { font-family: 'ZCOOL KuaiLe', cursive; font-size: 1.3rem; color: var(--paper); }

.gacha-slot {
  width: 80px;
  height: 24px;
  background: var(--ink);
  border: 2px dashed var(--paper);
  border-radius: 0 0 12px 12px;
  margin: 8px auto 0;
  box-shadow: inset 2px 2px 0 rgba(0,0,0,0.3);
}

.gacha-prompt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 1.1rem;
  color: var(--text-medium);
  font-weight: 700;
  animation: prompt-bounce 1.5s ease-in-out infinite;
}

.prompt-bounce { font-size: 1.5rem; animation: point 1s ease-in-out infinite; }

@keyframes point {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-8px) rotate(3deg); }
}

@keyframes prompt-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(44, 44, 44, 0.65);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fade-in 0.3s ease;
}

.modal-content {
  background: var(--paper);
  border: 3px dashed var(--ink);
  border-radius: var(--radius-lg);
  padding: 28px 22px;
  max-width: 420px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-red), 0 0 0 6px var(--paper);
  position: relative;
  animation: pop-in 0.4s var(--transition);
}

/* 图钉装饰 */
.modal-content::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 18px;
  background: var(--red);
  border: 3px solid var(--ink);
  border-radius: 50%;
  box-shadow: 2px 2px 0 rgba(44, 44, 44, 0.2);
  z-index: 5;
}

.modal-btn, .modal-close {
  width: 100%;
  padding: 16px;
  border: 3px dashed var(--ink);
  border-radius: var(--radius-xl);
  font-family: 'ZCOOL KuaiLe', cursive;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--yellow);
  box-shadow: var(--shadow-red);
  margin-top: 14px;
  transition: var(--transition);
}

.modal-btn:active, .modal-close:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--red); }
.modal-close { background: var(--teal); }

/* Box reveal modal */
.box-reveal {
  background: transparent;
  box-shadow: none;
  max-width: 420px;
  overflow: visible;
}

.reveal-stage {
  position: relative;
  width: 100%;
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reveal-box {
  width: 160px;
  height: 160px;
  position: relative;
  z-index: 5;
  animation: box-float 3s ease-in-out infinite;
}

.reveal-box-top {
  position: absolute;
  top: -20px;
  left: 10px;
  width: 140px;
  height: 40px;
  background: var(--red);
  border: 3px solid var(--ink);
  border-radius: 8px 8px 4px 4px;
  box-shadow: 2px 2px 0 rgba(44, 44, 44, 0.2);
  transform-origin: left center;
  transition: transform 0.6s var(--transition);
  z-index: 6;
}

.reveal-box-body {
  width: 160px;
  height: 140px;
  background: var(--yellow);
  border: 4px solid var(--ink);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-ink);
  position: relative;
  overflow: hidden;
}

.reveal-box-body::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(45deg, rgba(44,44,44,0.08) 0 12px, transparent 12px 24px);
}

.reveal-box-question {
  font-family: 'Fredoka', sans-serif;
  font-size: 4rem;
  font-weight: 900;
  color: var(--ink);
  text-shadow: 2px 2px 0 var(--paper);
  position: relative;
  z-index: 2;
}

.reveal-box-shine {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 50px;
  height: 70px;
  background: rgba(255,255,255,0.5);
  border-radius: 50%;
  transform: rotate(-20deg);
  z-index: 3;
}

.reveal-box.shaking { animation: box-shake 0.5s ease-in-out infinite; }
.reveal-box.opening .reveal-box-top { transform: rotate(-110deg) translateY(-30px); }
.reveal-box.opening { animation: box-pop-open 0.6s ease-in-out forwards; }

.reveal-light-beam {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.9) 0%, transparent 70%);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: all 0.6s ease-out;
  z-index: 4;
}

.reveal-light-beam.active {
  width: 320px;
  height: 320px;
  opacity: 1;
}

.reveal-particles {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  z-index: 7;
}

.reveal-result {
  background: var(--paper);
  border: 3px dashed var(--ink);
  border-radius: var(--radius-lg);
  padding: 28px 22px;
  text-align: center;
  box-shadow: var(--shadow-yellow), 0 0 0 6px var(--paper);
  animation: pop-in 0.5s var(--transition);
  position: relative;
  overflow: hidden;
}

.reveal-result::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 8px;
  background: repeating-linear-gradient(90deg, var(--red) 0 14px, var(--teal) 14px 28px, var(--yellow) 28px 42px);
}

.result-character {
  position: relative;
  display: inline-block;
  margin-bottom: 10px;
}

.result-character .char-standee {
  width: 190px;
  height: 190px;
  font-size: 5.8rem;
  z-index: 2;
  border-width: 4px;
  box-shadow: 0 14px 26px rgba(47, 64, 53, 0.22);
}

.result-character .char-standee .emoji { transform: scale(1.2) translateY(-2px); }

.result-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 220px;
  height: 220px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  z-index: 1;
  border: 3px dashed var(--ink);
  opacity: 0.5;
  animation: glow-pulse 2s ease-in-out infinite;
}

@keyframes glow-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.4; }
  50% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.7; }
}

.result-rarity-badge {
  display: inline-block;
  padding: 6px 16px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-xl);
  color: var(--ink);
  font-family: 'ZCOOL KuaiLe', cursive;
  font-size: 1rem;
  margin-bottom: 10px;
  box-shadow: 2px 2px 0 var(--ink);
}
.result-rarity-badge[data-rarity="legendary"] { color: var(--paper); }

.result-name { font-size: 2rem; color: var(--ink); margin-bottom: 4px; }
.result-series { color: var(--text-medium); font-size: 1rem; margin-bottom: 10px; }
.result-desc { color: var(--text-medium); font-size: 0.95rem; line-height: 1.5; margin-bottom: 16px; }

@keyframes box-float {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-12px) rotate(1deg); }
}

@keyframes box-shake {
  0%, 100% { transform: translateX(0) rotate(0); }
  25% { transform: translateX(-6px) rotate(-3deg); }
  75% { transform: translateX(6px) rotate(3deg); }
}

@keyframes box-pop-open {
  0% { transform: scale(1) rotate(-1deg); }
  50% { transform: scale(1.1) rotate(1deg); }
  100% { transform: scale(0.9); opacity: 0.8; }
}

/* Collection screen */
.collection-subtitle { text-align: center; color: var(--text-medium); margin-bottom: 16px; font-size: 1.05rem; }

.series-tab {
  flex-shrink: 0;
  padding: 8px 16px;
  border: 2px dashed var(--ink);
  border-radius: var(--radius-xl);
  font-family: 'ZCOOL KuaiLe', cursive;
  font-size: 0.9rem;
  background: var(--paper);
  color: var(--text-medium);
  box-shadow: 2px 2px 0 rgba(44, 44, 44, 0.1);
  transition: var(--transition);
}

.series-tab.active {
  background: var(--red);
  color: var(--paper);
  box-shadow: 3px 3px 0 var(--ink);
  transform: rotate(-1.5deg);
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 4px;
}

.blind-box-card {
  position: relative;
  cursor: pointer;
  transition: var(--transition);
}

.blind-box-card:active { transform: scale(0.95) rotate(-2deg); }

.box-card-inner {
  aspect-ratio: 1 / 1.1;
  background: var(--paper);
  border: 3px dashed var(--ink);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
  box-shadow: var(--shadow-teal);
  position: relative;
  overflow: hidden;
}

.box-card-inner .char-standee {
  width: 88px;
  height: 88px;
  font-size: 2.8rem;
  border-width: 3px;
  box-shadow: 3px 3px 0 var(--yellow);
}

.box-card-inner .char-standee .emoji { transform: scale(1.08) translateY(-1px); }

.box-card-inner .qmark .char-standee {
  background: var(--paper) !important;
  font-size: 2.4rem;
}

.box-card-inner .qmark .char-standee .emoji { transform: scale(1) translateY(0); }

.box-card-rarity {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 8px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-xl);
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}
.box-card-rarity.common { background: var(--teal); }
.box-card-rarity.rare { background: var(--red); color: var(--paper); }
.box-card-rarity.epic { background: var(--yellow); }
.box-card-rarity.legendary { background: var(--ink); color: var(--paper); }

.box-card-name {
  font-family: 'ZCOOL KuaiLe', cursive;
  font-size: 0.95rem;
  color: var(--ink);
  margin-top: 8px;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.box-card-series {
  font-size: 0.7rem;
  color: var(--text-light);
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.blind-box-card.uncollected .box-card-inner {
  background: var(--paper-2);
  border: 3px dashed var(--text-light);
  box-shadow: 2px 2px 0 rgba(44, 44, 44, 0.08);
}

.blind-box-card.uncollected .box-card-name { color: var(--text-light); }

.blind-box-card.collected .box-card-inner::after {
  content: '✓';
  position: absolute;
  bottom: 6px;
  left: 6px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--teal);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 800;
  box-shadow: 2px 2px 0 var(--ink);
}

.collection-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
  font-size: 1rem;
}

/* Character detail modal */
.char-detail {
  text-align: center;
  padding-top: 36px;
}

.char-detail .char-standee {
  width: 160px;
  height: 160px;
  font-size: 5.2rem;
  margin: 0 auto 16px;
  border-width: 4px;
  box-shadow: var(--shadow-red);
}

.char-detail .char-standee .emoji { transform: scale(1.18) translateY(-2px); }

.detail-name { font-size: 2rem; color: var(--ink); margin-bottom: 6px; }
.detail-series { color: var(--text-medium); font-size: 1rem; margin-bottom: 10px; }
.detail-rarity {
  display: inline-block;
  padding: 6px 18px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-xl);
  color: var(--ink);
  font-family: 'ZCOOL KuaiLe', cursive;
  font-size: 1rem;
  margin-bottom: 14px;
  box-shadow: 2px 2px 0 var(--ink);
}
.detail-rarity[data-rarity="legendary"] { color: var(--paper); }

.detail-desc { color: var(--text-medium); font-size: 1rem; line-height: 1.6; margin-bottom: 16px; }

/* Teach screen */
.teach-card {
  background: var(--paper);
  border: 3px dashed var(--ink);
  border-radius: var(--radius-lg);
  margin-bottom: 18px;
  box-shadow: var(--shadow-yellow);
  overflow: hidden;
  position: relative;
}

/* 胶带装饰 */
.teach-card::after {
  content: '';
  position: absolute;
  top: -8px;
  left: 18px;
  width: 70px;
  height: 22px;
  background: rgba(255, 217, 61, 0.65);
  border: 2px dashed var(--ink);
  transform: rotate(-4deg);
  z-index: 4;
}

.teach-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  color: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  position: relative;
  overflow: hidden;
}

.teach-card-header h3 { font-size: 1.2rem; color: var(--paper); text-shadow: 1px 1px 0 var(--ink); }
.teach-badge {
  padding: 4px 10px;
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: var(--radius-xl);
  font-size: 0.75rem;
  font-weight: 700;
}

.teach-add10 { background: var(--red); }
.teach-sub10 { background: var(--teal); }
.teach-add20 { background: var(--ink); }
.teach-sub20 { background: var(--yellow); color: var(--ink); }
.teach-sub20 h3 { color: var(--ink); text-shadow: 1px 1px 0 var(--paper); }
.teach-tip { background: var(--yellow); color: var(--ink); }
.teach-tip h3 { color: var(--ink); text-shadow: 1px 1px 0 var(--paper); }

.teach-content { padding: 18px; color: var(--text-medium); font-size: 0.95rem; }

.teach-example {
  margin-top: 14px;
  padding: 14px;
  background: var(--paper-2);
  border: 2px dashed var(--ink);
  border-radius: var(--radius-md);
}

.teach-example .example-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 1.4rem;
  margin-bottom: 8px;
}

.teach-example .example-text {
  text-align: center;
  font-family: 'Fredoka', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--ink);
}

.example-steps { display: flex; flex-direction: column; gap: 8px; }
.step-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  color: var(--ink);
}
.step-num {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  background: var(--teal); color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 50%;
  font-family: 'Fredoka', sans-serif;
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.step-row.step-result { font-weight: 800; color: var(--ink); }
.step-row.step-result .step-num { background: var(--yellow); }

.example-tenframe { display: flex; flex-direction: column; align-items: center; margin-top: 12px; }

.teach-subtitle { text-align: center; color: var(--text-medium); font-weight: 700; font-size: 0.95rem; margin: 0 12px 14px; }
.teach-filter { display: flex; gap: 8px; justify-content: center; margin-bottom: 16px; flex-wrap: wrap; }
.teach-filter-btn {
  padding: 8px 16px;
  border: 2px dashed var(--ink);
  background: var(--paper);
  color: var(--text-medium);
  border-radius: var(--radius-xl);
  font-family: 'ZCOOL KuaiLe', cursive;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 3px 3px 0 rgba(44, 44, 44, 0.12);
}
.teach-filter-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 rgba(44, 44, 44, 0.12); }
.teach-filter-btn.active { background: var(--red); color: var(--paper); border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); transform: rotate(-1.5deg); }

.number-bond { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 0; }
.bond-top { width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; background: var(--ink); color: var(--paper); border: 2px solid var(--ink); border-radius: 50%; font-family: 'Fredoka', sans-serif; font-weight: 800; font-size: 1.3rem; }
.bond-branches { display: flex; gap: 26px; }
.bond-branch { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: var(--paper-2); border: 2px dashed var(--ink); border-radius: 50%; font-family: 'Fredoka', sans-serif; font-weight: 800; font-size: 1.15rem; color: var(--ink); }
.equation-row { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; font-family: 'Fredoka', sans-serif; font-weight: 800; font-size: 1.05rem; color: var(--ink); margin-top: 4px; }

/* Confetti & toast */
.confetti-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 999; overflow: hidden; }
.confetti-piece { position: absolute; top: -20px; border: 2px solid var(--ink); }

.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 22px;
  background: var(--ink);
  color: var(--paper);
  border: 2px dashed var(--paper);
  border-radius: var(--radius-xl);
  font-size: 0.95rem;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  box-shadow: 3px 3px 0 var(--red);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.hide { opacity: 0; transform: translateX(-50%) translateY(20px); }

/* Practice question bank */
.btn-practice {
  background: var(--paper);
  border-color: var(--ink);
  box-shadow: var(--shadow-teal);
}
.btn-practice .btn-icon { background: var(--teal); }

.practice-bank-header { text-align: center; margin-bottom: 16px; }
.practice-bank-subtitle { color: var(--text-medium); font-weight: 700; font-size: 0.95rem; padding: 0 12px; }
.daily-practice-panel {
  margin: 0 0 18px;
  padding: 16px 16px 18px;
  background: var(--paper);
  border: 3px dashed var(--ink);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-red);
}
.daily-practice-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.daily-practice-title-wrap { text-align: left; }
.daily-practice-title { font-family: 'ZCOOL KuaiLe', cursive; color: var(--red); font-size: 1.3rem; text-shadow: 1px 1px 0 var(--yellow); }
.daily-practice-date { margin-top: 2px; color: var(--text-medium); font-size: 0.82rem; font-weight: 700; }
.daily-practice-progress { flex: 0 0 auto; min-width: 132px; text-align: right; }
.daily-progress-count { font-family: 'Fredoka', sans-serif; font-weight: 800; color: var(--ink); font-size: 0.95rem; }
.daily-progress-bar { margin-top: 5px; height: 9px; background: var(--paper-2); border: 2px dashed var(--ink); border-radius: var(--radius-xl); overflow: hidden; }
.daily-progress-fill { display: block; width: 0%; height: 100%; background: var(--teal); border-radius: var(--radius-xl); }
.daily-question-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 14px; }
.daily-question-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 70px;
  padding: 9px 8px 8px;
  color: var(--ink);
  background: var(--paper);
  border: 2px dashed var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: 3px 3px 0 rgba(44, 44, 44, 0.12);
  font-family: 'Fredoka', sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  transition: var(--transition);
}
.daily-question-card:active { transform: translate(2px, 2px) scale(0.97); background: var(--yellow); box-shadow: 1px 1px 0 rgba(44, 44, 44, 0.12); }
.daily-q-index { font-size: 0.7rem; font-weight: 700; color: var(--ink); }
.daily-q-display { font-size: 1.05rem; }
.daily-q-check { position: absolute; top: 5px; right: 6px; font-size: 0.92rem; color: var(--teal); }
.daily-question-card.done {
  background: var(--paper-2);
  border-color: var(--teal);
  box-shadow: 3px 3px 0 var(--teal);
  opacity: 0.88;
  cursor: default;
  pointer-events: none;
}
.daily-question-card.done .daily-q-index { color: var(--teal); }
.daily-question-card:disabled {
  opacity: 0.88;
  cursor: default;
  pointer-events: none;
}
.daily-all-done {
  margin-top: 14px;
  padding: 11px 12px;
  text-align: center;
  color: var(--ink);
  background: var(--paper-2);
  border: 2px dashed var(--teal);
  border-radius: var(--radius-sm);
  font-weight: 800;
  box-shadow: 3px 3px 0 var(--teal);
}
.daily-go-gacha-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 12px 14px;
  border: 2px dashed var(--ink);
  border-radius: var(--radius-md);
  background: var(--moss);
  color: #fffdf7;
  font-family: 'ZCOOL KuaiLe', cursive;
  font-size: 1.05rem;
  font-weight: 700;
  box-shadow: 3px 3px 0 rgba(47, 64, 53, 0.25);
  cursor: pointer;
}
.daily-go-gacha-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 rgba(47, 64, 53, 0.25); }
.bank-summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 16px;
  margin: 0 0 18px;
  color: var(--ink);
  background: var(--paper);
  border: 2px dashed var(--ink);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-yellow);
  font-size: 0.96rem;
}
.bank-summary-icon { font-size: 1.6rem; }
.bank-summary strong { font-family: 'Fredoka', sans-serif; font-size: 1.35rem; }
.bank-category-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.bank-category-card {
  position: relative;
  min-height: 172px;
  overflow: hidden;
  padding: 17px 14px 14px;
  text-align: left;
  border: 3px dashed var(--ink);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-teal);
  transition: var(--transition);
}
.bank-category-card:nth-child(odd) { transform: rotate(-1deg); }
.bank-category-card:nth-child(even) { transform: rotate(1deg); }
.bank-category-card::after {
  content: '';
  position: absolute;
  width: 84px;
  height: 84px;
  right: -27px;
  bottom: -34px;
  border-radius: 50%;
  background: var(--paper-2);
  border: 2px dashed var(--ink);
}
.bank-category-card:active { transform: translate(3px, 3px) scale(0.98) rotate(0); box-shadow: 1px 1px 0 var(--teal); }
.bank-category-icon { display: block; margin-bottom: 7px; font-size: 2.35rem; }
.bank-category-title { position: relative; z-index: 1; font-family: 'ZCOOL KuaiLe', cursive; font-size: 1.1rem; color: var(--ink); }
.bank-category-description { position: relative; z-index: 1; margin-top: 4px; color: var(--text-medium); font-size: 0.78rem; font-weight: 700; }
.bank-category-count { position: relative; z-index: 1; display: inline-block; margin-top: 13px; padding: 3px 9px; color: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius-xl); font-family: 'Fredoka', sans-serif; font-size: 0.8rem; font-weight: 800; box-shadow: 2px 2px 0 var(--ink); }
.bank-list-panel { margin-top: 20px; padding: 16px; background: var(--paper); border: 3px dashed var(--ink); border-radius: var(--radius-md); box-shadow: var(--shadow-yellow); }
.bank-list-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.bank-list-title { font-family: 'ZCOOL KuaiLe', cursive; color: var(--ink); font-size: 1.25rem; }
.bank-list-meta { margin-top: 2px; color: var(--text-medium); font-size: 0.8rem; font-weight: 700; }
.bank-list-close { flex: 0 0 36px; width: 36px; height: 36px; color: var(--paper); background: var(--red); border: 2px solid var(--ink); border-radius: 50%; font-size: 1.55rem; line-height: 1; box-shadow: 2px 2px 0 var(--ink); }
.bank-question-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; max-height: 470px; overflow-y: auto; padding: 2px 2px 8px; }
.bank-question-card { min-height: 64px; padding: 8px 5px; color: var(--ink); background: var(--paper-2); border: 2px dashed var(--ink); border-radius: var(--radius-sm); box-shadow: 3px 3px 0 rgba(44, 44, 44, 0.1); font-family: 'Fredoka', sans-serif; font-size: 0.98rem; font-weight: 800; transition: var(--transition); }
.bank-question-card:active { transform: translate(2px, 2px) scale(0.97); background: var(--yellow); box-shadow: 1px 1px 0 rgba(44, 44, 44, 0.1); }
.bank-question-number { display: block; margin-bottom: 2px; color: var(--text-light); font-family: 'Nunito', sans-serif; font-size: 0.63rem; font-weight: 800; }

/* Animations */
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-16px) rotate(2deg); }
}

@keyframes twinkle {
  0%, 100% { opacity: 0.6; transform: scale(1) rotate(-4deg); }
  50% { opacity: 1; transform: scale(1.2) rotate(4deg); }
}

@keyframes sparkle-rotate {
  0% { transform: rotate(0) scale(1); opacity: 0.8; }
  50% { transform: rotate(180deg) scale(1.2); opacity: 1; }
  100% { transform: rotate(360deg) scale(1); opacity: 0.8; }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-12px) rotate(2deg); }
}

@keyframes progress-shine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@keyframes swing {
  0% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
  100% { transform: rotate(-3deg); }
}

@keyframes bounce-tap {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-12deg); }
  40% { transform: rotate(10deg); }
  60% { transform: rotate(-8deg); }
  80% { transform: rotate(4deg); }
}

@keyframes confetti-fall {
  0% { transform: translateY(0) rotate(0); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes shake-wrong {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px) rotate(-2deg); }
  40% { transform: translateX(6px) rotate(2deg); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* Responsive */
@media (max-width: 400px) {
  .bank-category-grid { gap: 9px; }
  .bank-category-card { min-height: 155px; padding: 13px 11px 11px; }
  .bank-category-title { font-size: 1rem; }
  .bank-question-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .daily-question-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .answer-prompt { display: none; }
  .numpad { grid-template-columns: repeat(5, 1fr); gap: 8px; }
  .numkey { min-height: 46px; font-size: 1.4rem; }
  .answer-actions { gap: 8px; }
  .answer-clear, .answer-submit { padding: 12px; font-size: 1rem; }
  .collection-grid { grid-template-columns: repeat(2, 1fr); }
  .question-display .num,
  .question-display .op,
  .question-display .eq,
  .question-display .qmark { font-size: 2.2rem; }
  .hero-title { font-size: 2.2rem; }
  .char-standee { width: 96px; height: 96px; font-size: 3rem; }
  .result-character .char-standee { width: 140px; height: 140px; font-size: 4.5rem; }
  .app-container::before { left: 14px; }
}

@media (min-width: 520px) {
  .collection-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ============================================================
   v14 — 温暖手绘自然童话 UI
   保留全部功能类名，仅覆盖视觉令牌与响应式布局。
   ============================================================ */
:root {
  --paper: #f8f4e8;
  --paper-2: #fffdf7;
  --ink: #314238;
  --ink-soft: #5f6d5d;
  --text-dark: #2f4035;
  --text-medium: #657464;
  --text-light: #8b9685;
  --white: #fffdf7;
  --red: #c87855;
  --teal: #6f9b79;
  --yellow: #e4b95b;
  --sky: #a9cad4;
  --moss: #567b60;
  --leaf: #dbe8c8;
  --peach: #f2c6a7;
  --blue-line: rgba(169, 202, 212, 0.17);
  --red-line: rgba(200, 120, 85, 0.18);
  --shadow-red: 0 10px 22px rgba(143, 91, 60, 0.14);
  --shadow-teal: 0 10px 24px rgba(55, 103, 73, 0.15);
  --shadow-yellow: 0 10px 24px rgba(178, 133, 46, 0.15);
  --shadow-ink: 0 10px 24px rgba(47, 64, 53, 0.15);
  --radius-sm: 13px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-xl: 36px;
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 18px;
  --space-4: 26px;
  --space-5: 40px;
  --transition: 0.22s ease-out;
}

body {
  background-color: #e9f0df;
  background-image:
    radial-gradient(circle at 12% 8%, rgba(255, 255, 255, 0.7) 0 2px, transparent 3px),
    radial-gradient(circle at 75% 13%, rgba(255, 253, 247, 0.58) 0 2px, transparent 3px),
    linear-gradient(152deg, rgba(219, 232, 200, 0.78), rgba(233, 240, 223, 0.88) 46%, rgba(215, 231, 237, 0.62));
  background-size: 37px 37px, 61px 61px, auto;
  color: var(--text-dark);
}

body::before,
body::after {
  content: '';
  position: fixed;
  z-index: -1;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(1px);
}

body::before {
  width: min(42vw, 500px);
  height: min(42vw, 500px);
  top: -190px;
  left: -150px;
  background: rgba(198, 220, 164, 0.34);
}

body::after {
  width: min(35vw, 440px);
  height: min(35vw, 440px);
  right: -130px;
  bottom: -140px;
  background: rgba(169, 202, 212, 0.34);
}

h1, h2, h3, h4 { letter-spacing: 0; }
button { touch-action: manipulation; }
button:focus-visible,
.big-btn:focus-visible,
.numkey:focus-visible,
.series-tab:focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 3px;
}

.bg-decoration { opacity: 0.5; }
.cloud { opacity: 0.36; filter: saturate(0.75) drop-shadow(0 7px 10px rgba(47, 64, 53, 0.1)); }
.star-deco { color: var(--yellow); filter: saturate(0.8); }
.balloon-deco { opacity: 0.46; filter: saturate(0.62); }
.math-deco { color: rgba(86, 123, 96, 0.22); }

.app-container {
  width: min(100% - 32px, 740px);
  max-width: 740px;
  margin: 0 auto;
  container-type: inline-size;
}
.app-container::before { display: none; }

.screen {
  padding: clamp(24px, 4vw, 44px) clamp(18px, 4vw, 34px) 132px;
  min-height: calc(100vh - 92px);
}
.screen-title {
  margin-bottom: var(--space-2);
  font-size: clamp(2rem, 4.1vw, 2.7rem);
  color: var(--ink);
  text-shadow: 0 3px 0 rgba(228, 185, 91, 0.4);
  transform: none;
}

.top-nav {
  width: min(100% - 32px, 1040px);
  min-height: 64px;
  margin: 14px auto 0;
  padding: 9px 12px 9px 16px;
  gap: 12px;
  background: rgba(255, 253, 247, 0.87);
  border: 1px solid rgba(86, 123, 96, 0.22);
  border-radius: 22px;
  box-shadow: 0 8px 24px rgba(47, 64, 53, 0.12);
  backdrop-filter: blur(12px);
}
.nav-logo {
  font-size: clamp(1.1rem, 2vw, 1.38rem);
  text-align: left;
  text-shadow: none;
  transform: none;
}
.nav-back {
  min-height: 44px;
  padding: 8px 15px;
  color: var(--moss);
  background: var(--leaf);
  border: 1px solid rgba(86, 123, 96, 0.25);
  border-radius: 14px;
  box-shadow: none;
}
.nav-back:active { transform: scale(0.96); box-shadow: none; }
.nav-stats { gap: 7px; }
.nav-stat-item {
  min-height: 40px;
  padding: 5px 10px;
  background: rgba(248, 244, 232, 0.8);
  border: 1px solid rgba(86, 123, 96, 0.17);
  border-radius: 14px;
  box-shadow: none;
}
.nav-stat-value { color: var(--moss); }
.nav-sound {
  width: 44px;
  height: 44px;
  background: var(--peach);
  border: 1px solid rgba(143, 91, 60, 0.2);
  box-shadow: none;
}

.hanging-bar { height: 92px; gap: 20px; padding: 0 max(18px, calc((100vw - 1040px) / 2)); opacity: 0.8; }
.hanging-string { height: 34px; width: 2px; background: rgba(47, 64, 53, 0.46); }
.hanging-char .char-standee { box-shadow: 0 7px 14px rgba(47, 64, 53, 0.14); }

.home-hero {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  align-items: center;
  gap: 6px 22px;
  padding: clamp(20px, 4vw, 32px);
  margin-bottom: var(--space-4);
  background: rgba(255, 253, 247, 0.72);
  border: 1px solid rgba(86, 123, 96, 0.17);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-teal);
  overflow: hidden;
  position: relative;
}
.home-hero::before {
  content: '';
  position: absolute;
  width: 180px;
  height: 180px;
  top: -92px;
  right: -60px;
  border-radius: 50%;
  background: rgba(228, 185, 91, 0.2);
}
.hero-mascot { grid-row: span 2; margin: 0; justify-self: center; }
.hero-mascot .char-standee,
.char-standee.hero-standee { border: 5px solid #fffdf7; box-shadow: 0 10px 20px rgba(47, 64, 53, 0.16); }
.hero-title { margin: 0; text-align: left; font-size: clamp(2.2rem, 5.5vw, 3.4rem); text-shadow: 0 3px 0 rgba(228, 185, 91, 0.4); }
.hero-subtitle { max-width: 480px; text-align: left; color: var(--text-medium); font-size: clamp(0.98rem, 1.8vw, 1.08rem); }
.mascot-sparkle { filter: saturate(0.7); }

.home-progress-card,
.daily-practice-panel,
.bank-summary,
.bank-list-panel,
.question-card,
.mode-select,
.learn-complete,
.teach-card,
.modal-content,
.reveal-result {
  background: rgba(255, 253, 247, 0.9);
  border: 1px solid rgba(86, 123, 96, 0.19);
  box-shadow: var(--shadow-teal);
}
.home-progress-card {
  padding: clamp(18px, 3vw, 26px);
  border-radius: var(--radius-md);
}
.home-progress-card::before { background: rgba(219, 232, 200, 0.76); }
.progress-card-title { color: var(--moss); }
.progress-bar-wrap,
.learn-progress-bar,
.daily-progress-bar { background: rgba(86, 123, 96, 0.13); border: none; }
.progress-bar-fill,
.learn-progress-fill,
.daily-progress-fill { background: linear-gradient(90deg, var(--moss), var(--teal)); }
.progress-info-item { background: rgba(219, 232, 200, 0.42); border-radius: 14px; }

.home-actions { display: grid; gap: 14px; }
.big-btn {
  min-height: 90px;
  padding: 16px 18px;
  align-items: center;
  background: rgba(255, 253, 247, 0.9);
  border: 1px solid rgba(86, 123, 96, 0.2);
  border-radius: 20px;
  box-shadow: 0 7px 17px rgba(47, 64, 53, 0.11);
  overflow: hidden;
}
.big-btn::before { opacity: 0.18; }
.big-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 22px rgba(47, 64, 53, 0.16); }
.big-btn:active { transform: translateY(1px) scale(0.99); box-shadow: 0 4px 10px rgba(47, 64, 53, 0.12); }
.btn-learn { border-left: 7px solid var(--moss); }
.btn-collection { border-left: 7px solid var(--sky); }
.btn-practice { border-left: 7px solid var(--yellow); }
.btn-teach { border-left: 7px solid var(--red); }
.btn-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 17px; background: rgba(219, 232, 200, 0.5); }
.btn-title { color: var(--ink); font-size: clamp(1.15rem, 2.4vw, 1.35rem); }
.btn-sub { color: var(--text-medium); }
.btn-arrow { color: var(--moss); }

.mode-cards { gap: 14px; }
.mode-card {
  min-height: 155px;
  padding: 19px 16px;
  background: rgba(255, 253, 247, 0.92);
  border: 1px solid rgba(86, 123, 96, 0.2);
  border-radius: 20px;
  box-shadow: 0 8px 18px rgba(47, 64, 53, 0.1);
}
.mode-card:hover { transform: translateY(-3px); box-shadow: 0 12px 22px rgba(47, 64, 53, 0.15); }
.mode-card-icon { color: var(--moss); }
.mode-card-title { color: var(--ink); }
.mode-card-tag, .question-mode-badge, .teach-badge { background: var(--leaf); color: var(--moss); border-color: rgba(86, 123, 96, 0.24); }

.question-card { border-radius: var(--radius-lg); }
.question-display { color: var(--ink); }
.visual-aid { background: rgba(219, 232, 200, 0.3); border-radius: 18px; }
.numkey {
  min-height: 58px;
  border: 1px solid rgba(86, 123, 96, 0.2);
  border-radius: 16px;
  background: rgba(255, 253, 247, 0.92);
  box-shadow: 0 4px 10px rgba(47, 64, 53, 0.1);
}
.numkey:active { transform: scale(0.96); background: var(--leaf); }
.answer-clear, .answer-submit, .next-btn, .modal-btn, .modal-close {
  min-height: 48px;
  border-radius: 15px;
  border: 1px solid rgba(47, 64, 53, 0.16);
  box-shadow: 0 5px 12px rgba(47, 64, 53, 0.12);
}
.answer-submit, .next-btn, .modal-btn { background: var(--moss); color: #fffdf7; }
.answer-clear, .modal-close { background: var(--peach); color: var(--ink); }

.gacha-machine { max-width: 540px; margin-inline: auto; filter: saturate(0.82); }
.gacha-dome { background: rgba(255, 253, 247, 0.58); border-color: rgba(86, 123, 96, 0.45); box-shadow: inset 0 0 30px rgba(169, 202, 212, 0.22); }
.gacha-body { background: var(--moss); border-color: #3c6048; box-shadow: 0 12px 22px rgba(47, 64, 53, 0.2); }
.capsule { box-shadow: 0 6px 11px rgba(47, 64, 53, 0.18); }
.gacha-prompt { background: rgba(255, 253, 247, 0.82); border-color: rgba(86, 123, 96, 0.19); box-shadow: var(--shadow-yellow); }

.teach-filter { gap: 9px; padding: 5px 0 14px; }
.teach-filter-btn {
  min-height: 42px;
  padding: 8px 14px;
  background: rgba(255, 253, 247, 0.7);
  border: 1px solid rgba(86, 123, 96, 0.18);
  border-radius: 999px;
  box-shadow: none;
}
.series-tab.active, .teach-filter-btn.active { background: var(--moss); color: #fffdf7; border-color: var(--moss); }
.collection-grid { gap: 16px; }
.blind-box-card { background: rgba(255, 253, 247, 0.9); border-color: rgba(86, 123, 96, 0.18); box-shadow: 0 7px 15px rgba(47, 64, 53, 0.1); }
.blind-box-card:hover { transform: translateY(-3px); box-shadow: 0 12px 20px rgba(47, 64, 53, 0.14); }

.daily-practice-panel { border-radius: var(--radius-md); }
.daily-practice-title { color: var(--moss); }
.daily-question-card, .bank-question-card {
  min-height: 68px;
  background: rgba(248, 244, 232, 0.76);
  border: 1px solid rgba(86, 123, 96, 0.18);
  border-radius: 14px;
  box-shadow: none;
}
.daily-question-card:active, .bank-question-card:active { background: var(--leaf); box-shadow: none; }
.bank-category-card {
  min-height: 182px;
  padding: 20px 18px;
  background: rgba(255, 253, 247, 0.88);
  border: 1px solid rgba(86, 123, 96, 0.19);
  border-radius: 20px;
  box-shadow: 0 8px 18px rgba(47, 64, 53, 0.1);
}
.bank-category-card:nth-child(odd), .bank-category-card:nth-child(even) { transform: none; }
.bank-category-card::after { background: rgba(219, 232, 200, 0.45); border: none; }
.bank-category-count { background: var(--moss); color: #fffdf7; border: none; box-shadow: none; }

.teach-subtitle { color: var(--text-medium); text-align: center; margin: -2px auto 18px; }
.teach-card { margin-bottom: 18px; border-radius: 22px; overflow: hidden; }
.teach-card::after { opacity: 0.15; }
.teach-card-header { padding: 15px 19px; }
.teach-add10 { background: var(--moss); }
.teach-sub10 { background: #8ba66c; }
.teach-add20 { background: #739cab; }
.teach-sub20 { background: #c9955e; }
.teach-tip { background: #b87961; }
.teach-card-header h3 { text-shadow: none; }
.teach-content { padding: 19px; }
.teach-example { background: rgba(219, 232, 200, 0.32); border-radius: 16px; }
.step-num, .bond-top, .bond-branch { background: var(--moss); }

.modal-overlay { padding: 22px; background: rgba(40, 60, 45, 0.42); backdrop-filter: blur(5px); }
.modal-content { width: min(100%, 560px); border-radius: 26px; }
.char-detail-modal { max-height: min(86vh, 690px); overflow-y: auto; }
.reveal-result { border-radius: 24px; }
.result-glow { opacity: 0.35; }

@container (min-width: 600px) {
  .home-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .big-btn { min-height: 118px; }
  .big-btn .btn-sub { font-size: 0.86rem; }
  .mode-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grade-cards { grid-template-columns: 1fr; }
  .daily-question-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .bank-category-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .bank-category-card { min-height: 208px; }
  .bank-question-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); max-height: 540px; }
  .teach-card { margin-bottom: 20px; }
}

@media (min-width: 768px) {
  .app-container { width: min(100% - 52px, 1060px); max-width: 1060px; }
  .screen { padding: 42px 0 110px; min-height: calc(100vh - 86px); }
  .home-hero { grid-template-columns: 180px minmax(0, 1fr); gap: 8px 30px; padding: 34px 42px; }
  .hero-mascot .char-standee, .char-standee.hero-standee { width: 150px; height: 150px; font-size: 5rem; }
  #screen-home { display: none; }
  #screen-home.active { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr); gap: 22px; align-content: start; }
  #screen-home .home-hero { grid-column: 1 / -1; }
  #screen-home .home-progress-card { margin: 0; align-self: stretch; }
  #screen-home .home-actions { margin: 0; align-content: start; }
  #screen-home .home-today-status { grid-column: 1 / -1; }
  .home-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .big-btn { min-height: 132px; align-content: center; }
  .big-btn .btn-icon { width: 58px; height: 58px; font-size: 1.7rem; }
  .mode-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .mode-card { min-height: 185px; }
  .question-card { max-width: 760px; margin-inline: auto; padding: 34px; }
  .numpad { max-width: 620px; margin-inline: auto; }
  .answer-actions { max-width: 620px; margin-inline: auto; }
  .gacha-machine { transform: scale(1.06); transform-origin: top center; margin-top: 34px; }
  .gacha-prompt { margin-top: 56px; }
  .collection-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; }
  .daily-practice-head { align-items: center; }
  .daily-question-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .bank-question-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .teach-filter { justify-content: center; }
  #screen-teach { display: none; }
  #screen-teach.active { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 22px; align-items: start; }
  #screen-teach .screen-title, #screen-teach .teach-subtitle, #screen-teach .teach-filter { grid-column: 1 / -1; }
  #screen-teach .teach-card { margin-bottom: 22px; }
  #screen-teach .teach-card[data-stage="all"] { grid-column: 1 / -1; }
}

@media (min-width: 1024px) {
  .app-container { width: min(100% - 72px, 1180px); max-width: 1180px; }
  .top-nav { width: min(100% - 72px, 1180px); }
  .screen { padding-top: 48px; }
  .collection-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .bank-question-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .daily-question-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

@media (min-width: 768px) and (max-width: 1023px) and (orientation: portrait) {
  .top-nav { width: min(100% - 40px, 900px); }
  .app-container { width: min(100% - 40px, 900px); }
  .collection-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .gacha-machine { transform: scale(0.98); margin-top: 12px; }
}

@media (max-width: 560px) {
  .top-nav { width: calc(100% - 20px); margin-top: 8px; border-radius: 18px; }
  .nav-logo { overflow: hidden; text-overflow: ellipsis; }
  .nav-stat-item { padding: 5px 7px; }
  .nav-stat-total { display: none; }
  .nav-back { padding: 8px 10px; font-size: 0; }
  .nav-back::first-letter { font-size: 1.05rem; }
  .app-container { width: min(100% - 18px, 740px); }
  .screen { padding: 22px 6px 118px; }
  .home-hero { grid-template-columns: 94px minmax(0, 1fr); gap: 6px 14px; padding: 18px; border-radius: 22px; }
  .hero-mascot .char-standee, .char-standee.hero-standee { width: 92px; height: 92px; font-size: 3rem; }
  .hero-title { font-size: 2.12rem; }
  .hero-subtitle { font-size: 0.87rem; line-height: 1.55; }
  .big-btn { min-height: 84px; padding: 13px; }
  .btn-icon { width: 44px; height: 44px; border-radius: 14px; }
  .btn-sub { font-size: 0.75rem; }
  .daily-question-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bank-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bank-question-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .modal-overlay { padding: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ============================================================
   纸片人展示层（盲盒角色在页面底部左右走动）
   ============================================================ */
.paper-doll-layer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 172px;
  pointer-events: none;
  z-index: 300;
}

.paper-doll-mover {
  position: absolute;
  left: 10px;
  bottom: 28px;
  width: 96px;
  height: 120px;
  will-change: transform;
}

.paper-doll-bob {
  width: 100%;
  height: 100%;
  transform-origin: 50% 100%;
  will-change: transform;
}

.paper-doll-body {
  width: 96px;
  height: 96px;
  border: 4px solid var(--ink);
  border-radius: 50% 50% 46% 46% / 58% 58% 42% 42%;
  background: #fffdf0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 4px 4px 0 rgba(44, 44, 44, 0.18);
  position: relative;
  overflow: hidden;
}

.paper-doll-body .emoji {
  font-size: 3.2rem;
  line-height: 1;
  filter: drop-shadow(2px 2px 0 rgba(44, 44, 44, 0.12));
  transform: translateY(-1px);
}

.paper-doll-img {
  position: absolute;
  inset: 3px;
  width: calc(100% - 6px);
  height: calc(100% - 6px);
  object-fit: contain;
  border-radius: inherit;
}

.paper-doll-shadow {
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: 74px;
  height: 14px;
  transform: translateX(-50%);
  background: rgba(44, 44, 44, 0.18);
  border-radius: 50%;
}

.paper-doll-tip {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'ZCOOL KuaiLe', cursive;
  font-size: 0.82rem;
  color: var(--ink);
  background: var(--paper);
  border: 2px dashed var(--ink);
  padding: 2px 12px;
  border-radius: 999px;
  box-shadow: 2px 2px 0 rgba(44, 44, 44, 0.15);
  white-space: nowrap;
  pointer-events: none;
}

.paper-doll-close {
  position: absolute;
  top: 8px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: var(--red);
  color: var(--paper);
  font-size: 1.2rem;
  font-weight: 900;
  line-height: 1;
  pointer-events: auto;
  box-shadow: 2px 2px 0 rgba(44, 44, 44, 0.2);
  z-index: 2;
  transition: transform var(--transition);
}
.paper-doll-close:active { transform: translate(2px, 2px); }

/* 展示按钮（与收藏区分） */
.modal-btn-show { background: var(--teal); box-shadow: var(--shadow-red); }

/* 降级动画（无 GSAP / 减少动效时） */
@keyframes dollSlide {
  from { transform: translateX(0); }
  to { transform: translateX(calc(100vw - 120px)); }
}
@keyframes dollWobble {
  0%, 100% { transform: rotate(-6deg) translateY(0); }
  50% { transform: rotate(6deg) translateY(-8px); }
}
.paper-doll-mover.walking {
  animation: dollSlide 10s linear infinite alternate;
  will-change: transform;
}
.paper-doll-bob.walking-wobble {
  animation: dollWobble 0.55s ease-in-out infinite;
  will-change: transform;
}
/* 即使系统开启「减少动效」，仍保留纸片人左右走动（核心玩法） */
@media (prefers-reduced-motion: reduce) {
  .paper-doll-mover.walking {
    animation: dollSlide 12s linear infinite alternate !important;
    animation-duration: 12s !important;
    animation-iteration-count: infinite !important;
  }
  .paper-doll-bob.walking-wobble {
    animation: none !important;
  }
}

/* 平板 / 桌面：纸片人略放大 */
@media (min-width: 768px) {
  .paper-doll-layer { height: 200px; }
  .paper-doll-mover { width: 116px; height: 146px; bottom: 34px; }
  .paper-doll-body { width: 116px; height: 116px; }
  .paper-doll-body .emoji { font-size: 4rem; }
  .paper-doll-shadow { width: 90px; bottom: 22px; }
  .paper-doll-tip { font-size: 0.95rem; }
}
