:root {
  --bg: #f4efe6;
  --bg-2: #eaf2ec;
  --surface: rgba(255, 252, 246, 0.9);
  --surface-strong: #fffdf8;
  --text: #18211d;
  --muted: #56635d;
  --line: rgba(24, 33, 29, 0.12);
  --accent: #1d6b57;
  --accent-strong: #134a3c;
  --warm: #d28d39;
  --shadow: 0 18px 50px rgba(34, 48, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Outfit", "Noto Sans SC", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(210, 141, 57, 0.2), transparent 26%),
    radial-gradient(circle at top right, rgba(29, 107, 87, 0.18), transparent 24%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

a {
  color: inherit;
}

[data-page-lang="en"] [data-copy-lang="zh"],
[data-page-lang="zh"] [data-copy-lang="en"] {
  display: none !important;
}

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

.hero,
.section,
.footer {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.8fr);
  gap: 24px;
  padding: 24px;
  border-radius: 28px;
}

.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
}

.lang-switch {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.lang-option {
  min-width: 58px;
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.lang-option.is-active {
  background: var(--accent);
  color: #fff;
}

.hero-main {
  padding: 8px 4px 4px 0;
}

.eyebrow,
.section-kicker,
.card-label {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-main h1,
.intro h2 {
  margin: 0 0 16px;
  line-height: 1;
}

.hero-main h1 {
  max-width: 10ch;
  font-size: clamp(3rem, 7vw, 5.6rem);
  font-weight: 800;
}

.lede,
.simple-card p,
.audience-card p,
.start-card p,
.example-card p,
.faq p,
.footer p {
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.7;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 28px 0 24px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  text-decoration: none;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.button.primary {
  background: var(--accent);
  color: #fff;
}

.button.secondary {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
}

.quick-points {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 10px;
  color: var(--muted);
}

.hero-panel {
  display: grid;
  gap: 16px;
  align-self: stretch;
}

.info-card,
.simple-card,
.audience-card,
.start-card,
.example-card,
.faq article {
  padding: 20px;
  border-radius: 22px;
  border: 1px solid rgba(24, 33, 29, 0.08);
  background: var(--surface-strong);
}

.info-card strong {
  display: block;
  font-size: 1.04rem;
  line-height: 1.5;
}

.section {
  margin-top: 22px;
  padding: 28px;
  border-radius: 26px;
}

.intro h2 {
  max-width: 18ch;
  font-size: clamp(2rem, 4vw, 3.1rem);
}

.simple-grid,
.audience-grid,
.start-grid,
.example-grid {
  display: grid;
  gap: 18px;
}

.simple-grid,
.audience-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.start-grid {
  grid-template-columns: 1.2fr 1fr 1fr;
}

.example-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.simple-card h3,
.audience-card h3,
.start-card h3,
.example-card h3,
.faq h3 {
  margin: 0 0 10px;
  font-size: 1.18rem;
}

.demo-shell {
  display: grid;
  gap: 18px;
}

.demo-trust-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.demo-trust-pill,
.demo-subtle {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(24, 33, 29, 0.08);
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.demo-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
  border-radius: 24px;
  border: 1px solid rgba(24, 33, 29, 0.08);
  background:
    radial-gradient(circle at top right, rgba(210, 141, 57, 0.18), transparent 30%),
    linear-gradient(135deg, rgba(29, 107, 87, 0.12), rgba(255, 253, 248, 1));
}

.demo-title {
  margin: 0 0 10px;
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  line-height: 1.1;
}

.demo-copy {
  margin: 0;
  max-width: 58ch;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.7;
}

.demo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.demo-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.demo-tab {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(24, 33, 29, 0.12);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}

.demo-tab:hover,
.demo-tab.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-1px);
}

.demo-stage {
  display: grid;
  gap: 18px;
}

.demo-playground {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
  gap: 18px;
  align-items: start;
}

.demo-prompt,
.demo-card,
.demo-output-card {
  padding: 20px;
  border-radius: 22px;
  border: 1px solid rgba(24, 33, 29, 0.08);
  background: var(--surface-strong);
}

.demo-prompt {
  background:
    linear-gradient(180deg, rgba(210, 141, 57, 0.08), rgba(255, 253, 248, 1));
}

.demo-label {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.demo-prompt p:last-child,
.demo-console p:last-child {
  margin-bottom: 0;
}

.demo-brief {
  display: grid;
  gap: 18px;
}

.demo-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.demo-status {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(29, 107, 87, 0.1);
  color: var(--accent-strong);
  font-size: 0.84rem;
  font-weight: 800;
}

.demo-status.is-running {
  background: rgba(210, 141, 57, 0.18);
  color: #9a620f;
}

.demo-status.is-done {
  background: rgba(29, 107, 87, 0.14);
  color: var(--accent-strong);
}

.demo-source-list {
  display: grid;
  gap: 12px;
}

.demo-context-grid {
  display: grid;
  gap: 12px;
}

.demo-context-card,
.demo-source-card,
.demo-output-block {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(24, 33, 29, 0.08);
  background: rgba(255, 255, 255, 0.82);
}

.demo-context-card strong,
.demo-source-card strong {
  display: block;
  margin-bottom: 8px;
  line-height: 1.45;
}

.demo-context-card p,
.demo-source-card p,
.demo-output-block p {
  margin: 0;
  line-height: 1.65;
}

.demo-context-card p + p,
.demo-source-card p + p,
.demo-output-block p + p {
  margin-top: 8px;
}

.demo-context-label,
.demo-output-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.demo-output-block {
  background: rgba(255, 255, 255, 0.68);
}

.demo-source-card {
  background:
    linear-gradient(180deg, rgba(29, 107, 87, 0.05), rgba(255, 255, 255, 0.9));
}

.demo-context-card {
  background:
    linear-gradient(180deg, rgba(210, 141, 57, 0.08), rgba(255, 255, 255, 0.92));
}

.demo-source-list .demo-chip {
  margin: 0;
}

.demo-source-list,
.demo-context-grid,
.demo-console {
  gap: 10px;
}

.demo-chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: #edf4f0;
  border: 1px solid rgba(24, 33, 29, 0.08);
  color: var(--text);
  font-weight: 600;
}

.demo-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.demo-run-button,
.demo-reset-button {
  min-height: 42px;
  padding: 0 14px;
}

.demo-run-button:disabled,
.demo-reset-button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.demo-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.demo-console {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  background: #edf4f0;
  border: 1px solid rgba(24, 33, 29, 0.08);
}

.demo-console p {
  margin: 0;
  color: var(--text);
  line-height: 1.7;
}

.demo-output-card {
  min-height: 100%;
  background:
    radial-gradient(circle at top right, rgba(210, 141, 57, 0.16), transparent 30%),
    linear-gradient(180deg, rgba(29, 107, 87, 0.05), rgba(255, 253, 248, 1));
}

.demo-output-title {
  margin: 0;
  font-size: 1.22rem;
  line-height: 1.35;
}

.demo-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(24, 33, 29, 0.08);
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  transition: transform 0.18s, border-color 0.18s, background 0.18s, color 0.18s;
}

.demo-step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(24, 33, 29, 0.08);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 800;
}

.demo-step[data-step-state="active"] {
  transform: translateY(-2px);
  border-color: rgba(210, 141, 57, 0.5);
  background: rgba(210, 141, 57, 0.12);
  color: var(--text);
}

.demo-step[data-step-state="active"] .demo-step-index {
  background: var(--warm);
  color: #fff;
}

.demo-step[data-step-state="done"] {
  border-color: rgba(29, 107, 87, 0.2);
  background: rgba(29, 107, 87, 0.08);
  color: var(--text);
}

.demo-step[data-step-state="done"] .demo-step-index {
  background: var(--accent);
  color: #fff;
}

.demo-placeholder {
  color: var(--muted);
}

.featured {
  background:
    linear-gradient(180deg, rgba(29, 107, 87, 0.08), rgba(255, 253, 248, 1));
}

.text-link,
.footer a {
  color: var(--accent);
  font-weight: 700;
}

.code-block {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #edf4f0;
}

.code-block code {
  display: block;
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.93rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding: 5px 9px;
  border: 1px solid rgba(24, 33, 29, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.copy-btn:hover,
.copy-btn.is-copied {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.faq {
  display: grid;
  gap: 16px;
}

.footer {
  margin-top: 22px;
  padding: 18px 24px;
  border-radius: 22px;
}

@media (max-width: 960px) {
  .hero,
  .simple-grid,
  .audience-grid,
  .start-grid,
  .demo-playground,
  .example-grid {
    grid-template-columns: 1fr;
  }

  .demo-header {
    display: grid;
  }

  .hero-main h1,
  .intro h2 {
    max-width: none;
  }
}

/* ── Demo enhancements ──────────────────────────────── */

/* Progress bar */
.demo-progress-wrap {
  height: 3px;
  border-radius: 999px;
  background: rgba(24, 33, 29, 0.08);
  overflow: hidden;
  margin-bottom: 16px;
}

.demo-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--warm));
  border-radius: 999px;
  transition: width 0.45s ease;
}

/* Typing cursor */
@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.typing-cursor {
  display: inline-block;
  width: 2px;
  height: 0.88em;
  background: var(--accent);
  vertical-align: text-bottom;
  margin-left: 1px;
  animation: cursor-blink 0.7s step-end infinite;
}

/* Result card slide-in */
@keyframes result-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0);    }
}

