*,
*::before,
*::after { box-sizing: border-box; }

[hidden] { display: none !important; }

:root {
  --bg: #f3f4f6;
  --card: #ffffff;
  --ink: #1b1d22;
  --muted: #5c6570;
  --faint: #8b93a0;
  --line: #e6e8ee;
  --chip: #f3f4f6;
  --red: #d10f1a;
  --red-2: #b10d16;
  --red-text: #b00016;
  --soft: #fff1f2;
  --red-line: #ffc9ce;
  --board: #fff7f7;
  --grid: rgba(20, 22, 28, 0.05);
  --shadow: 0 18px 40px rgba(20, 22, 28, 0.06);
  --danger: #a4001a;
  --ok: #0b7a32;
  --overlay: rgba(16, 17, 20, 0.48);
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #101114;
  --card: #1b1e25;
  --ink: #f4f6f8;
  --muted: #c5cad3;
  --faint: #9aa3b2;
  --line: #2e3440;
  --chip: #262b34;
  --red: #e31824;
  --red-2: #ff3b46;
  --red-text: #ff8d93;
  --soft: #2a1618;
  --red-line: #6a3034;
  --board: #221416;
  --grid: rgba(255, 255, 255, 0.04);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --danger: #ffb4b8;
  --ok: #8ee0a8;
  --overlay: rgba(0, 0, 0, 0.62);
  color-scheme: dark;
}

html:not(.ready) body { visibility: hidden; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Hiragino Sans", "Yu Gothic UI", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--ink);
}

body.lock { overflow: hidden; }

h1, h2, h3, .wordmark, .num {
  font-family: "Space Grotesk", "Segoe UI", "PingFang SC", "Yu Gothic UI", "Microsoft YaHei", sans-serif;
}

h1, h2, h3 { line-height: 1.2; font-weight: 700; margin: 0; }

button, input { font: inherit; color: inherit; }

button { cursor: pointer; }

button:disabled { opacity: 0.6; cursor: not-allowed; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 16px;
  top: 8px;
  transform: translateY(-150%);
  background: var(--ink);
  color: var(--bg);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 80;
}

.skip:focus { transform: none; }

.wrap {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 64px;
  padding: env(safe-area-inset-top) 16px 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
}

.grow { flex: 1; }

.brand, .icon-btn, .text-btn {
  border: 0;
  background: transparent;
  min-height: 44px;
  border-radius: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 0 0;
  font-weight: 700;
  font-size: 18px;
}

.brand svg { width: 28px; height: 28px; flex: none; }

.icon-btn {
  width: 44px;
  display: grid;
  place-items: center;
  position: relative;
}

.icon-btn svg { width: 22px; height: 22px; }

body.is-in .burger::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--red);
  top: 8px;
  right: 8px;
}

.header-tools, .auth-desktop { display: flex; align-items: center; gap: 4px; }

.auth-desktop { display: none; }

.who {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 14px;
  padding: 0 8px;
}

.pop { position: relative; }

.menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 6px;
  box-shadow: var(--shadow);
  z-index: 30;
}

.menu button {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 0 12px;
  text-align: left;
}

.menu button:hover,
.menu button[aria-selected="true"],
.menu button[aria-checked="true"] { background: var(--chip); font-weight: 700; }

.drawer { position: fixed; inset: 0; z-index: 40; }

.scrim {
  position: absolute;
  inset: 0;
  border: 0;
  background: var(--overlay);
}

.sheet {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(86vw, 360px);
  background: var(--card);
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: auto;
}

.sheet-top { display: flex; justify-content: flex-end; }

.sheet [data-go],
.sheet [data-auth-open],
.sheet [data-logout] {
  width: 100%;
  min-height: 48px;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 12px;
  padding: 0 12px;
  font-weight: 700;
}

.check label { display: inline; margin: 0; font-weight: 600; }

.sheet [data-go]:hover,
.sheet [data-auth-open]:hover,
.sheet [data-logout]:hover { background: var(--chip); }

.sheet .who { max-width: none; padding: 12px; }

main { padding: 8px 0 64px; }

