:root {
  color-scheme: light;
  --bg: #f8f7f3;
  --surface: #fffdf9;
  --ink: #242927;
  --secondary: #626963;
  --border: #e8eae4;
  --accent: #326b88;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "PingFang TC", "Hiragino Sans", "Hiragino Sans GB", "Noto Sans SC", "Noto Sans TC", "Noto Sans JP", "Noto Sans KR", "Source Han Sans SC", "Apple SD Gothic Neo", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.75;
}

main {
  max-width: 42rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

header p,
footer p { margin: 0; }

.brand {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0 0 0.25rem;
}

.subtitle,
.updated,
footer {
  color: var(--secondary);
}

h1 {
  font-size: 1.35rem;
  line-height: 1.4;
  margin: 1.5rem 0 0.75rem;
}

h2 {
  font-size: 1.05rem;
  margin: 1.75rem 0 0.5rem;
}

h3 {
  font-size: 1rem;
  line-height: 1.45;
  margin: 1.25rem 0 0.25rem;
}

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

ul, ol { padding-left: 1.2rem; }

li + li { margin-top: 0.45rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.2rem 1rem 0.4rem;
  margin-top: 1rem;
}

footer {
  margin-top: 2.5rem;
  font-size: 0.95rem;
}

footer .beian {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  line-height: 1.4;
}

footer .beian a {
  color: inherit;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

.lang-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 0.25rem;
}

.lang-switch a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 0.85rem;
  border-radius: 12px;
  background: var(--border);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.85rem;
}

html[data-lang="zh"] .lang-switch a[data-store-lang="zh"],
html[data-lang="zh-Hant"] .lang-switch a[data-store-lang="zh-Hant"],
html[data-lang="en"] .lang-switch a[data-store-lang="en"],
html[data-lang="ja"] .lang-switch a[data-store-lang="ja"],
html[data-lang="ko"] .lang-switch a[data-store-lang="ko"] {
  background: var(--accent);
  color: var(--surface);
}

html:not([data-lang]) [data-locale]:not([data-locale="zh"]),
html[data-lang="zh"] [data-locale]:not([data-locale="zh"]),
html[data-lang="zh-Hant"] [data-locale]:not([data-locale="zh-Hant"]),
html[data-lang="en"] [data-locale]:not([data-locale="en"]),
html[data-lang="ja"] [data-locale]:not([data-locale="ja"]),
html[data-lang="ko"] [data-locale]:not([data-locale="ko"]) {
  display: none;
}
