/* ============================================================
   母乳喂养量与泵奶量估算器 · 独立视觉：奶白 + 天蓝 + 奶瓶刻度
   ============================================================ */

.bfb-page {
  --bfb-bg: #f2f8fc;
  --bfb-bg-2: #e8f3fa;
  --bfb-card: #ffffff;
  --bfb-soft: #eaf4fb;
  --bfb-soft-2: #dcedf8;
  --bfb-ink: #142c3a;
  --bfb-muted: #5f7c8c;
  --bfb-line: #d7e8f2;
  --bfb-accent: #1479b0;
  --bfb-accent-2: #57b9dd;
  --bfb-milk: #fdf3d8;
  --bfb-milk-2: #f6e2ad;
  --bfb-pink: #d9759d;
  --bfb-ok: #0f7d5c;
  --bfb-warn: #a85a06;
  --bfb-shadow: 0 10px 30px rgba(23, 74, 104, .08);

  background: var(--bfb-bg);
  color: var(--bfb-ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.75;
  padding-bottom: 48px;
  transition: background-color .2s ease, color .2s ease;
}

:root[data-theme="dark"] .bfb-page {
  --bfb-bg: #07141b;
  --bfb-bg-2: #0a1c25;
  --bfb-card: #0e2029;
  --bfb-soft: #122a35;
  --bfb-soft-2: #173542;
  --bfb-ink: #e6f3fa;
  --bfb-muted: #92afbe;
  --bfb-line: #1e3b48;
  --bfb-accent: #4cb4dd;
  --bfb-accent-2: #7cd0ea;
  --bfb-milk: #4a3f22;
  --bfb-milk-2: #6b5a2c;
  --bfb-pink: #ef9fbe;
  --bfb-ok: #4ade9f;
  --bfb-warn: #f3b64b;
  --bfb-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

html[data-theme="dark"] .bfb-page { color-scheme: dark; }

.bfb-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 20px 0;
}

/* ---------- 面包屑 ---------- */
.bfb-crumb {
  font-size: 13px;
  color: var(--bfb-muted);
  margin-bottom: 14px;
}
.bfb-crumb a { color: var(--bfb-muted); text-decoration: none; }
.bfb-crumb a:hover { color: var(--bfb-accent); }

/* ---------- Hero ---------- */
.bfb-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 190px;
  gap: 20px;
  align-items: center;
  background:
    radial-gradient(600px 200px at 88% -10%, rgba(87, 185, 221, .28), transparent 70%),
    linear-gradient(135deg, var(--bfb-bg-2), var(--bfb-card) 72%);
  border: 1px solid var(--bfb-line);
  border-radius: 22px;
  padding: 26px 28px;
  box-shadow: var(--bfb-shadow);
  margin-bottom: 20px;
}
.bfb-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--bfb-accent);
  background: rgba(20, 121, 176, .1);
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 8px;
}
.bfb-hero h1 {
  font-size: 28px;
  line-height: 1.35;
  margin: 0 0 10px;
  letter-spacing: -.01em;
}
.bfb-hero p {
  margin: 0;
  font-size: 14.5px;
  color: var(--bfb-muted);
  max-width: 640px;
}
.bfb-hero p b { color: var(--bfb-ink); }
.bfb-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.bfb-hero-meta span {
  font-size: 12px;
  color: var(--bfb-accent);
  background: var(--bfb-soft);
  border: 1px solid var(--bfb-line);
  border-radius: 8px;
  padding: 4px 10px;
  font-weight: 600;
}