.hero {
  display: grid;
  background: var(--card);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.hero-copy, .hero-board {
  padding: 28px 22px 32px;
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
}

.hero-board { background-color: var(--board); }

.kicker {
  margin: 0 0 12px;
  color: var(--red-text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.name { display: block; font-size: clamp(40px, 7vw, 64px); letter-spacing: -0.03em; }

.sub { display: block; margin-top: 6px; font-size: clamp(26px, 4vw, 40px); letter-spacing: -0.03em; }

.lead { margin: 16px 0 0; color: var(--muted); max-width: 40em; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  font-weight: 700;
  background: var(--chip);
}

.btn-red { background: var(--red); color: #fff; }

.btn-red:hover { background: var(--red-2); }

.btn-soft:hover, .text-btn:hover, .icon-btn:hover, .brand:hover { background: var(--chip); }

.btn svg { width: 18px; height: 18px; }

.points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 14px;
}

.points span { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; }

.points svg { width: 16px; height: 16px; color: var(--red-text); }

.pill {
  margin-top: 18px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 80%, transparent);
  border-radius: 999px;
  min-height: 40px;
  padding: 0 14px;
  font-weight: 700;
}

.board-top, .steps, .card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pool-label { margin: 22px 0 0; color: var(--muted); font-size: 13px; }

.pool-num {
  margin: 0;
  color: var(--red);
  font-size: clamp(36px, 5vw, 52px);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.bar { height: 8px; background: color-mix(in srgb, var(--ink) 8%, transparent); border-radius: 99px; margin: 10px 0; }

.bar span { display: block; width: 72%; height: 100%; background: var(--red); border-radius: inherit; }

.ready { color: var(--ok); font-size: 13px; font-weight: 700; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }

.stats div, .mini {
  background: var(--card);
  border-radius: 16px;
  padding: 14px;
}

.stats span, .mini span, .statgrid span { display: block; color: var(--muted); font-size: 13px; }

.stats strong, .mini strong, .statgrid strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.steps { margin-top: 16px; color: var(--muted); font-size: 13px; font-weight: 700; }

.steps b { color: var(--red-text); }

section { margin-top: 28px; }

.svc-head {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.svc-head p, .intro p { margin: 0; color: var(--muted); }

.bento, .trio { display: grid; gap: 16px; }

.svc {
  position: relative;
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 0;
  border-radius: 24px;
  padding: 22px;
  box-shadow: var(--shadow);
  min-height: 180px;
}

.svc:hover { transform: translateY(-2px); }

.ico {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--chip);
  color: var(--red-text);
}

.ico svg { width: 20px; height: 20px; }

.idx { position: absolute; top: 18px; right: 18px; color: var(--faint); font-size: 13px; }

.svc h3 { margin: 48px 0 8px; font-size: 22px; }

.svc p { margin: 0; color: var(--muted); }

.more { display: inline-block; margin-top: 16px; color: var(--red-text); font-weight: 700; }

.panel {
  background: var(--card);
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.flow, .why { display: grid; }

.flow-intro, .why-intro, .flow article, .why article { padding: 22px; }

.flow-intro, .why-intro { background: color-mix(in srgb, var(--chip) 70%, var(--card)); }

.flow article + article, .why article + article { border-top: 1px solid var(--line); }

.flow h3, .why h3 { margin-top: 8px; }

.flow p, .why p { margin: 8px 0 0; color: var(--muted); }

.step-no { color: var(--red-text); font-weight: 700; }

.why-point { color: var(--ok); font-weight: 700; }

.banner {
  border-radius: 24px;
  padding: 48px 20px;
  text-align: center;
  background-color: var(--soft);
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
}

.banner p { color: var(--muted); }

.banner .btn { margin-top: 8px; }

.faq details {
  background: var(--card);
  border-radius: 16px;
  padding: 8px 16px;
  margin-top: 10px;
}

.faq summary {
  cursor: pointer;
  font-weight: 700;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.faq p { margin: 0 0 12px; color: var(--muted); }

.site-footer { padding: 28px 0 calc(28px + env(safe-area-inset-bottom)); }

.foot { display: grid; gap: 22px; }

.foot h2 { font-size: 14px; margin-bottom: 8px; }

.foot button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--muted);
  min-height: 36px;
  padding: 0;
  border-radius: 8px;
}

.foot button:hover { color: var(--ink); }

.brand-sub, .status, .copy { color: var(--muted); margin: 6px 0 0; }

.back { margin-bottom: 14px; }

.page-lead { color: var(--muted); max-width: 46em; }

.split, .stack { display: grid; gap: 16px; }

.card {
  background: var(--card);
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.statgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.statgrid div { background: var(--chip); border-radius: 14px; padding: 12px; }

.stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--chip);
  border-radius: 16px;
  padding: 6px;
  margin-top: 8px;
}

.stepper button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: var(--card);
  font-size: 22px;
}

.stepper input {
  width: 88px;
  border: 0;
  background: transparent;
  text-align: center;
  font-size: 32px;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
}

.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.quick button {
  min-width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: var(--chip);
  font-weight: 700;
}

.quick button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

label, .lbl { display: block; font-weight: 700; font-size: 14px; margin: 14px 0 6px; }

input[type="email"],
input[type="password"],
input[type="text"],
input[type="number"] {
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  padding: 0 14px;
  font-size: 16px;
}

.stepper input { min-height: 44px; width: 88px; padding: 0; }

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 14px;
  min-height: 44px;
}

