/* app.css — 深色移动优先样式
 * 目标：360-430px 宽手机为主，兼容 Chrome 80 级老 WebView。
 * 变量 + flex/grid；使用 env(safe-area-inset-*) 处理刘海/手势条。
 * 不使用 :has() / 容器查询 / 颜色函数等新特性。
 */

:root {
  --bg: #0b0f15;
  --bg-2: #0e131b;
  --surface: #151b25;
  --surface-2: #1b222e;
  --surface-3: #222b39;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .16);
  --text: #eef3fa;
  --text-2: #a9b4c4;
  --text-3: #6d7a8c;
  --green: #35d07f;
  --green-dim: rgba(53, 208, 127, .14);
  --orange: #ff8a4c;
  --orange-dim: rgba(255, 138, 76, .14);
  --grey: #8b93a3;
  --grey-dim: rgba(139, 147, 163, .14);
  --dark: #525a68;
  --red: #ff5f6d;
  --yellow: #ffc94d;
  --blue: #4f9cff;
  --radius: 16px;
  --radius-sm: 10px;
  --tabbar-h: 62px;
  --topbar-h: 54px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

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

/* hidden 属性必须真的隐藏：作者样式里的 display:flex/grid 会盖掉 UA 的 [hidden]{display:none}，
   而 JS 里大量用 el.hidden = true 控制显隐（hero / section-head / campus-grid / footnote 等），
   没有这条兜底会出现「空状态卡片和六校区网格同时显示」的自相矛盾画面。 */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overscroll-behavior-y: contain;
}

body {
  min-height: 100vh;
  min-height: 100%;
  padding-top: var(--safe-top);
}

button, input { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; padding: 0; }
h1, h2, h3, p, dl, dd, dt, ul { margin: 0; padding: 0; }
ul { list-style: none; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }

.app {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 560px;
  margin: 0 auto;
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

/* ---------------- 顶部栏 ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--topbar-h);
  padding: 0 14px;
  background: rgba(11, 15, 21, .86);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.topbar.is-scrolled { border-bottom-color: var(--line); }

.topbar-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(53, 208, 127, .16);
  flex: 0 0 auto;
}
.brand-name { font-size: 16px; font-weight: 700; letter-spacing: .3px; }
.brand-sub { font-size: 11px; color: var(--text-3); padding-top: 2px; }

.topbar-actions { display: flex; align-items: center; gap: 4px; }
.icon-btn {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  color: var(--text-2);
  transition: background .16s var(--ease), color .16s var(--ease);
}
.icon-btn:active { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 21px; height: 21px; }
.icon-btn.is-spinning svg { animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

/* ---------------- 横幅 ---------------- */
.banner {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 12px 0;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}
.banner[hidden] { display: none; }
.banner-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.banner-text { flex: 1 1 auto; min-width: 0; }
.banner-btn {
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, .14);
}
.banner-warn { background: rgba(255, 201, 77, .13); color: #ffd76e; border: 1px solid rgba(255, 201, 77, .3); }
.banner-warn .banner-dot { background: var(--yellow); }
.banner-error { background: rgba(255, 95, 109, .14); color: #ff8f99; border: 1px solid rgba(255, 95, 109, .32); }
.banner-error .banner-dot { background: var(--red); animation: pulse 1.6s ease-in-out infinite; }
.banner-info { background: rgba(79, 156, 255, .12); color: #8fbfff; border: 1px solid rgba(79, 156, 255, .28); }
/* 数据源限流条：第二行说明「数据停在某时某分」，用 flex-basis:100% 强制换行，
   margin-left 对齐首行文字起点（dot 7px + gap 8px = 15px）。 */
#sourceBanner { flex-wrap: wrap; row-gap: 3px; }
#sourceBanner .banner-text { flex: 0 1 auto; }
#sourceBanner .banner-sub {
  flex: 1 0 100%;
  margin-left: 15px;
  font-size: 12px;
  font-weight: 500;
  opacity: .85;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* ---------------- 主区域 ---------------- */
.main {
  flex: 1 1 auto;
  padding: 12px 12px calc(var(--tabbar-h) + var(--safe-bottom) + 22px);
  outline: none;
}
.view[hidden] { display: none; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}
.card-title { font-size: 14px; font-weight: 700; margin-bottom: 10px; letter-spacing: .2px; }
.card-desc { font-size: 12.5px; color: var(--text-2); line-height: 1.6; margin-bottom: 12px; }
.card-desc code { background: var(--surface-3); padding: 1px 5px; border-radius: 5px; color: var(--text); }

/* ---------------- Hero 总览 ---------------- */
.card-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 14px;
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(53, 208, 127, .12) 0%, rgba(53, 208, 127, 0) 58%),
    linear-gradient(160deg, #17202c 0%, #121821 100%);
  border-color: rgba(53, 208, 127, .16);
}
.hero-left { flex: 1 1 auto; min-width: 0; }
.hero-label { font-size: 12px; color: var(--text-2); letter-spacing: .6px; }
.hero-num-row { display: flex; align-items: baseline; gap: 4px; margin: 2px 0 6px; }
.hero-free {
  font-size: 42px;
  font-weight: 800;
  line-height: 1.05;
  color: var(--green);
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}
.hero-total { font-size: 17px; color: var(--text-3); font-weight: 600; font-variant-numeric: tabular-nums; }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ratio-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--green-dim);
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.ratio-pill.is-low { background: var(--orange-dim); color: var(--orange); }
.ratio-pill.is-none { background: var(--grey-dim); color: var(--grey); }
.hero-time { font-size: 11.5px; color: var(--text-3); }
.hero-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.legend-item { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--text-2); }
.legend-swatch { width: 8px; height: 8px; border-radius: 2px; flex: 0 0 auto; }
.legend-item b { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }

