:root {
  --bg: #655040;
  --bg-panel: #574436;
  --bg-panel-2: #FAF8F5;
  --bg-deep: #4A3A2E;
  --border: #7A6453;
  --accent: #F5622A;
  --accent-dark: #C94A17;
  --text: #F6EFE6;
  --text-muted: #CBBBA9;
  --success: #8DBF7A;
  --warn: #E8B04B;
  --error: #E5574A;
  --ink: #2A211A;
  --ink-muted: #6B5D51;
  --surface: #FFFFFF;
  --rule-light: #ECE5DC;
  --rule-soft: #F3EEE8;
  --accent-ink: #A23C15;

  --door-a: #7A5E49;
  --door-b: #6A513F;
  --frame: var(--bg-deep);
  --cornice: var(--border);
  --plaster: var(--bg-panel);
  --brass: #BC9D6C;
  --brass-edge: #86683F;
  --slot: #2B2019;
  --envelope: #EFE6D6;
  --lamp: #F2C677;
  --cat-line: var(--surface);
  --shade-top: rgba(43,32,25,.45);
  --shade-bottom: rgba(43,32,25,.78);
  --veil: rgba(246,239,230,.08);
  --veil-strong: rgba(246,239,230,.14);
  --hairline-dark: rgba(246,239,230,.24);
  --menu-shade: rgba(43,32,25,.66);
  --clear: transparent;
  --shadow-note: 0 22px 44px rgba(24,16,11,.42), 0 4px 10px rgba(24,16,11,.24);

  --font-display: Georgia, "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "Times New Roman", serif;
  --font-body: "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --size-h1: clamp(34px, 3.4vw, 48px);
  --size-hero: clamp(30px, 3.4vw, 48px);
  --size-h2: clamp(26px, 2.5vw, 36px);
  --size-h3: 21px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-dot: 50%;
  --wrap: 1280px;
  --reading: 80ch;
  --gutter: 40px;
  --strip-h: 36px;
  --bar-h: 72px;
  --touch: 44px;
  --section-pad: clamp(48px, 7vw, 96px);
  --card-pad: clamp(16px, 2.4vw, 28px);
  --quick: .15s ease;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html.nav-open { overflow: hidden; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; }
img { display: block; max-inline-size: 100%; }
ul[role="list"], .clean-list { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p, pre, figure { margin: 0; }
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.2;
  text-wrap: balance;
}
h1 { font-size: var(--size-h1); }
h2 { font-size: var(--size-h2); }
h3 { font-size: var(--size-h3); }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}
.nowrap { white-space: nowrap; }
.wrap {
  inline-size: 100%;
  max-inline-size: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
  min-width: 0;
}
.reading { max-inline-size: calc(var(--reading) + var(--gutter) * 2); }
.sec { padding-block: var(--section-pad); }
.paper-band { background: var(--bg-panel-2); color: var(--ink); }
.brown-band { background: var(--bg); color: var(--text); }
.section-intro { max-inline-size: 64ch; margin-block-end: 28px; }
.section-intro p { margin-block-start: 10px; }
.tag {
  font: 500 12px/1.6 var(--font-mono);
  letter-spacing: .14em;
  color: var(--ink-muted);
  text-transform: uppercase;
}
.brown-band .tag, .field-manual .tag { color: var(--text-muted); }
.faq-heading > .tag,
.tutorial-step > .tag,
[aria-labelledby="client-notes"] > .section-intro > .tag { color: var(--text); }
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 20px;
}
.grid-cards > *, .foot-grid > *, .feature-grid > *, .palette-grid > * { min-width: 0; }
.pile > * + * { margin-block-start: 16px; }
.panel, .card {
  min-width: 0;
  padding: var(--card-pad);
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--rule-light);
  border-radius: var(--radius-md);
  overflow-wrap: anywhere;
}
.brown-band .panel {
  background: var(--bg-panel);
  color: var(--text);
  border-color: var(--border);
}
.prose, .article-body { min-width: 0; overflow-wrap: anywhere; }
.prose > * + *, .article-body > * + * { margin-block-start: 1em; }
.prose :is(h2,h3):not(:first-child), .article-body :is(h2,h3):not(:first-child) {
  margin-block-start: 1.8em;
}
.prose :is(ul,ol), .article-body :is(ul,ol) { padding-inline-start: 1.6em; }
.prose a:not(.btn,.dl-fab), .article-body a:not(.btn,.dl-fab), .text-link {
  text-decoration: underline;
  text-underline-offset: .22em;
}
:where(section, h2, h3, [role="tabpanel"])[id] { scroll-margin-block-start: 80px; }

