:root {
  --bg: #060a09;
  --surface: #0d1412;
  --surface-2: #121c19;
  --line: #1d2a26;
  --text: #e9f2ef;
  --muted: #89a29b;
  --accent: #34e0a0;
  --green: #34e0a0;
  --yellow: #f5c451;
  --red: #f2726f;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background:
    radial-gradient(1100px 500px at 15% -10%, rgba(52, 224, 160, 0.10), transparent 60%),
    radial-gradient(900px 400px at 95% 0%, rgba(88, 140, 255, 0.08), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Hiragino Sans GB", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.muted { color: var(--muted); }
.small { font-size: 13px; }
.count { font-size: 12px; color: var(--muted); font-weight: 400; }

/* ---------------------------------------------------------------- 顶栏 */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: rgba(6, 10, 9, 0.82);
  border-bottom: 1px solid var(--line);
  /* 添加到主屏幕后，避开 iPhone 刘海/状态栏 */
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

.topbar-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(160deg, rgba(52, 224, 160, 0.22), rgba(52, 224, 160, 0.05));
  border: 1px solid rgba(52, 224, 160, 0.35);
  color: var(--accent);
  flex: none;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-text strong { font-size: 16px; letter-spacing: 0.01em; white-space: nowrap; }
.brand-text small { color: var(--muted); font-size: 12px; }

.topbar-actions { display: flex; align-items: center; gap: 8px; flex: none; }

.badge {
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  white-space: nowrap;
}

.badge-muted { color: var(--muted); background: var(--surface); }
.badge-live { color: #06231a; background: var(--accent); border-color: transparent; font-weight: 600; }
.badge-demo { color: #2b2410; background: var(--yellow); border-color: transparent; font-weight: 600; }

.btn {
  font: inherit;
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.btn:hover { background: var(--surface-2); border-color: #2b3d37; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(180deg, #3ceaa9, #23c78a);
  border-color: transparent;
  color: #04231a;
  font-weight: 600;
}

.btn-primary:hover { background: linear-gradient(180deg, #4ff3b6, #2bd694); }

/* ---------------------------------------------------------------- 提示条 */

.banner {
  max-width: 1160px;
  margin: 14px auto 0;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(245, 196, 81, 0.3);
  background: rgba(245, 196, 81, 0.08);
  color: #f2dcae;
  font-size: 13.5px;
}

.banner-error {
  border-color: rgba(242, 114, 111, 0.38);
  background: rgba(242, 114, 111, 0.10);
  color: #ffd9d7;
}

.banner strong { color: inherit; }

.banner a,
.footer a,
.link-page a,
.setup a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(52, 224, 160, 0.4);
}

.banner a:hover,
.footer a:hover,
.link-page a:hover,
.setup a:hover { border-bottom-color: var(--accent); }

.banner code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 12.5px;
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
}

/* ---------------------------------------------------------------- 布局 */

.layout {
  max-width: 1160px;
  margin: 0 auto;
  padding: 18px 20px 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.card {
  background: linear-gradient(180deg, var(--surface), #0a100e);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 20px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.card-wide { grid-column: 1 / -1; }

.sync-line {
  grid-column: 1 / -1;
  text-align: right;
  font-size: 12px;
  color: var(--muted);
  margin: -6px 2px -8px;
}

.sync-line strong {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.card-hero,
#card-trend,
#card-workouts,
#card-glossary { grid-column: 1 / -1; }

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.card-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

/* ---------------------------------------------------------------- 恢复 */

.hero-body {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 26px;
  align-items: center;
}

.dial {
  --pct: 0;
  --zone-color: var(--accent);
  width: 168px;
  height: 168px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--zone-color) calc(var(--pct) * 1%), rgba(255, 255, 255, 0.07) 0);
  position: relative;
  transition: background 0.4s ease;
}

.dial::before {
  content: "";
  position: absolute;
  inset: 11px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 30%, #14201c, #0a1110 70%);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.dial-inner {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.dial-value { font-size: 46px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.dial-unit { font-size: 15px; color: var(--muted); }

.hero-copy { min-width: 0; }

.zone-pill {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 8px;
  background: rgba(52, 224, 160, 0.14);
  color: var(--green);
  border: 1px solid rgba(52, 224, 160, 0.3);
}

.zone-pill.is-yellow { background: rgba(245, 196, 81, 0.14); color: var(--yellow); border-color: rgba(245, 196, 81, 0.32); }
.zone-pill.is-red { background: rgba(242, 114, 111, 0.14); color: var(--red); border-color: rgba(242, 114, 111, 0.32); }
.zone-pill.is-muted { background: rgba(255, 255, 255, 0.05); color: var(--muted); border-color: var(--line); }

.advice { margin: 0 0 14px; color: #cfe0da; font-size: 14px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.stat-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.stat {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 9px 11px;
  min-width: 0;
}

.stat dt { font-size: 11.5px; color: var(--muted); margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat dd { margin: 0; font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat dd span { font-size: 11.5px; font-weight: 500; color: var(--muted); margin-left: 2px; }

/* ---------------------------------------------------------------- 睡眠 */

.sleep-summary {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.big-number { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }

.sleep-metrics { display: flex; gap: 18px; flex-wrap: wrap; }
.sleep-metrics .metric { display: flex; flex-direction: column; }
.sleep-metrics .metric b { font-size: 16px; font-variant-numeric: tabular-nums; }
.sleep-metrics .metric span { font-size: 11.5px; color: var(--muted); }

.stage-bar {
  display: flex;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-2);
  margin-bottom: 10px;
}

.stage-bar i { display: block; height: 100%; }

.stage-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}

.stage-legend li { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
.stage-legend .dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.stage-legend b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- 负荷 */

.strain-row { display: flex; align-items: center; gap: 18px; margin-bottom: 14px; flex-wrap: wrap; }

.strain-value {
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.strain-row .advice { margin: 0; flex: 1; min-width: 180px; }

/* ---------------------------------------------------------------- 趋势 */

.trend {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 168px;
  padding-top: 8px;
}

.trend-item { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }

.trend-bar {
  width: 100%;
  max-width: 46px;
  border-radius: 7px 7px 4px 4px;
  background: linear-gradient(180deg, rgba(52, 224, 160, 0.95), rgba(52, 224, 160, 0.35));
  min-height: 4px;
  position: relative;
  transition: height 0.35s ease;
}

.trend-bar.is-yellow { background: linear-gradient(180deg, rgba(245, 196, 81, 0.95), rgba(245, 196, 81, 0.3)); }
.trend-bar.is-red { background: linear-gradient(180deg, rgba(242, 114, 111, 0.95), rgba(242, 114, 111, 0.3)); }
.trend-bar.is-empty { background: rgba(255, 255, 255, 0.07); }

.trend-score { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.trend-label { font-size: 11px; color: var(--muted); white-space: nowrap; }
.trend-sub { font-size: 10.5px; color: #6f8781; white-space: nowrap; }

/* ---------------------------------------------------------------- 训练 */

.workout-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

.workout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(4, minmax(0, 0.8fr));
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.workout .sport { font-weight: 600; }
.workout .when { font-size: 12px; color: var(--muted); }

.workout .kv { display: flex; flex-direction: column; }
.workout .kv span { font-size: 11px; color: var(--muted); }
.workout .kv b { font-size: 14.5px; font-variant-numeric: tabular-nums; }

.empty {
  color: var(--muted);
  font-size: 13.5px;
  padding: 10px 2px;
}

/* ---------------------------------------------------------------- 词典 */

.search {
  font: inherit;
  font-size: 13px;
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  min-width: 220px;
}

.search::placeholder { color: #6f8781; }
.search:focus { outline: 2px solid rgba(52, 224, 160, 0.35); outline-offset: 1px; }

.glossary {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
}

.glossary li {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
}

.glossary .term { color: var(--accent); font-weight: 600; }
.glossary .term small { display: block; color: var(--muted); font-weight: 400; font-size: 11.5px; }
.glossary .desc { color: #c6d8d2; }

/* ---------------------------------------------------------------- 运动类型对照 */

.sports-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  cursor: pointer;
  list-style: none;
  margin-bottom: 6px;
}

.sports-details summary::-webkit-details-marker { display: none; }

.sports-details summary h2 { margin: 0; font-size: 15px; font-weight: 650; }

.toggle-hint {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 10px;
  flex: none;
}

.sports-details[open] .toggle-hint { color: var(--accent); border-color: rgba(52, 224, 160, 0.35); }

.sports-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0 20px;
  max-height: 420px;
  overflow-y: auto;
}

.sports-list li {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 7px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
  min-width: 0;
}

.sports-list .empty { grid-column: 1 / -1; border-top: 0; }

.sports-list .zh { color: var(--text); font-weight: 600; }

.sports-list .en {
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------------------------------------------------------------- 说明页 */

a.btn { display: inline-block; text-decoration: none; }

.doc {
  max-width: 860px;
  margin: 0 auto;
  padding: 26px 20px 64px;
}

.doc h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  margin: 34px 0 10px;
}

.doc .step {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border-radius: 8px;
  background: rgba(52, 224, 160, 0.13);
  border: 1px solid rgba(52, 224, 160, 0.3);
  color: var(--accent);
  font-size: 13px;
  flex: none;
}

.doc p, .doc li { color: #c6d8d2; font-size: 14px; }
.doc ul, .doc ol { padding-left: 22px; }
.doc li { margin: 5px 0; }

.doc a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(52, 224, 160, 0.3);
}

.doc a:hover { border-bottom-color: var(--accent); }

.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 13.5px;
}

.doc th,
.doc td {
  border-bottom: 1px solid var(--line);
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
  color: #c6d8d2;
}

.doc th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12.5px;
  background: rgba(255, 255, 255, 0.02);
}

.doc td strong { color: var(--text); }

.doc code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 12.5px;
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.07);
  color: #bfe9d8;
}

.doc pre {
  background: #0a1211;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 10px 0;
}

.doc pre code {
  background: none;
  padding: 0;
  color: #d6ece4;
  font-size: 13px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.callout {
  border-radius: 12px;
  padding: 14px 16px;
  margin: 18px 0;
  font-size: 13.5px;
  line-height: 1.8;
}

.callout-key {
  background: rgba(52, 224, 160, 0.07);
  border: 1px solid rgba(52, 224, 160, 0.28);
  color: #cdece0;
}

.callout-warn {
  background: rgba(245, 196, 81, 0.08);
  border: 1px solid rgba(245, 196, 81, 0.3);
  color: #f4e0b3;
}

.ok { color: #8fdcc0; font-size: 13.5px; }

/* ---------------------------------------------------------------- 弹窗 */

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(3, 6, 5, 0.72);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 20px;
}

/* 关键：display:grid 会盖掉 [hidden] 的默认 display:none，必须显式写回来 */
.modal[hidden] { display: none; }

.modal-card {
  width: 100%;
  max-width: 460px;
  background: linear-gradient(180deg, #101917, #0a100e);
  border: 1px solid #24352f;
  border-radius: 18px;
  padding: 22px 22px 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.modal-card h3 {
  margin: 0 0 12px;
  font-size: 17px;
  line-height: 1.5;
}

.modal-body {
  font-size: 13.5px;
  line-height: 1.8;
  color: #c6d8d2;
}

.modal-body p { margin: 0 0 10px; }
.modal-body p:last-child { margin-bottom: 0; }
.modal-body strong { color: var(--text); }
.modal-body code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12.5px;
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 5px;
  border-radius: 5px;
  color: #bfe9d8;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.modal-actions .btn { flex: 1; min-width: 120px; text-align: center; }

/* ---------------------------------------------------------------- 页脚 */

.footer {
  max-width: 1160px;
  margin: 0 auto;
  padding: 16px 20px calc(40px + env(safe-area-inset-bottom, 0px));
  color: var(--muted);
  font-size: 13px;
}

.footer p { margin: 6px 0; }
.footer strong { color: #ffd9d7; }

/* ---------------------------------------------------------------- 响应式 */

@media (max-width: 880px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .hero-body { grid-template-columns: minmax(0, 1fr); justify-items: start; gap: 18px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .glossary { grid-template-columns: minmax(0, 1fr); }
  .workout { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 10px; }
  .workout > div:first-child { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  body { font-size: 14px; }
  .topbar-inner { padding: 10px 14px; }
  .brand-text small { display: none; }
  .topbar-actions { width: 100%; gap: 6px; }
  .topbar-actions .badge { margin-right: auto; padding: 4px 9px; font-size: 11.5px; }
  .topbar-actions .btn { padding: 6px 9px; font-size: 12px; }
  .layout { padding: 14px 14px 4px; }
  .card { padding: 15px 14px 17px; }
  .trend { height: 140px; gap: 6px; }
  .trend-sub { display: none; }
  .glossary li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .topbar-actions .btn { padding: 6px 10px; }
  .dial { width: 140px; height: 140px; }
  .dial-value { font-size: 38px; }
}

/* ================================================================
   App 布局（对齐官方 App 的结构：顶栏 + 大环 + 指标卡 + 解读框 + 底部 tab）
   ================================================================ */

.app-body {
  background: #0b0e10;
  padding-bottom: 96px;
}

.appbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: calc(52px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 14px 0;
  background: rgba(11, 14, 16, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid #1a2023;
}

.appbar-btn {
  width: 34px;
  height: 34px;
  border: 0;
  background: none;
  color: #cfd8dc;
  font-size: 22px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.appbar-title {
  font-size: 12.5px;
  letter-spacing: 0.22em;
  color: #e9f2ef;
  text-transform: uppercase;
}

.screens {
  padding-top: calc(52px + env(safe-area-inset-top, 0px));
}

.screen {
  max-width: 520px;
  margin: 0 auto;
  padding: 18px 18px 30px;
}

/* ---------- 大环 ---------- */

.ring-wrap {
  position: relative;
  width: 258px;
  height: 258px;
  margin: 4px auto 0;
}

.ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-track {
  fill: none;
  stroke: #23282c;
  stroke-width: 9;
}

.ring-arc {
  fill: none;
  stroke: #2ee68a;
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 603.19;
  stroke-dashoffset: 603.19;
  transition: stroke-dashoffset 0.7s ease, stroke 0.3s ease;
}

.ring-blue { stroke: #2f9bff; }
.ring-purple { stroke: #a78bfa; }

.ring-tick {
  stroke: #dfe6e3;
  stroke-width: 3;
  opacity: 0.85;
}

.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.ring-brand {
  font-size: 10.5px;
  letter-spacing: 0.3em;
  color: #7f888d;
  margin-bottom: 2px;
}

.ring-value {
  font-size: 54px;
  font-weight: 700;
  line-height: 1.05;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.ring-label {
  font-size: 10.5px;
  letter-spacing: 0.22em;
  color: #7f888d;
  margin-top: 4px;
}

/* ---------- 指标卡 ---------- */

.sheet {
  position: relative;
  background: #14181a;
  border: 1px solid #20262a;
  border-radius: 18px;
  padding: 4px 16px 16px;
  margin-top: 16px;
}

.sheet::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 50%;
  width: 13px;
  height: 13px;
  background: #14181a;
  border-left: 1px solid #20262a;
  border-top: 1px solid #20262a;
  transform: translateX(-50%) rotate(45deg);
}

.sheet-plain { padding: 16px; }
.sheet-plain::before { display: none; }

.row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 0;
  border-bottom: 1px solid #1e2427;
}

.row:last-child { border-bottom: 0; }

.row-ico {
  width: 18px;
  text-align: center;
  font-size: 13px;
  color: #8b949a;
  flex: none;
}

.row-label {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  letter-spacing: 0.1em;
  color: #c9d1d5;
}

.row-value {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.row-unit {
  font-size: 10.5px;
  font-weight: 400;
  color: #8b949a;
  margin-left: 2px;
}

.row-trend {
  width: 12px;
  text-align: center;
  font-size: 9px;
  flex: none;
}

.row-trend.up { color: #2ee68a; }
.row-trend.down { color: #f0a44a; }
.row-trend.flat { color: #4d565b; }

/* ---------- 对比条 ---------- */

.cmp {
  margin-top: 12px;
  background: #0e1214;
  border: 1px solid #1c2225;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 11.5px;
  color: #8b949a;
  text-align: center;
  letter-spacing: 0.04em;
}

/* ---------- 解读框 ---------- */

.coach {
  margin-top: 14px;
  background: rgba(47, 155, 255, 0.08);
  border: 1px solid rgba(47, 155, 255, 0.45);
  border-radius: 16px;
  padding: 14px 15px;
}

.coach-text {
  margin: 0 0 9px;
  font-size: 13px;
  line-height: 1.75;
  color: #e3ecf1;
}

.coach-text strong { color: #ffffff; }

.coach-link {
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: #4aa8ff;
  text-decoration: none;
}

.coach-purple {
  background: rgba(167, 139, 250, 0.08);
  border-color: rgba(167, 139, 250, 0.45);
}

.coach-purple .coach-link { color: #b9a4ff; }

/* ---------- 睡眠阶段条 ---------- */

.stage-bar {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #12171a;
  margin: 14px 0 10px;
}

.stage-bar i { display: block; height: 100%; }

.stage-legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  padding: 0;
  margin: 0 0 4px;
}

.stage-legend li {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #8b949a;
}

.stage-legend .dot {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  flex: none;
}

.stage-legend b { color: #dfe6e3; font-weight: 600; }

/* ---------- 底部 tab ---------- */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  background: rgba(10, 13, 15, 0.94);
  backdrop-filter: blur(14px);
  border-top: 1px solid #1a2023;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.tab {
  flex: 1;
  position: relative;
  border: 0;
  background: none;
  padding: 14px 0 13px;
  font: inherit;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  color: #6f787d;
  cursor: pointer;
}

.tab.is-on { color: #ffffff; }

.tab.is-on::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #2ee68a;
}

/* ---------- 右上角状态浮标 ---------- */

.auth-fab {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  right: 10px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 6px;
}

.auth-fab .badge {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 999px;
}

.mini-btn {
  font: inherit;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #2a3236;
  background: #12181a;
  color: #cfd8dc;
  cursor: pointer;
}

.mini-primary {
  background: #2ee68a;
  border-color: transparent;
  color: #04231a;
  font-weight: 600;
}

/* ---------- 更多页 ---------- */

.more-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.more-title { font-size: 14px; font-weight: 650; color: #e9f2ef; }
.more-sub { font-size: 11.5px; color: #8b949a; }

.settings-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid #1e2427;
  font-size: 12.5px;
}

.settings-k { color: #8b949a; flex: none; }
.settings-v { color: #e9f2ef; text-align: right; }

.settings-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 14px;
}

.settings-links a {
  font-size: 12px;
  color: #2ee68a;
  text-decoration: none;
  border-bottom: 1px solid rgba(46, 230, 138, 0.35);
}

.foot-note {
  margin: 18px 0 0;
  font-size: 11px;
  line-height: 1.8;
  color: #6b7479;
  text-align: center;
}

.foot-note strong { color: #f3c2c0; }

/* ---------- 训练记录（新版结构） ---------- */

.workout-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.workout {
  display: block;
  padding: 12px 0;
  border-bottom: 1px solid #1e2427;
  background: none;
  border-radius: 0;
}

.workout:last-child { border-bottom: 0; }

.workout-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.workout-name { font-size: 14px; font-weight: 600; color: #e9f2ef; }
.workout-strain { font-size: 12px; color: #2ee68a; }

.workout-when {
  font-size: 11px;
  color: #7f888d;
  margin: 3px 0 6px;
}

.workout-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 11.5px;
  color: #b9c4c9;
}

/* ---------- 词典 / 运动表在窄屏下的调整 ---------- */

@media (max-width: 560px) {
  .glossary { grid-template-columns: minmax(0, 1fr); }
  .glossary li {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
    padding: 12px 0;
  }
  .sports-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ring-wrap { width: 228px; height: 228px; }
  .ring-value { font-size: 48px; }
}

/* ---------- 顶部留白 / 菜单 ---------- */

.app-body { padding-top: calc(52px + env(safe-area-inset-top, 0px)); }
.app-body .screens { padding-top: 0; }
.app-body .banner { margin-top: 12px; max-width: 520px; }

.appbar-btn { position: relative; }

.dot-ind {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f5c451;
  display: inline-block;
}

.dot-ind.is-live { background: #2ee68a; }
.appbar-btn .dot-ind { position: absolute; top: 4px; right: 4px; }

.menu-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: #c9d1d5;
  margin: 0 0 12px;
}

.menu-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid #1e2427;
}

.menu-list button,
.menu-list a {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 2px;
  border: 0;
  border-bottom: 1px solid #1e2427;
  background: none;
  color: #e9f2ef;
  font: inherit;
  font-size: 13.5px;
  text-decoration: none;
  cursor: pointer;
}

.menu-list button:hover,
.menu-list a:hover { color: #2ee68a; }

/* ---------- 趋势颜色（按"好/坏"而不是"涨/跌"） ---------- */

.row-trend.good { color: #2ee68a; }
.row-trend.bad { color: #f0a44a; }
.row-trend.flat { color: #4d565b; }

/* ---------- 圆环与卡片的衔接 ---------- */

.ring-wrap { margin-bottom: -18px; }

.sheet { margin-top: 10px; }

.sheet::before { z-index: 2; }

/* ---------- tab 选中指示 ---------- */

.tab.is-on::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: #2ee68a;
}

/* 桌面宽屏下别把 tab 拉开成整屏 */
.tabbar { justify-content: center; }
.tab { flex: 1 1 0; max-width: 140px; }

/* ================================================================
   首页（对齐官方 5.x：三环 + 方卡 + 我的一天）
   ================================================================ */

.screen-home { padding-top: 8px; }

.wordmark {
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.42em;
  color: #cfd8dc;
  margin: 6px 0 18px;
  padding-left: 0.42em;
}

.trio {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 20px;
}

.trio-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

.mini-ring-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  display: block;
}

.mini-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.mini-track {
  fill: none;
  stroke: #23282c;
  stroke-width: 7;
}

.mini-arc {
  fill: none;
  stroke: #2ee68a;
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
  transition: stroke-dashoffset 0.7s ease, stroke 0.3s ease;
}

.arc-blue { stroke: #2f9bff; }

.mini-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.mini-label {
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: #b9c4c9;
}

/* ---------- 方卡 ---------- */

.tiles {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.tile {
  flex: 1;
  min-width: 0;
  background: #14181a;
  border: 1px solid #20262a;
  border-radius: 16px;
  padding: 12px 12px 6px;
}

.tile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: #c9d1d5;
  margin-bottom: 6px;
}

.tile-arrow { color: #6f787d; }

.tile-rows { list-style: none; margin: 0; padding: 0; }

.tile-rows .row {
  padding: 8px 0;
  gap: 6px;
  border-bottom: 0;
}

.tile-rows .row-ico { display: none; }
.tile-rows .row-label { font-size: 11.5px; letter-spacing: 0.04em; color: #8b949a; }
.tile-rows .row-value { font-size: 13.5px; }
.tile-rows .row-unit { font-size: 9.5px; }
.tile-rows .row-trend { display: none; }

/* ---------- 我的一天 ---------- */

.day { margin-bottom: 16px; }

.day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.day-title { font-size: 15px; font-weight: 650; color: #e9f2ef; }
.day-sub { font-size: 11.5px; color: #8b949a; }

.timeline {
  position: relative;
  height: 34px;
  background: #12171a;
  border: 1px solid #1e2427;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 6px;
}

.timeline-seg {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 5px;
  opacity: 0.9;
}

.timeline-axis {
  position: absolute;
  bottom: 2px;
  left: 6px;
  font-size: 8.5px;
  color: #5c666b;
}

.timeline-axis.end { left: auto; right: 6px; }

.day-list { list-style: none; margin: 0; padding: 0; }

.day-list li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #1e2427;
  font-size: 12px;
}

.day-list li:last-child { border-bottom: 0; }

.day-time { color: #8b949a; font-variant-numeric: tabular-nums; flex: none; }
.day-name { color: #e9f2ef; font-weight: 600; }
.day-meta { color: #7f888d; margin-left: auto; }

@media (max-width: 560px) {
  .mini-ring-wrap { width: 88px; height: 88px; }
  .mini-value { font-size: 20px; }
}

/* ================================================================
   右侧竖排导航 + 社区
   ================================================================ */

.sidenav {
  position: fixed;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px 4px;
}

.sidenav .tab {
  width: 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 0;
  border: 1px solid transparent;
  border-radius: 14px;
  background: rgba(18, 22, 24, 0.86);
  color: #8b949a;
  font: inherit;
  font-size: 10px;
  letter-spacing: 0.02em;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.sidenav .tab-ico { font-size: 16px; line-height: 1; }

.sidenav .tab.is-on {
  color: #2ee68a;
  border-color: rgba(46, 230, 138, 0.45);
  background: rgba(46, 230, 138, 0.10);
}

.sidenav .tab.is-on::before { content: none; }

/* 给右侧导航让出空间 */
.screen { padding-right: 68px; }

@media (max-width: 420px) {
  .tiles { flex-direction: column; }
  .screen { padding-left: 14px; padding-right: 64px; }
}

/* ---------- 社区 ---------- */

.community-note {
  font-size: 11.5px;
  color: #7f888d;
  line-height: 1.7;
  margin: -6px 0 14px;
}

.community-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.community-form textarea {
  width: 100%;
  box-sizing: border-box;
  background: #12171a;
  border: 1px solid #20262a;
  border-radius: 14px;
  padding: 12px 14px;
  color: #e9f2ef;
  font: inherit;
  font-size: 13px;
  line-height: 1.6;
  resize: none;
}

.community-form textarea:focus {
  outline: 2px solid rgba(46, 230, 138, 0.35);
  outline-offset: 1px;
}

.community-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.community-list .msg {
  background: #14181a;
  border: 1px solid #20262a;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

.msg-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.msg-who { font-size: 11.5px; color: #2ee68a; }
.msg-time { font-size: 10.5px; color: #6f787d; }
.msg-text { font-size: 13px; color: #e3ecf1; line-height: 1.7; }

.community-list .empty { font-size: 12.5px; color: #7f888d; }

/* ================================================================
   配色：对齐官方 App（深海军蓝底 + 亮蓝主色）
   ================================================================ */

.app-body {
  background:
    radial-gradient(1200px 620px at 50% -12%, #16344f 0%, rgba(22, 52, 79, 0) 62%),
    linear-gradient(180deg, #0c1f33 0%, #081726 55%, #06121d 100%);
  background-attachment: fixed;
  color: #eaf2fb;
}

.appbar {
  background: rgba(9, 22, 36, 0.9);
  border-bottom: 1px solid rgba(120, 165, 210, 0.14);
}

.appbar-btn { color: #cfe2f5; }
.appbar-title { color: #e6f0fb; }
.wordmark { color: #cfe2f5; }
.ring-brand, .ring-label { color: #7e97b3; }

/* 环 */
.ring-track, .mini-track { stroke: #1e3550; }
.ring-arc { stroke: #4b9dff; }
.mini-arc { stroke: #4b9dff; }
.arc-blue, .ring-blue { stroke: #2f8cff; }
.ring-purple { stroke: #4b9dff; }
.mini-value, .ring-value { color: #ffffff; }

/* 卡片 */
.sheet,
.tile {
  background: linear-gradient(180deg, rgba(31, 53, 79, 0.96), rgba(19, 36, 56, 0.96));
  border: 1px solid rgba(122, 166, 208, 0.16);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

.sheet::before {
  background: rgba(31, 53, 79, 0.98);
  border-left: 1px solid rgba(122, 166, 208, 0.16);
  border-top: 1px solid rgba(122, 166, 208, 0.16);
}

.row { border-bottom: 1px solid rgba(122, 166, 208, 0.12); }
.row-label { color: #aac0d8; }
.row-ico { color: #8aa4c0; }
.row-value { color: #ffffff; }
.row-unit { color: #8aa4c0; }
.row-trend.good { color: #35d07f; }
.row-trend.bad { color: #f0a44a; }
.row-trend.flat { color: #58718c; }

.tile-head { color: #cfe0f2; }
.tile-arrow { color: #7e97b3; }

.cmp {
  background: rgba(8, 22, 36, 0.6);
  border: 1px solid rgba(122, 166, 208, 0.14);
  color: #8ea6c0;
}

.coach {
  background: rgba(47, 140, 255, 0.10);
  border: 1px solid rgba(90, 169, 255, 0.5);
}

.coach-text { color: #dcebf9; }
.coach-link { color: #7cbcff; }

/* 我的一天 */
.day-title { color: #eaf2fb; }
.day-sub { color: #8ea6c0; }

.timeline {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(122, 166, 208, 0.14);
}

.day-list li { border-bottom: 1px solid rgba(122, 166, 208, 0.12); }
.day-time { color: #8ea6c0; }
.day-name { color: #eaf2fb; }
.day-meta { color: #7e97b3; }

/* 右侧导航 */
.sidenav .tab {
  background: rgba(14, 30, 47, 0.9);
  border: 1px solid rgba(122, 166, 208, 0.14);
  color: #93a9c2;
}

.sidenav .tab.is-on {
  color: #8ec8ff;
  border-color: rgba(90, 169, 255, 0.5);
  background: rgba(47, 140, 255, 0.16);
}

/* 更多页 / 词典 / 训练 */
.settings-row { border-top: 1px solid rgba(122, 166, 208, 0.12); }
.settings-k, .more-sub { color: #8ea6c0; }
.settings-v, .more-title { color: #eaf2fb; }
.settings-links a { color: #7cbcff; border-bottom-color: rgba(124, 188, 255, 0.35); }
.foot-note { color: #7189a3; }

.workout { border-bottom: 1px solid rgba(122, 166, 208, 0.12); }
.workout-name { color: #eaf2fb; }
.workout-strain { color: #7cbcff; }
.workout-when, .workout-metrics { color: #8ea6c0; }

.glossary li { border-top: 1px solid rgba(122, 166, 208, 0.12); }
.glossary .term { color: #8ec8ff; }
.glossary .desc { color: #c2d4e6; }
.sports-list li { border-top: 1px solid rgba(122, 166, 208, 0.12); }
.sports-list .zh { color: #eaf2fb; }
.sports-list .en { color: #8ea6c0; }

.search {
  background: rgba(9, 22, 36, 0.7);
  border: 1px solid rgba(122, 166, 208, 0.16);
  color: #eaf2fb;
}

/* 提示条 / 弹窗 */
.banner {
  background: rgba(47, 140, 255, 0.10);
  border: 1px solid rgba(90, 169, 255, 0.35);
  color: #cfe4fb;
}

.banner a { color: #8ec8ff; }

.modal-card {
  background: linear-gradient(180deg, #16304a, #0d1f31);
  border: 1px solid rgba(122, 166, 208, 0.2);
}

.modal-body { color: #c2d4e6; }
.dot-ind { background: #f5c451; }
.dot-ind.is-live { background: #35d07f; }

@media (max-width: 560px) {
  .mini-label { color: #aac0d8; }
}

/* ---------- 小图表（近 7 天） ---------- */

.charts {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.chart-card {
  flex: 1;
  min-width: 0;
  background: rgba(8, 22, 36, 0.55);
  border: 1px solid rgba(122, 166, 208, 0.14);
  border-radius: 12px;
  padding: 10px 10px 6px;
}

.chart-title {
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: #8ea6c0;
  margin-bottom: 8px;
}

.chart-body { height: 62px; display: flex; flex-direction: column; }

.chart-bars {
  flex: 1;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  min-height: 0;
}

.chart-bars .bar {
  flex: 1;
  min-height: 2px;
  border-radius: 3px 3px 1px 1px;
  background: linear-gradient(180deg, #6ab4ff, #2f8cff);
  opacity: 0.9;
}

.chart-svg { flex: 1; width: 100%; min-height: 0; }

.chart-axis {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: #6f8aa6;
  margin-top: 4px;
}

.chart-empty { font-size: 11px; color: #6f8aa6; }

@media (max-width: 420px) {
  .charts { flex-direction: column; }
}

/* 柱子：带数值标签 */
.chart-bars .bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  height: 100%;
  min-width: 0;
}

.chart-bars .bar-wrap .bar {
  width: 100%;
  border-radius: 3px 3px 1px 1px;
  background: linear-gradient(180deg, #6ab4ff, #2f8cff);
  opacity: 0.9;
}

.chart-bars .bar-label {
  font-size: 8px;
  color: #8ea6c0;
  line-height: 1;
  margin-bottom: 2px;
  order: -1;
}

/* ---------- 健康监测（5 项） ---------- */

.hm-grid {
  display: flex;
  gap: 4px;
  margin: 4px 0 6px;
}

.hm-item {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 2px 4px;
}

.hm-value {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.hm-label {
  font-size: 9.5px;
  color: #8ea6c0;
  white-space: nowrap;
}

.hm-mark {
  font-size: 9px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
}

.hm-ok { color: #35d07f; border-color: rgba(53, 208, 127, 0.5); background: rgba(53, 208, 127, 0.12); }
.hm-warn { color: #f5c451; border-color: rgba(245, 196, 81, 0.5); background: rgba(245, 196, 81, 0.12); }
.hm-neutral { color: #6f8aa6; border-color: rgba(111, 138, 166, 0.35); }

.hm-note {
  margin: 2px 0 8px;
  font-size: 9.5px;
  line-height: 1.5;
  color: #7189a3;
}

/* ---------- 趋势页大图 ---------- */

.chart-card-lg {
  margin-bottom: 10px;
  padding: 12px 12px 8px;
}

.chart-body-lg { height: 96px; }

.chart-card-lg .chart-title { font-size: 11.5px; margin-bottom: 10px; }
.chart-card-lg .chart-axis { font-size: 9.5px; }
.chart-card-lg .bar-label { font-size: 8.5px; }

/* ---------- 趋势页：官方那种大卡片 ---------- */

.chart-card-lg {
  margin-bottom: 12px;
  padding: 16px 14px 10px;
  border-radius: 16px;
}

.chart-card-lg .chart-title {
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: #cfe0f2;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chart-card-lg .chart-title::after {
  content: "›";
  color: #7e97b3;
  font-size: 14px;
}

.chart-body-lg { height: 132px; }

.chart-card-lg .chart-bars { gap: 7px; }

.chart-card-lg .bar {
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, #7cc0ff, #2f8cff);
}

.chart-card-lg .bar-label {
  font-size: 9.5px;
  color: #b9d2ea;
  margin-bottom: 4px;
}

/* 7 天横轴：周几 / 日期 两行 */
.chart-axis span {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  line-height: 1.15;
}

.chart-axis i {
  font-style: normal;
  font-size: 9px;
  color: #7e97b3;
}

.chart-axis b {
  font-weight: 400;
  font-size: 9.5px;
  color: #9fb8d0;
}

.chart-card-lg .chart-axis { margin-top: 8px; }

/* 修复：旧规则里的 flex:1 会把柱子拉成等高，这里让内联高度生效 */
.chart-bars .bar-wrap .bar {
  flex: 0 0 auto;
  height: auto;
}

.menu-version {
  margin: -6px 0 12px;
  font-size: 11px;
  color: #6f8aa6;
}

/* ================================================================
   底部导航（官方 Home / Health / … / More 那种）
   ================================================================ */

.tabbar {
  justify-content: center;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.tabbar .tab {
  flex: 1 1 0;
  max-width: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 9px 0 10px;
  font-size: 10.5px;
  letter-spacing: 0.06em;
}

.tabbar .tab-ico {
  font-size: 16px;
  line-height: 1;
  color: inherit;
}

.tabbar .tab.is-on .tab-ico { color: #8ec8ff; }

.tabbar .tab.is-on::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: #4b9dff;
}

/* 底部导航时内容用满宽度 */
.screen { padding-right: 18px; padding-left: 18px; }

/* 指标行里的基线小字 */
.row-note {
  display: block;
  font-size: 9.5px;
  color: #7e97b3;
  margin-top: 2px;
  letter-spacing: 0;
}

.hm-note-inline { font-size: 11px; color: #8ea6c0; }

.promo-tag {
  font-size: 10px;
  color: #f5c451;
  border: 1px solid rgba(245, 196, 81, 0.4);
  border-radius: 999px;
  padding: 1px 8px;
  white-space: nowrap;
}

.promo-text {
  font-size: 12px;
  color: #8ea6c0;
  line-height: 1.7;
  margin: 8px 0 2px;
}

.promo { opacity: 0.9; }

/* ================================================================
   对齐官方：线图标、圆环粗细、卡片质感、顶栏圆形按钮、悬浮 W
   ================================================================ */

/* 底部线性图标 */
.tabbar .tab-ico {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: #6f8aa6;
}

.tabbar .tab.is-on .tab-ico { color: #8ec8ff; }

.tabbar .tab-text {
  font-size: 10px;
  letter-spacing: 0.02em;
  color: #7e97b3;
}

.tabbar .tab.is-on .tab-text { color: #d7e8f8; }

/* 悬浮 W */
.fab-w {
  position: fixed;
  right: 16px;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(124, 192, 255, 0.55);
  background: radial-gradient(circle at 50% 35%, rgba(47, 140, 255, 0.55), rgba(10, 30, 50, 0.9));
  display: grid;
  place-items: center;
  z-index: 45;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
}

.fab-w svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: #cfe6ff;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fab-w:active { transform: scale(0.94); }

/* 圆环更粗，接近官方的感观 */
.ring-track, .ring-arc { stroke-width: 12; }
.mini-track, .mini-arc { stroke-width: 8; }

/* 卡片：实色 + 极淡描边，去掉浮起来的阴影 */
.sheet,
.tile {
  background: #16283c;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: none;
}

.sheet::before {
  background: #16283c;
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* 中文标签不加字距（官方只给英文大写加） */
.row-label { letter-spacing: 0; font-size: 12.5px; }
.tile-head { letter-spacing: 0; }

/* 顶栏圆形按钮 */
.appbar-btn-round {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(150, 190, 230, 0.35);
  display: grid;
  place-items: center;
  color: #bcd2e6;
}

.appbar-btn-round .dots {
  font-size: 9px;
  letter-spacing: 1px;
  line-height: 1;
  transform: translateY(-1px);
}

/* ================================================================
   精修：卡片半透明、字号层级、导航栏质感、图表配色
   ================================================================ */

/* 卡片：半透明蓝 + 背景模糊，让底色透出来（官方那种"玻璃"感） */
.sheet,
.tile,
.chart-card {
  background: linear-gradient(180deg, rgba(40, 66, 98, 0.72), rgba(24, 44, 66, 0.78));
  border: 1px solid rgba(150, 190, 230, 0.13);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: none;
}

.sheet::before {
  background: rgba(40, 66, 98, 0.95);
  border-left: 1px solid rgba(150, 190, 230, 0.13);
  border-top: 1px solid rgba(150, 190, 230, 0.13);
}

/* 字号层级：中文标签更小更淡，数值保持醒目 */
.row-label {
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: #a9bed6;
}

.row-value { font-size: 16px; }
.row-unit { font-size: 10px; }
.row-note { font-size: 9px; }

.card-title,
.more-title { font-size: 13.5px; }

.tile-head { font-size: 11.5px; letter-spacing: 0.02em; }

.ring-value { font-size: 56px; }
.mini-value { font-size: 21px; }
.mini-label { font-size: 11px; letter-spacing: 0.02em; }

.day-title { font-size: 14px; }
.day-time, .day-name { font-size: 12px; }

/* 圆环轨道再淡一点 */
.ring-track, .mini-track { stroke: #243e5c; }

/* 柱子配色向官方靠：顶部更亮 */
.chart-card-lg .bar {
  background: linear-gradient(180deg, #8ec8ff, #2f8cff);
}

/* 底部导航：半透明 + 模糊 */
.tabbar {
  background: rgba(9, 22, 36, 0.86);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(150, 190, 230, 0.10);
}

/* 顶栏也压低一点存在感 */
.appbar {
  background: rgba(9, 22, 36, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(150, 190, 230, 0.10);
}

/* 悬浮 W 位置上移一点，别压住列表文字 */
.fab-w {
  width: 44px;
  height: 44px;
  right: 14px;
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  background: radial-gradient(circle at 50% 30%, rgba(64, 150, 255, 0.6), rgba(10, 30, 50, 0.92));
}

/* 健康监测的小格子别太挤 */
.hm-item { padding: 8px 2px 6px; }
.hm-value { font-size: 13.5px; }

/* 健康监测的对勾改成官方那种圆角方块 */
.hm-mark {
  border-radius: 4px;
  width: 15px;
  height: 15px;
  font-size: 9.5px;
}

/* 悬浮 W 再小一点、往下压，少压住文字 */
.fab-w {
  width: 42px;
  height: 42px;
  right: 12px;
  bottom: calc(78px + env(safe-area-inset-bottom, 0px));
}

.fab-w svg { width: 21px; height: 21px; }

/* 内容底部多留一点，滚动到底时最后一行不会被悬浮按钮挡住 */
.screen { padding-bottom: 40px; }

/* ---------- 今晚睡眠卡 ---------- */

.tonight-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.tonight-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px;
  background: rgba(8, 22, 36, 0.35);
  border: 1px solid rgba(150, 190, 230, 0.10);
  border-radius: 12px;
}

.tonight-ico { font-size: 13px; opacity: 0.9; }
.tonight-value { font-size: 17px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.tonight-label { font-size: 9.5px; color: #8ea6c0; }

.tonight-value { font-size: 15px; white-space: nowrap; }
.tonight-item:nth-child(3) .tonight-value { font-size: 13px; }

/* ---------- 顶栏日期切换 ---------- */

.appbar-center {
  display: flex;
  align-items: center;
  gap: 4px;
}

.date-arrow {
  background: none;
  border: 0;
  padding: 0 6px;
  font-size: 17px;
  line-height: 1;
  color: #8ec8ff;
  cursor: pointer;
}

.date-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 96px;
}

.appbar-date {
  font-size: 9.5px;
  color: #7e97b3;
  line-height: 1.3;
}

/* ---------- 心率区间条形 ---------- */

.zone-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 7px 0;
}

.zone-code {
  width: 22px;
  font-size: 10.5px;
  color: #8ea6c0;
  flex: none;
}

.zone-bar {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.zone-fill {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #2f8cff, #8ec8ff);
}

.zone-dur {
  width: 66px;
  text-align: right;
  font-size: 10.5px;
  color: #a9bed6;
  flex: none;
}

.menu-auth-error {
  margin: -4px 0 10px;
  font-size: 11px;
  line-height: 1.6;
  color: #f0a44a;
  word-break: break-all;
}
