/* ============================================================
   For Sarah · 全局样式
   暖色 / 可爱 / 一点点游戏感，桌面与手机通用
   ============================================================ */
:root {
  --bg-top: #fdf6ff;
  --bg-bottom: #ffeef5;
  --card: #ffffff;
  --ink: #3d2c4d;
  --muted: #8a7696;
  --pink: #ff8fb2;
  --pink-deep: #f26d9c;
  --gold: #f5b942;
  --gold-deep: #d99a24;
  --teal: #5cc8c0;
  --line: #f0e0ee;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(120, 70, 110, 0.14);
  --shadow-soft: 0 4px 14px rgba(120, 70, 110, 0.10);
}

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

html, body { height: 100%; }

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  min-height: 100%;
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
button { font-family: inherit; }

/* ---------- 通用按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  padding: 12px 26px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--pink), var(--pink-deep));
  box-shadow: 0 6px 18px rgba(242, 109, 156, 0.35);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  user-select: none;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.05); }
.btn:active { transform: translateY(0) scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn.gold { background: linear-gradient(135deg, var(--gold), var(--gold-deep)); box-shadow: 0 6px 18px rgba(217, 154, 36, 0.35); }
.btn.ghost { background: #fff; color: var(--pink-deep); box-shadow: var(--shadow-soft); }
.btn.small { padding: 8px 18px; font-size: 14px; }

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 18px 48px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

/* ============================================================
   首页
   ============================================================ */