/* Hero 装饰奶瓶 */
.bfb-hero-art {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.bfb-mini-scale {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 108px;
  font-size: 10px;
  color: var(--bfb-muted);
}
.bfb-mini-bottle {
  width: 74px;
  height: 132px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.bfb-mini-cap {
  width: 30px;
  height: 12px;
  border-radius: 6px 6px 2px 2px;
  background: var(--bfb-accent);
  opacity: .85;
}
.bfb-mini-neck {
  width: 38px;
  height: 8px;
  background: var(--bfb-soft-2);
  border: 1px solid var(--bfb-line);
  border-bottom: 0;
}
.bfb-mini-body {
  position: relative;
  width: 68px;
  height: 104px;
  border: 2px solid var(--bfb-accent-2);
  border-radius: 8px 8px 14px 14px;
  background: var(--bfb-card);
  overflow: hidden;
}
.bfb-mini-milk {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 62%;
  background: linear-gradient(180deg, var(--bfb-milk), var(--bfb-milk-2));
}
.bfb-mini-body i {
  position: absolute;
  left: 8px;
  height: 1px;
  width: 18px;
  background: var(--bfb-accent-2);
  opacity: .5;
}
.bfb-mini-body i:nth-child(2) { bottom: 22%; }
.bfb-mini-body i:nth-child(3) { bottom: 40%; }
.bfb-mini-body i:nth-child(4) { bottom: 58%; }
.bfb-mini-body i:nth-child(5) { bottom: 76%; }

/* ---------- 主栅格 ---------- */
.bfb-grid {
  display: grid;
  grid-template-columns: 1fr 408px;
  gap: 20px;
  align-items: start;
}
.bfb-col { min-width: 0; }

/* ---------- 卡片 ---------- */
.bfb-card {
  background: var(--bfb-card);
  border: 1px solid var(--bfb-line);
  border-radius: 16px;
  padding: 20px 20px 18px;
  box-shadow: var(--bfb-shadow);
}
.bfb-card + .bfb-card { margin-top: 16px; }
.bfb-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.bfb-card-head h2 {
  font-size: 17px;
  margin: 0;
  letter-spacing: -.01em;
}
.bfb-card-head span {
  font-size: 12px;
  color: var(--bfb-muted);
}
.bfb-link {
  border: 0;
  background: none;
  color: var(--bfb-accent);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.bfb-link:hover { color: var(--bfb-accent-2); }

/* ---------- 表单 ---------- */
.bfb-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}
.bfb-field { min-width: 0; }
.bfb-field.full { grid-column: 1 / -1; }
.bfb-field > label {
  display: block;
  font-size: 12.5px;
  color: var(--bfb-muted);
  font-weight: 600;
  margin-bottom: 5px;
}
.bfb-input {
  width: 100%;
  box-sizing: border-box;
  height: 40px;
  padding: 0 11px;
  font-size: 15px;
  color: var(--bfb-ink);
  background: var(--bfb-soft);
  border: 1px solid var(--bfb-line);
  border-radius: 9px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  font-variant-numeric: tabular-nums;
}
.bfb-input:focus {
  border-color: var(--bfb-accent);
  box-shadow: 0 0 0 3px rgba(20, 121, 176, .15);
  background: var(--bfb-card);
}
.bfb-input:disabled {
  opacity: .55;
  cursor: not-allowed;
}
.bfb-unit {
  position: relative;
}
.bfb-unit .bfb-input { padding-right: 38px; }
.bfb-unit em {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  font-style: normal;
  color: var(--bfb-muted);
  pointer-events: none;
}

/* 喂养方式分段 */
.bfb-seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: var(--bfb-soft);
  border: 1px solid var(--bfb-line);
  border-radius: 11px;
  padding: 5px;
}
.bfb-seg label {
  position: relative;
  display: block;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--bfb-muted);
  border-radius: 8px;
  padding: 8px 4px;
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
}
.bfb-seg input { position: absolute; opacity: 0; pointer-events: none; }
.bfb-seg input:checked + span {
  color: #fff;
  background: linear-gradient(135deg, var(--bfb-accent), var(--bfb-accent-2));
  box-shadow: 0 3px 10px rgba(20, 121, 176, .25);
}
.bfb-seg label span {
  display: block;
  border-radius: 8px;
  padding: 7px 2px;
  transition: background .15s, color .15s;
}
.bfb-seg input:focus-visible + span {
  outline: 2px solid var(--bfb-accent);
  outline-offset: 2px;
}

