/* ===== base.css ===== */
/* Base reset + document typography. Tokens come from tokens.css / theme.css. */

/* P5-10: display type. Headings use Cormorant Garamond for Latin and the
   already-loaded Noto Serif SC for CJK — a real serif pairing with no extra
   network request. A custom 朱雀仿宋 face was referenced earlier but the WOFF2
   was never shipped; the dangling @font-face only produced a 404 on every page,
   so it is removed until a licensed file is actually available. */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: var(--leading-body);
  font-size: 16px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Defensive: no part of the site is meant to scroll sideways. A single
     wide child (a long CJK headline, a 12-column grid) would otherwise create
     a horizontal scrollbar and shift every absolutely-positioned overlay. */
  overflow-x: clip;
}
a { color: inherit; }
img, svg, video { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: .01em; }
::selection { background: var(--gold-soft); color: var(--ink); }

main { display: block; position: relative; z-index: 1; }

/* Every image is cropped to a consistent frame (plan B7.7): 4/3 by default,
   object-fit so nothing is ever stretched, and a reserved box so the layout
   cannot shift when the bitmap arrives. */
.media-frame { position: relative; overflow: hidden; background: var(--gold-soft); }
.media-frame img, .media-frame video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.ratio-4-3 { aspect-ratio: 4 / 3; }
.ratio-3-2 { aspect-ratio: 3 / 2; }
.ratio-16-9 { aspect-ratio: 16 / 9; }
.ratio-21-9 { aspect-ratio: 21 / 9; }
.ratio-3-4 { aspect-ratio: 3 / 4; }
.ratio-1-1 { aspect-ratio: 1 / 1; }
.object-top { object-position: top center; }

/* Dark sections carry the 亮—暗 rhythm (plan B7.4 / B7.12). Text and borders
   flip through local custom properties so component CSS never has to care. */
.section--dark {
  background: var(--surface-dark);
  color: var(--color-on-dark);
  --text: var(--color-on-dark);
  --color-text: var(--color-on-dark);
  --text-muted: var(--color-on-dark-muted);
  --color-text-muted: var(--color-on-dark-muted);
  --line: var(--color-on-dark-line);
  --border: var(--color-on-dark-line);
  --surface: rgba(255, 255, 255, 0.04);
  --color-surface: rgba(255, 255, 255, 0.04);
  --gold: var(--gold-soft);
  --color-gold: var(--gold-soft);
  --gold-strong: var(--gold-soft);
  --ink: #FFFFFF;
  --color-ink: #FFFFFF;
}
.section--dark .kicker, .section--dark .block-eyebrow, .section--dark h2, .section--dark h3 {
  color: var(--color-on-dark);
}
.section--dark .btn-ghost { color: var(--gold-soft); border-color: var(--color-on-dark-line); }
.section--dark .btn-ghost:hover { background: rgba(255,255,255,0.14); color: #fff; }

/* Visually hidden but available to screen readers */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ===== components/layout.css ===== */
/* Layout primitives: the section grid, the vertical rhythm, and section heads. */

/* One section per screen-story beat (plan B7.4). `--tall` blocks get a minimum
   viewport height so the scroll narrative reads like a deck, not a news feed. */
.section {
  padding: var(--section-y) var(--gutter);
  position: relative;
  /* `isolation: isolate` makes each section its own stacking context, so the
     decorative `::before` below (z-index:-1) stays contained: it paints *above*
     this band colour but *below* every in-flow child (the copy, cards, media).
     That is what turns the gold line texture into a true background rather than a
     foreground overlay that crosses the text. */
  isolation: isolate;
  /* Every band wrapper carries its own ground colour. The auto alternation only
     adds `.section-alt` (porcelain) to some sections and leaves the rest with no
     background — i.e. transparent, showing the white page through the rhythm
     padding. A block that paints its own band (hero, brand-story) then ends up
     with white padding wrapped around it, which reads as a stray white gap
     between two coloured bands. Painting the wrapper explicitly removes that. */
  background: var(--bg);
}

/* Quiet champagne-gold line texture as a *background* layer (2026-11-03 fix:
   the old fixed full-screen `.ambient` overlay floated on top of the copy at
   z-index:40 and obscured reading — lines must be background, not foreground).
   Drawn per-section above the band colour but behind all content, so it reads as
   an editorial texture and never crosses the text. */
.section::before,
.page-hero::before {
  content: "";
  position: absolute; inset: 0;
  z-index: -1;
  pointer-events: none;
  /* Per-section random line set is generated in site.js (--ambient-lines). The
     fallback here is a single, very pale accent line so the page still has the
     texture before/without JS. Lines are intentionally sparse and faint — an
     accent, not decoration that competes with the copy. */
  background-image: var(--ambient-lines, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 480' preserveAspectRatio='xMidYMid slice'%3E%3Cpath d='M-40 300 C 160 360 260 200 420 240 S 720 380 900 300 S 1220 160 1500 250' fill='none' stroke='%23E4D3AE' stroke-opacity='0.22' stroke-width='1.3' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E"));
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
/* The hero is its own dark stage with its own signature decor — don't double up. */
.section:has(.block-hero)::before,
.section:has(.block-hero-slider)::before { content: none; }
@media (prefers-reduced-motion: no-preference) {
  .section::before,
  .page-hero::before { animation: ambientLineDrift 44s ease-in-out infinite; }
}
@keyframes ambientLineDrift {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -10px, 0); }
}
/* Two stacked sections each contribute a *half* rhythm, so the gap between
   them is one full --section-y split symmetrically. Before, only the follower's
   top padding collapsed and the leader kept a full bottom padding — which made
   short strip modules (e.g. the stats band) read bottom-heavy: a tall blank
   band under the cards and half that much air above them. The last section of
   a page keeps its full bottom padding, so the footer transition is unchanged. */
.section + .section { padding-top: calc(var(--section-y) * 0.5); }
.section:has(+ .section) { padding-bottom: calc(var(--section-y) * 0.5); }
.section + .section-alt,
.section-alt + .section,
.section--dark + .section,
.section + .section--dark {
  padding-top: calc(var(--section-y) * 0.5);
}
/* Full-bleed bands own their spacing. The half-rhythm rules above are specificity
   0,2,0 (`.section:has(...)`), which beat `.section-full` (0,1,0) — so a
   full-bleed hero silently kept 0.5 * --section-y of padding all along. Once the
   wrapper was painted ink to hide the white strip, that leftover padding
   reappeared as a *dark bar* under the carousel: same 64.8px gap, new colour.
   Declare the flush box with equal specificity, after the rhythm rules, so no
   full-bleed band can inherit padding again. */
.section.section-full { padding: 0; }

/* ── 全局金色活线（背景层，非前景）────────────────────────────────────────────
   2026-11-03 修正：最初把活线做成固定全屏 `.ambient` 浮层（z-index:40）压在文字
   之上，用户指出"线条应作背景、不应漂浮顶层遮挡阅读"。根因：区块背景不透明，单一
   固定层要么被区块盖住（z-index:0 不可见），要么浮在内容之上（遮挡文字）。正确架构
   = 逐区块 `::before`（`position:absolute; inset:0; z-index:-1`）置于每个 section
   自身隔离的层叠上下文（`isolation:isolate`）内：绘制在"区块底色之上、内容之下"，
   即真正的背景纹理，绝不压字。Hero 用 `:has(.block-hero)` 排除（自带签名装饰）。
   线条为内联 SVG data-URI（深金/金/玫瑰三色 0.5/0.4/0.32），44s 极慢漂移，
   prefers-reduced-motion 安全。浮动 `.ambient` 浮层已从 base.html 与 ambient.css 删除。 */

/* The hero is now a cream two-column stage; paint its wrapper cream too so the
   band reads as one continuous ivory surface (no dark strip, no white gap). */
/* Full-bleed hero bands: paint the wrapper deep so no page ground can leak
   around the photography. Use --surface-dark, NOT --ink — inside a
   .section--dark band --ink is remapped to #FFFFFF for text, which would turn
   this into a white strip. */
.section:has(.block-hero-slider),
.section:has(.block-hero) { background: var(--surface-dark); }
/* The brand-signature block paints its own full band (porcelain for the light
   tone, deep ink for the dark tone). When that band sits inside a transparent
   section wrapper, the wrapper's rhythm padding showed the white page — the
   white gap between ROYALTY's beige block and the next beige section. Paint the
   wrapper with the same band so the padding matches the block. Higher specificity
   than `.section`/`.section-alt`, so it wins and keeps the band consistent. */
.section:has(.block-brand-story--light) { background: var(--porcelain); }
.section:has(.block-brand-story:not(.block-brand-story--light)) { background: var(--surface-dark); }
/* `.section--dark` gets its ground from base.css (`--surface-dark`). Do NOT paint
   it with `var(--ink)` here: that same rule remaps `--ink` to #FFFFFF so dark
   bands can use "ink" as *text*, which makes `background: var(--ink)` resolve to
   white — a dark section that renders as a blank white strip. */
/* the warm porcelain beat: white -> #FAFAF8 -> deep ink, then back to white */
.section-alt { background: var(--porcelain); }

/* ── operator-chosen ground (PageEditor → 背景) ───────────────────────────────
   `style.bg` has to be authoritative, otherwise the editor control lies: choosing
   "默认白" only dropped `.section-alt` and left the inferred `:has(...)` ground in
   place, so a brand-signature module stayed porcelain on a white section. Same
   specificity (0,2,0) as those inferred rules but declared last, so the explicit
   choice always wins. Blocks that assumed the inferred ground re-read it from the
   `section_bg` template variable instead of guessing (see brand_story.html). */
.section.section--bg-default { background: var(--bg); }
.section.section--bg-alt { background: var(--porcelain); }
/* the ink band is `--surface-dark`, never `--ink`: see the note above. */
.section.section--bg-dark { background: var(--surface-dark); }
.section-container { max-width: var(--container); margin: 0 auto; width: 100%; }
.section-narrow { max-width: var(--container-narrow); }
.section-full { width: 100%; padding: 0; }
.section-full .block { max-width: 100%; }
.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-7);
  max-width: var(--container);
  margin: 0 auto;
}
.block { margin: 0 auto; max-width: var(--container); }

/* full-viewport beats */
.section--tall { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }
.section--tall-soft { min-height: 80vh; display: flex; flex-direction: column; justify-content: center; }
.section--flush { padding-top: 0; padding-bottom: 0; }

/* Section heads — quiet, left-aligned for every block type (a centred CJK title
   of 10+ characters reads top-heavy; the editorial left edge does not) */
.block-eyebrow {
  font-family: var(--font-display); color: var(--ink); text-align: left;
  font-size: var(--text-display); line-height: var(--leading-snug);
  margin: 0 0 var(--space-5);
}
.block-eyebrow::after {
  content: ""; display: block; width: 56px; height: 3px; margin-top: var(--space-4);
  background: linear-gradient(90deg, var(--gold, var(--brand)), transparent);
}
.block-lead {
  text-align: left; color: var(--text-muted); max-width: 560px;
  margin: 0 0 var(--space-8); font-size: var(--text-lg); line-height: 1.9;
}
.divider {
  width: 56px; height: 2px; background: var(--gold);
  margin: var(--space-4) 0 var(--space-7); border: none;
}
.kicker {
  display: inline-block; font-family: var(--font-body);
  font-size: var(--text-xs); font-weight: 600;
  letter-spacing: .26em; text-transform: uppercase;
  color: var(--gold-strong); margin: 0 0 var(--space-4);
}

/* Reading measure for long-form text (plan B7.8) */
.prose-measure { max-width: var(--reading-width); }

/* An empty listing must say so — a silently blank grid reads as a broken page
   (spec §7.1). Kept deliberately plain: one line, one hint, no illustration. */
.empty-state {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--space-8) 0;
  text-align: left;
  border-top: 1px solid var(--line);
}
.empty-state strong {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 500;
  color: var(--ink);
  margin-bottom: var(--space-3);
}
.empty-state p { margin: 0; color: var(--text-muted); font-size: var(--text-base); }

/* ===== components/buttons.css ===== */
/* Buttons and CTAs (plan B7.10) — primary carries real visual weight, the
   secondary is a hairline outline, and the hero variant gets a micro-interaction.

   2026-11-21: a flat brand fill replaced the old champagne-gold gradient and
   the sweeping "shimmer" animation. Both read as generated-template gloss; a
   solid fill, one restrained hover and a visible focus ring are quieter and
   more deliberate. Text colour is theme-driven (--color-on-brand) because a
   gold button needs dark ink while a deep-teal button needs white. */
.btn, a.btn, .btn-primary {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: 16px 40px;
  border-radius: var(--radius-pill);
  background: var(--gold-gradient);
  color: var(--color-on-brand);
  text-decoration: none;
  font-weight: 600; letter-spacing: .04em; font-size: var(--text-base);
  border: 1px solid transparent;
  position: relative; overflow: hidden;
  transition: transform .15s var(--ease-out), box-shadow .15s var(--ease-out),
              background .15s var(--ease-out), filter .15s var(--ease-out);
  cursor: pointer;
}
.btn:hover, a.btn:hover, .btn-primary:hover {
  background: var(--gold-gradient-strong);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(16, 24, 28, .18);
}
.btn:active, a.btn:active, .btn-primary:active {
  transform: translateY(0);
  box-shadow: none;
}
.btn:disabled, .btn[aria-disabled="true"], a.btn.is-disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* secondary: ink hairline, no fill.
   `a.btn-ghost` is listed explicitly: `a.btn` in the primary rule above has a
   higher specificity than a bare `.btn-ghost`, so every ghost *link* silently
   rendered as a solid gold pill. */
.btn-ghost, a.btn-ghost, button.btn-ghost {
  background: transparent; color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--ink) 32%, transparent);
  padding: 15px 34px;
}
.btn-ghost:hover, a.btn-ghost:hover, button.btn-ghost:hover {
  background: color-mix(in srgb, var(--gold) 12%, transparent);
  border-color: var(--gold); color: var(--gold-strong);
  transform: translateY(-2px); box-shadow: none;
}
.btn-ghost:disabled, button.btn-ghost:disabled { opacity: .45; cursor: not-allowed; }
.btn-sm { padding: var(--space-3) var(--space-6); font-size: var(--text-sm); }

/* the arrow inside a hero CTA slides on hover (plan B7.10) */
.btn .btn-arrow { display: inline-block; transition: transform .15s var(--ease-out); }
.btn:hover .btn-arrow { transform: translateX(5px); }

/* Accessibility: a visible keyboard focus ring everywhere */
a:focus-visible, button:focus-visible, summary:focus-visible,
.btn:focus-visible, .btn-ghost:focus-visible, .btn-primary:focus-visible,
.site-header nav a:focus-visible, .lang-switch a:focus-visible,
.brand-card:focus-visible, .faq-item summary:focus-visible,
.feed-card:focus-visible, .card:focus-visible,
.map-list-item:focus-visible, .pin:focus-visible,
.qr-tile:focus-visible, .mg-card:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ===== components/nav.css ===== */
/* Header, primary navigation, language switch, mobile drawer (plan B7.9).
   The bar collapses from 76px to 60px on scroll; the mobile menu is a full
   screen slide-in rather than a dropdown. */

