/* ===========================================================
   Tinsel — 视觉规范见 docs/02-体验与视觉规范.md
   一颗午夜的树，暗、暖、克制。
   =========================================================== */

:root {
  --bg-0: #080609;
  --bg-1: #10080e;
  --gold-1: #fff5ce;
  --gold-2: #ffda90;
  --gold-3: #e6a14f;
  --cream: #fff0dd;
  --muted: rgba(255, 240, 221, 0.56);
  --faint: rgba(255, 240, 221, 0.32);
  --line: rgba(223, 183, 122, 0.26);
  --line-strong: rgba(223, 183, 122, 0.55);
  --panel: rgba(255, 240, 221, 0.045);
  --danger: #ff8f8f;
  --display: "Cormorant Garamond", "Playfair Display", "Palatino Linotype", Georgia,
    "Songti SC", "Noto Serif SC", serif;
  --ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg-0);
  color: var(--cream);
  font-family: var(--ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}

body {
  background:
    radial-gradient(ellipse 120% 80% at 50% 42%, #1c0b15 0%, #10080e 46%, #080609 86%),
    var(--bg-0);
  background-attachment: fixed;
}

button { font: inherit; color: inherit; }
a { color: var(--gold-2); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { display: block; max-width: 100%; }

.hidden { display: none !important; }
.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;
}

/* ---------- 舞台：canvas + 挂饰层 ---------- */

.stage {
  position: relative;
  width: 100%;
  overflow: hidden;
  isolation: isolate;
}

.stage canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.stage #arctic { z-index: 0; }
.stage #scene { z-index: 1; mix-blend-mode: screen; }
.stage #accents { z-index: 3; }

.stage__layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.stage__layer .orn { pointer-events: auto; }

/* ---------- 挂饰 ---------- */

.orn {
  position: absolute;
  left: 0;
  top: 0;
  padding: 0;
  border: 0;
  background: none;
  width: var(--w, 96px);
  display: block;
  overflow: visible;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: filter 0.25s var(--ease);
}

.orn:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 6px; border-radius: 4px; }
.orn:hover { filter: brightness(1.08); }

.orn__inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  transform-origin: 50% -14px;
  animation: sway var(--dur, 7s) ease-in-out infinite alternate;
  animation-delay: var(--delay, 0s);
  will-change: transform;
}

.orn.is-back .orn__inner { opacity: 0.88; filter: brightness(0.92); }
.orn.is-editable .orn__inner::after {
  content: "";
  position: absolute;
  inset: -8px;
  border: 1px dashed rgba(255, 218, 144, 0.35);
  border-radius: 6px;
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}
.orn.is-editable:hover .orn__inner::after { opacity: 1; }

.orn__hook {
  position: absolute;
  top: -9px;
  left: 50%;
  width: 1px;
  height: 11px;
  background: rgba(255, 218, 144, 0.55);
  transform: translateX(-50%);
}
.orn__hook::before {
  content: "";
  position: absolute;
  top: -3px;
  left: -2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 218, 144, 0.75);
  box-shadow: 0 0 6px rgba(255, 207, 120, 0.7);
}

