/* 宝宝喂养日记 · v2 视觉
   温暖象牙底 + 每类记录一种柔和点缀色；长辈友好：正文 ≥20px，主按钮 ≥72px，图标 + 文字 */

:root {
  --bg: #F6F1EA;
  --bg-2: #EFE8DE;
  --card: #FFFFFF;
  --ink: #2A2420;
  --ink-2: #5E554E;
  --ink-3: #8A8077;
  --line: #E9E1D6;
  --line-2: #F1EBE3;

  --feed: #C8664A;   --feed-bg: #FBEDE6;   --feed-deep: #A9503A;
  --diaper: #B67A1E; --diaper-bg: #FAF0DC; --diaper-deep: #8F5F14;
  --sleep: #5A61B0;  --sleep-bg: #ECEDF8;  --sleep-deep: #454B92;
  --other: #3F8570;  --other-bg: #E3F0EA;  --other-deep: #2F6A58;

  --teal: #2E6B5F;
  --teal-2: #3D8775;
  --danger: #B5412F;

  --r-xl: 28px;
  --r-lg: 22px;
  --r-md: 16px;
  --sh-1: 0 1px 2px rgba(60, 40, 20, .05), 0 2px 8px rgba(60, 40, 20, .04);
  --sh-2: 0 1px 2px rgba(60, 40, 20, .06), 0 8px 24px -6px rgba(60, 40, 20, .12);
  --sh-3: 0 2px 6px rgba(30, 20, 10, .08), 0 24px 48px -12px rgba(30, 20, 10, .28);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans CJK SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 20px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
[hidden] { display: none !important; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
input:focus-visible, textarea:focus-visible, button:focus-visible { outline: 3px solid rgba(46, 107, 95, .35); outline-offset: 2px; }

.ic {
  width: 24px; height: 24px; flex: none;
  stroke: currentColor; fill: none; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}

#app { max-width: 560px; margin: 0 auto; }
.view { padding: 0 18px; }

/* 色调工具类 */
.tone-feed   { --c: var(--feed);   --cb: var(--feed-bg);   --cd: var(--feed-deep); }
.tone-diaper { --c: var(--diaper); --cb: var(--diaper-bg); --cd: var(--diaper-deep); }
.tone-sleep  { --c: var(--sleep);  --cb: var(--sleep-bg);  --cd: var(--sleep-deep); }
.tone-other  { --c: var(--other);  --cb: var(--other-bg);  --cd: var(--other-deep); }

/* ---------- 通用按钮 ---------- */
.btn-primary, .btn-secondary, .btn-danger-ghost {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 72px; border-radius: 20px;
  font-size: 22px; font-weight: 700; letter-spacing: .02em;
  transition: transform .12s var(--ease), box-shadow .2s, background .2s;
}
.btn-primary .ic, .btn-secondary .ic, .btn-danger-ghost .ic { width: 26px; height: 26px; stroke-width: 2.1; }
.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #D4775A 0%, var(--feed) 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 10px 22px -10px rgba(168, 80, 58, .7);
}
.btn-primary.btn-teal, #voice-submit, #confirm-yes {
  background: linear-gradient(180deg, var(--teal-2) 0%, var(--teal) 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .2) inset, 0 10px 22px -10px rgba(30, 80, 70, .75);
}
.btn-secondary {
  color: var(--ink); background: var(--card);
  box-shadow: 0 0 0 1.5px var(--line) inset;
}
.btn-danger-ghost {
  color: var(--danger); background: transparent;
  box-shadow: 0 0 0 1.5px rgba(181, 65, 47, .28) inset;
}
.btn-primary:active, .btn-secondary:active, .btn-danger-ghost:active, .big-btn:active,
.quick-grid4 button:active, .quick-grid3 button:active, .chip:active, .seg-btn:active,
.swatch:active, .tl-edit:active, .pill-btn:active, .stepper button:active, .temp-row button:active,
.timer-btn:active, .sheet-close:active, #undo-btn:active { transform: scale(.97); }

