/* 深色模式：放在所有样式最后加载，只覆盖颜色。v111 起这个文件里不再写 @media：index.html 用 <link media> 控制它生效——
   跟随系统时 media 是 (prefers-color-scheme: dark)，“我的 → 外观”选深色是 all、选浅色是 not all（theme-boot.js、features/theme.js）。
   新加样式写了固定颜色（#fff、浅色底、深灰字）时，要在这里补深色版，否则深色下会出现白块或看不清的字。
   图表系列色（配方奶 #3b8fc6、瓶喂母乳 #d6607e、臭臭 #a8761c、生长曲线 #2f80c0）在深色底 #1b232b 上
   用 dataviz 校验脚本检查过，保持不变；首页体重线 #287351 对比不够，深色下换成 #3fa877。
   首页图表（home-charts.js）的颜色写在 SVG 里，深色版在那个文件的 DARK 表。 */

  :root {
    color-scheme: dark;
    --bg: #11171d;
    --surface: #1b232b;
    --surface-soft: #212b34;
    --text: #e6edf3;
    --muted: #93a1ae;
    --line: #2c3843;
    --shadow: 0 16px 38px rgba(0, 0, 0, 0.35);
    /* 深色下用的几种文字色和淡底色 */
    --d-text-2: #c9d3dc;
    --d-text-3: #a5b2be;
    --d-blue: #7cbfe6;
    --d-pink: #f08aa5;
    --d-green: #6fd3a2;
    --d-red: #ff8a80;
    --d-orange: #f0ad62;
    --d-raised: #2f3b46;
    --d-field: #222c35;
    --d-bg-blue: #1d2f40;
    --d-bg-pink: #3a2430;
    --d-bg-green: #1c3328;
    --d-bg-yellow: #3a3220;
    --d-bg-teal: #183331;
    --d-bg-red: #3b2022;
    --d-bg-orange: #3a2b1c;
    --d-bg-lavender: #2a2540;
  }

  /* 外壳、状态栏、登录 */
  body::after { background: rgba(17, 23, 29, 0.94); }
  .app-shell { background: linear-gradient(180deg, #141b22 0, var(--bg) 260px); }
  .login-card { background: rgba(27, 35, 43, 0.92); }
  .login-card input { background: var(--d-field); color: var(--text); }
  /* 原来是“深色底 + 白字”（背景用 --text），深色下 --text 变浅，要改成浅底深字 */
  .login-card button, .primary-action, .secondary-action, .feature-panel button { background: var(--text); color: var(--bg); }
  .top-actions button { background: rgba(27, 35, 43, 0.85); box-shadow: none; }

  /* 卡片、列表、底部导航 */
  .feed-type-grid button, .care-type-grid button { background: rgba(27, 35, 43, 0.9); box-shadow: none; }
  .feeding-overview article { background: rgba(27, 35, 43, 0.9); box-shadow: none; }
  .timeline-card { background: var(--surface); box-shadow: none; }
  .timeline-card::before { box-shadow: 0 0 0 4px rgba(88, 169, 212, 0.2); }
  .swipe-clip, .swipe-content { background: var(--surface); box-shadow: none; }
  .bottom-nav { background: rgba(22, 29, 36, 0.94); box-shadow: 0 -1px 0 var(--line); }
  .bottom-nav button.active { background: var(--d-bg-blue); }
  .vaccine-empty { background: rgba(27, 35, 43, 0.65); }
  .home-card, .milk-chart, .growth-chart, .me-profile, .guide-age, .guide-vaccine, .guide-entry { box-shadow: none; }
  .guide-age.next { box-shadow: 0 0 0 2px #58a9d4; }

  /* 记录图标的淡底色 */
  .breast-icon, .temperature-icon, .nav-health, .record-icon.vaccine-mark, .upcoming-icon.vaccine-mark,
  .care-type-grid .feed-type-icon.vaccine-mark, .guide-entry-icon, .me-icon.pink { background: var(--d-bg-pink); color: var(--d-pink); }
  .formula-icon, .record-icon.checkup-mark, .upcoming-icon.checkup-mark,
  .care-type-grid .feed-type-icon.checkup-mark, .nav-records, .me-icon.blue { background: var(--d-bg-blue); color: var(--d-blue); }
  .food-icon, .jaundice-icon { background: var(--d-bg-yellow); }
  .diaper-icon { background: var(--d-bg-teal); }
  .supplement-icon { background: var(--d-bg-green); }
  .growth-mark, .nav-growth, .me-icon.green { background: var(--d-bg-green); color: var(--d-green); }
  .me-icon.red, #cloud-backup-state.warn .me-icon { background: var(--d-bg-red); color: var(--d-red); }

  /* 填写页 */
  .feed-sheet { background: rgba(5, 10, 15, 0.72); }
  .sheet-card { background: rgba(27, 35, 43, 0.97); box-shadow: none; }
  .feed-form input, .feed-form select, .vaccine-form textarea, .feed-form textarea { background: var(--d-field); color: var(--text); }
  .feed-form .med-dose select, .chip-group span { background: var(--d-field); color: var(--text); }
  .chip-group input:checked + span { background: var(--d-bg-blue); color: var(--d-blue); }
  .feed-form .swatch-group input:checked ~ small { color: var(--d-blue); }
  .swatch-group input:checked + i { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--blue); }
  .cancel-feed { background: rgba(27, 35, 43, 0.9); color: var(--text); }
  .feed-sheet .save-feed.incomplete { background: #3a4753; color: #b5c0ca; }
  .segmented, .chart-tabs, .sex-toggle { background: var(--d-field); }
  .segmented input:checked + span, .chart-tabs button[aria-selected="true"], .feed-filter button[aria-selected="true"], .health-filter button[aria-selected="true"], .monitor-filter button[aria-selected="true"],
  .guide-views button[aria-selected="true"], .library-tabs button[aria-selected="true"], .guide-switch button[aria-selected="true"], .sex-toggle button[aria-pressed="true"] { background: var(--d-raised); color: var(--text); box-shadow: none; }
  .record-menu-close { background: var(--d-raised); }
  .record-menu-backdrop { background: rgba(0, 0, 0, 0.5); }

  /* 写死的深灰、蓝、粉、绿、红、橙文字 */
  .home-small, .home-legend, .diaper-icons b, .home-clock-legend, .guide-age header span, .guide-disease,
  .me-value, #baby-birth, #account-password, #backup-status { color: var(--d-text-2); }
  .milk-hero-text, .home-card-label, .home-note, .diaper-icons .none, .home-clock-head small, .milestone-ends,
  .guide-entry small, .guide-intro, .guide-age header small, .guide-vaccine header small, .guide-note,
  .me-baby-line, .me-group-title, .me-backup-state small, .sex-toggle button { color: var(--d-text-3); }
  #milk-next, .guide-age.next header small, .guide-line b.free, .guide-tag.free, .me-back,
  .report-row button, .report-list > button { color: var(--d-blue); }
  #milk-next.over, #next-side, .feed-form #feed-next-side, .vaccine-card .overdue, .vaccine-error, .checkup-card .overdue { color: var(--d-pink); }
  .home-note.good, .guide-tag.local, #password-status { color: var(--d-green); }
  .guide-line b.paid, .guide-tag.paid { color: var(--d-orange); }
  #avatar-status, .avatar-error, .me-logout, #cloud-backup-state.warn #cloud-backup-title { color: var(--d-red); }
  .guide-doses li.past { color: #6f7d89; }

  /* 疫苗参考表的标签 */
  .guide-chip.free { background: var(--d-bg-blue); color: var(--d-blue); }
  .guide-chip.paid { background: var(--d-bg-orange); color: var(--d-orange); }
  .guide-chip.local { background: var(--d-bg-green); color: var(--d-green); }

  /* 首页里程碑、夜间说明 */
  .night-key { background: #252a44; }
  .milestone-bar { background: var(--d-bg-lavender); }

  /* “我的”页 */
  .me-row + .me-row::before { background: var(--line); }
  .me-sync, .me-profile { box-shadow: none; }
  .me-sync small, .me-stats { color: var(--d-text-3); }
  #me-sync-now { background: var(--d-bg-blue); color: var(--d-blue); }
  .me-daily[aria-pressed="true"] { background: var(--d-bg-green); color: var(--d-green); }
  .me-remove, .me-value.warn { color: var(--d-red); }
  .me-add, .me-option[aria-checked="true"] .me-label, .me-option[aria-checked="true"] .me-label::after { color: var(--d-blue); }
  .avatar.me-avatar { box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px #2c3d4b; }
  .me-camera { background: var(--d-raised); box-shadow: 0 0 0 3px var(--surface); }
  .backup-actions button { background: var(--d-field); color: var(--text); }
  .backup-actions svg { stroke: var(--d-blue); }

  /* 记录页“按日期”跳转 */
  .section-heading .day-jump { background: var(--d-bg-blue); color: var(--d-blue); }
  .feed-jump-note { color: var(--d-blue); }
  @keyframes day-jumped { 0%, 40% { background: var(--d-bg-blue); } 100% { background: transparent; } }

  /* 提示条 */
  .backup-alert { background: var(--d-bg-red); color: var(--d-red); }
  .profile-button.backup-warn::after { border-color: var(--bg); }
  .update-banner { background: var(--text); color: var(--bg); }

  /* 生长曲线、每日奶量柱状图（系列色不变，只换网格、参考带、基线） */
  .growth-svg .grid, .trend-svg .grid { stroke: #2a343e; }
  .trend-chart { box-shadow: none; }
  .growth-svg .band-outer { fill: #1f2a33; }
  .growth-svg .band-inner { fill: #263744; }
  .growth-svg .ref-line { stroke: #4b5a66; }
  .growth-svg .ref-median { stroke: #6b7c89; }
  .growth-svg .baby-point { stroke: var(--surface); }
  .growth-zoom-reset, .chart-zoom-reset { background: var(--d-bg-blue); color: var(--d-blue); }
  .milk-svg .baseline { stroke: #34414c; }
  .milk-svg .avg { stroke: #93a1ae; }
  .milk-legend i.dash { border-top-color: #93a1ae; }
  .milk-svg .picked { stroke: var(--text); }
  .health-tabs, .growth-tabs { background: var(--d-field); }
  .health-tabs button[aria-selected="true"], .growth-tabs button[aria-selected="true"] { background: var(--d-raised); color: var(--text); box-shadow: none; }
  .monitor-card { background: rgba(27, 35, 43, 0.9); box-shadow: none; }
  .monitor-card[aria-selected="true"] { border-color: var(--d-blue); }

  /* 睡眠：系列色 #7a6bd6 不变，淡底和文字换深色版 */
  .sleep-now { background: #27243f; box-shadow: none; }
  .sleep-now-text small, .feed-form .sleep-ongoing-info small { color: #b9afff; }
  .sleep-icon { background: #27243f; }
  .play-icon { background: #173a33; }
  .feed-form .play-span { color: #5fd0b5; }
  #play-chips button[aria-pressed="true"] { background: var(--d-bg-blue); color: var(--d-blue); }
  .sheet-hint { color: var(--d-text-3); }
  .sleep-duration b.bad { color: var(--d-pink); }
  /* 首页趋势卡片、喂奶统计 */
  .trend-head small, .trend-foot, .milk-stats-grid span, .milk-stats-grid strong small { color: var(--d-text-3); }
  .trend-card .home-big small { color: var(--d-text-2); }
  .trend-foot.sleeping { color: #b9afff; }
  .milk-stats, .trend-card { box-shadow: none; }
  /* 大事记 */
  .record-icon.milestone-icon, .feed-type-icon.milestone-icon, .timeline .milestone-tag, .chip-library button[aria-pressed="true"],
  #milestone-form .milestone-age:not(:empty), #home-milestone .milestone-log { background: var(--d-bg-yellow); color: var(--d-orange); }
  #milestone-form .milestone-age { color: var(--d-orange); }
  .chip-library button { background: var(--d-field); border-color: var(--line); }
  .chip-library .chip-add { color: var(--d-blue); }
  .milestone-thumb { background: var(--d-field); }
  #milestone-form .milestone-photo-add, #milestone-form .milestone-photo-tool { background: var(--d-bg-blue); color: var(--d-blue); }
  #milestone-form button.milestone-photo-tool { color: var(--d-text-3); }
  .backup-download { color: var(--d-blue); }
  /* 2026-11-17 五项借鉴 */
  .feed-week button { background: var(--surface); box-shadow: none; }
  .feed-week button.is-today b { color: var(--d-blue); }
  .feed-week button[aria-pressed="true"] { background: #2f6f99; }
  .record-icon.clinic-icon, .upcoming-icon.clinic-icon, .feed-type-icon.clinic-icon, .timeline .clinic-tag { background: var(--d-bg-red); color: var(--d-red); }
  .guide-head, .guide-actual > div { background: var(--d-field); }
  .guide-row.now { background: #3a3220; }
  .guide-toggle { color: var(--d-blue); }
  .guide-toggle[aria-expanded="true"] { background: var(--d-bg-blue); }
  .guide-actual .ok small { color: var(--d-green); }
  .guide-actual .low small, .guide-actual .high small { color: #f3b27a; }
  .layout-switch { background: #3a4754; }
  .layout-switch[aria-checked="true"] { background: #5aa9dc; }
  .layout-new { background: #372b17; color: #f0b562; }
  .layout-note, .trend-foot.warn, .guide-mini .low small, .guide-mini .high small { color: #f3b27a; }
  .me-reset-link { color: var(--d-blue); }
  .extra-chips span { background: var(--d-field); }
  .extra-chips span.done, .moment-thumb.empty { background: var(--d-bg-green); color: var(--d-green); }
  .trend-foot.good, .guide-mini .ok small { color: var(--d-green); }
  .extra-card .home-big.hot { color: var(--d-red); }
  .timeline .first-tag { background: #1d3a2b; color: #7fd6a6; }
  .timeline .spit-tag, .milk-stats-extra { background: #3a2a1d; color: #f3b27a; }
  .timeline .night-tag, .me-icon.purple { background: #2c2747; color: #b9afff; }
  .milk-stats-last, .last-night { background: #27243f; }
  .milk-stats-last span, .last-night-text small { color: #b9afff; }
  .night-inputs select { background: var(--d-field); color: var(--d-text-2); }
  .night-note button { color: var(--d-blue); }



/* iPhone 风格（v110，styles/ios.css）的深色版：系统深色分组底（纯黑）、卡片 #1c1c1e、不用阴影、分隔线和填充用系统深色值；
   卡片头的类别色在深色底上提亮。 */

  :root {
    --bg: #000000;
    --surface: #1c1c1e;
    --surface-soft: #2c2c2e;
    --line: #38383a;
    --muted: #98989f;
    --sep: rgba(84, 84, 88, 0.65);
    --fill: rgba(118, 118, 128, 0.24);
    --fill-press: rgba(118, 118, 128, 0.32);
    --d-field: #2c2c2e;
    --d-raised: #3a3a3c;
    --ios-green: #30d158;
    --ios-blue: #5aa9dc;
    --card-shadow: none;
    --thumb-shadow: 0 3px 8px rgba(0, 0, 0, 0.3), 0 0 0 0.5px rgba(255, 255, 255, 0.06);
  }
  .app-shell { background: var(--bg); }
  body::after { background: rgba(0, 0, 0, 0.75); }
  .bottom-nav { background: rgba(22, 22, 24, 0.82); }
  .me-topbar.compact { background: rgba(22, 22, 24, 0.82); }
  .top-actions .settings-button { background: var(--fill); color: var(--ios-blue); }
  .feed-sheet { background: rgba(0, 0, 0, 0.5); }
  .feed-form { background: var(--bg); }
  .feed-form::before { background: rgba(235, 235, 245, 0.3); }
  .sheet-card { background: var(--surface); }
  .segmented input:checked + span, .chart-tabs button[aria-selected="true"], .feed-filter button[aria-selected="true"], .health-filter button[aria-selected="true"],
  .monitor-filter button[aria-selected="true"], .library-tabs button[aria-selected="true"], .guide-switch button[aria-selected="true"], .sex-toggle button[aria-pressed="true"],
  .health-tabs button[aria-selected="true"], .growth-tabs button[aria-selected="true"], .guide-views button[aria-selected="true"], .has-seg-thumb > .seg-thumb { background: #636366; }
  .layout-switch::after, .feed-form .check-row input[type="checkbox"]::after { box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3); }
  .milk-stats-grid.strip { background: var(--surface-soft); }
  [data-home-card="since"], [data-home-card="milk"], [data-home-card="guide"] { --c: #6fb6e6; --c-soft: rgba(59, 143, 198, 0.25); }
  [data-home-card="nurse"] { --c: #f08aa5; --c-soft: rgba(214, 96, 126, 0.25); }
  [data-home-card="diaper"] { --c: #e0aa55; --c-soft: rgba(168, 118, 28, 0.3); }
  [data-home-card="sleep"], [data-home-card="day24"] { --c: #b3a8ff; --c-soft: rgba(122, 107, 214, 0.3); }
  [data-home-card="play"] { --c: #5fd0b5; --c-soft: rgba(31, 143, 118, 0.3); }
  [data-home-card="bath"] { --c: #4cc3d6; --c-soft: rgba(19, 137, 158, 0.3); }
  [data-home-card="food"] { --c: #f0ad62; --c-soft: rgba(194, 124, 14, 0.3); }
  [data-home-card="med"], [data-home-card="weight"] { --c: #6fd3a2; --c-soft: rgba(47, 158, 106, 0.28); }
  [data-home-card="temp"] { --c: #ff8a80; --c-soft: rgba(204, 90, 69, 0.28); }
  [data-home-card="bili"], [data-home-card="mile"], [data-home-card="moment"], [data-home-card="plans"] { --c: #f0c060; --c-soft: rgba(215, 169, 79, 0.28); }


/* v112「＋」菜单深色：弹出页是深灰（和 iPhone 弹出页一样），图标底色提亮一点 */
.record-menu-panel { background: #1c1c1e; }
.menu-pages { background: #2c2c2e; }
.sheet-grab { background: rgba(235, 235, 245, 0.3); }
.menu-dots i { background: rgba(235, 235, 245, 0.3); }
.record-menu .menu-page > button.dragging { background: #3a3a3c; }
#add-growth { --ic: #6fd3c6; }
[data-add="vaccines"] { --ic: #f08aa5; }
[data-add="checkups"] { --ic: #7cbfe6; }
/* v112“我的”一级页深色 */
.me-sex-tag { background: rgba(59, 143, 198, 0.28); color: #7cbfe6; }
#me .me-mini-icon { background: rgba(47, 158, 106, 0.28); color: #6fd3a2; }
#me .me-sync .me-mini-icon { background: rgba(59, 143, 198, 0.28); color: #7cbfe6; }
#me .me-sync.warn .me-mini-icon, #me .me-backup.warn .me-mini-icon { background: rgba(255, 69, 58, 0.25); color: #ff8a80; }
#me .me-backup.warn #me-backup-value, #me .me-sync.warn #me-sync-title { color: #ff8a80; }

/* 首页编辑模式和宽卡（v115）：卡片是深色，把手和 − 换浅色才看得出 */
.edit-grip path { stroke: #d1d1d6; }
.edit-grip svg { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6)); }
.edit-minus { background: #636366; color: #fff; }
.top-actions .home-edit-done { background: var(--ios-blue); color: #fff; }
.home-cards .wide-list .done b, .home-cards .wide-list .ok small { color: var(--d-green); }
.home-cards .wide-list .warn small, .home-cards .wide-list .low small, .home-cards .wide-list .high small { color: #f3b27a; }
.edit-ghost { background: rgba(90, 169, 220, 0.14); }

/* 存储空间（v120）：系列色提亮一点，快照柱、标签在深色底上看得清 */
.storage-page { --st-feed: #5aa9dc; --st-other: #45b5b5; --st-avatar: #9d90ee; --st-photo: #e2a33a; --st-sys: #636366; }
.storage-page .st-snap i { background: rgba(90, 169, 220, 0.45); }
.storage-page .st-pill.fine { background: rgba(48, 209, 88, 0.18); color: #30d158; }
.storage-page .st-pill.warn { background: rgba(255, 159, 10, 0.18); color: #ff9f0a; }
.storage-page .st-bad { color: #ff453a; }

/* 记录页顶上那排（v123）：深色毛玻璃 */
/* 提醒条（v127） */
.notify-banner { background: var(--d-bg-blue); }
.notify-banner-text small { color: var(--d-text-2); }
.notify-actions button { background: var(--d-raised); color: var(--d-blue); }
.notify-close { color: var(--d-blue); }
.notify-status.bad { color: var(--d-red); }
/* 洗澡（v132）：淡底、提示文字换深色版；柱子 #13899e 深色底也够 3:1，不变 */
.bath-icon { background: #10343b; }
.feed-form .bath-minutes button { background: var(--d-field); border-color: var(--line); }
.feed-form .bath-minutes button[aria-pressed="true"], #bath-chips button[aria-pressed="true"] { background: var(--d-bg-blue); color: var(--d-blue); }
.feed-form .bath-temp-note { color: #4cc3d6; }
.feed-form .bath-temp-note.hot { color: #f0a070; }
.feed-form .bath-temp-skip { color: var(--d-blue); }