.bfb-hint {
  font-size: 12px;
  color: var(--bfb-muted);
  margin: 12px 0 0;
  line-height: 1.7;
}
.bfb-hint b { color: var(--bfb-ink); }

.bfb-error {
  margin-top: 12px;
  padding: 9px 12px;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--bfb-warn);
  background: rgba(168, 90, 6, .08);
  border: 1px solid rgba(168, 90, 6, .22);
  border-radius: 9px;
}
.bfb-error:empty { display: none; }

/* ---------- 汇总卡 ---------- */
.bfb-summary {
  position: sticky;
  top: 14px;
  background: var(--bfb-card);
  border: 1px solid var(--bfb-line);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--bfb-shadow);
}
.bfb-sum-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.bfb-sum-head h2 { font-size: 16px; margin: 0; }
.bfb-badge {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--bfb-accent);
  background: var(--bfb-soft);
  border-radius: 999px;
  padding: 3px 9px;
  white-space: nowrap;
}
.bfb-big {
  font-size: 38px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--bfb-accent);
  font-variant-numeric: tabular-nums;
}
.bfb-big small {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--bfb-muted);
  margin-left: 6px;
  letter-spacing: 0;
}
.bfb-range {
  font-size: 12.5px;
  color: var(--bfb-muted);
  margin-top: 2px;
}
.bfb-range b { color: var(--bfb-ink); }

/* 母乳 / 奶粉占比条 */
.bfb-split {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--bfb-soft-2);
  margin: 14px 0 6px;
}
.bfb-split i.bm {
  background: linear-gradient(90deg, var(--bfb-accent), var(--bfb-accent-2));
  transition: width .3s ease;
}
.bfb-split i.fm {
  background: repeating-linear-gradient(45deg, var(--bfb-milk-2), var(--bfb-milk-2) 4px, var(--bfb-milk) 4px, var(--bfb-milk) 8px);
  transition: width .3s ease;
}
.bfb-split-legend {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--bfb-muted);
  margin-bottom: 14px;
}
.bfb-split-legend b { color: var(--bfb-ink); font-weight: 700; }