/* 照片：宝丽来 */
.orn__frame {
  display: block;
  width: 100%;
  padding: 5px 5px var(--pad-b, 7px);
  background: #fdf9f0;
  border-radius: 2px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.58), 0 1px 0 rgba(255, 255, 255, 0.5) inset;
  transform: rotate(-0.6deg);
}
.orn__img {
  width: 100%;
  height: var(--h, 96px);
  object-fit: cover;
  background: #2a2028;
  border-radius: 1px;
  filter: saturate(0.96) contrast(1.02);
}
.orn__cap {
  display: block;
  margin: 3px 1px 0;
  font-family: "Segoe Script", "Bradley Hand", var(--display);
  font-style: italic;
  font-size: clamp(7px, 1.9vw, 9px);
  line-height: 1.15;
  color: #4a3a30;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  /* 白边只有两行的高度；再长就靠灯箱看全文 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* 心愿签 */
.orn__paper {
  display: block;
  width: 100%;
  padding: 8px 8px 9px;
  background: linear-gradient(180deg, #fbf3df 0%, #f2e5c9 100%);
  border-radius: 2px;
  box-shadow: 0 9px 22px rgba(0, 0, 0, 0.5);
  transform: rotate(1.2deg);
}
.orn__body {
  display: block;
  font-family: var(--display);
  font-size: clamp(8px, 2vw, 10px);
  line-height: 1.4;
  color: #3b2b1f;
  text-align: left;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.orn__sign {
  margin-top: 3px;
  align-self: center;
  text-align: center;
  font-size: clamp(7px, 1.7vw, 9px);
  color: rgba(255, 240, 221, 0.55);
  letter-spacing: 0.04em;
}

/* 纪念牌 */
.orn__plate {
  display: block;
  width: 100%;
  padding: 7px 7px 8px;
  border-radius: 3px;
  background: linear-gradient(160deg, #d8b273 0%, #a9814a 48%, #7d5c31 100%);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  color: #2b1d0e;
  text-align: center;
}
.orn__title {
  display: block;
  font-family: var(--display);
  font-size: clamp(8px, 2vw, 10px);
  line-height: 1.25;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  word-break: break-word;
}
.orn__date {
  display: block;
  margin-top: 2px;
  font-size: clamp(6px, 1.5vw, 7.5px);
  letter-spacing: 0.1em;
  opacity: 0.72;
}
.orn__note {
  display: block;
  margin-top: 3px;
  font-size: clamp(7px, 1.7vw, 8.5px);
  line-height: 1.25;
  margin-top: 5px;
  opacity: 0.92;
  word-break: break-word;
}

@keyframes sway {
  from { transform: rotate(-2.2deg); }
  to { transform: rotate(2.2deg); }
}

/* ---------- 通用控件 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 218, 144, 0.06);
  color: var(--gold-1);
  font-size: 14px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.15s var(--ease);
  min-height: 44px;
}
.btn:hover { background: rgba(255, 218, 144, 0.12); border-color: var(--gold-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: default; }

.btn--primary {
  background: linear-gradient(180deg, #ffdfa3 0%, #e8b767 100%);
  border-color: #ffdfa3;
  color: #2a1a10;
  font-weight: 600;
  box-shadow: 0 8px 30px rgba(232, 183, 103, 0.22);
}
.btn--primary:hover { background: linear-gradient(180deg, #ffe9bd 0%, #f0c47c 100%); }

.btn--ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn--ghost:hover { color: var(--cream); background: rgba(255, 240, 221, 0.06); }
.btn--danger { color: var(--danger); border-color: rgba(255, 143, 143, 0.35); }
.btn--sm { padding: 8px 14px; min-height: 36px; font-size: 13px; }
.btn--block { width: 100%; }

.field { display: block; margin-bottom: 16px; }
.field__label {
  display: block;
  margin-bottom: 7px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
}
.field__req { color: var(--gold-2); letter-spacing: 0; }
.field__help {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--faint);
  letter-spacing: 0;
  text-transform: none;
}
.input, .textarea, .select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 240, 221, 0.04);
  color: var(--cream);
  font-family: var(--ui);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--gold-2);
  background: rgba(255, 240, 221, 0.07);
}
.textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: rgba(255, 240, 221, 0.28); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
/* Snow 的三个选项平分整行，不要挤在左边一小堆 */
#snow-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
#snow-chips .chip { text-align: center; padding-left: 6px; padding-right: 6px; }
.chip {
  padding: 9px 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  min-height: 40px;
}
.chip[aria-pressed="true"] {
  border-color: var(--gold-2);
  color: var(--gold-1);
  background: rgba(255, 218, 144, 0.12);
}

/* ---------- 顶栏 / 底栏 ---------- */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) 16px 12px;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.topbar__brand {
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--gold-2);
  opacity: 0.85;
}
.topbar__right { display: flex; align-items: center; gap: 8px; }

/* 音乐开关 */
.music {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(223, 183, 122, 0.26);
  background: rgba(12, 8, 12, 0.55);
  color: var(--gold-3);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.music:hover { border-color: rgba(223, 183, 122, 0.55); }
.music:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }
.music__icon { font-size: 16px; line-height: 1; transform: translateY(-0.5px); }
.music.is-on {
  color: #1a1014;
  background: var(--gold-2);
  border-color: var(--gold-2);
}
.music.is-on .music__icon { animation: musicPulse 1.6s ease-in-out infinite; }
@keyframes musicPulse {
  0%, 100% { transform: translateY(-0.5px) scale(1); }
  50% { transform: translateY(-0.5px) scale(1.16); }
}

.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(180deg, rgba(10, 6, 10, 0) 0%, rgba(10, 6, 10, 0.86) 42%, rgba(10, 6, 10, 0.96) 100%);
}
.dock--center { justify-content: center; }
.dock__spacer { flex: 1; }

/* ---------- 落地页 ---------- */

/* ---------- 落地页 ----------
   结构：左文案 / 中树 / 右说明（横向三栏，保持不变）。
   树画布必须铺满整个视口（原版 16:9 全屏画幅），否则：
     · WebGL 投影 x 会除以很窄的 aspect，树被横向拉出画面、两侧被裁、挂饰变形；
     · 深色背景只会画在中间那一块卡片里。
   所以 .stage 用 fixed 铺满全屏做背景，左右两栏作为透明层浮在树上。 */
body[data-route="landing"] .stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100vw;
  width: 100dvw;
  height: 100vh;
  height: 100dvh;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body[data-route="landing"] .stage::after { display: none; }
body[data-route="landing"] .topbar { position: relative; z-index: 6; }
body[data-route="landing"] .section,
body[data-route="landing"] .footer { position: relative; z-index: 5; }

/* ---------- 树页面（收礼人/树主看到的成品页）----------
   和落地页同一个毛病：画布只铺在中间那一列，左右两栏是死黑块。
   这里让 .stage 铺满整个视口当背景，三栏文字和按钮浮在上面。
   画布 aspect 变宽后树会跟着变高，所以下面按视口高度把树收一点。 */
body[data-route="tree"] .stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100vw;
  width: 100dvw;
  height: 100vh;
  height: 100dvh;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body[data-route="tree"] .view__stage {
  min-height: 0;
  background: transparent;
}
/* 三栏浮在画布上；左右栏加一层从外到内渐隐的暗幕，保证文字压得住星空 */
body[data-route="tree"] .view__head,
body[data-route="tree"] .dock { position: relative; z-index: 6; }
body[data-route="tree"] .panel { position: relative; z-index: 6; }
body[data-route="tree"] .panel--left {
  background: linear-gradient(90deg, rgba(7, 5, 10, 0.9) 0%, rgba(7, 5, 10, 0.66) 58%, rgba(7, 5, 10, 0) 100%);
}
body[data-route="tree"] .panel--right {
  background: linear-gradient(270deg, rgba(7, 5, 10, 0.9) 0%, rgba(7, 5, 10, 0.66) 58%, rgba(7, 5, 10, 0) 100%);
}
/* 矮窗口（笔记本半屏、1080×560 这种）：顶上那块会把树挤成一小截，
   这里把标题区压紧，把高度还给树。 */
@media (max-height: 740px) and (min-width: 1024px) {
  body[data-route="tree"] .view__head { padding-top: 14px; padding-bottom: 0; }
  body[data-route="tree"] .view__for { font-size: clamp(20px, 3.4vw, 26px); }
  body[data-route="tree"] .view__from { margin-top: 3px; }
  body[data-route="tree"] .view__msg { margin-top: 6px; font-size: 13px; max-width: 62ch; }
  body[data-route="tree"] .owner-bar { margin-top: 8px; padding: 6px 10px 6px 12px; }
  body[data-route="tree"] .owner-bar__text { font-size: 11px; line-height: 1.35; }
  body[data-route="tree"] .dock { padding-top: 4px; padding-bottom: 8px; }
}

.hero {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(18px, 3vw, 56px);
  min-height: 100svh;
  max-width: 1600px;
  margin: 0 auto;
  padding: 96px clamp(22px, 5vw, 72px) 44px;
  pointer-events: none; /* 让树的空白区域可透过；按钮单独恢复 */
}
.hero a, .hero button { pointer-events: auto; }
.hero__left { grid-column: 1; position: relative; z-index: 5; text-align: left; max-width: 30ch; }
.hero__right { grid-column: 3; position: relative; z-index: 5; display: grid; gap: 22px; justify-self: end; max-width: 280px; }
.hero__eyebrow {
  display: block;
  font-size: 10px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 14px;
}
.hero__title {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(30px, 3.5vw, 52px);
  line-height: 1.08;
  color: var(--gold-1);
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.85);
}
.hero__title em { font-style: italic; color: var(--gold-2); }
.hero__sub { display: block; margin: 16px 0 0; font-size: 14px; line-height: 1.6; color: var(--muted); }
.hero__actions { margin-top: 28px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.hero__actions .btn { padding: 13px 20px; font-size: 14px; }
.hero__hint { display: block; font-size: 11px; color: var(--faint); }
/* 首页那棵 demo 的"进得去"入口：内联链接，别做成第二个按钮抢主按钮的注意力 */
.hero__hint-link {
  color: var(--gold-3);
  text-decoration: none;
  border-bottom: 1px solid rgba(226, 196, 138, 0.4);
  padding-bottom: 1px;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.hero__hint-link:hover { color: var(--gold-1); border-bottom-color: var(--gold-1); }
/* 世界地图：每个点是一个国家里真的挂起来的树，点一下就会展开那一国的数字 */
.section--map { padding-top: 24px; }
.worldmap {
  position: relative;
  margin: 26px 0 0;
  padding: 0 0 6px;
}
.worldmap__land {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0.85;
  filter: drop-shadow(0 0 30px rgba(93, 148, 196, 0.08));
  pointer-events: none;
}
/* 有数据的国家再叠一层金色，深浅按人数；坐标系跟上面的底图完全一致，所以对得上 */
.worldmap__heat {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.worldmap__dots { position: absolute; inset: 0; }
.worldmap__dot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  background: none;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.worldmap__dot i {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold-3);
  box-shadow: 0 0 0 1px rgba(255, 236, 196, 0.55), 0 0 10px 2px rgba(226, 196, 138, 0.55);
  transition: width 0.25s ease, height 0.25s ease, box-shadow 0.25s ease;
}
.worldmap__dot--1 i { width: 6px; height: 6px; }
.worldmap__dot--2 i { width: 7px; height: 7px; }
.worldmap__dot--3 i { width: 9px; height: 9px; }
.worldmap__dot:hover i,
.worldmap__dot.is-on i {
  width: 11px;
  height: 11px;
  box-shadow: 0 0 0 2px rgba(255, 236, 196, 0.7), 0 0 16px 5px rgba(226, 196, 138, 0.6);
}
.worldmap__dot::after {
  content: attr(data-name);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 9px;
  border-radius: 6px;
  border: 1px solid rgba(226, 196, 138, 0.22);
  background: rgba(11, 17, 33, 0.94);
  color: var(--gold-2);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: 3;
}
.worldmap__dot:hover::after,
.worldmap__dot:focus-visible::after { opacity: 1; }
.worldmap__read {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(226, 196, 138, 0.14);
}
.worldmap__readout {
  font-family: var(--display);
  font-size: 15px;
  color: var(--gold-3);
  letter-spacing: 0.01em;
}
.worldmap__list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.worldmap__chip {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 6px 11px;
  border: 1px solid rgba(226, 196, 138, 0.16);
  border-radius: 999px;
  background: rgba(226, 196, 138, 0.04);
  color: var(--text-3);
  font-size: 11px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.worldmap__chip b {
  font-family: var(--display);
  font-weight: 400;
  font-size: 13px;
  color: var(--gold-3);
}
.worldmap__chip:hover,
.worldmap__chip.is-on { border-color: rgba(226, 196, 138, 0.45); background: rgba(226, 196, 138, 0.08); }

@media (max-width: 720px) {
  .worldmap { margin-top: 18px; }
  .worldmap__dot { width: 30px; height: 30px; }
  .worldmap__read { gap: 12px; }
}

/* 「已经有多少人做了」——竖排的数字块，比挤成一行更好认 */
.hero__proof {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid rgba(226, 196, 138, 0.14);
  width: fit-content;
}
.hero__proof__item { display: flex; align-items: baseline; gap: 10px; }
.hero__proof b {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 400;
  line-height: 1;
  color: var(--gold-3);
  min-width: 30px;
  text-align: right;
}
.hero__proof i {
  font-style: normal;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
}
.hero__note b {
  display: block;
  font-family: var(--display);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--gold-3);
  margin-bottom: 5px;
}
.hero__note span {
  display: block;
  font-family: var(--display);
  font-size: 15px;
  color: var(--gold-1);
  line-height: 1.25;
}
.hero__note small { display: block; margin-top: 6px; font-size: 11px; line-height: 1.5; color: var(--faint); }

@media (max-width: 719px) {
  .hero {
    grid-template-columns: 1fr;
    align-items: start;
    min-height: 100svh;
    padding: 104px 22px 40px;
  }
  .hero__left { grid-column: 1; max-width: 100%; }
  .hero__right { grid-column: 1; display: none; }
  .hero__title { font-size: clamp(30px, 9vw, 44px); }
  .hero__sub { max-width: 26ch; }
  .hero__actions { margin-top: 20px; }
}

@media (min-width: 720px) {
  .hero__right { gap: 24px; }
  .hero__note { padding-left: 16px; border-left: 1px solid var(--line); }
}

/* ---------- 开场同步出场 ----------
   SSR 给 body 加 .intro-pending，文字与挂饰先隐藏；landing.js 按树的时间线
   逐个加 .is-in 让它们浮现，与树的生长同步。无 JS / 减少动画 / 调试定点时
   landing.js 会移除 .intro-pending，内容直接可见。 */
.intro-pending .hero__eyebrow,
.intro-pending .hero__title,
.intro-pending .hero__sub,
.intro-pending .hero__actions,
.intro-pending .hero__hint,
.intro-pending .hero__note {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.intro-pending .hero__eyebrow.is-in,
.intro-pending .hero__title.is-in,
.intro-pending .hero__sub.is-in,
.intro-pending .hero__actions.is-in,
.intro-pending .hero__hint.is-in,
.intro-pending .hero__note.is-in {
  opacity: 1;
  transform: translateY(0);
}

.intro-pending .stage__layer .orn {
  opacity: 0;
  transition: opacity 0.75s var(--ease);
}
.intro-pending .stage__layer .orn.is-in { opacity: 1; }

.section { padding: 72px 24px; max-width: 980px; margin: 0 auto; }
.section__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(24px, 4vw, 34px);
  color: var(--gold-1);
  margin: 0 0 10px;
}
.section__lead { color: var(--muted); font-size: 15px; line-height: 1.7; max-width: 52ch; margin: 0 0 36px; }
.steps { display: grid; gap: 26px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 34px; } }
.step__num {
  font-family: var(--display);
  font-size: 30px;
  color: var(--gold-3);
  opacity: 0.65;
}
.step__title { margin: 6px 0 8px; font-size: 16px; color: var(--cream); }
.step__text { margin: 0; font-size: 14px; line-height: 1.65; color: var(--muted); }

.footer {
  padding: 34px 24px calc(40px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(223, 183, 122, 0.12);
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: space-between;
  font-size: 12px;
  color: var(--faint);
}
.footer a { color: var(--faint); }
.footer a:hover { color: var(--cream); }

/* ---------- 树页面 ---------- */

.view { position: relative; min-height: 100svh; display: flex; flex-direction: column; }
.view__head {
  position: relative;
  z-index: 10;
  padding: max(50px, calc(env(safe-area-inset-top) + 40px)) 22px 2px;
  text-align: center;
}
.owner-bar {
  margin: 16px auto 0;
  max-width: 440px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 14px;
  border: 1px solid rgba(223, 183, 122, 0.28);
  border-radius: 12px;
  background: rgba(223, 183, 122, 0.08);
  text-align: left;
}
.owner-bar__text {
  margin: 0;
  flex: 1;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}
.owner-bar__text b { color: var(--gold-1); font-weight: 600; }
.owner-bar .btn { white-space: nowrap; flex: none; }
@media (max-width: 540px) {
  .owner-bar { flex-wrap: wrap; }
  .owner-bar__text { flex: 1 0 100%; }
  .owner-bar .btn { flex: 1 1 0; }
}

/* 手机上这条"这是你的树"卡片会把标题区撑到 200px 高，树只能往下让，
   动画一放完就整棵往下掉、树根钻进底部按钮里。手机端收起来：
   Send 走底部的 Share，改样式走右上角 Edit，功能没少。 */
@media (max-width: 720px) {
  body[data-route="tree"] .owner-bar { display: none; }
}

.view__for {
  margin: 0;
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(21px, 5.4vw, 32px);
  color: var(--gold-1);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.6);
}
.view__from { margin: 6px 0 0; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--faint); }
.view__msg {
  margin: 14px auto 0;
  max-width: 26ch;
  font-family: var(--display);
  font-style: italic;
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
}
/* 树页那句"陌生人来过"的小字：只在真的有人留过灯时才出现，放在统计旁边当脚注 */
.view__whisper {
  margin: 30px 0 0;
  max-width: 34ch;
  font-family: var(--display);
  font-style: italic;
  font-size: 12.5px;
  line-height: 1.8;
  color: rgba(226, 196, 138, 0.55);
}
.view__stage { flex: 1; position: relative; min-height: 46svh; }
.view__stage .stage { position: absolute; inset: 0; }
.view__stage .stage__canvas, .view__stage .stage__layer { position: absolute; inset: 0; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  background: rgba(10, 6, 10, 0.4);
  backdrop-filter: blur(6px);
}
.badge b { color: var(--gold-1); font-weight: 600; }

