/* =============================================================================
   网络面板 · 样式
   -----------------------------------------------------------------------------
   暖白纸感皮肤。旧 Vue 版的 style.css 已归档在 archive/vue/，不再维护；
   本文件是唯一在用的样式表。

   配色原则（改色时请守住）：
   1. 整页只允许一个重色 —— 墨绿 --accent。除了「开始」按钮和图表线，别再用它铺面积。
   2. 所有大面积色块走中性暖灰（--surface-2 / --row），不要用绿底。
      浅绿铺一大片会显脏，尤其是推算条那种通栏色块。
   3. 灰阶统一在色相 40° 附近、饱和度压到 6% 以内，只靠明度拉开层次。
   4. 状态色（ok / warn / danger）一律降饱和，是「提示」不是「警示灯」。
   5. 夜间不是浅色的反相，是另立一套令牌（见 :root[data-theme="dark"]）。
      新增颜色一律先加令牌、两套都给值，别在规则里直接写 hex。
   ============================================================================= */
*, *::before, *::after { box-sizing: border-box; }

:root {
  color-scheme: light;

  --bg: #F4F3EF;              /* 素纸：比原先提亮一档，减黄 */
  --card: #FFFFFF;
  --field: #FAF9F6;
  --surface-2: #F8F7F3;       /* 卡片内的浅底（推算条、体检行） */
  --row: #FBFAF7;
  --hover: #F5F4F0;
  --raised: #FFFFFF;          /* 浮起面：下拉菜单 / 输入聚焦 / 控件悬停 */
  --track: #E8E4DB;           /* 滑块轨道 / 进度条底 */
  --knob: #FFFFFF;            /* 滑块头 */
  --dot: #CBC7BD;             /* 未检测的状态点 */

  --stroke: #E7E4DC;
  --stroke-strong: #D5D1C7;

  --text: #1A1A17;
  --muted: #6D6B64;
  --dim: #9E9B92;

  --accent: #24564A;          /* 墨绿：比 #1F6A57 更深、更灰，压住荧光感 */
  --accent-hover: #16382F;    /* 主按钮悬停：比 --accent 再深一档 */
  --accent-ink: #16382F;      /* 浅底上的强调文字（夜间必须反过来变浅） */
  --accent-soft: #E9F0EC;     /* 只用于小面积：运行徽章 / 选中项 / 延时胶囊 */
  --accent-line: #DEE7E2;

  --ok: #4A7C66;
  --warn: #96702C;
  --warn-rgb: 150, 112, 44;
  --danger: #A94B40;
  --danger-hover: #8F3E34;
  --danger-rgb: 169, 75, 64;

  --scroll: #D8D4CA;
  --scroll-hover: #C6C2B7;

  --grid: #E9E6DE;            /* canvas 的网格线 */
  --chart: #24564A;           /* canvas 的折线（夜间单独调亮，不跟 --accent 走） */
  --chart-rgb: 36, 86, 74;    /* 折线下方渐变；改 --chart 时必须同步改这里 */
  --radius: 13px;
  --shadow: 0 1px 1px rgba(26, 26, 23, .04), 0 8px 22px -18px rgba(26, 26, 23, .28);
  --shadow-pop: 0 16px 36px -14px rgba(26, 26, 23, .22);
  --shadow-up: 0 -1px 10px rgba(26, 26, 23, .06);
}

