:root {
  --bg: #0a1020;
  --bg-soft: #10192d;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-strong: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.1);
  --text: #f6f1e7;
  --muted: #aebbd0;
  --accent: #f4bf62;
  --accent-soft: rgba(244, 191, 98, 0.16);
  --radius-lg: 28px;
  --radius-md: 20px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  --content: min(1120px, calc(100vw - clamp(24px, 4vw, 56px)));
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 18% 8%, rgba(244, 191, 98, 0.18), transparent 24%),
    radial-gradient(circle at 82% 18%, rgba(108, 155, 255, 0.11), transparent 24%),
    linear-gradient(180deg, #0b1020 0%, #0d1528 42%, #0a1020 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.68), transparent 92%);
}

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

code,
pre,
.brand,
.metric-label,
.section-label,
.panel-kicker,
.eyebrow {
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
}

.progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 30;
  height: 3px;
  background: rgba(255, 255, 255, 0.04);
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #ffe2a8, var(--accent));
}

.site-header,
.hero,
.section {
  width: var(--content);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 12px;
  z-index: 20;
  margin-top: 12px;
  padding: 12px 16px;
  min-height: 64px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px 20px;
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03)),
    linear-gradient(135deg, rgba(22, 31, 54, 0.78), rgba(10, 16, 32, 0.68));
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px) saturate(145%);
  -webkit-backdrop-filter: blur(20px) saturate(145%);
  box-shadow:
    0 14px 30px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -1px 0 rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 16% 20%, rgba(255, 255, 255, 0.16), transparent 22%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 48%);
  opacity: 0.62;
}

.site-header::after {
  content: "";
  position: absolute;
  inset: 1px;
  pointer-events: none;
  border-radius: inherit;
  background:
    radial-gradient(circle at 86% 24%, rgba(244, 191, 98, 0.08), transparent 16%),
    radial-gradient(circle at 18% 88%, rgba(108, 155, 255, 0.05), transparent 16%);
  opacity: 0.72;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 6px;
  font-size: 1.04rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  white-space: nowrap;
  position: relative;
  z-index: 1;
}

.site-nav {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-width: 0;
  flex-wrap: wrap;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--muted);
  white-space: nowrap;
  border: 1px solid transparent;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.08);
}

.hero {
  min-height: calc(100svh - 24px);
  padding: 92px 0 72px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 40px;
  align-items: center;
  position: relative;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 6% 24% auto -8%;
  height: 320px;
  background: radial-gradient(circle, rgba(244, 191, 98, 0.14), transparent 70%);
  filter: blur(18px);
  pointer-events: none;
  z-index: -1;
}

.eyebrow,
.section-label,
.panel-kicker,
.metric-label {
  margin: 0;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.hero h1 {
  margin: 14px 0 0;
  max-width: 11ch;
  font-size: clamp(3.8rem, 10vw, 7.2rem);
  line-height: 0.92;
  letter-spacing: -0.07em;
  text-wrap: balance;
}

.hero-line {
  display: block;
}

.hero-line-accent {
  color: var(--accent);
  text-shadow: 0 0 28px rgba(244, 191, 98, 0.18);
}

.hero-lead {
  margin: 24px 0 0;
  max-width: 18ch;
  font-size: clamp(1.4rem, 3.2vw, 2.2rem);
  line-height: 1.2;
  font-weight: 700;
}

.hero-body,
.section-intro,
.rule-list p,
.scene-list p,
.faq-list p,
.sample-note,
.budget-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.85;
}

.hero-body {
  max-width: 38rem;
  margin-top: 18px;
  font-size: 1.02rem;
}

