:root {
  color-scheme: light dark;
  --bg: #f6f8fa;
  --surface: #ffffff;
  --text: #14202b;
  --muted: #5b6b7a;
  --border: #dbe3ea;
  --accent: #0e7490;
  --accent-soft: #e6f6fa;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1622;
    --surface: #111f2e;
    --text: #e8eff5;
    --muted: #9db0c0;
    --border: #21344a;
    --accent: #67e8f9;
    --accent-soft: #102b38;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0 1.25rem 5rem;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC",
    "PingFang TC", "Microsoft JhengHei", sans-serif;
  line-height: 1.75;
  -webkit-text-size-adjust: 100%;
}

.wrap {
  max-width: 46rem;
  margin: 0 auto;
}

header.masthead {
  padding: 3rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}

.brand svg {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.65rem;
  flex-shrink: 0;
}

.brand span {
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

h1 {
  font-size: 1.9rem;
  line-height: 1.35;
  margin: 0 0 0.6rem;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.2rem;
  margin: 2.75rem 0 0.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
  letter-spacing: -0.005em;
}

h2:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 2rem;
}

h3 {
  font-size: 1rem;
  margin: 1.75rem 0 0.5rem;
}

p,
li {
  color: var(--text);
}

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

.meta {
  color: var(--muted);
  font-size: 0.875rem;
  margin: 0.35rem 0 0;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

ul {
  padding-left: 1.3rem;
}

li {
  margin: 0.4rem 0;
}

.callout {
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}

.callout p:first-child {
  margin-top: 0;
}

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

.table-scroll {
  overflow-x: auto;
  margin: 1.25rem 0;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 34rem;
  background: var(--surface);
  font-size: 0.925rem;
}

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

th {
  font-weight: 600;
  background: var(--accent-soft);
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: none;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.875em;
  background: var(--accent-soft);
  padding: 0.1em 0.4em;
  border-radius: 0.3em;
}

footer {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.875rem;
}

footer a {
  margin-right: 1rem;
}

img,
svg {
  max-width: 100%;
}
