/* ==========================================================================
   山海不绝古俗长存
   A hand-built editorial site for Jieshi, Lufeng, Shanwei.
   ========================================================================== */

/* Fonts, reset and design tokens
   ========================================================================== */
:root {
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", "Times New Roman", serif;
  --font-sans: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  --font-latin: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Georgia, serif;

  --paper: #f4f1e8;
  --paper-raised: #faf8f1;
  --paper-deep: #e9e4d7;
  --paper-warm: #efe9dc;
  --ink: #1f302a;
  --ink-soft: #40534c;
  --ink-mute: #73827b;
  --celadon: #dce9e2;
  --celadon-soft: #edf3ef;
  --celadon-deep: #78988b;
  --tag-bg: var(--celadon);
  --tag-dot: var(--celadon-deep);
  --gold: #aa8850;
  --gold-soft: #d9c7a2;
  --seal: #9e493d;
  --line: rgba(31, 48, 42, 0.14);
  --line-strong: rgba(31, 48, 42, 0.28);
  --shadow: 0 22px 60px rgba(51, 48, 37, 0.11);
  --shadow-soft: 0 12px 34px rgba(51, 48, 37, 0.08);
  --header-bg: rgba(246, 243, 235, 0.84);
  --header-border: rgba(31, 48, 42, 0.1);
  --hero-left: rgba(244, 241, 232, 0.58);
  --hero-fade: rgba(244, 241, 232, 0.94);
  --hero-ink: #1f302a;
  --hero-ink-soft: #40534c;
  --hero-line: rgba(31, 48, 42, 0.22);
  --placeholder-a: #e4ece6;
  --placeholder-b: #f3efe4;
  --header-h: 82px;
  --radius: 3px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
}

html[data-theme="night"] {
  --paper: #0f1620;
  --paper-raised: #151f2d;
  --paper-deep: #111a26;
  --paper-warm: #151f2d;
  --ink: #f0f3f7;
  --ink-soft: #98a3b3;
  --ink-mute: #98a3b3;
  --celadon: #223044;
  --celadon-soft: #151f2d;
  --celadon-deep: #8fa6bc;
  --gold: #cfb37c;
  --gold-soft: #806c48;
  --seal: #c47461;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.1);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  --shadow-soft: 0 16px 42px rgba(0, 0, 0, 0.3);
  --header-bg: rgba(15, 22, 32, 0.84);
  --header-border: rgba(255, 255, 255, 0.1);
  --hero-left: rgba(9, 14, 22, 0.72);
  --hero-fade: rgba(15, 22, 32, 0.96);
  --hero-ink: #f0f3f7;
  --hero-ink-soft: #98a3b3;
  --hero-line: rgba(255, 255, 255, 0.1);
  --placeholder-a: #1a2534;
  --placeholder-b: #222f40;
  --tag-bg: rgba(220, 233, 226, 0.12);
  --tag-dot: rgba(220, 233, 226, 0.6);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  /* Reveal blocks wait just outside the viewport before sliding in; clip the
     horizontal overflow they create without turning the page into a scroller. */
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.8;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.5s ease, color 0.5s ease;
}

body.menu-open {
  overflow: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

p,
h1,
h2,
h3,
h4,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

::selection {
  background: var(--celadon-deep);
  color: #fffdf5;
}

:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 5px;
}

/* Base helpers
   ========================================================================== */
.wrap {
  width: min(1240px, calc(100% - clamp(40px, 8vw, 112px)));
  margin-inline: auto;
}

.wrap--narrow {
  width: min(900px, calc(100% - clamp(40px, 8vw, 112px)));
  margin-inline: auto;
}

.section {
  padding-block: clamp(76px, 11vw, 148px);
}

.section--tight {
  padding-block: clamp(52px, 7vw, 92px);
}

.section--paper {
  background: var(--paper);
}

.section--raised {
  background: var(--paper-raised);
}

.section--celadon {
  background: var(--celadon-soft);
}

.section--ink {
  position: relative;
  overflow: hidden;
  background: #152923;
  color: #eee8d9;
}

html[data-theme="night"] .section--ink {
  background: #0b121c;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.sr-only:focus {
  position: fixed !important;
  z-index: 200 !important;
  top: 12px !important;
  left: 12px !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 10px 16px !important;
  overflow: visible !important;
  clip: auto !important;
  white-space: normal !important;
  background: var(--paper-raised) !important;
  border: 1px solid var(--gold) !important;
  color: var(--ink) !important;
  font-size: 12px !important;
}

.serif {
  font-family: var(--font-serif);
}

.latin {
  font-family: var(--font-latin);
}

.quiet {
  color: var(--ink-mute);
}

.rule {
  width: 100%;
  height: 1px;
  border: 0;
  background: var(--line);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  min-height: 28px;
  padding: 4px 13px;
  border-radius: 999px;
  background: var(--tag-bg);
  color: var(--ink-soft);
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.tag::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--tag-dot);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ink-mute);
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  display: block;
  width: 34px;
  height: 1px;
  background: var(--gold);
}

.eyebrow--plain::before {
  display: none;
}

.display {
  font-family: var(--font-serif);
  font-size: clamp(34px, 5vw, 64px);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.05em;
  text-wrap: balance;
}

.display em,
.section-title em {
  font-style: normal;
  color: var(--seal);
}

.section-title {
  margin-top: 22px;
  font-family: var(--font-serif);
  font-size: clamp(28px, 3.8vw, 48px);
  font-weight: 500;
  line-height: 1.38;
  letter-spacing: 0.06em;
  text-wrap: balance;
}

.lede {
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-size: clamp(18px, 2vw, 22px);
  line-height: 2;
  letter-spacing: 0.04em;
}

.prose {
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 2.1;
}

.prose p + p {
  margin-top: 1.25em;
}

.prose strong {
  color: var(--ink);
  font-weight: 500;
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(260px, 0.55fr);
  align-items: end;
  gap: clamp(30px, 6vw, 100px);
  margin-bottom: clamp(38px, 5vw, 68px);
}

.section-head__aside {
  justify-self: end;
  max-width: 340px;
  padding-bottom: 8px;
}

.section-head__aside .prose {
  font-size: 13px;
  line-height: 1.95;
}

.text-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 15px;
  padding-bottom: 4px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.text-link::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: var(--line-strong);
  transform-origin: left;
  transition: transform 0.5s var(--ease-out), background 0.3s ease;
}

.text-link span {
  display: inline-block;
  transition: transform 0.5s var(--ease-out);
}

.text-link:hover::after {
  background: var(--gold);
}

.text-link:hover span {
  transform: translateX(5px);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  min-height: 48px;
  padding: 13px 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  line-height: 1.4;
  transition: background 0.35s var(--ease-soft), color 0.35s ease, border-color 0.35s ease, transform 0.35s var(--ease-out);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn--solid {
  background: var(--ink);
  color: var(--paper-raised);
}

.btn--solid:hover {
  background: var(--seal);
  color: #fff9ee;
}

.btn--ghost {
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn--ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.btn__arrow {
  width: 17px;
  height: 17px;
  transition: transform 0.35s var(--ease-out);
}

.btn:hover .btn__arrow {
  transform: translateX(4px);
}

.seal-stamp {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--seal);
  color: var(--seal);
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.15;
  letter-spacing: 0.04em;
  text-align: center;
  transform: rotate(-3deg);
  opacity: 0.9;
}

/* Invisible spacers preserving the layout of removed home-page seals */
.seal-space {
  display: block;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  pointer-events: none;
}

/* Header
   ========================================================================== */
.site-header {
  position: fixed;
  z-index: 90;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  color: var(--ink);
  transition: background-color 0.45s ease, border-color 0.45s ease, color 0.45s ease, backdrop-filter 0.45s ease;
}

.site-header.is-scrolled,
.site-header--solid {
  border-bottom-color: var(--header-border);
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  backdrop-filter: blur(18px) saturate(1.15);
}

.site-header--overlay:not(.is-scrolled) {
  background: linear-gradient(180deg, rgba(6, 16, 15, 0.48), transparent);
  color: #f4eee0;
}

.site-header--overlay:not(.is-scrolled) .brand__mark {
  border-color: #d8bd8b;
  color: #d8bd8b;
}

.site-header--overlay:not(.is-scrolled) .brand__cn {
  color: #f4eee0;
}

.site-header--overlay:not(.is-scrolled) .brand__en,
.site-header--overlay:not(.is-scrolled) .theme-toggle__label {
  color: rgba(244, 238, 224, 0.58);
}

.site-header--overlay:not(.is-scrolled) .brand__cn,
.site-header--overlay:not(.is-scrolled) .desktop-nav a,
.site-header--overlay:not(.is-scrolled) .theme-toggle__label {
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.44);
}

.site-header--overlay:not(.is-scrolled) .desktop-nav a {
  color: rgba(244, 238, 224, 0.86);
}

.site-header--overlay:not(.is-scrolled) .desktop-nav a:hover,
.site-header--overlay:not(.is-scrolled) .desktop-nav a[aria-current="page"] {
  color: #fff8e9;
}

.site-header--overlay:not(.is-scrolled) .theme-toggle,
.site-header--overlay:not(.is-scrolled) .menu-toggle {
  border-color: rgba(244, 238, 224, 0.28);
}

.site-header--overlay:not(.is-scrolled) .theme-toggle__disc {
  background: rgba(244, 238, 224, 0.14);
  color: #f4eee0;
}

body.menu-open .site-header {
  border-bottom-color: var(--line);
  background: var(--header-bg);
  color: var(--ink);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  backdrop-filter: blur(18px) saturate(1.15);
}

body.menu-open .site-header .brand__mark {
  border-color: var(--seal);
  color: var(--seal);
}

body.menu-open .site-header .brand__cn {
  color: var(--ink);
}

body.menu-open .site-header .brand__en,
body.menu-open .site-header .theme-toggle__label {
  color: var(--ink-mute);
  text-shadow: none;
}

body.menu-open .site-header .desktop-nav a {
  color: var(--ink-soft);
  text-shadow: none;
}

body.menu-open .site-header .theme-toggle,
body.menu-open .site-header .menu-toggle {
  border-color: var(--line);
}

body.menu-open .site-header .theme-toggle__disc {
  background: var(--celadon);
  color: var(--ink-soft);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: clamp(24px, 4vw, 60px);
  width: min(1440px, calc(100% - clamp(40px, 6vw, 96px)));
  height: 100%;
  margin-inline: auto;
}

.brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 13px;
}

.brand__mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  border: 1px solid var(--seal);
  color: var(--seal);
  font-family: var(--font-serif);
  font-size: 20px;
  line-height: 1;
  transition: background 0.3s ease, color 0.3s ease;
}

.brand__mark::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid currentColor;
  opacity: 0.35;
}

.brand:hover .brand__mark {
  background: var(--seal);
  color: var(--paper-raised);
}

.brand__wordmark {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand__cn {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.2em;
}

.brand__en {
  color: var(--ink-mute);
  font-family: var(--font-latin);
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.brand--logo {
  gap: 0;
}

.brand__logo {
  display: block;
  width: auto;
  height: clamp(44px, 4.1vw, 58px);
  max-width: 100%;
  object-fit: contain;
  filter: none;
  transition: filter 0.2s ease;
}

.brand--logo:hover .brand__logo {
  filter: brightness(0.9);
}

/* Header logo: crisp in daylight, and at night a soft, faint white halo so the
   mark still reads on the dark header without glaring. */
html[data-theme="night"] .site-header .brand__logo {
  filter: drop-shadow(0 0 9px rgba(255, 255, 255, 0.24)) drop-shadow(0 0 20px rgba(255, 255, 255, 0.12));
}

html[data-theme="night"] .site-header .brand--logo:hover .brand__logo {
  filter: brightness(0.95) drop-shadow(0 0 10px rgba(255, 255, 255, 0.28)) drop-shadow(0 0 22px rgba(255, 255, 255, 0.14));
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: clamp(22px, 2.8vw, 43px);
  margin-left: auto;
}

.desktop-nav a {
  position: relative;
  padding-block: 8px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.12em;
  white-space: nowrap;
  transition: color 0.3s ease;
}

.desktop-nav a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 1px;
  left: 0;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ease-out);
}

.desktop-nav a:hover,
.desktop-nav a[aria-current="page"] {
  color: var(--ink);
}

.desktop-nav a:hover::after,
.desktop-nav a[aria-current="page"]::after {
  transform: scaleX(1);
  transform-origin: left;
}

.header-tools {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 13px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 78px;
  height: 37px;
  padding: 0 11px 0 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.theme-toggle:hover {
  border-color: var(--gold);
  background: color-mix(in srgb, var(--paper-raised) 50%, transparent);
}

.theme-toggle__disc {
  position: relative;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: var(--celadon);
  color: var(--ink-soft);
  overflow: hidden;
}

.theme-toggle__disc svg {
  position: absolute;
  width: 15px;
  height: 15px;
  transition: transform 0.5s var(--ease-out), opacity 0.35s ease;
}

.theme-toggle .icon-sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.theme-toggle .icon-moon {
  opacity: 0;
  transform: rotate(-40deg) scale(0.5);
}

html[data-theme="night"] .theme-toggle .icon-sun {
  opacity: 0;
  transform: rotate(55deg) scale(0.4);
}

html[data-theme="night"] .theme-toggle .icon-moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.theme-toggle__label {
  color: var(--ink-mute);
  font-size: 10px;
  letter-spacing: 0.14em;
}

.theme-toggle__label::after {
  content: "昼";
}

html[data-theme="night"] .theme-toggle__label::after {
  content: "夜";
}

.menu-toggle {
  display: none;
  width: 37px;
  height: 37px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.menu-toggle__lines {
  position: relative;
  display: block;
  width: 15px;
  height: 7px;
  margin: auto;
}

.menu-toggle__lines::before,
.menu-toggle__lines::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transition: transform 0.3s ease;
}

.menu-toggle__lines::before {
  top: 0;
}

.menu-toggle__lines::after {
  bottom: 0;
}

body.menu-open .menu-toggle__lines::before {
  transform: translateY(3px) rotate(45deg);
}

body.menu-open .menu-toggle__lines::after {
  transform: translateY(-3px) rotate(-45deg);
}

/* Mobile navigation */
.mobile-menu {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: calc(var(--header-h) + 28px) clamp(24px, 8vw, 60px) 32px;
  background: var(--paper);
  visibility: hidden;
  opacity: 0;
  overflow-y: auto;
  transition: opacity 0.45s ease, visibility 0s linear 0.45s;
}

.mobile-menu::before {
  content: "JIESHI";
  position: absolute;
  right: -18px;
  bottom: 40px;
  color: var(--ink);
  font-family: var(--font-latin);
  font-size: clamp(110px, 24vw, 220px);
  letter-spacing: -0.04em;
  line-height: 0.7;
  opacity: 0.035;
  pointer-events: none;
}

body.menu-open .mobile-menu {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.45s ease, visibility 0s linear 0s;
}

.mobile-menu__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 34px;
}

.mobile-menu__eyebrow {
  color: var(--ink-mute);
  font-size: 10px;
  letter-spacing: 0.3em;
}

.mobile-menu__close {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.mobile-menu__nav {
  display: flex;
  flex-direction: column;
}

.mobile-menu__nav a {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-serif);
  font-size: clamp(26px, 6vw, 38px);
  letter-spacing: 0.1em;
  transition: color 0.3s ease, padding-left 0.4s var(--ease-out);
}

.mobile-menu__nav a small {
  color: var(--ink-mute);
  font-family: var(--font-latin);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.mobile-menu__nav a:hover,
.mobile-menu__nav a[aria-current="page"] {
  color: var(--seal);
  padding-left: 7px;
}

.mobile-menu__foot {
  margin-top: auto;
  padding-top: 44px;
  color: var(--ink-mute);
  font-size: 11px;
  line-height: 2;
  letter-spacing: 0.12em;
}

.mobile-menu__foot strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.16em;
}

/* Page back control
   ========================================================================== */
.page-back {
  position: fixed;
  z-index: 70;
  top: calc(var(--header-h) + 8px);
  right: 0;
  left: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.page-back__inner {
  width: min(1240px, calc(100% - clamp(40px, 8vw, 112px)));
  margin-inline: auto;
  display: flex;
  justify-content: flex-start;
}

.page-back__button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #222222;
  cursor: pointer;
  pointer-events: auto;
  filter: drop-shadow(0 1px 8px rgba(244, 241, 232, 0.7));
  transition: color 0.7s ease, transform 0.3s var(--ease-out), filter 0.7s ease, opacity 0.3s ease;
}

.page-back__button:hover {
  color: #7fa99a;
  transform: translateX(-2px);
}

html[data-theme="night"] .page-back__button {
  color: #f0f3f7;
  filter: drop-shadow(0 1px 8px rgba(0, 0, 0, 0.48));
}

html[data-theme="night"] .page-back__button:hover {
  color: #98a3b3;
}

.page-back__button:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 5px;
}

.page-back__button:disabled {
  cursor: default;
  opacity: 0.5;
}

.page-back__button svg {
  width: 24px;
  height: 24px;
  display: block;
}

body.book-reading .page-back {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Back to top
   ========================================================================== */
.back-to-top {
  position: fixed;
  z-index: 75;
  right: clamp(16px, 2.2vw, 30px);
  bottom: 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 14px 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper-raised) 88%, transparent);
  color: var(--ink-soft);
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.14em;
  line-height: 1;
  cursor: pointer;
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  backdrop-filter: blur(12px) saturate(1.1);
  box-shadow: var(--shadow-soft);
  transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease, transform 0.3s var(--ease-out);
}

/* From the tablet breakpoint up, the home hero keeps a small photo caption in
   this corner; lift the button so it never sits on top of that line. */
@media (min-width: 721px) {
  .back-to-top {
    bottom: 42px;
  }
}

.back-to-top__icon {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
}

.back-to-top:hover {
  border-color: var(--gold);
  color: var(--gold);
  transform: translateY(-2px);
}

.back-to-top:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 4px;
}

.back-to-top:active {
  transform: translateY(0);
}

html[data-theme="night"] .back-to-top {
  background: rgba(21, 31, 45, 0.88);
  border-color: rgba(255, 255, 255, 0.16);
  color: var(--ink-soft);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.36);
}

html[data-theme="night"] .back-to-top:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* The book reader takes over the viewport; keep the button out of its way. */
body.book-reading .back-to-top {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@media (max-width: 560px) {
  .back-to-top {
    gap: 6px;
    height: 32px;
    padding: 0 12px 0 10px;
    font-size: 10px;
  }

  .back-to-top__icon {
    width: 12px;
    height: 12px;
  }
}

/* Home hero
   ========================================================================== */
.hero {
  position: relative;
  height: 100svh;
  min-height: 720px;
  overflow: hidden;
  background: var(--paper);
  isolation: isolate;
}

.hero__media,
.hero__layer,
.hero__scrim,
.hero__stars,
.hero__clouds,
.hero__fireworks,
.hero__grain {
  position: absolute;
  inset: 0;
}

.hero__layer {
  z-index: 0;
  background-position: center 48%;
  background-repeat: no-repeat;
  background-size: cover;
  transition: opacity 0.7s ease;
}

.hero__layer--day {
  background-image: url("../images/hero-day.webp");
  opacity: 1;
}

.hero__layer--night {
  background-image: url("../images/hero-night.webp");
  opacity: 0;
}

html[data-theme="night"] .hero__layer--day {
  opacity: 0;
}

html[data-theme="night"] .hero__layer--night {
  opacity: 1;
}

.hero__stars {
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.1s ease;
}

html[data-theme="night"] .hero__stars {
  opacity: 1;
}

.hero__stars span {
  position: absolute;
  width: var(--size, 2px);
  height: var(--size, 2px);
  border-radius: 50%;
  background: var(--star-color, #ffd98a);
  box-shadow: 0 0 4px rgba(255, 180, 90, 0.25);
  opacity: 0;
  animation: star-twinkle var(--duration, 5s) var(--delay, 0s) ease-in-out infinite;
}

.hero__stars span.is-bright {
  box-shadow: 0 0 7px rgba(255, 180, 90, 0.36), 0 0 14px rgba(255, 180, 90, 0.16);
}

@keyframes star-twinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.85); }
  50% { opacity: 0.85; transform: scale(1); }
  74% { opacity: 0.32; transform: scale(0.92); }
}

.hero__lion {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 7%;
  width: min(64vw, 960px);
  height: 56%;
  background-image: url("../images/wushi-lion-vignette.webp");
  background-position: center 58%;
  background-repeat: no-repeat;
  background-size: cover;
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
  filter: saturate(1.2) brightness(1.04);
  transform: translateX(-50%) scale(1.02);
  -webkit-mask-image: radial-gradient(ellipse at 50% 57%, #000 28%, transparent 72%);
  mask-image: radial-gradient(ellipse at 50% 57%, #000 28%, transparent 72%);
  transition: opacity 1s ease;
}

html[data-theme="night"] .hero__lion {
  opacity: 0.37;
}

.hero__scrim {
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(68% 52% at 50% 43%, transparent 37%, rgba(9, 23, 22, 0.16) 100%),
    linear-gradient(180deg, rgba(12, 28, 25, 0.16) 0%, transparent 24%, transparent 51%, var(--hero-fade) 100%),
    linear-gradient(90deg, var(--hero-left) 0%, transparent 55%);
  transition: background 0.5s ease;
}

.hero__clouds {
  z-index: 3;
  height: 62%;
  top: auto;
  bottom: 12%;
  left: -4%;
  width: 108%;
  opacity: 0;
  overflow: visible;
  pointer-events: none;
  mix-blend-mode: screen;
  transition: opacity 1.1s ease;
}

html[data-theme="night"] .hero__clouds {
  opacity: 0.82;
}

.hero__clouds svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.cloud-shape {
  transform-box: fill-box;
  transform-origin: center;
  animation: cloud-drift 38s ease-in-out infinite alternate;
}

.cloud-shape--a {
  animation-duration: 42s;
}

.cloud-shape--b {
  animation-duration: 54s;
  animation-direction: alternate-reverse;
}

.cloud-shape--c {
  animation-duration: 47s;
  animation-delay: -12s;
}

@keyframes cloud-drift {
  0% { transform: translate3d(-2%, 1%, 0) scale(0.99); }
  50% { transform: translate3d(2%, -1%, 0) scale(1.02); }
  100% { transform: translate3d(5%, 0, 0) scale(1); }
}

.hero__mist {
  position: absolute;
  inset: 50% -10% 0;
  z-index: 3;
  opacity: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 22% 72%, rgba(198, 218, 242, 0.14), transparent 43%),
    radial-gradient(ellipse at 76% 68%, rgba(220, 233, 250, 0.09), transparent 46%),
    radial-gradient(ellipse at 56% 90%, rgba(210, 226, 245, 0.1), transparent 40%);
  filter: blur(22px);
  animation: mist-breathe 19s ease-in-out infinite alternate;
  transition: opacity 1.1s ease;
}

html[data-theme="night"] .hero__mist {
  opacity: 1;
}

@keyframes mist-breathe {
  0% { transform: translate3d(-1.5%, 1%, 0) scale(1); opacity: 0.55; }
  100% { transform: translate3d(2%, -1.5%, 0) scale(1.045); opacity: 0.95; }
}

.hero__fireworks {
  z-index: 3;
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  transition: opacity 1s ease;
}

html[data-theme="night"] .hero__fireworks {
  opacity: 0.8;
}

.firework {
  position: absolute;
  width: 1px;
  height: 1px;
  mix-blend-mode: screen;
}

.firework__spark {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--spark-size, 2.4px);
  height: var(--spark-size, 2.4px);
  border-radius: 50%;
  background: var(--spark-color, #e3c184);
  box-shadow: 0 0 7px var(--spark-glow, rgba(227, 193, 132, 0.3)), 0 0 16px var(--spark-glow, rgba(227, 193, 132, 0.3));
  opacity: 0;
  transform: rotate(var(--angle)) translateY(0);
  animation: spark-out var(--spark-duration, 26s) var(--spark-delay, 0s) ease-out infinite;
}

.firework::before {
  content: "";
  position: absolute;
  left: -9px;
  top: -9px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--burst-glow, rgba(255, 180, 90, 0.25)), transparent 66%);
  animation: fw-flash var(--spark-duration, 26s) var(--spark-delay, 0s) ease-out infinite;
}

