/* BestPerf 控制台 — 深黑底 · 青绿辉光 */
:root {
  color-scheme: dark;
  --bg: #06090d;
  --bg-2: #0a0f15;
  --panel: #0e151c;
  --panel-2: #0b1117;
  --line: #1a2430;
  --line-bright: #283746;
  --ink: #e9f1f6;
  --ink-dim: #8497a8;
  --ink-faint: #6d7f91;  /* lifted from #566677 → ~5:1 on the dark bg so hints/units/placeholders pass WCAG AA */
  --teal: #34e3c4;
  --teal-deep: #16c3a6;
  --teal-soft: rgba(52, 227, 196, 0.14);
  --amber: #ffc06a;
  --red: #ff6f6f;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --sans: "Sora", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ambient teal glow */
.ambient {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(620px 480px at 72% 8%, rgba(52, 227, 196, 0.12), transparent 70%),
    radial-gradient(520px 420px at 10% 100%, rgba(52, 227, 196, 0.06), transparent 70%);
}

/* ---- header ---- */
.console-bar {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px clamp(18px, 5vw, 56px);
  border-bottom: 1px solid var(--line);
}
/* teal hairline under the header, brightest in the center — a subtle "signal" accent */
.console-bar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(52,227,196,0.45), transparent);
}
.brand-group { display: flex; align-items: center; gap: 16px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
/* 网准通 company logo — clickable to the company site, divider separates it from the product mark */
.company-logo { display: inline-flex; align-items: center; gap: 14px; flex: none; height: clamp(48px, 4.8vw, 60px);
  padding-left: 20px; border-left: 1px solid var(--line); text-decoration: none; opacity: 0.92; transition: opacity 0.15s; }
.company-logo:hover { opacity: 1; }
.company-logo img { height: 100%; width: auto; display: block; }
.company-url { font-family: var(--mono); font-size: 1rem; color: var(--teal); letter-spacing: 0.3px;
  white-space: nowrap; text-decoration: none; transition: color 0.15s; }
.company-logo:hover .company-url { text-decoration: underline; }
.company-logo:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 4px; }
.brand-logo {
  display: block; flex: none; height: clamp(34px, 3.4vw, 42px); width: auto;
  object-fit: contain; filter: drop-shadow(0 0 14px rgba(52, 227, 196, 0.30));
}
.brand-text h1 { margin: 0; font-size: 1.42rem; font-weight: 800; letter-spacing: -0.4px; line-height: 1; }
.brand-text h1 span { color: var(--teal); }
.brand-text p { margin: 4px 0 0; font-size: 0.68rem; color: var(--ink-dim);
  font-family: var(--mono); text-transform: uppercase; letter-spacing: 1.8px; }

.health {
  display: flex; align-items: center; gap: 9px; font-family: var(--mono); font-size: 0.76rem;
  padding: 7px 14px; border: 1px solid var(--line-bright); border-radius: 999px;
  color: var(--ink-dim); background: var(--panel);
}
.health-lamp { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-faint); }
.health[data-state="ok"] { color: var(--teal); border-color: rgba(52,227,196,0.4); }
.health[data-state="ok"] .health-lamp { background: var(--teal); box-shadow: 0 0 10px 1px var(--teal); animation: pulse 2.4s infinite; }
.health[data-state="down"] { color: var(--red); border-color: rgba(255,111,111,0.4); }
.health[data-state="down"] .health-lamp { background: var(--red); box-shadow: 0 0 10px 1px var(--red); }

