/* ═══════════════════════════════════════════════════
   生日纪念页 · 样式
   深色暖调 / 衬线标题 / 移动优先
   ═══════════════════════════════════════════════════ */

:root {
  --ink: #f7efe4;
  --ink-soft: #e3d5cb;
  --ink-dim: #c3b2bf;
  --muted: #93828f;
  --bg: #171018;
  --bg-2: #231826;
  --card: rgba(255, 255, 255, 0.05);
  --line: rgba(247, 239, 228, 0.13);
  --accent: #e9c07a;
  --accent-soft: #f4dcae;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --shadow: 0 34px 90px -40px rgba(0, 0, 0, 0.9);
}

body[data-theme="rose"] {
  --bg: #1a1014;
  --bg-2: #2b171e;
  --accent: #e9a2a8;
  --accent-soft: #f4c4c7;
}

body[data-theme="pine"] {
  --bg: #0f1614;
  --bg-2: #17241f;
  --accent: #9cc7ab;
  --accent-soft: #c4e0cc;
}

body[data-theme="amber"] {
  --bg: #181208;
  --bg-2: #29200f;
  --accent: #eec27a;
  --accent-soft: #f7dcae;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* hidden 必须真的不占位：.gate/.admin/.music-dock 都设了 display，会盖过 html 的默认样式 */
[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 背景光晕 + 细颗粒 */
body::before {
  content: "";
  position: fixed;
  inset: -10%;
  z-index: -2;
  background:
    radial-gradient(60% 45% at 22% 8%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    radial-gradient(55% 40% at 82% 82%, color-mix(in srgb, var(--bg-2) 90%, #000), transparent 72%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 55%, var(--bg) 100%);
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

::selection {
  background: color-mix(in srgb, var(--accent) 35%, transparent);
}

/* ── 入口 ───────────────────────────────────────── */

.gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px 20px 40px;
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.gate.is-leaving {
  opacity: 0;
  transform: scale(0.985);
  pointer-events: none;
}

.gate-inner {
  position: relative;
  width: 100%;
  max-width: 392px;
  padding: 42px 26px 30px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.018));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  animation: fadeUp 0.9s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

.gate-inner::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -46px;
  width: 210px;
  height: 130px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 55%, transparent), transparent);
  filter: blur(22px);
  opacity: 0.5;
  pointer-events: none;
}

.eyebrow {
  margin: 0;
  font-size: 10.5px;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  color: var(--accent);
  opacity: 0.85;
}

.gate-title {
  margin: 20px 0 14px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(27px, 7.4vw, 33px);
  line-height: 1.5;
  letter-spacing: 0.03em;
  color: var(--ink);
}

.gate-sub {
  margin: 0 0 30px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--muted);
}

.gate-form {
  display: grid;
  gap: 12px;
  text-align: left;
}

.field {
  display: grid;
  gap: 7px;
}

.field-label {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
  color: var(--muted);
}

.field input {
  width: 100%;
  padding: 13px 16px;
  font-family: inherit;
  font-size: 16px; /* 避免 iOS 聚焦时自动放大 */
  color: var(--ink);
  background: rgba(0, 0, 0, 0.26);
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.field input::placeholder {
  color: color-mix(in srgb, var(--muted) 75%, transparent);
}

.field input:focus {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: rgba(0, 0, 0, 0.34);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 13%, transparent);
}

.gate-error {
  min-height: 18px;
  margin: 2px 0 2px;
  font-size: 12.5px;
  color: #f09d96;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.gate-error.is-visible {
  opacity: 1;
  transform: none;
}

.btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  padding: 14px 18px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
  color: #1c1218;
  background: linear-gradient(140deg, var(--accent-soft), var(--accent));
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 16px 34px -16px color-mix(in srgb, var(--accent) 80%, transparent);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.btn:active {
  transform: translateY(0) scale(0.994);
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.btn[disabled] {
  cursor: progress;
}

.btn.is-loading .btn-text {
  opacity: 0;
}

.btn-spinner {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(28, 18, 24, 0.28);
  border-top-color: #1c1218;
  border-radius: 50%;
  display: none;
  animation: spin 0.7s linear infinite;
}

.btn.is-loading .btn-spinner {
  display: block;
}

.btn-small {
  padding: 11px 18px;
  font-size: 12.5px;
  width: auto;
  justify-self: start;
}

.gate-note {
  margin: 20px 0 0;
  font-size: 11px;
  line-height: 1.7;
  color: var(--muted);
  opacity: 0.8;
}

/* ── 纪念页 ─────────────────────────────────────── */

.page {
  padding: max(26px, env(safe-area-inset-top)) 18px calc(104px + env(safe-area-inset-bottom));
  animation: fadeUp 0.9s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

.sheet {
  max-width: 620px;
  margin: 0 auto;
}

.hero {
  padding: 40px 10px 8px;
  text-align: center;
}

.kicker {
  margin: 0;
  font-size: 10.5px;
  letter-spacing: 0.36em;
  text-indent: 0.36em;
  color: var(--accent);
  opacity: 0.9;
}

.hero-name {
  margin: 16px 0 6px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(32px, 9vw, 46px);
  letter-spacing: 0.06em;
  text-indent: 0.06em;
  line-height: 1.25;
}

.hero-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.hero-sub {
  margin: 12px 0 0;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.countdown {
  margin-top: 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* 还没到生日：倒计时下面的一句话，说明那天会打开什么 */
.lock-note {
  margin: 30px auto 0;
  max-width: 21rem;
  text-align: center;
  font-size: 13px;
  line-height: 2;
  letter-spacing: 0.04em;
  color: var(--ink-dim);
}

.lock-note b {
  color: var(--accent);
  font-size: 21px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.countdown-label {
  margin: 0;
  font-size: 11.5px;
  letter-spacing: 0.26em;
  text-indent: 0.26em;
  color: var(--muted);
}

.countdown-digits {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  font-variant-numeric: tabular-nums;
}

.unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 62px;
  padding: 10px 8px 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.unit b {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 26px;
  line-height: 1.1;
  color: var(--accent);
}

.unit span {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  color: var(--muted);
}

/* 当天：庆祝态 */
.today {
  display: grid;
  gap: 14px;
  justify-items: center;
}

.today-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(26px, 7vw, 34px);
  letter-spacing: 0.1em;
  color: var(--accent);
}

.today-sub {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
}

.cake {
  width: 132px;
  height: 132px;
  cursor: pointer;
  border: 0;
  padding: 0;
  background: none;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cake:hover {
  transform: scale(1.05) rotate(-1.5deg);
}

.cake:active {
  transform: scale(0.97);
}

.flame {
  transform-origin: center bottom;
  animation: flicker 1.7s ease-in-out infinite alternate;
}

.flame:nth-of-type(2n) {
  animation-delay: -0.6s;
  animation-duration: 1.4s;
}

/* ── 区块通用 ───────────────────────────────────── */

.block {
  margin-top: 52px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 0 0 22px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.24em;
  text-indent: 0.24em;
  color: var(--accent);
}

.section-title::before,
.section-title::after {
  content: "";
  height: 1px;
  width: 34px;
  background: linear-gradient(90deg, transparent, var(--line));
}

.section-title::after {
  background: linear-gradient(90deg, var(--line), transparent);
}

/* ── 长信 ───────────────────────────────────────── */

.letter {
  padding: 30px 24px 26px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.012));
  box-shadow: 0 26px 60px -34px rgba(0, 0, 0, 0.9);
}

.letter .section-title {
  margin-bottom: 24px;
}

.letter-body p {
  margin: 0 0 1.15em;
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 2.1;
  letter-spacing: 0.015em;
  color: var(--ink-soft);
  text-align: justify;
}

.letter-body p:last-child {
  margin-bottom: 0;
}

.signature {
  margin: 20px 0 0;
  font-family: var(--serif);
  font-size: 13.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-align: right;
}

/* ── 相册 ───────────────────────────────────────── */

.gallery {
  margin-top: 54px;
}

.slides {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  aspect-ratio: 4 / 5;
  background: #0b080c;
}

.track {
  display: flex;
  height: 100%;
  transition: transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.slide {
  position: relative;
  flex: 0 0 100%;
  height: 100%;
  margin: 0;
}

.slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0b080c;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.slide.is-ready img {
  opacity: 1;
}

.slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.06) 45%, transparent 70%);
  background-size: 220% 100%;
  animation: shimmer 1.6s linear infinite;
  pointer-events: none;
}

.slide.is-ready::after {
  display: none;
}

.slide figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 34px 18px 16px;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: #f7efe4;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.78));
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.6s ease 0.1s, transform 0.6s ease 0.1s;
}

.slide.is-ready figcaption {
  opacity: 1;
  transform: none;
}

.slide-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0 0 3px;
  font-size: 21px;
  line-height: 1;
  color: #fff;
  background: rgba(10, 6, 12, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  cursor: pointer;
  opacity: 0.75;
  backdrop-filter: blur(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.slide-nav:hover {
  opacity: 1;
}

.slide-nav.prev {
  left: 12px;
}

.slide-nav.next {
  right: 12px;
}

.slides.is-single .slide-nav {
  display: none;
}

.dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 15px;
}

.dot {
  width: 6px;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: rgba(247, 239, 228, 0.26);
  cursor: pointer;
  transition: width 0.3s ease, background 0.3s ease;
}

.dot.is-active {
  width: 20px;
  background: var(--accent);
}

/* ── 留言墙（v1 关闭，样式先备好） ───────────────── */

.wall-list {
  display: grid;
  gap: 10px;
}

.wall-item {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}

.wall-item h3 {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.wall-item p {
  margin: 0;
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink-soft);
  word-break: break-word;
}

.wall-empty {
  margin: 0;
  padding: 18px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 16px;
}

.wall-form {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.wall-form input,
.wall-form textarea {
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.26);
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wall-form textarea {
  min-height: 88px;
  line-height: 1.7;
}

.wall-form input:focus,
.wall-form textarea:focus {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent);
}

/* ── 页脚 / 音乐 / 提示 ─────────────────────────── */

.foot {
  margin-top: 64px;
  text-align: center;
}

.foot p {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.24em;
  text-indent: 0.24em;
  color: var(--muted);
  opacity: 0.6;
}

.foot-write {
  display: inline-block;
  margin-top: 14px;
  padding: 7px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11.5px;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}

.foot-write:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.music-dock {
  position: fixed;
  right: 16px;
  top: calc(16px + env(safe-area-inset-top));
  bottom: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px 9px 14px;
  font-family: inherit;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  background: rgba(18, 12, 20, 0.72);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 18px 44px -20px #000;
  transition: transform 0.2s ease, border-color 0.2s ease;
  animation: fadeUp 0.8s 0.4s both;
}

/* 管理员预览/总览时，顶栏横在中间，音乐按钮往下让一让 */
body.is-admin .music-dock {
  top: calc(80px + env(safe-area-inset-top));
}

@media (max-width: 600px) {
  .music-dock {
    right: 12px;
    top: calc(12px + env(safe-area-inset-top));
  }

  body.is-admin .music-dock {
    top: calc(92px + env(safe-area-inset-top));
  }
}

.music-dock:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}

.music-dock[disabled] {
  opacity: 0.55;
  cursor: progress;
}

.bars {
  display: flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 14px;
}

.bars i {
  width: 2.5px;
  height: 35%;
  border-radius: 2px;
  background: var(--accent);
  transition: height 0.3s ease;
}

.music-dock.is-playing .bars i {
  animation: equalize 0.9s ease-in-out infinite alternate;
}

.music-dock.is-playing .bars i:nth-child(2) {
  animation-delay: -0.45s;
}

.music-dock.is-playing .bars i:nth-child(3) {
  animation-delay: -0.2s;
}

.music-dock.is-playing .bars i:nth-child(4) {
  animation-delay: -0.65s;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 70;
  max-width: 78vw;
  padding: 10px 18px;
  font-size: 13px;
  text-align: center;
  color: var(--ink);
  background: rgba(20, 14, 22, 0.94);
  border: 1px solid var(--line);
  border-radius: 999px;
  opacity: 0;
  transform: translate(-50%, 10px);
  pointer-events: none;
  transition: opacity 0.32s ease, transform 0.32s ease;
}

.toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

.confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 65;
  pointer-events: none;
}