@keyframes spark-out {
  0% { opacity: 0; transform: rotate(var(--angle)) translateY(0) scale(0.35); }
  1% { opacity: 0; transform: rotate(var(--angle)) translateY(calc(var(--distance) * -0.08)) scale(0.5); }
  2% { opacity: var(--spark-opacity, 0.5); transform: rotate(var(--angle)) translateY(calc(var(--distance) * -0.4)) scale(1); }
  4.5% { opacity: calc(var(--spark-opacity, 0.5) * 0.7); transform: rotate(var(--angle)) translateY(calc(var(--distance) * -0.86)) scale(0.82); }
  7% { opacity: 0; transform: rotate(var(--angle)) translateY(calc(var(--distance) * -1.08)) scale(0.32); }
  100% { opacity: 0; transform: rotate(var(--angle)) translateY(calc(var(--distance) * -1.08)) scale(0.32); }
}

@keyframes fw-flash {
  0%, 1% { opacity: 0; transform: scale(0.5); }
  2.2% { opacity: 0.32; transform: scale(1); }
  4.2% { opacity: 0; transform: scale(1.4); }
  100% { opacity: 0; transform: scale(0.5); }
}

.hero__grain {
  z-index: 8;
  opacity: 0.09;
  pointer-events: none;
  background-image: url("../images/grain.svg");
  mix-blend-mode: multiply;
}

html[data-theme="night"] .hero__grain {
  opacity: 0.16;
  mix-blend-mode: screen;
}

.hero__content {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: clamp(46px, 8vh, 96px);
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(220px, 0.5fr);
  align-items: end;
  gap: clamp(30px, 6vw, 100px);
  width: min(1240px, calc(100% - clamp(40px, 8vw, 112px)));
  transform: translateX(-50%);
  color: var(--hero-ink);
}

.hero__copy {
  max-width: 760px;
}

.hero__eyebrow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 22px;
  color: var(--hero-ink-soft);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.hero__eyebrow .tag {
  background: color-mix(in srgb, var(--celadon) 88%, transparent);
  color: var(--hero-ink-soft);
}

.hero__coordinates {
  font-family: var(--font-latin);
  font-size: 11px;
  letter-spacing: 0.16em;
}

.hero__title {
  color: var(--hero-ink);
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: 0.07em;
}

.hero__title-kicker {
  display: block;
  margin-bottom: 6px;
  font-size: clamp(17px, 1.75vw, 23px);
  font-weight: 400;
  letter-spacing: 0.33em;
  opacity: 0.8;
}

.hero__title-main {
  display: block;
  font-size: clamp(59px, 8.5vw, 122px);
  white-space: nowrap;
}

.hero__title-main em {
  position: relative;
  font-style: normal;
}

/* Site name in the hero lockup: the same serif display style as the original
   four-character title, stepped down so eight characters hold one line. The
   class is doubled so the later responsive sizes for .hero__title-main do not
   override it. */
.hero__title-main.hero__title-main--name {
  font-size: clamp(30px, 6.6vw, 80px);
  letter-spacing: 0.08em;
}

/* Phones: the eight-character name stacks into two four-character lines so it
   keeps the poster weight of the old lockup instead of shrinking away. */
@media (max-width: 640px) {
  .hero__title-main.hero__title-main--name {
    display: flex;
    flex-wrap: wrap;
    width: min-content;
    font-size: clamp(38px, 10.5vw, 56px);
    line-height: 1.16;
  }
}

.hero__sub {
  max-width: 35em;
  margin-top: 20px;
  color: var(--hero-ink-soft);
  font-family: var(--font-serif);
  font-size: clamp(14px, 1.3vw, 17px);
  line-height: 2;
  letter-spacing: 0.07em;
  text-shadow: 0 1px 16px color-mix(in srgb, var(--hero-fade) 60%, transparent);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 21px;
  margin-top: 30px;
}

.hero__actions .btn--solid {
  background: var(--hero-ink);
  color: var(--paper-raised);
}

.hero__actions .btn--solid:hover {
  background: var(--seal);
  color: #fff9ee;
}

.hero__actions .btn--ghost {
  border-color: var(--hero-line);
  color: var(--hero-ink);
}

.hero__actions .btn--ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.hero__aside {
  justify-self: end;
  width: min(100%, 246px);
  padding: 16px 18px 15px;
  border-top: 1px solid var(--hero-line);
  border-bottom: 1px solid var(--hero-line);
  background: linear-gradient(145deg, color-mix(in srgb, var(--paper-raised) 50%, transparent), color-mix(in srgb, var(--paper-raised) 18%, transparent));
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  backdrop-filter: blur(14px) saturate(1.1);
  box-shadow: 0 15px 40px color-mix(in srgb, var(--ink) 7%, transparent);
  transition: background 0.5s ease, border-color 0.5s ease;
}

html[data-theme="night"] .hero__aside {
  background: linear-gradient(145deg, rgba(15, 25, 40, 0.68), rgba(15, 25, 40, 0.26));
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.hero__aside-inner {
  padding: 0;
  border-left: 0;
}

.hero__aside-label {
  color: var(--hero-ink-soft);
  font-size: 9px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.hero__aside p {
  margin-top: 9px;
  color: var(--hero-ink-soft);
  font-family: var(--font-serif);
  font-size: 12px;
  line-height: 1.9;
  letter-spacing: 0.07em;
}

.hero__aside-arrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  color: var(--hero-ink);
  font-size: 10px;
  letter-spacing: 0.18em;
}

.hero__aside-arrow svg {
  width: 22px;
  height: 22px;
  transition: transform 0.35s var(--ease-out);
}

.hero__aside-arrow:hover svg {
  transform: translateY(4px);
}

.hero__side-note {
  position: absolute;
  z-index: 6;
  top: 50%;
  right: clamp(20px, 3vw, 44px);
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--hero-ink-soft);
  font-family: var(--font-serif);
  font-size: 10px;
  letter-spacing: 0.2em;
  writing-mode: vertical-rl;
  transform: translateY(-50%);
}

.hero__side-note::before {
  content: "";
  width: 1px;
  height: 52px;
  background: var(--hero-line);
}

.hero__caption {
  position: absolute;
  z-index: 6;
  right: clamp(20px, 4vw, 58px);
  bottom: 28px;
  color: var(--hero-ink-soft);
  font-size: 9px;
  letter-spacing: 0.16em;
  opacity: 0.74;
}

.hero__seal {
  position: absolute;
  z-index: 6;
  right: clamp(20px, 4vw, 58px);
  top: 50%;
  transform: translateY(-50%) rotate(3deg);
  width: 56px;
  height: 56px;
  border: 1px solid var(--seal);
  color: var(--seal);
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-size: 14px;
  line-height: 1.15;
  letter-spacing: 0.04em;
  opacity: 0.72;
  text-align: center;
}

.hero__seal::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid currentColor;
  opacity: 0.4;
}

/* Page hero — editorial pages
   ========================================================================== */
.page-hero {
  position: relative;
  padding-top: calc(var(--header-h) + clamp(68px, 10vw, 130px));
  padding-bottom: clamp(56px, 8vw, 100px);
  overflow: hidden;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.page-hero::before {
  content: "";
  position: absolute;
  top: 18%;
  right: -7%;
  width: min(520px, 42vw);
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 50%;
  opacity: 0.65;
  pointer-events: none;
}

.page-hero::after {
  content: attr(data-index);
  position: absolute;
  right: clamp(22px, 7vw, 110px);
  bottom: -0.18em;
  color: var(--ink);
  font-family: var(--font-latin);
  font-size: clamp(120px, 22vw, 270px);
  font-weight: 600;
  line-height: 0.75;
  letter-spacing: -0.06em;
  opacity: 0.045;
  pointer-events: none;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-mute);
  font-size: 10px;
  letter-spacing: 0.15em;
}

.breadcrumb a {
  transition: color 0.3s ease;
}

.breadcrumb a:hover {
  color: var(--seal);
}

.breadcrumb span {
  color: var(--ink-mute);
  opacity: 0.55;
}

.page-hero__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(250px, 0.55fr);
  gap: clamp(40px, 8vw, 130px);
  align-items: end;
  margin-top: clamp(46px, 7vw, 84px);
}

.page-hero__title {
  max-width: 800px;
  margin-top: 22px;
  font-family: var(--font-serif);
  font-size: clamp(46px, 6.7vw, 88px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.06em;
}

.page-hero__title em {
  font-style: normal;
  color: var(--seal);
}

.page-hero__subtitle {
  max-width: 660px;
  margin-top: 20px;
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-size: clamp(15px, 1.7vw, 19px);
  line-height: 1.9;
  letter-spacing: 0.1em;
}

.page-hero__aside {
  justify-self: end;
  max-width: 290px;
  padding-bottom: 13px;
}

.page-hero__aside p {
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-size: 14px;
  line-height: 2.15;
  letter-spacing: 0.05em;
}

.page-hero__aside .page-hero__note {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 24px;
  color: var(--ink-mute);
  font-family: var(--font-latin);
  font-size: 11px;
  letter-spacing: 0.16em;
}

.page-hero__note::before {
  content: "";
  width: 29px;
  height: 1px;
  background: var(--gold);
}

.page-hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(26px, 5vw, 68px);
  margin-top: clamp(38px, 5vw, 60px);
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.page-hero__stat {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.page-hero__stat strong {
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.page-hero__stat span {
  color: var(--ink-mute);
  font-size: 10px;
  letter-spacing: 0.14em;
}

/* Media heroes for Xuanwu / lantern stories
   ========================================================================== */
.media-hero {
  position: relative;
  min-height: min(88svh, 860px);
  padding-top: var(--header-h);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  color: #f4eee0;
  background: #0a1718;
  isolation: isolate;
}

.media-hero__layer,
.media-hero__scrim,
.media-hero__grain {
  position: absolute;
  inset: 0;
}

.media-hero__layer {
  z-index: 0;
  background-position: center 49%;
  background-size: cover;
  background-repeat: no-repeat;
  transition: opacity 0.7s ease;
}

.media-hero__layer--day {
  background-image: url("../images/hero-day.webp");
  opacity: 1;
}

.media-hero__layer--night {
  background-image: url("../images/hero-night.webp");
  opacity: 0;
}

html[data-theme="night"] .media-hero__layer--day {
  opacity: 0;
}

html[data-theme="night"] .media-hero__layer--night {
  opacity: 1;
}

.media-hero--lantern .media-hero__layer {
  background-image: url("../images/lanterns-hero.webp");
  background-position: center center;
}

.media-hero--lantern .media-hero__layer--day {
  opacity: 1;
}

.media-hero--lantern .media-hero__layer--night {
  background-image: url("../images/lanterns-hero.webp");
  opacity: 0;
  filter: brightness(0.58) saturate(0.8) contrast(1.03);
}

html[data-theme="night"] .media-hero--lantern .media-hero__layer--day {
  opacity: 0;
}

html[data-theme="night"] .media-hero--lantern .media-hero__layer--night {
  opacity: 1;
}

.media-hero__scrim {
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(8, 20, 20, 0.26) 0%, transparent 23%, transparent 40%, rgba(7, 18, 19, 0.92) 100%),
    linear-gradient(90deg, rgba(7, 18, 19, 0.44), transparent 62%);
}

html[data-theme="day"] .media-hero--lantern .media-hero__scrim {
  background:
    linear-gradient(180deg, rgba(43, 35, 24, 0.12) 0%, transparent 23%, transparent 38%, rgba(22, 31, 28, 0.9) 100%),
    linear-gradient(90deg, rgba(22, 31, 28, 0.28), transparent 62%);
}

.media-hero__grain {
  z-index: 2;
  opacity: 0.11;
  background-image: url("../images/grain.svg");
  mix-blend-mode: screen;
  pointer-events: none;
}

.media-hero__content {
  position: relative;
  z-index: 3;
  width: min(1240px, calc(100% - clamp(40px, 8vw, 112px)));
  margin-inline: auto;
  padding-block: clamp(54px, 8vw, 96px) clamp(48px, 7vw, 80px);
}

.media-hero__eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  color: rgba(244, 238, 224, 0.72);
  font-size: 10px;
  letter-spacing: 0.22em;
}

.media-hero__eyebrow .tag {
  background: rgba(228, 236, 227, 0.14);
  color: rgba(244, 238, 224, 0.9);
  border: 1px solid rgba(244, 238, 224, 0.16);
}

.media-hero__title {
  max-width: 900px;
  margin-top: 22px;
  font-family: var(--font-serif);
  font-size: clamp(48px, 7.6vw, 100px);
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: 0.07em;
  text-shadow: 0 10px 40px rgba(0, 0, 0, 0.24);
}

.media-hero__title em {
  font-style: normal;
  color: #e5c995;
}

.media-hero__deck {
  max-width: 550px;
  margin-top: 22px;
  color: rgba(244, 238, 224, 0.77);
  font-family: var(--font-serif);
  font-size: clamp(14px, 1.2vw, 17px);
  line-height: 2;
  letter-spacing: 0.06em;
}

.media-hero__foot {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-top: 30px;
  color: rgba(244, 238, 224, 0.55);
  font-size: 10px;
  letter-spacing: 0.17em;
}

.media-hero__foot::before {
  content: "";
  display: block;
  width: 45px;
  height: 1px;
  background: rgba(244, 238, 224, 0.4);
}

.media-hero__scroll {
  position: absolute;
  right: clamp(22px, 4vw, 58px);
  bottom: 35px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(244, 238, 224, 0.62);
  font-size: 9px;
  letter-spacing: 0.2em;
  writing-mode: vertical-rl;
}

.media-hero__scroll::after {
  content: "";
  width: 1px;
  height: 42px;
  background: rgba(244, 238, 224, 0.46);
  animation: scroll-pulse 2.8s ease-in-out infinite;
}

@keyframes scroll-pulse {
  0%, 100% { transform: scaleY(0.55); transform-origin: top; opacity: 0.5; }
  50% { transform: scaleY(1); transform-origin: top; opacity: 1; }
}

/* Home — introduction
   ========================================================================== */
.home-intro {
  position: relative;
  overflow: hidden;
  background: var(--paper);
}

.home-intro::before {
  content: "碣石";
  position: absolute;
  top: 10%;
  right: -0.13em;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: clamp(150px, 29vw, 420px);
  line-height: 0.8;
  letter-spacing: -0.08em;
  opacity: 0.032;
  pointer-events: none;
  writing-mode: vertical-rl;
}

.intro-grid {
  display: grid;
  grid-template-columns: 138px minmax(0, 1fr);
  gap: clamp(30px, 6vw, 90px);
}

.intro-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 26px;
  padding-top: 9px;
  border-right: 1px solid var(--line);
}

.intro-index {
  color: var(--gold);
  font-family: var(--font-latin);
  font-size: 14px;
  letter-spacing: 0.12em;
}

.intro-vertical {
  color: var(--ink-mute);
  font-family: var(--font-serif);
  font-size: 11px;
  line-height: 1.8;
  letter-spacing: 0.28em;
  writing-mode: vertical-rl;
}

.intro-aside .seal-stamp {
  margin-top: auto;
  margin-bottom: 3px;
}

.intro-aside .seal-space {
  margin-top: auto;
  margin-bottom: 3px;
}

.intro-body {
  max-width: 1020px;
}

.intro-body .display {
  max-width: 820px;
  margin-top: 24px;
}

.intro-body > .lede {
  max-width: 850px;
  margin-top: clamp(28px, 4vw, 46px);
}

.intro-details {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.7fr);
  gap: clamp(34px, 6vw, 90px);
  align-items: start;
  margin-top: clamp(34px, 5vw, 58px);
  padding-top: 30px;
  border-top: 1px solid var(--line);
}

.intro-details .text-link {
  margin-top: 30px;
}

.intro-facts {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.intro-facts div {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.intro-facts dt {
  flex: 0 0 62px;
  color: var(--ink-mute);
  font-size: 10px;
  letter-spacing: 0.14em;
}

.intro-facts dd {
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.7;
}

/* Home — paths / feature cards
   ========================================================================== */
.home-paths {
  position: relative;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(14px, 2vw, 26px);
}

.feature-card {
  position: relative;
  display: block;
  grid-column: span 6;
  min-height: clamp(350px, 34vw, 475px);
  overflow: hidden;
  background: var(--paper-deep);
  border: 1px solid var(--line);
  color: #f5efe2;
  isolation: isolate;
}

.feature-card--wide {
  grid-column: span 7;
}

.feature-card--small {
  grid-column: span 5;
}

.feature-card--paper {
  color: var(--ink);
  background: var(--paper-warm);
}

html[data-theme="day"] .feature-card--paper {
  background-color: #f8f5ec;
}

.feature-card--overview .feature-card__media--day,
.feature-card--overview .feature-card__media--night {
  background-image: url("../images/card-overview.webp");
}

.feature-card--xuanwu .feature-card__media--day,
.feature-card--xuanwu .feature-card__media--night {
  background-image: url("../images/card-xuanwu.webp");
}

.feature-card--lantern .feature-card__media--day,
.feature-card--lantern .feature-card__media--night {
  background-image: url("../images/lanterns-hero.webp");
}

.feature-card__media--night {
  opacity: 0;
  filter: brightness(0.62) saturate(0.82) contrast(1.03);
}

html[data-theme="night"] .feature-card__media--day {
  opacity: 0;
}

html[data-theme="night"] .feature-card__media--night {
  opacity: 1;
}

.feature-card__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: var(--image);
  background-position: center;
  background-size: cover;
  transition: transform 0.9s var(--ease-out), filter 0.6s ease, opacity 0.7s ease;
}

.feature-card:hover .feature-card__media {
  transform: scale(1.045);
}

.feature-card__shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(12, 26, 24, 0.06) 0%, transparent 38%, rgba(10, 23, 22, 0.86) 100%),
    linear-gradient(90deg, rgba(10, 23, 22, 0.3), transparent 65%);
}

.feature-card--paper .feature-card__shade {
  background:
    linear-gradient(180deg, transparent 34%, color-mix(in srgb, var(--paper-warm) 92%, transparent) 100%),
    linear-gradient(90deg, color-mix(in srgb, var(--paper-warm) 55%, transparent), transparent 70%);
}

.feature-card__num {
  position: absolute;
  top: 22px;
  right: 24px;
  z-index: 2;
  color: rgba(255, 248, 231, 0.58);
  font-family: var(--font-latin);
  font-size: 13px;
  letter-spacing: 0.12em;
}

.feature-card--paper .feature-card__num {
  color: var(--ink-mute);
}

.feature-card__body {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  padding: clamp(22px, 3vw, 38px);
}

.feature-card__body .tag {
  background: rgba(235, 241, 232, 0.14);
  color: rgba(245, 239, 226, 0.82);
  border: 1px solid rgba(245, 239, 226, 0.14);
}

.feature-card--paper .tag {
  background: var(--tag-bg);
  color: var(--ink-soft);
  border-color: transparent;
}

.feature-card__title {
  margin-top: 16px;
  font-family: var(--font-serif);
  font-size: clamp(26px, 3.1vw, 40px);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.06em;
}

.feature-card__title em {
  font-style: normal;
  color: #e1c489;
}

.feature-card--paper .feature-card__title em {
  color: var(--seal);
}

.feature-card__desc {
  max-width: 420px;
  margin-top: 9px;
  color: rgba(245, 239, 226, 0.72);
  font-size: 12px;
  line-height: 1.9;
  letter-spacing: 0.04em;
}

.feature-card--paper .feature-card__desc {
  color: var(--ink-mute);
}

.feature-card__arrow {
  position: absolute;
  right: clamp(22px, 3vw, 38px);
  bottom: clamp(22px, 3vw, 38px);
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(245, 239, 226, 0.3);
  border-radius: 50%;
  color: #f5efe2;
  transition: background 0.35s ease, color 0.35s ease, transform 0.35s var(--ease-out);
}

.feature-card--paper .feature-card__arrow {
  border-color: var(--line-strong);
  color: var(--ink);
}

.feature-card:hover .feature-card__arrow {
  background: var(--gold);
  color: #192822;
  transform: translate(3px, -3px);
}

.feature-card__arrow svg {
  width: 15px;
  height: 15px;
}

/* Small still-life of the three books used in the fourth card */
.mini-books {
  position: absolute;
  z-index: 2;
  right: 4%;
  bottom: 21%;
  width: 56%;
  height: 52%;
  pointer-events: none;
}

.mini-books span {
  position: absolute;
  bottom: 0;
  width: 34%;
  aspect-ratio: 270 / 368;
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  border-radius: 2px 5px 5px 2px;
  box-shadow: 0 18px 30px rgba(47, 39, 27, 0.18);
  transform-origin: bottom center;
  transition: transform 0.8s var(--ease-out);
}

.mini-books span:nth-child(1) {
  left: 2%;
  background-image: url("../images/cover-huadeng.webp");
  transform: rotate(-8deg) translateY(7%);
}

.mini-books span:nth-child(2) {
  left: 30%;
  z-index: 1;
  background-image: url("../images/cover-xingyi.webp");
  transform: rotate(1deg) translateY(-3%);
}

.mini-books span:nth-child(3) {
  left: 60%;
  background-image: url("../images/cover-yuewu.webp");
  transform: rotate(7deg) translateY(6%);
}

.feature-card:hover .mini-books span:nth-child(1) {
  transform: rotate(-12deg) translate(-5%, 3%);
}

.feature-card:hover .mini-books span:nth-child(2) {
  transform: rotate(0deg) translateY(-8%);
}

.feature-card:hover .mini-books span:nth-child(3) {
  transform: rotate(11deg) translate(5%, 3%);
}

/* Home — intangible heritage index
   ========================================================================== */
.home-registry {
  position: relative;
  background: var(--paper);
}

.registry-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 25px;
  margin-bottom: 42px;
}

.registry-head .section-title {
  max-width: 700px;
}

