/* ⭐ 我的小星星 —— 夜空攒星星主题 */

@font-face {
  font-family: "XingxingKuaiLe";
  src: url("fonts/kuaile-subset.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg1: #14152f;
  --bg2: #232052;
  --bg3: #3a2f6b;
  --gold: #ffd76e;
  --gold-deep: #ffb93d;
  --pink: #ff8fb2;
  --mint: #7fe3c3;
  --skyblue: #6ec6ff;
  --ink: #fff7e8;
  --ink-dim: rgba(255, 247, 232, .58);
  --card: rgba(255, 255, 255, .07);
  --card-brd: rgba(255, 255, 255, .14);
  --radius: 22px;
  --fnt: "XingxingKuaiLe", "Yuanti SC", "YouYuan", "幼圆", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

html { height: 100%; }

body {
  font-family: var(--fnt);
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg1) 0%, var(--bg2) 52%, var(--bg3) 100%) fixed;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

#app { max-width: 480px; margin: 0 auto; position: relative; }

/* ---------- 夜空背景 ---------- */
.sky { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.sky-stars .tw {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, rgba(255,255,255,0) 70%);
  animation: twinkle var(--tw-dur, 3s) ease-in-out var(--tw-del, 0s) infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: .15; transform: scale(.7); }
  50% { opacity: .95; transform: scale(1.15); }
}
.moon {
  position: absolute; top: 5vh; right: 8vw; font-size: 54px;
  filter: drop-shadow(0 0 24px rgba(255, 236, 170, .45));
  animation: floaty 6s ease-in-out infinite;
}
.cloud { position: absolute; font-size: 42px; opacity: .16; animation: drift 40s linear infinite; }
.cloud.c1 { top: 16vh; left: -60px; }
.cloud.c2 { top: 46vh; left: -90px; font-size: 58px; opacity: .10; animation-duration: 55s; animation-delay: -20s; }
@keyframes drift { to { transform: translateX(120vw); } }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ---------- 主区域 ---------- */
#main { position: relative; z-index: 1; padding: 20px 16px calc(96px + env(safe-area-inset-bottom)); }

.page { display: none; }
.page.active { display: block; animation: pagein .35s ease both; }
@keyframes pagein { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.pop { animation: popin .5s cubic-bezier(.34,1.4,.64,1) var(--d, 0s) both; }
@keyframes popin { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: none; } }

/* ---------- 英雄区 ---------- */
.hero { text-align: center; padding: 18px 0 6px; position: relative; }
.hero-sub { font-size: 15px; letter-spacing: 4px; color: var(--ink-dim); }
.hero-total { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 6px 0 2px; }
.star-big { font-size: 44px; display: inline-block; animation: starspin 4s ease-in-out infinite; filter: drop-shadow(0 0 18px rgba(255, 215, 110, .55)); }
@keyframes starspin { 0%,100% { transform: rotate(-10deg) scale(1); } 50% { transform: rotate(10deg) scale(1.12); } }
.hero-num {
  font-size: 84px; line-height: 1; color: var(--gold);
  text-shadow: 0 3px 0 rgba(0,0,0,.18), 0 0 30px rgba(255, 215, 110, .4);
}
.hero-num.bump { animation: bump .5s cubic-bezier(.34,1.6,.64,1); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
.hero-badge {
  display: inline-block; margin-top: 8px; padding: 6px 16px; font-size: 14px;
  background: linear-gradient(135deg, rgba(255,215,110,.22), rgba(255,143,178,.18));
  border: 1px solid rgba(255,215,110,.4); border-radius: 999px; color: var(--gold);
}
.hero-today { margin-top: 10px; font-size: 13px; color: var(--ink-dim); }
.sound-btn {
  position: absolute; top: 12px; right: 0; width: 40px; height: 40px;
  border-radius: 50%; border: 1px solid var(--card-brd); background: var(--card);
  font-size: 17px; color: var(--ink); cursor: pointer;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); border: 1px solid var(--card-brd);
  border-radius: var(--radius); padding: 18px 16px; margin-top: 16px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0,0,0,.22);
}
.card-title { font-size: 16px; margin-bottom: 14px; color: var(--ink); }
.card-title .hint { font-size: 12px; color: var(--ink-dim); font-weight: normal; }

