/* ============================================================
   智能充换电 · 移动工作台样式（方案 E1/E2）
   与主站明亮主题同源：薄荷白 #f4faf7 / 深松绿 #0e2f28 / 青绿 #00a878
   ============================================================ */

:root {
  --bg: #f4faf7;
  --surface: #ffffff;
  --ink: #12332c;
  --ink-2: #5a7268;
  --brand: #00a878;
  --brand-deep: #0e2f28;
  --brand-soft: #e2f5ee;
  --danger: #e05252;
  --warn: #e8a13c;
  --line: #e3ede8;
  --radius: 14px;
  --tabbar-h: 56px;
  --topbar-h: 52px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; cursor: pointer; border: 0; background: none; }
input, select, textarea { font: inherit; }

/* ---------------- 顶栏 ---------------- */
.app-topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  height: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 10px 0 6px;
  display: flex; align-items: center; gap: 4px;
  background: rgba(244, 250, 247, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
/* 标题吃掉中间剩余宽度，左右两组按钮各自贴边 */
.app-topbar h1 {
  flex: 1; min-width: 0;
  font-size: 17px; font-weight: 700; color: var(--brand-deep);
  text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-left: 2px;
}
/* 返回按钮：44×44 命中区（移动端最小可点尺寸），图标 20px 视觉不显笨重 */
.topbar-back {
  flex: none;
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 12px; color: var(--brand-deep);
  transition: background .16s ease, transform .16s ease;
}
.topbar-back:hover { background: var(--brand-soft); }
.topbar-back:active { transform: scale(.92); background: var(--brand-soft); }
.topbar-back svg { display: block; }
.topbar-back[hidden] { display: none !important; }

.topbar-right { flex: none; display: flex; align-items: center; gap: 6px; }
.topbar-site {
  display: inline-flex; align-items: center; height: 30px; padding: 0 11px;
  border-radius: 15px; border: 1px solid var(--line);
  background: var(--surface); color: var(--brand-deep);
  font-size: 12px; font-weight: 600; text-decoration: none;
  transition: border-color .16s ease, color .16s ease, background .16s ease;
}
.topbar-site:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.topbar-site[hidden] { display: none !important; }

.topbar-avatar {
  min-width: 34px; height: 34px; padding: 0 12px;
  border-radius: 17px; background: var(--brand-soft);
  color: var(--brand); font-size: 12px; font-weight: 600;
  max-width: 118px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 窄屏（≤360px，如 iPhone SE）收紧两侧按钮，保住标题可读宽度 */
@media (max-width: 360px) {
  .app-topbar { padding-left: 2px; padding-right: 6px; }
  .topbar-back { width: 36px; height: 36px; }
  .topbar-site { padding: 0 8px; font-size: 11px; }
  .topbar-avatar { max-width: 76px; padding: 0 9px; }
  .app-topbar h1 { font-size: 16px; }
}

/* ---------------- 主视图 ---------------- */
.app-view {
  padding: calc(var(--topbar-h) + env(safe-area-inset-top, 0px) + 12px) 14px
           calc(var(--tabbar-h) + var(--safe-b) + 20px);
  min-height: 100%;
}

/* ---------------- 底栏 TabBar（E1：56px + safe-area） ---------------- */
.app-tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 40;
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.tab-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: var(--ink-2); font-size: 11px;
}
.tab-item .tab-ico { font-size: 21px; line-height: 1; }
.tab-item.active { color: var(--brand); font-weight: 700; }
.tab-item .badge {
  position: absolute; transform: translate(16px, -6px);
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--danger); color: #fff; font-size: 10px; line-height: 16px;
}
/* 底栏消息未读小红点（.tab-dot 挂在 .tab-ico 里，跟着图标右上角） */
.tab-item .tab-ico { position: relative; }
.tab-item .tab-dot {
  position: absolute; top: -3px; left: 50%; transform: translateX(4px);
  min-width: 15px; height: 15px; padding: 0 4px; border-radius: 8px;
  background: var(--danger, #e5484d); color: #fff; font-size: 10px;
  line-height: 15px; text-align: center; font-weight: 700;
  box-shadow: 0 0 0 2px var(--surface, #fff);
}
.tab-item .tab-dot[hidden] { display: none !important; }

/* ---------------- 通用组件 ---------------- */
.card {
  background: var(--surface); border-radius: var(--radius);
  padding: 14px; margin-bottom: 12px;
  border: 1px solid var(--line);
}
.card h3 { font-size: 15px; color: var(--brand-deep); margin-bottom: 6px; }
.muted { color: var(--ink-2); font-size: 12.5px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 42px; padding: 0 18px; border-radius: 21px;
  background: var(--brand); color: #fff; font-size: 15px; font-weight: 600;
}
.btn:disabled { opacity: .45; }
.btn.ghost { background: var(--brand-soft); color: var(--brand); }
.btn.block { width: 100%; }
.btn.small { min-height: 32px; padding: 0 12px; font-size: 13px; border-radius: 16px; }
.btn.danger { background: var(--danger); }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 46px; padding: 0 14px;
  border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--ink); outline: none;
}
.field input:focus { border-color: var(--brand); }
.field .err { color: var(--danger); font-size: 12px; margin-top: 4px; min-height: 16px; }
.field input.invalid { border-color: var(--danger); }