/* ── 入场动画 ───────────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(16px);
}

.reveal.is-in {
  animation: fadeUp 0.9s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
  animation-delay: calc(var(--i, 0) * 110ms);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shimmer {
  from {
    background-position: 180% 0;
  }
  to {
    background-position: -80% 0;
  }
}

@keyframes flicker {
  from {
    transform: scaleY(0.94) scaleX(1);
    opacity: 0.86;
  }
  to {
    transform: scaleY(1.08) scaleX(0.94);
    opacity: 1;
  }
}

@keyframes equalize {
  from {
    height: 25%;
  }
  to {
    height: 100%;
  }
}

/* ── 桌面端 ─────────────────────────────────────── */

@media (min-width: 720px) {
  .page {
    padding-top: 60px;
  }

  .slides {
    max-width: 520px;
    margin: 0 auto;
  }

  .letter {
    padding: 38px 40px 34px;
  }

  .letter-body p {
    font-size: 16.5px;
  }
}

/* ── 管理员总览 ─────────────────────────────── */
.admin {
  min-height: 100vh;
  padding: clamp(48px, 9vh, 96px) 22px 96px;
  display: grid;
  justify-items: center;
  align-content: start;
}

.admin-inner {
  width: 100%;
  max-width: 900px;
}

.admin-title {
  font-family: var(--serif);
  font-size: clamp(2rem, 6vw, 2.9rem);
  letter-spacing: 0.06em;
  margin: 10px 0 14px;
}

