/* ============================================================
 * 圣诞邮局 · 纸张、墨色、圣诞红
 * ============================================================ */
@font-face {
  font-family: 'Great Vibes';
  src: url('../assets/fonts/GreatVibes.woff2') format('woff2');
  font-display: swap;
}

:root {
  --night: #05070d;
  --cream: #f2e9d8;          /* 夜色上的文字 */
  --cream-dim: rgba(242, 233, 216, .62);
  --cream-faint: rgba(242, 233, 216, .36);
  --paper: #f4ecdc;          /* 卡片纸 */
  --paper-2: #e9dec8;
  --ink: #1f1c17;
  --ink-2: #5a5246;
  --ink-3: #8b8172;
  --red: #c53a2c;
  --red-deep: #8f2318;
  --pine: #1d4636;
  --gold: #c99b48;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "Source Han Serif CN", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --ease: cubic-bezier(.22, .9, .3, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--night); color: var(--cream); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

#scene { position: fixed; inset: 0; display: block; touch-action: none; }
#scene.pointer { cursor: pointer; }
.vignette {
  position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(0, 0, 0, .55) 100%),
    linear-gradient(to bottom, rgba(0, 0, 0, .3), transparent 20%, transparent 75%, rgba(0, 0, 0, .45));
}

/* 显隐 */
.landing, .caption, .hint, .dock, .overlay, .loading, .corner-btn, .swipe-tip, .fab {
  transition: opacity .55s var(--ease), transform .55s var(--ease), visibility .55s, filter 1s var(--ease);
}
.hint, .dock, .overlay, .loading, .caption, .swipe-tip, .fab { opacity: 0; visibility: hidden; pointer-events: none; }
.is-on { opacity: 1 !important; visibility: visible !important; pointer-events: auto !important; }
.hint.is-on, .caption.is-on, .loading.is-on, .swipe-tip.is-on { pointer-events: none !important; }

/* ============================ 按钮 ============================ */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 46px; padding: 0 20px;
  border-radius: 12px;
  font-size: 15px; font-weight: 700; letter-spacing: .04em;
  white-space: nowrap;
  transition: transform .12s, box-shadow .12s, background .2s, color .2s;
}
.btn-lg { height: 56px; padding: 0 26px; font-size: 17px; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; border-radius: 9px; }
.btn:disabled { opacity: .5; cursor: default; }

/* 主按钮：实色圣诞红 + 下压阴影，按下去有手感 */
.btn-primary {
  color: #fff6e6;
  background: var(--red);
  box-shadow: 0 4px 0 var(--red-deep), 0 12px 24px rgba(150, 30, 20, .32);
}
.btn-primary:hover { background: #d0412f; }
.btn-primary:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--red-deep), 0 4px 10px rgba(150, 30, 20, .3); }
.btn-primary .arr { position: relative; width: 18px; height: 2px; background: currentColor; border-radius: 2px; animation: nudge 1.8s ease-in-out infinite; }
.btn-primary .arr::after { content: ''; position: absolute; right: -1px; top: -4px; width: 8px; height: 8px; border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: rotate(45deg); }
@keyframes nudge { 0%, 60%, 100% { transform: translateX(0); } 30% { transform: translateX(5px); } }
/* 次按钮：墨色描边 */
.btn-secondary { color: var(--ink); background: transparent; box-shadow: inset 0 0 0 1.5px rgba(31, 28, 23, .55); font-weight: 600; }
.btn-secondary:hover { background: rgba(31, 28, 23, .05); }
.btn-secondary:active { transform: translateY(1px); }

.text-link { margin-top: 14px; font-size: 13px; color: var(--cream-dim); padding: 6px 4px; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(242, 233, 216, .3); }
.text-link:hover { color: var(--cream); }
.text-link:empty { display: none; }
.modal .text-link, .ticket .text-link { color: var(--ink-2); text-decoration-color: rgba(31, 28, 23, .3); }

