/* ============================================================
   宝宝成长日记 · 高端母婴杂志风
   奶油暖底 + 衬线展示标题 + 温润阴影 + 编辑感版面
   ============================================================ */
:root {
  --bg: #FBF4E9;
  --card: #FFFCF7;
  --ink: #352619;
  --ink-2: #7A6151;
  --ink-3: #B3A08F;
  --line: #F0E3D3;
  --line-2: #F7EDE0;

  --rose: #C76B5A;
  --rose-d: #B25344;
  --rose-soft: #F8E6DE;
  --rose-grad: linear-gradient(135deg, #D57F6B, #C25A48);

  --sage: #7FA489;
  --sage-soft: #E7F0E6;
  --clay: #D0965F;
  --clay-soft: #F8EAD9;
  --blue: #8FA8BB;
  --blue-soft: #EAF0F5;
  --amber: #CE9B3F;
  --amber-soft: #F8EEDA;
  --milk: #C96B90;
  --milk-soft: #FBE8F0;
  --sleep: #7A6FA0;
  --sleep-soft: #EFEDF7;
  --vaccine: #5FA89E;
  --vaccine-soft: #E2F2F0;
  --gold: #C99B4F;
  --food: #E0935A;
  --food-soft: #FBEBDB;
  --stool: #A9856B;
  --stool-soft: #F1E7DD;
  --temp: #D9695F;
  --temp-soft: #FBE3E0;
  --task: #6FA88F;
  --task-soft: #E5F1EB;

  --radius: 24px;
  --radius-s: 16px;
  --shadow: 0 1px 2px rgba(92,62,40,.05), 0 8px 24px rgba(92,62,40,.06);
  --shadow-m: 0 3px 8px rgba(92,62,40,.07), 0 18px 42px rgba(92,62,40,.09);
  --shadow-l: 0 -14px 52px rgba(92,62,40,.16);
  --shadow-warm: 0 10px 26px rgba(199,107,90,.30);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);

  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Helvetica Neue", sans-serif;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC",
           "Noto Serif CJK SC", "SimSun", serif;
}

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

html, body {
  margin: 0; padding: 0;
  background:
    radial-gradient(1100px 560px at 88% -12%, rgba(214,150,95,.16), transparent 60%),
    radial-gradient(880px 520px at -12% -2%, rgba(199,107,90,.12), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.62;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font-family: inherit; font-size: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; font-size: 16px; }
svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }

/* 衬线展示字体：用于名字、标题、大数字，营造杂志感 */
.bs-txt strong, .card-head h2, .sheet-head h3, .rev-title b, .month-nav b,
.setup-card h1, .insight .ins-v, .who-top b, .day-head b, .rev-stat b,
.code-card b, .detail-measure b, .who-item b, .empty p, .feed-inline b {
  font-family: var(--serif);
  font-weight: 600;
}

button { transition: transform .13s cubic-bezier(.3,.7,.4,1.4); }
.entry:active, .chip:active, .tag-opt:active, .icon-btn:active, .baby-item:active { transform: scale(.965); }

/* ============ 顶部 ============ */
#topbar {
  position: relative;
  padding: calc(var(--safe-t) + 12px) 18px 12px;
  background: rgba(251,244,233,.92);
  backdrop-filter: saturate(1.5) blur(18px);
  -webkit-backdrop-filter: saturate(1.5) blur(18px);
  border-bottom: 1px solid rgba(92,62,40,.06);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}

/* 滚动时只留这一行：当前日期 + 日历按钮 */
#dateBar {
  position: sticky; top: 0; z-index: 35;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 18px;
  background: rgba(251,244,233,.92);
  backdrop-filter: saturate(1.5) blur(18px);
  -webkit-backdrop-filter: saturate(1.5) blur(18px);
  border-bottom: 1px solid rgba(92,62,40,.06);
}
#dateBar .db-date {
  flex: 1; text-align: center;
  font-family: var(--serif); font-size: 15px; font-weight: 600;
  color: var(--ink-2); letter-spacing: .01em;
}
#dateBar .db-cal {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; color: var(--ink-2);
}
#dateBar .db-cal:active { background: var(--line-2); }
#dateBar .db-cal svg { width: 19px; height: 19px; }

/* 头像行底部小花小草装饰（置于文字背后，柔色不抢视线） */
.top-deco {
  position: absolute; left: 0; right: 0; bottom: 0;
  width: 100%; height: 40px; z-index: -1;
  pointer-events: none; opacity: .55;
}

.baby-switch {
  display: flex; align-items: center; gap: 12px;
  padding: 4px 12px 4px 4px; border-radius: 999px;
  transition: background .16s; max-width: 70%;
}
.baby-switch:active { background: rgba(92,62,40,.05); }
.bs-txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; min-width: 0; }
.bs-txt strong { font-size: 19px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40vw; letter-spacing: .01em; }
.bs-txt em { font-style: normal; font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.caret { width: 15px; height: 15px; stroke: var(--ink-3); stroke-width: 2.2; flex: none; }

.avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  background: var(--rose-soft) center/cover no-repeat;
  color: var(--rose-d);
  display: grid; place-items: center;
  font-size: 17px; font-weight: 600; font-family: var(--serif);
  box-shadow: 0 0 0 2px var(--card), 0 0 0 3.5px var(--rose-soft), 0 2px 8px rgba(92,62,40,.10);
}
.avatar.big { width: 78px; height: 78px; font-size: 29px; }

.top-actions { display: flex; gap: 4px; flex: none; }
.icon-btn {
  width: 39px; height: 39px; border-radius: 50%; display: grid; place-items: center;
  color: var(--ink-2); position: relative; transition: background .16s, transform .13s;
}
.icon-btn:active { background: rgba(92,62,40,.06); }
.icon-btn svg { width: 20px; height: 20px; }
.dot-badge {
  position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--clay); box-shadow: 0 0 0 2px var(--bg);
}

