/* ================================================================
   成长手帐 · 样式
   主题：lavender（默认）/ sakura / mint / night（深色）
   ================================================================ */

:root, [data-theme="lavender"] {
  --bg: #f6f3fb;
  --dot: #e4ddf1;
  --card: #ffffff;
  --ink: #2e2a3a;
  --muted: #8a849a;
  --line: #ece7f4;
  --accent: #8b6fd6;
  --accent-ink: #ffffff;
  --accent-2: #f39ac1;
  --soft: #f0eafc;
  --partial: #ffc978;
  --partial-ink: #5a3d00;
  --rest: #9fb4e6;
  --empty: #ebe7f2;
  --zero: #cbc5d6;
  --note: #fff5d6;
  --note-ink: #4a3d1a;
  --shadow: 0 6px 20px rgba(90, 60, 160, .08);
  color-scheme: light;
}
[data-theme="sakura"] {
  --bg: #fff5f7; --dot: #f9dfe6; --ink: #3a2a30; --muted: #9a8189; --line: #f6e4e9;
  --accent: #ec7aa1; --accent-2: #ffb36b; --soft: #ffe8ef;
  --partial: #ffd27a; --rest: #a9c3ef; --empty: #f5e9ec; --zero: #d8c6cc;
  --note: #fff1dc; --shadow: 0 6px 20px rgba(200, 80, 120, .08);
}
[data-theme="mint"] {
  --bg: #f1faf7; --dot: #d6eee6; --ink: #22332f; --muted: #7c918b; --line: #e1f0eb;
  --accent: #36ae93; --accent-2: #ffa98a; --soft: #dcf3ec;
  --partial: #ffd27a; --rest: #9fbde8; --empty: #e5f1ed; --zero: #c3d3ce;
  --note: #fffbe0; --shadow: 0 6px 20px rgba(30, 120, 100, .08);
}
[data-theme="soda"] {
  --bg: #f2f9ff; --dot: #d9eaf8; --ink: #1f2d3a; --muted: #7a8c9c; --line: #e0edf7;
  --accent: #3a9ad9; --accent-2: #f5b21b; --soft: #e1f0fb;
  --partial: #ffd27a; --rest: #a7b8e8; --empty: #e6eff6; --zero: #c4d3df;
  --note: #fff8d6; --shadow: 0 6px 20px rgba(40, 120, 190, .09);
}
[data-theme="galaxy"] {
  --bg: #120f24; --dot: #221c40; --card: #1c1736; --ink: #f3eeff; --muted: #a59fca; --line: #2e2752;
  --accent: #ff8fc8; --accent-ink: #1c1736; --accent-2: #8fd3ff; --soft: #33264f;
  --partial: #f2c46b; --partial-ink: #2a1d00; --rest: #8fa4e6; --empty: #2a2449; --zero: #5b5585;
  --note: #2d2550; --note-ink: #f6f0ff; --shadow: 0 6px 22px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
[data-theme="night"] {
  --bg: #17152b; --dot: #26233f; --card: #221f3b; --ink: #ece9ff; --muted: #a19cc4; --line: #322e52;
  --accent: #a990ff; --accent-ink: #17152b; --accent-2: #ff9ccf; --soft: #2f2952;
  --partial: #e8b86a; --partial-ink: #2a1d00; --rest: #7f95d6; --empty: #2d2a4a; --zero: #5d5880;
  --note: #3a3456; --note-ink: #f3eeff; --shadow: 0 6px 20px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  /* 自动滚动（聚焦输入框等）时，不要把内容藏到悬浮导航栏后面 */
  scroll-padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 1024px) { html { scroll-padding-bottom: 0; scroll-padding-top: 96px; } }
body {
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1.2px, transparent 1.2px);
  background-size: 20px 20px;
  color: var(--ink);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}
.num, .total b, .kpi b, .dad-total b, .cal-d, .greet-date, .page-title, .strip-day b, .hist-bar b {
  font-family: Nunito, ui-rounded, "SF Pro Rounded", -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:active:not(:disabled) { transform: scale(.96); }
h1, h3, h4 { margin: 0; }
h3 { font-size: 16px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
h4 { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; font-weight: 400; }
.mt { margin-top: 16px; }
.center { text-align: center; }
.boot { min-height: 100vh; display: grid; place-items: center; font-size: 32px; color: var(--accent); animation: spin 1.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ================= 外壳：手机 = 悬浮底部导航 ================= */
.nav {
  position: fixed; z-index: 10;
  left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  height: 64px; display: flex; justify-content: space-around; align-items: center;
  background: color-mix(in srgb, var(--card) 86%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow);
  padding: 0 6px;
}
.brand, .me-chip { display: none; }
.tabs { flex: 1; display: flex; justify-content: space-around; align-items: center; gap: 2px; }
.nav-btn {
  flex: 1; height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: none; border: 0; border-radius: 16px; color: var(--muted); font-size: 11px; font-weight: 600;
}
.nav-btn svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-btn.on { color: var(--accent); background: var(--soft); }
.nav-btn.wide-only { display: none; }

/* 我的（昵称 + 主题色） */
.me-chip {
  align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--card);
  border-radius: 99px; padding: 4px 14px 4px 4px; height: 40px; font-weight: 700; font-size: 13.5px;
}
.me-swatch {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--accent) 0 50%, var(--accent-2) 50% 100%);
}
.me-name { max-width: 8em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-logout { display: block; margin: 4px auto 0; color: var(--muted); }

/* 大手机横屏 / iPad 竖屏：底部标签栏居中，6 个全显示 */
@media (min-width: 600px) {
  .nav { left: 50%; right: auto; width: min(560px, calc(100% - 24px)); transform: translateX(-50%); }
  .nav-btn.wide-only { display: flex; }
}
.main {
  padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(100px + env(safe-area-inset-bottom, 0px));
  max-width: 1280px; margin: 0 auto;
}
.page-title { font-size: 26px; font-weight: 900; margin: 4px 0 14px; letter-spacing: .5px; }

/* ================= 通用组件 ================= */
.card {
  background: var(--card); border-radius: 22px; padding: 18px;
  margin-bottom: 14px; box-shadow: var(--shadow); border: 1px solid var(--line);
}
.btn {
  border: 1.5px solid var(--line); background: var(--card); border-radius: 14px;
  padding: 10px 18px; min-height: 46px; font-weight: 600;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; border-style: dashed; color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.btn.small { min-height: 38px; padding: 6px 14px; font-size: 13.5px; }
.btn.block { width: 100%; margin-bottom: 14px; }
.link { background: none; border: 0; color: var(--accent); padding: 4px; font-weight: 600; }
.icon-btn {
  width: 38px; height: 38px; flex: none; border-radius: 12px;
  border: 0; background: var(--soft); color: var(--accent); font-size: 18px; line-height: 1; font-weight: 700;
}
.icon-btn.lg { width: 44px; height: 44px; font-size: 22px; border-radius: 14px; }
.icon-btn:disabled { opacity: .35; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-between h3 { margin: 0; }

input, textarea {
  width: 100%; border: 1.5px solid var(--line); background: var(--bg); border-radius: 14px;
  padding: 11px 14px; outline: none; resize: vertical;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .7; }
input:focus, textarea:focus { border-color: var(--accent); background: var(--card); }
label { display: block; font-size: 13.5px; color: var(--muted); margin-bottom: 10px; font-weight: 600; }
label input, label textarea { margin-top: 6px; color: var(--ink); font-weight: 400; }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }

/* 分段按钮 */
.seg { display: flex; gap: 8px; }
.seg-btn {
  flex: 1; min-height: 46px; border-radius: 14px; border: 1.5px solid var(--line);
  background: var(--card); color: var(--ink); font-weight: 600;
  transition: background .15s, border-color .15s, color .15s;
}
.seg-btn.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.seg-btn.zero.on { background: var(--zero); border-color: var(--zero); color: var(--ink); }

/* ================= 今天页：问候头部 ================= */
.greet { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; }
.greet-text { flex: 1; min-width: 0; }
.greet-hello { font-size: 14px; color: var(--muted); font-weight: 600; }
.greet-date { font-size: 30px; font-weight: 900; line-height: 1.15; letter-spacing: .5px; }
.greet-date small { font-size: 15px; font-weight: 700; color: var(--muted); margin-left: 6px; }
.greet-sub { font-size: 12.5px; color: var(--muted); }
.theme-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 0; flex: none;
  background: conic-gradient(var(--accent) 0 50%, var(--accent-2) 50% 100%);
  box-shadow: 0 0 0 3px var(--card), var(--shadow);
}
.day-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -4px 0 14px; }
.day-nav-mid { display: flex; align-items: center; gap: 4px; }
.day-nav-mid .btn { min-height: 36px; padding: 4px 14px; }
.cal-sheet .calendar { box-shadow: none; border: 0; padding: 0; margin-bottom: 10px; }
.cal-sheet .legend { margin: 0 0 14px; justify-content: center; }
.day-nav .icon-btn { width: auto; height: 36px; padding: 0 14px; font-size: 13.5px; }
.today-tag {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 12px; font-weight: 700; background: var(--accent-2); color: #fff;
  padding: 2px 9px; border-radius: 99px; vertical-align: middle; letter-spacing: 0;
}
.today-tag.future { background: var(--soft); color: var(--accent); }

