/* 伤感咩吖 — A Letter for AURORA
 * 风格：环球手写信博物馆 · 暖色手作拼贴/剪贴簿
 * 奶油纸张 + 原木软木板 + 胶带/图钉质感，自然民谣、温暖耐看。 */

/* ============================ 字体 ============================ */
/* AURORA 官方字体（标题点睛） */
@font-face {
  font-family: "AuroraChrome";
  src: url("../fonts/AURORAxCHROME.woff2?v=20260613m7") format("woff2");
  font-display: swap;
}
/* 思源宋体 / 思源黑体：生产环境自托管到 assets/fonts/ 后下面两段会生效；
   未提供时自动回落到系统的同族字体，视觉一致。 */
@font-face {
  font-family: "Source Han Serif SC";
  src: url("../fonts/SourceHanSerifSC-Regular.woff2?v=20260613m7") format("woff2"),
       local("Source Han Serif SC"), local("Noto Serif CJK SC"), local("Noto Serif SC");
  font-display: swap;
}
@font-face {
  font-family: "Source Han Sans SC";
  src: url("../fonts/SourceHanSansSC-Regular.woff2?v=20260613m7") format("woff2"),
       local("Source Han Sans SC"), local("Noto Sans CJK SC"), local("Noto Sans SC");
  font-display: swap;
}
/* 霞鹜文楷（手写楷体，纸条正文）：常用字（GB2312 + 标点）单文件子集，一次请求即可，
   远快于按 unicode-range 拆成几十个分块的扇出。极生僻字回落系统楷体。
   子集由 deploy/fetch_fonts.sh 生成（fontTools）。 */
@font-face {
  font-family: "LXGW WenKai";
  src: url("../fonts/LXGWWenKai-subset.woff2?v=20260613m7") format("woff2"),
       local("LXGW WenKai"), local("Kaiti SC"), local("KaiTi"), local("STKaiti");
  font-display: swap;
}
/* 得意黑 Smiley Sans（详情页正文，OFL 免费可商用，醒目斜体黑） */
@font-face {
  font-family: "Smiley Sans";
  src: url("../fonts/SmileySans-Oblique.woff2?v=20260613m7") format("woff2"),
       local("Smiley Sans Oblique"), local("Smiley Sans");
  font-display: swap;
}

/* ============================ 变量 ============================ */
:root {
  /* 暖色纸张基调 */
  --paper:      #f4ebd9;
  --paper-deep: #ece0c6;
  --board:      #d8c4a0;   /* 软木/麻布底板 */
  --ink:        #4a3b2e;   /* 暖褐墨色 */
  --ink-soft:   #7a6650;
  --line:       #cbb892;

  /* 四种纸条主题色（呼应 PNG 素材，用于 from/详情等点缀） */
  --c-pink:  #c8607a;
  --c-blue:  #3f6796;
  --c-red:   #a8424a;
  --c-kraft: #b07a3f;

  /* 自然民谣的辅助色 —— 苔绿、赭石、天蓝、暮玫瑰 */
  --sage:    #8a9a6b;
  --ochre:   #cf9a4e;
  --sky:     #7fa6c9;
  --rose:    #d39ba6;

  --tape:    rgba(226, 214, 176, 0.62);

  --font-serif: "Source Han Serif SC", "Songti SC", "STSong", Georgia, serif;
  --font-sans:  "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  /* 纸条正文：手写楷体（霞鹜文楷），更贴合手写信氛围 */
  --font-note:  "LXGW WenKai", "Kaiti SC", "KaiTi", var(--font-serif);
  /* 详情页正文：得意黑（Smiley Sans），醒目有个性 */
  --font-detail: "Smiley Sans", "Source Han Sans SC", var(--font-sans);
  --font-disp:  "AuroraChrome", var(--font-serif);

  --shadow-note: 0 10px 22px -12px rgba(74, 59, 46, 0.55);
  --radius: 14px;
}

* { box-sizing: border-box; }

/* hidden 属性优先级最高：避免被 .modal/.lightbox 的 display 规则覆盖 */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  position: relative;
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background-color: #f0e2bf;
  /* 手刷灰泥/画布质感（暖色）：离线生成的 15KB 无缝小图平铺，渲染开销极低；
     上面叠两层轻量径向渐变做光晕。不再使用实时 SVG 滤镜背景。 */
  background-image:
    radial-gradient(120% 80% at 15% 0%, rgba(255, 248, 228, 0.55) 0%, rgba(255,248,228,0) 55%),
    radial-gradient(90% 70% at 100% 100%, rgba(199, 154, 82, 0.14) 0%, rgba(199,154,82,0) 50%),
    url("../img/paper-texture.jpg");
  background-size: auto, auto, 512px 512px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.modal-open { overflow: hidden; }

a { color: inherit; }

