/* ==========================================================================
   役次元 Yokonex Hub — 共享设计系统
   ycygame.org · 纯静态 · 无外部依赖 · 无 @import
   CSP: default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 变量层
   -------------------------------------------------------------------------- */
:root {
  /* 背景与面板 */
  --bg: #0b0d12;
  --bg-deep: #07080c;
  --panel: #12151d;
  --panel-2: #171b26;
  --panel-3: #1c2130;
  --code-bg: #0f1219;

  /* 描边 */
  --line: #1e2330;
  --line-strong: #2b3346;
  --line-focus: #3a4256;

  /* 文字 */
  --fg: #dfe3ec;
  --fg-dim: #aab2c4;
  --muted: #8b93a7;
  --muted-2: #697083;

  /* 强调 */
  --accent: #5b8cff;
  --accent-hi: #8fb0ff;
  --accent-press: #4a78e0;
  --accent-soft: rgba(91, 140, 255, 0.12);
  --accent-line: rgba(91, 140, 255, 0.42);
  --accent-glow: rgba(91, 140, 255, 0.26);

  /* 本机边界 */
  --local: #2ee6a8;
  --local-soft: rgba(46, 230, 168, 0.06);
  --local-line: rgba(46, 230, 168, 0.34);

  /* 信号语义色 */
  --sig-event: #5b8cff;
  --sig-gate: #ffd479;
  --sig-gate-soft: rgba(255, 212, 121, 0.14);
  --sig-wave: #35d0ba;
  --sig-wave-soft: rgba(53, 208, 186, 0.12);
  --sig-cloud: #a78bfa;

  /* 危险 */
  --danger: #ff6b6b;
  --danger-soft: rgba(255, 107, 107, 0.08);
  --danger-line: rgba(255, 107, 107, 0.28);

  /* 设备族 */
  --fam-ems: #5b8cff;
  --fam-cup: #35d0ba;
  --fam-enema-v1: #ffd479;
  --fam-enema-v2: #a78bfa;

  /* 装饰 */
  --grid-line: rgba(91, 140, 255, 0.055);
  --grad-flow: linear-gradient(90deg, #5b8cff 0%, #8b7bff 100%);
  --grad-hairline: linear-gradient(90deg, transparent, rgba(91, 140, 255, .35), transparent);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.40);
  --shadow-lift: 0 12px 32px rgba(0, 0, 0, 0.45);
  --shadow-pop: 0 18px 48px rgba(0, 0, 0, 0.55);

  /* 圆角 */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-pill: 999px;

  /* 字体 */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "Cascadia Code", Consolas, "Noto Sans Mono", monospace;

  /* 动效 */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 180ms;
  --dur-slow: 260ms;

  /* 字号刻度 */
  --t-display: clamp(30px, 5.2vw, 54px);
  --t-h1: 28px;
  --t-h2: 22px;
  --t-h3: 15px;
  --t-body: 15px;
  --t-lead: 16.5px;
  --t-sm: 13.5px;
  --t-xs: 12.5px;
  --t-label: 11.5px;
  --t-mono: 13px;
  --t-metric: clamp(28px, 3.4vw, 40px);
  --t-micro: 12px;

  /* 间距刻度：4 / 8 / 12 / 16 / 24 / 32 / 48 / 72 / 96 */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 72px;
  --s-9: 96px;

  /* 几何 */
  --header-h: 56px;

  color-scheme: dark;
}

/* --------------------------------------------------------------------------
   2. Reset 与基座
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--t-body);
  font-weight: 400;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}

h1, h2, h3, h4, p, figure, dl, dd, ol, ul {
  margin: 0;
  padding: 0;
}

ol, ul { list-style: none; }

h1 { font-size: var(--t-h1); line-height: 1.28; font-weight: 650; letter-spacing: -0.015em; }
h2 { font-size: var(--t-h2); line-height: 1.35; font-weight: 650; letter-spacing: -0.01em; }
h3 { font-size: var(--t-h3); line-height: 1.5; font-weight: 600; }

img, svg, video { max-width: 100%; }
img, video { height: auto; display: block; }

a { color: inherit; text-decoration: none; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
  margin: 0;
}

button { background: none; border: 0; padding: 0; cursor: pointer; }

table { border-collapse: collapse; width: 100%; }

code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

[hidden] { display: none !important; }

::selection { background: var(--accent-soft); color: var(--fg); }

:focus-visible {
  outline: 2px solid var(--accent-hi);
  outline-offset: 2px;
  border-radius: inherit;
}

/* 深色滚动条 */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border: 3px solid var(--bg);
  border-radius: var(--r-pill);
}
::-webkit-scrollbar-thumb:hover { background: var(--line-focus); }

/* --------------------------------------------------------------------------
   3. 排版工具类
   -------------------------------------------------------------------------- */
.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.t-display {
  font-size: var(--t-display);
  line-height: 1.12;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.t-lead {
  font-size: var(--t-lead);
  line-height: 1.7;
  font-weight: 400;
  color: var(--fg-dim);
  max-width: 62ch;
}

.t-sm { font-size: var(--t-sm); line-height: 1.65; color: var(--muted); }
.t-xs { font-size: var(--t-xs); line-height: 1.45; color: var(--muted); }
.t-micro { font-size: var(--t-micro); line-height: 1.5; color: var(--muted-2); }

.t-label {
  font-size: var(--t-label);
  line-height: 1;
  font-weight: 600;
  letter-spacing: 0.10em;
  color: var(--muted-2);
}

.t-metric {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  font-size: var(--t-metric);
  line-height: 1;
  font-weight: 650;
  color: var(--fg);
}

.prose { max-width: 68ch; color: var(--fg-dim); }

.prose a,
.link-under {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--accent-line);
  transition: text-decoration-color var(--dur) var(--ease);
}
.prose a:hover,
.link-under:hover { text-decoration-color: var(--accent); }

.clamp-1,
.clamp-2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.clamp-1 { -webkit-line-clamp: 1; }
.clamp-2 { -webkit-line-clamp: 2; }

.vh {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   4. 布局
   -------------------------------------------------------------------------- */
.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--s-5);
}
.wrap.narrow { max-width: 900px; }
.wrap.mid { max-width: 1080px; }

.sec { padding: var(--s-9) 0; }
.sec + .sec { padding-top: 0; }

.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-5);
}

.sec-head .more {
  font-size: var(--t-sm);
  color: var(--muted);
  white-space: nowrap;
  transition: color var(--dur) var(--ease);
}
.sec-head .more .arr {
  display: inline-block;
  transition: transform var(--dur) var(--ease);
}
.sec-head .more:hover,
.sec-head .more:focus-visible { color: var(--fg); }
.sec-head .more:hover .arr,
.sec-head .more:focus-visible .arr { transform: translateX(3px); }

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: var(--s-7) 56px;
  align-items: center;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--s-4);
}

.hairline {
  height: 1px;
  border: 0;
  background: var(--grad-hairline);
  margin: 0;
}

/* --------------------------------------------------------------------------
   5. 页头
   -------------------------------------------------------------------------- */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
}
.skip:focus {
  left: 12px;
  top: 12px;
  padding: 9px 14px;
  background: var(--panel-2);
  border: 1px solid var(--accent);
  border-radius: var(--r-sm);
  font-size: var(--t-sm);
  color: var(--fg);
}

#top-sentinel { height: 1px; }

#site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 220ms var(--ease), border-color 220ms var(--ease);
}
#site-header::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: var(--grad-hairline);
  opacity: 0;
  transition: opacity 220ms var(--ease);
  pointer-events: none;
}
#site-header.is-stuck {
  background: rgba(11, 13, 18, .80);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom-color: var(--line);
}
#site-header.is-stuck::after { opacity: 1; }

.bar {
  display: flex;
  align-items: center;
  gap: 26px;
  height: var(--header-h);
}

/* 品牌 */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0;
  flex: 0 0 auto;
  padding: 4px 6px;
  margin-left: -6px;
  border-radius: var(--r-sm);
}
.brand .mark-svg { display: block; width: 20px; height: 20px; flex: 0 0 auto; }
.brand .mark-svg .mk-wave {
  stroke: var(--accent);
  transition: stroke var(--dur) var(--ease);
}
.brand:hover .mark-svg .mk-wave,
.brand:focus-visible .mark-svg .mk-wave {
  stroke: var(--accent-hi);
  animation: mk-draw 600ms var(--ease);
}
@keyframes mk-draw {
  from { stroke-dashoffset: 46; }
  to { stroke-dashoffset: 0; }
}
.brand b {
  font-size: 16px;
  font-weight: 600;
  color: var(--fg);
  margin-left: var(--s-2);
  letter-spacing: -0.01em;
}
.brand span {
  font-size: 15px;
  font-weight: 400;
  color: var(--muted);
  margin-left: 7px;
  transition: color var(--dur) var(--ease);
}
.brand:hover span { color: var(--fg-dim); }

