:root {
  color-scheme: light;
  --bg: #F7F2E8;
  --bg-panel: #FFFCF6;
  --bg-panel-2: #EFE7D8;
  --hero-top: #FBF7EF;
  --hero-bottom: #F1E9DA;
  --header-bg: rgba(251,247,239,.88);
  --border: #E2D8C6;
  --border-soft: rgba(42,34,27,.07);
  --border-strong: #CFC2AC;
  --accent: #7A66D1;
  --accent-dark: #5646A8;
  --accent-tint: #ECE6FA;
  --accent-wash: rgba(122,102,209,.08);
  --accent-soft: rgba(122,102,209,.22);
  --accent-line: rgba(122,102,209,.34);
  --on-accent: #FFFCF6;
  --text: #2A221B;
  --text-muted: #6E6355;
  --text-faint: #85786A;
  --success: #2F8A5B;
  --success-wash: rgba(47,138,91,.16);
  --warn: #B7791F;
  --error: #C2453A;
  --pine-1: #1F3A36;
  --pine-2: #2C5450;
  --pine-glow: rgba(143,199,178,.42);
  --accent-glow: rgba(150,132,232,.55);
  --on-pine: #EEF3EF;
  --on-pine-muted: rgba(238,243,239,.72);
  --on-pine-wash: rgba(238,243,239,.14);
  --flag-red: #C8463D;
  --flag-white: #FBF8F1;
  --flag-blue: #2E3E72;
  --flag-green: #2E7D57;
  --flag-edge: rgba(42,34,27,.16);
  --veil: rgba(42,34,27,.35);
  --clear: transparent;
  --highlight: rgba(255,255,255,.9);
  --highlight-strong: rgba(255,255,255,.95);
  --highlight-edge: rgba(255,255,255,.6);
  --hl-inset: inset 0 1px 0 rgba(255,255,255,.9);
  --shadow-panel: 0 24px 48px rgba(122,102,209,.10),0 1px 2px rgba(42,34,27,.06),inset 0 1px 0 rgba(255,255,255,.9);
  --shadow-card: 0 24px 48px rgba(122,102,209,.12),0 6px 16px rgba(31,58,54,.10),inset 0 1px 0 rgba(255,255,255,.95),inset 0 0 0 1px rgba(255,255,255,.6);
  --shadow-float: 0 16px 40px rgba(122,102,209,.12),0 2px 6px rgba(42,34,27,.08),inset 0 1px 0 rgba(255,255,255,.95);
  --shadow-stage: 0 32px 64px rgba(31,58,54,.20),0 12px 48px rgba(122,102,209,.10);
  --shadow-win: 0 -1px 0 rgba(255,255,255,.55),0 30px 70px rgba(8,20,18,.38),inset 0 1px 0 rgba(255,255,255,.95);
  --shadow-btn: 0 10px 24px rgba(122,102,209,.26),inset 0 1px 0 rgba(255,255,255,.28);
  --focus-ring: 0 0 0 3px rgba(122,102,209,.35);
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 10px;
  --radius-tiny: 4px;
  --radius-flag: 3px;
  --radius-round: 50%;
  --radius-pill: 999px;
  --font-display: "Inter","Noto Sans SC","PingFang SC","Hiragino Sans","Microsoft YaHei","Apple SD Gothic Neo","Malgun Gothic",system-ui,sans-serif;
  --font-body: "Inter","Noto Sans SC","PingFang SC","Hiragino Sans","Microsoft YaHei","Apple SD Gothic Neo","Malgun Gothic",system-ui,sans-serif;
  --font-mono: "JetBrains Mono",ui-monospace,"SFMono-Regular",Menlo,Consolas,monospace;
  --size-body: 17px;
  --size-h1: clamp(52px,4.4vw,64px);
  --size-h2: clamp(28px,3vw,40px);
  --size-h3: 23px;
  --size-small: 14px;
  --size-tiny: 12px;
  --weight-normal: 400;
  --weight-medium: 500;
  --weight-bold: 600;
  --leading-body: 1.7;
  --leading-title: 1.15;
  --tracking-title: -.02em;
  --gutter: 40px;
  --content-width: 1280px;
  --reading-width: 800px;
  --header-height: 68px;
  --anchor-offset: 84px;
  --toc-offset: 88px;
  --toc-landing: 156px;
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-6: 48px;
  --space-8: 64px;
  --space-10: 80px;
  --ease: cubic-bezier(.2,.7,.2,1);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .16 0 0 0 0 .13 0 0 0 0 .1 1.4 0 0 0 -.35'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  --grain-page: .09;
  --grain-stage: .12;
}
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { background: var(--bg); scroll-padding-top: var(--anchor-offset); scroll-behavior: smooth; }
html.nav-open { overflow: hidden; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--size-body);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: var(--grain);
  opacity: var(--grain-page);
  pointer-events: none;
  z-index: 40;
}
a { color: inherit; text-underline-offset: 4px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button, .btn { border: 0; }
:where(a,button,input,select,textarea,summary,[tabindex]):focus-visible {
  outline: 2px solid var(--accent-dark);
  outline-offset: 3px;
  box-shadow: var(--focus-ring);
}
img { display: block; max-width: 100%; height: auto; }
svg { flex-shrink: 0; }
ul, ol { list-style: none; }
[hidden] { display: none !important; }
.wrap {
  width: 100%;
  max-width: calc(var(--content-width) + var(--gutter) * 2);
  padding-inline: var(--gutter);
  margin-inline: auto;
}
.reading-wrap { width: 100%; max-width: calc(var(--reading-width) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-top: var(--space-10); padding-bottom: var(--space-10); }
.section-head { margin-bottom: var(--space-4); max-width: 48em; }
.section-head p { margin-top: var(--space-2); color: var(--text-muted); }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: var(--weight-medium); text-wrap: balance; overflow-wrap: break-word; }
h1 { font-size: var(--size-h1); line-height: var(--leading-title); letter-spacing: var(--tracking-title); }
h2 { font-size: var(--size-h2); line-height: 1.25; letter-spacing: var(--tracking-title); }
h3 { font-size: var(--size-h3); line-height: 1.35; }
.no-break { white-space: nowrap; }
.muted { color: var(--text-muted); }
.kicker { font-size: var(--size-tiny); color: var(--text-muted); letter-spacing: .06em; margin-bottom: var(--space-2); }
.prose { min-width: 0; overflow-wrap: break-word; }
.prose p, .prose ul, .prose ol, .prose pre, .prose blockquote { margin-block: var(--space-3); }
.prose h2 { margin-top: var(--space-8); margin-bottom: var(--space-3); }
.prose h3 { margin-top: var(--space-4); margin-bottom: var(--space-2); }
.prose ul { list-style: disc; padding-left: var(--space-3); }
.prose ol { list-style: decimal; padding-left: var(--space-3); }
.prose li + li { margin-top: var(--space-1); }
code { font-family: var(--font-mono); font-size: .88em; overflow-wrap: anywhere; background: var(--bg-panel-2); border-radius: var(--radius-tiny); padding: .1em .3em; }
pre { min-width: 0; max-width: 100%; overflow-x: auto; background: var(--bg-panel-2); padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius); }
pre code { padding: 0; white-space: pre; overflow-wrap: normal; }
.panel, .paper-card { background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-panel); padding: var(--space-4); min-width: 0; }
.panel-inset { background: var(--bg-panel-2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-4); min-width: 0; }
.grid-two { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--space-3); }
.grid-three { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: var(--space-3); }
.grid-two > *, .grid-three > * { min-width: 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 26px; font-family: var(--font-body);
  font-size: 16px; line-height: 24px; font-weight: var(--weight-medium);
  text-decoration: none; cursor: pointer; border-radius: var(--radius);
  flex-shrink: 0; white-space: nowrap;
  transition: background-color .2s ease, border-color .2s ease, transform .2s ease;
}
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-btn); }
.btn-primary:hover, .btn-primary.is-hover { background: var(--accent-dark); }
.btn-secondary { background: var(--bg-panel); border: 1px solid var(--border-strong); box-shadow: var(--hl-inset); }
.btn-secondary:hover { border-color: var(--accent); }
.btn-text { background: var(--clear); padding-inline: 2px; color: var(--text); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; text-decoration-color: var(--border-strong); }
.btn-text:hover { text-decoration-color: var(--accent); }
.btn:disabled, .btn[aria-disabled="true"] { cursor: not-allowed; opacity: .55; box-shadow: none; }
.btn.is-focus { outline: 2px solid var(--accent-dark); outline-offset: 3px; box-shadow: var(--focus-ring); }
.btn-arrow { transition: transform .2s ease; }
.btn-text:hover .btn-arrow { transform: translateX(3px); }
.cta-row { display: flex; align-items: center; flex-wrap: wrap; gap: 28px; margin-bottom: 24px; }
.ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ico-sm { width: 14px; height: 14px; }
.ico-xs { width: 13px; height: 13px; }
.ico-solid { fill: currentColor; stroke: none; }
.pf { width: 16px; height: 16px; flex: none; fill: currentColor; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.flag { width: 21px; height: 14px; flex: none; border-radius: var(--radius-flag); overflow: hidden; }
.f-r { fill: var(--flag-red); }
.f-w { fill: var(--flag-white); }
.f-b { fill: var(--flag-blue); }
.f-g { fill: var(--flag-green); }
.f-edge { fill: none; stroke: var(--flag-edge); stroke-width: 1; }
.annc { background: var(--accent-tint); color: var(--text); font-size: 14px; line-height: 20px; padding-block: 10px; text-align: center; border-bottom: 1px solid var(--accent-line); }
.annc a { display: inline-block; min-height: 24px; margin-left: 12px; color: var(--accent-dark); font-weight: var(--weight-medium); text-decoration: underline; text-underline-offset: 3px; }
.masthead { position: relative; z-index: 50; background: var(--header-bg); border-bottom: 1px solid var(--border); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.masthead-inner { display: flex; align-items: center; height: var(--header-height); gap: 40px; position: relative; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-family: var(--font-display); font-weight: var(--weight-bold); font-size: 19px; letter-spacing: -.01em; line-height: 1; flex-shrink: 0; min-height: 44px; }
.brand-logo { width: 30px; height: 30px; flex: none; }
.brand-zh { color: var(--text-muted); font-weight: var(--weight-normal); }
.main-nav ul { display: flex; align-items: center; list-style: none; margin: 0; padding: 0; gap: 4px; }
.main-nav a { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; min-height: 36px; border-radius: var(--radius-sm); color: var(--text-muted); text-decoration: none; font-size: 15px; line-height: 22px; white-space: nowrap; transition: background-color .2s ease,color .2s ease; }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--text); background: var(--bg-panel-2); }
.mast-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.language-control { position: relative; }
.lang { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-family: var(--font-body); font-size: 14px; line-height: 22px; color: var(--text-muted); background: var(--clear); border: 0; padding: 8px 10px; border-radius: var(--radius-sm); min-width: 44px; min-height: 44px; width: auto; white-space: nowrap; }
.lang:hover { color: var(--text); background: var(--bg-panel-2); }
.language-menu { position: absolute; right: 0; top: calc(100% + 8px); width: 200px; padding: 8px; background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-float); }
.language-menu a { display: flex; align-items: center; min-height: 44px; padding: 8px 12px; width: 100%; border-radius: var(--radius-sm); text-decoration: none; font-size: 14px; }
.language-menu a:hover, .language-menu a[aria-current="true"] { background: var(--bg-panel-2); }
.nav-login { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 18px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg-panel); color: var(--text); font-size: 15px; font-weight: var(--weight-medium); text-decoration: none; box-shadow: var(--hl-inset); white-space: nowrap; }
.nav-login:hover { border-color: var(--accent-line); }
.menu-toggle { display: none; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius); }
.mobile-nav { position: absolute; inset-inline: var(--gutter); top: 100%; background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-panel); max-height: calc(100dvh - 120px); overflow-y: auto; overscroll-behavior: contain; padding: 12px; }
.mobile-nav a { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 12px; text-decoration: none; font-size: 15px; border-radius: var(--radius-sm); }
.mobile-nav a:hover, .mobile-nav a[aria-current] { background: var(--bg-panel-2); }
.mobile-languages { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 12px; }
.nav-veil { position: fixed; inset: 0; background: var(--veil); border: 0; z-index: 45; cursor: pointer; }
.site-footer { background: var(--bg-panel-2); border-top: 1px solid var(--border); padding-top: var(--space-8); padding-bottom: var(--space-4); }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1.2fr 1fr; gap: var(--space-6); }
.footer-grid > * { min-width: 0; }
.footer-brand p { color: var(--text-muted); font-size: 15px; margin-top: var(--space-2); max-width: 26em; }
.footer-title { font-size: 15px; font-weight: var(--weight-medium); margin-bottom: var(--space-2); }
.footer-links { display: grid; gap: 4px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 28px; font-size: 14px; color: var(--text-muted); text-decoration: none; padding-block: 2px; }
.footer-links a:hover { color: var(--accent-dark); text-decoration: underline; }
.footer-bottom { margin-top: var(--space-6); padding-top: var(--space-3); border-top: 1px solid var(--border-strong); display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2); font-size: 13px; color: var(--text-muted); }
.footer-legal { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.footer-legal a { display: inline-flex; align-items: center; min-height: 28px; }
.reveal { transition: opacity .6s var(--ease),transform .6s var(--ease); }
.reveal.pending { opacity: 0; transform: translateY(16px); }
.reveal.shown { opacity: 1; transform: none; }
#server-status { position: static; display: block; min-width: 0; width: 100%; max-width: 100%; overflow: hidden; margin-block: var(--space-3); }
#server-status + * { margin-top: var(--space-3); }
#server-status > * { min-width: 0; max-width: 100%; }
body:has(.toc-tabs) section[id] { scroll-margin-top: var(--toc-landing); }
@media (max-width: 1180px) {
  .masthead-inner { gap: 20px; }
  .main-nav a { padding-inline: 8px; font-size: 14px; gap: 5px; }
}
@media (max-width: 1024px) {
  .main-nav { display: none; }
  .mast-right { margin-left: auto; }
  .menu-toggle { display: inline-flex; }
  .footer-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 768px) {
  :root { --gutter: 24px; --size-h1: clamp(28px,7vw,40px); --space-10: 48px; }
  .grid-three { grid-template-columns: 1fr; }
  .masthead-inner { gap: 12px; }
  .nav-login { min-height: 44px; }
  .mast-right { gap: 6px; margin-left: auto; }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; --size-h2: 28px; --size-h3: 21px; }
  .no-break { white-space: normal; }
  .grid-two, .footer-grid { grid-template-columns: 1fr; }
  .panel, .paper-card, .panel-inset { padding: 24px; }
  .tilt, [data-tilt] { transform: none; }
  .decoration, .stripe-halo { max-width: 100%; }
  .brand { gap: 7px; font-size: 17px; }
  .brand-logo { width: 26px; height: 26px; }
  .lang { padding-inline: 6px; }
  .nav-login { padding-inline: 12px; font-size: 14px; }
  .annc { font-size: 12px; }
  .footer-grid { gap: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal, .reveal.pending { opacity: 1; transform: none; }
}