/* ============================================================
   心仪数据 · 工具站 共享样式
   与首页同一套设计令牌；工具区背景比首页深一度，无渐变、无装饰图形。
   ============================================================ */

:root {
  /* 品牌色 · 九级（与首页一致） */
  --brand-50:  #eef4fe;
  --brand-100: #d9e6fd;
  --brand-200: #b8d1fb;
  --brand-300: #8ab2f7;
  --brand-400: #5a8ef2;
  --brand-500: #2f6fe8;
  --brand-600: #0b57d0;
  --brand-700: #0846ab;
  --brand-800: #073a8a;
  --brand-900: #062d69;

  /* 中性灰 · 九级（与首页一致） */
  --gray-50:  #fafbfc;
  --gray-100: #f5f7fa;
  --gray-200: #e4e9f0;
  --gray-300: #d3dae5;
  --gray-400: #b6c0cd;
  --gray-500: #8e9bab;
  --gray-600: #7d8a9b;
  --gray-700: #5c6a7c;
  --gray-800: #1d2a3d;

  /* 语义色 · 五组 × 三档（与首页一致） */
  --success-soft: #e6f4f1; --success: #0a8f80; --success-deep: #086b60;
  --warn-soft:    #fdf5e6; --warn:    #a86a12; --warn-deep:    #82500a;
  --danger-soft:  #fdecea; --danger:  #c0392b; --danger-deep:  #96261a;
  --info-soft:    #e8f0fe; --info:    #0b57d0; --info-deep:    #0842a0;
  --neutral-soft: #f2f4f7; --neutral: #5c6a7c; --neutral-deep: #34415a;

  /* 语义别名（与首页一致） */
  --ink: #0d1523;
  --ink-2: var(--gray-800);
  --muted: var(--gray-700);
  --muted-2: var(--gray-600);
  --line: var(--gray-200);
  --line-strong: var(--gray-300);
  --bg: #ffffff;
  --bg-soft: var(--gray-100);
  --bg-softer: var(--gray-50);
  --surface: #ffffff;
  --accent: var(--brand-600);
  --accent-hover: var(--brand-700);
  --accent-weak: var(--brand-50);
  --accent-line: var(--brand-200);

  --radius: 8px;
  --radius-lg: 10px;
  --ease: cubic-bezier(.22, .61, .36, 1);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", Arial, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", "Roboto Mono", ui-monospace, Menlo, Consolas, "Courier New", monospace;

  /* 工具区：容器宽度跟随视口，左右留白只由 --gutter 决定。
     原先这里还有 --wrap: clamp(1000px, 88vw, 1420px)，给容器设了 1420px 的硬上限：
     视口超过约 1613px 后容器不再增长，1920 下两侧各空 250px、2560 下各空 570px，
     大屏 / 放大窗口时右侧就是一条整片空白带。宽度交给视口和 gutter，不再设上限。 */
  --gutter: clamp(16px, 1.6vw, 36px);
  --header-h: 56px;
  --fs-body: 15px;

  /* 工具区底色：比首页白底深一度 */
  --tz-bg: #f4f6fa;
  --tz-bg-alt: #eef1f7;
  --tz-card: #ffffff;
  --tz-line: #e2e7ef;
  --tz-line-2: #d3dae5;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e9f0f7;
  --ink-2: #cfdae7;
  --muted: #a2b3c6;
  --muted-2: #8598ae;
  --line: #1b2a3d;
  --line-strong: #273a51;
  --bg: #0b1220;
  --bg-soft: #0f1b2b;
  --bg-softer: #0d1726;
  --surface: #0f1b2b;
  --accent: var(--brand-300);
  --accent-hover: var(--brand-200);
  --accent-weak: rgba(90, 142, 242, .14);
  --accent-line: rgba(90, 142, 242, .3);
  --success-soft: rgba(79, 207, 180, .12); --success: #4fcfb4; --success-deep: #7ee2c4;
  --warn-soft: rgba(224, 176, 114, .12);   --warn: #e0b072;   --warn-deep: #f0c777;
  --danger-soft: rgba(240, 138, 122, .12); --danger: #f08a7a; --danger-deep: #ffb3a6;
  --info-soft: rgba(90, 142, 242, .14);    --info: #8ab2f7;   --info-deep: #b8d1fb;
  --neutral-soft: rgba(162, 179, 198, .1); --neutral: #a2b3c6; --neutral-deep: #cfdae7;

  /* 工具区底比首页再深一度 */
  --tz-bg: #070e18;
  --tz-bg-alt: #0b1421;
  --tz-card: #0d1726;
  --tz-line: #1b2a3d;
  --tz-line-2: #273a51;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: light; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--ink);
  background: var(--tz-bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p, ul, ol, figure, pre { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
svg { display: block; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.wrap {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ============ 顶栏 ============ */
.th {
  position: sticky; top: 0; z-index: 40;
  background: var(--tz-card);
  border-bottom: 1px solid var(--tz-line);
}
.th__in { display: flex; align-items: center; gap: 14px; height: var(--header-h); }
.th__logo { display: flex; align-items: center; gap: 8px; flex: none; }
.th__mark {
  width: 24px; height: 24px; border-radius: 6px; background: var(--brand-600);
  display: grid; place-items: center; color: #fff; flex: none;
}
.th__mark svg { width: 15px; height: 15px; stroke-width: 1.9; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
.th__name { font-size: 15px; font-weight: 700; letter-spacing: .01em; }
.th__sep { color: var(--muted-2); font-size: 13px; }
.th__sec { font-size: 13px; font-weight: 500; color: var(--muted); }

.th__nav { display: flex; align-items: center; gap: 2px; margin-left: 10px; }
.th__nav a {
  padding: 6px 10px; border-radius: 6px; font-size: 13.5px; color: var(--muted);
  white-space: nowrap; transition: color .16s, background .16s;
}
.th__nav a:hover { color: var(--ink); background: var(--bg-soft); }
.th__nav a.is-on { color: var(--accent); background: var(--accent-weak); }

.th__act { display: flex; align-items: center; gap: 6px; margin-left: auto; flex: none; }
.th__home { font-size: 13.5px; color: var(--muted); padding: 6px 10px; border-radius: 6px; transition: color .16s, background .16s; }
.th__home:hover { color: var(--ink); background: var(--bg-soft); }
.th__mode {
  width: 32px; height: 32px; display: grid; place-items: center;
  border: 1px solid var(--tz-line-2); border-radius: 6px;
  background: var(--tz-card); color: var(--muted);
  transition: color .16s, border-color .16s;
}
.th__mode:hover { color: var(--ink); border-color: var(--muted-2); }
.th__mode svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
html[data-theme="dark"] .th__mode .i-sun,
html[data-theme="light"] .th__mode .i-moon { display: none; }
html:not([data-theme]) .th__mode .i-sun { display: none; }

/* ============ 面包屑 / 页头 ============ */
.crumb { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted-2); padding-top: 20px; }
.crumb a { transition: color .16s; }
.crumb a:hover { color: var(--accent); }
.crumb span { color: var(--gray-400); }

.page-head { padding: 18px 0 4px; }
.page-head h1 { font-size: 26px; font-weight: 650; letter-spacing: -.01em; line-height: 1.3; }
.page-head p { margin-top: 6px; font-size: 14px; color: var(--muted); max-width: 700px; }
.page-head .count { margin-top: 8px; font-size: 12.5px; color: var(--muted-2); }

/* ============ 搜索 ============ */
.search { position: relative; margin-top: 18px; }
.search__icon {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; stroke: var(--muted-2); fill: none;
  stroke-width: 1.8; stroke-linecap: round; pointer-events: none;
}
.search input {
  width: 100%; height: 42px; padding: 0 84px 0 38px;
  border: 1px solid var(--tz-line-2); border-radius: var(--radius);
  background: var(--tz-card); font-size: 14.5px;
  transition: border-color .16s, box-shadow .16s;
}
.search input::placeholder { color: var(--muted-2); }
.search input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-weak);
}
.search__hint {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted-2);
  pointer-events: none;
}
.search__hint kbd {
  font-family: var(--mono); font-size: 11px; line-height: 1;
  padding: 3px 5px; border: 1px solid var(--tz-line-2); border-radius: 4px;
  background: var(--bg-soft); color: var(--muted);
}

/* ============ 两栏布局 ============ */
.tools-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 32px;
  align-items: start;
  padding: 22px 0 56px;
}
.tools-main { min-width: 0; }

/* ============ 分类 ============ */
.cat { margin-bottom: 26px; }
.cat:last-child { margin-bottom: 0; }
.cat__head {
  display: flex; align-items: baseline; gap: 8px;
  padding-bottom: 9px; border-bottom: 1px solid var(--tz-line);
}
.cat__title { font-size: 14.5px; font-weight: 600; letter-spacing: .01em; }
.cat__count { font-size: 12px; color: var(--muted-2); margin-left: auto; }
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(226px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.tool-card {
  display: block;
  padding: 11px 13px 12px;
  border: 1px solid var(--tz-line);
  border-radius: var(--radius);
  background: var(--tz-card);
  transition: border-color .16s, background .16s;
}
a.tool-card:hover { border-color: var(--brand-300); background: var(--accent-weak); }
html[data-theme="dark"] a.tool-card:hover { border-color: var(--accent-line); }
.tool-card__name { font-size: 14px; font-weight: 500; color: var(--ink); display: block; }
.tool-card__desc { margin-top: 3px; font-size: 12.5px; line-height: 1.55; color: var(--muted); display: block; }
.tool-card mark { background: var(--brand-100); color: var(--brand-800); border-radius: 2px; padding: 0 1px; }
html[data-theme="dark"] .tool-card mark { background: rgba(90,142,242,.24); color: #d9e6fd; }
.tool-card[aria-disabled="true"] { cursor: default; background: var(--tz-bg-alt); }
.tool-card[aria-disabled="true"] .tool-card__name { color: var(--muted); }
.tool-card[aria-disabled="true"] .tool-card__desc { color: var(--muted-2); }
.tool-card[aria-disabled="true"]::after {
  content: "即将上线";
  display: inline-block;
  margin-top: 7px;
  padding: 0 4px;
  border: 1px solid var(--tz-line-2);
  border-radius: 3px;
  font-size: 10.5px;
  line-height: 1.55;
  letter-spacing: .02em;
  color: var(--muted-2);
}

.cat[hidden], .tool-card[hidden] { display: none; }

.empty {
  display: none;
  padding: 40px 0 56px;
  border-top: 1px solid var(--tz-line);
}
.empty.is-on { display: block; }
.empty p { font-size: 14.5px; color: var(--muted); }
.empty strong { color: var(--ink); font-weight: 600; }
.empty button {
  margin-top: 12px; height: 32px; padding: 0 12px; font-size: 13px;
  border: 1px solid var(--tz-line-2); border-radius: 6px; background: var(--tz-card);
  transition: border-color .16s, color .16s;
}
.empty button:hover { border-color: var(--accent); color: var(--accent); }

/* ============ 侧栏：常用工具 ============ */
.aside { position: sticky; top: calc(var(--header-h) + 20px); }
.aside__box {
  border: 1px solid var(--tz-line); border-radius: var(--radius-lg);
  background: var(--tz-card); padding: 14px 14px 12px;
}
.aside__title {
  font-size: 12px; font-weight: 600; letter-spacing: .06em; color: var(--muted-2);
  text-transform: none; margin-bottom: 8px;
}
.aside__list { display: flex; flex-direction: column; }
.aside__list a, .aside__list .off {
  display: flex; align-items: baseline; gap: 8px;
  padding: 7px 0; border-bottom: 1px solid var(--tz-line);
  font-size: 13.5px; transition: color .16s;
}
.aside__list .off { color: var(--muted); cursor: default; }
.aside__list li:last-child a,
.aside__list li:last-child .off { border-bottom: 0; }
.aside__list a:hover { color: var(--accent); }
.aside__list .n { font-family: var(--mono); font-size: 11.5px; color: var(--muted-2); }
.aside__note { margin-top: 10px; font-size: 12px; line-height: 1.6; color: var(--muted-2); }

/* ============ 工具页 ============ */
.tool-head { padding: 14px 0 0; }
.tool-head h1 { font-size: 27px; font-weight: 650; letter-spacing: -.01em; line-height: 1.28; }
.tool-head .lead { margin-top: 7px; font-size: 14.5px; color: var(--muted); max-width: 720px; }

.panel {
  margin-top: 18px;
  border: 1px solid var(--tz-line);
  border-radius: var(--radius-lg);
  background: var(--tz-card);
  padding: 18px;
}
.panel + .panel { margin-top: 12px; }
.tool-cols {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin-top: 18px;
}
.tool-cols > .panel { margin-top: 0; }
.calc-fields { display: flex; flex-direction: column; gap: 16px; }
.panel__head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--tz-line);
}
.panel__title { font-size: 13px; font-weight: 600; letter-spacing: .02em; color: var(--ink-2); }
.panel__head .sp { margin-left: auto; }

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label { font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.field .unit {
  display: flex; align-items: center;
  border: 1px solid var(--tz-line-2); border-radius: 7px; background: var(--tz-card);
  transition: border-color .16s, box-shadow .16s;
}
.field .unit:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
.field .unit input {
  flex: 1; min-width: 0; height: 38px; border: 0; background: transparent;
  padding: 0 10px; font-family: var(--mono); font-size: 15px;
  -moz-appearance: textfield;
}
.field .unit input::-webkit-outer-spin-button,
.field .unit input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.field .unit input:focus { outline: none; }
.field .unit .suffix {
  padding-right: 10px; font-size: 12px; color: var(--muted-2); flex: none;
}
.field .tip { font-size: 11.5px; line-height: 1.5; color: var(--muted-2); }

/* ============ 下拉控件（assets/select.css 的宿主样式） ============ */
/* select.js 接管 select.select 后，原生 select 被隐藏，可见按钮带 .select 类。
   select.css 依赖 --surface / --ink / --line-strong / --accent / --accent-weak / --muted，
   这些变量在 :root 与 html[data-theme="dark"] 中都已定义，深浅色无需另外映射。 */
.select {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--tz-line-2);
  border-radius: 7px;
  background: var(--tz-card);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.2;
  transition: border-color .16s, box-shadow .16s;
}
.select:hover { border-color: var(--muted-2); }
.select:focus-visible,
.select[aria-expanded="true"] {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-weak);
}