.site-header {
  display: flex; align-items: center; gap: var(--space-7);
  height: var(--header-h);
  padding: 0 clamp(20px, 3.4vw, 44px);
  background: color-mix(in srgb, var(--header-bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
  transition: height .32s var(--ease-out), background .32s,
              border-color .32s, box-shadow .32s;
}
.site-header.is-scrolled {
  height: var(--header-h-compact);
  background: color-mix(in srgb, var(--header-bg) 96%, transparent);
  box-shadow: var(--shadow-soft);
}

/* Transparent variant for full-bleed hero pages.
   All first-paint styling lives on .header-transparent ITSELF, not on the
   JS-added .is-transparent — otherwise the header paints its default cream
   solid bar until site.js runs (and in any JS-less / offline render it never
   becomes transparent at all). Scrolling adds .is-scrolled, which restores the
   solid bar via the higher-specificity rules below. */
.site-header.header-transparent {
  position: absolute; top: 0; left: 0; right: 0;
  /* A soft top scrim keeps white nav text readable on the bright parts of the
     photograph while still letting the image show through: header + hero read
     as one continuous first screen. */
  background: linear-gradient(180deg, rgba(20,16,12,.48), rgba(20,16,12,0));
  border-bottom-color: rgba(255,255,255,.14);
  box-shadow: none;
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
.site-header.header-transparent .brand,
.site-header.header-transparent .brand b { color: #fff; }
.site-header.header-transparent nav a { color: rgba(255,255,255,.9); border-bottom-color: transparent; }
.site-header.header-transparent nav a:hover,
.site-header.header-transparent nav a.active { color: #fff; border-bottom-color: var(--gold-soft); }
.site-header.header-transparent .lang-switch a { color: rgba(255,255,255,.82); }
.site-header.header-transparent .lang-switch a:hover,
.site-header.header-transparent .lang-switch a.active { color: #fff; background: rgba(255,255,255,.14); }
.site-header.header-transparent .menu-toggle { color: #fff; }
.site-header.header-transparent .brand-logo { filter: brightness(0) invert(1); }

/* the transparent header must stay legible once it collapses */
.site-header.header-transparent.is-scrolled {
  position: fixed; background: color-mix(in srgb, var(--header-bg) 96%, transparent);
  border-bottom-color: var(--line);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  box-shadow: var(--shadow-soft);
}
.site-header.header-transparent.is-scrolled .brand,
.site-header.header-transparent.is-scrolled .brand b { color: var(--ink); }
.site-header.header-transparent.is-scrolled nav a { color: var(--text); }
.site-header.header-transparent.is-scrolled nav a:hover,
.site-header.header-transparent.is-scrolled nav a.active { color: var(--gold); }
.site-header.header-transparent.is-scrolled .lang-switch a { color: var(--text-muted); }
/* Re-assert the hover/active states: the transparent-state :hover rules above
   have the same specificity, so without these the solid bar would show white
   text on a cream background when hovering the language switch. */
.site-header.header-transparent.is-scrolled .lang-switch a:hover,
.site-header.header-transparent.is-scrolled .lang-switch a.active {
  color: var(--gold-strong); background: rgba(16,32,31,.12);
}
.site-header.header-transparent.is-scrolled .menu-toggle { color: var(--ink); }
.site-header.header-transparent.is-scrolled .brand-logo { filter: none; }

.site-header .brand {
  font-family: var(--font-display); font-weight: 600; font-size: 26px;
  color: var(--ink); letter-spacing: .02em; text-decoration: none;
  white-space: nowrap; display: flex; align-items: center; gap: var(--space-3);
  transition: font-size .32s var(--ease-out);
}
.site-header.is-scrolled .brand { font-size: 22px; }
.site-header .brand b { color: var(--gold); }
.site-header .brand-logo {
  height: 60px; width: auto; max-width: 280px; object-fit: contain;
  transition: height .32s var(--ease-out), filter .25s;
}
.site-header.is-scrolled .brand-logo { height: 46px; }
/* Text wordmark: visible when no image logo is configured (the theory site's
   default), hidden when an operator supplies a .brand-logo. The onerror
   fallback above still wins via an inline style if that image fails to load. */
.site-header .brand-text { display: inline; }
.site-header .brand:has(.brand-logo) .brand-text { display: none; }

.site-header nav { display: flex; gap: clamp(var(--space-5), 2.2vw, var(--space-8)); flex: 1; flex-wrap: wrap; }
.site-header nav > a {
  color: var(--text); text-decoration: none;
  font-size: var(--text-lg);                 /* 14–15px band per B7.9 via rem */
  font-size: 15px; font-weight: 500; letter-spacing: .04em;
  padding: var(--space-2) 0; border-bottom: 1px solid transparent;
  transition: color .18s, border-color .18s;
}
.site-header nav > a:hover, .site-header nav > a.active { color: var(--gold); border-bottom-color: var(--gold); }

/* language switch is deliberately de-emphasised: small, muted, divided */
.lang-switch { display: flex; align-items: center; gap: 0; margin-left: auto; }
.lang-switch a {
  color: var(--text-muted); text-decoration: none;
  font-size: var(--text-xs); letter-spacing: .08em; text-transform: uppercase;
  padding: var(--space-1) var(--space-3); border-radius: var(--radius-pill);
  transition: color .18s, background .18s;
}
.lang-switch a + a { position: relative; }
.lang-switch a + a::before {
  content: ""; position: absolute; left: 0; top: 50%;
  width: 1px; height: 11px; background: var(--line); transform: translateY(-50%);
}
.lang-switch a:hover, .lang-switch a.active { color: var(--gold-strong); background: transparent; }
.lang-switch a.active { font-weight: 600; }
.site-header .lang-switch { margin-left: 0; }

.menu-toggle {
  display: none; background: none; border: none; cursor: pointer;
  padding: var(--space-2); margin-left: auto; color: var(--ink);
  width: 40px; height: 40px; position: relative;
}
/* the drawer's chrome (label + close control) only exists inside the mobile sheet */
.site-header nav .nav-head,
.site-header nav .nav-close { display: none; }
/* …and so does the drawer's booking entry (the header pill and the floating pill
   cover desktop and phones respectively) */
.site-header nav .nav-booking-wrap,
.site-header nav .nav-foot-wrap { display: none; }
.menu-toggle span, .menu-toggle span::before, .menu-toggle span::after {
  content: ""; display: block; width: 22px; height: 1.5px;
  background: currentColor; margin: 0 auto;
  transition: transform .3s var(--ease-out), opacity .2s;
}
.menu-toggle span::before { transform: translateY(-7px); }
.menu-toggle span::after { transform: translateY(5.5px); }
.menu-toggle[aria-expanded="true"] span { opacity: 0; }
.menu-toggle[aria-expanded="true"]::before,
.menu-toggle[aria-expanded="true"]::after {
  content: ""; position: absolute; left: 9px; width: 22px; height: 1.5px;
  background: currentColor;
}
.menu-toggle[aria-expanded="true"]::before { transform: rotate(45deg); top: 19px; }
.menu-toggle[aria-expanded="true"]::after { transform: rotate(-45deg); top: 19px; }

/* mobile: a right-hand sheet (not a full-bleed takeover). The drawer covers at
   most 86vw / 380px so the page stays visible behind the scrim and the eye can
   still tell where it came from; links are 19–22px serif, not 27–38px display
   type that turned seven items into a wall of text. */
@media (max-width: 860px) {
  /* tighter gap so brand + language switch + menu all fit a 390px bar without
     the last language label clipping off the right edge */
  .site-header { height: var(--header-h-compact); padding: 0 var(--space-5); gap: var(--space-3); }
  .site-header .brand-logo { height: 42px; }
  .menu-toggle { display: block; }
  .site-header nav {
    /* Mobile drawer palette — these locals keep the change scoped to the sheet
       only. Every value resolves through a semantic token so the active theme
       (via /theme.css) drives the drawer on both instances. */
    --sheet-bg: var(--surface);
    --sheet-line: var(--border);
    --sheet-ink: var(--ink);
    --sheet-muted: var(--text-muted);
    --sheet-gold: var(--brand-strong);
    --sheet-gold-2: var(--brand);
    position: fixed; top: 0; right: 0; left: auto;
    /* NOTE: the header carries `backdrop-filter`, which makes it the containing
       block for this fixed child. A `bottom: 0` therefore resolved to the
       header's own ~60px box, so the sheet only ever covered a thin top strip
       (worse after scrolling, when it looked "cut off"). Use a full-viewport
       height instead so the drawer always spans the screen. */
    height: 100vh; height: 100dvh; max-height: 100vh;
    width: min(86vw, 380px);
    display: flex; flex-direction: column; flex: none; gap: 0;
    /* without this the desktop rule's `flex-wrap: wrap` survives, and a column
       flex container that wraps fills the first column top-down then starts a
       second one — on a 409×695 phone the 6th and 7th items landed beside the
       first ("首页   常见问题" on one row) instead of under it. */
    flex-wrap: nowrap;
    counter-reset: navitem;
    background: var(--sheet-bg);
    box-shadow: -30px 0 80px rgba(36, 24, 12, .22);
    padding: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    /* The panel is revealed with a clip wipe, not pushed off-canvas. The header
       carries `backdrop-filter`, which makes it the containing block for this
       fixed child — so a `translateX(102%)` closed state stayed inside the
       document's scrollable overflow and every listing page grew a 340px
       horizontal scrollbar on a 390px phone. A clip costs no layout: the box
       never leaves the viewport, and the negative insets keep the shadow while
       open. */
    clip-path: inset(-80px 0 -80px 100%);
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: clip-path .46s var(--ease-lux), opacity .26s, visibility .46s;
  }
  .site-header nav.open {
    clip-path: inset(-80px 0 -80px -80px);
    opacity: 1; visibility: visible; pointer-events: auto;
  }
  .site-header nav .nav-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--space-4); flex: none;
    position: sticky; top: 0; z-index: 2;
    padding: calc(env(safe-area-inset-top, 0px) + var(--space-5)) clamp(20px, 6vw, 30px) var(--space-4);
    background: var(--sheet-bg);
    border-bottom: 1px solid var(--sheet-line);
  }
  .site-header nav .nav-label {
    font-family: var(--font-body);
    font-size: var(--text-xs); font-weight: 600;
    letter-spacing: .24em; text-transform: uppercase;
    color: var(--sheet-gold);
  }
  .site-header nav > a {
    /* the sheet is a scroll surface, so the rows must keep their height instead
       of being squeezed to fit a short screen (landscape phone ≈ 390px tall) */
    flex: none;
    display: flex; align-items: center; gap: var(--space-4);
    font-family: var(--font-display);
    font-size: clamp(1.05rem, 4.2vw, 1.25rem); line-height: 1.3;
    letter-spacing: .01em;
    color: var(--sheet-ink);
    /* slimmer rows — the previous 1.15–1.4rem serif at 16px padding read heavy */
    padding: var(--space-3) clamp(20px, 6vw, 30px);
    border-bottom: 1px solid var(--sheet-line);
    transition: color .18s, background .18s;
  }
  /* 01–08 index, borrowed from the listing hero so the sheet reads as part of
     the same system rather than a bare list of links */
  .site-header nav > a::before {
    counter-increment: navitem;
    content: counter(navitem, decimal-leading-zero);
    flex: none; min-width: 1.4em;
    font-family: var(--font-body); font-size: 10px; font-weight: 600;
    letter-spacing: .1em; font-variant-numeric: tabular-nums;
    color: var(--sheet-gold); opacity: .55;
  }
  .site-header nav > a:hover, .site-header nav > a.active {
    color: var(--sheet-gold);
    background: rgba(16,32,31,.08);
  }
  /* The homepage header carries `.is-transparent`, whose `nav a { color: #fff }`
     (specificity 0,2,2) beats the drawer rule above (0,1,2) and paints every link
     white — invisible on the warm-ivory sheet. `nav a` (not `nav > a`) is needed
     because the contact block's phone/email are <a> nested inside .nav-foot, so a
     child-only selector would miss them. Same specificity but later in source, so
     this wins at mobile widths and keeps the whole sheet dark-on-ivory. */
  .site-header.is-transparent nav a { color: var(--sheet-ink); }
  .site-header.is-transparent nav a:hover,
  .site-header.is-transparent nav a.active { color: var(--sheet-gold); }
  .site-header nav.open > a { animation: navLinkIn .5s var(--ease-lux) both; }
  .site-header nav.open > a:nth-of-type(1) { animation-delay: .05s; }
  .site-header nav.open > a:nth-of-type(2) { animation-delay: .09s; }
  .site-header nav.open > a:nth-of-type(3) { animation-delay: .13s; }
  .site-header nav.open > a:nth-of-type(4) { animation-delay: .17s; }
  .site-header nav.open > a:nth-of-type(5) { animation-delay: .21s; }
  .site-header nav.open > a:nth-of-type(6) { animation-delay: .25s; }
  .site-header nav.open > a:nth-of-type(7) { animation-delay: .29s; }
  .site-header nav.open > a:nth-of-type(8) { animation-delay: .33s; }
  .site-header nav .nav-close {
    /* a real control inside the sheet's own header: the hamburger it came from
       is covered by the sheet (z-index 50 bar vs 60 panel), so a visible close
       affordance has to live here. */
    display: flex; align-items: center; justify-content: center;
    flex: none; width: 40px; height: 40px; padding: 0;
    background: none; border: 1px solid var(--sheet-line);
    border-radius: var(--radius-pill);
    color: var(--sheet-ink); font-size: 22px; line-height: 1; cursor: pointer;
    transition: background .18s, color .18s, border-color .18s;
  }
  .site-header nav .nav-close:hover,
  .site-header nav .nav-close:focus-visible {
    background: rgba(16,32,31,.12); border-color: var(--sheet-gold-2);
    color: var(--sheet-ink); outline: none;
  }
  .site-header nav .nav-booking-wrap,
.site-header nav .nav-foot-wrap {
    /* sticky, because seven links plus the footer group do not fit a 640px-tall
       phone or a landscape one — the call to action has to stay reachable without
       first discovering that the sheet scrolls. When there is spare room the auto
       margin parks the group at the bottom instead of floating mid-panel. */
    display: flex; flex-direction: column; gap: var(--space-4);
    position: sticky; bottom: 0; z-index: 1;
    margin-top: auto;
    padding: var(--space-5) clamp(20px, 6vw, 30px) calc(var(--space-5) + env(safe-area-inset-bottom, 0px));
    background: var(--sheet-bg);
    border-top: 1px solid var(--sheet-line);
  }
  /* contact block — keeps the tall sheet from being half empty, and puts the two
     things a phone visitor wants (call / write) one tap away */
  .site-header nav .nav-foot { display: block; }
  .site-header nav .nav-foot-label {
    margin: 0 0 var(--space-2);
    font-family: var(--font-body); font-size: 10px; font-weight: 600;
    letter-spacing: .24em; text-transform: uppercase;
    color: var(--sheet-muted);
  }
  .site-header nav .nav-foot-line {
    display: block; padding: 0;
    font-family: var(--font-body); font-size: var(--text-sm);
    line-height: 1.9; letter-spacing: .03em;
    color: var(--sheet-ink);
    text-decoration: none;
    transition: color .18s;
  }
  .site-header nav .nav-foot-line:hover,
  .site-header nav .nav-foot-line:focus-visible { color: var(--sheet-gold); }
  /* Drawer booking entry — shared by both modes: base.html renders a <button>
     in dialog mode and an <a> in external mode. Without this rule neither gets
     the pill styling (the theory site had removed it along with the dialog). */
  .site-header nav .nav-booking {
    display: inline-flex; align-items: center; justify-content: center;
    width: 100%; min-height: 46px; padding: 0 var(--space-6);
    border: 1px solid var(--sheet-gold-2); border-radius: var(--radius-pill);
    background: transparent; color: var(--sheet-gold);
    font: inherit; font-family: var(--font-body);
    font-size: var(--text-base); font-weight: 600; letter-spacing: .14em;
    cursor: pointer; transition: background .18s, color .18s;
  }
  .site-header nav .nav-booking:hover,
  .site-header nav .nav-booking:focus-visible { background: var(--sheet-gold-2); color: #fff; }
  /* bar order: brand · [gap] · languages · hamburger (the sheet's trigger belongs
     in the corner, where the thumb already is) */
  .site-header .lang-switch { order: 3; flex-shrink: 0; margin-left: auto; }
  .site-header .menu-toggle { order: 4; margin-left: 0; }
  /* CJK language names were breaking mid-word ("简体 / 中文") in the tight bar;
     keep each label on one line. The 预约 link stays visible on every viewport. */
  .lang-switch a { white-space: nowrap; padding: var(--space-1) 6px; letter-spacing: .04em; }
  body.nav-open { overflow: hidden; }
  /* the bar the sheet slid out of has to go quiet: otherwise a clipped corner of
     the logo and the language switch would sit un-dimmed beside the scrim */
  body.nav-open .site-header {
    background: transparent; border-bottom-color: transparent;
    box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  body.nav-open .site-header .brand,
  body.nav-open .site-header .lang-switch,
  body.nav-open .site-header .menu-toggle { visibility: hidden; }
  /* scrim, injected by site.js so the page behind the sheet is dimmed and tapping
     outside closes it (a right-hand sheet with no backdrop feels like a layout
     accident, not a layer) */
  .nav-scrim {
    position: fixed; inset: 0; z-index: 45;
    background: rgba(36, 24, 12, .38);
    opacity: 0; visibility: hidden;
    transition: opacity .3s, visibility .3s;
  }
  body.nav-open .nav-scrim { opacity: 1; visibility: visible; }
}

@keyframes navLinkIn {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .site-header nav.open > a { animation: none; }
  .site-header nav { transition-duration: .01ms; }
}

/* Short-but-portrait phones (360×640, 375×667): the full-size rows plus the
   contact block came to 662px in a 640px sheet, so the sticky footer rode 22px up
   and clipped the last link. Tighten the rows instead of dropping content. */
@media (max-width: 860px) and (max-height: 700px) {
  .site-header nav .nav-head { padding-top: var(--space-4); padding-bottom: var(--space-3); }
  .site-header nav > a { padding-top: var(--space-3); padding-bottom: var(--space-3); }
  .site-header nav .nav-booking-wrap,
.site-header nav .nav-foot-wrap {
    gap: var(--space-3);
    padding-top: var(--space-4);
    padding-bottom: calc(var(--space-4) + env(safe-area-inset-bottom, 0px));
  }
  .site-header nav .nav-foot-line { line-height: 1.7; }
}

/* Landscape phones (844×390 and the like): seven rows cannot fit a 390px-tall
   sheet in one column, so the sheet widens and the links go two-up. The chrome
   (label/close) and the booking entry span both columns. */
@media (max-width: 860px) and (max-height: 520px) {
  .site-header nav {
    width: min(90vw, 520px);
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-content: start;
    column-gap: var(--space-6);
    padding: 0;
  }
  .site-header nav .nav-head { grid-column: 1 / -1; padding-top: var(--space-3); padding-bottom: var(--space-2); }
  .site-header nav > a {
    padding: var(--space-3) clamp(20px, 6vw, 30px);
    font-size: clamp(1rem, 2.4vw, 1.15rem);
  }
  .site-header nav > a:nth-of-type(even) { border-left: 1px solid var(--sheet-line); }
  .site-header nav .nav-booking-wrap,
.site-header nav .nav-foot-wrap {
    grid-column: 1 / -1;
    /* static, not sticky: on a 390px-tall sheet a bottom-anchored footer sits on
       top of the last grid row (常见问题 was completely covered). Here the panel
       scrolls instead, and the entry stays in flow right under the links. */
    position: static;
    margin-top: 0;
    padding-top: var(--space-3);
  }
  /* no room for the contact block on a landscape phone — navigation first */
  .site-header nav .nav-foot { display: none; }
  .site-header nav .nav-booking { min-height: 42px; }
}

/* Breadcrumb — same container + 2*gutter formula as detail/hero containers, so
   its text sits on the exact same left edge as listing cards and detail titles. */
.breadcrumb {
  max-width: calc(var(--container) + 2 * var(--gutter)); margin: 0 auto;
  padding: var(--space-5) var(--gutter) 0;
  font-size: var(--text-sm); color: var(--text-muted); letter-spacing: .02em;
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; transition: color .15s; }
.breadcrumb a:hover { color: var(--gold-strong); }
.breadcrumb .sep { margin: 0 9px; color: var(--gold); opacity: .6; }
.breadcrumb .current { color: var(--ink); font-weight: 600; }

/* Phone-width language switch: 简 / 繁 / EN.
   Three full native names (简体中文 · 繁體中文 · ENGLISH) are 203px wide; with
   the wordmark and the always-visible 预约 link they pushed the header to
   421px inside a 390px viewport, producing a white strip on the right and a
   clipped last label. The full labels remain in the DOM (screen readers and
   the title attribute still get them); only the visual glyph is swapped. */
@media (max-width: 480px) {
  .site-header .lang-switch a { font-size: 0; padding: var(--space-1) 7px; }
  .site-header .lang-switch a::after {
    content: attr(data-short);
    font-size: var(--text-xs); letter-spacing: .04em;
  }
  .site-header .lang-switch a.active::after { font-weight: 600; }
}

/* ===== components/cards.css ===== */
/* Cards: listing cards, editorial page heads, info rows, tags, doctor cards. */

/* Listing masthead — every listing page renders it through
   templates/_listing_head.html (articles / videos / activities / doctors /
   clinics / faq).

   What changed and why: the old head was one left-aligned text column inside the
   1280px container, so the right half of the band was blank at every width above
   ~900px, and the gap under the lead was the sum of three paddings — hero bottom
   56px + hero margin-bottom 72px + the following `.section`'s own --section-y
   (96–200px) — i.e. ≈230px of nothing at 1440 before the first card.

   The head is now a two-column masthead (title block + an index of what the page
   holds), and the vertical rhythm belongs to the head, not to the section. */
.page-hero {
  position: relative;
  isolation: isolate;
  padding: clamp(var(--space-7), 4.2vw, var(--space-12))
           max(var(--gutter), calc((100% - var(--container)) / 2))
           clamp(var(--space-6), 3vw, var(--space-10));
  text-align: center;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
}
/* The grid under the head keeps a deliberate step (≈32–56px) instead of a second
   section gap; the head already carries the top beat of the page. */
.page-hero + .section {
  padding-top: clamp(var(--space-7), 3.2vw, var(--space-10));
}
.page-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-7);
  align-items: start;
}
/* split only when the view actually supplied an index (see the macro) */
@media (min-width: 900px) {
  .page-hero-inner--split {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 340px);
    gap: clamp(var(--space-8), 5vw, var(--space-14));
    /* stretch, not end: the panel's rule then spans the whole masthead instead of
       hanging beside the last few lines, which is what makes the two columns read
       as one block */
    align-items: stretch;
  }
  .page-hero-index {
    display: flex; flex-direction: column; justify-content: flex-end;
  }
}
.page-hero .eyebrow {
  display: inline-block; padding: 7px 20px;
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  background: var(--gold-soft);
  font-size: var(--text-xs); font-weight: 600; color: var(--gold-strong);
  letter-spacing: .24em; text-transform: uppercase;
}
.page-hero h1 {
  font-size: var(--text-3xl); color: var(--ink);
  letter-spacing: .04em; margin: var(--space-3) 0 0; line-height: 1.1;
}
.page-hero .divider { margin: var(--space-6) auto; }
.page-hero .tagline {
  font-family: var(--font-display); color: var(--gold-strong);
  letter-spacing: .04em; font-size: var(--text-lg);
}
.page-hero p.lead {
  color: var(--text-muted); max-width: 64ch; margin: 0 auto;
  line-height: 1.95; font-size: var(--text-base);
}

/* Editorial variant (spec §1.2): every listing head is left-aligned, so a long
   CJK headline never floats in the middle with nothing to align to. */
.page-hero--editorial { text-align: left; }
.page-hero--editorial h1 { font-size: clamp(2.4rem, 4.6vw, 3.6rem); margin-top: var(--space-3); }
.page-hero--editorial .tagline { margin-top: var(--space-3); color: var(--text-muted); letter-spacing: .1em; }
/* 46ch measured on the Latin "0"; CJK glyphs are twice as wide, so the measure
   is given in px (≈ 34 CJK characters, the comfortable line length) */
.page-hero--editorial p.lead { max-width: 600px; margin: var(--space-5) 0 0; }
.page-hero--editorial .divider { margin-left: 0; }

/* ─── masthead index (right column) ─────────────────────────────────────────
   A count plus one row per group, hairline-separated like a table of contents.
   It reads as the page's own structure, so the band is never decorative filler;
   on articles/videos/faq the rows are jump links to the band they count. */
.page-hero-index {
  position: relative;
  border-left: 1px solid var(--border);
  padding-left: clamp(var(--space-5), 2.2vw, var(--space-7));
  min-width: 0;
}
/* a short gold tick at the top of the rule: the panel reads as a masthead block
   rather than a caption floating at the right edge */
.page-hero-index::before {
  content: ''; position: absolute; left: -1px; top: 0;
  width: 1px; height: 34px; background: var(--gold);
}
.phi-stat { display: flex; align-items: baseline; gap: var(--space-3); }
.phi-kicker {
  font-size: var(--text-xs); font-weight: 600; letter-spacing: .2em;
  text-transform: uppercase; color: var(--gold-strong);
}
.phi-num {
  /* Body face, not --font-display: Cormorant's "1" is a serif stem that reads as
     "I" at this size, so a count like 11 looked like "II". Inter's tabular
     figures stay unambiguous and align with the counts in the list below. */
  font-family: var(--font-body);
  font-weight: 300; line-height: 1; letter-spacing: -.01em;
  font-size: clamp(2rem, 3.2vw, 2.75rem); color: var(--ink);
  font-variant-numeric: tabular-nums lining-nums;
}
.phi-list { list-style: none; margin: var(--space-4) 0 0; padding: 0; }
.phi-row {
  display: flex; align-items: baseline; gap: var(--space-4);
  padding: 7px 0; border-bottom: 1px dotted var(--border);
  font-size: var(--text-sm); color: var(--text-muted);
  text-decoration: none;
  transition: color .2s var(--ease-out), border-color .2s;
}
.phi-list li:last-child .phi-row { border-bottom: 0; }
.phi-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phi-count {
  color: var(--gold-strong); font-size: var(--text-xs); font-weight: 600;
  letter-spacing: .06em; font-variant-numeric: tabular-nums;
}
a.phi-row:hover, a.phi-row:focus-visible { color: var(--ink); border-bottom-color: var(--gold); }
a.phi-row:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
/* stacked on narrow screens: the panel keeps its content but changes its edge */
@media (max-width: 899px) {
  .page-hero-index {
    border-left: 0; padding-left: 0;
    border-top: 1px solid var(--line); padding-top: var(--space-5);
  }
  /* the rule is horizontal here, so the gold tick would read as a stray mark */
  .page-hero-index::before { display: none; }
  .phi-list { margin-top: var(--space-3); }
}

/* every listing grid uses the same wrapping behaviour: cards grow to fill the
   row and a partial last row stays centred instead of docking left */
.cards-grid {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: var(--space-7);
  max-width: var(--container); margin: 0 auto;
}
.cards-grid > .card { flex: 1 1 320px; min-width: 0; max-width: 460px; }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .34s var(--ease-out), box-shadow .34s var(--ease-out),
              border-color .2s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); border-color: var(--gold); }
.card-photo { aspect-ratio: 4 / 3; overflow: hidden; background: var(--gold-soft); }
.card-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease-out); }
.card:hover .card-photo img { transform: scale(1.05); }
.card-photo--wide { aspect-ratio: 16 / 7; }
.card-body { padding: var(--space-7); display: flex; flex-direction: column; flex: 1; }

.region-badge {
  display: inline-block; padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-pill); border: 1px solid var(--border);
  background: var(--gold-soft); font-size: var(--text-xs); color: var(--gold-strong);
  letter-spacing: .08em; font-weight: 600;
}
.clinic-tag {
  display: inline-block; margin-left: var(--space-3); padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill); font-size: 11px; letter-spacing: .08em;
  background: var(--gold); color: #fff; font-weight: 600; vertical-align: middle;
}
.lbl {
  font-size: var(--text-xs); color: var(--gold-strong);
  letter-spacing: .14em; text-transform: uppercase;
  margin-bottom: var(--space-2); font-weight: 600;
}
.info-row {
  display: flex; align-items: flex-start; gap: var(--space-3);
  padding: var(--space-3) 0; border-bottom: 1px solid var(--line);
}
.info-row:last-child { border-bottom: none; }
.info-row .ico { color: var(--gold); flex-shrink: 0; margin-top: 3px; }
.info-row .lbl { font-size: 11px; letter-spacing: .12em; display: block; margin-bottom: 2px; }
.info-row .val { font-size: var(--text-sm); color: var(--text); line-height: 1.6; font-variant-numeric: tabular-nums; }
.tag-list { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.tag {
  padding: var(--space-1) var(--space-4); border-radius: var(--radius-pill);
  background: var(--gold-soft); border: 1px solid var(--border);
  font-size: var(--text-sm); color: var(--text-muted);
}

/* Doctor cards — portrait crop pinned to the top so faces are never cut */
.doc-name { font-size: var(--text-xl); color: var(--ink); margin: 0 0 var(--space-1); letter-spacing: .02em; }
.doc-title { color: var(--gold-strong); font-family: var(--font-display); margin: 0 0 var(--space-4); font-size: var(--text-base); }
.doc-bio { color: var(--text-muted); font-size: var(--text-sm); line-height: 1.85; margin: 0 0 var(--space-5); }
.doc-creds { list-style: none; padding: 0; margin: var(--space-2) 0 0; }
.doc-creds li {
  font-size: var(--text-sm); color: var(--text-muted); line-height: 1.8;
  display: flex; align-items: flex-start; gap: var(--space-3);
  padding: var(--space-2) 0; border-bottom: 1px solid var(--line);
}
.doc-creds li:last-child { border-bottom: none; }
.doc-cred-mark { color: var(--gold); flex-shrink: 0; margin-top: 1px; font-size: var(--text-xs); }
.doc-photo { aspect-ratio: 3 / 4; }
.doc-photo img { object-position: top center; }

/* Doctor card, slimmed to a teaser (spec §7.3). It is an <a>, so the whole card
   is the hit target; only the four lines below survive — everything else moved
   to /doctors/<slug>. */
.doctor-card { text-decoration: none; color: inherit; }
.doctor-card .card-body { padding: var(--space-6); }
.doctor-card-line {
  color: var(--text-muted); font-size: var(--text-sm); line-height: 1.75;
  margin: 0 0 var(--space-5);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.doctor-card-more {
  margin-top: auto; display: inline-flex; align-items: center; gap: var(--space-2);
  color: var(--gold-strong); font-size: var(--text-sm);
  letter-spacing: .06em; transition: gap .2s var(--ease-out), color .2s;
}
.doctor-card-more span { transition: transform .2s var(--ease-out); }
.doctor-card:hover .doctor-card-more { color: var(--gold); }
.doctor-card:hover .doctor-card-more span { transform: translateX(3px); }
.doctor-card:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.doctor-card-empty {
  display: grid; place-items: center; color: var(--gold-strong);
  font-family: var(--font-display); font-size: clamp(2rem, 6vw, 3rem);
}

/* ─── categorised listings (articles / videos) ──────────────────────────────
 * Each category becomes a titled band so the taxonomy is legible at a glance
 * and no item can disappear behind a silent filter (see _published_list). */
.list-group + .list-group { margin-top: var(--space-12); }
/* P5-19: numbered category bands so the grouping reads as a deliberate
   sequence rather than a stack of identical headings. The counter resets on the
   listing wrapper and increments per band (decimal-leading-zero → 01 / 02). */
.section.listing { counter-reset: group; }
/* Listings keep the same 1280 column as the doctors page. `.section` only pads by
   --gutter, so an uncapped grid stretched to 1824px on a 1920 screen — a wall of
   cards under a head that stops at 1280, and the widest type on the site. The cap
   lives on the band wrapper (articles/videos) *and* on the bare grid (activities)
   so a category rule and its cards always share one left/right edge. */
.section.listing > .feed-grid,
.section.listing > .list-group {
  max-width: var(--container);
  margin-inline: auto;
}
/* the masthead index jumps to these bands; the sticky header must not cover the
   band title after the jump */
.list-group, .faq-group { scroll-margin-top: calc(var(--header-h) + var(--space-6)); }
.list-group { counter-increment: group; }
.list-group-title::before {
  content: counter(group, decimal-leading-zero) " / ";
  color: var(--gold-strong); font-weight: 600; letter-spacing: .04em;
}
.list-group-title {
  font-family: var(--font-display); font-weight: 500;
  font-size: var(--text-xl); color: var(--ink);
  margin: 0 0 var(--space-6); padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--line); letter-spacing: .02em;
}

/* ===== components/forms.css ===== */
/* Form + filter primitives on the public site (search boxes, language pickers,
   pagination). The admin SPA has its own styling; this is front-end only. */

.field { display: flex; flex-direction: column; gap: var(--space-2); }
.field label {
  font-size: var(--text-xs); letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold-strong); font-weight: 600;
}
.field input, .field select, .field textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  transition: border-color .18s, box-shadow .18s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 18%, transparent);
}