/* ============================ 顶栏 ============================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px clamp(16px, 4vw, 48px);
  /* 改用近不透明纯色背景，去掉 backdrop-filter 毛玻璃——后者会在每帧滚动重新模糊背后区域，是滚动卡顿主因 */
  background: linear-gradient(180deg, #f4ebd9 0%, #f1e6cd 100%);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 700; }
.brand-mark { color: var(--ochre); font-size: 1.1rem; }
.brand-text { font-family: var(--font-serif); letter-spacing: 0.02em; }
.nav { display: flex; gap: clamp(10px, 2vw, 26px); margin-left: auto; }
.nav a {
  text-decoration: none; color: var(--ink-soft); font-size: 0.95rem;
  padding-bottom: 3px; border-bottom: 2px solid transparent; transition: 0.2s;
}
.nav a:hover { color: var(--ink); border-bottom-color: var(--ochre); }
.lang-switch { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.lang-switch button {
  border: 0; background: transparent; cursor: pointer; padding: 5px 11px;
  font-family: var(--font-sans); color: var(--ink-soft); font-size: 0.85rem; transition: 0.18s;
}
.lang-switch button.active { background: var(--ochre); color: #fff; }

/* ============================ 第一幕：信封 ============================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 20px;
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.hero.lifted { opacity: 0; transform: translateY(-40px); pointer-events: none; height: 0; min-height: 0; padding: 0; overflow: hidden; }
/* 揭示后英雄区已不可见：停掉光尘/信封的持续动画，避免在 0 高度容器里空转浪费合成 */
.hero.lifted .hero-dust i, .hero.lifted .envelope { animation: none !important; }
.hero-bg {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 50% at 50% 38%, rgba(255, 233, 191, 0.6), rgba(255,233,191,0) 70%);
}

.envelope-stage { display: grid; justify-items: center; gap: 22px; }

/* 信封本体（3D 透视） */
.envelope {
  position: relative;
  width: min(86vw, 460px);
  height: min(58vw, 300px);
  cursor: pointer;
  perspective: 1400px;
  transform-style: preserve-3d;
  filter: drop-shadow(0 26px 34px rgba(74, 59, 46, 0.34));
  animation: drop-in 1s cubic-bezier(.2,.8,.25,1) both;
}
@keyframes drop-in {
  0%   { transform: translateY(-90px) rotate(-3deg) scale(.92); opacity: 0; }
  100% { transform: translateY(0) rotate(0) scale(1); opacity: 1; }
}
.env-back, .env-body, .env-front, .env-flap, .env-letter { position: absolute; inset: 0; border-radius: 8px; }

.env-back { background: linear-gradient(145deg, #e7d7b4, #d9c499); }

/* 信纸（藏在信封内，开启后抽出） */
.env-letter {
  inset: 8% 7% auto 7%;
  height: 84%;
  background: linear-gradient(180deg, #fffaf0, #fdf3df);
  border: 1px solid #ece0c6;
  border-radius: 6px;
  box-shadow: 0 6px 16px -8px rgba(74,59,46,.4);
  display: grid;
  place-content: center;
  text-align: center;
  padding: 18px;
  transform: translateY(0);
  opacity: 0;                /* 初始隐藏信纸；移动 Safari 会把 clip-path 缝隙里的信纸透出来 */
  transition:
    transform 1.05s cubic-bezier(.2,.8,.2,1),
    opacity .28s ease;
  z-index: 1;
}
.env-letter-head { font-family: var(--font-disp); font-size: clamp(1.1rem, 3.4vw, 1.7rem); margin: 0 0 6px; letter-spacing: .08em; color: var(--ink); }
.env-letter-sub { font-family: var(--font-serif); font-style: italic; color: var(--ink-soft); margin: 0; font-size: .9rem; }

/* 信封主体 + 正面（遮住信纸下半） */
.env-body { background: linear-gradient(160deg, #efe1c2, #e3cfa6); z-index: 2; clip-path: polygon(0 38%, 50% 72%, 100% 38%, 100% 100%, 0 100%); }
.env-front {
  z-index: 3; display: grid; place-items: center; text-align: center;
  background: linear-gradient(160deg, rgba(239,225,194,.0), rgba(239,225,194,.0));
  clip-path: polygon(0 100%, 0 40%, 50% 74%, 100% 40%, 100% 100%);
  pointer-events: none;
}
/* 标题放在信封下方三角口袋区（中心 V 口在 74% 以下安全），不被信封盖遮挡 */
.env-title {
  position: absolute;
  left: 0; right: 0; bottom: 5%;
  font-family: var(--font-disp);
  font-size: clamp(1.3rem, 4.6vw, 2.2rem);
  line-height: 1; margin: 0; color: var(--ink);
  letter-spacing: .06em;
}
.env-title small {
  display: block;
  font-size: .38em;
  letter-spacing: .28em;
  color: var(--ochre);
  margin-bottom: 6px;
}

/* 邮票（含 30 周岁印记） */
.env-stamp {
  position: absolute; top: 12px; right: 14px; z-index: 4;
  width: 52px; height: 60px; border-radius: 4px;
  background: repeating-linear-gradient(45deg, #d39ba6, #d39ba6 6px, #c8607a 6px, #c8607a 12px);
  border: 3px dashed #fff6e4;
  display: grid; place-items: center;
  box-shadow: 0 3px 8px -3px rgba(74,59,46,.5);
  transform: rotate(6deg);
}
.stamp-30 { font-family: var(--font-disp); font-size: 1.5rem; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.25); }

/* 信封盖（开启时向上翻起） */
.env-flap {
  z-index: 5; transform-origin: top center;
  background: linear-gradient(160deg, #ecdcb9, #ddc69c);
  clip-path: polygon(0 0, 100% 0, 50% 56%);
  transition: transform 0.9s ease;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform;
  border-radius: 8px 8px 0 0;
}

/* 开启动画 */
/* 开启时：信封整体下移给抽出的信纸腾空间（避免信纸顶进顶栏被挡），
   下方按钮/提示/倒计时同时淡出 */
.envelope { transition: margin-top .9s cubic-bezier(.2,.8,.25,1); }
.envelope.is-opening,
.envelope.is-open { margin-top: clamp(110px, 20vh, 200px); }
.envelope.is-opening .env-flap,
.envelope.is-open .env-flap { transform: rotateX(180deg); z-index: 1; }
.envelope.is-open .env-letter { transform: translateY(-78%); opacity: 1; z-index: 6; }
.envelope.is-opening ~ .env-from,
.envelope.is-opening ~ .env-open-btn,
.envelope.is-opening ~ .env-hint,
.envelope.is-opening ~ .countdown,
.envelope.is-open ~ .env-from,
.envelope.is-open ~ .env-open-btn,
.envelope.is-open ~ .env-hint,
.envelope.is-open ~ .countdown {
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease .25s;
}

.env-from { font-family: var(--font-serif); font-style: italic; color: var(--ink-soft); margin: 0; }
.env-open-btn {
  font-family: var(--font-sans); cursor: pointer;
  background: var(--ink); color: #fff7e8; border: 0;
  padding: 11px 30px; border-radius: 999px; font-size: 1rem;
  box-shadow: 0 8px 18px -8px rgba(74,59,46,.7); transition: .2s;
}
.env-open-btn:hover { transform: translateY(-2px); background: #5a4636; }
.env-hint { font-size: .85rem; color: var(--ink-soft); margin: 0; opacity: .8; }

/* ============================ 区块通用 ============================ */
.section-head { text-align: center; padding: clamp(40px, 7vw, 80px) 20px 14px; }
.section-title { font-family: var(--font-serif); font-size: clamp(1.6rem, 4.6vw, 2.6rem); margin: 0 0 8px; color: var(--ink); }
.section-sub { color: var(--ink-soft); margin: 0; font-size: 1rem; }

/* ============================ 第二幕：纸条墙 ============================ */
.wall-section {
  padding-bottom: 30px;
  scroll-margin-top: 78px;
}
/* 固定列数网格：电脑 3 条/行，平板 2 条/行，手机 1 条/行，自适应 */
.wall {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: start;
  gap: clamp(20px, 3vw, 40px);
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px clamp(16px, 4vw, 48px) 0;
}
@media (max-width: 920px) { .wall { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .wall { grid-template-columns: 1fr; max-width: 420px; } }

.note {
  position: relative;
  display: flex;
  flex-direction: column;
  transition: transform .25s ease, filter .25s ease;
  animation: note-in .6s ease both;
  animation-delay: var(--delay, 0ms);
  padding-top: 18px;
}
@keyframes note-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; } }
.note:hover { transform: scale(1.03); filter: drop-shadow(0 14px 22px rgba(74,59,46,.3)); z-index: 5; }

/* from xxx —— 纸条外左上 */
.note-from {
  margin: 0 0 -8px 8px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: .82rem;
  color: var(--ink-soft);
  position: relative; z-index: 3;
}
.note-from strong { color: var(--ink); font-style: normal; }

/* 纸条主体：PNG 按各自真实比例铺满（aspect-ratio 由 JS 内联设置），绝不拉伸变形。
   文字用绝对定位放在「中央安全区」——不撑高盒子、不溢出撕纸边缘、避开四角的星星/图钉等装饰。 */
.note-paper {
  position: relative;
  background-repeat: no-repeat;
  background-size: 100% 100%;     /* 比例与图一致，故不会变形 */
  cursor: pointer;
  filter: drop-shadow(0 8px 16px -10px rgba(74,59,46,.5));
  isolation: isolate;
  /* 点击纸条/文字时：不显示文字选中高亮、不显示移动端点按高亮(避免出现“下横线/灰框”) */
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.note-paper, .note-text { text-decoration: none; }
/* 悬停时「每一行」文字下方浮现横线（像信纸横格），淡入；颜色自动跟随墨色。
   padding-bottom 给最后一行的下划线留出空间，使其不被 overflow:hidden 裁掉。 */
.note-text-inner {
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  padding-bottom: 5px;
  transition: text-decoration-color .22s ease;
}
.note-paper:hover .note-text-inner,
.note-paper:focus-visible .note-text-inner {
  text-decoration-color: currentColor;
}
/* 仅键盘聚焦时给柔和外框，鼠标点击不显示 */
.note-paper:focus { outline: none; }
.note-paper:focus-visible { outline: 2px solid var(--ochre); outline-offset: 3px; border-radius: 4px; }
/* 小纸条不再使用胶带装饰（群体开信信件的胶带保留，见 .gl-tape）。 */
/* 文字容器：绝对定位，限定在该纸条「专属安全区」内（top/right/bottom/left 由 JS 按图设置）。
   居中放置；overflow hidden 保证文字绝不溢出纸条边缘。 */
.note-text {
  position: absolute;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
/* 内层文字：自然字重（非加粗，避免“肿胀”感），行数由 JS 按各图设置 */
.note-text-inner {
  font-family: var(--font-note); /* 霞鹜文楷手写楷体 */
  font-weight: 400;
  font-size: clamp(.84rem, 1.24vw, 1.0rem);
  line-height: 1.52;
  letter-spacing: .01em;
  word-break: break-word;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 3; /* 兜底；实际由内联 webkitLineClamp 覆盖 */
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-height: calc(var(--note-lines, 3) * 1.52em);
}
/* 墨迹 SVG 置换滤镜（feTurbulence/feDisplacement）很吃渲染，逐张常驻会导致滚动卡顿。
   改为仅鼠标悬停在某张纸条时才施加——常态零滤镜开销，需要看质感时一悬停即有。 */
.note-paper:hover .note-text-inner {
  filter: url(#inkTexture);
}
@media (hover: none) {
  /* 触屏设备没有 hover，直接不施加，避免点按瞬间的闪卡 */
  .note-paper:hover .note-text-inner { filter: none; }
}
/* 「墨迹写在纸上」的关键：让笔画跟随纸面褶皱深浅变化、被纸吸收，而非一层纯色贴上去。
   浅色纸条（牛皮/粉）—— 深墨 + multiply + 略降透明度，墨色渗入纸纹与阴影；
   深色纸条（蓝/红）—— 暖白「墨」+ screen，随纸面明暗起伏，不是死白一片。 */
.note-kraft .note-text-inner,
.note-pink .note-text-inner {
  color: #2a1d10;
  mix-blend-mode: multiply;
  opacity: .9;
}
/* 深色纸条（蓝/红）：暖白墨 + screen，随纸面明暗起伏。
   不加 text-shadow —— 阴影会在行间叠出「未悬停就有暗横线」的假象。 */
.note-blue .note-text-inner,
.note-red .note-text-inner {
  color: #fbf3df;
  mix-blend-mode: screen;
  opacity: .97;
}

/* 含图片角标 */
.img-badge {
  position: absolute; top: 8px; right: 10px;
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 250, 240, 0.85);
  color: var(--ink); box-shadow: 0 2px 5px -2px rgba(74,59,46,.6);
  z-index: 3;
}
/* 多图张数角标 */
.img-badge-count {
  position: absolute; bottom: -6px; right: -8px;
  font-style: normal; font-family: var(--font-sans);
  font-size: .62rem; font-weight: 700; line-height: 1;
  background: var(--c-red); color: #fff7e8;
  padding: 2px 5px; border-radius: 999px;
}

/* 右下 详情 */
.note-detail {
  display: inline-block;
  margin: 6px 8px 0 auto;
  float: right;
  background: none; border: 0; cursor: pointer;
  font-family: var(--font-sans);
  font-size: .82rem; color: var(--ink-soft);
  border-bottom: 1px dashed var(--ink-soft);
  padding: 0 0 1px; transition: .18s;
}
.note-detail:hover { color: var(--c-red); border-bottom-color: var(--c-red); }

.scroll-hint { text-align: center; color: var(--ink-soft); font-style: italic; font-family: var(--font-serif); opacity: .75; margin: 30px 0; }

/* ============================ 第三幕：投稿表单 ============================ */
.submit-section { padding-bottom: 40px; }
.note-form {
  max-width: 640px; margin: 10px auto 0;
  background: linear-gradient(180deg, #fffaf0, #fbf2de);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(22px, 4vw, 38px);
  box-shadow: 0 20px 40px -28px rgba(74,59,46,.6);
  position: relative;
}
.note-form::before {
  content: ""; position: absolute; top: -14px; left: 50%; transform: translateX(-50%) rotate(-1.5deg);
  width: 120px; height: 26px; background: var(--tape); border-radius: 2px;
}
.field { margin-bottom: 20px; display: flex; flex-direction: column; gap: 7px; }
.field label { font-family: var(--font-sans); font-weight: 600; font-size: .92rem; color: var(--ink); }
.field input, .field select, .field textarea {
  font-family: var(--font-sans); font-size: 1rem; color: var(--ink);
  background: #fffdf7; border: 1px solid var(--line); border-radius: 9px;
  padding: 11px 13px; resize: vertical; transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--ochre); box-shadow: 0 0 0 3px rgba(207,154,78,.18);
}
.counter { font-size: .78rem; color: var(--ink-soft); align-self: flex-end; }
.ghost-btn {
  align-self: flex-start; margin-top: 4px;
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 16px; cursor: pointer; color: var(--ink-soft); font-family: var(--font-sans); transition: .18s;
}
.ghost-btn:hover { border-color: var(--ochre); color: var(--ink); }

.parsed-links { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 12px; }
.parsed-label { width: 100%; margin: 0 0 2px; font-size: .82rem; color: var(--ink-soft); }
.link-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--paper-deep); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 13px; font-size: .85rem; text-decoration: none; color: var(--ink);
  transition: .18s;
}
.link-chip:hover { background: var(--ochre); color: #fff; border-color: var(--ochre); }
.chip-ico { font-size: .95rem; }

.send-btn {
  width: 100%; margin-top: 8px; cursor: pointer; border: 0;
  background: linear-gradient(180deg, var(--c-red), #8e363d); color: #fff7e8;
  font-family: var(--font-sans); font-size: 1.05rem; padding: 13px; border-radius: 999px;
  box-shadow: 0 12px 22px -12px rgba(168,66,74,.9); transition: .2s;
}
.send-btn:hover:not(:disabled) { transform: translateY(-2px); }
.send-btn:disabled { opacity: .6; cursor: progress; }
.form-msg { text-align: center; margin: 14px 0 0; min-height: 1.4em; font-size: .95rem; }
.form-msg.ok { color: var(--sage); font-weight: 600; }
.form-msg.err { color: var(--c-red); }

/* ============================ 第四幕：历年生贺视频 ============================ */
.video-section {
  padding: clamp(42px, 7vw, 82px) 0 34px;
  scroll-margin-top: 78px;
}
.video-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(18px, 3vw, 34px);
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 48px);
}
.video-card {
  margin: 0;
  border: 1px solid rgba(184, 151, 92, .42);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 252, 242, .96), rgba(248, 236, 208, .92)),
    var(--paper);
  box-shadow: 0 18px 44px -28px rgba(74, 59, 46, .55);
  overflow: hidden;
}
.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #251f1b;
  border-bottom: 1px solid rgba(184, 151, 92, .35);
}
.video-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  overflow: hidden;
  color: #fffaf0;
  background: #251f1b;
}
.video-poster img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.01);
  filter: saturate(.95) contrast(.92) brightness(.78);
  transition: transform .35s ease, filter .35s ease;
}
.video-poster::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(37, 31, 27, .12), rgba(37, 31, 27, .52)),
    radial-gradient(circle at center, rgba(255, 250, 240, .16), transparent 42%);
}
.video-poster:hover img {
  transform: scale(1.045);
  filter: saturate(1) contrast(.96) brightness(.84);
}
.video-play {
  position: relative;
  z-index: 1;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  padding-left: 4px;
  color: #fffaf0;
  background: rgba(64, 49, 38, .86);
  box-shadow: 0 14px 34px rgba(28, 20, 14, .3);
  font-size: 1.28rem;
}
.video-load-text {
  position: absolute;
  z-index: 1;
  left: 14px;
  bottom: 12px;
  max-width: calc(100% - 28px);
  padding: 5px 10px;
  border-radius: 999px;
  color: #fffaf0;
  background: rgba(58, 46, 34, .72);
  font-size: .86rem;
  line-height: 1.25;
}
.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.video-meta {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px 14px;
  padding: 14px 16px 16px;
}
.video-year {
  margin: 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.35rem;
  color: var(--c-red);
}
.video-meta h3 {
  margin: 0;
  min-width: 0;
  font-family: var(--font-serif);
  font-size: clamp(1rem, 2vw, 1.18rem);
  color: var(--ink);
  font-weight: 600;
}
.video-meta a {
  color: var(--ink-soft);
  font-size: .92rem;
  text-decoration: none;
  border-bottom: 1px dashed currentColor;
  white-space: nowrap;
}
.video-meta a:hover {
  color: var(--c-red);
}