/* 主导航 */
.nav-main {
  display: flex;
  align-items: center;
  gap: var(--s-1);
}
.nav-main a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 11px;
  border-radius: 7px;
  font-size: 14px;
  color: var(--fg-dim);
  white-space: nowrap;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.nav-main a:hover,
.nav-main a:focus-visible {
  background: var(--panel-2);
  color: var(--fg);
}
.nav-main a.is-current {
  color: var(--fg);
  font-weight: 600;
}
.nav-main a.is-current::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -17px;
  width: 16px;
  height: 2px;
  margin-left: -8px;
  background: var(--accent);
  border-radius: 2px;
}

.ext-arr {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .55;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
a:hover > .ext-arr,
a:focus-visible > .ext-arr,
button:hover > .ext-arr {
  opacity: 1;
  transform: translate(1px, -1px);
}

/* 右区 */
.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

/* 页头搜索框 */
.search {
  position: relative;
  display: flex;
  align-items: center;
}
.search input {
  width: 300px;
  height: 36px;
  padding: 0 34px 0 12px;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--s-2);
  color: var(--fg);
  font-size: var(--t-sm);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  -webkit-appearance: none;
  appearance: none;
}
.search input::placeholder { color: var(--muted-2); }
.search input::-webkit-search-cancel-button { display: none; }
.search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}
.search kbd {
  position: absolute;
  right: 10px;
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: var(--t-label);
  line-height: 1;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px 5px;
}
.search input:focus ~ kbd,
.search.has-value kbd { display: none; }
.search .clear {
  position: absolute;
  right: 8px;
  display: none;
}
.search.has-value .clear { display: inline-flex; }
@media (min-width: 1080px) {
  .search input { width: 340px; }
}

/* 官方与开源 下拉 */
.eco { position: relative; }
#eco-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 7px;
  font-size: 14px;
  color: var(--muted);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
#eco-btn:hover,
#eco-btn:focus-visible,
#eco-btn[aria-expanded="true"] {
  background: var(--panel-2);
  color: var(--fg);
}
#eco-btn .chev {
  width: 10px; height: 10px;
  stroke: currentColor; fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  transition: transform var(--dur) var(--ease);
}
#eco-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }

#eco-menu {
  position: absolute;
  right: 0;
  top: calc(100% + var(--s-2));
  width: 312px;
  padding: var(--s-2);
  background: var(--panel-2);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: var(--shadow-pop);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
#eco-menu.is-open { opacity: 1; transform: translateY(0); }

.eco-group + .eco-group {
  margin-top: var(--s-2);
  padding-top: var(--s-2);
  border-top: 1px solid var(--line);
}
.eco-group > h3 {
  font-size: var(--t-label);
  line-height: 1;
  font-weight: 600;
  letter-spacing: 0.10em;
  color: var(--muted-2);
  padding: var(--s-2) 10px var(--s-1);
}
.eco-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--s-2);
  transition: background var(--dur) var(--ease);
}
.eco-item:hover,
.eco-item:focus-visible { background: var(--accent-soft); }
.eco-item .ic {
  width: 16px; height: 16px;
  flex: 0 0 auto;
  color: var(--muted);
}
.eco-item:hover .ic { color: var(--accent-hi); }
.eco-item .tx { min-width: 0; flex: 1 1 auto; }
.eco-item .tx b {
  display: block;
  font-size: var(--t-sm);
  font-weight: 400;
  color: var(--fg);
  line-height: 1.4;
}
.eco-sub {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  line-height: 1.4;
  color: var(--muted-2);
  margin-top: 2px;
  word-break: break-all;
}

/* 汉堡 */
#nav-toggle {
  display: none;
  width: 40px; height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: var(--s-2);
  color: var(--fg-dim);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
#nav-toggle:hover { background: var(--panel-2); color: var(--fg); }
#nav-toggle svg { width: 20px; height: 20px; }
#nav-toggle .hb-line {
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  transform-origin: center;
  transition: transform 220ms var(--ease), opacity 140ms var(--ease);
}
#nav-toggle[aria-expanded="true"] .hb-1 { transform: translateY(5px) rotate(45deg); }
#nav-toggle[aria-expanded="true"] .hb-2 { opacity: 0; }
#nav-toggle[aria-expanded="true"] .hb-3 { transform: translateY(-5px) rotate(-45deg); }

/* 抽屉 */
#nav-drawer {
  position: fixed;
  inset: var(--header-h) 0 0;
  z-index: 49;
  background: var(--bg);
  overflow-y: auto;
  padding: var(--s-2) var(--s-4) 40px;
  -webkit-overflow-scrolling: touch;
}
.drawer-group + .drawer-group {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 14px;
}
.drawer-group > h3 {
  font-size: var(--t-label);
  line-height: 1;
  font-weight: 600;
  letter-spacing: 0.10em;
  color: var(--muted-2);
  padding: var(--s-3) var(--s-3) var(--s-2);
}
.drawer-item {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 44px;
  padding: 13px var(--s-3);
  border-radius: var(--s-2);
  font-size: 16px;
  color: var(--fg-dim);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.drawer-item:hover,
.drawer-item:focus-visible { background: var(--panel-2); color: var(--fg); }
.drawer-item.is-current { color: var(--fg); font-weight: 600; }
.drawer-item .tx { display: block; }
.drawer-static {
  padding: 10px var(--s-3);
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   6. 按钮
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  height: 42px;
  padding: 0 22px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
              color var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
              transform var(--dur) var(--ease);
}
.btn-primary {
  background: var(--accent);
  color: #0b0d12;
}
.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--accent-hi);
  box-shadow: 0 6px 22px var(--accent-glow);
  transform: translateY(-1px);
}
.btn-primary:active {
  background: var(--accent-press);
  transform: translateY(0);
  box-shadow: none;
}
.btn-ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--line-strong);
  font-weight: 400;
}
.btn-ghost:hover,
.btn-ghost:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.btn-sm { height: 34px; padding: 0 14px; font-size: var(--t-sm); border-radius: var(--r-sm); }
.btn-block { width: 100%; }

.btn[disabled],
.btn.is-loading {
  cursor: default;
  opacity: .72;
  transform: none;
  box-shadow: none;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  color: var(--muted);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}
.icon-btn:hover,
.icon-btn:focus-visible {
  background: var(--panel-2);
  color: var(--fg);
  border-color: var(--line);
}
.icon-btn svg { width: 14px; height: 14px; }
.icon-btn.is-ok { color: var(--sig-wave); border-color: var(--sig-wave); }

.spinner {
  width: 14px; height: 14px;
  flex: 0 0 auto;
  animation: spin 800ms linear infinite;
}
.spinner circle { stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
@keyframes spin { to { transform: rotate(360deg); } }

.more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  height: 42px;
  min-width: 200px;
  padding: 0 26px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--panel);
  color: var(--fg-dim);
  font-size: 14px;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease),
              color var(--dur) var(--ease);
}
.more-btn:hover:not([disabled]),
.more-btn:focus-visible {
  border-color: var(--accent-line);
  background: var(--panel-2);
  color: var(--fg);
}
.more-btn[disabled] { cursor: default; color: var(--muted); }

.list-foot {
  display: flex;
  justify-content: center;
  padding: var(--s-6) 0 0;
}
.list-end {
  font-size: var(--t-xs);
  color: var(--muted);
  text-align: center;
  padding: var(--s-6) 0 0;
}

