/* Ping不通 — shared styles (tool page and recruiting page). Design 3:
 * the layout of design 1 in a warm editorial palette — paper white, forest
 * green for things to press, coral for the one loud word, serif display
 * type for headings and headline numbers, mono for labels and data.
 *
 * Colour roles:
 *   --ink         brand green: primary button, selected tab, the mark
 *   --coral       emphasis in the pitch only, never on data
 *   --accent      "in flight": pending probes, progress, links, focus
 *   --s-*         status fills for marks (dots, bars, map), same in both themes
 *   --ok/mid/bad  the same states as text, dark enough to read
 */

:root {
  --bg: #faf8f3;
  --panel: #ffffff;
  --ink: #1f5f3f;
  --ink-deep: #164829;
  --ink-soft: #e8f0e8;
  --coral: #d9663f;
  --text: #1a1814;
  --text-2: #4a4636;
  --muted: #6f6853;
  --faint: #a59d88;
  --line: #ebe4d4;
  --line-strong: #d8cfb8;
  --soft: #f3efe4;
  --accent: #1e5fb0;
  --accent-text: #ffffff;
  --btn: #1f5f3f;
  --btn-hover: #164829;
  --btn-text: #ffffff;
  --btn-shadow: 0 4px 16px rgba(31, 95, 63, 0.25);
  --ok: #12733a;
  --mid: #96590a;
  --bad: #c0271f;
  --s-good: #0ca30c;
  --s-warning: #fab219;
  --s-serious: #ec835a;
  --s-critical: #d03b3b;
  --map-empty: #ebe6d8;
  --p-dns: #86b6ef;
  --p-connect: #1baf7a;
  --p-tls: #2a78d6;
  --p-wait: #e87ba4;
  --p-download: #6250d6;
  --k-telecom: #47801f;
  --k-unicom: #bb590a;
  --k-mobile: #0f7a94;
  --k-cloud: #6a55b5;
  --k-gat: #9a4a6b;
  --k-overseas: #56616b;
  --k-other: #79715f;
  --shadow-xs: 0 1px 2px rgba(60, 50, 30, 0.04);
  --shadow: 0 6px 24px rgba(60, 50, 30, 0.07), 0 2px 6px rgba(60, 50, 30, 0.04);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --serif: "PingFang SC", "Songti SC", "Source Han Serif SC", "Noto Serif SC", "SimSun", "Microsoft YaHei", serif;
  --mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, "PingFang SC", "Microsoft YaHei", monospace;
  color-scheme: light;
}

/* Dark: the system's choice unless the visitor picked light, or their own pick. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14120e;
    --panel: #1d1a15;
    --ink: #2f7d55;
    --ink-deep: #a6d8bb;
    --ink-soft: #1f2e25;
    --coral: #e0714a;
    --text: #f1ece1;
    --text-2: #cdc6b6;
    --muted: #a39c89;
    --faint: #6f6857;
    --line: #302b22;
    --line-strong: #494233;
    --soft: #26221b;
    --accent: #86b4ee;
    --accent-text: #14120e;
    --btn: #2f7d55;
    --btn-hover: #38916a;
    --btn-text: #ffffff;
    --btn-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    --ok: #5cc98b;
    --mid: #e3a445;
    --bad: #f2766f;
    --map-empty: #2a261e;
    --p-dns: #86b6ef;
    --p-connect: #199e70;
    --p-tls: #3987e5;
    --p-wait: #d55181;
    --p-download: #9085e9;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.3), 0 2px 6px rgba(0, 0, 0, 0.2);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14120e;
  --panel: #1d1a15;
  --ink: #2f7d55;
  --ink-deep: #a6d8bb;
  --ink-soft: #1f2e25;
  --coral: #e0714a;
  --text: #f1ece1;
  --text-2: #cdc6b6;
  --muted: #a39c89;
  --faint: #6f6857;
  --line: #302b22;
  --line-strong: #494233;
  --soft: #26221b;
  --accent: #86b4ee;
  --accent-text: #14120e;
  --btn: #2f7d55;
  --btn-hover: #38916a;
  --btn-text: #ffffff;
  --btn-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  --ok: #5cc98b;
  --mid: #e3a445;
  --bad: #f2766f;
  --map-empty: #2a261e;
  --p-dns: #86b6ef;
  --p-connect: #199e70;
  --p-tls: #3987e5;
  --p-wait: #d55181;
  --p-download: #9085e9;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.3), 0 2px 6px rgba(0, 0, 0, 0.2);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 var(--sans);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

header, main, footer {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
}

svg.defs { position: absolute; }

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- site header, shared by every page ---- */