/* 结果区 */
.res {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 1px;
  background: var(--tz-line);
  border: 1px solid var(--tz-line);
  border-radius: var(--radius);
  overflow: hidden;
}
.res__cell { background: var(--tz-card); padding: 12px 14px; }
.res__k { font-size: 11.5px; color: var(--muted-2); }
.res__v {
  margin-top: 4px; font-family: var(--mono); font-size: 22px; font-weight: 600;
  letter-spacing: -.02em; line-height: 1.2;
}
.res__v small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.res__note { margin-top: 3px; font-size: 11.5px; color: var(--muted-2); }

/* 结论 / 解读 */
.readout { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.readout__lead {
  padding: 12px 14px; border-radius: var(--radius);
  background: var(--accent-weak); border: 1px solid var(--accent-line);
  font-size: 14px; line-height: 1.75; color: var(--ink-2);
}
.readout__lead b { color: var(--accent); font-family: var(--mono); font-size: 15px; }
.readout__p { font-size: 13.5px; line-height: 1.8; color: var(--muted); }
.readout__p b { color: var(--ink-2); font-weight: 600; }
.readout__warn {
  padding: 10px 12px; border-radius: var(--radius);
  background: var(--warn-soft); border: 1px solid var(--warn);
  font-size: 13px; line-height: 1.7; color: var(--warn-deep);
}

/* 档位表 */
.tier-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tier-table th, .tier-table td {
  padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--tz-line);
  white-space: nowrap;
}
.tier-table th { font-size: 11.5px; font-weight: 600; color: var(--muted-2); letter-spacing: .02em; }
.tier-table td { color: var(--ink-2); }
.tier-table td.mono { font-family: var(--mono); }
.tier-table tr:last-child td { border-bottom: 0; }
.tier-table tr.is-pick td { background: var(--accent-weak); color: var(--ink); font-weight: 500; }
.tier-table tr.is-pick td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.tier-scroll { overflow-x: auto; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: 7px;
  border: 1px solid var(--tz-line-2); background: var(--tz-card);
  font-size: 13px; font-weight: 500; color: var(--ink-2);
  transition: border-color .16s, color .16s, background .16s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn--primary { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.btn--primary:hover { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.btn--sm { height: 29px; padding: 0 10px; font-size: 12.5px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- 工具面板内的小按钮 ----------
   site-chrome.css 里 [data-xc="sub"] .btn 是给站点头部/移动抽屉用的：
   它把边框设成 transparent、又不设底色，权重 (0,2,0) 高于本文件的 .btn (0,1,0)，
   且 site-chrome.css 加载在后，于是工具面板里所有 <button class="btn"> 只剩一行文字。
   用 `[data-xc="sub"] main button.btn` 限定到正文里的 button：
   权重 (0,2,2) 能压过站点头部规则，同时不会碰到 <a class="btn"> 的 CTA 卡片按钮，
   也不会碰到 header / mobile-nav（都在 main 之外）。
   页面内的 .gb-dir .btn 这类布局规则权重较低，只影响 flex/宽度，仍按原样生效。 */
[data-xc="sub"] main button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 13px; border-radius: 7px;
  border: 1px solid var(--tz-line-2); background: var(--tz-card);
  font-size: 13px; font-weight: 500; line-height: 1; color: var(--ink-2);
  white-space: nowrap; text-decoration: none;
  transition: background .16s, border-color .16s, color .16s;
}
[data-xc="sub"] main button.btn--sm { height: 29px; padding: 0 10px; border-radius: 6px; font-size: 12.5px; }
[data-xc="sub"] main button.btn--primary { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }

/* 悬停/按下/聚焦：次要按钮染上品牌色，主操作用更深的蓝，危险操作用红 */
[data-xc="sub"] main button.btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); background: var(--accent-weak); }
[data-xc="sub"] main button.btn--primary:hover:not(:disabled) { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
[data-xc="sub"] main button.btn:active:not(:disabled) { transform: translateY(1px); }
[data-xc="sub"] main button.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 危险操作（清空/删除）：静止态就是淡红，和次要按钮一眼能分开 */
[data-xc="sub"] main button.btn--danger { background: var(--danger-soft); border-color: var(--danger-soft); color: var(--danger); }
[data-xc="sub"] main button.btn--danger:hover:not(:disabled) { background: var(--danger); border-color: var(--danger); color: var(--tz-card); }

/* 分段切换的选中态：编码/解码、加密/解密这类成组按钮 */
[data-xc="sub"] main button.btn.is-on,
[data-xc="sub"] main button.btn.is-on:hover:not(:disabled) {
  background: var(--accent-weak); border-color: var(--accent); color: var(--accent);
}

[data-xc="sub"] main button.btn:disabled { opacity: .45; cursor: not-allowed; }

@media (max-width: 38.75em) {
  [data-xc="sub"] main button.btn { height: 32px; padding: 0 11px; }
  [data-xc="sub"] main button.btn--sm { height: 30px; padding: 0 10px; }
}

/* JSON 编辑器 */
.json-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}
.json-pane { display: flex; flex-direction: column; min-width: 0; }
.json-pane textarea.editor, .json-pane pre.output { flex: 1 1 auto; }
.json-pane__head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px; font-size: 12px; color: var(--muted-2);
}
.json-pane__head .sp { margin-left: auto; }
textarea.editor {
  width: 100%; min-height: 300px; resize: vertical;
  padding: 12px; border: 1px solid var(--tz-line-2); border-radius: var(--radius);
  background: var(--tz-card); color: var(--ink);
  font-family: var(--mono); font-size: 13px; line-height: 1.7;
  tab-size: 2;
}
textarea.editor:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
pre.output {
  min-height: 300px; max-height: 560px; overflow: auto;
  padding: 12px; border: 1px solid var(--tz-line); border-radius: var(--radius);
  background: var(--bg-softer); color: var(--ink-2);
  font-family: var(--mono); font-size: 13px; line-height: 1.7;
  white-space: pre; tab-size: 2;
}
pre.output:empty::before { content: "结果会显示在这里"; color: var(--muted-2); }

