/* ===========================================================
   小肖和巴拉的学习成长屋
   高级视觉精修 — 温暖 / 治愈 / 童趣 / 专属角色辨识
   =========================================================== */

/* ---------- 设计令牌 ---------- */
:root {
  --bg-page: #FFF9EF;
  --bg-soft: #FFF4E4;
  --bg-card: #FFFCF7;
  --mabu:     #A97855;
  --mabu-lt:  #D9B486;
  --text-deep:#5F4636;
  --text-mid: #8A6F5C;
  --text-soft:#B89E89;
  --caramel:  #C8895A;
  --caramel-d:#A66E45;
  --btn-warm: #C8895A;
  --btn-warm-d:#A66E45;

  --c-chinese:#E9897E;
  --c-math:   #75A9D6;
  --star:     #E5B964;
  --c-english:#A694CF;
  --c-sport:  #83AE8A;
  --c-habit:  #E5B964;

  --c-chi-lt:#FBE2DD; --c-chi-dk:#D06B5E;
  --c-mat-lt:#DCEAF6; --c-mat-dk:#4A8AC0;
  --c-eng-lt:#ECE5F6; --c-eng-dk:#7E6BB5;
  --c-spo-lt:#DEEBE2; --c-spo-dk:#5C9268;
  --c-hab-lt:#FAEDD0; --c-hab-dk:#C99A2E;
  --c-mab-lt:#F0E0CC; --c-mab-dk:#8A5E3A;

  --r-card: 24px; --r-card-sm: 18px; --r-btn: 20px;
  --shadow-card:0 6px 18px rgba(95,70,54,0.07);
  --shadow-mabu:0 12px 32px rgba(95,70,54,0.16);
  --shadow-btn: 0 3px 0 var(--caramel-d);
  --tap-min: 48px;
}

