:root {
  --bg: #f9f9ff;
  --surface: #ffffff;
  --primary: #eb7355;
  --primary-deep: #c0563d;
  --soft: #fcf1ec;
  --text: #141b2b;
  --text2: #5e5a63;
  --outline: #eceef4;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11141b;
    --surface: #1b2029;
    --primary: #ee8568;
    --primary-deep: #ee8568;
    --soft: #33241f;
    --text: #eef0f7;
    --text2: #a9adba;
    --outline: #2a303b;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  font-size: 16px;
  line-height: 1.8;
}
html:lang(zh-Hans) body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif; }
html:lang(ja) body { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif; }
html:lang(en) body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; line-height: 1.65; }
a { color: var(--primary-deep); text-underline-offset: 3px; }

.wrap { max-width: 720px; margin: 0 auto; padding: 0 20px; }

header.site {
  border-bottom: 1px solid var(--outline);
  background: var(--surface);
}
header.site .wrap {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding-top: 14px; padding-bottom: 14px;
}
header.site img { width: 36px; height: 36px; border-radius: 9px; }
header.site .brand { font-weight: 700; color: var(--text); text-decoration: none; font-size: 17px; }
header.site nav { margin-left: auto; display: flex; gap: 16px; font-size: 14.5px; }
header.site nav a { color: var(--text2); text-decoration: none; }
header.site nav a[aria-current="page"] { color: var(--primary-deep); font-weight: 600; }

/* Language switcher */
header.site .lang-switch {
  display: flex; align-items: center; gap: 0; margin-left: 0; font-size: 13px;
  padding-left: 12px; border-left: 1px solid var(--outline);
}
header.site .lang-switch a { color: var(--text2); text-decoration: none; white-space: nowrap; }
header.site .lang-switch a + a::before { content: "·"; margin: 0 6px; color: var(--text2); }
header.site .lang-switch a.lang-current { color: var(--text); font-weight: 600; }

main { padding: 36px 0 56px; }
h1 { font-size: 28px; line-height: 1.35; margin: 0 0 6px; }
.meta { color: var(--text2); font-size: 14px; margin: 0 0 28px; }
h2 { font-size: 19px; margin: 36px 0 8px; padding-top: 4px; }
h3 { font-size: 16px; margin: 20px 0 4px; }
p, li { color: var(--text); }
ul { padding-left: 1.3em; }
li { margin: 4px 0; }

.summary {
  background: var(--soft);
  border-radius: 16px;
  padding: 18px 20px;
  margin: 0 0 8px;
}
.summary p { margin: 0 0 6px; font-weight: 600; }
.summary ul { margin: 0; }

.toc {
  border: 1px solid var(--outline);
  background: var(--surface);
  border-radius: 16px;
  padding: 14px 20px;
  margin: 24px 0 0;
  font-size: 15px;
}
.toc ol { margin: 6px 0 0; padding-left: 1.4em; }

table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 10px 0; }
th, td { text-align: left; vertical-align: top; padding: 10px 8px; border-bottom: 1px solid var(--outline); }
th { color: var(--text2); font-weight: 600; font-size: 14px; }
.table-scroll { overflow-x: auto; }

.hero { text-align: center; padding: 20px 0 8px; }
.hero img { width: 96px; height: 96px; border-radius: 22px; box-shadow: 0 6px 24px rgba(20, 27, 43, .12); }
.hero h1 { margin-top: 18px; }
.hero .tagline { color: var(--text2); margin: 0; }
.cards { display: grid; gap: 12px; margin-top: 32px; }
.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: 16px;
  padding: 16px 18px;
  text-decoration: none;
  color: var(--text);
}
.card strong { display: block; font-size: 16px; }
.card span { color: var(--text2); font-size: 14.5px; }

footer { border-top: 1px solid var(--outline); color: var(--text2); font-size: 13.5px; padding: 20px 0 32px; }

@media (max-width: 480px) {
  h1 { font-size: 24px; }
  header.site nav { gap: 12px; font-size: 14px; }
  header.site .brand span { display: none; }
}
@media (max-width: 640px) {
  header.site .wrap { row-gap: 6px; padding-bottom: 10px; }
  header.site .lang-switch { flex-basis: 100%; gap: 0; padding-left: 0; border-left: 0; }
}
