/* ============================================================
   大明家康记 · 样式
   ============================================================ */
:root {
  --bg: #F2F5F9;
  --card: #FFFFFF;
  --text: #1B2430;
  --text2: #5A6678;
  --muted: #98A2B3;
  --line: #EDF0F5;
  --primary: #2196F3;
  --primary-d: #1976D2;
  --teal: #2AA9A0;
  --teal-l: #4ECDC4;
  --green: #16A34A;
  --orange: #E8910B;
  --red: #E5484D;
  --purple: #8B5CF6;
  --grad: linear-gradient(105deg, #3DBDB5 0%, #33A8DC 52%, #2E8FF0 100%);
  --shadow: 0 2px 12px rgba(24, 45, 77, .07);
  --shadow-l: 0 6px 24px rgba(24, 45, 77, .12);
  --r: 14px;
  --nav-h: 58px;
}

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

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
body { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); }

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { border: none; background: none; cursor: pointer; }
a { color: var(--primary); text-decoration: none; }

/* ---------- 顶部渐变头 ---------- */
.appbar {
  background: var(--grad);
  color: #fff;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 14px;
  position: sticky; top: 0; z-index: 40;
}
.appbar-row { display: flex; align-items: center; gap: 11px; }
.avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(255,255,255,.24);
  border: 1.5px solid rgba(255,255,255,.6);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 700; color: #fff; flex: 0 0 auto;
}
.appbar-main { flex: 1 1 auto; min-width: 0; }
.appbar-name { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 5px; }
.appbar-name .chev { font-size: 11px; opacity: .85; }
.appbar-meta { font-size: 12px; opacity: .9; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 19px; position: relative; flex: 0 0 auto;
  background: rgba(255,255,255,.14);
}
.icon-btn .dot {
  position: absolute; top: 7px; right: 7px; width: 8px; height: 8px;
  background: #FFD54F; border-radius: 50%; border: 1.5px solid #2E8FF0;
}