/* 本周贴纸条 */
.strip { display: flex; gap: 6px; }
.strip-day {
  flex: 1; min-width: 0; border-radius: 16px; border: 0; background: var(--card);
  padding: 7px 0 8px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 11.5px; color: var(--muted); box-shadow: var(--shadow);
}
.strip-day b { font-size: 15px; color: var(--ink); line-height: 1.2; }
.sticker { font-size: 17px; line-height: 1; height: 18px; display: inline-flex; align-items: center; }
.st-done .sticker    { color: var(--accent); }
.st-partial .sticker { color: var(--partial); }
.st-rest .sticker    { color: var(--rest); }
.st-started .sticker { color: var(--muted); }
.st-empty .sticker   { color: var(--empty); }
.strip-day.sel { background: var(--accent); color: var(--accent-ink); }
.strip-day.sel b, .strip-day.sel .sticker { color: var(--accent-ink); }
.strip-day.today:not(.sel) { box-shadow: inset 0 0 0 2px var(--accent); }
.strip-day.future { opacity: .6; }
.rec-strip { margin-bottom: 14px; }

/* 昨天的留言：便利贴 */
.note-card {
  position: relative; background: var(--note); color: var(--note-ink);
  border-radius: 6px 18px 18px 18px; padding: 14px 16px 14px 18px; margin: 4px 4px 16px;
  transform: rotate(-.8deg); box-shadow: var(--shadow);
}
.note-card::before {
  content: ''; position: absolute; top: -9px; left: 22px; width: 54px; height: 18px;
  background: color-mix(in srgb, var(--accent-2) 55%, transparent); border-radius: 3px; transform: rotate(-4deg);
}
.note-card .note-from { font-size: 12px; opacity: .7; font-weight: 700; display: block; }
.note-card .note-text { font-size: 15px; font-weight: 600; }

.ro-banner { background: var(--soft); color: var(--accent); padding: 10px 14px; border-radius: 14px; margin-bottom: 14px; font-size: 13.5px; font-weight: 600; }

/* 日期类型 + 心情 */
.type-seg { margin-bottom: 14px; }
.type-seg .seg-btn { min-height: 54px; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.type-seg .seg-btn .emo { font-size: 19px; }

.hint { color: var(--muted); text-align: center; padding: 26px 18px; }
.hint .emo { font-size: 30px; display: block; margin-bottom: 4px; }
.rest-card { display: flex; gap: 16px; align-items: center; background: linear-gradient(135deg, var(--soft), var(--card)); }
.rest-card p { margin: 2px 0 0; }
.rest-moon { font-size: 40px; color: var(--rest); }

/* 计划卡头部 */
.plan-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.plan-head .link { flex: none; margin-top: -2px; }

/* 周计划页 */
.planner-tip { margin: -4px 0 12px; }
.planner-copy { margin-bottom: 14px; }
.planner { display: grid; gap: 0 14px; }
.pday { padding: 14px 16px; }
.pday-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.pday-head b { font-size: 15px; }
.pday-open { margin-left: auto; }
.pday.is-today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.pday.past { background: color-mix(in srgb, var(--card) 60%, var(--bg)); box-shadow: none; }
.mini-seg { margin-bottom: 10px; gap: 6px; }
.mini-seg .seg-btn { min-height: 34px; font-size: 13px; border-radius: 11px; }
.pday-rest { margin: 4px 0 0; }
.pday-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 14px; overflow-wrap: anywhere; }
.pday-list li.done { color: var(--muted); }

/* 想搞定的事 */
.plan-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.plan-row .check { margin-top: 8px; }
.plan-row .icon-btn { margin-top: 4px; }
.check {
  width: 30px; height: 30px; flex: none; border-radius: 50%; border: 2px solid var(--zero);
  background: var(--card); color: var(--accent-ink); font-weight: 900; font-size: 15px; line-height: 1;
  transition: all .18s;
}
.check.on { background: var(--accent); border-color: var(--accent); animation: pop .3s; }
.plan-input {
  border-color: transparent; background: var(--bg);
  resize: none; overflow: hidden; min-height: 46px; line-height: 1.5;
  overflow-wrap: anywhere; field-sizing: content;
}
.plan-input.done { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--accent-2); text-decoration-thickness: 2px; }
@keyframes pop { 50% { transform: scale(1.25); } }

/* 打分 */
.score-block { margin-bottom: 10px; }
.score-row { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.score-label { width: 84px; flex: none; display: flex; align-items: center; gap: 4px; font-weight: 700; font-size: 14.5px; white-space: nowrap; }
.score-label .emo { font-size: 16px; }
.score-seg { flex: 1; gap: 6px; }
.score-seg .seg-btn { min-height: 44px; font-size: 13.5px; padding: 0 2px; }
.tip-btn {
  width: 20px; height: 20px; border-radius: 50%; border: 0; background: var(--soft);
  color: var(--accent); font-size: 11px; font-weight: 800; padding: 0; flex: none;
}
.tip-btn.on { background: var(--accent); color: var(--accent-ink); }
.tip-panel {
  background: var(--soft); border-radius: 14px; padding: 10px 12px; margin: 4px 0 10px 82px;
  font-size: 13px; display: grid; gap: 4px;
  margin-left: 0;
}
.tip-panel b { display: inline-block; min-width: 48px; color: var(--accent); }
.score-desc { margin: 0 0 6px 94px; font-size: 12.5px; color: var(--accent); display: flex; flex-wrap: wrap; gap: 2px 10px; }
.score-hint { color: var(--muted); }
.score-hint::before { content: '· '; }

/* 打分：每项一行，分段胶囊，颜色随分数由浅到深 */
.score-item {
  display: grid; grid-template-columns: 76px minmax(0, 1fr); grid-template-areas: "name pill" ". sub";
  align-items: center; column-gap: 12px; row-gap: 4px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.score-item:first-of-type { padding-top: 2px; }
.score-name { display: contents; }
.score-name b { grid-area: name; display: flex; align-items: center; gap: 6px; font-size: 15px; white-space: nowrap; }
.score-name .emo { font-size: 16px; }
.score-sub { grid-area: sub; font-size: 12px; color: var(--muted); line-height: 1.4; padding-left: 4px; }
.score-sub.set { color: var(--ink); opacity: .75; }
.score-sub.is-hint { color: var(--accent); opacity: 1; }
.pill-seg {
  grid-area: pill; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px;
  background: var(--bg); border-radius: 14px; padding: 4px;
}
.pill {
  height: 38px; border: 0; border-radius: 11px; background: transparent;
  color: var(--muted); font-size: 13.5px; font-weight: 600; white-space: nowrap;
  transition: background .15s, color .15s, box-shadow .15s;
}
.pill.on { font-weight: 800; }
.lv0 .pill.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, .08); }
.lv1 .pill.on { background: color-mix(in srgb, var(--accent) 22%, var(--card)); color: var(--accent); }
.lv2 .pill.on { background: var(--accent); color: var(--accent-ink); box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 35%, transparent); }