/* --------------------------------------------------------------------------
   7. 标识与徽标
   -------------------------------------------------------------------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: var(--t-label);
  line-height: 1;
  color: var(--muted);
  white-space: nowrap;
}
.chip-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
.chip-amber {
  color: var(--sig-gate);
  background: var(--sig-gate-soft);
  border-color: rgba(255, 212, 121, .28);
}
.chip-blue {
  color: var(--accent-hi);
  background: var(--accent-soft);
  border-color: var(--accent-line);
}
.chip-wave {
  color: var(--sig-wave);
  background: var(--sig-wave-soft);
  border-color: rgba(53, 208, 186, .28);
}
.chip-cloud {
  color: var(--sig-cloud);
  background: rgba(167, 139, 250, .12);
  border-color: rgba(167, 139, 250, .28);
}

.eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 5px var(--s-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--code-bg);
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  line-height: 1.6;
  color: var(--fg-dim);
}

.dot-live {
  width: 5px; height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--local);
  box-shadow: 0 0 0 0 var(--local-line);
  animation: breathe 1.8s var(--ease) infinite;
}
@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46, 230, 168, .38); opacity: 1; }
  50% { box-shadow: 0 0 0 4px rgba(46, 230, 168, 0); opacity: .62; }
}

/* 确定性染色标记块：--mh 由 JS 写入 */
.mark {
  --mh: 220;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  line-height: 1;
  letter-spacing: .04em;
  color: hsl(var(--mh) 70% 72%);
  background: hsl(var(--mh) 42% 18%);
  border: 1px solid hsl(var(--mh) 40% 26%);
}
.mark-lg { width: 56px; height: 56px; font-size: 15px; border-radius: 12px; }

.badge-18 {
  display: inline-flex;
  align-items: center;
  padding: 3px var(--s-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: var(--t-label);
  line-height: 1;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   8. 卡片
   -------------------------------------------------------------------------- */
.card,
.p-card,
.w-card,
.road-card,
.mode-card,
.info-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
}

/* 插件卡 */
.p-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 18px 14px;
  min-height: 172px;
  overflow: hidden;
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}
.p-card::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 320ms var(--ease);
}
.p-card:hover,
.p-card:focus-visible {
  border-color: var(--accent-line);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}
.p-card:hover::before,
.p-card:focus-visible::before { transform: scaleX(1); }

.p-card .p-top {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.p-card .p-name {
  font-size: var(--t-h3);
  font-weight: 600;
  color: var(--fg);
  min-width: 0;
  -webkit-line-clamp: 1;
}
.p-card .p-ver { margin-left: auto; }
.p-card .p-desc {
  font-size: var(--t-sm);
  line-height: 1.65;
  color: var(--muted);
  min-height: 2.6em;
}
.p-card .p-meta {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: var(--t-xs);
  color: var(--muted);
}
.p-card .p-meta .num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.p-card .p-meta .num svg { width: 10px; height: 10px; }
.p-card .go {
  margin-left: auto;
  width: 12px; height: 12px;
  opacity: .35;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.p-card:hover .go,
.p-card:focus-visible .go { opacity: 1; transform: translate(1px, -1px); }

/* 波形卡 */
.w-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 14px 12px;
  text-align: left;
  width: 100%;
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.w-card:hover,
.w-card:focus-within,
.w-card:focus-visible { border-color: var(--accent-line); box-shadow: var(--shadow-lift); }
.w-card.is-featured { border-color: rgba(255, 212, 121, .26); }

.thumb {
  position: relative;
  height: 72px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--code-bg);
  overflow: hidden;
}
.thumb svg { display: block; width: 100%; height: 100%; }
.thumb .wave-line {
  stroke-width: 1.75;
  stroke-linejoin: round;
  fill: none;
  transition: stroke-width var(--dur) var(--ease);
}
.w-card:hover .thumb .wave-line,
.w-card:focus-visible .thumb .wave-line { stroke-width: 2.25; }
.thumb .hint {
  position: absolute;
  right: var(--s-2);
  bottom: 6px;
  font-size: var(--t-label);
  line-height: 1;
  color: var(--muted-2);
}
.thumb .nodata {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: var(--t-label);
  color: var(--muted-2);
}
.thumb .scan {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 64px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .10), transparent);
  transform: translateX(-64px);
  opacity: 0;
}
.w-card:hover .thumb .scan,
.w-card:focus-within .thumb .scan {
  opacity: 1;
  animation: scan 1.1s var(--ease) infinite;
}
@keyframes scan {
  from { transform: translateX(-64px); }
  to { transform: translateX(320px); }
}

.w-card .w-top { display: flex; align-items: center; gap: var(--s-2); }
.w-card .w-name {
  font-size: var(--t-h3);
  font-weight: 600;
  color: var(--fg);
  min-width: 0;
  -webkit-line-clamp: 1;
}
.w-card .w-fam-dot {
  width: 7px; height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
}
.w-card .w-params {
  font-size: var(--t-xs);
  color: var(--muted);
}
.w-card .w-params .num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
.w-card .w-meta {
  padding-top: 10px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: var(--s-3);
  font-size: var(--t-xs);
  color: var(--muted);
}
.w-card .w-meta .num {
  margin-left: auto;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
.w-open {
  max-height: 0;
  overflow: hidden;
  transition: max-height 200ms var(--ease);
}
.w-open > .w-open-in {
  border-top: 1px solid var(--line);
  margin-top: var(--s-3);
  padding: 14px var(--s-1) 4px;
  background: var(--bg-deep);
  font-size: var(--t-sm);
  color: var(--muted);
}

/* 四段路卡 */
.road-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-4);
}
.road-card {
  position: relative;
  padding: var(--s-5) 20px;
  transition: border-color var(--dur) var(--ease);
}
.road-card--dashed { border-style: dashed; }
.road-card:hover { border-color: var(--line-strong); }
.road-card .no {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--s-2);
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  line-height: 1;
  color: var(--accent);
  transition: background var(--dur) var(--ease);
}
.road-card:hover .no { background: var(--accent-soft); }
.road-card .no.is-cloud { color: var(--sig-cloud); }
.road-card .ic-lg { width: 22px; height: 22px; margin: var(--s-3) 0 var(--s-2); color: var(--muted); }
.road-card h3 { margin-bottom: 6px; }
.road-card p { font-size: var(--t-sm); line-height: 1.65; color: var(--muted); }

/* 采集模式卡 */
.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-3);
}
.mode-card {
  position: relative;
  padding: var(--s-4) 18px;
  border-radius: var(--r-md);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  transition: border-color var(--dur) var(--ease);
}
.mode-card:hover { border-color: var(--line-strong); }
.mode-card.is-preferred { border-left: 3px solid var(--accent); }
.mode-card p { font-size: var(--t-mono); line-height: 1.6; color: var(--muted); }
.mode-card .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }

.redline-card {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4) 18px;
  border: 1px solid var(--danger-line);
  background: var(--danger-soft);
  border-radius: var(--r-md);
  font-size: var(--t-sm);
  color: var(--fg-dim);
}
.redline-card svg { width: 20px; height: 20px; flex: 0 0 auto; stroke: var(--danger); fill: none; }

/* 侧栏信息卡 */
.info-card { padding: 18px; }
.info-card dt {
  font-size: var(--t-label);
  line-height: 1;
  font-weight: 600;
  letter-spacing: 0.10em;
  color: var(--muted-2);
}
.info-card dd {
  font-size: var(--t-sm);
  color: var(--fg-dim);
  margin-top: 5px;
}
.info-card dd.mono { word-break: break-all; }
.info-card .row + .row {
  border-top: 1px solid var(--line);
  padding-top: var(--s-3);
  margin-top: var(--s-3);
}
.info-card .sha {
  font-size: var(--t-label);
  line-height: 1.6;
  word-break: break-all;
  color: var(--muted);
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: var(--s-2);
}

