:root {
  --bg: #07100f;
  --ink: #eef7f3;
  --muted: #9eb0a9;
  --panel: #101916;
  --panel-2: #16211d;
  --line: #31433c;
  --cyan: #44d7e8;
  --green: #5fe0a8;
  --amber: #ffd166;
  --paper: #f4f1e8;
  --dark: #050807;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(180deg, #07100f 0%, #0b1512 44%, #10110c 100%);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", Arial, sans-serif;
  line-height: 1.55;
  overflow-x: hidden;
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(95, 224, 168, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(68, 215, 232, 0.08) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.55;
}

button,
input,
textarea {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 56px);
  border-bottom: 1px solid rgba(95, 224, 168, 0.18);
  background: rgba(7, 16, 15, 0.86);
  backdrop-filter: blur(16px);
}

.auth-widget {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.auth-status-text {
  color: var(--muted);
  font-size: 13px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: var(--dark);
  background: var(--green);
  border-radius: 8px;
}

.nav-tabs {
  display: flex;
  justify-content: center;
  gap: 4px;
}

.nav-link {
  min-width: 82px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.nav-link.active,
.nav-link:hover {
  color: var(--ink);
  border-color: rgba(68, 215, 232, 0.28);
  background: rgba(68, 215, 232, 0.1);
}

.page-view {
  display: none;
}

.page-view.active {
  display: block;
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, 0.98fr);
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
  min-height: calc(100vh - 68px);
  padding: clamp(40px, 6vw, 80px) clamp(16px, 5vw, 72px) 34px;
}

.hero-copy {
  max-width: 760px;
}

.tag {
  display: inline-flex;
  margin: 0 0 12px;
  color: var(--amber);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  letter-spacing: 0;
}

.hero-copy h1,
.page-title h1 {
  margin-bottom: 18px;
  font-size: clamp(38px, 6vw, 78px);
  line-height: 1.02;
}

.hero-copy p,
.page-title p {
  max-width: 660px;
  color: #c6d8d0;
  font-size: 18px;
}

.hero-actions,
.module-actions,
.output-actions,
.auth-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.auth-shell {
  padding: 56px clamp(16px, 5vw, 72px);
}

.auth-panel {
  max-width: 560px;
  margin: 0 auto;
}

.auth-form {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.auth-form label {
  width: 100%;
  margin-bottom: 0;
}

.auth-switch-btn {
  margin-top: 10px;
  border: 0;
  padding: 0;
  color: var(--amber);
  background: transparent;
  text-decoration: underline;
  cursor: pointer;
}

.auth-message {
  min-height: 24px;
  margin: 10px 0 0;
  color: var(--amber);
}

.auth-message.error {
  color: #ff9a9e;
}

.auth-message.ok {
  color: var(--green);
}

.auth-note {
  margin-top: 14px;
  color: var(--muted);
}

.btn {
  min-height: 42px;
  border: 1px solid rgba(95, 224, 168, 0.4);
  border-radius: 8px;
  padding: 10px 16px;
  color: #06100d;
  background: linear-gradient(90deg, var(--green), var(--cyan));
  cursor: pointer;
  font-weight: 700;
}

.btn:hover {
  box-shadow: 0 14px 28px rgba(68, 215, 232, 0.16);
  transform: translateY(-1px);
}

.btn.outline,
.btn.ghost {
  color: var(--ink);
  background: rgba(238, 247, 243, 0.04);
}

.btn.ghost {
  border-style: dashed;
}

.btn.success {
  background: linear-gradient(90deg, var(--amber), var(--green));
}

.small-btn {
  min-height: 38px;
  padding: 8px 14px;
}

.hero-visual {
  padding: 18px;
  border: 1px solid rgba(68, 215, 232, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(68, 215, 232, 0.14), transparent 34%),
    linear-gradient(225deg, rgba(255, 209, 102, 0.12), transparent 36%),
    rgba(11, 19, 17, 0.82);
}

.hero-visual img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid rgba(95, 224, 168, 0.26);
  border-radius: 8px;
}

.section-band,
.builder-shell,
.examples-shell {
  padding: 56px clamp(16px, 5vw, 72px);
}

.section-heading {
  max-width: 720px;
  margin-bottom: 22px;
}

.section-heading h2,
.split-band h2 {
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.12;
}

.feature-grid,
.example-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.feature-item,
.example-card,
.panel {
  border: 1px solid rgba(238, 247, 243, 0.1);
  border-radius: 8px;
  background: rgba(16, 25, 22, 0.78);
}

.feature-item,
.example-card {
  padding: 18px;
}

.example-card img,
.lead-box img,
.builder-preview {
  display: block;
  width: 100%;
  border: 1px solid rgba(68, 215, 232, 0.18);
  border-radius: 8px;
  object-fit: cover;
}

.example-card img {
  aspect-ratio: 4 / 3;
  margin-bottom: 16px;
}

.feature-icon {
  display: inline-flex;
  margin-bottom: 20px;
  color: var(--green);
  font-weight: 800;
}

.feature-item p,
.example-card p {
  color: var(--muted);
}

.split-band {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(360px, 1.14fr);
  gap: 22px;
  align-items: start;
  border-top: 1px solid rgba(238, 247, 243, 0.08);
}

.step-list {
  display: grid;
  gap: 10px;
}

.step-list div {
  display: grid;
  grid-template-columns: 84px 92px 1fr;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(68, 215, 232, 0.2);
  border-radius: 8px;
  background: rgba(68, 215, 232, 0.06);
}

.step-list img {
  width: 84px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
}

.step-list strong {
  color: var(--amber);
}

.step-list span {
  color: var(--muted);
}

.page-title {
  margin-bottom: 22px;
}

.builder-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  gap: 16px;
  align-items: start;
}

