/* ============================================================
   电耗账本 / 设计系统
   全屏响应式 Web App：桌面与手机共用同一套布局，无手机外框
   ============================================================ */

/* ---------- 1. 设计变量 ---------- */
:root {
  --brand: #0FB88F;
  --brand-2: #07A2A0;
  --brand-soft: #E3F7EF;
  --brand-ink: #067356;

  --app-bg: #F2F6F4;
  --card: #FFFFFF;
  --card-2: #F8FBF9;
  --ink: #102624;
  --ink-2: #506560;
  --ink-3: #8C9E9A;
  --line: #E6EDEA;
  --line-2: #F0F4F2;

  --fuel: #F5822B;
  --warn: #F0A020;
  --danger: #E5484D;
  --good: #0FB88F;

  --shadow: 0 4px 16px rgba(16, 38, 36, .055);
  --shadow-lg: 0 18px 50px rgba(16, 38, 36, .13);
  --radius: 20px;
  --radius-sm: 13px;
  --shell-max: 860px;

  /* 文字大小：由「设置 → 字体大小」切换 */
  --fs: 1.14;

  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  --num: "SF Pro Display", -apple-system, "Helvetica Neue", Arial, sans-serif;
}
html[data-font="small"]  { --fs: 1.14; }
html[data-font="normal"] { --fs: 1.3; }
html[data-font="large"]  { --fs: 1.45; }
html[data-font="xlarge"] { --fs: 1.6; }