.admin-sub {
  color: var(--muted);
  line-height: 1.95;
  max-width: 36em;
  margin-bottom: clamp(28px, 5vh, 44px);
}

.admin-list {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
}

.admin-card {
  display: grid;
  gap: 6px;
  padding: 22px 22px 20px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--card);
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.admin-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.admin-card-name {
  font-family: var(--serif);
  font-size: 1.45rem;
  letter-spacing: 0.04em;
}

.admin-card-meta {
  color: var(--accent);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
}

.admin-card-stats {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.7;
}

.admin-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.admin-card-actions .btn-small {
  margin-top: 0;
}

a.btn-small {
  text-decoration: none;
}

.admin-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: clamp(32px, 6vh, 52px);
}

.admin-bar {
  position: fixed;
  top: 16px;
  left: 50%;
  z-index: 60;
  max-width: calc(100vw - 32px);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 8px 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(10, 8, 12, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: 0.78rem;
  color: var(--ink-dim);
  transform: translateX(-50%);
}

.admin-bar-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── 长信：多封时用 ‹ › 翻页 ─────────────────────── */

.letter-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 26px;
}

.letter-step {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.letter-step:hover {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.04);
}

.letter-from {
  min-width: 5.4em;
  text-align: center;
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  color: var(--ink-dim);
}

