/* ==========================================================
   南金陵艺术空间 · 介绍页
   浅色基调：纸白 / 雾白 / 羊皮纸三种底色随章节缓慢过渡
   ========================================================== */

@font-face {
  font-family: "Local Serif SC";
  src: local("Noto Serif SC"), local("NotoSerifSC-Regular"), local("Source Han Serif SC"), local("SourceHanSerifSC-Regular");
  font-weight: 200 900;
  font-display: swap;
}

:root {
  /* 底色 */
  --paper: #f6f1e8;
  --mist: #f1f0eb;
  --parchment: #f1e7d6;
  /* 墨与金 */
  --ink: #2b231c;
  --ink-2: #5b4e41;
  --ink-3: #73644f;         /* 注释文字：三种底色上对比度 ≥ 4.6:1 */
  --gold: #a07a38;          /* 线条：浅底上的深金（只用于线条与装饰） */
  --gold-ink: #7f5f27;      /* 金色文字：对比度 ≥ 4.8:1，达到 WCAG AA */
  --gold-2: #c9a25d;
  --glow: #e7c27a;          /* 光晕 */
  --spire: #b4432f;         /* 尖顶红，只作点缀 */
  --rule: rgba(43, 35, 28, .14);

  --serif-zh: "Local Serif SC", "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --serif-la: "Cormorant Garamond", "Cormorant", "Garamond", "Georgia", "Times New Roman", serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --pad: clamp(20px, 5.5vw, 88px);
  --vh: 1vh;
  --svh: 100vh;
}
@supports (height: 100svh) { :root { --svh: 100svh; } }

/* 章节底色 --tone 挂在 body 上（普通变量，瞬时切换）；body 自身用 background-color 过渡。
   少数需要"跟底色一致"的元素（文字底晕、导航底、景章节的吸顶底）各自把 --bg 过渡到 --tone。
   --bg 注册为不继承，避免过渡期间全页数百个元素每帧重算样式。 */