.check input { width: 20px; height: 20px; margin-top: 3px; flex: none; }

.err { color: var(--danger); min-height: 1.25em; font-size: 14px; margin: 8px 0 0; }

.notice {
  border: 1px solid var(--red-line);
  background: var(--soft);
  border-radius: 16px;
  padding: 4px 16px 12px;
}

.notice h2 { font-size: 16px; color: var(--red-text); margin-top: 12px; }

.notice li { margin: 8px 0; }

.orders { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }

.orders li {
  background: var(--chip);
  border-radius: 14px;
  padding: 12px;
  display: grid;
  gap: 4px;
}

.orders li span { color: var(--muted); overflow-wrap: anywhere; }

.form-actions { margin-top: 16px; }

.keyline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.keyline code {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  background: var(--chip);
  border-radius: 12px;
  padding: 12px;
}

pre {
  white-space: pre-wrap;
  background: var(--chip);
  border-radius: 14px;
  padding: 14px;
  overflow-wrap: anywhere;
}

.result[data-ok="1"] { color: var(--ok); font-weight: 700; }

.result[data-ok="0"] { color: var(--danger); font-weight: 700; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--overlay);
}

.legal { z-index: 60; }

.dialog {
  width: min(440px, 100%);
  background: var(--card);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow);
  max-height: 92vh;
  overflow: auto;
}

.captcha { margin-top: 12px; }
.captcha-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.captcha .lbl { margin: 0; }
.captcha canvas {
  width: 100%;
  height: 148px;
  border-radius: 12px;
  display: block;
  touch-action: none;
  cursor: grab;
  background: var(--chip);
}
.captcha canvas:active { cursor: grabbing; }
.captcha-hint { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
#captchaStatus { margin: 6px 0 0; min-height: 1.2em; }

.dialog h2 { font-size: 24px; }

.dialog-top { display: flex; justify-content: space-between; gap: 12px; align-items: center; }

.link {
  border: 0;
  background: transparent;
  color: var(--red-text);
  font-weight: 700;
  min-height: 44px;
  padding: 0;
  cursor: pointer;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: min(92vw, 420px);
  background: var(--ink);
  color: var(--bg);
  padding: 12px 16px;
  border-radius: 999px;
  z-index: 70;
  text-align: center;
  opacity: 0;
  pointer-events: none;
}

.toast[data-show="1"] { opacity: 1; }

.noscript { padding: 24px; }

@media (min-width: 720px) {
  .auth-desktop { display: flex; }
  .stats { grid-template-columns: 1fr 1fr; }
  .statgrid.four { grid-template-columns: repeat(4, 1fr); }
  .statgrid.three { grid-template-columns: repeat(3, 1fr); }
  .foot { grid-template-columns: 1.4fr repeat(4, 1fr); }
}

@media (min-width: 900px) {
  .hero { grid-template-columns: 1.15fr 0.85fr; }
  .hero-copy, .hero-board { padding: 40px; }
  .svc-head { grid-template-columns: 0.8fr 1.2fr; align-items: end; gap: 24px; }
  .bento { grid-template-columns: 1.15fr 0.85fr; }
  .bento .wide { min-height: 320px; }
  .trio { grid-template-columns: repeat(3, 1fr); }
  .flow { grid-template-columns: 0.9fr 1fr 1fr 1fr; }
  .flow article + article, .why article + article { border-top: 0; border-left: 1px solid var(--line); }
  .why { grid-template-columns: 0.85fr 1.15fr; }
  .why-list { display: grid; }
  .split { grid-template-columns: 1.15fr 0.85fr; align-items: start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .svc:hover { transform: none; }
}
