/* ============================================================
   幼儿生活自理能力闯关 · 自然有机·草木
   主色 #325eae / 辅助 #654bbe / 强调 #6e2dd2
   ============================================================ */

:root {
  --c-primary: #325eae;
  --c-accent: #654bbe;
  --c-cta: #6e2dd2;
  --c-bg: #f8f9fb;
  --c-card: #ffffff;
  --c-text: #1b212c;
  --c-sub: #5c677a;
  --c-border: #dbdfe6;

  --p-soft: rgba(50, 94, 174, 0.1);
  --p-softer: rgba(50, 94, 174, 0.06);
  --a-soft: rgba(101, 75, 190, 0.12);
  --cta-soft: rgba(110, 45, 210, 0.1);

  --radius: 24px;
  --radius-sm: 16px;
  --radius-lg: 34px;

  --font-head: 'Quicksand', 'PingFang SC', system-ui, sans-serif;
  --font-body: system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', sans-serif;

  --shadow-card: 0 14px 34px rgba(50, 94, 174, 0.12), 0 3px 8px rgba(27, 33, 44, 0.04);
  --shadow-pop: 0 24px 60px rgba(110, 45, 210, 0.22), 0 6px 16px rgba(27, 33, 44, 0.08);
  --grad-main: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  --grad-cta: linear-gradient(135deg, var(--c-accent), var(--c-cta));
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4 { font-family: var(--font-head); color: var(--c-text); letter-spacing: 0.01em; }

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

/* ---------- 背景有机装饰 ---------- */
.bg-deco { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }

.blob {
  position: absolute;
  filter: blur(6px);
  opacity: 0.55;
}
.blob-1 {
  width: 420px; height: 420px; top: -140px; right: -120px;
  background: radial-gradient(circle at 35% 35%, var(--p-soft), transparent 70%);
  animation: blobMorph 16s ease-in-out infinite;
}
.blob-2 {
  width: 360px; height: 360px; bottom: 8%; left: -140px;
  background: radial-gradient(circle at 60% 40%, var(--a-soft), transparent 70%);
  animation: blobMorph 20s ease-in-out infinite reverse;
}
.blob-3 {
  width: 260px; height: 260px; top: 42%; right: -90px;
  background: radial-gradient(circle at 40% 60%, var(--cta-soft), transparent 70%);
  animation: blobMorph 14s ease-in-out infinite 2s;
}

@keyframes blobMorph {
  0%, 100% { border-radius: 58% 42% 55% 45% / 50% 58% 42% 50%; transform: rotate(0deg) scale(1); }
  33% { border-radius: 45% 55% 48% 52% / 55% 46% 54% 45%; transform: rotate(6deg) scale(1.06); }
  66% { border-radius: 52% 48% 60% 40% / 46% 55% 45% 54%; transform: rotate(-5deg) scale(0.97); }
}

.leaf {
  position: absolute;
  font-size: 26px;
  opacity: 0.75;
  animation: leafFloat 9s ease-in-out infinite;
}
.leaf-1 { top: 16%; left: 4%; animation-delay: 0s; }
.leaf-2 { top: 68%; right: 6%; animation-delay: 1.6s; }
.leaf-3 { bottom: 12%; left: 12%; animation-delay: 3s; }
.leaf-4 { top: 34%; right: 14%; animation-delay: 4.4s; font-size: 30px; }

@keyframes leafFloat {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-18px) rotate(8deg); }
}

/* ---------- 应用框架 ---------- */
.app {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 18px 120px;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow-card);
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-icon {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  font-size: 24px;
  border-radius: 40% 60% 50% 50% / 55% 45% 55% 45%;
  background: var(--grad-main);
  box-shadow: 0 8px 18px rgba(50, 94, 174, 0.3);
  color: #fff;
  animation: blobMorph 9s ease-in-out infinite;
}
.brand-text h1 { font-size: 20px; line-height: 1.15; font-weight: 700; }
.brand-text p { font-size: 12px; color: var(--c-sub); white-space: nowrap; }