/* 终端块 */
.term {
  background: var(--code-bg);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  transition: border-color var(--dur) var(--ease);
}
.term:hover { border-color: var(--line-focus); }
.term-head {
  position: relative;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: var(--t-label);
  color: var(--muted-2);
}
.term-dots {
  position: absolute;
  left: var(--s-3);
  display: flex;
  gap: 6px;
}
.term-dots i {
  width: var(--s-2); height: var(--s-2);
  border-radius: 50%;
  background: #3a4256;
}
.term-copy {
  position: absolute;
  right: var(--s-2);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.term:hover .term-copy,
.term:focus-within .term-copy { opacity: 1; }
.term-body {
  padding: var(--s-4) 18px;
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  line-height: 1.9;
  color: var(--fg);
  overflow-x: auto;
  white-space: pre;
}
.term-body .p { color: var(--muted); }
.term-body .ok { color: var(--sig-wave); }
.term-body .pend { color: var(--sig-gate); }

/* --------------------------------------------------------------------------
   9. 表格
   -------------------------------------------------------------------------- */
.tbl-scroll { overflow-x: auto; }
.tbl { font-size: var(--t-sm); }
.tbl th {
  text-align: left;
  background: var(--panel);
  font-size: var(--t-label);
  line-height: 1;
  font-weight: 600;
  letter-spacing: 0.10em;
  color: var(--muted-2);
  white-space: nowrap;
}
.tbl th,
.tbl td {
  padding: 9px var(--s-3);
  border: 1px solid var(--line);
  vertical-align: top;
}
.tbl td { color: var(--fg-dim); }
.tbl tbody tr:nth-child(even) { background: rgba(255, 255, 255, .015); }
.tbl td.mono,
.tbl td .mono {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
.tbl td.k-event { color: var(--sig-event); }
.tbl td.k-cmd { color: var(--sig-gate); }
.tbl tr.row-latest td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

/* --------------------------------------------------------------------------
   10. 竖轨列表（七道判定）
   -------------------------------------------------------------------------- */
.gate-rail { position: relative; padding-left: 26px; }
.gate-rail::before {
  content: "";
  position: absolute;
  left: 4px; top: 14px; bottom: 14px;
  width: 2px;
  background: var(--line);
  border-radius: 1px;
}
.gate-rail li {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-3) var(--s-3) 0;
  border-radius: var(--s-2);
  font-size: var(--t-body);
  color: var(--fg-dim);
  transition: background 160ms var(--ease), transform 160ms var(--ease);
}
.gate-dot {
  position: absolute;
  left: -26px;
  top: 50%;
  width: 10px; height: 10px;
  margin-top: -5px;
  margin-left: -1px;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  background: var(--bg);
  transition: width 160ms var(--ease), height 160ms var(--ease),
              margin 160ms var(--ease), background 160ms var(--ease),
              border-color 160ms var(--ease);
}
.gate-rail li:hover { background: var(--panel); transform: translateX(4px); }
.gate-rail li:hover .gate-dot {
  width: 14px; height: 14px;
  margin-top: -7px; margin-left: -3px;
  background: var(--accent);
  border-color: var(--accent);
}
.gate-rail li .txt { flex: 1 1 auto; min-width: 0; }
.gate-rail li .chip { margin-left: auto; }
.gate-rail code,
.mono-inline {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  line-height: 1.5;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
}

.note-bar {
  border-left: 3px solid var(--accent);
  background: var(--panel);
  border-radius: 0 var(--s-2) var(--s-2) 0;
  padding: 14px 18px;
  font-size: var(--t-sm);
  line-height: 1.7;
  color: var(--fg-dim);
}

/* --------------------------------------------------------------------------
   11. 表单控件
   -------------------------------------------------------------------------- */
.select-wrap { position: relative; display: inline-flex; align-items: center; }
.select-wrap select {
  height: 40px;
  padding: 0 32px 0 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--s-2);
  color: var(--fg);
  font-size: var(--t-sm);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.select-wrap select:hover { border-color: var(--line-strong); }
.select-wrap select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}
.select-wrap select option { background: var(--panel); color: var(--fg); }
.select-wrap .chev {
  position: absolute;
  right: 12px;
  pointer-events: none;
  width: 10px; height: 10px;
  stroke: var(--muted);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 工具条 */
.toolbar {
  position: sticky;
  top: var(--header-h);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) 0;
  background: rgba(11, 13, 18, .88);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.toolbar .search { flex: 1 1 auto; max-width: 520px; }
.toolbar .search input { width: 100%; height: 40px; }
.toolbar .count {
  margin-left: auto;
  font-size: var(--t-mono);
  color: var(--muted);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Segmented control */
.seg {
  position: relative;
  display: inline-flex;
  padding: 3px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  max-width: 100%;
}
.seg-ind {
  position: absolute;
  top: 3px; left: 0;
  height: calc(100% - 6px);
  border-radius: 7px;
  background: var(--panel-3);
  transition: transform 220ms var(--ease), width 220ms var(--ease);
  pointer-events: none;
}
.seg button {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 7px;
  font-size: var(--t-sm);
  color: var(--muted);
  white-space: nowrap;
  transition: color var(--dur) var(--ease);
}
.seg button:hover { color: var(--fg-dim); }
.seg button[aria-selected="true"] { color: var(--fg); }
.seg button i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}

/* 设备族 chip 行 */
.fam-chips { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-4); }
.fam-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--panel);
  font-size: var(--t-sm);
  color: var(--fg-dim);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease),
              color var(--dur) var(--ease);
}
.fam-chip i { width: var(--s-2); height: var(--s-2); border-radius: 50%; flex: 0 0 auto; }
.fam-chip:hover,
.fam-chip:focus-visible {
  border-color: var(--line-strong);
  background: var(--panel-2);
  color: var(--fg);
}

/* --------------------------------------------------------------------------
   12. 状态：骨架 / 空 / 错误 / 统计
   -------------------------------------------------------------------------- */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  min-height: 172px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .045) 40%, transparent 60%);
  background-size: 220% 100%;
  animation: sh 1.2s linear infinite;
}
@keyframes sh {
  from { background-position: 120% 0; }
  to { background-position: -120% 0; }
}
.sk-bar { background: var(--panel-2); border-radius: 4px; }
.sk-bar.h14 { height: 14px; }
.sk-bar.h12 { height: 12px; }
.sk-bar.w60 { width: 60%; }
.sk-bar.w100 { width: 100%; }
.sk-bar.w40 { width: 40%; }

/* 空态 */
.empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--s-8) var(--s-5);
  max-width: 460px;
  margin: 0 auto;
  gap: var(--s-4);
}
.empty .vis { color: var(--line-strong); opacity: .75; }
.empty .vis svg { width: 96px; height: 96px; fill: none; stroke-width: 1.5; }
.empty h3 { font-size: 18px; line-height: 1.4; font-weight: 600; color: var(--fg); }
.empty p {
  font-size: var(--t-sm);
  line-height: 1.7;
  color: var(--muted);
  max-width: 34ch;
}
.empty .btn-row { justify-content: center; margin-top: var(--s-1); }

.empty--light { padding: 56px var(--s-5); }
.empty--light .vis svg { width: 40px; height: 40px; stroke: var(--muted-2); }
.empty--light h3 { font-size: var(--t-h3); }
.empty--light .kw { color: var(--fg); font-weight: 600; }

.empty--compact { padding: 40px var(--s-5); min-height: 240px; justify-content: center; }
.empty--compact .vis svg { width: 64px; height: 64px; }

/* 错误态 */
.error,
.empty--error {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: var(--s-3);
  max-width: none;
  padding: var(--s-6) var(--s-5);
  border: 1px solid var(--line);
  border-left: 3px solid var(--danger);
  background: var(--danger-soft);
  border-radius: var(--r-lg);
}
.error .vis svg,
.empty--error .vis svg { width: 40px; height: 40px; stroke: var(--danger); fill: none; stroke-width: 1.5; }
.error h3,
.empty--error h3 { font-size: var(--t-h3); font-weight: 600; color: var(--fg); }
.error .code,
.empty--error .code {
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  line-height: 1.5;
  color: var(--muted);
  word-break: break-all;
}
.error p,
.empty--error p { font-size: var(--t-sm); color: var(--muted); max-width: 48ch; }
.error .retry-note,
.empty--error .retry-note { font-size: var(--t-micro); color: var(--muted-2); }

/* 统计条 */
.stat-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--panel), #0e1119);
  overflow: hidden;
}
.stat-bar > div {
  padding: var(--s-5) var(--s-4);
  text-align: center;
}
.stat-bar > div + div { border-left: 1px solid var(--line); }
.stat-bar dd {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  font-size: var(--t-metric);
  line-height: 1;
  font-weight: 650;
  color: var(--fg);
}
.stat-bar dt {
  margin-top: 10px;
  font-size: var(--t-xs);
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   13. 主视觉容器
   -------------------------------------------------------------------------- */
.scope-wrap { margin: 0; }
.scope-wrap > svg {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: linear-gradient(180deg, var(--panel), #0e1119);
}
#scope-v { display: none; }
.scope-bar {
  min-height: 84px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  padding: var(--s-4) 20px;
  display: flex;
  gap: var(--s-4);
  align-items: center;
  font-size: var(--t-sm);
  line-height: 1.65;
  color: var(--fg-dim);
  text-align: left;
}
.scope-bar-chip {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--code-bg);
  border-radius: var(--r-sm);
  padding: 5px var(--s-2);
}
#scope .node,
#scope-v .node { transition: opacity var(--dur) var(--ease); outline: none; }
#scope:hover .node,
#scope-v:hover .node { opacity: .45; }
#scope .node:hover,
#scope .node:focus-visible,
#scope-v .node:hover,
#scope-v .node:focus-visible { opacity: 1; }
#scope .node:focus-visible .hit,
#scope-v .node:focus-visible .hit {
  stroke: var(--accent-hi);
  stroke-width: 2;
  rx: 12;
}

