:root {
  --ink: #101b2d;
  --paper: #f0eadc;
  --paper-soft: #f7f3e9;
  --signal: #eb5b35;
  --signal-dark: #b93e22;
  --green: #1f9b72;
  --yellow: #d69b28;
  --muted: #6c746f;
  --line: rgba(16, 27, 45, 0.16);
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--ink); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 4%, rgba(235, 91, 53, 0.16), transparent 24rem),
    linear-gradient(135deg, #e7dfcf 0%, var(--paper-soft) 48%, #ddd7ca 100%);
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  overflow-x: hidden;
}

button { font: inherit; }

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.25;
  z-index: 20;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
}

.shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.masthead {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 22px;
}

.brand-mark {
  width: 58px;
  height: 58px;
  position: relative;
  display: grid;
  place-items: center;
  color: var(--paper-soft);
  background: var(--ink);
  font-family: Georgia, serif;
  font-weight: 700;
  letter-spacing: -0.08em;
  transform: rotate(-3deg);
  box-shadow: 6px 6px 0 var(--signal);
}

.brand-mark i {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  height: 2px;
  background: var(--signal);
}

.eyebrow,
.section-index {
  margin: 0 0 5px;
  font: 700 11px/1.2 Georgia, serif;
  letter-spacing: 0.18em;
  color: var(--signal-dark);
}

.masthead h1 {
  margin: 0;
  font-size: clamp(20px, 2.5vw, 28px);
  letter-spacing: 0.04em;
}

.masthead h1 span {
  margin-left: 0.65em;
  color: var(--muted);
  font-weight: 400;
}

.privacy-tag {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  font: 600 12px/1.2 "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0.05em;
}

.privacy-tag i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(31, 155, 114, 0.12);
}

.hero {
  min-height: 420px;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  align-items: center;
  gap: 70px;
  padding: 55px 6% 48px;
  margin-top: 26px;
  color: var(--paper-soft);
  background:
    linear-gradient(120deg, rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 32px 32px,
    var(--ink);
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "CLOUDFLARE";
  position: absolute;
  right: -31px;
  bottom: -14px;
  color: rgba(240, 234, 220, 0.035);
  font: 800 clamp(62px, 10vw, 140px)/0.8 Georgia, serif;
  letter-spacing: -0.08em;
}

.hero h2 {
  margin: 14px 0 19px;
  max-width: 720px;
  font-size: clamp(33px, 5.3vw, 64px);
  font-weight: 600;
  line-height: 1.11;
  letter-spacing: -0.045em;
}

.intro {
  margin: 0;
  max-width: 650px;
  color: rgba(247, 243, 233, 0.68);
  font: 400 15px/1.8 "PingFang SC", "Microsoft YaHei", sans-serif;
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 30px;
}

.primary-button,
.ghost-button {
  min-height: 48px;
  border: 0;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, opacity .2s ease;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  gap: 34px;
  padding: 0 19px 0 23px;
  color: white;
  background: var(--signal);
  font: 700 14px "PingFang SC", sans-serif;
}

.primary-button svg {
  width: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: square;
}

.primary-button:hover { transform: translateY(-2px); background: #f26640; }
.primary-button:disabled { opacity: .65; cursor: wait; transform: none; }

.ghost-button {
  padding: 0 20px;
  color: var(--paper-soft);
  background: transparent;
  border: 1px solid rgba(247, 243, 233, .28);
  font: 600 13px "PingFang SC", sans-serif;
}

.ghost-button:hover:not(:disabled) { border-color: var(--paper-soft); }
.ghost-button:disabled { opacity: .35; cursor: not-allowed; }

.result-orbit {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 300px;
  z-index: 2;
}

.orbit-ring {
  position: absolute;
  width: 270px;
  height: 270px;
  border: 1px solid rgba(247, 243, 233, .16);
  border-radius: 50%;
}

.orbit-ring::before,
.orbit-ring::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px dashed rgba(235, 91, 53, .35);
}

.orbit-ring::before { inset: 16px; }
.orbit-ring::after { inset: 44px; border-color: rgba(247, 243, 233, .12); }

.status-dial {
  position: relative;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--ink);
  background: var(--paper-soft);
  transition: background .35s ease, color .35s ease, transform .35s ease;
  z-index: 1;
}

.status-dial.running { animation: breathe 1.7s ease-in-out infinite; }
.status-dial.good { background: var(--green); color: white; }
.status-dial.fair { background: var(--yellow); color: var(--ink); }
.status-dial.bad { background: var(--signal); color: white; }

.pulse-dot {
  width: 7px;
  height: 7px;
  margin-bottom: 10px;
  border-radius: 50%;
  background: currentColor;
  opacity: .65;
}

.status-dial strong { font-size: 27px; letter-spacing: .06em; }
.status-dial small { margin-top: 8px; font: 12px "PingFang SC", sans-serif; opacity: .66; }

.tested-at {
  position: absolute;
  bottom: -3px;
  margin: 0;
  color: rgba(247, 243, 233, .5);
  font: 11px/1.2 Georgia, serif;
  letter-spacing: .08em;
}