/* ---------- 夜间 ----------
   不是把浅色反相，而是重做一份「墨底」：色相仍然守在 40° 附近，
   只把明度整体压到 8%~22% 这一段。三条必须守住的地方：
     1. 墨绿要提亮到 #35786A —— #24564A 在暗底上糊成一团，白字也压不住对比度；
     2. 所有「强调文字」用的 --accent-ink 必须反过来变浅，否则浅底文字变暗底文字直接消失；
     3. 状态点底色 --dot 要从浅灰换成深灰，否则未检测的点比已检测的还亮。
   data-theme 由 index.html 的内联脚本在首帧前写入，避免深色用户看到白闪。 */
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #131311;
  --card: #1B1B18;
  --field: #21201D;
  --surface-2: #1F1E1B;
  --row: #1D1C19;
  --hover: #252420;
  --raised: #272621;
  --track: #2F2E29;
  --knob: #F2F0E9;
  --dot: #4D4C45;

  --stroke: #2B2A25;
  --stroke-strong: #3C3B34;

  --text: #E9E7E0;
  --muted: #A3A099;
  --dim: #807E76;

  --accent: #2E6B5D;
  --accent-hover: #3A8071;    /* 暗底上靠「提亮」表示悬停，不要跟着 --accent-ink 走 */
  --accent-ink: #9ECDBB;
  --accent-soft: #1D2A26;
  --accent-line: #2B3C36;

  --ok: #6FAE90;
  --warn: #C39650;
  --warn-rgb: 195, 150, 80;
  --danger: #CE7A6E;
  --danger-hover: #B9605A;
  --danger-rgb: 206, 122, 110;

  --scroll: #3A3934;
  --scroll-hover: #4A4943;

  --grid: #34332D;
  --chart: #5FA391;
  --chart-rgb: 95, 163, 145;
  --shadow: 0 1px 1px rgba(0, 0, 0, .5), 0 10px 26px -18px rgba(0, 0, 0, .9);
  --shadow-pop: 0 18px 40px -16px rgba(0, 0, 0, .7);
  --shadow-up: 0 -1px 10px rgba(0, 0, 0, .35);
}

html { background: var(--bg); }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

[v-cloak] { display: none; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--scroll); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--scroll-hover); }
::-webkit-scrollbar-track { background: transparent; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 22px 48px;
}

/* ---------- 顶栏 ---------- */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.brand { display: flex; align-items: center; gap: 12px; }

.logo {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--accent);
  position: relative;
  flex: none;
}
.logo::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .92);
  border-top-color: transparent;
  border-right-color: transparent;
}

h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .1px;
}

.tagline {
  margin: 1px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--card);
  font-size: 12px;
  color: var(--muted);
  flex: none;
}
.status i {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--dim);
  display: block;
}
.status.running { color: var(--accent-ink); border-color: var(--accent-line); background: var(--accent-soft); }
.status.running i { background: var(--accent); animation: pulse 1.6s ease-in-out infinite; }
.status.paused { color: var(--warn); border-color: rgba(var(--warn-rgb), .26); background: rgba(var(--warn-rgb), .07); }
.status.paused i { background: var(--warn); }

/* 顶栏右端：运行徽章 + 主题切换。徽章文案会变（已停止 / 运行中 / 已暂停），
   宽度跟着变，所以这一组用 flex 靠右，按钮始终贴在最右侧，不会左右横跳。 */
.top-end {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

/* 明暗切换：32px 圆钮，与徽章同高；图标只描边不填色。
   显示的是「按下去会变成什么」，跟按钮的 title 保持一致：浅色下挂月亮，夜间下挂太阳。 */
.tb {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--stroke);
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color .16s, border-color .16s, background .16s, transform .12s;
}
.tb:hover { color: var(--text); border-color: var(--stroke-strong); background: var(--hover); }
.tb:active { transform: scale(.94); }
.tb:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tb svg { display: block; }
.tb .ic-sun { display: none; }
:root[data-theme="dark"] .tb .ic-sun { display: block; }
:root[data-theme="dark"] .tb .ic-moon { display: none; }

/* 切主题时让大块底色渐变过去，而不是硬切一刀。
   只挂在这几块「纯底色」上：状态色和 canvas 不参与——
   canvas 是重绘出来的，加过渡反而会闪。
   注意：离屏文档不派发动画帧，这些过渡在自测的 iframe（left:-3000px）里
   永远不会推进，断言底色时要读 --bg 令牌，别读计算色。 */
