/* ==========================================================================
   PiScan Pro — 设计系统
   派网络(Pi Network)区块链浏览器
   ========================================================================== */

/* ---------- 1. 主题令牌 ---------- */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC",
               Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo,
               Consolas, "Liberation Mono", monospace;

  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-full: 999px;

  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;

  --topbar-h: 58px;
  --sidebar-w: 246px;
  --content-max: 1240px;

  --ease: cubic-bezier(.4, 0, .2, 1);
  --t-fast: .13s var(--ease);
  --t-mid: .24s var(--ease);
}

/* 亮色主题（默认） */
html[data-theme="light"] {
  --bg:            #f4f5fa;
  --bg-grad:       radial-gradient(1200px 600px at 12% -8%, #ede9fe 0%, transparent 62%),
                   radial-gradient(900px 520px at 96% 2%, #fce7f3 0%, transparent 58%);
  --surface:       #ffffff;
  --surface-2:     #fafbfe;
  --surface-3:     #f1f2f9;
  --surface-hover: #f7f7fd;
  --border:        #e5e7f0;
  --border-strong: #d5d8e6;

  --text:      #14162b;
  --text-dim:  #565b7d;
  --text-mute: #8b90aa;
  --text-inv:  #ffffff;

  --accent:        #7c3aed;
  --accent-hover:  #6d28d9;
  --accent-soft:   #f3ecff;
  --accent-2:      #c026d3;
  --accent-grad:   linear-gradient(135deg, #7c3aed 0%, #c026d3 100%);

  --gold:      #b45309;
  --gold-soft: #fff5e5;
  --gold-line: #f5d9a8;

  --up:        #dc2626;   /* 涨 = 红（中国市场惯例） */
  --up-soft:   #fee2e2;
  --down:      #16a34a;   /* 跌 = 绿 */
  --down-soft: #dcfce7;

  --ok:        #15803d;
  --ok-soft:   #e7f8ed;
  --warn:      #b45309;
  --warn-soft: #fef3c7;
  --err:       #b91c1c;
  --err-soft:  #fee2e2;
  --info:      #1d4ed8;
  --info-soft: #e5edff;

  --shadow-xs: 0 1px 2px rgba(20, 22, 43, .05);
  --shadow-sm: 0 1px 3px rgba(20, 22, 43, .07), 0 1px 2px rgba(20, 22, 43, .04);
  --shadow-md: 0 4px 16px rgba(20, 22, 43, .08);
  --shadow-lg: 0 18px 48px rgba(20, 22, 43, .14);
  --ring: 0 0 0 3px rgba(124, 58, 237, .16);
  --skel: linear-gradient(90deg, #eef0f7 25%, #e3e6f2 37%, #eef0f7 63%);
}

/* 暗色主题 */
html[data-theme="dark"] {
  --bg:            #0a0b14;
  --bg-grad:       radial-gradient(1200px 600px at 12% -8%, #241a52 0%, transparent 60%),
                   radial-gradient(900px 520px at 96% 2%, #3b1044 0%, transparent 56%);
  --surface:       #12142400;
  --surface:       #131527;
  --surface-2:     #191c31;
  --surface-3:     #1f2338;
  --surface-hover: #1c2036;
  --border:        #262b46;
  --border-strong: #333a5c;

  --text:      #eceffc;
  --text-dim:  #a3a9c9;
  --text-mute: #767d9f;
  --text-inv:  #0a0b14;

  --accent:        #a78bfa;
  --accent-hover:  #bd9dff;
  --accent-soft:   #221a3e;
  --accent-2:      #e879f9;
  --accent-grad:   linear-gradient(135deg, #8b5cf6 0%, #d946ef 100%);

  --gold:      #fbbf24;
  --gold-soft: #2c2311;
  --gold-line: #4a3a17;

  --up:        #f87171;
  --up-soft:   #3a1c1f;
  --down:      #4ade80;
  --down-soft: #14301f;

  --ok:        #4ade80;
  --ok-soft:   #14301f;
  --warn:      #fbbf24;
  --warn-soft: #33270d;
  --err:       #f87171;
  --err-soft:  #3a1c1f;
  --info:      #7dabff;
  --info-soft: #16233f;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .45);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, .5);
  --shadow-lg: 0 22px 56px rgba(0, 0, 0, .62);
  --ring: 0 0 0 3px rgba(167, 139, 250, .22);
  --skel: linear-gradient(90deg, #1a1d31 25%, #23273f 37%, #1a1d31 63%);
}

/* ---------- 2. 基础重置 ---------- */
*, *::before, *::after { box-sizing: border-box; }

/* 覆盖 display 规则，保证 hidden 属性始终生效 */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background-color: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--accent-hover); }

h1, h2, h3, h4 { margin: 0; font-weight: 640; letter-spacing: -.015em; line-height: 1.3; }
h1 { font-size: 24px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
h4 { font-size: 13px; }
p  { margin: 0 0 var(--sp-3); }
p:last-child { margin-bottom: 0; }

code, kbd, pre, .mono { font-family: var(--font-mono); font-variant-ligatures: none; }

::selection { background: var(--accent); color: #fff; }

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-xs); }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--r-full);
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-mute); background-clip: content-box; }

/* ---------- 3. 布局 ---------- */
.app { display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  position: sticky; top: 0; z-index: 60;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 0 var(--sp-4);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); flex: 0 0 auto; }
.brand:hover { color: var(--text); }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--accent-grad);
  color: #fff; font-size: 19px; font-weight: 700; line-height: 1;
  padding-bottom: 3px;
  box-shadow: 0 3px 12px rgba(124, 58, 237, .34);
}
.brand-text { display: flex; align-items: baseline; gap: 5px; font-size: 15.5px; letter-spacing: -.02em; }
.brand-text b { font-weight: 700; }
.brand-text i {
  font-style: normal; font-weight: 700; font-size: 11px;
  background: var(--accent-grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  border: 1px solid var(--border); border-radius: var(--r-full);
  padding: 1px 6px;
}
.brand-text i { -webkit-text-fill-color: currentColor; color: var(--accent); }

.net-pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px;
  font-size: 11.5px; font-weight: 620; color: var(--text-dim);
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: var(--r-full); white-space: nowrap;
}
.net-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.net-pill.is-testnet .dot { background: var(--warn); }

