/* ===== 宝宝喂养记录 - 公共样式 ===== */
:root {
  --primary:#4e8cff;
  --primary-dark:#3b6fd8;
  --accent:#ffb84d;
  --bg:#f3f5f9;
  --card:#ffffff;
  --text:#2b3445;
  --text-sub:#8b93a5;
  --danger:#ff6b6b;
  --radius:16px;
  --shadow:0 2px 12px rgba(30,50,100,.06);
}
* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
body { font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","HarmonyOS Sans SC","Microsoft YaHei",sans-serif; background:var(--bg); color:var(--text); padding-bottom:76px; }
::-webkit-scrollbar { width:0; height:0; }

/* ===== 顶部 ===== */
.header {
  background:linear-gradient(135deg,#5b8cff 0%,#7c6bff 100%);
  padding:20px 20px 18px;
  border-radius:0 0 28px 28px;
  color:#fff;
  box-shadow:0 6px 20px rgba(91,140,255,.25);
}
.header h1 { font-size:20px; font-weight:700; display:flex; align-items:center; gap:8px; letter-spacing:.5px; }
.header .sub { font-size:12px; opacity:.85; margin-top:6px; display:flex; align-items:center; gap:6px; }
.header .sub .dot { width:6px; height:6px; border-radius:50%; background:#7ee2a8; display:inline-block; }

/* ===== 容器 ===== */
.container { max-width:640px; margin:0 auto; padding:12px 16px 30px; }

/* ===== 沐沐年龄牌 ===== */
.age-card {
  background:linear-gradient(135deg,#fff7ec 0%,#ffe9d6 100%);
  border-radius:var(--radius); padding:14px 16px; margin-top:14px;
  box-shadow:var(--shadow); display:flex; align-items:center; justify-content:space-between; gap:12px;
  border:1px solid #ffe4c4;
}
.age-left { flex-shrink:0; }
.age-name { font-size:16px; font-weight:800; color:#d9822b; }
.age-born { font-size:11px; color:#b08a5c; margin-top:2px; }
.age-right { text-align:right; flex:1; }
.age-num { font-size:20px; font-weight:800; color:#c96a1e; white-space:nowrap; }
.age-num small { font-size:11px; font-weight:600; color:#b08a5c; margin:0 2px 0 4px; }
.age-num small:first-of-type { margin-left:6px; }
.age-tip { font-size:11px; color:#d9822b; margin-top:1px; }

/* ===== 底部导航 ===== */
.tabbar {
  position:fixed; left:0; right:0; bottom:0; z-index:100;
  background:rgba(255,255,255,.96); backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px);
  display:flex; border-top:1px solid #eef0f5;
  padding:6px 0 calc(env(safe-area-inset-bottom) + 6px);
}
.tabbar a {
  flex:1; text-align:center; text-decoration:none; padding:6px 0;
  color:var(--text-sub); font-size:10px; font-weight:600; display:flex; flex-direction:column; align-items:center; gap:3px;
}
.tabbar a .ico { font-size:20px; line-height:1; }
.tabbar a.active { color:var(--primary); }
.tabbar a.active .ico { transform:scale(1.08); }

/* ===== 概览卡片 ===== */
.stats-row { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-top:14px; }
.stat { background:var(--card); border-radius:var(--radius); padding:14px 8px; text-align:center; box-shadow:var(--shadow); }
.stat .num { font-size:22px; font-weight:800; color:var(--primary); line-height:1.2; }
.stat .num small { font-size:12px; font-weight:600; color:var(--text-sub); }
.stat .label { font-size:11px; color:var(--text-sub); margin-top:3px; }
.stat.hl { background:linear-gradient(135deg,#5b8cff,#7c6bff); }
.stat.hl .num, .stat.hl .label { color:#fff; }

/* ===== 卡片 ===== */
.card { background:var(--card); border-radius:var(--radius); padding:16px 14px; margin-top:12px; box-shadow:var(--shadow); }
.card h2 { font-size:14px; font-weight:700; margin-bottom:4px; display:flex; align-items:center; gap:6px; }
.card .desc { font-size:11px; color:var(--text-sub); margin-bottom:10px; }
.chart { width:100%; height:280px; }
.chart.short { height:210px; }

/* ===== 表单 ===== */
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.form-grid .full { grid-column:1/-1; }
.field label { font-size:12px; color:var(--text-sub); display:block; margin-bottom:5px; font-weight:500; }
.field label .req { color:var(--danger); }
.field input, .field select, .field textarea {
  width:100%; padding:11px 12px; border:1.5px solid #e4e8f0; border-radius:12px;
  font-size:15px; background:#fafbfd; color:var(--text); outline:none; transition:border .2s;
  appearance:none; -webkit-appearance:none;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color:var(--primary); background:#fff; }
.field select { background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238b93a5' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 12px center; padding-right:30px; }
.field textarea { resize:vertical; min-height:56px; }
.btn-submit {
  width:100%; padding:14px; margin-top:14px; border:none; border-radius:14px;
  background:linear-gradient(135deg,#5b8cff,#7c6bff); color:#fff; font-size:16px; font-weight:700;
  cursor:pointer; letter-spacing:2px; box-shadow:0 6px 16px rgba(91,140,255,.3); transition:transform .1s, opacity .2s;
}
.btn-submit:active { transform:scale(.97); opacity:.9; }
#formMsg { text-align:center; margin-top:10px; font-size:13px; color:var(--primary); min-height:18px; }
#formMsg.err { color:var(--danger); }

/* ===== 记录列表 ===== */
.rec { display:flex; align-items:center; gap:10px; padding:12px 4px; border-bottom:1px solid #f0f2f7; }
.rec:last-child { border-bottom:none; }
.rec .time-wrap { text-align:center; flex-shrink:0; width:64px; }
.rec .time { font-weight:700; font-size:15px; color:var(--text); display:block; }
.rec .day { font-size:10px; color:var(--text-sub); }
.rec .info { flex:1; min-width:0; display:flex; flex-wrap:wrap; gap:4px; }
.tag { display:inline-flex; align-items:center; background:#eef3ff; color:var(--primary); border-radius:8px; padding:3px 8px; font-size:11px; font-weight:600; }
.tag.bf { background:#fff4e0; color:#d98c00; }
.tag.ja { background:#ffecec; color:var(--danger); }
.tag.poop { background:#e9f7e6; color:#4a9b3d; }
.tag.pee { background:#e3f4fd; color:#2f9cd6; }
.rec .note { width:100%; font-size:11px; color:var(--text-sub); margin-top:3px; }
.rec .del { color:#c9cfdd; cursor:pointer; font-size:16px; padding:4px; flex-shrink:0; }
.rec .del:active { color:var(--danger); }
.empty { text-align:center; color:var(--text-sub); padding:40px 0; font-size:13px; }
.list-header { font-size:11px; color:var(--text-sub); margin-bottom:6px; margin-top:14px; }
.list-header:first-child { margin-top:0; }