/* ============================ 第四幕：画作（备用，当前不展示） ============================ */
.art-section {
  padding-bottom: 40px;
  scroll-margin-top: 78px;
}
.art-grid {
  display: grid; gap: clamp(16px, 2.5vw, 28px);
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  max-width: 1100px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 48px);
}
.art-card {
  margin: 0; background: #fffaf0; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 10px 14px; box-shadow: var(--shadow-note); transform: rotate(-1deg);
}
.art-card img { width: 100%; border-radius: 6px; cursor: zoom-in; display: block; }
.art-card figcaption { font-family: var(--font-serif); margin-top: 8px; font-size: .9rem; }
.art-empty { text-align: center; color: var(--ink-soft); font-family: var(--font-serif); font-style: italic; padding: 30px; }

/* ============================ 结尾：半圆蛋糕背景 ============================ */
.site-footer { text-align: center; padding: clamp(50px, 8vw, 100px) 20px 0; }
/* 舞台：贴住页面最底，裁掉未升起部分；底色与全站一致 -> 蛋糕底边与页底无缝衔接 */
.cake-stage {
  position: relative;
  margin: clamp(26px, 4vw, 46px) -20px 0;
  height: clamp(118px, 18vw, 230px);
  overflow: hidden;
  pointer-events: none;
}
.cake-stage img {
  position: absolute;
  inset: 0;
  height: 100%;
  width: 100%;
  object-fit: cover;
  object-position: bottom center;
  display: block;
  transform: translateY(8px);
  transition: transform 1.1s cubic-bezier(.22, .8, .25, 1);
  will-change: transform;
}
/* 滚动到底部（footer 进入视口）时升起；离开则缩回 */
#ending.cake-in .cake-stage img { transform: translateY(0); }
.footer-made { font-family: var(--font-serif); color: var(--ink-soft); margin: 0; }