@media (max-width: 760px) {
  #scope { display: none; }
  #scope-v { display: block; }
}

/* --------------------------------------------------------------------------
   14. 页脚
   -------------------------------------------------------------------------- */
.foot {
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, #0b0d12 0%, #0e1119 100%);
  margin-top: var(--s-9);
}
/* 链路分隔条：hero 主视觉的极简复刻。静态，不做任何动画。
   用 HTML 而不是 preserveAspectRatio="none" 的 SVG —— 后者会把文字与节点横向压扁。 */
.foot-rule {
  position: relative;
  height: 64px;
  overflow: hidden;
}
.foot-rule::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 26px;
  height: 1px;
  background: var(--line);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 120px, #000 calc(100% - 120px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 120px, #000 calc(100% - 120px), transparent 100%);
}
.fr-pt {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.fr-node {
  width: 7px; height: 7px;
  margin-top: 21.5px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--bg);
}
.fr-gate {
  width: 4px; height: 4px;
  margin-top: 23.5px;
  background: var(--line-strong);
  border-radius: 1px;
  box-shadow: 0 0 0 3px var(--bg);
}
.fr-lb {
  margin-top: 9px;
  font-family: var(--font-mono);
  font-size: var(--t-label);
  line-height: 1;
  color: var(--muted);
  white-space: nowrap;
}

.foot-grid {
  display: grid;
  /* 品牌一栏 + 链接一整块。链接自己再分三列 ——
     这样列数变化不会把品牌那栏挤扁，右边也不会空出一大片。 */
  grid-template-columns: minmax(280px, 380px) 1fr;
  gap: 48px var(--s-8);
  padding: 48px 0 0;
  align-items: start;
}
.foot-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: var(--s-6);
  justify-items: start;
}
.foot-brand-row { display: flex; align-items: center; gap: var(--s-2); }
.foot-brand-row .mark-svg { width: 20px; height: 20px; }
.foot-brand-row .mark-svg .mk-wave { stroke: var(--accent); }
.foot-brand-row b { font-size: var(--t-h3); font-weight: 600; color: var(--fg); }
.foot-claim {
  margin-top: var(--s-3);
  font-size: var(--t-sm);
  line-height: 1.7;
  color: var(--muted);
  max-width: 34ch;
}

.foot-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: var(--s-5);
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--panel);
  font-size: var(--t-sm);
  color: var(--muted);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.foot-status:hover,
.foot-status:focus-visible { border-color: var(--line-strong); background: var(--panel-2); }
.foot-status i {
  width: 7px; height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--muted-2);
  transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.foot-status.is-ok i   { background: var(--sig-wave); box-shadow: 0 0 0 3px var(--sig-wave-soft); }