.demo-output-block {
  animation: result-in 0.35s ease both;
}

/* Step timing badge */
.demo-step-timing {
  margin-left: auto;
  align-self: center;
  font-size: 0.74rem;
  color: var(--accent);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transition: opacity 0.3s 0.1s;
}

.demo-step[data-step-state="done"] .demo-step-timing {
  opacity: 1;
}

/* Section scroll entrance */
@keyframes section-fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0);    }
}

.section.is-offscreen {
  opacity: 0;
}

.section.is-visible {
  animation: section-fade-up 0.5s ease both;
}

/* Action item checklist */
.demo-checklist {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.demo-checklist-item {
  display: flex;
  gap: 8px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.demo-check {
  flex-shrink: 0;
  margin-top: 2px;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: rgba(29, 107, 87, 0.12);
  border: 1.5px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.demo-check svg {
  display: block;
  width: 10px;
  height: 10px;
  color: var(--accent);
}

/* Formatted email card */
.demo-email-card {
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(24, 33, 29, 0.1);
  background: rgba(255, 255, 255, 0.9);
  font-size: 0.88rem;
}

.demo-email-header {
  display: grid;
  gap: 3px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.demo-email-row {
  display: flex;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.demo-email-row strong {
  color: var(--text);
  min-width: 52px;
}

.demo-email-body {
  line-height: 1.65;
  color: var(--text);
  margin: 0;
}

/* Comparison table */
.demo-table-wrap {
  overflow-x: auto;
  margin-top: 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.demo-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}

.demo-compare-table th,
.demo-compare-table td {
  padding: 7px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(24, 33, 29, 0.07);
  line-height: 1.4;
}

.demo-compare-table th {
  background: rgba(29, 107, 87, 0.07);
  color: var(--accent-strong);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.demo-compare-table tr:last-child td {
  border-bottom: 0;
}

.demo-compare-table td:first-child {
  font-weight: 600;
  color: var(--text);
}

.demo-win { color: var(--accent-strong); font-weight: 700; }
.demo-gap { color: #9a620f; font-weight: 700; }

/* Slide outline */
.demo-slide-outline {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 5px;
}

.demo-slide-outline li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: 0.9rem;
  line-height: 1.4;
}

.demo-slide-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(29, 107, 87, 0.12);
  color: var(--accent-strong);
  font-size: 0.75rem;
  font-weight: 800;
}

/* ── Responsive ──────────────────────────────────────── */

@media (max-width: 680px) {
  .page-shell {
    width: min(100% - 20px, 1120px);
    padding-top: 10px;
  }

  .hero,
  .section {
    padding: 20px;
    border-radius: 22px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-links {
    gap: 12px;
  }

  .hero-main h1 {
    font-size: clamp(2.4rem, 15vw, 4rem);
  }

  .code-block {
    align-items: flex-start;
    flex-direction: column;
  }

  .demo-heading-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .demo-actions {
    justify-content: flex-start;
  }
}