/* ============================ 首页 ============================ */
.landing {
  position: fixed; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(28px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom));
  text-align: center;
  z-index: 10;
  overflow-y: auto;
}
.landing.is-off { opacity: 0; transform: translateY(-12px); filter: blur(4px); visibility: hidden; pointer-events: none; transition-duration: .9s; }
.landing > * { animation: rise 1s var(--ease) both; }
.landing > :nth-child(2) { animation-delay: .1s; }
.landing > :nth-child(3) { animation-delay: .2s; }
.landing > :nth-child(4) { animation-delay: .32s; }
body.booting .landing > * { animation-play-state: paused; opacity: 0; }
body.booting .landing { pointer-events: none; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.kicker { margin: 0; display: flex; gap: 12px; align-items: center; font-size: 11px; letter-spacing: .28em; color: var(--cream-faint); }
.kicker span:first-child { color: var(--gold); }
.kicker span + span::before { content: ''; display: inline-block; width: 18px; height: 1px; background: var(--cream-faint); vertical-align: middle; margin-right: 12px; }
.headline {
  margin: 16px 0 0;
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(34px, 8.6vw, 54px);
  line-height: 1.18;
  letter-spacing: .02em;
  color: var(--cream);
  text-shadow: 0 2px 30px rgba(0, 0, 0, .6);
}
.lead { margin: 14px 0 0; font-size: 14px; line-height: 1.8; color: var(--cream-dim); }

/* 车票式表单 */
.ticket {
  position: relative;
  margin-top: 26px;
  width: min(380px, 100%);
  padding: 22px 22px 22px;
  border-radius: 16px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
  display: flex; flex-direction: column; align-items: stretch;
  text-align: left;
}
.ticket::after {
  content: ''; position: absolute; inset: 0; border-radius: 16px; pointer-events: none;
  background: radial-gradient(rgba(90, 70, 40, .07) 1px, transparent 1px) 0 0 / 5px 5px;
  mix-blend-mode: multiply;
}
.perf { position: relative; height: 1px; margin: 18px -22px 16px; border-top: 1.5px dashed rgba(31, 28, 23, .22); }
.perf::before, .perf::after { content: ''; position: absolute; top: -10px; width: 18px; height: 18px; border-radius: 50%; background: var(--night); }
.perf::before { left: -9px; }
.perf::after { right: -9px; }

.line-field { position: relative; display: block; width: 100%; }
.line-field input {
  width: 100%;
  background: transparent; border: 0; border-radius: 0; outline: none;
  color: var(--ink);
  font-family: var(--serif); font-size: 22px; font-weight: 700;
  padding: 6px 0 10px;
  border-bottom: 1.5px solid rgba(31, 28, 23, .25);
  transition: border-color .2s;
}
.line-field input:focus { border-color: var(--red); }
.line-field input::placeholder { color: var(--ink-3); font-weight: 400; font-size: 16px; font-family: var(--sans); }
.line-field .line { display: none; }
.line-field.shake { animation: shake .45s; }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
.field-tip { margin: 8px 0 0; font-size: 12px; color: var(--red); }
.ticket .line-field::before { content: '你的名字'; display: block; font-size: 11px; letter-spacing: .2em; color: var(--ink-3); }

/* 主题：三张小邮票 */
.themes { display: flex; gap: 10px; }
.theme {
  flex: 1;
  display: flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 10px;
  border-radius: 10px;
  font-size: 13px; color: var(--ink-2);
  box-shadow: inset 0 0 0 1.5px rgba(31, 28, 23, .14);
  transition: box-shadow .2s, background .2s, color .2s;
}
.theme i { width: 16px; height: 16px; border-radius: 50%; flex: none; }
.theme[data-theme="ice"] i { background: radial-gradient(circle at 35% 30%, #fff, #a9d6ff 55%, #4f97e8); }
.theme[data-theme="gold"] i { background: radial-gradient(circle at 35% 30%, #fffbe8, #ffd27a 55%, #d98b1c); }
.theme[data-theme="pink"] i { background: radial-gradient(circle at 35% 30%, #fff5fa, #ffb6d3 55%, #e2669a); }
.theme.on { color: var(--ink); font-weight: 700; background: #fff9ee; box-shadow: inset 0 0 0 2px var(--ink); }

.slots { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.slot {
  position: relative;
  width: 50px; height: 58px;
  padding: 4px 4px 11px;
  background: #fffaf0;
  border-radius: 2px;
  box-shadow: 0 3px 10px rgba(60, 40, 20, .22);
  transform: rotate(var(--r, 0deg));
  animation: pop .4s var(--ease) both;
}
.slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slot .rm { position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; }
.slot .rm svg { width: 10px; height: 10px; stroke-width: 2.4; }
.slot.add { background: transparent; box-shadow: inset 0 0 0 1.5px rgba(31, 28, 23, .28); border-radius: 6px; display: grid; place-items: center; color: var(--ink-2); cursor: pointer; padding: 0; }
.slot.add:hover { box-shadow: inset 0 0 0 1.5px var(--red); color: var(--red); }
.slot.add.full { display: none; }
@keyframes pop { from { opacity: 0; transform: rotate(var(--r, 0deg)) scale(.6); } }
.note { margin: 10px 0 0; font-size: 12px; color: var(--ink-3); }
.note b { color: var(--ink); }
#go { margin-top: 18px; width: 100%; }
.ticket .text-link { margin: 10px auto 0; display: block; }

/* ============================ 播放中 ============================ */
.corner-btn {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top)); left: calc(12px + env(safe-area-inset-left));
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--cream-dim); opacity: .7; z-index: 30;
}
.corner-btn:hover { opacity: 1; }
.corner-btn .ico-off { display: none; }
.corner-btn.muted .ico-on { display: none; }
.corner-btn.muted .ico-off { display: block; }

.caption {
  position: fixed; left: 0; right: 0; top: 80vh;
  text-align: center;
  font-family: var(--serif); font-size: 13px; letter-spacing: .3em; text-indent: .3em;
  color: var(--cream-dim);
  transform: translateY(6px);
  z-index: 4;
}
.caption.is-on { transform: none; }
.hint { position: fixed; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom)); transform: translate(-50%, 6px); font-size: 12px; letter-spacing: .2em; color: var(--cream-dim); white-space: nowrap; z-index: 8; }
.hint.is-on { transform: translate(-50%, 0); }
.hint b { color: var(--cream); font-weight: 600; font-variant-numeric: tabular-nums; }
.swipe-tip { position: fixed; left: 50%; top: calc(20px + env(safe-area-inset-top)); transform: translateX(-50%); font-size: 12px; color: var(--cream-faint); white-space: nowrap; z-index: 6; }

/* 底部工具栏 */
.dock {
  position: fixed; left: 0; right: 0; bottom: calc(14px + env(safe-area-inset-bottom));
  margin: 0 auto; width: max-content;
  display: flex; padding: 4px;
  border-radius: 14px;
  background: rgba(14, 16, 22, .86);
  box-shadow: 0 0 0 1px rgba(242, 233, 216, .08), 0 10px 30px rgba(0, 0, 0, .4);
  z-index: 20;
  touch-action: manipulation;
}
.dock button, .dock .dock-btn { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 60px; padding: 8px 6px 7px; border-radius: 10px; color: var(--cream-dim); cursor: pointer; transition: transform .1s, background .15s, color .15s; -webkit-user-select: none; user-select: none; }
.dock button:hover, .dock .dock-btn:hover { color: var(--cream); background: rgba(242, 233, 216, .06); }
.dock button:active, .dock .dock-btn:active { color: var(--cream); background: rgba(242, 233, 216, .16); }
.dock button svg, .dock .dock-btn svg { width: 19px; height: 19px; }
.dock button span, .dock .dock-btn span { font-size: 11px; letter-spacing: .06em; white-space: nowrap; }
/* 文件输入框用透明方式藏起来（不用 display:none，部分手机浏览器会点不开） */
.dock-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* 右上角：弹窗收起后的按钮 */
.fab {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top)); right: calc(12px + env(safe-area-inset-right));
  display: flex; align-items: center; gap: 6px;
  height: 40px; padding: 0 15px 0 12px;
  border-radius: 12px;
  color: #fff6e6; background: var(--red);
  font-size: 14px; font-weight: 700;
  box-shadow: 0 3px 0 var(--red-deep), 0 10px 24px rgba(150, 30, 20, .4);
  z-index: 35;
  transform: scale(.6);
}
.fab.is-on { transform: scale(1); animation: bob 2.6s ease-in-out .8s infinite; }
.fab svg { width: 17px; height: 17px; stroke-width: 2; }
.fab-glow { position: absolute; inset: -5px; border-radius: 15px; border: 1.5px solid rgba(255, 190, 170, .7); animation: ring 1.8s ease-out infinite; pointer-events: none; }
@keyframes ring { from { transform: scale(.94); opacity: .9; } to { transform: scale(1.3); opacity: 0; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.spark {
  position: fixed; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%;
  background: radial-gradient(circle, #fff, #ffd9a0 45%, transparent 70%);
  pointer-events: none; z-index: 34;
  animation: sparkFly var(--d, 1.2s) ease-out forwards;
}
@keyframes sparkFly { from { transform: translate(0, 0) scale(1); opacity: 1; } to { transform: translate(var(--x), var(--y)) scale(.2); opacity: 0; } }

/* ============================ 明信片弹窗 ============================ */
.overlay {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(5, 7, 13, .8);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
}
.modal-wrap { background: rgba(5, 7, 13, .5); backdrop-filter: none; -webkit-backdrop-filter: none; padding: 16px; }
.modal {
  position: relative;
  width: min(400px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 30px 24px 24px;
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
  transform: translateY(22px) rotate(-1deg) scale(.97);
  transition: transform .6s var(--ease);
}
.modal::before { /* 信封边 */
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 6px; border-radius: 8px 8px 0 0;
  background: repeating-linear-gradient(135deg, var(--red) 0 12px, var(--paper) 12px 20px, var(--pine) 20px 32px, var(--paper) 32px 40px);
}
.modal::after { content: ''; position: absolute; inset: 0; border-radius: 8px; pointer-events: none; background: radial-gradient(rgba(90, 70, 40, .07) 1px, transparent 1px) 0 0 / 5px 5px; mix-blend-mode: multiply; }
.overlay.is-on .modal { transform: none; }
.modal-x { position: absolute; top: 16px; left: 14px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-3); z-index: 2; }
.modal-x:hover { color: var(--ink); background: rgba(31, 28, 23, .06); }
.modal-x svg { width: 16px; height: 16px; }

/* 邮票 + 邮戳 */
.stamp {
  position: absolute; top: 18px; right: 18px;
  width: 60px; height: 70px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: var(--red); color: #fff3e0;
  border: 4px dotted var(--paper);
  outline: 1px solid rgba(255, 243, 224, .55);
  outline-offset: -8px;
  box-shadow: 0 0 0 1px rgba(31, 28, 23, .08), 0 3px 8px rgba(60, 30, 20, .25);
  transform: rotate(4deg);
}
.stamp svg { width: 24px; height: 24px; stroke-width: 1.8; }
.stamp b { font-family: var(--serif); font-size: 10px; letter-spacing: .12em; }
.postmark {
  position: absolute; top: 40px; right: 58px;
  width: 84px; height: 84px; border-radius: 50%;
  border: 1.5px solid rgba(31, 28, 23, .32);
  box-shadow: inset 0 0 0 4px var(--paper), inset 0 0 0 5px rgba(31, 28, 23, .22);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 9px; letter-spacing: .12em; color: rgba(31, 28, 23, .45);
  transform: rotate(-14deg);
  pointer-events: none;
}
.postmark span:first-child { font-family: var(--serif); font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.pc-label { margin: 0 0 0 26px; font-size: 11px; letter-spacing: .3em; color: var(--ink-3); }
.modal-title { margin: 18px 80px 0 0; font-family: var(--serif); font-size: 25px; font-weight: 900; line-height: 1.35; letter-spacing: .01em; }
.modal-title b { color: var(--red); }
.modal-sub { margin: 10px 0 0; font-size: 14px; line-height: 1.75; color: var(--ink-2); }
.modal-actions { margin-top: 22px; display: flex; flex-direction: column; gap: 10px; }
.modal-actions .btn { width: 100%; }
.modal-foot { margin: 14px 0 0; font-size: 12px; color: var(--ink-3); text-align: center; }
.modal-foot:empty { display: none; }
.modal-foot .text-link { margin: 0; font-size: 12.5px; }

/* 照片：像贴在明信片上的小照片 */
.fan { position: relative; height: 0; }
.fan.has { height: 96px; margin: 16px 0 -4px; }
.fan span {
  position: absolute; left: var(--l); top: 0;
  width: 72px; height: 86px;
  padding: 4px 4px 14px;
  background: #fffaf0;
  box-shadow: 0 4px 14px rgba(60, 40, 20, .25);
  transform: rotate(var(--r));
}
.fan span i { display: block; width: 100%; height: 100%; background: #ccc center / cover; }

/* 装饰弹窗 */
.step { margin: 0 0 0 26px; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); }
.step b, .step span { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 800; }
.step b { background: var(--red); color: #fff3e0; }
.step span { box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.step i { width: 20px; height: 1.5px; background: rgba(31, 28, 23, .2); }
#deco .modal-title { margin-right: 0; }
.slot.deco-slot {
  margin: 18px 0 6px;
  width: 100%; height: 150px;
  border-radius: 10px;
  transform: none;
  display: grid; place-items: center; align-content: center; gap: 6px;
  box-shadow: inset 0 0 0 1.5px rgba(197, 58, 44, .55);
  background: repeating-linear-gradient(135deg, rgba(197, 58, 44, .04) 0 10px, transparent 10px 20px);
  color: var(--red);
  animation: none;
}
.deco-slot svg { width: 28px; height: 28px; stroke-width: 2; }
.deco-slot em { font-style: normal; font-size: 13px; font-weight: 700; }
.deco-slot img { position: absolute; left: 50%; top: 10px; width: 112px; height: 112px; margin-left: -56px; object-fit: cover; box-shadow: 0 0 0 5px #fffaf0, 0 0 0 5px #fffaf0, 0 8px 20px rgba(60, 40, 20, .3); border-bottom: 18px solid #fffaf0; box-sizing: content-box; transform: rotate(-2deg); }
.slot.deco-slot.has { background: transparent; box-shadow: none; height: 160px; }
.deco-slot.has svg, .deco-slot.has em { display: none; }
#deco .line-field { margin-top: 12px; }
#deco .line-field input { font-size: 18px; }
#deco .field-tip { color: var(--ink-3); }

/* 保存图片 */
.shot { flex-direction: column; gap: 14px; padding: 20px; background: rgba(5, 7, 13, .94); }
.shot > .close { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 12px; }
.shot img { max-width: min(92vw, 520px); max-height: calc(100dvh - 190px); border-radius: 6px; box-shadow: 0 0 0 6px var(--paper), 0 20px 60px rgba(0, 0, 0, .6); -webkit-touch-callout: default; }
.shot-tip { margin: 6px 0 0; font-size: 13px; color: var(--cream); }
.close { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--cream-dim); }
.close:hover { color: var(--cream); }

/* 分享 */
.sheet { position: relative; width: min(340px, calc(100vw - 40px)); padding: 26px 22px 22px; border-radius: 8px; background: var(--paper); color: var(--ink); text-align: center; transform: translateY(14px); transition: transform .6s var(--ease); }
.overlay.is-on .sheet { transform: none; }
.sheet > .close { position: absolute; top: 8px; right: 8px; color: var(--ink-3); }
.sheet-title { margin: 0; font-family: var(--serif); font-size: 20px; font-weight: 900; }
.sheet-sub { margin: 8px 0 0; font-size: 13px; color: var(--ink-2); }
.qr { margin: 18px auto 0; width: 168px; height: 168px; padding: 10px; background: #fffaf0; box-shadow: 0 6px 20px rgba(60, 40, 20, .2); }
.qr img { width: 100%; height: 100%; display: block; }
.link-row { margin-top: 18px; display: flex; gap: 8px; align-items: center; padding: 6px 6px 6px 12px; border-radius: 10px; box-shadow: inset 0 0 0 1.5px rgba(31, 28, 23, .18); }
.link-row input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: var(--ink-2); font-size: 12px; }
.sheet .text-link { color: var(--ink-2); }
.sheet-actions { display: flex; justify-content: center; }
.demo-note { margin: 14px 0 0; font-size: 11.5px; line-height: 1.7; color: var(--red); }

/* 相册 */
.album { flex-direction: column; justify-content: flex-start; padding: calc(22px + env(safe-area-inset-top)) 20px calc(20px + env(safe-area-inset-bottom)); overflow-y: auto; }
.album-head { width: min(920px, 100%); display: flex; justify-content: space-between; align-items: flex-end; padding-bottom: 14px; border-bottom: 1px solid rgba(242, 233, 216, .14); }
.album-h { margin: 0; font-family: var(--serif); font-size: 26px; font-weight: 900; }
.album-head p { margin: 4px 0 0; font-size: 12.5px; color: var(--cream-dim); }
.album-actions { display: flex; align-items: center; gap: 8px; }
.album .btn-secondary { color: var(--cream); box-shadow: inset 0 0 0 1.5px rgba(242, 233, 216, .4); }
.album-grid { width: min(920px, 100%); margin-top: 26px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 28px 22px; }
.polaroid { background: #fffaf0; padding: 8px 8px 0; border-radius: 2px; box-shadow: 0 14px 36px rgba(0, 0, 0, .5); transform: rotate(var(--r, 0deg)); transition: transform .35s var(--ease); cursor: zoom-in; color: var(--ink); text-align: center; animation: pop .5s var(--ease) both; }
.polaroid:hover { transform: rotate(0) translateY(-4px); }
.polaroid .ph { aspect-ratio: 1; background: #ddd center / cover no-repeat; }
.polaroid .nm { display: block; padding: 9px 4px 11px; font-family: "Kaiti SC", "STKaiti", "KaiTi", var(--serif); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.album-empty { grid-column: 1 / -1; text-align: center; color: var(--cream-dim); font-size: 13px; padding: 60px 0; }

/* 大图 */
.lightbox { z-index: 50; background: rgba(5, 7, 13, .94); }
.lightbox > .close { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 12px; z-index: 2; }
.lightbox figure { margin: 0; display: flex; flex-direction: column; align-items: center; max-width: 92vw; }
.lightbox img { max-width: 92vw; max-height: calc(100dvh - 160px); object-fit: contain; border-radius: 2px; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
.lightbox figcaption { margin-top: 16px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; align-items: baseline; font-size: 13px; }
.lightbox .who { font-family: var(--serif); font-size: 16px; font-weight: 700; }
.lightbox .msg { font-family: var(--serif); color: var(--cream); font-size: 15px; }
.lightbox .msg:empty { display: none; }
.lightbox .when { color: var(--cream-faint); font-size: 12px; }
.lightbox figcaption .text-link { margin: 0; }
.nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; display: grid; place-items: center; color: var(--cream-dim); z-index: 2; }
.nav:hover { color: var(--cream); }
.nav.prev { left: 6px; }
.nav.next { right: 6px; }

.loading { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--cream-dim); z-index: 45; white-space: nowrap; }
.loading i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(242, 233, 216, .2); border-top-color: var(--cream); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed; left: 50%; top: calc(64px + env(safe-area-inset-top));
  transform: translate(-50%, -8px);
  max-width: calc(100vw - 40px);
  padding: 11px 18px;
  border-radius: 10px;
  background: var(--paper); color: var(--ink);
  font-size: 13.5px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  text-align: center;
  opacity: 0; pointer-events: none;
  transition: opacity .3s, transform .3s var(--ease);
  z-index: 60;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; color: var(--cream-dim); }

/* ============================ 响应式 ============================ */
@media (max-width: 520px) {
  .album-grid { grid-template-columns: repeat(2, 1fr); gap: 22px 16px; }
  .nav { display: none; }
  .modal { padding: 28px 20px 20px; }
  .modal-title { font-size: 22px; }
  .swipe-tip { top: auto; bottom: calc(86px + env(safe-area-inset-bottom)); }
}
@media (max-height: 700px) and (orientation: portrait) {
  .lead { display: none; }
  .ticket { margin-top: 18px; padding: 18px; }
  .perf { margin: 14px -18px 12px; }
  .fan.has { height: 80px; }
  .fan span { width: 60px; height: 72px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .landing { padding-top: calc(10px + env(safe-area-inset-top)); padding-bottom: 10px; flex-direction: row; gap: 28px; text-align: left; align-items: center; }
  .landing > .kicker { display: none; }
  .headline { font-size: 30px; margin: 0; }
  .lead { display: none; }
  .ticket { margin-top: 0; padding: 16px; }
  .perf { margin: 10px -16px 10px; }
  .slots { margin-top: 10px; flex-wrap: nowrap; }
  .slot { width: 40px; height: 47px; padding: 3px 3px 10px; }
  #go { margin-top: 10px; }
  .btn-lg { height: 48px; font-size: 15px; }
  .modal { width: min(560px, 100%); padding: 20px 20px 16px; }
  .fan.has, .pc-label, .postmark, .step { display: none; }
  .modal-title { margin-top: 0; }
  .modal-actions { flex-direction: row; margin-top: 14px; }
  .slot.deco-slot { height: 96px; margin: 8px 0 2px; }
  .dock { left: auto; right: calc(10px + env(safe-area-inset-right)); top: 50%; bottom: auto; margin: -150px 0 0; flex-direction: column; }
  .lightbox img, .shot img { max-height: calc(100dvh - 110px); }
}
@media (min-width: 900px) and (min-height: 700px) {
  .modal { width: 440px; padding: 34px 30px 28px; }
  .modal-title { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .landing > *, .slot, .polaroid, .fab.is-on, .fab-glow, .btn-primary .arr { animation: none; }
}

#deco .field-tip.err { color: var(--red); font-weight: 700; }
#deco .line-field.err input { border-color: var(--red); }

/* 「选照片」按钮：整个按钮就是文件输入框，手机上最可靠 */
label.btn { cursor: pointer; }
label.btn input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 0; }