/* ---------- 基础 ---------- */
*, *::before, *::after { box-sizing:border-box; }
html {
  -webkit-text-size-adjust:100%;
  -webkit-tap-highlight-color:transparent;
}
body {
  margin:0; padding:0;
  font-family:"PingFang SC","Hiragino Sans GB","Microsoft YaHei",
              "Helvetica Neue","Segoe UI",system-ui,sans-serif;
  font-size:17px; line-height:1.55;
  color:var(--text-deep);
  background:
    url("assets/bg-texture.svg") repeat,
    radial-gradient(1100px 500px at 95% -5%, #FFE9CF 0%, transparent 65%),
    radial-gradient(800px 450px at -5% 105%, #FFE4D0 0%, transparent 55%),
    var(--bg-page);
  background-size: 200px 200px, auto, auto, auto;
  background-attachment:fixed;
  min-height:100vh;
}
img { max-width:100%; display:block; }
button { font-family:inherit; cursor:pointer; }
a { color:inherit; text-decoration:none; }
[data-dev-only] { display:none !important; }

/* ============================================================
   iPad 横屏左侧导航（≥1024px 显示）
   ============================================================ */
.app-sidebar { display:none; }

.sidebar-brand {
  display:flex; align-items:center; gap:10px;
  padding:8px 4px 16px;
  border-bottom:1px dashed rgba(169,120,85,0.15);
  margin-bottom:10px;
}
.brand-paw { width:34px; height:34px; color:var(--mabu); flex-shrink:0; }
.brand-text { min-width:0; }
.brand-name {
  display:block;
  font-weight:800; font-size:16px; color:var(--text-deep);
  letter-spacing:.5px; line-height:1.3;
}
.brand-full {
  display:block;
  font-weight:500; font-size:11px; color:var(--text-soft);
  line-height:1.3; margin-top:2px;
}

.sidebar-nav { display:flex; flex-direction:column; gap:2px; flex:1; }
.sidebar-item {
  display:flex; align-items:center; gap:10px;
  padding:10px 12px; border-radius:13px;
  font-size:15px; font-weight:600;
  color:var(--text-mid);
  min-height:var(--tap-min);
  transition:background .15s,color .15s;
}
.sidebar-item:hover { background:rgba(169,120,85,.06); color:var(--text-deep); }
.sidebar-item.is-active {
  background:linear-gradient(135deg,#FFE8CC,#FFD9B0);
  color:var(--text-deep);
  box-shadow:inset 0 0 0 1px rgba(200,137,90,.22);
}
.sidebar-item svg { width:20px; height:20px; flex-shrink:0; }

.sidebar-footer {
  margin-top:auto; padding-top:12px;
  border-top:1px dashed rgba(169,120,85,.15);
}
.sidebar-gear {
  display:flex; align-items:center; gap:8px;
  padding:8px 12px; border-radius:12px;
  font-size:12px; font-weight:500;
  color:var(--text-soft);
  opacity:.6; transition:opacity .15s;
}
.sidebar-gear:hover { opacity:1; }
.sidebar-gear svg { width:18px; height:18px; flex-shrink:0; }

/* ============================================================
   App Shell & 顶条（<1024px）
   ============================================================ */
.app-shell { min-height:100vh; display:flex; flex-direction:column; }

.topbar {
  display:flex; align-items:center; gap:10px;
  padding:14px 18px;
  background:rgba(255,249,239,.85);
  backdrop-filter:saturate(180%) blur(10px);
  -webkit-backdrop-filter:saturate(180%) blur(10px);
  position:sticky; top:0; z-index:30;
  border-bottom:1px solid rgba(169,120,85,.08);
}
.menu-btn {
  appearance:none; border:none; background:none;
  width:var(--tap-min); height:var(--tap-min);
  display:flex; align-items:center; justify-content:center;
  color:var(--text-mid); padding:0;
  border-radius:12px;
}
.menu-btn:active { background:rgba(169,120,85,.08); }
.topbar-title { font-weight:800; font-size:17px; color:var(--text-deep); letter-spacing:.5px; }
.topbar-spacer { flex:1; }
.topbar-gear {
  width:var(--tap-min); height:var(--tap-min);
  display:flex; align-items:center; justify-content:center;
  color:var(--text-soft); opacity:.5;
  border-radius:12px; transition:opacity .15s;
}
.topbar-gear:active { background:rgba(169,120,85,.06); opacity:.8; }

/* ============================================================
   手机折叠抽屉（<1024px）
   ============================================================ */
.nav-drawer {
  position:fixed; top:0; left:0; bottom:0;
  width:280px; max-width:85vw;
  background:var(--bg-card);
  box-shadow:6px 0 32px rgba(95,70,54,.18);
  z-index:100;
  display:flex; flex-direction:column;
  transform:translateX(-100%);
  transition:transform .3s cubic-bezier(.4,0,.2,1);
}
.nav-open .nav-drawer { transform:translateX(0); }

.drawer-head {
  display:flex; align-items:flex-start; justify-content:space-between;
  padding:20px 20px 16px;
  border-bottom:1px dashed rgba(169,120,85,.15);
}
.drawer-title { font-weight:800; font-size:18px; color:var(--text-deep); display:block; }
.drawer-full { font-size:11px; color:var(--text-soft); display:block; margin-top:3px; }
.drawer-close {
  appearance:none; border:none; background:none;
  width:40px; height:40px; padding:0;
  display:flex; align-items:center; justify-content:center;
  color:var(--text-mid); border-radius:10px; flex-shrink:0;
}
.drawer-close:active { background:rgba(169,120,85,.08); }

.drawer-nav {
  display:flex; flex-direction:column; gap:2px;
  flex:1; padding:10px 14px;
}
.drawer-item {
  display:flex; align-items:center; gap:12px;
  padding:12px 14px; border-radius:14px;
  font-size:16px; font-weight:600;
  color:var(--text-mid);
  min-height:var(--tap-min);
  transition:background .15s;
}
.drawer-item:active { background:rgba(169,120,85,.08); }
.drawer-item.is-active {
  background:linear-gradient(135deg,#FFE8CC,#FFD9B0);
  color:var(--text-deep);
}
.drawer-item svg { width:20px; height:20px; flex-shrink:0; }
.drawer-foot { padding:14px 20px; border-top:1px dashed rgba(169,120,85,.15); }
.drawer-gear {
  display:flex; align-items:center; gap:8px;
  font-size:12px; color:var(--text-soft); opacity:.6;
}
.drawer-gear svg { flex-shrink:0; }

.nav-backdrop {
  position:fixed; inset:0; z-index:99;
  background:rgba(95,70,54,.30);
  opacity:0; pointer-events:none;
  transition:opacity .3s;
}
.nav-open .nav-backdrop { opacity:1; pointer-events:auto; }

/* ============================================================
   页面主区
   ============================================================ */
.page {
  flex:1;
  padding:20px 18px 32px;
  max-width:1100px; width:100%; margin:0 auto;
}

/* ---------- 欢迎卡片 ---------- */
.welcome-card {
  background:linear-gradient(140deg,#FFEFD9 0%,#FFE2C6 50%,#FFEDD5 100%);
  border-radius:var(--r-card);
  padding:20px 24px 14px;
  box-shadow:var(--shadow-mabu);
  position:relative; overflow:hidden;
  display:grid;
  grid-template-columns:1fr;
  gap:10px; align-items:center;
  margin-bottom:26px;
}
.welcome-card::before {
  content:""; position:absolute; top:-40px; right:-40px;
  width:140px; height:140px;
  background:radial-gradient(circle,rgba(255,255,255,.45),transparent 70%);
  border-radius:50%; pointer-events:none;
}

.welcome-left {}
.greeting {
  margin:0 0 4px;
  font-size:15px; color:var(--text-mid); font-weight:500;
}
.welcome-title {
  margin:0 0 10px;
  font-size:24px; font-weight:800; color:var(--text-deep);
  line-height:1.3; letter-spacing:.4px;
}
.welcome-title .accent {
  color:var(--caramel); font-size:28px; margin:0 2px;
}

.progress-pill {
  display:inline-flex; align-items:center; gap:7px;
  padding:8px 16px;
  background:rgba(255,255,255,.7);
  border-radius:999px;
  font-weight:600; font-size:14px; color:var(--text-deep);
  box-shadow:inset 0 0 0 1px rgba(169,120,85,.10);
}
.star-sm { width:16px; height:16px; color:var(--c-habit); }

.welcome-right {
  display:flex; justify-content:center;
  position:relative;
}
.mabu-full {
  width:120px; height:180px;
  position:relative;
  display:flex; align-items:center; justify-content:center;
  filter:drop-shadow(0 8px 18px rgba(95,70,54,.18));
  /* 用暖色底 + 羽化遮罩消除白底矩形 */
  background:radial-gradient(ellipse 42% 44% at 50% 48%, #FFE6CA 35%, transparent 82%);
  mask-image:radial-gradient(ellipse 45% 47% at 50% 48%, black 58%, transparent 88%);
  -webkit-mask-image:radial-gradient(ellipse 45% 47% at 50% 48%, black 58%, transparent 88%);
}
.mabu-full img {
  width:100%; height:100%; object-fit:contain;
}

/* 对话气泡 */
.speech-bubble {
  position:absolute; bottom:16px; left:-20px;
  background:var(--bg-card);
  border-radius:14px 14px 14px 4px;
  padding:7px 14px;
  font-size:13px; font-weight:500; color:var(--text-deep);
  box-shadow:0 4px 14px rgba(95,70,54,.10);
  white-space:nowrap;
  z-index:2;
  animation:bubble-in .5s .3s cubic-bezier(.34,1.56,.64,1) both;
}
.speech-bubble::after {
  content:""; position:absolute;
  bottom:6px; right:-7px;
  width:0; height:0;
  border-left:8px solid var(--bg-card);
  border-top:5px solid transparent;
  border-bottom:5px solid transparent;
}
@keyframes bubble-in {
  from { opacity:0; transform:translateY(8px) scale(.9); }
  to   { opacity:1; transform:none; }
}

/* ---------- 区块标题 ---------- */
.block { margin-bottom:26px; }
.block-head {
  display:flex; align-items:baseline; justify-content:space-between;
  margin-bottom:12px; padding:0 4px;
}
.block-head h2 {
  margin:0; font-size:19px; font-weight:800; color:var(--text-deep); letter-spacing:.4px;
}
.block-sub { font-size:12px; color:var(--text-soft); }

/* ---------- 今日任务卡片 ---------- */
.task-list { display:grid; grid-template-columns:1fr; gap:12px; }

.task-card {
  background:var(--bg-card);
  border-radius:var(--r-card-sm);
  padding:16px;
  box-shadow:var(--shadow-card);
  display:grid;
  grid-template-columns:48px 1fr;
  grid-template-rows:auto auto;
  grid-template-areas:"icon body" "btn btn";
  gap:8px 14px;
  align-items:center;
  transition:transform .15s,box-shadow .15s;
}
.task-card:active { transform:scale(.985); box-shadow:0 3px 10px rgba(95,70,54,.06); }

.task-card[data-subject="chinese"] { border-left:5px solid var(--c-chinese); }
.task-card[data-subject="math"]    { border-left:5px solid var(--c-math); }
.task-card[data-subject="english"] { border-left:5px solid var(--c-english); }
.task-card[data-subject="sport"]   { border-left:5px solid var(--c-sport); }

/* 图标 */
.ico {
  width:48px; height:48px; border-radius:14px;
  flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  grid-area:icon;
}
.ico svg { width:26px; height:26px; }
.ico-chinese { background:var(--c-chi-lt); color:var(--c-chi-dk); }
.ico-math    { background:var(--c-mat-lt); color:var(--c-mat-dk); }
.ico-english { background:var(--c-eng-lt); color:var(--c-eng-dk); }
.ico-sport   { background:var(--c-spo-lt); color:var(--c-spo-dk); }
.ico-habit   { background:var(--c-hab-lt); color:var(--c-hab-dk); }
.ico-mabu    { background:var(--c-mab-lt); color:var(--c-mab-dk); }

/* 卡片内容 */
.task-body { grid-area:body; min-width:0; }
.task-body h3 {
  margin:0 0 3px;
  font-size:16px; font-weight:700; color:var(--text-deep);
  letter-spacing:.3px; line-height:1.3;
  /* 防止标题换行挤窄 */
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.task-meta {
  margin:0; font-size:12px; color:var(--text-mid); line-height:1.3;
}

/* 按钮 / 状态 区域 */
.task-btn, .task-status { grid-area:btn; justify-self:stretch; }

.task-btn {
  appearance:none; border:none;
  background:var(--caramel); color:#FFF;
  font-weight:700; font-size:15px;
  padding:0 18px; min-height:48px;
  width:100%;
  border-radius:var(--r-btn);
  box-shadow:0 4px 0 var(--caramel-d), 0 2px 8px rgba(200,137,90,.2);
  display:flex; align-items:center; justify-content:center; gap:6px;
  transition:transform .1s,box-shadow .1s,background .15s;
  white-space:nowrap; text-decoration:none; font-family:var(--font-family);
  cursor:pointer;
}
.task-btn:active {
  transform:translateY(2px);
  box-shadow:0 1px 0 var(--caramel-d);
  background:var(--caramel-d);
}
.task-btn .btn-paw { width:16px; height:16px; flex-shrink:0; }

.task-btn.is-outline {
  background:#FFF; color:var(--caramel);
  border:2px solid var(--caramel);
  box-shadow:0 3px 0 rgba(200,137,90,.15);
}
.task-btn.is-outline:active { box-shadow:0 1px 0 rgba(200,137,90,.10); }

.task-status {
  height:44px;
  display:flex; align-items:center; justify-content:center; gap:6px;
  background:#EAF4EC; color:#4E7A58; font-weight:700;
  font-size:14px; border-radius:var(--r-btn);
}
.task-card.is-done { opacity:.88; }

/* ---------- 我的学习世界 ---------- */
.world-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:12px; }

.world-card {
  background:var(--bg-card);
  border-radius:var(--r-card-sm);
  padding:16px;
  box-shadow:var(--shadow-card);
  display:grid;
  grid-template-columns:48px 1fr;
  grid-template-rows:auto auto;
  grid-template-areas:"wico wlabel" "wico wsub";
  align-items:center;
  column-gap:14px; row-gap:1px;
  min-height:0;
  position:relative; overflow:hidden;
  transition:transform .15s;
}
.world-card:active { transform:scale(.97); }

/* 极淡学科色背景 */
.world-chinese { background:#FFF7F5; }
.world-math    { background:#F6F9FC; }
.world-english { background:#F9F7FC; }
.world-sport   { background:#F5FAF7; }
.world-habit   { background:#FDF8EF; }
.world-mabu    { background:#FCF6F0; }

.world-card .ico { grid-area:wico; }
.world-label {
  grid-area:wlabel;
  font-size:16px; font-weight:800; color:var(--text-deep);
  letter-spacing:.4px; line-height:1.3;
}
.world-sub {
  grid-area:wsub;
  font-size:11px; color:var(--text-soft); line-height:1.3;
}

/* 巴拉Mabu成长中心专属小标签 */
.mabu-tag {
  position:absolute; top:10px; right:12px;
  font-size:18px; opacity:.7; pointer-events:none;
}
/* 巴拉Mabu成长中心文字：防止断行在中间 */
.world-mabu-label {
  display:flex; flex-direction:column; line-height:1.35;
}
.world-mabu-label span { font-weight:800; color:var(--text-deep); }

/* ---------- 页脚轻版权 ---------- */
.page-credit {
  text-align:center;
  font-size:11px; color:var(--text-soft);
  opacity:.45; margin-top:32px;
  padding-bottom:16px;
}

/* ============================================================
   响应式
   ============================================================ */

/* ≥ 480px — 小横屏 */
@media (min-width:480px) {
  .welcome-card { padding:20px 28px 14px; }
  .welcome-title { font-size:26px; }
  .mabu-full { width:130px; height:195px; }
}

/* ≥ 600px — 大手机 / 小竖屏 */
@media (min-width:600px) {
  .page { padding:24px 24px 36px; }
  .welcome-title { font-size:28px; }
  .world-grid { grid-template-columns:repeat(2,1fr); gap:14px; }
}

/* ≥ 768px — iPad 竖屏（无侧栏，但显示顶条） */
@media (min-width:768px) {
  body { font-size:18px; }
  .page { padding:28px 32px 40px; }

  /* 欢迎卡改为左右构图 */
  .welcome-card {
    grid-template-columns:1.2fr 1fr;
    padding:22px 36px 14px;
    gap:20px;
  }
  .welcome-title { font-size:30px; }
  .welcome-title .accent { font-size:32px; }
  .mabu-full { width:130px; height:195px; }
  .speech-bubble { bottom:20px; left:-16px; }

  /* 任务卡改为单行横排 */
  .task-card {
    grid-template-columns:48px 1fr auto;
    grid-template-rows:1fr;
    grid-template-areas:"icon body btn";
    gap:12px 16px; align-items:center;
    padding:18px;
  }
  .task-btn, .task-status { width:auto; justify-self:end; }
  .task-body h3 { white-space:normal; } /* iPad 上可换行 */
  .task-list { grid-template-columns:1fr 1fr; gap:14px; }

  /* 学习世界 3 列 */
  .world-grid { grid-template-columns:repeat(3,1fr); gap:14px; }
}

/* ≥ 1024px — iPad 横屏：侧栏出现，顶条隐藏 */
@media (min-width:1024px) {
  .topbar { display:none; }
  .nav-drawer, .nav-backdrop { display:none; }

  .app-sidebar {
    display:flex; flex-direction:column;
    position:fixed; top:0; left:0;
    width:232px; height:100vh;
    background:rgba(255,252,247,.85);
    backdrop-filter:saturate(180%) blur(14px);
    -webkit-backdrop-filter:saturate(180%) blur(14px);
    border-right:1px solid rgba(169,120,85,.08);
    padding:22px 12px 14px;
    z-index:20;
  }
  .app-shell { margin-left:232px; }

  .page { padding:32px 36px 48px; max-width:1060px; }

  .welcome-card {
    grid-template-columns:1.4fr 1fr;
    padding:22px 42px 14px;
  }
  .welcome-title { font-size:34px; }
  .welcome-title .accent { font-size:38px; }
  .mabu-full { width:150px; height:225px; }
  .speech-bubble { bottom:24px; left:-8px; font-size:14px; }

  .world-grid { grid-template-columns:repeat(3,1fr); gap:16px; }
  .world-card { padding:18px; }
}

/* ≥ 1280px — 大屏 */
@media (min-width:1280px) {
  .page { max-width:1120px; padding:40px 48px 56px; }
  .welcome-card { padding:24px 52px 16px; }
  .welcome-title { font-size:38px; }
  .welcome-title .accent { font-size:42px; }
  .mabu-full { width:160px; height:240px; }
  .world-grid { gap:18px; }
  .task-list { gap:16px; }
}

/* ---------- reduced-motion ---------- */
@media (prefers-reduced-motion:reduce) {
  .nav-drawer { transition:none; }
  .speech-bubble { animation:none; }
  .mabu-full { transition:none; }
  .task-card,.world-card,.task-btn { transition:none; }
}

/* ============================================================
   学科分页 — 统一样式
   ============================================================ */

/* 学科欢迎条 */
.subj-hero {
  display:flex; align-items:center; gap:14px;
  padding:16px 18px;
  border-radius:var(--r-card);
  margin-bottom:18px;
}
.subj-hero .ico { width:48px; height:48px; border-radius:14px; }
.subj-hero .ico svg { width:26px; height:26px; }
.subj-hero-title {
  font-size:28px; font-weight:800; color:var(--text-deep);
  letter-spacing:.4px;
}
.subj-hero-tip {
  margin-left:auto;
  background:var(--bg-card);
  border-radius:10px 10px 10px 3px;
  padding:6px 12px;
  font-size:12px; font-weight:500; color:var(--text-mid);
  box-shadow:0 2px 8px rgba(95,70,54,.06);
  white-space:nowrap;
  flex-shrink:0;
}

/* 学科色背景 */
.subj-chinese { background:linear-gradient(135deg,#FFF5F3,#FFEDE8); }
.subj-math    { background:linear-gradient(135deg,#F4F8FC,#E8F1FA); }
.subj-english { background:linear-gradient(135deg,#F7F4FC,#EFEAF7); }
.subj-sport   { background:linear-gradient(135deg,#F2F8F4,#E8F2EC); }
.subj-habit   { background:linear-gradient(135deg,#FCF6ED,#F8EFDF); }

/* 任务类型卡片网格 */
.subj-grid {
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:10px;
  margin-bottom:24px;
}
.subj-card {
  background:var(--bg-card);
  border-radius:var(--r-card-sm);
  padding:14px 14px 12px;
  box-shadow:var(--shadow-card);
  cursor:pointer;
  transition:transform .12s;
  display:flex; flex-direction:column;
  gap:4px;
  min-height:0;
  position:relative; overflow:hidden;
}
.subj-card:active { transform:scale(.97); }
.subj-card .ico { margin-bottom:4px; }

.subj-card-title {
  font-size:15px; font-weight:700; color:var(--text-deep);
  line-height:1.3; letter-spacing:.3px;
}
.subj-card-hint {
  font-size:11px; color:var(--text-soft);
  line-height:1.3;
}

/* 学科卡片色条 — 极淡左侧点缀 */
.subj-card::before {
  content:""; position:absolute;
  left:0; top:12px; bottom:12px; width:4px;
  border-radius:0 3px 3px 0;
}
.subj-chinese-card::before { background:var(--c-chinese); opacity:.5; }
.subj-math-card::before    { background:var(--c-math); opacity:.5; }
.subj-english-card::before { background:var(--c-english); opacity:.5; }
.subj-sport-card::before   { background:var(--c-sport); opacity:.5; }
.subj-habit-card::before   { background:var(--c-habit); opacity:.5; }

/* 返回首页 */
.back-home {
  display:inline-flex; align-items:center; gap:6px;
  padding:0 16px; height:44px;
  border-radius:var(--r-btn);
  font-size:14px; font-weight:600; color:var(--text-mid);
  border:1.5px solid rgba(169,120,85,.15);
  background:var(--bg-card);
  min-height:var(--tap-min);
  transition:background .15s;
}
.back-home:hover { background:var(--bg-soft); }
.back-home svg { width:16px; height:16px; flex-shrink:0; }

/* 响应式 */
@media (min-width:600px) {
  .subj-hero { padding:18px 24px; }
  .subj-hero-title { font-size:30px; }
  .subj-hero-tip { font-size:13px; }
  .subj-grid { gap:12px; }
  .subj-card { padding:16px; }
}
@media (min-width:768px) {
  .subj-hero { padding:20px 28px; }
  .subj-hero-title { font-size:32px; }
  .subj-grid { grid-template-columns:repeat(3,1fr); gap:14px; }
}
@media (min-width:1024px) {
  .subj-hero { padding:22px 32px; }
  .subj-hero-title { font-size:34px; }
}

/* ============================================================
   巴拉Mabu安心陪学 — 完整陪学流程
   ============================================================ */

.study-body {
  background: var(--bg-page);
  transition: background .35s;
}
.study-body.focus-active {
  background: #111311;
}
.study-root {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
}

/* 陪学状态容器（基类） */
.study-state {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
}

/* ---- S1: 启动页 ---- */
.study-start { text-align: center; padding-top: 24px; }

.study-back {
  position: absolute; top: 18px; left: 18px;
  font-size: 14px; font-weight: 600; color: var(--text-mid);
  background: var(--bg-card); border-radius: 12px;
  padding: 10px 16px; box-shadow: var(--shadow-card);
  min-height: var(--tap-min); display: flex; align-items: center;
  transition: background .15s; z-index: 2;
}
.study-back:hover { background: var(--bg-soft); }

.study-mabu-wrap {
  width: 140px; height: 210px; margin: 16px auto 8px;
  position: relative;
  display: flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 10px 22px rgba(95,70,54,.18));
  background: radial-gradient(ellipse 42% 44% at 50% 48%, #FFE6CA 35%, transparent 82%);
  mask-image: radial-gradient(ellipse 45% 47% at 50% 48%, black 58%, transparent 88%);
  -webkit-mask-image: radial-gradient(ellipse 45% 47% at 50% 48%, black 58%, transparent 88%);
}
.study-mabu-img {
  width: 100%; height: 100%; object-fit: contain;
}

.study-task-name {
  margin: 12px 0 4px;
  font-size: 24px; font-weight: 800; color: var(--text-deep);
  letter-spacing: .4px; line-height: 1.3;
}
.study-task-meta {
  margin: 0 0 12px;
  font-size: 15px; color: var(--text-mid);
}
.study-task-meta strong { color: var(--caramel); }

.study-tip {
  margin: 0 0 28px;
  font-size: 15px; color: var(--text-mid);
  line-height: 1.7;
  max-width: 300px;
}

/* 大按钮 — 开始 */
.study-btn-start {
  appearance: none; border: none;
  background: var(--caramel); color: #FFF;
  font-weight: 800; font-size: 20px;
  padding: 0 56px; height: 60px;
  border-radius: 22px;
  box-shadow: 0 5px 0 var(--caramel-d), 0 8px 24px rgba(200,137,90,.22);
  transition: transform .1s, box-shadow .1s;
  min-height: var(--tap-min);
  letter-spacing: .5px;
}
.study-btn-start:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--caramel-d), 0 4px 12px rgba(200,137,90,.14);
}

/* ---- S2: 过渡 ---- */
.study-transition {
  background: var(--bg-page);
}
.trans-msg {
  font-size: 22px; font-weight: 700; color: var(--text-deep);
  text-align: center;
  animation: trans-fade .5s ease-in-out;
}
@keyframes trans-fade {
  0%   { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: none; }
}

/* ---- S3: 黑屏专注 ---- */
.study-focus {
  position: fixed; inset: 0;
  background: #111311;
  z-index: 200;
  cursor: pointer;
  -webkit-user-select: none; user-select: none;
  justify-content: center; align-items: center;
  padding: 0;
  min-height: 0;
}
.focus-clue {
  text-align: center;
  opacity: .22;
  animation: focus-breathe 6s ease-in-out infinite;
}
.focus-paw { font-size: 40px; margin-bottom: 14px; }
.focus-text {
  margin: 0 0 8px;
  font-size: 17px; font-weight: 500; color: #FFF;
  letter-spacing: 2px;
}
.focus-hint {
  margin: 0;
  font-size: 12px; color: rgba(255,255,255,.6);
}
@keyframes focus-breathe {
  0%,100% { opacity: .22; }
  50%     { opacity: .34; }
}

/* ---- S4: 轻点查看浮层 ---- */
.study-peek {
  position: fixed; inset: 0;
  z-index: 210;
  background: rgba(17,19,17,.88);
  display: flex; align-items: center; justify-content: center;
  animation: peek-in .25s ease-out;
}
@keyframes peek-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.peek-card {
  background: rgba(38,41,38,.94);
  border-radius: 22px;
  padding: 32px 26px 26px;
  text-align: center;
  max-width: 340px; width: 88%;
  box-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 16px 40px rgba(0,0,0,.4);
}
.peek-label {
  margin: 0 0 8px;
  font-size: 12px; font-weight: 600; color: rgba(255,255,255,.35);
  letter-spacing: 2px; text-transform: uppercase;
}
.peek-task {
  margin: 0 0 10px;
  font-size: 20px; font-weight: 800; color: rgba(255,255,255,.88);
  line-height: 1.35;
}
.peek-status {
  margin: 0 0 14px;
  font-size: 14px; color: rgba(255,255,255,.55);
}
.peek-time {
  margin: 0 0 22px;
  font-size: 16px; font-weight: 600; color: rgba(255,255,255,.72);
}

/* 完成按钮 — 暗色主题 */
.study-btn-done {
  appearance: none; border: none;
  background: var(--caramel); color: #FFF;
  font-weight: 700; font-size: 18px;
  padding: 0 40px; min-height: 64px;
  border-radius: 20px;
  width: 100%;
  box-shadow: 0 4px 0 var(--caramel-d), 0 6px 18px rgba(0,0,0,.3);
  transition: transform .1s, box-shadow .1s, background .15s;
  font-family: var(--font-family); cursor: pointer;
}
.study-btn-done:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--caramel-d), 0 3px 10px rgba(0,0,0,.2);
  background: var(--caramel-d);
}

/* ---- S5: 完成页 ---- */
.study-complete {
  background: var(--bg-page);
  text-align: center;
}
.done-icon { font-size: 56px; margin-bottom: 6px; }
.done-title {
  margin: 0 0 8px;
  font-size: 30px; font-weight: 800; color: var(--text-deep);
  letter-spacing: .4px;
}
.done-time {
  margin: 0 0 8px;
  font-size: 16px; color: var(--text-mid);
}
.done-task-name {
  margin: 0 0 4px;
  font-size: 13px; color: var(--text-mid); opacity: .7;
  letter-spacing: .2px;
}
.done-praise {
  margin: 0 0 18px;
  font-size: 15px; color: var(--text-deep); font-weight: 600;
}
.done-mabu {
  display: flex; flex-direction: column;
  align-items: center; gap: 12px;
  margin-bottom: 32px;
}
.done-mabu-pic {
  width: 100px; height: 100px; border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(circle, #FFE9CF 40%, transparent 78%);
  filter: drop-shadow(0 6px 16px rgba(95,70,54,.14));
}
.done-mabu-pic img {
  width: 100%; height: 100%; object-fit: cover;
}
.done-bubble {
  background: var(--bg-card);
  border-radius: 14px 14px 14px 4px;
  padding: 10px 18px;
  font-size: 14px; font-weight: 600; color: var(--text-deep);
  box-shadow: 0 4px 14px rgba(95,70,54,.08);
  max-width: 300px;
}

/* 返回首页按钮 */
.study-btn-home {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--caramel); color: #FFF;
  font-weight: 700; font-size: 18px;
  padding: 0 48px; height: 56px;
  border-radius: 20px;
  box-shadow: 0 4px 0 var(--caramel-d), 0 8px 22px rgba(200,137,90,.22);
  transition: transform .1s, box-shadow .1s;
  min-height: var(--tap-min);
}
.study-btn-home:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--caramel-d), 0 4px 12px rgba(200,137,90,.14);
}

/* ---- 温和提醒气泡 ---- */
.study-reminder {
  position: fixed; bottom: 30px; left: 50%;
  transform: translateX(-50%);
  z-index: 220;
  background: rgba(38,41,38,.92);
  color: rgba(255,255,255,.85);
  font-size: 14px; font-weight: 500;
  padding: 12px 24px;
  border-radius: 16px;
  box-shadow: 0 6px 22px rgba(0,0,0,.35);
  white-space: nowrap;
  max-width: 90vw; overflow: hidden; text-overflow: ellipsis;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s, transform .35s;
}
.study-reminder.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

/* ---- 启动页响应式 ---- */
@media (min-width: 600px) {
  .study-mabu-wrap { width: 155px; height: 232px; }
  .study-task-name { font-size: 28px; }
}
@media (min-width: 768px) {
  .study-start { padding-top: 40px; }
  .study-mabu-wrap { width: 170px; height: 255px; }
  .study-task-name { font-size: 32px; }
  .study-btn-start { height: 64px; font-size: 22px; padding: 0 64px; }
  .done-title { font-size: 34px; }
  .done-mabu-pic { width: 115px; height: 115px; }
}

/* =====================================================
   任务完成状态（首页）
   ===================================================== */
.task-done {
  display: flex; align-items: center; gap: 4px;
  padding: 10px 14px; border-radius: 14px;
  background: #EBF5EB; color: #5F855F;
  font-size: 14px; font-weight: 700;
  white-space: nowrap; flex-shrink: 0;
}
.task-done svg { width: 14px; height: 14px; flex-shrink: 0; }
.task-done-text { flex-shrink: 0; }
.task-done-time {
  font-size: 12px; font-weight: 400; opacity: .7;
  margin-left: 2px;
}
.is-hidden { display: none !important; }

/* =====================================================
   photo.html — 拍照提交页
   ===================================================== */
.photo-body {
  background: var(--bg-main); min-height: 100vh; min-height: 100dvh;
  margin: 0; font-family: var(--font-family);
  display: flex; justify-content: center;
}
.photo-root {
  width: 100%; max-width: 580px;
  padding: 32px 20px 40px;
  display: flex; flex-direction: column; align-items: center;
}
.photo-header { margin-bottom: 8px; text-align: center; }
.photo-title {
  margin: 0; font-size: 24px; font-weight: 700; color: var(--text-deep);
  letter-spacing: .3px;
}
.photo-task {
  margin: 0 0 20px; font-size: 16px; color: var(--text-mid);
  font-weight: 600; text-align: center;
}

/* 巴拉Mabu 提示 */
.photo-mabu-hint {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 28px;
}
.photo-mabu-pic {
  width: 56px; height: 84px; object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(95,70,54,.12));
}
.photo-hint-bubble {
  background: var(--card-bg); border-radius: 16px 16px 16px 4px;
  padding: 10px 16px; box-shadow: var(--shadow-card);
  font-size: 14px; color: var(--text-deep); font-weight: 500;
}

/* 拍照区域 */
.photo-area {
  width: 100%; min-height: 200px;
  border: 2px dashed var(--border); border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  background: var(--card-bg); margin-bottom: 20px;
  overflow: hidden;
  transition: border-color .2s;
}
.photo-area:hover { border-color: #C4B09A; }

.photo-empty {
  display: flex; align-items: center; justify-content: center;
  width: 100%; padding: 48px 20px;
}
.photo-pick-btn {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  cursor: pointer; border: none; background: none;
  padding: 28px 36px; border-radius: 18px;
  transition: background .2s;
}
.photo-pick-btn:hover { background: rgba(201,137,90,.06); }
.photo-pick-icon { font-size: 48px; line-height: 1; }
.photo-pick-text {
  font-size: 16px; font-weight: 600; color: var(--text-deep);
}

/* 预览 */
.photo-preview {
  width: 100%; display: flex; align-items: center; justify-content: center;
}
.photo-preview img {
  max-width: 100%; max-height: 340px;
  border-radius: 14px; box-shadow: var(--shadow-card);
  object-fit: contain;
}

/* 操作按钮 */
.photo-actions {
  display: flex; gap: 14px; width: 100%; max-width: 400px;
}
.photo-btn-retake {
  flex:1; padding: 16px 0; min-height: 56px; border-radius: 18px; border: 2px solid var(--caramel);
  background: var(--card-bg); font-size: 17px; font-weight: 600;
  color: var(--caramel); cursor: pointer; font-family: var(--font-family);
  transition: transform .12s, background .15s;
}
.photo-btn-submit {
  flex:1; padding: 16px 0; min-height: 56px; border-radius: 18px; border: none;
  background: var(--btn-warm); color: #fff;
  font-size: 17px; font-weight: 700; cursor: pointer; font-family: var(--font-family);
  box-shadow: 0 4px 16px rgba(200,137,90,.32);
  transition: transform .12s, background .15s, box-shadow .15s;
}
.photo-btn-submit:active {
  transform: scale(.97);
  background: var(--btn-warm-d);
  box-shadow: 0 2px 8px rgba(166,110,69,.35);
}
.photo-btn-retake:active { transform: scale(.97); background: var(--bg-soft); }

/* 提交中 */
.photo-submitting {
  display: flex; flex-direction: column; align-items: center;
  gap: 16px; padding: 48px 0;
}
.photo-spinner {
  width: 36px; height: 36px; border: 3px solid var(--border);
  border-top-color: var(--btn-warm); border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.photo-submitting p {
  font-size: 15px; color: var(--text-mid); margin: 0;
}

/* =====================================================
   reward.html — 巴拉Mabu 即时奖励页
   ===================================================== */
.reward-body {
  background: var(--bg-main); min-height: 100vh; min-height: 100dvh;
  margin: 0; font-family: var(--font-family);
  display: flex; justify-content: center;
}
.reward-root {
  width: 100%; max-width: 480px;
  padding: 48px 20px 40px;
  display: flex; flex-direction: column; align-items: center;
  position: relative; overflow: hidden;
}

/* 星星烟花 */
.reward-sparkles {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
}
.sparkle {
  position: absolute; font-size: 28px; opacity: 0;
  transform: scale(0);
  transition: opacity .4s, transform .5s;
}
.sparkle.s1 { top: 8%;  left: 10%; transition-delay: 0s; }
.sparkle.s2 { top: 5%;  right: 12%; transition-delay: .1s; }
.sparkle.s3 { top: 18%; left: 50%; transition-delay: .15s; }
.sparkle.s4 { top: 12%; right: 25%; transition-delay: .2s; }
.sparkle.s5 { top: 20%; left: 20%; transition-delay: .25s; }
.sparkle.s6 { top: 8%;  left: 40%; transition-delay: .3s; }
.reward-sparkles.active .sparkle { opacity: 1; transform: scale(1); }

/* 巴拉Mabu 弹跳 */
.reward-mabu-wrap {
  margin-bottom: 24px; position: relative; z-index: 1;
}
.reward-mabu-bounce {
  animation: mabuBounce .5s ease 2;
  background: radial-gradient(ellipse 60% 70% at 50% 48%, rgba(255,233,207,.7) 40%, transparent 75%);
  mask-image: radial-gradient(ellipse 52% 52% at 50% 48%, #000 70%, transparent 95%);
  -webkit-mask-image: radial-gradient(ellipse 52% 52% at 50% 48%, #000 70%, transparent 95%);
}
@keyframes mabuBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  40% { transform: translateY(-14px) scale(1.06); }
  70% { transform: translateY(-4px) scale(1.02); }
}
.reward-mabu-img {
  width: 140px; height: 210px; object-fit: contain;
  filter: drop-shadow(0 8px 22px rgba(95,70,54,.16));
}

/* 奖励卡片 */
.reward-card {
  background: var(--card-bg); border-radius: 22px;
  padding: 24px 28px; box-shadow: var(--shadow-mabu);
  text-align: center; margin-bottom: 32px;
  width: 100%; max-width: 380px; position: relative; z-index: 1;
}
.reward-msg {
  margin: 0 0 14px; font-size: 16px; color: var(--text-deep);
  font-weight: 600; line-height: 1.5;
}
.reward-stars {
  margin: 0 0 8px; font-size: 32px; font-weight: 800;
  color: var(--star); letter-spacing: 2px;
}
.reward-total {
  margin: 0; font-size: 13px; color: var(--text-mid);
}

/* 返回首页按钮 */
.reward-home-btn {
  display: inline-block; min-width: 180px;
  padding: 18px 52px; min-height: 64px;
  border-radius: 20px; background: var(--btn-warm); color: #fff;
  font-size: 20px; font-weight: 700; text-decoration: none;
  font-family: var(--font-family);
  box-shadow: 0 6px 22px rgba(200,137,90,.35);
  transition: transform .12s, background .15s, box-shadow .15s;
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.reward-home-btn:active {
  transform: scale(.96);
  background: var(--btn-warm-d);
  box-shadow: 0 3px 10px rgba(166,110,69,.4);
}

/* =====================================================
   direct.html — 直接完成页（英语朗读 / 运动等）
   ===================================================== */
.direct-body {
  background: var(--bg-main); min-height: 100vh; min-height: 100dvh;
  margin: 0; font-family: var(--font-family);
  display: flex; justify-content: center;
}
.direct-root {
  width: 100%; max-width: 520px;
  padding: 40px 20px 48px;
  display: flex; flex-direction: column; align-items: center;
}
.direct-subject {
  font-size: 18px; font-weight: 700; color: var(--text-mid);
  margin-bottom: 20px; letter-spacing: .3px;
}
.direct-mabu-wrap {
  margin-bottom: 16px;
  background: radial-gradient(ellipse 60% 70% at 50% 48%, rgba(255,233,207,.7) 40%, transparent 75%);
  mask-image: radial-gradient(ellipse 52% 52% at 50% 48%, #000 70%, transparent 95%);
  -webkit-mask-image: radial-gradient(ellipse 52% 52% at 50% 48%, #000 70%, transparent 95%);
}
.direct-mabu-img {
  width: 120px; height: 180px; object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(95,70,54,.14));
}
.direct-task-name {
  margin: 0 0 8px; font-size: 22px; font-weight: 700;
  color: var(--text-deep); text-align: center; letter-spacing: .3px;
}
.direct-hint {
  margin: 0 0 6px; font-size: 15px; color: var(--text-mid);
  text-align: center;
}
.direct-status {
  margin: 0 0 28px; font-size: 13px; color: var(--text-mid);
  opacity: .7; text-align: center;
}
.direct-btn {
  display: inline-block; min-width: 200px;
  padding: 18px 52px; min-height: 64px;
  border-radius: 20px; background: var(--btn-warm); color: #fff;
  font-size: 20px; font-weight: 700; border: none; cursor: pointer;
  font-family: var(--font-family);
  box-shadow: 0 6px 22px rgba(200,137,90,.35);
  transition: transform .12s, background .15s, box-shadow .15s;
  -webkit-tap-highlight-color: transparent;
}
.direct-btn:active {
  transform: scale(.96);
  background: var(--btn-warm-d);
  box-shadow: 0 3px 10px rgba(166,110,69,.4);
}

@media (min-width:768px) {
  .direct-mabu-img { width: 140px; height: 210px; }
  .direct-task-name { font-size: 26px; }
  .direct-hint { font-size: 16px; }
  .direct-btn { padding: 20px 64px; min-height: 68px; font-size: 22px; }
}
@media (min-width:1024px) {
  .direct-root { padding: 60px 20px 56px; }
}

/* ============================================================
   家长管理端
   ============================================================ */

/* ---- 通用视图容器 ---- */
.parent-view {
  min-height: 100vh; min-height: 100dvh;
  background: var(--bg-page);
  font-family: "PingFang SC","Hiragino Sans GB","Microsoft YaHei","Helvetica Neue","Segoe UI",system-ui,sans-serif;
  color: var(--text-deep);
}

/* ---- PIN / 卡片页 ---- */
.parent-card {
  max-width: 380px; margin: 0 auto;
  padding: 48px 24px 36px;
  text-align: center;
}
.parent-card-icon { font-size: 48px; margin-bottom: 12px; }
.parent-card-title {
  margin: 0 0 8px; font-size: 24px; font-weight: 800;
  color: var(--text-deep); letter-spacing: .3px;
}
.parent-card-desc {
  margin: 0 0 24px; font-size: 14px; color: var(--text-mid);
  line-height: 1.6;
}
.parent-pin-group {
  display: flex; flex-direction: column; gap: 12px;
  max-width: 260px; margin: 0 auto 16px;
}
.parent-pin-input {
  appearance: none; border: 2px solid rgba(169,120,85,.18);
  background: var(--bg-card); border-radius: 14px;
  padding: 14px 18px; font-size: 20px; font-weight: 700;
  text-align: center; letter-spacing: 8px; color: var(--text-deep);
  font-family: inherit; outline: none;
  transition: border-color .15s;
}
.parent-pin-input:focus { border-color: var(--caramel); }
.parent-error {
  margin: 0 0 16px; font-size: 13px; color: #E06060;
  min-height: 20px;
}

.parent-btn-parent-go {
  appearance: none; border: none;
  background: var(--caramel); color: #FFF;
  font-weight: 700; font-size: 17px;
  padding: 14px 48px; min-height: 52px;
  border-radius: 18px; cursor: pointer; font-family: inherit;
  box-shadow: 0 4px 0 var(--caramel-d), 0 6px 16px rgba(200,137,90,.22);
  transition: transform .1s, box-shadow .1s;
  display: block; margin: 0 auto;
}
.parent-btn-parent-go:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--caramel-d);
}
.parent-btn-back {
  appearance: none; border: none; background: none;
  margin-top: 14px; font-size: 14px; color: var(--text-mid);
  cursor: pointer; font-family: inherit; padding: 10px 20px;
  border-radius: 12px; display: block; margin-left: auto; margin-right: auto;
}
.parent-btn-back:hover { background: rgba(169,120,85,.06); }

/* ---- 管理端顶栏 ---- */
.parent-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(169,120,85,.08);
  background: rgba(255,249,239,.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.parent-topbar-title {
  margin: 0; font-size: 22px; font-weight: 800;
  color: var(--text-deep); letter-spacing: .4px;
}
.parent-btn-quit {
  appearance: none; border: 1.5px solid rgba(169,120,85,.18);
  background: var(--bg-card); border-radius: 14px;
  padding: 8px 20px; font-size: 14px; font-weight: 600;
  color: var(--text-mid); cursor: pointer; font-family: inherit;
  min-height: 44px; transition: background .15s;
}
.parent-btn-quit:hover { background: var(--bg-soft); }

/* ---- 今日统计 ---- */
.parent-today-badge {
  margin: 18px 24px 12px;
  font-size: 15px; font-weight: 600; color: var(--text-mid);
  text-align: center;
}

/* ---- 添加按钮 ---- */
.parent-btn-add {
  display: block; margin: 0 auto 20px;
  appearance: none; border: none;
  background: var(--caramel); color: #FFF;
  font-weight: 700; font-size: 17px;
  padding: 14px 36px; min-height: 52px;
  border-radius: 18px; cursor: pointer; font-family: inherit;
  box-shadow: 0 4px 0 var(--caramel-d), 0 6px 18px rgba(200,137,90,.22);
  transition: transform .1s, box-shadow .1s;
}
.parent-btn-add:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--caramel-d);
}

/* ---- 空状态 ---- */
.parent-empty {
  text-align: center; color: var(--text-soft);
  padding: 40px 20px; font-size: 15px; margin: 0;
}

/* ---- 任务列表 ---- */
.parent-task-list {
  padding: 0 24px 32px;
  max-width: 780px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 10px;
}
.parent-task-row {
  background: var(--bg-card); border-radius: 16px;
  padding: 14px 18px; box-shadow: var(--shadow-card);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.parent-row-left {
  display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1;
}
.parent-row-subj {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 12px; border-radius: 10px;
  font-size: 13px; font-weight: 700; white-space: nowrap;
  flex-shrink: 0;
}
.parent-row-info {
  display: flex; flex-direction: column; min-width: 0;
}
.parent-row-title {
  font-size: 15px; font-weight: 700; color: var(--text-deep);
  line-height: 1.3;
}
.parent-row-meta {
  font-size: 12px; color: var(--text-mid); margin-top: 2px;
}
.parent-row-right {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.parent-status-pending {
  font-size: 12px; color: var(--text-mid);
  background: rgba(169,120,85,.06); padding: 4px 10px;
  border-radius: 8px; white-space: nowrap;
}
.parent-status-done {
  font-size: 12px; color: #5F855F;
  background: #EBF5EB; padding: 4px 10px;
  border-radius: 8px; white-space: nowrap;
}
.parent-row-btn {
  appearance: none; border: 1.5px solid rgba(169,120,85,.15);
  background: var(--bg-card); border-radius: 10px;
  padding: 6px 14px; font-size: 13px; font-weight: 600;
  color: var(--text-mid); cursor: pointer; font-family: inherit;
  transition: background .15s; min-height: 36px;
}
.parent-row-btn:hover { background: var(--bg-soft); }
.parent-row-btn-del { color: #C06060; border-color: rgba(192,96,96,.25); }
.parent-row-btn-del:hover { background: #FFF0F0; }

/* ---- 浮层 ---- */
.parent-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(95,70,54,.35);
  display: flex; align-items: center; justify-content: center;
  animation: overlay-in .2s ease-out;
}
@keyframes overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---- 表单容器 ---- */
.parent-form-container {
  background: var(--bg-page); border-radius: 22px;
  width: 92%; max-width: 560px; max-height: 90vh;
  overflow-y: auto; box-shadow: 0 16px 48px rgba(95,70,54,.2);
  animation: form-slide .25s ease-out;
}
@keyframes form-slide {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
.parent-form-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid rgba(169,120,85,.1);
  position: sticky; top: 0; background: var(--bg-page); z-index: 1;
  border-radius: 22px 22px 0 0;
}
.parent-form-title {
  margin: 0; font-size: 18px; font-weight: 800; color: var(--text-deep);
}
.parent-form-close {
  appearance: none; border: none; background: none;
  width: 40px; height: 40px; font-size: 20px; color: var(--text-mid);
  cursor: pointer; border-radius: 12px; display: flex;
  align-items: center; justify-content: center;
}
.parent-form-close:hover { background: rgba(169,120,85,.08); }
.parent-form-body {
  padding: 20px 22px; display: flex; flex-direction: column; gap: 22px;
}
.parent-form-foot {
  padding: 16px 22px 20px;
  display: flex; gap: 12px; justify-content: flex-end;
  border-top: 1px solid rgba(169,120,85,.08);
}

/* ---- 表单字段 ---- */
.parent-field { display: flex; flex-direction: column; gap: 8px; }
.parent-label {
  font-size: 14px; font-weight: 700; color: var(--text-deep);
}
.parent-input {
  appearance: none; border: 2px solid rgba(169,120,85,.15);
  background: var(--bg-card); border-radius: 12px;
  padding: 12px 16px; font-size: 16px; color: var(--text-deep);
  font-family: inherit; outline: none; transition: border-color .15s;
}
.parent-input:focus { border-color: var(--caramel); }
.parent-input::placeholder { color: var(--text-soft); }

/* ---- 选项网格 ---- */
.parent-subject-grid, .parent-type-grid, .parent-completion-grid, .parent-mode-grid {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.parent-subj-opt, .parent-type-opt, .parent-comp-opt, .parent-mode-opt, .parent-reward-opt {
  appearance: none; border: 2px solid rgba(169,120,85,.12);
  background: var(--bg-card); border-radius: 12px;
  padding: 8px 16px; font-size: 14px; font-weight: 600;
  color: var(--text-mid); cursor: pointer; font-family: inherit;
  transition: all .15s;
}
.parent-subj-opt:hover, .parent-type-opt:hover, .parent-comp-opt:hover,
.parent-mode-opt:hover, .parent-reward-opt:hover {
  border-color: var(--caramel); color: var(--caramel);
}
.parent-subj-opt.is-active, .parent-type-opt.is-active,
.parent-comp-opt.is-active, .parent-mode-opt.is-active,
.parent-reward-opt.is-active,
.parent-time-quick.is-active {
  background: var(--caramel); color: #FFF; border-color: var(--caramel);
  box-shadow: 0 2px 8px rgba(200,137,90,.2);
}

/* ---- 时间选择 ---- */
.parent-time-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.parent-time-quick {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 40px; border-radius: 12px;
  border: 2px solid rgba(169,120,85,.12);
  background: var(--bg-card); font-size: 14px; font-weight: 700;
  color: var(--text-mid); cursor: pointer; transition: all .15s;
}
.parent-time-quick:hover { border-color: var(--caramel); }
.parent-time-custom {
  appearance: none; border: 2px solid rgba(169,120,85,.15);
  background: var(--bg-card); border-radius: 12px;
  padding: 8px 8px 8px 12px; width: 64px; font-size: 16px;
  font-weight: 700; color: var(--text-deep); text-align: center;
  font-family: inherit; outline: none;
}
.parent-time-custom:focus { border-color: var(--caramel); }

/* ---- 陪伴方式选择 ---- */
.parent-session-grid {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.parent-session-opt {
  appearance: none; border: 2px solid rgba(169,120,85,.12);
  background: var(--bg-card); border-radius: 14px;
  padding: 10px 14px; font-size: 13px; font-weight: 600;
  color: var(--text-mid); cursor: pointer; transition: all .15s;
  font-family: inherit; white-space: nowrap;
}
.parent-session-opt:hover { border-color: var(--caramel); }
.parent-session-opt.is-active {
  border-color: var(--caramel); color: var(--caramel);
  background: rgba(201,137,90,.08);
}

/* ---- 奖励选择 ---- */
.parent-reward-row {
  display: flex; gap: 8px;
}

/* ---- 表单按钮 ---- */
.parent-btn-save {
  appearance: none; border: none;
  background: var(--caramel); color: #FFF;
  font-weight: 700; font-size: 16px;
  padding: 12px 36px; min-height: 48px;
  border-radius: 16px; cursor: pointer; font-family: inherit;
  box-shadow: 0 4px 0 var(--caramel-d), 0 6px 16px rgba(200,137,90,.2);
  transition: transform .1s, box-shadow .1s;
}
.parent-btn-save:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--caramel-d);
}
.parent-btn-cancel {
  appearance: none; border: 2px solid rgba(169,120,85,.12);
  background: var(--bg-card); border-radius: 16px;
  padding: 12px 24px; min-height: 48px;
  font-size: 15px; font-weight: 600; color: var(--text-mid);
  cursor: pointer; font-family: inherit; transition: background .15s;
}
.parent-btn-cancel:hover { background: var(--bg-soft); }

/* ---- 删除确认 ---- */
.parent-delete-card {
  background: var(--bg-card); border-radius: 20px;
  padding: 32px 28px; text-align: center;
  box-shadow: 0 16px 48px rgba(95,70,54,.2);
  animation: form-slide .25s ease-out;
}
.parent-delete-msg {
  margin: 0 0 20px; font-size: 17px; font-weight: 700;
  color: var(--text-deep);
}
.parent-delete-actions {
  display: flex; gap: 12px; justify-content: center;
}
.parent-btn-delete {
  appearance: none; border: none;
  background: #D96565; color: #FFF;
  font-weight: 700; font-size: 16px;
  padding: 12px 36px; min-height: 48px;
  border-radius: 16px; cursor: pointer; font-family: inherit;
  box-shadow: 0 4px 0 #B54545, 0 6px 16px rgba(217,101,101,.22);
  transition: transform .1s;
}
.parent-btn-delete:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #B54545;
}

/* ===== 数据管理区域 ===== */
.parent-mgmt {
  margin-top: 28px;
  padding: 20px 24px;
  background: var(--bg-card);
  border-radius: 18px;
  border: 1px solid rgba(169,120,85,.12);
}
.parent-mgmt-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  margin: 0 0 14px;
  letter-spacing: .3px;
}
.parent-mgmt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.parent-mgmt-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px;
  background: var(--bg-soft);
  border-radius: 10px;
}
.parent-mgmt-stat-label {
  font-size: 11px;
  color: var(--text-soft);
}
.parent-mgmt-stat-val {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-deep);
}
.parent-mgmt-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.parent-mgmt-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: 1px solid rgba(169,120,85,.2);
  border-radius: 12px;
  background: var(--bg-card);
  color: var(--caramel);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s;
}
.parent-mgmt-btn:hover {
  background: rgba(169,120,85,.06);
}
.parent-mgmt-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}
.parent-mgmt-btn-restore {
  color: var(--text-mid);
  border-color: rgba(138,111,92,.2);
}
.parent-mgmt-hint {
  font-size: 11px;
  color: var(--text-soft);
  margin: 0;
}

/* ---- 巴拉Mabu语音开关 ---- */
.parent-voice-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-top: 1px dashed rgba(169,120,85,.1);
  border-bottom: 1px dashed rgba(169,120,85,.1);
  margin-bottom: 12px;
}
.parent-voice-label {
  font-size: 14px;
  color: var(--text-mid);
  font-weight: 600;
}
.parent-voice-toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
  cursor: pointer;
}
.parent-voice-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.parent-voice-slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(169,120,85,.18);
  border-radius: 28px;
  transition: background .28s ease;
}
.parent-voice-slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  bottom: 3px;
  background: #FFF;
  border-radius: 50%;
  transition: transform .28s ease;
  box-shadow: 0 1px 3px rgba(95,70,54,.15);
}
.parent-voice-toggle input:checked + .parent-voice-slider {
  background: var(--caramel);
}
.parent-voice-toggle input:checked + .parent-voice-slider::before {
  transform: translateX(20px);
}

/* ---- 语音音量选择 ---- */
.parent-voice-vol-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-top: 1px solid var(--mabu-lt);
  margin-top: 6px;
}
.parent-voice-vol-label {
  font-size: 13px; color: var(--text-mid); font-weight: 600;
  white-space: nowrap;
}
.parent-voice-vol-btns {
  display: flex; gap: 6px;
}
.pv-vol-btn {
  padding: 5px 14px; border-radius: 999px; border: 1.5px solid var(--mabu-lt);
  background: #FFF; color: var(--text-mid); font-size: 12px;
  font-weight: 600; cursor: pointer; font-family: inherit;
  transition: all .15s;
}
.pv-vol-btn:hover { border-color: var(--caramel); color: var(--caramel); }
.pv-vol-btn.is-active {
  background: var(--caramel); color: #FFF; border-color: var(--caramel);
}

/* ===== 学科页动态任务卡 ===== */
/* 空状态 */
.subj-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
}
.subj-empty-icon { font-size: 48px; margin-bottom: 12px; }
.subj-empty-title {
  font-size: 18px; font-weight: 700; color: var(--text-deep);
  margin: 0 0 6px;
}
.subj-empty-sub {
  font-size: 13px; color: var(--text-soft); margin: 0 0 20px;
}
.subj-empty-btn {
  display: inline-block; padding: 10px 28px;
  background: var(--caramel); color: #FFF;
  border-radius: 14px; font-weight: 700; font-size: 14px;
  text-decoration: none; transition: opacity .15s;
}
.subj-empty-btn:hover { opacity: .85; }

/* 动态任务卡片 */
.subj-dyntask {
  background: var(--bg-card);
  border-radius: 18px;
  padding: 18px 20px;
  border: 2px solid rgba(169,120,85,.08);
  transition: border-color .2s, box-shadow .2s;
}
.subj-dyntask:hover {
  border-color: rgba(169,120,85,.18);
  box-shadow: 0 4px 16px rgba(169,120,85,.08);
}
.subj-dyntask.is-done {
  opacity: .72;
  border-color: rgba(169,120,85,.04);
}
.sdt-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.sdt-type {
  display: inline-block; padding: 3px 12px;
  background: rgba(169,120,85,.08); color: var(--caramel);
  border-radius: 10px; font-size: 12px; font-weight: 700;
}
.sdt-stars { font-size: 14px; }
.sdt-title {
  font-size: 17px; font-weight: 700; color: var(--text-deep);
  margin-bottom: 8px; line-height: 1.35;
}
.sdt-meta {
  display: flex; gap: 14px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-soft);
  margin-bottom: 14px;
}
.sdt-action {
  text-align: right;
}
.sdt-done-badge {
  display: inline-block; padding: 6px 18px;
  background: #E8F5E9; color: #2E7D32;
  border-radius: 12px; font-size: 13px; font-weight: 700;
}
.sdt-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 22px; border: none; border-radius: 14px;
  font-size: 14px; font-weight: 700; font-family: inherit;
  cursor: pointer; transition: all .15s;
  box-shadow: 0 3px 0 rgba(0,0,0,.1);
}
.sdt-btn:active { transform: translateY(2px); box-shadow: none; }
.sdt-btn-focus {
  background: var(--caramel); color: #FFF;
  box-shadow: 0 4px 0 var(--caramel-d), 0 6px 16px rgba(200,137,90,.2);
}
.sdt-btn-english {
  background: #7986CB; color: #FFF;
  box-shadow: 0 4px 0 #5C6BC0, 0 6px 16px rgba(121,134,203,.2);
}
.sdt-btn-sport {
  background: #66BB6A; color: #FFF;
  box-shadow: 0 4px 0 #43A047, 0 6px 16px rgba(102,187,106,.2);
}
.sdt-btn-simple {
  background: var(--caramel); color: #FFF;
  box-shadow: 0 4px 0 var(--caramel-d), 0 6px 16px rgba(200,137,90,.2);
}

/* ===========================================================
   巴拉Mabu 成长中心
   =========================================================== */

.growth-body {
  background: var(--bg-page);
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  min-height: 100vh; min-height: 100dvh;
  display: flex; justify-content: center;
  padding: 0 12px 40px;
}
.growth-root {
  width: 100%; max-width: 480px;
}

/* ---- 顶栏 ---- */
.growth-topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0 10px;
}
.growth-back {
  font-size: 15px; color: var(--caramel); text-decoration: none;
  white-space: nowrap;
}
.growth-title {
  font-size: 17px; font-weight: 700; color: var(--text-deep);
  margin: 0;
}

/* ---- 巴拉Mabu形象区 ---- */
.growth-mabu-section {
  background: var(--bg-card);
  border-radius: 20px; padding: 24px 20px 18px;
  box-shadow: 0 2px 12px rgba(0,0,0,.04);
  margin-bottom: 16px;
  position: relative; overflow: hidden;
}
.growth-mabu-wrap {
  text-align: center; position: relative;
}
.growth-mabu-img {
  width: 130px; height: 130px; border-radius: 50%;
  object-fit: cover; border: 3px solid var(--mabu-lt);
  box-shadow: 0 4px 16px rgba(169,120,85,.15);
  transition: transform .3s ease;
}
.growth-mabu-img.bouncing {
  animation: mabuBounce .5s ease;
}
@keyframes mabuBounce {
  0% { transform: translateY(0); }
  30% { transform: translateY(-14px); }
  50% { transform: translateY(0); }
  70% { transform: translateY(-6px); }
  100% { transform: translateY(0); }
}

/* 升级庆祝 */
.growth-levelup {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255,249,239,.92);
  border-radius: 20px; padding: 16px 28px;
  flex-direction: column; align-items: center; gap: 6px;
  box-shadow: 0 8px 32px rgba(200,137,90,.25);
  z-index: 10; animation: gluPopIn .4s ease;
}
@keyframes gluPopIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.7); }
  80% { transform: translate(-50%, -50%) scale(1.08); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.glu-icon { font-size: 40px; }
.glu-text { font-size: 16px; font-weight: 700; color: var(--text-deep); }

/* ---- 统计卡片 ---- */
.growth-stat-card {
  margin-top: 14px; text-align: center;
}
.growth-level-row {
  margin-bottom: 8px;
}
.growth-level-badge {
  display: inline-block; background: var(--caramel); color: #FFF;
  padding: 4px 16px; border-radius: 999px;
  font-size: 14px; font-weight: 700;
}
.growth-bar-wrap {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
}
.growth-bar-track {
  flex: 1; height: 12px; background: #F0E8DB;
  border-radius: 6px; overflow: hidden;
}
.growth-bar-fill {
  height: 100%; background: linear-gradient(90deg, #92C47C, #66BB6A);
  border-radius: 6px; transition: width .6s ease;
}
.growth-bar-text {
  font-size: 12px; color: var(--text-soft); white-space: nowrap;
  min-width: 65px; text-align: right;
}
.growth-dual-stat {
  display: flex; justify-content: center; gap: 24px;
  font-size: 14px; color: var(--text-mid);
}
.growth-dual-stat strong {
  color: var(--text-deep); font-weight: 700;
}
.gds-stars strong { color: var(--star); }
.gds-gp strong { color: #66BB6A; }

/* 星星闪烁 */
@keyframes starFlash {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); color: #F4C542; }
  100% { transform: scale(1); }
}
.star-flash { animation: starFlash .6s ease; }

/* ---- Tab 栏 ---- */
.growth-tabs {
  display: flex; gap: 6px; margin-bottom: 14px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}
.growth-tabs::-webkit-scrollbar { display: none; }
.gtab {
  flex-shrink: 0; padding: 8px 14px;
  border-radius: 999px; border: 1.5px solid var(--mabu-lt);
  background: #FFF; color: var(--text-mid);
  font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .2s;
  white-space: nowrap;
}
.gtab.active {
  background: var(--caramel); color: #FFF;
  border-color: var(--caramel);
  box-shadow: 0 2px 8px rgba(200,137,90,.2);
}
.gtab:active { transform: scale(.96); }

/* ---- 商品网格 ---- */
.gshop-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; padding-bottom: 20px;
}
.gshop-item {
  background: var(--bg-card); border-radius: 16px;
  padding: 14px 10px 12px; text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  cursor: pointer; transition: all .2s;
  border: 2px solid transparent;
}
.gshop-item:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.gshop-item.is-owned { border-color: #C8E6C9; }
.gshop-item.is-equipped { border-color: var(--caramel); background: #FFFBF5; }
.gsi-icon {
  font-size: 32px; margin-bottom: 6px; line-height: 1;
}
.gsi-name {
  font-size: 13px; font-weight: 700; color: var(--text-deep);
  margin-bottom: 3px;
}
.gsi-desc {
  font-size: 11px; color: var(--text-soft); margin-bottom: 8px;
}
.gsi-btn {
  width: 100%; padding: 7px 0; border-radius: 999px;
  border: none; font-size: 12px; font-weight: 700;
  cursor: pointer; transition: all .15s;
  font-family: inherit;
}
.gsi-btn:active { transform: scale(.95); }
.gsi-btn-buy {
  background: var(--caramel); color: #FFF;
  box-shadow: 0 2px 0 var(--caramel-d);
}
.gsi-btn-equip {
  background: #E8F5E9; color: #43A047;
  border: 1.5px solid #81C784;
}
.gsi-btn-equipped {
  background: #FFF3E0; color: var(--caramel);
  border: 1.5px solid var(--caramel);
  cursor: default; opacity: .85;
}
.gsi-owned-tag {
  display: inline-block; font-size: 11px; color: #43A047;
  font-weight: 700;
}

/* ---- 洗澡区 ---- */
.gbath-section {
  text-align: center; padding: 24px 20px;
  background: var(--bg-card); border-radius: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,.04);
}
.gbath-icon-wrap {
  position: relative; display: inline-block;
  margin-bottom: 14px;
}
.gbath-big-icon {
  font-size: 56px; display: block;
}
.gbath-bubbles {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 4px;
}
.gbubble {
  font-size: 16px; animation: bubbleFloat 2s ease-in-out infinite;
}
.gbubble.b1 { animation-delay: 0s; }
.gbubble.b2 { animation-delay: .5s; }
.gbubble.b3 { animation-delay: 1s; }
@keyframes bubbleFloat {
  0%, 100% { transform: translateY(0); opacity: .5; }
  50% { transform: translateY(-8px); opacity: 1; }
}
.gbath-title {
  font-size: 16px; font-weight: 700; color: var(--text-deep);
  margin: 0 0 6px;
}
.gbath-desc {
  font-size: 13px; color: var(--text-soft); margin: 0 0 16px;
}
.gbath-btn {
  padding: 12px 32px; border-radius: 999px; border: none;
  font-size: 15px; font-weight: 700; font-family: inherit;
  cursor: pointer; background: #64B5F6; color: #FFF;
  box-shadow: 0 3px 0 #42A5F5, 0 5px 14px rgba(100,181,246,.25);
  transition: all .15s;
}
.gbath-btn:active { transform: translateY(2px); box-shadow: none; }
.gbath-btn:disabled {
  opacity: .6; cursor: not-allowed;
}
.gbath-btn.gbath-hint-low {
  background: #E0E0E0; color: #999;
  box-shadow: 0 3px 0 #CCC;
}
.gbath-wrap-hint {
  margin-top: 14px; font-size: 12px; color: var(--text-soft);
}

/* ---- 兑换确认浮层 ---- */
.growth-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.growth-redeem-card {
  background: var(--bg-card); border-radius: 24px;
  padding: 28px 24px 22px; text-align: center;
  width: 100%; max-width: 320px;
  box-shadow: 0 12px 40px rgba(0,0,0,.15);
  animation: redeFloat .3s ease;
}
@keyframes redeFloat {
  from { opacity: 0; transform: translateY(20px) scale(.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.grc-icon { font-size: 48px; margin-bottom: 6px; }
.grc-name { font-size: 17px; font-weight: 700; color: var(--text-deep); margin: 0 0 4px; }
.grc-price { font-size: 22px; font-weight: 700; color: var(--star); margin: 0 0 6px; }
.grc-balance { font-size: 13px; color: var(--text-soft); margin: 0 0 8px; }
.grc-hint { font-size: 13px; color: var(--caramel); margin: 0 0 14px; }
.grc-actions {
  display: flex; gap: 10px; margin-top: 6px;
}
.grc-btn-cancel {
  flex: 1; padding: 10px; border-radius: 999px;
  border: 1.5px solid var(--mabu-lt); background: #FFF;
  color: var(--text-mid); font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.grc-btn-confirm {
  flex: 1; padding: 10px; border-radius: 999px; border: none;
  background: var(--caramel); color: #FFF;
  font-size: 14px; font-weight: 700; cursor: pointer;
  font-family: inherit; box-shadow: 0 3px 0 var(--caramel-d);
  transition: all .15s;
}
.grc-btn-confirm:active { transform: translateY(2px); box-shadow: none; }
.grc-btn-confirm.is-disabled {
  background: #E0E0E0; color: #999; cursor: not-allowed;
  box-shadow: 0 3px 0 #CCC;
}

/* ---- 互动浮层 ---- */
.growth-interact-card {
  background: var(--bg-card); border-radius: 24px;
  padding: 32px 24px 24px; text-align: center;
  width: 100%; max-width: 300px;
  box-shadow: 0 12px 40px rgba(0,0,0,.15);
  animation: redeFloat .3s ease;
}
.gic-anim {
  font-size: 52px; margin-bottom: 10px;
  animation: gicBounce .6s ease infinite alternate;
}
@keyframes gicBounce {
  from { transform: translateY(0) rotate(-5deg); }
  to { transform: translateY(-8px) rotate(5deg); }
}
.gic-msg {
  font-size: 16px; font-weight: 700; color: var(--text-deep);
  margin: 0 0 18px;
}
.gic-btn {
  padding: 10px 32px; border-radius: 999px; border: none;
  background: var(--caramel); color: #FFF;
  font-size: 15px; font-weight: 700; cursor: pointer;
  font-family: inherit; box-shadow: 0 3px 0 var(--caramel-d);
}
.gic-btn:active { transform: translateY(2px); box-shadow: none; }

/* ---- 奖励页新元素 ---- */
.reward-gp {
  font-size: 14px; color: #66BB6A; margin: 0 0 2px;
  font-weight: 700;
}
.reward-level {
  font-size: 12px; color: var(--caramel); margin: 0;
  font-weight: 600;
}

/* ================================================================
   巴拉Mabu 苹果互动剧场
   ================================================================ */
.apple-theater {
  position: fixed; inset: 0; z-index: 20000;
  background: var(--bg-main);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  animation: atFadeIn .4s ease;
}
@keyframes atFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.apple-scene {
  position: relative;
  width: 100%; max-width: 420px; height: 100%;
  max-height: 640px;
  display: flex; align-items: center; justify-content: center;
}

/* ---- 巴拉 Mabu 主体 ---- */
.apple-mabu {
  max-width: 280px; width: 75%;
  display: block; margin: 0 auto;
  transition: transform .5s cubic-bezier(.34,1.56,.64,1);
  position: relative; z-index: 2;
  pointer-events: none;
  user-select: none;
}

/* Mabu 开心弹跳 */
.apple-mabu.happy-bounce {
  animation: appleMabuBounce .55s ease 2;
}
@keyframes appleMabuBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  40% { transform: translateY(-14px) scale(1.05); }
  70% { transform: translateY(-6px) scale(1.02); }
}

/* Mabu 拿苹果微晃 */
.apple-mabu.holding-apple {
  animation: appleMabuHold .5s ease infinite alternate;
}
@keyframes appleMabuHold {
  from { transform: translateY(0) rotate(-1deg); }
  to { transform: translateY(-3px) rotate(1deg); }
}

/* ---- 苹果 ---- */
.apple-fruit {
  position: absolute;
  font-size: 64px;
  left: 50%;
  z-index: 10;
  transition: all .55s cubic-bezier(.34,1.56,.64,1);
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.1));
}

/* Phase 0: 起始（屏幕下方之外） */
.apple-fruit.p-start {
  bottom: -100px; opacity: 0;
  transform: translateX(-50%) scale(.6);
}

/* Phase 1: 出现（底部可见） */
.apple-fruit.p-appear {
  bottom: 8%; opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* Phase 2: 来到巴拉手里（胸部位置） */
.apple-fruit.p-hands {
  bottom: 34%; opacity: 1;
  transform: translateX(-50%) scale(1);
  animation: appleNudge .35s ease infinite alternate;
}
@keyframes appleNudge {
  from { transform: translateX(-50%) translateY(0) rotate(-3deg); }
  to { transform: translateX(-50%) translateY(-5px) rotate(3deg); }
}

/* Phase 3: 第一口（到嘴边，缩小到75%） */
.apple-fruit.p-bite1 {
  bottom: 24%; opacity: 1;
  transform: translateX(-50%) scale(.72);
}

/* Phase 4: 第二口（缩小到40%） */
.apple-fruit.p-bite2 {
  bottom: 25%; opacity: 1;
  transform: translateX(-50%) scale(.4);
}

/* Phase 5: 消失 */
.apple-fruit.p-gone {
  bottom: 32%; opacity: 0;
  transform: translateX(-50%) scale(.15);
}

/* ---- 爱心 / 小星星 ---- */
.apple-hearts {
  position: absolute; top: 8%; left: 50%;
  transform: translateX(-50%); z-index: 5;
  display: flex; gap: 10px;
  pointer-events: none;
}
.apple-hearts .ah {
  font-size: 26px;
  animation: heartRise 1s ease infinite alternate;
}
.apple-hearts .ah:nth-child(1) { animation-delay: 0s; }
.apple-hearts .ah:nth-child(2) { animation-delay: .25s; }
.apple-hearts .ah:nth-child(3) { animation-delay: .5s; }
@keyframes heartRise {
  from { transform: translateY(0) scale(.7); opacity: .5; }
  to { transform: translateY(-18px) scale(1.2); opacity: 1; }
}

/* ---- 气泡对话框 ---- */
.apple-bubble {
  position: absolute; top: 2%; left: 50%;
  transform: translateX(-50%); z-index: 6;
  background: #FFF; border-radius: 18px;
  padding: 10px 20px;
  font-size: 15px; font-weight: 700;
  color: var(--text-deep);
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
  white-space: nowrap;
  animation: bubblePop .35s ease;
  pointer-events: none;
}
@keyframes bubblePop {
  from { opacity: 0; transform: translateX(-50%) translateY(10px) scale(.85); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* ---- 星星扣除飘字 ---- */
.apple-deduct {
  position: fixed; top: 24px; left: 50%;
  transform: translateX(-50%); z-index: 20001;
  font-size: 20px; font-weight: 700; color: var(--star);
  animation: deduFloat .9s ease forwards;
  pointer-events: none;
}
@keyframes deduFloat {
  0% { opacity: 0; transform: translateX(-50%) scale(.4); }
  25% { opacity: 1; transform: translateX(-50%) scale(1.25); }
  60% { opacity: .8; transform: translateX(-50%) translateY(-18px) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-36px) scale(.8); }
}

/* ---- 跳过按钮 ---- */
.apple-skip {
  position: fixed; bottom: 32px; right: 20px; z-index: 20001;
  padding: 8px 18px; border-radius: 999px;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.65);
  color: var(--text-soft); font-size: 13px;
  cursor: pointer; font-family: inherit;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background .2s;
}
.apple-skip:active { background: rgba(255,255,255,.9); }

/* ---- 温和提示 toast ---- */
.apple-toast {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%);
  z-index: 20001;
  background: #FFFBF5; border-radius: 20px;
  padding: 18px 28px;
  font-size: 15px; font-weight: 600; color: var(--text-mid);
  box-shadow: 0 6px 24px rgba(0,0,0,.1);
  border: 1.5px solid var(--mabu-lt);
  text-align: center; max-width: 280px;
  animation: appleToastIn .4s ease;
  pointer-events: none;
}
@keyframes appleToastIn {
  from { opacity: 0; transform: translate(-50%,-50%) scale(.9); }
  to { opacity: 1; transform: translate(-50%,-50%) scale(1); }
}

/* ================================================================
   巴拉Mabu 洗澡互动剧场
   ================================================================ */
.bath-theater {
  position: fixed; inset: 0; z-index: 20000;
  background: linear-gradient(180deg, #FFF9EF 0%, #FFF2E0 40%, #FFECD5 100%);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  animation: atFadeIn .4s ease;
}

.bath-scene {
  position: relative;
  width: 100%; max-width: 420px; height: 100%;
  max-height: 700px;
  display: flex; align-items: center; justify-content: center;
}

/* ---- 巴拉 Mabu ---- */
.bath-mabu {
  max-width: 260px; width: 70%;
  display: block; margin: 0 auto;
  transition: transform .5s cubic-bezier(.34,1.56,.64,1), filter .8s ease;
  position: relative; z-index: 2;
  pointer-events: none; user-select: none;
}

/* Mabu 轻弹 */
.bath-mabu.is-bouncing {
  animation: bathSoftBounce .6s ease;
}
@keyframes bathSoftBounce {
  0% { transform: translateY(0) scale(1); }
  30% { transform: translateY(-10px) scale(1.04); }
  50% { transform: translateY(0) scale(1); }
  70% { transform: translateY(-4px) scale(1.02); }
  100% { transform: translateY(0) scale(1); }
}

/* Mabu 轻轻晃动 */
.bath-mabu.is-swaying {
  animation: bathSway 1.2s ease-in-out infinite alternate;
}
@keyframes bathSway {
  from { transform: translateX(-3px) rotate(-1.5deg); }
  to { transform: translateX(3px) rotate(1.5deg); }
}

/* Mabu 洗后蓬松干净 */
.bath-mabu.is-clean {
  filter: brightness(1.12) saturate(1.08) drop-shadow(0 0 14px rgba(255,210,160,.45));
  transform: scale(1.03);
}

/* Mabu 开心跳 */
.bath-mabu.is-happy {
  animation: bathHappy .55s ease 2;
}
@keyframes bathHappy {
  0%, 100% { transform: translateY(0) scale(1); }
  40% { transform: translateY(-16px) scale(1.07); }
  70% { transform: translateY(-6px) scale(1.03); }
}

/* ---- 泡泡 ---- */
.bath-bubble {
  position: absolute; z-index: 3;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.7), rgba(180,210,240,.25));
  border-radius: 50%;
  pointer-events: none; user-select: none;
  animation: bathBubFloat 2.2s ease-in-out infinite;
  opacity: 0;
  transition: opacity .6s ease;
}
.bath-bubble.is-visible { opacity: .65; }
.bath-bubble.is-fading { opacity: 0 !important; transition: opacity 1s ease; }

@keyframes bathBubFloat {
  0% { transform: translateY(0) scale(.8); }
  40% { transform: translateY(-16px) scale(1.15); }
  70% { transform: translateY(-8px) scale(1); }
  100% { transform: translateY(0) scale(.85); }
}

/* ---- 浴巾/海绵 ---- */
.bath-towel {
  position: absolute; z-index: 5;
  font-size: 44px;
  pointer-events: none; user-select: none;
  opacity: 0;
  transition: opacity .3s ease;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.08));
}
.bath-towel.is-visible { opacity: 1; }
.bath-towel.is-wiping {
  animation: bathTowelWipe 1.4s ease-in-out;
}
@keyframes bathTowelWipe {
  0% { transform: translateX(-60px) rotate(-15deg); }
  35% { transform: translateX(20px) rotate(5deg); }
  65% { transform: translateX(-20px) rotate(-5deg); }
  100% { transform: translateX(0) rotate(0deg); opacity: 0; }
}

/* ---- 毛巾擦香香 ---- */
.bath-final-towel {
  position: absolute; z-index: 5;
  font-size: 38px;
  pointer-events: none; user-select: none;
  opacity: 0;
  transition: opacity .25s ease;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.06));
}
.bath-final-towel.is-visible { opacity: 1; }
.bath-final-towel.is-wiping {
  animation: bathTowelQuickWipe 1s ease-in-out;
}
@keyframes bathTowelQuickWipe {
  0% { transform: translateY(-20px) rotate(-8deg); }
  40% { transform: translateY(10px) rotate(3deg); }
  70% { transform: translateY(-5px) rotate(-3deg); }
  100% { transform: translateY(0) rotate(0deg); opacity: 0; }
}

