:root {
  --bg: #f6efe2;
  --ink: #17202b;
  --muted: #5b6570;
  --paper: rgba(255, 251, 243, 0.82);
  --paper-strong: rgba(255, 250, 240, 0.96);
  --accent: #c7561a;
  --accent-2: #113a5d;
  --line: rgba(23, 32, 43, 0.1);
  --shadow: 0 24px 64px rgba(17, 34, 51, 0.12);
  --radius: 28px;
  --font-sans: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", "Fira Code", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(199, 86, 26, 0.2), transparent 22rem),
    radial-gradient(circle at bottom left, rgba(17, 58, 93, 0.14), transparent 24rem),
    linear-gradient(180deg, #fbf6ea 0%, #efe5d4 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(23, 32, 43, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 32, 43, 0.025) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 85%);
}

.page-shell {
  width: min(1100px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.hero {
  padding: 28px;
  border: 1px solid rgba(23, 32, 43, 0.08);
  border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(145deg, rgba(255, 251, 243, 0.96), rgba(255, 244, 224, 0.84));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.eyebrow,
.card-label,
.metric-label {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-size: 0.76rem;
}

.hero h1 {
  margin: 14px 0 12px;
  font-size: clamp(2.5rem, 6vw, 4.7rem);
  line-height: 0.95;
  max-width: 12ch;
}

.hero-copy {
  max-width: 50rem;
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.75;
}

.hero-copy code,
.mono,
code {
  font-family: var(--font-mono);
  font-size: 0.95em;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.primary {
  color: #fff9f3;
  background: linear-gradient(135deg, #c7561a, #ed7f30);
  box-shadow: 0 16px 32px rgba(199, 86, 26, 0.28);
}

.secondary,
.tertiary {
  color: var(--accent-2);
  border: 1px solid rgba(17, 58, 93, 0.15);
  background: rgba(255, 255, 255, 0.58);
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.status-card,
.qr-card {
  grid-column: span 2;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.metric-value {
  margin-top: 8px;
  font-size: 1.15rem;
  font-weight: 700;
}

.checksum {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.checksum code {
  display: block;
  margin-top: 10px;
  padding: 12px 14px;
  overflow-x: auto;
  border-radius: 16px;
  background: rgba(17, 58, 93, 0.06);
}

.qr-panel {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  margin-top: 18px;
}

.qr-image {
  width: 220px;
  height: 220px;
  padding: 16px;
  border-radius: 26px;
  background: var(--paper-strong);
  border: 1px solid var(--line);
}

.qr-copy h2 {
  margin: 0 0 10px;
  font-size: 1.55rem;
}

.qr-copy p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.72;
}

.steps,
.notes {
  margin: 18px 0 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.8;
}

.steps li + li,
.notes li + li {
  margin-top: 10px;
}

.builder-copy {
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.75;
}

.bind-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.bind-form label {
  display: grid;
  gap: 8px;
}

.bind-form span {
  font-size: 0.9rem;
  font-weight: 700;
}

.bind-form input,
.bind-link {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(23, 32, 43, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
  font: inherit;
}

.bind-form input:focus,
.bind-link:focus {
  outline: 2px solid rgba(199, 86, 26, 0.26);
  outline-offset: 2px;
}

.full-span {
  grid-column: 1 / -1;
}

.builder-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.bind-output {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
  margin-top: 22px;
}

.bind-qr-panel,
.bind-link-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.44);
}

#bind-qr {
  width: 100%;
  height: auto;
  border-radius: 18px;
  background: white;
}

.bind-hint {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.bind-meta,
.bind-status {
  margin-top: 12px;
  color: var(--ink);
  line-height: 1.6;
}

.bind-status {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(17, 58, 93, 0.06);
  font-weight: 700;
}

.bind-link {
  min-height: 112px;
  margin-top: 10px;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

.notes.compact {
  margin-top: 10px;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  animation: rise 500ms ease forwards;
}

.reveal:nth-of-type(2) {
  animation-delay: 80ms;
}

.reveal:nth-of-type(3) {
  animation-delay: 140ms;
}

.reveal:nth-of-type(4) {
  animation-delay: 200ms;
}

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 860px) {
  .content-grid,
  .status-grid,
  .qr-panel,
  .bind-form,
  .bind-output {
    grid-template-columns: 1fr;
  }

  .status-card,
  .qr-card {
    grid-column: span 1;
  }

  .qr-image {
    width: min(100%, 260px);
    height: auto;
  }
}

@media (max-width: 600px) {
  .page-shell {
    width: min(100vw - 20px, 100%);
    padding-top: 14px;
  }

  .hero,
  .card {
    padding: 18px;
  }

  .hero-copy {
    font-size: 0.98rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .builder-actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }
}