.grow { flex: 1 1 auto; }

.search-trigger {
  display: flex; align-items: center; gap: 10px;
  height: 36px; width: 100%; max-width: 380px; padding: 0 10px 0 12px;
  font: inherit; font-size: 13px; color: var(--text-mute);
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: var(--r-sm); cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}
.search-trigger:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.search-trigger svg { flex: 0 0 auto; opacity: .75; }
.search-trigger span { flex: 1 1 auto; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-trigger kbd {
  font-size: 10.5px; padding: 2px 6px; border-radius: 5px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-mute); box-shadow: var(--shadow-xs);
}

.topbar-actions { display: flex; align-items: center; gap: var(--sp-1); flex: 0 0 auto; }

.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center;
  background: transparent; border: 1px solid transparent; border-radius: var(--r-sm);
  color: var(--text-dim); cursor: pointer; transition: all var(--t-fast);
  position: relative;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn.is-on { color: var(--accent); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 26%, transparent); }
.icon-btn.is-on::after {
  content: ''; position: absolute; top: 5px; right: 5px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 2px var(--surface);
}

/* Language switcher: like an icon-btn but slightly wider to fit the 2-letter language code */
.lang-btn {
  width: auto; min-width: 34px; height: 34px; padding: 0 8px;
  display: inline-flex; align-items: center; gap: 5px;
  background: transparent; border: 1px solid transparent; border-radius: var(--r-sm);
  color: var(--text-dim); cursor: pointer; transition: all var(--t-fast);
  font: 600 11.5px/1 var(--ff-mono, ui-monospace, "SF Mono", Menlo, monospace);
  letter-spacing: 0.5px;
}
.lang-btn:hover { background: var(--surface-3); color: var(--text); }
.lang-btn #langLabel { display: inline-block; transform: translateY(-0.5px); }
@media (max-width: 720px) {
  .lang-btn { padding: 0 6px; }
}

.menu-btn { display: none; }

.shell { display: flex; flex: 1 1 auto; align-items: flex-start; width: 100%; }

.sidebar {
  position: sticky; top: var(--topbar-h);
  flex: 0 0 var(--sidebar-w); width: var(--sidebar-w);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto; overscroll-behavior: contain;
  padding: var(--sp-4) var(--sp-3) var(--sp-8);
  border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 46%, transparent);
}

.nav-group + .nav-group { margin-top: var(--sp-5); }
.nav-group-label {
  padding: 0 10px var(--sp-2);
  font-size: 10.5px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-mute);
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  height: 34px; padding: 0 10px; margin-bottom: 2px;
  border-radius: var(--r-sm);
  color: var(--text-dim); font-size: 13.5px; font-weight: 520;
  transition: all var(--t-fast);
  position: relative;
}
.nav-item svg { flex: 0 0 auto; opacity: .8; }
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item.active {
  background: var(--accent-soft); color: var(--accent); font-weight: 620;
}
.nav-item.active svg { opacity: 1; }
.nav-item.active::before {
  content: ''; position: absolute; left: -12px; top: 7px; bottom: 7px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.nav-item .nav-badge {
  margin-left: auto; font-size: 10.5px; font-weight: 600;
  padding: 1px 6px; border-radius: var(--r-full);
  background: var(--surface-3); color: var(--text-mute);
  border: 1px solid var(--border);
}

.sidebar-foot {
  margin-top: var(--sp-6); padding: var(--sp-3) 10px 0;
  border-top: 1px solid var(--border);
  font-size: 11.5px; color: var(--text-mute); line-height: 1.7;
}
.sidebar-foot a { color: var(--text-dim); }
.sidebar-foot code { font-size: 10.5px; }

.content {
  flex: 1 1 auto; min-width: 0;
  padding: var(--sp-6) var(--sp-6) var(--sp-10);
  max-width: calc(var(--content-max) + var(--sp-6) * 2);
}

.footer {
  border-top: 1px solid var(--border);
  padding: var(--sp-5) var(--sp-6);
  font-size: 12px; color: var(--text-mute);
  display: flex; flex-wrap: wrap; gap: var(--sp-4) var(--sp-6);
  align-items: center;
  background: color-mix(in srgb, var(--surface) 40%, transparent);
}
.footer .sep { flex: 1 1 auto; }

/* ---------- 4. 页头 ---------- */
.page-head { margin-bottom: var(--sp-5); }
.page-head .crumbs {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-mute); margin-bottom: var(--sp-2);
}
.page-head .crumbs a { color: var(--text-dim); }
.page-head .crumbs span.sep { opacity: .5; }
.page-head-row { display: flex; align-items: flex-start; gap: var(--sp-4); flex-wrap: wrap; }
.page-head-row .grow { min-width: 12px; }
.page-head h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-desc { color: var(--text-dim); font-size: 13px; margin-top: 5px; max-width: 78ch; }
.page-actions { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }

/* ---------- 5. 面板 / 卡片 ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.panel + .panel { margin-top: var(--sp-5); }
.panel-head {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 13px var(--sp-5);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  min-height: 50px;
}
.panel-head h2, .panel-head h3 { font-size: 14px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.panel-head .grow { flex: 1 1 auto; }
.panel-head .sub { font-size: 11.5px; color: var(--text-mute); font-weight: 400; }
.panel-body { padding: var(--sp-5); }
.panel-body.flush { padding: 0; }
.panel-foot {
  padding: 10px var(--sp-5); border-top: 1px solid var(--border);
  background: var(--surface-2); font-size: 12px; color: var(--text-mute);
  display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap;
}

.grid { display: grid; gap: var(--sp-5); }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.split-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid.split-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.stack { display: flex; flex-direction: column; gap: var(--sp-5); }

/* 统计卡片 */
.stat-grid { display: grid; gap: var(--sp-4); grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-card {
  position: relative;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 14px var(--sp-4) 12px;
  box-shadow: var(--shadow-xs); overflow: hidden;
  transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.stat-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.stat-card .stat-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 560; color: var(--text-mute);
  margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stat-card .stat-value {
  font-size: 21px; font-weight: 680; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums; line-height: 1.25;
  overflow-wrap: anywhere;
}
.stat-card .stat-value .unit { font-size: 13px; font-weight: 560; color: var(--text-dim); margin-left: 3px; }
.stat-card .stat-sub {
  margin-top: 4px; font-size: 11.5px; color: var(--text-mute);
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
}
.stat-card .stat-spark { position: absolute; right: 0; bottom: 0; left: 0; height: 34px; opacity: .5; pointer-events: none; }
.stat-card.accent { border-color: color-mix(in srgb, var(--accent) 34%, transparent); }
.stat-card.accent .stat-value { color: var(--accent); }
.stat-card.gold { border-color: var(--gold-line); background: linear-gradient(180deg, var(--gold-soft), var(--surface) 70%); }
.stat-card.gold .stat-value { color: var(--gold); }

/* ---------- 6. 表格 ---------- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  text-align: left; font-weight: 600; font-size: 11.5px;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-mute); background: var(--surface-2);
  padding: 9px var(--sp-4); white-space: nowrap;
  border-bottom: 1px solid var(--border);
  position: relative;
}
table.tbl th a, table.tbl th button {
  color: inherit; font: inherit; background: none; border: 0; padding: 0; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
}
table.tbl th button:hover { color: var(--accent); }
table.tbl td {
  padding: 10px var(--sp-4);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
table.tbl tbody tr { transition: background var(--t-fast); }
table.tbl tbody tr:hover { background: var(--surface-hover); }
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl td.num, table.tbl th.num { text-align: right; }
table.tbl td.nowrap, table.tbl th.nowrap { white-space: nowrap; }
table.tbl.compact td { padding: 7px var(--sp-4); }

.table-toolbar {
  display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap;
  padding: 11px var(--sp-5); border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.table-toolbar .grow { flex: 1 1 auto; }

/* ---------- 7. 小元件 ---------- */
.mono-sm { font-family: var(--font-mono); font-size: 12px; letter-spacing: -.02em; }
.muted { color: var(--text-mute); }
.dim { color: var(--text-dim); }
.up { color: var(--up); }
.down { color: var(--down); }
.nowrap { white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.right { text-align: right; }
.hidden { display: none !important; }

.addr {
  font-family: var(--font-mono); font-size: 12.2px;
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--accent); max-width: 100%;
}
.addr:hover { text-decoration: underline; }
.addr .addr-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.copy-btn {
  flex: 0 0 auto; width: 18px; height: 18px; display: inline-grid; place-items: center;
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--text-mute); border-radius: 4px; opacity: 0; transition: all var(--t-fast);
}
tr:hover .copy-btn, .kv-row:hover .copy-btn, .addr:hover .copy-btn, .copy-host:hover .copy-btn { opacity: 1; }
.copy-btn:hover { color: var(--accent); background: var(--surface-3); }
.copy-btn.done { color: var(--ok); opacity: 1; }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  height: 20px; padding: 0 7px; border-radius: var(--r-xs);
  font-size: 11px; font-weight: 600; letter-spacing: .01em;
  background: var(--surface-3); color: var(--text-dim);
  border: 1px solid var(--border); white-space: nowrap;
}
.chip.ok     { background: var(--ok-soft);    color: var(--ok);    border-color: color-mix(in srgb, var(--ok) 26%, transparent); }
.chip.err    { background: var(--err-soft);   color: var(--err);   border-color: color-mix(in srgb, var(--err) 26%, transparent); }
.chip.warn   { background: var(--warn-soft);  color: var(--warn);  border-color: color-mix(in srgb, var(--warn) 26%, transparent); }
.chip.info   { background: var(--info-soft);  color: var(--info);  border-color: color-mix(in srgb, var(--info) 26%, transparent); }
.chip.accent { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 26%, transparent); }
.chip.gold   { background: var(--gold-soft);  color: var(--gold);  border-color: var(--gold-line); }
.chip.up     { background: var(--up-soft);    color: var(--up);    border-color: color-mix(in srgb, var(--up) 26%, transparent); }
.chip.down   { background: var(--down-soft);  color: var(--down);  border-color: color-mix(in srgb, var(--down) 26%, transparent); }
.chip .chip-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 13px;
  font: inherit; font-size: 13px; font-weight: 570;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  cursor: pointer; white-space: nowrap;
  transition: all var(--t-fast);
  box-shadow: var(--shadow-xs);
}
.btn:hover { background: var(--surface-3); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary {
  background: var(--accent-grad); border-color: transparent; color: #fff;
  box-shadow: 0 2px 10px rgba(124, 58, 237, .3);
}
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-dim); }
.btn.ghost:hover { background: var(--surface-3); color: var(--text); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn.xs { height: 24px; padding: 0 8px; font-size: 11.5px; border-radius: var(--r-xs); }
.btn.block { width: 100%; }

.input, .select, textarea.input {
  height: 34px; padding: 0 11px; width: 100%;
  font: inherit; font-size: 13px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-sm); transition: all var(--t-fast);
}
textarea.input { height: auto; padding: 9px 11px; resize: vertical; line-height: 1.55; min-height: 84px; }
.input::placeholder, textarea.input::placeholder { color: var(--text-mute); }
.input:focus, .select:focus, textarea.input:focus {
  outline: none; border-color: var(--accent); box-shadow: var(--ring);
}
.input.mono { font-family: var(--font-mono); font-size: 12.4px; }
.select {
  appearance: none; padding-right: 30px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12px; font-weight: 580; color: var(--text-dim); }
