/* LBT 双节贺卡。颜色全部来自 css/palette.css（scripts/palette.py 在 OKLCH 里定义后换算的 sRGB），这里不写散落的色值。 */
:root {
  --bg: var(--night-800);
  --font-cn: 'NSS', 'PingFang SC', 'HarmonyOS Sans SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  --font-en: 'MSR', 'Montserrat', 'Avenir Next', 'Helvetica Neue', Arial, sans-serif;
  /* 镭射箔：色板里的四个色标（青 · 紫 · 粉 · 金） */
  --holo: linear-gradient(100deg, var(--holo-1), var(--holo-2) 34%, var(--holo-3) 66%, var(--holo-4) 100%);
  --glass: rgba(245, 244, 252, 0.08);
  --glass-line: rgba(245, 244, 252, 0.16);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

body {
  /* 固定住整页：iOS/微信里拖动时不会带着整页回弹 */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  font-family: var(--font-cn);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
img, canvas { -webkit-touch-callout: none; -webkit-user-drag: none; }

button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }

/* ---------- 加载：月亮像电池一样充满 ---------- */
.loader {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 38%, var(--night-700), var(--night-900) 70%);
  transition: opacity .6s ease, visibility .6s;
}
.loader .charge {
  position: relative;
  width: 48px;
  height: 48px;
  margin-bottom: 18px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: inset 0 0 0 1.5px rgba(247, 231, 187, .55), 0 0 34px rgba(247, 231, 187, .22);
}
.loader .charge b {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: calc(var(--p, .08) * 100%);
  background: linear-gradient(var(--moon), var(--gold));
  transition: height .35s ease;
  animation: charge-glow 1.4s ease-in-out infinite;
}
.loader span { font-size: 13px; letter-spacing: .3em; text-indent: .3em; color: var(--text-3); }
.loader em { font-style: normal; font-family: var(--font-en); font-weight: 600; letter-spacing: .06em; color: var(--gold); }
.loader.hide { opacity: 0; visibility: hidden; }
@keyframes charge-glow { 50% { opacity: .78; } }

/* 手机横屏提示 */
.rotate {
  display: none;
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 70;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--night-800);
  color: var(--text-2);
  font-size: 16px;
  letter-spacing: .25em;
}
.rotate p { margin: 18px 0 0; }
.rotate-phone {
  width: 34px;
  height: 58px;
  border: 2px solid var(--text-2);
  border-radius: 7px;
  display: grid;
  place-items: center;
  animation: rotate-hint 2.4s ease-in-out infinite;
}
.rotate-phone i { width: 14px; height: 14px; border-radius: 50%; background: var(--moon); }
@keyframes rotate-hint { 0%, 20% { transform: rotate(-90deg); } 55%, 100% { transform: rotate(0); } }
@media (orientation: landscape) and (max-height: 500px) and (hover: none) {
  .rotate { display: flex; }
}

#bg, #scene {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  width: 100%;
  height: 100%;
  display: block;
}
#scene { z-index: 2; touch-action: none; cursor: grab; }