/* phone header: keep the wordmark, tagline and status pill on single, non-broken lines */
@media (max-width: 560px) {
  .console-bar { padding: 12px 16px; gap: 10px; }
  .brand { gap: 9px; }
  .brand-text h1 { font-size: 1.18rem; }
  .brand-text p { white-space: nowrap; letter-spacing: 1px; font-size: 0.6rem; }
  .health { flex: none; white-space: nowrap; padding: 6px 11px; font-size: 0.7rem; gap: 7px; }
  .health-lamp { width: 8px; height: 8px; }
  .company-url { display: none; }   /* 窄屏只留公司 logo,省空间 */
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ---- layout ---- */
.deck {
  position: relative; z-index: 1; max-width: 1160px; margin: 0 auto;
  padding: clamp(22px, 4vw, 40px) clamp(18px, 5vw, 56px) 80px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 22px;
}
.hero { grid-column: 1 / -1; }
.view { grid-column: 1 / -1; }   /* tabbed: the visible view takes the full width */

.tabs {
  position: relative; z-index: 1; max-width: 1160px; margin: 0 auto;
  padding: 14px clamp(18px, 5vw, 56px) 0; display: flex; gap: 8px;
}
.tab {
  background: transparent; border: 1px solid transparent; border-bottom: none;
  color: var(--ink-dim); border-radius: 11px 11px 0 0; padding: 11px 22px;
  font-size: 0.82rem; font-family: var(--mono); letter-spacing: 0.2px; cursor: pointer;
  transition: color 0.14s, background 0.14s, box-shadow 0.14s; position: relative;
}
.tab:hover { color: var(--ink); background: rgba(255,255,255,0.03); }
.tab.active {
  color: var(--teal); background: var(--teal-soft);
  border-color: rgba(52,227,196,0.32); box-shadow: inset 0 -2px 0 var(--teal);
}
@media (max-width: 900px) { .deck { grid-template-columns: 1fr; } }

.panel, .hero {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 24px 60px -32px rgba(0,0,0,0.9), inset 0 1px 0 rgba(255,255,255,0.045);
  animation: rise 0.5s both;
}
.panel { padding: 22px 24px 26px; }
#probesPanel { animation-delay: 0.08s; }
#resultsPanel { animation-delay: 0.12s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---- hero ---- */
.hero {
  display: grid; grid-template-columns: 1fr 320px; gap: 30px;
  padding: 28px clamp(22px, 3vw, 36px);
  position: relative; overflow: hidden;
}
/* stack config above the launch orb early — side-by-side cramps the form on tablets */
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } }
.kicker { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 1.5px; text-transform: uppercase; color: var(--teal); }

.endpoint-row { display: flex; align-items: flex-end; gap: 12px; margin: 16px 0 18px; }
.ep { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.ep-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.8px; color: var(--ink-dim); font-family: var(--mono); }
.swap {
  flex: none; width: 40px; height: 42px; border-radius: 10px; cursor: pointer;
  background: var(--teal-soft); border: 1px solid rgba(52,227,196,0.4); color: var(--teal);
  font-size: 1.2rem; transition: 0.15s;
}
.swap:hover { background: rgba(52,227,196,0.22); }

input, select, .control {
  font-family: var(--sans); font-size: 0.9rem; color: var(--ink);
  background: var(--bg-2); border: 1px solid var(--line-bright); border-radius: 9px;
  padding: 10px 12px; width: 100%; transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder { color: var(--ink-faint); }
input:focus, select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(52,227,196,0.15); }

/* Keyboard-only focus ring (mouse clicks don't trigger :focus-visible) — applied to every
   interactive control so tab-navigation is always visible, including the segmented radios
   whose real <input> is visually hidden (opacity:0). Premium look: a teal halo, no harsh outline. */
.tab:focus-visible, .btn:focus-visible, .orb:focus-visible, .swap:focus-visible,
.id-copy:focus-visible, .run-row:focus-visible, .advanced summary:focus-visible,
.probe-item .del:focus-visible, .cmp:focus-visible {
  outline: none; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--teal);
}
.seg input:focus-visible + span { outline: none; box-shadow: 0 0 0 2px var(--teal); }
.advanced summary:focus-visible { border-radius: 11px; }
select { appearance: none; padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-dim) 50%), linear-gradient(135deg, var(--ink-dim) 50%, transparent 50%);
  background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
#probeHost, #probePort, input[type="number"] { font-family: var(--mono); }

/* segmented direction */
.seg { border: 1px solid var(--line-bright); border-radius: 10px; padding: 6px; margin: 0 0 18px; display: flex; gap: 4px; }
.seg legend { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.8px; color: var(--ink-dim); font-family: var(--mono); padding: 0 6px; }
.seg label { flex: 1; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; font-size: 0.8rem; padding: 8px 6px; border-radius: 7px; cursor: pointer; color: var(--ink-dim); transition: 0.15s; }
.seg input:checked + span { background: var(--teal); color: var(--bg); font-weight: 600; }
.seg span:hover { color: var(--ink); }