/* filter chips used on listing pages */
.chip-row { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-bottom: var(--space-8); justify-content: center; }
.chip {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  background: var(--surface); color: var(--text-muted);
  font-size: var(--text-sm); letter-spacing: .04em; text-decoration: none;
  cursor: pointer; transition: all .18s var(--ease-out);
}
.chip:hover { border-color: var(--gold); color: var(--gold-strong); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--gold-soft); }

/* pagination */
.pager { display: flex; gap: var(--space-3); justify-content: center; margin-top: var(--space-12); }
.pager a, .pager span {
  min-width: 40px; height: 40px; padding: 0 var(--space-3);
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: var(--radius-pill);
  font-size: var(--text-sm); text-decoration: none; color: var(--text-muted);
}
.pager .is-current { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-strong); font-weight: 600; }

/* ===== components/detail.css ===== */
/* Detail pages share the site-wide --container frame so their content edges
   line up with the listing grids and the breadcrumb. The +2*gutter formula
   mirrors how listing sections work (section supplies gutter padding, grid
   caps at --container): border box = container + 2 gutters, content = exactly
   the container edge, at every viewport. The hero (title), the body (text +
   inline media + PDF reader) and the video player ALL use this same frame, so
   every block's left/right edges match the title and the listing cards — no
   narrow floating column, no right-side dead space. */
.detail-hero { max-width: calc(var(--container) + 2 * var(--gutter)); margin: 0 auto; padding: clamp(var(--space-10), 8vw, var(--space-14)) var(--gutter) 0; text-align: left; }
.detail-hero .eyebrow {
  font-size: var(--text-xs); letter-spacing: .26em; text-transform: uppercase;
  color: var(--gold-strong); font-weight: 600; display: inline-block;
  margin-bottom: var(--space-5);
}
.detail-hero h1 {
  font-size: var(--text-3xl); color: var(--ink);
  margin: 0 0 var(--space-5); line-height: 1.12;
}
.detail-hero .summary {
  color: var(--text-muted); font-size: var(--text-lg); line-height: 1.9;
  max-width: 100%; margin: 0 0 var(--space-6);
}
/* Left-aligned gold rule keeps the editorial hero coherent: the eyebrow,
   title, standfirst and this accent all start at the same left edge, so the
   rule reads as a deliberate underline of the title block rather than a stray
   centred tick. Space below it separates the rule from the meta strip. */
.detail-hero .rule { width: 56px; height: 2px; background: var(--gold); margin: 0 0 var(--space-6); border: none; }
/* The meta strip is a single baseline-aligned row: a small uppercase label,
   the formatted date (tabular figures so multi-row lists never jitter), and an
   optional reading-time. Reading order is therefore title → standfirst →
   published → media → body, which is the canonical editorial sequence. */
.detail-meta { display: flex; align-items: baseline; gap: var(--space-3); flex-wrap: wrap; text-align: left; color: var(--text-muted); font-size: var(--text-sm); letter-spacing: .04em; margin: 0; }
.detail-meta .meta-label { color: var(--gold-strong); font-weight: 600; font-size: var(--text-xs); letter-spacing: .12em; text-transform: uppercase; }
.detail-meta .meta-date { color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.detail-meta .sep { margin: 0 2px; color: var(--gold); opacity: .55; }
.detail-meta .reading-time { color: var(--text-muted); }

.detail-container {
  max-width: calc(var(--container) + 2 * var(--gutter)); margin: 0 auto;
  padding: var(--space-7) var(--gutter) clamp(var(--space-12), 9vw, var(--space-16));
}
/* Reading sheet: the page ground is white now, so the sheet leans on the
   barely-warm surface token plus a hairline — enough to read as one calm plate
   without a second colour. */
.detail-sheet {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-soft);
  padding: clamp(var(--space-6), 4vw, var(--space-12));
}
/* Reading sheet: the page ground is white now, so the sheet leans on the
   barely-warm surface token plus a hairline — enough to read as one calm plate
   without a second colour. The body fills the SAME container frame as the
   title and the listing cards (no max-width cap, no auto-centring): text,
   inline images, the PDF reader and the video player all share the exact same
   left/right edges, so nothing floats as a narrow column and there is no
   right-side dead space. */
.detail-body { font-size: var(--text-lg); line-height: 1.8; color: var(--text); max-width: 100%; }

/* Paper full-text: rendered inline as an embedded PDF reader instead of a
   download button (request: show the content, do not offer a file download).
   Fills the same container width as the body text and the title — no narrower
   column, no right-side dead space. */
.paper-reader {
  max-width: 100%; margin: clamp(var(--space-8), 5vw, var(--space-10)) 0 0;
}
.paper-reader-head {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-3); border-bottom: 1px solid var(--line);
}
.paper-reader-title {
  font-family: var(--font-display); font-size: 1.4rem; color: var(--ink);
}
.paper-reader-hint { font-size: 13px; color: var(--text-muted); }
.paper-embed {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden; background: var(--surface);
}
.paper-embed object {
  display: block; width: 100%; height: clamp(620px, 82vh, 1180px);
  border: 0;
}
.paper-embed-fallback {
  padding: var(--space-8); text-align: center; color: var(--text-muted);
}
.paper-embed-fallback .btn { margin-top: var(--space-3); }

/* Video detail player: sits on the shared --container frame so the player and
   the text block share the same left/right edges (request §4). The 16/9 box +
   object-fit:cover on .video-wrap guarantees no letterboxing regardless of the
   source's native aspect ratio. */
.detail-video-wide {
  max-width: calc(var(--container) + 2 * var(--gutter)); margin: clamp(var(--space-8), 5vw, var(--space-10)) auto;
  padding: 0 var(--gutter);
}
@media (max-width: 720px) {
  .detail-video-wide { padding: 0 var(--gutter); }
}
/* Block elements simply fill the body width (which is the full container
   frame, matching the title and the listing cards). No per-element max-width,
   so text, headings and lists all share one consistent left/right edge. */
.detail-body > p, .detail-body > ul, .detail-body > ol,
.detail-body > h2, .detail-body > h3, .detail-body > blockquote {
  max-width: 100%;
}
.detail-body p { margin: 0 0 1.4em; }
/* P5-21: the opening paragraph reads as a magazine standfirst — a touch larger
   and ink-dark — so the body doesn't dive straight in after the gold rule. */
.detail-body > p:first-of-type { font-size: 1.25rem; color: var(--ink); line-height: 1.9; }
.detail-body h2, .detail-body h3 { font-family: var(--font-display); color: var(--ink); line-height: 1.25; }
.detail-body h2 { font-size: 1.7rem; margin: 2em 0 .6em; padding-left: var(--space-4); border-left: 1px solid var(--gold); }
/* h3 is one level down: a lighter rule in the same family, so the hierarchy is
   visible at a glance instead of h3 looking like a bold paragraph */
.detail-body h3 {
  font-size: 1.35rem; margin: 1.6em 0 .5em; color: var(--gold-strong);
  padding-left: var(--space-4); border-left: 2px solid var(--gold-soft);
}
.detail-body a { color: var(--gold-strong); text-decoration: underline; text-underline-offset: 3px; }
.detail-body ul, .detail-body ol { padding-left: 1.3em; margin: 0 0 1.3em; }
.detail-body li { margin: 0 0 .5em; }
.detail-body blockquote {
  border-left: 2px solid var(--gold); padding-left: var(--space-6);
  margin: var(--space-7) 0; font-family: var(--font-display);
  font-size: 1.3rem; color: var(--ink); font-style: italic; line-height: 1.5;
}
/* media inside an article is always cropped to a stable frame (B7.7/B7.11) */
.detail-body img, .detail-body video, .detail-body iframe {
  display: block; width: 100%; max-width: 100%;
  border-radius: var(--radius-md); margin: var(--space-10) auto;
  box-shadow: var(--shadow-soft); background: #000;
}
.detail-body img { object-fit: cover; }
.detail-body figure { margin: var(--space-10) 0; border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-soft); }
.detail-body figure img { margin: 0; box-shadow: none; border-radius: 0; }
.detail-body figcaption {
  text-align: center; font-size: var(--text-sm); color: var(--text-muted);
  padding: var(--space-3) var(--space-4); background: var(--surface); letter-spacing: .03em;
}
.detail-body iframe { aspect-ratio: 16 / 9; border: 0; }

.detail-actions { display: flex; gap: var(--space-4); justify-content: center; margin-top: var(--space-12); flex-wrap: wrap; }

/* PDF download affordance on literature/paper articles (request §2). Sits above
   the body so the link is obvious without scrolling the abstract. */
.detail-pdf { display: flex; align-items: center; gap: var(--space-5); flex-wrap: wrap; margin: 0 0 var(--space-10); }
.detail-pdf .btn { margin: 0; }
.detail-pdf-hint { color: var(--text-muted); font-size: var(--text-sm); letter-spacing: .02em; }

/* ── Doctor detail — headline + dossier spread (2026-11-03, pass 2) ─────────
   Pass 1 put the portrait in the masthead to balance the name block. It balanced,
   but the portrait then floated at the top right on its own, disconnected from
   every other element on the page, and the name sat alone in a 1fr column with
   half a screen of white under it.

   This version reads as a dossier: the headline is a compact full-width band
   (eyebrow / name / rule / region), and the body is a two-column spread whose
   LEFT column is the portrait and whose RIGHT column is the label/value spec
   sheet. That gives the page a single top edge (portrait top = first hairline),
   puts the image where the eye already starts, and — because the sheet is
   `minmax(0, 1fr)` — lets the table take exactly the width the portrait leaves,
   at any viewport, with or without a photo. */

/* Compact masthead: the portrait no longer sits up here, so the band can be a
   normal editorial header instead of a 400px stage. */
.detail-hero--doctor { padding-top: clamp(var(--space-7), 4.2vw, var(--space-12)); }
.detail-hero--doctor h1 { font-size: clamp(2.3rem, 4.2vw, 3.1rem); margin-bottom: var(--space-4); }
.detail-hero--doctor .rule { margin-bottom: var(--space-4); }
.detail-hero--doctor .detail-meta { margin-bottom: 0; }

/* gap to the dossier: one step, not a band. The old 56px container padding plus
   the 96px hero padding left ~150px of air between the name and the first row. */
.detail-container--doctor { padding-top: clamp(var(--space-5), 2.6vw, var(--space-8)); }

.doctor-dossier {
  display: grid;
  /* the portrait column is the only knob: the sheet is whatever is left, so the
     table re-flows automatically when this width changes or the photo is absent */
  --portrait-w: clamp(220px, 23vw, 320px);
  grid-template-columns: var(--portrait-w) minmax(0, 1fr);
  gap: clamp(var(--space-6), 4vw, var(--space-12));
  align-items: start;
}
.doctor-dossier--text { grid-template-columns: minmax(0, 1fr); }

.doctor-portrait {
  margin: 0; overflow: hidden;
  border-radius: var(--radius-lg); background: var(--gold-soft);
  box-shadow: 0 30px 70px -28px rgba(36, 28, 21, 0.5);
  /* The portrait is a column, not an ornament: it stretches to the height of the
     sheet beside it so the left edge of the spread is one solid mass and no dead
     column opens under the photo. `min-height` keeps a very short record (a bio
     and two credentials) from squeezing it into a landscape strip. The image is
     absolutely placed, so its intrinsic height never drives the row. */
  align-self: stretch; position: relative;
  min-height: clamp(320px, 30vw, 460px);
  /* the stretch has a floor on the aspect ratio: past ~2.6x its own width the
     cover fit starts slicing the photo horizontally instead of filling it, and a
     long English record (9 credentials) turned the portrait into a 1:4.7 sliver.
     Expressed in the column's own width so it holds at every breakpoint. */
  max-height: calc(var(--portrait-w) * 2.6);
}
.doctor-portrait img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: top center; display: block;
}

/* ── spec sheet ────────────────────────────────────────────────────────────
   Labelled rows: a narrow term column and a wide value column. The term column
   is deliberate (it is what a reader scans for), so it never reads as empty
   space, and the value column carries its own hairline grid — the composition is
   full at every viewport no matter how few items a record has. */
.doctor-facts { margin: 0; }
.doctor-fact {
  display: grid;
  grid-template-columns: minmax(0, 160px) minmax(0, 1fr);
  gap: clamp(var(--space-4), 2.2vw, var(--space-8));
  align-items: start;
  padding: clamp(var(--space-5), 2.4vw, var(--space-8)) 0;
  border-top: 1px solid var(--line);
}
.doctor-fact:last-child { border-bottom: 1px solid var(--line); }
.doctor-fact dt {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 1.25vw, 1.25rem);
  color: var(--ink); letter-spacing: .04em; padding-top: 2px;
}
/* short gold tick under the term — the same accent vocabulary as the hero rule
   and the footer headings */
.doctor-fact dt::after {
  content: ''; display: block; width: 26px; height: 1px;
  background: var(--gold); margin-top: var(--space-3);
}
.doctor-fact dd { margin: 0; min-width: 0; }

/* Biography. The cell is already a comfortable measure (~740px at 1440), so the
   cap only guards against ultra-wide viewports; the column itself does the work.
   `density` comes from the data (see _doctor_layout): a short bio is promoted to
   a statement, which is what stops it from looking like a stray paragraph. */
.doctor-bio { max-width: 76ch; }
.doctor-bio.detail-body > :first-child { margin-top: 0; }
.doctor-bio.detail-body > :last-child { margin-bottom: 0; }
.doctor-bio--brief.detail-body,
.doctor-bio--brief.detail-body p {
  font-size: clamp(1.2rem, 1.5vw, 1.4rem);
  line-height: 1.95; color: var(--ink); max-width: 100%;
}
.doctor-bio--long.detail-body { font-size: var(--text-base); line-height: 1.9; max-width: 74ch; }

/* specialties as a numbered index rather than a pill ribbon: pills of 3–6 CJK
   characters left two thirds of the row empty, an indexed list fills it and
   matches the editorial numeral used elsewhere on the site.
   Multi-column, not a 2-column grid: a grid leaves the last row ragged (an odd
   count puts item 05 alone with a half-width rule under it), while columns
   balance 5 items as 3 + 2 and the rules end evenly. */
.doctor-spec-list {
  list-style: none; margin: 0; padding: 0;
  columns: 2; column-gap: clamp(var(--space-6), 3vw, var(--space-10));
}
.doctor-spec-list li {
  display: flex; align-items: baseline; gap: var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--text-base); color: var(--text); line-height: 1.6;
  break-inside: avoid;
}
.doctor-spec-idx {
  flex: 0 0 auto;
  font-family: var(--font-display); font-size: var(--text-sm);
  color: var(--gold-strong); letter-spacing: .1em;
  font-variant-numeric: tabular-nums lining-nums;
}

/* credentials keep the ◆ + hairline rhythm of the shared list; two columns only
   when there are enough items (a split 2-item list would leave a hole) */
.doc-creds--two { columns: 2; column-gap: clamp(var(--space-6), 3vw, var(--space-10)); }
.doc-creds--two li { break-inside: avoid; }
.doctor-fact .doc-creds { margin-top: 0; }
/* one notch up from the shared list: inside the spec sheet the credentials sit
   beside 1rem specialty rows and a 14px list read as fine print */
.doctor-fact .doc-creds li { font-size: .9375rem; line-height: 1.75; }

/* closing row: the page has a bottom edge and a next step instead of trailing
   off into a lone back link right above the footer */
.doctor-endcap {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-5); flex-wrap: wrap;
  margin-top: clamp(var(--space-7), 3.2vw, var(--space-10));
  padding-top: clamp(var(--space-5), 2.4vw, var(--space-7));
  border-top: 1px solid var(--line);
}
.doctor-back {
  display: inline-flex; align-items: center; gap: var(--space-2);
  color: var(--gold-strong); font-size: var(--text-sm); letter-spacing: .06em;
  text-decoration: none; border-bottom: 1px solid transparent;
  transition: color .2s, border-color .2s, gap .2s;
}
.doctor-back:hover { color: var(--gold); border-bottom-color: var(--gold); gap: var(--space-3); }
.doctor-back:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.doctor-endcap .btn { margin: 0; }

/* Below 980px the portrait column would squeeze the value column under ~380px,
   so the portrait drops to 240px first, then (860px) the spread stacks: portrait,
   then the sheet at full width. */
@media (max-width: 1200px) {
  /* keep the var in step with the column, or the height cap above would be
     computed from a width that is no longer in use */
  .doctor-dossier { --portrait-w: clamp(200px, 21vw, 260px); }
}
@media (max-width: 860px) {
  .doctor-dossier,
  .doctor-dossier--text { grid-template-columns: minmax(0, 1fr); gap: var(--space-7); }
  /* stacked: the spread is one column now, so the portrait goes back to a fixed
     portrait ratio instead of stretching (there is nothing beside it to match) */
  .doctor-portrait { position: relative; align-self: start; max-width: 260px; aspect-ratio: 3 / 4; min-height: 0; }
  .doctor-fact { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
  .doctor-fact dt::after { margin-top: var(--space-2); }
  .doc-creds--two { columns: 1; }
  .doctor-spec-list { columns: 1; }
  .doctor-bio, .doctor-bio--brief.detail-body, .doctor-bio--long.detail-body { max-width: 100%; }
}
@media (max-width: 720px) {
  .doctor-portrait { max-width: 220px; }
  .doctor-endcap { justify-content: flex-start; }
}

/* Article-embedded language gallery (hammock graphical abstract).
   The rich-text editor may strip the wrapper class on later edits; plain
   <figure> children stay readable and simply stack in that case. */
.detail-body .article-lang-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: var(--space-5);
  margin: var(--space-8) 0;
}
.detail-body .article-lang-gallery figure {
  margin: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: none;
}
.detail-body .article-lang-gallery img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
}
.detail-body .article-lang-gallery figcaption {
  padding: var(--space-3) var(--space-4);
  font-size: 13px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* ── Enhanced long-form article rendering (shared by both CMS instances) ──
   These styles deliberately target only tags that the admin rich-text editor
   already produces (headings, paragraphs, lists, images, tables, quotes,
   code). theory/about content can therefore live as ordinary articles and
   still read like an editorial page — no per-page template and no extra
   editor build is required to get a card grid or a spec table. */
.detail-body > p.lead {
  font-size: 1.25rem; color: var(--ink); line-height: 1.9;
  margin-bottom: var(--space-5);
}
.detail-body table {
  width: 100%; margin: var(--space-8) 0;
  border-collapse: separate; border-spacing: 0;
  border: 1px solid var(--line); border-radius: var(--radius-md);
  overflow: hidden; background: var(--surface);
  font-size: var(--text-sm); line-height: 1.7;
}
.detail-body table th, .detail-body table td {
  padding: var(--space-4); text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.detail-body table th {
  font-family: var(--font-display); color: var(--ink);
  background: var(--surface); font-weight: 500;
}
.detail-body table tr:last-child > td { border-bottom: 0; }
/* Two-column tables become a card sheet: image on the left, text on the
   right. The image keeps a fixed ratio so a long description cannot stretch
   the row into an unstable height. */
.detail-body table td img {
  margin: 0; box-shadow: none; border-radius: var(--radius-md);
  aspect-ratio: 4 / 3; object-fit: cover;
}
.detail-body table td h3 {
  margin: 0 0 var(--space-3); padding: 0; border: 0;
  font-size: 1.15rem; color: var(--ink);
}
.detail-body table td p { margin: 0 0 var(--space-3); font-size: var(--text-sm); }
/* Image caption without a custom class: an italic paragraph immediately
   after an image paragraph is read as the figure caption. */
.detail-body p:has(> img) { margin: var(--space-8) 0 0; }
.detail-body p:has(> img) + p > em {
  display: block; margin: var(--space-3) 0 var(--space-8);
  text-align: center; font-style: normal;
  font-size: var(--text-sm); color: var(--text-muted);
}
.detail-body hr {
  border: 0; border-top: 1px solid var(--line);
  margin: var(--space-10) 0;
}
.detail-body pre {
  margin: var(--space-8) 0; padding: var(--space-5);
  border: 1px solid var(--line); border-left: 2px solid var(--gold);
  border-radius: var(--radius-md); background: var(--surface);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: var(--text-sm); line-height: 1.6; overflow-x: auto;
}
.detail-body code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: .92em; padding: .1em .35em;
  border-radius: 4px; background: var(--surface);
}
@media (max-width: 720px) {
  .detail-body table th, .detail-body table td {
    padding: var(--space-3); font-size: var(--text-sm);
  }
  .detail-body table td img { aspect-ratio: 16 / 9; }
}

/* ── Long-form article table of contents ────────────────────────────────
   Shared by both CMS instances. Rendered only when the body has 2+ section
   headings (see _article_outline in views/pages.py). A sticky horizontal
   strip sits just under the header; h3 entries are indented as sub-items.
   Anchors use the position-derived #sec-N ids so re-ordering cannot leave a
   stale link. `scroll-margin-top` keeps a jumped-to heading clear of the
   sticky header + TOC strip. */
.article-toc {
  position: sticky; top: var(--header-h, 76px); z-index: 20;
  max-width: 100%; margin: 0 0 var(--space-8);
  padding: var(--space-4) var(--space-5);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-soft);
}
.article-toc-label {
  display: block; font-family: var(--font-display); color: var(--gold-strong);
  font-size: var(--text-sm); font-weight: 600; letter-spacing: .12em;
  margin-bottom: var(--space-3);
}
.article-toc-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5);
}
.article-toc-item--h3 { margin-left: var(--space-5); }
.article-toc-link {
  display: inline-block; padding: 2px 0; color: var(--text-muted);
  font-size: var(--text-sm); text-decoration: none;
  border-bottom: 1px solid transparent; transition: color .2s, border-color .2s;
}
.article-toc-link:hover, .article-toc-link:focus-visible {
  color: var(--gold-strong); border-bottom-color: var(--gold); outline: none;
}
.detail-body h2[id], .detail-body h3[id] { scroll-margin-top: calc(var(--header-h, 76px) + 96px); }
@media (max-width: 720px) {
  .article-toc { top: var(--header-h-compact, 60px); padding: var(--space-3) var(--space-4); }
  .article-toc-list { gap: var(--space-2) var(--space-4); }
  .article-toc-item--h3 { margin-left: var(--space-3); }
}