.registry-list {
  border-top: 1px solid var(--line-strong);
}

.registry-row {
  display: grid;
  grid-template-columns: 150px 130px minmax(0, 1fr) 66px;
  align-items: center;
  gap: 20px;
  min-height: 118px;
  padding: 18px 8px;
  border-bottom: 1px solid var(--line);
  transition: background 0.4s ease, padding 0.5s var(--ease-out);
}

.registry-row:hover {
  padding-left: 22px;
  background: var(--celadon-soft);
}

.registry-row__cn {
  font-family: var(--font-serif);
  font-size: clamp(27px, 3.2vw, 39px);
  line-height: 1.2;
  letter-spacing: 0.08em;
}

.registry-row__en {
  color: var(--ink-mute);
  font-family: var(--font-latin);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.registry-row__items {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 15px;
  color: var(--ink-soft);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.registry-row__items span {
  position: relative;
}

.registry-row__items span + span::before {
  content: "·";
  position: absolute;
  left: -9px;
  color: var(--gold);
}

.registry-row__arrow {
  justify-self: end;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-soft);
  transition: background 0.35s ease, color 0.35s ease, border-color 0.35s ease;
}

.registry-row:hover .registry-row__arrow {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.registry-row__arrow svg {
  width: 14px;
  height: 14px;
}

/* Home — closing
   ========================================================================== */
.home-closing {
  position: relative;
  overflow: hidden;
  padding-block: clamp(88px, 12vw, 156px);
  border-top: 1px solid var(--line);
  background:
    radial-gradient(ellipse at 50% 55%, var(--celadon-soft), transparent 66%),
    var(--paper);
}

.home-closing::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(690px, 78vw);
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.home-closing::after {
  content: "山";
  position: absolute;
  top: 50%;
  left: 50%;
  color: var(--gold);
  font-family: var(--font-serif);
  font-size: clamp(190px, 27vw, 350px);
  line-height: 0.8;
  opacity: 0.05;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* The homepage replaces the ring and mountain mark with the lantern pair. */
.home-closing--lanterns::before,
.home-closing--lanterns::after {
  content: none;
}

/* Two lanterns flank the closing title. The grid keeps both lantern columns and
   their gaps in the title's own box, so the whole group scales and stays centred
   together; the artworks are stacked so a theme swap only changes opacity. */
.closing-title {
  --lantern-width: clamp(150px, 16vw, 240px);
  --lantern-gap: 24px;
  position: relative;
  display: grid;
  width: max-content;
  grid-template-columns: var(--lantern-width) auto var(--lantern-width);
  column-gap: var(--lantern-gap);
  justify-content: center;
  align-items: center;
  margin-top: 24px;
}

.closing-lantern {
  position: absolute;
  top: 50%;
  width: var(--lantern-width);
  aspect-ratio: 1260 / 2000;
  translate: 0 -50%;
  pointer-events: none;
}

.closing-lantern--left {
  left: 0;
}

.closing-lantern--right {
  right: 0;
}

.closing-lantern__swing {
  position: relative;
  width: 100%;
  height: 100%;
  transform-origin: 50% 0;
  animation: closing-lantern-sway 5.4s ease-in-out infinite;
  will-change: transform;
}

.closing-lantern--right .closing-lantern__swing {
  animation-delay: -2.7s;
}

.closing-lantern__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.7s ease;
  filter: drop-shadow(0 0 14px rgba(255, 228, 170, 0.2)) drop-shadow(0 0 34px rgba(255, 216, 150, 0.1));
}

.closing-lantern__img--night {
  opacity: 0;
  filter: drop-shadow(0 0 14px rgba(255, 210, 120, 0.34)) drop-shadow(0 0 30px rgba(255, 198, 96, 0.16));
}

html[data-theme="night"] .closing-lantern__img--day {
  opacity: 0;
}

html[data-theme="night"] .closing-lantern__img--night {
  opacity: 1;
}

@keyframes closing-lantern-sway {
  0%, 100% { transform: rotate(-2.6deg); }
  50% { transform: rotate(2.6deg); }
}

@media (max-width: 720px) {
  .closing-title {
    --lantern-width: clamp(44px, 16vw, 120px);
  }
}

.closing-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.closing-inner .eyebrow {
  justify-content: center;
}

.closing-inner .display {
  margin-top: 24px;
  font-size: clamp(38px, 5.3vw, 70px);
}

.closing-inner .closing-title .display {
  position: relative;
  z-index: 1;
  grid-column: 2;
  margin-top: 0;
}

/* Closing entrance: the title rises first, then both lanterns follow together.
   The block's generic reveal is neutralised here so this section only performs
   the requested, purely vertical fade-up. */
.js .home-closing--lanterns .closing-inner.reveal,
.js .home-closing--lanterns .closing-inner.reveal.is-visible {
  opacity: 1;
  translate: none;
  transition: none;
}

.js .home-closing--lanterns .closing-inner .closing-title .display,
.js .home-closing--lanterns .closing-inner .closing-lantern {
  opacity: 0;
  translate: 0 12px;
}

.js .home-closing--lanterns .closing-inner .closing-lantern {
  translate: 0 calc(-50% + 12px);
}

.js .home-closing--lanterns .closing-inner.is-visible .closing-title .display,
.js .home-closing--lanterns .closing-inner.is-visible .closing-lantern {
  opacity: 1;
  transition: opacity 0.95s ease-out, translate 0.95s ease-out;
}

.js .home-closing--lanterns .closing-inner.is-visible .closing-title .display {
  translate: 0 0;
}

.js .home-closing--lanterns .closing-inner.is-visible .closing-lantern {
  translate: 0 -50%;
  transition-delay: 0.12s;
}

.closing-inner .seal-stamp {
  margin-bottom: 24px;
}

.closing-inner .seal-space {
  margin-bottom: 24px;
}

.closing-inner .btn {
  margin-top: 36px;
}

.closing-note {
  margin-top: 22px;
  color: var(--ink-mute);
  font-family: var(--font-latin);
  font-size: 11px;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

/* Shared editorial components
   ========================================================================== */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(35px, 7vw, 105px);
}

.split--offset {
  align-items: start;
}

.split--offset > :last-child {
  margin-top: clamp(34px, 6vw, 90px);
}

.split--wide-left {
  grid-template-columns: minmax(0, 1.28fr) minmax(0, 0.72fr);
}

.split--wide-right {
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
}

.split__copy {
  max-width: 530px;
}

.split__copy .lede {
  margin-top: 25px;
}

.split__copy .prose {
  margin-top: 22px;
}

.split__copy .text-link {
  margin-top: 30px;
}

.split__media {
  position: relative;
}

.photo-frame {
  position: relative;
  width: 100%;
  aspect-ratio: var(--ratio, 4 / 3);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    linear-gradient(145deg, var(--placeholder-a), var(--placeholder-b));
  isolation: isolate;
}

.photo-frame > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-figure {
  margin: 0;
}

.photo-frame::before {
  content: "";
  position: absolute;
  inset: 11px;
  border: 1px solid color-mix(in srgb, var(--celadon-deep) 28%, transparent);
  pointer-events: none;
  z-index: 2;
}

.photo-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent 0 43px, color-mix(in srgb, var(--ink) 4%, transparent) 43px 44px),
    repeating-linear-gradient(90deg, transparent 0 43px, color-mix(in srgb, var(--ink) 4%, transparent) 43px 44px),
    url("../images/grain.svg");
  opacity: 0.65;
  pointer-events: none;
  z-index: 1;
}

.photo-frame--tall {
  --ratio: 3 / 4;
}

.photo-frame--wide {
  --ratio: 16 / 9;
}

.photo-frame--portrait {
  --ratio: 4 / 5;
}

.photo-frame--square {
  --ratio: 1 / 1;
}

/* A frame holding a real photograph instead of a placeholder: the labels sit
   on the picture, so they get a soft scrim and a light type colour. */
.photo-frame--filled::after {
  background:
    linear-gradient(180deg, rgba(11, 25, 23, 0.5), rgba(11, 25, 23, 0) 23%, rgba(11, 25, 23, 0) 74%, rgba(11, 25, 23, 0.48)),
    url("../images/grain.svg");
  opacity: 1;
}

.photo-frame--filled::before {
  border-color: color-mix(in srgb, #f4f1e8 34%, transparent);
}

.photo-frame--filled .photo-frame__corner,
.photo-frame--filled .photo-frame__no {
  color: #f6f2e7;
  text-shadow: 0 1px 8px rgba(10, 20, 18, 0.72);
}

.photo-frame__inner {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  text-align: center;
}

.photo-frame__icon {
  width: 42px;
  height: 42px;
  margin-bottom: 18px;
  color: var(--celadon-deep);
  opacity: 0.74;
}

.photo-frame__label {
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-size: 18px;
  letter-spacing: 0.12em;
}

.photo-frame__meta {
  margin-top: 10px;
  color: var(--ink-mute);
  font-family: var(--font-latin);
  font-size: 9px;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

.photo-frame__corner {
  position: absolute;
  z-index: 3;
  top: 21px;
  left: 23px;
  color: var(--ink-mute);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.photo-frame__no {
  position: absolute;
  z-index: 3;
  right: 22px;
  bottom: 17px;
  color: var(--ink-mute);
  font-family: var(--font-latin);
  font-size: 14px;
  letter-spacing: 0.08em;
}

.photo-caption {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 12px;
  color: var(--ink-mute);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.photo-caption span:last-child {
  flex: 0 0 auto;
  font-family: var(--font-latin);
  letter-spacing: 0.12em;
}

.editorial-image {
  position: relative;
  margin: 0;
  overflow: hidden;
  background: var(--paper-deep);
  border: 1px solid var(--line);
}

.editorial-image img {
  width: 100%;
  height: auto;
  filter: saturate(0.93) contrast(0.98);
  transition: transform 1.1s var(--ease-out), filter 0.6s ease;
}

.editorial-image--wide img {
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.editorial-image:hover img {
  transform: scale(1.025);
  filter: saturate(1) contrast(1);
}

.editorial-image figcaption {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 17px;
  border-top: 1px solid var(--line);
  color: var(--ink-mute);
  font-size: 10px;
  letter-spacing: 0.1em;
}

.editorial-image figcaption::before {
  content: "";
  width: 21px;
  height: 1px;
  background: var(--gold);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 2.4vw, 30px);
}

.photo-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.photo-grid--asymmetric {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: start;
}

.photo-grid--asymmetric > :last-child {
  margin-top: clamp(35px, 7vw, 96px);
}

.quote-block {
  position: relative;
  padding: clamp(30px, 5vw, 64px) 0 clamp(30px, 5vw, 64px) clamp(28px, 5vw, 62px);
  border-left: 1px solid var(--gold);
}

.quote-block::before {
  content: "“";
  position: absolute;
  top: -12px;
  left: 12px;
  color: var(--gold);
  font-family: var(--font-serif);
  font-size: 44px;
  opacity: 0.4;
}

.quote-block p {
  max-width: 770px;
  font-family: var(--font-serif);
  font-size: clamp(23px, 3vw, 37px);
  line-height: 1.8;
  letter-spacing: 0.06em;
}

.quote-block cite {
  display: block;
  margin-top: 22px;
  color: var(--ink-mute);
  font-size: 10px;
  font-style: normal;
  letter-spacing: 0.16em;
}

.fact-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.fact-strip__item {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 165px;
  padding: clamp(23px, 3.4vw, 38px);
}

.fact-strip__item + .fact-strip__item {
  border-left: 1px solid var(--line);
}

.fact-strip__value {
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: clamp(30px, 4vw, 50px);
  line-height: 1.2;
  letter-spacing: 0.04em;
}

.fact-strip__value em {
  font-size: 0.48em;
  font-style: normal;
  letter-spacing: 0.1em;
}

.fact-strip__label {
  color: var(--ink-soft);
  font-size: 12px;
  letter-spacing: 0.09em;
}

.fact-strip__note {
  margin-top: auto;
  color: var(--ink-mute);
  font-family: var(--font-latin);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
}

.timeline__item {
  display: grid;
  grid-template-columns: 125px minmax(0, 1fr);
  gap: clamp(20px, 5vw, 60px);
  padding-block: 27px;
  border-top: 1px solid var(--line);
}

.timeline__item:last-child {
  border-bottom: 1px solid var(--line);
}

.timeline__year {
  color: var(--gold);
  font-family: var(--font-latin);
  font-size: 22px;
  line-height: 1.4;
  letter-spacing: 0.05em;
}

.timeline__body h3 {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.timeline__body p {
  max-width: 640px;
  margin-top: 7px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.9;
}

.ink-band {
  position: relative;
  overflow: hidden;
  color: #ece6d6;
  background: #152923;
}

html[data-theme="night"] .ink-band {
  background: #0b121c;
}

.ink-band::before {
  content: "";
  position: absolute;
  top: -35%;
  right: -10%;
  width: min(620px, 60vw);
  aspect-ratio: 1;
  border: 1px solid rgba(238, 232, 217, 0.12);
  border-radius: 50%;
  pointer-events: none;
}

.ink-band .eyebrow {
  color: rgba(236, 230, 214, 0.55);
}

.ink-band .section-title,
.ink-band .display {
  color: #efe9da;
}

.ink-band .lede,
.ink-band .prose {
  color: rgba(236, 230, 214, 0.69);
}

.ink-band .text-link {
  color: #efe9da;
}

.ink-band .text-link::after {
  background: rgba(236, 230, 214, 0.26);
}

.ink-band .tag {
  background: rgba(236, 230, 214, 0.1);
  color: rgba(236, 230, 214, 0.75);
}

.ink-band .split__copy .prose {
  margin-top: 20px;
}

.ink-band .btn--ghost {
  border-color: rgba(236, 230, 214, 0.3);
  color: #efe9da;
}

.ink-band .btn--ghost:hover {
  border-color: #d4b57a;
  color: #d4b57a;
}

.ink-band .photo-frame {
  border-color: rgba(236, 230, 214, 0.15);
  background:
    linear-gradient(145deg, #1c312d, #102220);
}

.ink-band .photo-frame::before {
  border-color: rgba(236, 230, 214, 0.16);
}

.ink-band .photo-frame::after {
  opacity: 0.19;
}

.ink-band .photo-frame__label {
  color: rgba(236, 230, 214, 0.72);
}

.ink-band .photo-frame__corner,
.ink-band .photo-frame__no,
.ink-band .photo-frame__meta,
.ink-band .photo-caption {
  color: rgba(236, 230, 214, 0.45);
}

.ink-band .photo-frame__icon {
  color: #b3c5b9;
}

.process-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.process-card {
  position: relative;
  min-height: 240px;
  padding: 30px clamp(18px, 2.4vw, 32px);
}

.process-card + .process-card {
  border-left: 1px solid var(--line);
}

.process-card__index {
  color: var(--gold);
  font-family: var(--font-latin);
  font-size: 12px;
  letter-spacing: 0.12em;
}

.process-card h3 {
  margin-top: 34px;
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.process-card p {
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.9;
}

.process-card__glyph {
  position: absolute;
  top: 19px;
  right: 21px;
  color: var(--celadon-deep);
  font-family: var(--font-serif);
  font-size: 40px;
  line-height: 1;
  opacity: 0.26;
}

.story-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}

.story-item {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) 160px;
  gap: clamp(16px, 4vw, 50px);
  padding-block: 23px;
  border-bottom: 1px solid var(--line);
  transition: padding-left 0.4s var(--ease-out), background 0.35s ease;
}

.story-item:hover {
  padding-left: 12px;
  background: var(--celadon-soft);
}

.story-item__num {
  color: var(--gold);
  font-family: var(--font-latin);
  font-size: 13px;
  letter-spacing: 0.1em;
}

.story-item__title {
  font-family: var(--font-serif);
  font-size: clamp(19px, 2.3vw, 26px);
  font-weight: 500;
  letter-spacing: 0.06em;
}

.story-item__desc {
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.8;
}

.story-item__tag {
  justify-self: end;
  align-self: start;
  color: var(--ink-mute);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-align: right;
}

.page-note {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  max-width: 750px;
  margin-top: 44px;
  padding: 18px 0 0 20px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--gold);
  color: var(--ink-mute);
  font-size: 11px;
  line-height: 1.9;
}

.page-note::before {
  content: "注";
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line-strong);
  color: var(--gold);
  font-family: var(--font-serif);
  font-size: 11px;
}

.next-page {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  margin-top: clamp(60px, 9vw, 112px);
  padding-top: 28px;
  border-top: 1px solid var(--line-strong);
}

.next-page__label {
  color: var(--ink-mute);
  font-size: 10px;
  letter-spacing: 0.2em;
}

.next-page__link {
  display: inline-flex;
  align-items: center;
  gap: 15px;
  font-family: var(--font-serif);
  font-size: clamp(22px, 3vw, 34px);
  letter-spacing: 0.08em;
  transition: color 0.3s ease;
}

.next-page__link:hover {
  color: var(--seal);
}

.next-page__link svg {
  width: 22px;
  height: 22px;
  transition: transform 0.4s var(--ease-out);
}

.next-page__link:hover svg {
  transform: translateX(6px);
}

/* Generic section intro centered
   ========================================================================== */
.centered-head {
  max-width: 780px;
  margin: 0 auto clamp(40px, 6vw, 72px);
  text-align: center;
}

.centered-head .eyebrow {
  justify-content: center;
}

.centered-head .section-title {
  margin-top: 19px;
}

.centered-head .prose {
  max-width: 600px;
  margin: 20px auto 0;
}

/* Intangible heritage — the three books
   ========================================================================== */
.heritage-hero {
  position: relative;
}

.heritage-hero .page-hero::before {
  display: none;
}

.heritage-hero__stamp {
  position: absolute;
  top: 29%;
  right: clamp(26px, 9vw, 150px);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: var(--ink-mute);
  font-size: 9px;
  letter-spacing: 0.22em;
  writing-mode: vertical-rl;
}

.heritage-hero__stamp .seal-stamp {
  color: var(--seal);
  writing-mode: horizontal-tb;
}

.books-section {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 38%, var(--paper-raised), transparent 67%),
    var(--paper);
}

.books-section::before {
  content: "";
  position: absolute;
  inset: 7% 6% auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
  pointer-events: none;
}

.books-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(20px, 3vw, 36px);
}

.books-head .section-title {
  max-width: 610px;
}

.books-head__hint {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 8px;
  color: var(--ink-mute);
  font-size: 10px;
  letter-spacing: 0.16em;
}

.books-head__hint::before {
  content: "";
  width: 30px;
  height: 1px;
  background: var(--gold);
}

.book-shelf {
  --book-gap: clamp(8px, 2vw, 28px);
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--book-gap);
  height: 590px;
  margin-top: 10px;
  isolation: isolate;
}

.book-shelf::after {
  content: "";
  position: absolute;
  z-index: -2;
  right: -8%;
  bottom: 42px;
  left: -8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong) 17%, var(--line-strong) 83%, transparent);
  opacity: 0.55;
  box-shadow: 0 12px 50px rgba(48, 42, 31, 0.09);
}

.book-shelf::before {
  content: "";
  position: absolute;
  z-index: -2;
  right: 8%;
  bottom: 43px;
  left: 8%;
  height: 140px;
  background: linear-gradient(90deg, transparent, rgba(56, 48, 34, 0.06), transparent);
  filter: blur(20px);
  pointer-events: none;
}

.book-unit {
  position: relative;
  height: 100%;
  min-width: 0;
  transition: opacity 0.45s ease, filter 0.45s ease;
}

.book-unit::before {
  content: "";
  position: absolute;
  z-index: 0;
  bottom: 72px;
  left: 50%;
  width: 300px;
  height: 350px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(190, 215, 245, 0.14), transparent 68%);
  filter: blur(22px);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 0.6s ease;
}

html[data-theme="night"] .book-unit::before {
  opacity: 1;
}

.book-shelf.has-open .book-unit:not(.is-open) {
  opacity: 0.34;
  filter: blur(0.35px);
}

.book-object {
  --closed-w: 270px;
  --closed-h: 368px;
  --open-w: min(850px, 90vw);
  --open-h: 520px;
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: 72px;
  width: var(--closed-w);
  height: var(--closed-h);
  perspective: 1900px;
  transform: translateX(-50%) rotate(var(--tilt, 0deg));
  transform-origin: bottom center;
  transition: width 0.86s var(--ease-out), height 0.86s var(--ease-out), left 0.86s var(--ease-out), transform 0.86s var(--ease-out);
}

.book-unit.is-open {
  z-index: 20;
}

.book-unit.is-open .book-object {
  z-index: 20;
  width: var(--open-w);
  height: var(--open-h);
  transform: translateX(-50%) rotate(0deg);
}

.book-unit:first-child.is-open .book-object {
  left: calc(150% + var(--book-gap));
}

.book-unit:nth-child(3).is-open .book-object {
  left: calc(-50% - var(--book-gap));
}

.book-object::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 7px 5px 5px 9px;
  border-radius: 2px 5px 5px 2px;
  background: linear-gradient(100deg, #f8f1e2, #eadfc9);
  box-shadow: inset 14px 0 20px -20px rgba(65, 48, 27, 0.65);
  opacity: 0.94;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.book-object::after {
  content: "";
  position: absolute;
  z-index: 1;
  top: 5px;
  right: -6px;
  bottom: -6px;
  left: 9px;
  border-radius: 2px 7px 7px 2px;
  background: repeating-linear-gradient(180deg, #e6dbc4 0 1px, #f7efdf 1px 3px);
  box-shadow: 0 12px 24px rgba(51, 42, 28, 0.14);
  opacity: 0.9;
  pointer-events: none;
  transition: opacity 0.6s ease, transform 0.65s var(--ease-out);
}

.book-shadow {
  position: absolute;
  z-index: -1;
  right: 2%;
  bottom: -18px;
  left: 2%;
  height: 32px;
  border-radius: 50%;
  background: rgba(54, 45, 30, 0.2);
  filter: blur(14px);
  transition: right 0.9s var(--ease-out), left 0.9s var(--ease-out), opacity 0.5s ease;
}

html[data-theme="night"] .book-shadow {
  background: rgba(0, 0, 0, 0.5);
}

.book-unit.is-open .book-shadow {
  right: -8%;
  left: -8%;
  bottom: 4px;
  height: 38px;
  background: rgba(45, 38, 25, 0.27);
}

.book-ribbon {
  position: absolute;
  z-index: 3;
  bottom: -45px;
  left: 50%;
  width: 10px;
  height: 66px;
  background: var(--ribbon, var(--gold));
  clip-path: polygon(0 0, 100% 0, 100% 84%, 50% 100%, 0 84%);
  box-shadow: 0 3px 4px rgba(50, 40, 27, 0.12);
  transform: translateX(-50%);
  transition: opacity 0.35s ease, transform 0.8s var(--ease-out);
}

.book-unit.is-open .book-ribbon {
  bottom: -28px;
  opacity: 0;
  transform: translateX(-50%) translateY(10px);
}

.book-spread {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border-radius: 3px;
  background:
    linear-gradient(90deg, rgba(101, 83, 54, 0.03), transparent 12%, transparent 88%, rgba(101, 83, 54, 0.04)),
    url("../images/book-paper.webp") center / cover no-repeat,
    #efe4cf;
  box-shadow: 0 30px 65px rgba(46, 37, 24, 0.22), 0 2px 0 rgba(97, 77, 48, 0.2);
  opacity: 0;
  pointer-events: none;
  transform: scaleX(0.36);
  transform-origin: center;
  transition: opacity 0.42s ease, transform 0.78s var(--ease-out);
}

.book-spread::after {
  content: "";
  position: absolute;
  z-index: 8;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 55px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(75, 59, 37, 0.14) 46%, rgba(255, 252, 242, 0.2) 53%, transparent);
  pointer-events: none;
}

.book-unit.is-open .book-spread {
  opacity: 1;
  pointer-events: auto;
  transform: scaleX(1);
}

.book-page {
  position: relative;
  min-width: 0;
  height: 100%;
  padding: clamp(24px, 3vw, 36px);
  overflow: hidden;
  color: #3e3a2c;
  background:
    linear-gradient(110deg, rgba(255, 252, 242, 0.38), transparent 42%, rgba(128, 102, 62, 0.045)),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(94, 74, 41, 0.022) 39px 40px),
    url("../images/book-paper.webp") center / cover no-repeat;
}