.quick-params { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
@media (max-width: 560px) { .quick-params { grid-template-columns: 1fr; } }
.qp { display: flex; flex-direction: column; gap: 6px; }
.qp > span:first-child { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.6px; color: var(--ink-dim); font-family: var(--mono); }
.qp-input { display: flex; align-items: center; background: var(--bg-2); border: 1px solid var(--line-bright); border-radius: 9px; padding-right: 11px; }
.qp-input input { border: none; background: transparent; box-shadow: none !important; }
.qp-input i { font-style: normal; font-family: var(--mono); font-size: 0.74rem; color: var(--ink-faint); }

/* test toggles */
.tests { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.test-toggle { display: flex; align-items: center; gap: 12px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-2); }
.test-toggle.on { border-color: rgba(52,227,196,0.4); background: var(--teal-soft); }
.test-toggle .tt-text { flex: 1; }
.test-toggle strong { font-size: 0.9rem; font-weight: 600; }
.test-toggle small { display: block; color: var(--ink-dim); font-size: 0.76rem; margin-top: 2px; }
.test-toggle em { font-style: normal; font-family: var(--mono); font-size: 0.62rem; color: var(--amber); border: 1px solid rgba(255,192,106,0.4); border-radius: 4px; padding: 1px 5px; margin-left: 5px; }
.switch { flex: none; width: 42px; height: 24px; border-radius: 999px; background: var(--line-bright); position: relative; transition: 0.18s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink-dim); transition: 0.18s; }
.switch.on { background: var(--teal); box-shadow: 0 0 14px -2px var(--teal-deep); }
.switch.on i { left: 21px; background: #04140f; }
.switch[data-disabled] { opacity: 0.5; }
.switch:not([data-locked]):not([data-disabled]) { cursor: pointer; }
.test-toggle em.loop-only { color: #4fd6ff; border-color: rgba(79,214,255,0.4); }
.load-cap { display: block; margin-top: 7px; font-size: 0.74rem; color: var(--ink-dim); font-family: var(--mono); }
.load-cap input { width: 66px; display: inline-block; padding: 4px 7px; font-size: 0.78rem; }

.advanced { border: 1px solid var(--line); border-radius: 11px; background: var(--panel-2); }
.advanced + .advanced { margin-top: 12px; }
.advanced summary { cursor: pointer; padding: 12px 15px; font-size: 0.82rem; color: var(--ink-dim); font-family: var(--mono); user-select: none; }
.advanced summary .summary-hint { font-weight: 400; color: var(--ink-faint); font-size: 0.74rem; margin-left: 10px; letter-spacing: 0; }
.advanced summary::marker { color: var(--teal); }
.advanced[open] summary { border-bottom: 1px solid var(--line); color: var(--ink); }
.advanced-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; padding: 16px 15px; }
@media (max-width: 560px) { .advanced-grid { grid-template-columns: 1fr; } }
.advanced-grid .field { display: flex; flex-direction: column; gap: 6px; }
.advanced-grid .field span { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.6px; color: var(--ink-dim); font-family: var(--mono); }

/* ---- the orb ---- */
.hero-launch { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; }
.orb {
  position: relative; width: 232px; height: 232px; border-radius: 50%; cursor: pointer;
  border: none; background: transparent; display: grid; place-items: center;
  transition: transform 0.3s cubic-bezier(.2,.8,.2,1); -webkit-tap-highlight-color: transparent;
}
/* the glassy signal core: off-center light source, teal body, sunken rim — reads as a 3D sphere */
.orb::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%; z-index: 1;
  background:
    radial-gradient(120% 120% at 36% 27%, rgba(202,255,243,0.95) 0%, rgba(120,240,214,0) 44%),
    radial-gradient(circle at 50% 56%, #45e7c7 0%, var(--teal-deep) 56%, #08302a 100%);
  box-shadow:
    inset 0 1px 0 rgba(222,255,249,0.75),
    inset 0 -18px 36px rgba(2,22,18,0.55),
    inset 0 0 0 1px rgba(150,255,235,0.35),
    0 18px 50px -14px rgba(0,0,0,0.6),
    0 0 56px 2px rgba(52,227,196,0.4);
  animation: orb-heart 2.3s ease-in-out infinite;
}
/* heartbeat ripples emanating outward — the measurement "signal" pinging into the dark */
.orb::after, .orb-glow {
  content: ""; position: absolute; inset: 0; border-radius: 50%; z-index: 0; pointer-events: none;
  border: 1.5px solid rgba(52,227,196,0.55); animation: orb-ping 2.3s cubic-bezier(.2,.6,.3,1) infinite;
}
.orb-glow { animation-delay: 0.16s; border-color: rgba(52,227,196,0.3); }
.orb-label {
  position: relative; z-index: 2; font-family: var(--sans); font-size: 1.85rem; font-weight: 600;
  color: #052a23; letter-spacing: 5px; padding-left: 5px;
  text-shadow: 0 1px 1px rgba(222,255,249,0.5);
}
.orb:hover { transform: scale(1.045); }
.orb:hover::before { box-shadow:
    inset 0 1px 0 rgba(222,255,249,0.85), inset 0 -18px 36px rgba(2,22,18,0.5),
    inset 0 0 0 1px rgba(150,255,235,0.55), 0 18px 54px -12px rgba(0,0,0,0.6),
    0 0 82px 8px rgba(52,227,196,0.6); }
.orb:active { transform: scale(0.99); }
.orb:disabled { cursor: progress; }
/* a heart's lub-dub: two quick beats then rest — glow dims→brightens + the core gently swells */
@keyframes orb-heart {
  0%, 40%, 100% { transform: scale(1);    filter: brightness(0.9); }
  9%            { transform: scale(1.028); filter: brightness(1.22); }   /* lub */
  18%           { transform: scale(1);    filter: brightness(0.9); }
  27%           { transform: scale(1.016); filter: brightness(1.08); }   /* dub */
}
@keyframes orb-ping {
  0%   { transform: scale(1);    opacity: 0; }
  9%   { opacity: 0.6; }
  60%  { opacity: 0; }
  100% { transform: scale(1.44); opacity: 0; }
}
/* running: drop the heartbeat for a steady, energized 'live' glow */
.orb.running::before { animation: none; filter: brightness(1.12);
  background: radial-gradient(circle at 50% 42%, #bdf7ff, var(--teal) 50%, #0a342c 100%);
  box-shadow: inset 0 0 0 1px rgba(180,255,245,0.6), 0 0 84px 10px rgba(52,227,196,0.66); }
.orb.running::after, .orb.running .orb-glow { animation-duration: 1.1s; }
@media (prefers-reduced-motion: reduce) {
  .orb::before { animation: none; }
  .orb::after, .orb-glow { animation: none; opacity: 0; }
}

.loopback-link { background: none; border: none; color: var(--ink-dim); font-family: var(--mono); font-size: 0.8rem; cursor: pointer; transition: 0.15s; }
.loopback-link:hover { color: var(--teal); }
.launch-note { margin: 0; font-family: var(--mono); font-size: 0.78rem; color: var(--ink-dim); text-align: center; min-height: 1em; }
.launch-note.err { color: var(--red); }
.launch-note.ok { color: var(--teal); }

/* ---- panels common ---- */
.panel-head { margin-bottom: 16px; }
.panel-head h2 { margin: 0; font-size: 1.02rem; font-weight: 700; }
.panel-sub { margin: 7px 0 0; font-size: 0.8rem; color: var(--ink-dim); }
.tag { font-size: 0.64rem; font-family: var(--mono); color: var(--teal); border: 1px solid rgba(52,227,196,0.4); border-radius: 5px; padding: 1px 6px; }

/* probe list */
.probe-list { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.probe-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); transition: border-color 0.15s, background 0.15s; }
.probe-item:hover { border-color: var(--line-bright); background: var(--panel); }
.probe-item.self { border-color: rgba(45,212,191,0.28); background: linear-gradient(180deg, rgba(45,212,191,0.05), var(--panel-2)); }
.probe-item .dot { width: 8px; height: 8px; border-radius: 50%; background: #4fd6ff; flex: none; box-shadow: 0 0 8px #4fd6ff; }
.probe-item.self .dot { background: var(--teal); box-shadow: 0 0 8px var(--teal); }
.probe-item .pname { font-weight: 600; }
.probe-item .paddr { font-family: var(--mono); font-size: 0.8rem; color: var(--ink-dim); margin-left: auto; }
.probe-item .del { background: none; border: none; color: var(--ink-faint); cursor: pointer; font-size: 1.15rem; line-height: 1; padding: 2px 4px; }
.probe-item .del:hover { color: var(--red); }
.probe-form { display: grid; grid-template-columns: 1fr 1.2fr 0.7fr; gap: 8px; }
.probe-form #probeCtrl { grid-column: 1 / 3; font-family: var(--mono); font-size: 0.8rem; }
.probe-form #probeToken { grid-column: 1 / 3; font-family: var(--mono); font-size: 0.8rem; }
.probe-form button { grid-column: 3 / 4; grid-row: 2 / 4; align-self: stretch; }
/* 探针的「添加」是本表单主操作 —— 做成实心青色按钮,一眼可点(不再是透明描边的空框) */
.btn.add-btn { background: var(--teal-soft); color: var(--teal); border-color: rgba(52,227,196,0.5); font-weight: 700; }
.btn.add-btn:hover { background: var(--teal); color: #04140f; border-color: var(--teal); box-shadow: 0 0 22px -8px var(--teal-deep); }
.probe-form .add-btn { font-size: 0.98rem; letter-spacing: 1.5px; }
@media (max-width: 520px) { .probe-form { grid-template-columns: 1fr 1fr; } .probe-form #probeCtrl, .probe-form #probeToken { grid-column: 1 / 3; } .probe-form button { grid-column: 1 / 3; grid-row: auto; } }
.probe-note { margin: 10px 2px 0; font-size: 0.8rem; color: var(--ink-dim); min-height: 1.1em; }
.probe-note.ok { color: var(--teal); }
.probe-note.err { color: var(--amber); }
.probe-item .tag.ctrl { color: #4fd6ff; border-color: rgba(79,214,255,0.4); }

/* buttons */
.btn { font-family: var(--sans); font-size: 0.86rem; font-weight: 600; border-radius: 9px; padding: 10px 16px; cursor: pointer; border: 1px solid transparent; transition: 0.15s; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-bright); }
.btn.ghost:hover { border-color: var(--teal); color: var(--teal); }
.btn.ghost.danger { color: var(--red); }
.btn.ghost.danger:hover { border-color: var(--red); color: var(--red); }

/* ---- results ---- */
.results-body { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 20px; }
.run-list, .run-detail { min-width: 0; }
@media (max-width: 760px) { .results-body { grid-template-columns: 1fr; } }
.run-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; max-height: 520px; overflow-y: auto; }
.run-row { padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); cursor: pointer; transition: 0.12s; }
.run-row:hover { border-color: var(--line-bright); }
.run-row.sel { border-color: var(--teal); background: var(--teal-soft); }
.run-row .rid { font-family: var(--mono); font-size: 0.76rem; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.run-row .rmeta { font-size: 0.7rem; color: var(--ink-dim); margin-top: 4px; display: flex; gap: 8px; align-items: center; }
.status-pill { font-family: var(--mono); font-size: 0.64rem; padding: 1px 7px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.status-pill.running { color: #4fd6ff; border: 1px solid rgba(79,214,255,0.4); }
.status-pill.exited { color: var(--teal); border: 1px solid rgba(52,227,196,0.4); }
.status-pill.failed { color: var(--red); border: 1px solid rgba(255,111,111,0.4); }
.status-pill.archived { color: var(--ink-dim); border: 1px solid var(--line-bright); }

.run-detail .empty { color: var(--ink-faint); font-size: 0.9rem; padding: 36px 0; text-align: center; }
.detail-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.detail-head .rid { font-family: var(--mono); font-size: 0.88rem; }

/* direction metric cards (发送端/接收端 style) */
.dir-card { border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); margin-bottom: 12px; overflow: hidden; }
.dir-card h4 { margin: 0; padding: 11px 16px; font-size: 0.8rem; font-family: var(--mono); color: var(--teal); letter-spacing: 0.5px; background: rgba(52,227,196,0.05); border-bottom: 1px solid var(--line); }
.dir-head { margin: 6px 0 8px; font-size: 0.84rem; font-family: var(--mono); color: #4fd6ff; letter-spacing: 0.5px; }
.kv { display: flex; align-items: center; justify-content: space-between; padding: 9px 16px; border-bottom: 1px solid rgba(26,36,48,0.6); }
.kv:last-child { border-bottom: none; }
.kv .k { font-size: 0.82rem; color: var(--ink-dim); }
.kv .v { font-family: var(--mono); font-size: 1.02rem; font-weight: 700; color: var(--teal); letter-spacing: -0.2px; }
.kv .v.muted { color: var(--ink); font-size: 0.9rem; font-weight: 500; letter-spacing: 0; }
.kv .v.warn { color: var(--amber); }
.kv .v .u { font-size: 0.66rem; color: var(--ink-faint); margin-left: 3px; font-weight: 400; letter-spacing: 0; }
.tl-row { padding: 8px 16px; border-bottom: 1px solid rgba(26,36,48,0.6); }
.tl-row:last-child { border-bottom: none; }
.tl-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 5px; }
.tl-t { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-faint); flex: none; }
.tl-v { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-dim); margin-left: auto; }
.tl-loss { font-family: var(--mono); font-size: 0.72rem; font-weight: 600; color: var(--teal); flex: none; }
.tl-loss.warn { color: var(--red); }
.tl-bar { position: relative; display: block; height: 8px; background: rgba(52,227,196,0.07); border-radius: 5px; overflow: hidden; }
.tl-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; }
.tl-bar i.p95 { background: rgba(255,192,106,0.35); }
.tl-bar i.p50 { background: var(--teal); }
.measure-desc { font-size: 0.76rem; color: var(--ink-dim); font-family: var(--mono); margin: 8px 0 14px; }
.field small, .qp small { display: block; color: var(--ink-faint); font-size: 0.66rem; margin-top: 3px; line-height: 1.3; }
.qp small b { color: var(--ink-dim); font-weight: 600; }
.field-group-label { font-size: 0.78rem; color: var(--ink-dim); font-family: var(--sans); margin: 13px 0 0; padding: 0 15px; line-height: 1.55; letter-spacing: 0.2px; }
.sample-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
.sample-count { font-family: var(--mono); font-size: 0.76rem; color: var(--ink-dim); margin-right: auto; }
.mini { background: var(--panel-2); border: 1px solid var(--line); color: var(--ink); border-radius: 8px; padding: 6px 10px; font-size: 0.78rem; font-family: var(--mono); }
.mini:focus { outline: none; border-color: var(--teal); }
/* Batch-action bar: appears above the list once one or more samples are checked. */
/* Batch controls sit at the TOP of the sample column (not a full-width row): 全选 + 已选 + 删除选中. */
.list-col { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.list-head { display: flex; align-items: center; gap: 8px; padding: 0 2px 7px; border-bottom: 1px solid var(--line); }
.list-head .select-all { display: inline-flex; align-items: center; gap: 5px; flex: none; white-space: nowrap;
  font-size: 0.76rem; color: var(--ink-dim); cursor: pointer; user-select: none; }
.list-head .select-all span { white-space: nowrap; }
.list-head .batch-count { white-space: nowrap; }
.list-head .select-all input { cursor: pointer; }
.list-head .batch-count { font-family: var(--mono); font-size: 0.74rem; color: var(--teal); }
.list-head .batch-spacer { flex: 1; }
.list-head .btn.mini { padding: 4px 9px; font-size: 0.74rem; }
/* Detail-panel actions pinned to the top (exports + delete) — reachable without scrolling. */
.detail-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.detail-actions .btn { padding: 8px 13px; font-size: 0.78rem; }
.detail-actions .spacer { flex: 1; min-width: 12px; }
.tag.env { background: rgba(52,227,196,0.12); color: var(--teal); border: 1px solid rgba(52,227,196,0.3); border-radius: 6px; padding: 1px 7px; font-size: 0.68rem; font-family: var(--mono); margin-left: 6px; display: inline-block; margin-top: 5px; }
.run-row .rhead { display: flex; align-items: center; gap: 8px; }
.run-row .cmp { accent-color: var(--teal); flex: none; cursor: pointer; width: 15px; height: 15px; margin: 0; }
.run-row .rhead .rid { flex: 1; min-width: 0; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-dim); }
.kind-badge { flex: none; font-family: var(--mono); font-size: 0.66rem; font-weight: 700; letter-spacing: 0.4px;
  padding: 2px 8px; border-radius: 5px; border: 1px solid currentColor; line-height: 1.3; }
.kind-badge.k-light { color: var(--teal); }
.kind-badge.k-load { color: #ffc06a; }
.kind-badge.k-tcp { color: #4fd6ff; }
.kind-badge.k-self { color: #b794f6; }
.kind-badge.k-other { color: var(--ink-dim); }
.events-line { font-size: 0.78rem; color: var(--ink-dim); font-family: var(--mono); padding: 4px 0 10px; }
.events-line .ev { color: var(--amber); margin-right: 12px; }

/* Degenerate-run banner: a light test that measured nothing (peer never replied). */
.warn-banner { font-size: 0.84rem; line-height: 1.55; color: var(--red);
  background: rgba(255,111,111,0.10); border: 1px solid rgba(255,111,111,0.45);
  border-radius: 8px; padding: 10px 12px; margin: 2px 0 14px; }

.artifact-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.artifact-bar .btn { padding: 8px 13px; font-size: 0.78rem; }
.dl-scenario { background: var(--teal); color: var(--bg); border-color: var(--teal); font-weight: 700; box-shadow: 0 0 20px -8px var(--teal); }
.dl-scenario:hover { background: #4ff0d6; color: var(--bg); }
/* Unified download button: every export in the actions row uses this one look (no loud/faint mix),
   so the set reads as a tidy group of "download X" buttons. */
.btn.dl { background: var(--teal-soft); color: var(--teal); border-color: rgba(52,227,196,0.42); font-weight: 600; }
.btn.dl:hover { background: rgba(52,227,196,0.22); border-color: var(--teal); }
/* raw / debug downloads: present but visually subordinate to the deliverables above */
.raw-downloads { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 9px; }
.raw-downloads .raw-label { font-family: var(--mono); font-size: 0.66rem; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--ink-faint); margin-right: 2px; }
.btn.raw { padding: 5px 10px; font-size: 0.72rem; color: var(--ink-dim); border-color: var(--line);
  font-weight: 500; background: transparent; }
.btn.raw:hover { color: var(--ink); border-color: var(--line-bright); }
.log-tail { margin-top: 14px; font-family: var(--mono); font-size: 0.72rem; color: var(--ink-dim); background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 12px; max-height: 150px; overflow: auto; white-space: pre-wrap; }
.spinner { display: inline-block; width: 13px; height: 13px; border: 2px solid var(--line-bright); border-top-color: #4fd6ff; border-radius: 50%; animation: spin 0.7s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 实时面板 (LV3) ---------- */
.detail-col { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.live-panel {
  background: linear-gradient(180deg, rgba(52,227,196,0.07), var(--panel-2));
  border: 1px solid rgba(52,227,196,0.32); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: 0 0 32px -10px var(--teal-deep);
}
.live-head { display: flex; align-items: center; gap: 9px; font-family: var(--mono);
  font-size: 0.8rem; letter-spacing: 0.6px; text-transform: uppercase; color: var(--teal); }
.live-head .live-sub { margin-left: auto; text-transform: none; letter-spacing: 0;
  color: var(--ink-dim); font-size: 0.74rem; font-family: var(--sans); }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--teal);
  box-shadow: 0 0 10px 1px var(--teal); animation: pulse 1.6s infinite; }
.live-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 14px 0; }
.live-tile { background: var(--bg); border: 1px solid var(--line); border-radius: 11px; padding: 12px 14px; }
.live-tile .lt-k { display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--ink-dim); font-family: var(--mono); }
.live-tile .lt-v { font-family: var(--mono); font-size: 1.7rem; font-weight: 700; color: var(--ink); }
.live-tile .lt-v i { font-style: normal; font-size: 0.8rem; color: var(--ink-faint); margin-left: 4px; }
.live-tile.teal .lt-v { color: var(--teal); }
.live-tile.amber .lt-v { color: var(--amber); }
.live-tile.warn .lt-v { color: var(--red); }
.live-canvas { width: 100%; height: auto; display: block; background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; margin-top: 4px; }
.live-chart-label { font-size: 0.7rem; font-family: var(--mono); color: var(--ink-dim);
  text-transform: uppercase; letter-spacing: 0.5px; margin: 10px 0 4px; }
.live-legend { display: flex; gap: 16px; margin-top: 9px; flex-wrap: wrap; }
.live-legend .lg { display: inline-flex; align-items: center; gap: 6px; font-size: 0.74rem; color: var(--ink-dim); }
.live-legend .lg::before { content: ""; width: 14px; height: 3px; border-radius: 2px;
  background: var(--lg, var(--teal)); }
.live-legend .lg.teal::before { background: var(--teal); }
.live-legend .lg.amber::before { background: var(--amber); }

/* ---------- 跨机收集卡片 (A4) ---------- */
.collect-card { border-color: rgba(255,192,106,0.35); }
.collect-state { font-family: var(--mono); font-size: 0.72rem; padding: 2px 8px; border-radius: 999px;
  margin-left: 8px; border: 1px solid var(--line-bright); }
.collect-state.warn { color: var(--amber); border-color: rgba(255,192,106,0.5); }
.collect-state.go { color: var(--teal); border-color: rgba(52,227,196,0.5); }
.collect-state.ok { color: var(--teal); }
.collect-state.muted { color: var(--ink-dim); }
.collect-bar { height: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px;
  overflow: hidden; margin: 10px 0 6px; }
.collect-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--teal-deep), var(--teal));
  transition: width 0.4s ease; }