.home-hero { text-align: center; padding: 26px 0 8px; }
.home-hero h1 {
  font-size: 34px;
  letter-spacing: 2px;
  background: linear-gradient(135deg, var(--pink-deep), #a96bd8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.home-hero p { color: var(--muted); margin-top: 6px; }

.chest-area { text-align: center; margin: 26px 0 8px; }
.chest-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  border-radius: 24px;
  transition: transform 0.2s ease;
}
.chest-btn:hover { transform: scale(1.04); }
.chest-btn:active { transform: scale(0.97); }
.chest-btn.shake { animation: shake 0.5s ease; }

.chest {
  position: relative;
  width: 210px;
  height: 168px;
  margin: 0 auto;
  perspective: 500px;
}
.chest-lid {
  position: absolute;
  top: 0;
  left: 8%;
  width: 84%;
  height: 42%;
  background: linear-gradient(180deg, #c68a4a, #9c6226);
  border-radius: 22px 22px 8px 8px;
  transform-origin: 50% 100%;
  z-index: 3;
  transition: transform 0.9s cubic-bezier(0.5, -0.2, 0.4, 1.2), box-shadow 0.5s ease;
  box-shadow: inset 0 4px 8px rgba(255, 230, 180, 0.45), 0 4px 10px rgba(90, 50, 20, 0.25);
}
.chest-lid::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  top: 30%;
  height: 10px;
  background: rgba(90, 50, 20, 0.25);
  border-radius: 6px;
}
.chest-base {
  position: absolute;
  bottom: 0;
  left: 4%;
  width: 92%;
  height: 58%;
  background: linear-gradient(180deg, #b57a3c, #7c4b1e);
  border-radius: 0 0 18px 18px;
  box-shadow: inset 0 6px 10px rgba(255, 230, 180, 0.35), 0 10px 22px rgba(90, 50, 20, 0.28);
}
.chest-base::before {
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  top: 14%;
  height: 6px;
  background: rgba(90, 50, 20, 0.35);
  border-radius: 4px;
}
.chest-lock {
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 30px;
  z-index: 4;
  transition: filter 0.4s ease;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.25));
}
.chest.ready .chest-lid {
  box-shadow: inset 0 4px 8px rgba(255, 230, 180, 0.45), 0 0 26px rgba(255, 210, 90, 0.9);
}
.chest.open .chest-lid { transform: rotateX(-165deg); }
.chest.open .chest-lock { filter: drop-shadow(0 0 8px #ffe27a); }
.chest-glow {
  position: absolute;
  inset: -18px;
  border-radius: 40px;
  background: radial-gradient(circle, rgba(255, 214, 110, 0.55), transparent 65%);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}
.chest.ready .chest-glow { opacity: 1; animation: glowPulse 1.6s ease-in-out infinite; }

.chest-status { margin-top: 14px; font-size: 15px; font-weight: 700; letter-spacing: 1px; color: var(--muted); }
.chest-status.ready { color: var(--gold-deep); }
.chest-hint { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* ---------- 钥匙列表 ---------- */
.keys { margin-top: 28px; }
.keys h2 { font-size: 18px; margin-bottom: 14px; text-align: center; }
.key-list { display: grid; gap: 12px; }
.key-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  padding: 14px 16px;
  border: 2px solid var(--line);
}
.key-card .key-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: #fdf1f6;
  flex: 0 0 auto;
}
.key-card .key-info { flex: 1; min-width: 0; }
.key-card .key-label { font-size: 12px; color: var(--muted); font-weight: 700; letter-spacing: 1px; }
.key-card .key-name { font-weight: 700; font-size: 16px; }
.key-card .key-state { font-size: 13px; color: var(--muted); }
.key-card.done { border-color: #b9e8c8; background: #f3fff7; }
.key-card.done .key-icon { background: #e2f8ea; }
.key-card.done .key-state { color: #2f9e5f; font-weight: 700; }
.key-card.locked .key-state { color: var(--muted); }

/* ============================================================
   游戏通用
   ============================================================ */
.game-head { text-align: center; margin-bottom: 18px; }
.game-head h1 { font-size: 24px; }
.game-head p { color: var(--muted); font-size: 14px; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 10px;
}
.back-link:hover { color: var(--pink-deep); }

.progress-dots { display: flex; justify-content: center; gap: 8px; margin: 14px 0 18px; }
.progress-dots .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); transition: background 0.3s ease, transform 0.3s ease; }
.progress-dots .dot.on { background: var(--pink); transform: scale(1.25); }
.progress-dots .dot.ok { background: #7fd6a8; }

.q-note { color: var(--muted); font-size: 13px; margin-top: 6px; }
.option-btn {
  display: block;
  width: 100%;
  text-align: left;
  border: 2px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  margin-top: 10px;
  font-size: 15px;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.12s ease, background 0.2s ease;
}
.option-btn:hover { border-color: var(--pink); }
.option-btn:active { transform: scale(0.99); }
.option-btn.right { border-color: #5ecb8a; background: #e9fbf1; }
.option-btn.wrong { border-color: #f2748c; background: #ffeff3; animation: shake 0.4s ease; }
.option-img {
  display: block;
  width: 100%;
  height: 130px;
  object-fit: cover;
  object-position: center;
  border-radius: 10px;
  margin-bottom: 8px;
  background: #f6ecfa;
}
.option-text { display: block; }

@media (max-width: 420px) {
  .option-img { height: 110px; }
}

.date-row { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.date-row input {
  flex: 1;
  min-width: 180px;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease;
}
.date-row input:focus { border-color: var(--pink); }

.feedback { margin-top: 12px; font-size: 14px; min-height: 22px; }
.feedback.right { color: #2f9e5f; }
.feedback.wrong { color: #e0556f; }

/* ---------- 完成覆盖层 ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(61, 44, 77, 0.72);
  backdrop-filter: blur(4px);
  padding: 20px;
}
.overlay.show { display: flex; animation: fadeIn 0.35s ease; }
.overlay-card {
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  padding: 30px 26px;
  text-align: center;
  max-width: 420px;
  width: 100%;
  position: relative;
  animation: popIn 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.overlay-card .big-emoji { font-size: 64px; line-height: 1.1; }
.overlay-card h2 { margin: 10px 0 6px; font-size: 22px; }
.overlay-card p { color: var(--muted); font-size: 14px; }
.overlay-card .btn-row { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.overlay-card .key-line { font-size: 20px; font-weight: 800; color: var(--gold-deep); margin-top: 8px; }

/* ============================================================
   抓娃娃机
   ============================================================ */
.machine {
  background: linear-gradient(180deg, #8d5bb8, #6f3fa0);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 12px 12px 16px;
}
.machine-banner {
  text-align: center;
  color: #ffe9a8;
  font-weight: 800;
  letter-spacing: 3px;
  font-size: 15px;
  padding: 4px 0 10px;
}
.machine-window {
  background: linear-gradient(180deg, #eaf7ff, #d3ecf9);
  border-radius: 14px;
  padding: 6px;
  box-shadow: inset 0 2px 8px rgba(40, 70, 110, 0.25);
}
#clawCanvas { width: 100%; height: auto; display: block; border-radius: 10px; background: #eaf7ff; }

.machine-controls { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; }
.dir-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: var(--pink-deep);
  font-size: 24px;
  font-weight: 800;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  user-select: none;
  transition: transform 0.1s ease;
}
.dir-btn:active { transform: scale(0.9); }
#grabBtn { min-width: 128px; font-size: 17px; }

.claw-msg { text-align: center; margin-top: 14px; min-height: 24px; font-weight: 700; color: var(--ink); }

/* ============================================================
   拼图
   ============================================================ */
.puzzle-toolbar { display: flex; gap: 10px; justify-content: center; margin-bottom: 14px; flex-wrap: wrap; }
.puzzle-board {
  display: grid;
  gap: 3px;
  background: #f7ecfa;
  padding: 8px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  margin: 0 auto;
  max-width: 460px;
  aspect-ratio: 4 / 3;
}
.pcell {
  border-radius: 4px;
  background-size: cover;
  background-position: center;
  aspect-ratio: 4 / 3;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.pcell:active { transform: scale(0.96); }
.pcell.selected { box-shadow: 0 0 0 3px var(--pink); z-index: 2; transform: scale(1.03); }
.pcell.solved { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.4); }
.puzzle-info { display: flex; justify-content: space-between; margin-top: 12px; color: var(--muted); font-size: 13px; }
.hint-img {
  position: fixed;
  inset: 0;
  background: rgba(30, 20, 40, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 40;
  padding: 20px;
}
.hint-img.show { display: flex; animation: fadeIn 0.25s ease; }
.hint-img img { max-width: 100%; max-height: 80vh; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.4); }

/* ============================================================
   宝箱页
   ============================================================ */
.chest-stage { text-align: center; padding-top: 30px; }
.chest-stage .chest { width: 260px; height: 208px; }
.chest-stage .chest-status { font-size: 16px; margin-top: 18px; }
.key-chips { display: flex; justify-content: center; gap: 14px; margin-top: 24px; }
.key-chip {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: #f3e9f7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  opacity: 0.35;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.3, 1.2, 0.4, 1);
}
.key-chip.active { opacity: 1; transform: translateY(0); }
.flash {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle, #fff8dd, #ffd166 40%, transparent 75%);
  opacity: 0;
  pointer-events: none;
  z-index: 30;
}
.flash.go { animation: flashOut 1s ease forwards; }
.chest-cta { margin-top: 26px; display: none; }
.chest-cta.show { display: block; animation: popIn 0.5s ease; }

/* ============================================================
   手书页
   ============================================================ */
.hb-page { position: fixed; inset: 0; overflow: hidden; }
.hb-entry {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 30%, #ffe3f0, #f7e6ff 60%, #e3e8ff);
  z-index: 20;
  padding: 24px;
  text-align: center;
}
.hb-entry .big { font-size: 60px; }
.hb-entry h1 { font-size: 28px; margin: 12px 0 6px; }
.hb-entry p { color: var(--muted); margin-bottom: 22px; }

.hb-stage {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: background 1.2s ease;
}
.theme-sg { background: linear-gradient(180deg, #a8d8ff 0%, #ffe3b3 70%, #ffc98f 100%); }
.theme-flight { background: linear-gradient(180deg, #22305c 0%, #4c5f9e 60%, #8a97c8 100%); }
.theme-shanghai { background: linear-gradient(180deg, #3b1d52 0%, #a3416e 60%, #ff9d76 100%); }
.theme-thailand { background: linear-gradient(180deg, #ffe9b8 0%, #8fd9c6 60%, #7ec4e8 100%); }

.hb-emoji {
  position: absolute;
  font-size: 30px;
  opacity: 0.65;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.18));
  animation: floaty 3.2s ease-in-out infinite;
}
.hb-char {
  position: absolute;
  bottom: 6%;
  left: -25%;
  width: clamp(64px, 16vw, 112px);
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.28));
  z-index: 6;
  will-change: left;
}
.hb-char .walker { animation: walkBob 0.5s ease-in-out infinite; }
.hb-char img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.95)) drop-shadow(0 0 3px rgba(255, 255, 255, 0.8)) drop-shadow(0 3px 6px rgba(0, 0, 0, 0.28));
}
.hb-char.walk-right { animation: walkRight var(--walk-dur, 10s) linear forwards; }
.hb-char.walk-left { animation: walkLeft var(--walk-dur, 10s) linear forwards; }
.hb-char.posing { animation-play-state: paused; }
.hb-char.posing .walker { animation: poseSway 1.2s ease-in-out infinite; }

.hb-shadow {
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 72%;
  height: 12px;
  background: radial-gradient(ellipse, rgba(20, 10, 30, 0.38), transparent 70%);
  animation: shadowPulse 0.45s ease-in-out infinite;
  pointer-events: none;
}

.hb-pose {
  position: absolute;
  bottom: calc(100% - 8px);
  left: 60%;
  font-size: 34px;
  opacity: 0;
  transform: scale(0.3);
  transition: opacity 0.2s ease, transform 0.2s ease;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.3));
  pointer-events: none;
}
.hb-char.posing .hb-pose {
  opacity: 1;
  animation: poseWiggle 0.55s ease-in-out infinite;
}

.hb-camhint {
  position: absolute;
  bottom: 41%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(40, 20, 50, 0.68);
  color: #fff;
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 13px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 7;
  pointer-events: none;
}
.hb-camhint.show { opacity: 1; animation: glowPulse 1s ease-in-out infinite; }

.cam-btn {
  position: absolute;
  bottom: 26%;
  left: 50%;
  transform: translateX(-50%);
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff8fb2, #f26d9c);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  padding: 10px 24px;
  box-shadow: 0 6px 18px rgba(242, 109, 156, 0.45);
  cursor: pointer;
  z-index: 8;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.cam-btn.show {
  opacity: 1;
  pointer-events: auto;
  animation: camPulse 1.4s ease-in-out infinite;
}
.cam-btn:active { transform: translateX(-50%) scale(0.94); }

.hb-flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
}
.hb-flash.go { animation: photoFlash 0.5s ease-out forwards; }

.polaroid {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%) rotate(-4deg) scale(0.4);
  background: #fff;
  padding: 10px 10px 14px;
  border-radius: 6px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.45);
  width: min(300px, 64vw);
  z-index: 12;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.polaroid-photo {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 2px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}
.polaroid-sarah {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  height: 80%;
  width: auto;
  filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.95)) drop-shadow(0 0 3px rgba(255, 255, 255, 0.8)) drop-shadow(0 3px 6px rgba(0, 0, 0, 0.28));
}
.polaroid-peace {
  position: absolute;
  top: 6%;
  right: 20%;
  font-size: 40px;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
}
.polaroid-cap {
  text-align: center;
  font-size: 12px;
  color: #6b5a76;
  margin-top: 8px;
  font-weight: 700;
}
.polaroid.show { opacity: 1; transform: translate(-50%, -50%) rotate(-3deg) scale(1); }
.polaroid.shrink { transform: translate(-50%, -50%) rotate(0deg) scale(0.2); opacity: 0; }

.filmstrip {
  position: absolute;
  right: 8px;
  top: auto;
  bottom: 36%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 46%;
  overflow: hidden;
  z-index: 8;
  pointer-events: none;
}
.filmstrip .mini {
  width: 56px;
  background: #fff;
  padding: 3px 3px 6px;
  border-radius: 4px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
  transform: rotate(var(--rot, -2deg));
  animation: popIn 0.35s ease;
}
.mini-photo {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  border-radius: 1px;
}
.mini-sarah {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  height: 72%;
  width: auto;
  filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.95)) drop-shadow(0 0 2px rgba(255, 255, 255, 0.8));
}
.mini-peace {
  position: absolute;
  top: 2%;
  right: 10%;
  font-size: 13px;
}

.lyrics {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: auto;
  height: 36%;
  background: linear-gradient(180deg, rgba(20, 10, 35, 0.85) 0%, rgba(20, 10, 35, 0.6) 45%, rgba(20, 10, 35, 0) 100%);
  overflow: hidden;
  z-index: 7;
  --line-h: 42px;
}
.lyrics-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  will-change: transform;
  transition: transform 0.65s cubic-bezier(0.3, 1, 0.4, 1);
}
.lyric-line {
  height: var(--line-h);
  line-height: var(--line-h);
  padding: 0 14px;
  text-align: center;
  color: #f6ecff;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.5s ease, color 0.3s ease;
}

.record {
  position: relative;
  width: 210px;
  height: 210px;
  margin: 0 auto 16px;
}
.record-disc {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-radial-gradient(circle at 50% 50%, #23232c 0 2px, #101016 2px 4px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4), inset 0 0 0 2px #3a3a46;
  animation: spin 9s linear infinite;
}
.record-disc::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 210deg, transparent 0deg, rgba(255, 255, 255, 0.14) 24deg, transparent 46deg, transparent 180deg, rgba(255, 255, 255, 0.08) 205deg, transparent 230deg);
}
.record-label {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffd6e6, #f26d9c 72%, #d44d85);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.65), 0 5px 12px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-align: center;
  z-index: 2;
}
.record-hole {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
  z-index: 3;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.25);
}
.record-hash { font-size: 10px; opacity: 0.9; line-height: 1; }
.record-title { font-size: 13px; font-weight: 800; line-height: 1.15; }
.record-sub { font-size: 9px; opacity: 0.95; line-height: 1.1; }