/* ---------- 国庆夜的天安门（js/tiananmen.js）：金色轮廓灯、红墙红柱、八盏大红灯笼；不画国徽 ---------- */
#tam { position: fixed; z-index: 1; pointer-events: none; }
#tam svg { display: block; width: 100%; height: 100%; overflow: visible; }
#tam path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
#tam.lit .tam-lines { filter: drop-shadow(0 0 2px rgba(239, 200, 118, .55)); }
#tam .m { stroke: var(--gold); stroke-width: var(--sw-m, 2px); opacity: .9; }
#tam .f { stroke: var(--gold); stroke-width: var(--sw-f, 1px); opacity: .5; }
#tam .tile { stroke: var(--gold); opacity: .22; } /* 瓦垄：金色的琉璃瓦 */
#tam .col { stroke: var(--red-hi); opacity: .9; }
#tam .occ { fill: var(--night-900); }
#tam .d { stroke-dasharray: var(--len) var(--len); stroke-dashoffset: var(--len); }
#tam.go .d { animation: tam-draw var(--dur) cubic-bezier(.5, .1, .3, 1) var(--t0) forwards; }
#tam .stud { fill: var(--gold); opacity: 0; }
#tam.go .stud { animation: tam-fade var(--dur) ease var(--t0) forwards; }
#tam .fill { stroke: none; opacity: 0; }
#tam.go .fill { animation: tam-fade var(--dur) ease var(--t0) forwards; }
#tam .f-wall { fill: var(--red-deep); }
#tam .f-red { fill: var(--red-wall); }
#tam .f-stone { fill: var(--night-600); }
#tam .f-roof { fill: var(--night-900); }
#tam .f-hole { fill: #030110; }
#tam .lan { opacity: 0; }
#tam.go .lan { animation: lan-on .9s ease var(--t0) forwards; }
#tam .lan-line { stroke: var(--gold); stroke-width: var(--sw-f, 1px); }
#tam .lan-cap { fill: var(--gold); }
#tam.instant .d, #tam.instant .stud, #tam.instant .fill, #tam.instant .lan { animation-duration: .01s !important; animation-delay: 0s !important; }
@keyframes tam-draw { to { stroke-dashoffset: 0; } }
@keyframes tam-fade { to { opacity: 1; } }
@keyframes lan-on { 0% { opacity: 0; } 40% { opacity: 1; } 60% { opacity: .55; } 100% { opacity: 1; } }
#scene.dragging { cursor: grabbing; }
#scene.over-paper { cursor: pointer; }

/* ---------- 界面：提示与按钮 ---------- */
#ui { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 3; pointer-events: none; }

/* 左上角：白色的 LBT 标志图形 */
.brand {
  position: absolute;
  top: calc(var(--safe-t) + 12px);
  left: 14px;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .8s ease, transform .8s ease;
}
.brand.show { opacity: 1; transform: none; }
.brand-seal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 5px;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  color: var(--text);
  background: var(--magenta);
  border-radius: 4px;
}
.brand-seal i { font-style: normal; }
.brand.has-logo { height: 38px; }
.brand-logo {
  display: block;
  height: 100%;
  width: auto;
  max-width: var(--brand-max, 120px);
  object-fit: contain;
  object-position: left top;
  filter: drop-shadow(0 2px 6px rgba(6, 3, 28, .5));
}
@media (max-width: 350px) { .brand.has-logo { height: 32px; } }

.hint {
  position: absolute;
  margin: 0;
  writing-mode: vertical-rl;
  font-size: 14px;
  font-size: clamp(12px, 3.6vw, 14px);
  letter-spacing: .3em;
  color: var(--text-3);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 1s ease, transform 1s ease;
}
.hint.show { opacity: 1; transform: none; }

.topbar {
  position: absolute;
  top: calc(var(--safe-t) + 12px);
  right: 12px;
  display: flex;
  gap: 8px;
  pointer-events: auto;
  opacity: 0;
  transition: opacity .8s ease;
}
.topbar.show { opacity: 1; }
/* 贺卡打开时收起顶栏和提示，只留贺卡自己的按钮 */
body.card-open .topbar, body.card-open .hint, body.card-open .brand { opacity: 0; pointer-events: none; }

/* 主按钮：LBT 品红；次按钮：磨砂玻璃 */
.pill {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 999px;
  min-height: 42px;
  padding: 9px 18px 8px;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: .12em;
  background: linear-gradient(180deg, var(--magenta-hi) -60%, var(--magenta) 70%);
  color: var(--text);
  box-shadow: 0 8px 22px rgba(193, 33, 110, .35), inset 0 1px 0 rgba(255, 255, 255, .22);
  transition: transform .15s ease, box-shadow .2s ease;
}
.pill:active { transform: scale(.96); }
.pill.ghost {
  background: var(--glass);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--glass-line);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.round {
  appearance: none;
  -webkit-appearance: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 22px;
  line-height: 1;
  background: var(--glass);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--glass-line), 0 4px 14px rgba(6, 3, 28, .3);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.round svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.round svg circle { fill: currentColor; stroke: none; }