/* ── Rich callout cards in article bodies ───────────────────────────────
   Editors insert a labelled note (核心方程式 / 对应治疗 / 三阶段顺序) as a
   <div class="doc-callout"><p class="doc-callout-label">…</p>…</div>.
   Degrades gracefully: without the class it is just a normal div. */
.detail-body .doc-callout {
  margin: var(--space-8) 0; padding: clamp(var(--space-5), 3vw, var(--space-8));
  background: var(--surface); border: 1px solid var(--line);
  border-left: 2px solid var(--gold); border-radius: var(--radius-md);
}
.detail-body .doc-callout-label {
  margin: 0 0 var(--space-4) !important; font-family: var(--font-display);
  color: var(--gold-strong) !important; font-size: var(--text-sm); font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
}
.detail-body .doc-callout > :last-child { margin-bottom: 0; }

/* Card grid: editors build a row of cards as a single table whose cells each
   hold an image + heading + paragraph. Those tables render as a card sheet
   above; when a label row is wanted, an .article-card-grid wrapper adds gutters
   and makes each cell an independent white card. */
.detail-body .article-card-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: var(--space-5); margin: var(--space-8) 0;
}
.detail-body .article-card-grid figure {
  margin: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-md); overflow: hidden; box-shadow: none;
}
.detail-body .article-card-grid figcaption {
  padding: var(--space-4); font-size: var(--text-sm); color: var(--text);
  line-height: 1.6;
}
.detail-body .article-card-grid figcaption strong {
  display: block; color: var(--ink); font-family: var(--font-display);
  font-size: 1.05rem; margin-bottom: var(--space-2);
}

/* Formula / equation block: a centred callout with tabular numerals so a long
   equation reads as one deliberate line rather than a stray code fragment. */
.detail-body .doc-formula {
  margin: var(--space-8) 0; padding: var(--space-6);
  background: var(--surface); border-top: 1px solid var(--gold-soft);
  border-bottom: 1px solid var(--gold-soft);
  text-align: center; font-family: var(--font-display); color: var(--ink);
  font-size: 1.25rem; line-height: 1.9; font-variant-numeric: tabular-nums;
}
.detail-body .doc-formula .op { color: var(--gold-strong); font-weight: 600; padding: 0 .3em; }
.detail-body .doc-formula .hint {
  display: block; margin-top: var(--space-3); font-family: var(--font-sans);
  font-size: var(--text-sm); color: var(--text-muted);
}

/* Article gallery image lightbox: click a 9-language thumbnail to inspect the
   original. Injected by site.js::initArticleImageLightbox; scoped so no other
   image on the site is affected. Theme-agnostic via existing tokens. */
.detail-body .article-lang-gallery figure.is-zoomable {
  cursor: zoom-in;
  transition: box-shadow .15s, transform .15s;
}
.detail-body .article-lang-gallery figure.is-zoomable:hover,
.detail-body .article-lang-gallery figure.is-zoomable:focus-visible {
  box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
  transform: translateY(-2px);
  outline: 2px solid var(--gold-strong, var(--accent, #A8843E));
  outline-offset: 2px;
}
.img-lightbox {
  display: none; position: fixed; inset: 0; z-index: 3000;
  align-items: center; justify-content: center; padding: 4vh 4vw;
  background: rgba(12, 14, 18, .92);
}
.img-lightbox.is-open { display: flex; animation: imgLbFade .2s ease; }
@keyframes imgLbFade { from { opacity: 0; } to { opacity: 1; } }
.img-lightbox-card {
  margin: 0; max-width: min(96vw, 1600px); max-height: 92vh;
  display: flex; flex-direction: column; align-items: center; gap: var(--space-3);
}
.img-lightbox-card img {
  max-width: 100%; max-height: 82vh; width: auto; height: auto;
  object-fit: contain; border-radius: 4px; background: #fff;
  box-shadow: 0 12px 48px rgba(0, 0, 0, .5);
}
.img-lightbox-card figcaption {
  color: #fff; font-size: var(--text-sm); text-align: center;
  max-width: 90vw; line-height: 1.6;
}
.img-lightbox-close {
  position: absolute; top: 2.5vh; right: 3vw; z-index: 1;
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .12); color: #fff;
  font-size: 28px; line-height: 44px; text-align: center; cursor: pointer;
  transition: background .15s;
}
.img-lightbox-close:hover, .img-lightbox-close:focus-visible {
  background: rgba(255, 255, 255, .28); outline: 2px solid #fff; outline-offset: 2px;
}
@media (max-width: 600px) {
  .img-lightbox { padding: 3vh 3vw; }
  .img-lightbox-card img { max-height: 74vh; }
}

/* Core-paper cover is a portrait journal cover; the generic table img rule
   crops it to 16/9 and hides the WILEY masthead. Show this one in full. */
.detail-body table td img[src*="3c213d37"] {
  width: auto; max-width: 100%; height: auto;
  aspect-ratio: auto; object-fit: contain;
  margin: 0 auto;
}

/* ===== components/footer.css ===== */
/* Footer (plan B6.2 + 亮色重排). Light porcelain ground, ink text, gold accents.
   Four columns: brand · navigation · contact · follow (social + QR). Every value
   is driven by backend settings — site.name, logo, footer text, phone/email/
   address, the social links and QR codes, and the ICP/police filing numbers. */

.site-footer {
  position: relative; z-index: 1;
  background: var(--surface);
  color: var(--text);
  padding: clamp(var(--space-10), 6vw, var(--space-14)) var(--gutter) var(--space-8);
  border-top: 1px solid var(--line);
}
/* a slim gold crown so the footer still reads as a deliberate brand edge on the
   light ground (request §4 — "高端感") */
.site-footer::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-soft) 50%, var(--gold) 100%);
}
.site-footer a { color: var(--text-muted); text-decoration: none; transition: color .15s; }
.site-footer a:hover { color: var(--gold-strong); }

.footer-inner {
  max-width: var(--container); margin: 0 auto;
  display: grid; grid-template-columns: 1.5fr 1fr 1.3fr;
  gap: var(--space-8) 0; align-items: stretch;
}
/* 每列等高拉伸：分隔线等高，整组读起来像一张规整的栅格而非错位块 */
.footer-col { display: flex; flex-direction: column; }
/* 品牌列右侧、各内容列之间用金色细线分隔，错落的高度因此显得是「有意为之」 */
.footer-nav-col,
.footer-contact { padding-left: var(--space-8); border-left: 1px solid var(--line); }
.footer-col h4 {
  font-weight: 600; color: var(--ink);
  font-size: var(--text-sm); letter-spacing: .14em; text-transform: uppercase;
  margin: 0 0 var(--space-4); padding-bottom: var(--space-3);
  position: relative;
}
/* 列标题统一加一道金色短规，强化品牌一致性与整齐感 */
.footer-col h4::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 28px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold-soft));
}
.footer-col nav { display: flex; flex-direction: column; gap: var(--space-3); }
/* Two-column navigation once there are enough entries to make a single tall
   column look sparse (this site ships 7). Flows left→right; links never split
   across columns (request §2). */
.footer-col nav.footer-nav-cols {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--space-5); row-gap: var(--space-3);
}
.footer-col nav.footer-nav-cols a { break-inside: avoid; }

/* 品牌列 = 身份块(logo+标语) + 连接集群(二维码/关注)。竖向堆叠，
   连接内容紧贴标语下方，彻底填掉原左侧空白（截图反馈）。 */
.footer-brand { display: flex; flex-direction: column; gap: var(--space-6); }
.footer-brand .footer-logo {
  height: 44px; width: auto; max-width: 200px; object-fit: contain;
  margin-bottom: var(--space-4);
}
/* Text wordmark used when no image logo is configured (no ROYALTY wordmark on
   the theory site). The footer is a LIGHT porcelain ground (--surface), so this
   must use the dark ink — on-dark text would be invisible here. */
.footer-brand .footer-brand-text {
  display: block; font-family: var(--font-display); font-weight: 600;
  font-size: 1.6rem; color: var(--ink);
  letter-spacing: .04em; margin-bottom: var(--space-4);
}
/* 品牌列「标题」即 logo，下方加一道与列标题一致的金色短规，三栏装饰对齐 */
.footer-brand-rule {
  display: block; width: 28px; height: 2px; border-radius: 2px;
  margin: 0 0 var(--space-3);
  background: linear-gradient(90deg, var(--gold), var(--gold-soft));
}
.footer-brand .footer-tagline {
  color: var(--text-muted); font-size: var(--text-sm);
  line-height: 1.7; max-width: 30ch;
}
/* 连接集群：与身份块之间留白，内部二维码与关注两子块间距一致 */
.footer-connect { display: flex; flex-direction: column; gap: var(--space-5); }
.footer-connect-title {
  font-weight: 600; color: var(--ink);
  font-size: var(--text-sm); letter-spacing: .14em; text-transform: uppercase;
  margin: 0 0 var(--space-3); padding-bottom: var(--space-3);
  position: relative;
}
.footer-connect-title::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 28px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold-soft));
}

.footer-social { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: 0; }
.footer-social-link {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 32px; padding: 0 var(--space-3);
  border: 1px solid rgba(36, 30, 25, .14); border-radius: var(--radius-pill);
  color: var(--text); text-decoration: none; font-size: var(--text-sm);
  background: var(--bg);
  transition: color .15s, background .15s, border-color .15s, transform .15s var(--ease-out);
}
.footer-social-link:hover { color: var(--surface-dark); background: var(--gold); border-color: var(--gold); transform: translateY(-1px); }
.footer-social-link--muted { opacity: .5; cursor: default; }
.footer-social-link--muted:hover { color: var(--text); background: var(--bg); border-color: var(--line); transform: none; }

.footer-contact p { color: var(--text); font-size: var(--text-sm); line-height: 1.9; margin: 0 0 var(--space-2); }
.footer-contact a { color: var(--text); }
.footer-contact a:hover { color: var(--gold-strong); }
/* Shared by both booking modes: the dialog mode renders a <button>, the
   external mode an <a>. Keeping one unqualified selector means neither loses
   its styling (the .footer-contact a rule below stays the more specific one). */
.footer-booking,
.footer-contact a.footer-booking {
  display: inline-block; background: none; border: 0; padding: 0; cursor: pointer;
  margin-top: var(--space-2); text-decoration: none;
  font: inherit; font-size: var(--text-sm); font-weight: 600;
  color: var(--gold-strong);
  border-bottom: 1px solid var(--gold);
  transition: color .15s, border-color .15s;
}
.footer-booking:hover,
.footer-contact a.footer-booking:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* QR grid: lives inside the brand column's connect cluster, so it reads left-
   aligned with the logo/slogan above it (each tile still labels itself, so the
   old "扫码关注" strip heading stays dropped — request §3). */
.qr-grid { display: flex; flex-wrap: wrap; gap: var(--space-5); justify-content: flex-start; }
.qr-tile {
  background: none; border: none; padding: 0; cursor: zoom-in;
  display: flex; flex-direction: column; align-items: center; gap: var(--space-2);
  color: var(--text-muted); font-size: var(--text-xs); letter-spacing: .04em;
  font-family: inherit;
}
/* QR bumped from 88→120px so a phone can scan it on-site (request §3); labels
   widen to match. */
.qr-tile-frame {
  width: 120px; height: 120px; padding: 10px;
  background: var(--bg); border-radius: var(--radius-md);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out), border-color .2s;
}
.qr-tile:hover .qr-tile-frame { transform: translateY(-3px); box-shadow: var(--shadow-float); border-color: var(--gold); }
.qr-tile-frame img { width: 100%; height: 100%; object-fit: contain; }
/* two lines max, reserving both lines so every tile keeps the same height even
   when one label ("Booking mini-program") wraps */
.qr-tile-label {
  text-align: center; max-width: 120px; line-height: 1.35; min-height: 2.7em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-word;
}

/* lightbox */
.qr-lightbox {
  position: fixed; inset: 0; z-index: 90; display: none;
  align-items: center; justify-content: center; padding: var(--gutter);
  background: rgba(18,14,10,.86); backdrop-filter: blur(6px);
}
.qr-lightbox.is-open { display: flex; animation: lbFade .22s ease; }
@keyframes lbFade { from { opacity: 0; } to { opacity: 1; } }
.qr-lightbox-card {
  background: var(--surface); border-radius: var(--radius-lg); padding: var(--space-6);
  max-width: 380px; width: 100%; text-align: center; position: relative;
  box-shadow: var(--shadow-float);
}
.qr-lightbox-card img { width: 100%; max-width: 300px; margin: 0 auto; display: block; }
.qr-lightbox-title { color: var(--ink); font-family: var(--font-display); font-size: var(--text-lg); margin: var(--space-4) 0 0; }
.qr-lightbox-hint { color: var(--text-muted); font-size: var(--text-sm); margin: var(--space-2) 0 0; }
.qr-lightbox-close {
  position: absolute; top: var(--space-3); right: var(--space-3);
  width: 32px; height: 32px; border-radius: var(--radius-pill);
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  font-size: 1.1rem; line-height: 1; cursor: pointer;
}
.qr-lightbox-qr-hint { color: var(--text-muted); font-size: var(--text-xs); margin-top: var(--space-3); }

/* Bottom bar: copyright + filings sit centered together as one group, never
   split left/right (request §4). */
.footer-bottom {
  max-width: var(--container); margin: var(--space-10) auto 0;
  padding-top: var(--space-5); border-top: 1px solid var(--line);
  display: flex; justify-content: center; gap: var(--space-4);
  flex-wrap: wrap; align-items: center; text-align: center;
}
.footer-bottom .filings { justify-content: center; }
.footer-bottom .copyright { color: var(--text-muted); font-size: var(--text-sm); margin: 0; }
/* 备案信息：字号与版权行同级；深底上是金、浅底上用深铜色保证对比（≥4.5:1，
   过 WCAG AA）；悬停/键盘聚焦提亮并加下划线暗示可点。 */
.footer-bottom .filings {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: var(--space-2); margin: 0;
}
.footer-bottom .filing {
  color: var(--brand-strong); font-size: var(--text-sm);
  font-variant-numeric: tabular-nums; text-decoration: none; white-space: nowrap;
  border-bottom: 1px solid transparent;
  transition: color .15s, border-color .15s;
}
.footer-bottom .filing:hover,
.footer-bottom .filing:focus-visible {
  color: var(--gold-strong); border-bottom-color: var(--gold-strong);
}
.footer-bottom .filing-sep { color: var(--text-muted); font-size: var(--text-sm); }

@media (max-width: 1024px) and (min-width: 721px) {
  .footer-inner { grid-template-columns: 1fr 1fr; gap: var(--space-7) 48px; }
  /* 竖线分隔在堆叠时改为顶部横线：品牌身份条之下、链接行之上各一道 */
  .footer-nav-col,
  .footer-contact { padding-left: 0; border-left: none; border-top: 1px solid var(--line); padding-top: var(--space-7); }
  /* 品牌列横跨整行作为「身份条」：左 logo+标语，右 二维码/关注，避免单列过空 */
  .footer-brand { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap;
    justify-content: space-between; align-items: flex-start; gap: var(--space-7); }
  .footer-brand-id { flex: 1 1 260px; }
  .footer-connect { flex: 0 1 auto; margin-top: 0; }
}
@media (max-width: 720px) {
  .footer-inner { grid-template-columns: 1fr; gap: var(--space-7); }
  /* 手机：品牌列回归竖向堆叠，连接集群居中更具仪式感 */
  .footer-brand { flex-direction: column; grid-column: auto; }
  .footer-brand-id, .footer-connect { flex: 1 1 auto; width: 100%; }
  .footer-connect { align-items: center; text-align: center; }
  .footer-brand-rule { margin-left: auto; margin-right: auto; }
  .qr-grid { justify-content: center; }
  .footer-social { justify-content: center; }
  /* 单列下分隔线转顶部横线，块与块之间整齐分段（品牌块无上边框） */
  .footer-nav-col,
  .footer-contact { padding-left: 0; border-left: none; border-top: 1px solid var(--line); padding-top: var(--space-7); }
  /* single-column nav on phones — two columns get too tight for the labels */
  .footer-col nav.footer-nav-cols { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: center; text-align: center; }
  /* 窄屏两个备案号必然换行，此时行内分隔点会孤零零挂在行尾，改成竖排并去掉它 */
  .footer-bottom .filings { flex-direction: column; align-items: center; gap: var(--space-1); }
  .footer-bottom .filing-sep { display: none; }
  .qr-tile-frame { width: 104px; height: 104px; }
  .qr-tile-label { max-width: 104px; }
  /* 居中布局下金色短规也居中，保持标题装饰对称 */
  .footer-col h4::after, .footer-connect-title::after { left: 50%; transform: translateX(-50%); }
}

/* ===== components/booking.css ===== */
/* Booking entry points + dialog (《优化任务第二版.md》§5.5 / §5.6).
 *
 * One dialog, six entry points. The entries are deliberately quiet — a gold
   outline in the header, a small pill floating bottom-right, a text link in the
   footer — because a clinic site asks for a booking at six places, not shouts
   about it. */

/* ─── header entry ─────────────────────────────────────────────────────────── */
.header-booking {
  flex: none; margin-left: var(--space-3);
  padding: 9px 22px; border-radius: var(--radius-pill);
  border: 1px solid var(--gold); background: transparent;
  color: var(--gold-strong); font: inherit; font-size: var(--text-sm);
  font-weight: 600; letter-spacing: .12em; cursor: pointer; white-space: nowrap;
  text-decoration: none;
  transition: background .2s, color .2s, border-color .2s, transform .2s var(--ease-out);
}
.header-booking:hover { background: var(--gold); color: var(--surface-dark); transform: translateY(-1px); }
.site-header.is-transparent .header-booking { color: #fff; border-color: rgba(255,255,255,.55); }
.site-header.is-transparent .header-booking:hover { background: var(--gold-soft); color: var(--surface-dark); border-color: var(--gold-soft); }
.site-header.header-transparent.is-scrolled .header-booking { color: var(--gold-strong); border-color: var(--gold); }

/* ─── footer entry ─────────────────────────────────────────────────────────── */
/* Styled in components/footer.css (it owns the footer's light theme); keeping a
   second copy here loaded later and silently re-darkened it. */

/* ─── floating entry ───────────────────────────────────────────────────────── */
.booking-float {
  position: fixed; right: clamp(14px, 2vw, 26px); bottom: clamp(14px, 2vw, 26px);
  z-index: 60; display: none; align-items: center; gap: 7px;
  padding: 12px 20px; border: 0; border-radius: var(--radius-pill);
  background: var(--gold-gradient-strong); color: var(--surface-dark);
  font: inherit; font-size: var(--text-sm); font-weight: 600; letter-spacing: .1em;
  box-shadow: 0 12px 28px rgba(16,24,28,.35); cursor: pointer;
  transition: transform .2s var(--ease-out), box-shadow .2s;
}
.booking-float span { font-size: 8px; opacity: .7; }
.booking-float:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(16,24,28,.42); }
/* shown where the header entry is not (spec §5.5) */
@media (max-width: 860px) {
  .header-booking { display: none; }
  .booking-float { display: inline-flex; }
}

/* ─── dialog ───────────────────────────────────────────────────────────────── */
.booking {
  position: fixed; inset: 0; z-index: 100;
  display: none; align-items: center; justify-content: center;
  padding: var(--gutter);
}
.booking.is-open { display: flex; }
.booking-backdrop {
  position: absolute; inset: 0;
  background: rgba(22, 18, 14, .55);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  animation: bookingFade .22s var(--ease-out);
}
.booking-panel {
  position: relative; width: min(460px, 100%);
  max-height: min(92vh, 760px);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float);
  animation: bookingRise .28s var(--ease-out);
}
@keyframes bookingFade { from { opacity: 0; } }
@keyframes bookingRise { from { opacity: 0; transform: translateY(14px); } }
body.booking-open { overflow: hidden; }

/* The `hidden` attribute is only `display:none` in the UA sheet, so any
   component rule with a `display` value silently beats it — that is how the tab
   bar stayed visible on the success screen. Scope the guard to this component. */
.booking [hidden] { display: none !important; }

.booking-head {
  display: flex; align-items: center; justify-content: space-between;
  flex: none;
  gap: var(--space-4); padding: var(--space-5) var(--space-5) var(--space-3);
}
.booking-head h2 {
  margin: 0; font-family: var(--font-display); font-size: 1.5rem;
  letter-spacing: .04em; color: var(--ink);
}
.booking-close {
  width: 34px; height: 34px; flex: none; border-radius: 50%;
  border: 1px solid var(--line); background: transparent;
  color: var(--text-muted); font-size: 20px; line-height: 1; cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.booking-close:hover { border-color: var(--gold); color: var(--gold-strong); background: var(--surface); }

/* tabs */
.booking-tabs {
  display: flex; gap: var(--space-6); padding: 0 var(--space-5);
  flex: none;
  border-bottom: 1px solid var(--line); background: var(--bg);
}
.booking-tab {
  position: relative; padding: var(--space-3) 0; border: 0; background: none;
  font: inherit; font-size: var(--text-sm); font-weight: 600; letter-spacing: .08em;
  color: var(--text-muted); cursor: pointer;
}
.booking-tab::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: transparent; transition: background .2s;
}
.booking-tab.is-active { color: var(--gold-strong); }
.booking-tab.is-active::after { background: var(--gold); }

.booking-body { padding: var(--space-5); overflow-y: auto; flex: 1; }

/* form */
.booking form { display: grid; gap: var(--space-3); }
.booking-hp {
  position: absolute; left: -9999px; width: 1px; height: 1px;
  opacity: 0; pointer-events: none;
}
.bf-field { display: grid; gap: 6px; }
.bf-label {
  font-size: var(--text-xs); letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 600;
}
.bf-label i { color: var(--gold); font-style: normal; margin-left: 3px; }
.bf-field input, .bf-field select, .bf-field textarea {
  width: 100%; padding: 10px 13px; font: inherit; font-size: var(--text-base);
  color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-md);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.bf-field textarea { resize: vertical; min-height: 64px; line-height: 1.7; }
.bf-field input:focus, .bf-field select:focus, .bf-field textarea:focus {
  outline: none; border-color: var(--gold); background: var(--bg);
  box-shadow: 0 0 0 3px rgba(16,32,31,.12);
}
.bf-field.has-error input, .bf-field.has-error select, .bf-field.has-error textarea {
  border-color: #B4483C; background: #FDF7F6;
}
.bf-error { font-size: var(--text-xs); color: #B4483C; min-height: 0; }
.bf-error:empty { display: none; }

.booking-alert {
  margin-bottom: var(--space-4); padding: 10px 14px;
  border-radius: var(--radius-md); font-size: var(--text-sm);
  background: #FDF2F0; border: 1px solid #EFCFC9; color: #9C3A2E;
}
.booking-submit { width: 100%; justify-content: center; margin-top: var(--space-2); }
.booking-submit[disabled] { opacity: .65; cursor: progress; transform: none; }
.booking-consent {
  margin: 0; text-align: center; font-size: var(--text-xs);
  color: var(--text-muted); letter-spacing: .02em;
}

/* QR tab */
.booking-qr { text-align: center; display: grid; gap: var(--space-4); justify-items: center; }
.booking-qr img {
  width: 180px; height: 180px; object-fit: contain; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-2);
}
.booking-qr p { margin: 0; color: var(--text-muted); font-size: var(--text-sm); }
.booking-qr-empty {
  margin: 0; text-align: center; color: var(--text-muted);
  font-size: var(--text-sm); line-height: 1.9; padding: var(--space-6) 0;
}
.booking-qr-empty a { color: var(--gold-strong); }