/* ---------- 奶瓶刻度可视化 ---------- */
.bfb-gauge {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 14px;
  align-items: center;
  background: var(--bfb-soft);
  border: 1px solid var(--bfb-line);
  border-radius: 13px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.bfb-bottle {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.bfb-b-cap {
  width: 34px;
  height: 13px;
  border-radius: 5px 5px 2px 2px;
  background: var(--bfb-accent);
  opacity: .9;
}
.bfb-b-neck {
  width: 42px;
  height: 7px;
  background: var(--bfb-soft-2);
  border: 1px solid var(--bfb-line);
  border-bottom: 0;
}
.bfb-b-body {
  position: relative;
  width: 70px;
  height: 112px;
  border: 2px solid var(--bfb-accent-2);
  border-radius: 7px 7px 14px 14px;
  background: var(--bfb-card);
  overflow: hidden;
}
.bfb-b-milk {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 0;
  background: linear-gradient(180deg, var(--bfb-milk), var(--bfb-milk-2));
  transition: height .35s ease;
}
.bfb-b-body span {
  position: absolute;
  right: 4px;
  width: 14px;
  height: 1px;
  background: var(--bfb-accent-2);
  opacity: .55;
}
.bfb-b-body span.t1 { bottom: 20%; }
.bfb-b-body span.t2 { bottom: 40%; }
.bfb-b-body span.t3 { bottom: 60%; }
.bfb-b-body span.t4 { bottom: 80%; }
.bfb-gauge-label {
  font-size: 12px;
  color: var(--bfb-muted);
  font-weight: 600;
}
.bfb-gauge-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--bfb-ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}
.bfb-gauge-cap {
  font-size: 12px;
  color: var(--bfb-muted);
  margin-top: 3px;
}
.bfb-gauge-cap b { color: var(--bfb-ink); }
.bfb-gauge-note {
  font-size: 11.5px;
  line-height: 1.5;
  margin-top: 4px;
  color: var(--bfb-muted);
}
.bfb-gauge-note.bad { color: var(--bfb-warn); font-weight: 600; }
.bfb-gauge-note.ok { color: var(--bfb-ok); font-weight: 600; }

/* ---------- 指标 ---------- */
.bfb-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.bfb-metric {
  background: var(--bfb-soft);
  border: 1px solid var(--bfb-line);
  border-radius: 10px;
  padding: 9px 11px;
}
.bfb-metric span {
  display: block;
  font-size: 11px;
  color: var(--bfb-muted);
}
.bfb-metric b {
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.bfb-metric b.sm { font-size: 14px; }

/* ---------- 明细条 ---------- */
.bfb-detail {
  margin-top: 14px;
  border-top: 1px dashed var(--bfb-line);
  padding-top: 12px;
}
.bfb-detail h3 {
  font-size: 12.5px;
  margin: 0 0 8px;
  color: var(--bfb-muted);
  font-weight: 700;
}
.bfb-detail dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 10px;
  margin: 0;
  font-size: 13px;
}
.bfb-detail dt { color: var(--bfb-muted); }
.bfb-detail dd {
  margin: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.bfb-detail dd.ok { color: var(--bfb-ok); }
.bfb-detail dd.bad { color: var(--bfb-warn); }
.bfb-detail dd.mut { color: var(--bfb-muted); font-weight: 600; }

/* ---------- 结果提示 ---------- */
.bfb-tip {
  margin-top: 12px;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--bfb-muted);
}
.bfb-tip b { color: var(--bfb-ink); }

/* ---------- 按钮 ---------- */
.bfb-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.bfb-btn {
  flex: 1;
  height: 38px;
  border: 0;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--bfb-accent), var(--bfb-accent-2));
  cursor: pointer;
  transition: transform .12s, box-shadow .15s;
}
.bfb-btn:hover { box-shadow: 0 5px 14px rgba(20, 121, 176, .28); }
.bfb-btn:active { transform: translateY(1px); }
.bfb-btn.ghost {
  flex: 0 0 84px;
  color: var(--bfb-accent);
  background: var(--bfb-soft);
  border: 1px solid var(--bfb-line);
}

/* ---------- 内容区块 ---------- */
.bfb-block {
  background: var(--bfb-card);
  border: 1px solid var(--bfb-line);
  border-radius: 16px;
  padding: 20px;
  margin-top: 20px;
  box-shadow: var(--bfb-shadow);
}
.bfb-block > h2 {
  font-size: 18px;
  margin: 0 0 6px;
}
.bfb-block > p {
  font-size: 13px;
  color: var(--bfb-muted);
  margin: 0 0 14px;
}
.bfb-tbl-wrap { overflow-x: auto; margin: 0 -4px; }
.bfb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.bfb-table th,
.bfb-table td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--bfb-line);
  text-align: left;
  vertical-align: top;
}
.bfb-table th {
  font-size: 12px;
  color: var(--bfb-muted);
  font-weight: 700;
  background: var(--bfb-soft);
  white-space: nowrap;
}
.bfb-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bfb-table tbody tr:last-child td { border-bottom: 0; }
.bfb-table .sub { display: block; font-size: 11px; color: var(--bfb-muted); }
.bfb-table td.good { color: var(--bfb-ok); font-weight: 700; }
.bfb-table td.bad { color: var(--bfb-warn); font-weight: 700; }
.bfb-table .tbl-wrap { overflow-x: auto; }