#btnSound .off { display: none; }
#btnSound[aria-pressed="false"] .off { display: inline; }
#btnSound[aria-pressed="false"] { opacity: .7; }

button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--magenta-hi);
  outline-offset: 2px;
}

/* 镭射箔字：色板的四个色标，光泽缓缓流动；不支持的浏览器退回浅紫 */
.holo { color: var(--purple-hi); }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .holo {
    background: var(--holo);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    animation: holo-shift 6s ease-in-out infinite alternate;
  }
  /* 落款的金：月光金 → 金 → 深金 */
  .foil {
    background: linear-gradient(100deg, var(--moon), var(--gold) 45%, var(--gold-deep));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
  }
}
@keyframes holo-shift { to { background-position: 100% 0; } }

/* ---------- 贺卡：深紫卡纸 + 镭射箔 ---------- */
.card-layer {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 20;
  --cw: 300px;
  --ch: 400px;
  --cy: 50%;
}
.card-layer[hidden] { display: none; }

.card-backdrop {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: radial-gradient(ellipse at 50% 42%, rgba(47, 24, 74, .55), rgba(6, 3, 28, .86));
  opacity: 0;
  transition: opacity .55s ease;
}
.card-layer.show .card-backdrop { opacity: 1; }

.card-wrap {
  position: absolute;
  left: 50%;
  top: var(--cy);
  width: var(--cw);
  height: var(--ch);
  margin-left: calc(var(--cw) / -2);
  margin-top: calc(var(--ch) / -2);
  transform-origin: 50% 50%;
  will-change: transform;
}

.card {
  position: relative;
  width: 100%;
  height: 100%;
  perspective: 2000px;
  transition: transform 1.1s cubic-bezier(.3, .7, .2, 1);
}
/* 上下翻开：封面向上翻起，整张卡往下挪半格，让打开后的上下两页居中 */
.card-layer.is-open .card { transform: translateY(calc(var(--ch) / 2)); }

.card-inside,
.face {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  border-radius: 6px;
  overflow: hidden;
}

.card-inside {
  background: var(--night-700) url(../assets/img/card.webp) center / cover;
  box-shadow: 0 30px 60px rgba(2, 1, 12, .6), 0 2px 6px rgba(2, 1, 12, .4), inset 0 0 0 1px rgba(245, 244, 252, .06);
}

.card-cover {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  transform-origin: 50% 0;
  transform-style: preserve-3d;
  transition: transform 1.1s cubic-bezier(.3, .7, .2, 1);
  cursor: pointer;
}
.card-layer.is-open .card-cover { transform: rotateX(180deg); cursor: default; }

.face {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.face.front:focus { outline: none; }
.kbd .face.front:focus-visible { outline: 2px solid var(--magenta-hi); outline-offset: 4px; }
.face.front {
  background: var(--night-900);
  box-shadow: 0 30px 60px rgba(2, 1, 12, .6), 0 2px 6px rgba(2, 1, 12, .4);
}
/* 封面描一道镭射细边 */
.face.front::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--holo);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: .6;
  pointer-events: none;
}
.face.back {
  transform: rotateX(180deg);
  background: var(--night-700) url(../assets/img/card.webp) center / cover;
  box-shadow: 0 30px 60px rgba(2, 1, 12, .5);
}

.cover-art {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-user-drag: none;
}
.cover-art-next { opacity: 0; transition: opacity .45s ease; }
.cover-art-next.show { opacity: 1; }