/* ---- 闪亮/水滴 ---- */
.bath-sparkles {
  position: absolute; top: 12%; left: 50%;
  transform: translateX(-50%); z-index: 4;
  display: flex; gap: 14px;
  pointer-events: none;
}
.bath-sparkles span {
  font-size: 20px;
  opacity: 0;
  animation: bathSparklePop 1.5s ease infinite;
}
.bath-sparkles span:nth-child(1) { animation-delay: 0s; }
.bath-sparkles span:nth-child(2) { animation-delay: .4s; }
.bath-sparkles span:nth-child(3) { animation-delay: .8s; }
@keyframes bathSparklePop {
  0%, 100% { opacity: 0; transform: translateY(4px) scale(.6); }
  50% { opacity: .75; transform: translateY(-6px) scale(1.1); }
}

/* ---- 爱心 ---- */
.bath-hearts {
  position: absolute; top: 6%; left: 50%;
  transform: translateX(-50%); z-index: 6;
  display: flex; gap: 10px;
  pointer-events: none;
}
.bath-hearts span {
  font-size: 24px;
  animation: bathHeartRise 1s ease infinite alternate;
}
.bath-hearts span:nth-child(1) { animation-delay: 0s; }
.bath-hearts span:nth-child(2) { animation-delay: .25s; }
.bath-hearts span:nth-child(3) { animation-delay: .5s; }
@keyframes bathHeartRise {
  from { transform: translateY(0) scale(.7); opacity: .5; }
  to { transform: translateY(-16px) scale(1.2); opacity: 1; }
}

