:root {
  --bg: #EAF4FF;
  --bg-dot: #D6E8FF;
  --card: #FFFFFF;
  --line: #CADDF3;
  --ink: #2D4665;
  --ink-soft: #7A90AB;
  --blue: #4DA3FF;
  --blue-deep: #2B7FD9;
  --flower: #FF7FA0;
  --flower-deep: #E0567C;
  --yellow: #FFD166;
  --yellow-deep: #F0B429;
  --mint: #6BCB77;
  --mint-deep: #3FA34D;
  --sky: #5ED0FA;
  --sky-deep: #1FA7D8;
  --grape: #B794F6;
  --red: #FF7B7B;
  --red-deep: #E0524F;
  --radius: 22px;
  --shadow: 0 4px 0 var(--line);
  --tabbar-h: 72px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: "Arial Rounded MT Bold", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", ui-rounded, system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background-color: var(--bg);
  background-image: radial-gradient(var(--bg-dot) 2px, transparent 2.5px);
  background-size: 26px 26px;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
input, textarea, select { user-select: text; -webkit-user-select: text; }
button { font-family: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }

#app { max-width: 980px; margin: 0 auto; padding: calc(12px + var(--safe-t)) 16px calc(var(--tabbar-h) + var(--safe-b) + 24px); }

/* ---------- 顶部 ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.kid-switch { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 4px 2px 8px; }
.kid-switch::-webkit-scrollbar { display: none; }
.kid-chip {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
  padding: 5px 14px 5px 5px; border-radius: 999px; background: var(--card);
  border: 3px solid var(--line); box-shadow: var(--shadow); font-weight: 800; font-size: 15px;
  transition: transform .15s;
}
.kid-chip .av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; }
.kid-chip.on { border-color: var(--kc); box-shadow: 0 4px 0 var(--kc); transform: translateY(-2px); }
.wallet { display: flex; gap: 8px; flex-shrink: 0; }
.coin {
  display: flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 999px;
  background: var(--card); border: 3px solid var(--line); box-shadow: var(--shadow);
  font-weight: 900; font-size: 17px; font-variant-numeric: tabular-nums;
}
.coin.pop { animation: pop .5s; }

/* ---------- 通用卡片 ---------- */
.card { background: var(--card); border: 3px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 22px 4px 10px; font-size: 19px; font-weight: 900; }
.section-title small { font-size: 13px; color: var(--ink-soft); font-weight: 700; }
.muted { color: var(--ink-soft); }
.empty { text-align: center; padding: 28px 12px; color: var(--ink-soft); font-weight: 700; }
.empty .big { font-size: 48px; display: block; margin-bottom: 6px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 18px; border-radius: 999px; font-weight: 900; font-size: 16px;
  background: var(--blue); color: #fff; box-shadow: 0 4px 0 var(--blue-deep);
  transition: transform .1s, box-shadow .1s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--blue-deep); }
.btn.mint { background: var(--mint); box-shadow: 0 4px 0 var(--mint-deep); }
.btn.sky { background: var(--sky); box-shadow: 0 4px 0 var(--sky-deep); }
.btn.yellow { background: var(--yellow); color: var(--ink); box-shadow: 0 4px 0 var(--yellow-deep); }
.btn.red { background: var(--red); box-shadow: 0 4px 0 var(--red-deep); }
.btn.ghost { background: var(--card); color: var(--ink); border: 3px solid var(--line); box-shadow: var(--shadow); }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.block { width: 100%; }