.bfb-sched {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.bfb-sched .bfb-metric b { font-size: 15px; }

.bfb-checklist {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
}
.bfb-checklist li {
  position: relative;
  padding-left: 20px;
  color: var(--bfb-muted);
  line-height: 1.7;
}
.bfb-checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--bfb-ok);
  font-weight: 800;
}
.bfb-checklist li b { color: var(--bfb-ink); }

/* ---------- AI ---------- */
.bfb-ai {
  margin-top: 16px;
  border-top: 1px dashed var(--bfb-line);
  padding-top: 14px;
}
.bfb-ai-btn {
  width: 100%;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(20, 121, 176, .3);
  background: linear-gradient(135deg, rgba(20, 121, 176, .1), rgba(87, 185, 221, .14));
  color: var(--bfb-accent);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.bfb-ai-btn:hover { background: rgba(20, 121, 176, .16); }
.bfb-ai-btn:disabled { opacity: .6; cursor: wait; }
.bfb-ai-note {
  font-size: 11.5px;
  color: var(--bfb-muted);
  margin: 7px 0 0;
  line-height: 1.6;
}
.bfb-ai-status {
  font-size: 13px;
  line-height: 1.8;
  color: var(--bfb-ink);
  margin-top: 8px;
  white-space: pre-wrap;
}
.bfb-ai-status.err { color: var(--bfb-warn); }

/* ---------- FAQ ---------- */
.bfb-faq {
  background: var(--bfb-card);
  border: 1px solid var(--bfb-line);
  border-radius: 16px;
  padding: 20px;
  margin-top: 20px;
  box-shadow: var(--bfb-shadow);
}
.bfb-faq h2 { font-size: 18px; margin: 0 0 12px; }
.bfb-faq details {
  border-bottom: 1px solid var(--bfb-line);
  padding: 10px 0;
}
.bfb-faq details:last-child { border-bottom: 0; padding-bottom: 0; }
.bfb-faq summary {
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 20px;
}
.bfb-faq summary::-webkit-details-marker { display: none; }
.bfb-faq summary::after {
  content: "+";
  position: absolute;
  right: 2px;
  top: -2px;
  font-size: 17px;
  color: var(--bfb-muted);
  font-weight: 400;
}
.bfb-faq details[open] summary::after { content: "−"; }
.bfb-faq p {
  font-size: 13px;
  color: var(--bfb-muted);
  margin: 7px 0 2px;
  line-height: 1.85;
}
.bfb-faq p b { color: var(--bfb-ink); }

.bfb-disclaimer {
  font-size: 12px;
  color: var(--bfb-muted);
  line-height: 1.8;
  margin: 18px 2px 0;
}

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .bfb-grid { grid-template-columns: 1fr; }
  .bfb-summary { position: static; }
  .bfb-hero { grid-template-columns: 1fr; }
  .bfb-hero-art { display: none; }
  .bfb-sched { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .bfb-shell { padding: 12px 12px 0; }
  .bfb-hero { padding: 20px 18px; }
  .bfb-hero h1 { font-size: 22px; }
  .bfb-fields { grid-template-columns: 1fr; }
  .bfb-checklist { grid-template-columns: 1fr; }
  .bfb-card, .bfb-block, .bfb-faq { padding: 16px; }
  .bfb-big { font-size: 32px; }
  .bfb-table { font-size: 12px; }
  .bfb-table th, .bfb-table td { padding: 7px 5px; }
}

/* ---------- 打印 ---------- */
@media print {
  .bfb-page { background: #fff; padding: 0; }
  .bfb-crumb, .bfb-actions, .bfb-ai, .bfb-faq, .bfb-hero-art,
  .bfb-hero-meta, .bfb-disclaimer, .bfb-card-head .bfb-link { display: none !important; }
  .bfb-hero, .bfb-card, .bfb-summary, .bfb-block, .bfb-faq {
    box-shadow: none;
    border-color: #ccc;
  }
  .bfb-grid { grid-template-columns: 1fr; }
  .bfb-summary { position: static; }
  .bfb-card, .bfb-block { break-inside: avoid; }
}

