:root {
  --bg: #eef2f7;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #667085;
  --line: #d9e0ea;
  --accent: #1368d8;
  --accent-strong: #0f55b4;
  --danger: #b42318;
  --soft: #f6f8fb;
  --shadow: 0 14px 38px rgba(23, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Noto Sans TC", sans-serif;
}

.landing-page {
  background: #f8fafc;
  scroll-behavior: smooth;
}

.landing-nav {
  align-items: center;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 14px 28px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand,
.landing-nav nav,
.hero-actions {
  align-items: center;
  display: flex;
}

.brand {
  color: var(--ink);
  display: grid;
  font-size: 22px;
  font-weight: 800;
  gap: 2px;
  line-height: 1;
  text-decoration: none;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.landing-nav nav {
  gap: 10px;
}

.landing-nav nav a,
.primary-link,
.secondary-link {
  align-items: center;
  border-radius: 6px;
  color: var(--ink);
  display: inline-flex;
  font-weight: 800;
  min-height: 38px;
  padding: 0 13px;
  text-decoration: none;
}

.landing-nav nav a:hover,
.secondary-link:hover {
  background: #eef2f7;
}

.landing-nav .nav-action,
.primary-link {
  background: var(--accent);
  color: #fff;
}

.landing-nav .nav-action:hover,
.primary-link:hover {
  background: var(--accent-strong);
}

.landing-hero {
  align-items: center;
  display: grid;
  gap: 26px;
  grid-template-columns: minmax(360px, 0.82fr) minmax(0, 1.18fr);
  min-height: calc(100vh - 67px);
  padding: 28px;
  scroll-margin-top: 67px;
}

.hero-copy {
  align-self: center;
  max-width: 640px;
}

.eyebrow {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  margin-bottom: 10px;
}

.hero-copy h1 {
  font-size: 56px;
  line-height: 1.02;
  max-width: 720px;
}

.hero-lede {
  color: var(--muted);
  font-size: 20px;
  line-height: 1.55;
  margin-top: 18px;
}

.agent-lede {
  background: #eaf2ff;
  border-left: 4px solid var(--accent);
  color: #12335f;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.55;
  margin-top: 14px;
  padding: 11px 14px;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.primary-link,
.secondary-link {
  min-height: 44px;
  padding: 0 18px;
}

.secondary-link {
  background: #fff;
  border: 1px solid var(--line);
}

.hero-demo,
.demo-frame {
  background: #0b1020;
  border: 1px solid #243044;
  box-shadow: var(--shadow);
  min-width: 0;
  overflow: hidden;
}

.hero-demo {
  align-items: center;
  align-self: stretch;
  display: flex;
  justify-content: center;
  max-height: calc(100vh - 130px);
  min-height: 0;
  position: relative;
}

.hero-demo img,
.hero-demo iframe {
  align-self: center;
  border: 0;
  display: block;
  height: 100%;
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  justify-self: center;
  min-height: 0;
  width: 100%;
}

.hero-demo iframe {
  pointer-events: none;
}

.hero-demo-caption {
  background: #000;
  border: 2px solid #fff;
  bottom: 28px;
  color: #fff;
  display: grid;
  gap: 4px;
  max-width: 300px;
  padding: 13px 15px;
  position: absolute;
  right: 28px;
  width: min(300px, 32%);
}

.hero-demo-caption strong {
  color: #ffea00;
  font-size: 14px;
}

.hero-demo-caption span {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.35;
}

.demo-frame iframe {
  border: 0;
  display: block;
  height: 100%;
  width: 100%;
}

.back-top {
  align-items: center;
  background: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  bottom: 22px;
  box-shadow: 0 12px 30px rgba(23, 32, 51, 0.22);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-weight: 900;
  justify-content: center;
  min-height: 44px;
  opacity: 0;
  padding: 0 16px;
  pointer-events: none;
  position: fixed;
  right: 22px;
  transform: translateY(10px);
  transition:
    opacity 160ms ease,
    transform 160ms ease,
    background 160ms ease;
  z-index: 20;
}

.back-top:hover {
  background: var(--accent);
}

.back-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.feature-band,
.demo-section {
  min-height: calc(100vh - 67px);
  padding: 28px;
  scroll-margin-top: 67px;
}

.feature-band {
  align-items: center;
  background: #fff;
  border-block: 1px solid var(--line);
  display: flex;
}

.feature-wrap {
  display: grid;
  gap: 36px;
  margin: 0 auto;
  max-width: 1180px;
  width: 100%;
}

.feature-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 auto;
  max-width: 1180px;
}

.feature-grid article {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  min-height: 190px;
  padding: 24px;
}

.feature-grid strong {
  display: block;
  font-size: 24px;
}

.feature-grid p {
  color: var(--muted);
  line-height: 1.6;
  margin-top: 8px;
}

.demo-section {
  align-content: center;
  background: #eef2f7;
  display: grid;
}

.section-heading {
  margin: 0 auto 20px;
  max-width: 920px;
  text-align: center;
}

.section-heading h2 {
  font-size: 34px;
}

.section-heading p:last-child {
  color: var(--muted);
  line-height: 1.6;
  margin-top: 10px;
}

.demo-frame {
  height: calc(100vh - 260px);
  margin: 0 auto;
  max-width: 1280px;
  min-height: 520px;
  width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
  gap: 20px;
  min-height: 100vh;
  padding: 20px;
}

.workspace,
.results {
  min-width: 0;
}

.topbar,
.results-head,
.steps-head,
.actions,
.step-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.05;
}

h2 {
  font-size: 16px;
}

.topbar {
  margin-bottom: 16px;
}

.topbar p {
  margin-top: 6px;
  color: var(--muted);
}

.panel,
.results {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel {
  padding: 18px;
}

.results {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 40px);
  padding: 18px;
}

.grid {
  display: grid;
  gap: 12px;
}

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

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

.viewport,
.steps-head {
  margin-top: 16px;
}

label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

label span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 10px 11px;
  outline: none;
}

input[type="color"] {
  min-height: 42px;
  padding: 5px;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: 1px solid var(--line);
  border-radius: 4px;
}

input[type="color"]::-moz-color-swatch {
  border: 1px solid var(--line);
  border-radius: 4px;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(19, 104, 216, 0.14);
}

button,
.download,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  padding: 0 14px;
  text-decoration: none;
  cursor: pointer;
}