/* ============================ 详情弹窗 & 灯箱 ============================ */
.modal, .lightbox { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(58, 46, 34, 0.55); backdrop-filter: blur(3px); }
.modal-card {
  position: relative; z-index: 1; width: min(92vw, 560px); max-height: 86vh; overflow: auto;
  background: linear-gradient(180deg, #fffaf0, #fbf2de);
  border-radius: var(--radius); padding: clamp(22px, 4vw, 36px);
  border: 1px solid var(--line); box-shadow: 0 30px 60px -24px rgba(0,0,0,.5);
  animation: pop .25s ease both;
}
@keyframes pop { from { transform: scale(.94) translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-close {
  position: absolute; top: 12px; right: 14px; border: 0; background: none; cursor: pointer;
  font-size: 1.1rem; color: var(--ink-soft); width: 32px; height: 32px; border-radius: 50%; transition: .18s;
}
.modal-close:hover { background: var(--paper-deep); color: var(--ink); }
.modal-from { font-family: var(--font-serif); font-style: italic; color: var(--ink-soft); margin: 0 0 14px; }
.modal-from strong { color: var(--ink); font-style: normal; }

/* 上下滚动区：原图 → 原文 → 翻译，依次纵向排列 */
.modal-scroll { display: flex; flex-direction: column; gap: 22px; }
.detail-figure { margin: 0; }
.detail-media,
.detail-figure img,
.detail-figure video {
  width: 100%; max-width: 100%; height: auto; border-radius: 10px; cursor: zoom-in; display: block;
  box-shadow: 0 10px 24px -14px rgba(74,59,46,.6);
  background: rgba(58, 46, 34, .12);
}
.detail-figure video { max-height: min(62vh, 640px); object-fit: contain; }
.detail-figure video::-webkit-media-controls,
.lightbox video::-webkit-media-controls { display: none !important; }
.detail-figure img.is-broken { display: none; }
.detail-image-fallback {
  min-height: 180px;
  display: grid;
  place-items: center;
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: rgba(255, 250, 240, .64);
  color: var(--ink-soft);
  text-align: center;
  font-family: var(--font-sans);
  cursor: pointer;
}
.detail-image-fallback:hover { color: var(--ink); border-color: var(--ochre); }
.detail-figure figcaption {
  text-align: center; font-size: .82rem; color: var(--ink-soft); margin-top: 6px; font-family: var(--font-sans);
  cursor: zoom-in;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
.detail-figure figcaption:hover { color: var(--ink); }
.detail-block { display: flex; flex-direction: column; gap: 7px; }
.detail-label {
  margin: 0; font-family: var(--font-sans); font-size: .8rem; font-weight: 700;
  letter-spacing: .06em; color: var(--ochre); text-transform: uppercase;
  border-left: 3px solid var(--ochre); padding-left: 8px;
}
/* 可折叠翻译块：标签可点击，箭头指示展开状态 */
.detail-block.collapsible .detail-label {
  cursor: pointer; user-select: none;
  display: inline-flex; align-items: center; gap: 7px;
}
.detail-block.collapsible .detail-label:hover { color: var(--c-red); border-left-color: var(--c-red); }
.dl-arrow { display: inline-block; font-size: .75rem; transition: transform .25s ease; }
.detail-block.collapsed .dl-arrow { transform: rotate(-90deg); }
.detail-block.collapsed .detail-text { display: none; }
.detail-text {
  margin: 0; font-family: var(--font-detail); font-size: 1.06rem; color: #3a2e22; line-height: 1.85;
  white-space: pre-wrap; word-break: break-word;
}

.lightbox img,
.lightbox video { position: relative; z-index: 1; max-width: 92vw; max-height: 86vh; border-radius: 8px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.7); }
.light-close { background: rgba(255,250,240,.9); }

/* ============================ 无障碍 / 减弱动效 ============================ */
/* 减弱动效（系统设置）：行业惯例是「减弱而非消灭」——
   关闭持续晃动的装饰动画（光尘/浮动/脉动/闪烁），
   一次性入场与功能性过渡保留但近乎瞬间完成，内容绝不缺失。 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-dust i,
  .envelope,
  .countdown .cd-days,
  .brand-mark,
  .scroll-hint.in,
  .cake-candles i::after { animation: none !important; }
  .envelope { opacity: 1; }   /* drop-in 被关后保证可见 */
  *, *::before, *::after {
    animation-duration: .01s !important;
    animation-delay: 0s !important;
    transition-duration: .01s !important;
    transition-delay: 0s !important;
  }
}

/* ============================ 优化与扩充内容 ============================ */

/* 跳到内容链接（无障碍）：默认隐藏，键盘聚焦时出现 */
.skip-link {
  position: fixed; top: -60px; left: 12px; z-index: 200;
  background: var(--ink); color: #fff7e8; padding: 9px 16px; border-radius: 0 0 10px 10px;
  text-decoration: none; transition: top .2s ease;
}
.skip-link:focus { top: 0; }

/* 生日倒计时 */
.countdown {
  margin-top: 6px;
  display: inline-flex; align-items: baseline; gap: 7px;
  background: rgba(255, 250, 240, .7); border: 1px solid var(--line);
  padding: 7px 18px; border-radius: 999px;
  font-family: var(--font-serif); color: var(--ink-soft);
  box-shadow: 0 6px 16px -12px rgba(74,59,46,.5);
}
.countdown .cd-days { font-family: var(--font-disp); font-size: 1.5rem; color: var(--c-red); line-height: 1; }
.countdown.is-today { color: var(--c-red); font-weight: 600; }

/* 祝福计数 */
.wishes-count { margin: 10px 0 0; color: var(--ochre); font-family: var(--font-serif); font-style: italic; }

/* 排序切换 */
.sort-ctl {
  display: inline-flex; margin-top: 14px;
  border: 1px solid var(--line); border-radius: 999px; overflow: hidden;
  background: rgba(255, 250, 240, .6);
}
.sort-ctl button {
  border: 0; background: transparent; cursor: pointer;
  padding: 6px 18px; font-family: var(--font-sans); font-size: .85rem;
  color: var(--ink-soft); transition: .18s;
}
.sort-ctl button.active { background: var(--ochre); color: #fff; }

/* 群体开信信件 */
.group-letter {
  position: relative;
  max-width: 720px; margin: 8px auto 36px;
  background: linear-gradient(180deg, #fffaf0, #fbf2de);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(26px, 4vw, 44px) clamp(24px, 4vw, 48px);
  box-shadow: 0 18px 40px -26px rgba(74,59,46,.55);
  transform: rotate(-.6deg);
}
.gl-tape {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%) rotate(1.5deg);
  width: 130px; height: 26px; background: var(--tape); border-radius: 2px;
}
.gl-greeting { font-family: var(--font-serif); font-size: 1.2rem; color: var(--ink); margin: 0 0 12px; }
.gl-body { font-family: var(--font-note); font-size: 1.12rem; line-height: 2; color: #3a2e22; margin: 0 0 16px; }
.gl-sign { text-align: right; font-family: var(--font-serif); font-style: italic; color: var(--ink-soft); margin: 0; }

/* 加载骨架：fetch 期间显示几块微光占位（数据走缓存，通常一闪而过） */
.wall-skeleton {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 40px);
  max-width: 1180px; margin: 0 auto; padding: 18px clamp(16px, 4vw, 48px) 0;
}
.wall-skeleton i {
  display: block; height: 150px; border-radius: 10px;
  background: linear-gradient(100deg, var(--paper-deep) 30%, #f6eeda 50%, var(--paper-deep) 70%);
  background-size: 200% 100%; animation: shimmer 1.3s infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (max-width: 920px) { .wall-skeleton { grid-template-columns: repeat(2, 1fr); } .wall-skeleton i:nth-child(n+5) { display: none; } }
@media (max-width: 560px) { .wall-skeleton { grid-template-columns: 1fr; max-width: 420px; } .wall-skeleton i:nth-child(n+3) { display: none; } }

/* 空状态 */
.wall-empty { text-align: center; color: var(--ink-soft); font-family: var(--font-serif); font-style: italic; padding: 40px 20px; }

/* 结尾收束语 + 投稿 CTA */
.closing-line { font-family: var(--font-note); font-size: 1.3rem; color: var(--ink); margin: 0 0 30px; }
.cta-write {
  display: inline-block; margin: 8px 0 18px; text-decoration: none;
  background: var(--ink); color: #fff7e8; font-family: var(--font-sans);
  padding: 11px 26px; border-radius: 999px;
  box-shadow: 0 10px 22px -12px rgba(74,59,46,.7); transition: .2s;
}
.cta-write:hover { transform: translateY(-2px); background: #5a4636; }

/* ============================ 作者社媒弹层 ============================ */
.note-from strong.has-links {
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
.note-from strong.has-links:hover { color: var(--c-red); }
.link-pop {
  position: fixed;
  z-index: 120;
  min-width: 180px;
  max-width: 280px;
  background: linear-gradient(180deg, #fffaf0, #fbf2de);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 36px -18px rgba(50, 34, 18, .55);
  padding: 12px 14px;
  animation: pop .18s ease both;
}
.link-pop-title {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: .95rem;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}
.link-pop-item {
  display: block;
  padding: 6px 8px;
  border-radius: 8px;
  text-decoration: none;
  font-size: .9rem;
  color: var(--ink-soft);
  transition: .15s;
}
.link-pop-item:hover { background: var(--paper-deep); color: var(--ink); }

/* ============================ 低性能优化 ============================ */
/* 视口外的纸条完全跳过渲染（含墨迹滤镜/混合模式），长墙滚动性能大幅提升 */
.note { content-visibility: auto; contain-intrinsic-size: auto 280px; }

/* perf-lite：JS 检测到低端设备（内存/核数少或用户偏好减弱动效）时挂到 body，
   关闭最耗费合成开销的特效，保内容、保流畅 */
body.perf-lite::before,
body.perf-lite::after { display: none; }
body.perf-lite .topbar { backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; }
body.perf-lite .note-text-inner {
  filter: none;              /* 墨迹位移滤镜（最大开销点） */
  mix-blend-mode: normal;    /* 混合模式逐张合成的开销 */
  opacity: 1;
}
body.perf-lite .note:hover { transform: none; filter: none; }
body.perf-lite .note-paper,
body.perf-lite .note:hover .note-paper,
body.perf-lite .note-paper:focus-visible {
  filter: none;
  transform: none;
}
body.perf-lite .note-paper::after,
body.perf-lite .wall::before,
body.perf-lite .hero-dust,
body.perf-lite .hero-bg::before,
body.perf-lite .hero-bg::after {
  display: none;
}
body.perf-lite .note {
  animation: none;
  content-visibility: visible;
  contain-intrinsic-size: auto;
}
body.perf-lite .envelope { filter: none; }
body.perf-lite .cake-stage img { transition-duration: .5s; }

/* 移动端：压低顶栏高度，避免语言切换、导航和大纸条互相挤压 */
@media (max-width: 700px) {
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    padding: 9px max(12px, env(safe-area-inset-left)) 8px max(12px, env(safe-area-inset-right));
  }
  .brand {
    min-width: 0;
    gap: 7px;
  }
  .brand-mark { font-size: .95rem; }
  .brand-text {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .84rem;
    letter-spacing: 0;
  }
  .lang-switch {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    flex: 0 0 auto;
  }
  .lang-switch button {
    min-width: 34px;
    padding: 5px 8px;
    font-size: .78rem;
    line-height: 1.2;
  }
  .nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: center;
    margin-left: 0;
    gap: 20px;
  }
  .nav a {
    font-size: .82rem;
    padding-bottom: 1px;
  }
  .video-grid {
    grid-template-columns: 1fr;
    padding: 0 14px;
  }
  .video-meta {
    grid-template-columns: auto 1fr;
    align-items: start;
  }
  .video-meta a {
    grid-column: 1 / -1;
    justify-self: start;
  }
  .hero {
    min-height: calc(100svh - 86px);
    padding: 22px 12px 28px;
  }
  .envelope-stage {
    gap: 16px;
    width: 100%;
  }
  .envelope {
    width: min(92vw, 360px);
    height: auto;
    aspect-ratio: 460 / 300;
    filter: drop-shadow(0 16px 20px rgba(74, 59, 46, 0.28));
  }
  .envelope.is-opening,
  .envelope.is-open { margin-top: 86px; }
  .envelope.is-open .env-letter { transform: translateY(-72%); }
  .env-letter {
    padding: 14px;
    transition:
      transform .92s cubic-bezier(.2,.8,.2,1),
      opacity .24s ease;
  }
  .env-letter-head { font-size: 1.15rem; }
  .env-letter-sub { font-size: .78rem; }
  .env-title { font-size: 1.45rem; }
  .env-title small {
    margin-bottom: 4px;
    letter-spacing: .2em;
  }
  .env-stamp {
    top: 9px;
    right: 10px;
    width: 42px;
    height: 49px;
  }
  .stamp-30 { font-size: 1.2rem; }
  .env-open-btn {
    padding: 10px 22px;
    font-size: .9rem;
  }
  .countdown {
    padding: 6px 13px;
    font-size: .86rem;
  }
  .section-head {
    padding: 34px 14px 10px;
  }
  .wall-section,
  .art-section {
    scroll-margin-top: 92px;
  }
  .section-title {
    font-size: 1.55rem;
    line-height: 1.25;
  }
  .section-sub,
  .wishes-count {
    font-size: .9rem;
  }
  .sort-ctl button {
    padding: 6px 14px;
    font-size: .8rem;
  }
  .group-letter,
  .group-letter.reveal,
  .group-letter.reveal.in {
    width: min(92vw, 430px);
    margin: 10px auto 28px;
    padding: 28px 18px 22px;
    transform: none;
  }
  .gl-tape {
    width: 108px;
    height: 22px;
    top: -11px;
  }
  .gl-greeting {
    font-size: 1.02rem;
    margin-bottom: 10px;
  }
  .gl-body {
    font-size: .96rem;
    line-height: 1.75;
    margin-bottom: 13px;
  }
  .gl-sign { font-size: .92rem; }
  .wall {
    gap: 14px;
    padding: 12px 12px 0;
  }
  .wall-skeleton {
    gap: 14px;
    padding: 12px 12px 0;
  }
  .note {
    padding-top: 8px;
  }
  .note:hover,
  .cta-write:hover,
  .env-open-btn:hover {
    transform: none;
  }
  .note-from {
    font-size: .78rem;
  }
  .note-text-inner {
    font-size: .84rem;
    line-height: 1.42;
    letter-spacing: 0;
    max-height: calc(var(--note-lines, 3) * 1.42em);
  }
  .img-badge {
    width: 24px;
    height: 24px;
  }
  .closing-line {
    font-size: 1.05rem;
    margin-bottom: 22px;
  }
  .modal,
  .lightbox {
    padding: 10px;
  }
  .modal-card {
    width: min(96vw, 560px);
    max-height: 88svh;
    padding: 20px 15px 18px;
    border-radius: 10px;
  }
  .modal-scroll {
    gap: 16px;
  }
  .detail-figure img {
    max-height: 56svh;
    object-fit: contain;
  }
  .detail-text {
    font-size: .94rem;
    line-height: 1.72;
  }
  .lightbox img {
    max-width: 96vw;
    max-height: 84svh;
  }
  .link-pop {
    max-width: calc(100vw - 24px);
  }
}

@media (max-width: 380px) {
  .brand-text { max-width: 176px; }
  .nav { gap: 16px; }
  .lang-switch button {
    min-width: 31px;
    padding: 5px 6px;
    font-size: .74rem;
  }
  .envelope { width: min(94vw, 330px); }
  .envelope.is-opening,
  .envelope.is-open { margin-top: 76px; }
  .env-title { font-size: 1.3rem; }
  .gl-body { font-size: .92rem; }
  .note-text-inner { font-size: .8rem; }
}

/* ============================ 精修层：信纸展览质感 ============================ */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
body::before {
  background:
    linear-gradient(90deg, rgba(69, 94, 82, .14), transparent 18%, transparent 82%, rgba(63, 103, 150, .13)),
    radial-gradient(52% 38% at 8% 18%, rgba(127, 166, 201, .22), transparent 62%),
    radial-gradient(44% 35% at 92% 22%, rgba(138, 154, 107, .20), transparent 64%),
    radial-gradient(50% 40% at 72% 88%, rgba(200, 96, 122, .13), transparent 66%);
  mix-blend-mode: multiply;
}
body::after {
  background:
    linear-gradient(rgba(255, 250, 240, .18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 250, 240, .14) 1px, transparent 1px);
  background-size: 44px 44px, 44px 44px;
  mask-image: radial-gradient(72% 62% at 50% 32%, #000 0%, transparent 76%);
  opacity: .45;
}
body > * {
  position: relative;
}

.topbar {
  box-shadow: 0 10px 24px -22px rgba(74, 59, 46, .72);
}
.topbar::after {
  content: "";
  position: absolute;
  left: clamp(16px, 4vw, 48px);
  right: clamp(16px, 4vw, 48px);
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(176, 122, 63, .75), rgba(63, 103, 150, .45), transparent);
}
.brand {
  padding: 5px 9px 5px 6px;
  border-radius: 999px;
}
.brand-mark {
  width: auto;
  height: auto;
  display: inline-block;
  border-radius: 0;
  background: none;
  color: var(--ochre);
  box-shadow: none;
  font-size: 1.05rem;
  line-height: 1;
}
.nav a {
  position: relative;
  border-bottom: 0;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  right: 50%;
  bottom: 0;
  height: 1px;
  background: currentColor;
  transition: left .22s ease, right .22s ease;
}
.nav a:hover::after { left: 0; right: 0; }
.lang-switch {
  background: rgba(255, 250, 240, .55);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 8px 20px -18px rgba(74, 59, 46, .7);
}
.lang-switch button.active {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 4px 12px -8px rgba(74,59,46,.8);
}

.hero {
  overflow: hidden;
}
.hero-bg {
  background:
    radial-gradient(48% 42% at 50% 39%, rgba(255, 240, 204, .78), rgba(255,240,204,0) 68%),
    radial-gradient(24% 32% at 18% 68%, rgba(127, 166, 201, .18), transparent 70%),
    radial-gradient(28% 34% at 82% 62%, rgba(138, 154, 107, .16), transparent 74%);
}
.hero-bg::before,
.hero-bg::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.hero-bg::before {
  width: min(62vw, 560px);
  height: min(62vw, 560px);
  left: 50%;
  top: 50%;
  transform: translate(-50%, -52%);
  border: 1px solid rgba(176, 122, 63, .16);
  box-shadow: inset 0 0 0 18px rgba(255,250,240,.08), 0 0 80px rgba(255, 232, 184, .32);
}
.hero-bg::after {
  width: min(82vw, 760px);
  height: min(82vw, 760px);
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border: 1px dashed rgba(122, 102, 80, .14);
}
.envelope {
  filter:
    drop-shadow(0 30px 34px rgba(74, 59, 46, 0.26))
    drop-shadow(0 3px 0 rgba(255,250,240,.3));
}
.env-back,
.env-body,
.env-flap {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.34), inset 0 -20px 34px rgba(176,122,63,.08);
}
.env-stamp {
  border-color: rgba(255, 246, 228, .88);
}
.env-open-btn,
.cta-write {
  position: relative;
  overflow: hidden;
}
.env-open-btn::after,
.cta-write::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0 35%, rgba(255,255,255,.22) 46%, transparent 58% 100%);
  transform: translateX(-120%);
  transition: transform .55s ease;
}
.env-open-btn:hover::after,
.cta-write:hover::after { transform: translateX(120%); }

.section-head {
  position: relative;
}
.section-head::before {
  content: "✶";
  display: block;
  margin: 0 auto 8px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  line-height: 30px;
  color: #fff8dc;
  background: linear-gradient(145deg, var(--ochre), var(--c-red));
  box-shadow: 0 8px 18px -12px rgba(74, 59, 46, .75);
  font-size: .86rem;
}
.section-title {
  text-wrap: balance;
}
.section-sub {
  max-width: 42rem;
  margin-inline: auto;
}
.wishes-count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 13px;
  border-radius: 999px;
  background: rgba(255, 250, 240, .45);
  border: 1px solid rgba(203, 184, 146, .72);
}
.wishes-count:empty { display: none; }

.group-letter {
  background:
    linear-gradient(90deg, rgba(176,122,63,.10) 0 1px, transparent 1px 100%) 34px 0 / 1px 100% no-repeat,
    repeating-linear-gradient(180deg, transparent 0 31px, rgba(203,184,146,.22) 32px 33px),
    linear-gradient(180deg, #fffbf2, #fbf1dc);
  box-shadow:
    0 24px 48px -34px rgba(74,59,46,.68),
    inset 0 1px 0 rgba(255,255,255,.58);
}
.group-letter::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(176, 122, 63, .13);
  border-radius: calc(var(--radius) - 4px);
  pointer-events: none;
}
.gl-tape {
  box-shadow: 0 3px 10px -8px rgba(74,59,46,.7);
}

.wall {
  position: relative;
}
.wall::before {
  content: "";
  position: absolute;
  inset: 0 clamp(12px, 3vw, 28px);
  z-index: -1;
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(138,154,107,.08), transparent 24%, transparent 76%, rgba(63,103,150,.08)),
    radial-gradient(70% 28% at 50% 0%, rgba(255,250,240,.22), transparent 70%);
}
.note {
  transform-origin: center 20%;
}
.note:nth-child(4n + 1) { --note-tilt: -1.2deg; }
.note:nth-child(4n + 2) { --note-tilt: .9deg; }
.note:nth-child(4n + 3) { --note-tilt: -.45deg; }
.note:nth-child(4n + 4) { --note-tilt: 1.35deg; }
.note-paper {
  transform: rotate(var(--note-tilt, 0deg));
  transition: transform .24s ease, filter .24s ease;
}
.note:hover .note-paper,
.note-paper:focus-visible {
  transform: rotate(0deg) translateY(-3px);
}
.note-paper::after {
  content: "";
  position: absolute;
  inset: 7%;
  border-radius: 45% 55% 50% 50%;
  background: radial-gradient(closest-side, rgba(255,250,240,.16), transparent 72%);
  mix-blend-mode: screen;
  opacity: .65;
  pointer-events: none;
}
.note-from {
  text-shadow: 0 1px 0 rgba(255,250,240,.55);
}
.note-detail {
  border-bottom-style: solid;
  border-bottom-color: rgba(122, 102, 80, .34);
}

.modal {
  padding: clamp(14px, 3vw, 28px);
}
.modal-backdrop {
  background:
    radial-gradient(70% 60% at 50% 38%, rgba(255, 240, 205, .18), transparent 70%),
    rgba(58, 46, 34, 0.58);
}
.modal-card {
  border-radius: 12px;
  background:
    repeating-linear-gradient(180deg, transparent 0 35px, rgba(203,184,146,.18) 36px 37px),
    linear-gradient(180deg, #fffbf2, #fbf0da);
  box-shadow:
    0 36px 80px -34px rgba(0,0,0,.66),
    inset 0 1px 0 rgba(255,255,255,.62);
}
.modal-card::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  width: 118px;
  height: 22px;
  transform: translateX(-50%) rotate(-1.5deg);
  border-radius: 2px;
  background: rgba(226, 214, 176, .68);
  box-shadow: 0 4px 12px -10px rgba(74,59,46,.7);
}
.modal-close {
  background: rgba(255,250,240,.58);
  border: 1px solid rgba(203,184,146,.42);
}
.detail-block {
  padding: 14px 0 0;
  border-top: 1px solid rgba(203, 184, 146, .42);
}
.detail-block:first-of-type { border-top: 0; padding-top: 0; }
.detail-label {
  width: fit-content;
  background: rgba(255,250,240,.58);
  padding: 2px 10px 2px 8px;
  border-radius: 0 999px 999px 0;
}
.detail-text {
  text-wrap: pretty;
}
.detail-figure img {
  background: rgba(255,250,240,.42);
  border: 1px solid rgba(203,184,146,.46);
}
.lightbox img {
  background: rgba(255,250,240,.25);
  border: 1px solid rgba(255,250,240,.36);
}

.art-empty,
.wall-empty,
.scroll-hint {
  text-wrap: balance;
}
.cake-stage {
  filter: drop-shadow(0 -12px 24px rgba(74,59,46,.08));
}

@media (max-width: 700px) {
  body::after { opacity: .24; }
  .topbar::after {
    left: 12px;
    right: 12px;
  }
  .brand {
    padding-left: 0;
  }
  .brand-mark { font-size: .95rem; }
  .hero-bg::before {
    width: 118vw;
    height: 118vw;
  }
  .hero-bg::after { display: none; }
  .section-head::before {
    width: 26px;
    height: 26px;
    line-height: 26px;
    margin-bottom: 7px;
  }
  .wishes-count {
    max-width: calc(100vw - 28px);
    justify-content: center;
    text-align: center;
  }
  .wall::before {
    inset: 0 6px;
    border-radius: 14px;
  }
  .note-paper {
    transform: none;
  }
  .note:hover .note-paper,
  .note-paper:focus-visible {
    transform: translateY(-2px);
  }
  .modal-card::before {
    width: 96px;
    height: 18px;
  }
  .detail-label {
    max-width: 100%;
    overflow-wrap: anywhere;
  }
}

@media (hover: none), (pointer: coarse), (max-width: 700px) {
  body::before,
  body::after { display: none; }
  .hero-dust,
  .hero-bg::before,
  .hero-bg::after,
  .wall::before,
  .note-paper::after { display: none !important; }
  .brand-mark,
  .countdown .cd-days,
  .scroll-hint.in,
  .hero-dust i { animation: none !important; }
  .note,
  .modal-scroll > *,
  .link-pop-item {
    animation: none !important;
  }
  .note-paper,
  .note:hover .note-paper,
  .note-paper:focus-visible,
  .envelope,
  .cake-stage {
    filter: none !important;
  }
  .note-text-inner,
  .note-kraft .note-text-inner,
  .note-pink .note-text-inner,
  .note-blue .note-text-inner,
  .note-red .note-text-inner {
    filter: none !important;
    mix-blend-mode: normal !important;
    opacity: 1;
  }
  .note-blue .note-text-inner,
  .note-red .note-text-inner {
    color: #fff7e8;
  }
  .modal-backdrop {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* ============================ 动效层（transform/opacity 合成动画，低开销） ============================ */

/* 滚动揭示：进入视口淡入上浮 */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.25,1); }
.reveal.in { opacity: 1; transform: translateY(0); }
/* 群体信揭示时带一点旋转落定的手作感 */
.group-letter.reveal { transform: translateY(26px) rotate(-2.4deg); }
.group-letter.reveal.in { transform: translateY(0) rotate(-.6deg); }

/* 信封待机：轻轻浮动（开启后停止，避免与下移过渡打架） */
.envelope { animation: drop-in 1s cubic-bezier(.2,.8,.25,1) both, env-float 4.5s ease-in-out 1.4s infinite; }
.envelope.is-open { animation: none; }
@keyframes env-float {
  0%, 100% { transform: translateY(0) rotate(0); }
  50%      { transform: translateY(-7px) rotate(.4deg); }
}

/* 英雄区暖金光尘：缓慢上浮明灭 */
.hero-dust { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.hero-dust i {
  position: absolute; bottom: -3%;
  width: 5px; height: 5px; border-radius: 50%;
  background: radial-gradient(circle, #ffe9b0 0%, rgba(255,233,176,0) 70%);
  opacity: 0;
  animation: dust-rise linear infinite;
}
.hero-dust i:nth-child(1) { left: 16%; animation-duration: 11s; animation-delay: 0s;  width: 6px; height: 6px; }
.hero-dust i:nth-child(2) { left: 31%; animation-duration: 14s; animation-delay: 3s; }
.hero-dust i:nth-child(3) { left: 47%; animation-duration: 12s; animation-delay: 6s;  width: 4px; height: 4px; }
.hero-dust i:nth-child(4) { left: 62%; animation-duration: 15s; animation-delay: 1.5s; }
.hero-dust i:nth-child(5) { left: 76%; animation-duration: 13s; animation-delay: 4.5s; width: 7px; height: 7px; }
.hero-dust i:nth-child(6) { left: 88%; animation-duration: 16s; animation-delay: 8s;  width: 4px; height: 4px; }
@keyframes dust-rise {
  0%   { transform: translateY(0) translateX(0) scale(.8); opacity: 0; }
  12%  { opacity: .85; }
  55%  { opacity: .5; }
  100% { transform: translateY(-92vh) translateX(26px) scale(1.15); opacity: 0; }
}

/* 倒计时数字呼吸 */
.countdown .cd-days { display: inline-block; animation: cd-pulse 2.6s ease-in-out infinite; }
@keyframes cd-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }

/* 顶栏星标微闪 */
.brand-mark { display: inline-grid; animation: star-twinkle 3.2s ease-in-out infinite; }
@keyframes star-twinkle { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .55; transform: scale(.88) rotate(18deg); } }

/* 滚动提示轻浮 */
.scroll-hint.in { animation: hint-bob 2.8s ease-in-out 1s infinite; }
@keyframes hint-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

/* 详情弹窗内容分块入场（图片/原文/翻译依次浮现） */
.modal-scroll > * { animation: block-in .45s ease both; }
.modal-scroll > *:nth-child(1) { animation-delay: .05s; }
.modal-scroll > *:nth-child(2) { animation-delay: .14s; }
.modal-scroll > *:nth-child(3) { animation-delay: .23s; }
.modal-scroll > *:nth-child(4) { animation-delay: .32s; }
.modal-scroll > *:nth-child(5) { animation-delay: .41s; }
@keyframes block-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* 灯箱大图缩放入场 */
.lightbox img { animation: lb-zoom .28s cubic-bezier(.2,.8,.25,1) both; }
@keyframes lb-zoom { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: scale(1); } }

