:root {
  --color-bg: #f9f9f9;
  --color-surface: #ffffff;
  --color-text: #111111;
  --color-text-muted: #6e6e73;
  --color-border: #e5e5e7;
  --color-brand: #0a84ff;
  --color-brand-contrast: #ffffff;
  --color-accent: #0a84ff;
  --gradient-accent: linear-gradient(to right, #0a84ff, #7c3aed);
  --nav-bg: rgba(249, 249, 249, 0.8);
  --hero-shot-bg: linear-gradient(135deg, #dbeafe, #ede9fe, #fee2e2);
  --max-width: 1040px;
  --radius-lg: 20px;
  --radius-pill: 999px;
}

/* 深色模式：預設跟隨系統設定，除非使用者手動選過（存在 data-theme） */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #0d0d0f;
    --color-surface: #18181b;
    --color-text: #f5f5f7;
    --color-text-muted: #9a9aa2;
    --color-border: #2c2c30;
    --color-brand: #0a84ff;
    --color-brand-contrast: #ffffff;
    --color-accent: #0a84ff;
    --gradient-accent: linear-gradient(to right, #0a84ff, #a78bfa);
    --nav-bg: rgba(13, 13, 15, 0.75);
    --hero-shot-bg: linear-gradient(135deg, #1e293b, #312e51, #3b1f2b);
  }
}

:root[data-theme="dark"] {
  --color-bg: #0d0d0f;
  --color-surface: #18181b;
  --color-text: #f5f5f7;
  --color-text-muted: #9a9aa2;
  --color-border: #2c2c30;
  --color-brand: #0a84ff;
  --color-brand-contrast: #ffffff;
  --color-accent: #0a84ff;
  --gradient-accent: linear-gradient(to right, #0a84ff, #a78bfa);
  --nav-bg: rgba(13, 13, 15, 0.75);
  --hero-shot-bg: linear-gradient(135deg, #1e293b, #312e51, #3b1f2b);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

section[id] {
  scroll-margin-top: 80px;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, "PingFang TC", "Microsoft JhengHei", ui-sans-serif, system-ui, sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  transition: background-color 0.2s ease, color 0.2s ease;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

h1, h2, h3 {
  line-height: 1.15;
}

/* Nav */

.nav {
  position: sticky;
  top: 0;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--color-border);
  z-index: 10;
}

.nav__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  text-decoration: none;
  color: var(--color-text);
}

.nav__logo {
  border-radius: 6px;
}

.nav__utility {
  display: flex;
  align-items: center;
  gap: 24px;
  margin: 0 auto;
  font-size: 14px;
  color: var(--color-text-muted);
}

.nav__link {
  text-decoration: none;
  color: var(--color-text-muted);
}

.nav__link:hover {
  color: var(--color-text);
}

.nav__icon-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--color-text-muted);
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}

.nav__icon-link:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

/* Locale */

.nav__locale {
  position: relative;
}

.nav__locale summary {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  cursor: pointer;
  color: var(--color-text);
  font-weight: 600;
  font-size: 13px;
}

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

.nav__locale[open] summary {
  border-color: var(--color-accent);
}

.nav__locale-caret {
  transition: transform 0.15s ease;
}

.nav__locale[open] .nav__locale-caret {
  transform: rotate(180deg);
}

.nav__locale-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 140px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.25);
}

.nav__locale-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--color-text-muted);
  text-decoration: none;
}

.nav__locale-option.is-active {
  color: var(--color-text);
  font-weight: 600;
  background: var(--color-bg);
}

.nav__locale-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
}

.nav__theme .icon-sun,
.nav__theme .icon-moon {
  display: none;
}

.nav__theme .icon-sun {
  display: block;
}

:root[data-theme="dark"] .nav__theme .icon-sun {
  display: none;
}

:root[data-theme="dark"] .nav__theme .icon-moon {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .nav__theme .icon-sun {
    display: none;
  }

  :root:not([data-theme="light"]) .nav__theme .icon-moon {
    display: block;
  }
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
}

.btn--pill {
  border-radius: var(--radius-pill);
}

.btn--dark {
  background: var(--color-brand);
  color: var(--color-brand-contrast);
}

.btn--outline {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn--lg {
  padding: 14px 28px;
  font-size: 17px;
}

.btn__icon {
  flex-shrink: 0;
}

.btn__badge {
  margin-left: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.18);
  font-size: 12px;
  font-weight: 500;
}

/* Sections */

main section {
  padding: 72px 24px;
}

.section--alt {
  background: var(--color-surface);
  transition: background-color 0.2s ease;
}

.section__inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section__subtitle {
  text-align: center;
  color: var(--color-text-muted);
  margin-top: 0;
  margin-bottom: 40px;
}

main section h2 {
  font-size: 32px;
  font-weight: 600;
  text-align: center;
  margin: 0 0 16px;
}

/* Scroll-reveal */

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

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

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* Hero */

.hero {
  text-align: center;
  padding-bottom: 64px;
}

.hero__intro {
  min-height: 82vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 48px;
}

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

.hero h1 {
  font-size: clamp(34px, 5.5vw, 64px);
  font-weight: 600;
  margin: 0 0 20px;
}

.hero h1 span {
  display: block;
}

.gradient-text {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__tagline {
  font-size: 19px;
  color: var(--color-text-muted);
  max-width: 620px;
  margin: 0 auto 36px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 16px;
}

.hero__hint {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 0;
}

.hero__scroll-cue {
  margin-top: 48px;
  color: var(--color-text-muted);
}

.hero__scroll-dot {
  animation: hero-scroll-dot 1.6s ease-in-out infinite;
}

@keyframes hero-scroll-dot {
  0%, 100% {
    transform: translateY(0);
    opacity: 1;
  }
  50% {
    transform: translateY(10px);
    opacity: 0.3;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__scroll-dot {
    animation: none;
  }
}

.hero__shot {
  max-width: 420px;
  margin: 0 auto;
  padding: 32px;
  border-radius: 32px;
  background: var(--hero-shot-bg);
  transition: background 0.2s ease;
}

.hero__shot img {
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.35);
}

/* Features */

.features__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.feature-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px -16px rgba(0, 0, 0, 0.25);
}