.link-button {
  min-height: 38px;
}

.tutorial-link {
  background: #fff7ed;
  border-color: #f97316;
  box-shadow:
    0 0 0 3px rgba(249, 115, 22, 0.18),
    0 8px 22px rgba(249, 115, 22, 0.2);
  color: #9a3412;
}

.tutorial-link:hover {
  background: #fff7ed;
  color: #7c2d12;
}

.download {
  min-width: 64px;
}

button:hover,
.download:hover,
.link-button:hover {
  background: var(--accent-strong);
}

.secondary,
.ghost {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.secondary:hover,
.ghost:hover {
  background: var(--soft);
}

.steps {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.step {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 14px;
}

.step-title strong {
  font-size: 14px;
}

.icon {
  width: 32px;
  min-height: 32px;
  padding: 0;
  border: 1px solid #f1b8b4;
  background: #fff;
  color: var(--danger);
  font-size: 22px;
  line-height: 1;
}

.icon:hover {
  background: #fff4f2;
}

.actions {
  margin-top: 16px;
  justify-content: flex-start;
}

#status {
  color: var(--muted);
  font-size: 14px;
}

#status.error {
  color: var(--danger);
}

.download.disabled {
  pointer-events: none;
  background: #cbd5e1;
  color: #475467;
}

.output {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  overflow: auto;
}

.output.empty {
  place-items: center;
  min-height: 220px;
  border: 1px dashed var(--line);
  color: var(--muted);
}

.shot {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.shot img {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  object-position: top;
  border-bottom: 1px solid var(--line);
}

.shot div {
  padding: 10px 12px;
}

.shot strong {
  display: block;
  font-size: 14px;
}

.shot p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

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

  .landing-hero {
    min-height: 0;
  }

  .hero-copy h1 {
    font-size: 42px;
  }

  .hero-demo {
    height: 62vh;
    min-height: 420px;
    max-height: none;
  }

  .feature-band,
  .demo-section {
    min-height: 0;
    padding-block: 48px;
  }

  .feature-band {
    display: block;
  }

  .feature-wrap {
    gap: 24px;
  }

  .demo-frame {
    height: 620px;
    min-height: 0;
  }

  .app {
    grid-template-columns: 1fr;
  }

  .results {
    min-height: 420px;
  }
}

@media (max-width: 720px) {
  .landing-nav {
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
  }

  .landing-nav nav {
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
  }

  .brand {
    font-size: 18px;
    white-space: nowrap;
  }

  .landing-nav nav a {
    font-size: 14px;
    min-height: 34px;
    padding: 0 9px;
  }

  .landing-hero,
  .feature-band,
  .demo-section {
    padding-inline: 16px;
    scroll-margin-top: 104px;
  }

  .hero-copy h1 {
    font-size: 36px;
  }

  .hero-lede {
    font-size: 17px;
  }

  .hero-demo {
    height: 560px;
    min-height: 0;
  }

  .hero-demo-caption {
    bottom: 12px;
    left: 12px;
    max-width: none;
    right: 12px;
    width: auto;
  }

  .demo-frame {
    height: 560px;
  }

  .back-top {
    bottom: 14px;
    min-height: 40px;
    padding: 0 13px;
    right: 14px;
  }

  .app {
    padding: 12px;
  }

  .two,
  .three {
    grid-template-columns: 1fr;
  }

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

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