:root {
  --text: #111111;
  --muted: #6e6e73;
  --line: rgba(17, 17, 17, 0.08);
  --line-strong: rgba(17, 17, 17, 0.14);
  --surface: rgba(255, 255, 255, 0.86);
  --surface-strong: rgba(255, 255, 255, 0.96);
  --accent: #0071e3;
  --accent-soft: rgba(0, 113, 227, 0.12);
  --good: #218043;
  --good-soft: rgba(33, 128, 67, 0.08);
  --warn: #b36a00;
  --warn-soft: rgba(179, 106, 0, 0.1);
  --bad: #c43128;
  --bad-soft: rgba(196, 49, 40, 0.1);
  --radius-xl: 40px;
  --radius-lg: 28px;
  --radius-md: 18px;
  --shadow: 0 30px 80px rgba(15, 23, 42, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font-family:
    "SF Pro Display",
    "SF Pro Text",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    "Hiragino Sans GB",
    "Noto Sans SC",
    sans-serif;
  line-height: 1.4;
  background:
    radial-gradient(circle at top center, rgba(0, 113, 227, 0.08), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, #f7f7f9 48%, #efeff2 100%);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 0.92), transparent 24%),
    radial-gradient(circle at 100% 0%, rgba(0, 113, 227, 0.06), transparent 20%);
}

a,
button {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

h1,
h2,
p {
  margin: 0;
}

h1,
h2 {
  font-weight: 600;
  letter-spacing: -0.05em;
}

h1 {
  font-size: clamp(4.5rem, 14vw, 9rem);
  line-height: 0.88;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 0.96;
}

p,
.scan-copy,
.loading-copy,
.result-copy,
.result-next {
  color: var(--muted);
}

.shell {
  width: min(960px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 72px;
}

.main-content {
  display: grid;
  gap: 24px;
}

.screen {
  min-height: 100svh;
  display: grid;
  align-items: center;
}

.panel,
.loading-view,
.empty-view,
.result,
.stat,
.finding {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--surface-strong), var(--surface));
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.panel::before,
.loading-view::before,
.empty-view::before,
.result::before,
.stat::before,
.finding::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.42), transparent 36%);
}

.hero {
  justify-items: center;
  gap: 22px;
  padding: 48px 24px;
  text-align: center;
}

.hero-mark {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 32%, #55a6ff, #0071e3 62%, #0057b8 100%);
  box-shadow: 0 0 0 10px rgba(0, 113, 227, 0.08);
}

.hero-button {
  min-width: 132px;
}

.hero-note {
  font-size: 0.92rem;
  letter-spacing: 0.03em;
}

.scan-screen,
.result-screen {
  padding: 32px 0 0;
}

.scan-panel,
.loading-view,
.empty-view,
.result {
  z-index: 1;
  padding: 24px;
}

.page-title {
  font-size: clamp(2.6rem, 7vw, 5rem);
  line-height: 0.92;
}

