@font-face { font-family: Round; font-weight: 500; font-display: swap; src: url(fonts/round-500.woff2) format('woff2'); }
@font-face { font-family: Round; font-weight: 700; font-display: swap; src: url(fonts/round-700.woff2) format('woff2'); }

:root {
  --bg: #FFF7EF; --bg2: #FDEFE3; --card: #FFFFFF; --ink: #4A3B36; --ink2: #7C6A62; --ink3: #A8978E; --line: #F3E7DB;
  --coral: #F58E7C; --coral-d: #E5705C; --coral-l: #FFE6DF; --green: #6DB98A; --green-l: #E2F4E8; --lav: #A99BE6; --lav-l: #EEEAFB; --yel: #F7C948; --yel-l: #FFF3CF; --sky: #8FB8E8; --sky-l: #E5F0FB;
  --r: 22px; --shadow: 0 6px 18px rgba(150, 105, 80, .09); --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; overflow: hidden; background: var(--bg); color: var(--ink); font: 500 15px/1.5 Round, "PingFang SC", "Noto Sans SC", system-ui, sans-serif; -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none; }
input, textarea { user-select: text; -webkit-user-select: text; }
button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; }
h3 { font-size: 19px; margin: 0 0 10px; font-weight: 700; }
h2 { margin: 0; }
b { font-weight: 700; }
p { margin: 0; }
svg { display: block; width: 1em; height: 1em; }
[hidden] { display: none !important; }
.muted { color: var(--ink2); } .small { font-size: 13px; } .center { text-align: center; } .pad { padding: 16px 0; }
.danger { color: var(--coral-d) !important; }