/* 封面文字：统一压在左上角的暗处 */
.cover-type {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  pointer-events: none;
  transition: opacity .35s ease;
}
.cover-type.fade { opacity: 0; }
.cover-en {
  position: absolute;
  left: 6%;
  top: 7.5%;
  margin: 0;
  font-family: var(--font-en);
  font-weight: 800;
  font-size: calc(var(--cw) * .024);
  letter-spacing: .22em;
}
.cover-title {
  position: absolute;
  left: 5.6%;
  top: 11.5%;
  margin: 0;
  font-weight: 900;
  font-size: calc(var(--cw) * .082);
  line-height: 1.15;
  letter-spacing: .06em;
  color: var(--text);
  text-shadow: 0 2px 18px rgba(6, 3, 28, .65);
}
.cover-to {
  position: absolute;
  left: 6%;
  bottom: 13.5%;
  margin: 0;
  font-size: calc(var(--cw) * .034);
  letter-spacing: .2em;
  color: var(--text);
  text-shadow: 0 1px 10px rgba(6, 3, 28, .8);
}
.cover-to:empty { display: none; }
.cover-foot {
  position: absolute;
  left: 6%;
  bottom: 6.5%;
  margin: 0;
  font-size: calc(var(--cw) * .024);
  letter-spacing: .3em;
  color: var(--gold);
  text-shadow: 0 1px 8px rgba(6, 3, 28, .9);
}

/* 封面内侧：翻开后在上半页 */
.face.back {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.back-en {
  margin: 0;
  font-family: var(--font-en);
  font-weight: 800;
  font-size: calc(var(--cw) * .025);
  letter-spacing: .3em;
  text-indent: .3em;
  text-transform: uppercase;
}
.back-mark {
  width: auto;
  height: calc(var(--cw) * .12);
  margin: calc(var(--cw) * .04) 0 calc(var(--cw) * .032);
}
.back-line {
  margin: 0;
  font-weight: 900;
  font-size: calc(var(--cw) * .044);
  letter-spacing: .24em;
  text-indent: .24em;
  color: var(--text);
}
.back-line.red { margin-top: calc(var(--cw) * .012); color: var(--red-hi); }
.back-sub {
  margin: calc(var(--cw) * .02) 0 0;
  font-size: calc(var(--cw) * .026);
  letter-spacing: .3em;
  text-indent: .3em;
  color: var(--text-3);
}

/* 内页：切角的金色细框（机甲装甲板的切角）+ 居中排的祝福 */
.inside-frame {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.inside-frame path { fill: none; stroke: var(--gold); stroke-width: 1.1; opacity: .75; }
.inside-frame .thin { stroke-width: .5; opacity: .45; }
.inside-frame .tick { stroke: var(--magenta-hi); stroke-width: 1.4; opacity: .9; }

.letter {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  padding: 8% 11% 6.5%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: var(--text);
}
.l-body {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-size: var(--fs, calc(var(--cw) * .04));
  line-height: 1.85;
  letter-spacing: .05em;
  overflow: hidden;
}
.l-body p { margin: 0; text-wrap: balance; }
.l-body .l-to { margin-bottom: .6em; letter-spacing: .15em; color: var(--gold); }
.l-body .l-poem { font-size: 1.2em; letter-spacing: .12em; line-height: 1.9; }
.l-body .l-by { margin-top: .5em; font-size: .7em; letter-spacing: .12em; color: var(--text-3); }
.l-body .l-greet { margin-top: 1.1em; }
.l-sign {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--cw) * .022);
  margin-top: calc(var(--cw) * .015);
  font-size: calc(var(--cw) * .04);
  font-weight: 900;
  letter-spacing: .12em;
}
.l-sign .name:not(.foil) { color: var(--gold); }
.l-sign .by { font-weight: 500; font-size: .72em; letter-spacing: .2em; color: var(--text-2); }
.l-sign .l-logo { height: calc(var(--cw) * .062); width: auto; }
/* LBT 的六角徽章：翻开时“啪”地贴上去 */
.l-seal {
  display: inline-grid;
  place-items: center;
  width: calc(var(--cw) * .076);
  height: calc(var(--cw) * .066);
  font-family: var(--font-en);
  font-weight: 800;
  font-size: calc(var(--cw) * .019);
  letter-spacing: .04em;
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  background: linear-gradient(160deg, var(--magenta-hi), var(--magenta) 60%);
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
  opacity: 0;
  transform: rotate(-8deg) scale(1.6);
  transition: opacity .3s ease 1s, transform .35s cubic-bezier(.3, 1.6, .5, 1) 1s;
}
.card-layer.is-open .l-seal { opacity: 1; transform: rotate(-8deg) scale(1); }
.l-date {
  margin: calc(var(--cw) * .012) 0 0;
  font-size: calc(var(--cw) * .024);
  letter-spacing: .24em;
  text-indent: .24em;
  color: var(--text-3);
}