/* ---------- 本机连接信息卡 (UX4) ---------- */
.identity-card { margin: 0; padding: 16px 20px;
  background: linear-gradient(135deg, rgba(52,227,196,0.10), var(--panel-2));
  border: 1px solid rgba(52,227,196,0.34); border-radius: var(--radius);
  box-shadow: 0 0 30px -12px var(--teal-deep); }
.id-head { display: flex; align-items: center; gap: 9px; font-family: var(--mono);
  font-size: 0.82rem; letter-spacing: 0.5px; color: var(--teal); }
.id-head .id-sub { margin-left: auto; color: var(--ink-dim); font-family: var(--sans);
  font-size: 0.76rem; letter-spacing: 0; }
.id-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--teal);
  box-shadow: 0 0 10px 1px var(--teal); }
.id-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px 28px; margin-top: 14px; }
.id-field { display: flex; align-items: center; gap: 10px; min-width: 0; }
.id-field .id-k { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--ink-dim); font-family: var(--mono); white-space: nowrap; min-width: 96px; }
.id-field .id-v { font-size: 1.05rem; color: var(--ink); font-weight: 600; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.id-field .id-v.mono { font-family: var(--mono); letter-spacing: 1px; }
.id-copy { background: var(--teal-soft); color: var(--teal); border: 1px solid rgba(52,227,196,0.4);
  border-radius: 7px; padding: 3px 10px; font-size: 0.74rem; cursor: pointer; white-space: nowrap; }
.id-copy:hover { background: var(--teal); color: var(--bg); }
.id-warn { margin-top: 12px; padding: 9px 12px; border-radius: 8px; font-size: 0.8rem;
  color: var(--amber); background: rgba(255,192,106,0.10); border: 1px solid rgba(255,192,106,0.4); }
.id-warn code { font-family: var(--mono); background: rgba(0,0,0,0.3); padding: 1px 6px; border-radius: 4px; }
/* decluttered 本机连接信息: share group -> quiet tech line -> divider -> toggle+hint -> benchmark */
.id-share { margin-top: 14px; }
.id-tech { display: flex; flex-wrap: wrap; gap: 6px 32px; margin-top: 14px; font-size: 0.88rem; color: var(--ink-dim); }
.id-tech em { font-style: normal; text-transform: uppercase; letter-spacing: 0.6px; font-size: 0.7rem; color: var(--ink-faint); margin-right: 9px; }
.id-divider { height: 1px; background: var(--line); margin: 15px 0; }
.id-expose-top { display: flex; align-items: center; gap: 11px; }
.id-v.sm { font-size: 0.92rem; }
.id-expose-hint { margin: 8px 0 0; font-size: 0.8rem; line-height: 1.55; color: var(--ink-dim); max-width: 760px; }
.id-expose-hint.ok { color: var(--teal); }
.id-bench { margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--line); }
.id-bench .id-field .id-v { font-size: 0.95rem; }
.id-note { margin-top: 12px; padding: 9px 12px; border-radius: 8px; font-size: 0.8rem;
  color: var(--teal); background: var(--teal-soft); border: 1px solid rgba(52,227,196,0.4); }
