:root {
  color-scheme: dark;
  --charcoal: #101113;
  --panel: #1b1a18;
  --field: #141414;
  --ink: #f0e9dc;
  --muted: #c8bcaa;
  --gold: #d4b46e;
  --gold-light: #f6e1a7;
  --line: #675536;
  --control-line: #86734e;
  --focus: #ffdb83;
  --paper: #f6efe2;
  --paper-ink: #221c14;
  --paper-muted: #62513c;
  --paper-line: #cbbc9f;
  --paper-link: #684610;
  --paper-focus: #805413;
  --site-width: 72rem;
  --reading-width: 52rem;
  --gutter: clamp(1rem, 3.5vw, 2rem);
  --serif: ui-serif, "Songti SC", "Noto Serif CJK SC", "Noto Serif SC",
    "Source Han Serif SC", STSong, "SimSun", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-padding-block-start: 8rem;
}

body {
  min-block-size: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: radial-gradient(ellipse at 50% 0, #26221b, transparent 38rem),
    var(--charcoal);
  color: var(--ink);
  font: 1rem/1.7 var(--sans);
}

h1,
h2,
h3,
h4,
h5,
h6,
.brand {
  font-family: var(--serif);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
  margin-block-start: 0;
}

h1 {
  margin-block-end: .65em;
  font-size: clamp(2rem, 5vw, 3.7rem);
}

h2 {
  margin-block-end: .7em;
  font-size: clamp(1.5rem, 3vw, 2.15rem);
}

h3 {
  margin-block-end: .55em;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
}

a {
  color: var(--gold-light);
  text-underline-offset: .22em;
  text-decoration-thickness: .075em;
}

a:hover {
  text-decoration-thickness: .13em;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  inset-block-start: .75rem;
  inset-inline-start: .75rem;
  padding: .65rem 1rem;
  border: 1px solid #533b1c;
  border-radius: .25rem;
  background: var(--gold-light);
  color: #21180a;
  font-weight: 700;
  transform: translateY(calc(-100% - 1rem));
}

.skip-link:focus {
  transform: none;
  outline: 2px solid #17120b;
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--gold-light);
}

.site-header,
.site-footer {
  padding-inline: max(var(--gutter), calc((100% - var(--site-width)) / 2));
}