.foot-status.is-warn i { background: var(--warn, #f5a524); box-shadow: 0 0 0 3px rgba(245,165,36,.16); }
.foot-status.is-err  i { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.foot-status .fs-label { flex: 1 1 auto; color: var(--fg-dim); }
.foot-status.is-ok .fs-label { color: var(--fg); }
.foot-status .fs-go {
  flex: 0 0 auto;
  font-size: var(--t-micro);
  color: var(--muted-2);
  white-space: nowrap;
}
.foot-status:hover .fs-go { color: var(--accent-hi); }

.foot-col h3 {
  font-size: var(--t-label);
  line-height: 1;
  font-weight: 600;
  letter-spacing: 0.10em;
  color: var(--muted-2);
  margin-bottom: 14px;
}
.foot-link {
  position: relative;
  display: block;
  padding: 6px 0;
  padding-left: 0;
  font-size: var(--t-sm);
  color: var(--muted);
  transition: color var(--dur) var(--ease), padding-left var(--dur) var(--ease);
}
.foot-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 2px;
  height: 0;
  background: var(--accent);
  border-radius: 1px;
  transition: height var(--dur) var(--ease);
}
.foot-link:hover,
.foot-link:focus-visible { color: var(--fg); padding-left: 6px; }
.foot-link:hover::before,
.foot-link:focus-visible::before { height: 14px; }
.foot-link .ext-arr { margin-left: 5px; opacity: .5; }
.foot-sub {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  line-height: 1.4;
  color: var(--muted-2);
  margin-top: 2px;
  word-break: break-all;
}
.foot-static {
  padding: 6px 0;
  font-size: var(--t-micro);
  color: var(--muted);
  font-family: var(--font-mono);
}
.foot-static em {
  font-style: normal;
  font-family: var(--font-sans);
  color: var(--muted-2);
  margin-left: 6px;
}

.foot-bottom {
  margin-top: 44px;
  border-top: 1px solid var(--line);
  padding: 18px 0 30px;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3) var(--s-5);
  align-items: center;
  font-size: var(--t-micro);
  line-height: 1.6;
  color: var(--muted-2);
}
.foot-mini { color: var(--muted-2); transition: color var(--dur) var(--ease); }
.foot-mini:hover, .foot-mini:focus-visible { color: var(--fg); }
.foot-mini-flat { color: var(--muted-2); }
.foot-bottom .right {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
}

.foot-col > details > summary {
  list-style: none;
  cursor: default;
  pointer-events: none;          /* 桌面端只是组名，不可折叠 */
}
.foot-col > details > summary::-webkit-details-marker { display: none; }

/* --------------------------------------------------------------------------
   15. 响应式
   -------------------------------------------------------------------------- */

/* —— 中档：768–1099 —— */
@media (max-width: 1099px) {
  .foot-grid {
    grid-template-columns: minmax(260px, 1fr) repeat(2, 1fr);
    gap: var(--s-6) var(--s-5);
  }
  .foot-brand { grid-column: 1 / -1; }
  .two-col { grid-template-columns: 1fr; gap: var(--s-7); }
}

/* 品牌 + 四项导航 + 下拉 + 300px 搜索框在 1130px 以下挤不下，
   先收掉页头搜索框（列表页的 sticky 工具条里有一个更大的）。 */
@media (max-width: 1130px) {
  .bar { gap: 18px; }
  #site-header .search { display: none; }
}

@media (max-width: 1000px) {
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

@media (max-width: 960px) {
  .road-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .sec { padding: var(--s-8) 0; }
}

/* —— 页头折叠：≤860 —— */
@media (max-width: 860px) {
  .nav-main,
  .eco { display: none; }
  #nav-toggle { display: inline-flex; }
  .nav-right { gap: var(--s-1); }
  .search input { width: 200px; }
  .sec { padding: 56px 0; }
  .sec + .sec { padding-top: 0; }
  .foot { margin-top: 56px; }
  .mode-grid { grid-template-columns: repeat(2, 1fr); }
}

/* —— 小屏：<768 —— */
@media (max-width: 767px) {
  .wrap { padding: 0 20px; }
  .toolbar { flex-wrap: wrap; }
  .toolbar .search { flex: 1 1 100%; max-width: none; }
  .toolbar .count { margin-left: 0; flex: 1 1 100%; }
  .card-grid { grid-template-columns: 1fr; }
  .gate-rail li { flex-wrap: wrap; }
  .gate-rail li .chip { margin-left: 0; }
  .stat-bar { grid-template-columns: 1fr; }
  .stat-bar > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .foot-rule { height: 48px; }
  .foot-rule::before { top: 20px; }
  .fr-node { margin-top: 15.5px; }
  .fr-gate { margin-top: 17.5px; }
  .fr-pt.side .fr-lb { display: none; }
}

@media (max-width: 720px) {
  .foot-grid { grid-template-columns: 1fr; gap: var(--s-5); }
  .foot-col > details > summary {
    position: relative;
    cursor: pointer;
    pointer-events: auto;
    padding: 14px 0;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  .foot-col > details > summary h3 { margin-bottom: 0; }
  .foot-col > details > summary::after {
    content: "";
    position: absolute;
    right: 2px;
    width: 7px; height: 7px;
    margin-top: -3px;
    border-right: 1.5px solid var(--muted-2);
    border-bottom: 1.5px solid var(--muted-2);
    transform: rotate(45deg);
    transition: transform var(--dur) var(--ease);
  }
  .foot-col > details[open] > summary::after {
    margin-top: 2px;
    transform: rotate(225deg);
  }
  .foot-col > details[open] > summary { margin-bottom: var(--s-2); }
  .foot-col + .foot-col { border-top: 1px solid var(--line); }
  .foot-bottom { flex-direction: column; align-items: flex-start; gap: 10px; }
  .foot-bottom .right { margin-left: 0; }
}

@media (max-width: 640px) {
  .seg { overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%); }
  .seg::-webkit-scrollbar { display: none; }
  .seg-ind { display: none; }
  .seg button[aria-selected="true"] { background: var(--panel-3); }
}

@media (max-width: 620px) {
  .thumb { height: 64px; }
}

@media (max-width: 600px) {
  .wrap { padding: 0 var(--s-4); }
  .empty { padding: 56px var(--s-4); }
}

@media (max-width: 520px) {
  .mode-grid { grid-template-columns: 1fr; }
  .road-grid { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .brand span { display: none; }
  .search input { width: 150px; }
}

/* --------------------------------------------------------------------------
   16. 降级：prefers-reduced-motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
  .skeleton::after { display: none; }
  .thumb .scan { display: none; }
  .dot-live { animation: none; }
  .seg-ind { transition: none; }
  .p-card:hover { transform: none; }
  .btn-primary:hover { transform: none; }
  .gate-rail li:hover { transform: none; }
}

/* --------------------------------------------------------------------------
   17. 打印（极简兜底）
   -------------------------------------------------------------------------- */
@media print {
  #site-header,
  #nav-drawer,
  .foot-rule { display: none; }
  body { background: #fff; color: #000; }
}

/* ==========================================================================
   工具类
   CSP 是 style-src 'self'，内联 style 属性会被拦掉，所以间距一律用类。
   ========================================================================== */
.mt-0 { margin-top: 0; }
.mt-3 { margin-top: var(--s-3); }
.mt-4 { margin-top: var(--s-4); }
.mt-5 { margin-top: var(--s-5); }
.mt-6 { margin-top: var(--s-6); }
.mb-0 { margin-bottom: 0; }
.my-0 { margin-top: 0; margin-bottom: 0; }
.hero-title { margin: var(--s-4) 0 0; }
.hero-lead { margin: var(--s-4) 0 0; }
.hero-cta { margin-top: var(--s-6); }

/* ==========================================================================
   首屏信号动画
   动效放 CSS 而不是 JS：CSP 下内联脚本被禁，而且这本来就该是表现层的事。
   尊重 prefers-reduced-motion —— 有人对动效敏感。
   ========================================================================== */
.sig-flow {
  stroke-dasharray: 26 240;
  animation: sig-run 2.6s linear infinite;
}
@keyframes sig-run {
  from { stroke-dashoffset: 266; }
  to   { stroke-dashoffset: 0; }
}
.sig-wave {
  stroke-dasharray: 80 80;
  animation: sig-pulse 2.6s var(--ease) infinite;
}
@keyframes sig-pulse {
  0%, 62%  { stroke-dashoffset: 80; opacity: .25; }
  74%      { stroke-dashoffset: 0;  opacity: 1; }
  100%     { stroke-dashoffset: 0;  opacity: .45; }
}
@media (prefers-reduced-motion: reduce) {
  .sig-flow, .sig-wave, .dot-live { animation: none; }
  .sig-flow { stroke-dasharray: none; }
  .sig-wave { stroke-dasharray: none; opacity: .7; }
}

/* 风险标记 */
.risk { display: inline-flex; align-items: center; gap: 5px; padding: 3px var(--s-2);
  border-radius: var(--r-sm); font-size: var(--t-label); line-height: 1.4;
  border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap; }
.risk::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.risk-none    { color: var(--local);  border-color: var(--local-line); background: var(--local-soft); }
.risk-caution { color: var(--sig-gate); border-color: rgba(255,212,121,.28); background: var(--sig-gate-soft); }
.risk-high    { color: var(--danger); border-color: var(--danger-line); background: var(--danger-soft); }
.risk-undeclared { color: var(--muted); }

/* ==========================================================================
   风险确认弹窗
   用原生 <dialog>：自带焦点陷阱、Esc 关闭、::backdrop，
   比自己拿 div 拼一个可访问性好得多。
   ========================================================================== */
dialog.modal {
  width: min(520px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  background: var(--panel);
  color: var(--fg);
  box-shadow: var(--shadow-pop);
}
dialog.modal::backdrop { background: rgba(4, 6, 10, .72); backdrop-filter: blur(2px); }
.modal-head { padding: 20px 22px 0; }
.modal-head h2 { margin: 0 0 6px; font-size: 18px; font-weight: 600; }
.modal-body { padding: 14px 22px 0; font-size: var(--t-sm); line-height: 1.75; color: var(--fg-dim); }
.modal-body ul { margin: 10px 0; padding-left: 20px; }
.modal-body li { margin: 5px 0; }
.modal-body b { color: var(--fg); font-weight: 500; }
.modal-foot { padding: 18px 22px 20px; display: flex; gap: var(--s-3); justify-content: flex-end; flex-wrap: wrap; }
.modal-check {
  display: flex; gap: 9px; align-items: flex-start; margin: 16px 0 0;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--code-bg); font-size: var(--t-sm); line-height: 1.6; cursor: pointer;
}
.modal-check input { margin: 3px 0 0; width: 15px; height: 15px; flex: 0 0 auto; accent-color: var(--accent); cursor: pointer; }
.modal-foot .btn:disabled { opacity: .45; cursor: not-allowed; }

/* 工具条 */
.filters { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; margin-bottom: var(--s-5); }
.filters .grow { flex: 1 1 240px; min-width: 200px; }
.filters input[type=search], .filters select {
  width: 100%; padding: 9px 12px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--code-bg); color: var(--fg);
  font-size: var(--t-sm); font-family: inherit;
}
.filters input:focus-visible, .filters select:focus-visible {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.pager { display: flex; gap: var(--s-3); align-items: center; justify-content: center; margin-top: var(--s-6); }
.pager .t-sm { color: var(--muted); font-variant-numeric: tabular-nums; }

/* 设备族筛选的选中态 —— 用 aria-pressed 而不是额外类名，
   状态只有一处真相，读屏器也能读到。 */
.fam-chip[aria-pressed="true"] {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-hi);
}

/* 页头登录入口。窄屏收进抽屉，别跟汉堡按钮挤在一起。 */
.nav-login { white-space: nowrap; }
@media (max-width: 720px) { .nav-login { display: none; } }

/* ==========================================================================
   顶栏账号
   ========================================================================== */
.nav-account { position: relative; display: flex; align-items: center; }

.acct-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 10px 0 6px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--fg-dim);
  font-size: var(--t-sm);
  cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.acct-btn:hover,
.acct-btn:focus-visible,
.acct-btn[aria-expanded="true"] {
  background: var(--panel-2);
  border-color: var(--line-strong);
  color: var(--fg);
}
.acct-dot {
  display: grid;
  place-items: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-hi);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}
.acct-name {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acct-btn .chev {
  width: 10px; height: 10px;
  stroke: currentColor; fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  transition: transform var(--dur) var(--ease);
}
.acct-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }

.acct-menu {
  position: absolute;
  right: 0;
  top: calc(100% + var(--s-2));
  min-width: 176px;
  padding: 6px;
  background: var(--panel-2);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: var(--shadow-pop);
  z-index: 60;
}
.acct-item {
  display: block;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: var(--s-2);
  background: transparent;
  color: var(--fg-dim);
  font: inherit;
  font-size: var(--t-sm);
  text-align: left;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.acct-item:hover,
.acct-item:focus-visible { background: var(--accent-soft); color: var(--fg); }

@media (max-width: 720px) {
  .acct-name { display: none; }
  .acct-btn { padding: 0 8px; }
}

/* ==========================================================================
   Cookie 与本地存储提示
   左下角一张小卡，不挡内容、不锁滚动。我们只有必要 Cookie，
   所以它是告知，不是同意闸机 —— 不需要把整个页面拦下来。
   ========================================================================== */
.cookie-notice {
  position: fixed;
  left: var(--s-4);
  bottom: var(--s-4);
  z-index: 90;
  width: min(380px, calc(100vw - var(--s-4) * 2));
  padding: 18px;
  background: var(--panel-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 220ms var(--ease), transform 220ms var(--ease);
}
.cookie-notice.is-in { opacity: 1; transform: translateY(0); }
.cookie-notice.is-out { opacity: 0; transform: translateY(12px); }

.cn-title {
  margin: 0 0 6px;
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--fg);
  letter-spacing: 0.01em;
}
.cn-text {
  margin: 0;
  font-size: var(--t-sm);
  line-height: 1.7;
  color: var(--muted);
}
.cn-actions {
  display: flex;
  gap: var(--s-2);
  margin-top: var(--s-3);
}

@media (max-width: 720px) {
  .cookie-notice { left: var(--s-3); right: var(--s-3); bottom: var(--s-3); width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .cookie-notice { transition: none; }
}

/* 首页精选卡片整块可点 */
.p-card-link { display: block; color: inherit; }
.p-card-link:hover { border-color: var(--line-focus); }
.p-card-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ==========================================================================
   条款
   ========================================================================== */
.legal-list { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.legal-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-4);
  padding: 16px 18px;
  background: var(--panel);
  transition: background var(--dur) var(--ease);
}
.legal-row:hover { background: var(--panel-2); }
.legal-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.legal-row-name { font-size: 15px; color: var(--fg); }
.legal-row-meta { font-size: var(--t-sm); color: var(--muted); white-space: nowrap; }
.legal-back { display: inline-block; margin-bottom: var(--s-4); font-size: var(--t-sm); color: var(--muted); }
.legal-back:hover { color: var(--fg); }
.legal-body { max-width: 74ch; }
.legal-body h1 { font-size: 19px; margin: 30px 0 10px; color: var(--fg); }
.legal-body h2 { font-size: 17px; margin: 28px 0 10px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--fg); }
.legal-body h3 { font-size: 15px; margin: 20px 0 6px; color: var(--fg); }
.legal-body p { margin: 10px 0; }
.legal-body ul, .legal-body ol { padding-left: 22px; margin: 10px 0; }
.legal-body li { margin: 5px 0; }
.legal-body code { background: var(--bg-deep); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; font-size: 12.5px; }
.legal-body table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: var(--t-sm); display: block; overflow-x: auto; }
.legal-body th, .legal-body td { border: 1px solid var(--line); padding: 8px 11px; text-align: left; vertical-align: top; }
.legal-body th { background: var(--panel-2); white-space: nowrap; }
.legal-body blockquote { margin: 16px 0; padding: 10px 16px; border-left: 3px solid var(--accent); background: var(--panel-2); border-radius: 0 6px 6px 0; }
.legal-body hr { border: none; border-top: 1px solid var(--line); margin: 24px 0; }
@media (max-width: 560px) {
  .legal-row { flex-direction: column; gap: 4px; }
  .legal-row-meta { white-space: normal; }
}