code, pre, kbd { font-family: var(--font-mono); }
code { overflow-wrap: anywhere; }
pre {
  max-width: 100%;
  min-width: 0;
  padding: 15px 18px;
  overflow-x: auto;
  border-radius: var(--radius-md);
  font-size: .875rem;
  line-height: 1.7;
  background: var(--bg-panel);
  color: var(--text);
}
pre code { overflow-wrap: normal; white-space: pre; }
:where(.decor-clip, .wall-hero) { overflow-x: clip; }
:where(.icon, .dot, .btn svg, .brand img) { flex-shrink: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  max-inline-size: 100%;
  min-height: var(--touch);
  padding: 0 20px;
  text-align: center;
  font-family: var(--font-body);
  font-weight: 600;
  border: 1.5px solid var(--clear);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color var(--quick), color var(--quick), border-color var(--quick);
}
.btn-s { min-height: 42px; padding-inline: 20px; font-size: 15px; }
.btn-l { min-height: 54px; padding-inline: 32px; font-size: 16.5px; }
.btn-solid { background: var(--accent); color: var(--ink); border-color: var(--accent); }
.btn-solid:hover, .btn-solid.is-hover { background: var(--accent-dark); color: var(--surface); border-color: var(--accent-dark); }
.btn-line { background: var(--clear); color: var(--accent-ink); border-color: var(--accent); }
.btn-line:hover, .btn-line.is-hover { background: var(--rule-soft); color: var(--accent-ink); }
.btn-line-light { background: var(--clear); color: var(--text); border-color: var(--text); }
.btn-line-light:hover, .btn-line-light.is-hover { background: var(--bg-panel); color: var(--text); }
.btn:active, .btn.is-pressed { background: var(--bg-deep); color: var(--text); border-color: var(--bg-deep); }
.btn.is-focus { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn:disabled { background: var(--rule-soft); color: var(--ink-muted); border-color: var(--rule-light); cursor: not-allowed; }
.btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The header has its own width constraint. */
.hall-head { background: var(--surface); color: var(--ink); position: relative; z-index: 30; }
.hall-inner {
  inline-size: 100%;
  max-width: min(100%, calc(1280px + var(--gutter) * 2));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.hall-strip { position: relative; z-index: 3; border-bottom: 1px solid var(--rule-soft); font-size: 13px; color: var(--ink-muted); }
.hall-strip .hall-inner { height: var(--strip-h); display: flex; align-items: center; justify-content: space-between; }
.hall-strip-links { display: flex; align-items: center; gap: 28px; }
.hall-strip-links a { transition: color var(--quick); }
.hall-strip-links a:hover { color: var(--ink); }
.lang { position: relative; flex-shrink: 0; }
.lang summary, .lang-button {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  padding: 0;
  background: var(--clear);
  color: var(--ink);
  font-weight: 500;
}
.lang summary::-webkit-details-marker { display: none; }
.lang svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.4; flex-shrink: 0; }
.lang .caret { font-size: 11px; color: var(--ink-muted); }
.lang-list {
  position: absolute;
  inset-block-start: calc(100% + 8px);
  inset-inline-start: -12px;
  min-width: 150px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--rule-light);
  border-radius: var(--radius-md);
}
.lang-list a { display: block; padding: 7px 10px; border-radius: var(--radius-sm); }
.lang-list a:hover { background: var(--rule-soft); color: var(--ink); }
.hall-head a[aria-current="true"] { font-weight: 600; }
.hall-bar { position: relative; z-index: 2; }
.hall-bar .hall-inner { height: var(--bar-h); display: flex; align-items: center; gap: 48px; }
.brand { display: inline-flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand img { width: 36px; height: 36px; }
.brand-name { font-size: 19px; font-weight: 600; letter-spacing: .01em; }
.hall-nav { min-width: 0; font-size: 15.5px; }
.hall-nav ul {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.36vw, 34px);
  list-style: none;
  margin: 0;
  padding: 0;
}
.hall-nav a { display: block; padding-block: 6px; white-space: nowrap; transition: color var(--quick); }
.hall-nav a:hover { color: var(--accent-ink); }
.hall-head a[aria-current="page"] {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 7px;
}
.hall-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.hall-actions .btn { white-space: nowrap; }
.hall-actions .btn-solid, .wall-hero .btn-solid { color: var(--surface); }
.hall-tools, .hall-drawer, .hall-veil, .preview-menu { display: none; }
.hall-toggle, .preview-menu summary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: var(--touch);
  min-height: var(--touch);
  padding: 0;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--rule-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  list-style: none;
}
.preview-menu summary::-webkit-details-marker { display: none; }
.hall-toggle svg, .preview-menu svg { width: 21px; height: 21px; }