.hero-right { flex: 0 0 auto; }
.donut-wrap { width: 118px; height: 118px; position: relative; }
.donut-svg { display: block; width: 100%; height: 100%; }
.donut-track { stroke: rgba(255, 255, 255, .07); }
.donut-seg { transition: stroke-dasharray .55s var(--ease), stroke-dashoffset .55s var(--ease); }
.donut-main { fill: var(--text); font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.donut-sub { fill: var(--text-3); font-size: 8.5px; font-weight: 600; }

/* ---------------- 首页：端口表入口（大按钮，一眼看出能点） ---------------- */
.cta-ports {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 13px;
  margin-bottom: 4px;
  text-align: left;
  background: linear-gradient(150deg, #1d2a3a 0%, #16202c 100%);
  border: 1px solid rgba(79, 156, 255, .3);
  border-radius: 14px;
  transition: transform .14s var(--ease), background .14s var(--ease), border-color .14s var(--ease);
}
.cta-ports:active { transform: scale(.98); background: var(--surface-2); }
.cta-icon {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: rgba(79, 156, 255, .16);
  color: var(--blue);
}
.cta-icon svg { width: 21px; height: 21px; }
.cta-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cta-title { font-size: 14.5px; font-weight: 700; color: var(--text); }
.cta-sub {
  font-size: 11.5px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cta-arrow { flex: 0 0 auto; font-size: 20px; color: var(--blue); line-height: 1; }

/* ---------------- 首页：空闲端口列表 ---------------- */
.free-ports {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 4px;
}
.fp-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 11px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--campus-color, var(--blue));
  border-radius: 11px;
  transition: transform .12s var(--ease), background .12s var(--ease);
}
.fp-row:active { transform: scale(.982); background: var(--surface-2); }
.fp-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; }
.fp-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.fp-code {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: .3px;
}
.fp-station {
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fp-campus {
  flex: 0 0 auto;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-3);
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  max-width: 74px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fp-arrow { flex: 0 0 auto; font-size: 17px; color: var(--text-3); line-height: 1; }
.fp-empty {
  padding: 16px 12px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-3);
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: 11px;
}
.fp-skel { height: 52px; border-radius: 11px; }
.more-ports {
  width: 100%;
  height: 42px;
  margin-top: 8px;
  border-radius: 11px;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  color: var(--blue);
  font-size: 12.5px;
  font-weight: 600;
  transition: background .14s var(--ease);
}
.more-ports:active { background: var(--surface-2); }