/* ---------- 理由 chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.reason-group { margin-bottom: 14px; }
.reason-group:last-child { margin-bottom: 0; }
.group-title {
  font-size: 12.5px; color: var(--ink-dim); letter-spacing: 1px;
  margin: 0 2px 8px; display: flex; align-items: center; gap: 8px;
}
.group-title::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--card-brd), transparent);
}
.chip {
  font-family: var(--fnt); font-size: 14.5px; color: var(--ink);
  padding: 9px 14px; border-radius: 999px; cursor: pointer;
  background: rgba(255,255,255,.06); border: 1.5px solid var(--card-brd);
  transition: transform .15s, background .15s, border-color .15s;
}
.chip:active { transform: scale(.93); }
.chip.sel {
  background: linear-gradient(135deg, rgba(255,215,110,.30), rgba(255,185,61,.22));
  border-color: var(--gold); color: var(--gold);
  box-shadow: 0 0 14px rgba(255,215,110,.25);
}
.chip.add-chip { border-style: dashed; color: var(--ink-dim); }

/* ---------- 分数选择 ---------- */
.points-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.pt {
  font-family: var(--fnt); border-radius: 18px; padding: 12px 4px 10px; cursor: pointer;
  background: rgba(255,255,255,.06); border: 1.5px solid var(--card-brd); color: var(--ink);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.pt b { font-size: 21px; }
.pt i { font-style: normal; font-size: 10.5px; opacity: .75; letter-spacing: 1px; }
.pt:active { transform: scale(.93); }
.pt.pt-custom { border-style: dashed; color: var(--ink-dim); }
.pt.pt-custom.sel {
  background: linear-gradient(150deg, rgba(255,215,110,.32), rgba(255,143,178,.20));
  border-color: var(--gold); color: var(--gold); border-style: solid;
  box-shadow: 0 6px 18px rgba(255,185,61,.28);
  transform: translateY(-3px);
}
.pt.sel {
  background: linear-gradient(150deg, rgba(255,215,110,.32), rgba(255,143,178,.20));
  border-color: var(--gold); box-shadow: 0 6px 18px rgba(255,185,61,.28);
  transform: translateY(-3px);
}

/* ---------- 提交按钮 ---------- */
.submit-btn {
  display: block; width: 100%; margin-top: 20px; padding: 17px; cursor: pointer;
  font-family: var(--fnt); font-size: 20px; letter-spacing: 2px; color: #5b3a00;
  background: linear-gradient(135deg, #ffe49a, var(--gold) 45%, var(--gold-deep));
  border: none; border-radius: 999px;
  box-shadow: 0 8px 24px rgba(255,185,61,.4), inset 0 -3px 0 rgba(0,0,0,.08);
  transition: transform .15s, box-shadow .15s, filter .2s;
}
.submit-btn:active { transform: scale(.96); box-shadow: 0 4px 12px rgba(255,185,61,.35); }
.submit-btn:disabled { filter: grayscale(.75) brightness(.75); cursor: not-allowed; }
.submit-btn.shake { animation: shake .4s; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }
.foot-hint { text-align: center; margin-top: 14px; font-size: 12.5px; color: var(--ink-dim); }
.foot-credit {
  text-align: center; font-size: 10.5px; color: var(--ink-dim);
  opacity: .55; margin-top: 6px; letter-spacing: 1px;
}

/* ---------- 统计页 ---------- */
.page-title { font-size: 22px; margin: 8px 2px 2px; letter-spacing: 2px; }
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.s-card {
  background: var(--card); border: 1px solid var(--card-brd); border-radius: 20px;
  padding: 14px 16px; backdrop-filter: blur(10px);
}
.s-card em { display: block; font-style: normal; font-size: 12.5px; color: var(--ink-dim); margin-bottom: 4px; }
.s-card b { font-size: 34px; line-height: 1.1; }
.gold { color: var(--gold); } .pink { color: var(--pink); }
.mint { color: var(--mint); } .skyblue { color: var(--skyblue); }

.streak-num { color: var(--gold); font-size: 18px; margin-left: 4px; }
.heatmap-wrap { overflow-x: auto; padding-bottom: 4px; }
.heatmap { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; gap: 4px; width: max-content; margin: 0 auto; }
.heatmap i {
  width: 15px; height: 15px; border-radius: 4.5px; display: block;
  background: rgba(255,255,255,.07);
}
.heatmap i.lv1 { background: rgba(255,215,110,.30); }
.heatmap i.lv2 { background: rgba(255,200,80,.55); }
.heatmap i.lv3 { background: rgba(255,190,60,.80); }
.heatmap i.lv4 { background: var(--gold); box-shadow: 0 0 8px rgba(255,215,110,.5); }
.heatmap i.today { outline: 2px solid rgba(255,143,178,.85); outline-offset: 1px; }
.h-legend { display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 12px; font-size: 11px; color: var(--ink-dim); }
.h-legend i { width: 12px; height: 12px; border-radius: 3.5px; display: inline-block; background: rgba(255,255,255,.07); }
.h-legend i.lv1 { background: rgba(255,215,110,.30); } .h-legend i.lv2 { background: rgba(255,200,80,.55); }
.h-legend i.lv3 { background: rgba(255,190,60,.80); } .h-legend i.lv4 { background: var(--gold); }

.bars { display: flex; align-items: flex-end; gap: 5px; height: 130px; padding-top: 22px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; justify-content: flex-end; }
.bar-star { font-size: 11px; opacity: 0; transition: opacity .4s; }
.bar-col.has .bar-star { opacity: 1; }
.bar {
  width: 100%; max-width: 18px; border-radius: 7px 7px 3px 3px; min-height: 4px;
  background: linear-gradient(180deg, var(--gold), rgba(255,185,61,.35));
  transform-origin: bottom; animation: grow .7s cubic-bezier(.34,1.3,.64,1) both;
}
.bar-col.zero .bar { background: rgba(255,255,255,.12); animation: none; }
@keyframes grow { from { transform: scaleY(0); } }
.bar-day { font-size: 10px; color: var(--ink-dim); }
.bar-col.today .bar-day { color: var(--pink); font-weight: bold; }

.rank-list { display: flex; flex-direction: column; gap: 12px; }
.rank-item { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; }
.rank-medal { font-size: 22px; text-align: center; }
.rank-emoji { font-size: 16px; }
.rank-body .rank-name { font-size: 14.5px; margin-bottom: 5px; display: flex; gap: 6px; align-items: baseline; }
.rank-bar-bg { height: 10px; border-radius: 999px; background: rgba(255,255,255,.09); overflow: hidden; }
.rank-bar { height: 100%; border-radius: 999px; animation: growx .8s cubic-bezier(.34,1.2,.64,1) both; transform-origin: left; }
@keyframes growx { from { transform: scaleX(0); } }
.rank-pts { text-align: right; min-width: 58px; }
.rank-pts b { font-size: 17px; color: var(--gold); }
.rank-pts em { display: block; font-style: normal; font-size: 10.5px; color: var(--ink-dim); }
.rank-empty { text-align: center; color: var(--ink-dim); font-size: 13.5px; padding: 10px 0 4px; }

/* ---------- 记录页 ---------- */
.log-meta { font-size: 12.5px; color: var(--ink-dim); margin: 6px 2px 0; }
.day-group { margin-top: 16px; }
.day-head { display: flex; align-items: baseline; gap: 8px; margin: 0 4px 8px; }
.day-head b { font-size: 15px; }
.day-head em { font-style: normal; font-size: 12px; color: var(--ink-dim); }
.day-head .day-sum { margin-left: auto; font-size: 13px; color: var(--gold); }
.log-item {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center;
  background: var(--card); border: 1px solid var(--card-brd); border-radius: 18px;
  padding: 12px 14px; margin-bottom: 9px; cursor: pointer;
  transition: transform .15s, background .2s;
  animation: popin .4s ease both;
}
.log-item:active { transform: scale(.97); background: rgba(255,255,255,.11); }
.log-ico {
  width: 44px; height: 44px; border-radius: 15px; font-size: 21px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.08); border: 1px solid var(--card-brd);
}
.log-mid .log-reason { font-size: 15px; }
.log-mid .log-time { font-size: 11.5px; color: var(--ink-dim); margin-top: 3px; }
.log-pts {
  font-size: 17px; color: var(--gold); padding: 5px 12px; border-radius: 999px;
  background: rgba(255,215,110,.13); border: 1px solid rgba(255,215,110,.35);
}
.log-tip { text-align: center; font-size: 11.5px; color: var(--ink-dim); margin-top: 16px; }
.log-empty { text-align: center; padding: 46px 0 30px; color: var(--ink-dim); font-size: 14px; }
.log-empty .big { font-size: 44px; display: block; margin-bottom: 10px; }

/* ---------- 星星兑换页 ---------- */
.balance-row {
  display: flex; align-items: center; justify-content: center; gap: 12px;
}
.balance-row .star-big { font-size: 34px; }
.balance-num { font-size: 52px; }
.balance-sub { text-align: center; font-size: 12.5px; color: var(--ink-dim); margin-top: 6px; }
.spend-row { display: flex; gap: 8px; margin-top: 12px; }
.spend-row input {
  flex: 1; min-width: 0;
  font-family: var(--fnt); font-size: 14.5px; color: var(--ink);
  padding: 11px 14px; border-radius: 14px;
  background: rgba(255,255,255,.07); border: 1.5px solid var(--card-brd);
  outline: none; transition: border-color .15s;
}
.spend-row input:focus { border-color: var(--gold); }
.spend-row .spend-go { flex: none; padding: 11px 18px; border: none; border-radius: 14px; cursor: pointer; font-size: 14px; }
.card-title .hint { font-size: 11.5px; color: var(--ink-dim); font-weight: normal; margin-left: 6px; }

/* ---------- 流水负数（兑换）样式 ---------- */
.log-item.log-spend .log-ico { background: rgba(255,143,178,.12); border-color: rgba(255,143,178,.35); }
.log-item.log-spend .log-pts {
  color: #ffb3ca; background: rgba(255,143,178,.13); border-color: rgba(255,143,178,.35);
}

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; z-index: 20;
  display: flex; justify-content: space-around; padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(20, 21, 47, .82); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--card-brd);
}
.tab {
  font-family: var(--fnt); background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--ink-dim); font-size: 11.5px; padding: 4px 9px; border-radius: 14px;
  transition: color .2s, transform .15s;
}
.tab i { font-style: normal; font-size: 23px; transition: transform .2s; }
.tab.active { color: var(--gold); }
.tab.active i { transform: translateY(-3px) scale(1.15); }
.tab:active { transform: scale(.9); }

