:root {
  --bg: #F7F9F9;
  --panel: #FFFFFF;
  --panel-blue: #EDF4F6;
  --border: #DCE4E1;
  --accent: #367C64;
  --accent-dark: #285D4B;
  --text: #28312E;
  --muted: #626E69;
  --subtle: #808C86;
  --mint: #EAF4EE;
  --code-bg: #F5F8F7;
  --success: #367C64;
  --warn: #806B42;
  --error: #985A60;
  --clear: transparent;
  --halo-blue: rgba(216, 235, 242, .72);
  --halo-mint: rgba(207, 233, 220, .64);
  --veil: rgba(40, 49, 46, .18);
  --shadow-window: 0 28px 65px rgba(43, 74, 62, .10), 0 4px 12px rgba(43, 74, 62, .05);
  --shadow-card: 0 18px 40px rgba(43, 74, 62, .12), 0 3px 8px rgba(43, 74, 62, .045);
  --shadow-button: 0 5px 12px rgba(54, 124, 100, .15);
  --body: 'Inter', 'Noto Sans SC', 'PingFang TC', 'Hiragino Sans', 'Yu Gothic', 'Malgun Gothic', sans-serif;
  --display: 'Inter', 'Noto Sans SC', 'PingFang TC', 'Hiragino Sans', 'Yu Gothic', 'Malgun Gothic', sans-serif;
  --mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  --text-micro: 9px;
  --text-xs: 11px;
  --text-sm: 12px;
  --text-note: 13px;
  --text-ui: 14px;
  --text-nav: 15px;
  --text-body: 17px;
  --text-brand: 21px;
  --text-section: 24px;
  --text-heading: clamp(24px, 2.3vw, 32px);
  --text-title: clamp(34px, 3.34vw, 48px);
  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-display: 800;
  --leading-body: 1.85;
  --leading-ui: 1.5;
  --leading-title: 1.3;
  --leading-code: 1.95;
  --tracking-label: .12em;
  --radius-window: 28px;
  --radius-card: 20px;
  --radius-button: 12px;
  --radius-small: 8px;
  --radius-pill: 999px;
  --line: 1px;
  --line-strong: 2px;
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 20px;
  --s6: 24px;
  --s7: 28px;
  --s8: 32px;
  --s9: 40px;
  --s10: 48px;
  --s11: 64px;
  --s12: 80px;
  --s13: 96px;
  --gutter: 24px;
  --content: 1320px;
  --reading: 880px;
  --header: 80px;
  --icon: 18px;
  --touch: 44px;
  --action-height: 52px;
  --platform-height: 34px;
  --duration: 180ms;
  --reveal-duration: 500ms;
  --reveal-distance: 12px;
  --layer-veil: 18;
  --layer-header: 20;
  --layer-fab: 12;
  --layer-menu: 24;
  --bench-width: 980px;
  --stage-height: 460px;
  --window-left: 70px;
  --window-width: 680px;
  --window-height: 420px;
  --window-bar: 62px;
  --rail-width: 132px;
  --dot-size: 7px;
  --dot-gap: 6px;
  --setting-height: 51px;
  --setting-safe-width: 340px;
  --note-width: 270px;
  --override-width: 230px;
  --merge-width: 330px;
  --table-width: 620px;
  --toc-width: 230px;
  --swatch-height: 72px;
}
*,
*::before,
*::after { box-sizing: border-box; }
html {
  background: var(--bg);
  color: var(--text);
  scroll-behavior: smooth;
  scroll-padding-top: var(--s6);
  -webkit-text-size-adjust: 100%;
}
html.nav-open { overflow: hidden; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: var(--text-body);
  font-weight: var(--weight-normal);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
h1, h2, h3, h4, p, figure, pre, blockquote, dl, dd { margin: 0; }
h1, h2, h3 {
  font-family: var(--display);
  line-height: var(--leading-title);
  text-wrap: balance;
  overflow-wrap: anywhere;
}
h1 { font-size: var(--text-title); font-weight: var(--weight-display); }
h2 { font-size: var(--text-heading); font-weight: var(--weight-bold); }
h3 { font-size: var(--text-brand); font-weight: var(--weight-semibold); }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-dark); }
a, button, summary { -webkit-tap-highlight-color: var(--clear); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
button, a, summary { touch-action: manipulation; }
:focus-visible {
  outline: var(--line-strong) solid var(--accent);
  outline-offset: var(--s1);
}
img, video { display: block; max-width: 100%; height: auto; }
svg { display: block; flex-shrink: 0; }
main, section, article, aside, nav, header, footer,
.wrap > *, .card-grid > *, .split > * { min-width: 0; }
code, kbd, samp { font-family: var(--mono); font-size: .88em; overflow-wrap: anywhere; }
pre {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  padding: var(--s5);
  background: var(--code-bg);
  color: var(--text);
  border: var(--line) solid var(--border);
  border-radius: var(--radius-small);
  line-height: var(--leading-code);
  tab-size: 2;
}
pre code { font-size: var(--text-ui); white-space: pre; overflow-wrap: normal; word-break: normal; }
table { border-collapse: collapse; }
th { text-align: left; font-weight: var(--weight-semibold); }
ul, ol { padding-left: var(--s6); }
strong { font-weight: var(--weight-semibold); }
::selection { background: var(--mint); color: var(--accent-dark); }
.wrap {
  width: 100%;
  max-width: calc(var(--content) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.reading { max-width: calc(var(--reading) + var(--gutter) * 2); }
.section { padding-top: var(--s12); padding-bottom: var(--s12); }
.section-white { background: var(--panel); color: var(--text); }
.section-wash {
  background: linear-gradient(120deg, var(--panel-blue), var(--mint));
  color: var(--text);
}
.section-heading { margin-bottom: var(--s8); }
.section-heading p { margin-top: var(--s3); color: var(--muted); }
.stack > * + * { margin-top: var(--s5); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s8); }
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s6); }
.prose { overflow-wrap: anywhere; }
.prose > * + * { margin-top: var(--s5); }
.prose h2 { margin-top: var(--s11); }
.prose h3 { margin-top: var(--s8); }
.prose a:not(.action) { color: var(--accent-dark); text-decoration: underline; text-underline-offset: var(--s1); }
.prose li + li { margin-top: var(--s2); }
.prose :not(pre) > code {
  padding: 0 var(--s1);
  background: var(--code-bg);
  color: var(--text);
  border-radius: var(--radius-small);
  overflow-wrap: anywhere;
}
.muted { color: var(--muted); }
.text-link { color: var(--accent-dark); text-decoration: underline; text-underline-offset: var(--s1); }
.keyword { white-space: nowrap; }
.accent { color: var(--accent); }
.eyebrow { color: var(--accent-dark); font-size: var(--text-note); font-weight: var(--weight-semibold); }
.sr-only {
  position: absolute;
  width: var(--line);
  height: var(--line);
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  left: var(--s4);
  top: var(--s4);
  z-index: var(--layer-menu);
  padding: var(--s3) var(--s5);
  background: var(--panel);
  color: var(--accent-dark);
  border-radius: var(--radius-small);
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }
.line-icon {
  width: var(--icon);
  height: var(--icon);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s3); margin-top: var(--s5); }
