:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #697386;
  --line: #e5eaf1;
  --blue: #1876e8;
  --blue-soft: #eaf4ff;
  --violet: #7254e9;
  --violet-soft: #f0ecff;
  --green: #28a772;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 8%, rgba(40, 150, 255, .08), transparent 28rem),
    radial-gradient(circle at 92% 18%, rgba(111, 78, 238, .08), transparent 24rem),
    #f7f9fc;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
}

button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .7; }

main { min-height: 100vh; }

.topbar {
  width: min(1120px, calc(100% - 40px));
  height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(220, 226, 236, .8);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 720;
  letter-spacing: -.02em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  color: white;
  background: linear-gradient(145deg, #1677e9, #7354e8);
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(55, 102, 207, .24);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-nav a {
  color: #596579;
  text-decoration: none;
  font-size: 13px;
  transition: color .2s;
}

.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--blue); }

.status {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #657084;
  font-size: 13px;
}

.status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(40, 167, 114, .1);
}

.hero {
  width: min(760px, calc(100% - 40px));
  margin: 70px auto 42px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 13px !important;
  color: #6680a3 !important;
  font-size: 11px !important;
  font-weight: 750;
  letter-spacing: .18em;
}

.hero h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 48px);
  letter-spacing: -.045em;
  line-height: 1.1;
}