.feature-card h3 {
  font-size: 17px;
  margin: 0 0 8px;
}

.feature-card p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 15px;
}

/* Pain */

.pain__grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pain__pair {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pain__pair:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px -16px rgba(0, 0, 0, 0.25);
}

.pain__problem,
.pain__solution {
  min-width: 0;
}

.pain__problem h3,
.pain__solution h3 {
  font-size: 16px;
  margin: 0 0 6px;
}

.pain__problem p,
.pain__solution p {
  margin: 0;
  font-size: 14px;
  color: var(--color-text-muted);
}

.pain__problem {
  opacity: 0.65;
}

.pain__solution {
  border-left: 2px solid var(--color-border);
  padding-left: 24px;
}

.pain__solution h3 {
  color: var(--color-accent);
}

/* Install / Quick start */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.step__body {
  min-width: 0;
  flex: 1;
}

.step__number {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-brand);
  color: var(--color-brand-contrast);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
}

.step__body h3 {
  font-size: 17px;
  margin: 0 0 6px;
}

.step__body p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 15px;
}

.step__body code {
  background: var(--color-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

.install-toggle {
  margin-top: 16px;
}

.install-toggle summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  list-style: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-accent);
  -webkit-user-select: none;
  user-select: none;
}

.install-toggle summary::-webkit-details-marker {
  display: none;
}

.install-toggle .faq__chevron {
  width: 16px;
  height: 16px;
  color: var(--color-accent);
}

.install-toggle[open] .faq__chevron {
  transform: rotate(180deg);
}

.install-gallery {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.install-gallery figure {
  flex: 0 0 auto;
  width: 280px;
  margin: 0;
  text-align: center;
}

.install-gallery img {
  display: block;
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  box-shadow: 0 8px 20px -12px rgba(0, 0, 0, 0.35);
}

.install-gallery figcaption {
  margin-top: 8px;
  font-size: 13px;
  color: var(--color-text-muted);
}

/* FAQ */

.faq__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq__item {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.faq__item:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px -16px rgba(0, 0, 0, 0.25);
}

.faq__item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: 16px;
  -webkit-user-select: none;
  user-select: none;
}

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

.faq__chevron {
  flex-shrink: 0;
  color: var(--color-text-muted);
  transition: transform 0.2s ease;
}

.faq__item[open] .faq__chevron {
  transform: rotate(180deg);
}

.faq__answer {
  padding: 0 24px 20px;
  color: var(--color-text-muted);
  font-size: 15px;
}

.faq__answer p {
  margin: 0;
}

.faq__answer code {
  background: var(--color-surface);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

.faq__steps {
  margin: 12px 0 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq__steps strong {
  color: var(--color-text);
}

.copy-block {
  margin-top: 8px;
  border: 1px solid #2a2b35;
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.copy-block:hover {
  border-color: rgba(224, 80, 71, 0.4);
  box-shadow: 0 0 40px rgba(224, 80, 71, 0.1);
}

.copy-block__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #1c1d24;
  border-bottom: 1px solid #2a2b35;
}

.copy-block__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.copy-block__dot:nth-child(1) {
  background: #f7fbff;
}

.copy-block__dot:nth-child(2) {
  background: #0a84ff;
}

.copy-block__dot:nth-child(3) {
  background: #ffd60a;
}

.copy-block__body {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: #14151a;
}

.copy-block__text {
  margin: 0;
  font-family: "Space Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 1.7;
  color: #e2e4ed;
  white-space: pre-wrap;
  word-break: break-word;
}

.copy-block__footer {
  display: flex;
  justify-content: flex-end;
  padding: 10px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: #14151a;
}

.chatgpt-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #e2e4ed;
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.chatgpt-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.3);
}

.chatgpt-btn__icon {
  flex-shrink: 0;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 6px;
  border: none;
  background: none;
  color: #6b6d7b;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s ease;
}

.copy-btn:hover {
  color: #e2e4ed;
}

.copy-btn__icon {
  flex-shrink: 0;
}

.copy-btn__icon--copied {
  display: none;
}

.copy-btn.is-copied .copy-btn__icon--default {
  display: none;
}

.copy-btn.is-copied .copy-btn__icon--copied {
  display: block;
}

.copy-btn.is-copied {
  color: #4ade80;
}

/* Footer */

.footer {
  border-top: 1px solid var(--color-border);
  padding: 32px 20px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 14px;
}

.footer a {
  text-decoration: none;
}

.footer p {
  margin: 0;
}

/* Responsive: mobile (~375px) */

@media (max-width: 480px) {
  .hero {
    padding-top: 64px;
  }

  .hero__tagline {
    font-size: 16px;
  }

  .hero__shot {
    padding: 16px;
    border-radius: 24px;
  }

  main section {
    padding: 48px 20px;
  }

  main section h2 {
    font-size: 24px;
  }

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

  .pain__pair {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .pain__solution {
    border-left: none;
    padding-left: 0;
    border-top: 2px solid var(--color-border);
    padding-top: 16px;
  }

  .nav__link,
  .nav__brand span {
    display: none;
  }

  .nav__utility {
    gap: 12px;
  }
}

/* Responsive: wide desktop (~1440px) */

@media (min-width: 1400px) {
  :root {
    --max-width: 1120px;
  }
}
