:root {
  color-scheme: dark;
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #070909;
  color: #edf3f1;
  --accent: #96f6cb;
  --muted: #a2aaa6;
  --line: #222b27;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse 34rem 28rem at 50% 40%, #10231c 0%, #0a100d 49%, #070909 100%);
}

.entry {
  width: min(100%, 32rem);
  min-height: 100vh;
  min-height: 100svh;
  margin-inline: auto;
  padding: max(2rem, env(safe-area-inset-top)) 1.25rem max(2rem, env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto 1fr;
  justify-items: center;
}

.brand, .brand-mark {
  display: flex;
  align-items: center;
}

.brand { gap: .65rem; }

.brand-mark {
  min-width: 2.25rem;
  min-height: 1.75rem;
  justify-content: center;
  padding-inline: .3rem;
  border: 1px solid #466757;
  border-radius: .4rem;
  background: #18251f;
  color: var(--accent);
  font-size: .9rem;
  font-weight: 850;
  font-style: italic;
  letter-spacing: -.04em;
}

.brand-name {
  color: #d0dbd5;
  font-size: .875rem;
  font-weight: 600;
  letter-spacing: .12em;
}

.match {
  align-self: center;
  width: 100%;
  text-align: center;
  padding-block: 2.75rem 3.5rem;
}

.scanner {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 8.75rem;
  aspect-ratio: 1;
  margin: 0 auto 2.25rem;
  border: 1px solid #4e6f5d;
  border-radius: 50%;
  background: radial-gradient(circle, #172c22 0%, #101c16 64%, #12261c 100%);
  box-shadow: 0 0 2.6rem #62deb023, inset 0 0 1.1rem #62deb024;
}

.scanner::before, .scanner::after {
  content: "";
  position: absolute;
  inset: 0;
}

.scanner::before {
  background: linear-gradient(transparent calc(50% - .5px), #83cfa03b 50%, transparent calc(50% + .5px)),
    linear-gradient(90deg, transparent calc(50% - .5px), #83cfa03b 50%, transparent calc(50% + .5px));
}

.scanner::after {
  inset: 18%;
  border: 1px solid #83cfa042;
  border-radius: 50%;
}

.scanner-ring, .scanner-sweep, .scanner-core {
  position: absolute;
  display: block;
  border-radius: 50%;
}

.scanner-ring {
  inset: 34%;
  border: 1px solid #83cfa047;
}

.scanner-sweep {
  inset: 1px;
  background: conic-gradient(from 0deg, transparent 0% 66%, #62dfa805 72%, #63e7b09c 99.8%, #aef8da 100%);
  animation: scan 2.3s linear infinite;
}

.scanner-core {
  inset: calc(50% - .19rem);
  background: var(--accent);
  box-shadow: 0 0 .9rem #9efbd1ad;
}

@keyframes scan { to { transform: rotate(1turn); } }

[data-state="ready"] .scanner-sweep { animation-play-state: paused; opacity: .75; }
[data-state="failed"] .scanner-sweep { animation: none; opacity: 0; }
[data-state="failed"] .scanner-core { background: #78837d; box-shadow: none; }

.message h1 {
  margin: 0;
  font-size: clamp(1.65rem, 6.4vw, 2.5rem);
  font-weight: 720;
  line-height: 1.22;
  letter-spacing: .015em;
  text-wrap: balance;
}

.message p, .no-script {
  margin: .8rem 0 0;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.6;
}

.routes {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .55rem;
  padding: 0;
  margin: 1.45rem 0 0;
  list-style: none;
}

.route {
  display: flex;
  align-items: center;
  gap: .45rem;
  min-height: 2rem;
  padding: .3rem .6rem;
  border: 1px solid var(--line);
  border-radius: .35rem;
  background: #101714;
  color: #c6d0ca;
  font-size: .875rem;
  white-space: nowrap;
}

.route-result { color: var(--muted); font-variant-numeric: tabular-nums; }
.route[data-result="available"] .route-result { color: var(--accent); }

.actions {
  display: flex;
  justify-content: center;
  gap: .5rem;
  min-height: 2.75rem;
  margin-top: 1.4rem;
}

.action {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 8rem;
  min-height: 2.75rem;
  padding: .55rem 1rem;
  border: 1px solid #456252;
  border-radius: .55rem;
  background: #17271f;
  color: #d9f8e7;
  font: inherit;
  font-size: .9rem;
  text-decoration: none;
  cursor: pointer;
}

.action:hover { background: #203528; }
.action:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .scanner-sweep { animation: none; transform: rotate(45deg); }
}

@media (max-height: 570px) {
  .match { padding-block: 1.5rem 0; }
  .scanner { width: 6.5rem; margin-bottom: 1.35rem; }
}