/* ---------- 庆祝弹层 ---------- */
.celebrate {
  position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center;
  background: rgba(10, 10, 30, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fadein .25s ease both;
}
.celebrate.hidden, .modal.hidden, .toast.hidden, .debt-banner.hidden, #pendingCard.hidden, .hidden { display: none !important; }
@keyframes fadein { from { opacity: 0; } }
.celebrate-card {
  text-align: center; padding: 34px 46px; border-radius: 30px;
  background: linear-gradient(160deg, rgba(58,47,107,.92), rgba(35,32,82,.95));
  border: 1.5px solid rgba(255,215,110,.5); box-shadow: 0 0 60px rgba(255,215,110,.22);
  animation: celebratein .55s cubic-bezier(.34,1.5,.64,1) both;
}
@keyframes celebratein { from { opacity: 0; transform: scale(.5) translateY(40px); } }
.celebrate-stars { font-size: 52px; letter-spacing: 4px; animation: starspin 1.2s ease-in-out infinite; }
.celebrate-text { font-size: 27px; color: var(--gold); margin-top: 10px; text-shadow: 0 0 20px rgba(255,215,110,.5); }
.celebrate-sub { font-size: 14px; color: var(--ink-dim); margin-top: 8px; }

/* ---------- 通用弹窗 ---------- */
.modal {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  background: rgba(10, 10, 30, .6); padding: 24px; animation: fadein .2s ease both;
}
.modal-card {
  width: 100%; max-width: 340px; border-radius: 26px; padding: 24px 20px;
  background: linear-gradient(160deg, #2c2a5e, #1e1d46);
  border: 1.5px solid var(--card-brd); text-align: center;
  animation: celebratein .4s cubic-bezier(.34,1.4,.64,1) both;
}
.modal-card input {
  width: 100%; font-family: var(--fnt); font-size: 16px; color: var(--ink);
  background: rgba(255,255,255,.07); border: 1.5px solid var(--card-brd);
  border-radius: 14px; padding: 13px 14px; margin-top: 4px; outline: none;
}
.modal-card input:focus { border-color: var(--gold); }
.modal-btns { display: flex; gap: 10px; margin-top: 18px; }
.mbtn {
  flex: 1; font-family: var(--fnt); font-size: 15.5px; padding: 12px; border-radius: 999px;
  cursor: pointer; border: none; transition: transform .15s;
}
.mbtn:active { transform: scale(.94); }
.mbtn.ghost { background: rgba(255,255,255,.08); color: var(--ink-dim); border: 1px solid var(--card-brd); }
.mbtn.gold { background: linear-gradient(135deg, #ffe49a, var(--gold-deep)); color: #5b3a00; }
.mbtn.pink { background: linear-gradient(135deg, #ffb3ca, #ff7fa5); color: #6b1130; }
.del-star { font-size: 44px; margin-bottom: 8px; }
.del-sub { font-size: 13px; color: var(--ink-dim); margin-top: 6px; }
.spend-note { font-size: 12px; color: var(--ink-dim); margin-top: 8px; line-height: 1.5; opacity: .9; }

/* ---------- 粒子 & toast ---------- */
#particleLayer { position: fixed; inset: 0; z-index: 60; pointer-events: none; overflow: hidden; }
.pt-star {
  position: absolute; font-size: var(--sz, 22px);
  animation: fly .9s cubic-bezier(.2,.7,.4,1) var(--del, 0s) forwards;
}
@keyframes fly {
  0% { transform: translate(0, 0) scale(.4) rotate(0deg); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1.15) rotate(var(--rot)); opacity: 0; }
}
.toast {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 70;
  background: rgba(30, 29, 70, .95); border: 1px solid var(--card-brd);
  color: var(--ink); font-size: 14px; padding: 11px 20px; border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0,0,0,.35); animation: fadein .25s ease both;
  max-width: 86vw; text-align: center;
}

/* ---------- PC 端稍作修饰 ---------- */
@media (min-width: 520px) {
  body::before {
    content: ""; position: fixed; inset: 0; z-index: -1;
    background: radial-gradient(60% 50% at 50% 0%, rgba(255,215,110,.06), transparent);
  }
}

/* ---------- 转账 / 家长奖励双按钮 ---------- */
.add-btns { display: flex; gap: 10px; }
.submit-btn.half { margin-top: 20px; flex: 1; font-size: 16.5px; letter-spacing: 1px; padding: 15px 6px; }
.submit-btn.half.alt {
  background: linear-gradient(135deg, #a8f0d8, var(--mint) 50%, #4ecfa8);
  color: #0b4d38;
  box-shadow: 0 8px 24px rgba(127,227,195,.32), inset 0 -3px 0 rgba(0,0,0,.08);
}

/* ---------- 欠款提醒条 ---------- */
.debt-banner {
  position: sticky; top: 8px; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 0 0 4px; padding: 10px 14px;
  background: linear-gradient(135deg, rgba(255,143,178,.22), rgba(255,185,61,.18));
  border: 1px solid rgba(255,143,178,.5); border-radius: 999px;
  font-size: 14px; color: var(--ink);
  animation: fadein .3s ease both;
}
.debt-banner b { color: var(--pink); font-size: 17px; }
.mini-btn {
  font-family: var(--fnt); font-size: 13px; cursor: pointer;
  padding: 6px 14px; border-radius: 999px; border: none;
  background: linear-gradient(135deg, #ffe49a, var(--gold-deep)); color: #5b3a00;
}
.mini-btn.ok { background: linear-gradient(135deg, #a8f0d8, #4ecfa8); color: #0b4d38; }
.mini-btn.no { background: rgba(255,255,255,.10); color: var(--ink-dim); border: 1px solid var(--card-brd); }
.mini-btn:active { transform: scale(.94); }

/* ---------- 补记日期选择 ---------- */
.date-in-card {
  margin-top: 14px; padding-top: 14px;
  border-top: 1px dashed var(--card-brd);
}
.date-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.date-label { font-size: 13.5px; color: var(--ink-dim); }
.date-btn {
  font-family: var(--fnt); font-size: 14px; color: var(--ink); cursor: pointer;
  padding: 7px 15px; border-radius: 999px;
  background: rgba(255,255,255,.06); border: 1.5px solid var(--card-brd);
  transition: transform .15s, border-color .15s, color .15s, background .15s;
}
.date-btn:active { transform: scale(.94); }
.date-btn.sel {
  color: var(--gold); border-color: var(--gold);
  background: linear-gradient(135deg, rgba(255,215,110,.30), rgba(255,185,61,.22));
  box-shadow: 0 0 12px rgba(255,215,110,.2);
}
/* 记录弹窗里的「日期选错了？点这里改」 */
.date-edit-btn {
  display: block; width: 100%; margin-top: 14px; padding: 10px;
  font-family: var(--fnt); font-size: 13.5px; cursor: pointer;
  color: var(--gold); background: rgba(255,215,110,.10);
  border: 1.5px dashed rgba(255,215,110,.45); border-radius: 12px;
  transition: transform .15s, background .15s;
}
.date-edit-btn:active { transform: scale(.97); background: rgba(255,215,110,.16); }
.date-hint { font-size: 12px; color: var(--ink-dim); }
.date-quick { justify-content: center; margin-bottom: 2px; }
#dateInput {
  width: 100%; margin-top: 12px; padding: 12px 14px;
  font-family: var(--fnt); font-size: 16px; color: var(--ink);
  background: rgba(255,255,255,.06); border: 1px solid var(--card-brd);
  border-radius: 12px; outline: none; color-scheme: dark;
}
#dateInput:focus { border-color: var(--gold); }

/* ---------- 收款码付款弹窗 ---------- */
.pay-amount { text-align: center; font-size: 44px; color: var(--gold); margin: 6px 0 10px; text-shadow: 0 0 22px rgba(255,215,110,.4); }
.pay-tabs { display: flex; justify-content: center; gap: 8px; margin-bottom: 12px; }
.pay-qr {
  display: block; margin: 0 auto; width: min(230px, 58vw); aspect-ratio: 1/1;
  object-fit: contain; border-radius: 14px; background: #fff; padding: 8px;
  box-shadow: 0 0 26px rgba(255,215,110,.25);
}
.pay-hint { text-align: center; font-size: 12.5px; color: var(--ink-dim); margin-top: 10px; }
.modal-card input[type="password"], .modal-card input[type="text"], .modal-card input[type="number"] {
  width: 100%; margin-top: 10px; padding: 12px 14px; font-family: var(--fnt); font-size: 17px;
  color: var(--ink); background: rgba(255,255,255,.06);
  border: 1px solid var(--card-brd); border-radius: 12px; outline: none;
}
.modal-card input:focus { border-color: var(--gold); }
.pin-sub { font-size: 12.5px; color: var(--ink-dim); margin-top: 4px; }
.modal-btns.three { display: flex; gap: 8px; }
.modal-btns.three .mbtn { flex: 1; padding-left: 4px; padding-right: 4px; }
.mbtn.mint { background: linear-gradient(135deg, #a8f0d8, #4ecfa8); color: #0b4d38; }

/* ---------- 待确认区 ---------- */
.pending-item {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center;
  padding: 10px 0; border-bottom: 1px dashed var(--card-brd);
}
.pending-item:last-child { border-bottom: none; }
.pending-btns { display: flex; gap: 6px; }

/* ---------- 流水状态标签 ---------- */
.log-badge {
  display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px;
  font-size: 11px; vertical-align: 1px;
}
.log-badge.bp { background: rgba(255,215,110,.18); border: 1px solid rgba(255,215,110,.45); color: var(--gold); }
.log-badge.bd { background: rgba(255,143,178,.16); border: 1px solid rgba(255,143,178,.45); color: var(--pink); }
.log-badge.bpay { background: rgba(120,200,255,.16); border: 1px solid rgba(120,200,255,.45); color: var(--skyblue, #7ec8ff); }
.log-badge.bpay-ok { background: rgba(120,230,180,.14); border: 1px solid rgba(120,230,180,.4); color: #4ecfa8; }

/* ---------- 全部标记已充值（待打款筛选下的整体对账操作）---------- */
.mark-paid-btn {
  display: block; margin: 10px 2px 0; padding: 10px 18px; border-radius: 999px; border: none;
  font-size: 14px; font-family: var(--fnt); cursor: pointer; white-space: nowrap;
  background: linear-gradient(135deg, #ffe49a, var(--gold) 60%, var(--gold-deep));
  color: #5a3c00; box-shadow: 0 4px 14px rgba(255,185,61,.35);
  transition: transform .15s;
}
.mark-paid-btn:active { transform: scale(.97); }

/* ---------- 待打款勾选模式（行首圆圈，选哪几笔标哪几笔）---------- */
/* 勾选圆圈是第 4 个网格列，显式加列避免子元素掉行错位 */
.log-item.with-check { grid-template-columns: 24px 44px 1fr auto; }
.pay-check {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--gold-deep); background: transparent;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: transparent; line-height: 1;
  transition: background .15s, color .15s;
}
.pay-check.on { background: var(--gold); color: #5a3c00; }

/* ---------- 时光星河筛选 ---------- */
.log-filters { margin-top: 10px; }
.log-filters .chip { font-size: 13px; padding: 6px 13px; }

/* ---------- 日间主题（6~18 点自动切换）---------- */
/* 蓝天白云太阳；金色星星保留，深色文字保证可读 */
body.day {
  --bg1: #8fd0f7;
  --bg2: #b5e3fb;
  --bg3: #dff3ff;
  --ink: #23405c;
  --ink-dim: rgba(35, 64, 92, .55);
  --card: rgba(255, 255, 255, .55);
  --card-brd: rgba(35, 64, 92, .12);
}
body.day .moon { filter: drop-shadow(0 0 20px rgba(255, 220, 120, .8)); }
body.day .sky-stars { display: none; } /* 白天的天空不撒星点 */
body.day .cloud { opacity: .5; }
body.day .hero-num { color: var(--gold-deep); text-shadow: 0 2px 0 rgba(255,255,255,.6), 0 0 24px rgba(255, 185, 61, .35); }
body.day .hero-badge { background: linear-gradient(135deg, rgba(255,215,110,.45), rgba(255,143,178,.30)); border-color: rgba(255,185,61,.6); color: #9a6a00; }
body.day .star-big { filter: drop-shadow(0 0 14px rgba(255, 185, 61, .5)); }
body.day .tab.active { color: #c47f00; }
body.day .tabbar { background: rgba(255, 255, 255, .78); border-top: 1px solid rgba(35, 64, 92, .10); }
body.day .day-head .day-sum { color: #c47f00; }
body.day .log-pts { color: #9a6a00; background: rgba(255,185,61,.16); border-color: rgba(255,185,61,.5); }
body.day .log-item:active { background: rgba(255,255,255,.75); }
body.day .log-ico { background: rgba(255,255,255,.6); }
body.day .rank-bar-bg { background: rgba(35, 64, 92, .10); }
body.day .heatmap i { background: rgba(35, 64, 92, .08); }
body.day .h-legend i { background: rgba(35, 64, 92, .08); }
body.day .h-legend i.lv1 { background: rgba(255,185,61,.30); } .day .h-legend i.lv2 { background: rgba(255,185,61,.55); }
body.day .h-legend i.lv3 { background: rgba(255,170,40,.8); } body.day .h-legend i.lv4 { background: var(--gold-deep); }
body.day .bar-col.zero .bar { background: rgba(35, 64, 92, .12); }
body.day .heatmap i.lv4 { background: var(--gold-deep); }
body.day .pt.sel { border-color: var(--gold-deep); }
body.day .chip.sel { color: #9a6a00; border-color: var(--gold-deep); background: linear-gradient(135deg, rgba(255,215,110,.45), rgba(255,185,61,.30)); }
body.day .celebrate { background: rgba(140, 190, 230, .45); }
body.day .celebrate-card { background: linear-gradient(160deg, #ffffff, #eaf6ff); border-color: rgba(255,185,61,.6); box-shadow: 0 0 50px rgba(255,185,61,.30); }
body.day .celebrate-text { color: #c47f00; text-shadow: none; }
body.day .modal { background: rgba(70, 120, 165, .35); }
body.day .modal-card { background: linear-gradient(160deg, #ffffff, #eef7ff); border-color: rgba(35, 64, 92, .15); }
body.day .mbtn.ghost { background: rgba(35, 64, 92, .06); color: var(--ink-dim); border-color: rgba(35, 64, 92, .15); }
body.day .toast { background: rgba(255, 255, 255, .96); border-color: rgba(35, 64, 92, .15); color: #23405c; }
body.day .pay-qr { box-shadow: 0 4px 18px rgba(35, 64, 92, .18); }
body.day .date-btn.sel { color: #9a6a00; }
body.day .date-edit-btn { color: #9a6a00; background: rgba(255,185,61,.12); border-color: rgba(255,185,61,.5); }
body.day #dateInput { color-scheme: light; }
body.day .coin-bar-col.zero .coin-bar-in,
body.day .coin-bar-col.zero .coin-bar-out { background: rgba(35, 64, 92, .12); }
body.day .coin-heatmap i.lv1 { background: rgba(255,143,178,.28); }
body.day .coin-heatmap i.lv2 { background: rgba(255,120,160,.52); }
body.day .coin-heatmap i.lv3 { background: rgba(255,100,145,.76); }
body.day .coin-heatmap i.lv4 { background: #ff7fa5; }

/* ---------- 顶部分组子导航（星星/零钱两大分组） ---------- */
.subbar {
  position: sticky; top: 0; z-index: 15;
  display: flex; gap: 4px; justify-content: space-between;
  padding: 10px 14px 8px;
  background: linear-gradient(180deg, rgba(20,21,47,.92), rgba(20,21,47,.75));
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.subtab {
  flex: 1; font-family: var(--fnt); font-size: 12.5px; color: var(--ink-dim);
  background: rgba(255,255,255,.05); border: 1px solid var(--card-brd);
  border-radius: 999px; padding: 8px 4px; cursor: pointer; white-space: nowrap;
  transition: color .2s, background .2s, border-color .2s, transform .15s;
}
.subtab i { font-style: normal; }
.subtab:active { transform: scale(.93); }
.subtab.active {
  color: var(--gold); border-color: rgba(255,215,110,.55);
  background: linear-gradient(135deg, rgba(255,215,110,.22), rgba(255,185,61,.14));
  box-shadow: 0 0 12px rgba(255,215,110,.18);
}

/* ---------- 零钱主题（夜空小金库：金色点缀） ---------- */
.coin-num { color: var(--gold); }
.coin-big { animation: none; filter: drop-shadow(0 0 16px rgba(255, 215, 110, .5)); }
.coin-amount-chips .chip.amt.sel {
  background: linear-gradient(135deg, rgba(255,215,110,.45), rgba(255,185,61,.30));
  border-color: var(--gold); color: var(--gold-deep);
  box-shadow: 0 0 16px rgba(255,215,110,.30);
}
.coin-item .log-ico { background: rgba(255,215,110,.10); border-color: rgba(255,215,110,.35); }
.coin-item.log-spend .log-ico { background: rgba(255,143,178,.12); border-color: rgba(255,143,178,.35); }
.coin-item .log-pts { color: var(--gold-deep); }
.coin-item.log-spend .log-pts { color: #ffb3ca; }
/* 欠款 / 还款待确认：没真正动余额，整行压暗一点 */
.coin-item.log-ghost { opacity: .78; }
.coin-item.log-ghost .log-pts { color: var(--ink-dim); background: rgba(255,255,255,.05); border-color: var(--card-brd); }

/* ---------- 零钱统计：14 天收支柱状图 ---------- */
.coin-bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 20px; }
.coin-bar-col {
  flex: 1; min-width: 0; height: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 5px; justify-content: flex-end;
}
.coin-bar-pair { flex: 1; width: 100%; min-height: 0; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.coin-bar-in, .coin-bar-out {
  width: 6px; max-width: 8px; min-height: 2px; border-radius: 4px 4px 2px 2px;
  transform-origin: bottom; animation: grow .7s cubic-bezier(.34,1.3,.64,1) both;
}
.coin-bar-in { background: linear-gradient(180deg, var(--gold), rgba(255,185,61,.35)); }
.coin-bar-out { background: linear-gradient(180deg, var(--pink), rgba(255,143,178,.30)); }
.coin-bar-col.zero .coin-bar-in, .coin-bar-col.zero .coin-bar-out { background: rgba(255,255,255,.10); animation: none; }
.coin-bar-day { font-size: 10px; color: var(--ink-dim); }
.coin-bar-col.today .coin-bar-day { color: var(--pink); font-weight: bold; }
.coin-legend { display: flex; justify-content: center; gap: 16px; margin-top: 10px; font-size: 11.5px; color: var(--ink-dim); }
.coin-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }
.coin-legend .gold-dot { background: var(--gold); }
.coin-legend .pink-dot { background: var(--pink); }

/* ---------- 零钱统计：10 周消费热力图（粉色=花钱） ---------- */
.coin-heatmap i.lv1 { background: rgba(255,143,178,.25); }
.coin-heatmap i.lv2 { background: rgba(255,120,160,.48); }
.coin-heatmap i.lv3 { background: rgba(255,100,145,.72); }
.coin-heatmap i.lv4 { background: var(--pink); box-shadow: 0 0 8px rgba(255,143,178,.5); }
.coin-h-legend i.lv1 { background: rgba(255,143,178,.25); }
.coin-h-legend i.lv2 { background: rgba(255,120,160,.48); }
.coin-h-legend i.lv3 { background: rgba(255,100,145,.72); }
.coin-h-legend i.lv4 { background: var(--pink); }

/* ---------- 零钱统计：支出排行 ---------- */
.coin-rank-item .rank-pts b { color: var(--pink); }

/* 本月卡片是"领 + 花"两行，缩小字号避免 34px 大字换行拥挤 */
.s-card b#cbMonth { font-size: 19px; line-height: 1.65; }

/* 零钱欠款条（和星星欠款条分开，各还各的） */
/* 不跟星星欠款条抢 sticky 位置：星星条吸顶，零钱条随页面滚走，避免两条重叠 */
.coin-debt {
  position: relative; top: auto;
  background: linear-gradient(135deg, rgba(255,215,110,.20), rgba(127,227,195,.16));
  border-color: rgba(255,215,110,.5);
}

/* ---------- 日间主题：子导航与零钱适配 ---------- */
body.day .subbar { background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.78)); border-bottom: 1px solid rgba(35,64,92,.08); }
body.day .subtab.active { color: #c47f00; border-color: rgba(255,185,61,.6); background: linear-gradient(135deg, rgba(255,215,110,.40), rgba(255,185,61,.25)); }

/* ---------- 家长设置入口（⚙️，紧挨音效按钮左侧） ---------- */
.settings-btn { right: 46px; font-size: 16px; }

/* ---------- 家长设置面板（⚙️ 弹窗） ---------- */
.panel-block {
  text-align: left; margin-top: 14px; padding-top: 14px;
  border-top: 1px dashed var(--card-brd);
}
.panel-label { font-size: 13.5px; color: var(--ink); margin-bottom: 4px; }
.panel-sub { font-size: 12px; color: var(--ink-dim); line-height: 1.5; margin-bottom: 2px; min-height: 18px; }
.panel-go { flex: none; width: 100%; margin-top: 12px; padding: 11px; font-size: 15px; }
.panel-version { margin-top: 14px; font-size: 11.5px; color: var(--ink-dim); opacity: .8; text-align: center; }