.status {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 12px; border-radius: var(--radius);
  font-size: 12.5px; line-height: 1.65;
  border: 1px solid transparent;
}
.status--idle { background: var(--neutral-soft); color: var(--muted); }
.status--ok { background: var(--success-soft); color: var(--success-deep); border-color: var(--success); }
.status--err { background: var(--danger-soft); color: var(--danger-deep); border-color: var(--danger); }
.status b { font-weight: 600; }
.status .mono { font-size: 12px; }

.err-snippet {
  margin-top: 8px; padding: 10px 12px; overflow-x: auto;
  border: 1px solid var(--danger); border-radius: var(--radius);
  background: var(--bg-softer);
  font-family: var(--mono); font-size: 12.5px; line-height: 1.7;
  color: var(--ink-2); white-space: pre;
}
.err-snippet .ln { color: var(--muted-2); user-select: none; }
.err-snippet .caret { color: var(--danger); font-weight: 700; }

.stats { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; font-size: 12px; color: var(--muted-2); }
.stats b { font-family: var(--mono); color: var(--ink-2); font-weight: 500; }

/* ============ 说明正文（按文章规格） ============ */
/* 正文限宽 760px（中文约 32-35 字/行），宽屏时右侧补本页目录，不留空 */
.article-grid {
  display: grid;
  grid-template-columns: minmax(0, 760px) minmax(220px, 280px);
  column-gap: clamp(24px, 4vw, 72px);
  align-items: start;
}
.article {
  max-width: 760px;
  min-width: 0;
  margin-top: 40px;
  padding-top: 26px;
  border-top: 1px solid var(--tz-line);
}
.article h2, .article h3 { scroll-margin-top: calc(var(--header-h) + 18px); }