.id-expose { grid-column: 1 / -1; }
@media (max-width: 760px) { .id-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  /* the inline hint duplicates the panel intro above — drop it so the title sits on one line */
  .id-head .id-sub { display: none; }
  /* label on its own line; value + copy share the next, value free to wrap so nothing truncates */
  .id-field { flex-wrap: wrap; gap: 3px 10px; }
  .id-field .id-k { flex: 1 0 100%; min-width: 0; }
  .id-field .id-v { overflow: visible; white-space: normal; word-break: break-all; font-size: 0.98rem; }
}

/* ---------- 快速上手三步 (home) ---------- */
.steps-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.steps-tag { flex: none; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.5px; color: var(--teal);
  background: var(--teal-soft); border: 1px solid rgba(52,227,196,0.4); border-radius: 999px; padding: 3px 11px; }
.steps-note { color: var(--ink-dim); font-size: 0.78rem; }
.steps { display: flex; align-items: stretch; gap: 12px; margin-top: 10px; }
.step { flex: 1; display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; }
/* "建议第N步" 软标签(不再是带强烈顺序感的数字圆圈)*/
.step-n { flex: none; min-width: 40px; padding: 4px 8px; border-radius: 8px; text-align: center;
  font-family: var(--sans); font-size: 0.62rem; font-weight: 700; line-height: 1.18; color: var(--teal);
  background: var(--teal-soft); border: 1px solid rgba(52,227,196,0.4); }