.panel {
  display: none;
}
@media (min-width: 1024px) {
  .view {
    display: grid;
    grid-template-columns: clamp(240px, 21vw, 320px) minmax(0, 1fr) clamp(240px, 21vw, 320px);
    grid-template-rows: auto minmax(0, 1fr) auto;
    height: 100svh;
  }
  .view__head {
    grid-column: 2;
    grid-row: 1;
    position: static;
    padding: 34px 22px 8px;
  }
  .view__stage { grid-column: 2; grid-row: 2; min-height: 0; }
  .panel { display: block; padding: 96px 26px 40px; overflow-y: auto; }
  .panel--left { grid-column: 1; grid-row: 1 / span 2; border-right: 1px solid rgba(223, 183, 122, 0.1); }
  .panel--right { grid-column: 3; grid-row: 1 / span 2; border-left: 1px solid rgba(223, 183, 122, 0.1); }
  .dock { position: static; grid-column: 1 / -1; grid-row: 3; justify-content: center; }
  .topbar { position: absolute; }
}

.panel__title {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 14px;
}
.panel__stat { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.panel__stat b { font-family: var(--display); font-size: 26px; color: var(--gold-2); font-weight: 400; }
.panel__stat span { font-size: 12px; color: var(--faint); }
.panel__notes { margin: 26px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.panel__note {
  padding: 10px 12px;
  border-left: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}
.panel__note b { display: block; font-size: 11px; color: var(--gold-3); margin-bottom: 3px; letter-spacing: 0.08em; }

/* ---------- 编辑器 ---------- */

.editor { position: relative; min-height: 100svh; padding-bottom: 108px; }
.editor__stage { position: fixed; inset: 0; }
.editor__stage .stage { height: 100%; }
.editor__hint {
  position: fixed;
  left: 50%;
  top: 84px;
  transform: translateX(-50%);
  z-index: 44;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(8, 6, 10, 0.6);
  border: 1px solid rgba(223, 183, 122, 0.16);
  backdrop-filter: blur(8px);
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  pointer-events: none;
}
.editor__title {
  position: fixed;
  top: 44px;
  left: 0;
  right: 0;
  z-index: 40;
  text-align: center;
  padding: 0 22px;
  pointer-events: none;
}
.editor__title p {
  margin: 0;
  font-family: var(--display);
  font-style: italic;
  font-size: 20px;
  color: var(--gold-1);
}

/* 标题就是"给谁"的入口，点一下能改 */
.editor__for {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(223, 183, 122, 0.28);
  background: rgba(18, 10, 16, 0.55);
  color: var(--gold-1);
  font-family: var(--display);
  font-style: italic;
  font-size: 18px;
  line-height: 1.2;
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: border-color 0.2s, background 0.2s;
}
.editor__for:hover { border-color: rgba(223, 183, 122, 0.58); background: rgba(26, 15, 23, 0.7); }
.editor__for:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }
.editor__for-arrow { font-style: normal; font-size: 16px; opacity: 0.65; }

.toolbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(12px, env(safe-area-inset-top)) 14px 10px;
}
.toolbar__count { font-size: 12px; color: var(--faint); letter-spacing: 0.06em; }

.addbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  padding: 10px 14px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(10, 6, 10, 0) 0%, rgba(10, 6, 10, 0.9) 40%, rgba(10, 6, 10, 0.98) 100%);
}
.addbar__row { display: flex; gap: 8px; }
.addbar__btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 9px 6px 8px;
  border-radius: 14px;
  border: 1px solid rgba(223, 183, 122, 0.38);
  background: rgba(255, 240, 221, 0.06);
  color: rgba(255, 240, 221, 0.88);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.addbar__btn:hover { border-color: var(--gold-2); color: var(--gold-1); background: rgba(255, 218, 144, 0.08); }
.addbar__btn span:first-child { font-size: 19px; line-height: 1; color: var(--gold-2); }
.addbar__send { margin-top: 10px; }

/* ---------- 面板 / 弹层 ---------- */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: block;
  overflow-x: hidden;
  background: rgba(4, 3, 5, 0.72);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s var(--ease);
}
.sheet.is-open { opacity: 1; pointer-events: auto; }
.sheet__panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: auto;
  max-width: 460px;
  margin: 0 auto;
  max-height: 88svh;
  overflow-y: auto;
  padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0;
  background: linear-gradient(180deg, #1b1018 0%, #120b11 100%);
  border: 1px solid rgba(223, 183, 122, 0.2);
  border-bottom: 0;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.6);
  transform: translateY(14px);
  transition: transform 0.3s var(--ease);
}
.sheet.is-open .sheet__panel { transform: translateY(0); }
@media (min-width: 720px) {
  .sheet__panel { bottom: auto; top: 50%; transform: translateY(-50%); border-radius: 20px; border-bottom: 1px solid rgba(223, 183, 122, 0.2); }
  .sheet.is-open .sheet__panel { transform: translateY(-50%); }
}
.sheet__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.sheet__title { margin: 0; font-family: var(--display); font-size: 21px; font-weight: 400; color: var(--gold-1); }
.sheet__close {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line);
  background: transparent; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1;
}
.sheet__text { margin: 0 0 16px; font-size: 13px; line-height: 1.65; color: var(--muted); }
.sheet__actions { display: flex; gap: 10px; margin-top: 18px; }
.sheet__actions .btn { flex: 1; }