/* success state replaces the form content (spec §5.6) */
.booking-done {
  display: grid; gap: var(--space-4); justify-items: center;
  padding: var(--space-10) var(--space-6) var(--space-12); text-align: center;
}
.booking-done[hidden] { display: none; }
.booking-done-mark {
  width: 54px; height: 54px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--gold-soft); color: var(--gold-strong); font-size: 26px;
}
.booking-done p { margin: 0; color: var(--text); line-height: 1.9; max-width: 28ch; }

/* Mobile: full screen, tabs pinned to the top, submit pinned to the bottom */
@media (max-width: 640px) {
  .booking { padding: 0; }
  .booking-panel {
    width: 100%; height: 100%; max-height: none;
    border-radius: 0; border: 0; display: flex; flex-direction: column;
    overflow: hidden;
  }
  .booking-head { flex: none; padding: var(--space-5) var(--space-5) var(--space-2); }
  .booking-tabs { flex: none; }
  .booking-body { flex: 1; overflow-y: auto; padding: var(--space-5); }
  /* the submit stays reachable while the fields scroll under it; `sticky` inside
     the body's own scroller does this without a fixed overlay fighting the
     keyboard on mobile Safari */
  .booking-submit {
    position: sticky; bottom: 0; z-index: 3;
    box-shadow: 0 -10px 22px var(--bg), 0 12px 30px rgba(16,24,28,.28);
  }
  .booking-done { padding: var(--space-12) var(--space-5); }
}

@media (prefers-reduced-motion: reduce) {
  .booking-backdrop, .booking-panel { animation: none; }
  .booking-float:hover, .header-booking:hover { transform: none; }
}

/* ===== components/map.css ===== */
/* ─────────────────────────────────────────────────────────────────────────────
 * Clinic atlas — light full-world redesign (2026-11-25)
 *
 * The map is a quiet, conventional cartographic sheet: pale blue-grey sea,
 * warm-grey land, hairline coast, light graticule. It deliberately matches the
 * porcelain site rather than fighting it. Deep blue is no longer used at all.
 *
 * All clinics are peers — no flagship pin, no arcs, no default selection — and
 * every pin label is visible. The SVG viewBox is the zoom state; wheel, drag,
 * double-click and the control buttons all operate on it.
 * ───────────────────────────────────────────────────────────────────────────── */

.clinic-section {
  padding-top: clamp(var(--space-8), 4vw, var(--space-12));
  padding-bottom: clamp(var(--space-8), 4vw, var(--space-12));
}
.clinic-stage {
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 2.2vw, 30px);
  max-width: var(--container-wide);
  margin: 0 auto;
}
/* Directory reads first as a horizontal strip; the atlas gets the full width
   underneath instead of being squeezed into a sidebar-sized window. */
.clinic-panel { order: 1; }
.atlas-card { order: 2; }

/* ── atlas card ───────────────────────────────────────────────────────────── */
.atlas-card {
  min-width: 0; overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
}
.map-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--space-5); flex-wrap: wrap;
  padding: 22px 28px 18px;
  border-bottom: 1px solid var(--line);
}
.map-eyebrow {
  display: block; margin-bottom: 6px;
  font-family: var(--font-display); font-size: .66rem;
  letter-spacing: .28em; color: var(--text-muted);
}
.map-title {
  margin: 0; font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.4rem, 2vw, 1.85rem); line-height: 1.2;
  color: var(--ink);
}
.map-summary {
  display: flex; align-items: baseline; gap: 8px; white-space: nowrap;
  padding-left: 20px; border-left: 1px solid var(--line);
}
.map-summary strong {
  font-family: var(--font-display); font-size: 2rem; font-weight: 500;
  color: var(--gold-strong); font-variant-numeric: tabular-nums;
}
.map-summary span { font-size: .74rem; letter-spacing: .12em; color: var(--text-muted); }