.article-rail {
  position: sticky;
  top: calc(var(--header-h) + 18px);
  margin-top: 40px;
  padding-top: 26px;
  border-top: 1px solid var(--tz-line);
}
.article-rail__title {
  font-size: 12px; font-weight: 600; letter-spacing: .04em;
  color: var(--muted-2);
}
.article-rail ol { margin-top: 10px; padding: 0; list-style: none; display: grid; gap: 1px; }
.article-rail a {
  display: block; padding: 5px 0 5px 10px;
  font-size: 12.5px; line-height: 1.6; color: var(--muted);
  border-left: 2px solid transparent;
  transition: color .16s, border-color .16s;
}
.article-rail a:hover { color: var(--accent); border-left-color: var(--accent-line); }

@media (max-width: 68.75em) {          /* 1100px 以下收起右侧目录 */
  .article-grid { grid-template-columns: minmax(0, 1fr); }
  .article-rail { display: none; }
}
.article h2 {
  font-size: 19px; font-weight: 600; letter-spacing: -.005em;
  margin-top: 34px; line-height: 1.5;
}
.article h2:first-child { margin-top: 0; }
.article h3 { font-size: 15px; font-weight: 600; margin-top: 22px; }
.article p {
  margin-top: 11px;
  font-size: 15px; line-height: 1.9; color: var(--ink-2);
}
.article ul, .article ol {
  margin-top: 11px; padding-left: 1.25em;
  font-size: 15px; line-height: 1.9; color: var(--ink-2);
}
.article ul { list-style: disc; }
.article ol { list-style: decimal; }
.article li { margin-top: 5px; }
.article li::marker { color: var(--muted-2); }
.article code {
  font-family: var(--mono); font-size: 13px;
  padding: 1px 5px; border-radius: 4px;
  background: var(--bg-soft); border: 1px solid var(--tz-line);
  color: var(--ink);
  /* 长参数 / 长哈希在窄屏不许撑破正文容器 */
  overflow-wrap: anywhere; word-break: break-word;
}
.article p, .article li, .article td { overflow-wrap: anywhere; }
/* 面板 / 提示里的行内代码同样是长串来源（appId、scheme 示例等） */
.panel code, .ap-fixed code, .lead code { overflow-wrap: anywhere; word-break: break-word; }
.article strong { color: var(--ink); font-weight: 600; }
.article .note {
  margin-top: 16px; padding: 12px 14px;
  border-left: 2px solid var(--accent-line);
  background: var(--bg-softer);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 14px; line-height: 1.85; color: var(--muted);
}
.article .note b { color: var(--ink-2); }
.article table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 14px; }
.article th, .article td {
  padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--tz-line);
  line-height: 1.7;
}
.article th { font-size: 12.5px; font-weight: 600; color: var(--muted-2); }
.article td { color: var(--ink-2); }