.hero p {
  margin: 17px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.tool-grid {
  width: min(1050px, calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: stretch;
}

.tool-card {
  min-width: 0;
  padding: 30px;
  background: rgba(255, 255, 255, .92);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 16px 50px rgba(34, 47, 73, .065);
}

.ip-card { border-top: 3px solid #2c8bf2; }
.speed-card { border-top: 3px solid #7a5bec; }

.card-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.icon-box {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
}

.ip-card .icon-box { color: var(--blue); background: var(--blue-soft); }
.speed-card .icon-box { color: var(--violet); background: var(--violet-soft); }

.icon-box svg {
  width: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tool-label {
  display: block;
  margin-bottom: 4px;
  color: #8a94a6;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .14em;
}

.card-heading h2 {
  margin: 0;
  font-size: 21px;
  letter-spacing: -.02em;
}

.search-form {
  display: flex;
  gap: 10px;
}

.search-form input {
  min-width: 0;
  flex: 1;
  height: 46px;
  padding: 0 14px;
  border: 1px solid #dbe2ec;
  border-radius: 11px;
  color: var(--ink);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.search-form input::placeholder { color: #a0a9b8; }
.search-form input:focus { border-color: #5aa6f5; box-shadow: 0 0 0 3px rgba(40, 139, 241, .12); }

.search-form button {
  height: 46px;
  padding: 0 21px;
  border: 0;
  border-radius: 11px;
  background: var(--blue);
  color: white;
  font-weight: 680;
  box-shadow: 0 8px 18px rgba(24, 118, 232, .2);
}

.current-ip {
  margin-top: 12px;
  padding: 0;
  color: var(--blue);
  background: none;
  border: 0;
  font-size: 13px;
}

.ip-result {
  min-height: 267px;
  margin-top: 23px;
  padding: 22px;
  border: 1px solid #e2ebf5;
  border-radius: 15px;
  background: #f8fbff;
}

.loading-state, .error-state {
  height: 218px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #738096;
  font-size: 14px;
}

.loading-state span {
  width: 16px;
  height: 16px;
  border: 2px solid #bcd5f2;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

.error-state { color: #c64253; }

.primary-result {
  padding-bottom: 19px;
  border-bottom: 1px solid #e0e8f2;
}

.primary-result span, .details-list dt {
  color: #7a879a;
  font-size: 12px;
}

.primary-result strong {
  display: block;
  margin-top: 7px;
  color: #1d6fc9;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: clamp(17px, 2.8vw, 23px);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.details-list { margin: 11px 0 0; }
.details-list div { min-height: 34px; display: grid; grid-template-columns: 105px 1fr; align-items: center; gap: 12px; }
.details-list dd { margin: 0; color: #354156; font-size: 13px; text-align: right; overflow-wrap: anywhere; }

.speed-visual {
  text-align: center;
  padding-top: 2px;
}

.speed-ring {
  width: 176px;
  height: 176px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #7354e9 var(--progress), #ebe8f5 var(--progress));
  position: relative;
  transition: background .25s;
}

.speed-ring::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: white;
  box-shadow: inset 0 0 0 1px #f0edf8;
}

.speed-ring > div { position: relative; z-index: 1; }
.speed-ring strong { display: block; font-size: 38px; letter-spacing: -.05em; }
.speed-ring span { color: #858b9a; font-size: 12px; }
.speed-visual p { margin: 13px 0 21px; color: #737c8f; font-size: 13px; }

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.metrics > div {
  padding: 13px 8px;
  border: 1px solid #e8e5f2;
  border-radius: 12px;
  background: #fbfaff;
  text-align: center;
}

.metrics span { display: block; color: #7c8495; font-size: 11px; }
.metrics strong { display: block; margin-top: 7px; font-size: 18px; }
.metrics b { font: inherit; }
.metrics small { color: #8c93a0; font-size: 10px; font-weight: 500; }
.metrics i { font-style: normal; font-weight: 800; }
.ping-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #f6ae3a; }
.down-arrow { color: #7657e9; }
.up-arrow { color: #3aa886; }

.test-button {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 12px;
  color: white;
  background: linear-gradient(110deg, #7657e9, #6550cf);
  font-weight: 690;
  box-shadow: 0 10px 22px rgba(105, 79, 211, .22);
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  border: 2px solid rgba(255,255,255,.45);
  border-top-color: white;
  border-radius: 50%;
  vertical-align: -2px;
  animation: spin .8s linear infinite;
}

.speed-note { margin: 11px 0 0; color: #949baa; font-size: 11px; text-align: center; }

.content-section {
  width: min(1050px, calc(100% - 40px));
  margin: 30px auto 0;
  padding: 44px;
  background: rgba(255, 255, 255, .9);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 16px 50px rgba(34, 47, 73, .045);
}

.section-heading { max-width: 690px; margin-bottom: 27px; }
.section-heading h2, .reading-section h2 { margin: 0; font-size: 27px; letter-spacing: -.035em; }
.section-heading p { margin: 12px 0 0; color: var(--muted); line-height: 1.8; }

.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.info-grid article { padding: 25px; border: 1px solid #e5eaf2; border-radius: 16px; background: #fbfcff; }
.info-grid article:first-child { border-top: 3px solid var(--blue); }
.info-grid article:last-child { border-top: 3px solid var(--violet); }
.info-grid h3 { margin: 0 0 11px; font-size: 19px; }
.info-grid p, .reading-section p { color: #5f6c80; line-height: 1.85; font-size: 14px; }
.info-grid a, .text-link { color: var(--blue); text-decoration: none; font-size: 13px; font-weight: 650; }

.reading-section { display: grid; grid-template-columns: .72fr 1.28fr; gap: 44px; align-items: start; }
.step-list { margin: 0; padding: 0; list-style: none; counter-reset: steps; }
.step-list li { position: relative; padding: 0 0 21px 45px; counter-increment: steps; }
.step-list li::before { content: counter(steps); position: absolute; left: 0; top: -2px; display: grid; place-items: center; width: 29px; height: 29px; border-radius: 9px; color: white; background: #7354e9; font-size: 12px; font-weight: 700; }
.step-list strong, .step-list span { display: block; }
.step-list strong { margin-bottom: 5px; font-size: 14px; }
.step-list span { color: #697589; font-size: 13px; line-height: 1.65; }
.reading-section .text-link { grid-column: 2; }

.faq-section { max-width: 1050px; }
.faq-section details { border-top: 1px solid #e7ebf1; }
.faq-section details:last-child { border-bottom: 1px solid #e7ebf1; }
.faq-section summary { padding: 19px 2px; cursor: pointer; font-weight: 650; font-size: 14px; }
.faq-section details p { margin: -4px 0 20px; color: #637084; line-height: 1.8; font-size: 13px; }

.article-page {
  width: min(820px, calc(100% - 40px));
  margin: 68px auto 0;
  padding: 50px 56px;
  background: rgba(255, 255, 255, .94);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 16px 50px rgba(34, 47, 73, .055);
}

.article-page h1 { margin: 0; font-size: clamp(32px, 5vw, 44px); line-height: 1.18; letter-spacing: -.045em; }
.article-page .lead { margin: 20px 0 38px; color: #536178; font-size: 17px; line-height: 1.85; }
.article-page h2 { margin: 35px 0 12px; font-size: 22px; letter-spacing: -.025em; }
.article-page p, .article-page li { color: #536076; font-size: 15px; line-height: 1.95; }
.article-page ul, .article-page ol { padding-left: 23px; }
.article-page li + li { margin-top: 8px; }
.article-page a { color: #176dc8; }
.policy-date { color: #8993a4 !important; font-size: 12px !important; }
.article-cta { margin-top: 42px; padding: 28px; border-radius: 16px; background: linear-gradient(135deg, #edf6ff, #f2efff); }
.article-cta h2 { margin-top: 0; }
.primary-link { display: inline-flex; align-items: center; min-height: 42px; padding: 0 18px; border-radius: 10px; color: white !important; background: linear-gradient(110deg, #1876e8, #6c55dc); text-decoration: none; font-weight: 680; }

footer {
  width: min(1050px, calc(100% - 40px));
  margin: 34px auto 0;
  padding: 22px 0 40px;
  color: #8b94a4;
  border-top: 1px solid #e5e9f0;
  font-size: 12px;
  text-align: center;
}

footer nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 19px; margin-bottom: 14px; }
footer a { color: #697589; text-decoration: none; }
footer a:hover { color: var(--blue); }
footer p { margin: 7px 0 0; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 820px) {
  .site-nav { display: none; }
  .hero { margin-top: 52px; }
  .tool-grid { grid-template-columns: 1fr; max-width: 580px; }
  .info-grid, .reading-section { grid-template-columns: 1fr; }
  .reading-section .text-link { grid-column: 1; }
}

@media (max-width: 520px) {
  .topbar { width: calc(100% - 28px); height: 66px; }
  .status { font-size: 11px; }
  .hero { width: calc(100% - 28px); margin: 46px auto 32px; }
  .hero p { font-size: 14px; }
  .tool-grid { width: calc(100% - 24px); gap: 16px; }
  .tool-card { padding: 22px 18px; border-radius: 18px; }
  .content-section { width: calc(100% - 24px); padding: 28px 20px; border-radius: 18px; }
  .article-page { width: calc(100% - 24px); margin-top: 34px; padding: 32px 21px; border-radius: 18px; }
  .article-page .lead { font-size: 15px; }
  .search-form button { padding: 0 17px; }
  .ip-result { padding: 18px; }
  .details-list div { grid-template-columns: 82px 1fr; }
}