/* ---------- 欢迎页 ---------- */
#view-welcome { padding-top: 40px; padding-bottom: 40px; }
.welcome-head { text-align: center; margin-bottom: 22px; }
.brand-mark {
  width: 76px; height: 76px; margin: 0 auto 16px; border-radius: 24px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(145deg, #DE876A, var(--feed) 60%, #B4573E);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .3) inset, 0 14px 30px -12px rgba(168, 80, 58, .8);
}
.brand-mark .ic { width: 40px; height: 40px; stroke-width: 1.7; }
.welcome-head h1 { margin: 0; font-size: 32px; font-weight: 800; letter-spacing: .04em; }
.welcome-head .sub { margin: 6px 0 0; color: var(--ink-2); font-size: 18px; }

.seg {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px;
  padding: 5px; border-radius: 20px; background: var(--bg-2);
  box-shadow: 0 1px 2px rgba(60, 40, 20, .06) inset;
}
.seg-btn {
  min-height: 60px; border-radius: 16px; padding: 0 6px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 19px; font-weight: 600; color: var(--ink-2);
  transition: background .2s, color .2s, box-shadow .2s, transform .12s;
}
.seg-btn .ic { width: 22px; height: 22px; }
.seg-btn.selected { background: var(--card); color: var(--ink); box-shadow: var(--sh-1); }
.welcome-seg { margin-bottom: 16px; }
.welcome-seg .seg-btn { font-size: 18px; }

.card { background: var(--card); border-radius: var(--r-xl); box-shadow: var(--sh-2); }
.form-card { padding: 24px 20px 22px; }
.form-card h2 { margin: 0; font-size: 24px; font-weight: 800; }
.card-sub { margin: 4px 0 18px; color: var(--ink-3); font-size: 17px; line-height: 1.45; }
.field { display: block; margin: 0 0 16px; }
.field > span {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 8px; font-size: 18px; font-weight: 600; color: var(--ink-2);
}
.field > span .ic { width: 20px; height: 20px; color: var(--ink-3); }
.field input, .field textarea, .note-row input {
  width: 100%; min-height: 60px; padding: 0 18px;
  border: 1.5px solid var(--line); border-radius: 16px;
  background: #FCFAF7; font-size: 21px; color: var(--ink);
  transition: border-color .2s, box-shadow .2s, background .2s;
  -webkit-appearance: none; appearance: none;
}
.field input:focus, .note-row input:focus, #voice-text:focus {
  outline: none; border-color: var(--teal-2); background: #fff;
  box-shadow: 0 0 0 4px rgba(61, 135, 117, .14);
}
input::placeholder, textarea::placeholder { color: #B3A99F; }
.code-input { text-align: center; letter-spacing: .5em; font-size: 30px !important; font-weight: 700; padding-left: calc(18px + .5em) !important; }
.form-card .btn-primary { margin-top: 6px; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.role-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.chip {
  min-height: 56px; padding: 0 14px; border-radius: 16px;
  background: #FCFAF7; box-shadow: 0 0 0 1.5px var(--line) inset;
  font-size: 20px; font-weight: 600; color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .2s, color .2s, box-shadow .2s, transform .12s;
}
.role-chips .chip { padding: 0 4px; }
.chip.selected {
  background: var(--ink); color: #fff;
  box-shadow: 0 6px 14px -8px rgba(42, 36, 32, .8);
}

/* ---------- 主界面 ---------- */
#view-main { padding-bottom: 120px; }
.tab-page { padding-top: 14px; animation: fadeUp .35s var(--ease); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.home-head { display: flex; align-items: center; gap: 14px; padding: 10px 2px 18px; }
.avatar {
  width: 58px; height: 58px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-size: 26px; font-weight: 800; color: #fff;
  background: linear-gradient(145deg, #E9A184, var(--feed));
  box-shadow: 0 0 0 3px #fff, 0 6px 16px -6px rgba(168, 80, 58, .7);
}
.home-id { flex: 1; min-width: 0; }
.baby-name { font-size: 28px; font-weight: 800; line-height: 1.2; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.baby-age { font-size: 17px; color: var(--ink-2); margin-top: 2px; }
.pill-btn {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  min-height: 48px; padding: 0 16px; border-radius: 999px;
  background: var(--card); box-shadow: var(--sh-1), 0 0 0 1px var(--line-2) inset;
  font-size: 18px; font-weight: 600; color: var(--ink);
  transition: transform .12s;
}
.pill-btn .ic { width: 22px; height: 22px; color: var(--ink-2); }

/* 语音大按钮：全页最醒目 */
.voice-btn {
  position: relative; overflow: hidden;
  width: 100%; min-height: 132px; padding: 22px 22px;
  display: flex; align-items: center; gap: 20px; text-align: left;
  border-radius: var(--r-xl); color: #fff;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(255, 255, 255, .16) 0%, rgba(255, 255, 255, 0) 55%),
    linear-gradient(150deg, #3F8B79 0%, var(--teal) 55%, #245A50 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 18px 36px -16px rgba(30, 80, 70, .85);
  transition: transform .15s var(--ease), box-shadow .2s;
}
.voice-btn::after {
  content: ""; position: absolute; right: -40px; bottom: -60px; width: 180px; height: 180px; border-radius: 50%;
  background: rgba(255, 255, 255, .06);
}
.voice-btn:active { transform: scale(.985); }
.voice-orb {
  position: relative; z-index: 1;
  width: 84px; height: 84px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: #fff; color: var(--teal);
  box-shadow: 0 8px 18px -6px rgba(0, 0, 0, .35);
}
.voice-orb .ic { width: 40px; height: 40px; stroke-width: 2; }
.voice-orb::before {
  content: ""; position: absolute; inset: -8px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35);
}
.voice-btn.listening .voice-orb::before { animation: pulse 1.4s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(.9); opacity: 1; } 100% { transform: scale(1.35); opacity: 0; } }
#voice-btn-label { position: relative; z-index: 1; font-size: 28px; font-weight: 800; line-height: 1.3; letter-spacing: .03em; }
#voice-btn-label em { font-style: normal; font-size: 18px; font-weight: 500; opacity: .85; letter-spacing: 0; }

.voice-fallback {
  margin-top: 12px; padding: 18px; border-radius: var(--r-lg);
  background: var(--card); box-shadow: var(--sh-2);
}
.vf-head { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.vf-head .ic { color: var(--teal); }
#voice-text {
  width: 100%; min-height: 96px; padding: 14px 16px; resize: none;
  border: 1.5px solid var(--line); border-radius: 16px; background: #FCFAF7; font-size: 22px; line-height: 1.45;
}
.vf-hint { display: flex; align-items: center; gap: 6px; margin: 8px 2px 14px; font-size: 17px; color: var(--ink-3); }
.vf-hint .ic { width: 20px; height: 20px; }

/* 距上次喂奶 主卡 */
.hero-card {
  margin-top: 16px; padding: 20px 20px 20px 18px;
  display: flex; align-items: center; gap: 18px;
  border-radius: var(--r-xl); background: var(--card); box-shadow: var(--sh-2);
  --c: var(--feed); --cb: var(--feed-bg);
}
.hero-card.warn { --c: #C0482F; background: linear-gradient(180deg, #FFF9F6, #fff); box-shadow: var(--sh-2), 0 0 0 1.5px rgba(192, 72, 47, .25) inset; }
.ring-wrap { position: relative; width: 104px; height: 104px; flex: none; }
.ring { width: 104px; height: 104px; display: block; }
.ring-track { fill: none; stroke: var(--cb); stroke-width: 10; }
.ring-bar { fill: none; stroke: var(--c); stroke-width: 10; stroke-linecap: round; transition: stroke-dasharray .6s var(--ease); }
.ring-icon {
  position: absolute; inset: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--cb); color: var(--c);
}
.ring-icon .ic { width: 32px; height: 32px; }
.hero-card .status-text { display: flex; flex-direction: column; min-width: 0; }
.hero-label { font-size: 17px; font-weight: 600; color: var(--ink-3); letter-spacing: .04em; }
.hero-num { font-size: 22px; font-weight: 700; line-height: 1.25; margin: 2px 0 6px; color: var(--ink); }
.hero-num strong { font-size: 40px; font-weight: 800; letter-spacing: -.01em; margin-right: 2px; color: var(--ink); }
.hero-card.warn .hero-num strong { color: #B13F28; }
.status-sub { font-size: 18px; color: var(--ink-2); line-height: 1.4; }
.status-sub.muted { color: var(--ink-3); font-size: 17px; }
.hero-tip.soft { background: var(--feed-bg); color: var(--feed-deep); }
.hero-tip {
  align-self: flex-start; margin-top: 8px; padding: 4px 12px; border-radius: 999px;
  background: #FBE5DE; color: #A23A25; font-size: 17px; font-weight: 600;
}

.status-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.status-card {
  display: flex; flex-direction: column; gap: 10px; min-width: 0;
  padding: 16px 16px 16px; border-radius: var(--r-lg);
  background: var(--card); box-shadow: var(--sh-1);
}
.status-card.diaper { --c: var(--diaper); --cb: var(--diaper-bg); }
.status-card.sleep { --c: var(--sleep); --cb: var(--sleep-bg); }
.status-card.sleep.active { background: linear-gradient(160deg, #5F66B5, #464C93); color: #fff; box-shadow: 0 14px 28px -14px rgba(69, 75, 146, .9); }
.status-card.sleep.active .status-icon { background: rgba(255, 255, 255, .18); color: #fff; }
.status-card.sleep.active .mini-label, .status-card.sleep.active .status-sub { color: rgba(255, 255, 255, .82); }
.status-card.sleep.active b { color: #fff; }
.status-icon {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  background: var(--cb); color: var(--c);
}
.status-card .status-text { display: flex; flex-direction: column; min-width: 0; }
.mini-label { font-size: 16px; font-weight: 600; color: var(--ink-3); letter-spacing: .03em; }
.status-card b { font-size: 21px; font-weight: 800; line-height: 1.3; margin: 2px 0 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-card .status-sub { font-size: 17px; }

.section-title { margin: 28px 4px 12px; font-size: 21px; font-weight: 800; letter-spacing: .03em; }
.section-row { display: flex; align-items: center; justify-content: space-between; margin: 28px 4px 12px; }
.section-row .section-title { margin: 0; }
.count-pill { font-size: 16px; font-weight: 600; color: var(--ink-2); background: var(--bg-2); padding: 3px 12px; border-radius: 999px; }
.count-pill:empty { display: none; }

/* 快捷 2×2 */
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.big-btn {
  position: relative; min-height: 132px; padding: 76px 16px 14px;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 0;
  text-align: left; border-radius: var(--r-lg);
  background: var(--card); box-shadow: var(--sh-1);
  transition: transform .12s var(--ease), box-shadow .2s;
}
.big-btn.feed { --c: var(--feed); --cb: var(--feed-bg); }
.big-btn.diaper { --c: var(--diaper); --cb: var(--diaper-bg); }
.big-btn.sleep { --c: var(--sleep); --cb: var(--sleep-bg); }
.big-btn.other { --c: var(--other); --cb: var(--other-bg); }
.big-btn .bb-icon {
  position: absolute; top: 14px; left: 14px;
  width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center;
  background: var(--cb); color: var(--c);
}
.big-btn .bb-icon .ic { width: 28px; height: 28px; }
.big-btn > span:not(.bb-icon) { font-size: 23px; font-weight: 800; line-height: 1.25; }
.big-btn em { font-style: normal; font-size: 16px; color: var(--ink-3); line-height: 1.35; margin-top: 2px; }
.big-btn.sleep.active { background: var(--sleep-bg); box-shadow: 0 0 0 1.5px rgba(90, 97, 176, .35) inset; }
.big-btn.sleep.active .bb-icon { background: var(--sleep); color: #fff; }

/* 时间线 */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); position: relative; }
.tl-item {
  position: relative; display: grid; grid-template-columns: 56px 42px minmax(0, 1fr);
  column-gap: 8px; padding-bottom: 12px;
}
.tl-item::before {
  content: ""; position: absolute; left: calc(56px + 8px + 20px); top: 46px; bottom: -2px; width: 2px;
  background: var(--line); border-radius: 2px;
}
.tl-item:last-child::before { display: none; }
.tl-time { text-align: right; padding-top: 6px; line-height: 1.2; }
.tl-time small { display: block; font-size: 15px; color: var(--ink-3); font-weight: 600; }
.tl-time b { display: block; font-size: 20px; font-weight: 800; color: var(--ink); letter-spacing: -.01em; }
.tl-dot {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; margin-top: 4px;
  background: var(--cb); color: var(--c); box-shadow: 0 0 0 4px var(--bg); position: relative; z-index: 1;
}
.tl-item.ongoing .tl-dot { background: var(--c); color: #fff; }
.tl-card {
  min-width: 0; padding: 12px 10px 12px 16px; border-radius: 18px;
  background: var(--card); box-shadow: var(--sh-1);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; align-items: start;
}
.tl-card > .tl-voice, .tl-card > .tl-note { grid-column: 1 / -1; margin-right: 2px; }
.tl-body { flex: 1; min-width: 0; }
.tl-title { font-size: 20px; font-weight: 700; line-height: 1.35; word-break: break-word; }
.tl-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.tl-rel { font-size: 16px; color: var(--ink-3); }
.member-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px 2px 2px; border-radius: 999px;
  background: var(--bg); font-size: 16px; font-weight: 600; color: var(--ink-2);
}
.member-chip i {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-style: normal; font-size: 13px; font-weight: 700; color: #fff; background: var(--mc, #9A8F86);
}
.tone-rose  { --mc: #CF7B6B; --mcb: #F8E6E1; }
.tone-amber { --mc: #C59336; --mcb: #F7EDD8; }
.tone-sage  { --mc: #5E9682; --mcb: #E2EFEA; }
.tone-sky   { --mc: #5B86B8; --mcb: #E3ECF6; }
.tone-plum  { --mc: #8E6BA8; --mcb: #EEE6F4; }
.tone-sand  { --mc: #A08670; --mcb: #F0EAE3; }
.tl-voice, .tl-note {
  display: flex; align-items: flex-start; gap: 6px; margin-top: 8px;
  padding: 6px 10px; border-radius: 12px; background: var(--bg);
  font-size: 17px; color: var(--ink-2); line-height: 1.4; min-width: 0;
}
.tl-voice .ic, .tl-note .ic { width: 18px; height: 18px; margin-top: 2px; color: var(--ink-3); }
.tl-voice span, .tl-note span { min-width: 0; overflow-wrap: anywhere; }
.tl-edit {
  flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 58px; min-height: 58px; border-radius: 14px;
  color: var(--ink-2); font-size: 15px; font-weight: 600;
  background: var(--bg); transition: transform .12s, background .2s;
}
.tl-edit .ic { width: 20px; height: 20px; }

.empty { text-align: center; color: var(--ink-3); padding: 28px 0; }
.empty .ic { width: 44px; height: 44px; stroke-width: 1.4; }
.empty p { margin: 8px 0 0; font-size: 18px; }

/* ---------- 底部 Tab ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  max-width: 560px; margin: 0 auto;
  padding: 8px 14px calc(8px + env(safe-area-inset-bottom));
  background: rgba(252, 249, 245, .86);
  -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
  border-top: 1px solid rgba(233, 225, 214, .9);
}
.tab {
  min-height: 64px; border-radius: 18px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 17px; font-weight: 600; color: var(--ink-3);
  transition: background .2s, color .2s;
}
.tab .ic { width: 26px; height: 26px; }
.tab.active { color: var(--teal); background: rgba(46, 107, 95, .1); }
.tab.active .ic { stroke-width: 2.1; }

/* ---------- 页面头 ---------- */
.page-head { padding: 14px 4px 14px; }
.page-title { margin: 0; font-size: 32px; font-weight: 800; letter-spacing: .03em; }
.page-sub { margin: 2px 0 0; color: var(--ink-2); font-size: 18px; }

/* ---------- 统计 ---------- */
.stat-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile {
  width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; flex: none;
  background: var(--cb); color: var(--c);
}
.tile .ic { width: 24px; height: 24px; }
.stat-hero {
  grid-column: 1 / -1; padding: 18px 18px 18px; border-radius: var(--r-xl);
  background: linear-gradient(160deg, #fff 0%, #FFF8F4 100%); box-shadow: var(--sh-2);
}
.sh-head { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; }
.sh-row { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 14px; }
.sh-cell { padding: 0 6px; }
.sh-cell + .sh-cell { border-left: 1px solid var(--line-2); padding-left: 14px; }
.stat-num { line-height: 1.1; white-space: nowrap; }
.stat-num b { font-size: 34px; font-weight: 800; letter-spacing: -.02em; }
.stat-num small { font-size: 16px; font-weight: 600; color: var(--ink-3); margin: 0 2px 0 3px; }
.stat-label { font-size: 16px; color: var(--ink-2); margin-top: 4px; }
.stat-card { padding: 16px; border-radius: var(--r-lg); background: var(--card); box-shadow: var(--sh-1); }
.stat-card .tile { margin-bottom: 12px; }
.stat-card .stat-num b { font-size: 30px; }

.chart-card { margin-bottom: 12px; padding: 16px 14px 10px; border-radius: var(--r-lg); background: var(--card); box-shadow: var(--sh-1); }
.chart-head { display: flex; align-items: center; gap: 10px; padding: 0 4px; }
.chart-title { flex: 1; font-size: 20px; font-weight: 800; }
.chart-title small { margin-left: 6px; font-size: 16px; font-weight: 600; color: var(--ink-3); }
.chart-avg { text-align: right; line-height: 1.15; }
.chart-avg small { display: block; font-size: 14px; color: var(--ink-3); }
.chart-avg b { font-size: 20px; font-weight: 800; color: var(--cd); }
.chart { display: block; width: 100%; height: auto; margin-top: 6px; overflow: visible; }
.chart .grid { stroke: var(--line-2); stroke-width: 1; }
.chart .avg { stroke: var(--c); stroke-width: 1.4; stroke-dasharray: 4 4; opacity: .55; }
.chart .bar { fill: var(--cb); }
.chart .bar.today { fill: var(--c); }
.chart .bar.zero { fill: var(--line); }
.chart .area { fill: var(--cb); opacity: .9; }
.chart .line { fill: none; stroke: var(--c); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.chart .pt { fill: #fff; stroke: var(--c); stroke-width: 2.4; }
.chart .pt.today { fill: var(--c); }
.chart text { font-family: var(--font); text-anchor: middle; }
.chart .val { font-size: 13px; font-weight: 700; fill: var(--ink-3); }
.chart .val.today { fill: var(--cd); font-size: 15px; }
.chart .xl { font-size: 13px; fill: var(--ink-3); font-weight: 500; }
.chart .xl.today { fill: var(--ink); font-weight: 800; }

/* ---------- 家庭 ---------- */
.invite-card {
  padding: 22px 20px 20px; border-radius: var(--r-xl); text-align: center; color: #fff;
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(255, 255, 255, .14), rgba(255, 255, 255, 0) 55%),
    linear-gradient(150deg, #3F8B79, var(--teal) 60%, #245A50);
  box-shadow: 0 18px 36px -16px rgba(30, 80, 70, .85);
}
.invite-label { display: inline-flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 600; opacity: .9; }
.invite-label .ic { width: 22px; height: 22px; }
.invite-code { display: flex; justify-content: center; gap: 8px; margin: 16px 0 12px; }
.invite-code span {
  width: 44px; height: 60px; border-radius: 14px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .14); box-shadow: 0 0 0 1px rgba(255, 255, 255, .22) inset;
  font-size: 32px; font-weight: 800;
}
.invite-hint { margin: 0 0 16px; font-size: 17px; line-height: 1.5; opacity: .86; }
.invite-card .btn-secondary { background: #fff; color: var(--teal); box-shadow: none; }
.member-list { list-style: none; margin: 0 0 20px; padding: 6px; border-radius: var(--r-lg); background: var(--card); box-shadow: var(--sh-1); }
.member-item { display: flex; align-items: center; gap: 14px; padding: 12px 10px; min-height: 76px; }
.member-item + .member-item { border-top: 1px solid var(--line-2); }
.member-avatar {
  width: 50px; height: 50px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-size: 22px; font-weight: 800; color: var(--mc); background: var(--mcb);
}
.member-info { display: flex; flex-direction: column; min-width: 0; }
.member-name { display: flex; align-items: center; gap: 8px; font-size: 21px; font-weight: 700; }
.member-sub { font-size: 16px; color: var(--ink-3); }
.member-me { font-size: 14px; font-weight: 700; color: var(--teal); background: rgba(46, 107, 95, .12); padding: 1px 9px; border-radius: 999px; }

/* ---------- 底部弹层 ---------- */
#sheet-mask, #confirm-mask {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(32, 24, 18, .42);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  animation: fadeIn .22s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
#sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  max-width: 560px; margin: 0 auto; max-height: 92vh; overflow-y: auto; overscroll-behavior: contain;
  padding: 8px 18px calc(24px + env(safe-area-inset-bottom));
  border-radius: 30px 30px 0 0; background: var(--bg);
  box-shadow: 0 -12px 40px -12px rgba(30, 20, 10, .3);
  transform: translateY(100%); transition: transform .32s var(--ease);
}
#sheet.open { transform: none; }
.sheet-grip { width: 44px; height: 5px; border-radius: 3px; background: #D9CFC3; margin: 2px auto 12px; }
.sheet-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.sheet-icon { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; background: var(--cb); color: var(--c); flex: none; }
.sheet-icon .ic { width: 28px; height: 28px; }
.sheet-title { flex: 1; font-size: 26px; font-weight: 800; letter-spacing: .02em; min-width: 0; }
.sheet-close {
  display: inline-flex; align-items: center; gap: 4px; min-height: 48px; padding: 0 14px 0 10px;
  border-radius: 999px; background: var(--card); box-shadow: var(--sh-1);
  font-size: 18px; font-weight: 600; color: var(--ink-2);
}
.sheet-close .ic { width: 20px; height: 20px; }
.sheet-hint { margin: 20px 4px 10px; font-size: 18px; font-weight: 600; color: var(--ink-2); }
#sheet .seg { margin-bottom: 4px; }
#sheet .seg-btn { font-size: 19px; flex-direction: column; gap: 2px; min-height: 72px; }
#sheet .seg-btn .ic { width: 24px; height: 24px; }

.quick-grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quick-grid4 button, .quick-grid3 button {
  min-height: 88px; border-radius: 20px; background: var(--card); box-shadow: var(--sh-1);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  transition: transform .12s var(--ease), box-shadow .2s;
}
.quick-grid4 b { font-size: 32px; font-weight: 800; line-height: 1.1; color: var(--feed-deep); }
.quick-grid4 small { font-size: 16px; color: var(--ink-3); }
.quick-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.side-grid button { min-height: 104px; }
.side-grid b {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--feed-bg); color: var(--feed-deep); font-size: 20px; font-weight: 800; margin-bottom: 4px;
}
.side-grid span { font-size: 21px; font-weight: 700; line-height: 1.2; }
.side-grid small { font-size: 15px; color: var(--ink-3); }
.other-grid { grid-template-columns: 1fr 1fr; }
.other-grid button { flex-direction: row; gap: 12px; min-height: 84px; font-size: 22px; font-weight: 700; }
.other-grid .bb-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--cb); color: var(--c); }
.other-grid .bb-icon .ic { width: 28px; height: 28px; }

.timer-card {
  margin-top: 12px; padding: 14px 14px 14px 18px; border-radius: 20px;
  display: flex; align-items: center; gap: 12px;
  background: var(--card); box-shadow: var(--sh-1), 0 0 0 1.5px var(--line-2) inset;
}
.timer-card.running { background: linear-gradient(160deg, #FFF6F2, #FBEDE6); box-shadow: 0 0 0 1.5px rgba(200, 102, 74, .3) inset; }
.timer-left { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.timer-label { display: flex; align-items: center; gap: 6px; font-size: 17px; font-weight: 600; color: var(--ink-2); }
.timer-label .ic { width: 20px; height: 20px; color: var(--feed); }
.timer-val { font-size: 38px; font-weight: 800; letter-spacing: .02em; line-height: 1.15; color: var(--ink); }
.timer-card.running .timer-val { color: var(--feed-deep); }
.timer-btn {
  flex: none; min-height: 72px; padding: 0 20px; border-radius: 18px;
  display: flex; align-items: center; gap: 8px; font-size: 21px; font-weight: 700; color: #fff;
  background: linear-gradient(180deg, #D4775A, var(--feed));
  box-shadow: 0 10px 20px -10px rgba(168, 80, 58, .8);
}
.timer-btn .ic { width: 22px; height: 22px; fill: currentColor; stroke: none; }

.option-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.option-row .chip { min-height: 52px; font-size: 19px; }
#sheet .btn-primary { margin-top: 18px; }

.stepper, .temp-row {
  display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 22px;
  background: var(--card); box-shadow: var(--sh-1);
}
.stepper button, .temp-row button {
  width: 72px; height: 72px; flex: none; border-radius: 18px; display: grid; place-items: center;
  background: var(--bg); color: var(--ink); transition: transform .12s;
}
.stepper button .ic, .temp-row button .ic { width: 30px; height: 30px; stroke-width: 2.2; }
.stepper-val, .temp-val { flex: 1; text-align: center; font-size: 38px; font-weight: 800; letter-spacing: -.01em; }
.stepper-val small, .temp-val small { font-size: 18px; font-weight: 600; color: var(--ink-3); margin-left: 2px; }
.temp-icon { width: 40px; display: grid; place-items: center; color: var(--other); margin-left: 4px; }
.temp-icon .ic { width: 30px; height: 30px; }
.temp-row .temp-val { text-align: center; }
.note-row { display: flex; gap: 10px; }
.note-row input { flex: 1; min-width: 0; min-height: 72px; }
.note-row .btn-secondary { width: auto; padding: 0 20px; flex: none; }

.swatch-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.swatch {
  min-height: 60px; border-radius: 16px; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--card); box-shadow: var(--sh-1); font-size: 19px; font-weight: 600;
  transition: transform .12s, box-shadow .2s;
}
.swatch i { width: 22px; height: 22px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08) inset; }
.swatch.selected { box-shadow: 0 0 0 2.5px var(--ink) inset; }
.sw-yellow { background: #E9C24A; } .sw-golden { background: #D59A2C; } .sw-green { background: #7E9A3E; }
.sw-brown { background: #8A5A34; } .sw-black { background: #2E2A27; } .sw-red { background: #C0473A; }

.sheet-extra { margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--line); }
.sheet-extra .field input { background: var(--card); }
.danger-zone { margin-top: 4px; }

/* ---------- 语音确认 ---------- */
#confirm-mask { display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50; }
#confirm-card {
  width: 100%; max-width: 420px; padding: 26px 20px 20px; border-radius: 30px; text-align: center;
  background: var(--card); box-shadow: var(--sh-3);
  animation: popIn .32s var(--ease);
}
@keyframes popIn { from { opacity: 0; transform: scale(.92) translateY(12px); } to { opacity: 1; transform: none; } }
.confirm-icon {
  width: 72px; height: 72px; margin: 0 auto 12px; border-radius: 22px; display: grid; place-items: center;
  background: var(--cb, var(--other-bg)); color: var(--c, var(--other));
}
.confirm-icon .ic { width: 40px; height: 40px; }
.confirm-q { margin: 0; font-size: 18px; color: var(--ink-3); font-weight: 600; letter-spacing: .06em; }
.confirm-main { margin: 6px 0 12px; font-size: 32px; font-weight: 800; line-height: 1.3; }
.confirm-time {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px;
  background: var(--bg); font-size: 19px; font-weight: 600; color: var(--ink-2);
}
.confirm-time .ic { width: 20px; height: 20px; }
.confirm-voice {
  display: flex; align-items: flex-start; gap: 8px; text-align: left;
  margin: 16px 0 18px; padding: 12px 14px; border-radius: 16px; background: var(--bg);
  font-size: 18px; color: var(--ink-2);
}
.confirm-voice .ic { width: 20px; height: 20px; margin-top: 3px; color: var(--teal); }
.confirm-voice:empty { display: none; }
#confirm-card .btn-secondary { margin-top: 10px; }

/* ---------- 撤销条 & 提示 ---------- */
#undo-bar {
  position: fixed; left: 14px; right: 14px; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 30;
  max-width: 532px; margin: 0 auto; overflow: hidden;
  display: flex; align-items: center; gap: 12px; min-height: 76px; padding: 10px 10px 10px 14px;
  border-radius: 22px; color: #fff; background: rgba(36, 30, 26, .94);
  box-shadow: 0 18px 36px -14px rgba(20, 14, 10, .6);
  animation: slideUp .3s var(--ease);
}
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.undo-check { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #3D8775; flex: none; }
.undo-check .ic { width: 22px; height: 22px; stroke-width: 2.4; }
#undo-text { flex: 1; min-width: 0; font-size: 20px; font-weight: 700; line-height: 1.3; }
#undo-text small { display: block; font-size: 16px; font-weight: 500; opacity: .72; }
#undo-btn {
  flex: none; display: flex; align-items: center; gap: 6px; min-height: 56px; padding: 0 18px;
  border-radius: 16px; background: rgba(255, 255, 255, .14); color: #fff; font-size: 20px; font-weight: 700;
}
#undo-btn .ic { width: 22px; height: 22px; }
.undo-progress { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: #7FC4B2; transform-origin: left; }
#undo-bar.run .undo-progress { animation: shrink 5s linear forwards; }
@keyframes shrink { from { transform: scaleX(1); } to { transform: scaleX(0); } }

#toast {
  position: fixed; left: 50%; top: calc(18px + env(safe-area-inset-top)); z-index: 60;
  transform: translateX(-50%); max-width: calc(100% - 40px);
  padding: 12px 22px; border-radius: 999px;
  background: rgba(36, 30, 26, .92); color: #fff; font-size: 19px; font-weight: 600;
  box-shadow: 0 12px 28px -10px rgba(20, 14, 10, .5);
  animation: toastIn .25s var(--ease);
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }

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