.actions-start { justify-content: flex-start; }
.action {
  min-height: var(--action-height);
  padding: var(--s2) var(--s7);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s3);
  max-width: 100%;
  border: var(--line) solid var(--border);
  border-radius: var(--radius-button);
  font-size: var(--text-body);
  line-height: var(--leading-ui);
  font-weight: var(--weight-semibold);
  text-align: center;
  background: var(--panel);
  color: var(--text);
  transition: background var(--duration), border-color var(--duration), color var(--duration);
}
.action-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--panel);
  box-shadow: var(--shadow-button);
}
.action-primary:hover, .action-primary.is-hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: var(--panel);
}
.action-secondary:hover, .action-secondary.is-hover { border-color: var(--accent); color: var(--accent-dark); }
.action:active, .action.is-pressed { box-shadow: none; border-color: var(--accent-dark); }
.action.is-focus { outline: var(--line-strong) solid var(--accent); outline-offset: var(--s1); }
.action:disabled, .action[aria-disabled="true"] {
  background: var(--panel-blue);
  color: var(--muted);
  border-color: var(--border);
  box-shadow: none;
  cursor: not-allowed;
}
.panel, .card {
  min-width: 0;
  padding: var(--s8);
  background: var(--panel);
  color: var(--text);
  border: var(--line) solid var(--border);
  border-radius: var(--radius-window);
}
.card { border-radius: var(--radius-card); }
.panel-raised { box-shadow: var(--shadow-window); }
.card-raised { box-shadow: var(--shadow-card); }
.card > * + * { margin-top: var(--s4); }
.card-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); }
.card-header > * { min-width: 0; }