html[data-theme="night"] .book-page {
  background:
    linear-gradient(110deg, rgba(255, 244, 220, 0.22), transparent 44%, rgba(82, 56, 28, 0.06)),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(94, 74, 41, 0.028) 39px 40px),
    url("../images/book-paper.webp") center / cover no-repeat;
}

.book-page::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(100, 81, 50, 0.16);
  pointer-events: none;
}

.book-page--left {
  padding-right: clamp(36px, 4vw, 60px);
  box-shadow: inset -32px 0 42px -46px rgba(56, 42, 24, 0.65);
}

.book-page--right {
  padding-left: clamp(28px, 3vw, 40px);
  box-shadow: inset 32px 0 42px -46px rgba(56, 42, 24, 0.65);
}

.book-page__head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: rgba(75, 61, 39, 0.64);
  font-size: 9px;
  letter-spacing: 0.19em;
}

.book-page__head span:last-child {
  font-family: var(--font-latin);
  font-size: 11px;
}

.book-page__vertical {
  position: relative;
  z-index: 2;
  margin-top: clamp(25px, 3vw, 36px);
  color: #3e3a2c;
  font-family: var(--font-serif);
  font-size: clamp(45px, 4.4vw, 58px);
  line-height: 1.2;
  letter-spacing: 0.2em;
  writing-mode: vertical-rl;
}

.book-page__category-en {
  position: absolute;
  top: clamp(80px, 10vw, 120px);
  right: clamp(24px, 3vw, 36px);
  color: rgba(80, 65, 41, 0.52);
  font-family: var(--font-latin);
  font-size: 10px;
  letter-spacing: 0.18em;
  writing-mode: vertical-rl;
}

.book-page__title {
  position: absolute;
  right: clamp(24px, 3vw, 34px);
  bottom: clamp(100px, 13vw, 135px);
  left: clamp(36px, 4.2vw, 57px);
  color: #443e2f;
  font-family: var(--font-serif);
  font-size: clamp(20px, 2.2vw, 29px);
  font-weight: 500;
  line-height: 1.65;
  letter-spacing: 0.09em;
}

.book-page__desc {
  position: absolute;
  right: clamp(24px, 3vw, 34px);
  bottom: clamp(68px, 8vw, 88px);
  left: clamp(36px, 4.2vw, 57px);
  max-width: 280px;
  color: rgba(62, 58, 44, 0.7);
  font-family: var(--font-serif);
  font-size: 11px;
  line-height: 1.9;
  letter-spacing: 0.04em;
}

.book-page__seal {
  position: absolute;
  right: clamp(27px, 3.4vw, 42px);
  bottom: 26px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(154, 70, 57, 0.78);
  color: rgba(154, 70, 57, 0.86);
  font-family: var(--font-serif);
  font-size: 10px;
  line-height: 1.1;
  text-align: center;
  transform: rotate(-2deg);
}

.book-page__seal::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid currentColor;
  opacity: 0.45;
}

.book-page__count {
  position: absolute;
  bottom: 26px;
  left: clamp(36px, 4.2vw, 57px);
  color: rgba(75, 61, 39, 0.55);
  font-family: var(--font-latin);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.book-page__caption {
  position: absolute;
  top: 50%;
  right: clamp(25px, 3vw, 37px);
  color: rgba(75, 61, 39, 0.53);
  font-family: var(--font-serif);
  font-size: 9px;
  letter-spacing: 0.15em;
  writing-mode: vertical-rl;
  transform: translateY(-50%);
}

.book-cards {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 22px;
}

.book-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 5px;
  border: 1px solid rgba(97, 76, 44, 0.16);
  background: rgba(255, 251, 240, 0.45);
  color: #443e2f;
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  transition: opacity 0.45s ease, transform 0.65s var(--ease-out), background 0.3s ease;
}

.book-unit.is-open .book-card {
  opacity: 1;
  transform: none;
  transition-delay: calc(0.35s + var(--card-i, 0) * 0.075s);
}

.book-card:hover {
  background: rgba(255, 252, 242, 0.8);
}

.book-card__thumb {
  position: relative;
  aspect-ratio: 1.7;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 30% 24%, rgba(255, 255, 255, 0.66), transparent 42%),
    linear-gradient(135deg, var(--thumb-a, #dce6dc), var(--thumb-b, #e9dfcd));
}

.book-card__thumb::before {
  content: attr(data-glyph);
  position: absolute;
  right: 9px;
  bottom: -0.22em;
  color: rgba(67, 78, 65, 0.18);
  font-family: var(--font-serif);
  font-size: 54px;
  line-height: 1;
}

.book-card__thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent 0 17px, rgba(80, 65, 41, 0.06) 17px 18px),
    url("../images/grain.svg");
  opacity: 0.8;
}

.book-card__thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.76;
  filter: saturate(0.85) sepia(0.08);
}

.book-card__body {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 5px;
  padding: 7px 3px 4px;
}

.book-card__name {
  overflow: hidden;
  font-family: var(--font-serif);
  font-size: clamp(10px, 1.1vw, 13px);
  line-height: 1.45;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-card__no {
  flex: 0 0 auto;
  color: rgba(75, 61, 39, 0.48);
  font-family: var(--font-latin);
  font-size: 9px;
}

.book-cover {
  position: absolute;
  z-index: 5;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 2px 6px 6px 2px;
  background-color: #c4af8a;
  background-image: var(--cover-image);
  background-position: center;
  background-size: cover;
  box-shadow:
    0 22px 40px rgba(51, 42, 28, 0.2),
    inset 7px 0 12px -9px rgba(255, 251, 238, 0.7),
    inset -4px 0 8px -7px rgba(52, 40, 23, 0.55);
  cursor: pointer;
  filter: saturate(0.94) brightness(1.01);
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform 0.82s var(--ease-out), box-shadow 0.65s ease, filter 0.5s ease;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.book-cover::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 248, 232, 0.12) 0%, transparent 8%, transparent 88%, rgba(23, 19, 12, 0.18) 100%),
    linear-gradient(180deg, rgba(255, 248, 232, 0.07), transparent 28%, transparent 74%, rgba(35, 27, 16, 0.16));
  pointer-events: none;
  transition: background 0.5s ease, opacity 0.5s ease;
}

.book-cover::after {
  content: "";
  position: absolute;
  right: 7px;
  top: 0;
  bottom: 0;
  z-index: 3;
  width: 3px;
  border-left: 1px solid rgba(255, 250, 236, 0.22);
  background: repeating-linear-gradient(180deg, rgba(255, 248, 230, 0.28) 0 2px, transparent 2px 22px);
  opacity: 0.65;
  pointer-events: none;
}

.book-unit.is-open .book-cover {
  box-shadow: 8px 20px 34px rgba(51, 42, 28, 0.16);
  pointer-events: none;
  transform: rotateY(-168deg);
}

.book-unit.is-open .book-object::after {
  opacity: 0;
}

.book-unit.is-open .book-object::before {
  opacity: 0;
}

.book-cover:focus-visible {
  outline-offset: 5px;
}

.book-unit--huadeng {
  --tilt: -4deg;
  --ribbon: #b68b55;
  --thumb-a: #ead7b9;
  --thumb-b: #c7a87b;
  --cover-image: url("../images/book-cover-huadeng.webp");
}

.book-unit--xingyi {
  --tilt: 1.6deg;
  --ribbon: #486458;
  --thumb-a: #ced9cc;
  --thumb-b: #82978a;
  --cover-image: url("../images/book-cover-xingyi.webp");
}

.book-unit--yuewu {
  --tilt: 4.7deg;
  --ribbon: #c8b596;
  --thumb-a: #eee3d0;
  --thumb-b: #d5c0a2;
  --cover-image: url("../images/book-cover-yuewu.webp");
}

html[data-theme="night"] .book-cover {
  filter: brightness(0.84) saturate(0.84) contrast(1.02);
  box-shadow:
    0 24px 44px rgba(0, 0, 0, 0.4),
    0 0 42px rgba(190, 215, 245, 0.1),
    inset 7px 0 12px -9px rgba(230, 240, 255, 0.3),
    inset -4px 0 8px -7px rgba(0, 0, 0, 0.52);
}

html[data-theme="night"] .book-cover::before {
  background:
    linear-gradient(90deg, rgba(230, 240, 255, 0.07) 0%, transparent 12%, transparent 82%, rgba(2, 6, 12, 0.4) 100%),
    linear-gradient(168deg, rgba(215, 230, 250, 0.1), transparent 36%, rgba(3, 8, 16, 0.35) 100%);
}

html[data-theme="night"] .book-object::after {
  background: repeating-linear-gradient(180deg, #cabea8 0 1px, #e2d6c1 1px 3px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
  opacity: 0.62;
}

html[data-theme="night"] .book-object::before {
  background: linear-gradient(100deg, #e6dbc7, #cfc1a9);
}

.book-unit__caption {
  position: absolute;
  right: 0;
  bottom: 48px;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--ink-mute);
  font-family: var(--font-serif);
  font-size: 12px;
  letter-spacing: 0.15em;
  text-align: center;
  transition: opacity 0.35s ease, transform 0.6s var(--ease-out);
}

.book-unit__caption span {
  color: var(--gold);
  font-family: var(--font-latin);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.book-unit.is-open .book-unit__caption {
  opacity: 0;
  transform: translateY(8px);
}

.book-shelf__note {
  margin-top: 26px;
  color: var(--ink-mute);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-align: center;
}

.book-backdrop {
  display: none;
}

/* Heritage index on the heritage page
   ========================================================================== */
.heritage-index {
  border-top: 1px solid var(--line);
}

.heritage-index__category {
  display: grid;
  grid-template-columns: 235px minmax(0, 1fr);
  align-items: start;
  gap: clamp(24px, 5vw, 70px);
  padding-block: clamp(36px, 5vw, 58px);
  border-bottom: 1px solid var(--line);
}

.heritage-index__aside {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.heritage-index__cn {
  font-family: var(--font-serif);
  font-size: 43px;
  line-height: 1.3;
  letter-spacing: 0.1em;
}

.heritage-index__en {
  color: var(--ink-mute);
  font-family: var(--font-latin);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.heritage-index__desc {
  max-width: 240px;
  margin-top: 8px;
  color: var(--ink-mute);
  font-size: 11px;
  line-height: 1.9;
}

.heritage-index__items {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(24px, 4vw, 55px);
  border-top: 1px solid var(--line);
}

.heritage-index__item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding-block: 16px;
  border-bottom: 1px solid var(--line);
  transition: padding-left 0.35s var(--ease-out), color 0.3s ease;
}

.heritage-index__item:hover {
  padding-left: 9px;
  color: var(--seal);
}

.heritage-index__item span:first-child {
  font-family: var(--font-serif);
  font-size: 17px;
  letter-spacing: 0.07em;
}

.heritage-index__item span:last-child {
  color: var(--ink-mute);
  font-family: var(--font-latin);
  font-size: 10px;
  letter-spacing: 0.08em;
}

/* Heritage detail page
   ========================================================================== */
.detail-page {
  padding-top: calc(var(--header-h) + 44px);
  background: var(--paper);
}

.detail-shell {
  transition: opacity 0.28s ease, transform 0.4s var(--ease-out);
}

.detail-shell.is-leaving-left {
  opacity: 0;
  transform: translateX(-34px);
}

.detail-shell.is-leaving-right {
  opacity: 0;
  transform: translateX(34px);
}

.detail-shell.is-entering-left {
  opacity: 0;
  transform: translateX(28px);
}

.detail-shell.is-entering-right {
  opacity: 0;
  transform: translateX(-28px);
}

.detail-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--ink-mute);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.detail-breadcrumb a {
  transition: color 0.3s ease;
}

.detail-breadcrumb a:hover {
  color: var(--seal);
}

.detail-breadcrumb i {
  font-style: normal;
  color: var(--line-strong);
}

/* Back arrow below the breadcrumb, above and left of the item title.
   The visual token is shared with the site-wide .page-back__button, so the
   icon, hover motion and day/night colours stay identical everywhere. */
.detail-back {
  display: flex;
  margin-top: clamp(14px, 2vw, 20px);
}

.detail-back__link {
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.detail-back + .detail-head {
  margin-top: clamp(18px, 2.6vw, 30px);
}

.detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 30px;
  align-items: end;
  margin-top: clamp(36px, 5vw, 59px);
}

.detail-head__main {
  max-width: 840px;
}

.detail-category {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-mute);
  font-size: 10px;
  letter-spacing: 0.18em;
}

.detail-category::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--gold);
}

.detail-title {
  margin-top: 14px;
  font-family: var(--font-serif);
  font-size: clamp(47px, 7vw, 88px);
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: 0.08em;
}

.detail-subtitle {
  max-width: 670px;
  margin-top: 14px;
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-size: clamp(15px, 1.7vw, 19px);
  line-height: 1.9;
  letter-spacing: 0.04em;
}

.detail-head__aside {
  justify-self: end;
  padding-bottom: 10px;
  text-align: right;
}

.detail-head__aside .seal-stamp {
  margin-left: auto;
}

.detail-head__aside p {
  margin-top: 15px;
  color: var(--ink-mute);
  font-family: var(--font-latin);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.detail-carousel {
  margin-top: clamp(30px, 4.5vw, 52px);
}

.carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--paper-deep);
  border: 1px solid var(--line);
}

.carousel__stage {
  position: relative;
  aspect-ratio: 16 / 8.6;
  min-height: 310px;
}

.carousel__slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: scale(1.015);
  transition: opacity 0.65s ease, visibility 0s linear 0.65s, transform 1.1s var(--ease-out);
  background:
    radial-gradient(ellipse at 28% 18%, rgba(255, 255, 255, 0.46), transparent 35%),
    linear-gradient(130deg, var(--slide-a), var(--slide-b));
}

.carousel__slide.is-active {
  z-index: 2;
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  transition: opacity 0.65s ease, visibility 0s linear 0s, transform 1.1s var(--ease-out);
}

.carousel__slide-img {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.96) contrast(0.98);
}

.carousel__slide.has-image::after {
  z-index: 2;
  background:
    linear-gradient(180deg, rgba(13, 26, 24, 0.04) 18%, rgba(12, 24, 22, 0.72) 100%),
    url("../images/grain.svg");
  opacity: 0.8;
}

.carousel__slide.has-image::before {
  opacity: 0.18;
}

.carousel__slide.has-image .carousel__placeholder {
  z-index: 4;
}

.carousel__slide.has-image .carousel__slide-inner {
  text-shadow: 0 2px 20px rgba(19, 26, 23, 0.4);
}

.carousel__slide::before {
  content: attr(data-glyph);
  position: absolute;
  top: 48%;
  left: 50%;
  color: rgba(46, 57, 47, 0.09);
  font-family: var(--font-serif);
  font-size: clamp(190px, 30vw, 450px);
  line-height: 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.carousel__slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent 0 54px, rgba(63, 56, 40, 0.045) 54px 55px),
    repeating-linear-gradient(90deg, transparent 0 54px, rgba(63, 56, 40, 0.045) 54px 55px),
    url("../images/grain.svg");
  opacity: 0.62;
  pointer-events: none;
}

.carousel__slide--huadeng {
  --slide-a: #d8bd95;
  --slide-b: #a87950;
}

.carousel__slide--xingyi {
  --slide-a: #b7c6b7;
  --slide-b: #607d72;
}

.carousel__slide--yuewu {
  --slide-a: #e8decd;
  --slide-b: #c8b28e;
}

html[data-theme="night"] .carousel__slide--huadeng {
  --slide-a: #1a2534;
  --slide-b: #151f2d;
}

html[data-theme="night"] .carousel__slide--xingyi {
  --slide-a: #1a2534;
  --slide-b: #151f2d;
}

html[data-theme="night"] .carousel__slide--yuewu {
  --slide-a: #1a2534;
  --slide-b: #151f2d;
}

.carousel__slide-inner {
  position: relative;
  z-index: 3;
  width: 100%;
  padding: clamp(25px, 4vw, 52px);
  color: rgba(255, 251, 241, 0.95);
  text-shadow: 0 2px 18px rgba(44, 35, 24, 0.18);
}

.carousel__slide-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  color: rgba(255, 248, 234, 0.7);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.carousel__slide-meta::before {
  content: "";
  width: 30px;
  height: 1px;
  background: rgba(255, 248, 234, 0.55);
}

.carousel__slide-title {
  margin-top: 10px;
  font-family: var(--font-serif);
  font-size: clamp(24px, 3.7vw, 46px);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.07em;
}

.carousel__slide-note {
  max-width: 460px;
  margin-top: 5px;
  color: rgba(255, 248, 234, 0.68);
  font-size: 11px;
  line-height: 1.8;
  letter-spacing: 0.06em;
}

.carousel__placeholder {
  position: absolute;
  z-index: 2;
  top: clamp(20px, 4vw, 46px);
  right: clamp(20px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  color: rgba(255, 250, 239, 0.7);
  text-align: right;
}

.carousel__placeholder span {
  font-size: 9px;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.carousel__placeholder strong {
  font-family: var(--font-latin);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.08em;
}

.carousel__arrow {
  position: absolute;
  z-index: 5;
  top: 50%;
  display: grid;
  place-items: center;
  width: 47px;
  height: 47px;
  border: 1px solid rgba(255, 250, 240, 0.42);
  border-radius: 50%;
  background: rgba(20, 32, 28, 0.12);
  color: rgba(255, 251, 241, 0.95);
  cursor: pointer;
  transform: translateY(-50%);
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.carousel__arrow:hover {
  border-color: var(--gold);
  background: var(--paper-raised);
  color: var(--ink);
}

.carousel__arrow--prev {
  left: clamp(15px, 3vw, 34px);
}

.carousel__arrow--next {
  right: clamp(15px, 3vw, 34px);
}

.carousel__arrow svg {
  width: 18px;
  height: 18px;
}

.carousel__foot {
  position: absolute;
  z-index: 5;
  right: clamp(21px, 4vw, 48px);
  bottom: clamp(19px, 3vw, 31px);
  display: flex;
  align-items: center;
  gap: 18px;
  color: rgba(255, 251, 241, 0.74);
}

.carousel__dots {
  display: flex;
  align-items: center;
  gap: 7px;
}

.carousel__dot {
  width: 5px;
  height: 5px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 251, 241, 0.4);
  cursor: pointer;
  transition: width 0.3s var(--ease-out), border-radius 0.3s ease, background 0.3s ease;
}

.carousel__dot.is-active {
  width: 20px;
  border-radius: 999px;
  background: rgba(255, 251, 241, 0.95);
}

.carousel__counter {
  min-width: 48px;
  font-family: var(--font-latin);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-align: right;
}

.carousel__hint {
  margin-top: 12px;
  color: var(--ink-mute);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-align: right;
}

.detail-body {
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(230px, 0.5fr);
  gap: clamp(35px, 7vw, 110px);
  margin-top: clamp(52px, 8vw, 96px);
}

.detail-copy h2 {
  font-family: var(--font-serif);
  font-size: clamp(25px, 3vw, 37px);
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0.06em;
}

.detail-copy > p {
  margin-top: 20px;
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 2.15;
  letter-spacing: 0.04em;
}

.writing-space {
  position: relative;
  margin-top: 42px;
  padding: clamp(25px, 4vw, 42px);
  border: 1px solid var(--line);
  background:
    linear-gradient(120deg, var(--celadon-soft), transparent 72%),
    var(--paper-raised);
}

.writing-space::before {
  content: "文字预留";
  position: absolute;
  top: -1px;
  left: 26px;
  padding: 0 9px;
  background: var(--paper);
  color: var(--ink-mute);
  font-size: 9px;
  letter-spacing: 0.17em;
  transform: translateY(-50%);
}

.writing-space__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.writing-space__col {
  color: var(--ink-mute);
  font-size: 10px;
  line-height: 2;
  letter-spacing: 0.06em;
}

.writing-space__col strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.1em;
}

.writing-space__lines {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-top: 12px;
}

.writing-space__lines span {
  display: block;
  height: 1px;
  background: var(--line);
}

.writing-space__lines span:nth-child(2) {
  width: 86%;
}

.writing-space__lines span:nth-child(3) {
  width: 67%;
}

/* Finished entries replace the placeholder above with readable sections.
   Only rendered when an item provides copy; the placeholder stays for the
   entries that are still being written. */
.detail-sections {
  margin-top: clamp(34px, 4vw, 46px);
  border-top: 1px solid var(--line-strong);
}

.detail-section {
  display: grid;
  grid-template-columns: minmax(92px, 124px) minmax(0, 1fr);
  gap: clamp(16px, 3vw, 38px);
  padding-block: clamp(20px, 2.6vw, 28px);
  border-bottom: 1px solid var(--line);
}

.detail-section h3 {
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.9;
  letter-spacing: 0.12em;
}

.detail-section p {
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-size: 14.5px;
  line-height: 2.15;
  letter-spacing: 0.03em;
}

/* Key terms in the copy are marked with **…** in heritage-data.js and rendered
   as <strong> by detail.js. One accent colour per theme; size, line-height and
   spacing stay exactly those of the surrounding paragraph. */
.detail-copy > p strong,
.detail-section p strong {
  color: var(--seal);
  font-weight: 600;
}

html[data-theme="night"] .detail-copy > p strong,
html[data-theme="night"] .detail-section p strong {
  color: var(--gold);
}

.detail-meta {
  align-self: start;
  padding-top: 7px;
  border-top: 1px solid var(--line-strong);
}

.detail-meta__row {
  display: flex;
  align-items: baseline;
  gap: 15px;
  padding-block: 14px;
  border-bottom: 1px solid var(--line);
}

.detail-meta__row dt {
  flex: 0 0 60px;
  color: var(--ink-mute);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.detail-meta__row dd {
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-size: 13px;
  line-height: 1.75;
}

.detail-meta__note {
  margin-top: 24px;
  color: var(--ink-mute);
  font-size: 10px;
  line-height: 1.9;
  letter-spacing: 0.05em;
}

/* Five-colour lion icons replace the meta column on the 五色狮灯 detail page.
   The icons carry their own enamel colours; only the soft halo behind each one
   changes with the day / night theme. */
.detail-aside {
  align-self: start;
  min-width: 0;
  overflow: visible;
}

/* The five icons sit in a single vertical column. They are fixed at 130px,
   centred in the right-hand track, with 24px between the icon boxes and enough
   panel padding for each halo to extend without being clipped. */
.lion-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
  padding-block: 38px;
  overflow: visible;
}

.lion-panel[hidden] {
  display: none;
}

.lion-icon {
  --lion-halo: 205, 90, 65;
  --lion-halo-day: 0.1;
  --lion-halo-night: 0.8;
  --lion-halo-delay: 0s;
  position: relative;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 130px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
}

.lion-icon--cyan {
  --lion-halo: 47, 176, 158;
  --lion-halo-night: 0.82;
  --lion-halo-delay: -0.4s;
}

.lion-icon--red {
  --lion-halo: 213, 73, 51;
  --lion-halo-night: 0.86;
  --lion-halo-delay: -2.1s;
}

.lion-icon--yellow {
  --lion-halo: 242, 194, 63;
  --lion-halo-night: 0.82;
  --lion-halo-delay: -3.6s;
}

.lion-icon--blue {
  --lion-halo: 64, 132, 196;
  --lion-halo-night: 0.84;
  --lion-halo-delay: -4.8s;
}

.lion-icon--purple {
  --lion-halo: 155, 63, 107;
  --lion-halo-night: 0.84;
  --lion-halo-delay: -1.4s;
}

.lion-icon__figure {
  position: relative;
  display: block;
  width: 130px;
  height: 130px;
  isolation: isolate;
}

.lion-icon__halo {
  position: absolute;
  inset: -18%;
  z-index: 0;
  border-radius: 50%;
  opacity: var(--lion-halo-day);
  transition: opacity 0.55s ease;
  pointer-events: none;
}

.lion-icon__halo::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(var(--lion-halo), 0.9) 0%,
    rgba(var(--lion-halo), 0.5) 32%,
    rgba(var(--lion-halo), 0.2) 56%,
    rgba(var(--lion-halo), 0) 74%
  );
  filter: blur(12px);
  transform: scale(0.9);
}

