:root {
  --bg: #0b0d12;
  --surface: #151a24;
  --surface-2: #10141c;
  --border: #2b3242;
  --accent: #22c7dc;
  --accent-dark: #087f8c;
  --ink: #172033;
  --muted: #6b7486;
  --light: #f5f7fa;
  --white: #ffffff;
  --radius: 8px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: #e8edf7;
  background: var(--bg);
  font-family: "Segoe UI", "Noto Sans TC", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

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

.site-header {
  min-height: 68px;
  padding: 0 max(22px, 5vw);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid #202532;
}

.brand {
  color: var(--accent);
  font-size: 1.35rem;
  font-weight: 800;
  text-decoration: none;
}

.header-link {
  color: #d6dce8;
  font-weight: 700;
  text-decoration: none;
}

.header-link:hover { color: var(--accent); }

.intro {
  max-width: 1180px;
  margin: 0 auto;
  padding: 72px 24px 58px;
}

.eyebrow,
.section-label {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1, h2, h3, p, span { overflow-wrap: anywhere; }

h1 {
  max-width: 940px;
  margin: 0;
  color: var(--white);
  font-size: clamp(2rem, 5vw, 4.25rem);
  line-height: 1.12;
  letter-spacing: 0;
}

.lede {
  max-width: 800px;
  margin: 22px 0 0;
  color: #9aa5b8;
  font-size: 1.08rem;
}

.flow-nav {
  margin-top: 42px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-block: 1px solid #2a3040;
}

.flow-nav a {
  min-height: 72px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #c8d0de;
  border-right: 1px solid #2a3040;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.flow-nav a:last-child { border-right: 0; }
.flow-nav a:hover { color: var(--white); background: #111620; }
.flow-nav span { color: var(--accent); font-size: 1.05rem; }

.guide-section { padding: 76px max(24px, 5vw); }
.light-section { color: var(--ink); background: var(--light); }
.dark-section { color: #e8edf7; background: var(--surface-2); }
.result-section { color: var(--ink); background: #e9edf3; }

.section-copy {
  width: min(1180px, 100%);
  margin: 0 auto 34px;
  display: grid;
  grid-template-columns: 66px minmax(0, 760px);
  gap: 22px;
}

.step-number {
  margin: 0;
  color: var(--accent-dark);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
}

.dark-section .step-number,
.dark-section .section-label { color: var(--accent); }

h2 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.45rem);
  line-height: 1.25;
  letter-spacing: 0;
}

.section-copy p:last-child { margin: 12px 0 0; color: var(--muted); }
.dark-section .section-copy p:last-child { color: #929db0; }

.source-grid {
  width: min(1320px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}

.screenshot-figure {
  min-width: 0;
  margin: 0;
  background: var(--white);
  border: 1px solid #cfd5df;
  border-radius: var(--radius);
  overflow: hidden;
}

.screenshot-figure > a {
  display: block;
  background: #dfe4eb;
  overflow: hidden;
}

.screenshot-figure img {
  width: 100%;
  height: auto;
  transition: transform 180ms ease;
}

.screenshot-figure > a:hover img { transform: scale(1.008); }

.source-grid .screenshot-figure img {
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: left top;
}

figcaption {
  min-height: 92px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--ink);
}

figcaption strong { color: var(--accent-dark); }
figcaption span { color: var(--muted); font-size: 0.88rem; }

.wide-figure,
.output-figure {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.wide-figure > a {
  max-height: 820px;
  display: flex;
  justify-content: center;
}

.wide-figure img {
  width: 100%;
  max-height: 820px;
  object-fit: contain;
}

.dark-frame { background: var(--surface); border-color: var(--border); }
.dark-frame > a { background: #0e1118; }
.dark-frame figcaption { color: #e8edf7; background: var(--surface); }
.dark-frame figcaption strong { color: var(--accent); }
.dark-frame figcaption span { color: #9aa5b8; }

.output-figure > a { background: #d7dce4; }
.output-figure img { width: 100%; height: auto; }

.notes-section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 62px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 42px;
}

.notes-section h2 { color: var(--white); }
.notes-section p { max-width: 830px; margin: 12px 0 0; color: #9aa5b8; }

.primary-link {
  min-height: 48px;
  padding: 11px 22px;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  color: #071014;
  background: var(--accent);
  border-radius: 6px;
  font-weight: 800;
  text-decoration: none;
}

.primary-link:hover { background: #43d5e7; }

footer {
  padding: 24px;
  color: #778195;
  border-top: 1px solid #202532;
  text-align: center;
  font-size: 0.86rem;
}

@media (max-width: 900px) {
  .flow-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow-nav a:nth-child(2) { border-right: 0; }
  .flow-nav a:nth-child(-n + 2) { border-bottom: 1px solid #2a3040; }
  .source-grid { grid-template-columns: 1fr; }
  .notes-section { align-items: stretch; flex-direction: column; }
  .primary-link { align-self: flex-start; }
}

@media (max-width: 600px) {
  .site-header { padding-inline: 18px; }
  .intro { padding: 48px 18px 42px; }
  .guide-section { padding: 52px 18px; }
  .flow-nav { grid-template-columns: 1fr; }
  .flow-nav a { min-height: 58px; border-right: 0; border-bottom: 1px solid #2a3040; }
  .flow-nav a:nth-child(3) { border-bottom: 1px solid #2a3040; }
  .flow-nav a:last-child { border-bottom: 0; }
  .section-copy { grid-template-columns: 1fr; gap: 4px; }
  .step-number { font-size: 1.35rem; }
  figcaption { min-height: 0; }
  .wide-figure > a { max-height: none; }
  .wide-figure img { max-height: none; }
  .notes-section { padding: 48px 18px; }
  .primary-link { width: 100%; }
}