/* 从花灯飞出时的灯面 */
.paper-veil {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
}

.card-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--safe-b) + 18px);
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity .4s ease;
}
.card-layer.ready .card-bar { opacity: 1; }
.cover-nav, .inside-actions { grid-area: 1 / 1; display: flex; align-items: center; gap: 12px; transition: opacity .35s ease, visibility .35s; }
.cover-nav { flex-direction: column; gap: 6px; }
.nav-hint { margin: 0; font-size: 12px; letter-spacing: .24em; color: var(--text-3); }
.nav-row { display: flex; align-items: center; gap: 10px; }
.card-layer.is-open .cover-nav,
.card-layer:not(.is-open) .inside-actions { opacity: 0; visibility: hidden; }

.dots { display: flex; padding: 0 2px; }
/* 圆点只有 7px，按钮本身放大方便手指点 */
.dots button {
  width: 22px;
  height: 40px;
  padding: 0;
  border: 0;
  background: none;
  display: grid;
  place-items: center;
}
.dots button::after {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(245, 244, 252, .3);
  transition: background .25s, transform .25s, box-shadow .25s;
}
.dots button[aria-current="true"]::after { background: var(--magenta-hi); transform: scale(1.3); box-shadow: 0 0 10px var(--magenta); }

.card-close {
  position: absolute;
  top: calc(var(--safe-t) + 12px);
  right: 12px;
  opacity: 0;
  transition: opacity .4s ease;
}
.card-layer.ready .card-close { opacity: 1; }