/* ---------- 今日首页 ---------- */
.hero {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 16px;
  background: linear-gradient(135deg, var(--kc, var(--blue)) 0%, #7FD0FF 100%);
  color: #fff; border: 0; box-shadow: 0 6px 0 rgba(0,0,0,.08);
}
.hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,.18); }
.hero .big-av { width: 76px; height: 76px; flex-shrink: 0; border-radius: 50%; background: rgba(255,255,255,.9); display: grid; place-items: center; font-size: 48px; box-shadow: 0 4px 0 rgba(0,0,0,.08); animation: bob 3s ease-in-out infinite; }
.hero h2 { margin: 0 0 4px; font-size: 22px; }
.hero p { margin: 0; font-size: 14px; opacity: .95; font-weight: 700; }
.hero .bar { margin-top: 10px; height: 14px; border-radius: 999px; background: rgba(255,255,255,.35); overflow: hidden; }
.hero .bar i { display: block; height: 100%; border-radius: 999px; background: #fff; transition: width .5s cubic-bezier(.3,1.5,.6,1); }

.datebar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; padding: 8px; }
.datebar .arrow { width: 44px; height: 44px; border-radius: 50%; background: var(--bg); font-size: 22px; font-weight: 900; }
.datebar .arrow:active { transform: scale(.9); }
.datebar .mid { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.datebar .pick { display: flex; flex-direction: column; align-items: center; padding: 4px 14px; border-radius: 16px; }
.datebar .pick:active { background: var(--bg); }
.datebar .pick b { font-size: 19px; display: block; }
.datebar .pick span { font-size: 13px; color: var(--ink-soft); font-weight: 700; }
.datebar .arrow[disabled] { opacity: .3; pointer-events: none; }
/* 原生日期框藏在按钮下面，只用来弹出系统日期选择器 */
.datebar .mid input { position: absolute; left: 50%; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; }
.today-tag { display: inline-block; margin-left: 4px; padding: 1px 8px; border-radius: 999px; background: var(--yellow); color: var(--ink); font-size: 12px; vertical-align: 2px; }
.back-today { font-size: 13px; color: #fff; background: var(--blue); box-shadow: 0 3px 0 var(--blue-deep); font-weight: 900; padding: 3px 12px; border-radius: 999px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; } }

.task {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 16px 10px 14px; min-height: 150px; text-align: center;
  background: var(--card); border: 3px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: transform .12s, box-shadow .12s, background .2s;
}
.task:active { transform: translateY(3px) scale(.98); box-shadow: 0 1px 0 var(--line); }
.task .emo { font-size: 46px; line-height: 1.1; filter: drop-shadow(0 3px 0 rgba(0,0,0,.06)); }
.task .nm { font-size: 16px; font-weight: 900; line-height: 1.25; }
.task .pts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.tag { display: inline-flex; align-items: center; gap: 2px; padding: 2px 9px; border-radius: 999px; font-size: 13px; font-weight: 900; background: #FFF4D1; color: #B7791F; }
.tag.fl { background: #FFE8EF; color: var(--flower-deep); }
.tag.minus { background: #FFE5E5; color: var(--red-deep); }
.tag.gray { background: #E8F0FA; color: var(--ink-soft); }
.task .count { font-size: 12px; font-weight: 800; color: var(--ink-soft); }
.task.done { background: #EFFFF1; border-color: #B9E8BF; box-shadow: 0 4px 0 #B9E8BF; }
.task.done .emo { animation: wiggle .6s; }
.task .stamp {
  position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%;
  background: var(--mint); color: #fff; display: grid; place-items: center; font-size: 17px; font-weight: 900;
  box-shadow: 0 3px 0 var(--mint-deep); animation: pop .4s;
}
.task .undo {
  position: absolute; top: 8px; left: 8px; width: 30px; height: 30px; border-radius: 50%;
  background: var(--bg); color: var(--ink-soft); display: grid; place-items: center; font-size: 15px; font-weight: 900;
}
.task.rule { background: #FFF8F8; border-color: #FFD6D6; box-shadow: 0 4px 0 #FFD6D6; min-height: 120px; }
.task.rule .emo { font-size: 38px; }

.cat-label { display: inline-block; margin: 16px 4px 8px; padding: 4px 12px; border-radius: 999px; background: var(--card); border: 2px solid var(--line); font-size: 13px; font-weight: 900; color: var(--ink-soft); }

.quick { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.quick .btn { flex: 1; min-width: 140px; }

/* ---------- 记录列表 ---------- */
.rec-list { display: flex; flex-direction: column; gap: 8px; }
.rec { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--card); border: 3px solid var(--line); border-radius: 18px; }
.rec .ic { width: 44px; height: 44px; flex-shrink: 0; border-radius: 14px; background: var(--bg); display: grid; place-items: center; font-size: 26px; }
.rec .info { flex: 1; min-width: 0; }
.rec .info b { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec .info span { font-size: 12px; color: var(--ink-soft); font-weight: 700; }
.rec .val { text-align: right; font-weight: 900; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rec .val .p { color: var(--mint-deep); }
.rec .val .n { color: var(--red-deep); }
.rec .del { width: 32px; height: 32px; border-radius: 50%; color: var(--ink-soft); font-size: 16px; flex-shrink: 0; }
.rec .del:active { background: var(--bg); }

.day-group { margin-top: 16px; }
.day-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 6px 8px; }
.day-head b { font-size: 16px; }
.day-head span { font-size: 13px; font-weight: 800; color: var(--ink-soft); }

/* ---------- 奖励商店 ---------- */
.reward {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 12px 14px; text-align: center;
  background: var(--card); border: 3px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.reward .emo { font-size: 52px; animation: bob 3.5s ease-in-out infinite; }
.reward .nm { font-weight: 900; font-size: 16px; }
.reward .need { width: 100%; height: 10px; border-radius: 999px; background: #E8F0FA; overflow: hidden; }
.reward .need i { display: block; height: 100%; background: linear-gradient(90deg, var(--sky), var(--blue)); border-radius: 999px; }
.reward .hint { font-size: 12px; color: var(--ink-soft); font-weight: 800; min-height: 16px; }

/* ---------- 历史 ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { text-align: center; padding: 14px 6px; }
.stat b { display: block; font-size: 26px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--ink-soft); font-weight: 800; }
.stat:nth-child(1) b { color: var(--mint-deep); }
.stat:nth-child(2) b { color: var(--sky-deep); }
.stat:nth-child(3) b { color: #D69E2E; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 4px; }
.chip { padding: 7px 14px; border-radius: 999px; background: var(--card); border: 2px solid var(--line); font-size: 14px; font-weight: 900; color: var(--ink-soft); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }

.week { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding: 10px 4px 0; }
.week .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.week .col i { display: block; width: 100%; max-width: 34px; border-radius: 10px 10px 4px 4px; background: linear-gradient(180deg, var(--blue), #A9D8FF); min-height: 4px; transition: height .5s; }
.week .col span { font-size: 11px; font-weight: 800; color: var(--ink-soft); }
.week .col em { font-style: normal; font-size: 11px; font-weight: 900; color: var(--blue-deep); }

/* ---------- 设置 ---------- */
.seg { display: flex; gap: 6px; padding: 6px; background: var(--card); border: 3px solid var(--line); border-radius: 999px; box-shadow: var(--shadow); }
.seg { overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: 1 0 auto; min-height: 42px; padding: 0 6px; border-radius: 999px; font-weight: 900; font-size: 14px; color: var(--ink-soft); white-space: nowrap; }
.seg button.on { background: var(--blue); color: #fff; box-shadow: 0 3px 0 var(--blue-deep); }
.set-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--card); border: 3px solid var(--line); border-radius: 18px; text-align: left; width: 100%; }
.set-row.off { opacity: .5; }
.set-row .ic { width: 46px; height: 46px; flex-shrink: 0; border-radius: 14px; background: var(--bg); display: grid; place-items: center; font-size: 28px; }
.set-row .info { flex: 1; min-width: 0; }
.set-row .info b { display: block; font-size: 16px; }
.set-row .info span { font-size: 12px; color: var(--ink-soft); font-weight: 700; }
.set-row .go { color: var(--ink-soft); font-size: 20px; font-weight: 900; }
.tip { margin: 12px 4px 0; font-size: 13px; color: var(--ink-soft); font-weight: 700; line-height: 1.6; }

/* 排序 */
.sort-bar { display: flex; justify-content: flex-end; margin-bottom: 2px; }
.set-row .mv { width: 42px; height: 42px; flex-shrink: 0; border-radius: 14px; background: var(--bg); font-size: 20px; font-weight: 900; color: var(--blue-deep); }
.set-row .mv:active { transform: scale(.9); background: #D5E8FF; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 14px; font-weight: 900; margin-bottom: 6px; }
.field > label small { color: var(--ink-soft); font-weight: 700; }
.input { width: 100%; min-height: 48px; padding: 0 14px; border-radius: 16px; border: 3px solid var(--line); background: #F7FBFF; font: inherit; font-size: 16px; font-weight: 700; color: var(--ink); }
.input:focus { outline: none; border-color: var(--blue); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stepper { display: flex; align-items: center; justify-content: space-between; border: 3px solid var(--line); border-radius: 16px; background: #F7FBFF; min-height: 48px; padding: 3px; }
.stepper button { width: 40px; height: 40px; border-radius: 12px; background: var(--bg); font-size: 22px; font-weight: 900; }
.stepper input { width: 50px; border: 0; background: transparent; text-align: center; font: inherit; font-size: 18px; font-weight: 900; color: var(--ink); }
.stepper input:focus { outline: none; }
.emoji-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; max-height: 164px; overflow-y: auto; padding: 6px; border-radius: 16px; background: var(--bg); }
.emoji-pick button { height: 44px; border-radius: 12px; font-size: 26px; }
.emoji-pick button.on { background: var(--card); box-shadow: 0 0 0 3px var(--blue); }
.color-pick { display: flex; gap: 10px; flex-wrap: wrap; }
.color-pick button { width: 38px; height: 38px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--line); }
.color-pick button.on { box-shadow: 0 0 0 3px var(--ink); }
.switch-row { display: flex; align-items: center; justify-content: space-between; font-weight: 900; }
.switch { position: relative; width: 56px; height: 32px; border-radius: 999px; background: #D3DFEC; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 0 rgba(0,0,0,.1); transition: left .2s; }
.switch.on { background: var(--mint); }
.switch.on::after { left: 27px; }

/* ---------- 连续打卡 & 徽章 ---------- */
.streak-pill { position: absolute; top: 12px; right: 12px; z-index: 2; padding: 4px 12px; border-radius: 999px; background: rgba(255,255,255,.95); color: #E8590C; font-size: 13px; font-weight: 900; box-shadow: 0 3px 0 rgba(0,0,0,.08); }
.hero h2 { padding-right: 96px; }
.streak-card { display: flex; align-items: center; gap: 14px; background: linear-gradient(135deg, #FFB547, #FF7A45); color: #fff; border: 0; box-shadow: 0 6px 0 #E8590C33; }
.streak-card .fire { font-size: 58px; animation: bob 2s ease-in-out infinite; filter: drop-shadow(0 4px 0 rgba(0,0,0,.1)); }
.streak-card .fire.off { filter: grayscale(1); opacity: .6; animation: none; }
.streak-card .now { flex: 1; }
.streak-card b { display: block; font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; }
.streak-card span { font-size: 13px; font-weight: 800; opacity: .95; }
.streak-card .best { text-align: center; padding: 8px 14px; border-radius: 18px; background: rgba(255,255,255,.22); }
.streak-card .best b { font-size: 26px; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
@media (min-width: 700px) { .badge-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; } }
.badge { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px 12px; text-align: center; background: var(--card); border: 3px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.badge .bi { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; font-size: 34px; background: #E8F0FA; filter: grayscale(1); opacity: .45; }
.badge b { font-size: 14px; }
.badge .bd { font-size: 11px; font-weight: 700; color: var(--ink-soft); line-height: 1.35; min-height: 30px; }
.badge em { font-style: normal; font-size: 12px; font-weight: 900; padding: 2px 10px; border-radius: 999px; background: #FFF4D1; color: #B7791F; }
.badge em.lk { background: none; color: var(--ink-soft); padding: 0; }
.badge .need { width: 80%; height: 8px; border-radius: 999px; background: #E8F0FA; overflow: hidden; }
.badge .need i { display: block; height: 100%; border-radius: 999px; background: var(--blue); }
.badge.on { border-color: #FFD98A; box-shadow: 0 4px 0 #FFD98A; }
.badge.on .bi { filter: none; opacity: 1; background: radial-gradient(circle at 35% 30%, #FFF6D6, #FFD166); box-shadow: 0 3px 0 var(--yellow-deep); animation: pop .5s; }
.redeemed.zero { background: none; color: var(--ink-soft); font-weight: 800; }
.redeemed { margin-top: -4px; padding: 2px 9px; border-radius: 999px; background: #E3F4E6; color: var(--mint-deep); font-size: 12px; font-weight: 900; }

/* ---------- 家长密码键盘 ---------- */
.pin { text-align: center; }
.pin h3 { margin-bottom: 4px; }
.pin-sub { margin: 0 0 16px; font-weight: 800; color: var(--ink-soft); min-height: 20px; }
.pin-dots { display: flex; justify-content: center; gap: 16px; margin-bottom: 20px; }
.pin-dots i { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--line); transition: background .15s, transform .15s; }
.pin-dots i.on { background: var(--blue); border-color: var(--blue); transform: scale(1.1); }
.pin-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 300px; margin: 0 auto; }
.pin-keys button { height: 64px; border-radius: 20px; background: var(--bg); font-size: 26px; font-weight: 900; box-shadow: 0 4px 0 var(--line); }
.pin-keys button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.pin-keys button.fn { font-size: 16px; color: var(--ink-soft); background: transparent; box-shadow: none; }
.coin.lock { padding: 6px 10px; }
.switch[disabled] { opacity: .5; pointer-events: none; }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(10px + var(--safe-b)); z-index: 20;
  width: min(600px, calc(100% - 24px)); height: var(--tabbar-h); display: flex; padding: 6px;
  background: var(--card); border: 3px solid var(--line); border-radius: 28px; box-shadow: 0 6px 0 var(--line), 0 10px 30px rgba(45,70,101,.12);
}
.tabbar button { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 22px; font-size: 12px; font-weight: 900; color: var(--ink-soft); transition: background .2s; }
.tabbar .ti { font-size: 24px; transition: transform .2s; }
.tabbar button.on { background: #DDEEFF; color: var(--blue-deep); }
.tabbar button.on .ti { transform: translateY(-2px) scale(1.12); }

/* ---------- 弹窗 ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(45,70,101,.35); animation: fade .2s; }
.modal-card {
  position: relative; width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto;
  background: var(--card); border-radius: 28px 28px 0 0; padding: 22px 18px calc(18px + var(--safe-b));
  animation: up .28s cubic-bezier(.3,1.3,.6,1);
}
@media (min-width: 700px) { .modal { align-items: center; } .modal-card { border-radius: 28px; padding-bottom: 22px; } }
.modal-card h3 { margin: 0 0 16px; font-size: 20px; text-align: center; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn { flex: 1; }
.confirm-emo { text-align: center; font-size: 64px; margin: 4px 0 8px; animation: bob 2s ease-in-out infinite; }
.confirm-text { text-align: center; font-weight: 800; font-size: 16px; line-height: 1.6; }

.toast { position: fixed; top: calc(16px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 70; padding: 12px 20px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 900; box-shadow: 0 6px 20px rgba(0,0,0,.2); animation: drop .3s; max-width: calc(100% - 32px); text-align: center; }
.toast[hidden] { display: none; }

/* ---------- 特效 ---------- */
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.float-up { position: absolute; font-weight: 900; font-size: 24px; color: var(--mint-deep); text-shadow: 0 2px 0 #fff, 0 0 8px #fff; animation: floatUp 1s ease-out forwards; white-space: nowrap; transform: translate(-50%, -50%); }
.float-up.neg { color: var(--red-deep); }
.confetti { position: absolute; top: -40px; font-size: 26px; animation: fall linear forwards; }
.celebrate { position: fixed; inset: 0; display: grid; place-items: center; z-index: 65; pointer-events: none; }
.celebrate div { background: var(--card); border: 4px solid var(--yellow); border-radius: 32px; padding: 24px 32px; text-align: center; box-shadow: 0 8px 0 var(--yellow-deep); animation: popIn .5s cubic-bezier(.3,1.6,.5,1); }
.celebrate .e { font-size: 72px; display: block; }
.celebrate b { font-size: 22px; }

/* ---------- 登录 ---------- */
.login { max-width: 360px; margin: 12vh auto 0; text-align: center; }
.login .logo { font-size: 80px; animation: bob 3s ease-in-out infinite; }
.login h1 { margin: 8px 0 20px; }

@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes popIn { 0% { transform: scale(.3); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes wiggle { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-12deg) scale(1.15); } 75% { transform: rotate(12deg) scale(1.15); } }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.6); } 20% { opacity: 1; transform: translate(-50%, -60%) scale(1.2); } 100% { opacity: 0; transform: translate(-50%, -180%) scale(1); } }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes drop { from { transform: translate(-50%, -20px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (max-width: 420px) {
  .seg { gap: 2px; padding: 5px; }
  .seg button { font-size: 13px; padding: 0 4px; }
  .coin { padding: 5px 10px; font-size: 15px; }
  .kid-chip { font-size: 14px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .task { min-height: 138px; }
  .task .emo { font-size: 40px; }
}