.field .hint { font-size: 11.5px; color: var(--text-mute); }
.inline-form { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
.inline-form .input { flex: 1 1 220px; width: auto; }

.seg {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: var(--r-sm);
}
.seg button {
  height: 26px; padding: 0 11px; border: 0; border-radius: var(--r-xs);
  background: transparent; color: var(--text-dim);
  font: inherit; font-size: 12.4px; font-weight: 560; cursor: pointer;
  transition: all var(--t-fast); white-space: nowrap;
}
.seg button:hover { color: var(--text); }
.seg button.active {
  background: var(--surface); color: var(--text); font-weight: 640;
  box-shadow: var(--shadow-xs);
}

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); padding: 0 var(--sp-5); background: var(--surface-2); overflow-x: auto; }
.tabs button {
  position: relative; height: 44px; padding: 0 13px; border: 0; background: none;
  font: inherit; font-size: 13.4px; font-weight: 550; color: var(--text-mute);
  cursor: pointer; white-space: nowrap; transition: color var(--t-fast);
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--accent); font-weight: 650; }
.tabs button.active::after {
  content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px;
  background: var(--accent); border-radius: 2px 2px 0 0;
}
.tabs button .cnt {
  display: inline-block; margin-left: 5px; font-size: 10.5px;
  padding: 0 5px; border-radius: var(--r-full); background: var(--surface-3); color: var(--text-mute);
}

.kv { display: flex; flex-direction: column; }
.kv-row {
  display: flex; gap: var(--sp-4); padding: 9px 0;
  border-bottom: 1px dashed var(--border);
  align-items: flex-start;
}
.kv-row:last-child { border-bottom: 0; }
.kv-row > .k {
  flex: 0 0 168px; font-size: 12.4px; color: var(--text-mute);
  padding-top: 1px; font-weight: 520;
}
.kv-row > .v {
  flex: 1 1 auto; min-width: 0; font-size: 13px; overflow-wrap: anywhere;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.kv.tight .kv-row { padding: 6px 0; }
.kv.tight .kv-row > .k { flex-basis: 132px; }

.dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--sp-4); }
.dl .dl-item .dt { font-size: 11.5px; color: var(--text-mute); margin-bottom: 3px; }
.dl .dl-item .dd { font-size: 15px; font-weight: 640; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

pre.code {
  margin: 0; padding: var(--sp-4);
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-family: var(--font-mono); font-size: 12px; line-height: 1.7;
  overflow-x: auto; white-space: pre; color: var(--text);
  max-height: 460px; overflow-y: auto;
}
.json-view { position: relative; }
.json-view pre.code { max-height: 420px; }
.json-view .json-toggle {
  position: absolute; top: 8px; right: 8px; z-index: 2;
}
.j-key { color: var(--accent); }
.j-str { color: var(--ok); }
.j-num { color: var(--info); }
.j-bool { color: var(--warn); }
.j-null { color: var(--text-mute); }

.copy-host { position: relative; }
.copy-host .copy-btn { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; background: var(--surface); border: 1px solid var(--border); opacity: 1; }
.copy-host .copy-btn:hover { opacity: 1; }

.hl { padding: 1px 5px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); font-family: var(--font-mono); font-size: 12px; }
.hl.gold { background: var(--gold-soft); color: var(--gold); }