.lion-icon__art {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: 50% 66%;
  filter: drop-shadow(0 2px 3px rgba(31, 48, 42, 0.14));
  transition: filter 0.45s ease, opacity 0.45s ease;
  pointer-events: none;
}

/* At night an icon whose halo is switched off also loses its colour, so the
   lit / unlit state reads clearly. Day mode always keeps the enamel colours. */
html[data-theme="night"] .lion-icon.is-halo-off .lion-icon__art {
  filter: grayscale(1) brightness(0.72) contrast(0.9) drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
  opacity: 0.5;
}

.lion-icon__direction {
  position: relative;
  z-index: 2;
  margin-top: 8px;
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
  user-select: none;
  transition: color 0.4s ease, text-shadow 0.4s ease;
}

html[data-theme="night"] .lion-icon__direction {
  color: var(--gold);
  text-shadow:
    0 1px 3px rgba(6, 10, 16, 0.55),
    0 0 10px rgba(207, 179, 124, 0.34);
}

html[data-theme="night"] .lion-icon__halo {
  opacity: var(--lion-halo-night);
}

html[data-theme="night"] .lion-icon__halo::after {
  animation: lion-halo-breathe 7.6s ease-in-out infinite;
  animation-delay: var(--lion-halo-delay);
}

html[data-theme="night"] .lion-icon.is-halo-off .lion-icon__halo {
  opacity: 0;
}

html[data-theme="night"] .lion-icon.is-halo-off .lion-icon__halo::after {
  animation-play-state: paused;
}

@keyframes lion-halo-breathe {
  0%, 100% {
    opacity: 0.7;
    transform: scale(0.9);
  }
  50% {
    opacity: 1;
    transform: scale(1.06);
  }
}

@media (hover: hover) and (pointer: fine) {
  .lion-icon:hover .lion-icon__art,
  .lion-icon:focus-visible .lion-icon__art {
    animation: lion-sway 2.4s ease-in-out infinite;
  }
}

@keyframes lion-sway {
  0%, 100% {
    transform: rotate(0deg) translateY(0);
  }
  25% {
    transform: rotate(-2deg) translateY(-1px);
  }
  75% {
    transform: rotate(2deg) translateY(-1px);
  }
}

.detail-switcher {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: clamp(54px, 8vw, 100px);
  padding-top: 24px;
  border-top: 1px solid var(--line-strong);
}

.detail-switcher__label {
  color: var(--ink-mute);
  font-size: 10px;
  letter-spacing: 0.13em;
}

.detail-switcher__label strong {
  color: var(--ink-soft);
  font-weight: 400;
}

.detail-switcher__actions {
  display: flex;
  gap: 10px;
}

.switch-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 10px;
  letter-spacing: 0.09em;
  cursor: pointer;
  transition: border-color 0.3s ease, color 0.3s ease, background 0.3s ease;
}

.switch-button:hover {
  border-color: var(--gold);
  color: var(--ink);
  background: var(--celadon-soft);
}

.switch-button svg {
  width: 13px;
  height: 13px;
}

.detail-swipe-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  margin-top: 55px;
  color: var(--ink-mute);
  font-size: 9px;
  letter-spacing: 0.16em;
}

.detail-swipe-hint::before,
.detail-swipe-hint::after {
  content: "";
  width: 35px;
  height: 1px;
  background: var(--line);
}

.detail-end {
  margin-top: 36px;
  text-align: center;
}

.detail-end .text-link {
  font-size: 10px;
}

/* Page-specific: overview
   ========================================================================== */
.overview-hero .page-hero__title {
  max-width: 900px;
}

.overview-intro .split__media {
  padding-left: clamp(0px, 3vw, 35px);
}

.overview-intro .split__media::before {
  content: "";
  position: absolute;
  top: -24px;
  bottom: 26px;
  left: 6px;
  width: 58%;
  border: 1px solid var(--line);
  pointer-events: none;
}

.overview-intro .photo-frame {
  position: relative;
  z-index: 1;
}

.overview-timeline {
  max-width: 980px;
  margin-top: clamp(44px, 6vw, 76px);
  margin-inline: auto;
}

.overview-map {
  position: relative;
  min-height: 420px;
  padding: clamp(25px, 4vw, 46px);
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(ellipse at 50% 45%, var(--celadon-soft), transparent 63%),
    var(--paper-raised);
}

.overview-map::before {
  content: "";
  position: absolute;
  inset: 13px;
  border: 1px solid var(--line);
  pointer-events: none;
}

.overview-map__lines {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image:
    repeating-linear-gradient(31deg, transparent 0 87px, var(--line) 87px 88px),
    repeating-linear-gradient(148deg, transparent 0 117px, var(--line) 117px 118px);
  -webkit-mask-image: radial-gradient(ellipse at 50% 50%, #000, transparent 75%);
  mask-image: radial-gradient(ellipse at 50% 50%, #000, transparent 75%);
}

.overview-map__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 330px;
}

.overview-map__coordinates {
  color: var(--gold);
  font-family: var(--font-latin);
  font-size: 12px;
  letter-spacing: 0.16em;
}

.overview-map__place {
  margin-top: 8px;
  font-family: var(--font-serif);
  font-size: clamp(37px, 5vw, 68px);
  letter-spacing: 0.12em;
}

.overview-map__desc {
  max-width: 315px;
  margin-top: 13px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.9;
}

/* Page-specific: Xuanwu
   ========================================================================== */
.festival-lock {
  padding-top: clamp(38px, 5vw, 72px);
  padding-bottom: clamp(38px, 5vw, 72px);
}

.festival-lock__card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.55fr);
  align-items: end;
  gap: clamp(30px, 5vw, 72px);
  padding: clamp(28px, 4.5vw, 58px);
  overflow: hidden;
  border: 1px solid rgba(236, 230, 214, 0.16);
  background: #152923;
  color: #eee8d9;
}

.festival-lock__card::before {
  content: "丙";
  position: absolute;
  right: -0.08em;
  bottom: -0.3em;
  color: #efe9da;
  font-family: var(--font-serif);
  font-size: clamp(220px, 30vw, 430px);
  line-height: 0.8;
  letter-spacing: -0.08em;
  opacity: 0.035;
  pointer-events: none;
}

.festival-lock__card::after {
  content: "";
  position: absolute;
  top: 0;
  left: clamp(28px, 4.5vw, 58px);
  width: 92px;
  height: 2px;
  background: #c4a66e;
}

html[data-theme="night"] .festival-lock__card {
  background: #151f2d;
}

.festival-lock__identity {
  position: relative;
  z-index: 1;
}

.festival-lock__identity .eyebrow {
  color: rgba(236, 230, 214, 0.55);
}

.festival-lock__identity .eyebrow::before {
  background: #c4a66e;
}

.festival-lock__title {
  margin-top: 18px;
  color: #efe9da;
  font-family: var(--font-serif);
  font-size: clamp(30px, 4vw, 52px);
  font-weight: 500;
  line-height: 1.32;
  letter-spacing: 0.06em;
}

.festival-lock__title em {
  color: #d7ba80;
  font-style: normal;
}

.festival-lock__intro {
  max-width: 320px;
  margin-top: 20px;
  color: rgba(236, 230, 214, 0.62);
  font-size: 12px;
  line-height: 1.95;
  letter-spacing: 0.04em;
}

.festival-lock__facts {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.festival-fact {
  min-width: 0;
  padding: 7px clamp(15px, 2vw, 28px) 5px;
  border-left: 1px solid rgba(236, 230, 214, 0.16);
}

.festival-fact:first-child {
  padding-left: 0;
  border-left: 0;
}

.festival-fact__value {
  display: block;
  color: #d8bb82;
  font-family: var(--font-serif);
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.festival-fact__label {
  display: block;
  margin-top: 7px;
  color: rgba(236, 230, 214, 0.36);
  font-family: var(--font-latin);
  font-size: 9px;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.festival-fact h3 {
  margin-top: 23px;
  color: #efe9da;
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.1em;
}

.festival-fact p {
  margin-top: 6px;
  color: rgba(236, 230, 214, 0.58);
  font-size: 11px;
  line-height: 1.8;
}

.festival-lock__note {
  position: relative;
  z-index: 1;
  grid-column: 1 / -1;
  margin-top: clamp(24px, 3vw, 38px);
  padding-top: 17px;
  border-top: 1px solid rgba(236, 230, 214, 0.14);
  color: rgba(236, 230, 214, 0.4);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-align: right;
}

.xuanwu-facts {
  margin-top: -1px;
}

.ritual-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: rgba(235, 227, 208, 0.14);
  border-top: 1px solid rgba(235, 227, 208, 0.16);
  border-bottom: 1px solid rgba(235, 227, 208, 0.16);
}

.ritual-card {
  padding: clamp(27px, 4vw, 44px) clamp(21px, 3vw, 35px);
  background: #152923;
}

html[data-theme="night"] .ritual-card {
  background: #151f2d;
}

.ritual-card__num {
  color: #c0a875;
  font-family: var(--font-latin);
  font-size: 12px;
  letter-spacing: 0.12em;
}

.ritual-card h3 {
  margin-top: 34px;
  color: #efe9da;
  font-family: var(--font-serif);
  font-size: 25px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.ritual-card p {
  margin-top: 9px;
  color: rgba(236, 230, 214, 0.62);
  font-size: 12px;
  line-height: 1.95;
}

.xuanwu-calendar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(24px, 4vw, 48px);
  margin-top: 44px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.xuanwu-calendar__item {
  display: flex;
  align-items: baseline;
  gap: 11px;
  color: var(--ink-soft);
  font-size: 12px;
}

.xuanwu-calendar__item strong {
  color: var(--gold);
  font-family: var(--font-latin);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.06em;
}

/* Page-specific: lanterns
   ========================================================================== */
.lantern-types {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(9px, 1.5vw, 18px);
}

.lantern-type {
  display: flex;
  flex-direction: column;
  min-height: 310px;
  padding: clamp(18px, 2.2vw, 27px);
  border: 1px solid var(--line);
  background: var(--paper-raised);
  transition: transform 0.5s var(--ease-out), background 0.35s ease, border-color 0.35s ease;
}

.lantern-type:hover {
  border-color: var(--gold);
  background: var(--celadon-soft);
  transform: translateY(-6px);
}

.lantern-type__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-mute);
  font-family: var(--font-latin);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.lantern-type__glyph {
  display: grid;
  place-items: center;
  width: 56px;
  height: 73px;
  margin: 30px auto 22px;
  border: 1px solid var(--line-strong);
  border-radius: 50% 50% 44% 44%;
  color: var(--gold);
  font-family: var(--font-serif);
  font-size: 26px;
  line-height: 1;
  background:
    radial-gradient(circle at 50% 42%, rgba(216, 183, 123, 0.18), transparent 65%),
    var(--paper);
}

.lantern-type h3 {
  margin-top: auto;
  font-family: var(--font-serif);
  font-size: clamp(17px, 1.6vw, 22px);
  font-weight: 500;
  letter-spacing: 0.07em;
  text-align: center;
}

.lantern-type p {
  margin-top: 7px;
  color: var(--ink-mute);
  font-size: 10px;
  line-height: 1.8;
  text-align: center;
}

.lantern-type .lantern-type__link {
  display: block;
  margin-top: 18px;
  color: var(--ink-soft);
  font-size: 9px;
  letter-spacing: 0.13em;
  text-align: center;
}

.lantern-type:hover .lantern-type__link {
  color: var(--seal);
}

.lantern-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: clamp(28px, 6vw, 90px);
  align-items: center;
}

.lantern-note {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  margin-top: 36px;
  padding-top: 23px;
  border-top: 1px solid var(--line);
}

.lantern-note__mark {
  flex: 0 0 auto;
  color: var(--gold);
  font-family: var(--font-serif);
  font-size: 35px;
  line-height: 1;
}

.lantern-note p {
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-size: 13px;
  line-height: 2;
}

/* Footer
   ========================================================================== */
.site-footer {
  position: relative;
  overflow: hidden;
  /* The extra bottom room keeps the fixed back-to-top button clear of the
     closing copyright line. */
  padding-block: clamp(58px, 8vw, 95px) 60px;
  background: #152520;
  color: #ece6d6;
}

@media (min-width: 721px) {
  .site-footer {
    padding-bottom: 82px;
  }
}

html[data-theme="night"] .site-footer {
  background: #0b121c;
}

.site-footer::before {
  content: "山海";
  position: absolute;
  right: -0.08em;
  bottom: -0.28em;
  color: #ece6d6;
  font-family: var(--font-serif);
  font-size: clamp(190px, 31vw, 430px);
  line-height: 1;
  letter-spacing: -0.1em;
  opacity: 0.035;
  pointer-events: none;
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(40px, 8vw, 130px);
  align-items: end;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}

/* Footer logo: a 39px layout box keeps the original lockup height, while the
   artwork itself renders slightly larger and softly glows in both themes. */
.footer-logo-link {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: clamp(92px, 7vw, 104px);
  height: 39px;
}

.footer-logo {
  position: absolute;
  bottom: 0;
  left: 0;
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.38)) drop-shadow(0 0 30px rgba(255, 255, 255, 0.18));
}

.footer-brand .brand__mark {
  color: #c69a6c;
  border-color: #c69a6c;
}

.footer-brand .brand__cn {
  color: #f0e9d8;
}

.footer-brand .brand__en {
  color: rgba(240, 233, 216, 0.48);
}

.footer-brand p {
  max-width: 290px;
  color: rgba(236, 230, 214, 0.52);
  font-size: 11px;
  line-height: 2;
  letter-spacing: 0.05em;
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 30px;
  justify-self: end;
  width: min(100%, 420px);
}

.footer-nav a {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(236, 230, 214, 0.14);
  color: rgba(236, 230, 214, 0.68);
  font-size: 12px;
  letter-spacing: 0.08em;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.footer-nav a span {
  color: rgba(236, 230, 214, 0.3);
  font-family: var(--font-latin);
  font-size: 9px;
}

.footer-nav a:hover {
  color: #d6bb87;
  border-color: rgba(214, 187, 135, 0.45);
}

.footer-phrase {
  /* The dark footer now opens with this line, so it no longer needs the top
     margin that used to separate it from the brand / link row above. */
  margin-top: 0;
  padding-block: clamp(30px, 5vw, 60px) clamp(22px, 3vw, 34px);
  border-top: 1px solid rgba(236, 230, 214, 0.18);
  border-bottom: 1px solid rgba(236, 230, 214, 0.18);
  color: #eee6d4;
  font-family: var(--font-serif);
  font-size: clamp(36px, 7.2vw, 99px);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.17em;
  text-align: center;
  white-space: nowrap;
}

.footer-phrase em {
  color: #c5a66d;
  font-style: normal;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding-top: 22px;
  color: rgba(236, 230, 214, 0.36);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.footer-bottom .latin {
  font-family: var(--font-latin);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Footer · About this site
   ========================================================================== */
.footer-about {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin-top: clamp(30px, 4vw, 46px);
  padding-top: clamp(20px, 2.6vw, 30px);
}

.footer-about__head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.footer-about__title {
  margin: 0;
  color: #eee6d4;
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: 0.26em;
}

.footer-about__body {
  display: grid;
  gap: 9px;
  max-width: 90ch;
  color: rgba(236, 230, 214, 0.52);
  font-size: 11px;
  line-height: 2.05;
  letter-spacing: 0.05em;
}

.footer-about__body p {
  margin: 0;
}

.footer-about__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 38px;
  margin-top: 7px;
}

.footer-about__meta p {
  white-space: nowrap;
}

/* Filing number: the slot keeps its width even when the number is replaced
   or left empty during later editing. */
.footer-about__icp {
  display: inline-block;
  min-width: 13em;
  color: rgba(236, 230, 214, 0.62);
  letter-spacing: 0.04em;
  vertical-align: top;
}

@media (max-width: 960px) {
  .footer-about__meta {
    gap: 4px 26px;
  }

  .footer-about__meta p {
    white-space: normal;
  }
}

/* Global night ambience
   ========================================================================== */
.night-sky-host {
  position: relative;
  isolation: isolate;
}

/* The books section owns a fixed mobile reading overlay; keep its ancestor
   from becoming an isolated stacking context. */
.books-section.night-sky-host {
  isolation: auto;
}

.night-sky {
  position: absolute;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

html[data-theme="night"] .night-sky {
  opacity: 1;
}

.night-sky-host > .wrap {
  position: relative;
  z-index: 1;
}

.night-sky__star {
  position: absolute;
  width: var(--star-size, 2px);
  height: var(--star-size, 2px);
  border-radius: 50%;
  background: var(--star-color, #ffd98a);
  box-shadow: 0 0 4px rgba(255, 180, 90, 0.25);
  opacity: 0.4;
  animation: night-sky-twinkle var(--star-duration, 6s) var(--star-delay, 0s) ease-in-out infinite;
}

.night-sky__star.is-bright {
  box-shadow: 0 0 7px rgba(255, 180, 90, 0.36), 0 0 14px rgba(255, 180, 90, 0.16);
}

@keyframes night-sky-twinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.85); }
  50% { opacity: 0.82; transform: scale(1); }
  74% { opacity: 0.3; transform: scale(0.92); }
}

.night-sky .firework {
  animation: night-sky-burst var(--burst-cycle, 24s) var(--burst-delay, 0s) ease-in-out infinite;
}

.night-sky .firework::before {
  display: none;
}

.night-sky .firework__spark {
  width: var(--spark-size, 2.2px);
  height: var(--spark-size, 2.2px);
  background: var(--spark-color, #e3c184);
  box-shadow: 0 0 7px var(--spark-glow, rgba(227, 193, 132, 0.3)), 0 0 16px var(--spark-glow, rgba(227, 193, 132, 0.3));
  animation: night-sky-spark var(--burst-cycle, 24s) var(--burst-delay, 0s) ease-out infinite;
}

@keyframes night-sky-spark {
  0%, 80% { opacity: 0; transform: rotate(var(--angle)) translateY(3px) scale(0.45); }
  84% { opacity: var(--spark-opacity, 0.5); transform: rotate(var(--angle)) translateY(calc(var(--distance) * -0.34)) scale(1); }
  90% { opacity: calc(var(--spark-opacity, 0.5) * 0.84); transform: rotate(var(--angle)) translateY(calc(var(--distance) * -0.85)) scale(0.9); }
  94% { opacity: calc(var(--spark-opacity, 0.5) * 0.28); transform: rotate(var(--angle)) translateY(calc(var(--distance) * -1.08)) scale(0.7); }
  100% { opacity: 0; transform: rotate(var(--angle)) translateY(calc(var(--distance) * -1.12)) scale(0.45); }
}

.night-sky .firework::after {
  content: "";
  position: absolute;
  top: -30px;
  left: -30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--burst-glow, rgba(255, 180, 90, 0.25)) 0 9%, transparent 68%);
  pointer-events: none;
}

@keyframes night-sky-burst {
  0%, 81%, 100% { opacity: 0; }
  84%, 94% { opacity: var(--night-burst-opacity, 0.38); }
}

/* Reveal animation
   ========================================================================== */
/* Content blocks enter from alternating sides: the first, third, fifth block
   slides in from the left, the second, fourth, sixth from the right. The
   movement is a single smooth 1.2s ease-out with no spring or overshoot, so
   each block slowly comes into focus, and site.js re-arms it whenever it has
   fully left the viewport so the reveal can replay.
   The individual `translate` property is animated instead of `transform`,
   leaving hover transforms on cards and photographs untouched. */
.js .reveal {
  --reveal-distance: clamp(22px, 2.8vw, 40px);
  opacity: 0;
  translate: calc(var(--reveal-distance) * -1) 0;
}

.js .reveal[data-reveal-dir="right"] {
  translate: var(--reveal-distance) 0;
}

/* The transition lives only on the visible state: entering fades and slides
   in over 1.2s, while leaving the viewport resets instantly off-screen. */
.js .reveal.is-visible {
  opacity: 1;
  translate: none;
  transition:
    opacity 1.2s ease-out,
    translate 1.2s ease-out;
  transition-delay: var(--reveal-delay, 0s);
}

/* Elements may opt into a small stagger of their own. */
.js .reveal [data-stagger] > *,
.js .reveal[data-stagger] > * {
  transition-delay: calc(var(--stagger, 0) * 70ms);
}

/* Responsive
   ========================================================================== */
@media (max-width: 1120px) {
  .desktop-nav {
    gap: 19px;
  }

  .desktop-nav a {
    font-size: 11px;
  }

  .theme-toggle {
    min-width: 37px;
    padding-right: 6px;
  }

  .theme-toggle__label {
    display: none;
  }

  .feature-card__arrow {
    right: 22px;
  }

  .book-object {
    --closed-w: 235px;
    --closed-h: 325px;
    --open-w: min(830px, 92vw);
    --open-h: 520px;
    bottom: 60px;
  }

  .book-shelf {
    height: 600px;
  }

  .registry-row {
    grid-template-columns: 120px 115px minmax(0, 1fr) 55px;
  }
}