/* ── 左下角：朋友写来的短祝福，慢慢往上滚 ─────────── */

.notes-ticker {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 55;
  width: min(300px, calc(100vw - 40px));
  max-height: 46vh;
  overflow: hidden;
  padding: 12px 14px 6px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(10, 8, 12, 0.74);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 82%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 82%, transparent);
}

.notes-label {
  margin: 0 0 6px;
  font-size: 0.66rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
}

.notes-stage {
  animation: notes-scroll var(--notes-dur, 40s) linear infinite;
}

.notes-ticker:hover .notes-stage {
  animation-play-state: paused;
}

.note-card {
  padding: 10px 0 12px;
  border-top: 1px solid var(--line);
}

.note-card:first-child {
  border-top: 0;
}

.note-from {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--accent-soft);
}

.note-text {
  margin: 4px 0 0;
  font-size: 0.86rem;
  line-height: 1.7;
  color: var(--ink);
}

@keyframes notes-scroll {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-50%);
  }
}

@media (max-width: 600px) {
  .notes-ticker {
    left: 12px;
    right: 12px;
    bottom: 78px;
    width: auto;
    max-height: 32vh;
  }
}

/* ── 右下角：像弹消息一样循环冒出来的话（管理员可编辑） ── */

.msg-stack {
  position: fixed;
  right: 24px;
  bottom: 26px;
  z-index: 56;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(288px, calc(100vw - 48px));
  pointer-events: none;
}

.msg-bubble {
  padding: 12px 15px;
  border-radius: 16px 16px 5px 16px;
  border: 1px solid var(--line);
  background: rgba(13, 10, 15, 0.84);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.4);
  font-size: 0.86rem;
  line-height: 1.66;
  color: var(--ink);
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.msg-from {
  color: var(--accent-soft);
  font-weight: 600;
  margin-right: 2px;
}

.msg-bubble.is-in {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.msg-bubble.is-out {
  opacity: 0;
  transform: translateY(-12px) scale(0.98);
}

@media (max-width: 600px) {
  /* 手机上贴右下、音乐按钮上方；如果左下角有「TA 们的话」，JS 会把整叠抬到它上面 */
  .msg-stack {
    right: 12px;
    top: auto;
    bottom: 22px;
    width: min(280px, calc(100vw - 40px));
    gap: 8px;
  }

  .msg-bubble {
    padding: 10px 13px;
    font-size: 0.82rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* 安全模式（?safe=1）：去掉所有毛玻璃与滤镜，用于排查某些显卡驱动下的卡死 */
html.no-blur *,
html.no-blur *::before,
html.no-blur *::after {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  filter: none !important;
}


/* 备案号：按规定在页脚展示，链到工信部备案系统 */
.foot-beian {
  display: block;
  margin: 18px auto 0;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--ink-dim, #9c908a);
  opacity: 0.85;
  text-decoration: none;
  transition: color 0.18s ease;
}

.foot-beian:hover {
  color: var(--ink-dim, #9c908a);
  text-decoration: underline;
}