body, .card, .node-row, .predict, .pf-ip, .menu, .status {
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .25; }
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

/* ---------- 主面板 ---------- */
.speed {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 2px;
}

.speed .num {
  font-size: 58px;
  font-weight: 700;
  letter-spacing: -2.4px;
  padding-right: 6px;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.speed .unit {
  font-size: 15px;
  color: var(--muted);
  font-weight: 500;
}

/* 大数字与「下载 / 上传」开关同一行：开关落在大数字右侧的空白里，不额外占一行，
   出现或消失时下方内容不会跟着跳。
   选中态不用墨绿 —— 一小块绿会和「开始」按钮抢注意力，靠白底加字重已经够分辨。 */
.head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.seg {
  display: inline-flex;
  flex: none;
  gap: 2px;
  margin-top: 7px;
  padding: 2px;
  border-radius: 9px;
  border: 1px solid var(--stroke);
  background: var(--surface-2);
  animation: fadein .25s ease;   /* 探测通过后淡入，而不是「啪」地冒出来 */
}

.seg-b {
  height: 26px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  line-height: 26px;
  cursor: pointer;
  transition: background .16s, color .16s;
  -webkit-tap-highlight-color: transparent;
}
.seg-b:hover { color: var(--text); }
.seg-b.on {
  background: var(--card);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(26, 26, 23, .07);
}
:root[data-theme="dark"] .seg-b.on { background: var(--raised); box-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.seg-b:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.speed-sub {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.speed-sub .sep { width: 1px; height: 11px; background: var(--stroke-strong); }
.speed-sub .dim { color: var(--dim); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chart-box {
  position: relative;
  height: 168px;
  margin: 16px 0 4px;
}
.chart-box canvas { width: 100%; height: 100%; display: block; }
.chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--dim);
  letter-spacing: .8px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
  padding-top: 16px;
  border-top: 1px solid var(--stroke);
}

.m label {
  display: block;
  font-size: 11px;
  color: var(--dim);
  margin-bottom: 4px;
  letter-spacing: .2px;
}

.m b {
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.2px;
}
.m b s { text-decoration: none; font-size: 11px; color: var(--muted); font-weight: 400; margin-left: 2px; }

/* 推算条：原来铺的是浅绿底，通栏一大片压在卡片底部会发闷。
   改成中性浅底 + 一条极细描边，让绿色只留在数字上。 */
.predict {
  margin-top: 14px;
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  font-size: 12px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
}
.predict b { color: var(--accent-ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* 网络延时挂在推算条右端。推算条现在是中性浅底，徽章靠白底 + 描边区分层次 */
.ping {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.ping-k { color: var(--dim); font-size: 11.5px; }
.predict .ex-ms { background: var(--card); border-color: var(--stroke); color: var(--accent-ink); }

/* 出口信息条：本机出口 · 延时徽章 · IP · 归属地 */
.ex-k { color: var(--dim); }
.ex-ms {
  padding: 0 6px;
  min-width: 46px;
  text-align: center;
  border-radius: 5px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent-ink);
  font-weight: 600;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  line-height: 18px;
}
.ex-ip {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--text);
  letter-spacing: .2px;
}
.ex-loc {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* ---------- 控制面板 ---------- */
.field { margin-bottom: 18px; position: relative; }

.field > label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.field .val {
  color: var(--accent-ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* 标签右侧的一句补充说明（「上传不经过节点」），比在下方再堆一行 hint 省地方 */
.lab-note { font-size: 11px; color: var(--dim); font-weight: 400; }

/* 上传模式下节点不参与测试：选择器压暗并挡住点击（panel.js 里也做了同样的判断，
   这里只是别让人白点一下）。菜单本身是隐藏的，不用一起处理。 */
.field-off .select { opacity: .5; pointer-events: none; }

.select-wrap { position: relative; }

.select {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 42px;
  padding: 0 13px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: var(--field);
  cursor: pointer;
  transition: border-color .16s, background .16s;
  user-select: none;
}
.select:hover { border-color: var(--stroke-strong); background: var(--raised); }
.select.open { border-color: var(--accent); background: var(--raised); }

.sel-name {
  flex: 1;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.caret {
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--muted);
  transition: transform .18s;
}
.select.open .caret { transform: rotate(180deg); }

/* 状态点：6px、降饱和。原来 7px 的高饱和绿排成一片像一排指示灯，
   缩一号并把绿压灰之后，红点才真的能"跳"出来。 */
.dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--dot);
  flex: none;
}
.dot.ok { background: var(--ok); }
.dot.fail { background: var(--danger); }
.dot.checking { background: var(--warn); animation: pulse 1s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .3; }
}

.menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  /* 28 条节点 + 5 个分组标题，一屏放不下，但也不宜压到下一页卡片上：
     380px ≈ 8 行，够扫一眼常用组，剩下的靠滚（分组标题跟着滚，位置有锚点感） */
  max-height: 380px;
  overflow-y: auto;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--stroke-strong);
  background: var(--raised);
  box-shadow: var(--shadow-pop);
}

.menu-filter {
  position: sticky;
  top: -6px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin: -6px -6px 4px;
  font-size: 12px;
  color: var(--muted);
  background: var(--raised);
  border-bottom: 1px solid var(--stroke);
  cursor: pointer;
  user-select: none;
}

.menu-filter:hover { color: var(--text); }

.mf-note { margin-left: auto; font-size: 11px; color: var(--dim); }

.box-chk {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  border-radius: 3px;
  border: 1px solid var(--stroke-strong);
  background: var(--raised);
  position: relative;
}

.box-chk.on {
  background: var(--accent);
  border-color: var(--accent);
}

.box-chk.on::after {
  content: '';
  position: absolute;
  left: 3.5px;
  top: 1px;
  width: 4px;
  height: 7px;
  border: solid #fff;
  border-width: 0 1.6px 1.6px 0;
  transform: rotate(42deg);
}

.health-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
}