@media (max-width: 960px) {
  :root {
    --header-h: 72px;
  }

  .desktop-nav {
    display: none;
  }

  .menu-toggle {
    display: block;
  }

  .header-inner {
    width: calc(100% - 42px);
  }

  .hero__content {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    width: calc(100% - 48px);
  }

  .hero__aside,
  .hero__side-note {
    display: none;
  }

  .hero__title-main {
    font-size: clamp(58px, 12vw, 104px);
  }

  .hero__seal {
    right: 26px;
    top: 31%;
  }

  .hero__caption {
    right: 24px;
    bottom: 18px;
  }

  .page-hero__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .page-hero__aside {
    justify-self: start;
    max-width: 500px;
    padding-bottom: 0;
  }

  .page-hero::before {
    right: -18%;
    width: 50vw;
  }

  .section-head {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .section-head__aside {
    justify-self: start;
    max-width: 560px;
  }

  .intro-grid {
    grid-template-columns: 75px minmax(0, 1fr);
    gap: 32px;
  }

  .intro-aside {
    gap: 20px;
  }

  .intro-details {
    grid-template-columns: minmax(0, 1fr);
    gap: 30px;
  }

  .feature-card--wide,
  .feature-card--small {
    grid-column: span 12;
    min-height: 390px;
  }

  .registry-row {
    grid-template-columns: 100px 1fr 55px;
    gap: 12px 18px;
  }

  .registry-row__items {
    grid-column: 2 / 3;
    grid-row: 2;
  }

  .registry-row__arrow {
    grid-column: 3 / 4;
    grid-row: 1 / 3;
  }

  .registry-row__en {
    display: none;
  }

  .split,
  .split--wide-left,
  .split--wide-right {
    grid-template-columns: minmax(0, 1fr);
    gap: 38px;
  }

  .split--wide-right .split__media {
    order: -1;
  }

  .split--offset > :last-child {
    margin-top: 0;
  }

  .split__copy {
    max-width: 100%;
  }

  .photo-grid--three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fact-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .fact-strip__item {
    min-height: 150px;
    padding: 24px 18px;
  }

  .fact-strip__value {
    font-size: 32px;
  }

  .process-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .process-card:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .process-card:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .book-shelf {
    --book-gap: 0px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    height: 600px;
  }

  .book-object {
    --closed-w: 200px;
    --closed-h: 280px;
    --open-w: min(780px, 93vw);
    --open-h: 540px;
    bottom: 40px;
  }

  .book-page {
    padding: 22px;
  }

  .book-page--left {
    padding-right: 33px;
  }

  .book-page--right {
    padding-left: 25px;
  }

  .book-page__vertical {
    font-size: 38px;
  }

  .book-page__title {
    left: 31px;
    bottom: 100px;
    font-size: 19px;
  }

  .book-page__desc {
    left: 31px;
    bottom: 68px;
    font-size: 10px;
  }

  .book-page__count {
    left: 31px;
  }

  .book-page__head {
    font-size: 8px;
  }

  .book-card__thumb {
    aspect-ratio: 1.35;
  }

  .book-card__body {
    padding-top: 5px;
  }

  .book-card__name {
    font-size: 10px;
  }

  .heritage-index__category {
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 28px;
  }

  .heritage-index__cn {
    font-size: 34px;
  }

  .lantern-types {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .lantern-type {
    min-height: 280px;
  }

  .lantern-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 38px;
  }

  .footer-top {
    grid-template-columns: minmax(0, 1fr);
    gap: 42px;
  }

  .footer-nav {
    justify-self: start;
  }

  .footer-phrase {
    letter-spacing: 0.1em;
  }
}

@media (max-width: 720px) {
  .wrap,
  .wrap--narrow,
  .hero__content,
  .media-hero__content,
  .page-back__inner {
    width: calc(100% - 38px);
  }

  .section {
    padding-block: 70px;
  }

  .hero {
    min-height: 680px;
  }

  .hero__layer {
    background-position: center 46%;
  }

  .hero__scrim {
    background:
      linear-gradient(180deg, rgba(12, 28, 25, 0.12) 0%, transparent 23%, transparent 42%, var(--hero-fade) 95%),
      linear-gradient(90deg, var(--hero-left), transparent 92%);
  }

  .hero__content {
    bottom: 66px;
  }

  .hero__eyebrow {
    margin-bottom: 15px;
  }

  .hero__title-kicker {
    font-size: 16px;
    letter-spacing: 0.27em;
  }

  .hero__title-main {
    font-size: clamp(49px, 14vw, 72px);
    letter-spacing: 0.03em;
  }

  .hero__sub {
    margin-top: 14px;
    font-size: 13px;
    line-height: 1.95;
  }

  .hero__actions {
    gap: 13px;
    margin-top: 24px;
  }

  .hero__actions .btn {
    min-height: 43px;
    padding: 10px 17px;
    font-size: 10px;
  }

  .hero__seal {
    top: 25%;
    right: 19px;
    width: 45px;
    height: 45px;
    font-size: 12px;
  }

  .hero__caption {
    display: none;
  }

  .hero__lion {
    bottom: 8%;
    width: 110vw;
    height: 46%;
    opacity: 0;
  }

  .theme-toggle {
    min-width: 37px;
    height: 34px;
    padding: 0 5px;
  }

  .theme-toggle__disc {
    width: 23px;
    height: 23px;
  }

  .header-tools {
    gap: 8px;
  }

  .brand__en {
    display: none;
  }

  .brand__mark {
    width: 34px;
    height: 34px;
    font-size: 18px;
  }

  .brand__cn {
    font-size: 17px;
  }

  .page-hero {
    padding-top: calc(var(--header-h) + 54px);
    padding-bottom: 52px;
  }

  .page-hero__grid {
    margin-top: 37px;
  }

  .page-hero__title {
    font-size: clamp(38px, 10.7vw, 56px);
  }

  .page-hero__aside p {
    font-size: 13px;
  }

  .page-hero__stats {
    gap: 20px 30px;
  }

  .page-hero__stat strong {
    font-size: 23px;
  }

  .page-hero::before {
    top: 27%;
    right: -27%;
    width: 78vw;
  }

  .page-hero::after {
    right: 10px;
    font-size: 155px;
  }

  .media-hero {
    min-height: 78svh;
  }

  .media-hero__content {
    padding-block: 44px 42px;
  }

  .media-hero__title {
    font-size: clamp(43px, 12.5vw, 66px);
  }

  .media-hero__deck {
    font-size: 13px;
  }

  .media-hero__scroll {
    display: none;
  }

  .intro-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .intro-aside {
    flex-direction: row;
    align-items: center;
    gap: 17px;
    padding-top: 0;
    padding-bottom: 17px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .intro-vertical {
    font-size: 10px;
    writing-mode: horizontal-tb;
  }

  .intro-aside .seal-stamp {
    width: 36px;
    height: 36px;
    margin-top: 0;
    margin-left: auto;
    margin-bottom: 0;
    font-size: 12px;
  }

  .intro-aside .seal-space {
    width: 36px;
    height: 36px;
    margin-top: 0;
    margin-left: auto;
    margin-bottom: 0;
  }

  .display {
    font-size: clamp(31px, 9vw, 43px);
  }

  .intro-body .display {
    margin-top: 18px;
  }

  .intro-body > .lede {
    font-size: 17px;
  }

  .feature-grid {
    display: flex;
    flex-direction: column;
  }

  .feature-card {
    min-height: 380px;
  }

  .feature-card__body {
    padding: 22px;
  }

  .feature-card__desc {
    max-width: 80%;
    font-size: 11px;
  }

  .mini-books {
    right: 2%;
    bottom: 26%;
    width: 58%;
    height: 40%;
  }

  .registry-head {
    margin-bottom: 27px;
  }

  .registry-row {
    grid-template-columns: 1fr 44px;
    gap: 7px 12px;
    min-height: 0;
    padding: 20px 2px;
  }

  .registry-row__cn {
    font-size: 28px;
  }

  .registry-row__items {
    grid-column: 1 / 2;
    grid-row: 2;
    gap: 4px 12px;
    font-size: 11px;
  }

  .registry-row__arrow {
    grid-column: 2 / 3;
    grid-row: 1 / 3;
    width: 31px;
    height: 31px;
  }

  .photo-grid,
  .photo-grid--asymmetric,
  .photo-grid--three {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .photo-grid--asymmetric > :last-child {
    margin-top: 0;
  }

  .fact-strip {
    grid-template-columns: minmax(0, 1fr);
  }

  .fact-strip__item {
    min-height: 0;
    padding: 22px 18px;
  }

  .fact-strip__item + .fact-strip__item {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .fact-strip__value {
    font-size: 37px;
  }

  .timeline__item {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 18px;
  }

  .timeline__year {
    font-size: 18px;
  }

  .process-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .process-card {
    min-height: 170px;
  }

  .process-card + .process-card {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .process-card h3 {
    margin-top: 19px;
  }

  .story-item {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 14px;
  }

  .story-item__tag {
    grid-column: 2 / 3;
    justify-self: start;
    text-align: left;
  }

  .quote-block {
    padding-left: 22px;
  }

  .quote-block p {
    font-size: 23px;
  }

  .next-page {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .next-page__link {
    font-size: 24px;
  }

  .ink-band .split {
    gap: 35px;
  }

  .book-shelf {
    display: flex;
    height: auto;
    min-height: 390px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding-bottom: 32px;
    margin-inline: -19px;
    padding-inline: 19px;
  }

  .book-backdrop {
    position: fixed;
    z-index: 84;
    inset: 0;
    display: block;
    background: rgba(8, 18, 18, 0.48);
    -webkit-backdrop-filter: blur(7px);
    backdrop-filter: blur(7px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s ease, visibility 0s linear 0.35s;
  }

  body.book-reading {
    overflow: hidden;
  }

  .book-shelf.has-open {
    z-index: 86;
  }

  body.book-reading .book-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.35s ease, visibility 0s linear 0s;
  }

  body.book-reading .site-header,
  body.book-reading .mobile-menu {
    z-index: 90;
  }

  .book-shelf::-webkit-scrollbar {
    display: none;
  }

  .book-unit {
    flex: 0 0 78vw;
    height: 390px;
    scroll-snap-align: center;
  }

  .book-object {
    --closed-w: 196px;
    --closed-h: 276px;
    --open-w: 94vw;
    --open-h: 480px;
    bottom: 61px;
  }

  .book-unit.is-open .book-object {
    position: fixed;
    top: calc(var(--header-h) + 12px);
    bottom: auto;
    left: 50%;
    z-index: 85;
    width: var(--open-w);
    height: calc(100svh - var(--header-h) - 24px);
    transform: translateX(-50%);
  }

  .book-unit:first-child.is-open .book-object,
  .book-unit:nth-child(3).is-open .book-object {
    left: 50%;
  }

  .book-spread {
    grid-template-columns: minmax(0, 1fr);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .book-spread::after {
    display: none;
  }

  .book-page--left {
    min-height: 166px;
    padding: 21px;
    box-shadow: inset 0 -22px 32px -34px rgba(56, 42, 24, 0.55);
  }

  .book-page--right {
    min-height: 300px;
    padding: 20px;
    box-shadow: inset 0 22px 32px -34px rgba(56, 42, 24, 0.55);
  }

  .book-page--left::before,
  .book-page--right::before {
    inset: 10px;
  }

  .book-page__head {
    font-size: 8px;
  }

  .book-page__vertical {
    position: absolute;
    top: 48px;
    left: 27px;
    margin-top: 0;
    font-size: 37px;
  }

  .book-page__category-en {
    top: 50px;
    right: 26px;
    font-size: 9px;
  }

  .book-page__title {
    top: 54px;
    right: 51px;
    bottom: auto;
    left: 105px;
    font-size: 17px;
  }

  .book-page__desc {
    display: none;
  }

  .book-page__seal {
    right: 27px;
    bottom: 20px;
    width: 28px;
    height: 28px;
    font-size: 8px;
  }

  .book-page__count {
    bottom: 22px;
    left: 24px;
    font-size: 9px;
  }

  .book-page__caption {
    display: none;
  }

  .book-cards {
    margin-top: 13px;
    gap: 8px;
  }

  .book-card__thumb {
    aspect-ratio: 1.55;
  }

  .book-card__name {
    font-size: 10px;
  }

  .book-shelf.has-open .book-unit:not(.is-open) {
    opacity: 0;
    pointer-events: none;
  }

  .book-unit__caption {
    bottom: 26px;
  }

  .book-shelf__note {
    margin-top: 0;
    font-size: 9px;
  }

  .heritage-index__category {
    grid-template-columns: minmax(0, 1fr);
    gap: 19px;
  }

  .heritage-index__desc {
    max-width: 100%;
  }

  .heritage-index__items {
    grid-template-columns: minmax(0, 1fr);
  }

  .heritage-hero__stamp {
    display: none;
  }

  .detail-page {
    padding-top: calc(var(--header-h) + 26px);
  }

  .detail-head {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    margin-top: 32px;
  }

  .detail-title {
    font-size: clamp(43px, 13vw, 65px);
  }

  .detail-head__aside {
    justify-self: start;
    padding: 0;
    text-align: left;
  }

  .detail-head__aside .seal-stamp {
    margin-left: 0;
  }

  .detail-carousel {
    margin-top: 28px;
  }

  .carousel__stage {
    aspect-ratio: 5 / 4.2;
    min-height: 0;
  }

  .carousel__slide-inner {
    padding: 22px 22px 82px;
  }

  .carousel__slide-title {
    font-size: 24px;
  }

  .carousel__slide-note {
    font-size: 10px;
  }

  .carousel__placeholder {
    top: 19px;
    right: 20px;
  }

  .carousel__arrow {
    top: auto;
    bottom: 19px;
    width: 37px;
    height: 37px;
    transform: none;
  }

  .carousel__arrow--prev {
    left: 18px;
  }

  .carousel__arrow--next {
    left: 62px;
    right: auto;
  }

  .carousel__foot {
    right: 18px;
    bottom: 30px;
  }

  .carousel__hint {
    font-size: 8px;
  }

  .detail-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 45px;
    margin-top: 43px;
  }

  .detail-copy > p {
    font-size: 15px;
  }

  .writing-space {
    padding: 22px;
  }

  .writing-space__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }

  .detail-section {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding-block: 20px;
  }

  .detail-section h3 {
    font-size: 14px;
  }

  .detail-section p {
    font-size: 14px;
    line-height: 2.05;
  }

  .detail-meta {
    max-width: 100%;
  }

  .detail-switcher {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .detail-swipe-hint {
    margin-top: 38px;
  }

  .process-card__glyph {
    font-size: 31px;
  }

  .lantern-types {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lantern-type {
    min-height: 260px;
    padding: 17px;
  }

  .lantern-type__glyph {
    margin: 24px auto 18px;
  }

  .lantern-type h3 {
    font-size: 18px;
  }

  .festival-lock {
    padding-top: 46px;
    padding-bottom: 46px;
  }

  .festival-lock__card {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    padding: 24px;
  }

  .festival-lock__card::after {
    left: 24px;
  }

  .festival-lock__title {
    font-size: 34px;
  }

  .festival-lock__intro {
    max-width: 100%;
  }

  .festival-lock__facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .festival-fact {
    padding: 17px 0;
    border-top: 1px solid rgba(236, 230, 214, 0.16);
    border-left: 0;
  }

  .festival-fact:first-child {
    padding-top: 0;
    border-top: 0;
  }

  .festival-lock__note {
    text-align: left;
    line-height: 1.9;
  }

  .xuanwu-calendar {
    gap: 16px 26px;
  }

  .footer-phrase {
    font-size: clamp(30px, 8.6vw, 52px);
    letter-spacing: 0.07em;
    white-space: normal;
  }

  .footer-nav {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }

  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-brand {
    gap: 16px;
  }

  .footer-logo-link {
    height: 34px;
  }

  .site-footer {
    padding-top: 48px;
  }
}

@media (max-width: 430px) {
  .wrap,
  .wrap--narrow,
  .hero__content,
  .media-hero__content,
  .page-back__inner {
    width: calc(100% - 32px);
  }

  .hero__eyebrow {
    gap: 9px 14px;
    font-size: 9px;
  }

  .hero__coordinates {
    font-size: 9px;
  }

  .hero__title-main {
    font-size: 47px;
  }

  .hero__actions .btn--ghost {
    display: none;
  }

  .lantern-types {
    grid-template-columns: minmax(0, 1fr);
  }

  .lantern-type {
    min-height: 235px;
  }

  .book-unit {
    flex-basis: 84vw;
  }

  .book-object {
    --open-w: 96vw;
  }

  .detail-title {
    font-size: 40px;
  }

  .carousel__stage {
    aspect-ratio: 4 / 4.2;
  }
}

/* Night palette: deep sea blue, cool light, no green cast
   ========================================================================== */
html[data-theme="night"] .section--ink,
html[data-theme="night"] .ink-band {
  background: #0b121c;
  color: var(--ink);
}

html[data-theme="night"] .ink-band .eyebrow,
html[data-theme="night"] .ink-band .lede,
html[data-theme="night"] .ink-band .prose {
  color: var(--ink-mute);
}

html[data-theme="night"] .ink-band .text-link {
  color: var(--ink);
}

html[data-theme="night"] .ink-band .text-link::after {
  background: rgba(255, 255, 255, 0.22);
}

html[data-theme="night"] .tag {
  color: var(--ink);
}

html[data-theme="night"] .ink-band .tag {
  background: rgba(220, 233, 226, 0.1);
  color: var(--ink);
}

html[data-theme="night"] .ink-band .btn--ghost {
  border-color: rgba(255, 255, 255, 0.24);
  color: var(--ink);
}

html[data-theme="night"] .media-hero {
  background: #0f1620;
  color: var(--ink);
}

html[data-theme="night"] .media-hero__scrim {
  background:
    linear-gradient(180deg, rgba(8, 13, 22, 0.3) 0%, transparent 23%, transparent 40%, rgba(9, 14, 22, 0.94) 100%),
    linear-gradient(90deg, rgba(9, 14, 22, 0.5), transparent 62%);
}

html[data-theme="night"] .media-hero__eyebrow,
html[data-theme="night"] .media-hero__foot,
html[data-theme="night"] .media-hero__scroll {
  color: var(--ink-mute);
}

html[data-theme="night"] .media-hero__title {
  color: var(--ink);
}

html[data-theme="night"] .media-hero__deck {
  color: var(--ink-soft);
}

html[data-theme="night"] .media-hero__eyebrow .tag {
  background: rgba(220, 233, 226, 0.12);
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.16);
}

html[data-theme="night"] .site-header--overlay:not(.is-scrolled) {
  background: linear-gradient(180deg, rgba(8, 13, 22, 0.55), transparent);
  color: var(--ink);
}

html[data-theme="night"] .site-header--overlay:not(.is-scrolled) .brand__cn {
  color: var(--ink);
}

html[data-theme="night"] .site-header--overlay:not(.is-scrolled) .brand__en,
html[data-theme="night"] .site-header--overlay:not(.is-scrolled) .theme-toggle__label {
  color: var(--ink-mute);
}

html[data-theme="night"] .site-header--overlay:not(.is-scrolled) .desktop-nav a {
  color: var(--ink-mute);
}

html[data-theme="night"] .site-header--overlay:not(.is-scrolled) .desktop-nav a:hover,
html[data-theme="night"] .site-header--overlay:not(.is-scrolled) .desktop-nav a[aria-current="page"] {
  color: var(--ink);
}

html[data-theme="night"] .hero__scrim {
  background:
    radial-gradient(68% 52% at 50% 43%, transparent 37%, rgba(8, 12, 20, 0.18) 100%),
    linear-gradient(180deg, rgba(10, 16, 26, 0.18) 0%, transparent 24%, transparent 51%, var(--hero-fade) 100%),
    linear-gradient(90deg, var(--hero-left) 0%, transparent 55%);
}

html[data-theme="night"] .hero__aside {
  background: linear-gradient(145deg, rgba(15, 25, 40, 0.68), rgba(15, 25, 40, 0.26));
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.28);
}

html[data-theme="night"] .hero__mist {
  background:
    radial-gradient(ellipse at 22% 72%, rgba(198, 218, 242, 0.14), transparent 43%),
    radial-gradient(ellipse at 76% 68%, rgba(220, 233, 250, 0.09), transparent 46%),
    radial-gradient(ellipse at 56% 90%, rgba(210, 226, 245, 0.1), transparent 40%);
}

html[data-theme="night"] .hero__stars span {
  background: var(--star-color, #ffd98a);
  box-shadow: 0 0 4px rgba(255, 180, 90, 0.25);
}

html[data-theme="night"] .hero__stars span.is-bright {
  box-shadow: 0 0 7px rgba(255, 180, 90, 0.36), 0 0 14px rgba(255, 180, 90, 0.16);
}

html[data-theme="night"] .firework__spark {
  background: var(--spark-color, #e3c184);
  box-shadow: 0 0 7px var(--spark-glow, rgba(227, 193, 132, 0.3)), 0 0 16px var(--spark-glow, rgba(227, 193, 132, 0.3));
}

html[data-theme="night"] .firework::before {
  background: radial-gradient(circle, var(--burst-glow, rgba(255, 180, 90, 0.25)), transparent 66%);
}

html[data-theme="night"] .page-back__button {
  color: var(--ink);
  filter: drop-shadow(0 1px 8px rgba(0, 0, 0, 0.55));
}

html[data-theme="night"] .page-back__button:hover {
  color: var(--ink-soft);
}

html[data-theme="night"] .feature-card:not(.feature-card--paper) {
  color: var(--ink);
}

html[data-theme="night"] .feature-card:not(.feature-card--paper) .feature-card__shade {
  background:
    linear-gradient(180deg, rgba(9, 14, 22, 0.08) 0%, transparent 38%, rgba(9, 14, 22, 0.9) 100%),
    linear-gradient(90deg, rgba(9, 14, 22, 0.36), transparent 65%);
}

html[data-theme="night"] .feature-card:not(.feature-card--paper) .feature-card__desc {
  color: var(--ink-soft);
}

html[data-theme="night"] .feature-card:not(.feature-card--paper) .feature-card__num {
  color: var(--ink-mute);
}

html[data-theme="night"] .feature-card:not(.feature-card--paper) .feature-card__arrow {
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="night"] .feature-card__body .tag {
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.16);
}

html[data-theme="night"] .hero__eyebrow .tag {
  background: rgba(220, 233, 226, 0.14);
  color: var(--hero-ink);
}

html[data-theme="night"] .book-unit::before {
  background: radial-gradient(ellipse, rgba(190, 215, 245, 0.14), transparent 68%);
}

html[data-theme="night"] .book-cover {
  box-shadow:
    0 24px 44px rgba(0, 0, 0, 0.4),
    0 0 42px rgba(190, 215, 245, 0.1),
    inset 7px 0 12px -9px rgba(230, 240, 255, 0.3),
    inset -4px 0 8px -7px rgba(0, 0, 0, 0.55);
}

html[data-theme="night"] .book-cover::before {
  background:
    linear-gradient(90deg, rgba(230, 240, 255, 0.07) 0%, transparent 12%, transparent 82%, rgba(2, 6, 12, 0.45) 100%),
    linear-gradient(168deg, rgba(215, 230, 250, 0.1), transparent 36%, rgba(3, 8, 16, 0.4) 100%);
}

html[data-theme="night"] .book-unit--xingyi {
  --ribbon: #5e6b7a;
  --thumb-a: #2a3645;
  --thumb-b: #1b2634;
}

html[data-theme="night"] .carousel__slide--huadeng,
html[data-theme="night"] .carousel__slide--xingyi,
html[data-theme="night"] .carousel__slide--yuewu {
  --slide-a: #1a2534;
  --slide-b: #151f2d;
}

html[data-theme="night"] .carousel__slide-inner {
  color: var(--ink);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.36);
}

html[data-theme="night"] .carousel__slide-meta,
html[data-theme="night"] .carousel__placeholder,
html[data-theme="night"] .carousel__foot {
  color: var(--ink-soft);
}

html[data-theme="night"] .carousel__slide-meta::before {
  background: rgba(255, 255, 255, 0.22);
}

html[data-theme="night"] .carousel__slide-note {
  color: var(--ink-soft);
}

html[data-theme="night"] .carousel__arrow {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
}

html[data-theme="night"] .festival-lock__card {
  background: #151f2d;
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--ink);
}

html[data-theme="night"] .festival-lock__card::before {
  color: var(--ink);
}

html[data-theme="night"] .festival-lock__identity .eyebrow,
html[data-theme="night"] .festival-fact__label,
html[data-theme="night"] .festival-lock__note {
  color: var(--ink-mute);
}

html[data-theme="night"] .festival-lock__title,
html[data-theme="night"] .festival-fact h3 {
  color: var(--ink);
}

html[data-theme="night"] .festival-lock__intro,
html[data-theme="night"] .festival-fact p {
  color: var(--ink-soft);
}

html[data-theme="night"] .festival-fact {
  border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="night"] .festival-lock__note {
  border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="night"] .ritual-grid {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="night"] .ritual-card {
  background: #151f2d;
}

html[data-theme="night"] .ritual-card h3 {
  color: var(--ink);
}

html[data-theme="night"] .ritual-card p {
  color: var(--ink-soft);
}

html[data-theme="night"] .site-footer {
  background: #0b121c;
  color: var(--ink);
}

html[data-theme="night"] .site-footer::before {
  color: var(--ink);
}

html[data-theme="night"] .footer-brand .brand__cn,
html[data-theme="night"] .footer-phrase {
  color: var(--ink);
}

html[data-theme="night"] .footer-brand .brand__en,
html[data-theme="night"] .footer-brand p,
html[data-theme="night"] .footer-nav a span,
html[data-theme="night"] .footer-bottom {
  color: var(--ink-mute);
}

html[data-theme="night"] .footer-nav a {
  color: var(--ink-soft);
  border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="night"] .footer-phrase {
  border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="night"] .footer-about__title {
  color: var(--ink);
}

html[data-theme="night"] .footer-about__body {
  color: var(--ink-mute);
}

html[data-theme="night"] .footer-about__icp {
  color: var(--ink-soft);
}

html[data-theme="night"] .photo-frame__corner,
html[data-theme="night"] .photo-frame__no {
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.72);
}

html[data-theme="night"] .photo-frame--filled::after {
  background:
    linear-gradient(180deg, rgba(8, 13, 22, 0.55), rgba(8, 13, 22, 0) 23%, rgba(8, 13, 22, 0) 74%, rgba(8, 13, 22, 0.5)),
    url("../images/grain.svg");
}

html[data-theme="night"] .carousel__slide.has-image::after {
  background:
    linear-gradient(180deg, rgba(8, 13, 22, 0.06) 18%, rgba(8, 13, 22, 0.74) 100%),
    url("../images/grain.svg");
}

html[data-theme="night"] .carousel__slide.has-image .carousel__slide-inner {
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
}

html[data-theme="night"] .carousel__slide::before {
  color: rgba(205, 220, 240, 0.08);
}

html[data-theme="night"] .book-card__thumb::before {
  color: rgba(205, 220, 240, 0.14);
}

html[data-theme="night"] .night-sky__star {
  background: var(--star-color, #ffd98a);
  box-shadow: 0 0 4px rgba(255, 180, 90, 0.25);
}

html[data-theme="night"] .night-sky__star.is-bright {
  box-shadow: 0 0 7px rgba(255, 180, 90, 0.36), 0 0 14px rgba(255, 180, 90, 0.16);
}

html[data-theme="night"] .night-sky .firework__spark {
  box-shadow: 0 0 7px var(--spark-glow, rgba(227, 193, 132, 0.3)), 0 0 16px var(--spark-glow, rgba(227, 193, 132, 0.3));
}

html[data-theme="night"] .night-sky .firework::after {
  background: radial-gradient(circle, var(--burst-glow, rgba(255, 180, 90, 0.25)) 0 9%, transparent 68%);
}

/* Home — stacked feature module
   ========================================================================== */
.stack-feature {
  --stack-accent: #9e493d;
  --stack-edge: rgba(255, 255, 255, 0.78);
  --stack-shadow: 0 22px 48px rgba(48, 39, 24, 0.16);
  display: grid;
  grid-template-columns: minmax(0, 0.84fr) minmax(0, 1.16fr);
  align-items: center;
  gap: clamp(34px, 6vw, 96px);
}

html[data-theme="night"] .stack-feature {
  --stack-accent: #e5c78e;
  --stack-edge: rgba(255, 224, 170, 0.44);
  --stack-shadow: 0 22px 54px rgba(0, 0, 0, 0.48);
}

.stack-copy {
  position: relative;
  padding-left: clamp(0px, 2vw, 26px);
}

.stack-copy::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 1px;
  background: linear-gradient(180deg, var(--gold), var(--line) 56%, transparent);
  opacity: 0.72;
  pointer-events: none;
}

.stack-copy__index {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--gold);
  font-family: var(--font-latin);
  font-size: clamp(15px, 1.5vw, 19px);
  line-height: 1;
  letter-spacing: 0.14em;
}

.stack-copy__total {
  color: var(--ink-mute);
  font-size: 11px;
  letter-spacing: 0.18em;
}

.stack-copy__title {
  margin-top: clamp(18px, 2.4vw, 28px);
  font-family: var(--font-serif);
  font-size: clamp(30px, 3.4vw, 42px);
  font-weight: 500;
  line-height: 1.34;
  letter-spacing: 0.055em;
}

.stack-copy__name {
  position: relative;
  display: inline-block;
  color: var(--ink);
  transform-origin: left center;
  transition: color 0.35s ease, transform 0.45s var(--ease-out);
}

.stack-copy__name::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 2px;
  left: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.45s var(--ease-out);
}

.stack-copy__desc {
  max-width: 390px;
  margin-top: clamp(18px, 2.2vw, 26px);
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-size: clamp(15px, 1.4vw, 17px);
  line-height: 2.05;
  letter-spacing: 0.035em;
}

.stack-copy__more {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: clamp(28px, 3.6vw, 44px);
  padding-bottom: 7px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
}

.stack-copy__more::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: var(--line-strong);
  transition: background 0.35s ease;
}