/* ---- 对话气泡 ---- */
.bath-speech {
  position: absolute; bottom: 12%; left: 50%;
  transform: translateX(-50%); z-index: 7;
  background: #FFF; border-radius: 18px;
  padding: 10px 20px;
  font-size: 15px; font-weight: 700;
  color: var(--text-deep);
  box-shadow: 0 4px 18px rgba(0,0,0,.08);
  white-space: nowrap;
  animation: bubblePop .35s ease;
  pointer-events: none;
}

/* ---- 跳过按钮 ---- */
.bath-skip {
  position: fixed; bottom: 32px; right: 20px; z-index: 20001;
  padding: 8px 18px; border-radius: 999px;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.65);
  color: var(--text-soft); font-size: 13px;
  cursor: pointer; font-family: inherit;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background .2s;
}
.bath-skip:active { background: rgba(255,255,255,.9); }

/* ================================================================
   巴拉Mabu 统一装备渲染 — 帽子叠加层
   ================================================================ */
.mabu-equip-container {
  position: relative; display: inline-block;
}
.mabu-equip-img {
  display: block; position: relative; z-index: 1;
}
.mabu-hat-overlay {
  position: absolute; z-index: 3;
  pointer-events: none; user-select: none;
}
/* 帽子定位（根据父容器微调，继承父容器尺寸比例） */
.mabu-hat-overlay svg {
  display: block; width: 100%; height: auto;
}