.builder-side {
  display: grid;
  gap: 16px;
  align-items: start;
}

.builder-preview {
  aspect-ratio: 16 / 10;
  margin-bottom: 16px;
}

.panel {
  padding: 18px;
}

.mode-buttons,
.module-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip,
.tab-btn {
  border: 1px solid rgba(68, 215, 232, 0.25);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--ink);
  background: rgba(238, 247, 243, 0.04);
  cursor: pointer;
}

.chip:hover,
.tab-btn:hover,
.tab-btn.active {
  border-color: rgba(95, 224, 168, 0.6);
  background: rgba(95, 224, 168, 0.12);
}

.form-stack {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.module {
  display: none;
  margin: 0;
  padding: 14px;
  border: 1px solid rgba(95, 224, 168, 0.18);
  border-radius: 8px;
}

.module.active {
  display: block;
}

legend {
  padding: 0 6px;
  color: var(--amber);
}

label {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  color: #dce9e3;
  font-size: 14px;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(238, 247, 243, 0.16);
  border-radius: 8px;
  padding: 10px;
  color: var(--ink);
  background: rgba(5, 8, 7, 0.72);
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #75857f;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(68, 215, 232, 0.14);
}

.output-panel {
  position: static;
}

.output-panel textarea {
  min-height: 520px;
}

.lead-box {
  display: grid;
  grid-template-columns: minmax(280px, 0.7fr) minmax(320px, 1fr);
  gap: 10px 18px;
  align-items: start;
  margin-top: 16px;
}

.lead-box img {
  aspect-ratio: 4 / 3;
  margin-bottom: 4px;
  grid-row: span 6;
}

.lead-box p {
  color: var(--muted);
}

.lead-box .btn {
  width: fit-content;
}

.save-status {
  min-height: 24px;
  margin: 0;
  color: var(--green);
  font-size: 14px;
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .auth-widget {
    justify-content: flex-start;
    margin-top: 8px;
  }

  .nav-tabs {
    justify-content: start;
    overflow-x: auto;
  }

  .landing-hero,
  .split-band,
  .builder-layout {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    padding: 12px;
  }

  .feature-grid,
  .example-grid {
    grid-template-columns: 1fr;
  }

  .output-panel {
    position: static;
  }

  .lead-box {
    grid-template-columns: 1fr;
  }

  .lead-box img {
    grid-row: auto;
  }
}

@media (max-width: 560px) {
  .landing-hero,
  .section-band,
  .builder-shell,
  .examples-shell {
    padding-inline: 14px;
  }

  .hero-copy h1,
  .page-title h1 {
    font-size: 34px;
  }

  .step-list div {
    grid-template-columns: 72px 1fr;
  }

  .step-list img {
    width: 72px;
    grid-row: span 2;
  }
}