/* ============ 相关工具 ============ */
.related { margin-top: 38px; padding-top: 24px; border-top: 1px solid var(--tz-line); }
.related__title { font-size: 13px; font-weight: 600; color: var(--muted-2); letter-spacing: .02em; }
.related__grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px; margin-top: 12px;
}

/* ============ 页脚 ============ */
.tf { border-top: 1px solid var(--tz-line); margin-top: 44px; }
.tf__in {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 20px;
  padding: 18px 0 26px; font-size: 12.5px; color: var(--muted-2);
}
.tf__in nav { display: flex; gap: 16px; margin-left: auto; }
.tf__in a { transition: color .16s; }
.tf__in a:hover { color: var(--accent); }

/* ============ 响应式 ============ */
@media (max-width: 62.5em) {           /* 1000px */
  .tools-layout { grid-template-columns: 1fr; gap: 20px; padding-top: 18px; }
  .tool-cols { grid-template-columns: minmax(0, 1fr); }
  .aside { position: static; order: -1; }
  .aside__box { padding: 12px; }
  .aside__list { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .aside__list li { flex: 0 0 auto; }
  .aside__list a, .aside__list .off {
    padding: 6px 10px; border: 1px solid var(--tz-line); border-radius: 6px;
    font-size: 13px;
  }
  .aside__list li:last-child a,
  .aside__list li:last-child .off { border-bottom: 1px solid var(--tz-line); }
  .aside__list .n { display: none; }
  .aside__note { display: none; }
}

@media (max-width: 51.25em) {          /* 820px */
  .th__nav { display: none; }
  .json-grid { grid-template-columns: 1fr; }
  textarea.editor, pre.output { min-height: 220px; }
  .article { margin-top: 32px; }
}

@media (max-width: 38.75em) {          /* 620px */
  :root { --fs-body: 14.5px; }
  .page-head h1 { font-size: 22px; }
  .tool-head h1 { font-size: 22px; }
  .panel { padding: 14px; }
  .search input { padding-right: 16px; }
  .search__hint { display: none; }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .tool-card { padding: 10px 11px; }
  .tool-card__name { font-size: 13.5px; }
  .tool-card__desc { font-size: 12px; }
  .res { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .res__v { font-size: 19px; }
  .article p, .article ul, .article ol { font-size: 14.5px; line-height: 1.88; }
  .article h2 { font-size: 17.5px; }
  .tf__in nav { margin-left: 0; }
}

@media (max-width: 23.75em) {          /* 380px */
  .tool-grid { grid-template-columns: 1fr; }
  .tool-head h1 { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- 移动端底部导航（工具站全部页面） ---------- */
.tool-mobile-nav { display: none; }
@media (max-width: 51.25em) {
  body { padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px)); }
  .tool-mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 44;
    display: flex;
    align-items: stretch;
    padding: 5px 8px calc(5px + env(safe-area-inset-bottom, 0px));
    background: var(--surface);
    border-top: 1px solid var(--tz-line);
    box-shadow: 0 -12px 30px -24px rgba(13, 21, 35, .55);
  }
  .tool-mobile-nav a {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 9px 4px;
    border-radius: 6px;
    color: var(--tz-muted, #5c6a7c);
    font-size: 12px;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
  }
  .tool-mobile-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-weak); font-weight: 600; }
  .tf { padding-bottom: 24px; }
}