.step-tx strong { display: block; font-size: 0.9rem; font-weight: 600; }
.step-tx small { display: block; color: var(--ink-dim); font-size: 0.74rem; margin-top: 2px; line-height: 1.35; }
.step-arrow { align-self: center; color: var(--ink-faint); font-family: var(--mono); font-size: 1rem; flex: none; }
@media (max-width: 760px) { .steps { flex-direction: column; } .step-arrow { display: none; } }

/* ---------- 时间线降采样 + 最差窗口 (UX5) ---------- */
.tl-meta { font-size: 0.74rem; color: var(--ink-dim); font-family: var(--mono); margin: 2px 0 8px; }
.worst-list { display: flex; flex-direction: column; gap: 4px; }
.worst-row { display: grid; grid-template-columns: 64px 96px 1fr; gap: 10px; align-items: center;
  font-size: 0.8rem; padding: 5px 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 7px; }
.worst-row .wt { font-family: var(--mono); color: var(--ink-dim); }
.worst-row .wl { font-weight: 600; }
.worst-row .wl.warn { color: var(--red); }
.worst-row .wd { color: var(--ink-dim); font-family: var(--mono); }

/* 远程访问:手动令牌输入 (V3) */
.id-token-input { flex: 1; min-width: 220px; font-family: var(--mono); font-size: 0.82rem;
  background: var(--bg); border: 1px solid var(--line-bright); border-radius: 8px;
  padding: 6px 10px; color: var(--ink); }
.id-token-input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(52,227,196,0.15); }

/* ---------- 发起测试页内的实时进度块 ---------- */
.test-live { width: 100%; min-width: 0; padding: 18px 20px;
  background: linear-gradient(180deg, rgba(52,227,196,0.07), var(--panel-2));
  border: 1px solid rgba(52,227,196,0.34); border-radius: var(--radius);
  box-shadow: 0 0 32px -12px var(--teal-deep); }
.test-live .live-canvas { height: auto; }

/* 测试中计时/倒计时 chip */
.live-timer { margin-left: 12px; font-family: var(--mono); font-size: 0.8rem; font-weight: 700;
  color: var(--teal); background: var(--teal-soft); border: 1px solid rgba(52,227,196,0.4);
  border-radius: 999px; padding: 3px 12px; letter-spacing: 0.3px; }
.live-canvas { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