/* 社媒弹层条目级联 */
.link-pop-item { animation: block-in .3s ease both; }
.link-pop-item:nth-child(2) { animation-delay: .05s; }
.link-pop-item:nth-child(3) { animation-delay: .1s; }
.link-pop-item:nth-child(4) { animation-delay: .15s; }

/* 画作卡片悬停轻抬 */
.art-card { transition: transform .25s ease, box-shadow .25s ease; }
.art-card:hover { transform: rotate(0deg) translateY(-5px); box-shadow: 0 18px 30px -16px rgba(74,59,46,.5); }

/* 低性能档：关闭持续型装饰动画（一次性入场动画保留） */
body.perf-lite .hero-dust,
body.perf-lite .countdown .cd-days,
body.perf-lite .brand-mark,
body.perf-lite .scroll-hint.in { animation: none; }
body.perf-lite .envelope { animation: drop-in 1s cubic-bezier(.2,.8,.25,1) both; }
body.perf-lite .envelope.is-open { animation: none; }

/* 最终移动端性能闸：放在文件末尾，压过上面的质感/动效规则。 */
@media (hover: none), (pointer: coarse), (max-width: 700px) {
  body::before,
  body::after,
  .hero-dust,
  .hero-bg::before,
  .hero-bg::after,
  .wall::before,
  .note-paper::after {
    display: none !important;
  }
  .brand-mark,
  .countdown .cd-days,
  .scroll-hint.in,
  .hero-dust i,
  .note,
  .modal-scroll > *,
  .link-pop-item {
    animation: none !important;
  }
  .note-paper,
  .note:hover .note-paper,
  .note-paper:focus-visible,
  .envelope,
  .cake-stage {
    filter: none !important;
  }
  .note-text-inner,
  .note-kraft .note-text-inner,
  .note-pink .note-text-inner,
  .note-blue .note-text-inner,
  .note-red .note-text-inner {
    filter: none !important;
    mix-blend-mode: normal !important;
    opacity: 1;
  }
  .note-blue .note-text-inner,
  .note-red .note-text-inner {
    color: #fff7e8;
  }
  .modal-backdrop {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}