.map-stage {
  position: relative;
  height: clamp(420px, 46vw, 680px);
  background: #EFF4F6;
  cursor: grab;
  outline: none;
  touch-action: none;
}
.map-stage.is-dragging { cursor: grabbing; }
.map-stage:focus-visible { box-shadow: inset 0 0 0 2px var(--gold-strong); }
.worldmap {
  position: absolute; inset: 0; display: block;
  width: 100%; height: 100%;
}
.map-sea { fill: #EFF4F6; }
.map-geo .land path {
  fill: #DCE5E8; stroke: #B9C8CD; stroke-width: .9;
  stroke-linejoin: round; vector-effect: non-scaling-stroke;
}
.graticule line {
  stroke: #CFDCE0; stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.atlas-corner {
  fill: none; stroke: #B5C5CA; stroke-width: 1; opacity: .7;
  vector-effect: non-scaling-stroke;
}
.atlas-compass circle { fill: rgba(255,255,255,.82); stroke: #B5C5CA; stroke-width: 1; }
.atlas-compass path { fill: #7C9199; }
.atlas-compass text {
  fill: #7C9199; font-family: var(--font-display);
  font-size: 12px; text-anchor: middle; letter-spacing: .1em;
}

/* ── pins: every clinic is equal and named by default ────────────────────── */
.pin { cursor: pointer; outline: none; visibility: hidden; }
.pin.is-positioned { visibility: visible; }
.pin-halo {
  fill: #5E7780; opacity: .08;
  transform-box: fill-box; transform-origin: center;
}
.pin-ring {
  fill: none; stroke: #8AA0A6; stroke-width: 1; opacity: .45;
  vector-effect: non-scaling-stroke; transition: opacity .18s, stroke-width .18s;
}
.pin-dot {
  fill: #FFFFFF; stroke: #4A5F67; stroke-width: 2.2;
  vector-effect: non-scaling-stroke; transition: stroke-width .18s;
}
.pin-num {
  font-family: var(--font-display); font-size: 13px; font-weight: 600;
  text-anchor: middle; fill: #33474F; pointer-events: none;
  font-variant-numeric: tabular-nums;
}
.pin-leader {
  stroke: #87999F; stroke-width: 1;
  vector-effect: non-scaling-stroke; opacity: .75;
}
.pin-label {
  font-family: var(--font-family-body, var(--font-display));
  font-size: 13px; font-weight: 600;
  fill: #2E3A40; text-anchor: middle; pointer-events: none;
  paint-order: stroke; stroke: #FFFFFF; stroke-width: 4px;
  stroke-linejoin: round;
}
.pin-label.align-start { text-anchor: start; }
.pin-label.align-end { text-anchor: end; }
.pin.is-outside { opacity: .28; }
.pin.is-active .pin-dot { stroke-width: 3; }
.pin.is-active .pin-ring { opacity: .95; }
.pin.is-active .pin-label { fill: var(--gold-strong); }
.pin:focus-visible .pin-ring { opacity: 1; stroke-width: 2.4; }
.pin:focus-visible .pin-label { fill: var(--gold-strong); }

/* ── zoom controls + readout ─────────────────────────────────────────────── */
.map-controls {
  position: absolute; right: 18px; bottom: 18px;
  display: flex; align-items: center; gap: 6px;
  padding: 6px; border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 6px 18px rgba(22, 42, 50, .08);
}
.map-controls button {
  width: 30px; height: 30px; padding: 0;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--bg); color: var(--ink);
  font: inherit; font-size: 1rem; line-height: 1; cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.map-controls button:hover { border-color: var(--gold); color: var(--gold-strong); }
.map-controls button:focus-visible {
  outline: 2px solid var(--gold-strong); outline-offset: 2px;
}
.zoom-level {
  min-width: 44px; text-align: center;
  font-size: .68rem; color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.map-readout {
  position: absolute; left: 18px; bottom: 18px;
  display: flex; align-items: center; gap: 12px;
  max-width: min(400px, calc(100% - 190px));
  padding: 10px 16px 10px 10px;
  border: 1px solid var(--line); border-radius: 12px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 6px 18px rgba(22, 42, 50, .08);
}
.readout-index {
  flex: none; font-family: var(--font-display); font-size: 1.25rem;
  color: var(--gold-strong); font-variant-numeric: tabular-nums;
}
.readout-body { min-width: 0; display: grid; gap: 3px; }
.readout-body strong {
  font-family: var(--font-display); font-size: .95rem; font-weight: 600;
  color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.readout-body small {
  font-size: .68rem; letter-spacing: .02em; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.map-legend {
  display: flex; flex-wrap: wrap; gap: 10px 24px;
  padding: 13px 28px; border-top: 1px solid var(--line);
  background: var(--surface);
}
.legend-item {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .72rem; letter-spacing: .04em; color: var(--text-muted);
  white-space: nowrap;
}
.legend-item .dot {
  width: 10px; height: 10px; border-radius: 50%; flex: none;
  background: #FFFFFF; border: 2px solid #4A5F67;
}
.legend-item .dash {
  width: 22px; height: 0; flex: none; border-top: 1px solid #CFDCE0;
}
.legend-note { margin-left: auto; }

/* ── directory panel (unchanged interaction, theme-gold accents only) ────── */
.clinic-panel {
  display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}
.panel-head {
  flex: none; padding: 18px 22px 14px;
  display: flex; align-items: center; gap: 14px 24px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
}
.panel-title-row { flex: none; }
.panel-title { margin-bottom: 0; }
.clinic-search { flex: 1 1 260px; max-width: 420px; }
.region-filters { flex: 1 1 auto; margin-top: 0; }
.panel-foot {
  flex: 1 1 100%; display: flex; align-items: center;
  justify-content: space-between; gap: 12px;
}
.panel-eyebrow {
  display: block; font-family: var(--font-display); font-size: .64rem;
  letter-spacing: .24em; color: var(--text-muted);
}
.panel-title {
  margin: 5px 0 16px; font-family: var(--font-display);
  font-size: 1.32rem; font-weight: 600; line-height: 1.2; color: var(--ink);
}
.clinic-search { position: relative; display: block; }
.search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; fill: none; stroke: var(--text-muted);
  stroke-width: 1.8; stroke-linecap: round; pointer-events: none;
}
.clinic-search input {
  width: 100%; height: 42px; padding: 0 14px 0 40px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--ink);
  font: inherit; font-size: .84rem; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.clinic-search input::placeholder { color: var(--text-muted); }
.clinic-search input:focus {
  border-color: var(--gold-strong); box-shadow: 0 0 0 3px var(--gold-soft);
}
.region-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.region-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg); color: var(--text-muted);
  font: inherit; font-size: .72rem; cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.region-chip span { font-variant-numeric: tabular-nums; opacity: .72; }
.region-chip:hover { border-color: var(--gold); color: var(--ink); }
.region-chip.is-active {
  background: var(--gold-strong); border-color: var(--gold-strong);
  color: #FFFFFF;
}
.panel-status {
  flex: 1 1 auto; min-height: 1em; margin: 0;
  font-size: .72rem; color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
/* Sideways browsing: all matching clinics stay in the DOM and are reachable
   by scrolling the strip; the arrows simply make that affordance unmistakable. */
.strip-nav { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.strip-btn {
  width: 32px; height: 32px; padding: 0;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--bg); color: var(--ink);
  font: inherit; font-size: 1.3rem; line-height: 1; cursor: pointer;
  transition: border-color .15s, color .15s, opacity .15s;
}
.strip-btn:hover:not(:disabled) { border-color: var(--gold); color: var(--gold-strong); }
.strip-btn:disabled { opacity: .35; cursor: not-allowed; }
.strip-btn:focus-visible { outline: 2px solid var(--gold-strong); outline-offset: 2px; }

.clinic-list {
  flex: none; display: flex; align-items: flex-start; gap: 10px;
  list-style: none; margin: 0; padding: 12px 14px 16px;
  overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin;
  scroll-snap-type: x proximity; scroll-behavior: smooth;
  outline: none;
}
.clinic-list:focus-visible { box-shadow: inset 0 0 0 2px var(--gold-soft); }
.clinic-row[hidden] { display: none !important; }
.clinic-row {
  position: relative; flex: 0 0 clamp(272px, 23vw, 336px); min-width: 0;
  scroll-snap-align: start;
  padding: 12px 14px 12px 12px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg);
  cursor: pointer; outline: none;
  transition: background .15s, box-shadow .15s, border-color .15s;
}
.clinic-row::before {
  content: ""; position: absolute; left: 0; top: 12px; bottom: 12px;
  width: 3px; border-radius: 3px; background: transparent;
  transition: background .15s;
}
.clinic-row:hover, .clinic-row.is-hover {
  background: color-mix(in srgb, var(--gold-soft) 45%, var(--bg));
}
.clinic-row.is-active {
  background: color-mix(in srgb, var(--gold-soft) 70%, var(--bg));
  border-color: var(--gold);
}
.clinic-row.is-active::before { background: var(--gold-strong); }
.clinic-row:focus-visible { box-shadow: inset 0 0 0 2px var(--gold-strong); }

.cr-main { display: flex; gap: 12px; min-width: 0; }
.cr-index {
  flex: none; width: 30px; padding-top: 2px;
  font-family: var(--font-display); font-size: .9rem; font-weight: 600;
  color: var(--text-muted); font-variant-numeric: tabular-nums;
}
.cr-identity { flex: 1; min-width: 0; }
.cr-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.cr-name {
  margin: 0; max-width: 100%;
  font-family: var(--font-display); font-size: 1rem; font-weight: 600;
  line-height: 1.3; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cr-status {
  font-size: .62rem; letter-spacing: .12em; color: var(--gold-strong);
  white-space: nowrap;
}
.cr-meta {
  margin: 4px 0 0; font-size: .7rem; letter-spacing: .02em;
  color: var(--text-muted); font-variant-numeric: tabular-nums;
}
.cr-address {
  margin: 4px 0 0; font-size: .76rem; line-height: 1.55; color: var(--text);
  overflow-wrap: anywhere;
}
.cr-details { display: none; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.clinic-row.is-active .cr-details { display: grid; gap: 4px; }
.cr-line { display: flex; gap: 10px; font-size: .75rem; line-height: 1.5; }
.cr-line .lbl { flex: none; min-width: 2.8em; font-size: .66rem; color: var(--text-muted); }
.cr-line .val { color: var(--text); font-variant-numeric: tabular-nums; }
.cr-line a { color: inherit; text-decoration: none; }
.cr-line a:hover { color: var(--gold-strong); }
.cr-actions {
  display: none; gap: 8px; flex-wrap: wrap;
  margin-top: 12px; padding-left: 42px;
}
.clinic-row.is-active .cr-actions, .clinic-row:focus-within .cr-actions { display: flex; }
.cr-actions .btn-sm { padding: 7px 14px; font-size: .76rem; }

.panel-empty {
  display: grid; gap: 6px; padding: 36px 20px; text-align: center;
  color: var(--text-muted);
}
.panel-empty[hidden] { display: none; }
.panel-empty strong { font-family: var(--font-display); font-size: 1rem; color: var(--ink); }
.panel-empty span { font-size: .76rem; }

.region-chip:focus-visible, .clinic-search input:focus-visible {
  outline: 2px solid var(--gold-strong); outline-offset: 2px;
}

/* ── responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 980px) {
  .clinic-stage { max-width: var(--container); }
  .map-stage { height: clamp(340px, 58vw, 520px); }
}
@media (max-width: 600px) {
  .map-head { padding: 18px 18px 14px; }
  .map-summary { padding-left: 14px; }
  .map-summary strong { font-size: 1.7rem; }
  .map-stage { height: 320px; }
  .map-readout { left: 12px; bottom: 12px; max-width: calc(100% - 150px); }
  .map-controls { right: 12px; bottom: 12px; }
  .map-legend { padding: 12px 16px; }
  .legend-note { margin-left: 0; }
  .panel-head { padding: 18px 16px 14px; }
  .clinic-list { padding: 12px 12px 16px; }
  .clinic-row { flex-basis: min(84vw, 320px); }
  .cr-actions { padding-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .pin-ring, .pin-dot, .clinic-row { transition: none; }
}

/* ===== components/ambient.css ===== */
/* Hero signature decoration only. The page-wide gold line texture now lives as a
   per-section background (`::before` in layout.css), so it sits behind the copy
   instead of floating over it. This file keeps just the hero's own self-drawing
   facial contour. Purely decorative, non-interactive. */

.hero-decor { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.hero-face {
  position: absolute; right: -2%; top: 50%; transform: translateY(-50%);
  height: 92%; width: auto; opacity: .22; color: var(--gold-soft);
}
.hero-face svg { height: 100%; width: auto; display: block; overflow: visible; }
.hero-face .face-line { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.hero-face .face-contour { fill: none; stroke: currentColor; stroke-width: 1.2; opacity: .6; }
/* NOTE: the looping white-glow "meteor" streaks were removed at the user's
   request (2026-11-03) — they read as a distracting flying light over the hero.
   The self-drawing facial contour above is kept as the brand signature. */

@media (prefers-reduced-motion: no-preference) {
  .hero-face .face-line {
    stroke-dasharray: 2600; stroke-dashoffset: 2600;
    animation: drawFace 3.4s .3s ease forwards, faceBreathe 7s 3.8s ease-in-out infinite;
  }
  .hero-face .face-contour { stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: drawFace 3s .7s ease forwards; }
}
@keyframes drawFace { to { stroke-dashoffset: 0; } }
@keyframes faceBreathe { 0%,100% { opacity: .22; } 50% { opacity: .36; } }
@media (max-width: 720px) { .hero-face { display: none; } }

/* ===== components/reveal.css ===== */
/* Scroll reveal + hero entrance (plan B7.6).

`site.js` adds `data-reveal` to block content and flips `is-revealed` when the
element enters the viewport. If JS is unavailable the elements are simply visible
— the attribute selector only hides what the script has claimed.
Everything in this file is inert under prefers-reduced-motion. */

html.js [data-reveal] {
  opacity: 0;
  transform: translateY(var(--reveal-distance));
  transition: opacity var(--reveal-duration) var(--ease-lux),
              transform var(--reveal-duration) var(--ease-lux);
  will-change: opacity, transform;
}
html.js [data-reveal="left"] { transform: translateX(calc(var(--reveal-distance) * -1)); }
html.js [data-reveal="scale"] { transform: scale(.97); }
html.js [data-reveal].is-revealed { opacity: 1; transform: none; }

/* stagger children without needing per-element classes */
html.js [data-reveal-stagger] > * {
  opacity: 0; transform: translateY(calc(var(--reveal-distance) * .7));
  transition: opacity 720ms var(--ease-lux), transform 720ms var(--ease-lux);
}
html.js [data-reveal-stagger].is-revealed > * { opacity: 1; transform: none; }
html.js [data-reveal-stagger].is-revealed > *:nth-child(1) { transition-delay: 60ms; }
html.js [data-reveal-stagger].is-revealed > *:nth-child(2) { transition-delay: 140ms; }
html.js [data-reveal-stagger].is-revealed > *:nth-child(3) { transition-delay: 220ms; }
html.js [data-reveal-stagger].is-revealed > *:nth-child(4) { transition-delay: 300ms; }
html.js [data-reveal-stagger].is-revealed > *:nth-child(5) { transition-delay: 380ms; }
html.js [data-reveal-stagger].is-revealed > *:nth-child(6) { transition-delay: 460ms; }

/* word-by-word lift for the first-screen headline */
.reveal-words { display: inline; }
.reveal-words .rw {
  display: inline-block; overflow: hidden; vertical-align: bottom;
}
.reveal-words .rw > span {
  display: inline-block; transform: translateY(110%);
  animation: rwUp 1.05s var(--ease-lux) forwards;
  animation-delay: calc(var(--rw-i, 0) * 70ms + 240ms);
}
@keyframes rwUp { to { transform: none; } }

/* Ken Burns slow zoom for still hero backgrounds */
.ken-burns { animation: kenburns 12s var(--ease-out) forwards; }
@keyframes kenburns {
  from { transform: scale(1.001); }
  to   { transform: scale(1.10); }
}

/* one-shot section fade used as the no-JS-friendly baseline */
@media (prefers-reduced-motion: no-preference) {
  .section .block { animation: fadeUp .6s ease both; }
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  html.js [data-reveal], html.js [data-reveal-stagger] > * {
    opacity: 1 !important; transform: none !important;
  }
  .reveal-words .rw > span { transform: none !important; }
  .ken-burns { animation: none !important; }
}

/* ===== components/errors.css ===== */
/* Status pages: module disabled, page not found, language not found (plan B8.2).
   These used to be bare text bodies — "language not found" with no way back. */

.status-page {
  min-height: min(72vh, 620px);
  display: flex; align-items: center; justify-content: center;
  padding: var(--section-y) var(--gutter);
  text-align: center; position: relative; z-index: 1;
}
.status-card {
  max-width: 560px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-xl);
  padding: clamp(var(--space-8), 6vw, var(--space-14)) var(--space-7);
  box-shadow: var(--shadow-card);
}
.status-mark {
  font-family: var(--font-display); font-size: clamp(3rem, 12vw, 5.5rem);
  line-height: 1; color: var(--gold-soft); margin-bottom: var(--space-4);
  letter-spacing: .04em;
}
.status-card h1 { font-size: var(--text-2xl); color: var(--ink); margin: 0 0 var(--space-4); }
.status-card p { color: var(--text-muted); margin: 0 0 var(--space-8); line-height: 1.9; }
.status-actions { display: flex; gap: var(--space-4); justify-content: center; flex-wrap: wrap; }
.status-hint { font-size: var(--text-sm); color: var(--text-muted); opacity: .8; margin-top: var(--space-7) !important; }

/* a soft notice strip used above content when something is degraded */
.notice-bar {
  max-width: var(--container); margin: 0 auto var(--space-7);
  padding: var(--space-4) var(--space-6);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--gold-soft); color: var(--gold-strong);
  font-size: var(--text-sm); letter-spacing: .02em;
}

/* Search on the 404 page and on the results page: one shared control so a
   visitor never has to learn a second interaction. */
.status-search, .search-form {
  display: flex; align-items: stretch; gap: var(--space-3);
  width: 100%; max-width: 560px; margin: 0 auto var(--space-4);
}
.search-form { max-width: 760px; margin: 0 auto var(--space-7); }
.status-search input, .search-form input {
  flex: 1 1 auto; min-width: 0;
  font: inherit; font-size: var(--text-sm);
  padding: var(--space-3) var(--space-4);
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-pill, 999px);
  transition: border-color .15s, box-shadow .15s;
}
.status-search input::placeholder, .search-form input::placeholder { color: var(--text-muted); opacity: .8; }
.status-search input:hover, .search-form input:hover { border-color: var(--gold-strong); }
.status-search input:focus-visible, .search-form input:focus-visible {
  outline: none; border-color: var(--gold-strong);
  box-shadow: 0 0 0 3px var(--gold-soft);
}
.status-search .btn, .search-form .btn { flex: 0 0 auto; white-space: nowrap; }
.status-search-hint {
  font-size: var(--text-xs, var(--text-sm)); color: var(--text-muted);
  margin: 0 0 var(--space-6) !important; line-height: 1.6;
}
.search-page .search-summary {
  max-width: var(--container); margin: 0 auto var(--space-7);
  font-size: var(--text-sm); color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.search-page .search-empty {
  max-width: var(--container); margin: 0 auto; text-align: center;
  padding: var(--space-12) var(--space-6); color: var(--text-muted);
}
.search-page .search-empty strong { display: block; color: var(--ink); font-size: var(--text-lg); margin-bottom: var(--space-3); }
.search-page .search-empty p { margin: 0; font-size: var(--text-sm); line-height: 1.8; }
.search-page .search-notice {
  max-width: var(--container); margin: var(--space-6) auto 0;
  font-size: var(--text-sm); color: var(--text-muted); text-align: center;
}
.search-group-count { font-size: var(--text-sm); color: var(--text-muted); font-variant-numeric: tabular-nums; }
@media (max-width: 600px) {
  .status-search, .search-form { flex-direction: column; align-items: stretch; }
  .status-search .btn, .search-form .btn { width: 100%; }
}

/* ===== blocks/hero.css ===== */
/* Hero — two-column editorial split on a warm cream ground (reference design
   system). Copy dominates the left, the illustration sits in a rounded card on
   the right. A soft gold ambient glow + faint graph-paper gives the ground depth
   so it reads as a designed surface, not flat emptiness.

   Spacing note: this site uses a SOLID sticky header (in normal flow), so the
   hero must NOT re-add --header-h to its top padding — that double-counts the
   bar and produces a huge dead gap above the headline. The reference ROYALTY
   hero assumed a transparent/absolute header; we deliberately do not. */

.block-hero {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  margin: 0 auto;
  overflow: hidden;
  padding: var(--space-12) var(--gutter) var(--space-12);
  background: var(--bg);
  color: var(--ink);
  min-height: clamp(560px, 80svh, 840px);
}
@supports not (min-height: 80svh) { .block-hero { min-height: 600px; } }

/* Layered background: a soft gold ambient glow + a faint warm wash give the
   cream ground depth and a clear "designed" feel. Painted behind everything. */
.block-hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(62% 56% at 84% 14%, rgba(16,32,31,.18), transparent 70%),
    radial-gradient(46% 46% at 8% 96%, rgba(241,233,218,.9), transparent 72%),
    radial-gradient(40% 38% at 96% 92%, rgba(91,117,83,.08), transparent 70%);
}

/* Faint graph-paper texture, drawn above the glow but behind the copy. Masked so
   it fades at the edges instead of tiling to a hard rectangle. */
.hero-grid {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 88px 88px;
  -webkit-mask-image: radial-gradient(118% 96% at 72% 28%, #000 38%, transparent 80%);
          mask-image: radial-gradient(118% 96% at 72% 28%, #000 38%, transparent 80%);
}

.hero-inner {
  position: relative; z-index: 2; width: 100%;
  max-width: var(--container-wide); margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: clamp(40px, 5vw, 80px); align-items: center;
}
.hero-text-only .hero-inner { grid-template-columns: minmax(0, 720px); margin: 0 auto; text-align: center; }
.hero-text-only .hero-copy { margin: 0 auto; }
.hero-text-only .hero-eyebrow { margin-left: auto; margin-right: auto; }

.hero-copy { max-width: 620px; }
.hero-eyebrow {
  display: inline-block; letter-spacing: .26em; text-transform: uppercase;
  font-size: var(--text-xs); color: var(--gold-strong); font-weight: 600;
  margin-bottom: var(--space-5); padding: var(--space-2) var(--space-5);
  border: 1px solid rgba(16,32,31,.40); border-radius: var(--radius-pill);
  background: rgba(16,32,31,.06);
}
.block-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 5.2vw, 4.4rem); color: var(--ink);
  margin: 0 0 var(--space-6); letter-spacing: .005em; line-height: 1.1;
  font-weight: 600; max-width: 15ch; overflow-wrap: anywhere;
}
.block-hero .subtitle {
  color: var(--text); font-family: var(--font-body);
  font-size: clamp(1.02rem, 1.5vw, 1.18rem); letter-spacing: .01em;
  margin: 0; line-height: 1.85; max-width: 46ch;
}
.hero-cta { display: flex; gap: var(--space-4); justify-content: flex-start; flex-wrap: wrap; margin-top: var(--space-8); }

/* Illustration card — a soft white frame holding the hammock scene. The frame
   keeps a cream fallback fill so a missing image degrades to a calm panel, never
   a broken box. Narrower column keeps it a supporting element, not the focal
   point, so the headline leads. */
.hero-figure { position: relative; margin: 0; align-self: center; }
.hero-figure-frame {
  position: relative; width: 100%; aspect-ratio: 4 / 3;
  border-radius: var(--radius-xl);
  background: var(--porcelain);
  border: 1px solid var(--gold-soft);
  box-shadow: var(--shadow-card); overflow: hidden;
}
.hero-media-el {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block;
}

/* Annotation chip — dark plate, gold label, white sub. Insets INSIDE the card
   corner so it reads as a deliberate editorial tag, not a cramped overlap. */
.hero-chip {
  position: absolute; left: var(--space-5); bottom: var(--space-5);
  z-index: 3; display: flex; flex-direction: column; gap: 2px;
  padding: var(--space-3) var(--space-5);
  background: var(--ink); color: #fff; border-radius: var(--radius-md);
  box-shadow: 0 12px 30px rgba(16,24,28,.28);
  max-width: 78%;
}
.hero-chip-label { font-family: var(--font-body); font-weight: 600; font-size: var(--text-sm); color: var(--gold-soft); letter-spacing: .02em; }
.hero-chip-text { font-family: var(--font-body); font-size: var(--text-xs); color: rgba(255,255,255,.82); letter-spacing: .04em; }

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: var(--space-8); }
  .hero-copy { max-width: 640px; order: 1; }
  .hero-figure { max-width: 540px; order: 2; }
  .block-hero h1 { max-width: 100%; font-size: clamp(2.1rem, 8.5vw, 3.2rem); }
  .hero-chip { left: var(--space-4); bottom: var(--space-4); }
}
@media (prefers-reduced-motion: no-preference) {
  .hero-grid { animation: heroGridDrift 60s linear infinite; }
}
@keyframes heroGridDrift { 0%,100% { background-position: 0 0, 0 0; } 50% { background-position: 44px 44px, 44px 44px; } }

/* ===== blocks/hero_slider.css ===== */
/* Hero slider — the homepage's current first screen. Shares the hero type scale
   so both variants read as the same brand voice. */

.block-hero-slider {
  position: relative; width: 100%;
  height: var(--hero-height, 100svh); min-height: 560px;
  overflow: hidden; background: var(--ink);
}
@supports not (min-height: 100svh) { .block-hero-slider { height: var(--hero-height, 100vh); } }
.hero-slider, .hero-slide { position: absolute; inset: 0; }
.hero-slide { opacity: 0; visibility: hidden; transition: opacity 1.1s var(--ease-out), visibility 1.1s; z-index: 1; }
.hero-slide.active { opacity: 1; visibility: visible; z-index: 2; }
.hero-slide-bg {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  /* Lift the hero photography a touch more so the frame reads bright and
     premium, while the left-weighted scrim below still protects the white copy. */
  filter: brightness(1.30) saturate(1.06) contrast(.96);
}
/* Ken Burns: the active slide drifts slowly rather than sitting still (B7.3) */
.hero-slide-bg.ken-burns { animation: slideZoom 12s linear forwards; }
@keyframes slideZoom { from { transform: scale(1.001); } to { transform: scale(1.09); } }
.hero-slide-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-slide-overlay {
  position: absolute; inset: 0;
  /* A left-weighted scrim: the bright portrait photography needs more shade
     behind the white headline, but only on the left third where the copy sits —
     the subject on the right stays bright. The previous even scrim washed the
     whole image or left the type unreadable. Eased in Nov-2026 so the
     background reads clearer without losing the copy column's contrast. */
  background: linear-gradient(100deg,
    rgba(20, 16, 12, .46) 0%,
    rgba(20, 16, 12, .24) 38%,
    rgba(20, 16, 12, .04) 72%,
    rgba(20, 16, 12, 0) 100%);
}
/* ── strong shade (illustration-backed slides) ──────────────────────────────
   2026-11-12: the "too dark" complaint traced to the JPEG, not the CSS.
   build_hammock_hero.py used to bake a GLOBAL dark grade into the frame
   (Brightness 0.52 + 24% ink blend + left scrim + vignette): mean luminance
   0.891 -> 0.222, left third 0.108. No CSS brightness tweak could undo that,
   which is why two earlier rounds of scrim tuning made no visible difference.
   scripts/brighten_hammock_hero.py now emits a BRIGHT frame (~0.81) with no
   baked left scrim; darkness is the runtime CSS layer's job, so swapping the
   image in the admin still keeps white copy legible.

   The scrim is strictly left-weighted: the right two thirds (palms, hammock,
   sky) stay fully vivid, while the copy column is shaded to >= 4.5:1. Thin
   top/bottom bands protect the transparent white nav and the synced caption. */
.hero-slide--strong .hero-slide-bg {
  /* No artificial boost: the frame is already bright, and lifting it further
     would blow out the white clouds/sky into flat white. */
  filter: saturate(1.05) contrast(1.0);
}
.hero-slide--strong .hero-slide-overlay {
  /* 2026-11-23: the old scrim dropped .72 -> 0 between 44% and 70% (≈370px
     on a 1440 frame), which read as a hard vertical seam between grey and
     clear. Spread the falloff over 34%->100% in small steps: the copy column
     (0-34%) keeps its >= .78 shade for white-text contrast, while the eye
     sees a continuous fade instead of a boundary. The vertical band is eased
     the same way without changing its top/bottom anchors (nav + caption). */
  background:
    linear-gradient(100deg,
      rgba(14, 10, 8, .92) 0%,
      rgba(14, 10, 8, .90) 20%,
      rgba(14, 10, 8, .86) 34%,
      rgba(14, 10, 8, .76) 46%,
      rgba(14, 10, 8, .60) 58%,
      rgba(14, 10, 8, .40) 70%,
      rgba(14, 10, 8, .22) 82%,
      rgba(14, 10, 8, .08) 91%,
      rgba(14, 10, 8, 0) 100%),
    linear-gradient(180deg,
      rgba(14, 10, 8, .30) 0%,
      rgba(14, 10, 8, .16) 12%,
      rgba(14, 10, 8, .04) 28%,
      rgba(14, 10, 8, .04) 72%,
      rgba(14, 10, 8, .14) 88%,
      rgba(14, 10, 8, .30) 100%);
}
.hero-slide--strong .hero-slide-content h1,
.hero-slide--strong .hero-slide-content .subtitle,
.hero-slide--strong .hero-caption-line {
  text-shadow: 0 2px 30px rgba(0, 0, 0, .62);
}
.hero-slide-link { position: absolute; inset: 0; z-index: 2; }
.hero-slide-content {
  position: absolute; z-index: 3; top: 0; bottom: 0; left: 0; right: 0;
  /* Border-box + horizontal padding rather than `left/right: inset` or a `min()`
     width: both alternatives produced a box wider than the viewport on narrow
     phones, which let a long CJK headline run past the right edge. */
  width: 100%; box-sizing: border-box;
  max-width: calc(var(--container) + var(--gutter) * 2); margin: 0 auto;
  padding: calc(var(--header-h) + var(--space-8)) var(--gutter) var(--space-14);
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  color: var(--color-on-dark); text-align: left;
}
.hero-slide-content.centered { align-items: center; text-align: center; }
.hero-slide-content .hero-eyebrow {
  display: inline-block; letter-spacing: .26em; text-transform: uppercase;
  font-size: var(--text-xs); color: var(--gold-soft); margin-bottom: var(--space-5);
  padding: var(--space-2) var(--space-5);
  border: 1px solid rgba(255,255,255,.5); border-radius: var(--radius-pill);
}
.hero-slide-content h1 {
  font-size: var(--text-hero); color: #fff; margin: 0 0 var(--space-5);
  letter-spacing: .01em; font-weight: 500; line-height: var(--leading-tight);
  /* Type sits on a photographic ground, so a soft shadow guarantees contrast
     even where the scrim is thinnest. */
  text-shadow: 0 2px 26px rgba(0, 0, 0, .34);
  /* CJK headlines have no spaces to break on, so `ch` units and a fixed max-width
     both overflow on phones; bound it to the container and allow any break. */
  max-width: 100%; overflow-wrap: anywhere;
  /* Balance the two lines instead of leaving a single orphan glyph on the second
     (「以学术为根基的年轻化」 used to break 8+1). Browsers without support simply
     keep the greedy wrap. */
  text-wrap: balance;
}
.hero-slide-content .subtitle {
  color: var(--gold-soft); font-size: clamp(1.15rem, 2.4vw, 1.6rem);
  font-family: var(--font-display); letter-spacing: .04em; margin: 0;
  text-shadow: 0 2px 20px rgba(0, 0, 0, .38);
}
.hero-slide-content .hero-cta {
  display: flex; gap: var(--space-4); justify-content: inherit;
  flex-wrap: wrap; margin-top: var(--space-10);
}
.hero-slide-content .btn-ghost { color: #fff; border-color: rgba(255,255,255,.42); }
.hero-slide-content .btn-ghost:hover { background: rgba(255,255,255,.12); color: #fff; }

.hero-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 4;
  width: 48px; height: 48px; border-radius: var(--radius-pill);
  border: 1px solid rgba(255,255,255,.32); background: rgba(22,18,14,.30);
  color: #fff; font-size: 1.4rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .18s, border-color .18s, transform .18s;
}
.hero-arrow:hover { background: rgba(16,32,31,.42); border-color: rgba(255,255,255,.7); }
.hero-arrow--prev { left: var(--space-7); }
.hero-arrow--next { right: var(--space-7); }
.hero-dots {
  position: absolute; bottom: var(--space-8); left: 50%; transform: translateX(-50%);
  z-index: 4; display: flex; gap: var(--space-3);
}
.hero-dot {
  width: 34px; height: 2px; border-radius: 1px; border: none;
  background: rgba(255,255,255,.34); cursor: pointer; padding: 0;
  transition: background .25s, transform .25s;
}
.hero-dot.active { background: var(--gold-soft); transform: scaleX(1.2); }
.hero-dot:hover { background: rgba(255,255,255,.85); }

/* Synced caption — replaces the detached hero-intro strip. Lives inside the hero
   at the foot, left-aligned with the headline, and rotates with the active slide
   (site.js swaps the text on every `show()`). A short gold rule + a constrained
   measure keep it from reading as a half-finished, right-blanked block. */
.hero-caption {
  position: absolute; left: 0; right: 0;
  bottom: clamp(64px, 7vw, 92px);
  z-index: 3;
  /* Match the slide-content box so the caption lines up with the headline,
     subtitle and button instead of hugging the viewport's left edge. */
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin: 0 auto; padding: 0 var(--gutter);
  pointer-events: none;
}
.hero-caption-rule {
  display: block; width: 36px; height: 2px;
  background: var(--gold-soft); opacity: .9;
  margin: 0 0 var(--space-4);
}
.hero-caption-line {
  max-width: min(100% - 2 * var(--gutter), 560px); margin: 0;
  font-family: var(--font-display); color: rgba(255,255,255,.92);
  font-size: clamp(1.02rem, 1.5vw, 1.28rem); line-height: 1.7; letter-spacing: .02em;
  /* the left-weighted slide overlay already shades this zone; the shadow guards
     the rare bright frame so the line stays legible everywhere */
  text-shadow: 0 2px 18px rgba(0, 0, 0, .4);
  transition: opacity .24s var(--ease-out);
}
.hero-caption-line.is-fading { opacity: 0; }
@media (max-width: 480px) {
  .hero-caption { bottom: var(--space-10); }
  .hero-caption-line { font-size: 1rem; }
}
.hero-slide-content > * { opacity: 0; transform: translateY(24px); transition: opacity .85s var(--ease-lux), transform .85s var(--ease-lux); }
.hero-slide.active .hero-slide-content > * { opacity: 1; transform: none; }
.hero-slide.active .hero-slide-content > *:nth-child(1) { transition-delay: .12s; }
.hero-slide.active .hero-slide-content > *:nth-child(2) { transition-delay: .26s; }
.hero-slide.active .hero-slide-content > *:nth-child(3) { transition-delay: .40s; }
.hero-slide.active .hero-slide-content > *:nth-child(4) { transition-delay: .54s; }
.hero-slide.active .hero-slide-content > *:nth-child(5) { transition-delay: .68s; }

@media (max-width: 860px) {
  .block-hero-slider { min-height: 520px; }
  /* A 390px viewport crops the 16:9 illustration down to a tall sliver, which
     also crops away most of the baked left scrim. Re-assert the shade here so
     the white headline still measures >= 4.5:1 (verify_hammock_visual.py). */
  .hero-slide--strong .hero-slide-bg {
    filter: saturate(1.03) contrast(1.0);
  }
  /* 390px crops the 16:9 frame to a tall sliver, so the baked edge vignette is
     gone and the bright sky sits right behind the wrapped headline. A full-width
     top band (0-44%) plus a firm left-weighted scrim together keep the measured
     copy column >= 4.5:1, while the lower-right of the frame still shows the
     red hammock cloth clearly (verify_hammock_visual.py). */
  .hero-slide--strong .hero-slide-overlay {
    background:
      linear-gradient(180deg,
        rgba(14, 10, 8, .54) 0%,
        rgba(14, 10, 8, .28) 44%,
        rgba(14, 10, 8, .22) 72%,
        rgba(14, 10, 8, .48) 100%),
      linear-gradient(100deg,
        rgba(14, 10, 8, .88) 0%,
        rgba(14, 10, 8, .77) 55%,
        rgba(14, 10, 8, .44) 82%,
        rgba(14, 10, 8, .20) 100%);
  }
  .hero-slide-content {
    padding-left: var(--space-5); padding-right: var(--space-5);
    word-break: break-all; overflow-wrap: anywhere;
  }
  /* CJK headlines have no spaces to break on; break-all is safe here because the
     text is a single CJK run and the alternative is overflowing the viewport. */
  .hero-slide-content h1 {
    font-size: clamp(1.7rem, 7.2vw, 2.5rem);
    max-width: 100%;
  }
  .hero-arrow--prev { left: var(--space-4); }
  .hero-arrow--next { right: var(--space-4); }
  /* keep the caption aligned with the headline once the slide content tightens
     its side padding on small screens */
  .hero-caption { padding: 0 var(--space-5); }
}
@media (max-width: 480px) {
  .block-hero-slider { min-height: 460px; }
  .hero-slide-content { padding-bottom: var(--space-12); }
}

/* ── 本站本地化（与参考站唯一的差异）────────────────────────────────────────
   The reference CMS headline is a 2–3 character brand name (睿优提), so
   --text-hero (up to 8rem) reads as a monumental statement there. Hammock
   Theory headlines are full CJK sentences (11+ characters): at 8rem they wrap
   into three lines and overflow the container. Cap the display size while
   keeping the same editorial weight and the same left-aligned composition. */
.hero-slide-content h1 {
  font-size: clamp(2.5rem, 5vw, 4.4rem);
  line-height: 1.18;
  text-wrap: balance;
}

/* ===== blocks/brand_story.css ===== */
/* ─────────────────────────────────────────────────────────────────────────────
 * Brand signature section — a balanced two-column "quiet luxury" beat:
 * the serif philosophy statement on the left, a portrait image on the right.
 * The image fills its own column so the composition never collapses into the
 * dead space the old full-bleed slab produced whenever the hero image was
 * missing. Missing image degrades to a centred statement instead of a blank.
 * ───────────────────────────────────────────────────────────────────────────── */

.block-brand-story {
  position: relative; width: 100%; overflow: hidden;
  background: var(--surface-dark); color: var(--color-on-dark);
}
.block-brand-story--light { background: var(--porcelain); color: var(--ink); }

.brand-story-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.86fr);
  gap: clamp(32px, 5vw, 84px);
  align-items: center;
  width: min(100% - var(--gutter) * 2, var(--container));
  margin: 0 auto;
  padding: clamp(var(--space-12), 8vw, 132px) var(--gutter);
}

.brand-story-copy { max-width: 46ch; }
.brand-story-eyebrow {
  font-size: var(--text-xs); letter-spacing: .3em; text-transform: uppercase;
  color: var(--gold-soft); margin: 0 0 var(--space-7); font-weight: 600;
}
.brand-story-quote {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.6vw, 2.85rem);
  line-height: 1.3; letter-spacing: .01em; color: #fff;
  margin: 0 0 var(--space-8); font-weight: 500;
}
.brand-story-quote::before { content: "\201C"; color: var(--gold-soft); margin-right: .1em; }
.brand-story-quote::after { content: "\201D"; color: var(--gold-soft); }
.brand-story-rule {
  width: 64px; height: 1px; background: var(--gold-soft);
  border: none; margin: 0 0 var(--space-6); opacity: .85;
}
.brand-story-signature {
  font-family: var(--font-display); font-size: var(--text-xl);
  color: var(--gold-soft); margin: 0; letter-spacing: .04em;
}
.brand-story-role {
  font-size: var(--text-sm); letter-spacing: .14em; text-transform: uppercase;
  color: var(--color-on-dark-muted); margin: var(--space-2) 0 0;
}
.brand-story-actions { display: flex; gap: var(--space-4); margin-top: var(--space-9, 48px); flex-wrap: wrap; }

/* ── portrait image column ─────────────────────────────────────────────────── */
.brand-story-media {
  position: relative; margin: 0; align-self: stretch;
  display: flex;
}
.brand-story-media img {
  display: block; width: 100%; height: 100%;
  aspect-ratio: 4 / 5; object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float);
}
/* a slim gold offset frame gives the portrait an editorial, intentional edge
   instead of a floating rectangle */
.brand-story-media::after {
  content: ""; position: absolute;
  inset: 16px -16px -16px 16px;
  border: 1px solid var(--gold-soft); border-radius: var(--radius-lg);
  opacity: .45; pointer-events: none; z-index: -1;
}
/* micro-interaction: a gentle lift + warm filter on hover, so the signature
   portrait shares the same quiet life as the feed cards (request: unify the
   micro-interactions). The offset gold frame lifts with the media. */
.brand-story-media { transition: transform .45s var(--ease-out); }
.brand-story-media:hover { transform: translateY(-5px); }
.brand-story-media img { transition: filter .45s var(--ease-out); }
.brand-story-media:hover img { filter: brightness(1.05) saturate(1.07); }

/* ── play button + lightbox (unchanged behaviour) ──────────────────────────── */
.brand-story-play {
  display: inline-flex; align-items: center; gap: var(--space-3);
  background: none; border: none; cursor: pointer; padding: 0;
  color: var(--color-on-dark); font: inherit; font-size: var(--text-sm);
  letter-spacing: .12em; text-transform: uppercase;
}
.brand-story-play span {
  width: 44px; height: 44px; border-radius: var(--radius-pill);
  border: 1px solid rgba(255,255,255,.5);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .2s, transform .2s;
}
.brand-story-play:hover span { background: rgba(255,255,255,.18); transform: scale(1.06); }
.brand-story-player {
  position: absolute; inset: 0; z-index: 5; display: none;
  align-items: center; justify-content: center; background: rgba(12,9,7,.92);
  padding: var(--gutter);
}
.brand-story-player.is-open { display: flex; }
.brand-story-player video { width: min(100%, 980px); border-radius: var(--radius-md); background: #000; }
.brand-story-player-close {
  position: absolute; top: var(--space-6); right: var(--space-6);
  width: 40px; height: 40px; border-radius: var(--radius-pill);
  border: 1px solid rgba(255,255,255,.4); background: transparent;
  color: #fff; font-size: 1.2rem; cursor: pointer;
}

/* ── light tone overrides ──────────────────────────────────────────────────── */
.block-brand-story--light .brand-story-eyebrow { color: var(--gold-strong); }
.block-brand-story--light .brand-story-quote { color: var(--ink); }
.block-brand-story--light .brand-story-quote::before,
.block-brand-story--light .brand-story-quote::after { color: var(--gold); }
.block-brand-story--light .brand-story-rule { background: var(--gold); opacity: .55; }
.block-brand-story--light .brand-story-signature { color: var(--gold-strong); }
.block-brand-story--light .brand-story-role { color: var(--text-muted); }
.block-brand-story--light .brand-story-play { color: var(--ink); }
.block-brand-story--light .brand-story-play span { border-color: rgba(35, 30, 25, .28); }
.block-brand-story--light .brand-story-play:hover span { background: rgba(16,32,31,.12); }

/* ── no image: centred statement, never a blank slab ───────────────────────── */
.block-brand-story--no-media .brand-story-grid { grid-template-columns: 1fr; }
.block-brand-story--no-media .brand-story-copy {
  max-width: 64ch; margin: 0 auto; text-align: center;
}
.block-brand-story--no-media .brand-story-rule { margin-left: auto; margin-right: auto; }
.block-brand-story--no-media .brand-story-actions { justify-content: center; }
.block-brand-story--no-media.block-brand-story--light {
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(16,32,31,.10), rgba(247,244,237,0) 60%),
    var(--porcelain);
}