/* ---------- 页签容器 ---------- */
.tab-page { display: none; padding: 12px 12px 18px; animation: fade .18s ease; }
.tab-page.active { display: block; }
@keyframes fade { from { opacity: .3; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 14px; margin-bottom: 12px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-title { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.card-title .em { font-size: 16px; }
.card-more { font-size: 13px; color: var(--primary); }
.sect-label { font-size: 13.5px; font-weight: 600; color: var(--text2); margin: 16px 4px 8px; display: flex; align-items: center; gap: 6px; }

/* ---------- 首页 · 健康评分 ---------- */
.score-wrap { display: flex; align-items: center; gap: 16px; }
.score-ring { position: relative; width: 96px; height: 96px; flex: 0 0 auto; }
.score-ring svg { transform: rotate(-90deg); display: block; }
.score-ring .num {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.score-ring .num b { font-size: 27px; font-weight: 700; line-height: 1; }
.score-ring .num span { font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.score-info { flex: 1 1 auto; min-width: 0; }
.score-info h3 { margin: 0 0 6px; font-size: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 11.5px; padding: 3px 9px; border-radius: 20px;
  background: #F1F3F6; color: var(--text2); display: inline-flex; align-items: center; gap: 4px;
}
.chip.good { background: #E8F7EE; color: #16A34A; }
.chip.warn { background: #FEF3E2; color: #E8910B; }
.chip.bad { background: #FDECEC; color: #E5484D; }

/* ---------- 首页 · 三格指标 ---------- */
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.metric {
  background: var(--card); border-radius: var(--r); box-shadow: var(--shadow);
  padding: 13px 10px; text-align: center; position: relative; overflow: hidden;
}
.metric .ic { font-size: 19px; line-height: 1; }
.metric .lbl { font-size: 11.5px; color: var(--muted); margin: 5px 0 3px; }
.metric .val { font-size: 19px; font-weight: 700; letter-spacing: -.3px; }
.metric .val small { font-size: 11px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.metric .st { font-size: 11px; margin-top: 4px; font-weight: 600; }
.metric .empty { font-size: 13px; color: var(--muted); font-weight: 500; }

/* ---------- 待办 ---------- */
.todo {
  display: flex; align-items: center; gap: 11px; padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.todo:last-child { border-bottom: none; padding-bottom: 2px; }
.todo:first-child { padding-top: 2px; }
.todo-check {
  width: 22px; height: 22px; border-radius: 50%; border: 1.8px solid #CBD3DF;
  flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; transition: .15s;
}
.todo-check.done { background: var(--green); border-color: var(--green); }
.todo-body { flex: 1 1 auto; min-width: 0; }
.todo-title { font-size: 14.5px; font-weight: 500; }
.todo-title.done { color: var(--muted); text-decoration: line-through; }
.todo-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.todo-time { font-size: 12.5px; color: var(--text2); font-weight: 600; flex: 0 0 auto; }
.todo-btn {
  font-size: 12px; padding: 5px 11px; border-radius: 20px;
  background: #EAF4FF; color: var(--primary); font-weight: 600; flex: 0 0 auto;
}
.todo-btn.gray { background: #F1F3F6; color: var(--text2); }

/* ---------- 成员列表 ---------- */
.member-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.member-row:last-child { border-bottom: none; }
.member-row:first-child { padding-top: 2px; }
.member-av {
  width: 42px; height: 42px; border-radius: 50%; color: #fff; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700;
}
.member-body { flex: 1 1 auto; min-width: 0; }
.member-name { font-size: 15px; font-weight: 600; }
.member-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.member-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 5px; background: #FEF3E2; color: #D9820A; }
.tag.blue { background: #EAF4FF; color: #1E7FD6; }
.tag.green { background: #E8F7EE; color: #16A34A; }
.row-arrow { color: #C6CEDB; font-size: 17px; flex: 0 0 auto; }
.cur-badge { font-size: 10.5px; padding: 1px 7px; border-radius: 10px; background: #EAF4FF; color: var(--primary); margin-left: 6px; font-weight: 600; }

/* ---------- 数据页 ---------- */
.seg {
  display: flex; background: #E9EDF3; border-radius: 11px; padding: 3px; margin-bottom: 12px;
}
.seg button {
  flex: 1; padding: 8px 0; border-radius: 9px; font-size: 13.5px; font-weight: 600;
  color: var(--text2); transition: .18s;
}
.seg button.on { background: #fff; color: var(--primary); box-shadow: 0 1px 5px rgba(24,45,77,.1); }

.ranges { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 10px; -webkit-overflow-scrolling: touch; }
.ranges::-webkit-scrollbar { display: none; }
.range-btn {
  flex: 0 0 auto; padding: 6px 13px; border-radius: 18px; font-size: 12.5px;
  background: #fff; color: var(--text2); border: 1px solid #E3E8F0; font-weight: 500;
}
.range-btn.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }

.chart-box { width: 100%; height: 190px; position: relative; }
.chart-box canvas { width: 100%; height: 100%; display: block; }
.chart-empty { display: flex; align-items: center; justify-content: center; height: 190px; color: var(--muted); font-size: 13.5px; flex-direction: column; gap: 8px; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.stat-cell { text-align: center; padding: 9px 4px; background: #F7F9FC; border-radius: 10px; }
.stat-cell .k { font-size: 11px; color: var(--muted); }
.stat-cell .v { font-size: 15.5px; font-weight: 700; margin-top: 3px; }
.stat-cell .v small { font-size: 10.5px; font-weight: 500; color: var(--muted); }

.rec-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.rec-row:last-child { border-bottom: none; }
.rec-main { flex: 1 1 auto; min-width: 0; }
.rec-val { font-size: 15.5px; font-weight: 700; }
.rec-val small { font-size: 11px; color: var(--muted); font-weight: 500; margin-left: 3px; }
.rec-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.rec-right { text-align: right; flex: 0 0 auto; }
.rec-date { font-size: 12px; color: var(--muted); }
.rec-tag { font-size: 11px; padding: 1.5px 8px; border-radius: 10px; margin-top: 3px; display: inline-block; font-weight: 600; }

/* ---------- 提醒 ---------- */
.adh-wrap { display: flex; align-items: center; gap: 14px; }
.adh-ring { width: 76px; height: 76px; position: relative; flex: 0 0 auto; }
.adh-ring svg { transform: rotate(-90deg); }
.adh-ring .num {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.adh-ring .num b { font-size: 19px; font-weight: 700; line-height: 1; }
.adh-ring .num span { font-size: 9.5px; color: var(--muted); margin-top: 2px; }
.adh-info h3 { margin: 0 0 4px; font-size: 15px; }
.adh-info p { margin: 0; font-size: 12.5px; color: var(--text2); }

.rm-row { display: flex; align-items: center; gap: 11px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rm-row:last-child { border-bottom: none; }
.rm-icon {
  width: 38px; height: 38px; border-radius: 11px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
  background: #EAF4FF;
}
.rm-icon.med { background: #FEF3E2; }
.rm-body { flex: 1 1 auto; min-width: 0; }
.rm-title { font-size: 14.5px; font-weight: 600; }
.rm-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.rm-time { font-size: 13px; font-weight: 700; color: var(--primary); flex: 0 0 auto; }
.rm-time.off { color: var(--muted); font-weight: 500; }

.switch { width: 44px; height: 25px; border-radius: 13px; background: #D7DEE8; position: relative; transition: .18s; flex: 0 0 auto; }
.switch.on { background: var(--green); }
.switch::after { content: ''; position: absolute; top: 2.5px; left: 2.5px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: .18s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch.on::after { left: 21.5px; }

/* ---------- 报告页 ---------- */
.rpt-type { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.rpt-opt {
  padding: 12px 10px; border-radius: 12px; border: 1.5px solid #E3E8F0; background: #fff;
  font-size: 13.5px; font-weight: 600; color: var(--text2); text-align: center; transition: .15s;
}
.rpt-opt.on { border-color: var(--primary); color: var(--primary); background: #F2F9FF; }
.rpt-opt.full { grid-column: 1 / -1; }
.rpt-opt .n { font-weight: 400; color: var(--muted); font-size: 12.5px; }

.btn-primary {
  width: 100%; padding: 14px; border-radius: 12px; background: var(--grad);
  color: #fff; font-size: 15.5px; font-weight: 600; box-shadow: 0 6px 16px rgba(46,143,240,.3);
}
.btn-primary:active { transform: scale(.99); }
.btn-plain { width: 100%; padding: 13px; border-radius: 12px; background: #fff; border: 1.5px solid #E3E8F0; font-size: 15px; font-weight: 600; color: var(--text); }
.btn-danger { width: 100%; padding: 13px; border-radius: 12px; background: #FDECEC; color: var(--red); font-size: 15px; font-weight: 600; }
.btn-sm { padding: 8px 14px; border-radius: 10px; background: var(--primary); color: #fff; font-size: 13px; font-weight: 600; }

.hint { font-size: 12px; color: var(--muted); text-align: center; margin-top: 10px; line-height: 1.6; }
.data-count { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
.data-count .k { font-size: 12px; color: var(--muted); }
.data-count .v { font-size: 22px; font-weight: 700; color: var(--primary); }

/* ---------- 我的 ---------- */
.li-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.li-row:last-child { border-bottom: none; }
.li-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 17px; flex: 0 0 auto; }
.li-body { flex: 1 1 auto; min-width: 0; }
.li-title { font-size: 14.5px; font-weight: 600; }
.li-title.danger { color: var(--red); }
.li-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.about-text { font-size: 13px; color: var(--text2); line-height: 1.75; margin: 0 0 10px; }
.about-text b { color: var(--text); }
.ver-badge { display: inline-block; font-size: 11.5px; padding: 2px 9px; border-radius: 10px; background: #EAF4FF; color: var(--primary); font-weight: 600; vertical-align: 2px; margin-left: 6px; }

/* 检查新版本（v1.05） */
.up-badge { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 9px; background: #FDECEC; color: var(--red); font-weight: 700; margin-left: 6px; vertical-align: 1px; }
.li-row.has-new .li-title { color: var(--red); }
.up-lead { margin: 0 0 10px; color: var(--text2); font-size: 13.5px; line-height: 1.7; }
.up-lead b { color: var(--text); }
.up-notes { margin: 0 0 4px; padding-left: 18px; }
.up-notes li { font-size: 13px; color: var(--text2); line-height: 1.65; margin-bottom: 5px; }

/* ---------- 底部导航 ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: #fff; display: flex; align-items: center;
  box-shadow: 0 -2px 16px rgba(24,45,77,.08);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: #9AA5B5; font-size: 10.5px; padding-top: 6px; transition: .15s;
}
.nav-item .ni { font-size: 20px; line-height: 1; }
.nav-item.on { color: var(--primary); font-weight: 600; }
.nav-spacer { width: 68px; flex: 0 0 auto; }
.fab {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--grad); color: #fff; font-size: 30px; font-weight: 300;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(46,143,240,.42);
  border: 4px solid #fff; line-height: 1;
}
.fab:active { transform: translateX(-50%) scale(.94); }

/* ---------- 弹层 ---------- */
.mask {
  position: fixed; inset: 0; background: rgba(16,26,42,.45); z-index: 100;
  display: none; align-items: flex-end; justify-content: center;
  backdrop-filter: blur(2px);
}
.mask.show { display: flex; }
.sheet {
  width: 100%; max-width: 560px; background: #fff;
  border-radius: 20px 20px 0 0; max-height: 88vh; overflow-y: auto;
  padding: 6px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  animation: slideUp .25s cubic-bezier(.2,.8,.3,1);
}
@keyframes slideUp { from { transform: translateY(60px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet-bar { width: 38px; height: 4px; border-radius: 2px; background: #E3E8F0; margin: 8px auto 6px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 12px; }
.sheet-head h2 { margin: 0; font-size: 17px; font-weight: 700; }
.sheet-head .x { font-size: 22px; color: var(--muted); line-height: 1; padding: 0 4px; }

.field { margin-bottom: 13px; }
.field > label { display: block; font-size: 13px; font-weight: 600; color: var(--text2); margin-bottom: 6px; }
.field input[type=text], .field input[type=number], .field input[type=date], .field input[type=time], .field select, .field textarea {
  width: 100%; padding: 11px 12px; border-radius: 11px; border: 1.5px solid #E3E8F0;
  background: #FAFBFD; outline: none; transition: .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); background: #fff; }
.field-row { display: flex; gap: 10px; }
.field-row > .field { flex: 1; margin-bottom: 13px; }
.unit-in { position: relative; }
.unit-in .u { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 12.5px; color: var(--muted); pointer-events: none; }
.unit-in input { padding-right: 46px; }

.pick-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pick {
  padding: 9px 15px; border-radius: 10px; border: 1.5px solid #E3E8F0; background: #fff;
  font-size: 13.5px; font-weight: 500; color: var(--text2);
}
.pick.on { border-color: var(--primary); background: #F2F9FF; color: var(--primary); font-weight: 600; }
.pick.big { flex: 1; text-align: center; padding: 13px 8px; }

.type-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 14px; }
.type-card {
  padding: 14px 6px; border-radius: 13px; border: 1.5px solid #E3E8F0; background: #fff;
  text-align: center; font-size: 13px; font-weight: 600; color: var(--text2);
}
.type-card .ti { font-size: 22px; display: block; margin-bottom: 4px; }
.type-card.on { border-color: var(--primary); background: #F2F9FF; color: var(--primary); }

.bmi-box {
  background: #F2F9FF; border-radius: 11px; padding: 11px 13px; margin-bottom: 13px;
  display: flex; align-items: center; justify-content: space-between; font-size: 13.5px;
}
.bmi-box b { font-size: 18px; color: var(--primary); }

.days-row { display: flex; gap: 6px; flex-wrap: wrap; }
.day-chip {
  width: 38px; height: 38px; border-radius: 10px; border: 1.5px solid #E3E8F0;
  display: flex; align-items: center; justify-content: center; font-size: 13px;
  color: var(--text2); font-weight: 500;
}
.day-chip.on { border-color: var(--primary); background: #F2F9FF; color: var(--primary); font-weight: 700; }

.mask-center { align-items: center; padding: 20px; }
.mask-center .sheet { border-radius: 18px; max-width: 380px; animation: popIn .2s ease; }
@keyframes popIn { from { transform: scale(.94); opacity: .5; } to { transform: none; opacity: 1; } }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 30px); transform: translateX(-50%) translateY(10px);
  background: rgba(22,32,48,.92); color: #fff; font-size: 13.5px; padding: 10px 18px;
  border-radius: 22px; z-index: 200; opacity: 0; pointer-events: none; transition: .25s;
  max-width: 80%; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.empty-state { text-align: center; padding: 34px 20px; color: var(--muted); }
.empty-state .e { font-size: 40px; margin-bottom: 10px; opacity: .55; }
.empty-state p { margin: 0 0 14px; font-size: 13.5px; }

@media (min-width: 620px) {
  body { max-width: 560px; margin: 0 auto; box-shadow: 0 0 40px rgba(24,45,77,.08); }
  .nav { max-width: 560px; left: 50%; transform: translateX(-50%); }
  .appbar { max-width: 560px; margin: 0 auto; }
}

/* ============================================================
   报告浮层
   ============================================================ */
.report-view { position: fixed; inset: 0; background: #fff; z-index: 300; display: none; flex-direction: column; }
.report-view.show { display: flex; }
.report-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px;
  background: #F7F9FC; border-bottom: 1px solid var(--line); flex: 0 0 auto; gap: 8px;
}
.report-bar .rb-back { font-size: 15px; color: var(--primary); font-weight: 600; padding: 6px 4px; }
.report-bar .rb-act { display: flex; gap: 8px; }
.report-bar .rb-act button {
  font-size: 13px; font-weight: 600; padding: 7px 13px; border-radius: 9px;
  background: var(--primary); color: #fff;
}
.report-bar .rb-act button.ghost { background: #fff; color: var(--primary); border: 1.5px solid #CFE4FB; }
.report-body { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0; }

.rpt { max-width: 760px; margin: 0 auto; padding: 22px 18px 60px; }
.rpt-head { display: flex; align-items: center; gap: 13px; border-bottom: 3px solid var(--primary); padding-bottom: 13px; margin-bottom: 14px; }
.rpt-logo {
  width: 44px; height: 44px; border-radius: 12px; flex: 0 0 auto;
  background: var(--grad); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.rpt h1 { font-size: 19px; margin: 0; }
.rpt-sub { font-size: 12.5px; color: var(--text2); margin-top: 3px; }
.rpt h2 { font-size: 15px; margin: 22px 0 10px; padding-left: 10px; border-left: 4px solid var(--primary); }
.rpt-meta { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.rpt-meta td { padding: 6px 8px; border: 1px solid #E3E8F0; }
.rpt-meta td:first-child { background: #F7F9FC; width: 106px; color: var(--text2); }
.rpt-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.rpt-table th { background: #F2F9FF; color: #1E6FD0; padding: 8px; border: 1px solid #DCE7F5; font-weight: 600; text-align: left; }
.rpt-table td { padding: 7px 8px; border: 1px solid #E7EDF5; }
.rpt p { font-size: 13px; line-height: 1.8; margin: 8px 0; }
.rpt-list { font-size: 13px; line-height: 1.9; padding-left: 20px; margin: 8px 0; }
.rpt-list li { margin-bottom: 6px; }
.rpt b.good { color: var(--green); }
.rpt b.warn { color: var(--orange); }
.rpt b.bad { color: var(--red); }
.rpt-bars { margin: 10px 0; }
.bar-row { display: flex; align-items: center; gap: 10px; font-size: 12px; margin-bottom: 6px; }
.bar-k { width: 88px; color: var(--text2); flex: 0 0 auto; }
.bar { flex: 1; height: 12px; background: #EEF2F7; border-radius: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--grad); }
.bar-v { width: 104px; text-align: right; color: var(--text2); flex: 0 0 auto; }
.rpt-note { font-size: 11.5px; color: var(--muted); }
.rpt-foot { margin-top: 24px; padding-top: 13px; border-top: 1px dashed #DCE3EC; font-size: 11.5px; color: #7A8699; }
.rpt-foot p { margin: 5px 0; font-size: 11.5px; }

@media print {
  body > *:not(.report-view) { display: none !important; }
  .report-view { position: static; display: block !important; }
  .report-bar { display: none !important; }
  .report-body { overflow: visible; }
  .rpt { max-width: none; padding: 0; }
  @page { margin: 14mm; }
}

/* 深色模式（跟随系统，保证可读） */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12171F; --card: #1B2230; --text: #E8EDF5; --text2: #A9B4C4;
    --muted: #7C8899; --line: #262F3E;
  }
  .seg { background: #202836; }
  .seg button.on { background: #2A3547; }
  .range-btn, .rpt-opt, .pick, .type-card, .day-chip, .btn-plain { background: #1B2230; border-color: #2C3748; color: var(--text2); }
  .stat-cell { background: #212A39; }
  .field input, .field select, .field textarea { background: #202836; border-color: #2C3748; }
  .bmi-box { background: #1E3044; }
  .todo-btn { background: #1E3044; color: #6CB6F7; }
  .todo-btn.gray { background: #262F3E; }
  .rm-icon { background: #1E3044; }
  .rm-icon.med { background: #3A2E1E; }
  .report-view, .sheet, .nav, .report-bar { background: var(--card); }
  .report-bar { background: #1B2230; }
  .bar { background: #2A3547; }
  .rpt-meta td:first-child, .rpt-table th { background: #202836; color: #7FB6F0; }
  .rpt-meta td, .rpt-table td, .rpt-table th { border-color: #2C3748; }
  .appbar { box-shadow: 0 2px 12px rgba(0,0,0,.3); }
  .up-badge { background: rgba(229,72,77,.18); }
}