/* 装饰只在受约束的局部区域内绘制，不裁切正文容器。 */
.decorated { position: relative; isolation: isolate; overflow-x: clip; }
.decoration { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.decoration svg { width: 100%; height: 100%; }
.reveal { opacity: 1; }
.reveal.reveal-pending { opacity: 0; transform: translateY(var(--reveal-distance)); }
.reveal.shown {
  opacity: 1;
  transform: none;
  transition: opacity var(--reveal-duration), transform var(--reveal-duration);
}

/* 页头拥有独立的宽版心，不复用阅读版心。 */
.mast { height: var(--header); position: relative; z-index: var(--layer-header); }
.mast-inner {
  width: 100%;
  max-width: min(100%, calc(var(--content) + var(--gutter) * 2));
  height: 100%;
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s8);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: var(--s3);
  white-space: nowrap;
  font-size: var(--text-brand);
  font-weight: var(--weight-bold);
}
.brand-mark { width: var(--s9); height: var(--s9); flex-shrink: 0; }
.navigation { display: flex; align-items: center; gap: var(--s2); margin-left: auto; }
.navigation a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  padding: var(--s2) var(--s3);
  font-size: var(--text-nav);
  font-weight: var(--weight-medium);
  color: var(--muted);
  border-radius: var(--radius-small);
  white-space: nowrap;
}
.navigation a[aria-current="page"] { color: var(--accent-dark); background: var(--mint); }
.navigation a:hover { color: var(--accent-dark); }
.header-tools { display: flex; align-items: center; gap: var(--s3); flex-shrink: 0; position: relative; }
.language {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: var(--touch);
  border: 0;
  border-left: var(--line) solid var(--border);
  padding: 0 0 0 var(--s6);
  background: var(--clear);
  color: var(--muted);
  font-size: var(--text-ui);
  white-space: nowrap;
}
.language-short { display: none; }
.language-menu {
  position: absolute;
  right: 0;
  top: calc(100% + var(--s2));
  min-width: max-content;
  padding: var(--s2);
  background: var(--panel);
  color: var(--text);
  border: var(--line) solid var(--border);
  border-radius: var(--radius-button);
  box-shadow: var(--shadow-card);
}
.language-menu a {
  display: flex;
  align-items: center;
  min-height: var(--touch);
  padding: var(--s2) var(--s4);
  border-radius: var(--radius-small);
}
.language-menu a:hover, .language-menu a[aria-current="true"] { background: var(--mint); color: var(--accent-dark); }
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: var(--touch);
  min-height: var(--touch);
  padding: var(--s2);
  border: var(--line) solid var(--border);
  border-radius: var(--radius-small);
  background: var(--panel);
  color: var(--text);
}
.mobile-drawer { display: none; }
.nav-veil {
  position: fixed;
  inset: var(--header) 0 0;
  z-index: var(--layer-veil);
  border: 0;
  background: var(--veil);
  color: var(--text);
}
.drawer-label { padding: var(--s4) var(--s4) var(--s2); color: var(--muted); font-size: var(--text-sm); }
.site-footer {
  padding-top: var(--s11);
  padding-bottom: calc(var(--s12) + env(safe-area-inset-bottom));
  border-top: var(--line) solid var(--border);
  background: var(--panel);
  color: var(--text);
}
.footer-grid { display: grid; grid-template-columns: 1.35fr .8fr 1.2fr .7fr; gap: var(--s9); }
.footer-grid > * { min-width: 0; }
.footer-brand p { margin-top: var(--s4); max-width: var(--note-width); color: var(--muted); font-size: var(--text-ui); }
.footer-heading { font-size: var(--text-nav); font-weight: var(--weight-semibold); margin-bottom: var(--s4); }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li + li { margin-top: var(--s2); }
.footer-links a { font-size: var(--text-ui); color: var(--muted); overflow-wrap: anywhere; }
.footer-links a:hover, .footer-links a[aria-current="true"] { color: var(--accent-dark); text-decoration: underline; text-underline-offset: var(--s1); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s4);
  margin-top: var(--s10);
  padding-top: var(--s6);
  border-top: var(--line) solid var(--border);
  color: var(--muted);
  font-size: var(--text-note);
}
.preview-language { position: relative; }
.preview-language > summary { list-style: none; cursor: pointer; }
.preview-language > summary::-webkit-details-marker { display: none; }

