:root {
  color-scheme: dark;
  --bg: #050812;
  --panel: rgba(255, 255, 255, 0.075);
  --panel-strong: rgba(255, 255, 255, 0.11);
  --line: rgba(255, 255, 255, 0.14);
  --text: #f6f8fc;
  --muted: #a8b3c7;
  --cyan: #5be7ff;
  --green: #83ffc3;
  --pink: #ff7fc5;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 8% 12%, rgba(91, 231, 255, 0.2), transparent 28rem),
    radial-gradient(circle at 82% 22%, rgba(131, 255, 195, 0.13), transparent 26rem),
    linear-gradient(135deg, #050812 0%, #08111f 48%, #070912 100%);
  color: var(--text);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.72), transparent 86%);
}

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

.ambient {
  position: fixed;
  z-index: -2;
  width: 36rem;
  height: 36rem;
  border-radius: 50%;
  filter: blur(36px);
  pointer-events: none;
}
.ambient-a { left: -16rem; top: 18rem; background: radial-gradient(circle, rgba(91, 231, 255, 0.28), transparent 62%); }
.ambient-b { right: -16rem; bottom: 2rem; background: radial-gradient(circle, rgba(131, 255, 195, 0.2), transparent 64%); }

.shell {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
}

.glass {
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 18% 0%, rgba(91, 231, 255, 0.08), transparent 34%),
    linear-gradient(145deg, var(--panel-strong), rgba(255, 255, 255, 0.045));
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1160px, calc(100% - 40px));
  margin: 18px auto 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(5, 8, 18, 0.76);
  backdrop-filter: blur(22px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(91, 231, 255, 0.54);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(91, 231, 255, 0.22), rgba(131, 255, 195, 0.14));
  font-size: 13px;
}

.nav-links {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  flex: 0 0 auto;
  padding: 10px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}
.nav-links a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: 44px;
  align-items: center;
  min-height: min(calc(100vh - 84px), 820px);
  padding: 74px 0 76px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1 {
  max-width: 760px;
  margin-bottom: 22px;
  font-size: clamp(44px, 7vw, 84px);
  line-height: 1.02;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}
h1 span { display: block; }
h2 { margin-bottom: 14px; font-size: clamp(30px, 4vw, 48px); line-height: 1.1; }
h3 { margin-bottom: 12px; font-size: 20px; }

.hero-subtitle {
  max-width: 690px;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.8;
}

.idea-card {
  display: grid;
  gap: 10px;
  max-width: 760px;
  margin-bottom: 18px;
  padding: 16px;
  border-radius: 24px;
}

.idea-card span, .option-group h3 {
  color: var(--text);
  font-size: 15px;
  font-weight: 850;
}

textarea {
  width: 100%;
  min-height: 132px;
  resize: vertical;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  outline: none;
  background: rgba(1, 6, 17, 0.62);
  color: var(--text);
  line-height: 1.65;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}
textarea:focus {
  border-color: rgba(91, 231, 255, 0.58);
  background: rgba(1, 6, 17, 0.8);
  box-shadow: 0 0 0 4px rgba(91, 231, 255, 0.1);
}
textarea::placeholder { color: rgba(168, 179, 199, 0.62); }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  cursor: pointer;
  overflow: hidden;
  font-weight: 850;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}
.button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transform: translateX(-120%);
  transition: transform 480ms ease;
}
.button:hover { transform: translateY(-2px); }
.button:hover::after { transform: translateX(120%); }
.button:active, .button.is-pressed { transform: translateY(1px) scale(0.98); }
.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--cyan), var(--green));
  color: #041018;
  box-shadow: 0 16px 42px rgba(91, 231, 255, 0.22);
}
.secondary { background: rgba(255, 255, 255, 0.08); color: var(--text); }