@property --bg { syntax: "<color>"; inherits: false; initial-value: #f6f1e8; }

*, *::before, *::after { box-sizing: border-box; }
/* 只在 html 上裁横向溢出：写在 body 上会让不支持 clip 的旧浏览器把 body 变成滚动容器，sticky 全部失效 */
html { -webkit-text-size-adjust: 100%; scroll-behavior: auto; overflow-x: hidden; overflow-x: clip; }
body {
  --tone: var(--paper);
  margin: 0;
  background-color: var(--tone);
  color: var(--ink);
  font-family: var(--serif-zh);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 1.4s var(--ease-io);
}
body[data-tone="mist"] { --tone: var(--mist); }
body[data-tone="parchment"] { --tone: var(--parchment); }

/* 读屏可读、视觉隐藏 */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* 压在线条上的文字：身后一团很淡的底色晕开，保证可读 */
.veil { isolation: isolate; }
.veil::before {
  content: ""; position: absolute; z-index: -1; inset: -22% -16%;
  --bg: var(--tone); transition: --bg 1.4s var(--ease-io);
  background: radial-gradient(closest-side, var(--bg) 58%, rgba(246, 241, 232, 0));
  pointer-events: none;
}
@supports (color: color-mix(in srgb, red, blue)) {
  .veil::before { background: radial-gradient(closest-side, var(--bg) 58%, color-mix(in srgb, var(--bg) 0%, transparent)); }
}
/* 不支持 overflow-x: clip 的浏览器：底晕不向左右外扩，避免撑宽页面 */
@supports not (overflow-x: clip) { .veil::before { left: 0; right: 0; } }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, p, ol, ul, figure { margin: 0; padding: 0; }
ol, ul { list-style: none; }
::selection { background: rgba(160, 122, 56, .22); }

/* ---------- 全局流动线条 ---------- */
.flow {
  position: fixed; left: 0; top: 0;
  width: 100%; height: var(--svh);
  pointer-events: none;
  z-index: 0;
  overflow: visible;
}
/* viewBox 与像素 1:1，无需 non-scaling-stroke（它与 pathLength 虚线描线同用时各浏览器表现不一） */
.flow path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.flow__lines path { stroke: url(#flowFade); }
.flow stop { stop-color: var(--gold); }
.flow__roof path { fill: var(--spire); stroke: none; }
/* 光晕的模糊用 SVG <filter>（见 index.html），比 SVG 元素上的 CSS blur() 兼容性更好 */
.flow__halo { opacity: 0; }
.flow__halo path { stroke: var(--glow); stroke-width: 7; stroke-opacity: .55; }
.flow__cross { stroke: var(--gold); stroke-width: 1.2; fill: none; }

.grain {
  /* 不用 mix-blend-mode：全屏混合层会让每帧重新合成整页，手机上代价很高 */
  position: fixed; inset: 0; z-index: 3; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .3  0 0 0 0 .25  0 0 0 0 .2  0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

main { position: relative; z-index: 1; }

/* ---------- 导航 ---------- */
.nav {
  position: fixed; z-index: 10; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: max(18px, env(safe-area-inset-top)) var(--pad) 18px;
  font-size: 13px; letter-spacing: .12em; color: var(--ink);
  pointer-events: none;
  transition: opacity 1.2s var(--ease) .9s, transform .9s var(--ease);
}
.js .nav { opacity: 0; transform: translateY(-8px); }
.nav::before {
  content: ""; position: absolute; inset: 0 0 -24px; z-index: -1; pointer-events: none;
  --bg: var(--tone);
  background: linear-gradient(to bottom, var(--bg) 35%, rgba(246, 241, 232, 0));
  opacity: 0; transition: opacity .6s var(--ease), --bg 1.4s var(--ease-io);
}
@supports (color: color-mix(in srgb, red, blue)) {
  .nav::before { background: linear-gradient(to bottom, var(--bg) 35%, color-mix(in srgb, var(--bg) 0%, transparent)); }
}
body.is-scrolled .nav::before { opacity: .96; }
body.is-ready .nav { opacity: 1; transform: none; }
body.is-ready.nav-hidden .nav { transform: translateY(-110%); transition-delay: 0s; }
body.is-ready.nav-hidden .nav:focus-within { transform: none; }   /* 键盘焦点进入时展开，焦点不落在屏幕外 */
.nav > * { pointer-events: auto; }
.nav__brand { display: flex; align-items: center; gap: 10px; }
.nav__mark { width: 15px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.1; stroke-linecap: round; stroke-linejoin: round; }
.nav__index { display: flex; align-items: center; gap: 12px; color: var(--ink-2); }
.nav__num { font-family: var(--serif-la); font-style: italic; font-size: 15px; letter-spacing: .04em; min-width: 1.4em; text-align: right; }
.nav__rule { position: relative; width: clamp(48px, 9vw, 120px); height: 1px; background: var(--rule); overflow: hidden; }
.nav__rule i { position: absolute; inset: 0; background: var(--gold); transform-origin: 0 50%; transform: scaleX(0); }
.nav__name { min-width: 2.5em; }
.nav__cta {
  padding: 8px 16px; border: 1px solid rgba(43, 35, 28, .28); border-radius: 999px;
  transition: background-color .5s var(--ease), color .5s var(--ease), border-color .5s var(--ease);
}
.nav__cta:hover, .nav__cta:focus-visible { background: var(--ink); color: var(--paper); border-color: var(--ink); }
a:focus-visible { outline: 1px solid var(--gold-ink); outline-offset: 4px; }

/* ---------- 通用排版 ---------- */
.sec { position: relative; overflow-x: clip; }   /* clip 不生成滚动容器，不影响 sticky */
.sec--pin { height: calc(var(--pin, 200) * var(--vh)); }
.stage {
  position: sticky; top: 0;
  height: var(--svh);
  overflow: hidden;
}
.eyebrow, .index {
  font-size: 12px; letter-spacing: .42em; color: var(--ink-2);
}
.index { display: flex; align-items: baseline; gap: 14px; margin-bottom: clamp(18px, 3vh, 32px); }
.index span {
  font-family: var(--serif-la); font-style: italic; font-size: 20px; letter-spacing: .02em; color: var(--gold-ink);
}
.index::after { content: ""; flex: 0 0 40px; height: 1px; background: var(--rule); transform: translateY(-4px); }
.h2 {
  font-weight: 400;
  font-size: clamp(1.75rem, 3.9vw, 3.4rem);
  line-height: 1.38;
  letter-spacing: .08em;
  color: var(--ink);
}
.body {
  margin-top: 1.4em;
  max-width: 25em;
  font-size: clamp(14.5px, 1.05vw, 16px);
  line-height: 2.05;
  letter-spacing: .06em;
  color: var(--ink-2);
  text-wrap: pretty;          /* 避免段末孤字（不支持的浏览器会忽略） */
}
.body + .body { margin-top: .9em; }

/* 进入 / 离开视口的淡入淡出。
   所有"初始隐藏"都挂在 .js 下：脚本没运行或中途出错时（main.js 会移除 .js），页面退回静态可读状态 */
[data-reveal] {
  transition: opacity 1.1s var(--ease), transform 1.3s var(--ease);
  transition-delay: calc(var(--d, 0) * 90ms);
}
.js [data-reveal] { opacity: 0; transform: translate3d(0, 26px, 0); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* 字符级拆分 */
.ch { display: inline-block;
  transition: opacity 1.2s var(--ease), transform 1.4s var(--ease), filter 1.2s var(--ease);
  transition-delay: calc(var(--base, 0ms) + var(--i) * 55ms); }
.js .ch { opacity: 0; transform: translate3d(0, .5em, 0); filter: blur(6px); }
body.is-ready .ch { opacity: 1; transform: none; filter: none; }

/* 由 main.js 按滚动进度写入不透明度的元素，初始隐藏 */
.js .glass__rose, .js .float, .js .glass__text, .js .light__text,
.js .piano__upright, .js .piano__grand, .js .piano__text { opacity: 0; }

/* ---------- 拱形画框 ---------- */
.archframe { position: relative; overflow: hidden; background: #e8dfcf; }
.archframe img { width: 100%; height: 100%; object-fit: cover; transform-origin: 50% 50%; }
.archframe--round { border-radius: 50% 50% 0 0 / var(--r-top, 36%) var(--r-top, 36%) 0 0; }
.credit { display: block; margin-top: 4px; font-size: 11px; letter-spacing: .12em; color: var(--ink-3); }
p.credit { margin-top: 1.4em; }
.nowrap { white-space: nowrap; }
.archframe--circle { border-radius: 50%; }
/* --lancet 的尖拱 clip-path 由 main.js 按真实宽高生成 */

/* ---------- 00 首屏 ---------- */
#hero .stage { display: grid; place-items: center; }
.hero__text {
  position: absolute; left: 0; right: 0; bottom: clamp(52px, 8.5vh, 96px);
  text-align: center; padding: 0 var(--pad);
}
.hero__text .eyebrow { margin-bottom: clamp(14px, 2.4vh, 26px); }
.hero__title {
  font-weight: 300;
  font-size: clamp(2.3rem, 6.4vw, 5.8rem);
  letter-spacing: .2em; margin-right: -.2em;
  line-height: 1.15;
}
.hero__latin {
  margin-top: 10px;
  font-family: var(--serif-la); font-style: italic; font-weight: 300;
  font-size: clamp(15px, 1.5vw, 21px); letter-spacing: .12em; color: var(--ink-3);
  transition: opacity 1.6s var(--ease) 1.1s;
}
.js .hero__latin { opacity: 0; }
body.is-ready .hero__latin { opacity: 1; }
.hero__line {
  margin-top: clamp(18px, 3.2vh, 34px);
  font-size: clamp(14px, 1.2vw, 17px); letter-spacing: .3em; color: var(--ink-2);
}
.scrollcue {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-family: var(--serif-la); font-style: italic; font-size: 12px; letter-spacing: .2em; color: var(--ink-3);
  transition: opacity 1.4s var(--ease) 1.8s;
}
.js .scrollcue { opacity: 0; }
body.is-ready .scrollcue { opacity: 1; }
.scrollcue svg { width: 12px; height: 40px; overflow: visible; }
.scrollcue path { fill: none; stroke: var(--gold); stroke-width: 1; stroke-dasharray: 64; animation: cue 2.8s var(--ease-io) infinite; }
@keyframes cue { 0% { stroke-dashoffset: 64; } 55% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -64; } }

/* ---------- 01 序 ---------- */
.prologue {
  min-height: 140vh;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  align-items: center; gap: clamp(32px, 7vw, 120px);
  padding: 20vh var(--pad) 18vh;
}
.prologue__fig { width: min(38vw, 520px); justify-self: end; }
.prologue__frame { aspect-ratio: 3 / 4.1; background: transparent; }
.prologue__frame img { height: 118%; margin-top: -9%; will-change: transform; }
.prologue__fig figcaption { margin-top: 16px; text-align: center; font-size: 12px; letter-spacing: .3em; color: var(--ink-3); }
.prologue__text { position: relative; max-width: 30em; }
em.credit { font-style: normal; }

/* ---------- 02 窗 ---------- */
.glass__rose {
  position: absolute; left: 50%; top: 50%;
  width: clamp(84px, 13vmin, 150px); aspect-ratio: 1;
  margin: calc(clamp(84px, 13vmin, 150px) / -2) 0 0 calc(clamp(84px, 13vmin, 150px) / -2);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(160, 122, 56, .35), 0 0 60px 10px rgba(231, 194, 122, .35);
  will-change: transform, opacity;
}
.glass__rose img { width: 100%; height: 100%; border-radius: 50%; }
.float { position: absolute; will-change: transform, opacity; }
.float .archframe { width: 100%; }
.float--a { left: 7vw; top: 13vh; width: clamp(130px, 17vw, 260px); }
.float--a .archframe { aspect-ratio: 3 / 4.2; }
.float--b { right: 8vw; top: 24vh; width: clamp(110px, 14vw, 210px); }
.float--b .archframe { aspect-ratio: 1; }
.float--c { left: 21vw; bottom: 9vh; width: clamp(96px, 11vw, 170px); }
.float--c .archframe { aspect-ratio: 3 / 4.6; }
.glass__text {
  position: absolute; right: var(--pad); bottom: 12vh; width: min(30em, 36vw);
  will-change: transform, opacity;
}
/* 彩色玻璃投下的光斑：蓝、琥珀、玫红三团柔光斜扫过页面 */
.glass__spots { position: absolute; inset: 0; pointer-events: none; }
.glass__spots i {
  position: absolute; left: 0; top: 0; width: 46vmax; height: 46vmax; margin: -23vmax 0 0 -23vmax;
  border-radius: 50%; opacity: 0; will-change: transform, opacity;
}
.glass__spots i:nth-child(1) { background: radial-gradient(closest-side, rgba(43, 79, 140, .30), rgba(43, 79, 140, 0)); }
.glass__spots i:nth-child(2) { background: radial-gradient(closest-side, rgba(227, 169, 43, .34), rgba(227, 169, 43, 0)); }
.glass__spots i:nth-child(3) { background: radial-gradient(closest-side, rgba(180, 67, 47, .22), rgba(180, 67, 47, 0)); }

/* ---------- 03 光 ---------- */
.light__photo { position: absolute; inset: 0; will-change: clip-path; }
.light__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 42%; will-change: transform; }
.light__edge { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.light__edge path { fill: none; stroke-linecap: round; }
#lightEdgeHalo { stroke: var(--glow); stroke-width: 9; stroke-opacity: .6; }   /* 模糊由 SVG <filter> 提供 */
#lightEdgeLine { stroke: #f3d9a0; stroke-width: 1.6; }
.light__glint {
  position: absolute; left: 0; top: 0; width: 160px; height: 160px; margin: -80px 0 0 -80px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 244, 214, .95), rgba(231, 194, 122, .45) 40%, rgba(231, 194, 122, 0));
  opacity: 0; pointer-events: none; will-change: transform, opacity;
}
.light__text {
  position: absolute; left: var(--pad); bottom: 13vh; width: min(27em, 34vw);
  will-change: transform, opacity;
}

/* ---------- 04 琴 ---------- */
.piano__ripples { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.piano__ripples circle { fill: none; stroke: var(--gold); stroke-width: 1; }
.piano__upright {
  position: absolute; left: 9vw; top: 17vh; width: clamp(150px, 22vw, 330px); aspect-ratio: 3 / 4.2;
  will-change: transform, opacity;
}
.piano__grand { position: absolute; inset: 0; will-change: clip-path, opacity; }
/* 与琴形蒙版共享坐标；完整竖幅实景按主体焦点铺满轮廓，禁止露出图片矩形边。 */
.piano__grand img { position: absolute; left: 0; top: 0; max-width: none; object-fit: cover; transform-origin: 52% 60%; }
.piano__text { position: absolute; width: min(26em, 38vw); will-change: transform, opacity; }
.piano__text--a { right: var(--pad); bottom: 16vh; }
.piano__text--b { left: var(--pad); bottom: 13vh; }

/* ---------- 05 景 ---------- */
.scenes {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(32px, 6vw, 110px);
  padding: 14vh var(--pad) 22vh;
}
.scenes__media { position: relative; }
.scenes__frame {
  position: sticky; top: 15vh;
  width: min(34vw, 470px); aspect-ratio: 3 / 4.3; margin-left: auto;
}
.scenes__frame img {
  position: absolute; inset: 0; opacity: 0; transform: scale(1.08);
  will-change: opacity, transform;
}
.scenes__frame img.is-on { opacity: 1; transform: scale(1); }
.scenes__head { padding-top: 6vh; margin-bottom: 8vh; }
.scenes__items li {
  display: grid; grid-template-columns: 3.2em 1fr; align-items: baseline; row-gap: 10px;
  min-height: 34vh; padding: 5vh 0 0; border-top: 1px solid var(--rule);
}
.scenes__no { font-family: var(--serif-la); font-style: italic; font-size: 20px; color: var(--gold-ink); }
/* 只淡化非当前项的大号标题（≥25.6px 属大字，.55 时对比度约 3.5:1）；序号与注释保持清晰 */
.scenes__zh { font-size: clamp(1.6rem, 3.4vw, 3rem); letter-spacing: .08em; font-weight: 400; opacity: .55; transition: opacity .9s var(--ease); }
.scenes__items li.is-active .scenes__zh { opacity: 1; }
.scenes__note { grid-column: 2; font-size: 14px; letter-spacing: .2em; color: var(--ink-3); }
.scenes__who { margin-top: 8vh; font-size: clamp(16px, 1.5vw, 21px); line-height: 2; letter-spacing: .12em; color: var(--ink-2); }
.scenes__ask { margin-top: 1.2em; font-size: 13px; letter-spacing: .16em; color: var(--ink-3); }

/* ---------- 06 帧 ---------- */
.gallery__head { position: absolute; left: var(--pad); top: 13vh; z-index: 2; will-change: opacity, transform; }
.gallery__track {
  position: absolute; left: 0; top: 7vh; bottom: 0;
  display: flex; align-items: center; gap: clamp(28px, 5vw, 90px);
  padding: 0 var(--pad) 0 clamp(260px, 36vw, 560px);
  will-change: transform;
}
.gcard { flex: 0 0 auto; position: relative; will-change: transform, opacity; }
.gcard .archframe { height: min(58vh, 620px); aspect-ratio: 3 / 4.2; }
.gcard .archframe--round { aspect-ratio: 3 / 4; }
.gcard:nth-child(even) { transform: translateY(6vh); }
.gcard img { width: 118%; max-width: none; margin-left: -9%; }
.gcard figcaption { margin-top: 18px; font-size: 13px; letter-spacing: .28em; color: var(--ink-2); }
.gcard figcaption > span { font-family: var(--serif-la); font-style: italic; color: var(--gold-ink); margin-right: 12px; font-size: 16px; letter-spacing: .04em; }
.gallery__rule { position: absolute; left: var(--pad); right: var(--pad); bottom: 8vh; height: 1px; background: var(--rule); overflow: hidden; }
.gallery__rule i { position: absolute; inset: 0; background: var(--gold); transform-origin: 0 50%; transform: scaleX(0); }

/* ---------- 07 湖 ---------- */
.lake {
  position: relative; min-height: 150vh;
  padding: 22vh var(--pad) 26vh;
}
.lake__text { position: relative; z-index: 2; max-width: 30em; }
.lake__fig { position: absolute; will-change: transform; }
.lake__fig--a { right: 10vw; top: 16vh; width: min(30vw, 420px); aspect-ratio: 3 / 4; }
.lake__fig--b { right: 36vw; top: 70vh; width: min(20vw, 280px); aspect-ratio: 3 / 4.5; }

/* ---------- 08 约：尖拱之门 ---------- */
/* 上 40% 屏留给三尖顶（Flow），拱尖从 40% 处起；拱内是门楣题字，门内是咨询单与信笺 */
#visit { min-height: var(--svh); }
.sym { position: absolute; width: 0; height: 0; overflow: hidden; }
.visit { container-type: inline-size; padding: calc(var(--svh) * .40) var(--pad) 0; }
.door {
  position: relative; isolation: isolate;
  width: min(960px, 100%); margin: 0 auto;
  --arch-h: calc(min(960px, 100cqw) * .728);        /* 拱高；main.js 按实测宽度与题字高度覆盖 */
}
/* 门内的光：底色略亮于纸白；一团暖光随视线在门内下行。整块按尖拱轮廓裁切（main.js） */
.door__glow { position: absolute; inset: 0; z-index: -1; overflow: hidden; background: linear-gradient(to bottom, #fcf9f3, #faf6ee 55%, #f9f4ea); }
.door__light {
  position: absolute; left: -20%; top: 0; width: 140%; aspect-ratio: 1;
  background: radial-gradient(closest-side, rgba(231, 194, 122, .16), rgba(231, 194, 122, 0));
  will-change: transform;
}
.door__line { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.door__line path { fill: none; stroke: var(--gold); stroke-linecap: round; stroke-linejoin: round; }
.door__line .door__halo { stroke: var(--glow); stroke-width: 7; stroke-opacity: .55; opacity: 0; }
.door.is-lit .door__halo { animation: doorLit 1.6s var(--ease-io); }
@keyframes doorLit { 0% { opacity: 0; } 30% { opacity: .85; } 100% { opacity: 0; } }
.door__transom, .door__sill { stroke-width: .8; stroke-opacity: .7; }

/* 拱内题字：内容从拱高的 36% 处开始（那里的拱宽已 ≥ 门宽的 69%），左右各让出 14% */
.door { --head-top: .36; }
.door__head { position: relative; min-height: var(--arch-h); padding: calc(var(--arch-h) * var(--head-top)) 14% 64px; text-align: center; }
.door__rose {
  position: absolute; left: 50%; top: calc(var(--arch-h) * .25);
  width: 44px; height: 44px; margin: -22px 0 0 -22px; overflow: visible;
  fill: none; stroke: var(--gold); stroke-width: 2.2; stroke-dasharray: 1 1;
}
.door__head .index { justify-content: center; margin-bottom: 14px; }
.door__head .index::after { display: none; }
.visit__title { font-weight: 300; font-size: clamp(1.25rem, 6.4vw, 2.4rem); line-height: 1.5; letter-spacing: .12em; margin-right: -.12em; }
/* 门楣下沿的一行西文题字，两侧各一道细线，贴着横楣 */
.door__latin {
  position: absolute; left: 0; right: 0; bottom: 22px;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  font-family: var(--serif-la); font-style: italic; font-weight: 300; font-size: clamp(15px, 1.4vw, 19px); letter-spacing: .12em; color: var(--ink-3);
}
.door__latin::before, .door__latin::after { content: ""; width: 32px; height: 1px; background: var(--rule); }
.js .door__head [data-door], .js .door__rose { opacity: 0; }

/* 门内 */
.door__body { position: relative; padding: clamp(36px, 6vh, 60px) clamp(20px, 6.5%, 64px) clamp(56px, 10vh, 104px); }
.door__intro { text-align: center; }
.visit__how { font-size: clamp(14.5px, 1.2vw, 17px); letter-spacing: .12em; line-height: 2; color: var(--ink-2); }
.visit__where { margin-top: .5em; font-size: 13px; letter-spacing: .42em; color: var(--ink-3); }
.door__lead { max-width: 30em; margin: 1.6em auto 0; font-size: 14px; line-height: 2; letter-spacing: .06em; color: var(--ink-2); text-wrap: pretty; }
.door__grid { display: grid; gap: 56px; margin-top: clamp(44px, 7vh, 72px); }

/* 表单 */
.ask { display: grid; gap: clamp(30px, 4.4vh, 42px); }
.ask__field { min-width: 0; margin: 0; padding: 0; border: 0; }
.ask__legend { display: block; padding: 0; margin-bottom: 10px; font-size: 12px; letter-spacing: .42em; color: var(--ink-2); }
.ask__legend::after { content: ""; display: inline-block; width: 40px; height: 1px; margin-left: 12px; vertical-align: middle; background: var(--rule); }
.ask__legend em { font-style: normal; margin-left: .6em; font-size: 11px; letter-spacing: .16em; color: var(--ink-3); }
.ask__hint { margin-top: 8px; font-size: 12px; line-height: 1.8; letter-spacing: .06em; color: var(--ink-3); }
.ask__hint.is-warn { color: var(--spire); }
.visit :is(button, input, textarea):focus-visible { outline: 1px solid var(--gold-ink); outline-offset: 4px; }

/* 用途：一排小尖拱窗，选中的那扇"亮起" */
.opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; }
.opt, .seg__opt { position: relative; display: block; cursor: pointer; }
.opt__input, .seg__input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.opt__face { position: relative; display: grid; grid-template-columns: 14px 1.6em minmax(0, 1fr); align-items: center; column-gap: 8px; min-height: 52px; padding: 8px 2px; border-bottom: 1px solid var(--rule); }
.opt__face::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--gold); transform: scaleX(0); transition: transform .9s var(--ease); }
.opt__icon { width: 14px; height: 20px; overflow: visible; }
.opt__icon path { fill: rgba(127, 95, 39, 0); stroke: var(--gold); stroke-width: 1; transition: fill .6s var(--ease), stroke .6s var(--ease); }
.opt__no { font-family: var(--serif-la); font-style: italic; font-size: 17px; letter-spacing: .02em; color: var(--gold-ink); }
.opt__zh { font-size: 15px; letter-spacing: .04em; color: var(--ink-2); transition: color .5s var(--ease); }
.opt:hover .opt__icon path { stroke: var(--gold-ink); }
.opt__input:checked + .opt__face::after { transform: scaleX(1); }
.opt__input:checked + .opt__face .opt__icon path { fill: var(--gold-ink); stroke: var(--gold-ink); }
.opt__input:checked + .opt__face .opt__zh { color: var(--ink); }
.opt__input:focus-visible + .opt__face, .seg__input:focus-visible + span { outline: 1px solid var(--gold-ink); outline-offset: 3px; }

/* 时段：四格，一道金线滑到选中的一格 */
.seg { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--rule); }
.seg__opt { display: grid; place-items: center; min-height: 48px; }
.seg__opt + .seg__opt::before { content: ""; position: absolute; left: 0; top: 32%; bottom: 32%; width: 1px; background: var(--rule); }
.seg__opt span { padding: 4px 6px; font-size: 15px; letter-spacing: .14em; color: var(--ink-2); transition: color .5s var(--ease); }
.seg__input:checked + span { color: var(--ink); }
.seg__thumb { position: absolute; left: 0; bottom: -1px; width: 25%; height: 1px; background: var(--gold); pointer-events: none; transform: translateX(calc(var(--i, 0) * 100%)) scaleX(var(--on, 0)); transition: transform .9s var(--ease); }

/* 人数：± 圆钮 */
.count { display: flex; align-items: center; gap: 16px; }
.count__btn {
  flex: none; width: 44px; height: 44px; display: grid; place-items: center; padding: 0;
  border: 1px solid rgba(43, 35, 28, .28); border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer;
  transition: background-color .5s var(--ease), color .5s var(--ease), border-color .5s var(--ease), opacity .4s;
}
.count__btn svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; }
.count__btn:hover, .count__btn:focus-visible { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.count__btn[aria-disabled="true"] { cursor: default; border-color: rgba(43, 35, 28, .14); }
.count__btn[aria-disabled="true"] svg { opacity: .38; }
.count__btn[aria-disabled="true"]:hover, .count__btn[aria-disabled="true"]:focus-visible { background: transparent; color: var(--ink); border-color: rgba(43, 35, 28, .28); }
.count__box { display: flex; align-items: baseline; gap: 6px; padding: 0 4px; border-bottom: 1px solid rgba(43, 35, 28, .28); }
.count__input {
  width: 2.4em; padding: 2px 0; border: 0; border-radius: 0; background: transparent; color: var(--ink);
  font-family: var(--serif-la); font-style: italic; font-size: 30px; line-height: 1.2; text-align: center;
  -moz-appearance: textfield; appearance: textfield;
}
.count__input::-webkit-inner-spin-button, .count__input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.count__input::placeholder { color: var(--ink-3); opacity: 1; }
.count__input.is-tick { animation: tick .45s var(--ease); }
@keyframes tick { from { opacity: .3; transform: translateY(var(--dy, 6px)); } }
.count__unit { font-size: 14px; letter-spacing: .1em; color: var(--ink-2); }

/* 文本输入 */
.ask__input {
  display: block; width: 100%; min-height: 48px; padding: 10px 2px;
  border: 0; border-bottom: 1px solid rgba(43, 35, 28, .28); border-radius: 0; background: transparent;
  color: var(--ink); font: inherit; font-size: 16px; letter-spacing: .06em;     /* ≥16px：iOS 聚焦时不自动放大 */
  -webkit-appearance: none; appearance: none; transition: border-color .5s var(--ease);
}
.ask__input::placeholder { color: var(--ink-3); opacity: 1; }
.ask__input:hover { border-bottom-color: var(--gold); }
.ask__input:focus-visible { border-bottom-color: var(--gold-ink); }
.ask__input--date::-webkit-date-and-time-value { text-align: left; min-height: 1.5em; }
.ask__input--date::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; }
.ask__input--date::-webkit-datetime-edit-year-field:focus,
.ask__input--date::-webkit-datetime-edit-month-field:focus,
.ask__input--date::-webkit-datetime-edit-day-field:focus { background: rgba(160, 122, 56, .22); color: var(--ink); }
/* 备注：信纸横线，随内容滚动 */
.ask__input--note {
  min-height: calc(1.9em * 4); padding: 0 2px; line-height: 1.9; resize: vertical; border-bottom: 0;
  background: repeating-linear-gradient(to bottom, transparent 0 calc(1.9em - 1px), var(--rule) calc(1.9em - 1px) 1.9em);
  background-attachment: local;
}

/* 信笺：圆拱顶的信纸（border-radius 取极大值时，浏览器按比例压缩到"宽的一半"，顶部恰为正半圆） */
.letter { container-type: inline-size; min-width: 0; }
.letter__paper {
  position: relative; overflow: hidden;
  padding: 104px 26px 30px; padding-top: 31cqw;
  background: #fdfaf4; border: 1px solid rgba(160, 122, 56, .5);
  border-radius: 9999px 9999px 0 0;
}
.letter__paper::before { content: ""; position: absolute; inset: 6px; border: 1px solid rgba(160, 122, 56, .26); border-radius: 9999px 9999px 0 0; pointer-events: none; }
.letter__rose { position: absolute; left: 50%; top: 32px; top: 9cqw; width: 30px; height: 30px; margin-left: -15px; fill: none; stroke: var(--gold); stroke-width: 2.4; }
.letter__title { position: absolute; left: 0; right: 0; top: 70px; top: 19.5cqw; text-align: center; font-weight: 400; font-size: 12px; letter-spacing: .42em; margin-right: -.42em; color: var(--ink-2); }
.letter__text { position: relative; white-space: pre-wrap; overflow-wrap: anywhere; text-wrap: pretty; font-size: 15px; line-height: 2; letter-spacing: .04em; color: var(--ink-2); }
.letter__v { color: var(--ink); background: linear-gradient(var(--gold), var(--gold)) 0 100% / 100% 1px no-repeat; }
.letter__e { color: var(--ink-3); }
.letter__v.is-new, .letter__e.is-new { animation: ink 1.8s ease-out; }
@keyframes ink { 0% { opacity: .15; filter: blur(3px); color: var(--gold-ink); } 30% { opacity: 1; filter: blur(0); color: var(--gold-ink); } }
.letter__glint {
  position: absolute; left: 50%; top: 0; width: 200px; height: 200px; margin: -100px 0 0 -100px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 244, 214, .95), rgba(231, 194, 122, .4) 45%, rgba(231, 194, 122, 0));
  opacity: 0; pointer-events: none;
}
.letter.is-lit .letter__glint { animation: glint 1.3s var(--ease-io); }
@keyframes glint { 0% { opacity: 0; transform: scale(.4); } 35% { opacity: .9; } 100% { opacity: 0; transform: scale(1.25); } }
.letter__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.btn {
  position: relative; flex: 1 1 auto; min-height: 48px; padding: 12px 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(43, 35, 28, .28); border-radius: 999px; background: transparent; color: var(--ink);
  font: inherit; font-size: 14px; letter-spacing: .16em; cursor: pointer;
  transition: background-color .5s var(--ease), color .5s var(--ease), border-color .5s var(--ease);
}
.btn:hover, .btn:focus-visible { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn--primary { flex-basis: 100%; background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn--primary:hover, .btn--primary:focus-visible { background: var(--gold-ink); border-color: var(--gold-ink); }
.btn__check {
  position: absolute; left: 20px; top: 50%; width: 14px; height: 10px; margin-top: -5px;
  fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1 1; stroke-dashoffset: 1; opacity: 0; transition: stroke-dashoffset .6s var(--ease) .05s, opacity .2s;
}
.btn.is-done .btn__check { opacity: 1; stroke-dashoffset: 0; }
.letter__status { min-height: 1.9em; margin-top: 12px; font-size: 13px; line-height: 1.9; letter-spacing: .06em; color: var(--gold-ink); }
.letter__manual { display: none; margin-top: 14px; font-size: 13px; line-height: 1.9; color: var(--ink-2); }
html:not(.ask-on) .ask, html:not(.ask-on) .door__lead, html:not(.ask-on) .letter__actions,
html:not(.ask-on) .letter__status, html:not(.ask-on) .letter__sign { display: none; }
html:not(.ask-on) .letter__manual { display: block; }
html:not(.ask-on) .door__grid { grid-template-columns: minmax(0, 420px); justify-content: center; }
/* 脚本不可用时画不出金线：给门内底色一道近似的拱形细边 */
html:not(.js) .door__glow { border: 1px solid rgba(160, 122, 56, .45); border-radius: 50% 50% 0 0 / var(--arch-h) var(--arch-h) 0 0; }

/* 日期：iOS Safari 空值不显示任何字，补一行占位；清除按钮 */
.date { position: relative; display: block; }
.date__ph { display: none; position: absolute; left: 2px; top: 0; line-height: 48px; font-size: 16px; letter-spacing: .06em; color: var(--ink-3); pointer-events: none; }
@supports (-webkit-touch-callout: none) {
  .date.is-empty .date__ph { display: block; }
  .date.is-empty .ask__input--date { color: transparent; }
}
.ask__hintrow { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.ask__clear {
  flex: none; min-height: 32px; margin-top: 4px; padding: 4px 0; border: 0; border-bottom: 1px solid var(--rule); border-radius: 0;
  background: none; font: inherit; font-size: 12px; letter-spacing: .12em; color: var(--ink-2); cursor: pointer;
  transition: color .4s var(--ease), border-color .4s var(--ease);
}
.ask__clear:hover, .ask__clear:focus-visible { color: var(--gold-ink); border-bottom-color: var(--gold-ink); }
.ask__clear[hidden] { display: none; }
.ask__hint--end { text-align: right; font-family: var(--serif-la); font-style: italic; letter-spacing: .08em; }

/* 信笺落款：单尖顶小印（与导航标记同形）+ 草稿状态 */
.letter__sign { position: relative; display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 18px; font-size: 12px; letter-spacing: .24em; color: var(--ink-3); transition: color .6s var(--ease); }
.letter__mark { width: 12px; height: 16px; fill: none; stroke: var(--gold); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.letter.is-copied .letter__sign { color: var(--gold-ink); }
.letter__pick { display: block; margin-top: 4px; font-size: 16px; letter-spacing: .12em; color: var(--ink); }

/* 手机 / 平板单栏：表单区内吸底的"查看咨询文字"小条（只在表单范围内吸底） */
.ask__peek { display: none; }

.door__foot { max-width: 34em; margin: clamp(48px, 8vh, 80px) auto 0; text-align: center; }
.door__steps { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 26px; font-size: 13px; line-height: 1.9; letter-spacing: .1em; color: var(--ink-2); }
.door__steps span { margin-right: 8px; font-family: var(--serif-la); font-style: italic; font-size: 16px; color: var(--gold-ink); }
.door__note { margin-top: 16px; font-size: 12px; line-height: 1.95; letter-spacing: .06em; color: var(--ink-3); text-wrap: pretty; }
.js [data-reveal]:focus-within { opacity: 1; transform: none; transition: none; }   /* 键盘跳进还没淡入的字段时立即显示、直接到位 */
/* 键盘聚焦时滚动留边：上方让出会重新出现的导航，下方让出手机上的吸底小条 */
.ask :is(input, button, textarea) { scroll-margin: 96px 0 24px; }

.visit__tags { margin-top: clamp(56px, 9vh, 88px); padding-bottom: 7vh; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px; font-size: 13px; letter-spacing: .1em; color: var(--gold-ink); }

@media (min-width: 761px) {
  .door { --head-top: .40; }
  .visit__title { font-size: clamp(2rem, 4vw, 3.2rem); }
  .opts { column-gap: 22px; }
  .door__rose { width: 64px; height: 64px; margin: -32px 0 0 -32px; stroke-width: 1.7; }
}
@media (max-width: 999px) {
  html.ask-on .ask__peek {
    position: sticky; bottom: max(14px, env(safe-area-inset-bottom)); z-index: 2; justify-self: center;
    display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 22px;
    border: 1px solid rgba(43, 35, 28, .28); border-radius: 999px; background: rgba(251, 248, 242, .94);
    font-size: 14px; letter-spacing: .14em; color: var(--ink);
    opacity: 0; visibility: hidden; transform: translate3d(0, 10px, 0);
    transition: opacity .5s var(--ease), transform .7s var(--ease), visibility 0s linear .7s;
  }
  .ask__peek svg { width: 10px; height: 14px; fill: none; stroke: var(--gold-ink); stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
  html.ask-on .ask.is-dirty .ask__peek { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
  html.ask-on .ask.is-typing .ask__peek, html.ask-on .ask.is-near .ask__peek { opacity: 0; visibility: hidden; transform: translate3d(0, 10px, 0); transition: opacity .3s var(--ease), transform .5s var(--ease), visibility 0s linear .5s; }
  .letter { scroll-margin-top: 72px; }
  .ask :is(input, button, textarea) { scroll-margin-bottom: 72px; }
}
@media (min-width: 1000px) {
  .door__grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(40px, 5vw, 72px); }
  .letter__sticky { position: sticky; top: max(12vh, 88px); }
}
.foot {
  padding: 28px var(--pad) max(28px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--rule);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 32px;
  font-size: 12px; line-height: 1.9; letter-spacing: .06em; color: var(--ink-3);
}
.foot p { max-width: 62em; }
.foot__top { white-space: nowrap; color: var(--ink-2); border-bottom: 1px solid var(--rule); align-self: flex-start; }
.foot__top:hover, .foot__top:focus-visible { color: var(--gold-ink); border-color: var(--gold-ink); }

/* ==========================================================
   移动端
   ========================================================== */
@media (max-width: 760px) {
  .nav { font-size: 12px; padding-top: max(14px, env(safe-area-inset-top)); }
  .nav__brand span { display: none; }
  .nav__rule { width: 44px; }
  .nav__cta { padding: 7px 13px; }

  .prologue { grid-template-columns: 1fr; padding: 16vh var(--pad) 14vh; min-height: 0; }
  .prologue__fig { width: min(82vw, 420px); justify-self: center; }
  .prologue__text { margin-top: 5vh; }

  .float--a { left: 5vw; top: 11vh; width: 30vw; }
  .float--b { right: 5vw; top: 20vh; width: 26vw; }
  .float--c { left: auto; right: 12vw; bottom: auto; top: 50vh; width: 20vw; }
  .glass__text { left: var(--pad); right: var(--pad); width: auto; bottom: 8vh; }
  .glass__text .body, .light__text .body, .piano__text .body { max-width: none; }

  .light__text { left: var(--pad); right: var(--pad); width: auto; bottom: 7vh; padding: 22px 20px; background: rgba(246, 241, 232, .88); }

  .piano__upright { left: 7vw; top: 12vh; width: 44vw; }
  .piano__text { left: var(--pad); right: var(--pad); width: auto; bottom: 8vh; }
  .piano__text--b { padding: 22px 20px; background: rgba(241, 231, 214, .9); }

  /* 手机：照片吸顶（带同色底），列表从照片下方滑过，不互相遮挡 */
  .scenes { grid-template-columns: 1fr; gap: 0; padding: 4vh var(--pad) 16vh; }
  .scenes__media { position: sticky; top: 0; z-index: 3; padding: 9vh 0 2vh; --bg: var(--tone); background: var(--bg); transition: --bg 1.4s var(--ease-io); }
  .scenes__media::after {
    content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 8vh; pointer-events: none;
    --bg: var(--tone); transition: --bg 1.4s var(--ease-io);
    background: linear-gradient(to bottom, var(--bg), rgba(246, 241, 232, 0));
  }
  @supports (color: color-mix(in srgb, red, blue)) {
    .scenes__media::after { background: linear-gradient(to bottom, var(--bg), color-mix(in srgb, var(--bg) 0%, transparent)); }
  }
  .scenes__frame { position: relative; top: 0; width: auto; height: 40vh; aspect-ratio: 3 / 4.3; margin: 0 auto; }
  .scenes__list { position: relative; z-index: 1; }
  .scenes__head { padding-top: 6vh; margin-bottom: 3vh; }
  .scenes__items li { min-height: 30vh; }

  .gallery__head { top: 11vh; }
  .gallery__track { padding-left: var(--pad); padding-top: 10vh; }
  .gcard .archframe { height: 50vh; }

  .lake { min-height: 0; padding: 16vh var(--pad) 10vh; display: flex; flex-direction: column; }
  .lake__fig { position: relative; }
  .lake__fig--a { right: auto; top: auto; width: 68vw; margin: 8vh 0 0 auto; }
  .lake__fig--b { right: auto; top: auto; width: 46vw; margin: -12vh 0 0 4vw; }
  .foot { flex-direction: column; }

  /* 门几乎贴满屏宽（两道门框线在 6px、12px 处），门内内容与普通段落同宽，输入框不被拱挤窄 */
  .visit { padding-left: max(6px, env(safe-area-inset-left)); padding-right: max(6px, env(safe-area-inset-right)); }
  .door__body { padding-left: 20px; padding-right: 20px; }
  .visit__tags { padding-left: var(--pad); padding-right: var(--pad); }
}
/* 窄屏（≤389px，如 320、360、375 宽）：用途两列放不下"序号 + 文字"，收起罗马序号，保证"法式复古拍摄"一行排下 */
@media (max-width: 389px) {
  .opt__face { grid-template-columns: 14px minmax(0, 1fr); }
  .opt__no { display: none; }
}

/* ==========================================================
   减少动态效果
   ========================================================== */
@media (prefers-reduced-motion: reduce) {
  [data-reveal], .js [data-reveal] { transform: none; transition: opacity .6s linear; }
  .ch, .js .ch { transform: none; filter: none; transition: opacity .6s linear; transition-delay: 0ms; }
  .scrollcue path { animation: none; stroke-dasharray: none; }
  .scenes__frame img { transform: none; }
  body { transition: none; }
  .opt__face::after, .seg__thumb { transition: none; }
  .nav { transition: opacity .4s linear; }                       /* 减少动态：导航不滑动，只淡入淡出 */
  .js .nav, body.is-ready.nav-hidden .nav { transform: none; }
  body.is-ready.nav-hidden .nav { opacity: 0; pointer-events: none; }
  body.is-ready.nav-hidden .nav:focus-within { opacity: 1; pointer-events: auto; }
  html.ask-on .ask__peek, html.ask-on .ask.is-dirty .ask__peek { transform: none; }
  .letter__v.is-new, .letter__e.is-new, .count__input.is-tick { animation: none; }
  .letter.is-lit .letter__glint { animation-name: glintFade; }
  @keyframes glintFade { 0%, 100% { opacity: 0; } 35% { opacity: .9; } }
}

/* 强制色（Windows 高对比度）：自绘的选中态会被系统色覆盖，改回显示原生单选框 */
@media (forced-colors: active) {
  .opt__input, .seg__input { position: static; opacity: 1; width: 18px; height: 18px; flex: none; }
  .opt, .seg__opt { display: flex; align-items: center; gap: 8px; }
}
