:root {
  --bg: #0b0f14;
  --bg2: #10161e;
  --card: #141b25;
  --fg: #e8eef5;
  --muted: #a3b0c0;
  --line: #243041;
  --accent: #5eead4;
  --accent-ink: #04201b;
  --bad: #ff8f8f;
  --warn: #f5c76a;
  --ok: #6ee7a0;
  --term: #070a0e;
  --radius: 12px;
  color-scheme: dark;
}
:root[data-theme='light'] {
  --bg: #ffffff;
  --bg2: #f4f6f9;
  --card: #ffffff;
  --fg: #0f1722;
  --muted: #455468;
  --line: #d9e0e8;
  --accent: #0b6e63;
  --accent-ink: #ffffff;
  --bad: #b3261e;
  --warn: #8a5a00;
  --ok: #176b3a;
  --term: #0f1722;
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) {
    --bg: #ffffff;
    --bg2: #f4f6f9;
    --card: #ffffff;
    --fg: #0f1722;
    --muted: #455468;
    --line: #d9e0e8;
    --accent: #0b6e63;
    --accent-ink: #ffffff;
    --bad: #b3261e;
    --warn: #8a5a00;
    --ok: #176b3a;
    --term: #0f1722;
    color-scheme: light;
  }
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font:
    16px/1.6 system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    'Noto Sans TC',
    'PingFang TC',
    'Microsoft JhengHei',
    sans-serif;
  -webkit-font-smoothing: antialiased;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation: none !important;
    transition: none !important;
  }
}
a {
  color: var(--accent);
  text-underline-offset: 3px;
}
code,
pre {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
}
code {
  font-size: 0.88em;
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}
.wrap {
  width: min(1120px, 100% - 40px);
  margin-inline: auto;
}
.narrow {
  width: min(760px, 100% - 40px);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 8px 14px;
  border-radius: 8px;
  z-index: 100;
}
.skip:focus {
  top: 10px;
}

/* nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-in {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 60px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--fg);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  font-size: 1.08rem;
}
.links {
  display: flex;
  gap: 22px;
  margin-left: 28px;
}
.links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
}
.links a:hover {
  color: var(--fg);
}
.tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.lang {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.lang button {
  background: none;
  border: 0;
  color: var(--muted);
  padding: 6px 10px;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}
.lang button[aria-pressed='true'] {
  background: var(--bg2);
  color: var(--fg);
  font-weight: 650;
}
.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: none;
  color: var(--fg);
  cursor: pointer;
}
.nav .gh-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--fg);
  color: var(--bg);
  font-size: 0.88rem;
  font-weight: 650;
  text-decoration: none;
}
.nav .gh-link:hover {
  opacity: 0.88;
}

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 8px;
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  border: 1px solid var(--line);
  background: none;
  color: var(--fg);
  cursor: pointer;
}
.btn:hover {
  background: var(--bg2);
}
.btn.primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.btn.primary:hover {
  background: color-mix(in srgb, var(--accent) 88%, var(--fg));
}
.cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 28px 0 0;
}

/* hero */
.hero {
  padding: 88px 0 80px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
h1 {
  font-size: clamp(2.2rem, 4.4vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 750;
  margin: 0 0 20px;
  max-width: 14em;
}
.lead {
  font-size: 1.15rem;
  color: var(--muted);
  margin: 0;
  max-width: 32em;
}
.hero .fine {
  margin-top: 18px;
}
.fine {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 16px 0 0;
}

/* terminal */
.term {
  margin: 0;
  min-width: 0;
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  background: #1a222d;
  padding: 10px 14px;
  border-radius: var(--radius) var(--radius) 0 0;
  border: 1px solid #2a3544;
  border-bottom: 0;
}
.term-bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3a4757;
}
.term-bar b {
  margin-left: 10px;
  font:
    600 0.78rem ui-monospace,
    Menlo,
    monospace;
  color: #a3b0c0;
}
.term-body {
  margin: 0;
  background: var(--term);
  color: #dbe5f0;
  padding: 18px;
  font-size: 0.8rem;
  line-height: 1.7;
  border: 1px solid #2a3544;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow-x: auto;
  min-height: 15.5em;
}
.term-body code {
  font-size: inherit;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ln {
  display: block;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.ln .p {
  color: #5eead4;
  font-style: normal;
  margin-right: 8px;
}
.ln.c {
  color: #8d9bad;
}
.ln.ok {
  color: #6ee7a0;
}
.ln.err {
  color: #ff9d9d;
}
.js .ln {
  opacity: 0;
}
.js .ln.show {
  opacity: 1;
  transition: opacity 0.25s;
}
.term figcaption {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 10px;
}

/* sections */
.sec {
  padding: 88px 0;
}
.sec.alt {
  background: var(--bg2);
  border-block: 1px solid var(--line);
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 720;
  margin: 0 0 12px;
  max-width: 24em;
}
h3 {
  font-size: 1.05rem;
  margin: 0 0 6px;
  line-height: 1.35;
}
.sub {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 42em;
  margin: 0 0 36px;
}
.h-table {
  margin: 56px 0 14px;
  font-size: 1.15rem;
}

/* diagram */
.diagram {
  margin: 0 0 40px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.diagram svg {
  display: block;
  width: 100%;
  height: auto;
}
.d-tall {
  display: none !important;
  max-width: 420px;
  margin-inline: auto;
}
.bx {
  fill: var(--bg2);
  stroke: var(--line);
  stroke-width: 1.5;
}
.bx.core {
  stroke: var(--accent);
  stroke-width: 2.5;
}
.t1 {
  fill: var(--fg);
  font:
    650 20px system-ui,
    sans-serif;
}
.t2 {
  fill: var(--muted);
  font:
    15px system-ui,
    sans-serif;
}
.t3 {
  fill: var(--muted);
  font:
    14px system-ui,
    sans-serif;
}
.t3.acc {
  fill: var(--accent);
  font-weight: 650;
}
.t3.bad {
  fill: var(--bad);
}
.ln-a {
  stroke: var(--muted);
  stroke-width: 2;
  fill: none;
}
.ln-s {
  stroke: var(--accent);
  stroke-width: 3;
  fill: none;
  stroke-dasharray: 10 6;
  animation: flow 1.2s linear 5;
}
.ln-x {
  stroke: var(--bad);
  stroke-width: 2;
  fill: none;
  stroke-dasharray: 2 7;
  stroke-linecap: round;
}
.dash {
  stroke-dasharray: 6 5;
}
.arrow-fill {
  fill: var(--muted);
}
.acc-fill {
  fill: var(--accent);
}
@keyframes flow {
  to {
    stroke-dashoffset: -16;
  }
}
.steps {
  list-style: none;
  counter-reset: s;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.steps li {
  counter-increment: s;
  border-top: 2px solid var(--line);
  padding-top: 16px;
}
.steps li::before {
  content: counter(s);
  display: block;
  color: var(--accent);
  font-weight: 750;
  font-size: 0.95rem;
  margin-bottom: 6px;
}
.steps p {
  margin: 0;
  color: var(--muted);
}

/* cards */
.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.cards.two-col {
  grid-template-columns: repeat(2, 1fr);
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.card p {
  margin: 0;
  color: var(--muted);
}
.card p + ul {
  margin-top: 10px;
}
.card ul {
  margin: 4px 0 0;
  padding-left: 1.1em;
  color: var(--muted);
}
.card li {
  margin: 6px 0;
}

/* tables */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}
th,
td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
td {
  color: var(--muted);
}
tbody tr:last-child > * {
  border-bottom: 0;
}
thead th {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 650;
  background: var(--bg2);
}
tbody th {
  font-weight: 650;
}
table.cmp tbody th {
  width: 22%;
}
table.cmp tr.us > * {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--fg);
}
table.status tbody th[scope='row'] {
  width: 26%;
}
table.status td:nth-child(2) {
  width: 20%;
  white-space: nowrap;
}
tr.grp th {
  background: var(--bg2);
  font-size: 0.82rem;
  color: var(--fg);
  padding-block: 8px;
}
.st {
  font-weight: 650;
}
.st::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
  background: currentColor;
  vertical-align: 1px;
}
.st.ok {
  color: var(--ok);
}
.st.warn {
  color: var(--warn);
}
.st.no {
  color: var(--muted);
}

/* faq */
details {
  border-bottom: 1px solid var(--line);
}
summary {
  cursor: pointer;
  font-weight: 650;
  padding: 18px 0;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
summary::-webkit-details-marker {
  display: none;
}
summary::after {
  content: '+';
  color: var(--muted);
  font-size: 1.3rem;
  line-height: 1;
}
details[open] summary::after {
  content: '\2212';
}
details p {
  margin: 0 0 20px;
  color: var(--muted);
}

/* install */
.src {
  background: var(--term);
  color: #cfd9e6;
  border: 1px solid #2a3544;
  border-radius: var(--radius);
  padding: 18px;
  font-size: 0.82rem;
  line-height: 1.7;
  overflow-x: auto;
  margin: 0;
}

/* footer */
.foot {
  border-top: 1px solid var(--line);
  padding: 32px 0 44px;
  color: var(--muted);
  font-size: 0.88rem;
}
.foot-in {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.foot p {
  margin: 0;
}
.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.foot a {
  color: var(--fg);
}
.foot .gh-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* responsive */
@media (max-width: 1000px) {
  .cards {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 900px) {
  .hero-grid,
  .cards.two-col,
  .steps {
    grid-template-columns: 1fr;
  }
  .links {
    display: none;
  }
  .hero {
    padding: 56px 0;
  }
}
@media (max-width: 640px) {
  .sec {
    padding: 60px 0;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .d-wide {
    display: none !important;
  }
  .d-tall {
    display: block !important;
  }
  .nav-in {
    gap: 8px;
  }
  .brand span {
    font-size: 1rem;
  }
  .nav .gh-link {
    padding: 6px 10px;
  }
  /* tables become one block per row, with the column name above each value */
  table.stack thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  table.stack,
  table.stack tbody,
  table.stack tr,
  table.stack th,
  table.stack td {
    display: block;
    width: auto !important;
  }
  table.stack tr {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
  }
  table.stack tbody tr:last-child {
    border-bottom: 0;
  }
  table.stack tr.grp {
    padding: 0;
  }
  table.stack th,
  table.stack td {
    border: 0;
    padding: 3px 16px;
  }
  table.stack tr.grp th {
    padding: 8px 16px;
  }
  table.stack td:empty {
    display: none;
  }
  table.stack td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.78rem;
    font-weight: 650;
    color: var(--muted);
    margin-top: 4px;
  }
  table.status td:nth-child(2) {
    white-space: normal;
  }
}