.site-header {
  position: sticky;
  z-index: 20;
  inset-block-start: 0;
  display: flex;
  align-items: center;
  gap: .4rem clamp(.65rem, 1.5vw, 1.3rem);
  min-block-size: 4.4rem;
  padding-block: .55rem;
  border-block-end: 1px solid #a28650;
  background: linear-gradient(180deg, #23201b, #171615);
  box-shadow: 0 .35rem 1.25rem #0005;
}

.brand {
  min-inline-size: 0;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  margin-inline-end: auto;
  color: var(--gold-light);
  font-size: clamp(.95rem, 1.8vw, 1.22rem);
  font-weight: 700;
  text-decoration: none;
}

.brand:hover .brand-name {
  text-decoration: underline;
  text-decoration-color: var(--gold);
}

.nav-coin {
  display: inline-grid;
  flex: none;
  place-items: center;
  inline-size: 1.55rem;
  aspect-ratio: 1;
  border: 1px solid #e1c280;
  border-radius: 50%;
  background: linear-gradient(135deg, #f3d999, #a57a37 62%, #e4c17c);
  box-shadow: inset 0 0 0 2px #684b296b;
  color: #30200b;
  font: 700 .9rem/1 var(--serif);
  animation: coin-turn 5.6s ease-in-out infinite;
}

@keyframes coin-turn {
  0%, 100% { transform: perspective(8rem) rotateY(-18deg) rotateZ(-8deg); }
  50% { transform: perspective(8rem) rotateY(38deg) rotateZ(7deg); }
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .2rem .45rem;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: 2.75rem;
  padding: .3rem .6rem;
  border-block-end: 2px solid transparent;
  border-radius: .25rem .25rem 0 0;
  color: var(--ink);
  text-decoration: none;
}

.site-nav a:hover {
  background: #d4b46e16;
  color: var(--gold-light);
}

.site-nav a[aria-current="page"] {
  border-block-end-color: var(--gold);
  color: var(--gold-light);
  font-weight: 700;
}

.motion-toggle,
button.nav-toggle,
.filter-chip {
  min-block-size: 2.75rem;
  padding: .42rem .8rem;
  border: 1px solid var(--control-line);
  border-radius: .32rem;
  background: var(--field);
  color: var(--ink);
  font-size: .875rem;
  line-height: 1.4;
}

.motion-toggle,
button.nav-toggle {
  flex-shrink: 0;
}

button.nav-toggle {
  display: none;
}

.motion-toggle:hover,
button.nav-toggle:hover,
.filter-chip:hover {
  border-color: var(--gold-light);
  background: #30291e;
}

.motion-toggle[aria-pressed="true"],
button.nav-toggle[aria-expanded="true"],
.filter-chip[aria-pressed="true"],
.filter-chip.is-active {
  border-color: var(--gold-light);
  background: var(--gold);
  color: #21180d;
  font-weight: 700;
}

.site-main {
  flex: 1 0 auto;
  inline-size: min(var(--site-width), calc(100% - var(--gutter) * 2));
  min-inline-size: 0;
  margin-inline: auto;
  padding-block: clamp(1.15rem, 3vw, 2.25rem) clamp(2.75rem, 7vw, 5rem);
}

.site-footer {
  padding-block: 1.35rem 1.65rem;
  border-block-start: 1px solid var(--line);
  background: #151514;
  color: var(--muted);
  font-size: .875rem;
  overflow-wrap: anywhere;
}

.site-footer p {
  margin-block: .32rem;
}

/* 首页：金库框体、静态照明及独立的 Canvas / 金粉层。 */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(1.4rem, 6vw, 5rem);
  border: 1px solid #8a7146;
  border-radius: .65rem;
  background:
    radial-gradient(ellipse at 50% -12%, #79603a 0%, transparent 59%),
    repeating-linear-gradient(90deg, #eed8a809 0 1px, transparent 1px 14%),
    linear-gradient(145deg, #26211b, #171717 55%, #101012);
  box-shadow: inset 0 0 4rem #0008, 0 1rem 3rem #0005;
}

.hero.vault-hero {
  display: grid;
  place-items: center;
  min-block-size: 78vh;
  min-block-size: 78svh;
  text-align: center;
}

.hero::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: clamp(.4rem, 1.3vw, .9rem);
  border: 1px solid #c7a76a52;
  border-radius: .35rem;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  inline-size: 100%;
  max-inline-size: 54rem;
  min-inline-size: 0;
}

.vault-ambient,
.coin-canvas,
.gold-dust {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  pointer-events: none;
}

.vault-ambient {
  z-index: 0;
}

.vault-ambient::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, #101012d9, #10101273 54%, transparent 81%);
}

.coin-canvas {
  display: block;
  opacity: .85;
}

.gold-dust {
  opacity: .67;
  background-image:
    radial-gradient(circle, #f7e2ad 0 .8px, transparent 1.65px),
    radial-gradient(circle, #d2a960 0 1px, transparent 2px),
    radial-gradient(circle, #e2c88f9e 0 1px, transparent 2.65px);
  background-size: 87px 121px, 137px 97px, 253px 189px;
  background-position: 11px 16px, 61px 41px, 41px 19px;
  animation: dust-drift 23s ease-in-out infinite alternate;
}

@keyframes dust-drift {
  55% { opacity: .4; }
  100% {
    opacity: .75;
    background-position: 58px -50px, 23px -4px, 76px -79px;
  }
}

.eyebrow {
  display: inline-block;
  margin-block-end: 1rem;
  padding: .25rem .8rem;
  border: 1px solid var(--control-line);
  border-radius: .2rem;
  background: #1b1814;
  color: var(--gold-light);
  font-size: .8rem;
  letter-spacing: .12em;
}

.hero-title {
  margin-block-end: .38em;
  color: var(--gold-light);
  font-size: clamp(2rem, 7vw, 5rem);
  line-height: 1.17;
  text-wrap: balance;
}

.hero-intro {
  max-inline-size: 39rem;
  margin-inline: auto;
  color: var(--ink);
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  text-wrap: pretty;
}

.hero-intro p {
  margin-block: 0;
}

.shimmer {
  color: var(--gold-light);
}

@supports (background-clip: text) or (-webkit-background-clip: text) {
  .shimmer {
    background-image: linear-gradient(
      106deg,
      #e8c986 32%,
      #e8c986 43%,
      #fff4d1 49%,
      #fdf0c1 51%,
      #d8ad62 56%,
      #e8c986 64%
    );
    background-position: 100% 50%;
    background-size: 260% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: foil 7s ease-in-out infinite;
  }

  .brand-name.shimmer {
    animation-duration: 10s;
  }
}

@keyframes foil {
  0%, 14% { background-position: 100% 50%; }
  63%, 100% { background-position: 0% 50%; }
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(.4rem, 1.6vw, 1rem);
  max-inline-size: 37rem;
  margin: clamp(1.35rem, 4vw, 2.8rem) auto 0;
  padding: 0;
  list-style: none;
}

.stat {
  padding: .65rem clamp(.25rem, 1.2vw, 1rem) .8rem;
  border: 1px solid var(--line);
  border-block-start-color: #b7975d;
  border-radius: .25rem;
  background: linear-gradient(155deg, #2b241d, #191817 80%);
  color: var(--ink);
  font-size: clamp(.75rem, 1.6vw, .95rem);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.stat-number {
  display: block;
  margin-block-end: .12em;
  color: var(--gold-light);
  font: 700 clamp(1.65rem, 5vw, 3rem)/1 var(--serif);
  font-variant-numeric: lining-nums tabular-nums;
}

/* 展厅门、策展铭牌和目录卡片。 */
.page-home .site-main > section + section {
  margin-block-start: clamp(2rem, 6vw, 4.3rem);
}

.page-home .site-main > section:not(.hero) > h2 {
  display: flex;
  align-items: center;
  gap: .85rem;
  color: var(--gold-light);
}

.page-home .site-main > section:not(.hero) > h2::after {
  content: "";
  flex: 1;
  block-size: 1px;
  background: linear-gradient(to right, var(--line), transparent);
}

.hall-grid,
.principles-grid,
.entry-grid {
  display: grid;
  gap: clamp(.8rem, 2vw, 1.25rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
}

.principles-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
}

.hall-card,
.entry-card,
.principle-card {
  min-inline-size: 0;
  border: 1px solid var(--line);
  border-radius: .42rem;
  background: var(--panel);
  overflow-wrap: anywhere;
}

.glow-card,
.hall-card,
.entry-card {
  position: relative;
  isolation: isolate;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.glow-card::before,
.hall-card::before,
.entry-card::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    110deg,
    transparent 38%,
    #aa834778 46%,
    #f9e1a4 50%,
    #aa834778 54%,
    transparent 62%
  ) 110% 0 / 300% 100% no-repeat;
  clip-path: inset(0 0 calc(100% - 1px) 0);
  pointer-events: none;
}

@supports (mask-composite: exclude) {
  .glow-card::before,
  .hall-card::before,
  .entry-card::before {
    inset: -1px;
    padding: 2px;
    clip-path: none;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
  }
}

.glow-card:not(.entry-card)::before,
.hall-card::before {
  animation: edge-foil 8s ease-in-out infinite;
}

.hall-card:nth-child(2)::before { animation-delay: -2.4s; }
.hall-card:nth-child(3)::before { animation-delay: -4.8s; }

.entry-card:is(:hover, :focus-within)::before {
  animation: edge-foil 3.2s ease-out infinite;
}

@keyframes edge-foil {
  0%, 16% { background-position: 110% 0; }
  70%, 100% { background-position: -10% 0; }
}

.glow-card:is(:hover, :focus-within),
.hall-card:is(:hover, :focus-visible),
.entry-card:is(:hover, :focus-within) {
  border-color: var(--gold);
  box-shadow: 0 .65rem 1.5rem #0005;
}

.hall-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-block-size: clamp(11rem, 19vw, 14rem);
  padding: 2.8rem clamp(1rem, 2.4vw, 1.6rem) 1.25rem;
  border-radius: 4.5rem 4.5rem .4rem .4rem;
  background:
    radial-gradient(ellipse at 50% 0, #755a334d, transparent 75%),
    linear-gradient(180deg, #22201b, #161616);
  color: var(--ink);
  text-decoration: none;
}

.hall-card::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: .4rem;
  border: 1px solid #b5995e4d;
  border-radius: 4.1rem 4.1rem .2rem .2rem;
  pointer-events: none;
}

.hall-card h3 {
  margin-block: auto .4rem;
  color: var(--gold-light);
  font-size: clamp(1.28rem, 2.2vw, 1.8rem);
}

.hall-card:hover h3 {
  text-decoration: underline;
  text-underline-offset: .22em;
}

.hall-card p,
.principle-card p {
  margin: 0;
  color: var(--muted);
}

.hall-secondary {
  background:
    radial-gradient(ellipse at 50% 0, #5b514442, transparent 75%),
    linear-gradient(180deg, #22201d, #161616);
}

.principle-card {
  padding: 1.15rem;
  border-block-start: 2px solid #a58750;
  background: linear-gradient(130deg, #28231b, #1a1917 72%);
  box-shadow: inset 0 0 0 3px #151411;
}

.principle-card h3 {
  color: var(--gold-light);
}

.strategy {
  margin: 1rem 0 0;
  padding: .9rem 1rem;
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--gold);
  border-radius: .25rem;
  background: #272117;
  overflow-wrap: anywhere;
}

.strategy strong {
  color: var(--gold-light);
}

.page-heading {
  margin-block-end: 1.25rem;
  padding-block: clamp(.6rem, 2vw, 1.3rem) 1rem;
  border-block-end: 1px solid var(--line);
}

.page-heading h1 {
  margin-block-end: 0;
  color: var(--gold-light);
  text-wrap: balance;
}

.search-controls {
  display: grid;
  gap: .7rem;
  margin-block-end: 1.35rem;
  padding: clamp(.95rem, 2.5vw, 1.5rem);
  border: 1px solid var(--line);
  border-radius: .4rem;
  background: linear-gradient(155deg, #252119, #1a1917 65%);
}

.search-controls label {
  font-weight: 700;
}

.search-input {
  inline-size: min(100%, 34rem);
  min-inline-size: 0;
  min-block-size: 2.85rem;
  padding: .55rem .8rem;
  border: 1px solid var(--control-line);
  border-radius: .3rem;
  background: var(--field);
  font-size: 1rem;
}

.search-input::placeholder {
  color: #b5aa99;
  opacity: 1;
}

.search-input:hover,
.search-input:focus {
  border-color: var(--gold);
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

.filter-chip {
  max-inline-size: 100%;
  border-radius: 1.4rem;
  overflow-wrap: anywhere;
}

.result-count,
.entry-meta {
  margin-block: 0;
  color: var(--gold);
  font-size: .875rem;
  font-variant-numeric: tabular-nums;
}

.entry-card {
  padding: clamp(1rem, 2.5vw, 1.35rem);
  background: linear-gradient(150deg, #24201b, #1a1917 80%);
}

.entry-card h2,
.entry-card h3 {
  margin-block: .35rem .45rem;
  font-size: clamp(1.22rem, 2.1vw, 1.52rem);
}

.entry-card h2 a,
.entry-card h3 a {
  text-decoration-color: #a38a57;
}

.entry-card h2 a:hover,
.entry-card h3 a:hover {
  text-decoration-color: currentColor;
}

.entry-summary {
  margin-block: 0;
  color: var(--muted);
  font-size: .95rem;
}

.no-results {
  grid-column: 1 / -1;
  margin-block: 1rem 0;
  padding: 1.3rem;
  border: 1px dashed var(--control-line);
  border-radius: .4rem;
  background: var(--panel);
  color: var(--ink);
  text-align: center;
}

/* 阅读区采用浅纸色；页头保留深色展厅标识，但不播放装饰动效。 */
body.page-read {
  color-scheme: light;
  background: #eae0cf;
  color: var(--paper-ink);
}

.page-read .site-header {
  color-scheme: dark;
  color: var(--ink);
}

.page-read :is(.vault-ambient, .coin-canvas, .gold-dust, .nav-coin) {
  display: none !important;
}

.page-read .site-header *,
.page-read .site-header *::before,
.page-read .site-header *::after {
  animation: none !important;
  transition: none !important;
}

.page-read .site-header .shimmer {
  background: none;
  color: var(--gold-light);
}

.page-read .site-main,
.page-read .site-footer {
  --focus: var(--paper-focus);
  --gold-light: var(--paper-link);
}

.page-read .site-footer {
  border-block-start-color: var(--paper-line);
  background: #e1d5c1;
  color: #574733;
}

.read-header,
.chapter-nav,
.prose {
  max-inline-size: var(--reading-width);
  margin-inline: auto;
}

.read-header {
  margin-block-end: 1.05rem;
  padding: .65rem clamp(.15rem, 1vw, .75rem) 0;
}

.read-header .entry-meta,
.prose .entry-meta {
  color: var(--paper-muted);
}

.read-header h1 {
  margin-block: .18em .4em;
  font-size: clamp(1.8rem, 5vw, 3.25rem);
  text-wrap: balance;
}

.read-header p:last-child {
  margin-block-end: 0;
}

.prose {
  color-scheme: light;
  padding: clamp(1rem, 5vw, 3.25rem);
  border: 1px solid var(--paper-line);
  border-radius: .4rem;
  background: var(--paper);
  box-shadow: 0 .65rem 1.8rem #38270f13;
  color: var(--paper-ink);
  font-size: clamp(1rem, 1.65vw, 1.1rem);
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.prose > :first-child { margin-block-start: 0; }
.prose > :last-child { margin-block-end: 0; }

.prose :is(h1, h2, h3, h4, h5, h6) {
  margin-block: 1.65em .55em;
  color: #302214;
}

.prose h1 {
  font-size: clamp(1.65rem, 4vw, 2.55rem);
}

.prose h2 {
  padding-block-end: .25em;
  border-block-end: 1px solid #d7c7ac;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
}

.prose h3 {
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
}

.prose :is(p, ul, ol, dl, figure, table, pre, blockquote) {
  margin-block: 0 1em;
}

.prose :is(ul, ol) {
  padding-inline-start: 1.55em;
}

.prose :is(ul, ol) :is(ul, ol) {
  margin-block: .35em 0;
}

.prose li + li {
  margin-block-start: .3em;
}

.prose li::marker {
  color: #795321;
}

.prose dt {
  font-weight: 700;
}

.prose dd {
  margin-inline-start: 1.35em;
}

.prose :is(a, a:visited),
.read-header a,
.chapter-nav a {
  color: var(--paper-link);
  text-decoration: underline;
}

.prose :is(img, svg, video, iframe) {
  max-inline-size: 100%;
}

.prose :is(img, video) {
  block-size: auto;
}

.prose figure {
  margin-inline: 0;
}

.prose figcaption {
  color: var(--paper-muted);
  font-size: .9em;
}

.prose :is(code, kbd, samp) {
  padding: .08em .28em;
  border-radius: .22rem;
  background: #eadfcb;
  color: #39291a;
  font: .9em/1.5 var(--mono);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.prose pre {
  max-inline-size: 100%;
  overflow: auto;
  padding: .85rem 1rem;
  border: 1px solid #d4c3a5;
  border-radius: .3rem;
  background: #efe5d4;
  color: #302417;
  font: .9em/1.6 var(--mono);
  white-space: pre;
  overflow-wrap: normal;
  tab-size: 4;
}

.prose pre code {
  padding: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font: inherit;
}

.prose blockquote,
.qa-block {
  margin-inline: 0;
  padding: .75rem clamp(.75rem, 2.5vw, 1.25rem);
  border-inline-start: 3px solid #9d783e;
  border-radius: .2rem;
  background: #efe4d0;
  color: var(--paper-ink);
}

.qa-block {
  max-inline-size: var(--reading-width);
  margin: 1.35rem auto;
  line-height: 1.75;
}

.qa-block :is(h2, h3, h4, summary) {
  color: #593b17;
}

.prose :is(blockquote, .qa-block) > :first-child,
.qa-block > :first-child {
  margin-block-start: 0;
}

.prose :is(blockquote, .qa-block) > :last-child,
.qa-block > :last-child {
  margin-block-end: 0;
}

.prose table {
  display: block;
  max-inline-size: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: .92em;
}

.prose caption {
  padding: .35rem .65rem;
  color: var(--paper-muted);
  font-weight: 700;
  text-align: start;
}

.prose :is(th, td) {
  padding: .42rem .7rem;
  border: 1px solid #b8a789;
  text-align: start;
  vertical-align: top;
}

.prose th {
  background: #e9dcc4;
}

.prose tbody tr:nth-child(even) td {
  background: #f0e6d5;
}

.prose hr {
  margin-block: 1.8em;
  border: 0;
  border-block-start: 1px solid var(--paper-line);
}

.chapter-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .65rem;
  margin-block-start: 1rem;
}

.chapter-nav a {
  min-inline-size: 0;
  max-inline-size: 100%;
  min-block-size: 2.75rem;
  padding: .5rem .85rem;
  border: 1px solid #b6a17d;
  border-radius: .3rem;
  background: var(--paper);
  overflow-wrap: anywhere;
}

.chapter-nav a:hover {
  border-color: var(--paper-link);
  background: #f9f3e8;
}

@media (max-width: 52rem) {
  .site-header {
    flex-wrap: wrap;
    min-block-size: 3.75rem;
  }

  .site-header button.nav-toggle:not([hidden]) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .site-nav {
    display: none;
    order: 3;
    flex-basis: 100%;
    gap: .25rem;
    max-block-size: 50vh;
    max-block-size: 50dvh;
    overflow: auto;
    padding: .4rem .25rem .25rem;
    border-block-start: 1px solid var(--line);
  }

  .site-header.is-open .site-nav,
  .site-nav.is-open,
  button.nav-toggle[aria-expanded="true"] ~ .site-nav {
    display: flex;
  }

  @supports selector(.site-header:has(button.nav-toggle)) {
    .site-header:has(button.nav-toggle[aria-expanded="true"]) .site-nav {
      display: flex;
    }

    /* 旧模板还未输出汉堡按钮时，保留可点击的导航。 */
    .site-header:not(:has(button.nav-toggle:not([hidden]))) .site-nav {
      display: flex;
    }
  }

  .site-nav a {
    padding-inline: .55rem;
    font-size: .9rem;
  }

  .hero.vault-hero {
    min-block-size: 62vh;
    min-block-size: 62svh;
  }
}

@media (max-width: 30rem) {
  .site-header {
    column-gap: .4rem;
  }

  .brand {
    flex: 1 1 9rem;
  }

  .motion-toggle,
  button.nav-toggle {
    padding-inline: .55rem;
  }

  .hero {
    padding-inline: .95rem;
  }

  .chapter-nav a {
    flex-basis: 100%;
  }
}

html.reduce-motion *,
html.reduce-motion *::before,
html.reduce-motion *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

html.reduce-motion :is(.vault-ambient, .coin-canvas, .gold-dust) {
  display: none !important;
}

html.reduce-motion .shimmer {
  background: none;
  color: var(--gold-light);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .vault-ambient,
  .coin-canvas,
  .gold-dust {
    display: none !important;
  }

  .shimmer {
    background: none;
    color: var(--gold-light);
  }
}

@media (forced-colors: active) {
  :focus-visible,
  .skip-link:focus {
    outline-color: Highlight;
  }

  .shimmer,
  html.reduce-motion .shimmer,
  .page-read .site-header .shimmer {
    background: none;
    color: inherit;
  }

  .vault-ambient {
    display: none !important;
  }

  .site-nav a[aria-current="page"] {
    border-block-end-color: Highlight;
    text-decoration: underline;
  }

  .filter-chip[aria-pressed="true"],
  .filter-chip.is-active,
  .motion-toggle[aria-pressed="true"],
  button.nav-toggle[aria-expanded="true"] {
    border-color: Highlight;
    text-decoration: underline;
  }
}