/* ---------- 框架 ---------- */
#app { position: fixed; inset: 0; display: flex; flex-direction: column; }
.pane { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: calc(var(--sat) + 8px) 16px calc(var(--sab) + 92px); display: none; }
.pane.on { display: block; animation: fade .22s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.tabbar { position: absolute; left: 12px; right: 12px; bottom: calc(var(--sab) + 10px); height: 64px; background: rgba(255, 255, 255, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-radius: 26px; box-shadow: 0 8px 26px rgba(150, 105, 80, .18); display: flex; z-index: 5; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color: var(--ink3); font-size: 12px; transition: color .15s; }
.tab svg { width: 25px; height: 25px; transition: transform .2s cubic-bezier(.3, 1.6, .5, 1); }
.tab.on { color: var(--coral-d); font-weight: 700; }
.tab.on svg { transform: translateY(-1px) scale(1.1); }

.top-bar { display: flex; align-items: center; justify-content: space-between; min-height: 52px; margin-bottom: 10px; }
.top-date { font-size: 13px; color: var(--ink2); }
.top-hi { font-size: 21px; font-weight: 700; line-height: 1.3; }
.top-r { display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--ink2); flex: none; }
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn:active { background: var(--bg2); }
.icon-btn[disabled] { opacity: .25; }
.icon-btn.small { width: 36px; height: 36px; } .icon-btn.small svg { width: 18px; height: 18px; }
.fish-chip { display: inline-flex; align-items: center; gap: 5px; height: 36px; padding: 0 13px 0 10px; background: #fff; border-radius: 18px; box-shadow: var(--shadow); font-size: 14px; color: var(--ink); }
.fish-ico { color: #F2A04E; display: inline-grid; } .fish-ico svg { width: 19px; height: 19px; }
.paw-ico { display: inline-grid; } .paw-ico svg { width: 1.15em; height: 1.15em; }

/* ---------- 卡片 ---------- */
.card { display: block; width: 100%; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 12px; text-align: left; }
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.card-head b { font-size: 15.5px; } .card-head .muted { margin-left: auto; }
.sec-t { font-size: 15px; font-weight: 700; margin: 18px 4px 8px; display: flex; align-items: baseline; gap: 8px; }
.sec-t small { color: var(--ink3); font-weight: 500; font-size: 12px; }
.foot-note { color: var(--ink3); font-size: 12px; text-align: center; margin: 14px 18px 4px; line-height: 1.6; }
.empty { text-align: center; padding: 26px 18px; }
.empty p { margin-bottom: 14px; }
.empty-ico { width: 58px; height: 58px; margin: 0 auto 10px; border-radius: 50%; background: var(--coral-l); color: var(--coral-d); display: grid; place-items: center; font-size: 28px; }

/* ---------- 按钮 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 48px; padding: 0 20px; border-radius: 24px; font-weight: 700; font-size: 15.5px; transition: transform .12s, box-shadow .12s, filter .12s; }
.btn svg { width: 1.2em; height: 1.2em; }
.btn:active { transform: translateY(2px) scale(.985); }
.btn-primary { background: var(--coral); color: #fff; box-shadow: 0 4px 0 var(--coral-d); width: 100%; margin-bottom: 4px; }
.btn-primary:active { box-shadow: 0 2px 0 var(--coral-d); }
.btn-big { min-height: 56px; font-size: 17px; border-radius: 28px; }
.btn-danger { background: var(--coral-d); color: #fff; width: 100%; }
.btn-soft { background: var(--bg2); color: var(--ink); flex: 1; }
.btn-ghost { color: var(--ink2); width: 100%; }
.btn-wide { width: 100%; margin: 10px 0; }
.btn-mini { min-height: 40px; padding: 0 16px; font-size: 14px; background: var(--coral); color: #fff; flex: none; }
.btn-row { display: flex; gap: 10px; margin-top: 12px; }
.btn-col { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.link-btn { color: var(--ink2); font-size: 14px; padding: 10px; min-height: 44px; }
.link-btn.center { display: block; width: 100%; text-align: center; }

/* ---------- 气泡 ---------- */
.bubble { background: #fff; border-radius: 18px; padding: 10px 14px; box-shadow: 0 5px 16px rgba(120, 85, 60, .16); line-height: 1.45; position: relative; min-height: 40px; }
.bubble::after { content: ''; position: absolute; width: 14px; height: 14px; background: #fff; transform: rotate(45deg); border-radius: 3px; }

/* ---------- 今天 ---------- */
.hero { position: relative; height: 260px; border-radius: 26px; overflow: hidden; margin-bottom: 12px; box-shadow: var(--shadow); background: #FBE7D3; }
.hero-cv { width: 100%; height: 100%; display: block; touch-action: pan-y; }
.hero-bubble { position: absolute; left: 12px; top: 12px; max-width: 58%; font-size: 14px; }
.hero-bubble::after { right: 22px; bottom: -5px; }
.hero-week { position: absolute; left: 12px; bottom: 12px; background: rgba(255, 255, 255, .88); border-radius: 14px; padding: 6px 12px; font-size: 12px; color: var(--ink2); display: flex; flex-direction: column; line-height: 1.35; }
.hero-week b { font-size: 15px; color: var(--ink); }

.progress-card { display: flex; align-items: center; gap: 14px; }
.ring { position: relative; width: 58px; height: 58px; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 18px; }
.ring i { font-style: normal; font-size: 12px; color: var(--ink3); font-weight: 500; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); fill: none; stroke-width: 6; stroke: var(--line); }
.ring circle.on { stroke: var(--coral); stroke-linecap: round; stroke-dasharray: var(--p) 1; transition: stroke-dasharray .5s ease; }
.pc-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pc-txt b { font-size: 16px; }

.meal-card { padding: 12px 14px 6px; }
.meal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; min-height: 36px; flex-wrap: wrap; }
.meal-ico { width: 30px; height: 30px; flex: none; border-radius: 11px; display: grid; place-items: center; }
.meal-ico svg { width: 19px; height: 19px; }
.m-breakfast { background: var(--yel-l); color: #C8921A; } .m-lunch { background: var(--coral-l); color: var(--coral-d); } .m-dinner { background: #FFE9D2; color: #D47F2F; } .m-bed, .m-custom { background: var(--lav-l); color: #7C6BCB; }
.m-water { background: var(--sky-l); color: #4F8FD0; } .m-heart { background: #FFE4E8; color: #E2687F; } .m-kick { background: var(--green-l); color: #47996A; } .m-wave { background: var(--lav-l); color: #7C6BCB; } .m-note { background: var(--sky-l); color: #4F8FD0; } .m-scale { background: var(--yel-l); color: #C8921A; } .m-bag { background: #FFE9D2; color: #D47F2F; } .m-food { background: var(--green-l); color: #47996A; } .m-alert { background: var(--coral-l); color: var(--coral-d); }
.ate-chip { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; min-height: 34px; padding: 0 12px; border-radius: 17px; background: var(--green-l); color: #2F7C51; font-size: 13px; font-weight: 700; }
.ate-chip.on { background: var(--bg2); color: var(--ink2); font-weight: 500; } .ate-chip svg { width: 13px; height: 13px; }
.med-row { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-top: 1px solid var(--line); cursor: pointer; }
.meal-head + .med-row { border-top: 0; }
.pill-ico { width: 42px; height: 42px; border-radius: 15px; flex: none; display: grid; place-items: center; color: #fff; background: var(--pc); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .08); }
.pill-ico svg { width: 25px; height: 25px; }
.med-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.med-name { font-weight: 700; font-size: 16px; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.med-dose { font-size: 12.5px; color: var(--ink2); font-weight: 500; }
.med-sub { font-size: 12.5px; color: var(--ink2); line-height: 1.4; }
.st-done .pill-ico { opacity: .55; } .st-done .med-name { color: var(--ink2); } .st-skip { opacity: .6; }
.st-due .med-sub { color: var(--coral-d); }
.eat-btn { flex: none; min-height: 42px; min-width: 76px; padding: 0 14px; border-radius: 21px; background: var(--coral); color: #fff; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 4px; box-shadow: 0 3px 0 var(--coral-d); animation: nudge 2.4s ease-in-out infinite; font-size: 15px; }
.eat-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--coral-d); }
.eat-btn.soft { background: var(--coral-l); color: var(--coral-d); box-shadow: none; animation: none; }
.eat-btn.ghost { background: var(--bg2); color: var(--ink2); box-shadow: none; animation: none; font-weight: 500; font-size: 13.5px; min-width: 66px; padding: 0 10px; }
@keyframes nudge { 0%, 86%, 100% { transform: none; } 90% { transform: rotate(-3deg); } 94% { transform: rotate(3deg); } }
.stamp { flex: none; min-width: 60px; text-align: center; color: var(--ink2); font-size: 12.5px; }
.stamp.done { color: var(--coral-d); display: flex; flex-direction: column; align-items: center; font-weight: 700; line-height: 1.2; }
.stamp-paw { font-size: 19px; animation: stamp .35s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes stamp { from { transform: scale(1.8); opacity: 0; } to { transform: none; opacity: 1; } }

.cups { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; }
.cup { height: 46px; position: relative; }
.cup i { position: absolute; left: 50%; top: 5px; width: 28px; height: 36px; transform: translateX(-50%); border: 2px solid #CBDFF2; border-top-width: 1.5px; border-radius: 4px 4px 11px 11px; overflow: hidden; background: #fff; }
.cup i::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: #8FC3EE; transition: height .28s ease; }
.cup.on i { border-color: #8FC3EE; } .cup.on i::after { height: 80%; }
.moods { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.mood { display: flex; flex-direction: column; align-items: center; font-size: 12px; color: var(--ink2); padding: 7px 0 5px; border-radius: 16px; transition: background .15s, transform .15s; }
.mood img { width: 44px; height: 44px; display: block; }
.mood.on { background: var(--coral-l); color: var(--coral-d); font-weight: 700; transform: scale(1.04); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.mini { margin: 0; display: flex; flex-direction: column; min-width: 0; padding: 13px 14px; }
.mini-ico { font-size: 26px; line-height: 1.2; }
.mini-ico.i { width: 34px; height: 34px; color: #4F8FD0; background: var(--sky-l); border-radius: 12px; display: grid; place-items: center; font-size: 20px; }
.mini-t { font-size: 12px; color: var(--ink2); margin-top: 4px; }
.mini b { font-size: 15px; line-height: 1.35; }

/* ---------- 记录 ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.stat { background: #fff; border-radius: 18px; box-shadow: var(--shadow); padding: 12px 6px 10px; text-align: center; display: flex; flex-direction: column; min-width: 0; }
.stat b { font-size: 22px; line-height: 1.25; } .stat b.range { font-size: 16px; line-height: 1.7; }
.stat i { font-style: normal; font-size: 12px; margin-left: 2px; color: var(--ink2); font-weight: 500; }
.stat span { font-size: 12px; color: var(--ink2); }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; }
.cal-week { font-size: 12px; color: var(--ink3); margin-bottom: 4px; }
.cal-d { height: 44px; position: relative; font-size: 14px; border-radius: 14px; display: grid; place-items: center; }
.cal-d span { position: relative; z-index: 1; }
.cal-d .m { position: absolute; inset: 0; display: grid; place-items: center; font-size: 31px; opacity: .22; color: var(--coral); }
.cal-d.full .m { opacity: .55; } .cal-d.full span { font-weight: 700; }
.cal-d.part .m { opacity: .2; }
.cal-d.future { color: #D5C8BE; }
.cal-d.today span { color: var(--coral-d); font-weight: 700; }
.cal-d.sel { background: var(--bg2); box-shadow: inset 0 0 0 2px var(--coral); }
.cal-legend { display: flex; gap: 16px; justify-content: center; font-size: 12px; color: var(--ink2); margin-top: 8px; }
.cal-legend span { display: inline-flex; align-items: center; gap: 4px; }
.lg { font-size: 16px; color: var(--coral); } .lg.full { opacity: .7; } .lg.part { opacity: .28; }
.rec-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 0; border-top: 1px solid var(--line); text-align: left; }
.card-head + .rec-row { border-top: 0; }
.rec-time { width: 44px; font-weight: 700; font-size: 14px; flex: none; font-variant-numeric: tabular-nums; }
.pill-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; display: inline-block; }
.pill-dot.big { width: 32px; height: 32px; border-radius: 12px; }
.rec-name { flex: 1; min-width: 0; display: block; font-weight: 700; }
.rec-name em { font-style: normal; color: var(--ink2); font-weight: 500; font-size: 12.5px; margin-left: 6px; }
.rec-name small { display: block; color: var(--ink2); font-weight: 500; font-size: 12px; }
.rec-st { font-size: 12.5px; color: var(--ink2); flex: none; }
.rec-st.st-done { color: #2F7C51; }
.rec-extra { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; font-size: 13px; color: var(--ink2); }
.chart { width: 100%; height: auto; margin-bottom: 4px; }
.chart text, .ch-t { font: 500 10.5px Round, sans-serif; fill: var(--ink2); }
.ch-band { fill: var(--green-l); }
.ch-axis { stroke: var(--line); stroke-width: 1; } .ch-grid { stroke: var(--line); stroke-width: 1; }
.ch-dot { fill: var(--coral); stroke: #fff; stroke-width: 2; }
.ch-line { fill: none; stroke: var(--coral); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ch-name { font-size: 13px; font-weight: 700; margin-top: 8px; }
.chart-note { margin: -4px 0 6px; }
.chart-wrap { position: relative; }
.tip-box { position: absolute; transform: translate(-50%, -100%); background: var(--ink); color: #fff; font-size: 12px; padding: 4px 9px; border-radius: 9px; pointer-events: none; opacity: 0; white-space: nowrap; transition: opacity .12s; z-index: 3; }
.tip-box.on { opacity: 1; }
#pane-records { position: absolute; }

/* ---------- 孕期 ---------- */
.week-card { border-radius: 26px; padding: 18px; margin-bottom: 14px; color: var(--ink); box-shadow: var(--shadow); background: linear-gradient(150deg, #FFE9DF, #FFF3DC); }
.week-card.tri-2 { background: linear-gradient(150deg, #E7F5EA, #FFF5DC); } .week-card.tri-3 { background: linear-gradient(150deg, #EFEAFB, #FFE9E3); }
.wk-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wk-label { font-size: 26px; font-weight: 700; line-height: 1.25; }
.wk-left { color: var(--ink2); font-size: 14px; } .wk-left b { color: var(--coral-d); font-size: 17px; }
.wk-fruit { width: 72px; height: 72px; border-radius: 50%; background: rgba(255, 255, 255, .72); display: grid; place-items: center; font-size: 40px; flex: none; }
.wk-bar { height: 10px; background: rgba(255, 255, 255, .8); border-radius: 5px; margin-top: 12px; overflow: hidden; }
.wk-bar i { display: block; height: 100%; background: var(--coral); border-radius: 5px; transition: width .4s ease; }
.wk-marks { display: grid; grid-template-columns: 13fr 14fr 13fr; font-size: 11.5px; color: var(--ink2); margin-top: 3px; text-align: center; }
.wk-size { margin-top: 10px; font-size: 15px; }
.wk-p { font-size: 13.5px; color: var(--ink2); margin-top: 6px; } .wk-p b { color: var(--ink); margin-right: 3px; }
.wk-cat { display: flex; align-items: flex-start; gap: 8px; margin-top: 10px; }
.wk-cat img { width: 52px; height: 52px; flex: none; }
.wk-cat .bubble { font-size: 13.5px; padding: 8px 12px; flex: 1; box-shadow: none; }
.wk-cat .bubble::after { left: -5px; top: 16px; }
.tool-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tool { background: #fff; border-radius: 18px; box-shadow: var(--shadow); padding: 13px 2px 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; }
.tool:active { transform: scale(.96); }
.tool .meal-ico { width: 38px; height: 38px; border-radius: 13px; } .tool .meal-ico svg { width: 23px; height: 23px; }

/* 工具页 */
.kick-stage { text-align: center; padding: 8px 16px 14px; }
.kick-cv { width: 100%; height: 170px; display: block; touch-action: pan-y; }
.kick-num b { font-size: 54px; line-height: 1; display: inline-block; }
.kick-num b.pop { animation: pop .28s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes pop { from { transform: scale(1.45); color: var(--coral-d); } to { transform: none; } }
.kick-num span { margin-left: 4px; color: var(--ink2); }
.kick-time { font-size: 13px; color: var(--ink2); margin-bottom: 10px; }
.kick-hint { margin: 2px 0 14px; color: var(--ink2); }
.kick-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 76px; border-radius: 30px; background: var(--coral); color: #fff; font-size: 20px; font-weight: 700; box-shadow: 0 5px 0 var(--coral-d); }
.kick-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--coral-d); }
.note-box { display: flex; gap: 10px; background: var(--yel-l); border-radius: 18px; padding: 12px 14px; font-size: 13.5px; line-height: 1.55; margin-bottom: 12px; }
.note-box svg { width: 20px; height: 20px; flex: none; margin-top: 1px; color: #B9851A; }
.note-box.hot { background: var(--coral-l); } .note-box.hot svg { color: var(--coral-d); }
.log-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; min-height: 42px; }
.log-row:first-child { border-top: 0; }
.log-row > span:first-child { flex: 1; } .log-row > b { min-width: 58px; text-align: right; }
.wave-stage { text-align: center; padding: 22px 16px; }
.wave-btn { width: 190px; height: 190px; border-radius: 50%; background: var(--lav-l); color: #5D4DB0; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; box-shadow: 0 0 0 10px rgba(169, 155, 230, .18); font-size: 13px; }
.wave-btn b { font-size: 30px; }
.wave-btn.on { background: var(--lav); color: #fff; animation: breathe 2.6s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: 0 0 0 24px rgba(169, 155, 230, .22); } }
.wave-avg { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 24px; font-size: 12px; color: var(--ink2); }
.wave-avg div { display: flex; flex-direction: column; } .wave-avg b { font-size: 15px; color: var(--ink); }
.timeline { padding-left: 4px; margin-bottom: 10px; }
.tl-item { display: flex; gap: 12px; width: 100%; text-align: left; position: relative; padding-bottom: 10px; }
.tl-item::before { content: ''; position: absolute; left: 10px; top: 24px; bottom: -2px; width: 2px; background: var(--line); }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 22px; height: 22px; flex: none; margin-top: 12px; border-radius: 50%; background: #fff; border: 2px solid #E6D8CB; display: grid; place-items: center; color: #fff; font-size: 13px; z-index: 1; }
.tl-b { flex: 1; min-width: 0; background: #fff; border-radius: 18px; box-shadow: var(--shadow); padding: 10px 14px; display: flex; flex-direction: column; }
.tl-b small { color: var(--ink2); font-size: 12.5px; } .tl-b .tl-items { color: var(--ink3); margin-top: 2px; }
.tl-item.next .tl-dot { border-color: var(--coral); box-shadow: 0 0 0 4px var(--coral-l); }
.tl-item.next .tl-b { box-shadow: 0 0 0 2px var(--coral), var(--shadow); }
.tl-item.done .tl-dot { background: var(--green); border-color: var(--green); }
.tl-item.done .tl-b { opacity: .68; }
.q-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); } .q-row span { flex: 1; font-size: 14px; }
.q-add { display: flex; gap: 8px; margin-top: 8px; } .q-add .input { margin: 0; min-width: 0; flex: 1; }
.weight-add { display: flex; gap: 8px; } .weight-add .input { min-width: 0; flex: 1; padding: 0 10px; font-size: 14px; }
.mood-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.mc { display: flex; flex-direction: column; align-items: center; font-size: 11px; color: var(--ink3); }
.mc img, .mc i { width: 36px; height: 36px; display: block; } .mc i { width: 22px; height: 22px; margin: 7px; border-radius: 50%; background: var(--bg2); }
.mc.today span { color: var(--coral-d); font-weight: 700; }
.input.area { height: auto; padding: 10px 12px; line-height: 1.5; margin-bottom: 10px; resize: none; }
.note-row { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); } .note-row:first-child { border-top: 0; }
.note-row img { width: 36px; height: 36px; flex: none; } .note-row small { color: var(--ink3); } .note-row p { font-size: 14px; user-select: text; }
.bag-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; } .bag-top b { font-size: 20px; } .bag-top .wk-bar { flex-basis: 100%; background: var(--bg2); margin-top: 2px; }
.check-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; text-align: left; border-top: 1px solid var(--line); font-size: 14.5px; padding: 4px 0; }
.check-row:first-child { border-top: 0; }
.ck { width: 24px; height: 24px; flex: none; border-radius: 8px; border: 2px solid #E6D8CB; color: transparent; display: grid; place-items: center; font-size: 15px; transition: all .15s; }
.check-row.on .ck { background: var(--green); border-color: var(--green); color: #fff; } .check-row.on { color: var(--ink3); }
.search { margin-bottom: 10px; }
.food-row { padding: 10px 0; border-top: 1px solid var(--line); } .food-row:first-child { border-top: 0; }
.food-row p { font-size: 13.5px; color: var(--ink2); margin-top: 2px; }
.food-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tag { font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 10px; flex: none; }
.tag.ok { background: var(--green-l); color: #2F7C51; } .tag.care { background: var(--yel-l); color: #8C6510; } .tag.no { background: var(--coral-l); color: #BE4B37; }
.warn-row { padding: 10px 0; border-top: 1px solid var(--line); } .warn-row:first-child { border-top: 0; } .warn-row p { font-size: 13.5px; color: var(--ink2); }
ul.plain { margin: 0 0 12px; padding-left: 20px; font-size: 14px; color: var(--ink2); }

/* ---------- 表单 ---------- */
.input { display: block; width: 100%; height: 48px; border: 2px solid var(--line); background: #fff; border-radius: 15px; padding: 0 14px; outline: none; font-size: 16px; -webkit-appearance: none; appearance: none; transition: border-color .15s; }
.input:focus { border-color: var(--coral); }
.input.short { width: 104px; flex: none; padding: 0 8px; height: 42px; font-size: 15px; }
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 13.5px; color: var(--ink2); margin-bottom: 5px; } .field em { font-style: normal; color: var(--ink3); }
.field-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 10px; font-size: 13.5px; color: var(--ink2); }
.field-row > span { flex-basis: 100%; } .dash { font-style: normal; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { min-height: 38px; padding: 0 13px; border-radius: 19px; background: var(--bg2); font-size: 14px; color: var(--ink2); transition: background .12s, color .12s; }
.chip.on { background: var(--coral); color: #fff; font-weight: 700; }
.slot { border: 2px solid var(--line); border-radius: 18px; padding: 12px; margin-bottom: 12px; }
.slot .chips + .chips { margin-top: 8px; }
.slot-head { display: flex; align-items: center; justify-content: space-between; min-height: 32px; margin-bottom: 6px; } .slot-head .link-btn { padding: 0 6px; min-height: 32px; }
.slot-preview { margin-top: 10px; background: var(--green-l); border-radius: 12px; padding: 7px 10px; font-size: 12.5px; color: #2C6F49; line-height: 1.45; }
.slot-preview .paw-ico { vertical-align: -2px; margin-right: 3px; }
.colors { display: flex; gap: 9px; flex-wrap: wrap; }
.color { width: 34px; height: 34px; border-radius: 50%; } .color.on { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--ink2); }
.preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.preset { background: #fff; border-radius: 16px; padding: 10px 11px; text-align: left; box-shadow: 0 0 0 2px var(--line); display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 0 7px; min-height: 58px; }
.preset small { grid-column: 1 / 3; font-size: 11.5px; color: var(--ink2); line-height: 1.35; }
.preset.on { box-shadow: 0 0 0 2.5px var(--coral); background: var(--coral-l); }
.preset.had { opacity: .55; }
.med-manage { display: flex; align-items: center; gap: 11px; } .med-manage.off { opacity: .55; } .chev { color: var(--ink3); font-size: 18px; flex: none; }
.set-list { padding: 2px 16px; }
.set-row { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 52px; text-align: left; border-top: 1px solid var(--line); font-size: 15px; }
.set-row:first-child { border-top: 0; } .set-row > span { flex: 1; } .set-row em { font-style: normal; color: var(--ink2); font-size: 13px; text-align: right; max-width: 60%; } .set-row > svg { color: var(--ink3); flex: none; }
.switch { width: 52px; height: 32px; border-radius: 16px; background: #E8DDD3; position: relative; transition: background .18s; flex: none; }
.switch i { position: absolute; left: 3px; top: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .18); transition: transform .18s; }
.switch[aria-checked=true] { background: var(--coral); } .switch[aria-checked=true] i { transform: translateX(20px); }
.about { text-align: center; font-size: 12px; color: var(--ink3); line-height: 1.7; margin: 6px 16px 10px; } .about b { color: var(--ink2); font-size: 14px; }
.sheet-body > p.muted { margin-bottom: 12px; }
.meal-set { margin-bottom: 14px; } .meal-set-h { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.rs { padding: 2px 26px 6px; }
.rs-track { height: 8px; background: var(--bg2); border-radius: 4px; position: relative; margin: 16px 0; }
.rs-fill { position: absolute; top: 0; bottom: 0; background: var(--coral); opacity: .45; border-radius: 4px; }
.rs-h { position: absolute; top: 50%; width: 52px; height: 30px; margin-left: -26px; margin-top: -15px; background: #fff; border-radius: 15px; box-shadow: 0 2px 7px rgba(120, 85, 60, .28); font-size: 12.5px; font-weight: 700; touch-action: none; color: var(--ink); }
.rs-h::before { content: ''; position: absolute; inset: -8px; }
.rs-h.drag { background: var(--coral); color: #fff; }

/* ---------- 弹层 ---------- */
#layers { position: fixed; inset: 0; pointer-events: none; z-index: 20; }
#layers > * { pointer-events: auto; }
.sheet-wrap { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; }
.sheet-bg { position: absolute; inset: 0; background: rgba(70, 48, 38, .42); opacity: 0; transition: opacity .24s; }
.sheet { position: relative; background: var(--bg); border-radius: 28px 28px 0 0; max-height: 90%; overflow-y: auto; transform: translateY(102%); transition: transform .28s cubic-bezier(.2, .9, .3, 1); padding-bottom: calc(var(--sab) + 12px); }
.sheet-wrap.on .sheet-bg { opacity: 1; } .sheet-wrap.on .sheet { transform: none; }
.sheet-grip { height: 26px; position: sticky; top: 0; z-index: 2; touch-action: none; }
.sheet-grip::after { content: ''; position: absolute; left: 50%; top: 9px; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: #E3D4C7; }
.sheet-body { padding: 0 18px 8px; }
.sheet-tall .sheet { height: 90%; }
.nudge .sheet { overflow: visible; background: linear-gradient(180deg, #FFF0E4, var(--bg) 42%); }
.nudge-stage { height: 196px; margin-top: -60px; position: relative; pointer-events: none; }
.nudge-cv { width: 100%; height: 100%; display: block; pointer-events: auto; touch-action: none; }
.nudge .sheet-grip { display: none; }
.nudge-bubble { margin: 6px 0 12px; text-align: center; font-size: 16px; }
.nudge-bubble::after { left: 50%; margin-left: -7px; top: -5px; }
.nudge-one { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 18px; padding: 11px 14px; margin-bottom: 14px; box-shadow: var(--shadow); }
.nudge-list { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; max-height: 32vh; overflow-y: auto; padding: 2px; }
.nudge-item { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 16px; min-height: 48px; padding: 0 12px; box-shadow: var(--shadow); text-align: left; }
.ni-name { font-weight: 700; } .ni-dose { color: var(--ink2); font-size: 13px; flex: 1; }
.ni-check { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #E6D8CB; color: transparent; display: grid; place-items: center; font-size: 16px; }
.nudge-item.on .ni-check { background: var(--coral); border-color: var(--coral); color: #fff; }
.nudge-row { display: flex; gap: 10px; margin-top: 12px; }
.nudge .link-btn { display: block; margin: 2px auto 0; }
.comfort-stage { height: 170px; } .comfort-stage canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.center-bubble { text-align: center; margin: 2px 0 14px; font-size: 15.5px; }
.center-bubble::after { left: 50%; margin-left: -7px; top: -5px; }

.page { position: absolute; inset: 0; background: var(--bg); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .26s cubic-bezier(.2, .9, .3, 1); box-shadow: -8px 0 24px rgba(120, 85, 60, .1); }
.page.on { transform: none; }
.page-head { display: flex; align-items: center; padding: calc(var(--sat) + 4px) 6px 2px; min-height: 52px; flex: none; }
.page-head h2 { flex: 1; text-align: center; font-size: 17px; font-weight: 700; }
.page-head-r { width: 44px; flex: none; }
.page-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 8px 16px calc(var(--sab) + 24px); position: relative; }

.celebrate { position: absolute; inset: 0; background: radial-gradient(circle at 50% 42%, rgba(255, 244, 228, .97), rgba(255, 226, 205, .95)); display: flex; flex-direction: column; opacity: 0; transition: opacity .22s; z-index: 5; align-items: center; justify-content: center; padding: 0 22px calc(var(--sab) + 40px); }
.celebrate.on { opacity: 1; }
.cele-cv { width: 100%; height: 330px; display: block; flex: none; }
.cele-card { width: 100%; background: #fff; border-radius: 24px; padding: 16px 18px; text-align: center; box-shadow: var(--shadow); animation: rise .35s cubic-bezier(.2, 1.3, .4, 1); }
@keyframes rise { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.cele-time { font-size: 13px; color: var(--ink2); }
.cele-line { font-size: 18px; font-weight: 700; margin: 4px 0 8px; min-height: 54px; line-height: 1.5; }
.cele-reward { display: inline-flex; align-items: center; gap: 4px; background: var(--yel-l); color: #8C6510; border-radius: 14px; padding: 3px 12px; font-size: 13.5px; font-weight: 700; }
.cele-left { font-size: 13px; color: var(--ink2); margin-top: 8px; }

#toast { position: fixed; left: 50%; bottom: calc(var(--sab) + 96px); transform: translate(-50%, 16px); max-width: 84%; background: rgba(74, 59, 54, .94); color: #fff; padding: 9px 16px; border-radius: 18px; font-size: 14px; opacity: 0; pointer-events: none; transition: all .22s; z-index: 50; text-align: center; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 猫猫页 ---------- */
.name-btn { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 21px; min-height: 44px; }
.name-btn svg { width: 17px; height: 17px; color: var(--ink3); }
.cat-stage { position: relative; height: 316px; border-radius: 28px; background: radial-gradient(circle at 50% 95%, #FFD9C2 0, #FFEBDC 42%, #FFF3E7 72%); overflow: hidden; }
.cat-cv { width: 100%; height: 100%; display: block; touch-action: pan-y; }
.cat-bubble { position: absolute; left: 12px; right: 12px; top: 12px; font-size: 14px; text-align: center; }
.cat-bubble::after { left: 50%; margin-left: -7px; bottom: -5px; }
.cat-hint { text-align: center; font-size: 12.5px; color: var(--ink3); margin: 7px 0 12px; }
.upload { display: flex; align-items: center; gap: 12px; background: linear-gradient(120deg, #FFE8DE, #FFF3D6); }
.up-ico { width: 46px; height: 46px; background: #fff; border-radius: 16px; display: grid; place-items: center; color: var(--coral-d); font-size: 25px; flex: none; }
.up-t { flex: 1; display: flex; flex-direction: column; min-width: 0; } .up-t small { color: var(--ink2); font-size: 12.5px; }
.upload > svg { color: var(--ink3); flex: none; font-size: 18px; }
.acc-row { display: flex; gap: 9px; overflow-x: auto; margin: 0 -16px; padding: 3px 16px 8px; scrollbar-width: none; }
.acc-row::-webkit-scrollbar { display: none; }
.acc { flex: none; width: 76px; background: #fff; border-radius: 16px; box-shadow: var(--shadow); padding: 6px 2px 7px; display: flex; flex-direction: column; align-items: center; font-size: 12.5px; position: relative; }
.acc-img { width: 62px; height: 62px; overflow: hidden; display: block; font-style: normal; }
.acc img { width: 100px; height: 100px; max-width: none; display: block; margin: -8px 0 0 -16px; }
.acc.on { box-shadow: 0 0 0 2.5px var(--coral); }
.acc.locked img { filter: saturate(.55); opacity: .75; }
.acc em { font-style: normal; display: inline-flex; align-items: center; gap: 2px; color: #8C6510; font-size: 12px; font-weight: 700; }
.acc em .fish-ico { font-style: normal; } .acc em svg { width: 14px; height: 14px; }
.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cat-cell { position: relative; }
.cat-tile { width: 100%; background: #fff; border-radius: 18px; box-shadow: var(--shadow); padding: 5px 2px 9px; display: flex; flex-direction: column; align-items: center; }
.cat-tile img { width: 92px; height: 92px; display: block; }
.cat-tile small { color: var(--ink3); font-size: 11.5px; }
.cat-cell.on .cat-tile { box-shadow: 0 0 0 2.5px var(--coral), var(--shadow); }
.cat-del { position: absolute; top: 2px; right: 2px; width: 34px; height: 34px; display: grid; place-items: center; color: var(--ink3); font-size: 14px; }

/* 照片生成 */
.align-tip { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 14px; margin-bottom: 10px; color: var(--ink); } .align-tip svg { color: var(--coral); }
.align-box { border-radius: 22px; overflow: hidden; margin: 0 auto 12px; width: min(100%, 46vh); box-shadow: var(--shadow); }
.align-cv { display: block; width: 100%; touch-action: none; cursor: grab; }
.align-ctl { display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: var(--ink2); margin-bottom: 8px; min-height: 36px; }
.align-ctl span { flex: none; }
.align-ctl input { flex: 1; height: 30px; margin: 0; -webkit-appearance: none; appearance: none; background: transparent; }
.align-ctl input::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; background: var(--bg2); }
.align-ctl input::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -9px; border-radius: 50%; background: var(--coral); box-shadow: 0 2px 6px rgba(120, 85, 60, .3); }
.align-page .btn-primary { margin-top: 8px; }
.morph { display: flex; flex-direction: column; align-items: center; padding-top: 12vh; }
.morph-photo { width: 200px; height: 200px; border-radius: 50%; overflow: hidden; position: relative; box-shadow: 0 0 0 6px #fff, var(--shadow); }
.morph-photo img { width: 100%; height: 100%; display: block; animation: toPaint 1.9s ease-in forwards; }
@keyframes toPaint { to { filter: saturate(1.5) contrast(.8) blur(5px); } }
.scan { position: absolute; left: 0; right: 0; height: 40%; top: -40%; background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .75)); animation: scan 1s linear 2; }
@keyframes scan { to { top: 100%; } }
.morph-dots { display: flex; gap: 8px; margin-top: 22px; min-height: 22px; }
.morph-dots span { width: 22px; height: 22px; border-radius: 50%; box-shadow: 0 0 0 2px #fff, 0 2px 5px rgba(0, 0, 0, .15); animation: dot .35s cubic-bezier(.3, 1.8, .5, 1) backwards; }
@keyframes dot { from { transform: scale(0); } }
.morph-t { margin-top: 14px; color: var(--ink2); }
.pop-in { animation: rise .4s cubic-bezier(.2, 1.3, .4, 1); }
.result .center-bubble { margin-top: 10px; }
.result .muted.small.center { margin-bottom: 12px; }
.compare { display: flex; align-items: center; justify-content: center; gap: 6px; }
.cmp-photo { position: relative; flex: none; display: flex; flex-direction: column; align-items: center; font-size: 12px; color: var(--ink2); gap: 5px; }
.cmp-photo img { width: 98px; height: 98px; border-radius: 50%; display: block; box-shadow: 0 0 0 3px #fff, var(--shadow); }
.cmp-arrow { color: var(--coral); font-size: 22px; flex: none; }
.cmp-cat { width: 210px; height: 220px; flex: none; } .cmp-cat canvas { width: 100%; height: 100%; display: block; touch-action: pan-y; }
.adj-row { display: flex; align-items: center; gap: 12px; padding: 7px 0; font-size: 14px; color: var(--ink2); } .adj-row > span { width: 32px; flex: none; }
.adj-cols, .adj-flags { display: flex; flex-wrap: wrap; gap: 6px; }
.adj-color { width: 36px; height: 36px; border-radius: 50%; display: block; box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--line); overflow: hidden; position: relative; cursor: pointer; }
.adj-color input { position: absolute; inset: -6px; opacity: 0; width: 200%; height: 200%; cursor: pointer; }
.adj-eye { width: 28px; height: 28px; border-radius: 50%; } .adj-eye.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink2); }

/* ---------- 引导 ---------- */
.onboard { position: absolute; inset: 0; background: var(--bg); display: flex; flex-direction: column; transition: opacity .3s; z-index: 1; }
.onboard.out { opacity: 0; }
.ob-cv { position: absolute; left: 0; right: 0; top: 0; width: 100%; height: 44%; display: block; }
.ob-bubble { position: absolute; left: 14px; right: 14px; top: calc(var(--sat) + 14px); text-align: center; font-size: 15px; z-index: 1; min-height: 62px; }
.ob-bubble::after { left: 50%; margin-left: -7px; bottom: -5px; }
.ob-card { position: absolute; left: 0; right: 0; bottom: 0; top: 40%; background: var(--bg); border-radius: 28px 28px 0 0; padding: 12px 18px calc(var(--sab) + 14px); box-shadow: 0 -6px 20px rgba(120, 85, 60, .1); display: flex; flex-direction: column; }
.ob-steps { display: flex; justify-content: center; gap: 7px; margin-bottom: 8px; flex: none; }
.ob-steps i { font-size: 15px; color: #EADCCF; transition: color .2s; } .ob-steps i.on { color: var(--coral); }
.ob-body { flex: 1; overflow-y: auto; min-height: 0; margin: 0 -18px; padding: 2px 18px; }
.ob-body.slide { animation: slideIn .28s ease; }
@keyframes slideIn { from { transform: translateX(22px); opacity: 0; } }
.ob-body .btn-primary { margin-top: 12px; }
.ob-body > .chips { margin-bottom: 12px; }
.ob-cats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-bottom: 6px; }
.ob-cat { display: flex; flex-direction: column; align-items: center; font-size: 12px; border-radius: 14px; padding: 3px 0 4px; color: var(--ink2); }
.ob-cat img { width: 54px; height: 54px; display: block; }
.ob-cat.on { background: var(--coral-l); color: var(--coral-d); font-weight: 700; }
.ob-body .meal-set { display: flex; align-items: center; gap: 4px; margin-bottom: 0; }
.ob-body .meal-set-h { flex-direction: column; gap: 0; margin: 0; width: 40px; flex: none; font-size: 12px; } .ob-body .meal-set-h b { font-weight: 500; color: var(--ink2); }
.ob-body .rs { flex: 1; padding: 0 24px; min-width: 0; }
.ob-week { margin: -4px 0 4px; min-height: 20px; }
/* 矮屏（iPhone SE 这一档）：猫小一点，保证按钮都在屏内 */
@media (max-height: 720px) {
  .nudge-stage { height: 128px; margin-top: -36px; }
  .nudge-bubble { font-size: 14.5px; margin: 4px 0 8px; }
  .nudge-one { margin-bottom: 10px; padding: 8px 12px; }
  .nudge-list { gap: 5px; margin-bottom: 10px; max-height: 24vh; overflow-y: auto; padding: 2px; }
  .nudge-item { min-height: 42px; }
  .nudge-row { margin-top: 8px; } .nudge .btn-big { min-height: 50px; } .nudge .btn-soft { min-height: 42px; }
  .cele-cv { height: 240px; }
  .ob-cats img { width: 44px; height: 44px; }
  .ob-cat { font-size: 11.5px; }
  .align-box { width: min(100%, 40vh); }
  .align-ctl { margin-bottom: 2px; }
  .hero { height: 220px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
