:root {
  --bg: #ffffff;
  --bg-soft: #f7f9fc;
  --text: #1f2933;
  --muted: #52606d;
  --border: #e4e7eb;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --code-bg: #f3f4f6;
  --warn-bg: #fff8e6;
  --warn-border: #f0c000;
  --radius: 8px;
  --max: 860px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    "PingFang TC",
    "Microsoft JhengHei",
    sans-serif;
  font-size: 17px;
  line-height: 1.65;
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header and navigation */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  padding-top: 16px;
  padding-bottom: 16px;
  position: relative;
}

.brand {
  order: 1;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}

.header-actions {
  order: 3;
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav {
  order: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 20px;
  margin-left: auto;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--accent);
}

.site-nav a[aria-current="page"] {
  font-weight: 600;
}

.gh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  color: var(--muted);
}

.gh svg {
  display: block;
  width: 20px;
  height: 20px;
}

.gh:hover {
  color: var(--text);
  background: var(--bg-soft);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}

.nav-toggle svg {
  display: block;
  width: 22px;
  height: 22px;
}

.nav-toggle:hover {
  border-color: var(--muted);
}

/* Typography */

main {
  padding: 48px 0 64px;
}

h1 {
  font-size: 2rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}

h2 {
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  margin: 48px 0 12px;
  padding-top: 8px;
}

h3 {
  font-size: 1.05rem;
  margin: 28px 0 8px;
}

h2,
h3 {
  scroll-margin-top: 20px;
}

p {
  margin: 0 0 16px;
}

ul,
ol {
  margin: 0 0 16px;
  padding-left: 22px;
}

li {
  margin: 0 0 8px;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

.lead {
  font-size: 1.15rem;
  color: var(--muted);
  margin-bottom: 24px;
}

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

/* Home hero */

.hero h1 {
  font-size: 2.4rem;
}

.hero .lead {
  max-width: 640px;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 36px;
  align-items: center;
}

.hero-shot {
  margin: 0;
}

.hero-shot img {
  display: block;
  width: 100%;
  /* max-width: 300px; */
  margin: 0 auto;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-soft);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 8px;
}

.button {
  display: inline-block;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
}

.button:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #fff;
  text-decoration: none;
}

.button.secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.button.secondary:hover {
  border-color: var(--muted);
  background: var(--bg-soft);
  color: var(--text);
}

/* Feature cards */

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

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  background: var(--bg);
}

.card h3 {
  margin-top: 0;
  margin-bottom: 6px;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Numbered flow */

.flow {
  list-style: none;
  counter-reset: flow;
  padding: 0;
  margin: 24px 0;
}

.flow li {
  counter-increment: flow;
  position: relative;
  padding-left: 44px;
  margin-bottom: 16px;
}

.flow li::before {
  content: counter(flow);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Steps */

.step {
  border-top: 1px solid var(--border);
  margin-top: 32px;
  padding-top: 8px;
}

.step h2 {
  margin-top: 24px;
}

/* Callouts */

.callout {
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 20px 0;
  background: var(--bg-soft);
  scroll-margin-top: 20px;
}

.callout.warn {
  background: var(--warn-bg);
  border-color: var(--warn-border);
}

.callout > strong:first-child {
  display: block;
  margin-bottom: 4px;
}

.callout p:last-child {
  margin-bottom: 0;
}

/* Code */

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 4px;
}

.code-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0;
}

pre {
  margin: 0;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  overflow-x: auto;
}

pre code {
  background: none;
  padding: 0;
  font-size: 0.9rem;
}

.copy-button {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  border-radius: var(--radius);
  padding: 8px 14px;
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
}

.copy-button:hover {
  border-color: var(--muted);
  color: var(--text);
}

/* Tables */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.95rem;
}

th,
td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

/* Screenshots */

.shot {
  margin: 24px 0;
}

.shot img {
  display: block;
  width: 100%;
  max-width: 360px;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.shot.wide img {
  max-width: 100%;
}

.shot figcaption {
  margin-top: 10px;
  max-width: 560px;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Table of contents */

.toc {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  padding: 18px 22px;
  margin: 28px 0 40px;
}

.toc h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 10px;
  padding: 0;
}

.toc ol {
  margin: 0;
  padding-left: 20px;
}

.toc li {
  margin-bottom: 6px;
}

/* Q&A */

.qa {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 0 0 16px;
  scroll-margin-top: 20px;
}

.qa h3 {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 1.1rem;
  line-height: 1.4;
}

.qa-icon {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 3px;
  color: var(--accent);
}

.qa > *:last-child {
  margin-bottom: 0;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 16px;
}

.site-footer p {
  margin: 0;
}

/* Focus */

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Responsive */

@media (max-width: 760px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .hero-shot img {
    max-width: 85%;
  }

  .actions {
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .nav-toggle {
    display: inline-flex;
  }

  .header-actions {
    margin-left: auto;
  }

  .site-nav {
    display: none;
    order: 4;
    flex-basis: 100%;
    margin-left: 0;
  }

  .site-nav.open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 0 4px;
    border-top: 1px solid var(--border);
  }

  .site-nav.open a {
    padding: 10px 4px;
    border-bottom: 1px solid var(--border);
  }

  .site-nav.open a:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 600px) {
  body {
    font-size: 16px;
  }

  .hero h1 {
    font-size: 1.9rem;
  }

  h1 {
    font-size: 1.6rem;
  }
}

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