.panel-head {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.relay-form {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 0.76rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.field input {
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  outline: none;
}

.field input:focus {
  border-color: rgba(0, 113, 227, 0.34);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
}

.secret-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.scan-copy {
  font-size: 0.84rem;
}

.button,
.ghost-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.button:hover,
.ghost-button:hover,
.finding:hover {
  transform: translateY(-1px);
}

.button-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(0, 113, 227, 0.24);
}

.button-secondary {
  background: rgba(255, 255, 255, 0.92);
}

.ghost-button {
  min-width: 76px;
  border-radius: var(--radius-md);
}

.form-actions,
.chip-row,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.loading-view,
.empty-view {
  gap: 18px;
  justify-items: center;
  text-align: center;
}

.loading-water {
  position: relative;
  width: 150px;
  height: 138px;
}

.drop,
.pool,
.ripple {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.drop {
  top: 0;
  width: 22px;
  height: 30px;
  border-radius: 50% 50% 60% 60%;
  background: linear-gradient(180deg, #62b0ff, #0071e3);
  opacity: 0;
  animation: drop-fall 2.4s ease-in infinite;
}

.drop::after {
  content: "";
  position: absolute;
  inset: -10px 5px auto;
  height: 20px;
  border-radius: 50%;
  background: inherit;
}

.drop-a {
  animation-delay: 0s;
}

.drop-b {
  width: 18px;
  height: 24px;
  animation-delay: 0.8s;
}

.drop-c {
  width: 14px;
  height: 18px;
  animation-delay: 1.6s;
}

.pool {
  bottom: 20px;
  width: 92px;
  height: 16px;
  border-radius: 999px;
  background: rgba(0, 113, 227, 0.16);
}

.ripple {
  bottom: 10px;
  width: 64px;
  height: 20px;
  border: 2px solid rgba(0, 113, 227, 0.18);
  border-radius: 999px;
  opacity: 0;
  animation: ripple-out 2.4s ease-out infinite;
}

.ripple-a {
  animation-delay: 0.1s;
}

.ripple-b {
  animation-delay: 0.9s;
}

.result {
  gap: 14px;
  scroll-margin-top: 32px;
}

.result-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.result-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.result-copy {
  margin-top: 10px;
  font-size: 0.95rem;
  max-width: 32ch;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-size: 0.72rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.stat,
.finding {
  z-index: 1;
  padding: 16px;
  border-radius: var(--radius-lg);
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 1rem;
  letter-spacing: -0.03em;
}

.findings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.finding {
  display: grid;
  gap: 10px;
}

.finding-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.finding-top strong {
  font-size: 1rem;
  letter-spacing: -0.03em;
}

.finding-top span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.05);
  color: var(--muted);
  font-size: 0.72rem;
  white-space: nowrap;
}

.finding[data-status="pass"] {
  border-color: rgba(33, 128, 67, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(33, 128, 67, 0.04));
}

.finding[data-status="warn"] {
  border-color: rgba(179, 106, 0, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(179, 106, 0, 0.04));
}

.finding[data-status="fail"] {
  border-color: rgba(196, 49, 40, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(196, 49, 40, 0.04));
}

.result[data-tone="good"] {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.93)),
    radial-gradient(circle at top right, rgba(33, 128, 67, 0.1), transparent 32%);
}

.result[data-tone="warn"] {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.93)),
    radial-gradient(circle at top right, rgba(179, 106, 0, 0.1), transparent 32%);
}

.result[data-tone="bad"] {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.93)),
    radial-gradient(circle at top right, rgba(196, 49, 40, 0.1), transparent 32%);
}

.result-next {
  margin-top: 2px;
  font-size: 0.9rem;
}

.chip-row {
  justify-content: flex-start;
}

:where(button, input):focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
}

@keyframes drop-fall {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(0) scale(0.9);
  }
  15% {
    opacity: 1;
  }
  72% {
    opacity: 1;
    transform: translateX(-50%) translateY(78px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(94px) scale(0.7);
  }
}

@keyframes ripple-out {
  0% {
    opacity: 0;
    transform: translateX(-50%) scale(0.7);
  }
  60% {
    opacity: 0.7;
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) scale(1.8);
  }
}

@media (hover: none) {
  body::before {
    display: none;
  }

  .button:hover,
  .ghost-button:hover,
  .finding:hover {
    transform: none;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 18px, 960px);
    padding-bottom: 48px;
  }

  .hero,
  .scan-screen,
  .result-screen {
    min-height: 100svh;
    padding: 24px 0 0;
  }

  .panel,
  .loading-view,
  .empty-view,
  .result,
  .stat,
  .finding {
    padding: 16px;
    border-radius: 28px;
  }

  .button,
  .ghost-button {
    width: 100%;
  }

  .secret-row,
  .stats,
  .findings,
  .form-actions {
    grid-template-columns: 1fr;
  }

  .form-actions,
  .result-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}

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

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