.hall-foot {
  background: var(--bg-deep);
  color: var(--text);
  padding-block: 54px 24px;
}
.foot-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, .75fr) minmax(0, 1.1fr) minmax(0, .75fr);
  gap: 30px;
}
.hall-foot h2 { font: 600 15px/1.4 var(--font-body); margin-block-end: 12px; }
.hall-foot p { margin-block-start: 10px; color: var(--text-muted); }
.hall-foot li + li { margin-block-start: 6px; }
.hall-foot a:hover { text-decoration: underline; text-underline-offset: .22em; }
.hall-foot a[aria-current="true"] { font-weight: 600; }
.foot-end {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 9px 24px;
  margin-block-start: 36px;
  padding-block-start: 18px;
  border-top: 1px solid var(--hairline-dark);
  color: var(--text-muted);
  font-size: 14px;
}
.foot-end ul { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.foot-end li + li { margin: 0; }

.reveal-armed .reveal { transition: opacity .42s ease; }
.reveal-armed .reveal:not(.shown):not(:focus-within) { opacity: 0; }

@media (max-width: 1240px) {
  .hall-bar .hall-inner { gap: 32px; }
  .hall-nav ul { gap: 24px; }
  .hall-nav { font-size: 15px; }
}
@media (max-width: 1280px) {
  html:not(:lang(zh-CN)) .hall-head { --drawer-mode: block; }
}
@media (max-width: 1080px) {
  .hall-head { --drawer-mode: block; }
}
@container not (width > 0px) {
  .hall-drawer[hidden] { display: none; }
}
/* Keep the language-specific breakpoints aligned with the header script. */
@media (max-width: 1280px) {
  html:not(:lang(zh-CN)) .hall-nav, html:not(:lang(zh-CN)) .hall-actions .btn-line { display: none; }
  html:not(:lang(zh-CN)) .hall-tools { display: block; margin-inline-start: 0; flex-shrink: 0; }
  html:not(:lang(zh-CN)) .hall-drawer, html:not(:lang(zh-CN)) .hall-veil { display: var(--drawer-mode); }
}
@media (max-width: 1080px) {
  .hall-bar .hall-inner { gap: 12px; }
  .hall-nav, .hall-actions .btn-line { display: none; }
  .hall-actions { margin-inline-start: auto; }
  .hall-tools, .preview-menu { display: block; margin-inline-start: 0; flex-shrink: 0; }
  .hall-drawer, .hall-veil { display: var(--drawer-mode); }
  .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.hall-head .hall-drawer, .preview-menu .hall-drawer {
  position: absolute;
  z-index: 2;
  inset-block-start: 100%;
  inset-inline: 0;
  max-height: calc(100dvh - var(--strip-h) - var(--bar-h) - 1px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px var(--gutter) 16px;
  background: var(--surface);
  color: var(--ink);
  border-block-start: 1px solid var(--rule-light);
}
.hall-drawer a {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: var(--touch);
  padding: 8px 12px;
  border-bottom: 1px solid var(--rule-soft);
}
.hall-drawer a:hover { background: var(--rule-soft); color: var(--ink); }
.hall-veil {
  position: fixed;
  z-index: 1;
  inset: calc(var(--strip-h) + var(--bar-h) + 1px) 0 0;
  background: var(--menu-shade);
  color: var(--text);
}
@media (max-width: 768px) {
  :root { --gutter: 24px; --size-h1: clamp(24px, 5vw, 30px); }
}
@media (max-width: 640px) {
  .tilt, .slip-card { transform: none; }
}
@media (max-width: 600px) {
  :root { --gutter: 20px; }
  .hall-strip-links { gap: 18px; }
  .brand-name { font-size: 17px; }
  .hall-bar .hall-inner { gap: 8px; }
  .hall-bar .hall-actions { display: none; }
  .hall-bar .brand { flex: 1; min-width: 0; }
  .hall-bar .brand img { flex: none; }
  .hall-bar .brand-name { min-width: 0; overflow-wrap: anywhere; }
  .hall-head .hall-tools { display: block; }
  .btn-l { min-height: 50px; }
}
@media (max-width: 360px) {
  :root { --gutter: 16px; }
  .hall-bar .brand { gap: 6px; }
  .hall-bar .brand img { width: 30px; height: 30px; }
  .hall-actions .btn-s { padding-inline: 9px; }
  .foot-grid { column-gap: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .reveal-armed .reveal:not(.shown) { opacity: 1; }
}