/* ====== 本地字体（离线可用，替代 Google Fonts）====== */
@font-face {
  font-family: 'ZCOOL KuaiLe';
  src: url('assets/fonts/ZCOOLKuaiLe-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Baloo 2';
  src: url('assets/fonts/Baloo2.woff2') format('woff2');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
/* ====== 基础重置与变量 ====== */
:root {
  --pink: #FFD6E2;
  --pink-deep: #FF9FB5;
  --cream: #FFF8F3;
  --blue: #D6ECFA;
  --blue-deep: #9CD3F0;
  --yellow: #FFF3B0;
  --yellow-deep: #FFCD5C;
  --purple: #E5D9F2;
  --purple-deep: #C8A8E9;
  --green: #D7F2D8;
  --text: #5D4A6E;
  --text-light: #8E7BA3;
  --white: #FFFFFF;
  --shadow-soft: 0 6px 18px rgba(255, 192, 209, 0.35);
  --shadow-card: 0 4px 14px rgba(155, 130, 180, 0.18);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;

  /* ====== 自适应主题变量（随背景切换，混合方案） ======
     默认值为原版樱花粉马卡龙；运行时由 app.js 按背景重写 */
  --accent:   #FF9FB5;   /* 主强调色 */
  --accent-2: #C8A8E9;   /* 次强调色（渐变搭配） */
  --accent-3: #9CD3F0;   /* 第三色 */
  --soft:     #FFF0F5;   /* 卡片浅色调 */
  --soft-2:   #FFF5F8;   /* 卡片第二浅色调 */
  --page-1:   #FFE4EC;   /* 页面渐变·上 */
  --page-2:   #F3E5F5;   /* 页面渐变·中 */
  --page-3:   #D6ECFA;   /* 页面渐变·下 */

  /* —— 面板类主题变量（由 JS derivePanelVars 按场景主色实时派生；此处为默认马卡龙值）—— */
  --panel-bg:        rgba(255,255,255,0.85);  /* 卡片/状态栏底色 */
  --panel-bg-strong: rgba(255,255,255,0.95);  /* 底部导航底色（更实） */
  --panel-border:    #ffe2ec;                 /* 卡片/按钮描边 */
  --nav-shadow:      rgba(255,192,209,0.30);  /* 导航/企鹅光环阴影 */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: 'ZCOOL KuaiLe', 'Baloo 2', 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', 'Noto Sans SC', sans-serif;
  background: linear-gradient(180deg, var(--page-1) 0%, var(--page-2) 50%, var(--page-3) 100%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  overflow-x: hidden;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select { font-family: inherit; }

.muted { color: var(--text-light); font-size: 0.85rem; margin-bottom: 8px; }
.empty-hint { color: var(--text-light); font-size: 0.9rem; padding: 14px; text-align: center; }

/* ====== App 容器 ====== */
.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 12px 14px 96px;
  min-height: 100vh;
  position: relative;
}

/* ====== 顶部 ====== */
.topbar { text-align: center; padding: 16px 0 8px; }
.title-wrap { display: flex; align-items: center; justify-content: center; gap: 10px; }
.title-icon { font-size: 1.4rem; min-width: 1.6rem; text-align: center; display: inline-block; animation: decorBob 3.2s ease-in-out infinite; }
.title-icon img.deco-img { width: 26px; height: 26px; display: inline-block; vertical-align: middle; }
#navStar img.deco-img { width: 24px; height: 24px; display: block; }
@keyframes decorBob { 0%,100%{ transform: translateY(0) rotate(-4deg); } 50%{ transform: translateY(-4px) rotate(4deg); } }
@keyframes spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.title {
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(120deg, var(--accent), var(--accent-2), var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 2px;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.35);
}
.subtitle {
  color: var(--text-light);
  font-size: 0.85rem;
  margin-top: 4px;
  letter-spacing: 2px;
}

/* ====== 状态栏 ====== */
.status-bar {
  background: var(--panel-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin: 10px 0;
  box-shadow: var(--shadow-card);
  border: 2px solid rgba(255,255,255,0.85);
  position: relative;
  overflow: hidden;
}
/* 角落小装饰：让状态栏更软萌 */
.status-bar::before {
  content: '🌸';
  position: absolute;
  right: 8px; top: 4px;
  font-size: 1.1rem;
  opacity: .55;
  transform: rotate(12deg);
}
/* 状态栏：四部分等宽等高（2×2 网格），不超出界面 */
.status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.status-item {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-radius: 18px;
  padding: 9px 14px;
  border: 2px solid rgba(255,255,255,.9);
  box-shadow: 0 4px 14px rgba(214,170,200,.25);
  min-width: 0;
  transition: transform .15s ease;
}
.status-item:active { transform: scale(.98); }
/* 每项柔和主题色 + 顶部小彩条 */
.si-name   { background: linear-gradient(135deg,#fff2f7,#ffe7f1); }
.si-aff    { background: linear-gradient(135deg,#fff0f4,#ffdce7); }
.si-hunger { background: linear-gradient(135deg,#fff7ec,#ffeccf); }
.si-mood   { background: linear-gradient(135deg,#f4efff,#e9e1ff); }
.status-item::before {
  content: ''; position: absolute; left: 0; top: 0; width: 100%; height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.si-name::before   { background: linear-gradient(90deg,#ff9ec0,#ffc4da); }
.si-aff::before    { background: linear-gradient(90deg,#ff8fab,#ffb3c6); }
.si-hunger::before { background: linear-gradient(90deg,#ffb877,#ffd6a3); }
.si-mood::before   { background: linear-gradient(90deg,#b79bff,#d9c6ff); }
.status-label { font-size: .82rem; font-weight: 700; color: var(--text); white-space: nowrap; display: flex; align-items: center; gap: 4px; letter-spacing: .5px; }
.status-content {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  min-width: 0;
}
.status-input {
  flex: 1;
  width: 100%;
  border: none;
  background: rgba(255,255,255,.6);
  border-radius: 14px;
  font-size: 1.6rem;
  line-height: 1.1;
  color: var(--text);
  font-weight: 700;
  text-align: center;
  outline: none;
  min-width: 0;
  padding: 4px 6px;
  box-shadow: inset 0 1px 4px rgba(180,140,160,.2);
  transition: background .2s;
}
.status-input:focus { background: rgba(255,255,255,.92); }
/* 好感 / 饥饿：只读糖果进度条（宽度=实际值，不可手动设置），颜色随值渐变 0深红→100舒绿 */
.bar {
  flex: 1;
  position: relative;
  height: 16px;
  border-radius: 999px;
  background: rgba(255,255,255,.75);
  box-shadow: inset 0 1px 3px rgba(180,140,160,.28);
  overflow: hidden;
  min-width: 0;
}
.bar.danger { background: #f4cccc; } /* 0 分：危险浅红底 */
.bar-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 50%;
  border-radius: 999px;
  background: #ff8fab;
  box-shadow: inset 0 2px 4px rgba(255,255,255,.5);
  transition: width .4s ease, background .4s ease;
}
.meter-val {
  font-weight: 800;
  font-size: 0.9rem;
  min-width: 30px;
  text-align: center;
  color: var(--text);
  background: rgba(255,255,255,.85);
  border-radius: 999px;
  padding: 1px 7px;
}
/* 心情：自动判定的表情展示 */
.mood-content { justify-content: center; min-height: 44px; }
.mood-display {
  font-size: 2.7rem;
  line-height: 1;
  animation: mood-pop 0.4s ease;
  filter: drop-shadow(0 3px 5px rgba(150,120,180,.3));
}
@keyframes mood-pop {
  0% { transform: scale(0.6); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.quick-stats {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.badge-mini {
  background: linear-gradient(135deg, #fff, var(--soft));
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.85rem;
  border: 1.5px solid #ffe2ec;
  box-shadow: 0 2px 6px rgba(255,200,215,0.4);
}
.badge-mini b { color: var(--accent); margin-left: 4px; }
.badge-mini.on {
  background: linear-gradient(135deg, #e8f9ec, #d6f3df);
  border-color: #9fe0b4;
  color: #2e9e63;
  box-shadow: 0 2px 6px rgba(120,210,160,0.5);
}

/* ====== 背景区 ====== */
.bg-section { margin: 12px 0; }
.bg-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  background: var(--cream);
}
.bg-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: opacity 0.5s;
}
/* 随场景主色晕染的柔光层：顶部一抹主色光晕 + 底部同色沉降，soft-light 混合保持克制 */
.scene-wash {
  position: absolute; inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% 0%, var(--accent-3) 0%, transparent 60%),
    linear-gradient(180deg, transparent 55%, var(--page-3) 100%);
  opacity: 0.18;
  mix-blend-mode: soft-light;
  transition: background 0.5s;
}
.penguin-wrap {
  position: absolute;
  left: 50%;
  bottom: 8%;
  transform: translateX(-50%);
  width: 38%;
  aspect-ratio: 1 / 1.1;
  display: flex;
  align-items: end;
  justify-content: center;
  z-index: 5;
  /* 企鹅脚下的「舞台光环」随场景主色变化，柔和不抢画面 */
  filter: drop-shadow(0 10px 18px var(--nav-shadow));
}
.penguin-idle {
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  will-change: transform;
}
.penguin-img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 6px 8px rgba(0,0,0,0.15));
  transition: opacity 0.3s;
  pointer-events: auto;
  cursor: pointer;
}
/* 各姿态待机动画：仅用 transform（挤压拉伸/跳跃/摇摆/踮脚），绝不改变形象与体型 */
.penguin-idle.idle-back   { animation: idleBack  2.8s ease-in-out infinite; transform-origin: 50% 100%; }
.penguin-idle.idle-greet  { animation: idleGreet 1.6s ease-in-out infinite; transform-origin: 50% 100%; }
.penguin-idle.idle-calm   { animation: idleCalm  3.2s ease-in-out infinite; transform-origin: 50% 100%; }
.penguin-idle.idle-cry    { animation: idleCry   1.8s ease-in-out infinite; transform-origin: 50% 100%; }
.penguin-idle.idle-pet    { animation: idlePet   2.2s ease-in-out infinite; transform-origin: 50% 100%; }
.penguin-idle.idle-angry  { animation: idleAngry 0.5s ease-in-out infinite; transform-origin: 50% 100%; }
.penguin-idle.idle-eat    { animation: idleEat   0.85s ease-in-out infinite; transform-origin: 50% 100%; }
.penguin-idle.idle-laugh  { animation: idleLaugh 1.5s ease-in-out infinite; transform-origin: 50% 100%; }
/* 睡觉(idle-sleep) 不挂任何待机动画：保持不动 */
.pet-hint {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255,255,255,0.9);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 14px;
  border: 2px solid var(--accent);
  white-space: nowrap;
  animation: hintPulse 1.4s ease-in-out infinite;
  pointer-events: none;
}
.pet-hint.hide { display: none; }
@keyframes hintPulse {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: 1; }
  50% { transform: translateX(-50%) scale(1.08); opacity: 0.7; }
}
/* 背对：轻轻扭屁股——以脚为轴左右摇摆带小幅横移（位移用百分比，主屏/缩略图自适应） */
@keyframes idleBack {
  0%, 100% { transform: rotate(-3.5deg) translateX(-1.5%); }
  50%      { transform: rotate(3.5deg)  translateX(1.5%); }
}
/* 打招呼：挥手问好——身体左右大幅摇摆（两拍快挥），像举起小手招手 */
@keyframes idleGreet {
  0%   { transform: rotate(-9deg) translateY(-1%); animation-timing-function: ease-in-out; }
  18%  { transform: rotate(9deg)  translateY(0);   animation-timing-function: ease-in-out; }
  36%  { transform: rotate(-9deg) translateY(-1%); animation-timing-function: ease-in-out; }
  54%  { transform: rotate(9deg)  translateY(0);   animation-timing-function: ease-in-out; }
  72%  { transform: rotate(-9deg) translateY(-0.5%); }
  100% { transform: rotate(-9deg) translateY(-1%); }
}
/* 平静：呼吸——柔和缩放（带挤压拉伸，像毛绒一起一伏） */
@keyframes idleCalm {
  0%, 100% { transform: scale(1, 1); }
  50%      { transform: scale(1.03, 1.045); }
}
/* 哭泣：抽泣——先停顿，再两下小下沉+轻颤，再停顿（带呼吸感） */
@keyframes idleCry {
  0%, 32%  { transform: translateY(0) rotate(0); }
  42%      { transform: translateY(1.2%) rotate(-1.5deg); }
  52%      { transform: translateY(0) rotate(1.2deg); }
  62%      { transform: translateY(1%) rotate(-1deg); }
  72%, 100% { transform: translateY(0) rotate(0); }
}
/* 求抚摸：求抱抱——蹲下(缩)→踮脚伸手够高(伸)，渴望的小弹跳（撒娇够抱） */
@keyframes idlePet {
  0%, 100% { transform: scale(1.07, 0.9)  translateY(1.5%); }   /* 蹲下，手垂着 */
  45%      { transform: scale(0.94, 1.1)  translateY(-2.5%); }  /* 踮脚伸手够高 */
  70%      { transform: scale(1.02, 0.98) translateY(0.3%); }   /* 回落撒娇 */
}
/* 生气：快速抖+两三下小跺脚 */
@keyframes idleAngry {
  0%, 100% { transform: rotate(-3.5deg) translateY(0); }
  25%      { transform: rotate(3.5deg)  translateY(-1%); }
  50%      { transform: rotate(-3.5deg) translateY(0); }
  75%      { transform: rotate(3.5deg)  translateY(-1%); }
}
/* 吃东西：点头咀嚼——快速小幅下沉+压扁回弹（嚼嚼嚼） */
@keyframes idleEat {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  35%      { transform: translateY(1%) scale(1.04, 0.95); }
  70%      { transform: translateY(1%) scale(1.04, 0.95); }
}
/* 开心笑：蹦跳大笑——蹲(蓄力)→跳起(拉伸)→顶点稍停→落地(挤压)→回弹→站稳→休息（位移用百分比自适应） */
@keyframes idleLaugh {
  0%   { transform: scale(1.06, 0.92)  translateY(1.5%); animation-timing-function: ease-out; }  /* 蓄力下蹲 */
  16%  { transform: scale(0.92, 1.12)  translateY(-11%); animation-timing-function: ease-in; }  /* 起跳拉伸 */
  34%  { transform: scale(1, 1.02)     translateY(-9%);  animation-timing-function: ease-in; }  /* 顶点稍停 */
  50%  { transform: scale(1.14, 0.84)  translateY(2%);   animation-timing-function: ease-out; }  /* 落地挤压 */
  63%  { transform: scale(0.98, 1.03)  translateY(-1%);  animation-timing-function: ease-in-out; }/* 回弹 */
  76%  { transform: scale(1, 1)        translateY(0); }                                          /* 站稳 */
  100% { transform: scale(1.06, 0.92)  translateY(1.5%); }                                        /* 休息蓄力 */
}
/* 抚摸互动反应：被摸时开心扭动 + 轻缩放（一次性播放） */
@keyframes petReact {
  0%   { transform: scale(1) rotate(0); }
  15%  { transform: scale(1.05) rotate(-6deg); }
  30%  { transform: scale(1.08) rotate(6deg); }
  45%  { transform: scale(1.05) rotate(-5deg); }
  60%  { transform: scale(1.08) rotate(5deg); }
  78%  { transform: scale(1.02) rotate(-2deg); }
  100% { transform: scale(1) rotate(0); }
}
/* 心情切换时的轻微弹跳（一次性播放） */
@keyframes moodPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.1); }
  100% { transform: scale(1); }
}
.speech-bubble {
  position: absolute;
  top: -10px;
  right: -10px;
  background: var(--panel-bg-strong);
  border-radius: 16px;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  box-shadow: var(--shadow-card);
  max-width: 180px;
  white-space: nowrap;
  opacity: 0;
  transform: scale(0.7);
  transition: 0.3s;
  z-index: 8;
  pointer-events: none;
}
.speech-bubble.show { opacity: 1; transform: scale(1); }
.speech-bubble::after {
  content: ''; position: absolute; bottom: -8px; left: 24px;
  border: 8px solid transparent; border-top-color: var(--panel-bg-strong);
}

.floating-hearts {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 9;
}
.heart-pop {
  position: absolute;
  left: 50%;
  bottom: 30%;
  font-size: 1.4rem;
  animation: heartRise 1.4s ease-out forwards;
}
@keyframes heartRise {
  0% { transform: translate(-50%, 0) scale(0.5); opacity: 1; }
  100% { transform: translate(-50%, -120px) scale(1.4); opacity: 0; }
}

.bg-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}
/* 动态装饰元素：离线预生成的主题化立体小元素（蘑菇/花/心/星/云/海星/贝壳/叶/宝石/土星/热气球…），
   按背景主色染色，与场景呼应；尺寸不超过企鹅头部 1/4，分散漂浮 */
.deco-item {
  position: absolute;
  transform: translate(-50%, -50%) rotate(var(--rot, 0deg));
  opacity: 0.95;
  animation: floatDeco var(--dur, 7s) ease-in-out var(--delay, 0s) infinite;
  filter: drop-shadow(0 3px 5px rgba(60, 50, 30, 0.22));
  pointer-events: none;
  user-select: none;
  will-change: transform;
  display: block;
}
@keyframes floatDeco {
  0%, 100% { transform: translate(-50%, -50%) translateY(0) rotate(var(--rot, 0deg)); }
  50%      { transform: translate(-50%, -50%) translateY(calc(-1 * var(--float-y, 12px))) rotate(var(--rot, 0deg)); }
}

/* 离家出走 */
.ranaway-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,228,236,0.92);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.ranaway-overlay[hidden] { display: none; }
.ranaway-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  width: 100%;
  max-width: 320px;
  box-shadow: var(--shadow-soft);
  border: 3px dashed var(--accent);
}
.ranaway-icon { font-size: 3.5rem; }
.ranaway-card h3 { color: var(--accent); margin: 8px 0; }
.ranaway-card p { color: var(--text-light); font-size: 0.85rem; margin-bottom: 12px; }

/* 背景缩略图 */
.bg-tabs-wrap { position: relative; }
.bg-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
  padding: 8px 4px;
  margin-top: 10px;
  scrollbar-width: none;
  max-height: 94px;            /* 折叠：只显示第一行，其余自动隐藏 */
  overflow: hidden;
  align-content: flex-start;
  justify-content: center;
  transition: max-height .3s ease;
}
.bg-tabs.expanded { max-height: 520px; overflow-y: auto; }
.bg-tabs::-webkit-scrollbar { display: none; }
.bg-thumb {
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  border: 3px solid transparent;
  background: #eee;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s;
}
.bg-thumb.active { border-color: var(--accent); transform: scale(1.05); order: -1; }
.bg-thumb-imgwrap { width: 100%; height: 48px; position: relative; overflow: hidden; background: #eee; }
.bg-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bg-thumb.locked .bg-thumb-imgwrap img { filter: grayscale(1) brightness(0.7); }
.bg-thumb .lock-badge {
  position: absolute;
  top: 3px; right: 3px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 0.6rem;
  border-radius: 999px;
  padding: 1px 5px;
  line-height: 1.4;
}
.bg-thumb-caption {
  height: 30px;
  padding: 2px 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.15;
  background: #fff;
}
.bg-thumb-name { font-size: 0.62rem; font-weight: 700; color: var(--text); }
.bg-thumb-lock {
  font-size: 0.5rem;
  color: #b3b8c2;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.bg-tabs-toggle {
  margin: 8px auto 0;
  display: flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  font-weight: 700;
  border: none;
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 0.75rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.bg-tabs-toggle:active { transform: scale(0.97); }

/* ====== 主操作按钮 ====== */
.actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 12px 0;
}
.action-btn {
  background: linear-gradient(135deg, #fff, var(--soft));
  border-radius: var(--radius-md);
  padding: 12px 4px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  box-shadow: var(--shadow-card);
  border: 2px solid var(--panel-border);
  transition: transform 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.action-btn:active { transform: scale(0.95); }

/* ====== 底部 tab ====== */
.bottom-tabs {
  position: fixed;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  max-width: 480px;
  width: calc(100% - 24px);
  display: flex;
  background: var(--panel-bg-strong);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 2px solid var(--panel-border);
  padding: 8px 0 10px;
  z-index: 100;
  border-radius: 22px;
  box-shadow: 0 -4px 12px var(--nav-shadow);
}
.tab {
  flex: 1;
  padding: 10px 4px;
  font-size: 1.05rem;
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-weight: 700;
}
.tab { position: relative; }
.tab.active { color: var(--accent); }

/* 菜单栏「选中图标」：真实的单个图标，悬在选中按钮正上方，切换时滑动 */
#navStar {
  position: absolute;
  top: -17px;                 /* 浮在导航栏上沿、贴近选中按钮文字 */
  left: 0;                    /* 实际位置由 JS 用 transform 平移到选中按钮中心 */
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  line-height: 1;
  background: var(--panel-bg-strong);   /* 不透明底盘：断开与毛玻璃层的合成缝，消除灰色竖条 */
  border: 2px solid var(--panel-border);
  border-radius: 50%;
  box-shadow: 0 3px 8px rgba(0,0,0,.18);
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 6;
  transition: transform .35s cubic-bezier(.34,1.56,.64,1);  /* 用 transform 平移，避免触发 layout 也避免重绘缝 */
  user-select: none;
}

/* ====== 选中图标模板选择 ====== */
.float-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.float-opt {
  border: 2px solid var(--panel-border);
  background: var(--panel-bg);
  color: var(--text-light);
  border-radius: 14px;
  padding: 4px 11px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1.4;
}
.float-opt.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--soft);
}

/* ====== 面板 ====== */
.tab-panel { display: none; animation: fadein 0.4s; }
.tab-panel.active { display: block; }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.card {
  background: var(--panel-bg);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-card);
  border: 2px solid var(--panel-border);
}
.card-title {
  font-size: 1.05rem;
  color: var(--accent-2);
  margin-bottom: 12px;
  font-weight: 800;
}

/* ====== 通用按钮 ====== */
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 800;
  border-radius: var(--radius-md);
  padding: 12px 24px;
  font-size: 0.95rem;
  box-shadow: var(--shadow-soft);
  transition: transform 0.15s;
  display: inline-block;
}
.btn-primary:active { transform: scale(0.96); }
.btn-primary.small { padding: 8px 16px; font-size: 0.82rem; }
.checkin-wrap { text-align: center; margin-top: 16px; }
.btn-secondary {
  background: linear-gradient(135deg, #fff, var(--soft));
  border: 2px solid var(--accent);
  color: var(--accent);
  font-weight: 800;
  border-radius: var(--radius-md);
  padding: 10px 18px;
  font-size: 0.85rem;
  display: inline-block;
  margin: 4px 4px 4px 0;
}
.btn-text {
  background: none;
  border: none;
  color: var(--text-light);
  font-weight: 700;
  font-size: 0.78rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 6px 4px;
  margin-top: 6px;
}
.btn-danger {
  background: linear-gradient(135deg, #fff, var(--soft));
  border: 2px solid #FF7A8B;
  color: #FF7A8B;
  font-weight: 800;
  border-radius: var(--radius-md);
  padding: 10px 18px;
  font-size: 0.85rem;
  display: inline-block;
  margin: 4px 4px 4px 0;
}

/* ====== 设置：音效开关 ====== */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 2px 12px;
}
.setting-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: #6a5a99;
}
.toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 2px solid #B8E6C1;
  background: #EAFBF0;
  border-radius: 999px;
  padding: 5px 14px 5px 6px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #4CAF7D;
  cursor: pointer;
  transition: transform .12s, background .15s, border-color .15s, color .15s;
}
.toggle-btn:active { transform: scale(.95); }
.toggle-btn .dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #4CAF7D;
  box-shadow: 0 0 0 3px rgba(76,175,125,.25);
  transition: transform .2s, background .15s;
}
.toggle-btn.off {
  border-color: #E3D6F7;
  background: #F3EEFB;
  color: #A99BC4;
}
.toggle-btn.off .dot {
  background: #C9BCE0;
  box-shadow: 0 0 0 3px rgba(201,188,224,.25);
  transform: translateX(0);
}

/* ====== 日记 ====== */
.diary-item {
  background: linear-gradient(135deg, #fff, #fff5e6);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 8px;
  border-left: 4px solid var(--yellow-deep);
}
.diary-date { font-size: 0.75rem; color: var(--text-light); margin-bottom: 4px; }
.diary-content { color: var(--text); font-size: 0.9rem; line-height: 1.5; }
/* 画作日记：大 emoji 拼图，低龄儿童看图即可 */
.diary-drawing {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  font-size: 1.9rem;
  line-height: 1.2;
}
.diary-drawing span {
  background: #fff7fb;
  border: 2px dashed #ffd6e6;
  border-radius: 12px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.diary-caption { font-size: 0.72rem; color: var(--text-light); margin-top: 6px; }

/* 最新日记高亮 + 历史折叠 */
.diary-latest { border-left-color: var(--pink-deep, #ff7eb3); box-shadow: 0 2px 8px rgba(255,126,179,0.18); }
.diary-history-toggle {
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px dashed #ffd6e6;
  border-radius: var(--radius-md);
  padding: 9px 14px;
  margin: 4px 0 8px;
  font-size: 0.82rem;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.diary-history-toggle:active { transform: scale(.99); }
.diary-chevron { transition: transform .2s ease; font-size: 0.7rem; color: var(--text-light); }
.diary-history-toggle.open .diary-chevron { transform: rotate(180deg); }

/* 场景化画作日记：背景 + 时间氛围罩 + 企鹅姿态（画面无文字对话框） */
.diary-art {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 4px 0 2px;
  background: #eaf0ff;
  box-shadow: 0 4px 12px rgba(120, 90, 120, 0.18);
  isolation: isolate;            /* 让时间罩只在画面内做混合，不影响外部 */
}
.diary-art .da-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 1;
}
.diary-art .da-penguin {
  position: absolute;
  height: auto;
  transform-origin: 50% 100%;
  filter: drop-shadow(0 6px 9px rgba(60, 40, 20, 0.35));
  z-index: 2;
}
.diary-art .da-wash {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 3;
}
/* 四套时间氛围罩：background-color 决定整体染色，background-image 加一抹方向光晕 */
.da-time-morning .da-wash {
  background-color: rgba(255, 228, 198, 0.30);
  background-image: radial-gradient(130% 70% at 50% 0%, rgba(255, 244, 214, 0.40), rgba(255, 244, 214, 0) 55%);
  mix-blend-mode: multiply;
}
.da-time-noon .da-wash {
  background-color: rgba(255, 252, 240, 0.10);
  mix-blend-mode: multiply;
}
.da-time-dusk .da-wash {
  background-color: rgba(255, 168, 128, 0.40);
  background-image: radial-gradient(130% 70% at 50% 100%, rgba(255, 180, 140, 0.35), rgba(255, 180, 140, 0) 55%);
  mix-blend-mode: multiply;
}
.da-time-night .da-wash {
  background-color: rgba(54, 74, 150, 0.55);
  background-image: radial-gradient(120% 60% at 70% 8%, rgba(190, 205, 255, 0.22), rgba(190, 205, 255, 0) 50%);
  mix-blend-mode: multiply;
}

/* ====== 徽章 ====== */
.badges {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}
.badge-item {
  flex: 0 0 auto;
  width: 72px;
  text-align: center;
  background: linear-gradient(135deg, #fff, var(--soft-2));
  border-radius: var(--radius-md);
  padding: 6px 4px;
  border: 2px solid #fff0fa;
}
.badge-icon { font-size: 1.5rem; }
.badge-name { font-size: 0.62rem; font-weight: 700; margin-top: 2px; }
.badge-item.locked { opacity: 0.4; filter: grayscale(1); }

/* ====== 徽章解锁条件说明 ====== */
.badge-legend {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.badge-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff7fc;
  border: 1px solid #ffe1ef;
  border-radius: 10px;
  padding: 5px 8px;
  font-size: 0.72rem;
  color: var(--text-light);
}
.badge-legend-item.got { background: #eafff0; border-color: #c7f0d4; color: var(--text); }
.badge-legend-item .bl-icon { font-size: 1rem; }
.badge-legend-item .bl-status { font-size: 0.8rem; }
.badge-legend-item .bl-text { line-height: 1.25; }
.badge-legend-item.got .bl-text b { color: #2e9e5b; }

/* ====== 时间轴 ====== */
.timeline {
  position: relative;
  padding-left: 20px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--accent-2));
  border-radius: 1px;
}
.timeline-item {
  position: relative;
  padding: 8px 0;
  font-size: 0.85rem;
}
.timeline-item::before {
  content: '🌸';
  position: absolute;
  left: -22px;
  top: 8px;
  font-size: 0.8rem;
}
.timeline-date { color: var(--text-light); font-size: 0.75rem; }
.timeline-text { color: var(--text); }

/* 时间轴：折叠标题（点击展开） */
.timeline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: opacity .12s;
}
.timeline-head:active { opacity: .6; }
.timeline-head .chevron {
  font-size: 0.9rem;
  color: var(--accent);
  transition: transform .2s ease;
  transform: rotate(0deg);
}
.timeline-head .chevron.up { transform: rotate(180deg); }
.timeline-summary {
  margin: 6px 0 2px;
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.5;
}

/* 徽章解锁条件：折叠标题（点击展开） */
.badge-legend-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: opacity .12s;
  margin: 12px 0 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}
.badge-legend-head:active { opacity: .6; }
.badge-legend-head .chevron {
  font-size: 0.9rem;
  color: var(--accent);
  transition: transform .2s ease;
  transform: rotate(0deg);
}
.badge-legend-head .chevron.up { transform: rotate(180deg); }
.badge-legend-summary {
  margin: 6px 0 2px;
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.5;
}

/* ====== 大奖 ====== */
.bigrewards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bigreward-card {
  background: linear-gradient(135deg, #fff, var(--soft));
  border-radius: var(--radius-md);
  padding: 12px 8px;
  text-align: center;
  border: 2px solid var(--panel-border);
  position: relative;
}
.bigreward-icon { font-size: 2rem; }
.bigreward-name { font-size: 0.8rem; font-weight: 700; margin-top: 4px; }
.bigreward-progress { font-size: 0.7rem; color: var(--text-light); margin-top: 2px; }
.bigreward-card.claimed {
  background: linear-gradient(135deg, #fff8e1, #fff0d0);
  border-color: var(--yellow-deep);
}
.bigreward-card.claimed::after {
  content: '已拆';
  position: absolute;
  top: 4px; right: 4px;
  background: var(--yellow-deep);
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 8px;
  font-weight: 700;
}
/* 未解锁：灰色锁定 */
.bigreward-card.locked {
  background: #f0f0f3;
  border-color: #d8d8de;
  filter: grayscale(1);
  opacity: 0.55;
}
.bigreward-card.locked .bigreward-icon { opacity: 0.4; }
/* 已解锁未拆：点亮高亮，吸引点击 */
.bigreward-card.unlocked {
  background: linear-gradient(135deg, #fff, #ffe9f3);
  border-color: var(--pink-deep, #ff8fb3);
  box-shadow: 0 0 0 3px rgba(255,143,179,0.25), 0 6px 16px rgba(255,143,179,0.3);
  animation: rewardGlow 1.6s ease-in-out infinite;
}
.bigreward-card.unlocked::after {
  content: '🎁';
  position: absolute;
  top: 4px; right: 4px;
  font-size: 0.9rem;
}
@keyframes rewardGlow {
  0%, 100% { box-shadow: 0 0 0 3px rgba(255,143,179,0.22), 0 6px 16px rgba(255,143,179,0.25); }
  50% { box-shadow: 0 0 0 6px rgba(255,143,179,0.35), 0 8px 22px rgba(255,143,179,0.45); }
}

/* ====== 任务 ====== */
.task-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.task-tab {
  flex: 1;
  background: var(--panel-bg);
  border-radius: 999px;
  padding: 8px 4px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-light);
  border: 2px solid transparent;
}
.task-tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border-color: #fff;
}

.task-list { display: flex; flex-direction: column; gap: 8px; }
.task-row {
  background: linear-gradient(135deg, #fff, var(--soft-2));
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 2px solid var(--panel-border);
}
.task-row.done {
  background: linear-gradient(135deg, #e8f5e9, var(--soft-2));
  border-color: var(--green, #88d8a3);
}
.task-name { font-weight: 700; flex: 1; }
.task-meta { font-size: 0.75rem; color: var(--text-light); margin: 0 8px; }
.task-actions { display: flex; gap: 6px; }
.task-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  font-size: 1.2rem;
  background: #fff;
  border: 2px solid var(--panel-border);
  font-weight: 800;
}
.task-btn.do { color: #5bbd7e; border-color: #b8e6c1; background: #f1faf3; }
.task-btn.undo { color: #e07b8b; border-color: #ffc9d2; background: #fff3f5; }
.task-row.done .task-btn.do { background: #5bbd7e; color: #fff; border-color: #4caf7d; }
.task-row.done .task-btn.undo { opacity: 1; }

.task-progress {
  margin-top: 12px;
  background: var(--panel-bg);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}
.task-progress-bar {
  height: 12px;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  margin-top: 6px;
}
.task-progress-bar > div {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--yellow-deep));
  border-radius: 6px;
  transition: width 0.4s;
}
.task-progress-text { font-size: 0.85rem; font-weight: 700; }

/* ====== 家长自定义加减分 ====== */
.parent-score {
  margin-top: 12px;
  padding: 12px;
  background: linear-gradient(135deg, #fef6ff, #f3f0ff);
  border: 2px dashed #d9c7f5;
  border-radius: var(--radius-md);
}
.parent-score-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  color: #8a6bd1;
  margin-bottom: 8px;
}
.parent-score-head .tiny { font-weight: 400; }
.parent-score-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.ps-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  margin-top: 8px;
}
.ps-add-row { border: 2px solid #b8e6c1; background: #f1faf3; }
.ps-sub-row { border: 2px solid #ffc9d2; background: #fff3f5; }
.ps-tag {
  font-weight: 800;
  font-size: 0.95rem;
  white-space: nowrap;
}
.ps-add-row .ps-tag { color: #4caf7d; }
.ps-sub-row .ps-tag { color: #e0667a; }
.ps-select {
  border: 2px solid #e3d6f7;
  border-radius: 8px;
  padding: 6px 4px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #6a5a99;
  background: #fff;
  text-align: center;
  min-width: 56px;
}
.ps-unit { font-weight: 700; color: #6a5a99; }
.ps-confirm {
  margin-left: auto;
  border: none;
  border-radius: var(--radius-md);
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  transition: transform .12s;
}
.ps-confirm:active { transform: scale(.94); }
.ps-confirm-add { background: linear-gradient(135deg, #6fcf97, #4caf7d); }
.ps-confirm-sub { background: linear-gradient(135deg, #f08a9b, #e0667a); }
.parent-score-note {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--text-light);
}
.parent-score-note.ps-add { color: #5bbd7e; font-weight: 700; }
.parent-score-note.ps-sub { color: #e07b8b; font-weight: 700; }

.foodbag { display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 8px; }
.food-chip {
  background: linear-gradient(135deg, #fff, var(--soft-2));
  border-radius: var(--radius-md);
  padding: 8px;
  text-align: center;
  border: 2px solid var(--panel-border);
}
.food-emoji { font-size: 1.6rem; }
.food-count { font-size: 0.75rem; font-weight: 700; color: var(--accent); margin-top: 2px; }

/* ====== 游戏 ====== */
.games-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.game-card {
  background: linear-gradient(135deg, #fff, var(--soft-2));
  border-radius: var(--radius-lg);
  padding: 16px 8px;
  text-align: center;
  border: 2px solid #fff;
  box-shadow: var(--shadow-card);
  position: relative;
}
.game-card.locked { opacity: 0.5; filter: grayscale(0.6); }
.game-icon { font-size: 2.4rem; }
.game-name { font-weight: 800; margin-top: 6px; }
.game-hint { font-size: 0.7rem; color: var(--text-light); margin-top: 4px; }
.game-card .lock-tag {
  position: absolute;
  top: 6px; right: 6px;
  background: #FF7A8B;
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 8px;
  font-weight: 700;
}

/* ====== 商店 ====== */
.shop-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.shop-card {
  background: linear-gradient(135deg, #fff, var(--soft-2));
  border-radius: var(--radius-md);
  padding: 12px;
  border: 2px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.shop-icon { font-size: 1.8rem; }
.shop-media {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(135deg, #fff0f6, #f3f0ff);
  display: flex;
  align-items: center;
  justify-content: center;
}
.shop-media .shop-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.shop-name { font-weight: 700; font-size: 0.9rem; }
.shop-price { color: var(--text-light); font-size: 0.75rem; }
.shop-points {
  background: linear-gradient(90deg, var(--yellow-deep), var(--accent));
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 4px 8px;
  border-radius: 999px;
  text-align: center;
  margin-top: 4px;
}
.shop-card.owned {
  border-color: #B8E6C1;
  background: linear-gradient(135deg, #f1fff5, var(--soft-2));
}
.owned-tag {
  align-self: flex-start;
  background: linear-gradient(90deg, #6abf7b, #4CAF7D);
  color: #fff;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 999px;
}
.shop-buy {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 700;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.8rem;
  margin-top: 6px;
}
.shop-buy:disabled { opacity: 0.5; filter: grayscale(1); }

/* ====== 姿态预览 ====== */
.pose-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.pose-cell {
  background: linear-gradient(135deg, #fff, var(--soft-2));
  border-radius: var(--radius-md);
  padding: 10px;
  text-align: center;
  border: 2px solid #fff;
}
.pose-cell img {
  width: 80%;
  height: auto;
  aspect-ratio: 1 / 1.1;
  object-fit: contain;
}
.pose-cell .name { font-weight: 700; font-size: 0.85rem; margin-top: 6px; }

/* ====== 模态弹层 ====== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.modal[hidden] { display: none; }
.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  animation: fadein 0.3s;
}
.modal-body {
  position: relative;
  background: linear-gradient(180deg, #fff, var(--soft-2));
  width: 100%;
  max-width: 480px;
  border-radius: 28px 28px 0 0;
  padding: 24px 20px 32px;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideUp 0.3s;
  box-shadow: 0 -8px 24px rgba(0,0,0,0.15);
}
.modal-body.large { max-height: 92vh; max-width: 560px; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-close {
  position: absolute;
  top: 12px; right: 16px;
  font-size: 1.4rem;
  color: var(--text-light);
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #f5f5f5;
}
.modal-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent-2);
  margin-bottom: 12px;
  text-align: center;
}

/* ====== 姿态大图灯箱（捏合缩放） ====== */
.modal.zoom { align-items: center; }
.zoom-body {
  max-width: 92vw;
  width: auto;
  max-height: 92vh;
  border-radius: 28px;
  padding: 16px 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.zoom-stage {
  width: 78vw;
  max-width: 520px;
  height: 60vh;
  max-height: 560px;
  border-radius: 22px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, #fff, var(--soft-2));
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.06);
  touch-action: none;          /* 由 JS 接管缩放手势，禁用浏览器默认 */
  display: flex;
  align-items: center;
  justify-content: center;
}
#zoomImg {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center center;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;        /* 让指针事件落在 stage 上，便于统一处理 */
}
.zoom-hint {
  margin-top: 12px;
  font-size: 0.82rem;
  text-align: center;
}

/* 装扮网格 */
/* ===== 换装：分组 + 规则条 + 进度 ===== */
.outfit-rule {
  background: linear-gradient(135deg, #fff7e6, #ffe9f1);
  border: 2px solid #ffd9e6;
  border-radius: var(--radius-md);
  padding: 8px 10px;
  font-size: 0.8rem;
  font-weight: 800;
  color: #c2567f;
  text-align: center;
  margin: 4px 0 6px;
}
.outfit-prog-line {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-light);
  margin-bottom: 10px;
}
.outfit-prog-line b { color: var(--accent); font-size: 1rem; }

.outfit-default { display: flex; justify-content: center; margin-bottom: 12px; }
.outfit-default .outfit-card { width: min(50%, 210px); }

.outfit-groups { display: flex; flex-direction: column; gap: 14px; }
.outfit-group.locked { opacity: 0.55; filter: grayscale(0.55); }
.group-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px; padding: 0 2px;
}
.group-title { font-weight: 800; font-size: 0.92rem; color: var(--accent-2); }
.group-state { font-size: 0.72rem; color: var(--text-light); }

.outfit-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.outfit-card {
  background: linear-gradient(135deg, #fff, var(--soft-2));
  border-radius: var(--radius-lg);
  padding: 10px 4px 8px;
  text-align: center;
  border: 3px solid transparent;
  position: relative;
  transition: transform 0.2s;
}
.outfit-card:active { transform: scale(0.96); }
.outfit-card.active { border-color: var(--accent); box-shadow: 0 4px 14px rgba(255,143,171,.35); }
.outfit-card.locked { opacity: 0.6; filter: grayscale(1); }
.outfit-preview {
  width: 86%;
  aspect-ratio: 1 / 1.05;
  margin: 0 auto 5px;
  display: flex;
  align-items: end;
  justify-content: center;
  cursor: pointer;
  border-radius: var(--radius-md);
}
.outfit-preview.pv-locked { cursor: not-allowed; opacity: 0.5; }
.outfit-preview img { width: 100%; height: auto; pointer-events: none; }
.outfit-name { font-weight: 800; font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.outfit-cond {
  font-size: 0.58rem;
  color: var(--text-light);
  margin-top: 3px;
  line-height: 1.25;
  min-height: 1.5em;
}
.outfit-actions { margin-top: 6px; display: flex; justify-content: center; gap: 4px; }
.outfit-actions button {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 700;
  border: none;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 0.66rem;
  cursor: pointer;
}
.unlock-btn { background: linear-gradient(135deg, #ffb347, #ff8a5c) !important; }
.outfit-actions button:disabled { opacity: 0.5; filter: grayscale(1); cursor: not-allowed; }

/* ===== 装扮 9 姿态滑动预览 ===== */
.op-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(135deg, #fff, var(--soft-2));
  border-radius: var(--radius-lg);
  padding: 12px 0;
}
.op-track::-webkit-scrollbar { display: none; }
.op-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
}
.op-slide img { width: 68%; max-height: 44vh; object-fit: contain; }
.op-cap { margin-top: 8px; font-weight: 800; font-size: 0.92rem; color: var(--accent-2); }
.op-arrows { display: flex; justify-content: space-between; margin: 8px 2px 0; }
.op-arrows button {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; border: none; border-radius: 999px;
  width: 42px; height: 42px; font-size: 1.3rem; line-height: 1; cursor: pointer;
}
.op-dots { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.op-dot { width: 8px; height: 8px; border-radius: 50%; background: #e3d6e8; transition: all .2s; }
.op-dot.on { background: var(--accent); transform: scale(1.35); }
.op-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.op-prog { font-size: 0.72rem; color: var(--text-light); }
.op-action-btn {
  flex: 1; border: none; border-radius: 999px; padding: 11px;
  font-weight: 800; font-size: 0.92rem; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.op-action-btn.unlock { background: linear-gradient(135deg, #ffb347, #ff8a5c); }
.op-action-btn:disabled { opacity: 0.5; filter: grayscale(1); cursor: not-allowed; }
.op-tip { text-align: center; margin-top: 8px; font-size: 0.72rem; }

/* ====== 家长自定义奖品编辑器 ====== */
.btn-block { width: 100%; margin-bottom: 6px; }
.modal-body.pe-body-wrap { max-width: 560px; }
.pe-tabs { display: flex; gap: 8px; margin: 6px 0 14px; }
.pe-tab {
  flex: 1; padding: 9px; border: 2px solid var(--panel-border); border-radius: var(--radius-md);
  background: #fff; font-weight: 800; color: var(--text-light); cursor: pointer; font-size: 0.9rem;
}
.pe-tab.active { border-color: var(--accent); background: linear-gradient(135deg, #fff0fa, var(--soft-2)); color: var(--accent-2); }
.pe-list { display: flex; flex-direction: column; gap: 12px; max-height: 52vh; overflow-y: auto; padding: 2px; }
.pe-row {
  display: flex; gap: 10px; align-items: flex-start;
  background: linear-gradient(135deg, #fff, var(--soft-2));
  border: 2px solid var(--panel-border); border-radius: var(--radius-md); padding: 10px;
}
.pe-thumb {
  width: 56px; height: 56px; flex: 0 0 56px; border-radius: 10px; overflow: hidden;
  background: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.8rem;
}
.pe-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pe-fields { flex: 1; display: grid; grid-template-columns: 1fr auto; gap: 8px 10px; align-items: center; }
.pe-lbl { display: flex; flex-direction: column; font-size: 0.72rem; color: var(--text-light); gap: 3px; }
.pe-lbl-icon { max-width: 64px; }
.pe-in {
  border: 1.5px solid var(--panel-border); border-radius: 8px; padding: 7px 9px; font-size: 0.88rem;
  background: #fff; color: var(--text); width: 100%; box-sizing: border-box;
}
.pe-in-icon { text-align: center; }
.pe-in-num { max-width: 92px; }
.pe-img-act { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.btn-mini {
  border: 1.5px solid var(--panel-border); border-radius: 999px; padding: 5px 11px;
  background: #fff; font-size: 0.78rem; cursor: pointer; color: var(--accent-2); font-weight: 700;
}
.btn-mini:hover { background: var(--soft-2); }
.pe-del { border: none; background: transparent; font-size: 1.1rem; cursor: pointer; color: #db9aa6; align-self: center; padding: 4px; }
.pe-add-row { margin-top: 12px; }
.pe-foot { display: flex; gap: 10px; margin-top: 12px; }
.pe-foot .btn-primary, .pe-foot .btn-secondary { flex: 1; }

/* 大奖图片 / 奖励弹层图片 */
.bigreward-img { width: 64px; height: 64px; object-fit: cover; border-radius: 12px; margin: 0 auto 6px; }
.reward-img { max-width: 160px; max-height: 160px; object-fit: contain; border-radius: 14px; margin: 8px auto; display: block; box-shadow: 0 6px 18px rgba(0,0,0,.15); }

/* 食物选择 */
.food-pick {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.food-pick .food-chip {
  cursor: pointer;
  transition: transform 0.15s;
}
.food-pick .food-chip:active { transform: scale(0.94); }

/* ====== 游戏区 ====== */
.game-area {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 12px;
  min-height: 360px;
  position: relative;
  overflow: hidden;
}
.game-area h3 {
  text-align: center;
  color: var(--accent-2);
  margin-bottom: 6px;
}
.game-area .game-info {
  display: flex;
  justify-content: space-around;
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 10px;
}
.game-board {
  display: grid;
  gap: 4px;
  margin: 8px auto;
  touch-action: none;
}

/* 消消乐 */
.match-board { width: 320px; height: 320px; max-width: 100%; }
.match-cell {
  background: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  cursor: pointer;
  transition: transform 0.15s;
  user-select: none;
}
.match-cell:active { transform: scale(0.92); }
.match-cell.selected {
  background: var(--yellow);
  box-shadow: 0 0 0 3px var(--yellow-deep);
}
.match-cell.matched {
  animation: pop 0.4s forwards;
}
@keyframes pop {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
  100% { transform: scale(0); opacity: 0; }
}

/* 拼图 */
.puzzle-board {
  width: 300px; height: 300px;
  max-width: 100%;
  display: grid;
  gap: 2px;
  background: #fff;
  border-radius: var(--radius-md);
  padding: 4px;
}
.puzzle-tile {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 800;
  color: #fff;
  transition: transform 0.15s;
  user-select: none;
}
.puzzle-tile:active { transform: scale(0.95); }
.puzzle-tile.empty {
  background: transparent;
  border: 2px dashed #ddd;
}
.puzzle-tile.correct { background: linear-gradient(135deg, var(--green, #88d8a3), #c8e6c9); }

/* 打地鼠 */
.whack-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}
.whack-hole {
  aspect-ratio: 1 / 1;
  background: var(--soft-2);
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.whack-mole {
  position: absolute;
  inset: 10%;
  font-size: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(100%);
  transition: transform 0.2s;
}
.whack-hole.up .whack-mole { transform: translateY(0); }
.whack-hole.bonked .whack-mole {
  animation: bonk 0.4s;
}
@keyframes bonk {
  0% { transform: translateY(0) scale(1); }
  50% { transform: translateY(0) scale(0.6) rotate(-15deg); filter: brightness(0.7); }
  100% { transform: translateY(100%) scale(0.6); }
}

/* 盲盒 */
.reward-modal-body {
  text-align: center;
  padding: 40px 20px;
}
.blindbox {
  margin: 30px auto;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6rem;
  animation: shake 0.4s ease-in-out 3;
}
.blindbox.opening { animation: open 0.6s ease-out forwards; }
@keyframes shake {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-12deg); }
  75% { transform: rotate(12deg); }
}
@keyframes open {
  0% { transform: scale(1) rotate(0); }
  100% { transform: scale(1.5) rotate(360deg); opacity: 0; }
}
.reward-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: 12px;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  top: 30%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 0.9rem;
  z-index: 2000;
  animation: fadein 0.3s;
  max-width: 80vw;
  text-align: center;
}

/* 弹跳 */
/* 小屏适配 */
@media (max-width: 360px) {
  .title { font-size: 1.5rem; }
  .actions { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .action-btn { font-size: 0.75rem; padding: 10px 4px; }
}

/* ====================== 趣味增强 ====================== */

/* 总成就进度环 */
.achievement-card .ach-wrap { display: flex; align-items: center; gap: 16px; }
.ach-ring {
  --accent: #ff8fab;
  width: 84px; height: 84px; border-radius: 50%;
  background: conic-gradient(var(--accent) 0%, #ffe2ec 0%);
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto; position: relative;
  transition: background .5s ease;
}
.ach-ring::after {
  content: ''; position: absolute; inset: 8px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(255,143,171,.25) inset;
}
.ach-pct {
  position: relative; z-index: 1; font-weight: 800; font-size: 1.2rem;
  color: var(--text);
}
.ach-detail { font-size: 0.85rem; color: var(--text-light); line-height: 1.7; }

/* 打卡星星树（4 阶段圣诞树） */
.star-wall {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  margin: 10px 0 6px; padding: 0;
}
.tree-wrap {
  position: relative;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1 / 1;          /* 容器正方形，树图保持 1:1 */
  display: flex; align-items: center; justify-content: center;
}
/* 树图随阶段"成长"——容器宽度递增，体现阶段 1→4 由小到大 */
.tree-wrap.stage-1 { max-width: 240px; }
.tree-wrap.stage-2 { max-width: 280px; }
.tree-wrap.stage-3 { max-width: 320px; }
.tree-wrap.stage-4 { max-width: 360px; }
.tree-img {
  width: 100%; height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(80, 60, 30, .15));
  transition: opacity .35s ease;
}
/* 树冠区的 ⭐ emoji overlay（位置由 JS 写入） */
.star-overlays {
  position: absolute; inset: 0;
  pointer-events: none;
  margin: 0 auto;
  left: 50%; transform: translateX(-50%);
}
.mini-star-img {
  position: absolute;
  width: var(--star-size-pct, 6%);
  height: auto;
  aspect-ratio: 1 / 1;          /* ⭐ emoji 默认就是方形 */
  transform: translate(-50%, -50%) scale(1);
  image-rendering: auto;
  transition: filter .4s ease, opacity .4s ease, transform .4s ease;
}
/* 未点亮：深灰，明显可见但不抢眼 */
.mini-star-img.off {
  opacity: 0.95;
  filter: drop-shadow(0 1px 2px rgba(60, 50, 30, 0.25));
}
/* 点亮后：暖金 + 三层渐变 drop-shadow 发光（由内向外平滑衰减，无硬边圆圈）+ 轻柔闪烁
   自然发散：内层 2px 柔光起点、外层 13px 极淡氛围，整体跟随星形轮廓向外晕开 */
.mini-star-img.on {
  filter:
    drop-shadow(0 0 2px rgba(255, 235, 160, 0.6))
    drop-shadow(0 0 6px rgba(255, 210, 105, 0.42))
    drop-shadow(0 0 13px rgba(255, 185, 70, 0.20));
  animation: star-twinkle 2.6s ease-in-out infinite;
}
.mini-star-img.just-added {
  animation: star-burst .9s ease-out 1, star-twinkle 2.6s ease-in-out infinite .9s;
}
@keyframes star-twinkle {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.16); }
}
@keyframes star-burst {
  0% { transform: translate(-50%, -50%) scale(0.2); opacity: 0; }
  50% { transform: translate(-50%, -50%) scale(1.6); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* 阶段信息卡（标题+进度条+状态，整卡占满卡片宽度，不再两边留空） */
.star-stage-info {
  width: 100%;
  max-width: 100%;
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, var(--soft-2), var(--soft));
  border: 1.5px dashed rgba(255, 207, 130, 0.45);
}
.star-stage-title {
  display: flex; align-items: center; gap: 8px; font-size: 1rem;
  font-weight: 700; color: var(--text);
}
.star-stage-title .stage-emoji { font-size: 1.25rem; }
.star-stage-title .stage-name { flex: 1; }
.star-stage-title .stage-tag {
  font-size: 0.7rem; padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 207, 130, 0.35);
  color: #b88526;
  white-space: nowrap;
}
/* 进度条 + 百分比 同一行，进度条占满剩余宽度 */
.ssi-bar {
  display: flex; align-items: center; gap: 10px;
}
.ssi-bar .star-progress { flex: 1; }
.ssi-pct {
  font-size: 0.74rem; font-weight: 700; color: #d2853a;
  white-space: nowrap; min-width: 36px; text-align: right;
}
/* 两列状态说明，充分利用整卡宽度，左右不再留空 */
.ssi-meta {
  display: flex; gap: 10px;
}
.ssi-stat {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 6px;
  font-size: 0.78rem; color: var(--text-dim);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 207, 130, 0.30);
  border-radius: 12px;
  padding: 8px 10px;
  line-height: 1.3;
}
.ssi-stat .ssi-ic { font-size: 0.95rem; flex: none; }
.ssi-stat b { color: #d2853a; font-weight: 700; }
.ssi-stat span:last-child { overflow: hidden; text-overflow: ellipsis; }
.star-progress {
  position: relative; width: 100%; height: 12px;
  border-radius: 999px; overflow: hidden;
  background: rgba(255, 207, 130, 0.18);
  box-shadow: inset 0 1px 3px rgba(180, 130, 50, 0.18);
}
.star-progress-fill {
  position: absolute; left: 0; top: 0; height: 100%;
  background: linear-gradient(90deg, #ffd166, #ff8fab 70%, #c3a6ff);
  border-radius: 999px;
  transition: width .55s cubic-bezier(.45,.05,.55,.95);
  box-shadow: 0 0 8px rgba(255, 158, 177, 0.55);
}
.star-progress-text {
  font-size: 0.75rem; color: var(--text-dim);
  letter-spacing: 0.02em;
}
.star-progress-text b { color: #d2853a; font-weight: 700; }

/* 手动放烟花按钮 */
.firework-btn {
  align-self: center;
  margin-top: 4px;
  border: none; padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.92rem; font-weight: 600;
  color: #fff; cursor: pointer;
  background: linear-gradient(135deg, #ff8fab, #c3a6ff 60%, #9be7ff);
  box-shadow: 0 4px 12px rgba(195, 166, 255, .4);
  animation: fw-btn-pulse 1.4s ease-in-out infinite;
  transition: transform .15s;
}
.firework-btn:active { transform: scale(.94); }
@keyframes fw-btn-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 4px 12px rgba(195, 166, 255, .4); }
  50% { transform: scale(1.05); box-shadow: 0 6px 22px rgba(255, 143, 171, .6); }
}

/* 烟花全屏覆盖层（5 秒）：fixed 全屏，绝对定位粒子 */
#fireworks {
  position: fixed; left: 0; top: 0;
  width: 100vw; height: 100vh;
  pointer-events: none;
  z-index: 9500;
  overflow: hidden;
}
.fw-particle {
  position: absolute;
  width: 12px; height: 12px;
  border-radius: 50%;
  pointer-events: none;
  animation: fw-fly 1.1s ease-out forwards;
  box-shadow: 0 0 8px currentColor;
}
@keyframes fw-fly {
  0% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
  60% { transform: translate(calc(-50% + var(--dx) * 1.2), calc(-50% + var(--dy) * 1.2)) scale(.8); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx) * 1.4), calc(-50% + var(--dy) * 1.4)) scale(.25); opacity: 0; }
}
.fw-banner {
  position: absolute; top: 12%;
  transform: translateX(-50%);
  padding: 10px 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #b88526;
  font-size: 1.05rem; font-weight: 700;
  box-shadow: 0 6px 18px rgba(255, 166, 188, .45);
  animation: fw-banner-pop .6s ease-out, fw-banner-out .6s ease-in 3.8s forwards;
}
@keyframes fw-banner-pop {
  0% { transform: translate(-50%, -20px) scale(.6); opacity: 0; }
  100% { transform: translate(-50%, 0) scale(1); opacity: 1; }
}
@keyframes fw-banner-out {
  to { transform: translate(-50%, -10px) scale(.9); opacity: 0; }
}

/* 季节背景推荐横幅 */
.season-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 10px; padding: 8px 12px; border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--soft-2), #f3f0ff);
  border: 2px dashed #ffd1e0;
  font-size: 0.85rem; color: var(--text);
}
.season-banner .season-text { flex: 1; }

/* 投喂飞行动画 */
.flying-foods { position: fixed; inset: 0; pointer-events: none; z-index: 9999; }
.fly-food {
  position: fixed; font-size: 2rem; transform: translate(-50%, -50%);
  transition: left .7s cubic-bezier(.45,.05,.55,.95), top .7s cubic-bezier(.45,.05,.55,.95),
              transform .7s ease, opacity .7s ease;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.25));
}

/* 日记语音朗读按钮 */
.diary-read {
  border: none; background: var(--soft); border-radius: 50%;
  width: 30px; height: 30px; font-size: 0.95rem; cursor: pointer;
  vertical-align: middle; margin-left: 8px;
  box-shadow: 0 1px 4px rgba(255,143,171,.4);
}
.diary-read:active { transform: scale(.9); }

/* 小游戏提示按钮 + 高亮 */
.game-hint-btn {
  display: block; margin: 10px auto 0;
  border: none; border-radius: 999px; padding: 8px 18px;
  background: #ffe08a; color: #7a5b00; font-weight: 800; font-size: 0.9rem;
  cursor: pointer; box-shadow: 0 2px 6px rgba(255,200,80,.5);
}
.match-cell.hint {
  outline: 3px solid #ffd166; outline-offset: -3px;
  animation: hint-blink .6s ease-in-out 2 alternate;
}
@keyframes hint-blink { from { background: rgba(255,209,102,.25); } to { background: rgba(255,209,102,.6); } }

/* 试玩预览模式 */
.preview-tip{
  background:linear-gradient(135deg,#fff7e6,#ffe9f2);
  border:2px dashed #ffb3c8;
  color:#c2185b;
  border-radius:18px;
  padding:10px 14px;
  font-size:14px;
  margin-bottom:12px;
  text-align:center;
  line-height:1.5;
}
.game-card.preview{
  box-shadow:0 0 0 3px #ffd54f inset, 0 6px 16px rgba(255,193,7,.25);
  border-color:#ffd54f;
}
.demo-banner{
  position:sticky;
  top:0;
  z-index:50;
  background:linear-gradient(90deg,#ffd9e6,#ffe6c7);
  color:#a8506b;
  font-weight:700;
  font-size:13px;
  text-align:center;
  padding:9px 12px;
  border-radius:0 0 18px 18px;
  box-shadow:0 4px 12px rgba(255,150,180,.3);
  line-height:1.5;
}

/* 找不同游戏 */
.diff-wrap{
  display:flex;
  flex-direction:column;
  gap:14px;
  justify-content:center;
  align-items:stretch;
  margin:6px 0 4px;
}
.diff-col{
  flex:none;
  width:100%;
  min-width:0;
}
.diff-label{
  text-align:center;
  font-size:13px;
  color:#8a6d3b;
  margin-bottom:4px;
  font-weight:600;
}
.diff-svg{
  width:100%;
  height:auto;
  display:block;
  background:#fff;
  border:4px solid #ffd9e6;
  border-radius:22px;
  box-shadow:0 6px 16px rgba(0,0,0,.10);
  touch-action:manipulation;
  cursor:pointer;
}
.diff-col:last-child .diff-svg{
  cursor:pointer;
  border-color:#b7e4ff;
}
.diff-mark{
  fill:rgba(105,219,124,.35);
  stroke:#3fae57;
  stroke-width:3;
  transform-box:fill-box;
  transform-origin:center;
  animation:diff-pop .3s ease;
}
.diff-mark-t{
  transform-box:fill-box;
  transform-origin:center;
  animation:diff-pop .3s ease;
}
@keyframes diff-pop{
  from{ transform:scale(.4); }
  to{ transform:scale(1); }
}
.diff-hint-mark{
  fill:none;
  stroke:#ff9f1c;
  stroke-width:4;
  stroke-dasharray:6 5;
  animation:diff-blink 1.6s ease-in-out 1;
}
@keyframes diff-blink{
  0%,100%{ opacity:1; }
  50%{ opacity:.25; }
}
/* 点错（没点到不同处）：柔和浅红小圈，一下即消失，不刺耳不惩罚 */
.diff-wrong-mark{
  fill:rgba(255,140,140,.30);
  stroke:#ff7a7a;
  stroke-width:3;
  transform-box:fill-box;
  transform-origin:center;
  animation:diff-pop .25s ease;
  pointer-events:none;
}
/* 点到了已找到的同位置：轻轻放大已有的 ✅ 提示「这里已经有了」 */
.diff-pulse{
  animation:diff-pulse .52s ease;
}
@keyframes diff-pulse{
  0%,100%{ transform:scale(1); }
  50%{ transform:scale(1.4); }
}

/* ====== 可爱气泡确认弹层（替代原生 confirm） ====== */
.confirm-overlay {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(48, 28, 66, 0.34);
  opacity: 0; transition: opacity .18s ease;
  padding: 0 14px;
}
.confirm-overlay.show { opacity: 1; }
.confirm-bubble {
  width: min(88vw, 320px);
  background: linear-gradient(180deg, #fffdfe 0%, #fff2f8 100%);
  border: 2px solid #ffd6e7;
  border-radius: 28px;
  padding: 22px 20px 18px;
  text-align: center;
  box-shadow: 0 14px 34px rgba(255, 110, 160, 0.28);
  transform: scale(.82);
  transition: transform .22s cubic-bezier(.2, 1.35, .5, 1);
  position: relative;
}
.confirm-overlay.show .confirm-bubble { transform: scale(1); }
/* 小气泡尾巴，营造「对话气泡」感 */
.confirm-bubble::after {
  content: '';
  position: absolute;
  left: 50%; bottom: -11px; transform: translateX(-50%) rotate(45deg);
  width: 20px; height: 20px;
  background: #fff2f8;
  border-right: 2px solid #ffd6e7;
  border-bottom: 2px solid #ffd6e7;
}
.confirm-emoji {
  font-size: 2.3rem; line-height: 1; margin-bottom: 8px;
  animation: decorBob 1.6s ease-in-out infinite;
}
.confirm-title {
  font-size: 1.18rem; font-weight: 800; color: #ff6f9d;
  margin-bottom: 8px; letter-spacing: .5px;
}
.confirm-msg {
  font-size: .92rem; color: #8a6a8c; line-height: 1.55; margin-bottom: 18px;
}
.confirm-msg .hl {
  display: inline-block; margin-top: 4px;
  color: #ff7a59; font-weight: 800;
}
.confirm-btns { display: flex; gap: 10px; }
.confirm-btn {
  flex: 1; border: none; border-radius: 16px;
  padding: 11px 0; font-size: .95rem; font-weight: 800; cursor: pointer;
  transition: transform .12s ease, filter .12s ease;
}
.confirm-btn:active { transform: scale(.95); }
.confirm-cancel { background: #f1edf5; color: #9a86ad; }
.confirm-cancel:active { filter: brightness(.97); }
.confirm-ok {
  background: linear-gradient(120deg, #ffa6c0, #ff7ab0);
  color: #fff; box-shadow: 0 7px 16px rgba(255, 120, 170, .36);
}
.confirm-ok:active { filter: brightness(1.04); }