/* 浅色模式：背景与次级卡片跟随主题色，和深色模式的 brand-soft 处理一致 */
[data-accent="blue"]   { --brand:#3B7DF6; --brand-2:#5B6EF5; --brand-soft:#E8F0FE; --brand-ink:#2159C4; --app-bg:#F1F5FD; --card-2:#F7FAFE; }
[data-accent="violet"] { --brand:#8B5CF6; --brand-2:#A855F7; --brand-soft:#F1EBFE; --brand-ink:#6B35D6; --app-bg:#F7F3FD; --card-2:#FBF8FE; }
[data-accent="amber"]  { --brand:#F29325; --brand-2:#E86A2B; --brand-soft:#FEF2E2; --brand-ink:#B5620C; --app-bg:#FDF7F0; --card-2:#FEFAF6; }

[data-theme="dark"] {
  --app-bg: #0C1513;
  --card: #16231F;
  --card-2: #1B2B26;
  --ink: #EAF4F0;
  --ink-2: #A3B8B1;
  --ink-3: #6E847D;
  --line: #263731;
  --line-2: #1F2E29;
  --brand-soft: #153B30;
  --shadow: 0 4px 16px rgba(0,0,0,.20);
  --shadow-lg: 0 18px 50px rgba(0,0,0,.42);
}
[data-theme="dark"][data-accent="blue"]   { --brand-soft:#172C4C; --brand-ink:#8FB5FF; }
[data-theme="dark"][data-accent="violet"] { --brand-soft:#2A1F49; --brand-ink:#C7A8FF; }
[data-theme="dark"][data-accent="amber"]  { --brand-soft:#3A2814; --brand-ink:#FFC47A; }

/* ---------- 2. 基础 ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; accent-color: var(--brand); }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--app-bg);
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
h1,h2,h3,h4,p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
.num, .big, .kpi-value, .stat-value, .hero-money, .rec-amount, .detail-amount {
  font-family: var(--num); font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--brand) 45%, var(--line)); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand); }
/* Firefox 滚动条同样跟随主题色 */
html { scrollbar-color: color-mix(in srgb, var(--brand) 45%, var(--line)) transparent; scrollbar-width: thin; }

/* ---------- 3. 页面标题区（顶部品牌栏已移除，安全区由 app-header 承担） ---------- */
/* ---------- 4. 应用容器（全屏，无手机外框） ---------- */
.app-shell {
  position: relative; width: 100%; height: 100dvh;
  background: var(--app-bg); display: flex; flex-direction: column;
  overflow: hidden; isolation: isolate;
}
.app-header {
  flex: none; padding: calc(14px + env(safe-area-inset-top)) 22px 8px; background: var(--app-bg);
  position: relative; z-index: 10;
}
.app-header > * { max-width: var(--shell-max); margin-left: auto; margin-right: auto; }
.hd { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.hd-eyebrow { font-size: calc(11.5px * var(--fs)); color: var(--ink-3); margin-bottom: 3px; letter-spacing: .03em; }
.hd-title { font-size: calc(25px * var(--fs)); font-weight: 800; letter-spacing: -.03em; line-height: 1.2; }
.hd-actions { display: flex; gap: 8px; align-items: center; padding-bottom: 2px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center;
  background: var(--card); color: var(--ink-2); box-shadow: var(--shadow); transition: .18s;
}
.icon-btn:hover { color: var(--brand); transform: translateY(-1px); }
.icon-btn:active { transform: scale(.92); }

.app-main { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 22px 132px; position: relative; }
.page { display: none; max-width: var(--shell-max); margin: 0 auto; }
.page.active { display: block; animation: pageIn .32s cubic-bezier(.2,.8,.2,1) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* 底部 Tab：桌面居中成一组，手机铺满 */
.tabbar {
  flex: none; z-index: 30; height: calc(70px + env(safe-area-inset-bottom));
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  display: flex; justify-content: center; gap: 4px;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: blur(18px) saturate(1.4);
  border-top: 1px solid var(--line);
}
.tab { flex: 1; max-width: 190px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--ink-3); transition: .2s; border-radius: 14px; }
.tab svg { width: 22px; height: 22px; }
.tab span { font-size: calc(10.5px * var(--fs)); font-weight: 600; }
.tab.active { color: var(--brand); }
.tab.active svg { stroke-width: 2.3; }
.tab:active { transform: scale(.9); }
.fab {
  position: absolute; z-index: 35;
  right: max(22px, calc((100% - var(--shell-max)) / 2 + 22px));
  bottom: calc(86px + env(safe-area-inset-bottom));
  width: 52px; height: 52px; border-radius: 18px; display: grid; place-items: center;
  color: #fff; background: linear-gradient(145deg, var(--brand), var(--brand-2));
  box-shadow: 0 10px 24px color-mix(in srgb, var(--brand) 40%, transparent);
  transition: .25s cubic-bezier(.2,.8,.2,1);
}
.fab svg { width: 24px; height: 24px; }
.fab:hover { transform: translateY(-3px) rotate(90deg); }
.fab:active { transform: scale(.9); }
.fab.hidden { opacity: 0; pointer-events: none; transform: scale(.5); }

/* ---------- 4b. 多车切换 / 对比 / 字体设置 ---------- */
.car-bar { display: flex; gap: 7px; overflow-x: auto; padding: 12px 0 2px; scrollbar-width: none; }
.car-bar::-webkit-scrollbar { display: none; }
.car-chip {
  flex: none; display: flex; align-items: center; gap: 6px; padding: 7px 12px;
  border-radius: 999px; background: var(--card); border: 1px solid var(--line);
  color: var(--ink-2); font-size: calc(11.5px * var(--fs)); font-weight: 650;
  white-space: nowrap; transition: .18s;
}
.car-chip i { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--dot, var(--brand)); }
.car-chip.active { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 5px 14px color-mix(in srgb, var(--brand) 28%, transparent); }
.car-chip.active i { background: rgba(255,255,255,.92); }
.car-chip.add { border-style: dashed; color: var(--brand-ink); }
.car-chip .cnt { opacity: .62; font-size: calc(10px * var(--fs)); }
.car-chip:active { transform: scale(.95); }

.car-mini { display: inline-flex; align-items: center; font-size: calc(9.5px * var(--fs)); color: var(--brand-ink); background: var(--brand-soft); padding: 1px 5px; border-radius: 5px; font-weight: 750; margin-right: 5px; }

.compare-item { margin-bottom: 14px; }
.compare-item:last-child { margin-bottom: 0; }
.compare-top { display: flex; align-items: center; gap: 8px; font-size: calc(12px * var(--fs)); margin-bottom: 7px; }
.compare-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.compare-name { font-weight: 700; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compare-val { font-family: var(--num); font-weight: 780; flex: none; }
.compare-bar { height: 8px; border-radius: 8px; background: var(--line-2); overflow: hidden; }
.compare-fill { height: 100%; border-radius: 8px; transition: width .4s; }
.compare-meta { font-size: calc(10px * var(--fs)); color: var(--ink-3); margin-top: 5px; }

.car-manage-item { display: flex; align-items: center; gap: 11px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.car-manage-item:last-child { border-bottom: 0; }
.car-avatar { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: #fff; flex: none; background: linear-gradient(140deg, var(--brand), var(--brand-2)); box-shadow: 0 5px 12px color-mix(in srgb, var(--brand) 26%, transparent); }
.car-manage-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.car-avatar svg { width: 18px; height: 18px; }
.car-manage-text { flex: 1; min-width: 0; }
.car-manage-text b { display: block; font-size: calc(12.5px * var(--fs)); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.car-manage-text span { font-size: calc(10.5px * var(--fs)); color: var(--ink-3); }
.car-manage-count { font-family: var(--num); font-size: calc(11px * var(--fs)); color: var(--ink-3); flex: none; }

.font-preview { background: var(--card-2); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 16px; }
.font-preview .pv-label { font-size: calc(10.5px * var(--fs)); color: var(--ink-3); margin-bottom: 7px; }
.font-preview .pv-num { font-family: var(--num); font-size: calc(27px * var(--fs)); font-weight: 800; line-height: 1.1; }
.font-preview .pv-text { font-size: calc(12.5px * var(--fs)); color: var(--ink-2); line-height: 1.7; margin-top: 8px; }
.font-opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.font-opt { padding: 12px 2px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line); text-align: center; transition: .18s; }
.font-opt b { display: block; font-weight: 800; line-height: 1.2; margin-bottom: 4px; }
.font-opt span { font-size: calc(10px * var(--fs)); color: var(--ink-3); }
.font-opt.active { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-ink); }
.font-opt:active { transform: scale(.95); }
.font-sm { font-size: calc(11px * var(--fs)); }
.font-md { font-size: calc(15px * var(--fs)); }
.font-lg { font-size: calc(19px * var(--fs)); }
.font-xl { font-size: calc(23px * var(--fs)); }

/* ---------- 5. 通用组件 ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 14px; border: 1px solid var(--line-2); }
.card.tight { padding: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 8px; }
.card-title { font-size: calc(14px * var(--fs)); font-weight: 750; letter-spacing: -.01em; }
.card-sub { font-size: calc(11px * var(--fs)); color: var(--ink-3); }
.link-btn { font-size: calc(11.5px * var(--fs)); color: var(--brand-ink); font-weight: 650; display: flex; align-items: center; gap: 2px; }
.link-btn:hover { opacity: .7; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 22px 2px 11px; }
.section-title { font-size: calc(16px * var(--fs)); font-weight: 800; letter-spacing: -.02em; }
.section-extra { font-size: calc(11.5px * var(--fs)); color: var(--ink-3); }
.muted { color: var(--ink-3); }
.green { color: var(--good); }
.orange { color: var(--fuel); }
.danger { color: var(--danger); }
.divider { height: 1px; background: var(--line-2); margin: 12px 0; }

.badge { font-size: calc(10px * var(--fs)); font-weight: 700; padding: 3px 7px; border-radius: 7px; background: var(--brand-soft); color: var(--brand-ink); }
.tag { font-size: calc(10px * var(--fs)); font-weight: 700; padding: 2.5px 7px; border-radius: 6px; white-space: nowrap; }
.tag-home { background: #E3F7EF; color: #067356; }
.tag-fast { background: #FFF0E4; color: #C2640F; }
.tag-slow { background: #E9F0FE; color: #2C63C9; }
[data-theme="dark"] .tag-home { background:#173A2C; color:#6FDCB0; }
[data-theme="dark"] .tag-fast { background:#3B2A18; color:#F5B475; }
[data-theme="dark"] .tag-slow { background:#1B2C49; color:#95B8FF; }

.chip { flex: none; font-size: calc(11.5px * var(--fs)); font-weight: 650; padding: 7px 13px; border-radius: 999px; background: var(--card); color: var(--ink-2); border: 1px solid var(--line); transition: .18s; white-space: nowrap; }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 5px 14px color-mix(in srgb, var(--brand) 28%, transparent); }
.chip:active { transform: scale(.94); }
.filter-row { display: flex; gap: 7px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.filter-row::-webkit-scrollbar, .month-strip::-webkit-scrollbar { display: none; }

/* 区间菜单栏：浅底浅色风格（全部 / 按月 / 按季 / 按年 / 自定义） */
.segmented { display: flex; background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; }
.seg { flex: 1; font-size: calc(12px * var(--fs)); font-weight: 650; padding: 7px 0; border-radius: 9px; color: var(--ink-2); transition: .2s; }
.seg:hover { color: var(--brand-ink); }
.seg.active { background: var(--card); color: var(--brand-ink); box-shadow: 0 2px 8px rgba(16,38,36,.08); font-weight: 800; }
[data-theme="dark"] .segmented { background: var(--card-2); border-color: var(--line); }
[data-theme="dark"] .seg.active { background: var(--brand-soft); color: var(--brand-ink); box-shadow: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: calc(13px * var(--fs)); font-weight: 700; padding: 12px 16px; border-radius: 13px; transition: .18s; }
.btn:active { transform: scale(.97); }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: 0 8px 20px color-mix(in srgb, var(--brand) 28%, transparent); }
.btn-ghost { background: var(--card-2); border: 1px solid var(--line); color: var(--ink-2); }
.btn-danger { background: color-mix(in srgb, var(--danger) 12%, var(--card)); color: var(--danger); }
.btn-block { width: 100%; }
.btn svg { width: 16px; height: 16px; }

.progress { height: 7px; border-radius: 7px; background: var(--line-2); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 7px; background: linear-gradient(90deg, var(--brand-2), var(--brand)); transition: width .5s; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: calc(10.5px * var(--fs)); color: var(--ink-3); }
.dot { width: 8px; height: 8px; border-radius: 3px; display: inline-block; }
.insight { margin-top: 12px; background: var(--brand-soft); border-radius: 12px; padding: 11px 12px; display: flex; gap: 9px; font-size: calc(11.5px * var(--fs)); line-height: 1.55; color: var(--brand-ink); }
/* 分析页星光洞察框：比正文小一号，避免大字号时文字过多 */
#page-analysis .insight { font-size: calc(10px * var(--fs)); }
.insight-icon { flex: none; width: 16px; height: 16px; margin-top: 1px; }

.empty { text-align: center; padding: 46px 20px; color: var(--ink-3); }
.empty-icon { width: 58px; height: 58px; border-radius: 20px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin: 0 auto 14px; }
.empty-icon svg { width: 28px; height: 28px; }
.empty b { display: block; font-size: calc(14px * var(--fs)); color: var(--ink-2); margin-bottom: 5px; }
.empty p { font-size: calc(11.5px * var(--fs)); line-height: 1.6; }

/* 开关 */
.switch { position: relative; flex: none; width: 44px; height: 26px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 2; }
.switch-track { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: .22s; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.18); transition: .22s; }
.switch input:checked + .switch-track { background: var(--brand); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }

/* ---------- 6. 首页 ---------- */
.greeting { display: flex; align-items: center; justify-content: space-between; font-size: calc(11.5px * var(--fs)); color: var(--ink-3); padding: 2px 3px 12px; }
.greeting b { color: var(--ink-2); }
.car-card {
  background: linear-gradient(145deg, var(--brand), var(--brand-2));
  border-radius: 22px; padding: 16px; color: #fff; margin-bottom: 16px;
  box-shadow: 0 14px 30px color-mix(in srgb, var(--brand) 26%, transparent); position: relative; overflow: hidden;
}
.car-card::after { content:""; position:absolute; right:-40px; top:-60px; width:180px; height:180px; border-radius:50%; background:rgba(255,255,255,.09); }
.car-card::before { content:""; position:absolute; right:20px; bottom:-70px; width:140px; height:140px; border-radius:50%; background:rgba(255,255,255,.06); }
.car-top { display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; }
.car-badge { width: 34px; height: 34px; border-radius: 11px; background: rgba(255,255,255,.2); display: grid; place-items: center; flex: none; }
.car-badge svg { width: 19px; height: 19px; }
.car-name { font-size: calc(14px * var(--fs)); font-weight: 750; flex: 1; line-height: 1.35; }
.car-plate { display: block; font-size: calc(10.5px * var(--fs)); opacity: .8; font-weight: 500; letter-spacing: .06em; margin-top: 1px; }
.car-top .icon-btn { background: rgba(255,255,255,.18); color: #fff; box-shadow: none; width: 30px; height: 30px; border-radius: 10px; }
.car-top .icon-btn:hover { background: rgba(255,255,255,.3); }
.car-cost { padding: 18px 2px 16px; position: relative; z-index: 1; }
.car-foot { border-top: 1px solid rgba(255,255,255,.22); padding-top: 11px; display: flex; justify-content: space-between; gap: 6px; font-size: calc(10.5px * var(--fs)); opacity: .9; position: relative; z-index: 1; }

.hero-stat { padding: 2px 2px 10px; }
.hero-label { font-size: calc(11.5px * var(--fs)); color: var(--ink-3); margin-bottom: 4px; }
.hero-money { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: calc(36px * var(--fs)); font-weight: 800; line-height: 1; }
.hero-num { white-space: nowrap; line-height: 1; }
.hero-money i { font-size: calc(17px * var(--fs)); font-style: normal; font-weight: 650; margin-right: 3px; }
.delta { display: inline-flex; align-items: center; justify-content: center; gap: 4px; font-size: calc(10.5px * var(--fs)); font-weight: 700; padding: 5px 9px; border-radius: 8px; margin-left: auto; flex: none; line-height: 1; white-space: nowrap; }
.delta.up { background: color-mix(in srgb, var(--danger) 11%, transparent); color: var(--danger); }
.delta.down { background: var(--brand-soft); color: var(--brand-ink); }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line-2); border-radius: 14px; overflow: hidden; border: 1px solid var(--line-2); }
.stat { background: var(--card-2); padding: 12px 13px; }
.stat-label { font-size: calc(10.5px * var(--fs)); color: var(--ink-3); margin-bottom: 5px; }
.stat-value { font-size: calc(19px * var(--fs)); font-weight: 750; }
.stat-value i { font-size: calc(10.5px * var(--fs)); font-style: normal; font-weight: 600; color: var(--ink-3); margin-left: 3px; }

/* 首页第一屏：本月电费 + 百公里电费 / 百公里电耗 */
.home-kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.home-kpi { min-width: 0; background: var(--card); border: 1px solid var(--line-2); border-radius: 16px; padding: 13px; box-shadow: var(--shadow); }
.hk-label { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; font-size: calc(10.5px * var(--fs)); color: var(--ink-3); margin-bottom: 7px; }
.hk-label span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.car-card .hk-label { color: rgba(255,255,255,.86); }
.hk-main { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
.hk-main b { font-family: var(--num); font-size: calc(32px * var(--fs)); font-weight: 800; line-height: 1; letter-spacing: -.02em; white-space: nowrap; }
.hk-main b i { font-size: calc(16px * var(--fs)); font-style: normal; font-weight: 650; margin-right: 2px; }
.hk-main .delta { margin-left: 0; }
.car-card .delta { background: rgba(255,255,255,.22); color: #fff; }
.hk-value { font-family: var(--num); font-size: calc(21px * var(--fs)); font-weight: 800; line-height: 1.1; white-space: nowrap; }
.hk-value i { font-size: calc(10px * var(--fs)); font-style: normal; font-weight: 600; color: var(--ink-3); margin-left: 2px; }
.hk-sub { font-size: calc(10px * var(--fs)); color: var(--ink-3); margin-top: 8px; line-height: 1.55; }
.car-card .hk-sub { color: rgba(255,255,255,.86); }
.hk-sub .delta { display: inline-flex; padding: 2px 5px; margin-left: 2px; font-size: calc(9.5px * var(--fs)); vertical-align: middle; }

/* 实际续航估算 */
.est-badge { flex: none; background: var(--brand-soft); color: var(--brand-ink); border-radius: 8px; padding: 5px 8px; font-size: calc(10px * var(--fs)); font-weight: 700; }
.est-main { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 11px; }
.est-num { font-family: var(--num); font-size: calc(34px * var(--fs)); font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.est-num span { font-size: calc(12px * var(--fs)); font-weight: 600; color: var(--ink-3); margin-left: 3px; }
.est-side { font-size: calc(11px * var(--fs)); color: var(--ink-2); line-height: 1.55; }
.est-side small { font-size: calc(10px * var(--fs)); color: var(--ink-3); }
.est-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: calc(10px * var(--fs)); color: var(--ink-3); }
/* 多车：各车续航估算罗列 */
.rr-list { margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); }
.rr-item { margin-bottom: 12px; }
.rr-item:last-child { margin-bottom: 0; }
.rr-top { display: flex; align-items: center; gap: 7px; font-size: calc(11.5px * var(--fs)); margin-bottom: 6px; }
.rr-name { flex: 1; min-width: 0; font-weight: 650; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rr-top b { font-family: var(--num); color: var(--brand-ink); font-size: calc(12px * var(--fs)); }
.rr-meta { font-size: calc(9.5px * var(--fs)); color: var(--ink-3); margin-top: 5px; }

.chart-wrap { width: 100%; }
.chart-wrap svg { display: block; width: 100%; height: auto; overflow: visible; }

/* 外层不再加大背景框，避免与每条记录自身的卡片背景重叠；首页固定 3 条 */
.recent-list { display: block; }
.tip-card { margin-top: 14px; margin-bottom: 14px; border: 1px dashed color-mix(in srgb, var(--brand) 35%, var(--line)); background: var(--brand-soft); border-radius: 16px; padding: 13px; display: flex; gap: 10px; }
.tip-icon { width: 28px; height: 28px; border-radius: 9px; background: var(--card); color: var(--brand); display: grid; place-items: center; flex: none; }
.tip-card b { font-size: calc(12px * var(--fs)); display: block; margin-bottom: 3px; color: var(--brand-ink); }
.tip-card p { font-size: calc(11px * var(--fs)); line-height: 1.55; color: var(--ink-2); }

/* ---------- 7. 充电记录 ---------- */
.month-strip { display: flex; gap: 7px; overflow-x: auto; padding: 0 0 12px; scrollbar-width: none; }
.month { flex: none; min-width: 58px; text-align: center; padding: 9px 8px; border-radius: 13px; background: var(--card); border: 1px solid var(--line); transition: .18s; }
.month b { display: block; font-size: calc(15px * var(--fs)); font-weight: 800; font-family: var(--num); }
.month span { font-size: calc(10px * var(--fs)); color: var(--ink-3); }
.month.active { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 7px 16px color-mix(in srgb, var(--brand) 28%, transparent); }
.month.active span { color: rgba(255,255,255,.82); }
.month.month-all { min-width: 64px; }
.month.month-all b { font-family: inherit; font-size: calc(13.5px * var(--fs)); line-height: 1.5; }
.month.month-all span { white-space: nowrap; }
.summary-band { display: flex; background: linear-gradient(135deg, var(--brand), var(--brand-2)); border-radius: 16px; padding: 13px 6px; margin-bottom: 13px; box-shadow: 0 10px 24px color-mix(in srgb, var(--brand) 28%, transparent); border: 1px solid transparent; }
.sb-item { flex: 1; text-align: center; border-right: 1px solid rgba(255,255,255,.24); }
.sb-item:last-child { border: 0; }
.sb-item span { display: block; font-size: calc(10.5px * var(--fs)); color: rgba(255,255,255,.82); margin-bottom: 5px; }
.sb-item b { font-family: var(--num); font-size: calc(17px * var(--fs)); font-weight: 780; color: #fff; }
.sb-item b i { font-size: calc(10px * var(--fs)); font-style: normal; color: rgba(255,255,255,.82); margin-left: 2px; font-weight: 600; }

.search-box { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; margin-bottom: 12px; }
.search-box svg { width: 15px; height: 15px; color: var(--ink-3); flex: none; }
.search-input { flex: 1; border: 0; outline: 0; background: none; font-size: calc(12.5px * var(--fs)); min-width: 0; }
.search-input::placeholder { color: var(--ink-3); }

.date-group { margin-bottom: 16px; }
.date-label { display: flex; justify-content: space-between; align-items: baseline; font-size: calc(11.5px * var(--fs)); font-weight: 700; color: var(--ink-2); padding: 0 3px 8px; }
.date-label span { font-size: calc(10.5px * var(--fs)); font-weight: 500; color: var(--ink-3); }
.rec-item {
  display: flex; align-items: center; gap: 11px; padding: 13px; background: var(--card);
  border: 1px solid var(--line-2); border-radius: 15px; margin-bottom: 8px;
  box-shadow: var(--shadow); transition: .18s; cursor: pointer;
}
.rec-item:hover { border-color: var(--brand); transform: translateY(-1px); }
.rec-item:active { transform: scale(.985); }
.rec-item.featured { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); background: linear-gradient(135deg, var(--brand-soft), var(--card) 72%); box-shadow: 0 8px 18px color-mix(in srgb, var(--brand) 14%, transparent); }
.rec-latest { font-style: normal; flex: none; background: var(--brand); color: #fff; border-radius: 6px; padding: 2px 5px; font-size: calc(9.5px * var(--fs)); font-weight: 700; white-space: nowrap; }
.rec-title .rec-latest + span { overflow: hidden; text-overflow: ellipsis; }
.rec-icon { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.rec-icon svg { width: 18px; height: 18px; }
.ico-home { background: #E3F7EF; color: #067356; }
.ico-fast { background: #FFF0E4; color: #C2640F; }
.ico-slow { background: #E9F0FE; color: #2C63C9; }
[data-theme="dark"] .ico-home { background:#173A2C; color:#6FDCB0; }
[data-theme="dark"] .ico-fast { background:#3B2A18; color:#F5B475; }
[data-theme="dark"] .ico-slow { background:#1B2C49; color:#95B8FF; }
.rec-main { flex: 1; min-width: 0; }
.rec-title { font-size: calc(12.5px * var(--fs)); font-weight: 700; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-title span:first-child { overflow: hidden; text-overflow: ellipsis; }
.rec-sub { font-size: calc(10.5px * var(--fs)); color: var(--ink-3); margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-right { text-align: right; flex: none; }
.rec-amount { font-size: calc(15px * var(--fs)); font-weight: 780; }
.rec-soc { font-size: calc(10px * var(--fs)); color: var(--ink-3); margin-top: 5px; }

/* ---------- 8. 充电分析 ---------- */
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.kpi { background: linear-gradient(145deg, var(--brand), var(--brand-2)); border-radius: 16px; padding: 13px; box-shadow: 0 10px 22px color-mix(in srgb, var(--brand) 24%, transparent); border: 1px solid transparent; color: #fff; }
.kpi-label { font-size: calc(10.5px * var(--fs)); color: rgba(255,255,255,.82); margin-bottom: 7px; }
.kpi-value { font-size: calc(23px * var(--fs)); font-weight: 800; line-height: 1; color: #fff; }
.kpi-value.compact { font-size: calc(19px * var(--fs)); letter-spacing: -.3px; }
.kpi-value i { font-size: calc(10.5px * var(--fs)); font-style: normal; font-weight: 600; color: rgba(255,255,255,.82); margin-left: 3px; }
.kpi-delta { font-size: calc(10px * var(--fs)); margin-top: 7px; color: rgba(255,255,255,.78); }
.donut-layout { display: flex; align-items: center; gap: 12px; }
.donut-layout > div:first-child { width: 132px; flex: none; }
.donut-legend { flex: 1; min-width: 0; }
.dl-item { margin-bottom: 10px; }
.dl-item:last-child { margin-bottom: 0; }
.dl-top { display: flex; justify-content: space-between; font-size: calc(11px * var(--fs)); margin-bottom: 5px; }
.dl-top b { font-family: var(--num); font-weight: 750; }
.dl-bar { height: 6px; border-radius: 6px; background: var(--line-2); overflow: hidden; }
.dl-fill { height: 100%; border-radius: 6px; }

.rank-item { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; }
.rank-item:last-child { margin-bottom: 0; }
.rank-num { width: 20px; height: 20px; border-radius: 7px; background: var(--card-2); color: var(--ink-3); font-size: calc(10px * var(--fs)); font-weight: 800; display: grid; place-items: center; flex: none; }
.rank-num.top { background: var(--brand-soft); color: var(--brand-ink); }
.rank-body { flex: 1; min-width: 0; }
.rank-name { font-size: calc(11.5px * var(--fs)); font-weight: 650; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 6px; border-radius: 6px; background: var(--line-2); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--brand-2), var(--brand)); }
.rank-val { font-family: var(--num); font-size: calc(11.5px * var(--fs)); font-weight: 750; flex: none; }

.vs-val { font-family: var(--num); font-size: calc(12px * var(--fs)); font-weight: 750; margin-bottom: 5px; }
.insight-list li { display: flex; gap: 9px; font-size: calc(11.5px * var(--fs)); line-height: 1.6; color: var(--ink-2); padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.insight-list li:last-child { border: 0; padding-bottom: 0; }
.insight-list li:first-child { padding-top: 0; }
.insight-list em { font-style: normal; flex: none; width: 18px; height: 18px; border-radius: 7px; background: var(--brand-soft); color: var(--brand-ink); font-size: calc(10px * var(--fs)); font-weight: 800; display: grid; place-items: center; margin-top: 1px; }

/* ---------- 9. 设置 ---------- */
.profile-card { display: flex; align-items: center; gap: 12px; background: linear-gradient(120deg, var(--card), var(--brand-soft)); border-radius: var(--radius); padding: 16px; margin-bottom: 20px; border: 1px solid var(--line-2); }
.profile-avatar { width: 50px; height: 50px; border-radius: 16px; background: linear-gradient(140deg, var(--brand), var(--brand-2)); color: #fff; display: grid; place-items: center; flex: none; box-shadow: 0 8px 18px color-mix(in srgb, var(--brand) 28%, transparent); }
.profile-avatar svg { width: 26px; height: 26px; }
.profile-info { flex: 1; min-width: 0; }
.profile-info b { font-size: calc(14px * var(--fs)); display: block; margin-bottom: 3px; }
.profile-info span { font-size: calc(10.5px * var(--fs)); color: var(--ink-3); }
.group-title { font-size: calc(11px * var(--fs)); font-weight: 750; color: var(--ink-3); letter-spacing: .06em; margin: 20px 4px 9px; }
.settings-group { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line-2); overflow: hidden; margin-bottom: 6px; }
.setting-row { display: flex; align-items: center; gap: 11px; padding: 13px 14px; border-bottom: 1px solid var(--line-2); min-height: 54px; transition: .16s; }
.setting-row:last-child { border-bottom: 0; }
.setting-row.clickable { cursor: pointer; }
.setting-row.clickable:hover { background: var(--card-2); }
.setting-icon { width: 30px; height: 30px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; flex: none; }
.setting-icon svg { width: 16px; height: 16px; }
.setting-icon.danger { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.setting-text { flex: 1; min-width: 0; }
.setting-label { font-size: calc(12.5px * var(--fs)); font-weight: 650; }
.setting-desc { font-size: calc(10.5px * var(--fs)); color: var(--ink-3); margin-top: 3px; line-height: 1.4; }
.setting-right { display: flex; align-items: center; gap: 8px; flex: none; font-size: calc(11.5px * var(--fs)); color: var(--ink-3); }
.chevron { width: 15px; height: 15px; color: var(--ink-3); }
.swatch-row { display: flex; gap: 9px; }
.swatch { width: 26px; height: 26px; border-radius: 9px; border: 2px solid transparent; transition: .18s; position: relative; }
.swatch.active { border-color: var(--ink); transform: scale(1.06); }
.swatch.active::after { content: ""; position: absolute; inset: 0; border-radius: 6px; border: 2px solid var(--card); }
.about-card { text-align: center; padding: 20px 12px 8px; }
.about-logo { width: 40px; height: 40px; border-radius: 13px; background: linear-gradient(140deg, var(--brand), var(--brand-2)); color: #fff; display: grid; place-items: center; margin: 0 auto 10px; }
.about-card b { font-size: calc(12.5px * var(--fs)); }
.about-card p { font-size: calc(10.5px * var(--fs)); color: var(--ink-3); line-height: 1.65; margin-top: 6px; }
.app-footer { text-align: center; font-size: calc(10px * var(--fs)); color: var(--ink-3); padding: 18px 0 6px; letter-spacing: .05em; }

/* ---------- 10. 表单 / 抽屉 / 详情 ---------- */
.overlay { position: absolute; z-index: 55; inset: 0; background: rgba(6, 22, 18, .44); opacity: 0; transition: opacity .26s; backdrop-filter: blur(2px); }
.overlay.show { opacity: 1; }
.sheet {
  position: absolute; z-index: 60; left: 0; right: 0; bottom: 0; max-height: 90%;
  width: min(100%, var(--shell-max)); margin: 0 auto;
  background: var(--card); border-radius: 24px 24px 0 0; display: flex; flex-direction: column;
  transform: translateY(103%); transition: transform .34s cubic-bezier(.2,.85,.25,1);
  box-shadow: 0 -14px 44px rgba(0,0,0,.16);
}
.sheet.show { transform: translateY(0); }
.sheet-handle { width: 38px; height: 4px; border-radius: 4px; background: var(--line); margin: 10px auto 2px; flex: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 18px 12px; border-bottom: 1px solid var(--line-2); flex: none; }
.sheet-head h2 { font-size: calc(16px * var(--fs)); font-weight: 800; }
.sheet-body { overflow-y: auto; padding: 16px 18px 28px; }
.form-section { margin-bottom: 18px; }
.form-section-title { font-size: calc(10.5px * var(--fs)); font-weight: 750; color: var(--ink-3); letter-spacing: .05em; margin-bottom: 10px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: block; }
.field-label { font-size: calc(10.5px * var(--fs)); color: var(--ink-2); font-weight: 650; margin-bottom: 6px; display: flex; justify-content: space-between; align-items: center; }
.field-hint { font-size: calc(9.5px * var(--fs)); color: var(--ink-3); font-weight: 500; }
.input, .select, .textarea {
  width: 100%; background: var(--card-2); border: 1px solid var(--line); border-radius: 11px;
  padding: 10px 11px; font-size: calc(12.5px * var(--fs)); outline: 0; transition: .18s; font-family: var(--num);
}
.textarea { font-family: var(--font); resize: vertical; min-height: 60px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); background: var(--card); box-shadow: 0 0 0 3px var(--brand-soft); }
.input[type="date"] { font-size: calc(12.5px * var(--fs)); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 26px; font-family: var(--font); }
.type-picker { display: flex; gap: 7px; }
.type-opt { flex: 1; text-align: center; font-size: calc(11px * var(--fs)); font-weight: 650; padding: 10px 2px; border-radius: 11px; background: var(--card-2); border: 1px solid var(--line); color: var(--ink-2); transition: .18s; }
.type-opt.active { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-ink); font-weight: 750; }
.meter-tip { margin-top: 9px; font-size: calc(10px * var(--fs)); color: var(--brand-ink); background: var(--brand-soft); border-radius: 10px; padding: 8px 10px; line-height: 1.55; min-height: 16px; }
.sheet-actions { display: flex; gap: 10px; margin-top: 4px; }
.sheet-actions .btn { flex: 1; }

.detail-hero { text-align: center; padding: 8px 0 18px; }
.detail-amount { font-size: calc(34px * var(--fs)); font-weight: 800; }
.detail-amount small { font-size: calc(12px * var(--fs)); font-weight: 600; color: var(--ink-3); display: block; margin-top: 4px; font-family: var(--font); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line-2); border: 1px solid var(--line-2); border-radius: 14px; overflow: hidden; margin-bottom: 14px; }
.detail-item { background: var(--card-2); padding: 11px 12px; }
.detail-item span { font-size: calc(10px * var(--fs)); color: var(--ink-3); display: block; margin-bottom: 4px; }
.detail-item b { font-family: var(--num); font-size: calc(14px * var(--fs)); font-weight: 750; }
.meter-detail { background: var(--card-2); border: 1px solid var(--line-2); border-radius: 14px; padding: 6px 12px; margin-bottom: 14px; }
.meter-detail-title { display: flex; align-items: center; gap: 6px; font-size: calc(10.5px * var(--fs)); font-weight: 750; color: var(--brand-ink); padding: 8px 0 4px; }
.meter-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line-2); }
.meter-row:first-of-type { border-top: 0; }
.meter-row > span { font-size: calc(11px * var(--fs)); color: var(--ink-2); }
.meter-row > span small { display: block; font-size: calc(9px * var(--fs)); color: var(--ink-3); margin-top: 2px; }
.meter-row > b { font-family: var(--num); font-size: calc(13px * var(--fs)); font-weight: 750; white-space: nowrap; }
.meter-row.accent > b, .meter-row.accent > span { color: var(--brand-ink); }
.detail-note { background: var(--card-2); border-radius: 12px; padding: 11px 12px; font-size: calc(11.5px * var(--fs)); color: var(--ink-2); line-height: 1.6; margin-bottom: 16px; }

.toast {
  position: absolute; z-index: 80; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translate(-50%, 12px);
  background: rgba(16,38,36,.92); color: #fff; font-size: calc(11.5px * var(--fs)); font-weight: 600;
  padding: 10px 16px; border-radius: 12px; opacity: 0; pointer-events: none; transition: .25s;
  box-shadow: 0 8px 22px rgba(0,0,0,.2); white-space: nowrap; max-width: 90%;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* SVG 图表 */
.ch-grid { stroke: var(--line); stroke-width: 1; }
.ch-axis { fill: var(--ink-3); font-size: calc(8.5px * var(--fs)); font-family: var(--num); }
.ch-month { font-size: calc(9.5px * var(--fs)); font-weight: 600; }
.ch-line { fill: none; stroke: var(--brand); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ch-line-2 { fill: none; stroke: var(--fuel); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 4 4; }
.ch-area { fill: url(#ddArea); }
.ch-dot { fill: var(--card); stroke: var(--brand); stroke-width: 2; }
.ch-bar { fill: var(--brand); }
.ch-bar-2 { fill: var(--brand-2); }
.ch-bar-fuel { fill: var(--fuel); }
.ch-target { stroke: var(--warn); stroke-width: 1.2; stroke-dasharray: 4 4; }
.ch-val { fill: var(--ink-2); font-size: calc(8px * var(--fs)); font-weight: 700; font-family: var(--num); }
.ch-center { fill: var(--ink); font-size: calc(19px * var(--fs)); font-weight: 800; font-family: var(--num); }
.ch-center-sub { fill: var(--ink-3); font-size: calc(8px * var(--fs)); }

/* ---------- 10b. v3 新增组件：时间 / 区间 / 海报 / 电价 / 站点 ---------- */
.rec-meta { font-size: calc(10px * var(--fs)); color: var(--ink-3); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.time-picker { display: flex; align-items: center; gap: 8px; }
.time-picker .select { flex: 1; min-width: 0; text-align: center; text-align-last: center; font-family: var(--num); font-size: calc(13px * var(--fs)); }
.time-picker > b { font-size: calc(16px * var(--fs)); color: var(--ink-3); flex: none; }
.time-picker-tag { font-size: calc(10px * var(--fs)); color: var(--ink-3); white-space: nowrap; flex: none; }

.seg5 .seg { font-size: calc(11px * var(--fs)); padding: 8px 0; }
.period-selector { margin-bottom: 14px; }
.analysis-scope { display: flex; align-items: center; gap: 7px; margin: -4px 0 13px; padding: 9px 11px; border-radius: 11px; background: var(--brand-soft); color: var(--brand-ink); font-size: calc(11px * var(--fs)); line-height: 1.5; }
.analysis-scope svg { flex: none; }
.analysis-scope b { font-weight: 750; }
[data-theme="dark"] .analysis-scope { background: color-mix(in srgb, var(--brand) 16%, var(--card)); }
.period-row { display: flex; align-items: flex-end; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 13px; padding: 11px 12px; margin: 10px 0 0; }
.period-row label { flex: 1; min-width: 0; }
.period-row label span { display: block; font-size: calc(10px * var(--fs)); color: var(--ink-3); margin-bottom: 5px; }
.period-row input { width: 100%; border: 0; background: var(--card-2); border-radius: 9px; padding: 8px 7px; font-size: calc(11px * var(--fs)); font-family: var(--num); color: var(--ink); outline: 0; }
.btn-mini { padding: 9px 12px; font-size: calc(11.5px * var(--fs)); flex: none; }

.month-summary { font-size: calc(12.5px * var(--fs)); font-weight: 700; line-height: 1.6; color: var(--ink); background: var(--card-2); border: 1px solid var(--line-2); border-radius: 13px; padding: 11px 13px; margin-bottom: 11px; }
.month-metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.month-metric { background: var(--card-2); border: 1px solid var(--line-2); border-left: 3px solid var(--brand); border-radius: 12px; padding: 10px 11px; min-width: 0; }
.month-metric span { display: block; font-size: calc(10.5px * var(--fs)); color: var(--ink-3); margin-bottom: 6px; }
.month-metric b { display: block; font-family: var(--num); font-size: calc(19px * var(--fs)); font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.mini-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.mini-kpis > div { background: var(--card-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 8px; text-align: center; }
.mini-kpis span { display: block; font-size: calc(9.5px * var(--fs)); color: var(--ink-3); margin-bottom: 5px; line-height: 1.3; overflow-wrap: anywhere; }
.mini-kpis b { font-family: var(--num); font-size: calc(15px * var(--fs)); font-weight: 780; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.src-badge { flex: none; background: var(--brand-soft); color: var(--brand-ink); border-radius: 8px; padding: 5px 8px; font-size: calc(9.5px * var(--fs)); font-weight: 700; white-space: nowrap; }
.meter-bars { display: flex; flex-direction: column; gap: 13px; }
.meter-bar .mb-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.meter-bar .mb-head span { font-size: calc(11px * var(--fs)); color: var(--ink-2); font-weight: 650; }
.meter-bar .mb-head span small { display: block; font-size: calc(9px * var(--fs)); color: var(--ink-3); font-weight: 500; margin-top: 2px; }
.meter-bar .mb-head b { font-family: var(--num); font-size: calc(13px * var(--fs)); font-weight: 750; white-space: nowrap; }
.mb-track { height: 9px; border-radius: 6px; background: var(--line-2); overflow: hidden; }
.mb-track i { display: block; height: 100%; border-radius: 6px; }
.chart-empty { text-align: center; padding: 42px 10px; font-size: calc(11.5px * var(--fs)); color: var(--ink-3); }

/* 电价参考卡：竖排列表，每时段一行，价格右对齐不换行 */
.price-ref { display: flex; flex-direction: column; gap: 7px; }
.price-row { display: flex; align-items: center; gap: 10px; padding: 9px 11px; background: var(--card-2); border-radius: 12px; border-left: 3px solid var(--brand); min-width: 0; }
.price-row.seg-1 { border-left-color: var(--fuel); }
.price-row.seg-2 { border-left-color: #7FB2F0; }
.price-row.seg-3 { border-left-color: #A98BE8; }
.price-row.seg-4 { border-left-color: #F5B96B; }
.price-row.flat { border-left-color: var(--ink-3); }
.pr-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--brand); }
.price-row.seg-1 .pr-dot { background: var(--fuel); }
.price-row.seg-2 .pr-dot { background: #7FB2F0; }
.price-row.seg-3 .pr-dot { background: #A98BE8; }
.price-row.seg-4 .pr-dot { background: #F5B96B; }
.price-row.flat .pr-dot { background: var(--ink-3); }
.pr-main { flex: 1; min-width: 0; }
.pr-name { display: flex; align-items: center; gap: 6px; font-size: calc(11.5px * var(--fs)); font-weight: 750; color: var(--ink); line-height: 1.3; }
.pr-tag { font-style: normal; font-weight: 600; font-size: calc(8.5px * var(--fs)); color: var(--brand-ink); background: var(--brand-soft); border-radius: 5px; padding: 1px 5px; white-space: nowrap; }
.pr-time { display: block; font-size: calc(9.5px * var(--fs)); color: var(--ink-3); margin-top: 3px; font-family: var(--num); line-height: 1.5; overflow-wrap: anywhere; }
.pr-price { flex: none; text-align: right; white-space: nowrap; }
.pr-price b { font-family: var(--num); font-size: calc(14px * var(--fs)); font-weight: 800; color: var(--ink); }
.pr-price i { font-style: normal; font-size: calc(8.5px * var(--fs)); color: var(--ink-3); margin-left: 1px; }
.price-quick { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.price-quick > span { font-size: calc(10.5px * var(--fs)); color: var(--ink-3); margin-right: 2px; }
.price-quick .chip { font-size: calc(10.5px * var(--fs)); padding: 6px 10px; }
.price-card { background: var(--brand-soft); border-radius: 14px; padding: 14px; margin-bottom: 16px; }
.price-card-title { display: flex; align-items: center; gap: 6px; font-size: calc(12px * var(--fs)); font-weight: 750; color: var(--brand-ink); margin-bottom: 11px; }
.price-card-row { display: flex; justify-content: space-between; gap: 8px; font-size: calc(11.5px * var(--fs)); color: var(--ink-2); padding: 6px 0; border-bottom: 1px solid color-mix(in srgb, var(--brand) 14%, transparent); }
.price-card-row span { min-width: 0; overflow-wrap: anywhere; }
.price-card-row b { font-family: var(--num); color: var(--brand-ink); flex: none; white-space: nowrap; }
.price-card p { font-size: calc(10px * var(--fs)); color: var(--ink-2); line-height: 1.65; margin-top: 10px; overflow-wrap: anywhere; }
/* 电价分段编辑器 */
.band-editor { display: flex; flex-direction: column; gap: 12px; }
.band-card { background: var(--card-2); border: 1px solid var(--line-2); border-left: 3px solid var(--brand); border-radius: 13px; padding: 12px; }
.band-card.seg-1 { border-left-color: var(--fuel); }
.band-card.seg-2 { border-left-color: #7FB2F0; }
.band-card.seg-3 { border-left-color: #A98BE8; }
.band-card.seg-4 { border-left-color: #F5B96B; }
.band-head { display: flex; align-items: center; gap: 8px; }
.seg-badge { width: 20px; height: 20px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-family: var(--num); font-size: calc(10px * var(--fs)); font-weight: 800; color: #fff; background: var(--brand); flex: none; }
.band-card.seg-1 .seg-badge { background: var(--fuel); }
.band-card.seg-2 .seg-badge { background: #7FB2F0; }
.band-card.seg-3 .seg-badge { background: #A98BE8; }
.band-card.seg-4 .seg-badge { background: #F5B96B; }
.band-name { flex: 1; min-width: 0; font-weight: 700; }
.band-price-wrap { flex: none; display: inline-flex; align-items: center; gap: 2px; font-family: var(--num); font-size: calc(11px * var(--fs)); color: var(--ink-2); white-space: nowrap; }
.band-price-wrap .input { width: 108px; text-align: right; font-family: var(--num); }
.band-del { flex: none; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: color-mix(in srgb, var(--danger, #E05252) 12%, transparent); color: var(--danger, #E05252); cursor: pointer; }
.band-del:active { transform: scale(0.94); }
.band-ranges { display: flex; flex-direction: column; gap: 7px; margin-top: 10px; }
.range-row { display: flex; align-items: center; gap: 6px; }
.range-row .input { flex: 1; min-width: 0; text-align: center; font-family: var(--num); }
.range-sep { flex: none; font-size: calc(10.5px * var(--fs)); color: var(--ink-3); }
.range-del { flex: none; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 7px; background: color-mix(in srgb, var(--danger, #E05252) 10%, transparent); color: var(--danger, #E05252); cursor: pointer; }
.range-del:active { transform: scale(0.94); }
.range-add { margin-top: 9px; display: inline-flex; align-items: center; gap: 4px; border: 1px dashed var(--line-2); background: transparent; color: var(--brand-ink); border-radius: 9px; padding: 6px 10px; font-size: calc(10.5px * var(--fs)); cursor: pointer; }
.range-add:active { transform: scale(0.97); }

.station-item { display: flex; align-items: center; gap: 11px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.station-item:last-child { border-bottom: 0; }
.station-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.station-text { flex: 1; min-width: 0; }
.station-text b { display: block; font-size: calc(12.5px * var(--fs)); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.station-text span { font-size: calc(10px * var(--fs)); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; margin-top: 2px; }
.rank-price { font-size: calc(9.5px * var(--fs)); color: var(--ink-3); margin-top: 4px; }

/* ---------- 11. 响应式 ---------- */
@media (min-width: 820px) {
  .kpi-grid { grid-template-columns: repeat(4, 1fr); }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .app-main { padding-left: 32px; padding-right: 32px; }
  .app-header { padding-left: 32px; padding-right: 32px; }
  .form-grid, .detail-grid { max-width: 700px; margin-left: auto; margin-right: auto; }
  .month-metrics { grid-template-columns: repeat(3, 1fr); }
  .donut-layout { gap: 24px; }
}
/* 宽屏有足够留白时，把悬浮按钮移到内容列外侧，避免遮挡卡片数值 */
@media (min-width: 1060px) {
  .fab { right: calc((100% - var(--shell-max)) / 2 - 66px); }
}
@media (max-width: 640px) {
  /* 添加到主屏幕后，避开刘海与底部手势条 */
  .app-header { padding: calc(12px + env(safe-area-inset-top)) 18px 8px; }
  .app-main { padding-left: 16px; padding-right: 16px; padding-bottom: calc(132px + env(safe-area-inset-bottom)); }
  .kpi-grid, .stat-grid { grid-template-columns: 1fr 1fr; }
  .tabbar { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
  .fab { right: 18px; bottom: calc(86px + env(safe-area-inset-bottom)); }
  .sheet { max-height: calc(92% - env(safe-area-inset-top)); }
  .sheet-body { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