/* TOOL-CTA:CSS:START */
/* ============ 工具页 CTA（相关产品 + 工单） ============ */
.t-cta {
  margin-top: 26px;
  padding: 20px;
  border: 1px solid var(--tz-line);
  border-radius: var(--radius-lg);
  background: var(--tz-card);
}
.t-cta__head { display: flex; flex-direction: column; gap: 3px; }
.t-cta__title { font-size: 15px; font-weight: 650; color: var(--ink); letter-spacing: -.005em; line-height: 1.45; }
.t-cta__sub { font-size: 13px; line-height: 1.65; color: var(--muted); max-width: 780px; }
.t-cta__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.t-cta__card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--tz-line);
  border-radius: var(--radius);
  background: var(--tz-bg-alt);
}
.t-cta__card--product { border-color: var(--accent-line); background: var(--accent-weak); }
.t-cta__kicker { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; color: var(--muted-2); }
.t-cta__name { font-size: 15px; font-weight: 650; color: var(--ink); }
.t-cta__desc { font-size: 12.5px; line-height: 1.6; color: var(--muted); overflow-wrap: anywhere; }
.t-cta__btn { margin-top: 8px; align-self: flex-start; }
@media (max-width: 48em) {
  .t-cta { padding: 16px; }
  .t-cta__grid { grid-template-columns: minmax(0, 1fr); }
}
/* TOOL-CTA:CSS:END */

/* ============================================================
   颜色与样式工具 / 表格编辑器（渐变、配色、阴影、取色、Markdown 表格）
   ============================================================ */
.cf-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
input[type="color"].csw-color {
  width: 44px; height: 38px; flex: none; padding: 2px;
  border: 1px solid var(--tz-line-2); border-radius: 7px;
  background: var(--tz-card); cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
input[type="color"].csw-color::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"].csw-color::-webkit-color-swatch { border: 0; border-radius: 4px; }
input[type="color"].csw-color::-moz-color-swatch { border: 0; border-radius: 4px; }

.slider {
  width: 100%; height: 38px; margin: 0; flex: 1; min-width: 80px;
  background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer;
}
.slider::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: var(--tz-line-2); }
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; margin-top: -5px;
  border-radius: 50%; background: var(--accent); border: 2px solid var(--tz-card);
  box-shadow: 0 0 0 1px var(--accent-line);
}
.slider::-moz-range-track { height: 6px; border-radius: 3px; background: var(--tz-line-2); }
.slider::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%; background: var(--accent);
  border: 2px solid var(--tz-card); box-shadow: 0 0 0 1px var(--accent-line);
}
.slider:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.chk input { width: 15px; height: 15px; accent-color: var(--accent); }

.stop-list { display: flex; flex-direction: column; gap: 8px; }
.stop { display: grid; grid-template-columns: 44px minmax(0, 1fr) 96px 30px; gap: 8px; align-items: center; min-width: 0; }
.stop__hex {
  width: 100%; min-width: 0; height: 38px; padding: 0 10px;
  border: 1px solid var(--tz-line-2); border-radius: 7px;
  background: var(--tz-card); font-size: 14px;
}
.stop__hex:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
.stop__pos { display: flex; align-items: center; gap: 6px; min-width: 0; }
.stop__pos .slider { height: 30px; }
.stop__pos .mono { font-size: 12px; color: var(--muted); flex: none; width: 34px; text-align: right; }
.stop__del { width: 30px; padding: 0; height: 30px; line-height: 1; }

.grad-preview {
  height: 240px; border-radius: var(--radius);
  border: 1px solid var(--tz-line); background: var(--tz-bg-alt);
}

.sw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 10px; margin-top: 10px; }
.sw {
  display: block; width: 100%; padding: 0; text-align: left; overflow: hidden;
  border: 1px solid var(--tz-line); border-radius: var(--radius);
  background: var(--tz-card); font: inherit; color: inherit;
}
.sw--btn { cursor: pointer; transition: border-color .16s; }
.sw--btn:hover { border-color: var(--accent-line); }
.sw__chip { display: block; height: 58px; }
.sw__body { display: block; padding: 8px 10px 10px; }
.sw__hex { display: block; font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: .01em; }
.sw__meta { display: block; margin-top: 2px; font-size: 11.5px; line-height: 1.5; color: var(--muted-2); }