/* ---------- 送祝福 ---------- */
.composer { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 30; }
.composer[hidden] { display: none; }
.composer-backdrop { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: rgba(6, 3, 28, .62); }
.sheet {
  position: absolute;
  left: 50%;
  /* --kb：iOS 键盘弹起时抬高的距离，由 main.js 根据 visualViewport 计算 */
  bottom: var(--kb, 0px);
  width: 100%;
  max-width: 520px;
  max-height: 92%;
  max-height: calc(100% - var(--kb, 0px) - var(--safe-t) - 12px);
  -webkit-touch-callout: default;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateX(-50%);
  margin: 0;
  padding: 16px 18px calc(var(--safe-b) + 18px);
  border-radius: 18px 18px 0 0;
  background: var(--night-700) url(../assets/img/card.webp) center / cover;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(245, 244, 252, .08);
  animation: sheet-in .45s cubic-bezier(.2, .8, .2, 1);
  -webkit-user-select: text;
  user-select: text;
  color: var(--text);
}
/* 弹层顶边一道品红灯带 */
.sheet::before {
  content: '';
  position: absolute;
  left: 18%;
  right: 18%;
  top: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--magenta-hi), transparent);
}
@keyframes sheet-in { from { transform: translate(-50%, 40px); opacity: 0; } }
.sheet header { display: flex; align-items: center; justify-content: space-between; }
.sheet h2 { margin: 0; font-weight: 900; font-size: 20px; letter-spacing: .14em; color: var(--text); }
.field { display: block; margin-top: 14px; position: relative; }
.label { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-2); margin-bottom: 6px; letter-spacing: .12em; }
.link { appearance: none; border: 0; background: none; padding: 0; color: var(--magenta-hi); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.sheet input, .sheet textarea {
  width: 100%;
  border: 1px solid rgba(165, 161, 185, .3);
  border-radius: 10px;
  background: rgba(6, 3, 28, .35);
  padding: 10px 12px;
  font: 17px/1.7 var(--font-cn);
  color: var(--text);
  resize: none;
  -webkit-appearance: none;
}
.sheet input::placeholder, .sheet textarea::placeholder { color: var(--text-3); opacity: .8; }
.sheet textarea { min-height: 104px; }
.count { position: absolute; right: 10px; bottom: 8px; font: 12px/1 var(--font-en); color: var(--text-3); }
.thumbs { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; }
.thumbs::-webkit-scrollbar { display: none; }
.thumbs button {
  flex: 0 0 auto;
  width: 88px;
  height: 66px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
  opacity: .72;
  transition: opacity .2s, transform .2s, box-shadow .2s;
}
.thumbs button img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbs button span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 4px 0 3px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .1em;
  color: var(--text);
  background: linear-gradient(transparent, rgba(6, 3, 28, .85));
}
.thumbs button[aria-pressed="true"] { opacity: 1; transform: translateY(-2px); box-shadow: 0 0 0 1.5px var(--magenta-hi), 0 6px 16px rgba(193, 33, 110, .3); }
.sheet-actions { display: flex; gap: 10px; margin-top: 18px; }
.sheet-actions .pill { flex: 1; }
/* 分享页：分享图 + 一键复制 */
.share-view { margin-top: 12px; text-align: center; }
.poster-wrap {
  position: relative;
  margin: 0 auto;
  width: 300px;
  max-width: 100%;
  max-width: min(100%, calc((92vh - 250px) * .64));
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45), 0 0 0 1px rgba(245, 244, 252, .08);
  background: var(--night-700);
  overflow: hidden;
}
/* 用 padding 撑出 750:1170 的比例，老版本 iOS 也能正确显示 */
.poster-wrap::before { content: ''; display: block; padding-top: 156%; }
.poster {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: 100%;
  height: 100%;
  -webkit-touch-callout: default; /* 允许长按保存 / 识别二维码 */
  -webkit-user-select: auto;
  user-select: auto;
  opacity: 0;
  transition: opacity .4s ease;
}
.poster.ready { opacity: 1; }
/* 微信里点“保存图片”时，图片轻轻一跳，提示长按它 */
.poster.hint { animation: poster-hint .9s ease; }
@keyframes poster-hint { 30% { transform: scale(1.035); } 60% { transform: scale(.99); } }
.poster-loading {
  position: absolute;
  pointer-events: none; /* 只是一行字：不能挡在分享图上面，否则长按摸到的是它，出不来“保存图片” */
  top: 0; right: 0; bottom: 0; left: 0;
  display: grid;
  place-items: center;
  font-size: 13px;
  letter-spacing: .2em;
  color: var(--text-3);
  transition: opacity .3s ease;
}
.poster.ready + .poster-loading { opacity: 0; visibility: hidden; }
.share-tip { margin: 12px 0 0; font-size: 13px; letter-spacing: .12em; color: var(--text-3); }
.share-view .sheet-actions { margin-top: 12px; gap: 8px; }
.share-view .sheet-actions .pill { padding-left: 6px; padding-right: 6px; font-size: 15px; letter-spacing: .06em; white-space: nowrap; }
#btnCopy .copy-label { display: inline-block; transition: transform .25s ease; }
#btnCopy.copied { background: var(--purple); box-shadow: none; }
.native-share { margin-top: 12px; }
.native-share[hidden] { display: none; }

.toast {
  position: fixed;
  left: 50%;
  top: calc(var(--safe-t) + 18px);
  z-index: 40;
  max-width: calc(100% - 32px);
  transform: translate(-50%, -12px);
  padding: 9px 18px 8px;
  border-radius: 999px;
  background: rgba(15, 8, 41, .82);
  box-shadow: inset 0 0 0 1px var(--glass-line), 0 8px 24px rgba(0, 0, 0, .35);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--text);
  font-size: 14px;
  letter-spacing: .06em;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .card, .card-cover { transition-duration: .01s !important; }
  .holo { animation: none; }
}