/* ── section paints the ground ───────────────────────────────────────────────
   When the operator picks 背景 explicitly in PageEditor, the wrapper section is
   the authority: this block drops its own band (and the no-media gradient) so
   the whole width shares one colour instead of a 1280px slab on a different one. */
.block-brand-story--flush,
.block-brand-story--no-media.block-brand-story--flush { background: transparent; }

/* ── responsive: stack on narrow viewports (copy first, then image) ────────── */
@media (max-width: 860px) {
  .brand-story-grid {
    grid-template-columns: 1fr;
    gap: var(--space-10);
    padding: var(--space-14) var(--gutter);
  }
  .brand-story-media { order: 2; max-width: 460px; margin: 0 auto; width: 100%; }
  .brand-story-media img { aspect-ratio: 3 / 2; }
  .brand-story-media::after { inset: 12px -12px -12px 12px; }
}
@media (max-width: 520px) {
  .brand-story-media { max-width: 100%; }
}

/* ===== blocks/about_clinic.css ===== */
/* ─────────────────────────────────────────────────────────────────────────────
 * Institution introduction ("About us") — an editorial, quiet-luxury beat:
 * a serif statement + clinic environment image, a compact service-journey
 * line, then the founding team folded in as cards. Neutral surfaces only;
 * the brand gold is an accent, never a text block background.
 * ───────────────────────────────────────────────────────────────────────────── */
.block-about-clinic {
  width: 100%;
  color: var(--ink);
  background: transparent;
}
.about-clinic-inner {
  width: min(100% - var(--gutter) * 2, var(--container));
  margin: 0 auto;
  padding-block: clamp(var(--space-12), 7vw, 112px);
}
.about-clinic-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .92fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: center;
}
.about-clinic-copy { max-width: 52ch; }
.about-clinic-eyebrow {
  margin: 0 0 var(--space-6);
  font-size: var(--text-xs); font-weight: 600;
  letter-spacing: .28em; text-transform: uppercase;
  color: var(--gold-strong);
}
.about-clinic-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.2vw, 3.1rem);
  font-weight: 500; line-height: 1.18; letter-spacing: .01em;
  color: var(--ink);
}
.about-clinic-rule {
  display: block; width: 68px; height: 1px;
  margin: var(--space-6) 0 var(--space-7);
  background: var(--gold); opacity: .7;
}
.about-clinic-lead {
  margin: 0;
  font-size: clamp(1rem, 1.15vw, 1.14rem);
  line-height: 1.9; color: var(--ink);
}
.about-clinic-detail {
  margin: var(--space-5) 0 0;
  font-size: var(--text-sm); line-height: 1.9;
  color: var(--text-muted);
}
.about-clinic-link {
  display: inline-flex; align-items: center; gap: .6em;
  margin-top: var(--space-8);
}
.about-clinic-link span { transition: transform .15s var(--ease-out); }
.about-clinic-link:hover span { transform: translateX(3px); }

.about-clinic-media { margin: 0; }
.about-clinic-media img {
  display: block; width: 100%;
  aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  background: var(--surface);
}
.about-clinic-media figcaption {
  margin-top: var(--space-3);
  font-size: var(--text-xs); letter-spacing: .08em;
  color: var(--text-muted); text-align: right;
}
.block-about-clinic--no-media .about-clinic-main { grid-template-columns: 1fr; }

/* A thin, readable journey line — four steps remain one row on desktop and
   wrap naturally instead of being clipped when a site has more steps. */
.about-clinic-journey {
  list-style: none;
  display: flex; flex-wrap: wrap;
  gap: var(--space-3);
  margin: clamp(36px, 4vw, 60px) 0 0;
  padding: var(--space-5) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.about-clinic-journey li {
  display: inline-flex; align-items: baseline; gap: var(--space-3);
  padding-right: var(--space-8);
  white-space: nowrap;
}
.journey-index {
  font-family: var(--font-display); font-size: var(--text-sm);
  color: var(--gold-strong); font-variant-numeric: tabular-nums;
}
.journey-label { font-size: var(--text-sm); color: var(--ink); }

.about-clinic-founders { margin-top: clamp(36px, 4vw, 64px); }
.founders-title {
  margin: 0 0 var(--space-6);
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2vw, 1.65rem);
  font-weight: 500; letter-spacing: .02em;
  color: var(--ink);
}
.founders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: clamp(16px, 2vw, 28px);
}
.founder-card {
  position: relative;
  padding: var(--space-7);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: border-color .15s var(--ease-out), transform .15s var(--ease-out);
}
.founder-card:hover {
  border-color: var(--gold-soft);
  transform: translateY(-2px);
}
.founder-index {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 24px; padding-inline: 8px;
  border-radius: var(--radius-pill);
  background: var(--porcelain);
  color: var(--gold-strong);
  font-size: var(--text-xs); font-variant-numeric: tabular-nums;
}
.founder-name {
  margin: var(--space-5) 0 var(--space-2);
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 1.5vw, 1.3rem);
  font-weight: 600; color: var(--ink);
}
.founder-role {
  margin: 0;
  font-size: var(--text-xs); letter-spacing: .08em;
  color: var(--gold-strong);
}
.founder-desc {
  margin: var(--space-4) 0 0;
  font-size: var(--text-sm); line-height: 1.85;
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .about-clinic-main { grid-template-columns: 1fr; gap: var(--space-8); }
  .about-clinic-copy { max-width: none; }
  .about-clinic-media img { aspect-ratio: 16 / 10; }
  .about-clinic-journey li { padding-right: var(--space-6); }
}
@media (max-width: 600px) {
  .about-clinic-inner { padding-block: var(--space-12); }
  .about-clinic-journey { gap: var(--space-2) var(--space-5); }
  .about-clinic-journey li { padding-right: 0; }
  .about-clinic-media figcaption { text-align: left; }
}

/* ===== blocks/content_feed.css ===== */
/* Content feed — the homepage's live-query card block, presented as a horizontal
   rail (spec §2.1). The shared `.feed-grid` + `.feed-card` pair is also used by
   the listing pages, so only the rail-specific rules live here. */

.block-content-feed { max-width: var(--container); }
.feed-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: var(--space-4); margin-bottom: var(--space-9, 48px); flex-wrap: wrap;
}
.feed-header h2 {
  font-family: var(--font-display); font-size: var(--text-display); color: var(--ink);
  margin: 0; letter-spacing: .01em; line-height: var(--leading-snug);
}
.feed-header .feed-desc { color: var(--text-muted); max-width: 560px; margin-top: var(--space-3); line-height: 1.9; }
.feed-link {
  color: var(--gold-strong); font-weight: 600; text-decoration: none;
  white-space: nowrap; border-bottom: 1px solid transparent; padding-bottom: 2px;
  transition: border-color .18s, color .18s;
}
.feed-link:hover { border-bottom-color: var(--gold); color: var(--gold); }

/* ─── the rail ──────────────────────────────────────────────────────────────
 * One axis, snap points, and a card width of min(85vw, 420px) so a phone shows
 * one card and a slice of the next — the slice is the affordance that says
 * "this scrolls". The scrollbar is hidden because the arrows and dots replace
 * it; the region stays keyboard- and trackpad-scrollable regardless. */
.feed-rail { position: relative; }
.feed-track {
  display: flex; gap: var(--space-7);
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  /* room for the card's hover lift and its shadow, which overflow would clip */
  padding: 4px 2px var(--space-7);
  margin: -4px -2px 0;
  scroll-padding-left: 2px;
}
.feed-track::-webkit-scrollbar { display: none; }
.feed-track > .feed-card {
  /* 340 rather than 420: the rail used to show only ~2.6 cards on a 1280
     container, so each tile read as a billboard. 340 fits ~3.4 cards and keeps
     the "there is more to scroll" affordance without dwarfing the row. */
  flex: 0 0 min(78vw, 340px);
  scroll-snap-align: start;
  height: auto;
}

/* Short rails fill the row instead of leaving a hole.
   Three cards at 340px only reach 1084px of the 1280 column, so the last card
   stopped 196px short of the right edge — the exact edge the header's "查看全部"
   link is pinned to (space-between), which is what made the row look crooked.
   Only from ~1180px up is the column wide enough (≥1084px) to give each card at
   least its normal 340px once the row is split three ways; below that the cards
   would shrink and the row would read as squeezed, so the rail keeps scrolling
   (and its arrows) exactly as before. */
@media (min-width: 1180px) {
  .feed-rail--fill .feed-track > .feed-card { flex: 1 1 0; min-width: 0; }
  /* nothing can scroll, so the arrows would only ever be disabled */
  .feed-rail--fill .feed-nav { display: none; }
}

/* One featured item (e.g. the papers category, which holds a single published
   paper today): fill the row at every width, and on wide screens lay the card
   out horizontally so it reads as a deliberate editorial feature rather than
   a 340px tile stranded on the left. No arrows/dots: there is nothing to move. */
.feed-rail--single .feed-track > .feed-card { flex: 1 1 0; min-width: 0; }
.feed-rail--single .feed-nav, .feed-rail--single .feed-dots { display: none; }
@media (min-width: 900px) {
  .feed-rail--single .feed-track > .feed-card {
    display: grid; grid-template-columns: minmax(0, 42%) minmax(0, 1fr);
    /* A fixed height breaks the circular dependency between the media's
       height:100% and the grid row's intrinsic height — without it the card
       grew to the image's natural 646px and left a huge blank under the copy. */
    height: clamp(320px, 26vw, 390px);
  }
  .feed-rail--single .feed-card-media {
    aspect-ratio: auto; min-height: 0; height: 100%;
  }
  .feed-rail--single .feed-card-media img { height: 100%; }
  .feed-rail--single .feed-card-body {
    justify-content: center;
    padding: clamp(var(--space-6), 3vw, var(--space-10));
  }
}

.feed-card {
  display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden;
  transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out), border-color .2s;
  text-decoration: none; color: inherit; height: 100%;
}
.feed-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-card); border-color: var(--gold); }
.feed-card-media { aspect-ratio: 4 / 3; overflow: hidden; background: var(--gold-soft); position: relative; }
.feed-card-media img, .feed-card-media video, .feed-card-media iframe {
  width: 100%; height: 100%; object-fit: cover; border: 0;
  transition: transform .8s var(--ease-out);
}
.feed-card:hover .feed-card-media img { transform: scale(1.05); }
.feed-card-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--gold-soft), var(--surface));
}
.feed-card-placeholder span {
  width: 62px; height: 62px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-pill); background: var(--gold); color: #fff;
  font-family: var(--font-display); font-size: var(--text-xl); font-weight: 600;
}
.feed-card-body { padding: var(--space-6) var(--space-6) var(--space-7); display: flex; flex-direction: column; flex: 1; }
.feed-card-eyebrow {
  font-size: 11px; color: var(--gold-strong); letter-spacing: .08em;
  text-transform: uppercase; font-weight: 700; margin-bottom: var(--space-3);
}
/* Listing cards carry the same date the detail hero shows. Category and date
   share one baseline, so adding the date costs no extra card height; tabular
   figures keep a mixed grid aligned and `nowrap` stops a date from breaking in
   the narrowest card. A row with no date simply shows the category alone. */
.feed-card-meta {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--space-3); margin-bottom: var(--space-3);
}
.feed-card-meta .feed-card-eyebrow { margin-bottom: 0; min-width: 0; }
.feed-card-date {
  flex: none; color: var(--text-muted); font-size: var(--text-xs);
  font-variant-numeric: tabular-nums; letter-spacing: .02em; white-space: nowrap;
}
.feed-card h3 {
  color: var(--ink); margin: 0 0 var(--space-3); font-family: var(--font-display);
  font-size: var(--text-xl); line-height: 1.3;
}
.feed-card p {
  color: var(--text-muted); font-size: var(--text-sm); line-height: 1.75; margin: 0 0 var(--space-5);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.feed-card .meta { margin-top: auto; font-size: var(--text-sm); color: var(--gold-strong); font-weight: 600; letter-spacing: .04em; }
.feed-empty { text-align: center; color: var(--text-muted); padding: var(--space-10) 0; }

/* ─── controls ──────────────────────────────────────────────────────────── */
.feed-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-pill); cursor: pointer;
  border: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 92%, transparent);
  color: var(--ink); font-size: 24px; line-height: 1;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow-soft);
  transition: opacity .2s, border-color .2s, color .2s, background .2s;
  z-index: 2;
}
.feed-nav--prev { left: -18px; }
.feed-nav--next { right: -18px; }
.feed-nav:hover { border-color: var(--gold); color: var(--gold-strong); }
.feed-nav:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.feed-nav[disabled] { opacity: 0; pointer-events: none; }

.feed-dots { display: none; justify-content: center; gap: var(--space-2); margin-top: var(--space-6); }
.feed-dot {
  width: 7px; height: 7px; padding: 0; border: 0; border-radius: var(--radius-pill);
  background: var(--line); cursor: pointer; transition: width .25s var(--ease-out), background .2s;
}
.feed-dot.active { width: 22px; background: var(--gold); }
.feed-dot:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* Phones and tablets: arrows give way to the dots (spec §2.1) */
@media (max-width: 860px) {
  .feed-nav { display: none; }
  .feed-dots { display: flex; }
  .feed-track { gap: var(--space-5); }
}

/* The listing pages keep the responsive wrap; nothing here is a rail.
   A 258px floor fits four balanced columns on the 1280 container instead of
   three oversized ones. Centered flex wrap (not `auto-fit` grid): with a grid,
   a count that doesn't fill the last row (5, 7 … cards) docks the orphan to
   the left edge; flex keeps every row — including a partial last row —
   centred, and `max-width` stops a lone orphan stretching into a slab. */
.feed-grid {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: var(--space-6);
}
.feed-grid > * { flex: 1 1 258px; min-width: 0; max-width: 420px; }

@media (prefers-reduced-motion: reduce) {
  .feed-track { scroll-behavior: auto; }
  .feed-card:hover { transform: none; }
}

/* ===== blocks/features.css ===== */
/* Features — staggered "creative" grid by default, plain grid as an option. */

.block-features { max-width: var(--container); }
/* The block-level title/desc of a features grid is a SUB-ordinate label, not a
   section heading: it must sit clearly below the page's <h2> section title so a
   grid like "四个力学维度" never competes with "力学平衡方程式" for the eye.
   Rendered as a small gold eyebrow + a short muted lead (no <h2>/<h3> weight). */
.block-features .features-eyebrow {
  font-family: var(--font-display); font-weight: 600;
  font-size: var(--text-sm); letter-spacing: .08em;
  color: var(--gold-strong); margin: 0 0 var(--space-2);
}
.block-features .features-lead {
  color: var(--text-muted); font-size: var(--text-base);
  line-height: 1.7; margin: 0 0 var(--space-6); max-width: 62ch;
}
/* Plain feature grid: data-driven flex wrap. Cards grow to fill the row and
   wrap when they no longer fit, and any orphan row is centred (not left-docked)
   — so a 5-card set reads as one tidy row on desktop and a balanced 3+2 /
   2+2+1 on smaller screens instead of an awkward left-aligned stray card. */
.feature-grid {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: var(--space-6);
}
/* basis 270 + max 320 so a 1280 container holds exactly 4 per row (→ 4+3 for 7
   cards) instead of 5+2 with two orphan cards ballooning to fill the row. */
.feature-grid > .feature-card { flex: 1 1 270px; min-width: 0; max-width: 320px; }
.feature {
  padding: var(--space-9, 48px) var(--space-8); border: 1px solid var(--line);
  border-radius: var(--radius-lg); background: var(--surface); position: relative;
  overflow: hidden; transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out), border-color .2s;
}
.feature:hover { transform: translateY(-6px); box-shadow: var(--shadow-card); border-color: var(--gold); }
.feature-icon { color: var(--gold); font-size: var(--text-xl); margin-bottom: var(--space-3); }
.feature-thumb { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-md); margin-bottom: var(--space-4); }
.feature h3 { color: var(--ink); margin: 0 0 var(--space-2); font-family: var(--font-display); font-size: var(--text-xl); letter-spacing: .01em; }
.feature p { color: var(--text-muted); font-size: var(--text-base); line-height: 1.85; margin: 0; }

/* creative layout: 12-column, alternating spans, vertical offset */
.feature-grid-creative {
  display: grid; grid-template-columns: repeat(12, 1fr);
  gap: var(--space-6); align-items: start;
}
.feature-card {
  position: relative; padding: var(--space-9, 48px) var(--space-8);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface); overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform .35s var(--ease-out), box-shadow .35s var(--ease-out), border-color .2s;
}
.feature-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-float); border-color: var(--gold); }
.feature-card .feature-num {
  display: inline-block;
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 600;
  line-height: 1; color: var(--gold); letter-spacing: .03em;
  margin-bottom: var(--space-4); padding: var(--space-1) var(--space-4);
  border: 1px solid rgba(16,32,31,.30); border-radius: var(--radius-pill);
  background: rgba(16,32,31,.07);
}
.feature-card .feature-thumb { height: auto; border-radius: var(--radius-md); margin-bottom: var(--space-5); transition: transform .6s var(--ease-out); }
.feature-card:hover .feature-thumb { transform: scale(1.04); }
.feature-card .feature-icon { color: var(--gold); font-size: var(--text-xl); margin-bottom: var(--space-3); }
.feature-card h3 { color: var(--ink); margin: 0 0 var(--space-3); font-family: var(--font-display); font-size: var(--text-xl); }
.feature-card p { color: var(--text); font-size: var(--text-base); line-height: 1.85; margin: 0; }
/* Optional block-level call-to-action under the grid (e.g. a founder strip
   linking to the physicians page). Centred, calm, reuses the ghost button. */
.feature-actions { margin-top: var(--space-7); display: flex; justify-content: center; }
.feature-grid-creative .feature-card:nth-child(4n+1) { grid-column: span 7; }
.feature-grid-creative .feature-card:nth-child(4n+2) { grid-column: span 5; transform: translateY(45px); }
.feature-grid-creative .feature-card:nth-child(4n+3) { grid-column: span 5; }
.feature-grid-creative .feature-card:nth-child(4n+4) { grid-column: span 7; transform: translateY(45px); }
.feature-grid-creative .feature-card:nth-child(4n+2):hover,
.feature-grid-creative .feature-card:nth-child(4n+4):hover { transform: translateY(37px); }

@media (max-width: 992px) {
  .feature-grid-creative { grid-template-columns: repeat(2, 1fr); }
  .feature-grid-creative .feature-card:nth-child(n) { grid-column: span 1; transform: none; }
}
@media (max-width: 600px) {
  .feature-grid-creative { grid-template-columns: 1fr; }
}

/* ===== blocks/stats.css ===== */
/* Stats — big serif numerals in gold, with the count-up animation driven by
   site.js. Gold is reserved for the number only (plan B7.1). */

.block-stats { max-width: var(--container); }
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: var(--space-6);
}
.stat {
  text-align: center; padding: var(--space-9, 48px) var(--space-4);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface); position: relative;
}
.stat::before {
  content: ""; position: absolute; top: var(--space-4); left: 50%;
  transform: translateX(-50%); width: 30px; height: 2px; background: var(--gold);
}
.stat-value {
  font-family: var(--font-display); font-size: clamp(2.4rem, 5vw, 3.4rem);
  color: var(--gold); line-height: 1; font-variant-numeric: tabular-nums;
}
.stat-label { margin-top: var(--space-4); color: var(--text-muted); font-size: var(--text-base); letter-spacing: .03em; }

/* Data-driven: columns auto-fit so the row follows the card count and the
   section height tracks the content instead of leaving an empty band. */
.stats-grid-bold { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-5); }
.stat-card {
  position: relative; padding: clamp(26px, 2.8vw, 40px) var(--space-6);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface); text-align: center; overflow: hidden;
  transition: transform .3s var(--ease-out), border-color .2s;
}
.stat-card:hover { transform: translateY(-6px); border-color: var(--gold); }
.stat-card::after {
  content: ""; position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  transform: scaleX(0); transition: transform .45s var(--ease-out);
}
.stat-card:hover::after { transform: scaleX(1); }
.stat-card .stat-value { font-size: clamp(2.4rem, 4.6vw, 3.6rem); margin-bottom: var(--space-3); }
.stat-card .stat-label {
  color: var(--text-muted); font-size: var(--text-sm);
  letter-spacing: .12em; text-transform: uppercase; font-weight: 600; margin-top: 0;
}
.stat-card .stat-suffix { font-size: .45em; color: var(--gold-strong); vertical-align: super; margin-left: var(--space-1); }
.section--dark .stat-card { background: rgba(255,255,255,.04); }

@media (max-width: 720px) { .stats-grid-bold { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .stats-grid-bold { grid-template-columns: 1fr; } }

/* ===== blocks/faq.css ===== */
/* FAQ block + the FAQ listing page. Uses <details> so it works with no JS. */

.block-faq { max-width: var(--container-narrow); }
.faq-list { display: flex; flex-direction: column; gap: var(--space-4); }
.faq-item {
  border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--surface); padding: 0 var(--space-7);
  transition: border-color .18s, box-shadow .18s;
}
.faq-item[open] { border-color: var(--gold); box-shadow: var(--shadow-soft); }
.faq-item summary {
  cursor: pointer; list-style: none; padding: var(--space-6) 0;
  font-weight: 600; color: var(--ink);
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-4);
  font-family: var(--font-display); font-size: var(--text-lg);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-mark { color: var(--gold); font-size: var(--text-xl); flex-shrink: 0; line-height: 1; transition: transform .25s var(--ease-out); }
.faq-item[open] .faq-mark { transform: rotate(45deg); }
.faq-answer { padding: 0 0 var(--space-6); color: var(--text-muted); line-height: 1.9; }
.faq-answer p { margin: 0 0 var(--space-4); }
.faq-answer p:last-child { margin-bottom: 0; }
/* Grouping (spec §7.2): the listing page splits by `faq_items.category`. The
   label stays a quiet eyebrow — it separates, it does not compete with the
   questions themselves. */
.faq-group + .faq-group { margin-top: var(--space-10); }
.faq-group-title {
  font-size: var(--text-sm); letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold-strong); font-weight: 600; margin: 0 0 var(--space-5);
}

/* ===== blocks/brands.css ===== */
/* Partner / technology brands strip. */

.block-brands { max-width: var(--container); }
.brands-grid { display: flex; flex-wrap: wrap; gap: var(--space-6); justify-content: center; }
.brand-card {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-3);
  padding: var(--space-8) var(--space-9, 48px);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface); min-width: 220px;
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.brand-card:hover { border-color: var(--gold); box-shadow: var(--shadow-soft); transform: translateY(-3px); }
.brand-logo { height: 46px; width: auto; max-width: 180px; object-fit: contain; }
.brand-logo--mono { filter: grayscale(1) opacity(.7); transition: filter .18s; }
.brand-card:hover .brand-logo--mono { filter: none; }
.brand-logo-placeholder {
  width: 64px; height: 46px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  font-family: var(--font-display); font-size: var(--text-xl); font-weight: 600;
  color: var(--gold); background: var(--gold-soft);
}
.brand-name { font-family: var(--font-display); font-weight: 600; color: var(--ink); font-size: var(--text-lg); }
.brand-desc { font-size: var(--text-sm); color: var(--text-muted); text-align: center; }