header.site {
  display: flex;
  align-items: center;
  gap: 8px 22px;
  flex-wrap: wrap;
  padding-top: 18px;
  padding-bottom: 10px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--text);
  text-decoration: none;
}
.mark { width: 26px; height: 26px; flex: none; }
.mark rect { fill: var(--ink); }
.mark path { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
header.site nav { display: flex; gap: 2px; margin-right: auto; }
header.site nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
}
header.site nav a:hover { color: var(--text); background: var(--soft); }
header.site nav a[aria-current="page"] { color: #fff; font-weight: 600; background: var(--ink); }
.site-tools { display: flex; align-items: center; gap: 10px; }

.live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.live::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--faint);
}
.live.up::before { background: var(--s-good); animation: beat 2.4s ease-out infinite; }
@keyframes beat {
  0% { box-shadow: 0 0 0 0 rgba(12, 163, 12, 0.5); }
  70%, 100% { box-shadow: 0 0 0 7px rgba(12, 163, 12, 0); }
}

.icon-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  display: inline-grid;
  place-items: center;
}
.icon-btn:hover { border-color: var(--line-strong); }
/* A half-filled disc: the usual sign for light / dark. */
.icon-btn::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--text);
  background: linear-gradient(90deg, var(--text) 50%, transparent 50%);
}

/* ---- hero and the command bar ---- */

#hero { padding: 44px 0 6px; }
#hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(32px, 5.6vw, 56px);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -1px;
}
.hit {
  display: inline-block;
  margin: 0 0.08em;
  padding: 0 0.16em;
  background: var(--coral);
  color: #fff;
  border-radius: 0.14em;
  transform: rotate(-2.5deg);
}
.tagline { margin: 16px 0 30px; color: var(--text-2); font-size: 16px; line-height: 1.8; max-width: 38em; }

/* After a test is on screen the page is about its result: fold the pitch away. */
body.has-task #hero { padding-top: 14px; }
body.has-task #hero h1,
body.has-task .tagline,
body.has-task #recent,
body.has-task .under,
body.has-task #status:empty { display: none; }

.cmd { margin: 0; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 18px;
  border-radius: 12px 12px 0 0;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.tabs button:hover { color: var(--text); background: var(--soft); }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--btn-text); }

.bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 62px;
  padding: 6px 6px 6px 16px;
  background: var(--panel);
  border: 2px solid var(--ink);
  border-radius: 0 18px 18px 18px;
  box-shadow: var(--shadow);
}
.bar:focus-within { box-shadow: var(--shadow), 0 0 0 4px color-mix(in srgb, var(--ink) 20%, transparent); }
.prompt { width: 24px; height: 24px; flex: none; }
.prompt path { fill: none; stroke: var(--faint); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.bar:focus-within .prompt path { stroke: var(--ink); }

#target {
  flex: 1 1 200px;
  min-width: 0;
  height: 46px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  font: 500 18px/1 var(--mono);
  outline: none;
}
#target::placeholder { color: var(--faint); font-family: var(--sans); font-weight: 400; font-size: 16px; }

kbd {
  font: 12px/1 var(--mono);
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 3px 6px;
}
.bar .slash { flex: none; }
.bar:focus-within .slash, #target:not(:placeholder-shown) ~ .slash { display: none; }

#rtype {
  height: 46px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--panel);
  font-family: var(--mono);
}

#go {
  flex: none;
  height: 46px;
  padding: 0 24px;
  border: 0;
  border-radius: 12px;
  background: var(--btn);
  color: var(--btn-text);
  font-weight: 600;
  letter-spacing: 0.3px;
  box-shadow: var(--btn-shadow);
  transition: transform 0.08s, background-color 0.2s;
}
#go:hover { background: var(--btn-hover); }
#go:active { transform: translateY(1px); }
#go:disabled { opacity: 0.5; cursor: progress; }

.under { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 12px 2px 0; }
#hint { margin: 0; color: var(--muted); font-size: 14px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 13px;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--btn-text); }
.chip small { color: var(--muted); font-size: 12px; margin-right: 6px; }
.chip[aria-pressed="true"] small { color: inherit; opacity: 0.7; }
.chip .n { margin-left: 6px; font-family: var(--mono); font-size: 12px; opacity: 0.65; }
.chip.mono { font-family: var(--mono); }

