:root {
  color-scheme: light;
  /* Standalone pages have a complete fallback; the viewer supplies the app's active tokens. */
  --surface-page: #f6f3ec;
  --surface-card: #fffdf8;
  --surface-panel: #efebe2;
  --surface-hover: #f3eee4;
  --text-primary: #1f1d1a;
  --text-secondary: #5e5a52;
  --text-muted: #6f685e;
  --border-default: #d8d1c3;
  --selection-accent: #b23a2b;
  --selection-bg: #f8e9e4;
  --fragment-accent: #2f4a8a;
  --font-reading: "Songti SC", "Noto Serif CJK SC", SimSun, serif;
  --button-primary-bg: #1f1d1a;
  --button-primary-text: #fffdf8;
  --button-secondary-bg: #fffdf8;
  --button-secondary-text: #1f1d1a;
  --button-secondary-border: #b9af9d;
  --button-radius: 6px;
  --muted: var(--text-secondary);
  --subtle: var(--text-muted);
  --line: var(--border-default);
  --accent: var(--fragment-accent);
  font-family: var(--font-reading);
  color: var(--text-primary);
  background: var(--surface-page);
}
* { box-sizing: border-box; }
body { margin: 0; }
.introduction { position: relative; isolation: isolate; min-width: 0; }
.background-motto { position: fixed; inset: 24px 16px; display: flex; justify-content: space-between; pointer-events: none; user-select: none; z-index: -1; }
.background-motto svg { width: max(0px, calc((100% - 960px) / 2 - 24px)); height: 100%; overflow: hidden; fill: var(--selection-accent); opacity: .18; }
.background-motto text { font-family: "STXingkai", "华文行楷", "STKaiti", "KaiTi", "楷体", serif; font-size: 100px; font-weight: 400; text-anchor: middle; }
a { color: var(--accent); text-underline-offset: 4px; overflow-wrap: anywhere; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
.site-nav, main, footer { width: min(960px, 100% - 48px); margin: auto; }
.site-nav { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.site-nav a { text-decoration: none; }
.site-nav strong { font-size: 22px; letter-spacing: .15em; white-space: nowrap; }
.nav-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px 24px; font-size: 14px; }
.skip-link { position: absolute; top: -100px; left: 16px; padding: 12px; background: var(--surface-card); }
.skip-link:focus { top: 12px; }
main { padding: 64px 0 40px; }
.eyebrow { font-size: 13px; letter-spacing: .12em; color: var(--subtle); }
h1 { max-width: 820px; font-size: clamp(30px, 5vw, 52px); line-height: 1.3; font-weight: 650; letter-spacing: -.03em; margin: 18px 0 24px; }
.introduction h1 small { display: block; margin-top: 14px; font-size: .6em; font-weight: 500; letter-spacing: .02em; }
.lead { max-width: 780px; font-size: 18px; line-height: 1.9; color: var(--muted); }
.manifesto { max-width: 820px; margin: 24px 0; font-size: 23px; font-weight: 650; line-height: 1.8; color: var(--selection-accent); }
.invitation { margin: 24px 0; font-size: 27px; font-weight: 650; line-height: 1.7; }
.invitation span { font-size: 18px; color: var(--subtle); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 48px; }
.button { display: inline-block; border: 1px solid var(--button-secondary-border); padding: 11px 20px; border-radius: var(--button-radius); text-decoration: none; background: var(--button-secondary-bg); color: var(--button-secondary-text); }
.button:hover { background: var(--surface-hover); }
.primary { background: var(--button-primary-bg); border-color: var(--button-primary-bg); color: var(--button-primary-text); }
.primary:hover { background: color-mix(in srgb, var(--button-primary-bg) 88%, var(--text-primary)); }
h2 { font-size: 24px; margin: 0 0 18px; }
h3 { font-size: 17px; margin: 0 0 10px; }
p, li { line-height: 1.85; }
p { margin: 0 0 12px; }
.section { padding: 32px 0; border-top: 1px solid var(--line); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 40px; }
.grid p { color: var(--muted); }
ol, ul { padding-left: 24px; margin: 0 0 16px; }
li { padding-left: 4px; margin-bottom: 10px; }
.note { color: var(--subtle); font-size: 14px; margin-top: 16px; }
.label { display: block; font-size: 12px; color: var(--subtle); margin-bottom: 8px; }
.documents h3 a { text-decoration-thickness: 1px; }
.document-main { padding-top: 40px; }
.document-main > header { margin-bottom: 24px; }
.document-main h1 { font-size: clamp(28px, 4vw, 40px); }
.document-menu { border: 1px solid var(--line); border-radius: var(--button-radius); padding: 14px 18px; margin: 24px 0; background: var(--surface-card); }
summary { cursor: pointer; font-size: 14px; }
.document-menu nav { display: flex; flex-wrap: wrap; gap: 12px 24px; padding-top: 16px; font-size: 14px; }
.document-menu [aria-current="page"] { font-weight: 700; text-decoration: none; }
.document-desktop-menu { display: none; }
.document-nav-group { min-width: 0; }
.document-nav-group h2 { margin: 0 0 10px; font-size: 13px; color: var(--subtle); }
.document-nav-group a { display: block; margin: 0 0 10px; }
.directory-heading { margin: 28px 0 14px; color: var(--subtle); font-size: 14px; }
.introduction-sidebar, .introduction-toc { display: none; }
.prose { max-width: 780px; margin: 32px auto; overflow-wrap: anywhere; }
.prose h2 { font-size: 24px; margin: 40px 0 18px; }
.prose h3, .prose h4, .prose h5, .prose h6 { margin: 28px 0 12px; }
.prose h2, .prose h3, .prose h4 { scroll-margin-top: 24px; }
.prose p, .prose ul, .prose ol { margin-bottom: 18px; }
.prose li > p { margin-bottom: 8px; }
.prose blockquote { border-left: 3px solid var(--selection-accent); margin: 24px 0; padding: 12px 20px; color: var(--muted); background: var(--selection-bg); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose pre { border: 1px solid var(--line); padding: 16px; border-radius: var(--button-radius); overflow-x: auto; line-height: 1.7; font-size: 14px; background: var(--surface-panel); }
.prose code { font-size: .9em; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
.table-scroll { overflow-x: auto; margin: 24px 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: 14px; }
.prose th, .prose td { padding: 12px; border: 1px solid var(--line); text-align: left; line-height: 1.7; min-width: 120px; }
.prose th { color: var(--text-primary); background: var(--surface-panel); }
footer { padding: 20px 0 32px; border-top: 1px solid var(--line); font-size: 14px; color: var(--subtle); line-height: 1.8; }

/* All appearances share document navigation, reading widths and responsive behavior. */
:root {
  --document-accent: var(--fragment-accent);
  --accent: var(--document-accent);
  font-size: 16px;
}
:root .introduction { min-width: 0; }
:root .background-motto { display: none; }
:root[data-embedded="true"] .site-nav { display: none; }
:root .site-nav { width: min(1204px, 100% - 48px); padding: 20px 0; }
:root main { width: min(720px, 100% - 40px); padding-top: 40px; }
:root h1 { font-size: 36px; line-height: 1.45; font-weight: 600; letter-spacing: .01em; }
:root h2 { font-size: 24px; font-weight: 600; }
:root h3 { font-weight: 600; }
:root .manifesto { font-size: 21px; color: var(--text-primary); }
:root .eyebrow { color: var(--document-accent); font-size: 12px; letter-spacing: .1em; }
:root .eyebrow a { color: var(--text-muted); text-decoration: none; }
:root .lead { font-size: 16px; line-height: 1.85; }
:root .section { padding: 32px 0; }
:root .section [id] { scroll-margin-top: 24px; }
:root .actions { margin-bottom: 40px; }
:root .button { border-radius: 3px; }
:root .quick-start-steps li { padding-left: 6px; margin-bottom: 14px; }
:root .directory-heading { font-size: 13px; letter-spacing: .08em; color: var(--document-accent); }
:root .introduction-toc { display: block; width: min(720px, 100% - 40px); margin: 0 auto; }
:root .document-main > header { margin: 0 0 28px; min-width: 0; }
:root .document-main h1 { margin: 14px 0 16px; font-size: 32px; }
:root .prose { width: 100%; max-width: 720px; margin: 24px 0 0; font-size: 16px; line-height: 1.85; }
:root .prose p, :root .prose li { line-height: 1.85; }
:root .prose h2 { font-size: 24px; margin-top: 36px; }
:root .prose > :first-child { margin-top: 0; }
:root .prose blockquote { border-left: 2px solid var(--document-accent); background: var(--surface-panel); }
:root .document-menu { margin: 0 0 20px; padding: 12px 16px; border-radius: 3px; box-shadow: none; }
:root .document-menu summary,
:root .document-menu-title { color: var(--document-accent); font-size: 12px; letter-spacing: .06em; }
:root .document-menu nav { display: block; padding-top: 18px; font-size: 14px; line-height: 1.65; }
:root .document-menu nav > a { display: block; padding: 5px 0 5px 12px; margin: 0 0 4px; border-left: 1px solid var(--border-default); color: var(--text-secondary); text-decoration: none; }
:root .document-nav-group { margin-bottom: 24px; }
:root .document-nav-group:last-child { margin-bottom: 0; }
:root .document-nav-group h2 { font-size: 12px; margin: 0 0 8px; font-weight: 600; letter-spacing: .08em; color: var(--text-muted); }
:root .document-nav-group a { padding: 5px 10px; margin: 0 0 2px; border-left: 2px solid transparent; color: var(--text-secondary); text-decoration: none; }
:root .document-menu a:hover { color: var(--document-accent); background: var(--surface-hover); }
:root .document-nav-group [aria-current="page"] { color: var(--document-accent); border-left-color: var(--document-accent); background: var(--surface-panel); font-weight: 600; }
:root footer { width: min(720px, 100% - 40px); font-size: 13px; }

@media (min-width: 1024px) {
  :root .introduction-shell,
  :root .document-main {
    display: grid;
    grid-template-columns: 220px minmax(0, 720px);
    column-gap: 32px;
    width: min(972px, 100% - 48px);
    margin: 0 auto;
  }
  :root .document-main { grid-template-areas: "sidebar title" "sidebar toc" "sidebar content"; align-content: start; }
  :root .document-main > header { grid-area: title; }
  :root .document-sidebar { grid-area: sidebar; align-self: start; position: sticky; top: 24px; }
  :root .document-main .document-toc { grid-area: toc; min-width: 0; }
  :root .document-main .prose { grid-area: content; min-width: 0; margin-top: 0; }
  :root .document-sidebar .document-menu { padding: 0 20px 0 0; border: 0; border-right: 1px solid var(--border-default); background: transparent; border-radius: 0; margin: 0; max-height: calc(100vh - 48px); overflow-y: auto; }
  :root .document-sidebar .document-desktop-menu { display: block; }
  :root .document-sidebar .document-collapsible { display: none; }
  :root .introduction-shell { padding-top: 40px; grid-template-areas: "sidebar toc" "sidebar content"; }
  :root .introduction-sidebar { display: block; }
  :root .introduction-toc { grid-area: toc; width: 100%; }
  :root .introduction main { grid-area: content; padding-top: 0; width: 100%; }
}
@media (min-width: 1280px) {
  :root .introduction-shell,
  :root .document-main { width: min(1204px, 100% - 48px); grid-template-columns: 220px minmax(0, 720px) 200px; }
  :root .document-main { grid-template-areas: "sidebar title toc" "sidebar content toc"; }
  :root .introduction-shell { grid-template-areas: "sidebar content toc"; }
  :root .introduction-toc { display: block; }
  :root .document-toc { grid-area: toc; align-self: start; position: sticky; top: 24px; }
  :root .document-toc .document-menu { padding: 0 0 0 16px; margin: 0; border: 0; border-left: 1px solid var(--border-default); border-radius: 0; background: transparent; max-height: calc(100vh - 48px); overflow-y: auto; }
  :root .document-toc .document-desktop-menu { display: block; }
  :root .document-toc .document-collapsible { display: none; }
}
@media (max-width: 1023px) {
  :root .introduction-sidebar { display: block; width: min(720px, 100% - 40px); margin: 24px auto 0; }
  :root .introduction main { padding-top: 20px; }
}
@media (max-width: 600px) {
  :root .grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  :root h1 { font-size: 30px; }
  :root .document-main h1 { font-size: 28px; }
  :root .site-nav { gap: 16px; }
  :root .nav-links { gap: 8px 14px; font-size: 12px; }
  :root .invitation { font-size: 23px; }
}
/* Lettering lives only in the outer margins, clear of both navigation columns. */
:root[data-theme="opus"] { --document-accent: #88631f; }
@media (min-width: 1440px) {
  :root .background-motto { display: flex; inset: 0 16px; align-items: center; }
  .background-motto svg { width: clamp(48px, calc((100vw - 1268px) / 2), 100px); height: min(480px, 65vh); fill: var(--document-accent); opacity: .09; }
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --surface-page: #101010;
    --surface-card: #1f1f1f;
    --surface-panel: #222;
    --surface-hover: #334155;
    --text-primary: #f3f4f6;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-default: #444;
    --selection-accent: #fbbf24;
    --selection-bg: rgba(91,65,0,.55);
    --fragment-accent: #60a5fa;
    --font-reading: system-ui, -apple-system, "Segoe UI", sans-serif;
    --button-primary-bg: #2563eb;
    --button-primary-text: #fff;
    --button-secondary-bg: #374151;
    --button-secondary-text: #e5e7eb;
    --button-secondary-border: #4b5563;
    --button-radius: 8px;
  }
}