.hash-break { font-family: var(--font-mono); font-size: 12px; word-break: break-all; line-height: 1.7; }

.callout {
  display: flex; gap: 10px; padding: 12px 14px;
  border-radius: var(--r-sm); border: 1px solid var(--border);
  background: var(--surface-2); font-size: 12.8px; color: var(--text-dim);
  line-height: 1.65;
}
.callout .co-icon { flex: 0 0 auto; margin-top: 1px; }
.callout b, .callout strong { color: var(--text); }
.callout.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); color: var(--text-dim); }
.callout.err  { background: var(--err-soft);  border-color: color-mix(in srgb, var(--err) 30%, transparent); }
.callout.ok   { background: var(--ok-soft);   border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.callout.info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.callout.accent { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }

/* ---------- 8. 图表 ---------- */
.chart { width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .c-grid { stroke: var(--border); stroke-width: 1; }
.chart .c-axis { fill: var(--text-mute); font-size: 10.5px; font-family: var(--font-sans); }
.chart .c-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .c-dot { stroke: var(--surface); stroke-width: 1.5; }
.chart .c-bar { transition: opacity var(--t-fast); }
.chart .c-bar:hover { opacity: .78; }
.chart .c-crosshair { stroke: var(--text-mute); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-legend { display: flex; gap: var(--sp-4); flex-wrap: wrap; padding-top: 10px; font-size: 11.8px; color: var(--text-dim); }
.chart-legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend .sw { width: 9px; height: 9px; border-radius: 3px; }
.chart-empty {
  display: grid; place-items: center; height: 180px;
  color: var(--text-mute); font-size: 12.5px;
}

.spark { display: block; width: 100%; }

.donut-wrap { display: flex; align-items: center; gap: var(--sp-5); flex-wrap: wrap; }
.donut-legend { display: flex; flex-direction: column; gap: 7px; flex: 1 1 200px; min-width: 0; }
.donut-legend .dl-row { display: flex; align-items: center; gap: 8px; font-size: 12.4px; }
.donut-legend .sw { width: 9px; height: 9px; border-radius: 3px; flex: 0 0 auto; }
.donut-legend .dl-name { color: var(--text-dim); flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donut-legend .dl-val { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.donut-legend .dl-pct { color: var(--text-mute); font-size: 11.5px; width: 46px; text-align: right; }

.hbar-row { display: flex; align-items: center; gap: 10px; padding: 4px 0; font-size: 12.4px; }
.hbar-row .hb-label { flex: 0 0 118px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-row .hb-track { flex: 1 1 auto; height: 8px; border-radius: var(--r-full); background: var(--surface-3); overflow: hidden; }
.hbar-row .hb-fill { height: 100%; border-radius: var(--r-full); transition: width .5s var(--ease); }
.hbar-row .hb-val { flex: 0 0 auto; font-variant-numeric: tabular-nums; font-weight: 600; min-width: 62px; text-align: right; }

/* ---------- 9. 状态 ---------- */
.skel {
  background: var(--skel); background-size: 400% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
  border-radius: var(--r-xs); height: 13px; display: block;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.skel.w40 { width: 40%; } .skel.w60 { width: 60%; } .skel.w80 { width: 80%; }

.empty {
  display: grid; place-items: center; gap: 8px;
  padding: 52px var(--sp-5); text-align: center; color: var(--text-mute);
}
.empty .em-icon {
  width: 46px; height: 46px; border-radius: var(--r-md);
  display: grid; place-items: center;
  background: var(--surface-3); color: var(--text-mute); margin-bottom: 4px;
}
.empty .em-title { font-size: 14px; font-weight: 620; color: var(--text-dim); }
.empty .em-desc { font-size: 12.5px; max-width: 46ch; line-height: 1.7; }

.spin {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent) 26%, transparent);
  border-top-color: var(--accent);
  animation: spin .72s linear infinite; display: inline-block; flex: 0 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.live-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok); position: relative; flex: 0 0 auto;
}
.live-dot::after {
  content: ''; position: absolute; inset: -3px; border-radius: 50%;
  border: 2px solid var(--ok); opacity: .5;
  animation: pulse 1.9s var(--ease) infinite;
}
@keyframes pulse {
  0%   { transform: scale(.6); opacity: .7; }
  100% { transform: scale(1.7); opacity: 0; }
}
.live-dot.paused { background: var(--text-mute); }
.live-dot.paused::after { display: none; }
.live-dot.offline { background: var(--warn); }
.live-dot.offline::after { border-color: var(--warn); }

.pager {
  display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap;
  padding: 11px var(--sp-5); border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.pager .pg-info { font-size: 12.2px; color: var(--text-mute); }
.pager .grow { flex: 1 1 auto; }

.toasts {
  position: fixed; z-index: 200; bottom: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 14px; max-width: 380px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-sm); box-shadow: var(--shadow-lg);
  font-size: 12.8px; color: var(--text);
  animation: toastIn .22s var(--ease);
  pointer-events: auto;
  border-left: 3px solid var(--accent);
}
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--err); }
.toast.warn { border-left-color: var(--warn); }
.toast.out { animation: toastOut .2s var(--ease) forwards; }
.toast svg { flex: 0 0 auto; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(16px); } }

/* ---------- 10. 搜索面板 ---------- */
.cmdk {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 11vh var(--sp-4) var(--sp-4);
  background: color-mix(in srgb, #05060f 52%, transparent);
  backdrop-filter: blur(3px);
  animation: fadeIn .14s var(--ease);
}
@keyframes fadeIn { from { opacity: 0; } }
.cmdk-box {
  width: 100%; max-width: 640px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  overflow: hidden; display: flex; flex-direction: column;
  max-height: 76vh;
  animation: popIn .18s var(--ease);
}
@keyframes popIn { from { opacity: 0; transform: translateY(-12px) scale(.985); } }
.cmdk-input-row {
  display: flex; align-items: center; gap: 10px;
  padding: 0 var(--sp-4); height: 54px; flex: 0 0 auto;
  border-bottom: 1px solid var(--border);
}
.cmdk-input-row svg { color: var(--text-mute); flex: 0 0 auto; }
.cmdk-input-row input {
  flex: 1 1 auto; border: 0; background: none; outline: none;
  font: inherit; font-size: 15px; color: var(--text);
}
.cmdk-input-row input::placeholder { color: var(--text-mute); }
.cmdk-results { overflow-y: auto; padding: 6px; flex: 1 1 auto; }
.cmdk-sec { padding: 8px 10px 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--text-mute); }
.cmdk-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: var(--r-sm);
  cursor: pointer; color: var(--text); font-size: 13.2px;
}
.cmdk-item:hover, .cmdk-item.active { background: var(--accent-soft); color: var(--accent); }
.cmdk-item .ci-icon { flex: 0 0 auto; width: 26px; height: 26px; border-radius: var(--r-xs); display: grid; place-items: center; background: var(--surface-3); color: var(--text-dim); }
.cmdk-item.active .ci-icon, .cmdk-item:hover .ci-icon { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.cmdk-item .ci-main { min-width: 0; flex: 1 1 auto; }
.cmdk-item .ci-title { font-weight: 560; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-item .ci-sub { font-size: 11.5px; color: var(--text-mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-item .ci-kind { flex: 0 0 auto; }
.cmdk-foot {
  display: flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap;
  padding: 9px var(--sp-4); border-top: 1px solid var(--border);
  background: var(--surface-2); font-size: 11.5px; color: var(--text-mute);
}
.cmdk-foot kbd { font-size: 10.5px; padding: 1px 5px; border-radius: 4px; background: var(--surface); border: 1px solid var(--border); }

/* ---------- 11. 详情页装饰 ---------- */
.ident {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px; border-radius: var(--r-md);
  background: var(--surface-3); border: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 12.4px; word-break: break-all;
}
.op-card {
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); overflow: hidden;
}
.op-card + .op-card { margin-top: var(--sp-3); }
.op-card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--surface-2);
  border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.op-card-head .op-idx {
  width: 22px; height: 22px; border-radius: 6px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
  background: var(--accent-soft); color: var(--accent);
}
.op-card-body { padding: 12px 14px; }
.op-flow {
  display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap;
  font-size: 13px;
}
.op-flow .arrow { color: var(--text-mute); flex: 0 0 auto; }
.op-amount { font-weight: 680; color: var(--gold); font-size: 14px; }

.flow-list { display: flex; flex-direction: column; }
.flow-item {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 8px 0; border-bottom: 1px dashed var(--border);
  font-size: 12.6px; flex-wrap: wrap;
}
.flow-item:last-child { border-bottom: 0; }

.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px;
  width: 1px; background: var(--border);
}
.tl-item { position: relative; padding-bottom: var(--sp-4); }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ''; position: absolute; left: -19px; top: 5px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--accent);
}
.tl-item .tl-time { font-size: 11.5px; color: var(--text-mute); }
.tl-item .tl-title { font-size: 13.2px; font-weight: 560; }
.tl-item .tl-desc { font-size: 12.2px; color: var(--text-dim); }

