:root {
  --bg: #f9fcfe;
  --surface: rgba(252, 254, 255, 0.94);
  --surface-solid: #fcfeff;
  --surface-muted: #e5f4fa;
  --ink: #0a2b42;
  --ink-soft: #4c7187;
  --line: rgba(13, 114, 156, 0.14);
  --accent: #168dbc;
  --accent-strong: #08749c;
  --accent-soft: rgba(25, 158, 207, 0.1);
  --success: #157765;
  --danger: #b04a44;
  --shadow: 0 24px 70px rgba(23, 113, 153, 0.13);
  --radius: 18px;
  --header-height: 68px;
  font-family: "Avenir Next", Avenir, "Segoe UI Variable", "PingFang SC", "Microsoft YaHei", sans-serif;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 78% 10%, rgba(91, 201, 238, 0.2), transparent 34rem),
    radial-gradient(circle at 8% 46%, rgba(121, 211, 240, 0.1), transparent 26rem),
    var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  opacity: 0.18;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 62%);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 20;
  transform: translateY(-150%);
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg);
  padding: 10px 14px;
  font-weight: 700;
}

.skip-link:focus {
  transform: translateY(0);
}

.shell {
  width: min(1160px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(252, 254, 255, 0.9);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand img,
.footer-brand img {
  border-radius: 10px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-link,
.language-button {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}

.header-link {
  padding: 10px 0;
}

.language-button {
  min-width: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
}

.header-link:hover,
.language-button:hover {
  color: var(--accent-strong);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(520px, 1.1fr);
  align-items: center;
  gap: clamp(54px, 7vw, 100px);
  min-height: calc(100dvh - var(--header-height));
  padding-block: 72px;
}

.hero-copy {
  align-self: center;
}

.panel-kicker {
  margin: 0;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(72px, 8vw, 104px);
  font-weight: 780;
  line-height: 0.94;
  letter-spacing: -0.075em;
  text-wrap: balance;
}

.hero-subtitle {
  margin-bottom: 18px;
  color: var(--accent-strong);
  font-size: clamp(24px, 2.6vw, 32px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.2;
}

.hero-description {
  white-space: pre-line;
  max-width: 35em;
  margin-bottom: 28px;
  color: var(--ink-soft);
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.75;
  text-wrap: pretty;
}

.privacy-note {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 13px;
}

.privacy-mark {
  width: 9px;
  height: 9px;
  border: 2px solid var(--success);
  border-radius: 50%;
}

.speed-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: clamp(24px, 4vw, 38px);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
}

.speed-panel::after {
  position: absolute;
  top: 0;
  right: 0;
  width: 140px;
  height: 140px;
  pointer-events: none;
  content: "";
  border-radius: 0 var(--radius) 0 100%;
  background: linear-gradient(225deg, var(--accent-soft), transparent 72%);
}

.panel-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.panel-kicker {
  margin-bottom: 10px;
}

.panel-head h2 {
  margin-bottom: 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.16;
  letter-spacing: -0.04em;
}

.test-state {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.state-dot,
.route-status-dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.is-running .state-dot,
.is-testing .route-status-dot {
  animation: pulse 1.2s ease-in-out infinite;
}

.test-state.is-ready .state-dot,
.route-row.is-available .route-status-dot {
  background: var(--success);
}

.test-state.is-error .state-dot,
.route-row.is-unavailable .route-status-dot {
  background: var(--danger);
}

.route-list {
  display: grid;
  gap: 10px;
}

.route-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-solid) 72%, transparent);
  padding: 18px;
  transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.route-row.is-best {
  border-color: color-mix(in srgb, var(--accent) 62%, transparent);
  background: var(--accent-soft);
}

.route-row:hover {
  transform: translateY(-2px);
}

.route-identity {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.route-identity h3 {
  margin-bottom: 5px;
  font-size: 15px;
  line-height: 1.3;
}

.route-domain {
  overflow: hidden;
  margin-bottom: 0;
  color: var(--ink-soft);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-result {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-end;
  flex-direction: column;
  gap: 7px;
}

.route-latency {
  color: var(--ink-soft);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.route-link {
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  padding: 0;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.route-skeleton {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  align-items: center;
  gap: 14px;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
}

.route-skeleton i {
  display: block;
  border-radius: 8px;
  background: var(--surface-muted);
  animation: skeleton 1.4s ease-in-out infinite alternate;
}

.route-skeleton i:nth-child(1) {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.route-skeleton i:nth-child(2) {
  width: min(210px, 60%);
  height: 34px;
}

.route-skeleton i:nth-child(3) {
  width: 72px;
  height: 18px;
}

.selection-message {
  min-height: 54px;
  padding-top: 18px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.65;
}

.selection-message strong,
.selection-message span {
  display: block;
}

.selection-message strong {
  color: var(--ink);
}

.panel-actions {
  display: flex;
  gap: 10px;
}

.primary-button,
.secondary-button {
  min-height: 48px;
  border-radius: 12px;
  padding: 0 20px;
  font-size: 14px;
  font-weight: 780;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.primary-button {
  flex: 1;
  border: 1px solid var(--accent-strong);
  background: var(--accent-strong);
  color: #f6fcff;
}

.primary-button:disabled {
  border-color: var(--line);
  background: var(--surface-muted);
  color: var(--ink-soft);
  cursor: wait;
}

.secondary-button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
}

.primary-button:not(:disabled):hover,
.secondary-button:hover {
  transform: translateY(-2px);
}

.primary-button:not(:disabled):active,
.secondary-button:active {
  transform: translateY(1px);
}

.process-section {
  border-block: 1px solid var(--line);
  background: #f3fafe;
  padding-block: 92px;
}

.process-grid {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: clamp(56px, 9vw, 140px);
  align-items: start;
}

.process-intro h2,
.faq-heading h2 {
  margin-bottom: 18px;
  font-size: clamp(32px, 4.2vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.05em;
}

.process-intro p,
.faq-heading p {
  max-width: 34em;
  margin-bottom: 0;
  color: var(--ink-soft);
  line-height: 1.75;
}

.process-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: process;
}

.process-list li {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
  counter-increment: process;
}

.process-list li:first-child {
  padding-top: 0;
}

.process-list strong {
  position: relative;
  padding-left: 34px;
}

.process-list strong::before {
  position: absolute;
  left: 0;
  color: var(--accent-strong);
  content: counter(process, decimal-leading-zero);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
}

.process-list span {
  color: var(--ink-soft);
  line-height: 1.6;
}

.faq-section {
  display: grid;
  grid-template-columns: 0.76fr 1.24fr;
  gap: clamp(54px, 9vw, 140px);
  padding-block: 110px;
  scroll-margin-top: calc(var(--header-height) + 24px);
}

.faq-list details {
  border-bottom: 1px solid var(--line);
}

.faq-list details:first-child {
  border-top: 1px solid var(--line);
}

.faq-list summary {
  position: relative;
  padding: 24px 44px 24px 0;
  font-weight: 750;
  line-height: 1.4;
  list-style: none;
  cursor: pointer;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  position: absolute;
  top: 21px;
  right: 4px;
  color: var(--accent-strong);
  content: "+";
  font-size: 24px;
  font-weight: 400;
  transition: transform 180ms ease;
}

.faq-list details[open] summary::after {
  transform: rotate(45deg);
}

.faq-list details p {
  max-width: 48em;
  margin-bottom: 24px;
  color: var(--ink-soft);
  line-height: 1.8;
}

footer {
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 94px;
  color: var(--ink-soft);
  font-size: 13px;
}

.footer-inner p {
  margin-bottom: 0;
}

.noscript-message {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 30;
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  background: var(--surface-solid);
  padding: 16px;
  box-shadow: var(--shadow);
  text-align: center;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes skeleton {
  from {
    opacity: 0.42;
  }
  to {
    opacity: 0.9;
  }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 44px;
    min-height: 0;
    padding-block: 70px 84px;
  }

  .hero-copy {
    max-width: 680px;
  }

  h1 {
    max-width: 10em;
    font-size: clamp(46px, 9.5vw, 70px);
  }

  .speed-panel {
    width: min(100%, 680px);
  }

  .process-grid,
  .faq-section {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .process-intro,
  .faq-heading {
    max-width: 620px;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 32px, 1160px);
  }

  .header-link {
    display: none;
  }

  .hero {
    gap: 32px;
    padding-block: 38px 56px;
  }

  .hero-copy {
    width: 100%;
    margin-inline: auto;
    text-align: center;
  }

  h1 {
    margin-bottom: 14px;
    font-size: clamp(46px, 14vw, 58px);
    letter-spacing: -0.055em;
  }

  .hero-subtitle {
    margin-bottom: 14px;
    font-size: clamp(21px, 6.5vw, 27px);
  }

  .hero-description {
    max-width: 31em;
    margin-right: auto;
    margin-bottom: 22px;
    margin-left: auto;
    font-size: 15px;
    line-height: 1.7;
  }

  .privacy-note {
    justify-content: center;
    font-size: 12px;
  }

  .speed-panel {
    width: 100%;
    padding: 19px 16px;
    text-align: left;
  }

  .panel-head {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
  }

  .panel-head h2 {
    font-size: clamp(23px, 7.5vw, 29px);
  }

  .test-state {
    justify-self: start;
  }

  .route-row {
    align-items: flex-start;
    flex-direction: column;
    min-height: 104px;
    gap: 14px;
    padding: 15px;
  }

  .route-identity,
  .route-result {
    width: 100%;
  }

  .route-identity > div {
    min-width: 0;
  }

  .route-domain {
    width: 100%;
    max-width: none;
  }

  .route-result {
    min-height: 0;
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
  }

  .panel-actions {
    flex-direction: column;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
    min-height: 50px;
  }

  .process-section,
  .faq-section {
    padding-block: 60px;
  }

  .process-grid,
  .faq-section {
    gap: 34px;
  }

  .process-intro,
  .faq-heading {
    margin-inline: auto;
    text-align: center;
  }

  .process-intro h2,
  .faq-heading h2 {
    margin-bottom: 14px;
    font-size: clamp(30px, 10vw, 40px);
  }

  .process-intro p,
  .faq-heading p {
    line-height: 1.65;
  }

  .process-list li {
    grid-template-columns: 1fr;
    gap: 9px;
    padding-block: 20px;
  }

  .process-list span {
    padding-left: 34px;
  }

  .faq-list summary {
    padding-block: 21px;
  }

  .faq-list details p {
    margin-bottom: 21px;
    line-height: 1.7;
  }

  .footer-inner {
    align-items: center;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    padding-block: 22px;
    text-align: center;
  }
}

@media (max-width: 380px) {
  .shell {
    width: min(100% - 24px, 1160px);
  }

  .header-inner {
    min-height: 62px;
  }

  .brand {
    gap: 8px;
  }

  .brand img {
    width: 34px;
    height: 34px;
  }

  .hero {
    padding-top: 32px;
  }

  .speed-panel {
    padding-inline: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@supports not (backdrop-filter: blur(1px)) {
  .site-header,
  .speed-panel {
    background: var(--surface-solid);
  }
}