.hero-note {
  margin: 20px 0 0;
  padding-left: 16px;
  max-width: 34rem;
  border-left: 3px solid rgba(244, 191, 98, 0.7);
  color: #dde6f3;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

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

.button-primary {
  color: #191208;
  background: linear-gradient(135deg, var(--accent), #d99121);
  box-shadow: 0 16px 32px rgba(217, 145, 33, 0.22);
}

.button-secondary {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.hero-tags span,
.piece,
.example-button,
.preset-button {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.hero-tags span {
  padding: 10px 14px;
  color: var(--muted);
  backdrop-filter: blur(12px);
}

.hero-stage {
  position: relative;
  min-height: 420px;
  border-radius: 50%;
  isolation: isolate;
}

.stage-ring {
  position: absolute;
  inset: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stage-ring-outer {
  width: 360px;
  height: 360px;
  box-shadow:
    inset 0 0 40px rgba(255, 255, 255, 0.03),
    0 0 80px rgba(244, 191, 98, 0.08);
}

.stage-ring-inner {
  width: 250px;
  height: 250px;
  border-color: rgba(244, 191, 98, 0.18);
}

.stage-core {
  position: absolute;
  inset: 50%;
  width: 170px;
  height: 170px;
  margin: -85px 0 0 -85px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244, 191, 98, 0.24), rgba(244, 191, 98, 0.06));
  border: 1px solid rgba(244, 191, 98, 0.25);
  box-shadow:
    0 0 90px rgba(244, 191, 98, 0.16),
    inset 0 0 30px rgba(255, 255, 255, 0.06);
  font-size: 2rem;
  font-weight: 800;
  z-index: 2;
}

.stage-piece {
  position: absolute;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: #d7e1ef;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  animation: float 7s ease-in-out infinite;
  z-index: 3;
}

.stage-piece-a { top: 6%; left: 45%; }
.stage-piece-b { top: 28%; left: 8%; animation-delay: 0.7s; }
.stage-piece-c { top: 27%; right: 4%; animation-delay: 1.4s; }
.stage-piece-d { bottom: 21%; left: 10%; animation-delay: 2.1s; }
.stage-piece-e { bottom: 10%; right: 16%; animation-delay: 2.8s; }
.stage-piece-f { top: 70%; left: 43%; animation-delay: 3.5s; }

.section {
  padding: 84px 0;
}

.section-head {
  max-width: 760px;
}

.section-head h2 {
  margin: 14px 0 0;
  font-size: clamp(1.9rem, 4vw, 3.1rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.section-intro {
  margin-top: 16px;
}

.rule-list,
.scene-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-top: 34px;
}

.rule-list article,
.scene-list article {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.rule-list h3,
.scene-list h3,
.panel-head h3 {
  margin: 0 0 10px;
  font-size: 1.15rem;
}

.interactive-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: 24px;
  margin-top: 34px;
}

.panel {
  padding: 24px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03)),
    rgba(16, 25, 45, 0.72);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.panel-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.quiz-list {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.quiz-item {
  padding: 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.quiz-item p {
  margin: 0;
  line-height: 1.75;
}

.quiz-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.quiz-button {
  min-width: 72px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
}

.quiz-button.is-selected {
  color: #181209;
  background: linear-gradient(135deg, var(--accent), #d99121);
  border-color: transparent;
}

.quiz-result {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  line-height: 1.75;
}

.quiz-result.is-correct {
  background: rgba(96, 182, 110, 0.14);
  color: #d2f0d8;
}

.quiz-result.is-wrong {
  background: rgba(255, 129, 97, 0.14);
  color: #ffd8cf;
}

.example-nav,
.preset-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.example-nav {
  margin-top: 18px;
}

.example-button,
.preset-button {
  padding: 10px 14px;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
}

.example-button {
  background: transparent;
}

.example-button.is-active,
.preset-button:hover,
.preset-button:focus-visible {
  color: #181209;
  background: linear-gradient(135deg, var(--accent), #d99121);
  border-color: transparent;
}

.demo-text,
.piece-area,
.budget-input-wrap {
  display: grid;
  gap: 10px;
}

.demo-text {
  margin-top: 20px;
}

#sample-text,
#budget-input {
  width: 100%;
  margin: 0;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  line-height: 1.8;
}

#sample-text {
  min-height: 92px;
  white-space: pre-wrap;
  word-break: break-word;
}

#budget-input {
  resize: vertical;
}

.demo-metrics,
.budget-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.demo-metrics div,
.budget-metrics div,
.budget-band {
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.demo-metrics strong,
.budget-metrics strong,
.budget-band strong {
  display: block;
  margin-top: 8px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
}

.token-pieces {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.piece {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  animation: rise 0.35s ease both;
}

.piece-index {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 0.75rem;
  font-family: "Space Grotesk", sans-serif;
}

.piece-han { background: rgba(244, 191, 98, 0.12); }
.piece-ascii { background: rgba(108, 155, 255, 0.12); }
.piece-symbol { background: rgba(255, 129, 97, 0.12); }
.piece-mixed { background: rgba(163, 131, 255, 0.12); }

.sample-note {
  margin-top: 16px;
}

.budget-panel {
  margin-top: 24px;
}

.budget-input-wrap {
  margin-top: 18px;
}

.budget-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.band-label {
  color: var(--muted);
}

.faq-list {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.faq-list details {
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.faq-list summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list p {
  margin-top: 12px;
}

.footer {
  padding-bottom: 92px;
}

.source-list {
  display: grid;
  gap: 14px;
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
}

.source-list li {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.source-list a::after {
  content: " ->";
  color: var(--accent);
}

@media (max-width: 1180px) {
  .site-header {
    top: 10px;
    margin-top: 10px;
    padding: 11px 14px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 32px;
  }
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

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

@media (max-width: 1040px) {
  .hero,
  .interactive-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 82px;
    gap: 28px;
  }

  .hero-stage {
    min-height: 320px;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
  }

  .rule-list,
  .scene-list,
  .demo-metrics,
  .budget-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stage-ring-outer {
    width: 300px;
    height: 300px;
  }

  .stage-ring-inner {
    width: 210px;
    height: 210px;
  }
}

@media (max-width: 820px) {
  :root {
    --content: calc(100vw - 24px);
  }

  .site-header {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 8px;
    padding: 10px 12px;
    min-height: 58px;
    border-radius: 20px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025)),
      linear-gradient(135deg, rgba(20, 30, 52, 0.82), rgba(10, 16, 32, 0.76));
  }

  .site-nav {
    justify-content: flex-start;
    width: 100%;
    gap: 6px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .button {
    width: 100%;
  }

  .panel,
  .budget-band {
    padding: 20px;
  }

  .hero h1 {
    max-width: 9ch;
    font-size: clamp(3.2rem, 13vw, 5rem);
  }

  .hero-lead,
  .hero-body,
  .hero-note {
    max-width: none;
  }

  .stage-core {
    width: 140px;
    height: 140px;
    margin: -70px 0 0 -70px;
  }

  .stage-piece {
    font-size: 0.95rem;
  }
}

@media (max-width: 640px) {
  .site-header {
    top: 8px;
    margin-top: 8px;
    padding: 8px 10px;
    min-height: 52px;
    border-radius: 18px;
    backdrop-filter: blur(18px) saturate(135%);
    -webkit-backdrop-filter: blur(18px) saturate(135%);
  }

  .site-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .site-nav a {
    min-height: 34px;
    padding: 7px 11px;
    font-size: 0.9rem;
  }

  .rule-list,
  .scene-list,
  .demo-metrics,
  .budget-metrics {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 76px;
  }

  .hero-stage {
    min-height: 280px;
  }

  .stage-ring-outer {
    width: 250px;
    height: 250px;
  }

  .stage-ring-inner {
    width: 180px;
    height: 180px;
  }

  .stage-piece {
    padding: 8px 12px;
  }

  .stage-piece-a { top: 2%; left: 41%; }
  .stage-piece-b { top: 26%; left: 0; }
  .stage-piece-c { top: 24%; right: -2%; }
  .stage-piece-d { bottom: 18%; left: 2%; }
  .stage-piece-e { bottom: 8%; right: 6%; }
  .stage-piece-f { top: 72%; left: 39%; }
}

@media (max-width: 420px) {
  .site-header,
  .hero,
  .section {
    width: calc(100vw - 20px);
  }

  .site-header {
    top: 6px;
    margin-top: 6px;
    padding: 7px 9px;
    min-height: 48px;
    border-radius: 16px;
  }

  .brand {
    min-height: 34px;
    font-size: 0.94rem;
    letter-spacing: 0.06em;
  }

  .panel {
    padding: 18px;
  }

  .site-nav a {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 0.88rem;
  }

  .hero-tags {
    gap: 8px;
  }

  .hero-tags span {
    padding: 9px 12px;
    font-size: 0.92rem;
  }
}