/* 页脚在窄屏上：品牌与链接叠成一列，链接两列排 */
@media (max-width: 900px) {
  .foot-grid { grid-template-columns: 1fr; gap: var(--s-7); }
  .foot-cols { grid-template-columns: repeat(2, 1fr); gap: var(--s-6) var(--s-5); }
}
@media (max-width: 560px) {
  .foot-cols { grid-template-columns: 1fr; gap: 0; }
  .foot-status { margin-top: var(--s-4); }
}

/* 兼容说明卡：跨满整行，和红线卡并排在采集方式那一栏下面。
   语气上是「你已有的东西在这儿也能用」，不是警告，所以用中性底色。 */
.compat-card {
  grid-column: 1 / -1;
  padding: var(--s-4) 18px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  border-radius: var(--r-md);
}
.compat-card .t-h3 { margin-bottom: var(--s-2); }
.compat-card p { margin: 0; max-width: 78ch; }
.compat-card p + p { margin-top: var(--s-2); }

/* --------------------------------------------------------------------------
   19. 插件详情页
   -------------------------------------------------------------------------- */

/* 面包屑 */
.crumb {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--t-sm);
  color: var(--muted-2);
  min-width: 0;
}
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--accent-hi); }
.crumb > span:last-child {
  color: var(--fg-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-hero {
  padding: var(--s-5);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
}
.detail-hero-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--s-3);
}
.detail-hero .t-lead { color: var(--fg-dim); }

/* 正文 + 侧栏。侧栏在窄屏排到正文下面，不是挤成两条细柱。 */
.detail-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: var(--s-5);
  align-items: start;
}
.detail-main { min-width: 0; display: flex; flex-direction: column; gap: var(--s-5); }
.detail-side { min-width: 0; display: flex; flex-direction: column; }

.detail-sec {
  padding: var(--s-5);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.detail-sec > .ev-list,
.detail-sec > .mini-grid { margin-top: var(--s-4); }

.side-card {
  padding: var(--s-4) var(--s-5) var(--s-5);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

/* 事件表。三列在桌面上是「中文名 / 插件事件键 / 通用键」，
   窄屏折成两行 —— 键是等宽长串，硬挤三列只会各自截断，谁都读不了。 */
.ev-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.ev-row {
  display: grid;
  grid-template-columns: minmax(96px, 1fr) minmax(0, 1.4fr) minmax(0, 1.2fr);
  gap: var(--s-3);
  align-items: center;
  padding: 10px var(--s-4);
  font-size: var(--t-sm);
}
.ev-row + .ev-row { border-top: 1px solid var(--line); }
.ev-row:nth-child(odd) { background: rgba(255, 255, 255, .012); }
.ev-name { color: var(--fg); }
.ev-key,
.ev-uni {
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  overflow-wrap: anywhere;
}
.ev-key { color: var(--muted); }
.ev-uni { color: var(--sig-wave); }
.ev-uni.is-none { font-family: inherit; color: var(--muted-2); }

/* 版本 / 大小这类成对信息 */
.kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px var(--s-4);
  margin: var(--s-3) 0 0;
  font-size: var(--t-sm);
}
.kv dt { color: var(--muted-2); }
.kv dd { margin: 0; color: var(--fg-dim); text-align: right; font-variant-numeric: tabular-nums; }

/* 校验哈希：它是「我下到的是不是这一份」的唯一答案，
   所以要整串可见、可复制，而不是缩成一行小字让人手抄 64 个字符。 */
.hash-block {
  padding: var(--s-3);
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.hash-val {
  display: block;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  line-height: 1.6;
  color: var(--fg-dim);
  overflow-wrap: anywhere;
}

.ver-list { list-style: none; margin: 0; padding: 0; font-size: var(--t-sm); }
.ver-list li {
  display: flex;
  align-items: baseline;
  gap: var(--s-3);
  padding: 7px 0;
  flex-wrap: wrap;
}
.ver-list li + li { border-top: 1px solid var(--line); }
.ver-list code { font-family: var(--font-mono); font-size: var(--t-micro); color: var(--fg); }
.ver-list .muted { color: var(--muted-2); font-size: var(--t-xs); }

/* 相关玩法的小卡 */
.mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--s-3);
}
.mini-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--s-3) var(--s-4);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: inherit;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.mini-card:hover { border-color: var(--accent-line); background: var(--panel-3); }
.mini-name { color: var(--fg); font-size: var(--t-sm); font-weight: 500; }
.mini-desc { color: var(--muted); font-size: var(--t-xs); line-height: 1.6; }
.mini-meta { color: var(--muted-2); font-size: var(--t-micro); font-variant-numeric: tabular-nums; }

/* 列表卡上的标题链接 */
.p-card-title { color: inherit; }
.p-card-title:hover { color: var(--accent-hi); }

/* 类别标记：只在不是普通插件时出现，给每张卡都挂一个「插件」是噪音 */
.chip-kind {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-hi);
}

/* 分段控件上的计数 */
.seg-n {
  min-width: 18px;
  padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--panel-3);
  color: var(--muted);
  font-size: var(--t-micro);
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.seg button[aria-pressed="true"] { color: var(--fg); background: var(--panel-3); }
.seg button[aria-pressed="true"] .seg-n { background: var(--accent-soft); color: var(--accent-hi); }

.inline-warn {
  margin: 0 0 var(--s-4);
  padding: 10px var(--s-4);
  border: 1px solid var(--danger-line);
  background: var(--danger-soft);
  border-radius: var(--r-md);
  color: var(--fg-dim);
  font-size: var(--t-sm);
}

.muted { color: var(--muted); }