.chk-line {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.chk-line:hover { color: var(--text); }

.menu-group {
  font-size: 11px;
  color: var(--dim);
  padding: 9px 10px 5px;
  letter-spacing: .5px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}
.menu-item:hover { background: var(--hover); }
.menu-item.active { background: var(--accent-soft); }

/* 「自动 · 4 节点并发」：它代表的不是某一条节点，而是 4 条不同源站的管道，
   语义比下面的条目重一档，所以加粗、并用一条内阴影与具体节点隔开
   （用 inset 而不是 border-bottom，圆角不会被切成直角）。 */
.menu-auto {
  margin-bottom: 4px;
  font-weight: 600;
  box-shadow: inset 0 -1px 0 var(--stroke);
}
.menu-auto.on { background: var(--accent-soft); }
.menu-auto.on .mi-name { color: var(--accent-ink); }
.menu-auto .mi-state { font-weight: 400; }

.mi-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mi-state {
  font-size: 11px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.hint { font-size: 11px; color: var(--dim); margin-top: 7px; }

input[type="range"] {
  width: 100%;
  height: 22px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 4px;
  background: var(--track);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px; height: 15px;
  margin-top: -5.5px;
  border-radius: 50%;
  background: var(--knob);
  border: 3px solid var(--accent);
  box-shadow: 0 1px 3px rgba(26, 26, 23, .14);
}

.row { display: flex; gap: 8px; }

input[type="number"] {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 13px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: var(--field);
  color: var(--text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  outline: none;
  transition: border-color .16s, background .16s;
}
input[type="number"]:focus { border-color: var(--accent); background: var(--raised); }
input[type="number"]::placeholder { color: var(--dim); }

.unit-sel {
  height: 42px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: var(--field);
  color: var(--text);
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

.bar {
  height: 3px;
  border-radius: 3px;
  background: var(--track);
  margin-top: 9px;
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width .4s;
}

.btn {
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .3px;
  color: #fff;
  cursor: pointer;
  transition: background .16s, opacity .16s;
  font-family: inherit;
}
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn.go { background: var(--accent); }
.btn.go:hover:not(:disabled) { background: var(--accent-hover); }
.btn.stop { background: var(--danger); }
.btn.stop:hover:not(:disabled) { background: var(--danger-hover); }
.btn.ghost {
  background: var(--raised);
  border: 1px solid var(--stroke);
  color: var(--muted);
  font-weight: 500;
  margin-top: 9px;
  height: 40px;
}
.btn.ghost:hover:not(:disabled) { background: var(--field); color: var(--text); border-color: var(--stroke-strong); }
.btn.small { width: auto; height: 34px; padding: 0 15px; font-size: 12px; margin: 0; }

.foot {
  margin-top: 13px;
  font-size: 11px;
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.foot .warn { color: var(--warn); flex: none; }
.foot .msg { color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 体检 ---------- */
.health-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.health-head h2 {
  margin: 0 0 3px;
  font-size: 14px;
  font-weight: 600;
}

.health-head p { margin: 0; font-size: 12px; color: var(--muted); }

.health-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 20px;
}

.node-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--row);
  font-size: 12px;
}

.nr-name { flex: none; min-width: 64px; }
.nr-group { font-size: 11px; color: var(--dim); flex: none; }
.nr-meta {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 45%;
}

.page-foot {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--stroke);
  text-align: center;
  font-size: 11px;
  line-height: 1.8;
  color: var(--dim);
}

.page-foot p { margin: 0; }

.page-foot p + p { margin-top: 3px; }

.page-foot .pf-legal { color: var(--muted); }

/* 页脚的本机 IP：小一号，居中，和免责声明隔开 */
.pf-ip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 9px;
  padding: 4px 11px;
  border-radius: 8px;
  border: 1px solid var(--stroke);
  background: var(--field);
  font-size: 11.5px;
  line-height: 20px;
}
.pf-ip .ex-ms { line-height: 16px; }
.pf-ip.is-fail { cursor: pointer; }
.pf-ip.is-fail .ex-ip { color: var(--danger); }
.pf-ip.is-fail:hover { background: rgba(var(--danger-rgb), .09); }

/* ---------- 响应式 ---------- */
@media (max-width: 880px) {
  .grid { grid-template-columns: 1fr; }
  .health-grid { grid-template-columns: 1fr; }
  .speed .num { font-size: 44px; letter-spacing: -1.8px; }
  .chart-box { height: 118px; margin: 12px 0 0; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; margin-top: 12px; padding-top: 12px; }
  .wrap { padding: 18px 14px calc(96px + env(safe-area-inset-bottom, 0px)); }
  .card { padding: 18px; }
  .health-head { flex-direction: column; }
  .br-none { display: none; }

  /* 手机端：主操作按钮固定在底部，保证「瞬时速率」和「开始」同屏可见 */
  .actions {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
    background: var(--card);
    border-top: 1px solid var(--stroke);
    box-shadow: var(--shadow-up);
  }
  .actions .btn { flex: 1; }
  .actions .btn.ghost {
    flex: none;
    width: auto;
    height: 46px;
    margin-top: 0;
    padding: 0 18px;
  }
}

.auto-note {
  color: var(--accent-ink);
  margin-top: 7px;
  line-height: 16px;
  min-height: 16px;          /* 常驻占位：提示未出现时也占一行，避免下方内容被顶开 */
  animation: fadein .25s ease;
}

.auto-note.is-empty { visibility: hidden; }

@keyframes fadein {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: none; }
}

.bg-line {
  margin-top: 13px;
  justify-content: center;
}

/* ---------- 条件渲染 ---------- */

/* VanJS 没有 v-if/v-show，条件渲染统一靠切换这个类（display:none 会连布局一起移除，
   语义等价于 v-if；需要保留占位时用 .is-empty 那套 visibility 方案）。 */
.hide { display: none !important; }