#captcha { margin: 14px 2px 0; }

#status { min-height: 1.55em; margin: 12px 2px 0; color: var(--muted); overflow-wrap: anywhere; }
#status.error { color: var(--bad); font-weight: 600; }
#status.error::before { content: "✕  "; }

.recent { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 6px 2px 0; }
.recent .label, .eyebrow { font-size: 12px; letter-spacing: 0.12em; color: var(--muted); }
.link { border: 0; background: none; padding: 0; color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--text); }

/* ---- panels ---- */

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-xs);
}
figure.panel { margin: 14px 0; padding: 16px 20px 14px; }
figcaption strong, #groups caption { font-family: var(--serif); font-size: 16px; font-weight: 700; letter-spacing: 0.2px; }

/* ---- verdict: the answer, stamped ---- */

.verdict {
  position: relative;
  overflow: hidden; /* the stamp lands from a larger size; keep that inside the panel */
  overflow: clip;
  margin-top: 14px;
  padding: 22px 24px 18px;
  display: grid;
  gap: 16px;
}
.progress { position: absolute; inset: 0 0 auto 0; height: 3px; border-radius: 18px 18px 0 0; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.3s, opacity 0.6s; }
.verdict.done .progress i { opacity: 0; }

.vmain { padding-right: 170px; min-height: 76px; }
/* A small mono badge, like a label on a specimen. */
.eyebrow {
  display: inline-block;
  margin: 0;
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--ink-soft);
  color: var(--ink-deep);
  font: 700 10.5px/1.5 var(--mono);
  letter-spacing: 1.8px;
  text-transform: uppercase;
}
#v-target { margin: 10px 0 6px; font: 600 clamp(20px, 3.2vw, 30px)/1.25 var(--mono); overflow-wrap: anywhere; }
#v-line { margin: 0; color: var(--muted); }
#v-line.bad { color: var(--bad); }

.stamp-slot { position: absolute; top: 20px; right: 26px; }
.seal {
  display: inline-block;
  font-family: var(--serif);
  padding: 3px 14px 5px;
  border: 3px solid currentColor;
  border-radius: 8px;
  outline: 1.5px solid currentColor;
  outline-offset: 3px;
  font-size: 38px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0.14em;
  text-indent: 0.14em;
  white-space: nowrap;
  transform: rotate(-8deg);
  filter: url(#ink);
  opacity: 0.92;
  user-select: none;
  animation: thump 0.38s cubic-bezier(0.2, 1.5, 0.4, 1) both;
}
.seal.long { font-size: 26px; }
.seal.good { color: var(--ok); }
.seal.warn { color: var(--mid); }
.seal.bad { color: var(--bad); }
@keyframes thump {
  from { transform: rotate(-8deg) scale(2.6); opacity: 0; }
  to { transform: rotate(-8deg) scale(1); opacity: 0.92; }
}

.ring { position: relative; width: 76px; height: 76px; display: grid; place-items: center; }
.ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 5; }
.ring .track { stroke: var(--soft); }
.ring .arc { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 0.3s; }
.ring span { font: 600 13px/1 var(--mono); }