/* ============ 页面 ============ */
#app { padding: 18px 18px calc(118px + var(--safe-b)); max-width: 660px; margin: 0 auto; }
.page { animation: rise .38s cubic-bezier(.2,.8,.3,1); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ============ 洞察卡片 ============ */
.insights { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.insight {
  background: var(--card); border-radius: var(--radius-s); padding: 13px 12px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px;
  border: 1px solid rgba(92,62,40,.04);
  animation: rise .4s cubic-bezier(.2,.8,.3,1) both;
}
.insights .insight:nth-child(2) { animation-delay: .04s; }
.insights .insight:nth-child(3) { animation-delay: .08s; }
.insights .insight:nth-child(4) { animation-delay: .12s; }
.insight .ins-l { font-size: 11px; color: var(--ink-3); letter-spacing: .02em; }
.insight .ins-v { font-size: 21px; letter-spacing: -.01em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.insight .ins-s { font-size: 10.5px; color: var(--ink-3); line-height: 1.3; }
.insight.rose .ins-v { color: var(--rose-d); }
.insight.sage .ins-v { color: var(--sage); }
.insight.clay .ins-v { color: var(--clay); }
.insight.warn { background: var(--amber-soft); }
.insight.warn .ins-v { color: #9E7A2E; }
.insight.milk { background: var(--milk-soft); }
.insight.milk .ins-v { color: var(--milk); }
.insight.sleep { background: var(--sleep-soft); }
.insight.sleep .ins-v { color: var(--sleep); }
.insight.vaccine { background: var(--vaccine-soft); }
.insight.vaccine .ins-v { color: var(--vaccine); }

/* 喂奶总结卡片（年/月/周/天），可点击打开本周日期选择 */
.feed-sum { grid-column: 1 / -1; cursor: pointer; }
.feed-sum:active { transform: scale(.992); }
.feed-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 9px 0 7px; }
.feed-grid div { display: flex; flex-direction: column; gap: 1px; }
.feed-grid b { font-size: 11px; color: var(--ink-3); font-weight: 600; }
.feed-grid span { font-size: 15px; font-weight: 700; color: var(--milk); font-variant-numeric: tabular-nums; }
.feed-sum.sleep .feed-grid span { color: var(--sleep); }
.feed-sum.vaccine .feed-grid span { color: var(--vaccine); }

/* 当日较昨日增减对比徽标 */
.feed-grid .delta {
  font-style: normal;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.25;
  margin-top: 1px;
  white-space: nowrap;
}
.feed-grid .delta.up { color: #2f9e44; }
.feed-grid .delta.down { color: #e03131; }
.feed-grid .delta.flat { color: var(--ink-3); }

/* 体重总结卡片（成长页 · 逻辑同喂奶总结，可点击选某天） */
.weight-sum-card { padding: 0; overflow: hidden; }
.weight-sum {
  grid-column: auto; width: 100%; box-shadow: none; border: 0; border-radius: 0;
  padding: 15px 16px; cursor: pointer;
}
.weight-sum:active { transform: scale(.992); }
.weight-sum .feed-grid span { color: var(--rose-d); }

/* ============ 日期提示 / 筛选 ============ */
.date-pill {
  display: inline-flex; align-items: center; gap: 7px; margin-bottom: 13px;
  padding: 6px 8px 6px 14px; border-radius: 999px;
  background: var(--rose-soft); color: var(--rose-d); font-size: 13px;
  box-shadow: var(--shadow);
}
.date-pill > svg { width: 15px; height: 15px; }
.date-pill button { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: rgba(92,62,40,.08); }
.date-pill button svg { width: 10px; height: 10px; stroke-width: 2.6; }

.filter-bar { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; margin-bottom: 13px; scrollbar-width: none; }
.filter-bar::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 8px 16px; border-radius: 999px; font-size: 13px;
  background: var(--card); color: var(--ink-2); box-shadow: var(--shadow); transition: .18s;
  border: 1px solid rgba(92,62,40,.04);
}
.chip.on { background: var(--ink); color: #FFF8EF; box-shadow: var(--shadow-m); }

.search-box { margin-bottom: 13px; }
.search-box input {
  width: 100%; padding: 12px 16px; border-radius: var(--radius-s); border: 1px solid rgba(92,62,40,.05);
  background: var(--card); box-shadow: var(--shadow); outline: none;
}

/* ============ 时间轴 ============ */
.day-group { margin-bottom: 22px; }
.day-head {
  display: flex; align-items: baseline; gap: 9px; padding: 0 4px 10px;
  position: sticky; top: 0; z-index: 5;
  background: linear-gradient(rgba(251,244,233,.96) 66%, rgba(251,244,233,0));
  padding-top: 5px;
}
.day-head b { font-size: 17px; }
.day-head span { font-size: 11.5px; color: var(--ink-3); }
.day-head em {
  font-style: normal; font-size: 10.5px; color: var(--rose-d); margin-left: auto;
  background: var(--rose-soft); padding: 2px 10px; border-radius: 999px; letter-spacing: .02em;
}
.day-head { cursor: pointer; }
.day-head em + .day-open { margin-left: 0; }
.day-open { width: 16px; height: 16px; stroke: var(--ink-3); stroke-width: 2.2; margin-left: 2px; flex: none; }
.day-head:active .day-open { transform: translateX(2px); }
.day-open { transition: transform .16s; }

/* ============ 当日详情 ============ */
.day-summary {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px;
}
.day-summary span {
  font-size: 12px; color: var(--rose-d); background: var(--rose-soft);
  padding: 4px 12px; border-radius: 999px; font-variant-numeric: tabular-nums;
}
.day-empty {
  text-align: center; color: var(--ink-3); font-size: 13.5px;
  padding: 40px 16px; background: var(--line-2); border-radius: var(--radius-s);
}

/* ============ 当日面板 · 周一到周日主题色（保持温馨） ============ */
#daySheet[data-weekday="1"] { --t:#C76B5A; --t-d:#B25344; --t-soft:#F8E6DE; --t-card:#FDF3F0; --t-grad:linear-gradient(135deg,#D57F6B,#C25A48); }
#daySheet[data-weekday="2"] { --t:#7FA489; --t-d:#5E8270; --t-soft:#E7F0E6; --t-card:#F4F8F4; --t-grad:linear-gradient(135deg,#93B49C,#6E937B); }
#daySheet[data-weekday="3"] { --t:#D0965F; --t-d:#A9723D; --t-soft:#F8EAD9; --t-card:#FCF5EC; --t-grad:linear-gradient(135deg,#E0A977,#CC8A4E); }
#daySheet[data-weekday="4"] { --t:#8FA8BB; --t-d:#5E7D96; --t-soft:#EAF0F5; --t-card:#F4F8FB; --t-grad:linear-gradient(135deg,#A6BCCB,#7C99AE); }
#daySheet[data-weekday="5"] { --t:#CE9B3F; --t-d:#9E7A2E; --t-soft:#F8EEDA; --t-card:#FBF6E9; --t-grad:linear-gradient(135deg,#DDB255,#C0902F); }
#daySheet[data-weekday="6"] { --t:#C96B90; --t-d:#A84872; --t-soft:#FBE8F0; --t-card:#FDF3F8; --t-grad:linear-gradient(135deg,#D97FA2,#BE5680); }
#daySheet[data-weekday="0"] { --t:#A98AB0; --t-d:#7E5E86; --t-soft:#F1E7F2; --t-card:#F8F3F9; --t-grad:linear-gradient(135deg,#BC9DC2,#9A7BA2); }

#daySheet .sheet-head {
  border-bottom-color: rgba(92,62,40,.06);
  background: linear-gradient(180deg, var(--t-soft), #fff 82%);
}
#daySheet .day-head-inner { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 0; }
#daySheet .sheet-head h3 { color: var(--t-d); }
#daySheet .day-weekday {
  display: inline-flex; align-items: center; gap: 6px; width: max-content;
  font-size: 12px; font-weight: 700; letter-spacing: .06em;
  color: var(--t-d); background: var(--t-soft);
  padding: 4px 12px; border-radius: 999px;
}
#daySheet .day-weekday::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--t); }
#daySheet #dayAdd { background: var(--t-grad); color: #fff; box-shadow: 0 6px 16px rgba(150,110,80,.22); }
#daySheet #dayAdd:active { opacity: .85; }
#daySheet .day-summary span { color: var(--t-d); background: var(--t-soft); }
#daySheet .day-entry {
  background: var(--t-card);
  border: 1px solid rgba(92,62,40,.05);
  border-left: 3px solid var(--t);
  box-shadow: var(--shadow);
  animation: dayIn .42s both;
}
#daySheet .day-entry:nth-child(2) { animation-delay: .04s; }
#daySheet .day-entry:nth-child(3) { animation-delay: .08s; }
#daySheet .day-entry:nth-child(4) { animation-delay: .12s; }
#daySheet .day-entry:nth-child(5) { animation-delay: .16s; }
#daySheet .day-entry:nth-child(n+6) { animation-delay: .2s; }
#daySheet .day-entry:active { transform: translateY(-1px); box-shadow: var(--shadow-m); }
#daySheet .de-btn { color: var(--t-d); background: #fff; }
#daySheet .de-btn.danger { color: #B8544A; }
#daySheet .day-empty { background: var(--t-card); color: var(--t-d); }

/* 类型小标题：主时间轴用类型色，当日面板用周主题色 */
.day-sec { display: flex; align-items: center; gap: 8px; margin: 17px 2px 9px; }
.day-sec-dot { width: 8px; height: 8px; border-radius: 3px; background: var(--sec-c, var(--rose)); flex: none; }
.day-sec h4 { margin: 0; font-size: 13.5px; font-weight: 700; letter-spacing: .02em; color: var(--ink); font-family: var(--serif); }
.day-sec-meta { margin-left: auto; font-size: 11.5px; color: var(--sec-c-d, var(--rose-d)); font-variant-numeric: tabular-nums; }
.day-sec.sec-media { --sec-c: var(--sage); --sec-c-d: #5E8270; }
.day-sec.sec-feeding { --sec-c: var(--milk); --sec-c-d: #A84872; }
.day-sec.sec-sleep { --sec-c: var(--sleep); --sec-c-d: #5E5280; }
.day-sec.sec-vaccine { --sec-c: var(--vaccine); --sec-c-d: #4A857E; }
.day-sec.sec-weight { --sec-c: var(--blue); --sec-c-d: #5E7D96; }
.day-sec.sec-milestone { --sec-c: var(--amber); --sec-c-d: #9E7A2E; }
.day-sec.sec-food { --sec-c: var(--food); --sec-c-d: #B26A39; }
.day-sec.sec-stool { --sec-c: var(--stool); --sec-c-d: #876B53; }
.day-sec.sec-temp { --sec-c: var(--temp); --sec-c-d: #B24B41; }
.day-sec.sec-task { --sec-c: var(--task); --sec-c-d: #4E8570; }
.day-sec.sec-diary { --sec-c: var(--rose); --sec-c-d: var(--rose-d); }
#daySheet .day-sec { --sec-c: var(--t); --sec-c-d: var(--t-d); }

@keyframes dayIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { #daySheet .day-entry { animation: none; } }
.day-entry {
  background: var(--line-2); border-radius: var(--radius-s);
  padding: 13px 14px; margin-bottom: 11px; border: 1px solid rgba(92,62,40,.04);
}
.de-top { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; flex-wrap: wrap; }
.de-time { font-size: 11px; color: var(--ink-3); margin-left: auto; font-variant-numeric: tabular-nums; }
.de-text { font-size: 14.5px; line-height: 1.72; white-space: pre-wrap; word-break: break-word; }
.de-media { display: grid; gap: 3px; margin-top: 11px; border-radius: 14px; overflow: hidden; }
.de-media.n1 { grid-template-columns: 1fr; }
.de-media.n2 { grid-template-columns: 1fr 1fr; }
.de-media.n3, .de-media.n4, .de-media.n-many { grid-template-columns: 1fr 1fr 1fr; }
.de-foot { display: flex; align-items: center; gap: 7px; margin-top: 11px; flex-wrap: wrap; }
.de-btn {
  margin-left: auto; font-size: 12.5px; color: var(--rose-d); font-weight: 600;
  padding: 5px 14px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow);
}
.de-btn + .de-btn { margin-left: 0; }
.de-btn.danger { color: #B8544A; }

.entry {
  background: var(--card); border-radius: var(--radius); padding: 16px 17px;
  box-shadow: var(--shadow); margin-bottom: 11px; transition: transform .16s, box-shadow .16s;
  border: 1px solid rgba(92,62,40,.04);
}
.entry:active { box-shadow: var(--shadow-m); }

.entry-top { display: flex; align-items: center; gap: 7px; margin-bottom: 9px; flex-wrap: wrap; }
.badge { font-size: 11px; padding: 4px 10px; border-radius: 8px; font-weight: 600; letter-spacing: .02em; }
.badge.b-diary { background: var(--rose-soft); color: var(--rose-d); }
.badge.b-media { background: var(--sage-soft); color: #5E8270; }
.badge.b-weight { background: var(--blue-soft); color: #5E7D96; }
.badge.b-milestone { background: var(--amber-soft); color: #9E7A2E; }
.badge.b-feeding { background: var(--milk-soft); color: var(--milk); }
.badge.b-sleep { background: var(--sleep-soft); color: var(--sleep); }
.badge.b-vaccine { background: var(--vaccine-soft); color: var(--vaccine); }
.badge.b-food { background: var(--food-soft); color: var(--food); }
.badge.b-stool { background: var(--stool-soft); color: var(--stool); }
.badge.b-temp { background: var(--temp-soft); color: var(--temp); }
.badge.b-task { background: var(--task-soft); color: var(--task); }
.author {
  font-size: 11px; padding: 4px 10px; border-radius: 8px;
  background: var(--line-2); color: var(--ink-2);
}
.baby-tag {
  font-size: 11px; padding: 4px 10px; border-radius: 8px;
  background: var(--clay-soft); color: #9C6F4C;
}
.entry-time { font-size: 11px; color: var(--ink-3); margin-left: auto; font-variant-numeric: tabular-nums; }

.entry-text { white-space: pre-wrap; word-break: break-word; font-size: 14.5px; line-height: 1.72; }
.entry-text.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

.entry-media { display: grid; gap: 3px; margin-top: 12px; border-radius: 16px; overflow: hidden; }
.entry-media.n1 { grid-template-columns: 1fr; }
.entry-media.n2 { grid-template-columns: 1fr 1fr; }
.entry-media.n3, .entry-media.n4, .entry-media.n-many { grid-template-columns: 1fr 1fr 1fr; }
.media-cell { position: relative; aspect-ratio: 1; background: var(--line-2); overflow: hidden; }
.media-cell.n1 { aspect-ratio: 4/3; }
.media-cell img, .media-cell video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-cell .play { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(46,32,22,.22); pointer-events: none; }
.media-cell .play svg { width: 32px; height: 32px; stroke: #fff; fill: rgba(255,255,255,.32); }
.media-more { position: absolute; right: 6px; bottom: 6px; background: rgba(46,32,22,.6); color: #fff; font-size: 11px; padding: 1px 8px; border-radius: 999px; }

.entry-foot { display: flex; gap: 7px; align-items: center; margin-top: 11px; flex-wrap: wrap; }
.tag-mini { font-size: 11px; padding: 4px 11px; border-radius: 8px; background: var(--line-2); color: var(--ink-2); }
.measure-inline { font-size: 13.5px; color: var(--ink-2); }
.measure-inline b { color: var(--blue); font-size: 15px; font-variant-numeric: tabular-nums; }

.feed-inline { font-size: 13.5px; color: var(--ink-2); display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.feed-time { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; font-family: var(--serif); }
.feed-kind { color: var(--milk); font-weight: 600; }
.feed-inline b { color: var(--milk); font-size: 16px; font-variant-numeric: tabular-nums; }
.detail-feed { margin-top: 13px; }
.detail-feed b { font-size: 22px; color: var(--milk); font-weight: 700; font-family: var(--serif); }

.empty { text-align: center; padding: 66px 20px; color: var(--ink-3); }
.empty-art {
  width: 104px; height: 104px; margin: 0 auto 20px; border-radius: 32px;
  background: linear-gradient(135deg, #F8E6DE, #F2D9CD) center/50px no-repeat;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C76B5A' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='3'/%3E%3Ccircle cx='9' cy='10' r='1.8'/%3E%3Cpath d='M4 17l5-4 4 3 3-2 4 3'/%3E%3C/svg%3E");
  box-shadow: 0 8px 24px rgba(199,107,90,.18), inset 0 0 0 1px rgba(255,255,255,.5);
}
.empty p { margin: 0 0 6px; color: var(--ink-2); font-weight: 600; font-size: 17px; }
.empty span { font-size: 13px; }

/* ============ 卡片 ============ */
.card {
  background: var(--card); border-radius: var(--radius); padding: 19px;
  box-shadow: var(--shadow); margin-bottom: 15px;
  border: 1px solid rgba(92,62,40,.04);
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; }
.card-head h2 { font-size: 17px; }
.link-btn { font-size: 13.5px; color: var(--rose-d); font-weight: 500; padding: 2px 4px; }

.seg { display: flex; background: var(--line-2); border-radius: 12px; padding: 3px; gap: 2px; }
.seg.wrap { flex-wrap: wrap; }
.seg.wrap button { flex: 0 1 auto; }
.seg button { padding: 8px 13px; border-radius: 9px; font-size: 13px; color: var(--ink-2); flex: 1; transition: .16s; white-space: nowrap; }
.seg button.on { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 1px 4px rgba(92,62,40,.10); }
.seg.small button { padding: 5px 11px; font-size: 12px; }

/* ============ WHO 卡片 ============ */
.who-card { padding: 20px; }
.who-top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 4px; }
.who-top span { font-size: 12.5px; color: var(--ink-3); }
.who-top b { font-size: 24px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.who-desc { font-size: 12.5px; color: var(--ink-2); margin: 0 0 14px; }
.who-bar { height: 8px; border-radius: 999px; background: linear-gradient(90deg, var(--blue-soft), var(--sage-soft) 45%, var(--amber-soft)); position: relative; }
.who-bar i {
  position: absolute; top: 50%; width: 15px; height: 15px; border-radius: 50%;
  background: var(--card); border: 3px solid var(--ink); transform: translate(-50%, -50%);
  box-shadow: 0 1px 5px rgba(92,62,40,.22);
}
.who-scale { display: flex; justify-content: space-between; font-size: 10px; color: var(--ink-3); margin-top: 6px; }
.who-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin-top: 5px; }
.who-item { border-left: 3px solid var(--line); padding-left: 12px; border-radius: 2px; }
.who-item.w { border-color: var(--rose); }
.who-item.h { border-color: var(--sage); }
.who-item span { display: block; font-size: 11px; color: var(--ink-3); }
.who-item b { font-size: 18px; font-variant-numeric: tabular-nums; }
.who-item em { font-style: normal; font-size: 11px; color: var(--ink-3); display: block; line-height: 1.4; }
.who-note { font-size: 10.5px; color: var(--ink-3); margin: 15px 0 0; line-height: 1.5; }

/* ============ 图表 ============ */
.chart { width: 100%; height: 180px; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart .grid { stroke: var(--line-2); stroke-width: 1; }
.chart .ref { stroke: var(--ink-3); stroke-width: 1.4; stroke-dasharray: 3 3; opacity: .55; }
.chart .axis-t { font-size: 10px; fill: var(--ink-3); }
.chart .dot-c { fill: var(--card); stroke-width: 2.4; }
.legend { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-3); margin-top: 10px; }
.legend .dot { margin-left: 12px; }
.legend .dot:first-child { margin-left: 0; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.rose { background: var(--rose); }
.dot.sage { background: var(--sage); }
.dot.blue { background: var(--blue); }
.dot.ghost { background: var(--ink-3); opacity: .5; }

.measure-list .m-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.measure-list .m-row:last-child { border-bottom: none; }
.measure-list .m-date { font-size: 13px; color: var(--ink-2); width: 74px; flex: none; font-variant-numeric: tabular-nums; }
.measure-list .m-val { font-size: 14px; }
.measure-list .m-val b { color: var(--blue); }
.measure-list .m-delta { margin-left: auto; font-size: 12px; color: var(--sage); font-weight: 600; }
.measure-list .m-delta.down { color: var(--ink-3); }

/* ============ 月度回顾 ============ */
.month-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; padding: 0 2px; }
.month-nav b { font-size: 19px; }
.month-nav button { width: 37px; height: 37px; border-radius: 50%; display: grid; place-items: center; background: var(--card); box-shadow: var(--shadow); color: var(--ink-2); border: 1px solid rgba(92,62,40,.04); }
.month-nav button:active { background: var(--line-2); }

.rev-hero {
  border-radius: var(--radius); overflow: hidden; background: var(--card);
  box-shadow: var(--shadow); margin-bottom: 15px; padding: 18px;
  border: 1px solid rgba(92,62,40,.04);
}
.rev-title { display: flex; align-items: baseline; gap: 9px; margin-bottom: 13px; }
.rev-title b { font-size: 19px; }
.rev-title span { font-size: 12px; color: var(--ink-3); }
.rev-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; border-radius: 16px; overflow: hidden; }
.rev-photos div { aspect-ratio: 1; background: var(--line-2) center/cover no-repeat; }
.rev-photos.p1 { grid-template-columns: 1fr; }
.rev-photos.p1 div { aspect-ratio: 4/3; }
.rev-photos.p2 { grid-template-columns: 1fr 1fr; }
.rev-empty { padding: 28px; text-align: center; color: var(--ink-3); font-size: 13px; background: var(--line-2); border-radius: 16px; }
.rev-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 16px; }
.rev-stat { text-align: center; }
.rev-stat b { display: block; font-size: 19px; color: var(--rose-d); font-variant-numeric: tabular-nums; }
.rev-stat span { font-size: 10.5px; color: var(--ink-3); }
.rev-sec { margin-bottom: 15px; }
.rev-sec h3 { font-size: 14px; margin-bottom: 10px; color: var(--ink-2); }
.rev-ms { display: flex; flex-wrap: wrap; gap: 8px; }
.rev-line { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.rev-line:last-child { border-bottom: none; }
.rev-line .rl-d { color: var(--ink-3); font-size: 12px; width: 46px; flex: none; font-variant-numeric: tabular-nums; }
.rev-line .rl-t { flex: 1; }

/* ============ 我的 ============ */
.baby-list { display: flex; flex-direction: column; gap: 10px; }
.baby-item {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  border-radius: var(--radius-s); background: var(--line-2); transition: .16s;
  border: 1px solid rgba(92,62,40,.03);
}
.baby-item.on { background: var(--rose-soft); box-shadow: inset 0 0 0 1.5px var(--rose); }
.baby-item .bi-txt { flex: 1; display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.baby-item .bi-txt strong { font-size: 15.5px; font-weight: 600; font-family: var(--serif); }
.baby-item .bi-txt span { font-size: 11.5px; color: var(--ink-3); }
.baby-item .bi-btn { font-size: 12px; color: var(--ink-2); padding: 6px 12px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow); }

.row-btn { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 2px; border-bottom: 1px solid var(--line-2); text-align: left; font-size: 14.5px; }
.row-btn:last-child { border-bottom: none; }
.row-btn svg { flex: none; stroke: var(--ink-2); }
.row-btn em { font-style: normal; font-size: 11.5px; color: var(--ink-3); margin-left: auto; text-align: right; }
.row-btn:active { opacity: .55; }
.row-btn.danger { color: #B8544A; }
.row-btn.danger svg { stroke: #B8544A; }

.storage-info { font-size: 13px; color: var(--ink-2); }
.storage-bar { height: 8px; background: var(--line-2); border-radius: 999px; overflow: hidden; margin: 10px 0 7px; }
.storage-bar i { display: block; height: 100%; background: var(--rose-grad); border-radius: 999px; }
.foot-note { font-size: 11.5px; color: var(--ink-3); text-align: center; padding: 8px 20px 22px; line-height: 1.65; }
.hint { font-size: 11.5px; color: var(--ink-3); margin: 8px 0 0; line-height: 1.6; }

/* 装到桌面引导（面板已移除，仅保留原生 beforeinstallprompt） */

/* ============ FAB ============ */
#fab {
  position: fixed; right: 18px; bottom: calc(96px + var(--safe-b)); z-index: 45;
  width: 58px; height: 58px; border-radius: 20px;
  background: var(--rose-grad); color: #fff; display: grid; place-items: center;
  box-shadow: var(--shadow-warm); transition: transform .16s;
}
#fab svg { width: 25px; height: 25px; stroke-width: 2.3; }
#fab:active { transform: scale(.9); }

/* ============ 底部导航（悬浮胶囊） ============ */
#tabbar {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + var(--safe-b)); z-index: 50;
  max-width: 460px; margin: 0 auto;
  display: flex; background: rgba(255,252,247,.9);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(92,62,40,.06);
  border-radius: 22px; box-shadow: var(--shadow-m);
  padding-bottom: 0;
}
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 0 9px; color: var(--ink-3); font-size: 10.5px; position: relative; }
.tab svg { width: 22px; height: 22px; }
.tab.on { color: var(--rose-d); font-weight: 600; }
.tab.on::after { content: ''; width: 4px; height: 4px; border-radius: 50%; background: var(--rose); }

/* ============ 弹层 ============ */
.sheet { position: fixed; inset: 0; z-index: 100; }
.sheet-mask { position: absolute; inset: 0; background: rgba(50,36,26,.42); animation: fadeIn .22s; backdrop-filter: blur(2px); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.sheet-body {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 92vh;
  background: var(--card); border-radius: 28px 28px 0 0;
  display: flex; flex-direction: column; box-shadow: var(--shadow-l);
  animation: up .34s cubic-bezier(.22,.9,.3,1);
  overflow: hidden;            /* 让子元素自己滚动，避免外层整页被顶开 */
}
@keyframes up { from { transform: translateY(100%); } to { transform: none; } }
.sheet-handle { width: 40px; height: 4px; background: var(--line); border-radius: 999px; margin: 10px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-bottom: 1px solid var(--line-2); flex: none; }
.sheet-head h3 { font-size: 17px; flex: 1; }
.head-actions { display: flex; gap: 4px; }
.sheet-close { width: 30px; height: 30px; display: grid; place-items: center; color: var(--ink-3); flex: none; border-radius: 50%; }
.sheet-close:active { background: var(--line-2); }
.sheet-save { padding: 8px 18px; border-radius: 999px; background: var(--ink); color: #FFF8EF; font-size: 14px; font-weight: 500; flex: none; }
.sheet-save.ghost { background: var(--line-2); color: var(--ink-2); }
.sheet-save.ghost.danger { color: #B8544A; }
.sheet-save:active { opacity: .7; }
.sheet-scroll { overflow-y: auto; padding: 18px 20px calc(24px + var(--safe-b)); -webkit-overflow-scrolling: touch; }

/* ============ 表单 ============ */
.field { display: block; margin-bottom: 17px; }
.field > span { display: block; font-size: 12.5px; color: var(--ink-3); margin-bottom: 8px; letter-spacing: .01em; }
.field input, .field textarea {
  width: 100%; padding: 13px 15px; border-radius: var(--radius-s);
  border: 1.5px solid var(--line); background: #FFFDF9; outline: none;
  transition: border-color .16s, background .16s; resize: none;
}
.field input:focus, .field textarea:focus { border-color: var(--rose); background: #fff; }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }
.counter { display: block; text-align: right; font-size: 11px; color: var(--ink-3); margin-top: 4px; }

.date-input { display: flex; gap: 8px; align-items: center; }
.date-input input { flex: 1; min-width: 0; }
.date-input button { width: 47px; height: 47px; flex: none; border-radius: var(--radius-s); background: var(--rose-soft); color: var(--rose-d); display: grid; place-items: center; }

.type-picker { display: flex; gap: 8px; padding: 15px 18px 7px; overflow-x: auto; flex: none; flex-wrap: wrap; }
.type-picker button {
  flex: 1 1 calc(33.333% - 8px); min-width: 74px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 6px; border-radius: var(--radius-s); background: var(--line-2); color: var(--ink-2); font-size: 12px; transition: .16s;
}
.type-picker button.on { background: var(--ink); color: #FFF8EF; }
.type-picker svg { width: 22px; height: 22px; }

.tag-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-opt { padding: 8px 15px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); font-size: 13px; transition: .16s; }
.tag-opt.on { background: var(--ink); color: #FFF8EF; }

.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.add-media {
  aspect-ratio: 1; border-radius: var(--radius-s); border: 1.5px dashed var(--line);
  background: var(--line-2); color: var(--ink-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
}
.add-media em { font-style: normal; font-size: 12px; }
.media-item { position: relative; aspect-ratio: 1; border-radius: var(--radius-s); overflow: hidden; background: var(--line-2); }
.media-item img, .media-item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-del { position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; border-radius: 50%; background: rgba(46,32,22,.55); color: #fff; display: grid; place-items: center; }
.media-del svg { width: 12px; height: 12px; stroke-width: 2.6; }
.media-badge { position: absolute; left: 5px; bottom: 5px; background: rgba(46,32,22,.55); color: #fff; font-size: 10px; padding: 1px 7px; border-radius: 999px; }

.avatar-pick { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 20px; }
.btn-ghost { padding: 8px 16px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); font-size: 13px; }

/* ============ 详情 ============ */
.detail-media { display: grid; gap: 6px; margin-bottom: 16px; }
.detail-media .dm { border-radius: 16px; overflow: hidden; background: var(--line-2); }
.detail-media img, .detail-media video { width: 100%; display: block; }
.detail-text { font-size: 15px; white-space: pre-wrap; word-break: break-word; line-height: 1.78; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.detail-measure { display: flex; gap: 24px; padding: 15px 17px; background: var(--blue-soft); border-radius: var(--radius-s); margin-bottom: 15px; }
.detail-measure div { display: flex; flex-direction: column; }
.detail-measure span { font-size: 11px; color: var(--ink-3); }
.detail-measure b { font-size: 22px; color: #5E7D96; font-variant-numeric: tabular-nums; }
.detail-placeholder { color: var(--ink-3); font-size: 13.5px; }
.detail-meta { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }

/* ============ 全屏查看 ============ */
.viewer { position: fixed; inset: 0; z-index: 200; background: #241E1A; display: flex; flex-direction: column; }
.viewer-close { position: absolute; top: calc(var(--safe-t) + 12px); right: 14px; z-index: 3; width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; display: grid; place-items: center; }
.viewer-stage { flex: 1; display: grid; place-items: center; overflow: hidden; padding: 56px 8px 8px; }
.viewer-stage img, .viewer-stage video { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer-nav { display: flex; align-items: center; justify-content: center; gap: 24px; padding: 12px 16px calc(18px + var(--safe-b)); color: #fff; font-size: 13px; }
.viewer-nav button { color: #fff; padding: 8px 17px; border-radius: 999px; background: rgba(255,255,255,.13); }

/* ============ 日历 ============ */
.cal-nav { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px 13px; flex: none; }
.cal-nav b { font-size: 17px; font-family: var(--serif); font-weight: 600; }
.cal-nav button { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 50%; color: var(--ink-2); }
.cal-nav button:active { background: var(--line-2); }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); padding: 0 14px 6px; flex: none; }
.cal-week span { text-align: center; font-size: 11.5px; color: var(--ink-3); }
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; padding: 0 14px;
  flex: 1 1 0; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.cal-cell {
  position: relative; aspect-ratio: 1; display: grid; place-items: center;
  border-radius: 13px; font-size: 14.5px; transition: .14s; font-variant-numeric: tabular-nums;
}
.cal-cell.empty { visibility: hidden; }
.cal-cell.future { color: var(--ink-3); opacity: .45; }
.cal-cell.today { box-shadow: inset 0 0 0 1.5px var(--rose); font-weight: 650; color: var(--rose-d); }
.cal-cell.on { background: var(--ink); color: #FFF8EF; font-weight: 600; box-shadow: none; }
.cal-cell.has::after {
  content: ''; position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--sage);
}
.cal-cell.on.has::after { background: #fff; }
.cal-cell:active { background: var(--line-2); }
.cal-foot { padding: 13px 18px calc(20px + var(--safe-b)); border-top: 1px solid var(--line-2); margin-top: 13px; flex: none; }

/* 本周日期选择 */
.week-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; padding: 0 14px;
  flex: 1 1 0; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.week-cell {
  position: relative; aspect-ratio: 1; display: grid; place-items: center;
  border-radius: 13px; font-size: 15px; transition: .14s; font-variant-numeric: tabular-nums;
  background: var(--line-2); color: var(--ink);
}
.week-cell .wc-d { font-weight: 500; }
.week-cell.future { color: var(--ink-3); opacity: .45; }
.week-cell.today { box-shadow: inset 0 0 0 1.5px var(--milk); font-weight: 650; color: var(--milk); }
.week-cell.on { background: var(--milk); color: #FFF8EF; font-weight: 600; box-shadow: none; }
.week-cell.has .wc-dot {
  content: ''; position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--milk);
}
.week-cell.on.has .wc-dot { background: #fff; }
.week-cell:active { background: var(--line-2); filter: brightness(.97); }

/* ============ 家庭共享 ============ */
.code-card {
  background: linear-gradient(135deg, #3A2B20, #2C1F16); border-radius: var(--radius);
  padding: 22px; color: #FFF3E6; text-align: center; margin-bottom: 12px;
  box-shadow: var(--shadow-m);
}
.code-card span { display: block; font-size: 12px; opacity: .72; letter-spacing: .04em; }
.code-card b { display: block; font-size: 34px; letter-spacing: 7px; margin: 6px 0 14px; font-variant-numeric: tabular-nums; }
.code-card .btn-ghost { background: rgba(255,243,230,.16); color: #FFF3E6; }

/* 家庭邀请二维码 */
.invite-qr { text-align: center; margin: 6px 0 18px; }
.invite-qr-img {
  display: inline-block; padding: 12px; background: #fff; border-radius: 16px;
  box-shadow: 0 2px 10px rgba(92,62,40,.10);
}
.invite-qr-img img { display: block; width: 220px; height: 220px; }
.member-list { display: flex; flex-direction: column; gap: 8px; }
.member { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 7px 0; }
.member i {
  width: 28px; height: 28px; border-radius: 50%; flex: none; background: var(--rose-soft) center/15px no-repeat;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C76B5A' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='3.5'/%3E%3Cpath d='M5 20c0-3.6 3.1-5.5 7-5.5s7 1.9 7 5.5'/%3E%3C/svg%3E");
}
.member em { font-style: normal; font-size: 10.5px; padding: 2px 8px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); margin-left: 4px; }
.howto { margin-top: 8px; border-top: 1px solid var(--line-2); padding-top: 14px; }
.howto summary { font-size: 13px; color: var(--rose-d); cursor: pointer; }
.howto ol { padding-left: 18px; font-size: 12.5px; color: var(--ink-2); line-height: 1.85; }
.howto li { margin-bottom: 5px; }
.err { color: #B8544A; }

/* ============ 首次建档 ============ */
.setup {
  position: fixed; inset: 0; z-index: 300;
  background:
    radial-gradient(1000px 500px at 88% -10%, rgba(214,150,95,.18), transparent 60%),
    radial-gradient(800px 460px at -10% 0%, rgba(199,107,90,.13), transparent 55%),
    var(--bg);
  display: flex; align-items: center; justify-content: center; padding: 22px; overflow-y: auto;
}
.setup-card { width: 100%; max-width: 380px; }
.setup-mark {
  width: 66px; height: 66px; border-radius: 22px; margin-bottom: 22px;
  background: var(--rose-grad); box-shadow: var(--shadow-warm);
  position: relative;
}
.setup-mark::after {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M9 10h.01M15 10h.01'/%3E%3Cpath d='M8.5 14.5a4.5 4.5 0 007 0'/%3E%3C/svg%3E") center/34px no-repeat;
}
.setup-card h1 { font-size: 28px; margin-bottom: 7px; letter-spacing: -.01em; }
.setup-sub { margin: 0 0 28px; font-size: 13.5px; color: var(--ink-3); }
.btn-primary {
  width: 100%; padding: 15px; border-radius: var(--radius-s); background: var(--rose-grad); color: #fff;
  font-size: 16px; font-weight: 600; box-shadow: var(--shadow-warm); letter-spacing: .01em;
}
.btn-primary:active { opacity: .9; transform: scale(.99); }
.setup-tip { font-size: 11.5px; color: var(--ink-3); margin: 17px 0 0; line-height: 1.6; }

/* ============ Toast / Loading ============ */
.toast {
  position: fixed; left: 50%; bottom: calc(110px + var(--safe-b)); transform: translateX(-50%) translateY(12px);
  background: var(--ink); color: #FFF8EF; padding: 11px 21px; border-radius: 999px;
  font-size: 13.5px; z-index: 400; opacity: 0; pointer-events: none; transition: .26s cubic-bezier(.2,.8,.3,1);
  max-width: 80vw; text-align: center; box-shadow: 0 8px 24px rgba(50,36,26,.3);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.loading {
  position: fixed; inset: 0; z-index: 500; background: rgba(251,244,233,.85);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  color: var(--ink-2); font-size: 13.5px;
  backdrop-filter: blur(3px);
}
.spinner {
  width: 32px; height: 32px; border: 2.5px solid var(--line); border-top-color: var(--rose);
  border-radius: 50%; animation: spin .8s linear infinite;
}

/* ============ 动效降级 ============ */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ============ 温馨背景 ============ */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(120% 60% at 50% -10%, #FFF6E9 0%, rgba(255,246,233,0) 60%),
    radial-gradient(80% 50% at 100% 0%, #FBE7EC 0%, rgba(251,231,236,0) 55%),
    radial-gradient(70% 50% at 0% 100%, #E9F1E6 0%, rgba(233,241,230,0) 55%),
    var(--bg);
}
#topAvatar { cursor: pointer; }
#topAvatar::after {
  content: ''; position: absolute; right: -1px; bottom: -1px; width: 14px; height: 14px;
  border-radius: 50%; background: var(--rose-grad) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E") center/9px no-repeat;
  border: 2px solid var(--card); box-shadow: 0 1px 3px rgba(92,62,40,.25);
}

/* ============ 子页头部 ============ */
.sub-head {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: 16px 18px 12px; background: rgba(251,244,233,.86); backdrop-filter: blur(10px);
}
.sub-head h2 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; flex: 1; }
.sub-actions { display: flex; align-items: center; gap: 8px; }
.mini-select, .mini-btn {
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
  border-radius: 999px; padding: 7px 13px; font-size: 12.5px; font-family: inherit;
}
.mini-btn { color: var(--rose-d); border-color: var(--rose-soft); background: var(--rose-soft); }
.back-btn {
  width: 34px; height: 34px; border-radius: 50%; background: var(--card); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; color: var(--ink-2);
}
.back-btn svg { width: 20px; height: 20px; }

/* ============ 相册 ============ */
.album-count { margin: 2px 18px 6px; font-size: 12.5px; color: var(--ink-3); }
.album { padding: 4px 14px 30px; }
.album-date {
  display: flex; align-items: baseline; gap: 8px; margin: 18px 4px 9px;
}
.album-date b { font-size: 15px; font-weight: 700; color: var(--ink); }
.album-date span { font-size: 11.5px; color: var(--ink-3); }
.album-group {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
}
.album-cell {
  position: relative; aspect-ratio: 1/1; border-radius: 12px; overflow: hidden;
  background: var(--line-2); box-shadow: var(--shadow);
}
.album-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.album-cell.v::after {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M8 5l11 7-11 7z'/%3E%3C/svg%3E") center/30% no-repeat;
  background-color: rgba(40,28,18,.28);
}
.album-empty, .rel-tip, .album-tip {
  color: var(--ink-3); font-size: 13px; text-align: center; line-height: 1.7;
}
.album-empty { padding: 40px 30px; }
.album-tip { padding: 4px 18px 24px; }
.rel-tip { text-align: left; margin: 0 18px 12px; }

/* ============ 亲友团 ============ */
.rel-list { padding: 4px 16px 30px; }
.rel-card {
  display: flex; align-items: center; gap: 13px; padding: 14px 15px; margin-bottom: 11px;
  background: var(--card); border-radius: var(--radius-s); box-shadow: var(--shadow); cursor: pointer;
}
.rel-card:active { transform: scale(.99); }
.rel-av {
  width: 46px; height: 46px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
  background: var(--rose-grad); color: #fff; font-size: 19px; font-weight: 700;
}
.rel-info { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.rel-info strong { font-size: 15.5px; color: var(--ink); }
.rel-info strong i { font-style: normal; font-size: 11px; background: var(--rose-soft); color: var(--rose-d); padding: 1px 6px; border-radius: 999px; margin-left: 4px; }
.rel-info span { font-size: 12px; color: var(--ink-3); }
.rel-go { width: 20px; height: 20px; color: var(--ink-3); }

/* ============ 任务勾选 ============ */
.check-row { display: flex; align-items: center; gap: 10px; padding: 12px 2px; }
.check-row input { width: 20px; height: 20px; accent-color: var(--task); }
.check-row span { font-size: 14px; color: var(--ink-2); }
.task-done .task-dot { background: var(--task); }
.feed-inline.task-done { opacity: .55; }

/* ============ 成长册 ============ */
.book-body { padding: 4px 2px 10px; }
.book-cover {
  text-align: center; padding: 40px 20px; margin-bottom: 18px;
  background: var(--rose-grad); color: #fff; border-radius: var(--radius); box-shadow: var(--shadow-warm);
}
.book-cover h1 { font-size: 24px; margin: 0 0 8px; }
.book-cover p { margin: 0; opacity: .9; font-size: 13px; }
.book-month { margin-bottom: 22px; }
.book-month h2 {
  font-size: 17px; font-weight: 700; color: var(--ink); margin: 0 0 12px;
  padding-bottom: 7px; border-bottom: 2px solid var(--rose-soft);
}
.book-entry { background: var(--card); border-radius: var(--radius-s); padding: 13px 14px; margin-bottom: 11px; box-shadow: var(--shadow); }
.be-head { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.be-head span { font-size: 12.5px; color: var(--ink-3); }
.book-imgs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-bottom: 8px; }
.book-imgs img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 8px; }
.be-text { font-size: 13.5px; line-height: 1.7; color: var(--ink-2); margin: 0; white-space: pre-wrap; }

/* 长按时不要选中文字，体验更顺 */
.album-cell, .rel-card, .day-sec, .entry { -webkit-user-select: none; user-select: none; }

/* ================= 待处理提醒（置顶黄卡） ================= */
.insight.reminder {
  grid-column: 1 / -1;            /* 占满整行，置顶在喂奶记录上方 */
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(100deg, #FFF6DA, #FFEFBE);
  border: 1px solid #F4D98A;
  box-shadow: 0 6px 18px rgba(214, 169, 38, .18);
  cursor: pointer;
  animation: remPulse 2.4s ease-in-out infinite;
}
.insight.reminder .rem-dot {
  width: 10px; height: 10px; border-radius: 50%; flex: none;
  background: #F2B705; box-shadow: 0 0 0 4px rgba(242, 183, 5, .22);
}
.insight.reminder .rem-txt { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.insight.reminder .rem-txt b { font-size: 14px; color: #8A6D1A; }
.insight.reminder .rem-txt span {
  font-size: 11.5px; color: #9B7E2E;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.insight.reminder .ins-go { width: 20px; height: 20px; flex: none; fill: none; stroke: #C9A23B; stroke-width: 2; }
@keyframes remPulse {
  0%, 100% { box-shadow: 0 6px 18px rgba(214, 169, 38, .18); }
  50% { box-shadow: 0 6px 22px rgba(214, 169, 38, .34); }
}
@media (prefers-reduced-motion: reduce) { .insight.reminder { animation: none; } }

/* 提醒面板里的每条 */
.rem-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 4px; border-bottom: 1px solid var(--line);
}
.rem-item:last-child { border-bottom: none; }
.rem-item-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rem-item-txt b { font-size: 15px; color: var(--ink); }
.rem-item-txt span { font-size: 12px; color: var(--ink-3); }
.rem-done {
  flex: none; border: none; border-radius: 999px; padding: 8px 16px;
  background: linear-gradient(100deg, #F2B705, #E59A00); color: #fff;
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.rem-done:active { transform: scale(.96); }

/* 超窄屏：日历/周选单元格字号与圆角略缩，确保 7 列不溢出 */
@media (max-width: 360px) {
  .cal-cell, .week-cell { font-size: 13px; border-radius: 11px; }
  .cal-week span { font-size: 11px; }
}

/* 媒体存储（阿里云 OSS）小节 */
.oss-section { margin-top: 6px; padding-top: 14px; border-top: 1px dashed var(--line-2); }
.oss-section .field { margin-top: 8px; }

/* ============ 移动端体验增强（追加，不改现有规则） ============ */
/* 防 iOS 横屏/缩放时字号被系统异常放大 */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* 动态视口高度：手机浏览器地址栏收缩时不挤压/不抖动布局（支持的浏览器才生效） */
@supports (min-height: 100dvh) {
  body { min-height: 100dvh; }
}
/* 触摸目标下限：符合苹果人机指南 ≥44pt，避免小屏误触 */
.icon-btn, .chip, .seg button { min-height: 40px; }