/* 配色选择：4 列均分，色块里画一棵迷你小树，名字放下面 */
.swatches {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px 10px;
}
.swatch {
  display: grid;
  gap: 7px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  text-align: center;
}
.swatch__tile {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10), 0 6px 16px rgba(0, 0, 0, 0.38);
  overflow: hidden;
  transition: transform 0.18s var(--ease), border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
/* 星星光点 */
.swatch__tile::before {
  content: "";
  position: absolute;
  top: 13%;
  left: 50%;
  width: 5px;
  height: 5px;
  margin-left: -2.5px;
  border-radius: 50%;
  box-shadow: 0 0 10px 3px rgba(255, 246, 226, 0.55);
  opacity: 0.9;
}
/* 玻璃反光 */
.swatch__tile::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0) 46%);
  pointer-events: none;
}
.swatch:hover .swatch__tile { transform: translateY(-2px); }
.swatch[aria-pressed="true"] .swatch__tile {
  border-color: var(--gold-2);
  box-shadow: 0 0 0 2px rgba(255, 218, 144, 0.30), 0 8px 20px rgba(0, 0, 0, 0.46);
}
.swatch__tick {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(10, 7, 10, 0.72);
  color: var(--gold-1);
  font-size: 10px;
  line-height: 16px;
  text-align: center;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease);
}
.swatch[aria-pressed="true"] .swatch__tick { opacity: 1; transform: scale(1); }
.swatch__name {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  transition: color 0.18s var(--ease);
}
.swatch[aria-pressed="true"] .swatch__name { color: var(--gold-1); }