.tiles {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}
.tiles > div { padding: 14px 16px 0; border-left: 1px solid var(--line); min-width: 0; }
.tiles > div:first-child { padding-left: 0; border-left: 0; }
.tiles dt { font-size: 12px; font-weight: 500; letter-spacing: 0.3px; color: var(--muted); }
.tiles dd { margin: 4px 0 0; font: 800 32px/1.15 var(--serif); letter-spacing: -1px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tiles dd .unit { font: 500 13px/1 var(--sans); letter-spacing: 0; color: var(--muted); margin-left: 4px; }
.tiles dd small { display: block; margin-top: 4px; letter-spacing: 0; font: 400 12px/1.5 var(--sans); color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.tiles dd.empty { color: var(--faint); }

.vactions { display: flex; flex-wrap: wrap; gap: 8px; }
.vactions button {
  border: 1px solid var(--line-strong);
  background: var(--panel);
  padding: 7px 18px;
  border-radius: 999px;
  font-size: 13.5px;
}
.vactions button:hover { border-color: var(--ink); }

/* ---- the strip: every node on one latency axis, with a wall at the end ---- */

#strip-panel figcaption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 10px; }
#strip-sub { color: var(--muted); font-size: 13px; }
.legend { list-style: none; margin: 0 0 0 auto; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); }
.legend li { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.legend i { width: 10px; height: 10px; border-radius: 50%; }

#strip { position: relative; --label: 172px; }
.srow, .saxis { display: grid; grid-template-columns: var(--label) minmax(0, 1fr); }
.srow { border-top: 1px solid var(--line); }
.slabel { padding: 10px 10px 10px 0; align-self: center; min-width: 0; }
.slabel button {
  display: block;
  border: 0;
  background: none;
  padding: 0;
  font-weight: 700;
  text-align: left;
}
.slabel button:hover { text-decoration: underline; text-underline-offset: 3px; }
.slabel span { display: block; font: 11.5px/1.6 var(--mono); color: var(--muted); }

.strack { position: relative; height: 46px; transition: height 0.3s; }
.strack > i { position: absolute; top: 0; bottom: 0; pointer-events: none; }
.sline { width: 0; border-left: 1px dashed var(--line-strong); left: var(--x); }
.swall { width: 3px; background: var(--text); left: var(--x-wall); border-radius: 2px; }
.shatch {
  left: calc(var(--x-wall) + 3px);
  right: 0;
  background: repeating-linear-gradient(-45deg, transparent 0 5px, var(--soft) 5px 7px);
}
.smed {
  top: auto !important;
  bottom: 0;
  left: var(--x);
  width: 0;
  height: 0;
  border: 5px solid transparent;
  border-bottom-color: var(--text);
  margin-left: -5px;
  transition: left 0.4s;
}

.dot {
  position: absolute;
  left: 0;
  top: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--faint);
  box-shadow: 0 0 0 2px var(--panel);
  transition: transform 0.65s cubic-bezier(0.2, 0.9, 0.25, 1), background-color 0.3s, opacity 0.2s;
}
.dot::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; }
.dot.pending { background: var(--accent); animation: wait 1.3s ease-in-out infinite; }
.dot.good { background: var(--s-good); }
.dot.warning { background: var(--s-warning); }
.dot.serious { background: var(--s-serious); }
.dot.fail { background: var(--s-critical); }
.dot.dim { opacity: 0.14; }
.dot.hl, .dot:hover, .dot:focus-visible { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--text); z-index: 2; outline: none; }
@keyframes wait { 50% { opacity: 0.35; } }

.saxis { border-top: 1px solid var(--line-strong); }
.sticks { position: relative; height: 26px; font: 11px/1 var(--mono); color: var(--muted); }
.sticks span { position: absolute; top: 8px; transform: translateX(-50%); white-space: nowrap; }
.sticks span::before { content: ""; position: absolute; left: 50%; top: -8px; height: 5px; border-left: 1px solid var(--line-strong); }
.sticks .zone { font-family: var(--sans); font-size: 12px; color: var(--text); font-weight: 700; }
.sticks .zone::before { display: none; }
.sticks .zone.start { transform: none; color: var(--muted); font-weight: 400; }

.tip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  background: var(--text);
  color: var(--bg);
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 12px;
  line-height: 1.5;
  white-space: nowrap;
  transform: translate(-50%, calc(-100% - 12px));
}
.tip b { display: block; font-size: 13px; }
.tip .val { font-family: var(--mono); }

/* ---- overview: map and group table ---- */

#overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
  gap: 14px;
  align-items: start;
  margin: 0 0 14px;
}
#overview figure.panel { margin: 0; }
@media (min-width: 960px) {
  #overview { grid-template-columns: minmax(0, 9fr) minmax(0, 11fr); }
  #overview:has(#map-panel[hidden]) { grid-template-columns: minmax(0, 1fr); }
}
#map { width: 100%; height: 400px; }
#map-note { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
#map-note a, footer a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
#map-note a:hover, footer a:hover { color: var(--text); }

.groups-panel { padding: 6px 0 4px; overflow: hidden; }
#groups caption { text-align: left; padding: 10px 20px 8px; }
#groups caption small { font-weight: 400; font-size: 12px; color: var(--muted); margin-left: 8px; }
#groups th:first-child, #groups td:first-child { padding-left: 20px; }
#groups th[scope="row"] { color: var(--text); font-size: inherit; }
#groups th[scope="row"] button { border: 0; background: none; padding: 0; font-weight: inherit; }
#groups tbody tr { cursor: pointer; }
#groups tbody tr:hover > * { background: var(--soft); }
#groups tr.on > * { background: var(--soft); box-shadow: inset 0 0 0 0 transparent; }
#groups tr.on > th { box-shadow: inset 3px 0 0 var(--ink); }
#groups tr.all th, #groups tr.all td { font-weight: 700; }
#groups tr.section th, #groups tr.section td { border-top: 1px solid var(--line-strong); }
#groups td { font-family: var(--mono); font-size: 13px; }