/* ================================================================
   巴拉Mabu 帽子互动剧场
   ================================================================ */
.hat-theater {
  position: fixed; inset: 0; z-index: 20000;
  background: linear-gradient(170deg, #FFF9EF 0%, #FFF3E0 40%, #FFECB3 100%);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  animation: htFadeIn .4s ease;
}
@keyframes htFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.hat-scene {
  position: relative;
  width: 100%; max-width: 420px; height: 100%;
  max-height: 640px;
  display: flex; align-items: center; justify-content: center;
}

/* 巴拉 Mabu（剧场中） */
.hat-mabu {
  max-width: 260px; width: 72%;
  display: block; margin: 0 auto;
  position: relative; z-index: 2;
  pointer-events: none; user-select: none;
  transition: transform .5s cubic-bezier(.34,1.56,.64,1);
}

/* 剧场帽子（动画用） */
.hat-flying {
  position: absolute; z-index: 5;
  font-size: 72px; line-height: 1;
  transition: all .7s cubic-bezier(.25,.8,.25,1.2);
  pointer-events: none; user-select: none;
}
.hat-flying.is-from-top {
  top: -20%; left: 50%; transform: translateX(-50%) rotate(-10deg) scale(.8);
}
.hat-flying.is-on-head {
  top: 8%; left: 50%; transform: translateX(-50%) rotate(0deg) scale(1.05);
}
.hat-flying.is-settled {
  top: 10%; left: 50%; transform: translateX(-50%) rotate(-3deg) scale(1);
}

/* 剧场泡泡对白 */
.hat-speech {
  position: absolute; bottom: 22%; left: 50%;
  transform: translateX(-50%);
  background: #FFF9EF; color: #5C4033;
  font-size: 15px; font-weight: 600;
  padding: 10px 22px; border-radius: 20px;
  box-shadow: 0 4px 16px rgba(139,90,43,.12);
  white-space: nowrap; z-index: 6;
  animation: htBubbleIn .4s ease;
}
@keyframes htBubbleIn {
  from { opacity: 0; transform: translateX(-50%) translateY(12px) scale(.9); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* 剧场爱心/星星 */
.hat-sparkles {
  position: absolute; top: 15%; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 12px; z-index: 6;
}
.hat-sparkles span {
  font-size: 28px;
  animation: htSparkleFloat 1.4s ease infinite alternate;
}
.hat-sparkles span:nth-child(2) { animation-delay: .3s; }
.hat-sparkles span:nth-child(3) { animation-delay: .6s; }
@keyframes htSparkleFloat {
  from { transform: translateY(0) scale(.8); opacity: .6; }
  to { transform: translateY(-10px) scale(1.1); opacity: 1; }
}

/* 剧场跳过 */
.hat-skip {
  position: absolute; top: 18px; right: 20px; z-index: 10;
  border: none; border-radius: 16px; padding: 7px 16px;
  background: rgba(255,255,255,.65);
  color: var(--text-soft); font-size: 13px;
  cursor: pointer; font-family: inherit;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background .2s;
}
.hat-skip:active { background: rgba(255,255,255,.9); }

/* Mabu 开心弹跳（剧场中） */
.hat-mabu.is-bouncing {
  animation: hatMabuBounce .5s ease 2;
}
@keyframes hatMabuBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  40% { transform: translateY(-10px) scale(1.04); }
  70% { transform: translateY(-4px) scale(1.02); }
}

.hat-mabu.is-wiggling {
  animation: hatMabuWiggle .45s ease infinite alternate;
}
@keyframes hatMabuWiggle {
  from { transform: rotate(-2deg); }
  to { transform: rotate(2deg); }
}

.hat-mabu.has-hat {
  filter: brightness(1.04) saturate(1.05);
}

/* ================================================================
   帽子屋商品卡增强
   ================================================================ */
.gshop-hat-card {
  position: relative;
}
.gshop-hat-card .gsi-btn-buy {
  transition: all .2s;
}
.gshop-hat-card .gsi-btn-equipped {
  background: #E8F5E9; color: #388E3C; border: 1px solid #A5D6A7;
  cursor: default;
}
.gshop-hat-card .gsi-btn-equip {
  background: #FFF3E0; color: #E65100; border: 1px solid #FFCC80;
  cursor: pointer;
}
.gshop-hat-card .gsi-btn-unequip {
  background: transparent; color: var(--text-soft); border: 1px dashed #ccc;
  font-size: 11px; padding: 5px 12px; cursor: pointer;
  border-radius: 10px; font-family: inherit;
}

/* DEV 测试按钮 */
.dev-test-btn {
  display: inline-block; padding: 5px 14px; margin-top: 8px;
  font-size: 11px; color: #999; background: #f5f5f5;
  border: 1px dashed #ddd; border-radius: 10px;
  cursor: pointer; font-family: inherit;
  opacity: .6; transition: opacity .2s;
}
.dev-test-btn:hover { opacity: 1; }

/* ================================================================
   衣服互动剧场（复用帽子剧場结构）
   ================================================================ */
.clothes-theater {
  position: fixed; inset: 0; z-index: 20002;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  background: linear-gradient(160deg, #FFF9EF 0%, #FFF0DC 40%, #F5E6D3 100%);
  animation: theaterFadeIn .4s ease;
}
.clothes-scene {
  position: relative; width: 300px; height: 340px;
  display: flex; align-items: center; justify-content: center;
}
.clothes-mabu {
  max-width: 200px; max-height: 260px;
  object-fit: contain; z-index: 3;
  transition: transform .4s ease, filter .4s ease;
}
.clothes-flying {
  position: absolute; font-size: 64px; z-index: 5;
  opacity: 0;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,.1));
  transition: opacity .4s ease, transform .5s cubic-bezier(.25,.46,.45,.94);
}
.clothes-flying.is-from-top {
  top: 0; left: 50%; transform: translate(-50%, -30px);
  opacity: 1;
}
.clothes-flying.is-on-body {
  top: 58%; left: 50%; transform: translate(-50%, -50%) scale(.8);
  opacity: 1;
}
.clothes-flying.is-settled {
  top: 60%; left: 50%; transform: translate(-50%, -50%) scale(.78);
  opacity: 1;
}
.clothes-sparkles {
  position: absolute; top: 18%; left: 50%; transform: translateX(-50%);
  display: flex; gap: 10px; z-index: 6;
}
.clothes-sparkles span {
  font-size: 26px;
  animation: clSparkleFloat 1.3s ease infinite alternate;
}
.clothes-sparkles span:nth-child(2) { animation-delay: .3s; }
.clothes-sparkles span:nth-child(3) { animation-delay: .6s; }
@keyframes clSparkleFloat {
  from { transform: translateY(0) scale(.8); opacity: .6; }
  to { transform: translateY(-8px) scale(1.1); opacity: 1; }
}
.clothes-speech {
  position: absolute; bottom: 4%; left: 50%; transform: translateX(-50%);
  background: rgba(255,255,255,.9); color: var(--text-main);
  padding: 8px 18px; border-radius: 20px; font-size: 15px;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
  z-index: 10; white-space: nowrap; animation: bounceIn .5s ease;
}
.clothes-skip {
  position: absolute; top: 18px; right: 20px; z-index: 10;
  border: none; border-radius: 16px; padding: 7px 16px;
  background: rgba(255,255,255,.65); color: var(--text-soft);
  font-size: 13px; cursor: pointer; font-family: inherit;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: background .2s;
}
.clothes-skip:active { background: rgba(255,255,255,.9); }

/* Mabu 开心弹跳 / 轻晃（剧场中） */
.clothes-mabu.is-bouncing {
  animation: clMabuBounce .5s ease 2;
}
@keyframes clMabuBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  40% { transform: translateY(-10px) scale(1.04); }
  70% { transform: translateY(-4px) scale(1.02); }
}
.clothes-mabu.is-wiggling {
  animation: clMabuWiggle .5s ease infinite alternate;
}
@keyframes clMabuWiggle {
  from { transform: rotate(-2.5deg); }
  to { transform: rotate(2.5deg); }
}