.code-panel {
  position: relative;
  min-width: 0;
  padding: 18px;
  border-radius: 28px;
  overflow: hidden;
}
.window-dots { display: flex; gap: 8px; margin-bottom: 16px; }
.window-dots span { width: 12px; height: 12px; border-radius: 50%; background: var(--pink); }
.window-dots span:nth-child(2) { background: #ffd166; }
.window-dots span:nth-child(3) { background: var(--green); }
.code-preview {
  min-height: 360px;
  margin: 0;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background: rgba(1, 6, 17, 0.78);
  color: #e2f2ff;
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
}
.code-dim { color: #8d9ab0; }
.code-accent { color: var(--green); }
.panel-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.panel-metrics span {
  min-height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.section { padding: 90px 0 0; scroll-margin-top: 110px; }
.section-heading { max-width: 760px; margin-bottom: 28px; }
.builder-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(380px, 1.05fr);
  gap: 18px;
  align-items: start;
}
.builder-panel, .result-panel { border-radius: 28px; padding: 22px; }
.option-group + .option-group { margin-top: 22px; }
.option-list { display: flex; flex-wrap: wrap; gap: 10px; }
.option-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 760;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease, transform 180ms ease;
}
.option-pill:hover {
  color: var(--text);
  border-color: rgba(91, 231, 255, 0.38);
  transform: translateY(-1px);
}
.option-pill input { position: absolute; opacity: 0; pointer-events: none; }
.option-pill:has(input:checked) {
  border-color: transparent;
  background: linear-gradient(135deg, var(--cyan), var(--green));
  color: #041018;
  box-shadow: 0 12px 28px rgba(91, 231, 255, 0.18);
}

.config-summary {
  display: grid;
  gap: 10px;
  margin-top: 22px;
  padding: 16px;
  border: 1px solid rgba(91, 231, 255, 0.16);
  border-radius: 20px;
  background: rgba(1, 6, 17, 0.4);
}
.summary-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 38px;
  padding: 9px 11px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
}
.summary-line span { flex: 0 0 auto; color: var(--muted); font-size: 13px; font-weight: 800; }
.summary-line strong { color: var(--text); font-size: 14px; text-align: right; }
.summary-features { align-items: flex-start; }

.result-panel { position: sticky; top: 106px; }
.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.result-head h2 { margin-bottom: 0; font-size: clamp(24px, 3vw, 36px); }
.copy-button { flex: 0 0 auto; }
.result-empty, .goal-output {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  background: rgba(1, 6, 17, 0.56);
}
.result-empty {
  min-height: 170px;
  display: grid;
  place-items: center;
  padding: 20px;
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
}
.result-panel.has-result .result-empty { display: none; }
.goal-output {
  display: none;
  max-height: 560px;
  margin: 0;
  padding: 18px;
  overflow: auto;
  color: #e2f2ff;
  font-size: 13px;
  line-height: 1.72;
  white-space: pre-wrap;
}
.result-panel.has-result .goal-output { display: block; }

.example-grid, .steps-grid { display: grid; gap: 16px; }
.example-grid { grid-template-columns: repeat(3, 1fr); }
.steps-grid { grid-template-columns: repeat(4, 1fr); }
.template-card, .step-card {
  border-radius: 24px;
  padding: 22px;
  text-align: left;
  color: var(--text);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}
.template-card { cursor: pointer; }
.template-card:hover, .step-card:hover {
  transform: translateY(-5px);
  border-color: rgba(91, 231, 255, 0.38);
  background: rgba(255, 255, 255, 0.1);
}
.template-card span, .step-card span {
  display: inline-flex;
  margin-bottom: 28px;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 900;
}
.template-card strong { display: block; margin-bottom: 10px; font-size: 20px; }
.template-card small, .step-card p { color: var(--muted); font-size: 15px; line-height: 1.7; }

.cta { padding: 96px 0 72px; }
.cta-inner {
  display: grid;
  justify-items: center;
  padding: 52px 28px;
  border-radius: 28px;
  text-align: center;
}
.cta-inner h2 { max-width: 760px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 40;
  padding: 11px 16px;
  border: 1px solid rgba(131, 255, 195, 0.36);
  border-radius: 999px;
  background: rgba(4, 18, 16, 0.86);
  color: #e8fff4;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.36);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 180ms ease, transform 180ms ease;
  font-size: 14px;
  font-weight: 850;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 680ms ease, transform 680ms ease;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 920px) {
  .site-header { align-items: flex-start; flex-direction: column; gap: 12px; }
  .nav-links { width: 100%; }
  .hero, .builder-grid { grid-template-columns: 1fr; }
  .hero { min-height: auto; padding-top: 62px; }
  .result-panel { position: static; }
  .example-grid, .steps-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  .shell, .site-header { width: min(100% - 24px, 1160px); }
  .site-header { margin-top: 12px; border-radius: 16px; }
  .brand { font-size: 15px; }
  h1 { font-size: 42px; line-height: 1.12; }
  .hero { gap: 28px; padding: 48px 0 56px; }
  .hero-actions, .button { width: 100%; }
  .code-preview { min-height: 280px; padding: 16px; font-size: 12px; }
  .builder-panel, .result-panel, .idea-card, .code-panel { border-radius: 22px; }
  .builder-panel, .result-panel { padding: 16px; }
  .result-head { align-items: stretch; flex-direction: column; }
  .example-grid, .steps-grid, .panel-metrics { grid-template-columns: 1fr; }
  .section { padding-top: 70px; }
  .toast { width: calc(100% - 32px); text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