.topbar-right { display: flex; align-items: center; gap: 10px; }

.stars-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--cta-soft);
  border: 1px solid rgba(110, 45, 210, 0.22);
  font-weight: 700;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.stars-chip:hover { transform: translateY(-2px); }
.stars-chip-num { font-family: var(--font-head); font-size: 17px; color: var(--c-cta); }

.profile-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px 7px 8px;
  border-radius: 999px;
  background: var(--p-soft);
  border: 1px solid rgba(50, 94, 174, 0.22);
  transition: transform 0.25s ease;
}
.profile-chip:hover { transform: translateY(-2px); }
.profile-chip-emoji {
  width: 32px; height: 32px; display: grid; place-items: center;
  border-radius: 50%; background: #fff; font-size: 18px;
  box-shadow: 0 3px 8px rgba(50, 94, 174, 0.18);
}
.profile-chip-name { font-weight: 600; font-size: 14px; color: var(--c-primary); }

.gear-btn {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  font-size: 20px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--c-border);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.gear-btn:hover { transform: rotate(40deg) scale(1.05); box-shadow: 0 6px 14px rgba(27, 33, 44, 0.12); }

/* ---------- 主区 / 视图 ---------- */
.main { margin-top: 18px; }
.view { display: none; animation: viewIn 0.45s ease both; }
.view.active { display: block; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 面板 ---------- */
.panel {
  background: var(--c-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-card);
  padding: 22px;
  margin-bottom: 18px;
  position: relative;
}
.panel-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 16px;
}
.panel-head h2 { font-size: 19px; font-weight: 700; }
.panel-head p { font-size: 13px; color: var(--c-sub); margin-top: 2px; }

/* ---------- 地图 Hero ---------- */
.map-hero {
  position: relative;
  border-radius: var(--radius-lg);
  background: var(--grad-main);
  color: #fff;
  overflow: hidden;
  margin-bottom: 18px;
  box-shadow: 0 20px 44px rgba(50, 94, 174, 0.28);
}
.map-hero::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 12% 30%, rgba(255,255,255,0.18), transparent 40%),
    radial-gradient(circle at 88% 80%, rgba(110,45,210,0.35), transparent 46%);
}
.map-hero-inner {
  position: relative;
  z-index: 1;
  padding: 26px 24px 40px;
}
.map-greet { display: flex; align-items: center; gap: 16px; }
.map-greet-emoji {
  width: 64px; height: 64px;
  display: grid; place-items: center;
  font-size: 34px;
  background: rgba(255,255,255,0.92);
  border-radius: 45% 55% 52% 48% / 55% 48% 52% 45%;
  animation: blobMorph 8s ease-in-out infinite;
}
.map-hello { font-family: var(--font-head); font-size: 26px; font-weight: 700; line-height: 1.2; }
.map-sub { font-size: 14px; opacity: 0.9; margin-top: 2px; }
.map-meta {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 18px;
}
.map-date {
  font-size: 13px;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.3);
  padding: 6px 14px; border-radius: 999px;
}
.map-stars {
  font-size: 13px;
  background: #fff;
  color: var(--c-primary);
  padding: 6px 14px; border-radius: 999px;
  font-weight: 600;
}
.map-stars b { font-family: var(--font-head); font-size: 16px; color: var(--c-cta); }
.hero-wave {
  position: absolute; left: 0; right: 0; bottom: 0;
  width: 100%; height: 44px; display: block;
}