.metrics {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  border-left: 1px solid var(--line);
  margin-top: 28px;
}

.metric-card {
  min-height: 230px;
  padding: 27px 28px 24px;
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(247, 243, 233, .48);
}

.metric-card.feature { background: var(--paper-soft); }

.metric-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font: 600 13px "PingFang SC", sans-serif;
  color: var(--muted);
}

.lamp {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a4a7a2;
}

.lamp.good { background: var(--green); box-shadow: 0 0 0 5px rgba(31,155,114,.12); }
.lamp.fair { background: var(--yellow); box-shadow: 0 0 0 5px rgba(214,155,40,.12); }
.lamp.bad { background: var(--signal); box-shadow: 0 0 0 5px rgba(235,91,53,.12); }

.metric-value { margin-top: 33px; white-space: nowrap; }
.metric-value strong { font: 600 clamp(48px, 6vw, 75px)/1 Georgia, serif; letter-spacing: -.055em; }
.metric-value small { margin-left: 8px; font: 600 12px "PingFang SC", sans-serif; color: var(--muted); }
.metric-card p { margin: 18px 0 0; font: 13px/1.5 "PingFang SC", sans-serif; color: var(--muted); }

.round-bars {
  height: 34px;
  margin-top: 13px;
  display: flex;
  align-items: flex-end;
  gap: 5px;
}

.round-bars i {
  flex: 1;
  min-width: 6px;
  background: var(--signal);
  opacity: .75;
  transform-origin: bottom;
  animation: rise .45s ease both;
}

.diagnostics {
  margin-top: 28px;
  padding: 34px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
}

.diag-heading {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  align-items: end;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.diag-heading h3 { margin: 0; font-size: 28px; }
.diag-heading > p { margin: 0; color: var(--muted); font: 13px/1.6 "PingFang SC", sans-serif; }

.diag-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0;
}

.diag-grid div { padding: 23px 22px 4px 0; min-width: 0; }
.diag-grid div + div { padding-left: 22px; border-left: 1px solid var(--line); }
.diag-grid .wide { grid-column: span 4; padding-left: 0; border-left: 0; border-top: 1px solid var(--line); margin-top: 20px; }
.diag-grid dt { color: var(--muted); font: 12px "PingFang SC", sans-serif; }
.diag-grid dd { margin: 9px 0 0; font: 700 16px/1.45 "PingFang SC", sans-serif; overflow-wrap: anywhere; }

.decision {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 36px;
  margin-top: 28px;
  padding: 27px 32px;
  color: var(--paper-soft);
  background: var(--signal-dark);
}

.decision-number { font: 700 13px "PingFang SC", sans-serif; letter-spacing: .06em; }
.decision p { margin: 0; font: 15px/1.75 "PingFang SC", sans-serif; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 2px 0;
  color: var(--muted);
  font: 11px/1.5 "PingFang SC", sans-serif;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 50;
  padding: 12px 18px;
  color: white;
  background: var(--ink);
  font: 13px "PingFang SC", sans-serif;
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

.reveal { animation: reveal .7s cubic-bezier(.2,.7,.2,1) both; }
.delay-1 { animation-delay: .08s; }
.delay-2 { animation-delay: .16s; }
.delay-3 { animation-delay: .24s; }
.delay-4 { animation-delay: .32s; }

@keyframes reveal {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes breathe {
  50% { transform: scale(.94); box-shadow: 0 0 0 18px rgba(247,243,233,.06); }
}

@keyframes rise {
  from { transform: scaleY(0); }
}

@media (max-width: 760px) {
  .shell { width: min(100% - 24px, 620px); padding-top: 16px; }
  .masthead { grid-template-columns: auto 1fr; }
  .brand-mark { width: 48px; height: 48px; }
  .eyebrow { font-size: 8px; letter-spacing: .11em; }
  .masthead h1 { font-size: 18px; }
  .masthead h1 span { display: block; margin: 3px 0 0; font-size: 13px; }
  .privacy-tag { grid-column: 1 / -1; justify-self: start; margin-top: 2px; }
  .hero { grid-template-columns: 1fr; gap: 14px; padding: 38px 25px 32px; min-height: 0; }
  .hero h2 { font-size: clamp(31px, 9.6vw, 46px); }
  .actions { align-items: stretch; flex-direction: column; }
  .primary-button { justify-content: space-between; }
  .result-orbit { min-height: 286px; }
  .orbit-ring { width: 250px; height: 250px; }
  .metrics { grid-template-columns: 1fr; }
  .metric-card { min-height: 190px; }
  .metric-value strong { font-size: 62px; }
  .diagnostics { padding: 25px 22px; }
  .diag-heading { display: block; }
  .diag-heading > p { margin-top: 12px; }
  .diag-grid { grid-template-columns: 1fr 1fr; }
  .diag-grid div + div { padding-left: 16px; }
  .diag-grid div:nth-child(3) { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .diag-grid div:nth-child(4) { border-top: 1px solid var(--line); }
  .diag-grid .wide { grid-column: span 2; }
  .decision { grid-template-columns: 1fr; gap: 12px; padding: 24px; }
  footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