/* ==========================================================================
   响应式加固 —— 手机 / 平板 / 各种比例

   这一段处理的不是「小屏幕」，是**各种比例**：

     · 刘海屏 / 挖孔屏   横过来时屏幕左右各有一条被摄像头和圆角吃掉的区域，
                         底部还有一条手势条。内容得从那几条里让开。
     · 手机横屏           可视高度只剩 360–430px。按竖屏那套纵向留白排，
                         一屏就只剩两行正文，粘顶栏还要再吃掉 14%。
     · 平板竖屏           768–1024 宽。按手机排是浪费，按桌面排又挤。
     · 折叠屏 / 分屏      宽高比什么都可能。所以断点按内容排不下的位置给，
                         不按机型给。
     · 地址栏收放         100vh 在手机上把被收起的那条地址栏也算了进去，
                         底部会被截掉一截。用 dvh。
     · 手指不是鼠标       点击目标 44px；输入框字号必须 ≥16px ——
                         小于 16px 时 iOS 聚焦会把整页放大，而且不会缩回去。
   ========================================================================== */

:root { --edge-x: var(--s-5); }

/* --- 安全区 --------------------------------------------------------------
   viewport-fit=cover 让页面铺满整块屏幕，代价是我们自己得让开那几条。
   用 max() 而不是加法：没有安全区的设备上它就等于原来的边距。 */
@supports (padding: max(0px)) {
  .wrap {
    padding-left: max(var(--edge-x), env(safe-area-inset-left));
    padding-right: max(var(--edge-x), env(safe-area-inset-right));
  }
  body { padding-bottom: env(safe-area-inset-bottom, 0px); }
}

/* --- 长串不许把版面撑开 --------------------------------------------------
   哈希、事件键、包名都是不带空格的长串。一个 64 位哈希就能把整页顶出
   横向滚动条，而横向滚动条在手机上是找不回来的 —— 用户只会觉得页面坏了。 */
pre { overflow-x: auto; -webkit-overflow-scrolling: touch; }
code, kbd, samp { overflow-wrap: anywhere; }
.tbl-scroll, .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
img, svg, video, canvas { max-width: 100%; }

/* --- 手指不是鼠标 -------------------------------------------------------- */
@media (pointer: coarse) {
  .btn { min-height: 44px; }
  .btn-sm,
  .seg button,
  .pager button,
  .sidenav-item,
  .nav-main a,
  .tab,
  .who-item { min-height: 40px; }
  /* < 16px 时 iOS 一聚焦就把整页放大，而且不会自己缩回去 */
  input, select, textarea { font-size: max(16px, var(--t-sm)); }
  /* 悬停态在触屏上会「粘住」—— 手指点完抬起来，卡片还留在 hover 的样子 */
  .p-card:hover, .mini-card:hover { transform: none; }
}

/* --- 手机横屏：可视高度只剩 360–430px ------------------------------------ */
@media (orientation: landscape) and (max-height: 500px) {
  :root { --header-h: 46px; }
  .sec { padding: var(--s-6) 0; }
  .sec + .sec { padding-top: 0; }
  .t-display { font-size: clamp(22px, 5.4vh, 34px); }
  /* 粘顶栏在 400px 高的屏上要吃掉 14% 的可视面积，这里让它跟着走 */
  #site-header, .acct-header, .topbar, .sidenav { position: static; }
  .console { padding-top: var(--s-4); }
}

/* --- 平板竖屏 768–1024 ---------------------------------------------------- */
@media (min-width: 768px) and (max-width: 1024px) {
  .card-grid, .p-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .console { grid-template-columns: 196px minmax(0, 1fr); gap: var(--s-5); }
}

/* --- 侧栏在窄屏上不再是一栏，而是一条可横滑的标签 ------------------------ */
@media (max-width: 860px) {
  .console { grid-template-columns: minmax(0, 1fr); gap: var(--s-4); }
  .sidenav { position: static; }
  .sidenav-list {
    flex-direction: row;
    overflow-x: auto;
    scrollbar-width: none;
    gap: var(--s-1);
    padding-bottom: 2px;
  }
  .sidenav-list::-webkit-scrollbar { display: none; }
  .sidenav-item {
    border-left: 0;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    flex: 0 0 auto;
  }
  .sidenav-item.is-current { border-left-color: transparent; border-bottom-color: var(--accent); }
}

/* --- 弹窗在小屏上是底部抽屉 ----------------------------------------------
   520px 宽的居中卡片在 375px 的手机上四周只剩 16px，按钮还够不着拇指。
   底部抽屉是手机上大家都认的形状。 */
@media (max-width: 560px) {
  dialog.modal {
    width: 100%;
    max-width: 100%;
    margin: auto auto 0;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    border-bottom: 0;
    max-height: 88dvh;
    overflow-y: auto;
  }
  .modal-foot {
    position: sticky;
    bottom: 0;
    background: var(--panel);
    border-top: 1px solid var(--line);
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }
  .modal-foot .btn { flex: 1 1 140px; justify-content: center; }
  .hide-sm { display: none !important; }
}

/* --- 极窄：≤360px（SE / 折叠屏合起来 / 分屏三分之一） --------------------- */
@media (max-width: 360px) {
  :root { --t-h1: 24px; --t-h2: 19px; --edge-x: 14px; }
  .btn { padding-left: 12px; padding-right: 12px; }
  .btn-row { gap: var(--s-2); }
}

/* --- 详情页在窄屏上的形状 ------------------------------------------------
   侧栏（版本 / 校验哈希 / 历史）在 900px 以下排到正文下面，而不是挤成
   两条细柱 —— 那一列里最长的东西是 64 位哈希，挤窄了只会换行成四行。 */
@media (max-width: 900px) {
  .detail-cols { grid-template-columns: minmax(0, 1fr); }
  .detail-side { flex-direction: row; flex-wrap: wrap; gap: var(--s-4); }
  .detail-side > * { flex: 1 1 280px; margin-top: 0 !important; }
}

@media (max-width: 560px) {
  .detail-hero, .detail-sec, .side-card { padding: var(--s-4); }
  /* 事件表三列在 375px 上各自只剩 100px，键是等宽长串，三列都会被截断。
     折成上下堆叠：名字一行，两个键各一行，谁都读得全。 */
  .ev-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
    padding: 12px var(--s-4);
  }
  .kv dd { text-align: left; }
  .kv { grid-template-columns: auto minmax(0, 1fr); }
  .detail-side > * { flex: 1 1 100%; }
}

/* 首屏那条说明在窄屏上改成上下排。
   横排时「强度上限你定」这个 chip 顶着左边，右边一整段文字换四行，
   中间留出一大块空白 —— 在 375px 上它读起来像排版坏了。 */
@media (max-width: 640px) {
  .scope-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s-2);
    min-height: 0;
  }
}

/* --- 页脚这一片的点击目标（实测补的） ---------------------------------------
   页脚链接普遍只有 22–30px 高，可折叠分组的 summary 只有 17px。
   桌面上鼠标点得准，手指点不准 —— 而页脚恰恰是「条款」「隐私」「状态页」
   这些出问题时才会去找的入口，点不中的代价比别处更大。 */
@media (pointer: coarse) {
  .foot-link,
  .foot-col a,
  .foot-bottom a,
  .foot-links a,
  .crumb a,
  .brand,
  .side-brand {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
  }
  .foot details > summary {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  /* 面包屑那一行本来就是一行文字，撑高之后不该把上下推开 */
  .crumb { align-items: center; }
}

/* 手机上的汉堡菜单是唯一的导航入口，34px 点不准。 */
@media (pointer: coarse) {
  #nav-toggle, .nav-toggle, .who-btn, .icon-btn {
    min-width: 44px;
    min-height: 44px;
  }
}

/* --------------------------------------------------------------------------
   下载页
   -------------------------------------------------------------------------- */
.dl-card {
  padding: var(--s-5);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
}
.dl-card + .dl-card { margin-top: var(--s-4); }
.dl-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--s-3); }

/* 测试版的那段说明。一个只写着「beta」的标签，用户读到的是「新功能」，
   而这里的实际含义是「有一块没在真机上验过」—— 那句话必须显眼。 */
.dl-beta {
  margin: var(--s-4) 0 0;
  padding: 12px var(--s-4);
  border: 1px solid var(--sig-gate-soft);
  border-left: 3px solid var(--sig-gate);
  border-radius: var(--r-md);
  background: var(--sig-gate-soft);
  font-size: var(--t-sm);
  line-height: 1.75;
  color: var(--fg-dim);
}
.dl-notes { margin-top: var(--s-4); color: var(--fg-dim); font-size: var(--t-sm); line-height: 1.8; }
.dl-notes p { margin: 0; }
.dl-notes p + p { margin-top: 6px; }

.btn-lg { padding: 12px 22px; font-size: var(--t-lead); }

kbd {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: var(--r-sm);
  background: var(--code-bg);
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  color: var(--fg-dim);
}