/* 分数圆环 + 达成印章 */
.summary {
  position: relative; display: flex; align-items: center; gap: 16px; margin-top: 16px; padding: 14px 16px;
  border-radius: 18px; background: var(--bg); overflow: hidden;
}
.ring { width: 66px; height: 66px; flex: none; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { fill: none; stroke: var(--empty); stroke-width: 7; }
.ring .bar { fill: none; stroke: var(--accent); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset .4s ease; }
.ring .total { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; line-height: 1; }
.ring .total b { font-size: 22px; font-weight: 900; }
.ring .total span { font-size: 10px; color: var(--muted); }
.badge-wrap { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.badge { font-weight: 700; }
.stamp {
  display: inline-block; align-self: flex-start; font-weight: 900; font-size: 17px; letter-spacing: 1px;
  color: var(--accent-2); border: 2.5px solid var(--accent-2); border-radius: 10px; padding: 2px 12px;
  transform: rotate(-6deg);
}
.summary.ok { background: var(--soft); }
.summary.celebrate .stamp { animation: stamp .5s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes stamp { from { transform: scale(2.2) rotate(-18deg); opacity: 0; } to { transform: scale(1) rotate(-6deg); opacity: 1; } }
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti i {
  position: absolute; top: -10px; width: 8px; height: 12px; border-radius: 2px; opacity: 0;
  animation: fall 1.4s ease-out forwards;
}
@keyframes fall {
  0% { opacity: 1; transform: translateY(0) rotate(0); }
  100% { opacity: 0; transform: translateY(130px) rotate(540deg); }
}

/* 结果区：今天的贴纸是主角，分数退到角落 */
.today-sticker {
  width: 62px; height: 62px; flex: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; line-height: 1; color: var(--zero); background: var(--card);
  border: 2px dashed var(--zero);
}
.today-sticker.got {
  color: #fff; border: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 40%, transparent);
}
.summary.celebrate .today-sticker.got { animation: pop .5s; }
.mini-score { flex: none; align-self: flex-start; font-size: 13px; font-weight: 800; color: var(--muted); font-family: Nunito, ui-rounded, sans-serif; }
.mini-score small { font-size: 10px; font-weight: 700; }

/* 本月星星数 */
.star-chip {
  margin-top: 6px; border: 0; border-radius: 99px; padding: 4px 12px;
  background: color-mix(in srgb, var(--accent-2) 18%, var(--card)); color: var(--accent-2);
  font-size: 12.5px; font-weight: 800;
}
.star-hero {
  display: flex; align-items: center; gap: 14px; margin: -4px 0 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 14px 18px; box-shadow: var(--shadow);
}
.star-hero b { font-size: 34px; font-weight: 900; font-family: Nunito, ui-rounded, sans-serif; color: var(--accent); }
.star-big {
  width: 54px; height: 54px; border-radius: 50%; flex: none; color: #fff; font-size: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

/* 宽限提醒、爸爸的回复 */
.ro-banner.grace { background: color-mix(in srgb, var(--partial) 25%, var(--card)); color: var(--partial-ink); }
.nudge {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; margin-bottom: 14px;
  border: 0; border-radius: 16px; padding: 11px 16px; font-weight: 700; font-size: 14px;
  background: color-mix(in srgb, var(--partial) 25%, var(--card)); color: var(--partial-ink);
}
.nudge span { margin-left: auto; font-size: 18px; }
.reply-card { transform: rotate(.6deg); background: color-mix(in srgb, var(--accent) 14%, var(--card)); color: var(--ink); }
.reply-card::before { background: color-mix(in srgb, var(--accent) 55%, transparent); }
.reply-actions { display: flex; gap: 16px; margin-top: 6px; }
.reply-actions .muted { color: var(--muted); }

/* 首屏：一行状态条 + 最多一张提醒 */
.status-bar {
  display: inline-flex; align-items: center; gap: 0; margin-top: 8px; max-width: 100%;
  border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 5px 4px;
  font-size: 12.5px; color: var(--muted); font-weight: 600; box-shadow: var(--shadow);
}
.status-bar > span { padding: 0 10px; white-space: nowrap; }
.status-bar > span + span { border-left: 1px solid var(--line); }
.status-bar b { color: var(--accent); font-size: 14px; font-weight: 900; font-family: Nunito, ui-rounded, sans-serif; }
.status-bar .ice { font-style: normal; margin-left: 4px; color: var(--rest); }
.yesterday-note {
  margin: -4px 0 12px; padding: 8px 12px; border-radius: 6px 12px 12px 12px;
  background: var(--note); color: var(--note-ink); font-size: 13px; overflow-wrap: anywhere;
}
.yesterday-note b { font-weight: 700; }
.dad-turn { position: relative; padding: 0; }
.dad-turn-main { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; background: none; padding: 12px 44px 12px 16px; }
.dad-turn-main > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.nudge-wrap { position: relative; }
.nudge-wrap .nudge { padding-right: 44px; }
.notice-x {
  position: absolute; top: 50%; right: 8px; transform: translateY(-50%);
  width: 28px; height: 28px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); font-size: 16px;
}
.reply-card { position: relative; }

/* 每周拿满 6 颗的额外奖励 */
.week-line { display: block; margin-top: 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.week-line.done { color: var(--accent-2); }
.unlock.bonus { border-color: var(--partial); }
.cal-cell { position: relative; }
.cal-bonus {
  position: absolute; top: 3px; right: 4px; font-size: 10px; font-weight: 900; line-height: 1;
  color: #fff; background: var(--accent-2); border-radius: 99px; padding: 2px 4px;
}

/* 贴纸墙 */
.wall { padding: 16px 14px 14px; }
.wall-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.wall-title { flex: 1; text-align: center; display: flex; flex-direction: column; }
.wall-title b { font-size: 18px; font-weight: 900; }
.wall-title span { font-size: 13px; color: var(--muted); font-weight: 600; }
.wall-title em { font-style: normal; font-size: 20px; font-weight: 900; color: var(--accent); font-family: Nunito, ui-rounded, sans-serif; }
.wall-back { display: block; margin: 0 auto 4px; }
.wall-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)) minmax(40px, .9fr); gap: 6px; margin-top: 10px; }
.wall-h { text-align: center; font-size: 12px; color: var(--muted); font-weight: 700; padding-bottom: 2px; }
.wall-cell {
  position: relative; aspect-ratio: 1; min-width: 0; border: 0; padding: 0; border-radius: 14px;
  background: var(--bg); display: flex; align-items: center; justify-content: center;
}
.wall-cell.out { background: transparent; }
.wall-cell.quiet { background: transparent; }
.wall-cell.quiet .wall-d { opacity: .45; }
.wall-cell.today { box-shadow: inset 0 0 0 2px var(--accent-2); }
.wall-d { position: absolute; top: 3px; left: 6px; font-size: 10.5px; font-weight: 800; color: var(--muted); font-family: Nunito, ui-rounded, sans-serif; }
.wall-sticker {
  width: 66%; height: 66%; margin-top: 10%; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: clamp(15px, 4.6vw, 32px); line-height: 1;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .14), 0 0 0 2.5px #fff;
}
.wall-cell.done { background: color-mix(in srgb, var(--accent) 8%, var(--bg)); }
.wall-mark { font-size: clamp(14px, 3.2vw, 26px); line-height: 1; margin-top: 10%; }
.wall-mark.rest { color: var(--rest); }
.wall-mark.partial { color: var(--partial); }
.wall-bonus {
  position: absolute; right: 2px; bottom: 2px; font-size: 9.5px; font-weight: 900; line-height: 1;
  color: #fff; background: var(--accent-2); border-radius: 99px; padding: 2px 4px;
}
.wall-week {
  border-radius: 14px; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 10.5px; color: var(--muted); text-align: center; line-height: 1.2; min-width: 0;
}
.wall-week { position: relative; }
.wall-week b { font-size: 15px; color: var(--ink); font-family: Nunito, ui-rounded, sans-serif; }
.wall-week .wk-stars { font-size: 13px; color: var(--accent); }
.wall-week .wk-bonus { color: var(--accent-2); font-weight: 900; font-size: 12px; }
.wk-ring { width: 78%; max-width: 46px; transform: rotate(-90deg); }
.wk-ring .track { fill: none; stroke: var(--empty); stroke-width: 4; }
.wk-ring .bar { fill: none; stroke: var(--accent-2); stroke-width: 4; stroke-linecap: round; }
.wk-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 13px; color: var(--ink); font-family: Nunito, ui-rounded, sans-serif; }
.wk-num small { font-size: 9px; color: var(--muted); }
.wall-week.blank { background: transparent; }
.wall-week.now { background: color-mix(in srgb, var(--accent-2) 10%, var(--bg)); }
.wall-week b small { font-size: 10px; color: var(--muted); }
.wall-week i { font-style: normal; font-size: 9.5px; color: var(--accent); font-weight: 700; }
.wall-week.done { background: linear-gradient(160deg, color-mix(in srgb, var(--accent-2) 25%, var(--card)), var(--card)); }
.wall-set { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.set-item { font-size: 20px; line-height: 1; filter: grayscale(1); opacity: .28; transition: all .2s; }
.set-item.got { filter: none; opacity: 1; }
.next-goals { display: grid; gap: 8px; margin: -4px 0 14px; }
.next-goal {
  display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 10px 14px; font-size: 14px; box-shadow: var(--shadow);
}
.next-goal b { color: var(--accent); font-size: 16px; font-family: Nunito, ui-rounded, sans-serif; }
.ng-icon { font-size: 20px; }
@media (min-width: 768px) { .next-goals { grid-template-columns: 1fr 1fr; } }
.cash-how { font-size: 13px; }
.cash-how summary { cursor: pointer; color: var(--accent); font-weight: 700; list-style: none; }
.cash-how summary::-webkit-details-marker { display: none; }
.cash-how summary::before { content: '› '; }
.cash-how[open] summary::before { content: '⌄ '; }
.cash-how .cash-steps { margin-top: 6px; }
@media (min-width: 1024px) {
  /* 电脑：左边贴纸墙，右边零花钱账本（跟着滚动） */
  .wall-page { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 22px; align-items: start; }
  .wall-side { position: sticky; top: 96px; }
  .wall { padding: 20px 22px; }
  .wall-grid { gap: 8px; grid-template-columns: repeat(7, minmax(0, 1fr)) minmax(64px, .9fr); }
  .wall-sticker { width: 66%; height: 66%; margin-top: 8%; }
  .wall-d { font-size: 12px; top: 6px; left: 9px; }
  .wall-sticker { font-size: 34px; }
  .wall-mark { font-size: 28px; }
  .wall-week { font-size: 12px; }
  .wall-week b { font-size: 22px; }
}

/* 星星换零花钱 */
.cash-locked { display: grid; gap: 8px; }
.cash-progress { height: 8px; border-radius: 99px; background: var(--empty); overflow: hidden; }
.cash-progress i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.cash-locked-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13.5px; }
.cash-locked-row b { font-size: 18px; color: var(--accent); font-family: Nunito, ui-rounded, sans-serif; }
.cash-locked-row .btn:disabled { opacity: .5; cursor: not-allowed; }
.cash-why { margin: 0; font-size: 13px; color: var(--ink); }
.cash-why b { color: var(--accent); }
.cash-steps { margin: 0; padding: 10px 12px 10px 30px; background: var(--bg); border-radius: 12px; font-size: 12.5px; color: var(--muted); display: grid; gap: 2px; }
.cash-frozen { flex-basis: 100%; font-size: 12.5px; font-weight: 700; color: var(--rest); }
.pill.blocked { opacity: .35; cursor: not-allowed; }
.pill.blocked:active { transform: none; }
.cash-balance { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.cash-balance > div { background: var(--bg); border-radius: 14px; padding: 8px 12px; display: flex; flex-direction: column; min-width: 0; }
.cash-balance > div.cash-main {
  grid-column: 1 / -1; flex-direction: row; align-items: baseline; gap: 10px; flex-wrap: wrap;
  background: var(--soft); padding: 12px 14px;
}
.cash-balance b { font-size: 17px; font-weight: 900; color: var(--ink); font-family: Nunito, ui-rounded, sans-serif; }
.cash-balance .cash-main b { font-size: 30px; color: var(--accent); }
.cash-list-title { margin: 14px 0 0; }
.cash-list { max-height: 320px; overflow-y: auto; }
.cash-no { flex: none; width: 28px; color: var(--muted); font-size: 12px; font-weight: 700; }
.cash-pick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cash-pick .mini-seg { margin: 0; flex: 1; min-width: 180px; }
.cash-hint { margin: 8px 0 0; }
.btn.danger { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.cash-list { margin-top: 6px; border-top: 1px solid var(--line); }
.cash-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.cash-date { flex: none; width: 64px; color: var(--muted); }
.cash-amt { flex: 1; font-weight: 700; }
.cash-st { flex: none; font-size: 12.5px; font-weight: 700; color: var(--accent-2); }
.cash-st.done { color: var(--muted); }
.cash-total { margin: 10px 0 0; }

/* 星星愿望单 */
.wish-line {
  display: block; margin-top: 6px; border: 0; background: none; padding: 0;
  font-size: 12.5px; font-weight: 700; color: var(--accent); text-align: left;
}
.wish-line.ready { color: var(--accent-2); }
.wish-head { margin-bottom: 10px; }
.wish-head h3 { margin: 0; }
.wish { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.wish-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.wish-main b { font-size: 14.5px; overflow-wrap: anywhere; }
.wish-bar { height: 8px; border-radius: 99px; background: var(--empty); overflow: hidden; }
.wish-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .4s; }
.wish.waiting { background: color-mix(in srgb, var(--accent) 8%, transparent); border-radius: 12px; padding-inline: 10px; }
.wish-balance { font-size: 13px; font-weight: 700; color: var(--muted); }
.wish-balance b { font-size: 20px; color: var(--accent); font-family: Nunito, ui-rounded, sans-serif; }
.wish.ready { background: color-mix(in srgb, var(--accent-2) 10%, transparent); border-radius: 12px; padding-inline: 10px; }
.wish-right { flex: none; display: flex; align-items: center; gap: 6px; }
.wish-status { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.wish-form { margin-top: 14px; display: grid; gap: 8px; }
.wish-form-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wish-form-row .mini-seg { margin: 0; flex: 1; min-width: 200px; }
.wish-form p { margin: 0; }
.wish-done-list { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.wish-emoji { font-size: 26px; }

/* 周末：轮到她给爸爸打分 */
.dad-turn {
  display: block; width: 100%; text-align: left;
  border: 1.5px dashed color-mix(in srgb, var(--accent) 50%, transparent); background: var(--card);
  border-radius: 18px; padding: 0; margin-bottom: 14px; position: relative;
}
.dad-turn-emo { font-size: 26px; }
.dad-turn-go { font-size: 22px; color: var(--accent); font-weight: 800; }

/* 达成后：顶部金色贴纸 + 打分卡里的一行 */
.day-star {
  display: inline-flex; align-items: center; gap: 2px; vertical-align: middle; margin-left: 4px;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 12px; font-weight: 800; letter-spacing: 0;
  color: #5a3d00; background: linear-gradient(135deg, #ffe08a, #ffc04d); border-radius: 99px; padding: 2px 10px;
  box-shadow: 0 2px 8px rgba(255, 176, 40, .35);
}
.summary-done {
  display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 10px 14px; border-radius: 14px;
  background: var(--soft);
}
.summary-done .mini-star { color: var(--accent-2); font-size: 20px; line-height: 1; }
.summary-done b { font-size: 14px; }
.summary-done .mini-score { margin-left: auto; align-self: center; }
.bump { animation: bump .6s cubic-bezier(.2, 1.8, .4, 1); }
@keyframes bump { 40% { transform: scale(1.18); } }

/* 全屏庆祝 */
.celebrate-mask {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: color-mix(in srgb, var(--bg) 55%, rgba(20, 12, 40, .55));
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  animation: fade .25s ease-out;
}
.celebrate-mask .confetti { position: fixed; }
.celebrate-mask .confetti i { top: -16px; height: 14px; animation-name: fall-far; }
@keyframes fall-far {
  0% { opacity: 1; transform: translateY(0) rotate(0); }
  85% { opacity: 1; }
  100% { opacity: 0; transform: translateY(105vh) rotate(720deg); }
}
.celebrate-box {
  position: relative; width: min(320px, 100%); text-align: center; padding: 34px 24px 20px;
  background: var(--card); border-radius: 28px; box-shadow: 0 20px 60px rgba(40, 20, 90, .35);
  animation: pop-in .55s cubic-bezier(.2, 1.6, .4, 1);
}
@keyframes pop-in { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.burst {
  position: absolute; left: 50%; top: 74px; width: 220px; height: 220px; margin: -110px 0 0 -110px; border-radius: 50%;
  background: repeating-conic-gradient(color-mix(in srgb, var(--accent-2) 35%, transparent) 0 10deg, transparent 10deg 30deg);
  -webkit-mask: radial-gradient(circle, #000 30%, transparent 70%); mask: radial-gradient(circle, #000 30%, transparent 70%);
  animation: spin 6s linear infinite;
}
.big-star {
  position: relative; width: 104px; height: 104px; margin: 0 auto 12px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 60px; line-height: 1; color: #fff;
  background: linear-gradient(135deg, #ffd25e, var(--accent-2));
  box-shadow: 0 8px 30px color-mix(in srgb, var(--accent-2) 55%, transparent);
  animation: star-in .8s cubic-bezier(.2, 1.7, .4, 1) .1s both;
}
@keyframes star-in { from { transform: scale(0) rotate(-180deg); } to { transform: scale(1) rotate(0); } }
.celebrate-box h2 { position: relative; margin: 0; font-size: 26px; font-weight: 900; letter-spacing: 1px; }
.celebrate-sub { position: relative; margin: 4px 0 0; color: var(--muted); font-weight: 700; }
.celebrate-extra { position: relative; margin: 10px 0 0; font-weight: 800; color: var(--accent-2); }
.celebrate-theme { position: relative; margin-top: 14px; display: inline-flex; align-items: center; gap: 8px; }
.celebrate-theme .swatch { width: 22px; height: 22px; }
.celebrate-tap { position: relative; display: block; margin-top: 16px; font-size: 12px; color: var(--muted); }

/* 我的目标 */
.goal-line {
  display: block; margin-top: 6px; border: 0; background: none; padding: 0; text-align: left;
  font-size: 13px; font-weight: 700; color: var(--ink);
}
.goal-line b { color: var(--accent-2); font-family: Nunito, ui-rounded, sans-serif; font-size: 15px; }
.goal-row { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.goal-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.goal-main b { overflow-wrap: anywhere; }
.goal-form { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.goal-form input[data-g="title"] { flex: 1 1 200px; }
.goal-form input[data-g="date"] { flex: 0 1 160px; }

/* 待攻克清单 */
.due-block { border: 1.5px solid color-mix(in srgb, var(--accent) 35%, var(--line)); }
.due-block h4 { margin-bottom: 8px; }
.due-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; flex-wrap: wrap; }
.due-item + .due-item { border-top: 1px solid var(--line); }
.due-text { flex: 1 1 160px; min-width: 0; font-weight: 600; overflow-wrap: anywhere; display: flex; flex-direction: column; }
.due-text small { font-weight: 400; font-size: 12px; }
.abc { display: flex; gap: 6px; flex: none; }
.abc-btn {
  border: 1.5px solid var(--line); background: var(--card); border-radius: 12px; padding: 5px 10px;
  font-size: 12.5px; display: flex; align-items: center; gap: 4px; color: var(--ink);
}
.abc-btn b { font-family: Nunito, ui-rounded, sans-serif; }
.abc-btn.abc-A { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); color: var(--accent); }
.abc-btn.abc-B { border-color: color-mix(in srgb, var(--partial) 70%, var(--line)); color: var(--partial-ink); }
.abc-btn.abc-C { border-color: color-mix(in srgb, var(--rest) 70%, var(--line)); color: var(--rest); }
.abc-help { margin: 10px 0 0; }
.struggle-box { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.struggle-label { flex-basis: 100%; font-size: 14px; font-weight: 700; }
.struggle-label .small { color: var(--muted); font-weight: 400; }
.struggle-chip {
  display: inline-flex; align-items: center; gap: 4px; background: var(--note); color: var(--note-ink);
  border-radius: 99px; padding: 3px 4px 3px 12px; font-size: 13px; font-weight: 600; overflow-wrap: anywhere;
}
.struggle-chip button { border: 0; background: none; color: inherit; opacity: .6; font-size: 14px; padding: 0 6px; }
.struggle-add { display: flex; gap: 8px; flex-basis: 100%; }
.struggle-add input { flex: 1; }
.struggle-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.lv-dot {
  width: 26px; height: 26px; flex: none; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; background: var(--empty); color: var(--muted); font-family: Nunito, ui-rounded, sans-serif;
}
.lv-dot.lv-A { background: var(--accent); color: var(--accent-ink); }
.lv-dot.lv-B { background: var(--partial); color: var(--partial-ink); }
.lv-dot.lv-C { background: var(--rest); color: #fff; }
.conquer-kpis { grid-template-columns: repeat(3, 1fr) !important; }
.conquer-kpis small { display: block; color: var(--accent-2); font-weight: 700; }
.mastered { display: flex; flex-wrap: wrap; gap: 6px; }
.mastered-chip { background: var(--soft); color: var(--accent); border-radius: 99px; padding: 3px 12px; font-size: 13px; font-weight: 600; }
.conquer-sum { background: var(--soft); border-radius: 12px; padding: 8px 12px; font-size: 13.5px; margin-top: 10px; }

/* 反思：便利贴风格 */
.reflect-grid { display: grid; gap: 4px 14px; }

/* 今天页：窄屏一列 ①②③；宽屏左右两栏（见 1100px 断点） */
.day-grid { display: flex; flex-direction: column; }
.col-a, .col-b { display: contents; }
.slot-plan { order: 1; }
.slot-reflect { order: 2; }
.slot-score { order: 3; }
.plan-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.reflect label { color: var(--ink); font-size: 14px; font-weight: 700; }
.reflect label .small { color: var(--muted); }
.reflect textarea { background: var(--note); color: var(--note-ink); border-color: transparent; border-radius: 6px 16px 16px 16px; }
.reflect textarea:focus { border-color: var(--accent-2); }

/* ================= 日历 ================= */
.cal-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.cal-nav b { flex: 1; text-align: center; font-size: 17px; font-weight: 800; }
.cal-nav .link { flex: none; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-h { text-align: center; font-size: 12px; color: var(--muted); font-weight: 700; }
.cal-cell {
  aspect-ratio: 1; border-radius: 14px; border: 0; background: var(--bg); padding: 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
}
.cal-cell.out { background: transparent; }
.cal-d { font-size: 13px; font-weight: 800; color: var(--muted); }
.cal-t { font-size: 11px; color: var(--muted); font-weight: 700; }
.cal-cell .sticker { font-size: 18px; height: 20px; }
.calendar.compact .cal-cell .sticker { font-size: 14px; height: 15px; }
.calendar.compact .cal-grid { gap: 4px; }
.calendar.compact .cal-cell { border-radius: 10px; }
.cal-cell.st-done { background: var(--soft); }
.cal-cell.today { box-shadow: inset 0 0 0 2px var(--accent-2); }
.cal-cell.sel { background: var(--accent); }
.cal-cell.sel .cal-d, .cal-cell.sel .cal-t, .cal-cell.sel .sticker { color: var(--accent-ink); }
.cal-cell.future { opacity: .55; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); margin: -4px 4px 14px; }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.legend .sticker { font-size: 14px; height: 15px; }

.record-side { display: none; }

/* ================= 标题 + 翻页胶囊 ================= */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin: 4px 0 14px; }
.page-head .page-title { margin: 0; }
.pager { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.page-head .pager { margin: 0; }
.pill-pager {
  display: flex; align-items: center; gap: 2px; background: var(--card); border: 1px solid var(--line);
  border-radius: 99px; padding: 4px; box-shadow: var(--shadow); min-width: 0;
}
.pp-btn {
  width: 36px; height: 36px; flex: none; border: 0; border-radius: 50%; background: var(--soft);
  color: var(--accent); font-size: 18px; font-weight: 800; line-height: 1;
}
.pager-title { display: flex; flex-direction: column; align-items: center; padding: 0 12px; min-width: 0; line-height: 1.25; }
.pager-title b { font-size: 15px; font-weight: 800; white-space: nowrap; }
.pager-title span { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.today-btn { flex: none; }
/* 手机：标题一行，翻页胶囊撑满下一行（右上角留给“我的”按钮） */
@media (max-width: 767px) {
  .page-head { padding-right: 52px; }
  .page-head .pager { flex-basis: calc(100% + 52px); margin-right: -52px; }
  .page-head .pill-pager { flex: 1; justify-content: space-between; }
}

/* ================= 复盘 / 统计 ================= */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--card); border-radius: 18px; padding: 12px 14px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.kpi span { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.kpi b { font-size: 28px; font-weight: 900; }
.kpi small { font-size: 13px; color: var(--muted); font-weight: 600; }

.rate-bar { position: relative; height: 14px; background: var(--empty); border-radius: 99px; margin: 20px 0 14px; }
.rate-fill { height: 100%; border-radius: 99px; background: var(--partial); transition: width .4s; }
.rate-fill.ok { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.rate-ref { position: absolute; top: -6px; bottom: -6px; border-left: 2px dashed var(--muted); }
.rate-ref span { position: absolute; top: -19px; left: -14px; font-size: 11px; color: var(--muted); font-weight: 700; }

.steps { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.step-no {
  width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  font-size: 12px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800;
}
.notes { display: grid; gap: 8px; max-height: 260px; overflow: auto; }
.note { background: var(--note); color: var(--note-ink); border-radius: 6px 14px 14px 14px; padding: 8px 12px; font-size: 13.5px; }
.note .muted { color: inherit; opacity: .7; }
.know-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.small-seg { flex: none; gap: 4px; }
.small-seg .seg-btn { width: 40px; min-height: 40px; flex: none; }
.seg-btn.lv-A.on { background: var(--accent); border-color: var(--accent); }
.seg-btn.lv-B.on { background: var(--partial); border-color: var(--partial); color: var(--partial-ink); }
.seg-btn.lv-C.on { background: var(--rest); border-color: var(--rest); color: #fff; }
.lv { display: inline-flex; width: 24px; height: 24px; border-radius: 8px; align-items: center; justify-content: center; color: #fff; font-weight: 800; }
.lv-A { background: var(--accent); } .lv-B { background: var(--partial); color: var(--partial-ink); } .lv-C { background: var(--rest); }

/* 复盘：本周完成率 */
.week-sum .ws-main { display: flex; align-items: baseline; gap: 10px; }
.week-sum .ws-main b { font-size: 34px; font-weight: 900; color: var(--accent); font-family: Nunito, ui-rounded, sans-serif; }
.week-sum .ws-main span { font-size: 14px; font-weight: 700; color: var(--muted); }
.week-sum .ws-detail { margin: 4px 0 0; font-size: 13.5px; }
.week-sum .ws-detail b { font-family: Nunito, ui-rounded, sans-serif; }
.week-sum .ws-note { margin: 4px 0 0; }

/* 复盘：进度 + 一张记录卡 */
.rv-progress h3 { margin-bottom: 8px; }
.rv-steps { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 4px; }
.rv-step {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: none;
  padding: 7px 8px; border-radius: 12px; font-size: 14px; color: var(--ink);
}
.rv-step:hover { background: var(--bg); }
.rv-dot {
  width: 24px; height: 24px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; border: 1.5px solid var(--line); color: var(--muted); font-family: Nunito, ui-rounded, sans-serif;
}
.rv-step.done { color: var(--muted); }
.rv-step.done .rv-dot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.rv-done { display: flex; flex-direction: column; align-items: center; gap: 0; margin: 0; min-height: 52px; }
.rv-done small { font-size: 12px; font-weight: 600; opacity: .8; }
.rv-done.confirm { border-color: var(--accent-2) !important; color: var(--accent-2) !important; background: color-mix(in srgb, var(--accent-2) 10%, var(--card)) !important; }
.rv-done:not(.primary) { border: 1.5px solid var(--accent); color: var(--accent); background: var(--soft); }
.rv-record h3 { margin-bottom: 4px; }
.rv-block { padding: 14px 0; border-top: 1px solid var(--line); scroll-margin-top: 110px; }
.rv-block:first-of-type { border-top: 0; }
.rv-block h4 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; font-size: 15px; }
.rv-block textarea.grow { resize: none; overflow: hidden; min-height: 64px; }
.rv-notes { display: grid; gap: 6px; max-height: 240px; overflow: auto; margin-bottom: 10px; }
.rv-note { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 13.5px; background: var(--note); color: var(--note-ink); border-radius: 6px 12px 12px 12px; padding: 7px 12px; }
.rv-note b { font-size: 12.5px; }
.rv-note .muted { color: inherit; opacity: .7; }
.rv-sub { margin: 14px 0 8px; font-weight: 700; font-size: 14px; }
.rv-dad { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--bg); border-radius: 14px; padding: 10px 14px; }
.rv-dad-main { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; font-size: 14px; }
.rv-dad-main b { font-size: 24px; font-weight: 900; color: var(--accent); font-family: Nunito, ui-rounded, sans-serif; }
.rv-dad-main small { color: var(--muted); margin-left: -8px; }

/* 上周定的改进 */
.rv-last { background: var(--soft); border-radius: 14px; padding: 12px 14px; margin: 6px 0 4px; }
.rv-last-label { font-size: 13px; font-weight: 700; color: var(--accent); }
.rv-last-text { margin: 4px 0 10px; font-size: 14px; overflow-wrap: anywhere; white-space: pre-wrap; }
.rv-last .mini-seg { margin: 0; }

/* 手机：先看数据和做复盘，最后才是进度和“标记已复盘” */
@media (max-width: 1023px) {
  .review-layout { display: flex; flex-direction: column; }
  .review-left, .review-right { display: contents; }
  .week-sum { order: 1; }
  .week-table { order: 2; }
  .rv-record { order: 3; }
  .rv-progress { order: 4; }
}

/* 复盘：本周一览 */
.wt { width: 100%; border-collapse: collapse; font-size: 13px; }
.wt th { text-align: left; font-weight: 700; color: var(--muted); font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.wt th span { display: inline-block; width: 22px; text-align: center; }
.wt td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.wt tbody tr[data-act] { cursor: pointer; }
.wt tbody tr[data-act]:hover { background: var(--bg); }
.wt tr.wt-future td { opacity: .45; }
.wt tr.wt-empty td, .wt tr.wt-future td { padding-top: 5px; padding-bottom: 5px; font-size: 12.5px; }
.wt tr.wt-empty .wt-day b, .wt tr.wt-future .wt-day b { display: inline; margin-right: 6px; font-size: 12.5px; }
.wt-day { white-space: nowrap; }
.wt-day b { display: block; font-size: 13.5px; }
.wt-day span { font-size: 11.5px; color: var(--muted); margin-right: 4px; }
.wt-type { display: inline-block; font-size: 10.5px !important; font-weight: 700; padding: 0 6px; border-radius: 99px; background: var(--soft); color: var(--accent) !important; }
.wt-type.t-繁忙 { background: color-mix(in srgb, var(--partial) 35%, var(--card)); color: var(--partial-ink) !important; }
.wt-type.t-休息 { color: var(--rest) !important; }
.wt-plans { min-width: 140px; }
.wt-plan { display: block; overflow-wrap: anywhere; line-height: 1.45; }
.wt-plan.done { color: var(--muted); }
.wt-scores { white-space: nowrap; }
.wt-s {
  display: inline-flex; width: 20px; height: 20px; margin-right: 2px; border-radius: 6px; align-items: center; justify-content: center;
  font-style: normal; font-size: 11px; font-weight: 800; font-family: Nunito, ui-rounded, sans-serif;
}
.wt-s.s0 { background: var(--empty); color: var(--muted); }
.wt-s.s1 { background: color-mix(in srgb, var(--accent) 25%, var(--card)); color: var(--accent); }
.wt-s.s2 { background: var(--accent); color: var(--accent-ink); }
.wt-s.sx { background: transparent; color: var(--muted); border: 1px dashed var(--line); }
.wt-total { white-space: nowrap; font-weight: 800; font-family: Nunito, ui-rounded, sans-serif; }
.wt-star { color: var(--accent-2); }
.wt-legend { margin: 8px 0 0; }
/* 手机：每天两行——上面计划，下面五项 + 总分 */
@media (max-width: 599px) {
  .wt thead { display: none; }
  .wt, .wt tbody { display: block; }
  .wt tr { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; grid-template-areas: "day plans plans" "day scores total"; border-bottom: 1px solid var(--line); padding: 8px 0; }
  .wt td { border: 0; padding: 2px 4px; }
  .wt-day { grid-area: day; }
  .wt-plans { grid-area: plans; min-width: 0; }
  .wt-scores { grid-area: scores; padding-top: 6px !important; }
  .wt-total { grid-area: total; padding-top: 6px !important; align-self: center; }
  .wt td[colspan] { grid-column: 2 / -1; }
  .wt-s { width: 22px; height: 22px; }
  .wt-day .wt-type { display: block; width: fit-content; margin-top: 3px; }
  .wt tr.wt-empty, .wt tr.wt-future { grid-template-columns: auto 1fr; grid-template-areas: none; column-gap: 12px; padding: 4px 0; align-items: center; }
  .wt tr.wt-empty .wt-day, .wt tr.wt-future .wt-day { grid-area: auto; grid-column: 1; grid-row: 1; }
  .wt tr.wt-empty td[colspan], .wt tr.wt-future td[colspan] { grid-column: 2; grid-row: 1; }
}

/* ================= 爸爸 ================= */
.dad-card header { margin-bottom: 14px; }
.dad-total b { font-size: 26px; font-weight: 900; }
.dad-total span { color: var(--muted); }
.prev-fb { background: var(--note); color: var(--note-ink); border-radius: 6px 14px 14px 14px; padding: 8px 12px; margin-bottom: 14px; font-size: 13.5px; }
.prev-fb .muted { color: inherit; opacity: .7; }
.dad-card .score-label { width: 76px; }
.score-seg .seg-btn { white-space: nowrap; }
.hist { display: flex; gap: 6px; align-items: stretch; height: 150px; }
.hist-bar {
  flex: 1; min-width: 0; position: relative; border: 0; border-radius: 14px; background: var(--bg);
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding: 0 0 4px; overflow: hidden;
}
.hist-fill { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(0deg, var(--accent), var(--accent-2)); opacity: .35; }
.hist-bar b, .hist-bar small { position: relative; }
.hist-bar small { font-size: 10.5px; color: var(--muted); }
.hist-bar.sel { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ================= 总览 ================= */
.ov-now { margin: -6px 0 12px; color: var(--muted); font-size: 14px; font-weight: 600; }
.ov-range { margin-bottom: 14px; max-width: 420px; }
.ov-range .seg-btn { min-height: 38px; font-size: 14px; border-radius: 12px; }
.trend, .items { display: grid; gap: 10px; }
.tr-row { display: grid; grid-template-columns: 84px 1fr 64px; gap: 10px; align-items: center; }
.tr-label b, .tr-val b { display: block; font-size: 14px; }
.tr-label small, .tr-val small { display: block; font-size: 11.5px; color: var(--muted); }
.tr-val { text-align: right; }
.tr-bar { position: relative; height: 12px; background: var(--empty); border-radius: 99px; }
.tr-fill { height: 100%; border-radius: 99px; background: var(--partial); }
.tr-fill.ok { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.tr-fill.it { background: var(--accent); opacity: .75; }
.tr-ref { position: absolute; left: 80%; top: -4px; bottom: -4px; border-left: 2px dashed var(--muted); opacity: .6; }
.it-row { display: grid; grid-template-columns: 92px 1fr 104px; gap: 10px; align-items: center; font-size: 14px; }
.it-val { display: flex; gap: 6px; align-items: baseline; justify-content: flex-end; white-space: nowrap; }
.it-val .up { color: var(--accent); font-size: 12px; font-weight: 700; }
.it-val .down { color: var(--partial-ink); font-size: 12px; font-weight: 700; }
.it-val .same { color: var(--muted); font-size: 12px; }
.it-val em { font-style: normal; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 99px; background: color-mix(in srgb, var(--partial) 35%, var(--card)); color: var(--partial-ink); }
.it-row.weak .tr-fill.it { background: var(--partial); opacity: 1; }
.ov-cash { font-size: 13.5px; font-weight: 600; background: var(--bg); border-radius: 12px; padding: 8px 12px; margin: 0 0 6px; }
.wk-tbl td { white-space: nowrap; }
.wk-range { display: block; font-size: 11.5px; }
.wk-tbl + .btn, .table-wrap + .btn { margin-top: 10px; }
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-weight: 700; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 8px; border-bottom: 1px solid var(--line); }
.tbl tbody tr[data-act] { cursor: pointer; }
.tbl tbody tr[data-act]:hover { background: var(--bg); }
.tbl.rules td { min-width: 120px; }
.timeline { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.timeline b { display: inline-block; min-width: 64px; }
.timeline li.past { color: var(--muted); }
.boundary { background: var(--bg); border-radius: 14px; padding: 10px 12px; font-size: 13.5px; margin: 0 0 12px; }

/* 手机：非“今天”页右上角的“我的”按钮（电脑上用导航栏里的昵称） */
.me-float {
  position: fixed; z-index: 15; top: calc(14px + env(safe-area-inset-top, 0px)); right: 16px;
  width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: conic-gradient(var(--accent) 0 50%, var(--accent-2) 50% 100%);
  box-shadow: 0 0 0 3px var(--card), var(--shadow);
}
@media (min-width: 1024px) { .me-float { display: none; } }
.dad-ro-note { margin: 8px 0 0; }
textarea[readonly] { background: var(--bg); color: var(--muted); }

/* ================= 主题与昵称面板 ================= */
.sheet-mask {
  position: fixed; inset: 0; z-index: 30; background: rgba(20, 16, 40, .35);
  display: flex; align-items: flex-end; justify-content: center; animation: fade .2s;
}
.sheet {
  width: 100%; max-width: 460px; background: var(--card); color: var(--ink);
  border-radius: 26px 26px 0 0; padding: 22px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  animation: up .25s ease-out;
}
@media (min-width: 768px) { .sheet-mask { align-items: center; } .sheet { border-radius: 26px; } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.theme-opt {
  border: 2px solid var(--line); background: var(--card); border-radius: 18px; padding: 10px 4px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700;
}
.theme-opt.on { border-color: var(--accent); color: var(--accent); }
.swatch { width: 38px; height: 38px; border-radius: 50%; position: relative; display: inline-flex; align-items: center; justify-content: center; }
.theme-opt.locked { opacity: .55; cursor: default; border-style: dashed; }
.theme-opt.locked .swatch { filter: grayscale(.6); }
.theme-opt.locked i { font-style: normal; font-size: 15px; }
.theme-opt small { font-size: 11px; color: var(--muted); font-weight: 700; }
.unlock {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; margin-top: 12px;
  border: 1.5px solid var(--accent-2); background: var(--card); border-radius: 16px; padding: 10px 14px;
  animation: pop .5s;
}
.unlock > span:last-child { display: flex; flex-direction: column; }

/* ================= 登录 ================= */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; padding: 30px 26px; text-align: center; }
.login-card h1 { font-size: 24px; font-weight: 900; margin: 10px 0 4px; }
.login-card label { text-align: left; margin-top: 14px; }
.login-card .btn { width: 100%; margin-top: 18px; }
.login-card .btn + .btn { margin-top: 10px; }
.login-card code { background: var(--bg); padding: 1px 5px; border-radius: 4px; }
.demo-note { margin: 14px 0 0; padding: 8px 10px; border-radius: 12px; font-size: 13px; font-weight: 700; background: color-mix(in srgb, var(--partial) 30%, var(--card)); color: var(--partial-ink); }
.test-tag {
  display: inline-block; margin: 4px 0 8px; padding: 3px 12px; border-radius: 99px;
  background: var(--note); color: var(--note-ink); font-size: 12.5px; font-weight: 700;
}
.err { color: #d0567a; font-size: 13.5px; min-height: 1em; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 13px; color: #fff; font-size: 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: inline-flex; align-items: center; justify-content: center; font-weight: 900;
}
.brand.big { display: block; }
.brand.big .brand-mark { width: 60px; height: 60px; font-size: 28px; border-radius: 20px; }

.save-status {
  position: fixed; top: calc(12px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); z-index: 20; white-space: nowrap;
  padding: 6px 14px; border-radius: 99px; font-size: 12.5px; font-weight: 700;
  background: var(--card); color: var(--muted); box-shadow: var(--shadow); border: 1px solid var(--line);
}
/* 电脑上顶部是导航栏：保存提示放到右下角 */
@media (min-width: 1024px) {
  .save-status { top: auto; bottom: 20px; left: auto; right: 24px; transform: none; }
}
.save-status.saved { color: var(--accent); }
.save-status.error { color: #d0567a; }
.save-status.warn { color: var(--partial-ink); background: color-mix(in srgb, var(--partial) 30%, var(--card)); }

/* ================= iPad 竖屏起：内容加宽 ================= */
@media (min-width: 768px) {
  .narrow-only { display: none; }
  .main { padding-inline: 28px; }
  .page-title { font-size: 30px; }
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .record-main { max-width: 720px; margin: 0 auto; }
  .reflect-grid { grid-template-columns: 1fr 1fr; }
  .dad-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 0 14px; align-items: start; }
}

/* ================= iPad 横屏 / 电脑：顶部悬浮导航条 ================= */
@media (min-width: 1024px) {
  .nav {
    top: calc(12px + env(safe-area-inset-top, 0px)); bottom: auto;
    width: min(1180px, calc(100% - 32px)); height: 62px;
    justify-content: space-between; gap: 12px; padding: 0 10px 0 14px;
  }
  .brand { display: flex; align-items: center; gap: 10px; flex: none; }
  .brand-mark { width: 34px; height: 34px; font-size: 16px; border-radius: 11px; }
  .brand-text { font-weight: 800; font-size: 15px; }
  .tabs { flex: none; gap: 4px; }
  .nav-btn { flex: none; flex-direction: row; gap: 7px; height: 42px; padding: 0 16px; font-size: 14px; border-radius: 14px; }
  .nav-btn svg { width: 19px; height: 19px; }
  .me-chip { display: flex; flex: none; }
  .theme-btn { display: none; }
  .main { padding: calc(100px + env(safe-area-inset-top, 0px)) 32px 48px; max-width: 1180px; }
  .review-layout { display: grid; grid-template-columns: 340px 1fr; gap: 22px; align-items: start; }
  .review-left { position: sticky; top: 96px; }
  .review-left .kpis { grid-template-columns: repeat(2, 1fr); }
  .planner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cal-page { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); gap: 22px; align-items: start; }
  .cal-page-side .kpis { grid-template-columns: repeat(2, 1fr); }
  .overview-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 0 14px; align-items: start; }
}

/* 电脑宽屏：今天页加宽为两栏，打分卡在右侧固定 */
@media (min-width: 1100px) {
  .record-main { max-width: 1100px; }
  /* 日期 | 本周贴纸条 | 翻页，合成一行 */
  .day-head {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "greet strip nav"; gap: 28px; align-items: center; margin-bottom: 16px;
  }
  .day-head .greet { grid-area: greet; margin: 0; }
  .day-head .rec-strip { grid-area: strip; margin: 0; }
  .day-head .day-nav { grid-area: nav; margin: 0; gap: 8px; }
  .day-head .day-nav .icon-btn { width: 40px; height: 40px; padding: 0; font-size: 20px; }
  .day-head .nav-txt { display: none; }
  .day-head .day-nav-mid { flex-direction: column; gap: 2px; }
  .day-grid { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 0 18px; align-items: start; }
  .col-a, .col-b { display: block; }
  .col-b { position: sticky; top: 96px; }
}

@media (min-width: 1280px) {
  .planner { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