.entry-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }

.cal-panel {
  position: fixed;
  inset: 0;
  background: rgba(61, 44, 77, 0.82);
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.cal-panel.show { display: flex; }
.cal-card {
  background: #fff;
  border-radius: 22px;
  padding: 24px;
  max-width: 460px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.cal-hint { color: var(--muted); font-size: 13px; margin-top: 6px; }
.cal-line {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fdf1f6;
  border-radius: 14px;
  padding: 12px;
  margin: 14px 0;
}
.cal-count { color: var(--muted); font-size: 13px; }
.cal-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.cal-status { color: #2f9e5f; font-size: 13px; min-height: 20px; margin-top: 10px; }
.cal-json {
  width: 100%;
  height: 90px;
  font-size: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  margin-top: 10px;
  font-family: Consolas, monospace;
  display: none;
  box-sizing: border-box;
}
.cal-json.show { display: block; }

.cake-piece {
  position: fixed;
  top: -70px;
  z-index: 70;
  pointer-events: none;
  animation: cakeFall linear forwards;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.22));
}
@keyframes cakeFall {
  to { transform: translateY(118vh) rotate(420deg); }
}

@keyframes walkRight { from { left: -25%; } to { left: 108%; } }
@keyframes walkLeft { from { left: 108%; } to { left: -25%; } }
@keyframes walkBob {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  25% { transform: translateY(-4px) rotate(-1deg); }
  50% { transform: translateY(-9px) rotate(3deg); }
  75% { transform: translateY(-4px) rotate(1deg); }
}
@keyframes shadowPulse {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.8; }
  50% { transform: translateX(-50%) scale(0.86); opacity: 0.55; }
}
@keyframes poseWiggle {
  0%, 100% { transform: scale(1.15) rotate(-8deg); }
  50% { transform: scale(1.25) rotate(8deg); }
}
@keyframes poseSway {
  0%, 100% { transform: translateY(-3px) rotate(-4deg); }
  50% { transform: translateY(-8px) rotate(4deg); }
}
@keyframes camPulse {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.05); }
}
@keyframes photoFlash {
  0% { opacity: 0; }
  18% { opacity: 0.95; }
  100% { opacity: 0; }
}
@keyframes spin { to { transform: rotate(360deg); } }