/* ---------- 今日任务 ---------- */
.today-list { display: grid; gap: 12px; }
.task-item {
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: linear-gradient(180deg, #fff, #fbfcfe);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.task-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); border-color: rgba(50,94,174,0.35); }
.task-item.done { background: linear-gradient(135deg, rgba(50,94,174,0.06), rgba(101,75,190,0.08)); border-color: rgba(101,75,190,0.35); }
.task-emoji {
  width: 52px; height: 52px; flex: none;
  display: grid; place-items: center;
  font-size: 28px;
  border-radius: 42% 58% 50% 50% / 55% 45% 55% 45%;
  background: var(--p-softer);
}
.task-info { flex: 1; min-width: 0; }
.task-name { font-weight: 700; font-size: 15px; }
.task-bonus { font-size: 12px; color: var(--c-sub); margin-top: 1px; }
.task-bonus b { color: var(--c-cta); }
.task-state { flex: none; font-size: 13px; font-weight: 600; color: var(--c-primary); white-space: nowrap; }

.task-empty {
  text-align: center;
  padding: 22px 14px;
  border: 1.5px dashed var(--c-border);
  border-radius: var(--radius);
  background: var(--p-softer);
}
.task-empty-emoji { font-size: 34px; animation: starFloat 3s ease-in-out infinite; }
.task-empty p { font-size: 14px; color: var(--c-sub); margin: 6px 0 12px; }

/* ---------- 地图路径 ---------- */
.map-path { position: relative; padding: 6px 0 10px; }
.map-path::before {
  content: "";
  position: absolute; left: 50%; top: 6px; bottom: 6px;
  width: 7px; transform: translateX(-50%);
  border-radius: 99px;
  background: repeating-linear-gradient(180deg, rgba(101,75,190,0.35) 0 12px, transparent 12px 24px);
}

.map-node { position: relative; width: min(460px, 100%); margin: 16px auto; }
.map-node.side-l { transform: translateX(-6%); }
.map-node.side-r { transform: translateX(6%); }

.node-flag {
  position: absolute; top: 50%; z-index: 2;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--c-accent);
  font-size: 14px;
  transform: translateY(-50%);
  box-shadow: 0 4px 10px rgba(101,75,190,0.25);
}
.map-node.side-l .node-flag { right: -15px; }
.map-node.side-r .node-flag { left: -15px; }
.node-flag.done { background: var(--grad-main); border-color: transparent; }

.node-card {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  overflow: hidden;
}
.node-card::after {
  content: "";
  position: absolute; right: -26px; top: -26px;
  width: 84px; height: 84px;
  border-radius: 48% 52% 55% 45% / 50% 48% 52% 50%;
  background: var(--p-softer);
  z-index: 0;
}
.node-card:hover { transform: translateY(-4px) scale(1.01); box-shadow: var(--shadow-pop); }

.node-emoji {
  width: 56px; height: 56px; flex: none;
  display: grid; place-items: center;
  font-size: 30px;
  border-radius: 44% 56% 50% 50% / 52% 46% 54% 48%;
  background: linear-gradient(135deg, var(--p-soft), var(--a-soft));
  position: relative; z-index: 1;
}
.node-info { flex: 1; min-width: 0; position: relative; z-index: 1; }
.node-name { font-weight: 700; font-size: 15px; }
.node-stars { font-size: 13px; color: var(--c-sub); margin-top: 2px; letter-spacing: 1px; }
.node-stars .on { color: #f6b93b; text-shadow: 0 1px 0 rgba(0,0,0,0.08); }
.node-tag {
  position: absolute; top: 8px; right: 10px; z-index: 1;
  font-size: 11px; font-weight: 700;
  color: var(--c-cta);
  background: var(--cta-soft);
  border-radius: 999px; padding: 2px 10px;
  border: 1px solid rgba(110,45,210,0.25);
}
.node-btn {
  position: relative; z-index: 1; flex: none;
  font-size: 13px; font-weight: 600;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--grad-main);
  color: #fff;
  box-shadow: 0 6px 14px rgba(50,94,174,0.28);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.node-btn:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 10px 20px rgba(50,94,174,0.34); }

/* ---------- 步骤学习 ---------- */
.level-chips { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.level-chip {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--c-border);
  background: #fff;
  font-size: 14px; font-weight: 600; color: var(--c-sub);
  transition: all 0.25s ease;
}
.level-chip:hover { transform: translateY(-2px); border-color: var(--c-accent); color: var(--c-accent); }
.level-chip.active {
  background: var(--grad-main); color: #fff; border-color: transparent;
  box-shadow: 0 8px 18px rgba(50,94,174,0.32);
}

.learn-stage {
  position: relative;
  height: 300px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 22% 26%, var(--p-softer), transparent 46%),
    radial-gradient(circle at 82% 74%, var(--a-soft), transparent 48%),
    linear-gradient(180deg, #fdfdff, #f3f5fa);
  border: 1px solid var(--c-border);
  overflow: hidden;
}
.learn-stage::before,
.learn-stage::after {
  content: "";
  position: absolute;
  border-radius: 50% 50% 46% 54% / 52% 48% 52% 48%;
  background: var(--p-softer);
}
.learn-stage::before { width: 130px; height: 130px; left: -40px; bottom: -30px; animation: blobMorph 12s ease-in-out infinite; }
.learn-stage::after { width: 90px; height: 90px; right: 30px; top: -20px; background: var(--a-soft); animation: blobMorph 14s ease-in-out infinite reverse; }

.stage-item-wrap {
  position: absolute; left: 50%; top: 40%;
  transform: translate(-50%, -50%);
  z-index: 3;
}
.stage-item {
  font-size: clamp(84px, 22vw, 122px);
  filter: drop-shadow(0 14px 18px rgba(50, 94, 174, 0.22));
  line-height: 1;
  display: block;
}

.stage-kid {
  position: absolute; left: 10%; bottom: 6%;
  width: 92px; z-index: 4;
  transition: transform 0.3s ease;
}
.kid-head {
  width: 62px; height: 62px; margin: 0 auto;
  display: grid; place-items: center;
  font-size: 32px;
  background: linear-gradient(160deg, #fff, #eef1f8);
  border-radius: 50%;
  box-shadow: inset 0 -8px 0 rgba(50, 94, 174, 0.08), 0 10px 18px rgba(50, 94, 174, 0.16);
  position: relative; z-index: 2;
}
.kid-body {
  width: 56px; height: 46px; margin: -8px auto 0;
  border-radius: 22px 22px 26px 26px;
  background: var(--grad-main);
  box-shadow: 0 8px 16px rgba(50, 94, 174, 0.2);
  position: relative; z-index: 1;
}
.kid-cheer .kid-head { animation: kidJump 0.65s ease 2; }
@keyframes kidJump { 50% { transform: translateY(-20px); } }

.stage-bubbles { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.stage-bubbles span {
  position: absolute; bottom: 20%;
  font-size: 22px;
  animation: bubbleUp 1.6s ease forwards;
}
@keyframes bubbleUp {
  from { transform: translateY(0) scale(0.5); opacity: 0; }
  30% { opacity: 1; }
  to { transform: translateY(-150px) translateX(14px) scale(1.15); opacity: 0; }
}

.sparkle {
  position: absolute; z-index: 6; pointer-events: none;
  font-size: 20px;
  animation: twinkle 0.9s ease forwards;
}
@keyframes twinkle {
  0% { transform: scale(0) rotate(0deg); opacity: 0; }
  50% { transform: scale(1.25) rotate(20deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 0.7; }
}

/* 步骤动作动画 */
.mo-lay { animation: moLay 0.85s cubic-bezier(0.2, 0.9, 0.3, 1.15) both; }
.mo-rise { animation: moRise 0.9s ease both; }
.mo-arm { animation: moArm 1s ease both; }
.mo-pop { animation: moPop 0.8s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
.mo-brush { animation: moBrush 1s ease both; }
.mo-rinse { animation: moRinse 1s ease both; }
.mo-tidy { animation: moTidy 0.9s ease both; }
.mo-knot { animation: moKnot 0.9s ease both; }
.mo-pull { animation: moPull 0.9s ease both; }
.mo-ear { animation: moEar 0.9s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
.mo-spin { animation: moSpin 0.9s ease both; }
.mo-sort { animation: moSort 0.8s ease both; }
.mo-toss { animation: moToss 1s ease both; }
.mo-bubble { animation: moBubble 1s ease both; }
.mo-scrub { animation: moScrub 0.9s ease both; }
.mo-fold { animation: moFold 0.8s ease both; }

@keyframes moLay { 0% { transform: translateY(-56px) scale(0.45); opacity: 0; } 60% { transform: translateY(8px) scale(1.12); } 100% { transform: none; opacity: 1; } }
@keyframes moRise { 0% { transform: translateY(46px); } 55% { transform: translateY(-26px) scale(1.14); } 100% { transform: translateY(-8px); } }
@keyframes moArm { 0%,100% { transform: rotate(0); } 30% { transform: rotate(-20deg) translateX(-8px); } 70% { transform: rotate(16deg) translateX(8px); } }
@keyframes moPop { 0% { transform: scale(0.35); opacity: 0.2; } 55% { transform: scale(1.28); } 100% { transform: scale(1); opacity: 1; } }
@keyframes moBrush { 0%,100% { transform: translateX(0) rotate(-6deg); } 35% { transform: translateX(-22px) rotate(-22deg); } 75% { transform: translateX(22px) rotate(12deg); } }
@keyframes moRinse { 0%,100% { transform: translateY(0) rotate(0); } 35% { transform: translateY(-18px) rotate(-14deg); } 70% { transform: translateY(16px) rotate(14deg); } }
@keyframes moTidy { 0% { transform: translateY(10px); opacity: 0.5; } 100% { transform: none; opacity: 1; } }
@keyframes moKnot { 0%,100% { transform: rotate(0) scale(1); } 50% { transform: rotate(-34deg) scale(1.18); } }
@keyframes moPull { 0%,100% { transform: translateY(0); } 40% { transform: translateY(20px) scaleY(0.88); } 75% { transform: translateY(-6px); } }
@keyframes moEar { 0% { transform: scale(0) rotate(-20deg); opacity: 0; } 70% { transform: scale(1.25); } 100% { transform: scale(1); opacity: 1; } }
@keyframes moSpin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@keyframes moSort { 0%,100% { transform: scale(1); } 40% { transform: scale(0.82) rotate(-8deg); } 70% { transform: scale(1.12); } }
@keyframes moToss { 0% { transform: translate(0, 0) rotate(0); } 60% { transform: translate(34px, -64px) rotate(170deg); } 100% { transform: translate(0, 0) rotate(0); } }
@keyframes moBubble { 0% { transform: translateY(10px) scale(0.5); opacity: 0.1; } 100% { transform: translateY(-44px) scale(1.1); opacity: 1; } }
@keyframes moScrub { 0%,100% { transform: translateX(0); } 35% { transform: translateX(-20px); } 70% { transform: translateX(20px); } }
@keyframes moFold { 0%,100% { transform: scale(1); } 50% { transform: scale(0.78) rotate(-5deg); } }

/* 步骤进度 */
.step-progress { display: flex; justify-content: center; gap: 10px; margin: 18px 0 14px; }
.dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--c-border);
  transition: all 0.35s ease;
}
.dot.active { width: 30px; border-radius: 99px; background: var(--grad-cta); }
.dot.done { background: var(--grad-main); }

/* 步骤卡 */
.step-card {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-card);
  animation: viewIn 0.4s ease both;
}
.step-index {
  font-family: var(--font-head);
  font-size: 12px; font-weight: 700;
  color: var(--c-accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.step-text { font-size: 19px; font-weight: 700; line-height: 1.45; }
.step-rhyme {
  margin-top: 10px;
  font-size: 14px;
  color: var(--c-sub);
  background: linear-gradient(135deg, var(--p-softer), var(--a-soft));
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  line-height: 1.9;
  white-space: pre-line;
  border: 1px solid rgba(101, 75, 190, 0.16);
}
.step-actions { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.step-actions .btn,
.step-actions .btn-ghost { flex: 1; min-width: 130px; }

.tip-line {
  margin-top: 14px;
  font-size: 13px; color: var(--c-sub);
  text-align: center;
  background: rgba(219, 223, 230, 0.35);
  border-radius: 999px;
  padding: 8px 16px;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-size: 15px; font-weight: 700; color: #fff;
  background: var(--grad-cta);
  box-shadow: 0 10px 22px rgba(110, 45, 210, 0.3);
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}
.btn:hover { transform: translateY(-3px); box-shadow: 0 14px 28px rgba(110, 45, 210, 0.38); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14px; font-weight: 600; color: var(--c-primary);
  background: #fff;
  border: 1.5px solid var(--c-border);
  transition: all 0.25s ease;
}
.btn-ghost:hover { border-color: var(--c-accent); color: var(--c-accent); transform: translateY(-2px); }
.btn-ghost:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-danger { background: linear-gradient(135deg, #e2606c, #c94250); box-shadow: 0 10px 22px rgba(201,66,80,0.26); }

/* ---------- 星星奖励 ---------- */
.reward-hero {
  text-align: center;
  background:
    radial-gradient(circle at 50% -20%, var(--a-soft), transparent 55%),
    linear-gradient(180deg, #fff, #fbfbff);
  padding: 36px 22px 30px;
}
.reward-star-big {
  width: 92px; height: 92px; margin: 0 auto 8px;
  display: grid; place-items: center;
  font-size: 52px;
  animation: starFloat 3.4s ease-in-out infinite;
}
@keyframes starFloat {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-12px) rotate(8deg); }
}
.reward-count {
  font-family: var(--font-head);
  font-size: 64px; font-weight: 700; line-height: 1;
  background: linear-gradient(135deg, var(--c-primary), var(--c-cta));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.reward-label { font-size: 15px; color: var(--c-sub); margin-top: 4px; }
.reward-today {
  margin: 14px auto 18px;
  width: fit-content;
  font-size: 14px; font-weight: 600; color: var(--c-primary);
  background: var(--p-soft);
  border-radius: 999px; padding: 8px 18px;
}
.reward-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* 周图表 */
.week-chart {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 8px;
  height: 150px; padding-top: 8px;
}
.week-bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.week-bar-col {
  width: 100%; max-width: 46px;
  min-height: 8px;
  border-radius: 14px 14px 8px 8px;
  background: linear-gradient(180deg, var(--c-accent), var(--c-cta));
  transition: height 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  box-shadow: 0 6px 14px rgba(110, 45, 210, 0.22);
  position: relative;
}
.week-bar-col.zero { background: var(--c-border); box-shadow: none; }
.week-bar-num { font-size: 11px; color: var(--c-sub); }
.week-bar-day { font-size: 12px; color: var(--c-sub); font-weight: 600; }
.week-bar.today .week-bar-day { color: var(--c-cta); }

/* 勋章 */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.badge-card {
  text-align: center;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 18px 14px 16px;
  background: #fff;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
}
.badge-card.locked { filter: grayscale(0.9); opacity: 0.6; background: #fafbfd; }
.badge-card.unlocked { background: linear-gradient(180deg, #fff, var(--p-softer)); border-color: rgba(50,94,174,0.3); }
.badge-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card); }
.badge-icon { font-size: 40px; line-height: 1; }
.badge-name { font-weight: 700; font-size: 14px; margin-top: 8px; }
.badge-desc { font-size: 12px; color: var(--c-sub); margin-top: 3px; }
.badge-prog {
  margin-top: 10px; height: 8px;
  background: var(--c-border); border-radius: 99px; overflow: hidden;
}
.badge-prog-fill { height: 100%; border-radius: 99px; background: var(--grad-main); transition: width 0.6s ease; }
.badge-card.new { animation: badgePulse 1.4s ease 2; }
@keyframes badgePulse { 50% { box-shadow: 0 0 0 8px rgba(110,45,210,0.12); } }

/* ---------- 弹窗 ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  display: none; align-items: flex-end; justify-content: center;
  background: rgba(27, 33, 44, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 16px;
}
.modal-backdrop.open { display: flex; animation: fadeIn 0.3s ease both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--c-bg);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 560px;
  max-height: 88vh;
  overflow: auto;
  box-shadow: var(--shadow-pop);
  border: 1px solid var(--c-border);
  animation: modalUp 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.15) both;
}
@keyframes modalUp { from { transform: translateY(60px) scale(0.96); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-head {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--c-border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.modal-head h3 { font-size: 19px; font-weight: 700; }
.modal-close {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  font-size: 16px; color: var(--c-sub);
  background: var(--c-bg);
  border-radius: 50%;
  border: 1px solid var(--c-border);
  transition: all 0.25s ease;
}
.modal-close:hover { background: var(--p-soft); color: var(--c-primary); transform: rotate(90deg); }
.modal-body { padding: 18px 22px 24px; }

.set-section { margin-bottom: 26px; }
.set-section h4 { font-size: 16px; margin-bottom: 6px; }
.set-hint { font-size: 12.5px; color: var(--c-sub); margin-bottom: 12px; }

.child-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.child-row {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: #fff;
  padding: 10px 14px;
}
.child-row.current { border-color: var(--c-accent); background: linear-gradient(135deg, var(--p-softer), var(--a-soft)); }
.child-emoji {
  width: 42px; height: 42px; flex: none;
  display: grid; place-items: center;
  font-size: 22px;
  border-radius: 50%;
  background: var(--p-soft);
}
.child-name { flex: 1; font-weight: 600; }
.child-tag { font-size: 11px; font-weight: 700; color: var(--c-cta); background: var(--cta-soft); border-radius: 999px; padding: 2px 10px; }
.child-switch {
  font-size: 13px; font-weight: 600; color: var(--c-primary);
  background: var(--p-soft); border-radius: 999px; padding: 6px 14px;
  transition: all 0.25s ease;
}
.child-switch:hover { background: var(--c-primary); color: #fff; }
.child-del {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%; color: var(--c-sub);
  background: var(--c-bg); border: 1px solid var(--c-border);
  transition: all 0.25s ease;
}
.child-del:hover { color: #fff; background: #e2606c; border-color: transparent; }

.child-form { display: flex; gap: 10px; flex-wrap: wrap; }
.input, .select {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--c-border);
  background: #fff;
  font-size: 14px; color: var(--c-text);
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.input { flex: 1; min-width: 140px; }
.input:focus, .select:focus { border-color: var(--c-primary); box-shadow: 0 0 0 4px var(--p-soft); }

.task-toggles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.toggle {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
}
.toggle:hover { transform: translateY(-2px); border-color: var(--c-accent); }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-box {
  width: 24px; height: 24px; flex: none;
  border-radius: 9px;
  border: 2px solid var(--c-border);
  display: grid; place-items: center;
  font-size: 14px; color: transparent;
  transition: all 0.25s ease;
}
.toggle input:checked + .toggle-box {
  background: var(--grad-cta); border-color: transparent; color: #fff;
}
.toggle:has(input:checked) { border-color: var(--c-cta); background: linear-gradient(135deg, var(--cta-soft), var(--a-soft)); }
.toggle-emoji { font-size: 22px; }
.toggle-name { font-weight: 600; font-size: 13.5px; }

/* 庆祝弹窗 */
.modal-celeb { text-align: center; max-width: 460px; background: #fff; }
.celeb-big { font-size: 74px; line-height: 1; margin-top: 26px; animation: celebPop 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.3) both; }
@keyframes celebPop { 0% { transform: scale(0); } 70% { transform: scale(1.2); } 100% { transform: scale(1); } }
.modal-celeb h3 { font-size: 26px; margin-top: 10px; }
.celeb-sub { color: var(--c-sub); font-size: 14px; margin-top: 4px; }
.celeb-stars { display: flex; justify-content: center; gap: 12px; margin: 16px 0; flex-wrap: wrap; }
.celeb-star-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--cta-soft);
  border: 1px solid rgba(110, 45, 210, 0.28);
  border-radius: 999px;
  padding: 10px 20px;
  font-weight: 700; font-size: 15px; color: var(--c-cta);
  animation: starChip 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
.celeb-star-chip:nth-child(2) { animation-delay: 0.15s; }
@keyframes starChip { from { transform: scale(0) translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.celeb-star-chip b { font-family: var(--font-head); font-size: 20px; }
.celeb-rhyme {
  font-size: 14px; color: var(--c-sub);
  background: linear-gradient(135deg, var(--p-softer), var(--a-soft));
  border-radius: var(--radius);
  padding: 14px 18px;
  line-height: 1.9;
  white-space: pre-line;
  border: 1px solid rgba(101,75,190,0.16);
  margin-bottom: 18px;
}
.celeb-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; padding-bottom: 26px; }
.celeb-actions .btn, .celeb-actions .btn-ghost { flex: 1; min-width: 120px; }

/* ---------- 底部导航 ---------- */
.bottom-nav {
  position: fixed;
  left: 50%; bottom: 14px;
  transform: translateX(-50%);
  z-index: 30;
  display: flex; gap: 6px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  padding: 8px;
  box-shadow: var(--shadow-pop);
  width: min(560px, calc(100% - 32px));
}
.nav-btn {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 12px 8px;
  border-radius: 999px;
  font-size: 14px; font-weight: 600; color: var(--c-sub);
  transition: all 0.3s ease;
}
.nav-btn span { font-size: 18px; }
.nav-btn.active {
  background: var(--grad-main);
  color: #fff;
  box-shadow: 0 8px 18px rgba(50, 94, 174, 0.32);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%; bottom: 96px;
  transform: translate(-50%, 24px);
  z-index: 60;
  background: var(--c-text);
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow-pop);
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  white-space: nowrap; max-width: 90vw; overflow: hidden; text-overflow: ellipsis;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 彩带 ---------- */
.confetti-layer { position: fixed; inset: 0; z-index: 70; pointer-events: none; overflow: hidden; }
.confetti-piece {
  position: absolute; top: -20px;
  width: 10px; height: 16px;
  border-radius: 4px;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  to { transform: translateY(110vh) rotate(720deg); opacity: 0.2; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  .app { padding: 12px 12px 110px; }
  .topbar { top: 8px; padding: 10px 12px; }
  .brand-text p { display: none; }
  .stars-chip { padding: 7px 11px; }
  .map-hello { font-size: 22px; }
  .map-greet-emoji { width: 54px; height: 54px; font-size: 28px; }
  .map-node.side-l { transform: none; }
  .map-node.side-r { transform: none; }
  .node-flag { display: none; }
  .map-path::before { left: 26px; }
  .map-node { margin-left: 44px; margin-right: 0; width: auto; }
  .map-node.side-l, .map-node.side-r { margin-left: 44px; margin-right: 0; }
  .learn-stage { height: 260px; }
  .stage-item { font-size: 84px; }
  .stage-kid { width: 78px; }
  .kid-head { width: 54px; height: 54px; font-size: 27px; }
  .kid-body { width: 48px; height: 40px; }
  .panel { padding: 18px; border-radius: var(--radius); }
  .modal { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .modal-backdrop { padding: 12px; align-items: flex-end; }
  .nav-btn span { display: none; }
  .nav-btn { font-size: 13px; }
  .reward-count { font-size: 52px; }
  .badge-grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.15s !important; }
}