@media (min-width: 720px) {
  .swatches { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 12px 10px; }
  .swatch__name { font-size: 9px; letter-spacing: 0.06em; }
}

/* 自定义调色：预设只是起点，下面四个参数随便调 */
.tint {
  margin-top: 16px;
  padding: 14px 14px 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 240, 221, 0.035);
}
.tint__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tint__title {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
}
.tint__reset {
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.18s var(--ease);
}
.tint__reset:hover { border-color: var(--gold-2); color: var(--gold-1); }
.tint__hint { margin: 8px 0 12px; font-size: 11px; line-height: 1.55; color: var(--faint); }
.tint__preview {
  height: 42px;
  margin: 0 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(100deg, #24322f 0%, #8fb7a4 34%, #ffd08a 62%, #ff8fa3 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 6px 16px rgba(0, 0, 0, 0.35);
  transition: filter 0.15s linear;
}
.tint .tune-row { margin: 10px 0; grid-template-columns: 78px 1fr 44px; }

/* 面板内部要能滚，但别把系统滚动条画在右边——那条灰杠在深色面板上很扎眼。 */
.sheet__panel,
.tune-panel,
.panel {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.sheet__panel::-webkit-scrollbar,
.tune-panel::-webkit-scrollbar,
.panel::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

/* 「树 / 背景」小标签：让用户一眼知道这一组在调什么 */
.panel__badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border: 1px solid rgba(223, 183, 122, 0.3);
  border-radius: 999px;
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--gold-2);
  text-transform: lowercase;
  vertical-align: 1px;
}
.tint--sky { margin-top: 14px; }
.tint--sky .tune-row { grid-template-columns: 96px 1fr 44px; }
.tint__preview--sky {
  background: linear-gradient(180deg, #04060b 0%, #081525 42%, #0d2b3f 74%, #123c4d 100%);
}

/* 色相滑块：彩虹轨道 */
.tint-row--hue input[type="range"],
.tint-row--sat input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 22px;
  background: transparent;
  accent-color: transparent;
}
.tint-row--hue input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff5d6c, #ffd166, #6ee7a8, #4dc9ff, #b07bff, #ff5d6c);
}
.tint-row--sat input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.16), rgba(255, 218, 144, 0.95));
}
/* 背景色相滑块：给出"夜色往哪边走"的直观轨迹（酒红→深蓝→青→墨绿→暖金） */
.tint-row--sky-hue input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 22px;
  background: transparent;
  accent-color: transparent;
}
.tint-row--sky-hue input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #7b2d5e, #2b4a8c, #0f7a8c, #2f8f6a, #c9a24a);
}
.tint-row--wash input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 22px;
  background: transparent;
  accent-color: transparent;
}
.tint-row--wash input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.14), rgba(255, 250, 235, 0.92));
}
.tint-row--wash input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -4px;
  border-radius: 50%;
  background: #fffdf8;
  border: 2px solid rgba(0, 0, 0, 0.42);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
}
.tint-row--wash input[type="range"]::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.14), rgba(255, 250, 235, 0.92));
}
.tint-row--wash input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fffdf8;
  border: 2px solid rgba(0, 0, 0, 0.42);
}
.tint-row--hue input[type="range"]::-webkit-slider-thumb,
.tint-row--sat input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -4px;
  border-radius: 50%;
  background: #fffdf8;
  border: 2px solid rgba(0, 0, 0, 0.42);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
}
.tint-row--hue input[type="range"]::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff5d6c, #ffd166, #6ee7a8, #4dc9ff, #b07bff, #ff5d6c);
}
.tint-row--sat input[type="range"]::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.16), rgba(255, 218, 144, 0.95));
}
.tint-row--hue input[type="range"]::-moz-range-thumb,
.tint-row--sat input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fffdf8;
  border: 2px solid rgba(0, 0, 0, 0.42);
}