.stack-copy__more-text {
  display: inline-block;
  transform-origin: left center;
  transition: color 0.35s ease, transform 0.45s var(--ease-out);
}

.stack-copy__arrow {
  width: 17px;
  height: 17px;
  transition: color 0.35s ease, transform 0.45s var(--ease-out);
}

.stack-copy__index,
.stack-copy__title,
.stack-copy__desc,
.stack-copy__more {
  transition: opacity 0.36s ease;
}

.stack-copy.is-changing .stack-copy__index,
.stack-copy.is-changing .stack-copy__title,
.stack-copy.is-changing .stack-copy__desc,
.stack-copy.is-changing .stack-copy__more {
  opacity: 0;
}

.stack-stage {
  position: relative;
  display: flex;
  justify-content: center;
  width: 100%;
  padding: clamp(68px, 5.2vw, 76px) clamp(30px, 4.6vw, 62px) clamp(30px, 4vw, 52px);
}

.stack-hint {
  position: absolute;
  top: clamp(4px, 0.9vw, 10px);
  right: clamp(14px, 2.2vw, 30px);
  z-index: 3;
  max-width: min(78%, 380px);
  color: var(--ink-mute);
  font-family: var(--font-serif);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0.06em;
  text-align: right;
  opacity: 0.9;
  pointer-events: none;
}

html[data-theme="night"] .stack-hint {
  color: rgba(230, 203, 154, 0.88);
}

.stack-hint::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 1px;
  margin-right: 9px;
  background: currentColor;
  opacity: 0.55;
  vertical-align: middle;
}

.stack-stage::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 8% 4%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 50%, rgba(255, 252, 242, 0.86), rgba(255, 252, 242, 0) 68%);
  filter: blur(18px);
  pointer-events: none;
}

html[data-theme="night"] .stack-stage::before {
  background: radial-gradient(ellipse at 50% 50%, rgba(255, 188, 92, 0.1), rgba(255, 188, 92, 0) 70%);
}

.stack-stage__canvas {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 620px;
  aspect-ratio: 4 / 3;
}

.stack-card {
  position: absolute;
  inset: 0;
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: 7px;
  transition: transform 0.8s var(--ease-out);
  will-change: transform;
}

.stack-card[data-depth="0"] {
  --halo-opacity: 0.85;
  --glow-delay: 0s;
  z-index: 5;
  transform: translate3d(0, 0, 0) rotate(0deg);
}

.stack-card[data-depth="1"] {
  --halo-opacity: 0.4;
  --glow-delay: -1.8s;
  z-index: 4;
  transform: translate3d(calc(clamp(14px, 2.1vw, 26px) * -1), clamp(7px, 1vw, 14px), 0) rotate(-4.4deg);
}

.stack-card[data-depth="2"] {
  --halo-opacity: 0.26;
  --glow-delay: -3.6s;
  z-index: 3;
  transform: translate3d(clamp(14px, 2.1vw, 26px), clamp(11px, 1.6vw, 22px), 0) rotate(3.6deg);
}

.stack-card[data-depth="3"] {
  --halo-opacity: 0.18;
  --glow-delay: -5.4s;
  z-index: 2;
  transform: translate3d(0, calc(clamp(12px, 1.8vw, 24px) * -1), 0) rotate(-2.6deg);
}

.stack-card__halo {
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: 10px;
  opacity: 0;
  box-shadow:
    0 0 24px 6px rgba(255, 178, 86, 0.32),
    0 0 46px 14px rgba(255, 150, 50, 0.12);
  pointer-events: none;
  transition: opacity 0.6s ease;
  will-change: opacity;
}

html[data-theme="night"] .stack-card__halo {
  opacity: var(--halo-opacity, 0.3);
  animation: stack-glow-breathe 7s ease-in-out infinite;
  animation-delay: var(--glow-delay, 0s);
}

@keyframes stack-glow-breathe {
  0%,
  100% {
    opacity: calc(var(--halo-opacity, 0.4) * 0.66);
  }

  50% {
    opacity: var(--halo-opacity, 0.4);
  }
}

.stack-card__frame {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  border-radius: inherit;
  background: var(--paper-deep);
  box-shadow:
    0 0 0 1px var(--stack-edge),
    0 0 22px rgba(255, 255, 255, 0.46),
    var(--stack-shadow);
  transform:
    perspective(1200px)
    rotateX(var(--tilt-x, 0deg))
    rotateY(var(--tilt-y, 0deg))
    translate3d(0, var(--lift, 0px), 0);
  transform-style: preserve-3d;
  transition: transform 0.6s var(--ease-out), box-shadow 0.6s ease;
  will-change: transform;
}

.stack-card__frame.is-tilting {
  transition: transform 0.14s var(--ease-out), box-shadow 0.6s ease;
}

.stack-card__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
  pointer-events: none;
}

html[data-theme="night"] .stack-card__frame {
  box-shadow:
    0 0 0 1px rgba(255, 223, 168, 0.44),
    0 18px 40px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(255, 188, 96, 0.18);
}

html[data-theme="night"] .stack-card[data-depth="0"] .stack-card__frame {
  box-shadow:
    0 0 0 1px rgba(255, 228, 177, 0.6),
    0 20px 46px rgba(0, 0, 0, 0.52),
    0 0 30px rgba(255, 188, 96, 0.28);
}

html[data-theme="night"] .stack-card__frame::after {
  box-shadow: inset 0 0 0 1px rgba(255, 223, 168, 0.2);
}

.stack-card__img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  filter: brightness(1) saturate(0.98);
  transform: scale(1.001);
  transition: transform 1.1s var(--ease-out), filter 0.65s ease;
}

.stack-card[data-depth="1"] .stack-card__img {
  filter: brightness(0.95) saturate(0.94);
}

.stack-card[data-depth="2"] .stack-card__img {
  filter: brightness(0.9) saturate(0.9);
}

.stack-card[data-depth="3"] .stack-card__img {
  filter: brightness(0.86) saturate(0.86);
}

html[data-theme="night"] .stack-card__img {
  filter: brightness(0.9) saturate(0.9) contrast(1.03);
}

html[data-theme="night"] .stack-card[data-depth="1"] .stack-card__img {
  filter: brightness(0.8) saturate(0.86) contrast(1.03);
}

html[data-theme="night"] .stack-card[data-depth="2"] .stack-card__img {
  filter: brightness(0.72) saturate(0.82) contrast(1.03);
}

html[data-theme="night"] .stack-card[data-depth="3"] .stack-card__img {
  filter: brightness(0.64) saturate(0.78) contrast(1.03);
}

.stack-card__shade {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(18, 24, 20, 0.1), transparent 30%, transparent 72%, rgba(18, 24, 20, 0.18));
  pointer-events: none;
}

html[data-theme="night"] .stack-card__shade {
  background: linear-gradient(180deg, rgba(6, 10, 18, 0.16), transparent 30%, transparent 70%, rgba(6, 10, 18, 0.32));
}

.stack-card__sheen {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at var(--sheen-x, 50%) var(--sheen-y, 50%), rgba(255, 250, 235, 0.38), rgba(255, 250, 235, 0) 58%);
  opacity: var(--sheen-opacity, 0);
  mix-blend-mode: screen;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

html[data-theme="night"] .stack-card__sheen {
  background: radial-gradient(circle at var(--sheen-x, 50%) var(--sheen-y, 50%), rgba(255, 225, 170, 0.3), rgba(255, 225, 170, 0) 58%);
}

.stack-card__num {
  position: absolute;
  top: 14px;
  left: 16px;
  color: rgba(255, 250, 236, 0.78);
  font-family: var(--font-latin);
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.12em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.stack-card:focus-visible {
  outline: 1px solid var(--stack-accent);
  outline-offset: 8px;
}

@media (hover: hover) and (pointer: fine) {
  .stack-copy__name:hover {
    color: var(--stack-accent);
    transform: scale(1.025);
  }

  .stack-copy__name:hover::after {
    transform: scaleX(1);
  }

  .stack-copy__more:hover .stack-copy__more-text {
    color: var(--stack-accent);
    transform: scale(1.03);
  }

  .stack-copy__more:hover .stack-copy__arrow {
    color: var(--stack-accent);
    transform: translateX(5px);
  }

  .stack-copy__more:hover::after {
    background: var(--stack-accent);
  }

  .stack-card[data-depth="0"]:hover .stack-card__frame {
    --lift: -5px;
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.9),
      0 0 34px rgba(255, 255, 255, 0.6),
      0 30px 60px rgba(48, 39, 24, 0.2);
  }

  html[data-theme="night"] .stack-card[data-depth="0"]:hover .stack-card__frame {
    box-shadow:
      0 0 0 1px rgba(255, 236, 198, 0.78),
      0 24px 54px rgba(0, 0, 0, 0.55),
      0 0 46px rgba(255, 186, 92, 0.4);
  }
}

@media (max-width: 960px) {
  .stack-feature {
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(40px, 8vw, 64px);
  }

  .stack-copy {
    max-width: 560px;
    padding-left: 20px;
  }

  .stack-copy__desc {
    max-width: 460px;
  }

  .stack-stage {
    max-width: 680px;
    margin-inline: auto;
  }
}

@media (max-width: 720px) {
  .stack-copy {
    padding-left: 16px;
  }

  .stack-copy__title {
    font-size: clamp(29px, 8vw, 38px);
  }

  .stack-copy__desc {
    max-width: 100%;
    font-size: 15px;
  }

  .stack-copy__more {
    margin-top: 26px;
  }

  .stack-stage {
    padding: 68px 24px 44px;
  }

  .stack-hint {
    top: 2px;
    right: 24px;
    font-size: 11px;
    letter-spacing: 0.04em;
  }
}

@media (max-width: 430px) {
  .stack-feature {
    gap: 34px;
  }

  .stack-stage {
    padding: 46px 18px 38px;
  }

  .stack-hint {
    right: 18px;
  }
}

/* 扛大旗 · 镖旗列
   ========================================================================== */
/* On the 扛大旗 page the parameter list gives way to the five ceremonial
   flags. The column fixes one shared width only; every height follows the
   flag's own ratio, so poles, tassels, borders and lettering are never
   stretched or cropped. A blurred copy of the flag is painted as its own
   layer underneath, which becomes a soft halo in the flag's own colours at
   night. That layer is decorative and never receives pointer events. */
.detail-body[data-detail-layout="flags"] {
  grid-template-columns: minmax(0, 1.16fr) minmax(300px, 0.74fr);
  gap: clamp(38px, 4.8vw, 76px);
}

.flag-panel {
  width: 100%;
  max-width: 440px;
  margin-inline: auto;
  overflow: visible;
}

.flag-panel[hidden] {
  display: none;
}

.flag-panel__list {
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 2.2vw, 28px);
}

.flag-item {
  --flag-image: none;
  --flag-glow-opacity: 0.5;
  --flag-glow-delay: 0s;
  --flag-reveal-distance: clamp(22px, 2.8vw, 40px);
  position: relative;
  isolation: isolate;
  width: 100%;
  margin: 0;
}

.flag-item--siji-pingan {
  --flag-image: url("../images/kangdaqi-flag-siji-pingan.webp");
  --flag-glow-opacity: 0.56;
  --flag-glow-delay: -0.6s;
}

.flag-item--qiancheng-sijin {
  --flag-image: url("../images/kangdaqi-flag-qiancheng-sijin.webp");
  --flag-glow-opacity: 0.5;
  --flag-glow-delay: -3.1s;
}

.flag-item--shengyi-xinglong {
  --flag-image: url("../images/kangdaqi-flag-shengyi-xinglong.webp");
  --flag-glow-opacity: 0.37;
  --flag-glow-delay: -5.4s;
}

.flag-item--junye-dingxing {
  --flag-image: url("../images/kangdaqi-flag-junye-dingxing.webp");
  --flag-glow-opacity: 0.35;
  --flag-glow-delay: -7.2s;
}

.flag-item--hejing-pingan {
  --flag-image: url("../images/kangdaqi-flag-hejing-pingan.webp");
  --flag-glow-opacity: 0.54;
  --flag-glow-delay: -9.3s;
}

.flag-item__glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  background-image: var(--flag-image);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  border-radius: 4px;
  filter: blur(19px) saturate(1.2);
  opacity: 0;
  transform: scale(1.012);
  transform-origin: 50% 55%;
  transition: opacity 1.4s ease;
  pointer-events: none;
}

.flag-item__img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
}

html[data-theme="night"] .flag-item__glow {
  animation: flag-glow-breathe 11.5s ease-in-out infinite;
  animation-delay: var(--flag-glow-delay);
}

@keyframes flag-glow-breathe {
  0%, 100% {
    opacity: calc(var(--flag-glow-opacity) * 0.74);
    transform: scale(1.008);
  }
  50% {
    opacity: var(--flag-glow-opacity);
    transform: scale(1.032);
  }
}

/* Same entrance as the rest of the site: odd flags from the left, even flags
   from the right, one 1.2s ease-out fade-and-slide with no bounce. Leaving
   the viewport clears the state, so the next pass replays it. */
.js .flag-item {
  opacity: 0;
  translate: calc(var(--flag-reveal-distance) * -1) 0;
}

.js .flag-item[data-flag-dir="right"] {
  translate: var(--flag-reveal-distance) 0;
}

.js .flag-item.is-visible {
  opacity: 1;
  translate: none;
  transition:
    opacity 1.2s ease-out,
    translate 1.2s ease-out;
  transition-delay: var(--flag-delay, 0s);
}

.flag-panel__note {
  margin-top: clamp(26px, 3vw, 34px);
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 2.15;
  letter-spacing: 0.04em;
}

@media (max-width: 960px) {
  .detail-body[data-detail-layout="flags"] {
    grid-template-columns: minmax(0, 1.08fr) minmax(260px, 0.82fr);
    gap: 36px;
  }

  .flag-panel {
    max-width: 360px;
  }

  .flag-panel__list {
    gap: 18px;
  }
}

@media (max-width: 720px) {
  .detail-body[data-detail-layout="flags"] {
    grid-template-columns: minmax(0, 1fr);
    gap: 38px;
  }

  .flag-panel {
    max-width: 520px;
  }

  .flag-panel__list {
    gap: 20px;
  }

  .flag-item__glow {
    filter: blur(13px) saturate(1.12);
  }

  .flag-panel__note {
    margin-top: 24px;
    font-size: 15px;
    line-height: 2.1;
  }
}

@media (max-width: 430px) {
  .flag-panel {
    max-width: 100%;
  }

  .flag-panel__list {
    gap: 16px;
  }
}

/* 双龙戏珠 · 龙珠过渡带
   ========================================================================== */
/* Only 双龙戏珠龙灯 uses this band. It sits between the top photograph and the
   body copy: the green pair enters from the left, the red pair from the right,
   each pearl leading its larger dragon. Every illustration keeps its natural
   ratio, so heads, whiskers, tails and flame edges are never cropped. */
.dragon-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  margin-top: clamp(28px, 3.6vw, 52px);
  margin-bottom: clamp(30px, 4vw, 54px);
  min-height: clamp(200px, 18vw, 250px);
}

.dragon-band[hidden] {
  display: none;
}

/* Each half owns 47.5% of the band; the 5% left between the two halves becomes
   the narrow space between the two pearls, always smaller than a pearl. */
.dragon-duo {
  --dragon-from: -110%;
  --pearl-from: -90%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 47.5%;
  flex: 0 0 47.5%;
  min-width: 0;
}

.dragon-duo--red {
  --dragon-from: 110%;
  --pearl-from: 90%;
}

/* The dragon fills most of its half and stays the main visual; the pearl is a
   small leading element, closer to the size of the dragon's mouth. */
.dragon-duo__dragon {
  display: block;
  width: 82%;
  height: auto;
}

