:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --fg: #1d1d1f;
  --muted: #5c5f66;
  --border: #e2e3e8;
  --surface: #f4f5f7;
  --accent: #2155cd;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111214;
    --fg: #ececef;
    --muted: #a3a6ad;
    --border: #2d2f35;
    --surface: #1b1d21;
    --accent: #8db1ff;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Noto Sans TC",
    "Microsoft JhengHei", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-wrap: break-word;
}

body:lang(zh) {
  line-height: 1.8;
}

.wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 16px;
}

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

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

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.25rem;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}

.brand {
  color: var(--fg);
  font-weight: 700;
  text-decoration: none;
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  font-size: 0.95rem;
}

.site-header nav a {
  text-decoration: none;
}

.site-header nav a[aria-current="page"] {
  color: var(--fg);
  font-weight: 600;
}

main.wrap {
  padding-top: 2rem;
  padding-bottom: 1rem;
}

h1 {
  font-size: clamp(1.75rem, 6vw, 2.4rem);
  line-height: 1.25;
  margin: 0 0 0.75rem;
}

h2 {
  font-size: 1.3rem;
  line-height: 1.35;
  margin: 2.25rem 0 0.5rem;
}

h3 {
  font-size: 1.08rem;
  line-height: 1.4;
  margin: 1.75rem 0 0.35rem;
}

ul {
  padding-left: 1.25rem;
}

li + li {
  margin-top: 0.35rem;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--surface);
  border-radius: 4px;
  padding: 0.1em 0.35em;
  overflow-wrap: anywhere;
}

.lead {
  font-size: 1.2rem;
  color: var(--muted);
}

.meta {
  color: var(--muted);
  font-size: 0.95rem;
}

.box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.25rem 1.25rem;
  margin: 1.5rem 0;
}

.box h2 {
  margin-top: 1rem;
}

.links {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.links li + li {
  margin-top: 0;
}

.links a {
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
  text-decoration: none;
  font-weight: 600;
}

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

.site-footer .wrap {
  padding-top: 1.25rem;
  padding-bottom: 2.5rem;
}

.site-footer p {
  margin: 0 0 0.6rem;
}

.site-footer .note {
  margin-bottom: 1rem;
}