.tag {
  display: inline-block; padding: 2px 10px; border-radius: 10px;
  background: var(--brand-soft); color: var(--brand); font-size: 12px;
}
.tag.gray { background: #eef2f0; color: var(--ink-2); }
.tag.warn { background: #fdf3e3; color: var(--warn); }

/* ---------------- 门店列表项 ---------------- */
.store-item { display: flex; gap: 12px; align-items: flex-start; }
.store-thumb {
  width: 72px; height: 72px; border-radius: 12px; flex: none;
  background: linear-gradient(135deg, #bfe9db, #00a878);
  object-fit: cover;
}
.store-name { font-weight: 700; font-size: 15px; color: var(--brand-deep); }
.store-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.score-pill {
  color: var(--brand); font-weight: 800; font-size: 13px;
  background: var(--brand-soft); border-radius: 10px; padding: 1px 8px;
}

/* ---------------- 状态条 ---------------- */
.status-strip {
  display: flex; gap: 4px; margin: 10px 0;
}
.status-strip span {
  flex: 1; text-align: center; font-size: 11px; padding: 4px 0;
  border-radius: 8px; background: #eef2f0; color: var(--ink-2);
}
.status-strip span.on { background: var(--brand); color: #fff; font-weight: 700; }

/* ---------------- 充电进度（服务端算、前端只画） ----------------
   进度条只用宽度表达比例，数字全部来自 /orders/{id}/session；
   这样换设备、关页面再回来，看到的都是同一个事实。 */
.chg-live { margin: 8px 0 2px; }
.chg-bar {
  height: 8px; border-radius: 99px; background: #eef2f0; overflow: hidden;
}
.chg-bar > i {
  display: block; height: 100%; width: 0;
  border-radius: 99px; background: linear-gradient(90deg, var(--brand), #35d3a3);
  transition: width .6s ease;
}
.chg-meta { font-size: 12px; color: var(--ink-2); margin-top: 6px; }
.chg-meta b { color: var(--brand-deep); font-weight: 800; }
.chg-note { font-size: 10px; color: #8b9691; margin-top: 2px; }

/* ---------------- 金额 ---------------- */
.money { font-size: 22px; font-weight: 800; color: var(--brand-deep); }
.money small { font-size: 12px; font-weight: 500; color: var(--ink-2); }

/* ---------------- Toast / Sheet ---------------- */
.app-toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 24px);
  transform: translateX(-50%) translateY(20px);
  background: rgba(14, 47, 40, .92); color: #fff;
  padding: 10px 18px; border-radius: 20px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 60;
  max-width: 80vw;
}
.app-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.sheet-mask { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 50; }
.app-sheet {
  position: fixed; inset: auto 0 0 0; z-index: 51;
  background: var(--surface); border-radius: 20px 20px 0 0;
  padding: 18px 16px calc(18px + var(--safe-b));
  max-height: 82vh; overflow-y: auto;
}
.sheet-title { font-size: 16px; font-weight: 700; color: var(--brand-deep); margin-bottom: 12px; }

/* ---------------- 登录页 ---------------- */
.login-hero { text-align: center; padding: 26px 0 18px; }
.login-hero .logo {
  width: 64px; height: 64px; margin: 0 auto 10px; border-radius: 18px;
  background: linear-gradient(135deg, var(--brand), #026d4f);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; color: #fff;
}
.login-hero h2 { color: var(--brand-deep); font-size: 20px; }
.code-row { display: flex; gap: 10px; }
.code-row input { flex: 1; min-width: 0; }
.code-row .btn { flex: none; }

/* ---------------- 空态 ---------------- */
.empty { text-align: center; color: var(--ink-2); padding: 40px 0; font-size: 13.5px; }
.empty .ico { font-size: 40px; display: block; margin-bottom: 8px; }

/* 桩状态点 */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.dot.s1 { background: var(--brand); }
.dot.s2 { background: var(--warn); }
.dot.s0, .dot.s3 { background: #c2ccc7; }

@media (min-width: 700px) {
  /* 注意：position:fixed 元素上的 margin:auto 不居中（auto 会被解析为 0）。
     必须用左右留白 + max-width 居中，否则平板/桌面端顶栏底栏会贴在左边、
     与居中的内容错位——这正是「多端展示不一致」的老根因。 */
  :root { --app-w: 560px; }

  .app-view {
    max-width: var(--app-w);
    margin: 0 auto;
  }
  .app-topbar,
  .app-tabbar {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--app-w);
  }
  .app-topbar {
    border-radius: 0 0 14px 14px;
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
  }
  .app-tabbar {
    bottom: 12px;
    border-radius: 16px;
    border: 1px solid var(--line);
    box-shadow: 0 8px 24px rgba(14, 47, 40, .08);
  }
  /* 底栏浮起后要多留 12px，否则最后一张卡片会被压住 */
  .app-view { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 32px); }
}

/* 宽屏（≥1100px）：左右留白更多，内容仍保持阅读舒适宽度 */
@media (min-width: 1100px) {
  :root { --app-w: 600px; }
}

/* ---------------- 登录：双模式 Tab ---------------- */
.login-tabs { display: flex; background: var(--bg); border-radius: 10px; padding: 4px; margin-bottom: 16px; }
.login-tab { flex: 1; border: 0; background: none; padding: 9px 0; border-radius: 8px; font: inherit; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.login-tab.on { background: var(--surface); color: var(--brand); font-weight: 700; box-shadow: 0 1px 4px rgba(14,47,40,.08); }

/* ---------------- 登录：演示测试账号卡片 ---------------- */
.demo-accounts { border-style: dashed; border-color: var(--brand); }
.demo-title { font-weight: 700; color: var(--brand-deep); margin-bottom: 10px; }
.demo-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 9px 12px; margin-bottom: 8px; font: inherit; cursor: pointer; transition: border-color .15s, transform .15s; }
.demo-item:hover { border-color: var(--brand); transform: translateY(-1px); }
.demo-ico { font-size: 20px; }
.demo-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.demo-main strong { font-size: 13.5px; color: var(--ink); }
.demo-main .muted { font-size: 12px; }
.demo-cred { display: flex; flex-direction: column; gap: 3px; align-items: flex-end; }
.demo-cred code { font-size: 12px; background: var(--brand-soft); color: var(--brand-deep); padding: 1px 8px; border-radius: 8px; }

/* ---------------- 平台公告横幅（后台发布 → 前台展示） ---------------- */
.ann-banner { margin-bottom: 12px; display: flex; flex-direction: column; gap: 8px; }
.ann-item { display: flex; gap: 10px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 12px; padding: 10px 12px; font-size: 13px; }
.ann-item strong { color: var(--brand-deep); }
.ann-item.lv-warn { border-left-color: var(--warn); }
.ann-item.lv-important { border-left-color: var(--danger); }
.ann-tag { flex-shrink: 0; font-size: 11px; padding: 2px 8px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); height: fit-content; }
.lv-warn .ann-tag { background: #fdf3e3; color: var(--warn); }
.lv-important .ann-tag { background: #fbe9e9; color: var(--danger); }

/* ---------------- 门店下架提示 ---------------- */
.offline-strip { background: #fbe9e9; color: var(--danger); border-radius: 10px; padding: 9px 12px; font-size: 13px; margin: 8px 0 4px; }

/* ---------------- SVG 图标系统（P1-3） ---------------- */
svg.ic { width: 20px; height: 20px; flex: none; vertical-align: -4px; }
.tab-item .tab-ico svg { width: 22px; height: 22px; display: block; margin: 0 auto; }
.tab-item.active .tab-ico { color: var(--brand); }
.empty .ico svg { width: 36px; height: 36px; color: var(--ink-lo, #9db4ac); }
.ico.spin svg { animation: ic-spin 1s linear infinite; }
@keyframes ic-spin { to { transform: rotate(360deg); } }
.login-hero .logo svg { width: 30px; height: 30px; }
.demo-ico svg { width: 22px; height: 22px; vertical-align: -5px; color: var(--brand); }
.demo-title svg { width: 17px; height: 17px; vertical-align: -3px; }
.tag svg { width: 11px; height: 11px; vertical-align: -1px; }
svg.ic.big { width: 30px; height: 30px; }
.offline-strip svg { width: 14px; height: 14px; vertical-align: -2px; }
.btn svg { width: 15px; height: 15px; vertical-align: -2.5px; }

/* ---------- F05 车位网格 ---------- */
.slot-summary { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.slot-summary span { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-deep); }
.slot-summary span.warn { background: #fdf1de; color: #8a5a12; }
.slot-summary span.bad { background: #fde8e8; color: #a13333; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.slot-cell {
  border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 6px; text-align: center;
  background: var(--surface); cursor: pointer; transition: transform .12s, border-color .12s;
}
.slot-cell:active { transform: scale(.97); }
.slot-cell .no { font-weight: 600; font-size: 13px; }
.slot-cell .st { font-size: 11px; color: var(--ink-2); margin-top: 2px; line-height: 1.3; }
.slot-cell .bar { height: 3px; border-radius: 2px; margin-top: 6px; background: var(--line); }
.slot-cell.s-FREE { border-color: #b7e6d3; }
.slot-cell.s-FREE .bar { background: var(--brand); }
.slot-cell.s-BUSY .bar { background: #4a9fe0; }
.slot-cell.s-OVERSTAY .bar { background: var(--warn); }
.slot-cell.s-OCCUPIED_NO_ORDER .bar { background: var(--danger); }
.slot-cell.s-FAULT .bar { background: #b9c4c0; }
.slot-cell.s-STALE .bar { background: #c9b6e8; }
.slot-cell.s-OVERSTAY .no, .slot-cell.s-OCCUPIED_NO_ORDER .no { color: var(--danger); }
.slot-cell.s-FREE .no { color: var(--brand-deep); }

/* ---------- F13 价费明细表 ---------- */
.price-row { display: flex; align-items: baseline; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.price-row:last-child { border-bottom: none; }
.price-row .lbl { font-size: 14px; }
.price-row .lbl small { display: block; font-size: 11px; color: var(--ink-2); }
.price-row .amt { font-weight: 600; font-variant-numeric: tabular-nums; }
.notice-strip {
  display: flex; gap: 8px; align-items: flex-start; font-size: 12px; line-height: 1.5;
  background: #fdf1de; color: #7d5310; padding: 8px 10px; border-radius: 9px; margin-top: 10px;
}
.notice-strip svg { width: 14px; height: 14px; flex: none; margin-top: 2px; }

/* ---------- F14 预估 / F15 对照 ---------- */
.est-total { display: flex; align-items: baseline; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1.5px solid var(--line); }
.est-total b { font-size: 21px; color: var(--brand-deep); font-variant-numeric: tabular-nums; }
.cmp-head, .cmp-row { display: grid; grid-template-columns: 1.35fr 1fr 1fr .9fr; gap: 6px; font-size: 12px; align-items: center; }
.cmp-head { color: var(--ink-2); padding: 4px 0; border-bottom: 1px solid var(--line); }
.cmp-row { padding: 6px 0; border-bottom: 1px dashed var(--line); font-variant-numeric: tabular-nums; }
.cmp-row:last-child { border-bottom: none; }
.cmp-row.hl { background: #fdf1de; border-radius: 6px; padding-left: 6px; padding-right: 6px; }
.cmp-row .r { text-align: right; }
.cmp-row .r.pos { color: var(--danger); }
.cmp-row .r.neg { color: var(--brand); }
.cmp-reason { grid-column: 1 / -1; font-size: 11px; color: #8a5a12; margin-top: 2px; }

/* ---------- F10 预约 ---------- */
.slot-cell.s-RESERVED .bar { background: #7b61ff; }
.slot-cell.s-RESERVED .no { color: #5a45c4; }
.rsv-code {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 30px; font-weight: 700;
  letter-spacing: 5px; color: var(--brand-deep); text-align: center; padding: 12px 0 4px;
}
.rsv-count { text-align: center; font-size: 13px; color: var(--ink-2); }
.rsv-count b { font-size: 19px; color: var(--brand); font-variant-numeric: tabular-nums; }
.rsv-count.urgent b { color: var(--danger); }
.opt-row { display: flex; gap: 8px; }
.opt {
  flex: 1; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 6px;
  text-align: center; font-size: 13px; background: #fff; cursor: pointer;
}
.opt.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-deep); font-weight: 600; }

/* ---------- F37 评价 ---------- */
.dim-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.dim-stars { display: flex; gap: 4px; flex: none; }
.dim-star {
  width: 30px; height: 30px; border-radius: 8px; border: 1.5px solid var(--line);
  background: #fff; color: var(--ink-2); font-size: 13px; cursor: pointer; padding: 0;
  font-variant-numeric: tabular-nums;
}
.dim-star.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-deep); font-weight: 700; }
.dim-bars { margin: 4px 0 10px; }
.dim-bar { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); padding: 3px 0; }
.dim-bar span { width: 96px; flex: none; }
.dim-bar b { color: var(--brand-deep); font-variant-numeric: tabular-nums; width: 28px; }
.dim-bar i { flex: 1; height: 6px; border-radius: 3px; background: #eef2f0; position: relative; }
.dim-bar i::after {
  content: ''; position: absolute; inset: 0 auto 0 0; width: var(--w, 0%);
  background: var(--brand); border-radius: 3px;
}
.review-item { padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.review-item:last-child { border-bottom: none; }
.review-reply { margin-top: 6px; padding: 6px 9px; background: #f6f8f7; border-radius: 8px; font-size: 12px; color: var(--ink-2); }

/* ---------- E09 服务包 ---------- */
.addon-card { padding: 12px; }
.addon-line { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.addon-line:last-child { border-bottom: none; }
.addon-line span:first-child { flex: 1; }
.price-now { font-weight: 700; color: var(--brand-deep); }
.rsv-code-box { display: flex; align-items: center; gap: 10px; margin: 8px 0 4px; }
.rsv-code-box span { font-size: 12px; color: var(--ink-2); }
.rsv-code-box .rsv-code { font-size: 20px; letter-spacing: 3px; padding: 0; }

/* ---------- F35 聚合地图 ---------- */
.seg { display: flex; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg button { border: none; background: #fff; font-size: 12px; padding: 4px 10px; color: var(--ink-2); cursor: pointer; }
.seg button.on { background: var(--brand); color: #fff; font-weight: 600; }
.third-strip {
  display: flex; gap: 8px; margin: 8px 0 4px; padding: 9px 11px; border-radius: 10px;
  background: #fdf3e3; color: #7a5210; font-size: 12px; line-height: 1.5;
}
.third-strip svg { width: 14px; height: 14px; flex: none; margin-top: 2px; }
.card-third { border-left: 3px solid var(--warn); }
.dim { opacity: .62; }

/* ---------- F32 长途规划 ---------- */
.trip-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.trip-sum > div { background: var(--brand-soft); border-radius: 10px; padding: 8px 6px; text-align: center; }
.trip-sum b { display: block; font-size: 17px; color: var(--brand-deep); font-variant-numeric: tabular-nums; }
.trip-sum span { font-size: 10px; color: var(--ink-2); }
.trip-step { display: flex; gap: 10px; padding: 8px 0 8px 4px; position: relative; }
.trip-step::before {
  content: ''; position: absolute; left: 8px; top: 24px; bottom: -6px; width: 2px; background: var(--line);
}
.trip-step:last-child::before { display: none; }
.trip-dot { width: 10px; height: 10px; border-radius: 50%; background: #cfd8d4; margin-top: 5px; flex: none; z-index: 1; }
.trip-dot.on { background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.trip-charge { background: #f8fbfa; border-radius: 10px; padding: 10px; margin: 2px 0; }

/* ============ B 线：健康画像 / 报修 / 功率 / 收藏 / 候补 ============ */
/* E02 五维雷达（用横条代替雷达图：手机小屏横条可读性更好） */
.health-grid { display: grid; gap: 6px; margin-top: 8px; }
.health-dim { display: grid; grid-template-columns: 34px 1fr 34px; gap: 8px; align-items: center; font-size: 12px; }
.health-dim em { font-style: normal; color: var(--ink-2); }
.health-dim b { text-align: right; font-variant-numeric: tabular-nums; color: var(--brand-deep); }
.health-bar { height: 7px; border-radius: 4px; background: #eef3f1; overflow: hidden; }
.health-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #34c79a, #00996c); }
.health-note { font-size: 11px; color: var(--ink-2); margin-top: 2px; }

/* F04 可靠性 */
.rel-head { display: flex; align-items: baseline; gap: 8px; }
.rel-score { font-size: 28px; font-weight: 700; color: var(--brand-deep); font-variant-numeric: tabular-nums; }
.rel-parts { margin-top: 6px; }
.rel-part { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-2); padding: 3px 0; border-bottom: 1px dashed var(--line); }
.rel-part:last-child { border-bottom: none; }

/* F03 报修进度 */
.rp-steps { display: flex; gap: 4px; margin: 8px 0 4px; }
.rp-step { flex: 1; text-align: center; font-size: 10px; color: var(--ink-2); }
.rp-step i { display: block; height: 3px; border-radius: 2px; background: #e6ecea; margin-bottom: 4px; }
.rp-step.on i { background: var(--brand); }
.rp-step.on { color: var(--brand-deep); font-weight: 600; }

/* F18 实时功率 */
.pw-hero { display: flex; align-items: flex-end; gap: 8px; margin: 6px 0 2px; }
.pw-hero b { font-size: 34px; line-height: 1; color: var(--brand-deep); font-variant-numeric: tabular-nums; }
.pw-hero span { font-size: 12px; color: var(--ink-2); padding-bottom: 4px; }
.pw-bar { height: 9px; border-radius: 5px; background: #eef3f1; overflow: hidden; margin: 8px 0; }
.pw-bar i { display: block; height: 100%; background: linear-gradient(90deg, #3fd0a4, #00a878); }
.pw-bar.warn i { background: linear-gradient(90deg, #f5c46a, #e8a13c); }
.pw-explain { font-size: 12px; color: var(--ink-2); background: #f7faf9; border-radius: 9px; padding: 8px 10px; line-height: 1.55; }
.pw-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.pw-grid > div { background: var(--brand-soft); border-radius: 10px; padding: 8px 6px; text-align: center; }
.pw-grid b { display: block; font-size: 16px; color: var(--brand-deep); font-variant-numeric: tabular-nums; }
.pw-grid span { font-size: 10px; color: var(--ink-2); }
.pw-curve { display: flex; align-items: flex-end; gap: 2px; height: 74px; margin: 8px 0 2px; }
.pw-curve i { flex: 1; background: #cdebdf; border-radius: 2px 2px 0 0; min-height: 3px; }
.pw-curve i.knee { background: #f0b46a; }
.pw-axis { display: flex; justify-content: space-between; font-size: 10px; color: var(--ink-2); }
.code-box { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 10px 0; }
.code-box b { font-size: 30px; letter-spacing: 6px; color: var(--brand-deep); font-variant-numeric: tabular-nums; }

/* F36 收藏 / 通用列表行 */
.fav-btn { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #f2f7f5; }
.fav-btn.on { background: var(--brand-soft); color: var(--brand); }
.fav-btn svg { width: 16px; height: 16px; }
/* 收藏按钮的两种视觉状态。
   .fav-btn 同时挂在 .btn.small.ghost 上，按钮型收藏（列表/详情）走下面这组覆盖：
   未收藏 = 灰描边空心星；已收藏 = 红底浅红 + 红色实心星 + 文案「已收藏」。 */
.btn.fav-btn {
  gap: 4px; min-height: 32px; padding: 0 12px; border-radius: 16px;
  color: var(--ink-2, #5b6b64);
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.btn.fav-btn .fav-ico { width: 15px; height: 15px; transition: color .18s ease; }
.btn.fav-btn.is-faved,
.btn.fav-btn.ghost.is-faved,
.btn.fav-btn.ghost.is-faved:hover {
  color: #e5484d;                              /* 醒目红：与价格/警示同色系 */
  background: #fdecec;
  border-color: #f7c9cb;
  font-weight: 600;
}
.btn.fav-btn.is-faved .fav-ico { color: #e5484d; }
.btn.fav-btn.is-faved .fav-ico path { fill: currentColor; stroke: currentColor; }
.btn.fav-btn:hover { border-color: #cfe0d9; }
.btn.fav-btn.is-faved:hover { filter: brightness(.97); }
.link-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.link-row:last-child { border-bottom: none; }
.link-row small { display: block; color: var(--ink-2); font-size: 11px; }
.link-row .arrow { color: #b9c7c1; }

/* E04 场地方面板 / E11 企业额度 */
.quota-bar { height: 10px; border-radius: 5px; background: #eef3f1; overflow: hidden; margin: 8px 0; }
.quota-bar i { display: block; height: 100%; background: linear-gradient(90deg, #34c79a, #00a878); }
.kv-row { display: flex; justify-content: space-between; font-size: 13px; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.kv-row:last-child { border-bottom: none; }
.kv-row span { color: var(--ink-2); }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .5px; }

/* ============================================================
   即时聊天（#/chat 会话列表 + #/chat/{id} 三方同窗）
   ============================================================ */
.chat-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: var(--brand-soft, #e8f3ee); color: var(--brand, #0f8a5f);
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
/* ---------------- 聊天头像（有图用图 / 无图用首字占位） ----------------
   无头像时若只留一个灰圈，整条对话会像短信列表。占位必须带「首字」，
   并按角色着色：用户＝青绿、商家＝琥珀、平台客服＝靛蓝。 */
.chat-av {
  width: 36px; height: 36px; border-radius: 50%; flex: none; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; line-height: 1; user-select: none;
}
.chat-av.lg { width: 42px; height: 42px; font-size: 16px; }
.chat-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-av.ph { color: #fff; letter-spacing: .5px; }
.chat-av.ph.r-user     { background: linear-gradient(135deg, #16a97b, #0c7d59); }
.chat-av.ph.r-merchant { background: linear-gradient(135deg, #f0a33c, #d1781a); }
.chat-av.ph.r-support  { background: linear-gradient(135deg, #6b7cf0, #4a55c9); }
.chat-sub { font-size: 11px; margin-top: 1px; }
.chat-head-inner { display: flex; align-items: center; gap: 10px; }
.chat-head-name { font-size: 14px; font-weight: 600; }
.chat-head-sub {
  font-size: 11px; color: var(--muted, #7a8); display: flex; align-items: center;
  gap: 6px; flex-wrap: wrap; margin-top: 2px;
}
.chat-badge {
  display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px;
  background: #e5484d; color: #fff; font-size: 11px; line-height: 18px; text-align: center;
}
/* 聊天窗口：撑满「顶栏下 → 底栏上」的剩余高度，输入框贴底。
   原实现是 min-height:60vh + .chat-msgs 的 max-height:62vh —— 容器比内容高、
   消息区又被限高，输入框就被顶到页面中间，且整页还能继续下滑。 */
.chat-window {
  display: flex; flex-direction: column;
  /* --topbar-h 由顶栏变量提供；底栏高度 + 底部安全区 + 一点缝隙 */
  height: calc(100vh - var(--topbar-h) - env(safe-area-inset-top, 0px)
                - var(--tabbar-h) - var(--safe-b) - 28px);
  min-height: 420px;
}
.chat-head { padding: 10px 14px; font-size: 14px; flex: 0 0 auto; }
.chat-msgs {
  flex: 1 1 auto; min-height: 0;          /* min-height:0 是 flex 子项可滚动的关键 */
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 8px 2px; display: flex; flex-direction: column; gap: 10px;
  overscroll-behavior: contain;
}
/* 气泡行：头像 + 内容列，左右两侧镜像。改成一行的原因见 bubble() 注释。 */
.chat-row {
  display: flex; align-items: flex-start; gap: 8px; max-width: 86%;
}
.chat-row.mine { align-self: flex-end; flex-direction: row-reverse; }
.chat-row.theirs { align-self: flex-start; }
.chat-col { display: flex; flex-direction: column; min-width: 0; }
.chat-row.mine .chat-col { align-items: flex-end; }
.chat-who { font-size: 11px; color: var(--muted, #7a8); margin: 0 4px 2px; }
.chat-bubble {
  padding: 8px 12px; border-radius: 14px; font-size: 14px; line-height: 1.5;
  word-break: break-word; white-space: pre-wrap; box-shadow: 0 1px 2px rgb(0 0 0 / 5%);
}
.chat-row.mine .chat-bubble { background: var(--brand, #0f8a5f); color: #fff; border-bottom-right-radius: 4px; }
.chat-row.theirs .chat-bubble { background: #f1f4f3; color: #1c2321; border-bottom-left-radius: 4px; }
.chat-meta { display: block; font-size: 10px; opacity: .75; margin-top: 2px; text-align: right; }
.chat-st.sent::before { content: '✓ '; }
.chat-st.read::before { content: '✓✓ '; color: #7ce0b4; }
/* 输入区：不参与收缩，永远贴在窗口（也就是底栏上方）的最底端 */
.chat-input {
  display: flex; gap: 8px; padding: 8px; align-items: center;
  flex: 0 0 auto; position: sticky; bottom: 0;
  background: var(--surface, #fff); border-top: 1px solid var(--line, #e6eeea);
  border-radius: 0 0 12px 12px;
}
.chat-input input { flex: 1; border: 1px solid #dde5e2; border-radius: 18px; padding: 9px 14px; font-size: 14px; outline: none; }
.chat-input input:focus { border-color: var(--brand, #0f8a5f); }
/* 矮屏（横屏手机 / 小窗口）：进一步压缩，保证消息区还有可读高度 */
@media (max-height: 620px) {
  .chat-window { height: calc(100vh - var(--topbar-h) - var(--tabbar-h) - var(--safe-b) - 12px); min-height: 300px; }
  .chat-head { padding: 6px 12px; font-size: 13px; }
}

/* ---------------- 我的页分组行（profile-row） ---------------- */
.profile-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 14px; background: none; border: none; border-top: 1px solid var(--line);
  text-decoration: none; color: inherit; font-size: 14px; text-align: left; cursor: pointer;
}
.profile-row:hover { background: #f6faf8; }
.profile-row .row-ico { color: var(--brand, #0f8a5f); display: flex; }
.profile-row .grow { display: flex; flex-direction: column; gap: 1px; }
.profile-row .grow b { font-weight: 600; }
.profile-row .muted { font-size: 11px; }
.profile-row .chev { margin-left: auto; color: #b8c4c0; font-size: 18px; }

/* ---------------- 站内路线图（导航「看得见」兜底） ----------------
   为什么要有它：原来点「导航」只 window.open 一条高德 URI，站内没有任何
   路线渲染。外部页面在短途（<1km）场景经常只画起终点、不铺折线，用户就
   觉得「没路线」。这里用后端 /route 返回的 GCJ-02 折线自绘 SVG，
   不依赖任何外部 SDK，也不受对方配额/版本变动影响。 */
.route-card { padding: 12px 14px 14px; }
.route-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.route-head h3 { display: flex; align-items: center; gap: 6px; font-size: 15px; margin: 0; }
.route-badge {
  font-size: 11px; padding: 2px 8px; border-radius: 9px;
  background: #eef3f1; color: var(--ink-2); font-weight: 600;
}
.route-badge.short { background: var(--brand-soft); color: var(--brand); }

.route-canvas {
  background: linear-gradient(160deg, #f7fbf9 0%, #eef6f2 100%);
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
.route-svg { display: block; width: 100%; height: auto; aspect-ratio: 320 / 180; }
/* 描边做「光晕」：浅色底上深色线更容易看清，短途的短线段也不会糊成一团 */
.route-halo { fill: none; stroke: #ffffff; stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; opacity: .95; }
.route-line { fill: none; stroke: var(--brand); stroke-width: 4.6; stroke-linecap: round; stroke-linejoin: round; }
/* 直线示意用虚线 + 降饱和，视觉上必须能和「真实路径」区分开 */
.route-line.dashed { stroke: #8fa8a0; stroke-width: 4; stroke-dasharray: 7 6; }
.route-flow { fill: #fff; stroke: var(--brand); stroke-width: 2.4; }
.route-dash-dot { fill: #8fa8a0; }
.route-pin circle:first-child { fill: #ffffff; stroke: var(--brand); stroke-width: 2.6; }
.route-pin .dot { fill: var(--brand); }
.route-pin-to path { fill: var(--danger); stroke: #fff; stroke-width: 1.6; }
.route-pin-to .dot { fill: #fff; }
.route-empty {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 120px; color: var(--ink-2); font-size: 13px;
}

.route-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  margin-top: 8px; font-size: 13px; color: var(--ink);
}
.route-meta .sep { color: #b8c4c0; margin: 0 2px; }
.route-meta .tag { margin-left: auto; }

.route-tip {
  display: flex; gap: 6px; align-items: flex-start;
  margin-top: 8px; padding: 7px 10px; border-radius: 9px;
  font-size: 12px; line-height: 1.5;
  background: var(--brand-soft); color: #0b6b4d;
}
.route-tip.warn { background: #fdf3e3; color: #8a5a12; }
.route-tip.ok { background: #eaf7f1; color: #0b6b4d; }
.route-tip svg { flex: 0 0 auto; margin-top: 1px; }

.route-steps { list-style: none; margin: 10px 0 0; padding: 0; }
.route-steps li {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13px;
}
.route-steps li:last-child { border-bottom: none; }
.route-steps .idx {
  flex: 0 0 18px; height: 18px; border-radius: 6px; margin-top: 1px;
  background: var(--brand-soft); color: var(--brand);
  font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.route-steps .txt { flex: 1; line-height: 1.5; }
.route-steps .dist { flex: 0 0 auto; color: var(--ink-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.route-more { font-size: 11px; color: var(--ink-2); margin-top: 6px; }
.route-actions { margin-top: 10px; }

/* ---------------- 个人资料（三角色通用：头像 / 基本信息 / 手机号验证） ---------------- */
.pf-head { display: flex; align-items: center; gap: 14px; }
.pf-avatar-btn {
  position: relative; flex: 0 0 auto; padding: 0; border: none;
  background: none; cursor: pointer; line-height: 0;
}
.pf-av-edit {
  position: absolute; right: -2px; bottom: -2px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--surface);
}
.pf-av-edit .ic { width: 12px; height: 12px; }
/* 头像容器：56px 常规 / 72px 大图（sheet 预览）。
   同时用于 img 与占位图标，保证两种状态占位一致、不会跳版。 */
.avatar-ph, .avatar-img { border-radius: 50%; object-fit: cover; display: block; }
.avatar-ph {
  width: 56px; height: 56px; background: var(--brand-soft); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
}
.avatar-ph .ic { width: 26px; height: 26px; }
.avatar-ph.lg, .avatar-img.lg { width: 72px; height: 72px; }
.avatar-ph.lg .ic { width: 32px; height: 32px; }
.avatar-img { width: 56px; height: 56px; background: #eef3f1; }

.pf-name { font-size: 16px; font-weight: 600; line-height: 1.3; }
.pf-sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 5px; }
.pf-phone { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--ink-2); }
.pf-phone .ic { width: 13px; height: 13px; }
.pf-phone.ok { color: var(--brand); }

.pf-progress { margin-top: 14px; }
.pf-bar { height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.pf-bar i { display: block; height: 100%; background: var(--brand); border-radius: 3px; }
.pf-line {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: 11px; margin-top: 5px; color: var(--ink-2);
}
.pf-line .muted { font-size: 11px; }

.pf-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.pf-actions .btn { flex: 1 1 auto; min-width: 0; font-size: 13px; padding: 9px 8px; }
.pf-actions .btn.is-ok { color: var(--brand); border-color: var(--brand-soft); background: var(--brand-soft); }
.pf-pending {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line);
}
.pf-pending .btn[disabled] { opacity: .55; cursor: not-allowed; }
.pf-extra {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--ink-2); margin-top: 8px;
}
.pf-extra .ic { width: 14px; height: 14px; }

.pf-avatar-row { display: flex; align-items: center; gap: 14px; }
.pf-err { font-size: 11px; color: var(--danger); min-height: 14px; margin-top: 3px; }
.field .req { color: var(--danger); }
