/* 穿戴 App 外壳 v3 — 两套彩色配色(2026-10-06 主公定):
   candy = 晴日糖果(默认,浅色暖白 + 糖果色卡)  neon = 霓虹夜空(深色 + 天空头图 + 渐变发光卡)
   切换写在 <html data-theme>,频道主题色写在 <html data-ch>(今天橙 / 睡眠紫 / 健身绿 / 用药粉 / 记录蓝 / 健康红)。
   好坏色是规矩(绿 = 在范围 / 达标,琥珀 = 偏离且不利,红 = 较差),两套配色都用实心胶囊,不和卡片渐变混。 */

/* ---------- 公共尺寸 ---------- */
:root {
  --radius: 24px; --radius-s: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  --good: #16a34a; --warn: #f59e0b; --bad: #ef4444;
  --accg: linear-gradient(135deg, var(--acc1), var(--acc2));
}

/* ---------- 频道主题色(两套共用色相,ink 各自定) ---------- */
:root, :root[data-ch="today"] { --acc1: #fbbf24; --acc2: #f97316; }
:root[data-ch="sleep"]   { --acc1: #818cf8; --acc2: #a855f7; }
:root[data-ch="fitness"] { --acc1: #34d399; --acc2: #06b6d4; }
:root[data-ch="meds"]    { --acc1: #f472b6; --acc2: #f43f5e; }
:root[data-ch="records"] { --acc1: #60a5fa; --acc2: #6366f1; }
:root[data-ch="health"]  { --acc1: #fb7185; --acc2: #e11d48; }

/* ---------- 晴日糖果(默认) ---------- */
:root, :root[data-theme="candy"] {
  color-scheme: light;
  --bg: #fcf8f5; --card: #ffffff; --card2: #f4eef7; --line: #eee6f1;
  --fg: #1f1a2e; --fg2: #6b6280; --fg3: #9a90ab;
  --shadow: 0 6px 18px rgba(80, 40, 120, .08); --shadow-s: 0 2px 8px rgba(80, 40, 120, .07);
  --acc-ink: #c2410c; --primary: var(--acc-ink); --on-acc: #fff;
  --good-ink: #15803d; --warn-ink: #b45309; --bad-ink: #dc2626;
  --activity: #10b981; --activity-bg: linear-gradient(135deg, #d1fae5, #a7f3d0); --activity-ink: #047857; --activity-tint: #dcfce7;
  --sleep: #7c3aed; --sleep-bg: linear-gradient(135deg, #ede9fe, #c4b5fd); --sleep-ink: #5b21b6; --sleep-tint: #ede9fe;
  --recovery: #f43f5e; --recovery-bg: linear-gradient(135deg, #ffe4e6, #fecdd3); --recovery-ink: #be123c; --recovery-tint: #ffe4e6;
  --vitals: #0ea5e9; --vitals-bg: linear-gradient(135deg, #e0f2fe, #bae6fd); --vitals-ink: #0369a1; --vitals-tint: #e0f2fe;
  --tile-glow: none; --tile-fg: var(--fg); --tile-fg2: #4a4060; --tile-ic: #fff;
  --rem: #93c5fd; --light: #a5b4fc; --deep: #7c3aed;
  --ring-track: #f3e8e2; --ring-a: #fbbf24; --ring-b: #f97316; --ring-c: #ec4899;
  --rng-line: rgba(31, 26, 46, .35); --spark-line: rgba(31, 26, 46, .45);
  --c-activity: #10b981; --c-sleep: #7c3aed; --c-recovery: #f43f5e; --c-vitals: #0ea5e9; --c-primary: #6366f1;
  --chart-grid: rgba(31, 26, 46, .07); --chart-tick: #8a8199; --chart-goal: rgba(31, 26, 46, .4); --chart-soft: rgba(31, 26, 46, .3); --chart-band: rgba(99, 102, 241, .12);
  --chart-tip-bg: #ffffff; --chart-tip-fg: #1f1a2e; --chart-tip-line: #e9e1ee;
  --tab-bg: #ffffff; --toast-bg: #1f1a2e; --toast-fg: #fff;
  --sky: linear-gradient(180deg, color-mix(in srgb, var(--acc1) 30%, var(--bg)) 0%, color-mix(in srgb, var(--acc2) 10%, var(--bg)) 60%, var(--bg) 100%);
}
:root[data-theme="candy"][data-ch="today"]   { --acc-ink: #c2410c; }
:root[data-theme="candy"][data-ch="sleep"]   { --acc-ink: #6d28d9; }
:root[data-theme="candy"][data-ch="fitness"] { --acc-ink: #047857; }
:root[data-theme="candy"][data-ch="meds"]    { --acc-ink: #be185d; }
:root[data-theme="candy"][data-ch="records"] { --acc-ink: #1d4ed8; }
:root[data-theme="candy"][data-ch="health"]  { --acc-ink: #be123c; }

/* ---------- 霓虹夜空 ---------- */
:root[data-theme="neon"] {
  color-scheme: dark;
  --bg: #0d0b1a; --card: #17132b; --card2: #251f42; --line: #2c2650;
  --fg: #f4f2ff; --fg2: #b9b3dd; --fg3: #8a84b3;
  --shadow: 0 10px 26px rgba(0, 0, 0, .32); --shadow-s: none;
  --acc-ink: #fdba74; --on-acc: #fff;
  --good-ink: #6ee7a0; --warn-ink: #fcd34d; --bad-ink: #fca5a5;
  --activity: #10b981; --activity-bg: linear-gradient(135deg, #10b981, #06b6d4); --activity-ink: #5eead4; --activity-tint: rgba(16, 185, 129, .22);
  --sleep: #a855f7; --sleep-bg: linear-gradient(135deg, #6366f1, #a855f7 60%, #ec4899); --sleep-ink: #d8b4fe; --sleep-tint: rgba(168, 85, 247, .26);
  --recovery: #f43f5e; --recovery-bg: linear-gradient(135deg, #f43f5e, #fb923c); --recovery-ink: #fda4af; --recovery-tint: rgba(244, 63, 94, .22);
  --vitals: #0ea5e9; --vitals-bg: linear-gradient(135deg, #0ea5e9, #6366f1); --vitals-ink: #7dd3fc; --vitals-tint: rgba(14, 165, 233, .22);
  --tile-fg: #fff; --tile-fg2: rgba(255, 255, 255, .88); --tile-ic: rgba(255, 255, 255, .22);
  --rem: #a5b4fc; --light: #60a5fa; --deep: #a855f7;
  --ring-track: rgba(128, 120, 190, .2); --ring-a: #22d3ee; --ring-b: #a855f7; --ring-c: #ec4899;
  --rng-line: rgba(255, 255, 255, .55); --spark-line: rgba(255, 255, 255, .6);
  --c-activity: #2dd4bf; --c-sleep: #a78bfa; --c-recovery: #fb7185; --c-vitals: #38bdf8; --c-primary: #818cf8;
  --chart-grid: rgba(255, 255, 255, .07); --chart-tick: #8f89b8; --chart-goal: rgba(255, 255, 255, .4); --chart-soft: rgba(255, 255, 255, .35); --chart-band: rgba(255, 255, 255, .1);
  --chart-tip-bg: #251f42; --chart-tip-fg: #f4f2ff; --chart-tip-line: #3b3366;
  --tab-bg: #0d0b1a; --toast-bg: #2c2650; --toast-fg: #fff;
  --sky: linear-gradient(160deg, var(--acc1), var(--acc2));
}
:root[data-theme="neon"][data-ch="today"]   { --acc-ink: #fdba74; }
:root[data-theme="neon"][data-ch="sleep"]   { --acc-ink: #c4b5fd; }
:root[data-theme="neon"][data-ch="fitness"] { --acc-ink: #6ee7b7; }
:root[data-theme="neon"][data-ch="meds"]    { --acc-ink: #f9a8d4; }
:root[data-theme="neon"][data-ch="records"] { --acc-ink: #93c5fd; }
:root[data-theme="neon"][data-ch="health"]  { --acc-ink: #fda4af; }
:root[data-theme="neon"] { --primary: var(--acc-ink); }
/* 霓虹的天空:今天按时段,睡眠是夜空,其余按频道色 */
:root[data-theme="neon"][data-ch="today"][data-sky="dawn"]  { --sky: linear-gradient(160deg, #f97316 0%, #ec4899 55%, #8b5cf6 100%); }
:root[data-theme="neon"][data-ch="today"][data-sky="day"]   { --sky: linear-gradient(160deg, #0ea5e9 0%, #6366f1 58%, #a855f7 100%); }
:root[data-theme="neon"][data-ch="today"][data-sky="dusk"]  { --sky: linear-gradient(160deg, #f59e0b 0%, #ef4444 48%, #7c3aed 100%); }
:root[data-theme="neon"][data-ch="today"][data-sky="night"],
:root[data-theme="neon"][data-ch="sleep"] {
  --sky: radial-gradient(2px 2px at 18% 30%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 66% 16%, #fff 50%, transparent 51%),
         radial-gradient(1.5px 1.5px at 42% 58%, #e9d5ff 50%, transparent 51%), radial-gradient(2px 2px at 86% 52%, #fff 50%, transparent 51%),
         radial-gradient(1.5px 1.5px at 30% 78%, #fff 50%, transparent 51%), linear-gradient(160deg, #1e1b4b 0%, #4c1d95 60%, #7c3aed 100%);
}
:root[data-theme="neon"][data-ch="fitness"] { --sky: linear-gradient(160deg, #10b981 0%, #0891b2 55%, #4f46e5 100%); }
:root[data-theme="neon"][data-ch="meds"]    { --sky: linear-gradient(160deg, #f472b6 0%, #fb7185 55%, #fb923c 100%); }
:root[data-theme="neon"][data-ch="records"] { --sky: linear-gradient(160deg, #3b82f6 0%, #6366f1 55%, #8b5cf6 100%); }
:root[data-theme="neon"][data-ch="health"]  { --sky: linear-gradient(160deg, #fb7185 0%, #e11d48 52%, #7c3aed 100%); }

/* ---------- 基础 ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font-family: -apple-system, "SF Pro Text", "PingFang SC", "Helvetica Neue", Roboto, "Noto Sans CJK SC", sans-serif; font-size: 16px; line-height: 1.45; }
body { padding-bottom: calc(76px + var(--safe-b)); overscroll-behavior-y: contain; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; letter-spacing: -0.02em; }
.wrap { max-width: 480px; margin: 0 auto; padding: 0 16px; position: relative; z-index: 1; }
.muted { color: var(--fg2); } .faint { color: var(--fg3); }
.h1 { font-size: 25px; font-weight: 800; margin: 0; } .h2 { font-size: 18px; font-weight: 800; margin: 0; } .h3 { font-size: 15px; font-weight: 700; margin: 0; }
.small { font-size: 13px; } .tiny { font-size: 12px; }

/* 天空头图:糖果 = 顶部一抹频道色;霓虹 = 整块天空,下面的卡片压在它上面 */
.sky { position: absolute; top: 0; left: 0; right: 0; height: calc(232px + var(--safe-t)); background: var(--sky); z-index: 0; pointer-events: none; }
:root[data-theme="neon"] .sky { border-radius: 0 0 34px 34px; overflow: hidden; }
:root[data-theme="neon"][data-ch="today"][data-sky="day"] .sky::after { content: ""; position: absolute; right: -36px; top: calc(20px + var(--safe-t)); width: 170px; height: 170px; border-radius: 50%; background: radial-gradient(circle, rgba(253, 230, 138, .95) 0%, rgba(253, 230, 138, 0) 68%); }
:root[data-theme="neon"][data-ch="today"][data-sky="night"] .sky::after { content: ""; position: absolute; right: 44px; top: calc(70px + var(--safe-t)); width: 34px; height: 34px; border-radius: 50%; box-shadow: -10px 6px 0 0 #fde68a; }
:root[data-theme="neon"] .sky.detail { height: calc(150px + var(--safe-t)); }
.sky.none { display: none; }
/* 状态栏那一条(iPhone 桌面图标打开时):铺频道色,白字看得清 */
.statusbar { position: fixed; top: 0; left: 0; right: 0; height: var(--safe-t); background: var(--accg); z-index: 8; }

/* 顶栏(不再吸顶,随页面滚走) */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: calc(14px + var(--safe-t)) 16px 6px; position: relative; z-index: 2; max-width: 480px; margin: 0 auto; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--card); color: var(--fg2); font-size: 13px; box-shadow: var(--shadow-s); }
.pill.active { background: var(--accg); color: var(--on-acc); font-weight: 700; }
.pill:disabled { opacity: .45; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accg); color: var(--on-acc); display: grid; place-items: center; font-weight: 800; }
.theme-btn { width: 30px; height: 30px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow-s); display: grid; place-items: center; font-size: 14px; line-height: 1; }
.top-r { display: flex; align-items: center; gap: 8px; }
:root[data-theme="neon"] .topbar .pill { background: rgba(255, 255, 255, .18); color: #fff; }
:root[data-theme="neon"] .topbar .pill.active { background: #fff; color: #4338ca; }
:root[data-theme="neon"] .avatar { background: #fff; color: #4338ca; }
:root[data-theme="neon"] .theme-btn { background: rgba(255, 255, 255, .18); }
/* 霓虹:压在天空上的页头文字一律白 */
:root[data-theme="neon"] .page-head, :root[data-theme="neon"] .page-head .h1 { color: #fff; }
:root[data-theme="neon"] .page-head .faint, :root[data-theme="neon"] .page-head .muted, :root[data-theme="neon"] .page-head.faint, :root[data-theme="neon"] .page-head.muted { color: rgba(255, 255, 255, .86); }
:root[data-theme="neon"] .page-head .pill { background: rgba(255, 255, 255, .2); color: #fff; box-shadow: none; }

/* 卡片 */
.card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card + .card, .section + .section { margin-top: 12px; }
.section { margin-top: 20px; }
.section-title { font-size: 20px; font-weight: 800; margin: 0 0 10px; }
button.card { width: 100%; }

/* 指标块:糖果 = 浅色渐变 + 实心彩色图标;霓虹 = 饱和渐变 + 发光 */
.tile { border-radius: var(--radius); padding: 13px 12px; min-height: 86px; display: flex; align-items: center; gap: 10px; background: var(--card); color: var(--tile-fg); text-align: left; box-shadow: var(--shadow-s); }
.tile .icon { width: 38px; height: 50px; border-radius: 999px; display: grid; place-items: center; font-size: 20px; flex: none; background: var(--tile-ic); }
.tile .t { font-size: 14px; color: var(--tile-fg2); }
.tile .v { font-size: 24px; font-weight: 800; line-height: 1.1; }
.tile .v small { font-size: 12px; font-weight: 600; margin-left: 2px; color: var(--tile-fg2); }
.tile .v.nodata { font-size: 18px; font-weight: 700; color: var(--tile-fg2) !important; }
.tile .s { font-size: 12px; color: var(--tile-fg2); margin-top: 2px; opacity: .9; }
.tile .st { margin-top: 4px; }
.tile.activity { background: var(--activity-bg); } .tile.sleep { background: var(--sleep-bg); }
.tile.recovery { background: var(--recovery-bg); } .tile.vitals { background: var(--vitals-bg); }
:root[data-theme="candy"] .tile.activity .icon, :root:not([data-theme]) .tile.activity .icon { background: var(--activity); }
:root[data-theme="candy"] .tile.sleep .icon, :root:not([data-theme]) .tile.sleep .icon { background: var(--sleep); }
:root[data-theme="candy"] .tile.recovery .icon, :root:not([data-theme]) .tile.recovery .icon { background: var(--recovery); }
:root[data-theme="candy"] .tile.vitals .icon, :root:not([data-theme]) .tile.vitals .icon { background: var(--vitals); }
:root[data-theme="candy"] .tile.activity .v { color: var(--activity-ink); } :root[data-theme="candy"] .tile.sleep .v { color: var(--sleep-ink); }
:root[data-theme="candy"] .tile.recovery .v { color: var(--recovery-ink); } :root[data-theme="candy"] .tile.vitals .v { color: var(--vitals-ink); }
:root[data-theme="neon"] .tile.activity { box-shadow: 0 8px 22px rgba(6, 182, 212, .32); }
:root[data-theme="neon"] .tile.sleep { box-shadow: 0 8px 22px rgba(168, 85, 247, .34); }
:root[data-theme="neon"] .tile.recovery { box-shadow: 0 8px 22px rgba(244, 63, 94, .28); }
:root[data-theme="neon"] .tile.vitals { box-shadow: 0 8px 22px rgba(14, 165, 233, .3); }

/* 今天页卡片组:横向分页 */
.pager { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 16px; gap: 12px; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 14px; }
.pager::-webkit-scrollbar { display: none; }
.page { flex: 0 0 100%; scroll-snap-align: start; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.page .tile.wide { grid-column: 1 / -1; }
.dots { display: flex; justify-content: center; gap: 6px; margin: -4px 0 4px; }
.dots i { width: 7px; height: 7px; border-radius: 4px; background: var(--line); } .dots i.on { background: var(--accg); width: 20px; }
.hero-ring { grid-row: span 3; display: grid; place-items: center; padding: 10px; }

/* 环 */
.ring { position: relative; width: 148px; height: 148px; }
.ring svg { transform: rotate(-90deg); }
.ring .c { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .c b { font-size: 30px; font-weight: 900; }
.ring .c span { font-size: 12px; color: var(--fg2); }

/* 按钮 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 22px; border-radius: 999px; background: var(--accg); color: var(--on-acc); font-weight: 800; font-size: 16px; box-shadow: 0 8px 18px color-mix(in srgb, var(--acc2) 32%, transparent); }
.btn.ghost { background: var(--card); color: var(--fg); box-shadow: var(--shadow-s); }
:root[data-theme="neon"] .btn.ghost { background: var(--card2); }
.btn.sm { padding: 8px 14px; font-size: 14px; }
.btn:disabled { opacity: .6; }
.actions { display: flex; gap: 10px; margin: 14px 0 6px; } .actions .btn { flex: 1; }
.fab { position: fixed; right: 18px; bottom: calc(84px + var(--safe-b)); z-index: 6; width: 56px; height: 56px; border-radius: 18px; background: var(--accg); color: var(--on-acc); display: grid; place-items: center; font-size: 22px; box-shadow: 0 8px 22px color-mix(in srgb, var(--acc2) 45%, transparent); }
.fab.wide { width: auto; padding: 0 18px; font-weight: 800; font-size: 15px; gap: 8px; border-radius: 999px; }

/* 教练卡(时间线) */
.feed-item { background: var(--card); border-radius: var(--radius); padding: 16px; margin-top: 12px; box-shadow: var(--shadow); }
.feed-item .meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--fg2); margin-bottom: 8px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.chip.sleep { background: var(--sleep-tint); color: var(--sleep-ink); } .chip.activity { background: var(--activity-tint); color: var(--activity-ink); }
.chip.recovery { background: var(--recovery-tint); color: var(--recovery-ink); } .chip.vitals { background: var(--vitals-tint); color: var(--vitals-ink); }
.chip.alert { background: var(--bad); color: #fff; } .chip.report { background: color-mix(in srgb, var(--acc1) 22%, transparent); color: var(--acc-ink); }
.feed-item h3 { margin: 0 0 6px; font-size: 20px; line-height: 1.3; }
.feed-item p { margin: 0; color: var(--fg2); white-space: pre-wrap; }
.votes { display: flex; gap: 18px; margin-top: 12px; color: var(--fg3); font-size: 18px; } .votes button { filter: grayscale(1); opacity: .55; } .votes .on { filter: none; opacity: 1; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--fg2); font-size: 14px; margin: 18px 0 2px; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 2px dashed var(--line); }

/* 详情页 */
.seg { display: flex; gap: 6px; margin: 10px 0 12px; }
.seg button { flex: 1; padding: 10px 0; border-radius: 999px; background: var(--card); color: var(--fg2); font-size: 15px; box-shadow: var(--shadow-s); }
:root[data-theme="neon"] .seg button { background: var(--card2); }
.seg button.on { background: var(--accg); color: var(--on-acc); font-weight: 800; }
.datenav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.datenav .lbl { font-size: 24px; font-weight: 800; }
.datenav .nav button { width: 40px; height: 40px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow-s); margin-left: 8px; font-size: 18px; }
:root[data-theme="neon"] .datenav .nav button { background: var(--card2); }
.datenav .nav button:disabled { opacity: .35; }
.headline { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 0 4px; }
.headline .big { font-size: 44px; font-weight: 900; line-height: 1; }
.headline .big small { font-size: 18px; font-weight: 600; margin-left: 6px; color: var(--fg); }
.headline .sub { color: var(--fg2); margin-top: 6px; }
.chart-box { position: relative; height: 230px; margin: 8px 0 6px; }

/* 好坏胶囊:实心,两套配色一致 */
.status, .st { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 800; white-space: nowrap; }
.status.in_range, .status.good, .st.good { background: var(--good); color: #fff; }
.status.above, .status.below, .status.warn, .st.warn { background: var(--warn); color: #3b2300; }
.status.bad, .st.bad { background: var(--bad); color: #fff; }
.status.calibrating, .status.none, .st.none { background: var(--card2); color: var(--fg2); }

/* 睡眠分期三行 */
.stage-rows { margin-top: 6px; }
.stage-row { margin: 10px 0 14px; }
.stage-row .lbl { font-size: 15px; margin-bottom: 6px; }
.stage-row .track { position: relative; height: 26px; border-radius: 13px; background: var(--card2); overflow: hidden; }
.stage-row .track i { position: absolute; top: 0; bottom: 0; border-radius: 13px; }
.stage-row.rem .track i { background: var(--rem); } .stage-row.light .track i { background: var(--light); } .stage-row.deep .track i { background: var(--deep); }
:root[data-theme="neon"] .stage-row.deep .track i { box-shadow: 0 0 8px var(--deep); }
.axis { display: flex; justify-content: space-between; color: var(--fg2); font-size: 13px; margin-top: 4px; }
.axis b { display: block; color: var(--fg); font-size: 15px; }

/* 质量滑条 */
.qrow { margin: 14px 0; }
.qrow .top { display: flex; align-items: center; justify-content: space-between; font-size: 16px; margin-bottom: 8px; gap: 8px; }
.qrow .bar { position: relative; height: 22px; border-radius: 11px; background: var(--card2); }
.qrow .bar .rng { position: absolute; top: 0; bottom: 0; border-radius: 11px; border: 1.5px dashed var(--rng-line); }
.qrow .bar .fill { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 11px; }
.qrow .bar .dot { position: absolute; top: -3px; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: 0 1px 5px rgba(0, 0, 0, .3); transform: translateX(-50%); }
.qrow.good .fill { background: var(--good); } .qrow.warn .fill { background: var(--warn); } .qrow.none .fill { background: var(--line); }

/* 7 天点图 */
.dots7 { display: flex; justify-content: space-between; align-items: flex-end; height: 70px; margin: 6px 0; }
.dots7 .col { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--fg2); flex: 1; }
.dots7 .col i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.dots7 .col.on i { background: var(--warn); } .dots7 .col.today span { background: var(--card2); border-radius: 999px; padding: 2px 8px; color: var(--fg); }

/* 列表 */
.list .row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--line); }
.list .row:last-child { border-bottom: 0; }
.list .row .l { display: flex; align-items: center; gap: 12px; }
.list .row .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--acc1) 20%, var(--card)); font-size: 18px; }

/* 底栏:当前频道亮主题色 */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--tab-bg); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); z-index: 7; }
.tabbar .in { max-width: 480px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); }
.tabbar button { padding: 10px 0 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--fg3); font-size: 12px; }
.tabbar button .ic { width: 52px; height: 30px; border-radius: 15px; display: grid; place-items: center; font-size: 18px; }
.tabbar button.on { color: var(--acc-ink); font-weight: 800; }
.tabbar button.on .ic { background: color-mix(in srgb, var(--acc1) 26%, var(--tab-bg)); }
:root[data-theme="neon"] .tabbar button.on { color: #fff; }
:root[data-theme="neon"] .tabbar button.on .ic { background: var(--accg); }

/* 底部弹层 */
.sheet-bg { position: fixed; inset: 0; background: rgba(15, 10, 30, .55); z-index: 20; display: flex; align-items: flex-end; }
.sheet { width: 100%; max-width: 520px; margin: 0 auto; background: var(--card); color: var(--fg); border-radius: 24px 24px 0 0; max-height: 86vh; display: flex; flex-direction: column; }
.sheet .hd { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.sheet .body { padding: 12px 18px; overflow: auto; flex: 1; }
.sheet .ft { padding: 10px 14px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); display: flex; gap: 8px; }
.sheet .ft input { flex: 1; background: var(--card2); border: 0; border-radius: 999px; padding: 12px 16px; color: var(--fg); font-size: 16px; outline: none; }
.sheet .card { box-shadow: none; background: var(--card2); }
.msg { margin: 8px 0; padding: 10px 14px; border-radius: 18px; max-width: 88%; white-space: pre-wrap; }
.msg.me { background: var(--accg); color: var(--on-acc); margin-left: auto; } .msg.ai { background: var(--card); box-shadow: var(--shadow-s); }
:root[data-theme="neon"] .msg.ai { background: var(--card2); }
.quick { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.quick button { flex: none; padding: 8px 12px; border-radius: 999px; background: var(--card); color: var(--acc-ink); font-weight: 600; font-size: 13px; box-shadow: var(--shadow-s); }
:root[data-theme="neon"] .quick button { background: var(--card2); }
.disclaimer { font-size: 12px; color: var(--fg3); margin-top: 10px; }
.empty { text-align: center; color: var(--fg2); padding: 36px 16px; }
.skeleton { background: linear-gradient(90deg, var(--card) 25%, var(--card2) 50%, var(--card) 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--radius); height: 86px; }
@keyframes sk { to { background-position: -200% 0; } }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(96px + var(--safe-b)); background: var(--toast-bg); color: var(--toast-fg); padding: 10px 16px; border-radius: 999px; z-index: 30; font-size: 14px; box-shadow: 0 4px 16px rgba(0, 0, 0, .3); white-space: nowrap; }

/* 6 频道底栏 */
.tabbar .in.six { grid-template-columns: repeat(6, 1fr); }
.tabbar .in.six button { font-size: 11px; padding: 8px 0 6px; }
.tabbar .in.six button .ic { width: 44px; height: 28px; font-size: 17px; }

/* 记录页子频道胶囊 */
.subtabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 5px; margin: 6px 0 14px; position: sticky; top: calc(8px + var(--safe-t)); z-index: 4; background: var(--card); border-radius: 999px; box-shadow: var(--shadow); }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs button { flex: none; padding: 8px 14px; border-radius: 999px; color: var(--fg2); font-size: 14px; }
.subtabs button.on { background: var(--accg); color: var(--on-acc); font-weight: 800; }

/* 吃药打卡 */
.dose-row { padding: 12px 0; border-top: 1px solid var(--line); }
.card > .dose-row:first-of-type { border-top: 0; }
.dose-row .hd { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.slots { display: flex; gap: 8px; }
.slot { flex: 1; min-width: 56px; padding: 10px 6px; border-radius: 14px; background: var(--card2); color: var(--fg2); font-size: 13px; font-weight: 700; display: flex; flex-direction: column; align-items: center; gap: 2px; transition: transform .08s; }
.slot:active { transform: scale(.96); }
.slot .ic { font-size: 18px; line-height: 1.1; }
.slot.on { background: var(--accg); color: var(--on-acc); box-shadow: 0 6px 14px color-mix(in srgb, var(--acc2) 30%, transparent); }
.slot.wide { flex: none; min-width: 112px; padding: 12px 10px; }

/* 录入步进器与文本框 */
.stepper { margin: 10px 0 18px; }
.stepper .ctl { display: flex; align-items: center; justify-content: center; gap: 18px; }
.stepper .ctl button { width: 64px; height: 64px; border-radius: 50%; background: var(--card2); font-size: 32px; font-weight: 300; line-height: 1; }
.stepper .ctl button:active { background: var(--line); }
.stepper .ctl .val { font-size: 48px; font-weight: 900; min-width: 120px; text-align: center; color: var(--acc-ink); }
.sheet textarea { width: 100%; min-height: 150px; background: var(--card2); border: 0; border-radius: 16px; padding: 14px; color: var(--fg); font: inherit; font-size: 16px; outline: none; resize: vertical; }
.sheet .list .row { width: 100%; text-align: left; }

/* 指标格与徽章 */
.mgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mcell { background: var(--card); border-radius: var(--radius-s); padding: 12px; text-align: left; min-width: 0; box-shadow: var(--shadow-s); }
:root[data-theme="neon"] .mcell { background: var(--card); }
.mcell .t { font-size: 12px; color: var(--fg2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mcell .v { font-size: 22px; font-weight: 800; color: var(--acc-ink); line-height: 1.2; }
.mcell.bad .v { color: var(--bad-ink); }
.mcell .v small { font-size: 11px; color: var(--fg3); margin-left: 3px; font-weight: 500; }
.mcell .d { font-size: 11px; color: var(--fg3); }
.bad-text { color: var(--bad-ink); } .good-text { color: var(--good-ink); } .warn-text { color: var(--warn-ink); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--card2); color: var(--fg2); white-space: nowrap; }
.badge.good { background: var(--good); color: #fff; } .badge.warn { background: var(--warn); color: #3b2300; }
.badge.bad { background: var(--bad); color: #fff; } .badge.info { background: var(--accg); color: var(--on-acc); }
.list button.row { width: 100%; text-align: left; }
.card.alert-box { border: 1.5px solid color-mix(in srgb, var(--bad) 55%, transparent); }
.card.ask-box { border: 1.5px solid color-mix(in srgb, var(--warn) 60%, transparent); }

/* 报告正文(极简 markdown) */
.md { font-size: 15px; line-height: 1.65; color: var(--fg2); overflow-wrap: anywhere; }
.md h1 { font-size: 20px; color: var(--fg); margin: 4px 0 10px; } .md h2 { font-size: 17px; color: var(--fg); margin: 18px 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.md h3 { font-size: 15px; color: var(--acc-ink); margin: 14px 0 6px; }
.md p { margin: 8px 0; } .md li { margin: 4px 0 4px 18px; list-style: disc; } .md li.n { list-style: decimal; }
.md blockquote { color: var(--fg3); border-left: 2px solid var(--line); padding-left: 10px; margin: 6px 0; font-size: 13px; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.md code { background: var(--card2); padding: 1px 6px; border-radius: 6px; font-size: 13px; color: var(--acc-ink); } .md strong { color: var(--fg); }
.md table { border-collapse: collapse; width: 100%; margin: 8px 0; font-size: 13px; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--line); padding: 4px 8px; text-align: left; white-space: nowrap; } .md th { color: var(--fg); background: var(--card2); }

/* 对话页 */
.chat { padding-bottom: 140px; }
.chat-list { display: flex; flex-direction: column; }
.chat-list .msg { max-width: 90%; }
.chat-list .msg.ai.md { font-size: 15px; color: var(--fg); } .chat-list .msg.ai.md p:first-child { margin-top: 0; } .chat-list .msg.ai.md p:last-child { margin-bottom: 0; }
.msg.sys { align-self: center; background: transparent; color: var(--fg2); font-size: 13px; text-align: center; border: 1px dashed var(--line); box-shadow: none; }
.chatbar { position: fixed; left: 0; right: 0; bottom: calc(68px + var(--safe-b)); background: linear-gradient(transparent, var(--bg) 18%); padding: 14px 16px 8px; z-index: 6; }
.chatbar .in { max-width: 480px; margin: 0 auto; }
.chatbar .row { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.chatbar input { flex: 1; min-width: 0; background: var(--card); border: 0; border-radius: 999px; padding: 12px 16px; color: var(--fg); font-size: 16px; outline: none; box-shadow: var(--shadow-s); }
:root[data-theme="neon"] .chatbar input { background: var(--card2); }
.chatbar .att { width: 44px; height: 44px; border-radius: 50%; background: var(--card); font-size: 20px; flex: none; box-shadow: var(--shadow-s); }
:root[data-theme="neon"] .chatbar .att { background: var(--card2); }
.chatbar .att:disabled { opacity: .5; }

/* 心率区间 */
.zones { margin-top: 6px; }
.zlegend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--fg2); margin: 4px 0 10px; }
.zlegend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.zrow { margin: 12px 0; }
.zrow .top { display: flex; justify-content: space-between; font-size: 15px; margin-bottom: 6px; }
.zrow .track { height: 18px; border-radius: 9px; background: var(--card2); overflow: hidden; }
.zrow .track i { display: block; height: 100%; border-radius: 9px; min-width: 0; }

/* 教练点评卡:边框色 = 好坏(绿 / 琥珀),中性时糖果用频道色、霓虹用彩虹边 */
.coach-card { background: var(--card); border-radius: var(--radius); padding: 16px 16px 12px; margin-top: 12px; box-shadow: var(--shadow); --tone: var(--acc2); }
.coach-card.tone-good { --tone: var(--good); } .coach-card.tone-warn { --tone: var(--warn); }
:root[data-theme="candy"] .coach-card, :root:not([data-theme]) .coach-card { border-top: 5px solid var(--tone); }
:root[data-theme="neon"] .coach-card { border: 1.5px solid var(--tone); }
:root[data-theme="neon"] .coach-card.tone-neutral { border-color: transparent; background-image: linear-gradient(var(--card), var(--card)), linear-gradient(135deg, #22d3ee, #a855f7, #ec4899); background-origin: border-box; background-clip: padding-box, border-box; }
.coach-card .meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--fg2); margin-bottom: 8px; }
.coach-card .spark { color: var(--acc-ink); }
.coach-card h3 { margin: 0 0 8px; font-size: 21px; line-height: 1.3; font-weight: 900; }
.coach-card p { margin: 0 0 8px; color: var(--fg); line-height: 1.6; font-size: 16px; }
.coach-card p.q { color: var(--fg); font-weight: 700; margin-top: 4px; }
.coach-card .replies { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; }
.coach-card .replies button { border-radius: 999px; padding: 8px 14px; font-size: 15px; font-weight: 600; color: var(--acc-ink); background: color-mix(in srgb, var(--acc1) 18%, var(--card)); }
:root[data-theme="neon"] .coach-card .replies button { background: var(--card2); color: #fff; border: 1px solid var(--line); }
.coach-card .replies button:active { transform: scale(.97); }
.coach-card .foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.coach-card .foot .votes { margin: 0 0 0 auto; }
.coach-card.loading { --tone: var(--line); }
:root[data-theme="neon"] .coach-card.loading { border-color: var(--line); background-image: none; }
svg.band7 { width: 100%; height: 76px; margin: 6px 0 4px; display: block; }
svg.band7 text { fill: var(--fg3); font-size: 8px; } svg.band7 text.today { fill: var(--fg); font-weight: 700; }

/* ---- 2026-10-07 睡眠得分「哪些因素会影响你的得分?」两张卡(照 Google) ---- */
.card.factor { display: flex; align-items: center; gap: 12px; }
.card.factor .fi { font-size: 26px; line-height: 1; }

/* ---- 2026-10-07 专属链接「点这里进入」(挡微信链接扫描器) ---- */
.gate { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 24px; }
.gate-card { width: 100%; max-width: 360px; text-align: center; background: var(--card); border-radius: 24px; padding: 32px 24px; box-shadow: 0 10px 40px rgba(0,0,0,.12); }
.gate-icon { font-size: 48px; }
.gate-card h1 { font-size: 24px; margin: 12px 0 8px; color: var(--fg); }
.gate-card p { color: var(--fg2); margin: 0 0 24px; line-height: 1.6; }
.gate-card button { width: 100%; padding: 16px; border-radius: 999px; border: 0; font-size: 18px; font-weight: 700; color: #fff; background: var(--primary); }
