:root {
  --ink: #3b3357;
  --ink-soft: #7a6f96;
  --paper: #fffdf8;
  --card: #ffffff;
  --line: rgba(80, 60, 120, 0.12);
  --primary: #ff8fb1;
  --primary-deep: #f2668f;
  --accent: #6fc3ff;
  --sun: #ffd166;
  --mint: #7ddb8a;
  --radius: 20px;
  --shadow: 0 6px 0 rgba(80, 60, 120, 0.10), 0 12px 24px rgba(80, 60, 120, 0.10);
  --shadow-sm: 0 3px 0 rgba(80, 60, 120, 0.10);
  --tap: 52px;
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1100px 600px at 10% -10%, #ffe6f2 0%, rgba(255, 230, 242, 0) 60%),
    radial-gradient(900px 520px at 100% 0%, #dff1ff 0%, rgba(223, 241, 255, 0) 55%),
    linear-gradient(180deg, #fdf7ff 0%, #f2f7ff 100%);
  background-attachment: fixed;
  overscroll-behavior-y: none;
}

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
h1, h2, p { margin: 0; }

.ico {
  width: 1.5em;
  height: 1.5em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

#app { max-width: 1120px; margin: 0 auto; padding: 12px 14px 20px; }

.screen { display: none; }
.screen.is-active { display: block; animation: screenIn .28s ease; }
@keyframes screenIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- 通用按钮 ---------- */
.icon-btn {
  width: var(--tap);
  height: var(--tap);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  display: grid;
  place-items: center;
  color: var(--ink);
  font-size: 18px;
  transition: transform .12s ease;
}
.icon-btn:active { transform: translateY(3px); box-shadow: none; }
.icon-btn.off { color: var(--ink-soft); }

.star-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: var(--tap);
  padding: 0 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, #fff3c4, #ffe08a);
  box-shadow: var(--shadow-sm);
  color: #8a5a12;
  font-size: 18px;
}
.star-pill .ico { fill: #ffb347; stroke: #e8912a; width: 1.2em; height: 1.2em; }
.star-pill b { font-size: 20px; }

.big-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 0 20px;
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  font-size: 17px;
  font-weight: 600;
}
.big-btn:active { transform: translateY(3px); box-shadow: none; }
.big-btn.primary { background: linear-gradient(180deg, #ffa8c4, var(--primary-deep)); color: #fff; }
.big-btn.danger { color: #e05a6a; }
.big-btn.ghost { color: var(--ink-soft); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
}
.chip .ico { width: 1.15em; height: 1.15em; }
.chip.is-active { background: linear-gradient(180deg, #bfe4ff, var(--accent)); color: #fff; }

.tool-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 60px;
  min-height: 58px;
  padding: 6px 10px;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
}
.tool-btn .ico { width: 22px; height: 22px; }
.tool-btn.is-active { background: linear-gradient(180deg, #ffe1a8, var(--sun)); color: #8a5a12; }
.tool-btn:active { transform: translateY(3px); box-shadow: none; }

/* ---------- 地图 ---------- */
.map-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 6px 2px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffd7e8, var(--primary));
  color: #fff;
  box-shadow: var(--shadow-sm);
  font-size: 20px;
}
.brand h1 { font-size: 28px; letter-spacing: 2px; }
.map-head-actions { display: flex; align-items: center; gap: 8px; }
.map-tip { color: var(--ink-soft); font-size: 15px; padding: 0 4px 12px; }

.world-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.world-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: left;
  transition: transform .14s ease;
  overflow: hidden;
}
.world-card:active { transform: translateY(4px); box-shadow: var(--shadow-sm); }
.world-thumb {
  display: block;
  aspect-ratio: 120 / 86;
  border-radius: 16px;
  overflow: hidden;
  background: var(--sky);
}
.world-card-body { display: flex; flex-direction: column; gap: 8px; }
.world-card-name { display: flex; align-items: center; gap: 6px; font-size: 17px; }
.world-card-name .ico { width: 20px; height: 20px; color: var(--primary-deep); }
.world-dots { display: flex; gap: 6px; }
.world-dots i {
  width: 26px; height: 26px;
  border-radius: 9px;
  display: grid; place-items: center;
  background: #f1eef8;
  color: #b6aecb;
}
.world-dots i .ico { width: 15px; height: 15px; }
.world-dots i.on { background: linear-gradient(180deg, #b9edc4, var(--mint)); color: #2f7a42; }
.world-ribbon {
  position: absolute;
  top: 14px; right: 14px;
  width: 32px; height: 32px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(180deg, #fff3c4, #ffc94d);
  color: #b06f10;
  box-shadow: var(--shadow-sm);
}
.world-ribbon .ico { fill: #fff6d8; width: 18px; height: 18px; }

/* ---------- 世界头部 ---------- */
.world-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0 10px;
}
.world-title { display: flex; align-items: center; gap: 8px; font-size: 21px; flex: 1; min-width: 0; }
.world-title b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.world-ico { display: grid; place-items: center; color: var(--primary-deep); font-size: 18px; }
.world-head-actions { display: flex; align-items: center; gap: 8px; }
.album-count { color: var(--ink-soft); font-size: 15px; }

/* ---------- 舞台 ---------- */
.stage-wrap { position: relative; }
.stage {
  position: relative;
  border-radius: 26px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--sky-a, #bfeaff), var(--sky-b, #e8f8dc));
  box-shadow: var(--shadow);
  transition: max-height .3s ease;
}
.stage svg#sceneSvg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 44vh;
  touch-action: none;
  user-select: none;
}
.stage.mini svg#sceneSvg { max-height: 24vh; }

.ambient { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.amb {
  position: absolute;
  width: var(--size);
  height: var(--size);
  background: var(--c);
  opacity: .8;
  animation-duration: var(--dur);
  animation-delay: var(--delay);
  animation-iteration-count: infinite;
  animation-timing-function: linear;
}
.amb-leaf { border-radius: 60% 10% 60% 10%; top: -12%; animation-name: ambFall; }
.amb-snow { border-radius: 50%; top: -8%; animation-name: ambFall; }
.amb-dust { border-radius: 50%; bottom: -10%; opacity: .5; animation-name: ambRise; }
.amb-heart { border-radius: 50% 50% 50% 0; transform: rotate(-45deg); bottom: -10%; animation-name: ambRise; }
.amb-bubble { border-radius: 50%; background: transparent; border: 2px solid var(--c); bottom: -12%; animation-name: ambRise; }
.amb-star, .amb-spark, .amb-sparkle {
  border-radius: 50%;
  top: calc(var(--size) * 2);
  animation-name: ambTwinkle;
  animation-timing-function: ease-in-out;
  box-shadow: 0 0 10px var(--c);
}
.amb-spark { top: 30%; }
.amb-sparkle { top: 20%; }
@keyframes ambFall {
  0% { transform: translate(0, -20px) rotate(0deg); opacity: 0; }
  10% { opacity: .85; }
  100% { transform: translate(var(--drift), 420px) rotate(240deg); opacity: 0; }
}
@keyframes ambRise {
  0% { transform: translate(0, 20px) scale(.7); opacity: 0; }
  15% { opacity: .8; }
  100% { transform: translate(var(--drift), -420px) scale(1.1); opacity: 0; }
}
@keyframes ambTwinkle {
  0%, 100% { transform: scale(.4); opacity: .2; }
  50% { transform: scale(1.2); opacity: 1; }
}

.speech {
  position: absolute;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  max-width: 86%;
  padding: 10px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .95);
  box-shadow: var(--shadow-sm);
  font-size: 17px;
  font-weight: 600;
  text-align: center;
  pointer-events: none;
}
.speech.show { animation: speechIn .3s ease; }
@keyframes speechIn { from { opacity: 0; transform: translate(-50%, -10px) scale(.9); } to { opacity: 1; transform: translateX(-50%) scale(1); } }

.stage-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.stage-flash.flash { animation: flash .45s ease; }
@keyframes flash { 0% { opacity: .85; } 100% { opacity: 0; } }

.photo-btn {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 60px; height: 60px;
  border-radius: 22px;
  display: grid; place-items: center;
  background: linear-gradient(180deg, #fff, #ffe9f2);
  color: var(--primary-deep);
  box-shadow: var(--shadow);
  font-size: 22px;
}
.photo-btn:active { transform: translateY(4px); box-shadow: var(--shadow-sm); }

.particle {
  position: absolute;
  width: 12px; height: 12px;
  border-radius: 4px;
  pointer-events: none;
  animation: particleFly 1.2s ease-out forwards;
}
@keyframes particleFly {
  0% { transform: translate(0, 0) scale(.4) rotate(0); opacity: 1; }
  100% { transform: translate(var(--px), var(--py)) scale(1.1) rotate(220deg); opacity: 0; }
}

/* ---------- 准备条 ---------- */
.prep-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 8px;
  margin: 12px 0;
}
.prep-step {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 54px;
  padding: 6px 8px;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
}
.prep-ico {
  width: 30px; height: 30px;
  border-radius: 11px;
  display: grid; place-items: center;
  background: #f1eef8;
  color: #b6aecb;
  flex: none;
}
.prep-ico .ico { width: 17px; height: 17px; }
.prep-step.done { color: #2f7a42; }
.prep-step.done .prep-ico { background: linear-gradient(180deg, #b9edc4, var(--mint)); color: #fff; }
.prep-step.pulse { animation: prepPulse .7s ease 2; }
@keyframes prepPulse {
  0%, 100% { transform: none; box-shadow: var(--shadow-sm); }
  50% { transform: translateY(-4px); box-shadow: 0 0 0 4px rgba(255, 209, 102, .55); }
}
.prep-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.adventure-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  padding: 0 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, #e9e4f5, #d8d1ea);
  color: #7a6f96;
  box-shadow: var(--shadow-sm);
  font-size: 17px;
}
.adventure-btn .ico { width: 22px; height: 22px; }
.adventure-btn.ready {
  background: linear-gradient(180deg, #ffb0cd, var(--primary-deep));
  color: #fff;
  animation: readyGlow 1.8s ease-in-out infinite;
}
.adventure-btn.done.ready { background: linear-gradient(180deg, #ffd98a, #f5a623); }
.adventure-btn.busy { opacity: .7; }
.adventure-btn:active { transform: translateY(3px); box-shadow: none; }
@keyframes readyGlow {
  0%, 100% { box-shadow: 0 3px 0 rgba(80, 60, 120, .1), 0 0 0 0 rgba(255, 143, 177, .5); }
  50% { box-shadow: 0 3px 0 rgba(80, 60, 120, .1), 0 0 0 10px rgba(255, 143, 177, 0); }
}

/* ---------- 工具区 ---------- */
.tools { min-height: 150px; }
.tool-row { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; align-items: center; }
.layer-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  padding: 6px 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, #eef4ff, #dfe9fb);
  color: #5b6b96;
  font-size: 13px;
  font-weight: 600;
}
.layer-chip .ico { width: 17px; height: 17px; }

.block-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 12px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.block-strip::-webkit-scrollbar { height: 8px; }
.block-strip::-webkit-scrollbar-thumb { background: rgba(120, 100, 160, .25); border-radius: 8px; }
.block-card {
  position: relative;
  flex: none;
  width: 86px;
  padding: 6px 4px 8px;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  scroll-snap-align: start;
}
.block-art { display: flex; align-items: flex-end; justify-content: center; width: 100%; height: 96px; }
.block-art svg { display: block; max-width: 100%; max-height: 100%; }
.block-name { font-size: 13px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; }
.block-card.is-active { background: linear-gradient(180deg, #fff0f6, #ffd7e8); box-shadow: 0 0 0 3px var(--primary), var(--shadow-sm); }
.block-card.is-active .block-name { color: var(--primary-deep); }
.block-card:active { transform: translateY(3px); }
.special-card { width: 96px; background: linear-gradient(180deg, #fffaf0, #fff1d6); }
.special-card .block-art svg { width: 72px; height: 64px; }
.special-card.locked { filter: grayscale(.65); opacity: .75; }
.card-badge {
  position: absolute;
  top: 4px; right: 4px;
  width: 22px; height: 22px;
  border-radius: 8px;
  display: grid; place-items: center;
  background: var(--mint);
  color: #fff;
}
.card-badge .ico { width: 14px; height: 14px; stroke-width: 3; }
.card-badge.lock { background: #b6aecb; }

/* ---------- 拼图 ---------- */
.puzzle-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.size-switch { display: flex; gap: 8px; }
.puzzle-actions { display: flex; gap: 8px; }
.puzzle-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.puzzle-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--n), 1fr);
  gap: 4px;
  aspect-ratio: 1;
  width: min(100%, 42vh);
  justify-self: center;
  padding: 8px;
  border-radius: 22px;
  background: linear-gradient(180deg, #fff, #f4f0fb);
  box-shadow: var(--shadow);
}
.board-ghost { position: absolute; inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px); opacity: .22; border-radius: 14px; pointer-events: none; }
.eyes-closed { display: none; }
.doll.blink .eyes-open { display: none; }
.doll.blink .eyes-closed { display: inline; }
.slot {
  position: relative;
  border-radius: 10px;
  background: rgba(255, 255, 255, .35);
  border: 2px dashed rgba(120, 100, 160, .3);
  overflow: hidden;
  padding: 0;
  aspect-ratio: 1;
}
.slot svg { display: block; width: 100%; height: 100%; }
.slot.filled { border: 0; background: none; animation: snapIn .28s ease; }
.slot.hint { border-color: var(--sun); background: rgba(255, 209, 102, .35); animation: hintPulse .8s ease-in-out infinite; }
.slot.shake { animation: shake .32s ease; }
.puzzle-board.done { box-shadow: 0 0 0 4px var(--mint), var(--shadow); }
@keyframes snapIn { from { transform: scale(.82); } 60% { transform: scale(1.05); } to { transform: scale(1); } }
@keyframes hintPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 179, 71, .6); } 50% { box-shadow: 0 0 0 8px rgba(255, 179, 71, 0); } }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.puzzle-side { display: flex; flex-direction: column; gap: 10px; }
.puzzle-tip { font-size: 14px; color: var(--ink-soft); }
.tray { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 8px; width: min(100%, 38vh); }
.piece {
  padding: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-sm);
  aspect-ratio: 1;
  transition: transform .12s ease;
}
.piece svg { display: block; width: 100%; height: 100%; }
.piece.is-active { box-shadow: 0 0 0 4px var(--primary), var(--shadow-sm); transform: translateY(-4px) scale(1.04); }
.tray-empty { aspect-ratio: 1; border-radius: 12px; background: rgba(120, 100, 160, .07); }
.puzzle-done {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 16px;
  border-radius: 20px;
  background: linear-gradient(180deg, #eafbee, #d6f5de);
  color: #2f7a42;
  box-shadow: var(--shadow-sm);
  font-size: 17px;
}
.puzzle-done .ico { width: 28px; height: 28px; stroke-width: 3; }

/* ---------- 换装 ---------- */
.dress-wrap { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; }
.dress-preview {
  position: relative;
  border-radius: 22px;
  background: linear-gradient(180deg, #fff, #f6f1ff);
  box-shadow: var(--shadow);
  padding: 8px;
  aspect-ratio: 1;
}
.dress-preview .dice { position: absolute; right: 8px; bottom: 8px; }
.dress-right { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cat-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 10px;
}
.option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.option-doll { display: block; width: 62px; height: 62px; }
.swatch { display: block; width: 46px; height: 46px; border-radius: 16px; box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .08); }
.option-name { font-size: 12px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; }
.option.is-active { box-shadow: 0 0 0 3px var(--primary), var(--shadow-sm); background: linear-gradient(180deg, #fff0f6, #ffe4ee); }
.option.locked { filter: grayscale(.7); opacity: .7; }
.dress-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #8a5a12;
  background: linear-gradient(180deg, #fff6dd, #ffedc2);
  padding: 10px 12px;
  border-radius: 14px;
}
.dress-hint .ico { width: 18px; height: 18px; }

/* ---------- 底部导航 ---------- */
.tabbar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
  padding: 8px;
  border-radius: 24px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 58px;
  justify-content: center;
  border-radius: 18px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
}
.tab .ico { width: 24px; height: 24px; }
.tab.is-active { background: linear-gradient(180deg, #ffd7e8, var(--primary)); color: #fff; box-shadow: var(--shadow-sm); }

/* ---------- 相册 ---------- */
.album-body { padding-bottom: 20px; }
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.album-item {
  padding: 8px;
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.album-item img { width: 100%; border-radius: 14px; display: block; }
.album-item-cap { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.album-item-cap .ico { width: 16px; height: 16px; }
.album-item.story .album-item-cap { color: #b06f10; }
.album-item.story .album-item-cap .ico { fill: var(--sun); }
.album-item:active { transform: translateY(3px); box-shadow: var(--shadow-sm); }
.empty { text-align: center; color: var(--ink-soft); padding: 60px 20px; display: grid; gap: 8px; justify-items: center; }
.empty .ico { width: 54px; height: 54px; color: #cfc7e0; }
.empty-tip { font-size: 14px; }

/* ---------- 弹窗 ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(50, 38, 74, .5);
  backdrop-filter: blur(3px);
  animation: screenIn .2s ease;
}
.modal[hidden] { display: none; }
.modal-card {
  position: relative;
  width: min(560px, 100%);
  max-height: 92vh;
  overflow: auto;
  padding: 18px;
  border-radius: 28px;
  background: var(--paper);
  box-shadow: 0 20px 50px rgba(40, 28, 66, .35);
  text-align: center;
}
.photo-card img { width: 100%; border-radius: 18px; display: block; }
.photo-caption { padding: 10px 0 14px; font-size: 17px; font-weight: 700; }
.modal-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.reward-card h2 { font-size: 26px; padding-bottom: 12px; }
.reward-items { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; padding-bottom: 12px; }
.reward-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px;
  border-radius: 20px;
  background: linear-gradient(180deg, #fff, #fff2f7);
  box-shadow: var(--shadow-sm);
  font-size: 15px;
  animation: rewardPop .4s ease backwards;
}
.reward-item:nth-child(2) { animation-delay: .12s; }
.reward-item:nth-child(3) { animation-delay: .24s; }
.reward-art { display: block; width: 110px; height: 110px; }
@keyframes rewardPop { from { transform: scale(.6) translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.reward-tip { color: var(--ink-soft); font-size: 15px; padding-bottom: 14px; }
.reward-burst { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.reward-burst i {
  position: absolute;
  left: 50%; top: 30%;
  width: 10px; height: 10px;
  border-radius: 3px;
  background: var(--sun);
  transform-origin: 0 0;
  animation: burstOut 1s ease-out forwards;
}
.reward-burst i:nth-child(3n) { background: var(--primary); }
.reward-burst i:nth-child(3n+1) { background: var(--accent); }
@keyframes burstOut {
  0% { transform: rotate(var(--a)) translateX(0) scale(.4); opacity: 1; }
  100% { transform: rotate(var(--a)) translateX(180px) scale(1); opacity: 0; }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  z-index: 50;
  max-width: 88vw;
  padding: 12px 20px;
  border-radius: 18px;
  background: rgba(59, 51, 87, .92);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}
.toast[hidden] { display: none; }
.toast.show { animation: toastIn .25s ease; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translateX(-50%); } }

/* ---------- 场景内动画 ---------- */
.cell.pop { animation: cellPop .3s ease; transform-box: fill-box; transform-origin: 50% 100%; }
.ghost { opacity: .5; }
@keyframes cellPop { 0% { transform: translateY(-14px) scale(.9); } 60% { transform: translateY(2px) scale(1.03); } 100% { transform: none; } }

.doll-body { transform-box: fill-box; transform-origin: 50% 100%; animation: dollIdle 3.4s ease-in-out infinite; }
@keyframes dollIdle { 0%, 100% { transform: translateY(0) scaleY(1); } 50% { transform: translateY(-2px) scaleY(1.02); } }
.doll.walking .doll-body { animation: dollWalk .32s ease-in-out infinite; }
@keyframes dollWalk { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-6px) rotate(3deg); } }
.doll.happy .doll-body { animation: dollJump .62s ease-in-out infinite; }
@keyframes dollJump { 0%, 100% { transform: translateY(0) scaleY(.96); } 40% { transform: translateY(-16px) scaleY(1.04); } }
.doll-preview .doll-body { animation: dollIdle 3s ease-in-out infinite; }
.special-art { transform-box: fill-box; transform-origin: 50% 100%; animation: specialFloat 4s ease-in-out infinite; }
@keyframes specialFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.sway { transform-box: fill-box; transform-origin: 50% 50%; animation: sway 3s ease-in-out infinite; }
@keyframes sway { 0%, 100% { transform: translateX(-2px) rotate(-3deg); } 50% { transform: translateX(2px) rotate(3deg); } }

/* ---------- 平板 ---------- */
@media (max-width: 900px) {
  .world-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dress-wrap { grid-template-columns: 190px minmax(0, 1fr); }
  .stage svg#sceneSvg { max-height: 42vh; }
}

/* ---------- 窄屏 375px ---------- */
@media (max-width: 560px) {
  :root { --tap: 46px; --radius: 16px; }
  #app { padding: 8px 10px 16px; }
  .brand h1 { font-size: 22px; }
  .brand-mark { width: 40px; height: 40px; font-size: 17px; }
  .map-tip { font-size: 13px; padding-bottom: 8px; }
  .world-grid { gap: 10px; }
  .world-card { padding: 8px; border-radius: 18px; }
  .world-card-name { font-size: 15px; }
  .world-dots i { width: 22px; height: 22px; }
  .world-title { font-size: 18px; }
  .stage { border-radius: 20px; }
  .stage svg#sceneSvg { max-height: 34vh; }
  .stage.mini svg#sceneSvg { max-height: 20vh; }
  .photo-btn { width: 50px; height: 50px; border-radius: 18px; font-size: 18px; right: 8px; bottom: 8px; }
  .speech { font-size: 14px; padding: 8px 12px; top: 8px; }
  .prep-bar { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .prep-step { flex-direction: column; gap: 2px; min-height: 60px; font-size: 12px; padding: 6px 2px; }
  .prep-ico { width: 26px; height: 26px; }
  .adventure-btn { grid-column: 1 / -1; justify-content: center; min-height: 50px; }
  .tool-btn { min-width: 54px; min-height: 52px; font-size: 11px; padding: 4px 8px; }
  .block-card { width: 76px; }
  .block-art { height: 78px; }
  .special-card { width: 86px; }
  .special-card .block-art svg { width: 64px; height: 58px; }
  .puzzle-body { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .puzzle-board { width: min(100%, 34vh); }
  .tray { width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dress-wrap { grid-template-columns: minmax(0, 1fr); }
  .dress-preview { max-width: 190px; margin: 0 auto; width: 100%; }
  .cat-row { padding-bottom: 6px; }
  .cat-row .chip { flex: none; white-space: nowrap; padding: 0 10px; font-size: 14px; }
  .option-grid { grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 8px; }
  .option-doll { width: 52px; height: 52px; }
  .swatch { width: 40px; height: 40px; }
  .tabbar { padding: 6px; border-radius: 20px; }
  .tab { min-height: 52px; font-size: 13px; }
  .album-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .modal-card { padding: 14px; border-radius: 22px; }
  .reward-card h2 { font-size: 22px; }
  .reward-art { width: 84px; height: 84px; }
  .toast { bottom: 84px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .amb, .doll-body, .special-art, .sway, .adventure-btn.ready { animation: none !important; }
}