.hb-label {
  position: absolute;
  bottom: 32%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  padding: 8px 20px;
  font-weight: 800;
  font-size: 16px;
  box-shadow: var(--shadow-soft);
  white-space: nowrap;
  max-width: 90vw;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 8;
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.hb-label.hide { opacity: 0; transform: translateX(-50%) translateY(-10px); }

.hb-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: rgba(255, 255, 255, 0.4);
  z-index: 9;
}
.hb-progress .bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--pink), var(--gold)); transition: width 0.3s linear; }

.hb-controls { position: absolute; top: 14px; right: 14px; z-index: 9; display: flex; gap: 8px; }
.hb-controls button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.88);
  font-size: 17px;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}

.hb-final {
  position: absolute;
  inset: 0;
  z-index: 15;
  display: none;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.97), rgba(255, 233, 245, 0.96));
  padding: 24px;
  text-align: center;
}
.hb-final.show { display: flex; animation: fadeIn 0.8s ease; }
.hb-final .big { font-size: 72px; }
.hb-final h2 { font-size: 30px; margin: 10px 0; }
.hb-final .final-msg { color: var(--muted); max-width: 420px; margin: 0 auto 22px; font-size: 15px; }

/* ============================================================
   特效与动画
   ============================================================ */
.confetti {
  position: fixed;
  top: -12px;
  z-index: 60;
  border-radius: 2px;
  pointer-events: none;
  animation: fall linear forwards;
}
@keyframes fall {
  to { transform: translateY(105vh) rotate(720deg); }
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}
@keyframes glowPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}
@keyframes beat {
  0%, 100% { transform: translateX(-50%) translateY(0) scale(1, 1); }
  50% { transform: translateX(-50%) translateY(-16px) scale(1.04, 0.94); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn {
  0% { opacity: 0; transform: scale(0.7); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes flashOut {
  0% { opacity: 0; }
  30% { opacity: 1; }
  100% { opacity: 0; }
}

/* ---------- 小屏幕适配 ---------- */
@media (max-width: 420px) {
  .wrap { padding: 16px 12px 36px; }
  .home-hero h1 { font-size: 28px; }
  .chest { width: 176px; height: 142px; }
  .chest-stage .chest { width: 220px; height: 176px; }
  .hb-char { bottom: 5%; width: clamp(52px, 14vw, 90px); }
  .lyrics { height: 34%; --line-h: 34px; }
  .lyric-line { font-size: 13px; }
  .hb-label { bottom: 32%; font-size: 14px; }
  .cam-btn { bottom: 26%; font-size: 13px; padding: 8px 18px; }
  .filmstrip { bottom: 34%; }
  .filmstrip .mini { width: 46px; }
  .key-card { padding: 12px; }
  .key-card .key-icon { width: 42px; height: 42px; font-size: 20px; }
  #grabBtn { min-width: 100px; }
  .dir-btn { width: 50px; height: 50px; }
}