/* ---- result table ---- */

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 18px 0 10px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; accent-color: var(--ink); }
.count { margin-left: auto; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
th, td {
  padding: 9px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
th { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.3px; }
tbody tr:last-child > * { border-bottom: 0; }

#results > thead > tr > th:first-child, #results > tbody > tr > td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--panel);
  padding-left: 20px;
  font-weight: 600;
  max-width: 46vw;
  overflow: hidden;
  text-overflow: ellipsis;
}
#results thead th { background: var(--panel); }

.sort {
  border: 0;
  background: none;
  padding: 0;
  color: inherit;
  font-weight: inherit;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.sort::after { content: "↕"; font-size: 11px; opacity: 0.4; }
.sort:hover { color: var(--text); }
th[aria-sort] .sort { color: var(--text); }
th[aria-sort="ascending"] .sort::after { content: "↑"; opacity: 1; }
th[aria-sort="descending"] .sort::after { content: "↓"; opacity: 1; }

#results tbody tr.row:hover > td, #results tbody tr.hl > td { background: var(--soft); }
#results tbody tr.flash > td { animation: flash 1.4s ease-out; }
@keyframes flash { from { background: color-mix(in srgb, var(--accent) 30%, var(--panel)); } }

td.v { font-family: var(--mono); font-size: 13px; }
td.pending { color: var(--muted); }
td.pending::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: wait 1.3s ease-in-out infinite;
}
td.ok { color: var(--ok); font-weight: 600; }
td.ok::before { content: "✓ "; }
td.fail { color: var(--bad); font-weight: 600; white-space: normal; min-width: 180px; overflow-wrap: anywhere; }
td.fail::before { content: "✕ "; }
td.mid { color: var(--mid); }
td.slow { color: var(--bad); }

/* The headline number of each row, with a bar so a column can be scanned. */
td.metric { min-width: 116px; font-weight: 600; }
td.metric i { display: block; height: 3px; margin-top: 4px; border-radius: 2px; min-width: 3px; background: var(--faint); transition: width 0.4s; }
td.metric i.good { background: var(--s-good); }
td.metric i.warning { background: var(--s-warning); }
td.metric i.serious { background: var(--s-serious); }

/* The kind of a node (line, or where abroad): white on a solid colour, the
   same in both themes, all one width so the names after them line up. */
.kind {
  display: inline-block; flex: none; box-sizing: border-box; min-width: 48px; padding: 0 5px;
  border-radius: 5px; background: var(--k-other); color: #fff;
  font: 600 12px/21px var(--sans); letter-spacing: 0; text-align: center; white-space: nowrap;
}
.k-telecom { background: var(--k-telecom); }
.k-unicom { background: var(--k-unicom); }
.k-mobile { background: var(--k-mobile); }
.k-cloud { background: var(--k-cloud); }
.k-gat { background: var(--k-gat); }
.k-overseas { background: var(--k-overseas); }
.ninline .kind { min-width: 0; font-size: 11px; line-height: 17px; padding: 0 4px; border-radius: 4px; margin-right: 2px; }
.tip .kind { margin-right: 4px; }

/* The node: its tag, then the place, with the network under it when known. */
.nbox { display: flex; align-items: center; gap: 9px; min-width: 0; }
.nbox > div { min-width: 0; }
td.node b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
td.node small { display: block; margin-top: 1px; color: var(--muted); font-size: 12px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; }

/* Website tests: where the time went, as one bar per node (its own total is
   the full width) with the numbers under it, in the legend's order. */
.phases { min-width: 168px; }
.pbar { display: flex; gap: 2px; height: 8px; }
.pbar i { flex: 1 1 0; min-width: 3px; border-radius: 2px; }
.phases small { display: block; margin-top: 4px; color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.p-dns { background: var(--p-dns); }
.p-connect { background: var(--p-connect); }
.p-tls { background: var(--p-tls); }
.p-wait { background: var(--p-wait); }
.p-download { background: var(--p-download); }
.plegend { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; color: var(--muted); font-size: 12px; }
.plegend i { display: inline-block; width: 10px; height: 10px; margin-left: 6px; border-radius: 2px; }

/* Group table: the fastest / slowest node, then its number, apart. */
#groups td.who .ninline { font-family: var(--sans); font-size: 13px; }
#groups td.who b { margin-left: 8px; font-weight: 500; }

tr.detail > td { background: var(--bg); white-space: normal; padding: 8px 20px 12px; }
tr.detail summary { cursor: pointer; color: var(--muted); font-size: 13px; }
table.hops { margin-top: 8px; width: auto; min-width: 60%; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
table.hops th, table.hops td { padding: 5px 12px; font-family: var(--mono); font-size: 13px; }
table.hops td.pending::before { display: none; } /* a hop that never answered is not waiting */
table.hops td.geo { font: 12px var(--sans); color: var(--muted); max-width: 16em; overflow: hidden; text-overflow: ellipsis; }

/* DNS answers: each record, and where it is after it. */
.recs { display: flex; flex-wrap: wrap; gap: 2px 14px; max-width: 46em; white-space: normal; }
.rec { white-space: nowrap; }
.rec small { margin-left: 6px; color: var(--muted); font: 11.5px var(--sans); }

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 20px;
  padding: 36px 20px 44px;
  color: var(--muted);
  font-size: 13px;
}

/* ---- small screens ---- */

@media (max-width: 720px) {
  header, main, footer { padding-left: 16px; padding-right: 16px; }
  #hero { padding-top: 26px; }
  .live { display: none; } /* the strip below says how many nodes there are */
  header.site { flex-wrap: nowrap; gap: 8px; }
  .brand { font-size: 17px; gap: 7px; }
  .mark { width: 23px; height: 23px; }
  header.site nav { min-width: 0; }
  header.site nav a { padding: 6px 8px; white-space: nowrap; }
  .tagline { font-size: 15px; margin-bottom: 20px; }
  .bar { min-height: 0; padding: 5px 5px 5px 12px; flex-wrap: wrap; border-radius: 0 12px 12px 12px; }
  .prompt, .bar .slash { display: none; }
  #target { font-size: 16px; flex-basis: 150px; }
  #go { padding: 0 16px; }
  .verdict { padding: 18px 16px 14px; }
  .vmain { padding-right: 0; min-height: 0; }
  .stamp-slot { position: static; justify-self: start; min-height: 64px; display: grid; align-items: center; padding-left: 6px; }
  .seal { font-size: 30px; }
  .seal.long { font-size: 22px; }
  .ring { width: 60px; height: 60px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles > div { padding: 12px 12px 10px; }
  .tiles > div:nth-child(odd) { padding-left: 0; border-left: 0; }
  .tiles > div:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .tiles dd { font-size: 22px; }
  figure.panel { padding: 14px 14px 10px; }
  .legend { margin-left: 0; }
  #strip { --label: 0px; }
  .srow, .saxis { grid-template-columns: minmax(0, 1fr); }
  .slabel { padding: 8px 0 0; display: flex; align-items: baseline; gap: 10px; }
  .saxis > :first-child { display: none; }
  #map { height: 300px; }
  #results > thead > tr > th:first-child, #results > tbody > tr > td:first-child { padding-left: 14px; }

  /* Each node becomes a card: name and headline number on top, the rest as
     labelled values two to a line. No sideways scrolling on a phone. */
  #results thead { display: none; }
  #results, #results tbody { display: block; }
  #results tr.row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 4px 14px;
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
  }
  #results tbody tr.row:last-of-type { border-bottom: 0; }
  #results tr.row > td,
  #results > thead > tr > th:first-child, #results > tbody > tr > td:first-child {
    display: block; position: static; max-width: none; padding: 0; border: 0;
    background: none; white-space: normal; min-width: 0;
  }
  #results td.node { grid-column: 1; grid-row: 1; }
  #results td.metric { grid-column: 2; grid-row: 1; justify-self: end; text-align: right; min-width: 84px; font-size: 15px; }
  #results tr.row > td:nth-child(2) { grid-column: 1 / -1; font-size: 13px; }
  #results tr.row > td.ok { display: none; } /* the number already says it worked */
  #results td.v:not(.metric) { font-size: 12.5px; overflow-wrap: anywhere; }
  #results td.v:not(.metric)::before { content: attr(data-label) " "; color: var(--muted); font-family: var(--sans); }
  #results td.v:not(.metric):empty { display: none; }
  #results td.wide { grid-column: 1 / -1; padding: 2px 0; }
  #results td.wide::before { display: none; } /* the legend above the cards names it */
  #results td.metric i { margin-left: auto; }
  #results tr.detail, #results tr.detail > td { display: block; }
  #results > tbody > tr.detail > td { padding: 0 14px 12px; background: none; border-bottom: 1px solid var(--line); }
  #results tr.row:has(+ tr.detail) { border-bottom: 0; padding-bottom: 6px; }
  #results tr.detail details { overflow-x: auto; }
  table.hops { width: 100%; }
  table.hops th, table.hops td { padding: 5px 8px; font-size: 12px; }

  /* An option's explanation shows while it is being filled in. */
  .pin small { display: none; }
  .pin:focus-within small { display: block; }

  /* Header: the name stays on one line; five tool tabs share the width. */
  .brand { flex: none; }
  .brand span { white-space: nowrap; }
  header.site nav { overflow-x: auto; scrollbar-width: none; }
  header.site nav::-webkit-scrollbar { display: none; }
  .tabs { display: grid; grid-template-columns: repeat(5, minmax(0, auto)); }
  .tabs button { padding: 8px 10px; font-size: 13.5px; }
}
@media (max-width: 400px) {
  header.site nav a { padding: 6px 7px; font-size: 13px; }
  .tabs button { padding: 8px 6px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
/* ---- connect IP (website tests) ---- */

.pin { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 10px 2px 0; font-size: 14px; }
.pin label { color: var(--muted); }
.pin input {
  flex: 0 1 240px; min-width: 0; height: 34px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text); font: 14px var(--mono);
}
.pin input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 18%, transparent); }
.pin small { flex: 1 1 260px; color: var(--muted); font-size: 12px; }
.pin select {
  flex: 0 1 auto; min-width: 0; height: 34px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text); font: 14px var(--sans);
}
.pin select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 18%, transparent); }
.pin input.bad { border-color: var(--bad); }