@media (max-width: 1100px) {
  .mast-inner { gap: var(--s4); }
  .navigation { gap: 0; }
  .navigation a { padding: var(--s2); font-size: var(--text-ui); }
  .language { padding-left: var(--s4); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .navigation { display: none; }
  .header-tools { margin-left: auto; }
  .menu-toggle { display: inline-flex; }
  .mobile-drawer:not([hidden]) {
    display: block;
    position: absolute;
    z-index: var(--layer-menu);
    top: var(--header);
    left: 0;
    right: 0;
    max-height: calc(100dvh - var(--header));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: var(--s3) var(--gutter) var(--s6);
    border-bottom: var(--line) solid var(--border);
    background: var(--panel);
    color: var(--text);
    box-shadow: var(--shadow-card);
  }
  .mobile-drawer a {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: var(--touch);
    gap: var(--s3);
    padding: var(--s3) var(--s4);
    border-radius: var(--radius-small);
  }
  .mobile-drawer a:hover,
  .mobile-drawer a[aria-current] { background: var(--mint); color: var(--accent-dark); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .preview-mast { height: auto; min-height: var(--header); }
  .preview-mast .mast-inner { flex-wrap: wrap; padding-top: var(--s3); padding-bottom: var(--s3); }
  .preview-mast .navigation {
    display: flex;
    order: 3;
    flex-basis: 100%;
    flex-wrap: wrap;
    justify-content: center;
    margin: 0;
  }
}
@media (max-width: 768px) {
  :root { --text-title: clamp(24px, 6.7vw, 30px); }
}
@media (max-width: 640px) {
  :root {
    --gutter: 16px;
    --header: 72px;
    --text-heading: 24px;
  }
  .section { padding-top: var(--s10); padding-bottom: var(--s10); }
  .card-grid, .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .panel, .card { padding: var(--s5); }
  .wordmark { font-size: var(--text-body); gap: var(--s2); }
  .brand-mark { width: var(--s8); height: var(--s8); }
  .mast-inner { gap: var(--s2); }
  .header-tools { gap: var(--s2); margin-left: auto; }
  .language { border: 0; padding: 0 var(--s1); font-size: var(--text-sm); }
  .language > .line-icon { display: none; }
  .language-full { display: none; }
  .language-short { display: inline; }
  .action { min-height: var(--s10); font-size: var(--text-ui); padding-inline: var(--s5); }
  .tilt, [data-tilt] { transform: none !important; }
  .footer-grid { gap: var(--s8); }
  .preview-mast .navigation { gap: 0; justify-content: space-between; }
  .preview-mast .navigation a { padding: var(--s1); font-size: var(--text-xs); }
  .preview-mast .navigation .line-icon { width: var(--s3); height: var(--s3); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal.reveal-pending { opacity: 1; transform: none; }
}