/* ================================================================
   多槽装备叠加层（成长中心）
   ================================================================ */
.mabu-equip-container {
  position: relative; display: inline-block; line-height: 0;
}
.mabu-hat-overlay {
  position: absolute; pointer-events: none; z-index: 4;
  animation: equipLayerIn .3s ease;
}
.mabu-clothes-overlay {
  position: absolute; pointer-events: none; z-index: 3;
  animation: equipLayerIn .3s ease;
}
.mabu-accessory-overlay {
  position: absolute; pointer-events: none; z-index: 5;
  animation: equipLayerIn .3s ease;
}
@keyframes equipLayerIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ================================================================
   首页 Mabu 装备叠加
   ================================================================ */
.welcome-mabu-wrap {
  position: relative; display: inline-block; line-height: 0;
}
.welcome-hat-overlay,
.welcome-clothes-overlay,
.welcome-accessory-overlay {
  position: absolute; pointer-events: none;
  animation: equipLayerIn .3s ease;
}
.welcome-hat-overlay { z-index: 4; }
.welcome-clothes-overlay { z-index: 3; }
.welcome-accessory-overlay { z-index: 5; }

/* ================================================================
   小屋 Tab
   ================================================================ */
.room-container {
  background: linear-gradient(180deg, #FFF9EF 0%, #FFF3E0 40%, #F5E6D3 100%);
  border-radius: 24px; padding: 30px 20px 24px;
  text-align: center; min-height: 380px;
  position: relative; overflow: hidden;
}
.room-title {
  font-size: 18px; color: var(--text-main); margin-bottom: 16px;
  font-weight: 600;
}
.room-mabu-area {
  position: relative; width: 200px; height: 240px;
  margin: 0 auto 20px;
}
.room-mabu-img {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  max-width: 160px; max-height: 200px; object-fit: contain; z-index: 2;
}
.room-decor {
  position: absolute; pointer-events: none; z-index: 1;
  opacity: 0; transition: opacity .5s ease, transform .5s ease;
}
.room-decor.is-placed {
  opacity: 1; transform: scale(1);
}
.room-decor-rug {
  bottom: 4px; left: 50%; transform: translateX(-50%) scale(.7);
  font-size: 80px;
}
.room-decor-rug.is-placed {
  transform: translateX(-50%) scale(1);
}
.room-decor-lamp {
  top: 6%; right: 8%; font-size: 40px;
  transform: scale(.6);
}
.room-decor-lamp.is-placed {
  transform: scale(1);
}
.room-decor-plant {
  bottom: 10%; left: 10%; font-size: 38px;
  transform: scale(.6);
}
.room-decor-plant.is-placed {
  transform: scale(1);
}
.room-decor-shelf {
  top: 10%; left: 6%; font-size: 42px;
  transform: scale(.6);
}
.room-decor-shelf.is-placed {
  transform: scale(1);
}
.room-empty-hint {
  color: var(--text-soft); font-size: 14px;
  padding: 20px 0;
}
.room-decor-list {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center; margin-top: 18px;
}
.room-decor-list .gshop-item {
  flex: 0 0 calc(50% - 8px); max-width: 160px;
}
.room-shop-toggle {
  display: inline-block; padding: 6px 16px; margin-top: 14px;
  border: 1px solid #ddd; border-radius: 12px;
  background: #fff; color: var(--text-soft); font-size: 13px;
  cursor: pointer; font-family: inherit;
  transition: background .2s;
}
.room-shop-toggle:hover { background: #fafafa; }

/* ================================================================
   等级技能系统 — 新本领/升级剧场/技能表演
   ================================================================ */

/* ---- 巴拉的新本领（技能展示区） ---- */
.skills-area {
  margin-top: 14px; padding: 12px 16px;
  background: linear-gradient(135deg, #FFF8F0, #FFF3E3);
  border-radius: 16px; border: 1px solid rgba(169,120,85,.1);
  text-align: left;
}
.skills-title {
  font-size: 13px; font-weight: 700; color: var(--caramel);
  margin: 0 0 10px; letter-spacing: .3px;
}
.skills-list {
  display: flex; flex-direction: column; gap: 8px;
}
.skill-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 12px;
  background: rgba(255,255,255,.6);
  transition: background .15s;
}
.skill-row.is-unlocked {
  cursor: pointer;
}
.skill-row.is-unlocked:hover {
  background: rgba(255,255,255,.9);
}
.skill-row.is-locked {
  opacity: .55;
}
.skill-icon {
  font-size: 22px; flex-shrink: 0;
  width: 32px; text-align: center;
}
.skill-info {
  flex: 1; min-width: 0;
}
.skill-name {
  font-size: 14px; font-weight: 700; color: var(--text-deep);
  line-height: 1.3;
}
.skill-desc {
  font-size: 11px; color: var(--text-soft); margin-top: 1px;
}
.skill-badge {
  font-size: 10px; padding: 3px 10px; border-radius: 999px;
  background: rgba(169,120,85,.08); color: var(--caramel);
  font-weight: 600; flex-shrink: 0; white-space: nowrap;
}
.skill-badge.is-done {
  background: #EBF5EB; color: #5F855F;
}
.skill-badge.is-locked-badge {
  background: rgba(0,0,0,.03); color: var(--text-soft);
}

/* ---- DEV 按钮组 ---- */
.dev-row {
  display: flex; gap: 5px; justify-content: center;
  margin-top: 8px; flex-wrap: wrap;
}
.dev-skill-btn {
  padding: 4px 10px; font-size: 10px; color: #999;
  background: #f7f7f7; border: 1px dashed #ddd;
  border-radius: 8px; cursor: pointer; font-family: inherit;
  opacity: .55; transition: opacity .2s;
}
.dev-skill-btn:hover { opacity: .9; }

/* ---- DEV 语音测试按钮 ---- */
.dev-voice-btn {
  padding: 4px 10px; font-size: 10px; color: #999;
  background: #faf7f2; border: 1px dashed #ddd;
  border-radius: 8px; cursor: pointer; font-family: inherit;
  opacity: .6; transition: opacity .2s;
}
.dev-voice-btn:hover { opacity: .95; background: #f5efe5; }
.dev-voice-btn:active { background: #ede5d8; }

/* ---- 等级升级大剧场 ---- */
.levelup-theater {
  position: fixed; inset: 0; z-index: 20010;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  background: linear-gradient(160deg, #FFF9EF 0%, #FFE9CF 40%, #FFDDAA 100%);
  animation: theaterFadeIn .4s ease;
}
.levelup-scene {
  text-align: center; position: relative;
}
.levelup-mabu-wrap {
  position: relative; display: inline-block;
  margin-bottom: 16px;
}
.levelup-mabu-img {
  width: 140px; height: 140px; border-radius: 50%;
  object-fit: cover; border: 3px solid var(--mabu-lt);
  box-shadow: 0 4px 20px rgba(169,120,85,.2);
}
.levelup-sparkles {
  position: absolute; top: 0; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 16px; pointer-events: none;
}
.levelup-sparkles span {
  font-size: 28px;
  animation: luSparkleFloat 1.2s ease infinite alternate;
}
.levelup-sparkles span:nth-child(2) { animation-delay: .3s; }
.levelup-sparkles span:nth-child(3) { animation-delay: .6s; }
.levelup-sparkles span:nth-child(4) { animation-delay: .9s; }
.levelup-sparkles span:nth-child(5) { animation-delay: .2s; }
@keyframes luSparkleFloat {
  from { transform: translateY(0) scale(.7); opacity: .5; }
  to { transform: translateY(-12px) scale(1.2); opacity: 1; }
}
.levelup-title {
  font-size: 26px; font-weight: 800; color: var(--text-deep);
  margin: 0 0 6px;
  animation: luBounceIn .5s ease;
}
.levelup-sub {
  font-size: 15px; color: var(--caramel); font-weight: 600;
  margin: 0 0 10px;
}
.levelup-new-skills {
  margin: 8px 0; font-size: 13px; color: var(--text-mid);
}
.levelup-skill-item {
  display: inline-block; margin: 3px 6px;
  padding: 5px 14px; background: rgba(255,255,255,.8);
  border-radius: 12px; font-weight: 600; color: var(--text-deep);
  box-shadow: 0 2px 6px rgba(0,0,0,.04);
  animation: luSkillPop .4s ease both;
}
.levelup-skill-item:nth-child(2) { animation-delay: .2s; }
.levelup-skill-item:nth-child(3) { animation-delay: .35s; }
@keyframes luSkillPop {
  from { opacity: 0; transform: translateY(8px) scale(.8); }
  to { opacity: 1; transform: none; }
}
@keyframes luBounceIn {
  from { opacity: 0; transform: scale(.7); }
  70% { transform: scale(1.06); }
  to { opacity: 1; transform: scale(1); }
}
.levelup-skip {
  position: absolute; top: 18px; right: 20px; z-index: 10;
  border: none; border-radius: 16px; padding: 7px 16px;
  background: rgba(255,255,255,.65); color: var(--text-soft);
  font-size: 13px; cursor: pointer; font-family: inherit;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: background .2s;
}
.levelup-skip:active { background: rgba(255,255,255,.9); }

/* ---- 技能表演动画（在成长中心 Mabu 形象上） ---- */
.growth-mabu-img.is-skill-jump {
  animation: skillJump .5s ease 2;
}
@keyframes skillJump {
  0%, 100% { transform: translateY(0); }
  35% { transform: translateY(-18px) scale(1.05); }
  65% { transform: translateY(-6px) scale(1.02); }
}
.growth-mabu-img.is-skill-hug {
  animation: skillHugAnim .7s ease;
}
@keyframes skillHugAnim {
  0% { transform: scale(1); filter: brightness(1); }
  35% { transform: scale(1.12); filter: brightness(1.08); }
  100% { transform: scale(1); filter: brightness(1); }
}
.growth-mabu-img.is-skill-celebration {
  animation: skillCelebAnim 1s ease;
}
@keyframes skillCelebAnim {
  0% { transform: translateY(0) rotate(0deg); }
  15% { transform: translateY(-10px) rotate(-3deg); }
  30% { transform: translateY(0) rotate(2deg); }
  45% { transform: translateY(-12px) rotate(-2deg); }
  60% { transform: translateY(0) rotate(0deg); }
  80% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* 技能爱心特效 */
.skill-hearts {
  position: absolute; top: -10px; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 12px; pointer-events: none; z-index: 10;
}
.skill-hearts span {
  font-size: 24px;
  animation: shFloat 1s ease both;
}
.skill-hearts span:nth-child(2) { animation-delay: .15s; }
.skill-hearts span:nth-child(3) { animation-delay: .3s; }
@keyframes shFloat {
  from { opacity: 1; transform: translateY(0) scale(.5); }
  to { opacity: 0; transform: translateY(-30px) scale(1.3); }
}

/* 技能语音气泡 */
.skill-bubble {
  position: absolute; bottom: -30px; left: 50%;
  transform: translateX(-50%);
  background: rgba(255,255,255,.9); color: var(--text-deep);
  padding: 6px 14px; border-radius: 14px; font-size: 13px;
  font-weight: 600; white-space: nowrap;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
  z-index: 11; pointer-events: none;
  animation: sbIn .35s ease both;
}
@keyframes sbIn {
  from { opacity: 0; transform: translateX(-50%) translateY(6px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* 书包装备叠加层（技能专用） */
.mabu-backpack-overlay {
  position: absolute; pointer-events: none; z-index: 5;
  animation: equipLayerIn .3s ease;
  font-size: 36px;
  top: 38%; right: 2%;
}

/* 陪学页书包展示 */
.study-backpack-hint {
  margin: 4px 0 12px; font-size: 13px; color: var(--caramel);
  font-weight: 600; text-align: center;
  animation: luBounceIn .5s ease;
}

/* ================================================================
   技能表演剧场 — 全屏互动舞台
   ================================================================ */
.skill-theater {
  position: fixed; inset: 0; z-index: 20020;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  background: linear-gradient(160deg, #FFF9EF 0%, #FFF0DF 30%, #FFE5C8 70%, #FFD8A8 100%);
  animation: theaterFadeIn .4s ease;
}
.skill-theater-scene {
  text-align: center; position: relative;
  max-width: 360px; width: 100%;
}
.skill-mabu-wrap {
  position: relative; display: inline-block;
  margin-bottom: 8px;
}
.skill-mabu-img {
  width: 160px; height: 160px; border-radius: 50%;
  object-fit: cover; border: 3px solid #C8895A;
  box-shadow: 0 6px 28px rgba(169,120,85,.22);
  transition: transform .25s ease;
  will-change: transform;
}

/* 技能剧场装备叠加层 */
.skill-equip-layers {
  position: absolute; inset: 0; pointer-events: none; z-index: 5;
}
.skill-layer { position: absolute; left: 50%; transform: translateX(-50%); line-height: 1; }
.skill-layer.hat-layer      { top: -4%; font-size: 42px; }
.skill-layer.acc-layer      { top: 28%; font-size: 36px; }
.skill-layer.clothes-layer  { bottom: 8%; font-size: 48px; }
.skill-layer.backpack-layer { top: 30%; right: 2%; left: auto; transform: none; font-size: 40px; animation: equipLayerIn .3s ease; }

/* 技能特效容器 */
.skill-effects {
  position: absolute; inset: 0; pointer-events: none; z-index: 6;
  overflow: hidden;
}
.skill-sparkle-particle {
  position: absolute;
  animation: skillSparkleRise 1s ease both;
  pointer-events: none;
}
@keyframes skillSparkleRise {
  from { opacity: .9; transform: translateY(0) scale(.5); }
  to   { opacity: 0;  transform: translateY(-60px) scale(1.3); }
}

/* 技能语音气泡 */
.skill-speech-bubble {
  position: relative; z-index: 10;
  display: inline-block; margin-top: 12px;
  background: rgba(255,255,255,.92); color: var(--text-deep);
  padding: 10px 20px; border-radius: 20px; font-size: 15px;
  font-weight: 700;
  box-shadow: 0 3px 18px rgba(0,0,0,.06);
  animation: sbTheaterIn .4s ease both;
  max-width: 280px; text-align: center;
}
@keyframes sbTheaterIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 大爱心 */
.skill-big-heart {
  position: absolute; top: 50%; left: 50%; z-index: 12;
  font-size: 80px; line-height: 1;
  transform: translate(-50%, -50%) scale(0);
  animation: bigHeartBeat .8s ease forwards;
  pointer-events: none;
}
@keyframes bigHeartBeat {
  0%   { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  30%  { transform: translate(-50%, -50%) scale(1.4); opacity: 1; }
  50%  { transform: translate(-50%, -50%) scale(.9); opacity: 1; }
  70%  { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
  85%  { transform: translate(-50%, -50%) scale(.95); opacity: .8; }
  100% { transform: translate(-50%, -50%) scale(1.1); opacity: .5; }
}

/* 彩纸 / confetti */
.skill-confetti {
  position: absolute; inset: 0; pointer-events: none; z-index: 8;
  overflow: hidden;
}
.confetti-piece {
  position: absolute; top: -10%;
  animation: confettiFall 1.5s ease forwards;
  pointer-events: none;
}
@keyframes confettiFall {
  0%   { opacity: 1; transform: translateY(0) rotate(0deg) scale(.5); }
  30%  { opacity: 1; transform: translateY(30%) rotate(120deg) scale(1); }
  70%  { opacity: .6; transform: translateY(70%) rotate(260deg) scale(.8); }
  100% { opacity: 0; transform: translateY(100%) rotate(360deg) scale(.3); }
}

/* 技能跳过按钮 */
.skill-skip-btn {
  position: absolute; top: 18px; right: 20px; z-index: 100;
  border: none; border-radius: 16px; padding: 7px 16px;
  background: rgba(255,255,255,.65); color: var(--text-soft);
  font-size: 13px; cursor: pointer; font-family: inherit;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: background .2s;
}
.skill-skip-btn:active { background: rgba(255,255,255,.9); }

/* ===========================================================
   iPhone / iPad PWA standalone 安全区基础适配
   =========================================================== */
:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

.topbar {
  padding-top: calc(14px + var(--safe-top));
  padding-right: calc(18px + var(--safe-right));
  padding-left: calc(18px + var(--safe-left));
}
.drawer-head {
  padding-top: calc(20px + var(--safe-top));
  padding-right: calc(20px + var(--safe-right));
  padding-left: calc(20px + var(--safe-left));
}
.drawer-nav { padding-left: calc(14px + var(--safe-left)); }
.drawer-foot {
  padding-bottom: calc(14px + var(--safe-bottom));
  padding-left: calc(20px + var(--safe-left));
}
.page {
  padding-right: calc(18px + var(--safe-right));
  padding-bottom: calc(32px + var(--safe-bottom));
  padding-left: calc(18px + var(--safe-left));
}

.study-state {
  padding-top: calc(32px + var(--safe-top));
  padding-right: calc(24px + var(--safe-right));
  padding-bottom: calc(32px + var(--safe-bottom));
  padding-left: calc(24px + var(--safe-left));
}
.study-back {
  top: calc(18px + var(--safe-top));
  left: calc(18px + var(--safe-left));
}
.study-focus,
.study-peek {
  padding-top: var(--safe-top);
  padding-right: var(--safe-right);
  padding-bottom: var(--safe-bottom);
  padding-left: var(--safe-left);
}
.study-reminder { bottom: calc(30px + var(--safe-bottom)); }

.photo-root {
  padding-top: calc(32px + var(--safe-top));
  padding-right: calc(20px + var(--safe-right));
  padding-bottom: calc(40px + var(--safe-bottom));
  padding-left: calc(20px + var(--safe-left));
}
.reward-root {
  padding-top: calc(48px + var(--safe-top));
  padding-right: calc(20px + var(--safe-right));
  padding-bottom: calc(40px + var(--safe-bottom));
  padding-left: calc(20px + var(--safe-left));
}
.direct-root {
  padding-top: calc(40px + var(--safe-top));
  padding-right: calc(20px + var(--safe-right));
  padding-bottom: calc(48px + var(--safe-bottom));
  padding-left: calc(20px + var(--safe-left));
}
.parent-card {
  padding-top: calc(48px + var(--safe-top));
  padding-right: calc(24px + var(--safe-right));
  padding-bottom: calc(36px + var(--safe-bottom));
  padding-left: calc(24px + var(--safe-left));
}
.parent-topbar {
  padding-top: calc(18px + var(--safe-top));
  padding-right: calc(24px + var(--safe-right));
  padding-left: calc(24px + var(--safe-left));
}
.parent-task-list {
  padding-right: calc(24px + var(--safe-right));
  padding-bottom: calc(32px + var(--safe-bottom));
  padding-left: calc(24px + var(--safe-left));
}
.parent-overlay {
  padding-top: var(--safe-top);
  padding-right: var(--safe-right);
  padding-bottom: var(--safe-bottom);
  padding-left: var(--safe-left);
}

.growth-body {
  padding-top: var(--safe-top);
  padding-right: calc(12px + var(--safe-right));
  padding-bottom: calc(40px + var(--safe-bottom));
  padding-left: calc(12px + var(--safe-left));
}
.growth-overlay,
.apple-theater,
.hat-theater,
.clothes-theater,
.skill-theater,
.levelup-theater {
  padding-top: var(--safe-top);
  padding-right: var(--safe-right);
  padding-bottom: var(--safe-bottom);
  padding-left: var(--safe-left);
}
.skill-skip-btn {
  top: calc(18px + var(--safe-top));
  right: calc(20px + var(--safe-right));
}

@media (min-width:1024px) {
  .app-sidebar {
    width: calc(232px + var(--safe-left));
    padding-top: calc(22px + var(--safe-top));
    padding-left: calc(12px + var(--safe-left));
    padding-bottom: calc(14px + var(--safe-bottom));
  }
  .app-shell { margin-left: calc(232px + var(--safe-left)); }
  .page {
    padding-top: 32px;
    padding-right: calc(36px + var(--safe-right));
    padding-bottom: calc(48px + var(--safe-bottom));
    padding-left: 36px;
  }
  .direct-root {
    padding-top: calc(60px + var(--safe-top));
    padding-bottom: calc(56px + var(--safe-bottom));
  }
}

@media (min-width:1280px) {
  .page {
    padding-top: 40px;
    padding-right: calc(48px + var(--safe-right));
    padding-bottom: calc(56px + var(--safe-bottom));
    padding-left: 48px;
  }
}