.p-sub { margin-top: 20px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.scale { display: flex; gap: 2px; height: 56px; border-radius: var(--radius); overflow: hidden; }
.scale__item { flex: 1; min-width: 0; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 4px; }
.scale__item span { font-family: var(--mono); font-size: 9.5px; color: rgba(255, 255, 255, .72); }

.preview-box {
  display: grid; place-items: center; min-height: 230px; padding: 28px;
  border: 1px dashed var(--tz-line-2); border-radius: var(--radius); background: var(--tz-bg-alt);
}
.demo-card {
  width: 100%; max-width: 300px; padding: 26px 20px; text-align: center;
  background: var(--tz-card); border-radius: 10px; font-size: 14px; color: var(--ink-2);
}

.drop {
  display: grid; place-items: center; gap: 6px; padding: 34px 18px; text-align: center;
  border: 1px dashed var(--tz-line-2); border-radius: var(--radius);
  background: var(--tz-bg-alt); transition: border-color .16s, background .16s;
}
.drop p { font-size: 14px; }
.drop.is-over { border-color: var(--accent); background: var(--accent-weak); }

.ic-stage { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.ic-stage canvas {
  display: block; max-width: 100%; height: auto; cursor: crosshair;
  border: 1px solid var(--tz-line); border-radius: var(--radius); background: var(--tz-bg-alt);
}
.ic-meta { font-size: 12px; color: var(--muted-2); }

.pick-chip {
  width: 28px; height: 28px; flex: none; border-radius: 6px;
  border: 1px solid var(--tz-line-2); background: var(--tz-bg-alt);
}
.pick-chip + .mono { font-size: 13px; min-width: 0; word-break: break-all; }

.tbl-wrap { overflow-x: auto; padding-bottom: 4px; }
.tbl-editor { border-collapse: collapse; width: 100%; min-width: 480px; }
.tbl-editor th, .tbl-editor td { border: 1px solid var(--tz-line); padding: 0; vertical-align: top; }
.tbl-editor th { background: var(--tz-bg-alt); }
.tbl-editor input {
  width: 100%; min-width: 90px; border: 0; padding: 9px 10px;
  background: transparent; font-size: 13.5px;
}
.tbl-editor input:focus { outline: none; background: var(--accent-weak); }
.tbl-editor .tbl-align {
  width: calc(100% - 8px); height: 30px; margin: 0 4px 4px; font-size: 12px;
}

/* Markdown 教程入口：工具标题下方的独立入口，不参与正文层级 */
.md-guide-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 12px; }
.md-guide {
  display: inline-flex; align-items: center; gap: 9px; min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--accent-line); border-radius: var(--radius);
  background: var(--accent-weak);
  font-size: 13.5px; line-height: 1.5;
  transition: border-color .16s, background .16s;
}
.md-guide:hover { border-color: var(--accent); }
.md-guide__k {
  flex: none; padding: 1px 6px; border-radius: 4px;
  background: var(--accent); color: #fff;
  font-size: 11.5px; font-weight: 600; letter-spacing: .02em;
}
.md-guide__t { min-width: 0; color: var(--ink-2); }
.md-guide__i { width: 15px; height: 15px; flex: none; color: var(--accent); }
.md-guide__more { font-size: 12.5px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.md-guide__more:hover { color: var(--accent); }

/* Markdown 语法速查：默认折叠，展开后是表格与示例 */
.md-ref-box {
  margin-top: 22px;
  border: 1px solid var(--tz-line); border-radius: var(--radius);
  background: var(--tz-card);
}
.md-ref-box > summary {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  list-style: none; cursor: pointer;
}
.md-ref-box > summary::-webkit-details-marker { display: none; }
.md-ref-box > summary:hover .md-ref-box__t { color: var(--accent); }
.md-ref-box__t { flex: none; font-size: 14px; font-weight: 600; color: var(--ink-2); transition: color .16s; }
.md-ref-box__s {
  min-width: 0; font-size: 12.5px; color: var(--muted-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.md-ref-box__i {
  margin-left: auto; width: 16px; height: 16px; flex: none;
  color: var(--muted-2); transition: transform .18s var(--ease);
}
.md-ref-box[open] .md-ref-box__i { transform: rotate(180deg); }
.md-ref-box__body { padding: 2px 14px 16px; border-top: 1px solid var(--tz-line); }
.md-ref-box__body > p { margin-top: 12px; font-size: 14.5px; line-height: 1.85; color: var(--ink-2); }
.md-ref-box__body h3 { margin-top: 26px; font-size: 15px; font-weight: 600; color: var(--ink); }
.md-ref-box__body h4 { margin-top: 18px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.md-ref-box__body ol { margin-top: 10px; padding-left: 1.4em; list-style: decimal; }
.md-ref-box__body li { margin-top: 5px; font-size: 14.5px; line-height: 1.85; color: var(--ink-2); }
.md-ref-box__body li::marker { color: var(--muted-2); }
.md-ref-box__body code {
  font-family: var(--mono); font-size: 12.5px;
  padding: 1px 5px; border-radius: 4px;
  background: var(--bg-soft); border: 1px solid var(--tz-line); color: var(--ink);
}
.md-ref-box .note {
  margin-top: 18px; padding: 11px 13px;
  border-left: 2px solid var(--accent-line);
  background: var(--bg-softer);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 13.5px; line-height: 1.8; color: var(--muted);
}
.md-ref-box .note b { color: var(--ink-2); }
.md-ref-box .note a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.md-ref-box table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 14px; }
.md-ref-box th, .md-ref-box td {
  padding: 8px 10px; text-align: left;
  border-bottom: 1px solid var(--tz-line); line-height: 1.7;
}
.md-ref-box th { font-size: 12.5px; font-weight: 600; color: var(--muted-2); }
.md-ref-box td { color: var(--ink-2); }

/* 示例代码与对照表 */
.md-snip {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--tz-line);
  border-radius: var(--radius);
  background: var(--bg-softer);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.78;
  white-space: pre;
  overflow-x: auto;
}
.md-ref { min-width: 560px; }
.md-ref code { white-space: nowrap; }

@media (max-width: 38.75em) {
  .stop { grid-template-columns: 40px minmax(0, 1fr) 78px 28px; gap: 6px; }
  .sw-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grad-preview { height: 180px; }
  .preview-box { min-height: 190px; padding: 18px; }
  .scale__item span { display: none; }
  .md-guide { display: flex; width: 100%; }
  .md-guide__t { flex: 1 1 auto; }
  .md-ref-box__s { display: none; }
  .md-ref-box__body { padding: 2px 12px 14px; }
}

/* ============================================================
   上游状态（宝塔拨测）：小绿点只在真实可用时呼吸，其余状态各有颜色。
   索引页卡片与工具页头部共用同一套 data-state / data-up 取值。
   ============================================================ */
.up-state {
  display: inline-flex; align-items: center;
  line-height: 1;
}
/* 不显示文字，只留圆点；除颜色外再用形状与动效区分状态，不只靠色彩传达。 */
.up-state .up-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gray-400); flex: none; box-sizing: border-box;
}
.up-state[data-state="on"] .up-dot {
  background: #16a34a;
  animation: up-pulse 2.2s var(--ease) infinite;
}
.up-state[data-state="warn"] .up-dot {
  background: transparent; border: 2px solid var(--warn);
}
.up-state[data-state="err"] .up-dot {
  background: var(--danger); border-radius: 2px;
}
.up-state[data-state="off"] .up-dot {
  background: transparent; border: 1px solid var(--gray-400);
}
.up-state[data-state="loading"] .up-dot {
  background: transparent; border: 1px dashed var(--gray-400);
  animation: up-blink 1.2s ease-in-out infinite;
}