/* ---------------- 端口表视图 ---------------- */
.ports-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 2px 2px 10px;
}
.ports-summary { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.ports-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 2px 10px;
}
.port-list { display: flex; flex-direction: column; gap: 0; }
.port-group-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 13px 2px 7px;
  font-size: 12.5px;
  color: var(--text-2);
}
.port-group-head:first-child { padding-top: 2px; }
.port-group-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; }
.port-group-name { font-weight: 700; color: var(--text); letter-spacing: .2px; }
.port-group-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.port-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  margin-bottom: 4px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  transition: background .12s var(--ease);
}
.port-row:active { background: var(--surface-3); }
.port-status-dot { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; }
.port-code {
  flex: 0 0 auto;
  min-width: 46px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: .2px;
}
.port-station {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 11.5px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.port-status-text {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.port-extra {
  flex: 0 0 auto;
  min-width: 42px;
  text-align: right;
  font-size: 10.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
@media (max-width: 359px) {
  .port-extra { display: none; }
  .fp-campus { display: none; }
}

/* ---------------- 段落标题 ---------------- */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 16px 2px 10px;
}
.section-title { font-size: 15px; font-weight: 700; letter-spacing: .3px; }
.section-hint { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* ---------------- 校区卡片 ---------------- */
.campus-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 340px) { .campus-grid { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 520px) { .campus-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.campus-card {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--campus-color, var(--blue));
  border-radius: 14px;
  padding: 11px 11px 12px;
  min-height: 118px;
  overflow: hidden;
  transition: transform .14s var(--ease), background .14s var(--ease), border-color .14s var(--ease);
}
.campus-card:active { transform: scale(.975); background: var(--surface-2); }
.campus-card.is-empty { opacity: .58; }
.campus-card-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.campus-name {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: .2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.campus-badge {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-2);
}
.campus-num-row { display: flex; align-items: baseline; gap: 3px; margin: 7px 0 6px; }
.campus-free {
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  color: var(--green);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.5px;
}
.campus-free.is-zero { color: var(--text-3); }
.campus-total { font-size: 12px; color: var(--text-3); font-weight: 600; font-variant-numeric: tabular-nums; }
.campus-free-unit {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: .2px;
}
/* 空闲率徽标单独一行：和大数字分行，避免把 /1978 挤成两行。 */
.campus-ratio-row { display: flex; align-items: center; gap: 6px; margin: -2px 0 7px; }
.ratio-pill-sm { padding: 1px 7px; font-size: 10.5px; font-weight: 700; }

/* 堆叠条 */
.stackbar {
  position: relative;
  width: 100%;
  border-radius: 4px;
  overflow: hidden;
  background: rgba(255, 255, 255, .06);
}
.stackbar-svg { display: block; width: 100%; height: 100%; }
.stackbar-empty { display: block; width: 100%; height: 100%; background: transparent; }

.campus-spark { margin-top: 7px; height: 22px; }
.spark-svg { display: block; width: 100%; height: 22px; }
.campus-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 8px;
  font-size: 10.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.campus-foot .campus-stations { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------- 历史页 ---------------- */
.seg-group {
  display: flex;
  gap: 4px;
  padding: 3px;
  margin-bottom: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.seg-btn {
  flex: 1 1 0;
  min-width: 0;
  height: 36px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  transition: background .16s var(--ease), color .16s var(--ease);
}
.seg-btn.is-active { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 6px rgba(0, 0, 0, .28); }

.chip-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 10px;
  margin-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.chip-scroll::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: background .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease);
}
.chip.is-active {
  background: var(--chip-color, var(--blue));
  border-color: transparent;
  color: #08101a;
  font-weight: 700;
}
.chip-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--chip-color, var(--blue)); }
.chip.is-active .chip-dot { background: #08101a; }

/* 源名可能极长（「充充充充电桩-铭创电子」）。固定上限 + 内部省略，
 * 避免 chip 撑爆横向滚动容器、把后面的 chip 推出可视区看不见。
 * title 属性在 app.js 里已设，长按/悬停能看到全名。 */
.chip-text {
  display: inline-block;
  max-width: 9.5em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.chart-card { padding: 12px 10px 10px; }
.chart-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; padding: 0 4px 8px; }
.chart-current { display: flex; align-items: baseline; gap: 6px; }
.chart-cur-val { font-size: 26px; font-weight: 800; color: var(--green); line-height: 1; font-variant-numeric: tabular-nums; }
.chart-cur-val.is-low { color: var(--orange); }
.chart-cur-val.is-none { color: var(--text-3); }
.chart-cur-label { font-size: 11px; color: var(--text-3); }
.chart-stats { display: flex; gap: 10px; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.chart-stats b { color: var(--text-2); font-weight: 700; }
.chart-box { position: relative; min-height: 200px; }
.area-svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.area-gridline { stroke: rgba(255, 255, 255, .07); stroke-width: 1; shape-rendering: crispEdges; }
.area-tick { stroke: rgba(255, 255, 255, .18); stroke-width: 1; }
.c-axis { fill: var(--text-3); font-size: 9.5px; font-weight: 500; font-variant-numeric: tabular-nums; }
.c-empty { fill: var(--text-3); font-size: 12px; }
/* charts.js 缺失时的纯 DOM 兜底：.c-empty 的 fill/text-size 是给 SVG 文本用的，
   落到 div 上要换成 color/字号，否则会继承成默认黑色看不见。 */
.chart-box-fallback { display: flex; align-items: center; justify-content: center; }
.chart-box-fallback .c-empty { color: var(--text-3); font-size: 12px; }
.area-empty-box { fill: transparent; stroke: rgba(255, 255, 255, .07); stroke-dasharray: 4 4; }
.area-line { vector-effect: non-scaling-stroke; }
.area-dot-last { fill: var(--green); stroke: #0e131b; stroke-width: 1.6; }
.area-hover-line { stroke: rgba(255, 255, 255, .38); stroke-width: 1; stroke-dasharray: 3 3; }
.area-hover-dot { fill: #fff; stroke: var(--green); stroke-width: 2.4; }
.chart-tip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  padding: 6px 9px;
  border-radius: 9px;
  background: rgba(24, 31, 42, .97);
  border: 1px solid var(--line-strong);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .45);
  font-size: 11px;
  color: var(--text-2);
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.chart-tip b { color: var(--text); font-size: 11.5px; }
.chart-tip em { color: var(--green); font-style: normal; font-weight: 700; }
.chart-foot { padding: 8px 4px 2px; font-size: 11px; color: var(--text-3); line-height: 1.5; }

.fleet-card .dist-row { margin-bottom: 10px; }
.fleet-card .dist-row:last-child { margin-bottom: 0; }
.dist-label { display: flex; align-items: center; justify-content: space-between; font-size: 12px; margin-bottom: 5px; }
.dist-label span { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.dist-label b { color: var(--text); font-variant-numeric: tabular-nums; }
.dist-bar { height: 7px; border-radius: 4px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.dist-bar i { display: block; height: 100%; border-radius: 4px; transition: width .5s var(--ease); }

/* ---------------- 返回按钮 ---------------- */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 36px;
  padding: 0 12px 0 6px;
  margin-bottom: 10px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
}
.back-btn:active { background: var(--surface-2); }
.back-btn svg { width: 18px; height: 18px; }

/* ---------------- 校区详情头 ---------------- */
.campus-hero { padding: 14px; }
.campus-hero-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.campus-hero-dot { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }
.campus-hero-name { font-size: 17px; font-weight: 800; letter-spacing: .3px; }
.campus-hero-stats { display: flex; gap: 16px; margin-top: 10px; }
.hstat { display: flex; flex-direction: column; gap: 1px; }
.hstat-v { font-size: 19px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.hstat-l { font-size: 10.5px; color: var(--text-3); }
.campus-hero-time { font-size: 11px; color: var(--text-3); margin-top: 8px; }

/* ---------------- 站点列表 ---------------- */
.station-list { display: flex; flex-direction: column; gap: 10px; }
.station-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}
.station-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.station-name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-all;
}
.station-free {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--green-dim);
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.station-free b { font-size: 15px; font-weight: 800; }
.station-free.is-low { background: var(--orange-dim); color: var(--orange); }
.station-free.is-none { background: var(--grey-dim); color: var(--grey); }
.station-addr { font-size: 11px; color: var(--text-3); margin-top: 4px; word-break: break-all; }
.station-meta-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 9px; }
.station-counts { display: flex; gap: 8px; font-size: 10.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.station-counts span { display: inline-flex; align-items: center; gap: 3px; }
.cnt-dot { width: 6px; height: 6px; border-radius: 2px; }
.station-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  margin-top: 10px;
  padding: 9px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
}
.station-toggle:active { background: var(--surface-3); }
.station-toggle .chev { transition: transform .2s var(--ease); }
.station-toggle.is-open { color: var(--text-3); }

/* 桩状态网格 */
.devices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
  gap: 6px;
  margin-top: 10px;
}
.devices.is-compact { grid-template-columns: repeat(auto-fill, minmax(22px, 1fr)); gap: 4px; }
.devices.is-compact.devices-many { grid-template-columns: repeat(auto-fill, minmax(15px, 1fr)); gap: 3px; }

.dev {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid transparent;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  transition: transform .12s var(--ease), background .12s var(--ease);
  /* 兜底：无论编号多长都不许溢出压到相邻色块上（正常情况 cellLabel() 已截短） */
  overflow: hidden;
  white-space: nowrap;
  padding: 0 2px;
}
.dev:active { transform: scale(.92); }
.dev.is-free { background: rgba(53, 208, 127, .17); border-color: rgba(53, 208, 127, .5); color: #6cf0a8; }
.dev.is-busy { background: rgba(255, 138, 76, .16); border-color: rgba(255, 138, 76, .45); color: #ffb083; }
.dev.is-offline { background: rgba(139, 147, 163, .15); border-color: rgba(139, 147, 163, .34); color: #b3bcc8; }
.dev.is-unknown { background: rgba(82, 90, 104, .2); border-color: rgba(82, 90, 104, .5); color: #939dab; }
.dev.is-free::after {
  content: "";
  position: absolute;
  top: 4px; right: 4px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px rgba(53, 208, 127, .9);
}
.devices.is-compact .dev { height: 22px; font-size: 9px; border-radius: 6px; }
.devices.is-compact .dev.is-free::after { top: 2px; right: 2px; width: 3px; height: 3px; }
.devices.devices-many .dev { height: 15px; font-size: 0; border-radius: 4px; }
.devices.devices-many .dev.is-free::after { display: none; }
.dev-empty { font-size: 12px; color: var(--text-3); margin-top: 10px; }

/* ---------------- 空/错误状态 ---------------- */
.state-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 46px 24px;
}
.state-block[hidden] { display: none; }
.state-icon { font-size: 38px; line-height: 1; opacity: .85; }
.state-title { font-size: 16px; font-weight: 700; }
.state-desc { font-size: 12.5px; color: var(--text-3); line-height: 1.6; max-width: 300px; }
.state-block .btn { margin-top: 8px; }

/* ---------------- 骨架屏 ---------------- */
.skel {
  position: relative;
  overflow: hidden;
  background: var(--surface-2);
}
.skel::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .06) 45%, rgba(255, 255, 255, 0) 100%);
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }
.skel-card { height: 118px; border-radius: 14px; }
.skel-line { height: 12px; border-radius: 6px; margin-bottom: 8px; }
.skel-chart { height: 200px; border-radius: 12px; }

/* ---------------- 表单 / 按钮 ---------------- */
.field { margin-bottom: 10px; }
.text-input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border-radius: 11px;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color .16s var(--ease);
}
.text-input:focus { border-color: var(--blue); }
.text-input::placeholder { color: var(--text-3); font-size: 12.5px; }

.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 11px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .12s var(--ease), background .12s var(--ease);
}
.btn:active { transform: scale(.97); background: var(--surface-3); }
.btn-primary { background: var(--green); color: #06120c; border-color: transparent; }
.btn-primary:active { background: #2bbd71; }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn[disabled] { opacity: .5; pointer-events: none; }

.hint-line { font-size: 11.5px; color: var(--text-3); margin-top: 10px; line-height: 1.5; word-break: break-all; }
.hint-line.is-ok { color: var(--green); }
.hint-line.is-err { color: var(--red); }
.hint-line.is-busy { color: var(--blue); }

.kv-list { display: flex; flex-direction: column; gap: 8px; }
.kv-list .kv { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.kv-list dt { color: var(--text-3); flex: 0 0 auto; }
.kv-list dd { color: var(--text-2); text-align: right; word-break: break-all; font-variant-numeric: tabular-nums; }

.about { text-align: center; color: var(--text-3); font-size: 11px; line-height: 1.7; padding: 10px 0 4px; }
.footnote { color: var(--text-3); font-size: 11px; line-height: 1.6; padding: 14px 4px 0; text-align: center; }

  /* ---------------- 数据源状态区（relay GET /api/sources） ---------------- */
  /* 紧凑三列：名字+主机（左，可省略）/ 空闲端口数（中）/ 更新时间+限流（右）。
   * 名字用 ellipsis 是因为源 B 的全称「充充充充电桩-铭创电子」很长，
   * 不截断的话会把右侧的更新时间挤出屏幕——而更新时间恰恰是这块要传达的重点。 */
  .sources-box { margin: 14px 0 0; }
  .sources-head { padding-bottom: 2px; }
  .sources-list {
    border: 1px solid var(--line);
    border-radius: 12px; overflow: hidden;
    background: var(--surface);
  }
  .source-row {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 12px; font-size: 12px; line-height: 1.4;
    border-bottom: 1px solid var(--line);
  }
  .source-row:last-child { border-bottom: none; }
  .source-left { display: flex; align-items: center; gap: 7px; flex: 1 1 auto; min-width: 0; }
  .source-dot {
    flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%;
    background: var(--green);
  }
  .source-row.is-throttled .source-dot { background: var(--yellow); }
  .source-name {
    min-width: 0; display: flex; flex-direction: column;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .source-host {
    font-size: 10px; color: var(--text-3); font-weight: 500;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .source-counts {
    flex: 0 0 auto; color: var(--text-2); white-space: nowrap;
  }
  .source-counts b { color: var(--green); }
  .source-age {
    flex: 0 0 auto; display: flex; align-items: center; gap: 5px;
    color: var(--text-3); white-space: nowrap;
  }
  .source-tag {
    font-size: 10px; line-height: 1; padding: 3px 5px; border-radius: 5px;
    background: rgba(255, 201, 77, .16); color: var(--yellow);
  }
  /* 可点进详情的数据源行。用 button 做容器（键盘可达、点按反馈），
   * 所以要把 button 的默认外观彻底抹平，只留我们自己的三列布局。 */
  .source-row.is-clickable {
    width: 100%; text-align: left; color: inherit;
    background: transparent; border: none; border-bottom: 1px solid var(--line);
    font-family: inherit; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background .16s var(--ease);
  }
  .source-row.is-clickable:last-child { border-bottom: none; }
  .source-row.is-clickable:active { background: var(--surface-3); }
  .source-chev {
    flex: 0 0 auto; font-size: 14px; line-height: 1; color: var(--text-3);
    margin-left: -1px;
  }
  .source-row.is-clickable:active .source-chev { color: var(--text); }
  /* 不可点（公共频道 / 旧 relay，没有分校区明细）：光标不暗示可点 */
  .source-row.is-static { cursor: default; }

/* ---------------- 数据源详情（某源的分校区明细） ---------------- */
.source-hero { margin-bottom: 12px; }
.source-hero.is-throttled { border-color: rgba(255, 201, 77, .34); }
.source-hero-top { display: flex; align-items: center; gap: 8px; }
.source-hero-dot {
  flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%;
  background: var(--green);
}
.source-hero-dot.is-throttled { background: var(--yellow); }
.source-hero-name {
  font-size: 15.5px; font-weight: 700; color: var(--text); line-height: 1.35;
  /* 源 B 全称「充充充充电桩-铭创电子」很长，窄屏必须能换行而不是顶出卡片 */
  word-break: break-word;
}
.source-hero-meta { margin-top: 5px; font-size: 12px; color: var(--text-2); }
.source-hero-host {
  margin-top: 3px; font-size: 11px; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.source-hero-warn {
  margin-top: 8px; padding: 7px 9px; border-radius: 9px;
  font-size: 11.5px; line-height: 1.5;
  background: rgba(255, 201, 77, .12); color: var(--yellow);
  word-break: break-word;
}
.source-summary {
  display: flex; align-items: baseline; gap: 5px; margin: 0 2px 10px;
  font-size: 12px; color: var(--text-3);
}
.source-summary-free {
  font-size: 19px; font-weight: 800; color: var(--green);
  font-variant-numeric: tabular-nums; letter-spacing: -.3px;
}
.source-empty-card { text-align: center; padding: 22px 16px; }
.source-campus-list { display: flex; flex-direction: column; gap: 8px; }
.source-campus-card {
  display: block; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--campus-color, var(--blue));
  border-radius: 13px; padding: 11px 12px;
  color: inherit; font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s var(--ease), background .16s var(--ease);
}
.source-campus-card:active { transform: scale(.982); background: var(--surface-2); }
.source-campus-card.is-empty { opacity: .58; }
.source-campus-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.source-campus-name {
  font-size: 13.5px; font-weight: 700; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.source-campus-chev { flex: 0 0 auto; font-size: 15px; line-height: 1; color: var(--text-3); }
.source-campus-num {
  display: flex; align-items: baseline; gap: 4px; margin: 5px 0 7px;
}
.source-campus-free {
  font-size: 23px; font-weight: 800; color: var(--green);
  line-height: 1.05; letter-spacing: -.4px; font-variant-numeric: tabular-nums;
}
.source-campus-free.is-zero { color: var(--text-3); }
.source-campus-total { font-size: 12px; color: var(--text-3); font-weight: 600; }
.source-campus-foot { margin-top: 8px; font-size: 10.5px; color: var(--text-3); }
.source-campus-counts {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------------- 底部页签 ---------------- */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  display: flex;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(13, 18, 25, .94);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
@media (min-width: 561px) {
  .tabbar { max-width: 560px; margin: 0 auto; left: 50%; transform: translateX(-50%); border-radius: 16px 16px 0 0; }
}
.tab {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 600;
  transition: color .16s var(--ease);
}
.tab svg { width: 22px; height: 22px; }
.tab.is-active { color: var(--green); }

/* ---------------- 抽屉 ---------------- */
.sheet-mask {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 60;
  background: rgba(0, 0, 0, .58);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet-mask[hidden] { display: none; }
.sheet {
  width: 100%;
  max-width: 560px;
  max-height: 82vh;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 20px 20px 0 0;
  padding: 6px 14px calc(16px + var(--safe-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: sheetUp .26s var(--ease);
}
@keyframes sheetUp { from { transform: translateY(28px); opacity: .5; } to { transform: translateY(0); opacity: 1; } }
.sheet-grab { width: 38px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 6px auto 4px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0 8px; }
.sheet-title { font-size: 15px; font-weight: 700; }
.sheet-body { padding-bottom: 6px; }
.sheet-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.sheet-row:last-child { border-bottom: none; }
.sheet-row dt, .sheet-row .k { color: var(--text-3); font-size: 12.5px; }
.sheet-row dd, .sheet-row .v { color: var(--text); font-weight: 600; text-align: right; word-break: break-all; font-variant-numeric: tabular-nums; }
.sheet-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

/* ---------------- 下拉刷新 ---------------- */
.ptr {
  position: fixed;
  top: calc(var(--safe-top) + 4px);
  left: 0; right: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  transform: translateY(-46px);
  transition: transform .2s var(--ease), opacity .2s var(--ease);
  opacity: 0;
  pointer-events: none;
}
.ptr.is-pulling, .ptr.is-refreshing { transform: translateY(0); opacity: 1; }
.ptr-inner {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 13px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  font-size: 11.5px;
  color: var(--text-2);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .4);
}
.ptr-spinner {
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .22);
  border-top-color: var(--green);
  display: none;
}
.ptr.is-refreshing .ptr-spinner { display: block; animation: spin .8s linear infinite; }
.ptr.is-ready .ptr-inner { color: var(--green); }

/* ---------------- Toast ---------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 18px);
  transform: translateX(-50%) translateY(8px);
  z-index: 80;
  max-width: 84vw;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(34, 43, 57, .97);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.toast[hidden] { display: none; }
.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------- 杂项小件 ---------------- */
.ptr-text { white-space: nowrap; }
.chev {
  display: inline-block;
  line-height: 1;
  color: var(--text-3);
  transform: translateY(-1px);
}
.chev-r::before { content: '›'; font-size: 18px; color: var(--text-3); line-height: 1; }

/* =========================================================
 * 首次使用手册（guide）
 * ---------------------------------------------------------
 * 必须真的挡住整个页面 —— 包括底部 tabbar（z-index 40）和 toast（80）。
 * z-index 取 200，比页面里任何东西都高。遮罩本身不绑点击事件：
 * 点空白处什么都不发生，用户只能点「下一步」，这是需求里明确要求的。
 * ========================================================= */
.guide-mask {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px calc(20px + var(--safe-bottom));
  background: rgba(4, 7, 11, .82);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.guide-mask[hidden] { display: none; }
.guide {
  width: 100%;
  max-width: 420px;
  max-height: 100%;
  overflow-y: auto;
  padding: 20px 18px 16px;
  border-radius: 18px;
  background: linear-gradient(165deg, #1a2330, #131a24);
  border: 1px solid var(--line-strong);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
}
.guide-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.guide-step { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.guide-title { font-size: 16px; font-weight: 700; }
.guide-body { min-height: 108px; }
.guide-page {
  display: none;
  font-size: 14.5px;
  line-height: 1.78;
  color: var(--text-2);
  margin: 0;
}
.guide-page.is-active { display: block; }
.guide-foot { display: flex; align-items: stretch; gap: 8px; margin-top: 18px; }
.guide-foot .btn { min-height: 44px; }
/* 第二页才出现的灰色等待按钮：10 秒内 disabled，10 秒后变可用 */
.btn-wait {
  flex: 0 0 auto;
  max-width: 58%;
  background: var(--surface-3);
  color: var(--text-3);
  border-color: var(--line);
  font-size: 11.5px;
  line-height: 1.35;
  text-align: center;
  white-space: normal;
  font-weight: 600;
}
.btn-wait[disabled] { opacity: .72; }
.btn-wait.is-ready { background: var(--surface-3); color: var(--text-2); border-color: var(--line-strong); }
.btn-wait[hidden] { display: none; }
#btnGuideNext { flex: 1 1 auto; }
/* 第 2 页的「我已知晓」在前 10 秒是 disabled 的。全局 .btn[disabled] 只是压暗，
 * 绿色按钮压暗后仍像「可以点」，容易让人反复去戳。这里直接把它降级成「灰色禁用」外观，
 * 十秒倒计时结束后 .btn-primary 的绿色自然回来，语义一眼可辨。 */
#btnGuideNext[disabled] {
  background: var(--surface-3);
  color: var(--text-3);
  border-color: var(--line);
  opacity: 1;
  box-shadow: none;
}

/* =========================================================
 * 通用确认弹窗（feedback 提交确认）
 * ========================================================= */
.confirm-mask {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  background: rgba(4, 7, 11, .78);
}
.confirm-mask[hidden] { display: none; }
.confirm {
  width: 100%;
  max-width: 340px;
  padding: 20px 18px 16px;
  border-radius: 16px;
  background: linear-gradient(165deg, #1a2330, #131a24);
  border: 1px solid var(--line-strong);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
}
.confirm-title { font-size: 15.5px; font-weight: 700; margin-bottom: 8px; }
.confirm-text { font-size: 13px; line-height: 1.65; color: var(--text-2); margin: 0 0 16px; }
.confirm-actions { display: flex; gap: 8px; }
.confirm-actions .btn { flex: 1 1 0; min-height: 42px; }

/* 风控惩罚弹窗：比普通确认弹窗更"危险"——标题描红、副标题是每秒跳动的倒计时。
 * 用户要求文案是「您已触发风控限制，请两分钟后再试」，所以标题与正文都要能一眼
 * 看出是「被限制了」而不是「操作失败」。 */
.confirm-danger { border-color: rgba(255, 94, 94, .55); }
.confirm-danger .confirm-title { color: var(--danger, #ff5e5e); }
.confirm-sub {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-3);
  margin: -8px 0 16px;
  font-variant-numeric: tabular-nums;
}

/* 风控期内的刷新按钮：置灰 + 禁止点击。只靠 opacity 不够，
 * 必须同时 disabled（app.js updateRefreshButtonLock 会设）。 */
.icon-btn.is-locked { opacity: .38; cursor: not-allowed; }
.icon-btn.is-locked svg { animation: none !important; }

/* 倒计时横幅里的秒数用等宽数字，避免每秒跳动时宽度抖动 */
.banner .rate-limit-text { font-variant-numeric: tabular-nums; }

/* =========================================================
 * 桩详情里的反馈块
 * ========================================================= */
.fb-block {
  margin-top: 10px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.fb-count {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-3);
  margin-bottom: 10px;
}
.fb-count b {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
/* 数字 + 可选「（已标记不可用）」的右侧组，避免 space-between 把数字夹到中间 */
.fb-count-right { display: inline-flex; align-items: baseline; gap: 6px; }
.fb-count.is-flagged b { color: var(--red); }
.fb-count.is-flagged { color: var(--red); }
/* 达阈值时计数行尾部的「（已标记不可用）」小字：同一行解释为什么这个端口变灰了 */
.fb-count-flag { font-size: 11px; font-weight: 600; color: var(--red); white-space: nowrap; }
.fb-btn { width: 100%; min-height: 44px; }
/* 「本机已反馈过这个端口」的按钮：禁用且降级成灰色说明态，
 * 不能只靠 :disabled 调透明度——绿色按钮压暗后仍像可点。 */
.fb-btn.is-done,
.fb-btn.is-done[disabled] {
  background: var(--surface-3);
  color: var(--text-3);
  border-color: var(--line);
  cursor: default;
  opacity: 1;
  box-shadow: none;
}
/* 「不可用」这个唯一选项：选中态用红，明确表达负面反馈 */
.fb-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  margin-bottom: 10px;
  border-radius: 11px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
}
.fb-option:active { transform: scale(.985); background: #2a1c1c; }
.fb-option.is-selected {
  background: rgba(255, 95, 109, .14);
  border-color: rgba(255, 95, 109, .5);
  color: var(--red);
}
.fb-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--grey);
  flex: 0 0 auto;
}
.fb-option.is-selected .fb-dot { background: var(--red); }
.fb-note { font-size: 11px; color: var(--text-3); line-height: 1.55; margin: 8px 0 0; }
.fb-note b { color: var(--orange); font-weight: 700; }
/* 被反馈标记为不可用的端口：详情里给一条显眼的红条 */
.fb-flag-line {
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  background: rgba(255, 95, 109, .12);
  border: 1px solid rgba(255, 95, 109, .35);
  color: var(--red);
  font-size: 11.5px;
  line-height: 1.55;
}

/* ---------------- 刷新按钮旋转 ---------------- */
.is-loading .icon-btn svg { animation: spin 1s linear infinite; }
.is-loading .icon-btn { color: var(--green); }

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; }
}