.photo-pick {
  display: block;
  width: 100%;
  padding: 26px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.photo-pick:hover { border-color: var(--gold-2); color: var(--gold-1); }
.photo-preview { position: relative; border-radius: 12px; overflow: hidden; background: #150e13; }
.photo-preview img { width: 100%; max-height: 240px; object-fit: cover; }

/* ---------- 分享 ---------- */

.share-card {
  padding: 18px;
  border-radius: 16px;
  background: rgba(255, 240, 221, 0.04);
  border: 1px solid var(--line);
}
.share-card__label { font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; }
.share-card__text {
  font-size: 14px; line-height: 1.6; color: var(--cream); margin: 0 0 12px;
  padding: 12px; border-radius: 10px; background: rgba(0, 0, 0, 0.32);
  font-family: var(--ui);
}
.share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.share-grid .btn { width: 100%; }

/* 海外分享渠道 */
.share-apps { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.share-app {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 240, 221, 0.05);
  font-family: var(--ui);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--cream);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, transform 0.12s;
}
.share-app:hover { background: rgba(255, 240, 221, 0.09); }
.share-app:active { transform: scale(0.97); }
.share-app--wa { border-color: rgba(37, 211, 102, 0.42); color: #6ff0a3; }
.share-app--tg { border-color: rgba(64, 168, 232, 0.42); color: #7cc6f5; }
.share-app--ig { border-color: rgba(225, 48, 108, 0.42); color: #f58aae; }
.share-app--fb { border-color: rgba(66, 103, 178, 0.5); color: #8fb0e8; }
.share-app--x { border-color: rgba(255, 255, 255, 0.26); color: #f2f2f2; }
.share-app--mail { border-color: rgba(223, 183, 122, 0.35); color: var(--gold-1); }
.share-app--sms { border-color: rgba(120, 200, 140, 0.34); color: #a8e0b4; }
.share-hint {
  display: none;
  margin: 10px 0 0;
  font-size: 11px;
  line-height: 1.5;
  color: var(--faint);
}
.share-hint.is-on { display: block; }

/* ---------- 灯箱 ---------- */

.lightbox {
  position: fixed; inset: 0; z-index: 95; display: none;
  align-items: center; justify-content: center; padding: 24px;
  background: rgba(4, 3, 5, 0.9); backdrop-filter: blur(8px);
}
.lightbox.is-open { display: flex; }
.lightbox__inner { max-width: 520px; width: 100%; text-align: center; }
.lightbox img { max-height: 62svh; margin: 0 auto; border-radius: 4px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7); }
.lightbox__cap { margin-top: 16px; font-family: var(--display); font-size: 17px; color: var(--cream); line-height: 1.5; }
.lightbox__meta { margin-top: 6px; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
.lightbox__actions { margin-top: 20px; display: flex; gap: 10px; justify-content: center; }

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translate(-50%, 12px);
  z-index: 120;
  padding: 11px 18px;
  border-radius: 999px;
  background: rgba(24, 15, 21, 0.96);
  border: 1px solid var(--line);
  color: var(--cream);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  max-width: 86vw;
  text-align: center;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 纪念册 ---------- */

.album { max-width: 980px; margin: 0 auto; padding: 96px 20px calc(60px + env(safe-area-inset-bottom)); }
.album__list { display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .album__list { grid-template-columns: 1fr 1fr; } }
.album__item {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(223, 183, 122, 0.12);
}
.album__thumb {
  width: 108px; height: 108px; border-radius: 4px; object-fit: cover;
  background: rgba(255, 240, 221, 0.05);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-size: 26px; color: var(--gold-3);
}
.album__body { font-family: var(--display); font-size: 15px; line-height: 1.6; color: var(--cream); margin: 0 0 6px; }
.album__meta { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }

/* ---------- 法务页 ---------- */

.legal { max-width: 720px; margin: 0 auto; padding: 108px 22px 80px; }
.legal h1 { font-family: var(--display); font-weight: 400; font-size: 34px; color: var(--gold-1); margin: 0 0 8px; }
.legal h2 { font-size: 16px; margin: 30px 0 10px; color: var(--gold-2); }
.legal p, .legal li { font-size: 14px; line-height: 1.75; color: var(--muted); }
.legal ul { padding-left: 20px; }
.legal__meta { font-size: 12px; color: var(--faint); margin-bottom: 28px; }

/* ---------- 结语层（点亮后） ---------- */

.finale {
  position: fixed; inset: 0; z-index: 60; display: none;
  align-items: center; justify-content: center; text-align: center;
  padding: 24px; background: radial-gradient(circle at 50% 50%, rgba(28, 11, 21, 0.86), rgba(6, 4, 7, 0.96));
  backdrop-filter: blur(3px);
}
.finale.is-open { display: flex; }
.finale__inner { max-width: 420px; }
.finale__title { font-family: var(--display); font-style: italic; font-size: 30px; color: var(--gold-1); margin: 0 0 10px; }
.finale__text { font-size: 14px; color: var(--muted); line-height: 1.7; margin: 0 0 24px; }

/* ---------- 原版渲染器高级设置 ---------- */

.tune {
  position: fixed;
  top: 62px;
  right: 14px;
  z-index: 50;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(223, 183, 122, 0.28);
  background: rgba(18, 11, 17, 0.78);
  color: var(--gold-2);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}
.tune:hover { background: rgba(223, 183, 122, 0.16); }
.tune[aria-expanded="true"] { background: rgba(223, 183, 122, 0.22); color: var(--gold-1); }
.tune-panel {
  position: fixed;
  z-index: 55;
  left: 0; right: 0; bottom: 0;
  max-height: 78svh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 18px calc(20px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(24, 14, 21, 0.96), rgba(10, 6, 10, 0.98));
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(223, 183, 122, 0.2);
  color: var(--cream);
  transform: translateY(103%);
  transition: transform 0.3s var(--ease);
}
.tune-panel[data-open="true"] { transform: translateY(0); }
@media (min-width: 860px) {
  .tune-panel {
    left: auto;
    right: 16px;
    bottom: 16px;
    width: 352px;
    max-height: 82vh;
    border: 1px solid rgba(223, 183, 122, 0.22);
    border-radius: 16px;
  }
}
.tune-panel *, .tune-panel { box-sizing: border-box; }
.tune-panel h2 { margin: 0 0 3px; font-family: var(--display); font-size: 18px; font-weight: 400; color: var(--gold-1); }
.tune-sub { margin: 0 0 14px; font-size: 11px; color: var(--faint); }
.tune-row { display: grid; grid-template-columns: 88px 1fr 44px; align-items: center; gap: 8px; margin: 10px 0; }
.tune-row label { color: var(--muted); font-size: 12px; }
.tune-val { text-align: right; font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
.tune-wide { grid-template-columns: 88px 1fr; }
.tune-wide input[type="text"] {
  width: 100%; padding: 8px 10px; border-radius: 8px; font-size: 13px;
  border: 1px solid rgba(223, 183, 122, 0.25); background: rgba(255, 240, 221, 0.05); color: var(--cream);
}
.tune-row input[type="range"] { width: 100%; height: 24px; accent-color: var(--gold-2); }
.tune-chips { display: flex; flex-wrap: wrap; gap: 6px; grid-column: 2 / 4; }
.tune-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 9px 5px 6px; border-radius: 20px; cursor: pointer;
  border: 1px solid rgba(223, 183, 122, 0.22); background: rgba(255, 240, 221, 0.05);
  color: var(--muted); font-size: 11px;
}
.tune-chip[aria-pressed="true"] { border-color: var(--gold-2); background: rgba(223, 183, 122, 0.16); color: var(--gold-1); }
.tune-chip i { width: 13px; height: 13px; border-radius: 50%; display: block; }
.tune-actions { display: flex; gap: 10px; margin-top: 16px; }
.tune-actions button {
  flex: 1; padding: 11px 0; border-radius: 10px; cursor: pointer; font-size: 12px; letter-spacing: 0.04em;
  border: 1px solid rgba(223, 183, 122, 0.5); background: rgba(223, 183, 122, 0.14); color: var(--gold-1);
}
.tune-actions .tune-ghost { border-color: rgba(223, 183, 122, 0.2); background: transparent; color: var(--faint); }
.tune-hint { margin: 10px 0 0; font-size: 11px; line-height: 1.5; color: var(--faint); }

@media (prefers-reduced-motion: reduce) {
  .orn__inner { animation: none; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}


