:root {
  color-scheme: light;
  --canvas: #f4f7fc;
  --paper: #fff;
  --ink: #162642;
  --muted: #4b5e79;
  --line: #dce5f1;
  --blue: #2056d5;
  --navy: #101f3c;
  --radius: 20px;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  line-height: 1.5;
}
* { box-sizing: border-box; }
body { margin: 0; padding-bottom: 28px; }
a { color: var(--blue); text-underline-offset: .22em; }
a:hover { color: #173ba3; }
button, a { touch-action: manipulation; }
button { font: inherit; }
button:not(:disabled):not([aria-disabled="true"]) { cursor: pointer; }
:focus-visible { outline: 3px solid #3263d7; outline-offset: 4px; }
h1, h2, p, dl, dd { margin: 0; }
h1, h2 { text-wrap: balance; }
p, dd { overflow-wrap: anywhere; }
#main, #method { scroll-margin-top: 20px; }

.shell { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.skip {
  position: absolute;
  z-index: 3;
  top: 8px;
  left: 16px;
  transform: translateY(-150%);
  padding: 10px 16px;
  background: var(--paper);
  border-radius: 8px;
}
.skip:focus { transform: none; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.topbar { background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-size: 1.02rem; font-weight: 720; }
.signal {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: end;
  justify-content: center;
  gap: 3px;
  padding-bottom: 8px;
  border-radius: 10px;
  background: var(--blue);
}
.signal i { width: 3px; border-radius: 2px; background: #fff; }
.signal i:nth-child(1) { height: 6px; opacity: .63; }
.signal i:nth-child(2) { height: 11px; opacity: .82; }
.signal i:nth-child(3) { height: 16px; }
.method-link {
  display: inline-flex;
  padding: 10px 14px;
  min-height: 44px;
  align-items: center;
  border-radius: 8px;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
}
.method-link:hover { background: #eaf0fd; color: var(--blue); }

.intro { padding-block: 36px 26px; }
.intro h1 { font-size: clamp(2.1rem, 3.65vw, 3.1rem); line-height: 1.16; letter-spacing: -.045em; font-weight: 760; }
.intro p { margin-top: 10px; color: var(--muted); font-size: 1rem; }
.overview { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; }
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 3px 12px #16376d09;
}
.network, .run { padding: 22px 24px; }
.network {
  container-type: inline-size;
  background:
    radial-gradient(circle at 90% 25%, #285bc177, transparent 56%),
    radial-gradient(circle at 95% 35%, transparent 57px, #acc6ff2b 58px, transparent 59px 82px, #acc6ff25 83px, transparent 84px 104px, #acc6ff19 105px, transparent 106px),
    var(--navy);
  border-color: #223b67;
  color: #fff;
}
.network h2 { font-size: .95rem; font-weight: 620; color: #d3e2ff; }
.ip-line { display: flex; align-items: center; gap: 14px; min-height: 57px; margin-block: 3px 10px; }
.ip-address {
  min-width: 0;
  font-family: var(--mono);
  font-size: clamp(1.45rem, 2.8vw, 2.3rem);
  font-weight: 700;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
}
.ip-address:not([data-state="ready"]) { font-family: inherit; letter-spacing: 0; }
.ip-address[data-family="v6"] { font-size: clamp(1.05rem, 3.8cqi, 1.55rem); line-height: 1.35; }
.copy {
  flex: none;
  padding: 0 11px;
  min-height: 44px;
  border: 1px solid #6681b3;
  border-radius: 9px;
  background: #ffffff10;
  color: #fff;
  font-size: .85rem;
  font-weight: 630;
  transition: background-color 140ms ease, border-color 140ms ease;
}
.copy:disabled { color: #c1cfe5; opacity: .74; }
.copy:hover:not(:disabled) { background: #ffffff26; border-color: #bacfff; }
.copy:focus-visible { outline-color: #b6d2ff; }
.network-details {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  padding-top: 13px;
  border-top: 1px solid #a8c4ff4a;
}
.network-details dt { font-size: .86rem; color: #c4d5f4; }
.network-details dd { margin-top: 3px; font-size: .94rem; font-weight: 600; }
.network-note, .copy-feedback { font-size: .82rem; color: #d1dfff; }
.network-note, .copy-feedback:not(:empty) { margin-top: 10px; }

.run { display: flex; flex-direction: column; }
.run-header, .run-actions { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.run h2, .results h2 { font-size: 1.12rem; font-weight: 740; }
.badge, .status {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .84rem;
  font-weight: 630;
  white-space: nowrap;
  color: #485c79;
  background: #ecf1f8;
}
.badge[data-state="running"], .status[data-state="running"] { color: #184dbd; background: #eaf0ff; }
.badge[data-state="responded"], .status[data-state="responded"] { color: #126449; background: #e4f6ed; }
.badge[data-state="failed"], .status[data-state="failed"] { color: #9c2c3b; background: #fcebf0; }
.status[data-state="timeout"] { color: #855300; background: #fff3d8; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.metrics { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 16px; margin: 16px 0 10px; }
.metric-label { color: var(--muted); font-size: .86rem; }
.metric-value { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 6px; min-height: 36px; }
.metric-value strong { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 1.45rem; line-height: 1.36; }
.metric-value span { color: var(--muted); font-size: .83rem; }
progress {
  display: block;
  width: 100%;
  height: 5px;
  border: 0;
  border-radius: 999px;
  background: #e7eefb;
  accent-color: var(--blue);
  color: var(--blue);
}
progress::-webkit-progress-bar { background: #e7eefb; border-radius: 999px; }
progress::-webkit-progress-value { background: var(--blue); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--blue); border-radius: 999px; }
.run-actions { margin-top: auto; padding-top: 16px; }
.primary {
  min-height: 44px;
  min-width: 122px;
  padding: 8px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  transition: background-color 140ms ease, transform 140ms ease;
}
.primary:hover:not(:disabled):not([aria-disabled="true"]) { background: #1948b7; }
.primary:active:not(:disabled):not([aria-disabled="true"]) { transform: translateY(1px); }
.primary:disabled, .primary[aria-disabled="true"] { background: #dce7ff; color: #264b9e; }
.run-time { color: var(--muted); font-size: .84rem; text-align: right; }
.run-time time { display: inline-block; font-variant-numeric: tabular-nums; }

.results { margin-top: 20px; }
.results-header { padding: 17px 24px 14px; }
.results-header p { color: var(--muted); margin-top: 3px; font-size: .87rem; }
table { width: 100%; table-layout: fixed; border-collapse: collapse; }
.product-col { width: 31%; }
.host-col { width: 32%; }
.latency-col { width: 17%; }
.status-col { width: 20%; }
th, td { padding: 6px 12px; text-align: left; }
th:first-child { padding-left: 24px; }
th:last-child, td:last-child { padding-right: 24px; }
thead { background: #f1f5fb; color: var(--muted); }
thead th { font-size: .85rem; font-weight: 660; padding-block: 9px; }
tbody tr + tr { border-top: 1px solid #e8eef6; }
tbody tr:hover, tbody tr:focus-within { background: #f8faff; }
.product { display: flex; align-items: center; gap: 12px; }
.product > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.product-name { display: block; font-size: .95rem; font-weight: 690; }
.mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: .8rem;
  color: #2752ad;
  background: #e8eeff;
}
.mark[data-tone="mint"] { background: #e3f3ec; color: #17664d; }
.mark[data-tone="sand"] { background: #faede2; color: #8a4926; }
.mark[data-tone="slate"] { background: #e8edf4; color: #36445f; }
.mark[data-tone="teal"] { background: #e2f5f4; color: #11686d; }
.mark[data-tone="violet"] { background: #efe9fc; color: #6634a7; }
.mark[data-tone="rose"] { background: #faeaf1; color: #873a6f; }
.host, .compact-host {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--blue);
  font-family: var(--mono);
  font-size: .86rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.compact-host { display: none; }
.host:hover, .compact-host:hover { text-decoration-thickness: 2px; }
.latency { text-align: right; }
.elapsed { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 660; font-size: .94rem; }

.method { margin-top: 24px; padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--radius); }
.method h2 { font-size: 1.05rem; }
.method dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 12px; }
.method dt { font-size: .92rem; font-weight: 680; }
.method dd { margin-top: 3px; color: var(--muted); font-size: .87rem; line-height: 1.7; }

@media (max-width: 900px) {
  .overview { grid-template-columns: minmax(0, 1fr); }
  .ip-address { font-size: clamp(1.35rem, 4vw, 2.2rem); }
}
@media (max-width: 650px) {
  .shell { width: calc(100% - 28px); }
  .intro { padding-block: 27px 20px; }
  .network, .run, .results-header, .method { padding-inline: 15px; }
  .host-cell, .host-col { display: none; }
  .compact-host { display: inline-flex; min-height: 32px; font-size: .72rem; }
  .product-col { width: auto; }
  .latency-col { width: 22%; }
  .status-col { width: 28%; }
  th, td { padding-inline: 5px; }
  th:first-child { padding-left: 13px; }
  th:last-child, td:last-child { padding-right: 10px; }
  .product { gap: 7px; }
  .mark { width: 30px; height: 30px; border-radius: 8px; }
  .status { padding-inline: 6px; font-size: .75rem; gap: 4px; }
  .method dl { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}
@media (max-width: 360px) {
  .mark { display: none; }
  .ip-line { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