.dragon-duo__pearl {
  display: block;
  width: 15.5%;
  height: auto;
  margin-bottom: clamp(3px, 0.8vw, 10px);
}

.dragon-duo--green .dragon-duo__pearl {
  filter:
    drop-shadow(0 0 10px rgba(58, 190, 156, 0.36))
    drop-shadow(0 0 24px rgba(58, 190, 156, 0.13));
}

.dragon-duo--red .dragon-duo__pearl {
  filter:
    drop-shadow(0 0 10px rgba(238, 74, 54, 0.36))
    drop-shadow(0 0 24px rgba(238, 74, 54, 0.13));
}

.js .dragon-band .dragon-duo__dragon,
.js .dragon-band .dragon-duo__pearl {
  opacity: 0;
}

/* The pearl leaves first; the dragon starts a beat later from farther out, so
   it visibly closes the gap while both settle into formation. */
.js .dragon-band.is-visible .dragon-duo__dragon {
  animation: dragon-chase 1.35s cubic-bezier(0.22, 0.61, 0.36, 1) 0.08s both;
}

.js .dragon-band.is-visible .dragon-duo__pearl {
  animation: dragon-pearl-chase 1.35s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

@keyframes dragon-chase {
  from {
    opacity: 0;
    transform: translate3d(var(--dragon-from), 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes dragon-pearl-chase {
  from {
    opacity: 0;
    transform: translate3d(var(--pearl-from), 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* The band widens the breathing space the page already had between the
   photograph and the copy. */
.detail-body[data-detail-layout="dragon"] {
  margin-top: clamp(24px, 3vw, 40px);
}

/* On this page the parameter list drops to sit beside the opening lines of
   the copy (双龙戏珠龙灯 … 一青一红), without changing its own spacing. */
.detail-body[data-detail-layout="dragon"] .detail-meta {
  margin-top: clamp(96px, 8.8vw, 128px);
}

@media (max-width: 820px) {
  .dragon-band {
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: clamp(18px, 3vw, 28px);
    min-height: 0;
  }

  .dragon-duo {
    width: 100%;
    flex: 0 0 auto;
    gap: 10px;
  }

  .dragon-duo--green {
    justify-content: flex-start;
  }

  .dragon-duo--red {
    justify-content: flex-end;
  }

  .dragon-duo__dragon {
    width: min(76%, 400px);
  }

  .dragon-duo__pearl {
    width: min(17%, 92px);
  }
}

@media (max-width: 720px) {
  .detail-body[data-detail-layout="dragon"] {
    margin-top: 24px;
  }

  .detail-body[data-detail-layout="dragon"] .detail-meta {
    margin-top: 0;
  }
}

/* 七星伴月 · 两侧星月图标
   ========================================================================== */
/* On the 七星伴月 page the parameter list is removed and the reading column is
   centred at very nearly its original width, so the copy shifts inward without
   being re-typeset. The eight small illustrations sit in the two margins. */
.detail-body[data-detail-layout="qixing"] {
  position: relative;
  grid-template-columns: minmax(0, min(826px, 61vw));
  justify-content: center;
  gap: 0;
}

.detail-body[data-detail-layout="qixing"] .detail-aside {
  display: none;
}

.qixing-orbit {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  justify-content: space-between;
  padding-block: clamp(6px, 1.4vw, 20px);
  pointer-events: none;
}

.qixing-orbit[hidden] {
  display: none;
}

.qixing-rail {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: clamp(62px, 7.4vw, 108px);
  min-height: 100%;
}

.qixing-rail--right {
  align-items: flex-end;
}

.qixing-icon {
  --icon-glow: 224, 198, 140;
  /* Halos are a night-only layer; day keeps them fully off. */
  --icon-glow-strength: 0;
  position: relative;
  display: block;
  width: 100%;
  isolation: isolate;
  pointer-events: none;
  user-select: none;
}

.qixing-icon--moon {
  --icon-glow: 148, 210, 190;
}

html[data-theme="night"] .qixing-icon {
  --icon-glow-strength: 0.86;
}

html[data-theme="night"] .qixing-icon.is-visible {
  pointer-events: auto;
  cursor: pointer;
}

.qixing-icon__glow {
  position: absolute;
  inset: 2%;
  z-index: 0;
  opacity: var(--icon-glow-strength);
  transition: opacity 0.55s ease;
  pointer-events: none;
}

.qixing-icon__glow::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at 50% 46%,
    rgba(var(--icon-glow), 0.5) 0%,
    rgba(var(--icon-glow), 0.2) 46%,
    rgba(var(--icon-glow), 0) 72%
  );
  filter: blur(10px);
  transform: scale(1.06);
  animation: qixing-glow-breathe 10s ease-in-out infinite;
  animation-delay: calc(var(--icon-index, 0) * -1.2s);
}

@keyframes qixing-glow-breathe {
  0%, 100% {
    opacity: 0.64;
    transform: scale(1.02);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

.qixing-icon__art {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  transition: filter 0.55s ease, opacity 0.55s ease;
}

/* Night-only click: one icon loses its halo and fades to grey, while the rest
   keep glowing. A second click on the same icon restores it; both directions
   use the same 0.55s transition. */
.qixing-icon.is-off .qixing-icon__glow {
  opacity: 0;
}

.qixing-icon.is-off .qixing-icon__art {
  filter: grayscale(1) saturate(0) brightness(0.72) contrast(0.9);
  opacity: 0.5;
}

/* Entrance: a short fade and lift, one icon after another. */
.js .qixing-icon {
  opacity: 0;
  translate: 0 14px;
}

.js .qixing-icon.is-visible {
  opacity: 1;
  translate: 0 0;
  transition:
    opacity 0.8s ease-out,
    translate 0.8s ease-out;
  transition-delay: calc(var(--icon-index, 0) * 45ms);
}

@media (max-width: 720px) {
  .detail-body[data-detail-layout="qixing"] {
    grid-template-columns: minmax(0, 1fr);
  }

  .qixing-orbit {
    position: static;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(10px, 2.4vw, 16px);
    margin-top: clamp(26px, 5vw, 38px);
    padding-block: 0;
  }

  .qixing-rail {
    display: contents;
  }

  .qixing-icon {
    width: min(100%, 92px);
    margin-inline: auto;
  }
}

/* 五色狮灯 · 右侧图标组对齐
   ========================================================================== */
/* The five lion icons begin beside the red lead-in “五色狮灯” rather than the
   page heading. Only the group's vertical offset changes; its count, order,
   spacing, size, colours and halo behaviour stay exactly as they were. */
.detail-body[data-detail-layout="lion"] .lion-panel {
  margin-top: clamp(72px, 6.6vw, 96px);
}

@media (max-width: 720px) {
  .detail-body[data-detail-layout="lion"] .lion-panel {
    margin-top: 0;
  }
}

/* 五岳朝天 · 鳌鱼绕麒麟
   ========================================================================== */
/* Two aoyu above, the qilin in the centre, three aoyu below (two plus one).
   Each illustration is trimmed only of its transparent margin, so the fish
   heads, tails and fins and the qilin itself stay whole. On this page the
   parameter list is removed and the group starts at the red “五岳朝天” line. */
.detail-body[data-detail-layout="wuyue"] .detail-meta {
  display: none;
}

.detail-body[data-detail-layout="wuyue"] .qilin-panel {
  margin-top: clamp(92px, 8.7vw, 125px);
  margin-bottom: 0;
}

.qilin-panel {
  width: 100%;
  max-width: 340px;
  margin: 0 auto clamp(20px, 2.6vw, 30px);
  padding-top: clamp(2px, 0.8vw, 8px);
  overflow: visible;
}

.qilin-panel[hidden] {
  display: none;
}

.qilin-orbit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(8px, 1.2vw, 14px);
}

.qilin-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 1vw, 12px);
  width: 100%;
}

/* The qilin's core keeps the up-left-facing fish beside its left flank; the
   rest of the orbit rows stay in place. */
.qilin-core {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(8px, 1.2vw, 12px);
  width: 100%;
}

.qilin-core .wuyue-icon--aoyu-3 {
  position: absolute;
  top: 50%;
  left: calc(-17% - 14px);
  translate: 0 -50%;
  margin: 0;
}

.qilin-core .wuyue-icon--aoyu-2 {
  position: absolute;
  top: calc(100% + 12px);
  left: -8%;
  margin: 0;
}

.qilin-row--bottom {
  justify-content: flex-end;
  aspect-ratio: 100 / 33.6;
}

.qilin-row--bottom .wuyue-icon--aoyu-1 {
  margin-right: calc(16.5% - 6px);
}

.wuyue-icon {
  --icon-glow: 146, 202, 172;
  /* Halos are a night-only layer; day keeps them fully off. */
  --icon-glow-strength: 0;
  position: relative;
  display: block;
  flex: 0 0 auto;
  isolation: isolate;
  cursor: default;
  pointer-events: none;
  user-select: none;
}

.wuyue-icon--qilin {
  --icon-glow: 222, 196, 142;
  width: min(67%, 210px);
}

/* Exactly half the qilin's width, and the same width for all five fish. */
.wuyue-icon--aoyu {
  width: min(33.5%, 105px);
}

html[data-theme="night"] .wuyue-icon {
  --icon-glow-strength: 0.82;
  cursor: pointer;
  pointer-events: auto;
}

.wuyue-icon__glow {
  position: absolute;
  inset: 2%;
  z-index: 0;
  opacity: var(--icon-glow-strength);
  transition: opacity 0.7s ease;
  pointer-events: none;
}

.wuyue-icon__glow::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at 50% 50%,
    rgba(var(--icon-glow), 0.45) 0%,
    rgba(var(--icon-glow), 0.17) 46%,
    rgba(var(--icon-glow), 0) 72%
  );
  filter: blur(10px);
  transform: scale(1.04);
  animation: wuyue-glow-breathe 10.5s ease-in-out infinite;
  animation-delay: calc(var(--icon-index, 0) * -1.5s);
}

@keyframes wuyue-glow-breathe {
  0%, 100% {
    opacity: 0.64;
    transform: scale(1.02);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

.wuyue-icon__art {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  transition: filter 0.7s ease, opacity 0.7s ease;
}

/* The upper-right fish tips slightly downward so the top pair keeps a
   clockwise flow around the central qilin. */
.wuyue-icon--aoyu-4 .wuyue-icon__art {
  transform: rotate(8deg);
}

/* Off: a quick dim. On: the base 0.7s transitions restore the colour slowly. */
.wuyue-icon.is-off .wuyue-icon__glow {
  opacity: 0;
  transition-duration: 0.25s;
}

.wuyue-icon.is-off .wuyue-icon__art {
  filter: grayscale(1) saturate(0) brightness(0.7) contrast(0.9);
  opacity: 0.45;
  transition-duration: 0.35s;
}

/* Entrance: the five aoyu float up from just below their resting places and
   fade in; the qilin rises last. */
.js .qilin-panel .wuyue-icon {
  opacity: 0;
}

.js .qilin-panel.is-visible .wuyue-icon--aoyu {
  animation: aoyu-rise 1.3s cubic-bezier(0.22, 0.61, 0.36, 1) both;
  animation-delay: calc(var(--icon-index, 0) * 0.03s);
}

.js .qilin-panel.is-visible .wuyue-icon--qilin {
  animation: qilin-arrive 1.05s cubic-bezier(0.22, 0.61, 0.36, 1) 0.2s both;
}

@keyframes aoyu-rise {
  from {
    opacity: 0;
    transform: translate3d(0, 22px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes qilin-arrive {
  from {
    opacity: 0;
    transform: translate3d(0, 22px, 0) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@media (max-width: 1000px) {
  .qilin-core .wuyue-icon--aoyu-3 {
    position: static;
    left: auto;
    translate: none;
    margin: 0 auto;
  }

  .qilin-core .wuyue-icon--aoyu-2 {
    position: static;
    top: auto;
    left: auto;
    margin: 0 auto;
  }

  .qilin-row--bottom {
    justify-content: center;
    padding-right: 0;
  }

  .qilin-row--bottom .wuyue-icon--aoyu-1 {
    margin-right: 0;
  }
}

@media (max-width: 720px) {
  .detail-body[data-detail-layout="wuyue"] .qilin-panel {
    margin-top: 24px;
    margin-bottom: 32px;
  }

  .qilin-panel {
    max-width: 340px;
    margin-bottom: 24px;
  }
}

/* 九鲤升天 · 鳌鱼领鲤
   ========================================================================== */
/* The parameter list is replaced on this page by one aoyu above nine carp
   lanterns. The group is read as a school leaping upward: every fish tilts
   back toward the vertical, and each one keeps its own height, offset and
   size so the cluster never settles into rows. */
.detail-body[data-detail-layout="jiuli"] .detail-meta {
  display: none;
}

.detail-body[data-detail-layout="jiuli"] .jiuli-panel {
  margin-top: clamp(58px, 5.4vw, 84px);
}

.jiuli-panel {
  width: 100%;
  max-width: 336px;
  margin-inline: auto;
  overflow: visible;
}

.jiuli-panel[hidden] {
  display: none;
}

/* One positioning context for the whole school; the stage keeps its shape at
   every width, so the fish stay in the same constellation when it shrinks. */
.jiuli-orbit {
  position: relative;
  width: 100%;
  aspect-ratio: 100 / 152;
}

/* Each fish is centred on --x / --y (stage percentages), sized by --w and
   turned by --rot. */
.jiuli-icon {
  --x: 50%;
  --y: 50%;
  --w: 25%;
  --rot: 0deg;
  --glow-rgb: 236, 152, 88;
  --glow-day: 0.2;
  --glow-night: 0.64;
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  transform: translate(-50%, -50%) rotate(var(--rot));
  transform-origin: 50% 50%;
  isolation: isolate;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
}

/* Placement: aoyu at the apex, nine carp beneath it, bottom fish lower and
   slighter so the school rises from the lower-left toward the leader. */
.jiuli-icon--aoyu {
  --x: 61%;
  --y: 12%;
  --w: 46%;
  --rot: -6deg;
  --glow-rgb: 126, 198, 166;
  --glow-day: 0.17;
  --glow-night: 0.66;
}

.jiuli-icon--1 {
  --x: 17%;
  --y: 88%;
  --w: 26%;
  --rot: -38deg;
}

.jiuli-icon--2 {
  --x: 44%;
  --y: 70%;
  --w: 25%;
  --rot: -20deg;
}

.jiuli-icon--3 {
  --x: 50%;
  --y: 39%;
  --w: 25%;
  --rot: -48deg;
}

.jiuli-icon--4 {
  --x: 24%;
  --y: 71%;
  --w: 27%;
  --rot: -55deg;
}

.jiuli-icon--5 {
  --x: 35%;
  --y: 55%;
  --w: 24%;
  --rot: -35deg;
}

.jiuli-icon--6 {
  --x: 38%;
  --y: 84%;
  --w: 24%;
  --rot: -30deg;
}

.jiuli-icon--7 {
  --x: 63%;
  --y: 46%;
  --w: 26%;
  --rot: -22deg;
}

.jiuli-icon--8 {
  --x: 76%;
  --y: 33%;
  --w: 27%;
  --rot: -40deg;
}

.jiuli-icon--9 {
  --x: 48%;
  --y: 59%;
  --w: 27%;
  --rot: -50deg;
}

/* Halo: a soft radial bloom that breathes on its own phase. The day version
   is a whisper of warmth on paper; at night the same layer brightens so the
   fish read against the dark background. */
.jiuli-icon__glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 132%;
  height: 132%;
  translate: -50% -50%;
  opacity: var(--glow-day);
  transition: opacity 0.85s ease;
  pointer-events: none;
  z-index: 0;
}

.jiuli-icon__glow::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at 50% 50%,
    rgba(var(--glow-rgb), 0.46) 0%,
    rgba(var(--glow-rgb), 0.18) 44%,
    rgba(var(--glow-rgb), 0) 74%
  );
  filter: blur(10px);
  animation: jiuli-glow-breathe 9.5s ease-in-out infinite;
  animation-delay: calc(var(--icon-index, 0) * -1.4s);
}

html[data-theme="night"] .jiuli-icon__glow {
  opacity: var(--glow-night);
}

@keyframes jiuli-glow-breathe {
  0%, 100% {
    opacity: 0.62;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

.jiuli-icon__body {
  position: relative;
  z-index: 1;
  display: block;
  transform-origin: 50% 55%;
}

.jiuli-icon__art {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 5px 12px rgba(86, 58, 32, 0.16));
  transition: filter 0.6s ease;
}

/* A few carp are painted facing left; flipping them lets the whole school
   swim the same way up the stage. */
.jiuli-icon--flip .jiuli-icon__art {
  transform: scaleX(-1);
}

/* At night the artwork carries its own light: a tight warm rim plus a wider
   spill, so the paper-and-wire lanterns glow instead of merely sitting there.
   The aoyu keeps a cooler jade spill. */
html[data-theme="night"] .jiuli-icon__art {
  filter:
    drop-shadow(0 0 9px rgba(255, 178, 96, 0.5))
    drop-shadow(0 0 26px rgba(255, 126, 56, 0.3));
}

html[data-theme="night"] .jiuli-icon--aoyu .jiuli-icon__art {
  filter:
    drop-shadow(0 0 10px rgba(134, 214, 176, 0.42))
    drop-shadow(0 0 28px rgba(232, 168, 82, 0.28));
}

/* Hover: the fish sways in place, a hair's width, as if the lantern were
   nudged in the parade; its halo warms one step further. */
@media (hover: hover) {
  .jiuli-icon:hover .jiuli-icon__body,
  .jiuli-icon:focus-visible .jiuli-icon__body {
    animation: jiuli-wobble 0.95s ease-in-out infinite;
  }

  .jiuli-icon:hover .jiuli-icon__glow,
  .jiuli-icon:focus-visible .jiuli-icon__glow {
    opacity: calc(var(--glow-day) + 0.08);
  }

  html[data-theme="night"] .jiuli-icon:hover .jiuli-icon__glow,
  html[data-theme="night"] .jiuli-icon:focus-visible .jiuli-icon__glow {
    opacity: calc(var(--glow-night) + 0.08);
  }
}

@keyframes jiuli-wobble {
  0%, 100% {
    transform: rotate(0deg) translateY(0);
  }
  24% {
    transform: rotate(-3.6deg) translateY(-2px);
  }
  58% {
    transform: rotate(3.4deg) translateY(1px);
  }
  80% {
    transform: rotate(-1.6deg) translateY(-1px);
  }
}

/* Entrance: the school drifts up into place, one fish after another, and the
   aoyu leads by a beat. */
.js .jiuli-panel .jiuli-icon {
  opacity: 0;
}

.js .jiuli-panel .jiuli-icon__body {
  translate: 0 14px;
  transition: translate 1.1s cubic-bezier(0.22, 0.61, 0.36, 1);
  transition-delay: calc(var(--icon-index, 0) * 55ms);
}

.js .jiuli-panel.is-visible .jiuli-icon {
  animation: jiuli-appear 1.1s cubic-bezier(0.22, 0.61, 0.36, 1) both;
  animation-delay: calc(var(--icon-index, 0) * 55ms);
}

.js .jiuli-panel.is-visible .jiuli-icon__body {
  translate: 0 0;
}

@keyframes jiuli-appear {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 720px) {
  .detail-body[data-detail-layout="jiuli"] .jiuli-panel {
    margin-top: 0;
  }

  .jiuli-panel {
    max-width: 300px;
    margin-bottom: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .js .reveal,
  .js .reveal[data-reveal-dir="right"],
  .js .reveal.is-visible,
  .js .reveal.is-visible[data-reveal-dir="right"] {
    opacity: 1;
    translate: none;
    transform: none;
    transition: none;
    animation: none;
  }

  .js .home-closing--lanterns .closing-inner .closing-title .display,
  .js .home-closing--lanterns .closing-inner .closing-lantern {
    opacity: 1;
    transition: none;
  }

  .js .home-closing--lanterns .closing-inner .closing-title .display {
    translate: 0 0;
  }

  .js .home-closing--lanterns .closing-inner .closing-lantern {
    translate: 0 -50%;
  }

  .lion-icon__halo::after,
  .lion-icon:hover .lion-icon__art,
  .lion-icon:focus-visible .lion-icon__art {
    animation: none !important;
  }

  .js .flag-item,
  .js .flag-item[data-flag-dir="right"],
  .js .flag-item.is-visible {
    opacity: 1;
    translate: none;
    transition: none;
  }

  .flag-item__glow {
    animation: none !important;
    transition: none;
  }

  html[data-theme="night"] .flag-item__glow {
    opacity: var(--flag-glow-opacity);
  }

  .js .dragon-band .dragon-duo__dragon,
  .js .dragon-band .dragon-duo__pearl {
    opacity: 1;
    transform: none;
    animation: none !important;
  }

  .js .qixing-icon {
    opacity: 1;
    translate: none;
    transition: none;
  }

  .qixing-icon__glow::after {
    animation: none !important;
  }

  .js .qilin-panel .wuyue-icon {
    opacity: 1;
    transform: none;
    animation: none !important;
  }

  .wuyue-icon__glow::after {
    animation: none !important;
  }

  .js .jiuli-panel .jiuli-icon {
    opacity: 1;
    animation: none !important;
  }

  .js .jiuli-panel .jiuli-icon__body {
    translate: none;
    transition: none;
  }

  .jiuli-icon__glow::after,
  .jiuli-icon:hover .jiuli-icon__body,
  .jiuli-icon:focus-visible .jiuli-icon__body {
    animation: none !important;
  }
}

/* 踩高跷 · 右侧人物列
   ========================================================================== */
/* The copy keeps the page's usual left-hand measure; only the right column
   changes: the parameter list gives way to the five character plates. They are
   stacked top to bottom so the whole column is exactly as tall as the copy
   beside it, alternating left / right and closing with a centred one. */
.detail-body[data-detail-layout="gaoqiao"] .detail-aside {
  align-self: stretch;
}

.gaoqiao-panel {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.2vw, 16px);
  height: 100%;
}

.gaoqiao-panel[hidden] {
  display: none;
}

.gaoqiao-figure {
  display: flex;
  align-items: center;
  flex: var(--fig-ratio, 1) 1 0;
  min-height: 0;
  margin: 0;
}

.gaoqiao-figure--left {
  justify-content: flex-start;
}

.gaoqiao-figure--right {
  justify-content: flex-end;
}

.gaoqiao-figure--center {
  justify-content: center;
}

.gaoqiao-figure__img {
  display: block;
  width: auto;
  height: 100%;
  max-width: 100%;
  filter: drop-shadow(0 14px 22px rgba(24, 38, 36, 0.12));
}

/* Narrow screens stack the whole page, so the plates become a short column
   under the copy instead of matching its height. */
@media (max-width: 720px) {
  .gaoqiao-panel {
    height: auto;
    gap: clamp(16px, 3vw, 22px);
  }

  .gaoqiao-figure {
    flex: 0 0 auto;
  }

  .gaoqiao-figure__img {
    height: clamp(200px, 42vw, 250px);
  }
}