:root {
  --bg: #FFF9F4;
  --bg-grad: radial-gradient(circle at 12% 0%, #FFEDE3 0%, rgba(255,237,227,0) 55%),
             radial-gradient(circle at 92% 8%, #EAF4EF 0%, rgba(234,244,239,0) 45%);
  --card: #FFFFFF;
  --card-2: #FFFDFB;
  --primary: #F58A6B;
  --primary-dark: #E2745A;
  --primary-soft: #FFEFE8;
  --text: #2F2A26;
  --text-2: #6B6158;
  --muted: #9C9188;
  --line: #F2E9E1;
  --green: #5CA98A;
  --green-soft: #E9F5EF;
  --amber: #DCA054;
  --amber-soft: #FDF2E3;
  --red: #D96A5B;
  --red-soft: #FBEBE8;
  --blue: #6B9BCB;
  --blue-soft: #EDF3FA;
  --shadow: 0 6px 20px rgba(166, 132, 108, .08);
  --shadow-lg: 0 14px 40px rgba(166, 132, 108, .14);
  --radius: 20px;
  --radius-sm: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body {
  background-image: var(--bg-grad);
  background-repeat: no-repeat;
  background-attachment: fixed;
  min-height: 100vh;
}

button { font-family: inherit; color: inherit; border: none; background: none; cursor: pointer; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
.hidden { display: none !important; }

.app {
  max-width: 620px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  padding-bottom: calc(86px + var(--safe-b));
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 18px 8px;
  background: linear-gradient(to bottom, rgba(255, 249, 244, .96) 60%, rgba(255, 249, 244, 0));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.topbar-main { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-avatar {
  width: 42px; height: 42px; border-radius: 14px;
  background: linear-gradient(135deg, #FFE2D3, #FFF1E9);
  display: grid; place-items: center; font-size: 22px;
  box-shadow: inset 0 0 0 1px rgba(245, 138, 107, .18);
}
.brand-name { font-size: 16px; font-weight: 700; letter-spacing: .2px; }
.brand-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center; color: var(--text-2);
  background: rgba(255, 255, 255, .7);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: transform .15s;
}
.icon-btn:active { transform: scale(.94); }

/* ---------- 页面 ---------- */
.pages { padding: 4px 18px 0; }
.page { display: none; animation: fade .22s ease; }
.page.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- 今日主卡 ---------- */
.hero-card {
  position: relative;
  margin-top: 6px;
  padding: 22px 22px 20px;
  border-radius: 26px;
  background: linear-gradient(135deg, #FF9E7F 0%, #F58A6B 55%, #EE7E62 100%);
  color: #fff;
  box-shadow: 0 14px 30px rgba(233, 125, 96, .26);
  overflow: hidden;
}
.hero-card::after {
  content: "";
  position: absolute;
  right: -40px; top: -50px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
}
.hero-card::before {
  content: "";
  position: absolute;
  right: 30px; bottom: -70px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
}
.hero-label { font-size: 12.5px; opacity: .88; letter-spacing: .5px; }
.hero-time { font-size: 30px; font-weight: 700; margin: 4px 0 4px; letter-spacing: -.5px; }
.hero-hint { font-size: 13px; opacity: .9; }
.hero-meta {
  position: relative; z-index: 1;
  margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap;
}
.hero-chip {
  font-size: 12px; padding: 6px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .2);
  backdrop-filter: blur(4px);
}

/* ---------- 快捷按钮 ---------- */
.quick-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 10px; margin-top: 14px;
}
.quick-btn {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 13px 6px 11px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, .8);
  transition: transform .14s ease, box-shadow .14s ease;
}
.quick-btn:active { transform: scale(.96); box-shadow: 0 2px 8px rgba(166, 132, 108, .1); }
.q-ico { font-size: 22px; line-height: 1.2; }
.q-title { font-size: 13px; font-weight: 600; }
.q-sub { font-size: 10.5px; color: var(--muted); }
.quick-btn.nurse { background: linear-gradient(160deg, #FFF3EC, #FFFFFF 70%); }
.quick-btn.bottle { background: linear-gradient(160deg, #EFF7F3, #FFFFFF 70%); }
.quick-btn.formula { background: linear-gradient(160deg, #FFF8E9, #FFFFFF 70%); }
.quick-btn.diaper { background: linear-gradient(160deg, #EEF5FB, #FFFFFF 70%); }

/* ---------- 区块标题 ---------- */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 24px 2px 12px;
}
.section-head h2 { font-size: 16px; font-weight: 700; letter-spacing: .2px; }
.section-date { font-size: 12px; color: var(--muted); }
.link-btn { font-size: 13px; color: var(--primary); font-weight: 600; }

/* ---------- 统计卡 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stat-card {
  background: var(--card); border-radius: 16px; padding: 14px 8px 12px;
  text-align: center; box-shadow: var(--shadow);
}
.stat-ico { font-size: 17px; opacity: .9; }
.stat-val { font-size: 19px; font-weight: 700; margin-top: 4px; letter-spacing: -.3px; }
.stat-val .unit { font-size: 11px; font-weight: 500; color: var(--muted); margin-left: 1px; }
.stat-label { font-size: 11px; color: var(--muted); margin-top: 1px; }

/* ---------- 时间线 ---------- */
.timeline { position: relative; }
.tl-item {
  display: flex; gap: 12px; padding: 12px 14px; margin-bottom: 8px;
  background: var(--card); border-radius: 16px;
  box-shadow: var(--shadow);
  align-items: center;
  transition: transform .12s;
}
.tl-item:active { transform: scale(.99); }
.tl-ico {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 13px;
  display: grid; place-items: center; font-size: 19px;
}
.tl-ico.t-nurse { background: var(--primary-soft); }
.tl-ico.t-bottle { background: var(--green-soft); }
.tl-ico.t-formula { background: var(--amber-soft); }
.tl-ico.t-pump { background: var(--blue-soft); }
.tl-ico.t-diaper { background: var(--blue-soft); }
.tl-ico.t-sleep { background: #F1EEFA; }
.tl-ico.t-temp { background: var(--red-soft); }
.tl-ico.t-growth { background: var(--green-soft); }
.tl-ico.t-note { background: #F6F3EF; }
.tl-main { flex: 1; min-width: 0; }
.tl-title { font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.tl-sub { font-size: 12px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-time { font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; text-align: right; }
.tl-gap { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.empty { text-align: center; padding: 34px 20px; color: var(--muted); }
.empty-ico { font-size: 30px; margin-bottom: 8px; opacity: .8; }
.empty p { font-size: 13px; }

/* ---------- 贴士 ---------- */
.tip-card {
  margin-top: 18px; padding: 16px 18px;
  background: linear-gradient(135deg, #F1F8F4, #FBFDFC);
  border: 1px solid #E3F0E9;
  border-radius: 18px; font-size: 12.5px; color: #4C7D68; line-height: 1.65;
}
.tip-card b { color: #3C6B57; }

/* ---------- 日期条 ---------- */
.daybar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border-radius: 18px; padding: 10px 12px;
  box-shadow: var(--shadow); margin-top: 6px;
}
.day-nav {
  width: 40px; height: 40px; border-radius: 12px; font-size: 22px; color: var(--text-2);
  background: var(--bg); display: grid; place-items: center;
}
.day-nav:disabled { opacity: .3; }
.day-center { text-align: center; }
.day-title { font-size: 15px; font-weight: 700; }
.day-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.day-summary {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin: 12px 0 14px;
}
.ds-chip {
  font-size: 12px; padding: 6px 11px; border-radius: 10px;
  background: var(--card); color: var(--text-2);
  box-shadow: 0 2px 8px rgba(166, 132, 108, .06);
}
.ds-chip b { color: var(--text); font-weight: 700; }

/* ---------- FAB ---------- */
.fab {
  position: fixed; right: 22px;
  bottom: calc(100px + var(--safe-b));
  width: 56px; height: 56px; border-radius: 20px;
  background: linear-gradient(135deg, #FF9E7F, #F07B5C);
  color: #fff; font-size: 28px; font-weight: 300;
  display: grid; place-items: center;
  box-shadow: 0 12px 26px rgba(233, 125, 96, .36);
  z-index: 25;
  transition: transform .15s;
}
.fab:active { transform: scale(.92); }

/* ---------- 分析页 ---------- */
.score-card {
  display: flex; gap: 18px; align-items: center;
  background: var(--card); border-radius: 24px; padding: 20px 18px;
  box-shadow: var(--shadow); margin-top: 6px;
}
.score-ring { position: relative; flex: 0 0 120px; }
.score-num {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700; letter-spacing: -1px;
}
.score-num small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 2px; margin-top: 8px; }
.score-side { flex: 1; min-width: 0; }
.score-badge {
  display: inline-block; font-size: 11.5px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px;
  background: var(--green-soft); color: var(--green);
}
.score-badge.ok { background: var(--amber-soft); color: var(--amber); }
.score-badge.warn { background: var(--amber-soft); color: #C4843A; }
.score-badge.danger { background: var(--red-soft); color: var(--red); }
.score-title { font-size: 16px; font-weight: 700; margin: 8px 0 4px; }
.score-desc { font-size: 12.5px; color: var(--text-2); line-height: 1.6; }

.target-box {
  margin-top: 12px; background: var(--card); border-radius: 18px;
  padding: 16px; box-shadow: var(--shadow);
}
.tg-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.tg-row:last-child { margin-bottom: 0; }
.tg-label { font-size: 12.5px; color: var(--text-2); width: 62px; flex: 0 0 62px; }
.tg-bar { flex: 1; height: 8px; background: #F4EDE7; border-radius: 999px; overflow: hidden; }
.tg-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #FFB49A, #F58A6B); transition: width .5s cubic-bezier(.3,.8,.3,1); }
.tg-fill.good { background: linear-gradient(90deg, #8CCBB0, #5CA98A); }
.tg-fill.warn { background: linear-gradient(90deg, #F3C27E, #DCA054); }
.tg-val { font-size: 11.5px; color: var(--muted); width: 84px; text-align: right; flex: 0 0 84px; }

.advice-list { display: flex; flex-direction: column; gap: 10px; }
.advice-item {
  background: var(--card); border-radius: 16px; padding: 14px 15px;
  box-shadow: var(--shadow);
  border-left: 3px solid var(--line);
}
.advice-item.good { border-left-color: #8CCBB0; }
.advice-item.info { border-left-color: #A9C7E4; }
.advice-item.warn { border-left-color: #F0C182; }
.advice-item.danger { border-left-color: #E69888; background: #FFFCFB; }
.adv-head { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; }
.adv-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; }
.advice-item.good .adv-dot { background: #6FB89B; }
.advice-item.info .adv-dot { background: #7FAFD8; }
.advice-item.warn .adv-dot { background: #E5AE5F; }
.advice-item.danger .adv-dot { background: #D96A5B; }
.adv-title { font-size: 14px; font-weight: 700; }
.adv-text { font-size: 12.5px; color: var(--text-2); line-height: 1.7; white-space: pre-line; }

.disclaimer {
  margin: 18px 2px 8px; font-size: 11.5px; color: var(--muted); line-height: 1.7;
  padding: 12px 14px; background: rgba(255, 255, 255, .55);
  border-radius: 14px; border: 1px dashed var(--line);
}

/* ---------- 统计页 ---------- */
.seg {
  display: flex; background: #F5EEE8; border-radius: 14px; padding: 4px; gap: 4px; margin-top: 6px;
}
.seg-btn {
  flex: 1; padding: 9px 0; border-radius: 11px; font-size: 13px; color: var(--text-2); font-weight: 600;
  transition: all .18s;
}
.seg-btn.active { background: #fff; color: var(--text); box-shadow: 0 2px 8px rgba(166, 132, 108, .12); }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.sr-card { background: var(--card); border-radius: 16px; padding: 14px 12px; box-shadow: var(--shadow); }
.sr-val { font-size: 20px; font-weight: 700; letter-spacing: -.4px; }
.sr-val span { font-size: 11px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.sr-label { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.chart-card {
  background: var(--card); border-radius: 18px; padding: 16px 16px 10px;
  box-shadow: var(--shadow); margin-top: 12px;
}
.chart-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.chart-head h3 { font-size: 14px; font-weight: 700; }
.chart-unit { font-size: 11px; color: var(--muted); }
.chart-wrap { width: 100%; overflow: hidden; }
.chart-wrap svg { display: block; width: 100%; height: auto; }

.insight-box {
  margin-top: 14px; background: linear-gradient(135deg, #FFF6F0, #FFFCFA);
  border: 1px solid #FBE7DC; border-radius: 18px; padding: 15px 16px;
  font-size: 12.5px; color: #8A5B47; line-height: 1.75;
}
.insight-box h4 { margin: 0 0 6px; font-size: 13px; color: #7A4C38; }
.insight-box div + div { margin-top: 6px; }

.btn-row { display: flex; gap: 10px; margin-top: 14px; }
.btn {
  flex: 1; text-align: center; padding: 13px 16px; border-radius: 14px;
  font-size: 14px; font-weight: 600; display: inline-block;
  background: #fff; color: var(--text-2); box-shadow: var(--shadow);
}
.btn.primary { background: linear-gradient(135deg, #FF9E7F, #F07B5C); color: #fff; box-shadow: 0 8px 20px rgba(233, 125, 96, .28); }
.btn.ghost { background: rgba(255, 255, 255, .8); border: 1px solid var(--line); box-shadow: none; }
.btn.small { flex: 0 0 auto; padding: 8px 16px; font-size: 13px; }
.btn.danger-text { color: var(--red); background: var(--red-soft); box-shadow: none; flex: 0 0 84px; }
.btn:active { transform: scale(.98); }

/* ---------- 我的 ---------- */
.profile-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border-radius: 22px; padding: 18px;
  box-shadow: var(--shadow); margin-top: 6px;
}
.profile-avatar {
  width: 58px; height: 58px; border-radius: 20px;
  background: linear-gradient(135deg, #FFE2D3, #FFF3EC);
  display: grid; place-items: center; font-size: 28px;
}
.profile-info { flex: 1; }
.profile-name { font-size: 17px; font-weight: 700; }
.profile-meta { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.5; }

.list-card {
  background: var(--card); border-radius: 18px; margin-top: 12px;
  box-shadow: var(--shadow); overflow: hidden;
}
.list-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 15px 16px; text-align: left; font-size: 14.5px;
  border-bottom: 1px solid var(--line);
  background: none;
}
.list-item:last-child { border-bottom: none; }
.list-item:active { background: #FCF7F2; }
.li-ico { font-size: 17px; width: 22px; text-align: center; }
.li-text { flex: 1; }
.li-arrow { color: #C9BDB2; font-size: 18px; }

.about-card {
  margin-top: 16px; text-align: center; padding: 22px 18px;
  background: rgba(255, 255, 255, .55); border-radius: 18px; border: 1px dashed var(--line);
}
.about-title { font-size: 13px; font-weight: 700; color: var(--text-2); }
.about-text { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.7; }
.about-meta { font-size: 10.5px; color: #C0B5AB; margin-top: 8px; }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; align-items: flex-start; justify-content: space-around;
  max-width: 620px; margin: 0 auto;
  padding: 8px 6px calc(6px + var(--safe-b));
  background: rgba(255, 253, 251, .94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 24px rgba(166, 132, 108, .06);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 5px 0 2px; color: #B3A79C; font-size: 10.5px; transition: color .18s;
}
.tab svg { width: 22px; height: 22px; }
.tab.active { color: var(--primary); }
.tab.active svg { stroke-width: 2.1; }
.tab-add { flex: 0 0 62px; }
.tab-add-inner {
  width: 50px; height: 50px; border-radius: 18px;
  background: linear-gradient(135deg, #FF9E7F, #F07B5C);
  color: #fff; font-size: 26px; font-weight: 300;
  display: grid; place-items: center; margin-top: -14px;
  box-shadow: 0 8px 20px rgba(233, 125, 96, .34);
  transition: transform .14s;
}
.tab-add:active .tab-add-inner { transform: scale(.93); }

/* ---------- 弹层 ---------- */
.sheet-mask {
  position: fixed; inset: 0; background: rgba(58, 44, 36, .36);
  opacity: 0; pointer-events: none; transition: opacity .24s; z-index: 50;
  backdrop-filter: blur(2px);
}
.sheet-mask.show { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed; left: 50%; bottom: 0; z-index: 60;
  width: 100%; max-width: 620px;
  transform: translate(-50%, 102%);
  transition: transform .3s cubic-bezier(.22, .85, .3, 1);
  background: #FFFDFB;
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -14px 50px rgba(120, 92, 74, .2);
  max-height: 90vh;
  display: flex; flex-direction: column;
  padding-bottom: calc(10px + var(--safe-b));
}
.sheet.show { transform: translate(-50%, 0); }
.sheet-grab { width: 38px; height: 4px; border-radius: 999px; background: #E8DDD3; margin: 9px auto 0; }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 18px 10px;
}
.sheet-head h3 { font-size: 16px; font-weight: 700; }
.sheet-body { padding: 2px 18px 12px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet-foot {
  display: flex; gap: 10px; padding: 8px 18px 6px;
  border-top: 1px solid var(--line);
  background: #FFFDFB;
}
.sheet-foot .btn { padding: 14px; }

/* 表单 */
.field { margin-bottom: 16px; }
.field-label { font-size: 12.5px; color: var(--text-2); font-weight: 600; margin-bottom: 8px; display: block; }
.field-hint { font-size: 11px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

input[type="text"], input[type="number"], input[type="date"], input[type="datetime-local"], textarea, select {
  width: 100%; padding: 13px 14px; font-size: 16px; font-family: inherit;
  border: 1px solid var(--line); border-radius: 13px; background: #fff; color: var(--text);
  outline: none; transition: border-color .16s, box-shadow .16s;
  -webkit-appearance: none; appearance: none;
}
input:focus, textarea:focus, select:focus {
  border-color: #F5B39E; box-shadow: 0 0 0 3px rgba(245, 138, 107, .12);
}
textarea { resize: none; min-height: 76px; line-height: 1.6; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 10px 16px; border-radius: 12px; font-size: 13.5px; font-weight: 600;
  background: #fff; color: var(--text-2); border: 1px solid var(--line);
  transition: all .16s; flex: 0 1 auto;
}
.chip.active { background: var(--primary-soft); color: var(--primary-dark); border-color: #F8C3B0; }

.amount-row { display: flex; gap: 8px; align-items: center; }
.amount-row input { text-align: center; font-size: 20px; font-weight: 700; padding: 12px; }
.step-btn {
  width: 48px; height: 48px; flex: 0 0 48px; border-radius: 13px;
  background: #fff; border: 1px solid var(--line); font-size: 20px; color: var(--text-2);
  display: grid; place-items: center; font-weight: 400;
}
.step-btn:active { background: var(--primary-soft); }

.quick-amounts { display: flex; gap: 7px; margin-top: 9px; flex-wrap: wrap; }
.qa-btn {
  padding: 8px 13px; border-radius: 10px; background: #FBF6F2; color: var(--text-2);
  font-size: 12.5px; font-weight: 600;
}
.qa-btn:active { background: var(--primary-soft); }

.mini-stats { display: flex; gap: 8px; margin-top: 8px; }
.mini-stat {
  flex: 1; background: #FBF7F3; border-radius: 11px; padding: 9px 10px;
  font-size: 11.5px; color: var(--muted); text-align: center;
}
.mini-stat b { display: block; font-size: 15px; color: var(--text); margin-bottom: 1px; }

.type-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 4px 18px 18px; }
.type-item {
  background: #fff; border-radius: 16px; padding: 14px 4px 11px;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  box-shadow: var(--shadow); font-size: 11.5px; font-weight: 600; color: var(--text-2);
}
.type-item:active { transform: scale(.96); }
.type-item .ti-ico { font-size: 22px; }

.toast {
  position: fixed; left: 50%; bottom: calc(110px + var(--safe-b));
  transform: translate(-50%, 14px);
  background: rgba(47, 42, 38, .92); color: #fff;
  font-size: 13px; padding: 10px 18px; border-radius: 12px;
  opacity: 0; pointer-events: none; transition: all .24s; z-index: 90;
  max-width: 80vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { background: rgba(60, 122, 98, .95); }
.toast.err { background: rgba(190, 82, 66, .95); }

/* 桌面微调 */
@media (min-width: 640px) {
  body { background-attachment: fixed; }
  .app { background: transparent; }
  .tabbar { border-radius: 0; }
  .quick-btn:hover, .stat-card:hover, .advice-item:hover { transform: translateY(-1px); }
}

@media (max-width: 360px) {
  .stat-grid { gap: 7px; }
  .stat-val { font-size: 17px; }
  .q-sub { display: none; }
  .menu-avatar { width: 34px; height: 34px; }
}

/* ===== v1.2 健康分析 / 教学家庭共享 ===== */
.analysis .seg { margin-bottom: 12px; }
.hh-title { font-size: 16px; font-weight: 700; letter-spacing: -.3px; }
.hh-chips { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.hh-chip {
  font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  background: #F5EEE8; color: var(--text-2);
}
.hh-chip.good { background: #E8F4EE; color: #4A8B70; }
.hh-chip.warn { background: #FBF0DE; color: #B57B2E; }
.hh-chip.danger { background: #FBE7E2; color: #C05A49; }
.hh-chip.info { background: #EAF1F8; color: #4F7FA8; }
#tab-health, #tab-guide { margin-top: 4px; }

.guide-sub { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.6; }
.stage-card {
  background: var(--card); border-radius: 18px; padding: 15px 16px;
  box-shadow: var(--shadow); margin-top: 12px; overflow: hidden;
  border: 1.5px solid transparent;
}
.stage-card.current { border-color: #F5B79F; background: linear-gradient(180deg, #FFF7F2, #fff); }
.stage-head { display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.stage-title { font-size: 14.5px; font-weight: 700; }
.stage-range { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.stage-card.current .stage-range { color: #D97B54; font-weight: 600; }
.stage-arrow { font-size: 20px; color: #C9BBB0; transition: transform .2s; }
.stage-card:not(.collapsed) .stage-arrow { transform: rotate(90deg); }
.stage-body { margin-top: 12px; border-top: 1px dashed #EFE4DA; padding-top: 12px; }
.stage-row { font-size: 13px; line-height: 1.7; color: var(--text-2); margin-bottom: 10px; }
.stage-row b {
  display: inline-block; font-size: 11px; font-weight: 700; color: #B08868;
  background: #F8F0E9; border-radius: 6px; padding: 1px 7px; margin-right: 7px;
}
.stage-row ul { margin: 4px 0 0 2px; padding-left: 18px; }
.stage-row li { margin-bottom: 3px; }
.stage-danger b { color: #C05A49; background: #FBE7E2; }
.stage-danger li { color: #A8503F; }

.tl-by {
  display: inline-block; margin-left: 6px; font-size: 10px; font-weight: 600;
  color: #B08868; background: #F8F0E9; border-radius: 999px; padding: 1px 7px;
  vertical-align: 1px;
}
.li-sub { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; font-weight: 500; }
.list-item.static { cursor: default; }
.list-item.static:active { background: none; }

.member-tip {
  font-size: 12px; color: var(--muted); line-height: 1.7; margin-top: 12px;
  background: #F8F0E9; border-radius: 12px; padding: 10px 12px;
}
.invite-box { font-size: 13px; }
.invite-step { margin-bottom: 10px; line-height: 1.7; color: var(--text-2); }
.invite-link {
  background: #F8F0E9; border: 1.5px dashed #E0CBB8; border-radius: 12px;
  padding: 11px 13px; font-size: 14px; font-weight: 700; color: #B05A35;
  margin: 6px 0 14px; word-break: break-all; text-align: center; user-select: all;
}

/* ===== v1.3 注册 / 登录 ===== */
input[type="password"] {
  width: 100%; padding: 13px 14px; font-size: 16px; font-family: inherit;
  border: 1px solid var(--line); border-radius: 13px; background: #fff; color: var(--text);
  outline: none; transition: border-color .16s, box-shadow .16s;
  -webkit-appearance: none; appearance: none;
}
body.auth-locked { overflow: hidden; }
.auth-gate {
  position: fixed; inset: 0; z-index: 200; display: none;
  background: linear-gradient(180deg, #FFF7F1 0%, #FDEFE4 55%, #FBE9DC 100%);
  padding: 24px 18px calc(24px + var(--safe-b)); overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.auth-gate.show { display: block; }
.auth-card {
  max-width: 400px; margin: 0 auto;
  background: rgba(255, 255, 255, .94);
  border-radius: 26px; padding: 26px 20px 22px;
  box-shadow: 0 20px 46px rgba(196, 151, 120, .18);
  border: 1px solid rgba(255, 255, 255, .8);
}
.auth-logo { font-size: 42px; text-align: center; line-height: 1; }
.auth-title { text-align: center; font-size: 22px; font-weight: 800; margin-top: 8px; letter-spacing: -.6px; }
.auth-sub { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 7px; line-height: 1.6; }
.auth-seg { margin: 18px 0 16px; }
.auth-err { color: #C05A49; font-size: 12.5px; min-height: 17px; margin: 2px 0 8px; text-align: center; line-height: 1.5; }
.auth-submit { width: 100%; padding: 14px; font-size: 15px; border-radius: 14px; }
.auth-submit[disabled] { opacity: .6; }
.auth-tip { font-size: 11.5px; color: var(--muted); text-align: center; margin-top: 13px; line-height: 1.6; }