.hero {
  position: relative; overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--r-xl);
  background:
    radial-gradient(760px 320px at 88% -30%, color-mix(in srgb, var(--accent-2) 16%, transparent), transparent 70%),
    radial-gradient(620px 300px at 6% -20%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 68%),
    var(--surface);
  padding: var(--sp-6);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--sp-5);
}
.hero-top { display: flex; align-items: flex-start; gap: var(--sp-4); flex-wrap: wrap; }
.hero h1 { font-size: 27px; letter-spacing: -.03em; }
.hero .hero-sub { color: var(--text-dim); font-size: 13.4px; margin-top: 6px; max-width: 72ch; }
.hero-stats {
  display: grid; gap: var(--sp-4); margin-top: var(--sp-5);
  grid-template-columns: repeat(auto-fit, minmax(152px, 1fr));
}
.hero-stat .hs-label { font-size: 11.3px; color: var(--text-mute); display: flex; align-items: center; gap: 5px; }
.hero-stat .hs-value {
  font-size: 20px; font-weight: 700; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums; margin-top: 2px;
}
.hero-stat .hs-sub { font-size: 11.3px; color: var(--text-mute); margin-top: 1px; }

.quick-grid { display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); }
.quick-card {
  display: flex; align-items: center; gap: 11px;
  padding: 12px 13px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); transition: all var(--t-fast); box-shadow: var(--shadow-xs);
}
.quick-card:hover { border-color: var(--accent); color: var(--text); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.quick-card .qc-icon {
  width: 34px; height: 34px; border-radius: var(--r-sm); flex: 0 0 auto;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.quick-card .qc-t { font-size: 13px; font-weight: 620; }
.quick-card .qc-d { font-size: 11.3px; color: var(--text-mute); }

.acc-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.acc-item { border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.acc-head {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 12px 14px; background: none; border: 0; cursor: pointer;
  font: inherit; font-size: 13.4px; font-weight: 580; color: var(--text); text-align: left;
}
.acc-head:hover { background: var(--surface-hover); }
.acc-head .acc-idx {
  flex: 0 0 auto; font-size: 11px; font-weight: 700; color: var(--accent);
  background: var(--accent-soft); border-radius: var(--r-xs); padding: 1px 6px;
}
.acc-head .grow { flex: 1 1 auto; }
.acc-head .caret { transition: transform var(--t-mid); color: var(--text-mute); flex: 0 0 auto; }
.acc-item.open .acc-head .caret { transform: rotate(180deg); }
.acc-body { padding: 2px var(--sp-4) var(--sp-4); display: none; font-size: 13px; color: var(--text-dim); line-height: 1.75; }
.acc-item.open .acc-body { display: block; }
.acc-body h4 { color: var(--text); margin: var(--sp-4) 0 6px; font-size: 13px; }
.acc-body h4:first-child { margin-top: 4px; }
.acc-body ul { margin: 0 0 var(--sp-3); padding-left: 20px; }
.acc-body li { margin-bottom: 4px; }
.acc-body code { background: var(--surface-3); padding: 1px 5px; border-radius: 4px; font-size: 12px; color: var(--accent); }
.acc-body table { width: 100%; border-collapse: collapse; font-size: 12.4px; margin: var(--sp-3) 0; }
.acc-body th, .acc-body td { border: 1px solid var(--border); padding: 6px 9px; text-align: left; }
.acc-body th { background: var(--surface-2); font-weight: 600; color: var(--text); }

.ep-list { display: flex; flex-direction: column; }
.ep {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 12.8px;
}
.ep:last-child { border-bottom: 0; }
.ep .method {
  flex: 0 0 auto; font-family: var(--font-mono); font-size: 10.5px; font-weight: 700;
  padding: 2px 7px; border-radius: var(--r-xs);
  background: var(--ok-soft); color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 26%, transparent);
}
.ep .path { font-family: var(--font-mono); font-size: 12.2px; color: var(--text); }
.ep .ep-desc { color: var(--text-mute); font-size: 12px; flex: 1 1 200px; }

.market-row { display: flex; align-items: center; gap: var(--sp-3); padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.market-row:last-child { border-bottom: 0; }
.market-row .mk-name { flex: 1 1 auto; font-weight: 560; }
.market-row .mk-price { font-variant-numeric: tabular-nums; font-weight: 640; }
.market-row .mk-chg { font-variant-numeric: tabular-nums; font-size: 12.2px; min-width: 68px; text-align: right; }
.market-row .mk-src { font-size: 11px; color: var(--text-mute); }

.price-big { font-size: 38px; font-weight: 720; letter-spacing: -.04em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.price-cur { font-size: 17px; font-weight: 560; color: var(--text-mute); margin-right: 5px; }

.watch-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 0;
  border-bottom: 1px dashed var(--border); font-size: 12.2px;
}
.watch-item:last-child { border-bottom: 0; }
.watch-item .grow { flex: 1 1 auto; min-width: 0; }

/* ---------- 12. 响应式 ---------- */
@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.split-2-1, .grid.split-1-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 940px) {
  .menu-btn { display: grid; }
  .sidebar {
    position: fixed; top: var(--topbar-h); left: 0; z-index: 70;
    background: var(--surface); box-shadow: var(--shadow-lg);
    transform: translateX(-102%); transition: transform var(--t-mid);
    border-right: 1px solid var(--border);
  }
  .sidebar.open { transform: none; }
  .content { padding: var(--sp-5) var(--sp-4) var(--sp-8); }
  .grid.cols-2, .grid.cols-3 { grid-template-columns: minmax(0, 1fr); }
  .kv-row { flex-direction: column; gap: 2px; }
  .kv-row > .k { flex-basis: auto; }
  .search-trigger span { display: none; }
  .search-trigger { width: 36px; max-width: 36px; padding: 0; justify-content: center; }
  .search-trigger kbd { display: none; }
  .brand-text { display: none; }
  .scrim {
    position: fixed; inset: var(--topbar-h) 0 0 0; z-index: 65;
    background: color-mix(in srgb, #05060f 42%, transparent);
  }
}
@media (max-width: 620px) {
  .stat-grid { grid-template-columns: minmax(0, 1fr); }
  .hero { padding: var(--sp-5) var(--sp-4); }
  .hero h1 { font-size: 22px; }
  .panel-body { padding: var(--sp-4); }
  .toasts { left: 12px; right: 12px; bottom: 12px; align-items: stretch; }
  .toast { max-width: none; }
  .price-big { font-size: 30px; }
}

@media print {
  .topbar, .sidebar, .footer, .page-actions, .table-toolbar, .pager { display: none !important; }
  .content { max-width: none; padding: 0; }
  .panel { break-inside: avoid; box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- 13. 网络切换下拉 ---------- */
.net-pill { cursor: pointer; transition: all var(--t-fast); }
.net-pill:hover { background: var(--surface-hover); border-color: var(--border-strong); }

.netmenu {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 90;
  min-width: 268px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  animation: popIn .16s var(--ease);
}
.netmenu-item {
  display: block; width: 100%; text-align: left; padding: 9px 11px;
  background: none; border: 0; border-radius: var(--r-sm); cursor: pointer;
  font: inherit; color: var(--text); transition: background var(--t-fast);
}
.netmenu-item:hover { background: var(--surface-3); }
.netmenu-item.active { background: var(--accent-soft); }
.netmenu-item.active .nm-title { color: var(--accent); font-weight: 680; }
.nm-title { display: block; font-size: 13px; font-weight: 600; }
.nm-sub { display: block; font-size: 11.2px; color: var(--text-mute); font-family: var(--font-mono); }

#demoBadge { flex: 0 0 auto; height: 24px; }

/* ---------- 14. 细节打磨 ---------- */
.ident { line-height: 1.65; }
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: '▸ '; color: var(--text-mute); }
details[open] > summary::before { content: '▾ '; }

.op-card-body .op-flow { font-size: 13.2px; }
.op-card-body .flow-item + .flow-item { margin-top: 2px; }

.ep .path { text-decoration: none; }
a.ep .path, .ep a.path { color: var(--accent); }

.toolbar-note { font-size: 11.8px; color: var(--text-mute); }

.acc-body ol { margin: 0 0 var(--sp-3); padding-left: 20px; }
.acc-body ol li { margin-bottom: 4px; }
.acc-body p { color: var(--text-dim); font-size: 13px; }
.acc-body table th { font-size: 12.2px; }

@media (max-width: 620px) {
  .netmenu { left: auto; right: 0; min-width: 240px; }
  .stat-card .stat-value { font-size: 19px; }
}

/* ===== Horizon connection modal ===== */
.connm {
  position: fixed; inset: 0; z-index: 320;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 11vh var(--sp-4) var(--sp-4);
  background: color-mix(in srgb, #05060f 52%, transparent);
  backdrop-filter: blur(3px);
  animation: fadeIn .14s var(--ease);
}
.connm[hidden] { display: none; }
.connm-box {
  width: 100%; max-width: 560px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  overflow: hidden; display: flex; flex-direction: column;
  animation: popIn .18s var(--ease);
}
.connm-head {
  display: flex; align-items: center; gap: 9px;
  padding: 13px 16px; border-bottom: 1px solid var(--border); color: var(--accent);
}
.connm-head .connm-title { flex: 1 1 auto; font-size: 14.5px; color: var(--text); }
.connm-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 13px; }
.connm-now {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 11px; border: 1px dashed var(--border-strong); border-radius: var(--r-sm);
  background: var(--surface-2);
}
.connm-now-label { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-mute); }
.connm-now-url { font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); word-break: break-all; }
.connm-result {
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; padding: 9px 11px; border-radius: var(--r-sm);
}
.connm-result.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.connm-result.err { color: var(--err); background: color-mix(in srgb, var(--err) 10%, transparent); }
.connm-why {
  font-size: 11.8px; line-height: 1.6; color: var(--text-mute);
  border-top: 1px dashed var(--border); padding-top: 11px;
}
.connm-foot {
  display: flex; gap: 8px; align-items: center;
  padding: 12px 16px; border-top: 1px solid var(--border);
}
@media (max-width: 520px) {
  .connm { padding: 7vh var(--sp-3) var(--sp-3); }
  .connm-foot { flex-wrap: wrap; }
}