/* ===== blocks/video.css ===== */
/* Video block — native file or an embedded YouTube / Bilibili / Vimeo player. */

.block-video { max-width: 920px; }
.block-video.block-video--wide { max-width: var(--container); }
.video-wrap {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-card); border: 1px solid var(--line); background: #000;
}
.video-wrap video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: #000; }
.video-wrap iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; object-fit: cover; }
.video-poster-button {
  position: absolute; inset: 0; border: none; background: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.video-poster-button img { width: 100%; height: 100%; object-fit: cover; }
.video-poster-button::after {
  content: ""; position: absolute; inset: 0; background: rgba(18,14,10,.32);
  transition: background .25s;
}
.video-poster-button:hover::after { background: rgba(18,14,10,.16); }
.video-play-glyph {
  position: relative; z-index: 2; width: 76px; height: 76px; border-radius: var(--radius-pill);
  border: 1px solid rgba(255,255,255,.6); background: rgba(22,18,14,.34);
  display: flex; align-items: center; justify-content: center;
  transition: transform .25s var(--ease-out), background .25s;
}
.video-play-glyph::before {
  content: ""; width: 0; height: 0; margin-left: 5px;
  border-left: 18px solid #fff; border-top: 11px solid transparent; border-bottom: 11px solid transparent;
}
.video-poster-button:hover .video-play-glyph { transform: scale(1.08); background: rgba(16,32,31,.55); }
.video-note { margin-top: var(--space-4); color: var(--text-muted); font-size: var(--text-sm); letter-spacing: .02em; text-align: center; }
.section--dark .video-note { color: var(--color-on-dark-muted); }

/* ===== blocks/cta.css ===== */
/* Closing CTA card. */

.cta-card {
  text-align: center; max-width: var(--container-narrow); margin: 0 auto;
  background: linear-gradient(135deg, var(--ink) 0%, var(--accent-2) 100%);
  border-radius: var(--radius-xl); padding: clamp(var(--space-10), 6vw, 72px) var(--space-8);
  box-shadow: var(--shadow-card); position: relative; overflow: hidden;
}
.cta-card.has-bg { background-size: cover; background-position: center; }
.cta-card.has-bg::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(20,16,12,.86), rgba(20,16,12,.92));
}
.cta-inner { position: relative; z-index: 1; color: var(--color-on-dark); }
.cta-card h2 { color: #fff; margin: 0 0 var(--space-4); font-size: var(--text-2xl); }
.cta-card p { color: var(--color-on-dark-muted); margin: 0 auto var(--space-8); font-size: var(--text-lg); max-width: 48ch; }
.cta-actions { display: flex; gap: var(--space-4); justify-content: center; flex-wrap: wrap; margin-top: var(--space-2); }
.cta-card .btn-primary { padding: 14px 34px; font-size: var(--text-base); }
.cta-card .btn-ghost { color: #fff; border-color: rgba(255,255,255,.42); }
.cta-card .btn-ghost:hover { background: rgba(255,255,255,.12); color: #fff; }
.cta-card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.07) 50%, transparent 60%);
  transform: translateX(-100%);
}
@media (prefers-reduced-motion: no-preference) {
  .cta-card:hover::after { animation: ctaShimmer 1.2s var(--ease-out); }
}
@keyframes ctaShimmer { to { transform: translateX(100%); } }

/* ===== blocks/ad_banner.css ===== */
/* Advertisement banner (P5-15): a full-bleed promo slot. Edge-to-edge by
   default so a campaign image can span the viewport without the container
   padding boxing it in. */
.block-ad-banner { width: 100%; }
.block-ad-banner .ad-banner-link {
  display: block; position: relative; text-decoration: none; color: inherit;
}
.block-ad-banner .ad-banner-img {
  width: 100%; aspect-ratio: 21 / 9; object-fit: cover; display: block;
  background: var(--gold-soft);
}
/* A small, on-image button so the CTA text is visible even when the banner is
   mostly imagery. Sits bottom-left in the editorial grid, not floating dead-centre. */
.block-ad-banner .ad-banner-cta {
  position: absolute; left: var(--gutter); bottom: var(--gutter);
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  background: rgba(36, 28, 21, 0.78); color: #fff;
  border: 1px solid rgba(255,255,255,0.5); border-radius: var(--radius-pill);
  font-size: var(--text-sm); letter-spacing: .04em; font-weight: 600;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: background .2s, transform .2s var(--ease-out);
}
.block-ad-banner .ad-banner-link:hover .ad-banner-cta {
  background: var(--gold-strong); transform: translateY(-2px);
}
.block-ad-banner .ad-banner-link:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

@media (max-width: 720px) {
  .block-ad-banner .ad-banner-img { aspect-ratio: 16 / 9; }
  .block-ad-banner .ad-banner-cta { left: var(--space-4); bottom: var(--space-4); }
}

/* ===== blocks/rich_text.css ===== */
/* Rich text block — reuses the reading typography from components/detail.css so a
   body of prose looks identical whether it lives in an article or a page block. */

.block-richtext { max-width: var(--container-narrow); }
.block-richtext .detail-body, .block-richtext > div:first-child { max-width: 68ch; }
.richtext-sheet {
  background: #FFFFFF; border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-soft);
  padding: clamp(var(--space-7), 4vw, var(--space-12));
}
.block-richtext img { border-radius: var(--radius-md); }

/* Within-section hierarchy: a larger lead line sets the premise right under the
   heading, and <h3> sub-headings keep longer sections scannable. This is what
   turns a flat paragraph wall into a readable, layered page. */
.block-richtext p.lead {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 1.5vw, 1.5rem);
  line-height: 1.5;
  color: var(--ink);
  margin: 0 0 var(--space-6);
}
.block-richtext h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.12rem, 1.5vw, 1.38rem);
  line-height: 1.3;
  color: var(--ink);
  margin: var(--space-10) 0 var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--gold-soft);
}
.block-richtext h3:first-child { margin-top: 0; }

/* ===== blocks/image.css ===== */
/* Image block — full-bleed capable, always cropped, always dimensioned (B7.7). */

.block-image { max-width: var(--container); }
.block-image.is-full { max-width: none; width: 100%; }
.block-image figure { margin: 0; }
.block-image .image-frame {
  border-radius: var(--radius-lg); overflow: hidden; background: var(--gold-soft);
  box-shadow: var(--shadow-soft);
}
.block-image.is-full .image-frame { border-radius: 0; box-shadow: none; }
.block-image img { width: 100%; height: 100%; object-fit: cover; }
.block-image figcaption {
  margin-top: var(--space-4); text-align: center;
  font-size: var(--text-sm); color: var(--text-muted); letter-spacing: .04em;
}

/* ===== blocks/heading.css ===== */
/* Heading + article list + generic fallback: the three small blocks.
   Both titles are left-aligned like every other block head (spec §1.4): the
   centred variant only survives as an explicit modifier. */

.block-heading {
  font-family: var(--font-display); color: var(--ink);
  font-size: var(--text-display); line-height: var(--leading-snug);
  margin: 0 auto; text-align: left; max-width: var(--container);
}
.block-heading::after {
  content: ""; display: block; width: 56px; height: 3px; margin-top: var(--space-4);
  background: linear-gradient(90deg, var(--gold, var(--brand)), transparent);
}
.block-heading--left { text-align: left; }
.block-heading--center { text-align: center; }

.block-articles { max-width: var(--container); }
.block-articles h2 { margin: 0 0 var(--space-8); }
.article-list { list-style: none; padding: 0; display: grid; gap: var(--space-4); }
.article-list li {
  padding: var(--space-5) var(--space-6);
  border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--surface); transition: border-color .18s, transform .18s;
}
.article-list li:hover { border-color: var(--gold); transform: translateX(4px); }
.article-list a { font-weight: 600; color: var(--ink); text-decoration: none; font-size: var(--text-lg); }
.article-list a:hover { color: var(--gold-strong); }
.article-list p { color: var(--text-muted); margin: var(--space-2) 0 0; font-size: var(--text-sm); line-height: 1.7; }

.block-unknown {
  max-width: var(--container); padding: var(--space-6);
  border: 1px dashed var(--border); border-radius: var(--radius-md);
  background: var(--surface);
}
.block-unknown h3 { margin: 0 0 var(--space-3); color: var(--ink); }
.block-unknown p { color: var(--text-muted); margin: 0 0 var(--space-3); }

/* ===== blocks/part_divider.css ===== */
/* Part divider — a full-width dark band that groups the surrounding sections
   into a logical "part" of the page (认识根源 / 理解框架 / 走向治疗). It never
   carries body content; it only labels a movement so a long page reads as a
   numbered argument instead of a flat stack of equal headings.

   The band sits inside a .section--dark (the block's tone=dark flips the
   section to the ink ground), so copy here is light on dark. */

.block-part-divider {
  max-width: var(--container);
  /* A part band should breathe more than a normal section's inner content. */
  padding: var(--space-6) 0;
}
.block-part-divider .part-eyebrow {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-sm);
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 var(--space-3);
}
.block-part-divider .part-title {
  font-family: var(--font-display);
  font-weight: 600;
  color: #fff;
  font-size: clamp(1.7rem, 3.2vw, 2.7rem);
  line-height: 1.18;
  margin: 0;
}
.block-part-divider .part-title::after {
  content: "";
  display: block;
  width: 64px;
  height: 3px;
  margin-top: var(--space-4);
  background: linear-gradient(90deg, var(--gold, var(--brand)), transparent);
}
.block-part-divider .part-intro {
  color: rgba(255, 255, 255, .74);
  font-size: var(--text-lg);
  line-height: 1.75;
  max-width: 62ch;
  margin: var(--space-5) 0 0;
}

/* ===== blocks/publication.css ===== */
/* Publication card — a formal journal-style citation used on the Theory page
   (the Hammock Hypothesis, the canonical paper) and the About page's
   "相关学术发表". Two columns on desktop (cover left, text right), stacked on
   narrow screens, with a white surface + gold hairline so it reads as a
   professional paper card rather than a loose text list. */

.block-publication {
  max-width: var(--container);
}

.block-publication .pub-grid {
  display: grid;
  grid-template-columns: minmax(200px, 280px) 1fr;
  gap: var(--space-7);
  align-items: center;
  background: var(--surface, #fff);
  border: 1px solid var(--border, rgba(16,32,31,0.22));
  border-radius: var(--radius-lg, 16px);
  padding: var(--space-7);
  box-shadow: var(--shadow-soft, 0 8px 26px rgba(16,24,28,0.06));
}

.block-publication .pub-cover {
  line-height: 0;
}

.block-publication .pub-cover img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--gold-soft, var(--brand-soft));
  box-shadow: var(--shadow-card, 0 18px 40px rgba(16,24,28,0.08));
}

.block-publication .pub-eyebrow {
  font-family: var(--font-display, serif);
  font-weight: 600;
  font-size: var(--text-sm, 0.875rem);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold, var(--brand));
  margin: 0 0 var(--space-3);
}

.block-publication .pub-title {
  font-family: var(--font-display, serif);
  font-weight: 600;
  font-size: clamp(1.3rem, 2.4vw, 2rem);
  line-height: 1.22;
  color: var(--ink, var(--ink));
  margin: 0;
}

.block-publication .pub-meta {
  margin: var(--space-3) 0 0;
  font-size: var(--text-sm, 0.875rem);
  letter-spacing: .02em;
  color: var(--text-muted, #7A6F60);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--gold-soft, var(--brand-soft));
}

.block-publication .pub-abstract {
  margin: var(--space-4) 0 0;
  font-size: var(--text-lg, 1.125rem);
  line-height: var(--leading-body, 1.85);
  color: var(--text, #4A4138);
  max-width: 60ch;
}

.block-publication .pub-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-6);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-pill, 999px);
  background: var(--gold, var(--brand));
  color: #fff;
  font-weight: 600;
  font-size: var(--text-base, 1rem);
  text-decoration: none;
  transition: background .15s ease, transform .15s ease;
}

.block-publication .pub-link:hover,
.block-publication .pub-link:focus-visible {
  background: var(--gold-strong, var(--brand-strong));
  transform: translateY(-1px);
  outline: none;
}

.block-publication .pub-link-arrow {
  transition: transform .15s ease;
}

.block-publication .pub-link:hover .pub-link-arrow,
.block-publication .pub-link:focus-visible .pub-link-arrow {
  transform: translateX(3px);
}

/* Narrow screens: stack cover above the text so the card never squeezes the
   cover into an unreadable sliver (plan B7.11 — fixed-height media avoids CLS). */
@media (max-width: 720px) {
  .block-publication .pub-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
    padding: var(--space-6);
  }
  .block-publication .pub-cover {
    max-width: 240px;
    margin: 0 auto;
  }
}

/* ===== blocks/scenario_slider.css ===== */
/* Scenario carousel — reference-style "animated explainer".
   Split panel (illustration left, explanation right) inside a rounded white card;
   green is the interactive/scene accent (badge, 关键对应 tag, active thumb).
   Pairs with blocks/scenario_slider.html + initScenarioSlider in site.js. */

.block-scenario-slider {
  --ss-gap: clamp(20px, 3vw, 56px);
  --ss-radius: 18px;
  width: 100%;
  max-width: var(--container, 1280px);
  margin-inline: auto;
}

.scenario-kicker {
  text-align: center;
  margin-bottom: clamp(16px, 2.4vw, 30px);
}
.scenario-kicker h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(26px, 3.2vw, 42px);
  letter-spacing: 0.01em;
  color: var(--ink);
}
.scenario-kicker h2::after {
  content: ""; display: block; width: 56px; height: 2px;
  margin: 14px auto 0; background: linear-gradient(90deg, var(--gold), transparent);
}

.scenario-player {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  padding: clamp(18px, 2.6vw, 34px);
}

.scenario-stage {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--ss-radius) - 4px);
}

.scenario-viewport { overflow: hidden; }

.scenario-track {
  display: flex;
  width: 100%;
  transition: transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform;
}

.scenario-slide {
  flex: 0 0 100%;
  min-width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--ss-gap);
  align-items: center;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.scenario-slide.is-active { opacity: 1; }

.scenario-media {
  margin: 0;
  position: relative;
  border-radius: var(--ss-radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--porcelain);
  box-shadow: 0 0 0 1px rgba(16,32,31,0.22);
}
.scenario-media img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
/* green scene badge — top-left of the illustration, the signature "场景 N" tag */
.scenario-badge {
  position: absolute; left: 12px; top: 12px; z-index: 2;
  font-family: var(--font-body); font-size: 12px; font-weight: 600;
  letter-spacing: 0.04em;
  color: #fff; background: var(--green);
  padding: 6px 12px; border-radius: var(--radius-pill);
  box-shadow: 0 4px 14px rgba(91, 117, 83, 0.32);
}

.scenario-body { padding-inline: clamp(4px, 1vw, 16px); }
.scenario-heading {
  display: inline-block; font-size: 13px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--gold-strong); margin-bottom: 12px;
}
.scenario-heading::before {
  content: ""; display: inline-block; width: 26px; height: 1px;
  margin-right: 12px; vertical-align: middle; background: var(--gold);
}
.scenario-title {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(24px, 2.8vw, 38px); line-height: 1.18;
  color: var(--ink); margin: 0 0 14px;
}
/* green 关键对应 tag — the "this scene maps to anatomy" chip */
.scenario-key {
  display: inline-block; font-family: var(--font-body); font-size: 13px;
  font-weight: 600; color: var(--green);
  background: var(--green-soft);
  border: 1px solid rgba(91, 117, 83, 0.28);
  padding: 6px 14px; border-radius: var(--radius-pill);
  margin-bottom: 16px;
}
.scenario-text {
  font-size: clamp(15px, 1.15vw, 17px); line-height: 1.9;
  color: var(--text); margin: 0;
}

/* counter — top-right of the player stage */
.scenario-topbar {
  position: absolute; right: 14px; top: 14px; z-index: 3;
  font-family: var(--font-body); font-variant-numeric: tabular-nums;
  font-size: 13px; letter-spacing: 0.06em;
  color: var(--ink);
  background: rgba(255,255,255,0.88); backdrop-filter: blur(4px);
  padding: 6px 14px; border-radius: var(--radius-pill);
  box-shadow: 0 4px 14px rgba(42,38,32,.10);
}
.scenario-topbar b {
  font-family: var(--font-display); font-size: 22px; font-weight: 600;
  color: var(--gold); margin-right: 2px;
}

/* controls bar: prev · progress · next */
.scenario-controls {
  display: flex; align-items: center; justify-content: center;
  gap: clamp(16px, 2vw, 28px);
  margin-top: clamp(20px, 2.6vw, 30px);
}
.scenario-arrow {
  flex: 0 0 auto; width: 52px; height: 52px; border-radius: 999px;
  border: 2px solid var(--gold);
  background: color-mix(in srgb, var(--gold) 9%, #ffffff);
  color: var(--gold); font-size: 28px; font-weight: 700; line-height: 1;
  cursor: pointer; display: grid; place-items: center;
  box-shadow: 0 6px 18px rgba(16,32,31,0.16);
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.scenario-arrow:hover { background: var(--gold); color: #fff; box-shadow: 0 8px 22px rgba(16,32,31,0.30); }
.scenario-arrow:active { transform: scale(0.94); }
.scenario-arrow:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.scenario-progress {
  flex: 1 1 auto; max-width: 320px; height: 4px; border-radius: 999px;
  background: rgba(16,32,31,0.18); overflow: hidden;
}
.scenario-progress > span {
  display: block; height: 100%; width: 0; border-radius: 999px;
  background: var(--gold); transition: width 0.5s cubic-bezier(0.22,0.61,0.36,1);
}

/* thumbnail scene index — doubles as navigation */
.scenario-index {
  display: flex; flex-wrap: wrap; gap: var(--space-3);
  justify-content: center; margin-top: clamp(18px, 2vw, 26px);
}
.scenario-thumb {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  min-width: 92px; padding: 10px 14px; cursor: pointer;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-md);
  text-align: left; transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.scenario-thumb:hover { transform: translateY(-2px); border-color: var(--gold-soft); }
.scenario-thumb.is-active { border-color: var(--green); background: var(--green-soft); }
.scenario-thumb-num {
  font-family: var(--font-display); font-size: 18px; font-weight: 600; color: var(--ink);
}
.scenario-thumb.is-active .scenario-thumb-num { color: var(--green); }
.scenario-thumb-label {
  font-family: var(--font-body); font-size: 12px; color: var(--text-muted);
  letter-spacing: 0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 150px;
}
.scenario-thumb:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* tablet / phone: stack the image above the text */
@media (max-width: 860px) {
  .scenario-slide { grid-template-columns: 1fr; gap: 18px; }
  .scenario-media { aspect-ratio: 16 / 10; }
}

@media (prefers-reduced-motion: reduce) {
  .scenario-track { transition: none; }
  .scenario-slide { transition: none; }
}

/* ===== blocks/media_gallery.css ===== */
/* Shared media gallery (2026-11-21). Fluid grid, no fixed column count, no
   stacked tooltips (title lives on the label only), keyboard focus on both
   linked and non-linked cards. Colours come from semantic vars so the same
   stylesheet serves a warm-gold brand and a cool academic brand. */
.block-media-gallery .block-lead { max-width: var(--reading-width); }

.mg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: var(--space-6);
  margin-top: var(--space-8);
}

.mg-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: transform .15s var(--ease-out),
              box-shadow .15s var(--ease-out),
              border-color .15s var(--ease-out);
}
.mg-card:hover, .mg-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
  border-color: var(--brand);
}
.mg-card.is-featured { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); }

.mg-frame {
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--bg);
  overflow: hidden;
}
.mg-frame img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .15s var(--ease-out);
}
.mg-card:hover .mg-frame img, .mg-card:focus-visible .mg-frame img { transform: scale(1.02); }

.mg-meta { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4); }
.mg-label {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mg-desc { font-size: var(--text-sm); color: var(--text-muted); }
.mg-action { font-size: var(--text-xs); color: var(--brand); letter-spacing: .04em; }

/* Inside a dark section --ink is remapped to white, so never use it as a
   ground. Use the dedicated surface-dark / on-dark tokens instead. */
.section--dark .mg-card {
  background: var(--surface-dark);
  border-color: var(--color-on-dark-line);
  color: var(--color-on-dark);
}
.section--dark .mg-frame { background: var(--surface-dark); }
.section--dark .mg-desc { color: var(--color-on-dark-muted); }
.section--dark .mg-action { color: var(--color-on-dark); }
.section--dark .mg-card:hover, .section--dark .mg-card:focus-visible {
  border-color: var(--color-on-dark);
}

@media (max-width: 600px) {
  .mg-grid { gap: var(--space-4); }
  .mg-meta { padding: var(--space-3); }
}

/* ===== responsive.css ===== */
/* Responsive rules that cross component boundaries live here so each component
   file can stay focused on its own geometry. */

/* Unified wrap behaviour. The desktop card grids (feed/listing, cards, plain
   features) are centred flex wraps (see blocks/content_feed.css,
   components/cards.css, blocks/features.css), so the old grid-template
   overrides are replaced by flex-basis floors: two-up on tablets, full-width
   single column on phones. */
@media (max-width: 992px) and (min-width: 601px) {
  .feed-grid > *, .cards-grid > .card, .feature-grid > .feature-card { flex-basis: 300px; }
}
@media (max-width: 600px) {
  .feed-grid > *, .cards-grid > .card, .feature-grid > .feature-card { flex: 1 1 100%; max-width: 100%; }
}

@media (max-width: 900px) {
  .feed-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 720px) {
  :root {
    --section-y: clamp(64px, 13vw, 96px);
    --header-h: 64px;
    --header-h-compact: 56px;
  }
  .hero-arrow { display: none; }
  .card-photo--wide { aspect-ratio: 16 / 9; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .brands-grid { flex-direction: column; align-items: stretch; }
  .brand-card { min-width: auto; }
}

@media (max-width: 480px) {
  .site-header { padding: 0 var(--space-4); }
  .site-header .brand { font-size: var(--text-xl); }
  .lang-switch a { font-size: var(--text-xs); padding: var(--space-1) var(--space-2); }
  .stats-grid, .stats-grid-bold { grid-template-columns: 1fr; }
  /* the header is sticky (in flow), so this is breathing room, not a clearance
     offset — keep it on the same scale as the desktop masthead */
  .page-hero { padding-top: var(--space-8); }
  .detail-sheet { padding: var(--space-6) var(--space-5); border-radius: var(--radius-md); }
}

/* 360-wide phones (Galaxy A-series, iPhone SE in some locales): brand + three
   language labels + the menu toggle exceed the bar by ~15px and push 中文/ENGLISH
   off the right edge. Tighten the labels rather than the tap targets. */
@media (max-width: 380px) {
  .site-header { gap: var(--space-2); }
  .lang-switch a {
    font-size: 10px; padding: var(--space-1) 4px; letter-spacing: .02em;
  }
}

/* touch devices: hover transforms look broken, so neutralise them */
@media (hover: none) {
  .card:hover, .feed-card:hover, .feature-card:hover, .stat-card:hover, .brand-card:hover {
    transform: none; box-shadow: var(--shadow-soft);
  }
  .card:hover .card-photo img,
  .feed-card:hover .feed-card-media img { transform: none; }
}