/* ---- response IPs ---- */

.ips-panel { margin-top: 14px; padding: 12px 20px 14px; }
.ips-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin-bottom: 9px; }
.ips-head strong { font-size: 14px; }
.ips-head #ips-sub { color: var(--muted); font-size: 12px; }
.ips-head .link { margin-left: auto; font-size: 12px; }
/* One chip per address: the address, where it is (when known), how many nodes. */
.ips-list { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ipchip {
  display: inline-flex; align-items: baseline; gap: 6px; max-width: 100%;
  padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel);
  font-size: 12.5px; color: var(--text); line-height: 1.6;
}
.ipchip:hover { border-color: var(--line-strong); background: var(--soft); }
.ipchip[aria-pressed="true"] { border-color: var(--ink); background: var(--ink-soft); box-shadow: inset 0 0 0 1px var(--ink); }
.ipchip .mono { font: 12.5px var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ipchip small { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 14em; }
.ipchip b { font: 600 11.5px var(--mono); color: var(--text-2); }
.ipmore { font-size: 12px; margin-left: 4px; }

/* The address in a result row, and where it is under it. */
.ipc small { display: block; max-width: 15em; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font: 11.5px var(--sans); }
/* ---- share and screenshot boxes under the verdict ---- */

.vactions button[aria-expanded="true"] { border-color: var(--ink); background: var(--ink-soft); }
.vbox { border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 10px; }
.vrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.vlabel { color: var(--muted); font-size: 13px; }
.vnote { margin: 0; color: var(--muted); font-size: 13px; }
.vnote.bad { color: var(--bad); }
.vbox button { border: 1px solid var(--line-strong); background: var(--panel); padding: 6px 16px; border-radius: 999px; font-size: 13.5px; }
.vbox button:hover { border-color: var(--ink); }
.vbox button.primary { background: var(--btn); border-color: var(--btn); color: var(--btn-text); font-weight: 600; }
.vbox button.primary:hover { background: var(--btn-hover); }
.vbox button.link { border: 0; padding: 0; border-radius: 0; background: none; justify-self: start; }
.vbox button:disabled { opacity: 0.55; cursor: default; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; padding: 2px; gap: 2px; }
.vbox .seg button { border: 0; padding: 5px 14px; }
.vbox .seg button[aria-checked="true"] { background: var(--ink); color: var(--btn-text); }
.link-out {
  flex: 1 1 280px; min-width: 0; height: 34px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--soft); color: var(--text); font: 13px var(--mono);
}
.shot-preview { max-height: 360px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.shot-preview img { display: block; width: 100%; height: auto; }
/* ---- 需要注意 ---- */

.vnotes { border-top: 1px solid var(--line); padding-top: 12px; }
.vn-title { margin: 0 0 6px; font-size: 12px; letter-spacing: 0.12em; color: var(--muted); }
.vnotes ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.vnotes li { position: relative; padding-left: 18px; font-size: 14px; line-height: 1.5; }
.vnotes li::before { content: ""; position: absolute; left: 2px; top: 0.5em; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.vnotes li.bad::before { background: var(--bad); }
.vnotes li.warn::before { background: var(--mid); }
.vnotes li button { border: 0; background: none; padding: 0; text-align: left; color: var(--text); text-decoration: underline dotted var(--faint); text-underline-offset: 3px; }
.vnotes li button:hover { text-decoration-color: var(--ink); }
.vnotes li button[aria-pressed="true"] { text-decoration: underline solid var(--ink); font-weight: 600; }
/* ---- coverage: quick or full ---- */

.cover { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 8px 2px 0; font-size: 14px; }
.cover > span { color: var(--muted); }
.seg2 { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; gap: 2px; background: var(--panel); }
.seg2 button { border: 0; background: none; padding: 3px 14px; border-radius: 999px; font-size: 13px; color: var(--muted); }
.seg2 button[aria-checked="true"] { background: var(--ink); color: var(--btn-text); }
.cover small { flex: 1 1 260px; color: var(--muted); font-size: 12px; }
/* ---- the coverage page ---- */

.cov-hero { padding-bottom: 0; }
.cov-tiles { margin: 0 0 14px; padding: 4px 24px 16px; border-top: 0; }
.cov-tiles > div:first-child { padding-left: 0; }
#cov-overview { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 14px; align-items: start; }
@media (min-width: 960px) { #cov-overview { grid-template-columns: minmax(0, 11fr) minmax(0, 9fr); } }
#cov-map-panel { margin: 0; }
#cov-map { width: 100%; height: 440px; }
.cov-legend { margin: 4px 0 0; justify-content: center; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.swatch.cov-full { background: var(--s-good); }
.swatch.cov-gap { background: var(--s-warning); }
.swatch.cov-none { background: var(--map-empty); border: 1px solid var(--line-strong); }
.cov-note { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.cov-note:empty { display: none; }
.cov-table-panel { padding: 6px 0 4px; overflow: hidden; }
#cov-table caption { text-align: left; padding: 10px 20px 8px; }
#cov-table caption small { font-weight: 400; font-size: 12px; color: var(--muted); margin-left: 8px; }
#cov-table th:first-child, #cov-table td:first-child { padding-left: 20px; }
#cov-table th[scope="row"] { color: var(--text); }
#cov-table td { font-family: var(--mono); font-size: 13px; }
#cov-table td:last-child { font-family: var(--sans); white-space: normal; }
@media (max-width: 720px), (min-width: 960px) and (max-width: 1240px) {
  #cov-table th, #cov-table td { padding-inline: 5px; }
  #cov-table th:first-child, #cov-table td:first-child { padding-left: 10px; }
  #cov-table .cov-badge { padding-inline: 5px; text-wrap: balance; }
}
@media (max-width: 400px) {
  #cov-table th, #cov-table td { padding-inline: 4px; }
}
#cov-table td.cov-miss { color: var(--faint); }
#cov-table tbody tr.flash > * { animation: flash 1.4s ease-out; }
.cov-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: var(--soft); color: var(--muted); }
.cov-badge.full, .cov-badge.some { background: color-mix(in srgb, var(--s-good) 16%, transparent); color: var(--ok); }
.cov-badge.gap { background: color-mix(in srgb, var(--s-warning) 22%, transparent); color: var(--mid); }
#cov-table td .cov-badge { margin-right: 4px; }
#cov-table td a { display: inline-block; white-space: nowrap; font-size: 12px; color: var(--ink); }
.cov-cta { margin-top: 14px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 20px 24px; }
.cov-cta h2 { margin: 0 0 4px; font-size: 18px; }
.cov-cta p { margin: 0; color: var(--muted); font-size: 14px; }
.cov-cta .button { display: inline-block; padding: 9px 20px; border-radius: 999px; background: var(--btn); color: var(--btn-text); text-decoration: none; font-weight: 600; box-shadow: var(--btn-shadow); }
.cov-cta .button:hover { background: var(--btn-hover); }
.cov-table-panel .table-wrap { max-height: 560px; overflow-y: auto; }
#cov-table thead th { position: sticky; top: 0; background: var(--panel); z-index: 1; }