@keyframes up-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(22, 163, 74, .45); }
  70%  { box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}
@keyframes up-blink {
  0%, 100% { opacity: .35; }
  50%      { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .up-state[data-state="on"] .up-dot,
  .up-state[data-state="loading"] .up-dot { animation: none; }
}

.up-banner {
  margin-top: 14px; padding: 10px 12px;
  border: 1px solid var(--warn); border-radius: var(--radius);
  background: var(--warn-soft); color: var(--warn-deep);
  font-size: 13px; line-height: 1.6;
}
.up-banner[hidden] { display: none; }

.tool-card { position: relative; }
.tool-card__up {
  position: absolute; top: 10px; right: 11px;
  display: inline-flex; align-items: center;
  line-height: 1;
}
.tool-card__up .up-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gray-400); flex: none; box-sizing: border-box;
}
.tool-card__up[data-up="on"] .up-dot {
  background: #16a34a;
  animation: up-pulse 2.2s var(--ease) infinite;
}
.tool-card__up[data-up="warn"] .up-dot {
  background: transparent; border: 2px solid var(--warn);
}
.tool-card__up[data-up="err"] .up-dot {
  background: var(--danger); border-radius: 2px;
}
.tool-card__up[data-up="off"] .up-dot {
  background: transparent; border: 1px solid var(--gray-400);
}
.tool-card__up[data-up="loading"] .up-dot {
  background: transparent; border: 1px dashed var(--gray-400);
  animation: up-blink 1.2s ease-in-out infinite;
}
.tool-card[data-upstream] .tool-card__name { padding-right: 26px; }

/* 探测节点选择与结果 */
.bt-nodes { display: flex; flex-wrap: wrap; gap: 6px; }
.bt-node {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 9px; border: 1px solid var(--tz-line-2); border-radius: 999px;
  background: var(--tz-card); font-size: 12.5px; color: var(--muted);
  cursor: pointer; transition: border-color .16s, color .16s, background .16s;
}
.bt-node:hover { border-color: var(--brand-300); color: var(--ink); }
.bt-node input { margin: 0; accent-color: var(--brand-600); }
.bt-node:has(input:checked) {
  border-color: var(--brand-400); background: var(--accent-weak); color: var(--ink);
}

.bt-summary { margin-bottom: 10px; font-size: 12.5px; color: var(--muted-2); }

/* 结果区：每个节点一张卡片，关键指标用标签+数值小块，长文本单独占整行 */
.bt-node-card {
  padding: 12px 14px; border: 1px solid var(--tz-line);
  border-radius: var(--radius); background: var(--tz-card);
}
.bt-node-card + .bt-node-card { margin-top: 10px; }
.bt-node-card__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 10px;
}
.bt-node-card__name {
  min-width: 0; font-size: 13.5px; font-weight: 600; color: var(--ink);
  overflow-wrap: break-word;
}
.bt-node-card__tag {
  flex: none; padding: 1px 8px; border-radius: 999px;
  font-size: 11.5px; line-height: 1.7; border: 1px solid var(--tz-line);
  color: var(--muted-2); background: var(--bg-softer);
}
.bt-node-card__tag--ok { color: var(--success); border-color: currentColor; }
.bt-node-card__tag--err { color: var(--danger); border-color: currentColor; }

.bt-metrics {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 8px; margin: 0;
}
.bt-metric {
  padding: 7px 9px; border: 1px solid var(--tz-line);
  border-radius: calc(var(--radius) - 3px); background: var(--bg-softer);
}
.bt-metric dt { font-size: 11.5px; line-height: 1.5; color: var(--muted-2); }
.bt-metric dd {
  margin: 2px 0 0; font-size: 14px; font-weight: 600; color: var(--ink);
  font-variant-numeric: tabular-nums; overflow-wrap: break-word;
}
.bt-metric dt.is-raw { font-family: var(--mono); }

.bt-details { margin: 10px 0 0; }
.bt-details:empty { margin: 0; }
.bt-detail {
  display: grid; grid-template-columns: 84px minmax(0, 1fr);
  gap: 4px 10px; padding: 5px 0;
  font-size: 12.5px; line-height: 1.65;
  border-top: 1px solid var(--tz-line);
}
.bt-detail dt { color: var(--muted-2); }
.bt-detail dt.is-raw { font-family: var(--mono); }
.bt-detail dd { margin: 0; color: var(--ink-2); overflow-wrap: break-word; word-break: normal; white-space: pre-wrap; }

@media (max-width: 560px) {
  .bt-detail { grid-template-columns: 1fr; gap: 2px; }
}

/* 任务信息：每项一行，标签固定宽度，值正常折行 */
.bt-readout { margin: 0; display: grid; gap: 4px; }
.bt-readout__line {
  display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px;
  font-size: 12.5px; line-height: 1.65;
}
.bt-readout__line dt { color: var(--muted-2); }
.bt-readout__line dd { margin: 0; color: var(--ink-2); overflow-wrap: break-word; word-break: normal; }
.bt-readout__note { margin: 8px 0 0; font-size: 12px; color: var(--muted-2); }

@media (max-width: 560px) {
  .bt-readout__line { grid-template-columns: 1fr; gap: 1px; }
}
