/* ==========================================================================
   小熊体温监测 · 视觉系统
   奶油黄 + 蜂蜜色 + 可可棕，圆角、软阴影、卡通小熊，PC / 手机自适应
   ========================================================================== */

:root {
  --cream: #fff8ec;
  --cream-2: #fff2dc;
  --honey: #f7b955;
  --honey-deep: #ee9a2b;
  --honey-soft: #ffe6b8;
  --cocoa: #6b4a36;
  --cocoa-2: #9c7a63;
  --cocoa-light: #c8ab96;
  --mint: #7fcfa2;
  --mint-soft: #e2f6ea;
  --sky: #7cc4e8;
  --sky-soft: #e3f3fb;
  --coral: #ff8f86;
  --coral-soft: #ffe6e3;
  --danger: #e0574f;
  --danger-soft: #ffe3e0;
  --ok: #47a878;
  --card: #ffffff;
  --line: #f0e2ce;
  --shadow-sm: 0 2px 8px rgba(139, 95, 60, 0.08);
  --shadow: 0 10px 28px rgba(139, 95, 60, 0.12);
  --shadow-lg: 0 18px 46px rgba(139, 95, 60, 0.16);
  --r-sm: 12px;
  --r: 18px;
  --r-lg: 26px;
  --rail-w: 224px;
  --font: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", -apple-system, "Segoe UI", system-ui, sans-serif;
}

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

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--cocoa);
  background: var(--cream);
  background-image:
    radial-gradient(1200px 520px at 12% -10%, #fff1d4 0%, rgba(255, 241, 212, 0) 62%),
    radial-gradient(900px 460px at 96% 4%, #ffe7e3 0%, rgba(255, 231, 227, 0) 58%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
input, textarea, select { font-family: inherit; font-size: 15px; color: var(--cocoa); }

/* 小熊爪印背景点缀 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(247, 185, 85, 0.13) 1.4px, transparent 1.5px);
  background-size: 26px 26px;
  opacity: 0.55;
  z-index: 0;
}

/* ============================= 布局 ============================= */
.app-shell { position: relative; z-index: 1; display: flex; min-height: 100dvh; }

.rail {
  width: var(--rail-w);
  flex: 0 0 var(--rail-w);
  padding: 22px 14px calc(22px + env(safe-area-inset-bottom));
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: linear-gradient(180deg, #fffbef 0%, #fff6e2 100%);
  border-right: 1px solid var(--line);
}

.rail-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.rail-brand .logo-mini { width: 42px; height: 42px; flex: none; }
.rail-brand h1 { font-size: 16px; margin: 0; letter-spacing: 0.5px; }
.rail-brand p { margin: 0; font-size: 11px; color: var(--cocoa-2); letter-spacing: 1px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 14px;
  font-size: 14.5px;
  color: var(--cocoa-2);
  cursor: pointer;
  border: 0;
  background: transparent;
  text-align: left;
  transition: background 0.18s, color 0.18s, transform 0.18s;
  width: 100%;
}
.nav-item:hover { background: #ffefd3; color: var(--cocoa); }
.nav-item.active { background: linear-gradient(120deg, #ffdfa6, #ffcd85); color: #6a4310; box-shadow: inset 0 0 0 1px #ffc978; font-weight: 600; }
.nav-item .icon { width: 18px; height: 18px; flex: none; }
.rail-foot { margin-top: auto; font-size: 11.5px; color: var(--cocoa-light); padding: 10px 12px; line-height: 1.7; }

.main { flex: 1; min-width: 0; padding: 22px 26px calc(90px + env(safe-area-inset-bottom)); }
.main.wide { padding-left: 18px; padding-right: 18px; }

.page { max-width: 1180px; margin: 0 auto; animation: fade-up 0.32s ease both; }
.page.narrow { max-width: 860px; }
@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 22px; letter-spacing: 0.3px; }
.page-head .sub { margin: 4px 0 0; font-size: 12.5px; color: var(--cocoa-2); }

/* 移动端底部导航 */
.tabbar {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 251, 240, 0.94);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  justify-content: space-around;
}
.tabbar button {
  border: 0; background: transparent; color: var(--cocoa-2);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 11.5px; padding: 6px 8px; border-radius: 12px; flex: 1;
}
.tabbar button.active { color: var(--honey-deep); font-weight: 700; }
.tabbar button.active .icon { filter: drop-shadow(0 3px 6px rgba(238, 154, 43, 0.4)); }

/* ============================= 基础组件 ============================= */
.card {
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 20px;
  border: 1px solid rgba(240, 226, 206, 0.9);
}
.card.flat { box-shadow: var(--shadow-sm); border-radius: var(--r); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h3 { margin: 0; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.card-head h3 .icon { width: 18px; height: 18px; color: var(--honey-deep); }
.card-head .hint { font-size: 12px; color: var(--cocoa-2); }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 0; border-radius: 14px; padding: 11px 18px;
  font-size: 14.5px; font-weight: 600; cursor: pointer;
  background: linear-gradient(135deg, var(--honey), var(--honey-deep));
  color: #563407;
  box-shadow: 0 8px 18px rgba(238, 154, 43, 0.3);
  transition: transform 0.14s, box-shadow 0.18s, filter 0.18s;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.04); transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }
.btn .icon { width: 17px; height: 17px; }

.btn.ghost { background: #fff; color: var(--cocoa); box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--cream-2); }
.btn.mint { background: linear-gradient(135deg, #9be0b9, var(--mint)); color: #14563a; box-shadow: 0 8px 18px rgba(127, 207, 162, 0.34); }
.btn.danger { background: linear-gradient(135deg, #ff9c95, var(--danger)); color: #fff; box-shadow: 0 8px 18px rgba(224, 87, 79, 0.32); }
.btn.sm { padding: 7px 12px; font-size: 12.5px; border-radius: 11px; }
.btn.block { width: 100%; }
.btn.link { background: transparent; box-shadow: none; color: var(--honey-deep); padding: 4px; font-weight: 600; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; color: var(--cocoa); }
.field .tip { font-size: 11.5px; color: var(--cocoa-2); margin-top: 5px; line-height: 1.6; }
.input, .select, .textarea {
  width: 100%; padding: 12px 14px; border-radius: 14px;
  border: 1.5px solid var(--line); background: #fffdf7;
  transition: border-color 0.16s, box-shadow 0.16s;
  outline: none;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--honey); box-shadow: 0 0 0 4px rgba(247, 185, 85, 0.18); background: #fff;
}
.input::placeholder, .textarea::placeholder { color: #c9b6a4; }
.textarea { min-height: 76px; resize: vertical; }
.input-row { display: flex; gap: 10px; align-items: center; }
.input-icon { position: relative; }
.input-icon .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--cocoa-light); }
.input-icon .input { padding-left: 40px; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 14px; border-radius: 999px; font-size: 13px;
  background: #fffdf5; border: 1.5px solid var(--line); cursor: pointer;
  transition: all 0.16s; color: var(--cocoa-2); white-space: nowrap;
}
.chip:hover { border-color: var(--honey-soft); background: #fff8e8; }
.chip.active { background: linear-gradient(135deg, #ffe2ab, #ffcf86); border-color: #ffc470; color: #6a4310; font-weight: 600; }
.chip.mini { padding: 5px 10px; font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.badge.honey { background: var(--honey-soft); color: #8a5a10; }
.badge.mint { background: var(--mint-soft); color: #256d4a; }
.badge.sky { background: var(--sky-soft); color: #15658c; }
.badge.coral { background: var(--coral-soft); color: #b13b32; }
.badge.gray { background: #f4efe7; color: var(--cocoa-2); }
.badge.danger { background: var(--danger-soft); color: #a52d26; }

.temp-chip {
  display: inline-flex; align-items: baseline; gap: 2px;
  padding: 3px 10px; border-radius: 12px; font-weight: 800; font-size: 15px;
}
.temp-normal { background: var(--mint-soft); color: #22724d; }
.temp-low { background: var(--sky-soft); color: #176b93; }
.temp-mid { background: #fff0cc; color: #8a5a10; }
.temp-high { background: #ffe1cc; color: #9a4a12; }
.temp-danger { background: var(--danger-soft); color: #a52d26; }

/* 空状态 */
.empty { text-align: center; padding: 34px 12px; color: var(--cocoa-2); }
.empty .bear { width: 92px; height: 92px; opacity: 0.85; margin-bottom: 10px; }
.empty p { margin: 4px 0 14px; font-size: 13.5px; }

/* ============================= LOGO / 小熊 ============================= */
.logo-mini { display: block; }
.bear-hero { width: 100%; max-width: 300px; margin: 0 auto; display: block; animation: breathe 4.2s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-6px) scale(1.015); } }

/* ============================= 登录页 ============================= */
.auth-wrap {
  min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  padding: 26px 16px calc(26px + env(safe-area-inset-bottom)); position: relative; z-index: 1;
}
.auth-card {
  width: 100%; max-width: 432px; background: #fff; border-radius: 30px;
  box-shadow: var(--shadow-lg); padding: 26px 24px 24px; position: relative; overflow: hidden;
  border: 1px solid #f7e6cd;
}
.auth-card::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px;
  background: linear-gradient(90deg, #ffd08a, #ffb35c, #ff9a8f, #8bd0ef, #a6e0bd);
}
.auth-brand { text-align: center; margin-bottom: 14px; }
.auth-brand .logo-mini { width: 84px; height: 84px; margin: 0 auto 6px; }
.auth-brand h2 { margin: 0; font-size: 24px; letter-spacing: 1px; }
.auth-brand h2 span { color: var(--honey-deep); }
.auth-brand p { margin: 6px 0 0; font-size: 12.5px; color: var(--cocoa-2); }

.auth-tabs { display: flex; gap: 6px; background: #fdf3e2; padding: 5px; border-radius: 16px; margin-bottom: 18px; }
.auth-tabs button {
  flex: 1; border: 0; background: transparent; padding: 9px 6px; border-radius: 12px;
  font-size: 13.5px; color: var(--cocoa-2); cursor: pointer; font-weight: 600;
}
.auth-tabs button.active { background: #fff; color: var(--cocoa); box-shadow: var(--shadow-sm); }

.auth-note { font-size: 12px; color: var(--cocoa-2); line-height: 1.7; margin-top: 14px; text-align: center; }
.form-msg { border-radius: 12px; padding: 10px 12px; font-size: 12.5px; line-height: 1.6; margin-bottom: 12px; }
.form-msg.err { background: var(--danger-soft); color: #a52d26; }
.form-msg.ok { background: var(--mint-soft); color: #1f6b48; }

/* ============================= 首页 ============================= */
.baby-switch { display: flex; gap: 10px; overflow-x: auto; padding: 3px 2px 8px; scrollbar-width: none; }
.baby-switch::-webkit-scrollbar { display: none; }
.baby-pill {
  display: flex; align-items: center; gap: 9px; padding: 9px 15px 9px 10px;
  border-radius: 16px; background: #fff; border: 1.5px solid var(--line);
  box-shadow: var(--shadow-sm); cursor: pointer; flex: none; transition: all 0.18s;
}
.baby-pill .ava { font-size: 22px; line-height: 1; }
.baby-pill .txt { display: flex; flex-direction: column; }
.baby-pill .txt b { font-size: 14px; }
.baby-pill .txt span { font-size: 11px; color: var(--cocoa-2); }
.baby-pill.active { background: linear-gradient(135deg, #fff2d9, #ffe0ae); border-color: #ffc470; }
.baby-pill.add { color: var(--cocoa-2); border-style: dashed; background: #fffdf6; }

.hero-card {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #fff3dc 0%, #ffe4bd 55%, #ffd9c8 100%);
  border: 1px solid #ffdcae;
}
.hero-card::after {
  content: ""; position: absolute; right: -40px; bottom: -56px; width: 190px; height: 190px;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0) 68%);
  border-radius: 50%;
}
.hero-inner { position: relative; z-index: 2; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.gauge { position: relative; width: 148px; height: 148px; flex: none; }
.gauge .num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.gauge .num b { font-size: 36px; line-height: 1; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.gauge .num b small { font-size: 15px; font-weight: 600; opacity: 0.7; }
.gauge .num span { font-size: 10.5px; color: var(--cocoa-2); margin-top: 5px; max-width: 104px; text-align: center; line-height: 1.35; }
.hero-meta { flex: 1; min-width: 190px; }
.hero-meta .baby-line { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--cocoa-2); }
.hero-meta h3 { margin: 8px 0 6px; font-size: 20px; }
.hero-meta .trend { font-size: 13.5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.trend.up { color: var(--danger); }
.trend.down { color: var(--ok); }
.trend.flat { color: var(--cocoa-2); }

.quick-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.qa {
  border: 0; background: #fff; border-radius: 18px; padding: 15px 8px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  box-shadow: var(--shadow-sm); transition: transform 0.16s, box-shadow 0.18s;
}
.qa:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.qa .ico-wrap { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; }
.qa .ico-wrap .icon { width: 21px; height: 21px; }
.qa span { font-size: 13px; font-weight: 600; }
.qa small { font-size: 11px; color: var(--cocoa-2); }

.stat {
  background: #fff; border-radius: var(--r); padding: 15px 16px; box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
}
.stat .k { font-size: 12px; color: var(--cocoa-2); display: flex; align-items: center; gap: 5px; }
.stat .k .icon { width: 15px; height: 15px; }
.stat .v { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 13px; font-weight: 600; opacity: 0.65; margin-left: 2px; }
.stat .extra { font-size: 11.5px; color: var(--cocoa-2); margin-top: 3px; }

.alert-box { border-radius: 18px; padding: 14px 16px; display: flex; gap: 11px; align-items: flex-start; }
.alert-box .icon { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.alert-box b { font-size: 14px; }
.alert-box p { margin: 3px 0 0; font-size: 12.5px; line-height: 1.65; }
.alert-box.danger { background: var(--danger-soft); color: #8f2b24; border: 1px solid #ffc9c4; }
.alert-box.warn { background: #fff2d4; color: #8a5a10; border: 1px solid #ffdd9e; }
.alert-box.info { background: var(--sky-soft); color: #155f86; border: 1px solid #c8e8f7; }
.alert-box.ok { background: var(--mint-soft); color: #1f6b48; border: 1px solid #c6ebd8; }

.med-next { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px; background: #fff7f4; border: 1px solid #ffdcd3; }
.med-next .ring { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; flex: none; background: #fff; box-shadow: var(--shadow-sm); font-size: 20px; }
.med-next .txt b { font-size: 14.5px; }
.med-next .txt p { margin: 3px 0 0; font-size: 12.5px; color: var(--cocoa-2); }
.med-next .count { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--danger); text-align: right; }
.med-next.due { background: #ffe9e6; border-color: #ffbdb6; }

/* 记录项 */
.rec-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--line); align-items: flex-start; }
.rec-item:last-child { border-bottom: 0; }
.rec-time { width: 62px; flex: none; text-align: center; }
.rec-time b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; }
.rec-time span { font-size: 11px; color: var(--cocoa-2); }
.rec-body { flex: 1; min-width: 0; }
.rec-body .line1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rec-body .meta { font-size: 11.5px; color: var(--cocoa-2); margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; }
.rec-body .note { font-size: 12px; color: var(--cocoa-2); margin-top: 4px; }
.diff { font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 8px; }
.diff.up { background: var(--danger-soft); color: #a52d26; }
.diff.down { background: var(--mint-soft); color: #1f6b48; }
.diff.flat { background: #f2ece3; color: var(--cocoa-2); }

/* ============================= 表单页 ============================= */
.temp-input-wrap { display: flex; align-items: center; gap: 14px; }
.temp-big {
  font-size: 34px; font-weight: 800; letter-spacing: -1px;
  background: #fffdf6; border: 1.5px solid var(--line); border-radius: 16px;
  padding: 6px 14px; width: 168px; text-align: center; outline: none;
  font-variant-numeric: tabular-nums;
}
.temp-big:focus { border-color: var(--honey); box-shadow: 0 0 0 4px rgba(247, 185, 85, 0.18); }
.stepper { display: flex; flex-direction: column; gap: 6px; }
.stepper button {
  width: 42px; height: 34px; border-radius: 11px; border: 1.5px solid var(--line);
  background: #fff; cursor: pointer; font-size: 17px; color: var(--cocoa); font-weight: 700;
}
.stepper button:active { background: var(--cream-2); }

.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg .opt {
  flex: 1; min-width: 92px; text-align: center; padding: 11px 8px; border-radius: 14px;
  border: 1.5px solid var(--line); background: #fffdf7; cursor: pointer; font-size: 13.5px;
  transition: all 0.16s;
}
.seg .opt.active { background: linear-gradient(135deg, #ffe4b3, #ffd08a); border-color: #ffc470; font-weight: 700; color: #6a4310; }
.seg .opt .ico { display: block; font-size: 18px; margin-bottom: 3px; }

.form-section { margin-bottom: 20px; padding-bottom: 18px; border-bottom: 1px dashed var(--line); }
.form-section:last-child { border-bottom: 0; padding-bottom: 0; }
.form-section h4 { margin: 0 0 12px; font-size: 14.5px; display: flex; align-items: center; gap: 7px; }
.form-section h4 .icon { width: 18px; height: 18px; color: var(--honey-deep); }
.form-section h4 .opt-tag { font-size: 11px; color: var(--cocoa-2); font-weight: 400; }

/* ============================= 弹窗 / 提示 ============================= */
.modal-mask {
  position: fixed; inset: 0; z-index: 60; background: rgba(70, 44, 26, 0.42);
  backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 18px;
  animation: fade-in 0.2s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%; max-width: 430px; background: #fff; border-radius: 26px; padding: 22px;
  box-shadow: var(--shadow-lg); animation: pop 0.26s cubic-bezier(0.34, 1.4, 0.6, 1) both;
  max-height: 86dvh; overflow: auto;
}
@keyframes pop { from { opacity: 0; transform: scale(0.94) translateY(10px); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.modal-head .emo { font-size: 30px; }
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-sub { font-size: 12.5px; color: var(--cocoa-2); margin: 0 0 14px; }
.modal .actions { display: flex; gap: 10px; margin-top: 18px; }
.modal .actions .btn { flex: 1; }

.toast-wrap { position: fixed; left: 50%; transform: translateX(-50%); top: 18px; z-index: 80; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); }
.toast {
  background: #fff; border-radius: 14px; padding: 12px 16px; font-size: 13.5px;
  box-shadow: var(--shadow-lg); display: flex; gap: 9px; align-items: center;
  animation: toast-in 0.26s ease both; border-left: 4px solid var(--honey);
}
.toast.err { border-left-color: var(--danger); }
.toast.ok { border-left-color: var(--ok); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }

/* ============================= 列表 / 时间轴 ============================= */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .input, .toolbar .select { width: auto; min-width: 150px; padding: 9px 12px; }
.day-group { margin-bottom: 18px; }
.day-label { font-size: 12.5px; font-weight: 700; color: var(--cocoa-2); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.day-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.rec-card { background: #fff; border-radius: var(--r); padding: 13px 15px; box-shadow: var(--shadow-sm); border: 1px solid var(--line); margin-bottom: 10px; }

/* ============================= 数据大屏（深色） ============================= */
.screen {
  background: radial-gradient(1100px 600px at 20% -10%, #2a4a72 0%, rgba(42, 74, 114, 0) 60%),
              radial-gradient(900px 500px at 100% 0%, #35507a 0%, rgba(53, 80, 122, 0) 55%),
              linear-gradient(160deg, #10203a 0%, #143055 55%, #0e1b30 100%);
  border-radius: 26px; padding: 20px; color: #e8f1ff; position: relative; overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.screen::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(120, 190, 255, 0.055) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(120, 190, 255, 0.055) 1px, transparent 1px);
  background-size: 34px 34px;
}
.screen-head { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.screen-head .t { display: flex; align-items: center; gap: 12px; }
.screen-head .logo-mini { width: 46px; height: 46px; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35)); }
.screen-head h2 { margin: 0; font-size: 21px; letter-spacing: 2px; color: #fff; }
.screen-head p { margin: 3px 0 0; font-size: 12px; color: #9db9d8; letter-spacing: 1px; }
.screen-head .clock { font-size: 13px; color: #a9c6e6; font-variant-numeric: tabular-nums; }

.screen-grid { position: relative; z-index: 2; display: grid; gap: 14px; grid-template-columns: 260px minmax(0, 1fr) 300px; }
.scard {
  background: linear-gradient(160deg, rgba(37, 74, 118, 0.55), rgba(16, 35, 62, 0.72));
  border: 1px solid rgba(120, 190, 255, 0.2); border-radius: 18px; padding: 14px 16px;
  backdrop-filter: blur(6px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.scard h4 { margin: 0 0 12px; font-size: 13.5px; color: #cfe4ff; display: flex; align-items: center; gap: 7px; letter-spacing: 0.5px; }
.scard h4 .icon { width: 16px; height: 16px; color: #7fc4ff; }
.kpi { display: flex; align-items: baseline; gap: 6px; }
.kpi .n { font-size: 34px; font-weight: 800; color: #ffffff; letter-spacing: -1px; font-variant-numeric: tabular-nums; text-shadow: 0 0 22px rgba(126, 196, 255, 0.45); }
.kpi .u { font-size: 12px; color: #9db9d8; }
.kpi-row { display: flex; justify-content: space-between; align-items: flex-end; padding: 9px 0; border-bottom: 1px dashed rgba(120, 190, 255, 0.16); }
.kpi-row:last-child { border-bottom: 0; }
.kpi-row .l { font-size: 12.5px; color: #9db9d8; }
.kpi-row .v { font-size: 19px; font-weight: 700; color: #ffd47e; font-variant-numeric: tabular-nums; }
.scard.dark-num .v { color: #8fe0b6; }

.mini-list { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow: auto; }
.mini-item { display: flex; align-items: center; gap: 9px; font-size: 12.5px; padding: 7px 9px; border-radius: 10px; background: rgba(255, 255, 255, 0.045); }
.mini-item .ava { font-size: 16px; }
.mini-item .grow { flex: 1; min-width: 0; }
.mini-item .grow b { color: #f2f7ff; font-weight: 600; }
.mini-item .grow span { display: block; font-size: 11px; color: #8fa9c6; }
.mini-item .tem { font-weight: 800; color: #ffd47e; font-variant-numeric: tabular-nums; }
.mini-item .tem.hot { color: #ff8a80; }

.screen-foot { position: relative; z-index: 2; margin-top: 14px; font-size: 11.5px; color: #8fa9c6; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* 图表 */
.chart { width: 100%; display: block; }
.chart-legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--cocoa-2); margin-top: 6px; flex-wrap: wrap; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: middle; }
.screen .chart-legend { color: #9db9d8; }

/* 后台表格 */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 720px; }
.tbl th { text-align: left; padding: 10px 12px; font-size: 12px; color: var(--cocoa-2); background: #fdf5e8; font-weight: 700; white-space: nowrap; }
.tbl th:first-child { border-radius: 12px 0 0 12px; }
.tbl th:last-child { border-radius: 0 12px 12px 0; }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.tbl tr:hover td { background: #fffaf0; }
.tbl .actions-cell { display: flex; gap: 6px; }

/* 骨架/加载 */
.loading { display: grid; place-items: center; padding: 40px; }
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--honey-soft); border-top-color: var(--honey-deep);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================= 响应式 ============================= */
@media (max-width: 1080px) {
  .screen-grid { grid-template-columns: 230px minmax(0, 1fr); }
  .screen-grid > :nth-child(3) { grid-column: 1 / -1; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .rail { display: none; }
  .tabbar { display: flex; }
  .main { padding: 16px 14px calc(86px + env(safe-area-inset-bottom)); }
  .page-head h2 { font-size: 19px; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .screen { border-radius: 20px; padding: 14px; }
  .screen-grid { grid-template-columns: minmax(0, 1fr); }
  .quick-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .qa { padding: 11px 4px; }
  .qa span { font-size: 12px; }
  .qa small { display: none; }
  .hero-inner { gap: 12px; }
  .gauge { width: 124px; height: 124px; margin: 0 auto; }
  .gauge .num b { font-size: 34px; }
  .card { padding: 16px; border-radius: 22px; }
}

@media (max-width: 520px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .temp-input-wrap { gap: 8px; }
  .temp-big { font-size: 28px; width: 130px; padding: 4px 8px; }
  .modal { padding: 18px; border-radius: 22px; }
  .auth-card { padding: 22px 18px; border-radius: 24px; }
  .page-head { align-items: flex-start; }
  .tbl { min-width: 640px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* 打印（记录单） */
@media print {
  .rail, .tabbar, .quick-actions, .no-print { display: none !important; }
  body { background: #fff; }
  .main { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}

/* ---------- 通用记录次要信息行（时间轴 / 列表共用） ---------- */
.meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11.8px; color: var(--cocoa-2); margin-top: 6px; }
.meta span { white-space: nowrap; }
.meta span::before { content: ""; display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: #d9c4ab; vertical-align: middle; margin-right: 5px; }

/* ---------- 登录页 LOGO ---------- */
.auth-logo { width: 84px; height: 84px; border-radius: 24px; box-shadow: 0 10px 22px rgba(214, 150, 60, .28); display: block; margin: 0 auto 12px; }

/* ---------- 个人中心「关于小熊」 ---------- */
.about-card { margin-top: 16px; }
.about-row { display: flex; gap: 18px; align-items: center; }
.about-mascot { width: 116px; border-radius: 18px; background: linear-gradient(160deg, #fff6e5, #ffe7c9); padding: 6px; }
.about-row h4 { margin: 0 0 6px; font-size: 15px; color: var(--cocoa); }
.about-row p { margin: 0; font-size: 12.5px; line-height: 1.85; color: var(--cocoa-2); }
.about-meta { margin-top: 10px !important; font-size: 11.5px !important; color: var(--cocoa-light) !important; }
@media (max-width: 520px) {
  .about-row { gap: 12px; }
  .about-mascot { width: 88px; }
}
/* ================= 大便记录展示 ================= */
.chip-warn { border-color: #efb4a9; color: #b0392c; background: #fff3f1; }
.chip-warn.active { background: #ffded8; border-color: #e0786a; color: #97271c; }
.danger-tip { color: #97271c; background: var(--danger-soft); padding: 8px 11px; border-radius: 12px; margin: 9px 0 0; line-height: 1.7; }
.stool-line .stool-flag { font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 7px; white-space: nowrap; }
.stool-line .stool-flag.danger { background: var(--danger-soft); color: #a52d26; }
.stool-line .stool-flag.warn { background: #fff0d8; color: #8a5a10; }
.stool-line .stool-flag.info { background: #f2ece3; color: var(--cocoa-2); }
.stool-line.tone-danger span:first-child { color: #a52d26; }
.stool-line.tone-warn span:first-child { color: #8a5a10; }

/* ================= 页面动画 ================= */
@keyframes pageIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to { opacity: 1; transform: none; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn {
  0% { transform: scale(.6); opacity: 0; }
  60% { transform: scale(1.06); opacity: 1; }
  100% { transform: scale(1); }
}
@keyframes chipPop {
  0% { transform: scale(1); }
  45% { transform: scale(1.12); }
  100% { transform: scale(1); }
}
@keyframes breathe {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 4px 10px rgba(238,154,43,.22)); }
  50% { transform: scale(1.02); filter: drop-shadow(0 8px 18px rgba(238,154,43,.34)); }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-12px) scale(.96); }
  to { opacity: 1; transform: none; }
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(.96); }
  to { opacity: 1; transform: none; }
}
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@keyframes shine {
  from { background-position: -120% 0; }
  to { background-position: 220% 0; }
}

.page { animation: pageIn .36s cubic-bezier(.22,.85,.3,1) both; }
.card { animation: cardIn .42s cubic-bezier(.22,.85,.3,1) both; }
.page .card:nth-of-type(2) { animation-delay: .05s; }
.page .card:nth-of-type(3) { animation-delay: .1s; }
.page .card:nth-of-type(4) { animation-delay: .14s; }
.page .card:nth-of-type(5) { animation-delay: .18s; }
.form-section { animation: cardIn .4s cubic-bezier(.22,.85,.3,1) both; }

.btn, .chip, .opt, .baby-pill, .nav-item, .tabbar button, .icon-btn { transition: transform .16s ease, box-shadow .22s ease, background .2s ease, color .2s ease; }
.btn:active, .chip:active, .opt:active, .baby-pill:active { transform: scale(.96); }
.btn:hover { box-shadow: 0 8px 18px rgba(214,150,60,.22); }
.chip.active { animation: chipPop .3s ease; }
.nav-item:hover icon, .nav-item:hover span { transform: translateX(1px); }
.tabbar button:active { transform: translateY(2px) scale(.96); }
.tabbar button.active icon { animation: floatY 2.4s ease-in-out infinite; }

.gauge svg { animation: breathe 4.2s ease-in-out infinite; border-radius: 50%; }
.gauge .num b { animation: popIn .5s cubic-bezier(.2,.9,.25,1.3) both; }
.quick-item .ico, .quick-card .ico { transition: transform .2s ease; }
.quick-item:hover .ico, .quick-card:hover .ico { transform: translateY(-3px) rotate(-4deg) scale(1.06); }

.toast { animation: toastIn .28s cubic-bezier(.2,.9,.25,1.2) both; }
.modal { animation: modalIn .28s cubic-bezier(.2,.9,.25,1.2) both; }
.modal-mask { animation: fadeIn .2s ease both; }

.chart { animation: fadeIn .45s ease both; }
.rec-item, .rec-card { animation: cardIn .36s cubic-bezier(.22,.85,.3,1) both; }
.screen .kpi { animation: cardIn .45s cubic-bezier(.22,.85,.3,1) both; }
.screen .kpi:nth-of-type(2) { animation-delay: .08s; }
.screen .kpi:nth-of-type(3) { animation-delay: .16s; }

/* 吉祥物轻微呼吸 */
.about-mascot { animation: floatY 4.5s ease-in-out infinite; }
.auth-logo { animation: popIn .55s cubic-bezier(.2,.9,.25,1.3) both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}