/* ========= 基础设置 ========= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ensure background covers full viewport height */
html,
body {
  height: 100%;
}

.no-scroll {
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", "PingFang SC", sans-serif;
  background: #ffd0e6;
  /* 稍微调深的粉色背景，提升雪花可见性 */
  color: #111;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

:root {
  --radius: 12px;
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  --bg-card: #ffffff;
  --accent: #ff66a3;
  /* 粉色主色 */
  --accent-light: #ffe6f0;
  --navbar-height: 64px;
}

/* ========= Loading Animation ========= */
#loader {
  position: fixed;
  inset: 0;
  background: #ffd0e6;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(255, 255, 255, 0.3);
  border-top: 5px solid var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* ========= 通用布局 ========= */
.container {
  width: 90%;
  max-width: 480px;
  /* 手机优化 */
  margin: 0 auto;
  padding: 20px 0;
}

/* ========= 首页大屏（Hero） ========= */
.hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: calc(100vh - var(--navbar-height));
  padding: 28px 16px;
}

/* Use a body class to apply the main page background so it fills the whole document. */
body.hero-bg {
  background-image: url('Elements/main_bg.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-color: #ffd0e6;
  /* fallback color */
}

/* Memory page background (specific image) */
body.memory-bg {
  background-image: url('Elements/memory_bg.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-color: #ffdfe9;
  /* slight fallback/tint for memory page */
}

/* Disable the global overlay for the memory page (remove 遮罩效果) */
body.memory-bg::before {
  display: none !important;
}

/* Add a spacer that keeps the document tall enough to show the full 800x3995 image
   when the image width equals the page width. Calculated padding-top preserves aspect ratio:
   (3995 / 800) * 100% = 499.375% */
/* spacer no longer needed; min-height calculation above handles dynamic sizing */

/* Overlay moved to body so it covers the whole background image */
body.hero-bg::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  pointer-events: none;
  z-index: 0;
}

/* Modifier for pages that should keep the overlay but not show the background image */
body.hero-bg.no-bg {
  background-image: none !important;
  background-color: #ffd0e6;
}

/* ========= Birthday Page ========= */
body.birthday-bg {
  background-color: #8f7f74;
  /* Matches image bottom color */
  /* Ensure min-height allows scrolling if image is tall */
  min-height: 100vh;
  position: relative;
  /* Needed for pseudo-element positioning */
}

body.birthday-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 160%;
  background-image: url('Elements/Birthday_BG.jpg');
  background-size: 100% auto;
  background-repeat: no-repeat;
  background-position: center 50px;
  opacity: 0;
  /* Start transparent */
  animation: illuFade 1.5s ease-out forwards;
  /* Same animation effect */
  pointer-events: none;
  z-index: -1;
  /* Behind content */
  display: block !important;
}

.birthday-spacer {
  /* Image aspect ratio is 1920/1080 = 1.7777 */
  /* We want spacer to be ImageHeight + Offset */
  /* ImageHeight = 100vw * (1920/1080) */
  width: 100%;
  padding-top: calc((1920 / 1080) * 100vw + 40px);
}

.birthday-card {
  margin-bottom: 24px;
  text-align: center;
  padding: 30px 20px;
}

.frost-card {
  background: rgba(255, 255, 255, 0.36);
  border: 1px solid rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  backdrop-filter: blur(10px) saturate(120%);
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12);
}

.card-desc {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 20px;
  line-height: 1.5;
}

.hint-text {
  font-size: 0.8rem;
  color: #777;
  margin-top: 12px;
}

/* .btn-white deprecated */

/* Candle Module */
.cake-container {
  margin: 20px auto;
}

.flame {
  transform-origin: center bottom;
  animation: flameFlicker 0.1s infinite alternate;
}

@keyframes flameFlicker {
  from {
    transform: scale(1);
  }

  to {
    transform: scale(1.1) rotate(2deg);
  }
}

/* Fireworks Module */
.fireworks-icon {
  margin: 20px auto;
}

/* Scratch Card Module */
.scratch-container {
  position: relative;
  /* Use percentage width to fit within the card, with a max-width cap */
  width: 100%;
  max-width: 300px;
  /* Maintain aspect ratio or set a fixed height that fits */
  height: 180px;
  margin: 20px auto;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.12);
}

.scratch-reward {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: #333;
  z-index: 1;
}

#scratchCanvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  cursor: crosshair;
}

.scratch-overlay-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 3;
  font-size: 1.2rem;
  color: #666;
  font-weight: bold;
}

/* Wish Modal */
.wish-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 2000;
}

.wish-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.wish-box {
  position: relative;
  z-index: 2;
  width: 80%;
  max-width: 320px;
  padding: 24px;
  background: #fff;
}

.wish-box textarea {
  width: 100%;
  height: 100px;
  margin: 16px 0;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #ddd;
}

/* Keep hero content above the overlay */
.hero {
  position: relative;
  color: #fff;
  /* 保证文字在背景上可读 */
}

.hero>* {
  position: relative;
  z-index: 2;
}

/* Move hero content slightly downward: align to top of hero and add top padding */
.hero {
  justify-content: flex-start;
  padding-top: 196px;
  /* 调整此值以改变下移距离 */
  padding-bottom: 48px;
}

.section-title {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 16px;
  text-align: center;
}

/* ========= 按钮 ========= */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--accent);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  transition: 0.25s;
  box-shadow: var(--shadow);
  border: none;
  cursor: pointer;
}

.btn:hover {
  background: #fff5f9;
  transform: translateY(-2px);
  color: var(--accent);
}

/* Deprecated/Aliased classes - now just inheriting base .btn style */
/* .btn-light deprecated */

/* Hero-specific button: keeps positioning/animation but uses base colors */
.btn-hero {
  border: 1px solid rgba(255, 102, 163, 0.12);
  transition: background 180ms ease, transform 160ms ease, color 160ms ease;
}



/* push the hero button a little lower than default */
.hero .btn-hero {
  margin-top: 240px;
  /* 三倍间距：桌面 */
}

@media (max-width: 480px) {
  .hero .btn-hero {
    margin-top: 80px;
    /* 三倍间距：移动端 */
  }
}

/* ========= Hero button animation ========= */
@keyframes btnFloat {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

/* subtle floating animation to attract attention; pause on hover/focus */
.btn-hero {
  animation: btnFloat 4.5s ease-in-out infinite;
}

.btn-hero:hover,
.btn-hero:focus {
  animation-play-state: paused;
}

.btn-hero:active {
  transform: translateY(-1px) scale(0.99);
  transition: transform 120ms ease;
}

@media (prefers-reduced-motion: reduce) {
  .btn-hero {
    animation: none !important;
    transition: none !important;
  }

  .fade-in {
    animation: none !important;
    transform: none !important;
  }
}

/* When the hero button is also a fade-in element, play entrance then start floating */
.btn-hero.fade-in {
  animation: fadeIn 0.8s ease forwards, btnFloat 4.5s ease-in-out 0.95s infinite;
}

.btn-hero.fade-in:hover,
.btn-hero.fade-in:focus {
  animation-play-state: paused;
}

/* ========= 卡片 ========= */
.card {
  background: var(--bg-card);
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: 0.3s;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}

/* ========= 导航栏 ========= */
.navbar {
  width: 100%;
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.8);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 999;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.navbar .logo {
  font-size: 1.1rem;
  font-weight: 600;
}

/* 当 logo 是链接时，去掉下划线并保持与原来一致的字体/颜色 */
.navbar .logo {
  text-decoration: none;
  color: inherit;
  display: inline-block;
}

.navbar .logo:hover {
  text-decoration: none;
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 16px;
}

.nav-links a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  transition: color 0.25s;
}

.nav-links a:hover {
  color: var(--accent);
}

/* ========= 图片网格（相册页用） ========= */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.grid img {
  width: 100%;
  border-radius: var(--radius);
  object-fit: cover;
  box-shadow: var(--shadow);
  transition: 0.25s;
}

.grid img:hover {
  transform: scale(1.03);
}

/* ========= 相册页 (Album) ========= */
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 20px;
  /* increased spacing between images */
  margin-top: 18px;
}

.album-grid figure {
  margin: 0;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.album-grid figure:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.12);
}

.album-grid img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}

.album-grid figcaption {
  font-size: 0.85rem;
  color: #666;
  padding: 8px 10px;
  text-align: center;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  transition: opacity 260ms ease, visibility 0s linear 260ms;
  z-index: 2000;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

.lightbox .lb-stage {
  max-width: 92vw;
  max-height: 84vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  transition: opacity 0.3s ease, transform 0.3s ease;
  opacity: 1;
  transform: scale(1);
}

.lightbox img.fade-out {
  opacity: 0;
  transform: scale(0.96);
}

.lightbox .lb-caption {
  margin-top: 10px;
  color: #fff;
  text-align: center;
  font-size: 0.95rem;
}

.lightbox .lb-close,
.lightbox .lb-prev,
.lightbox .lb-next {
  position: absolute;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  font-size: 22px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.lightbox .lb-close {
  top: 18px;
  right: 18px;
}

.lightbox .lb-prev {
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox .lb-next {
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
}

@media (max-width: 640px) {
  .album-grid img {
    height: 110px;
  }

  .lightbox .lb-stage {
    max-height: 80vh;
  }
}

@media (prefers-reduced-motion: reduce) {

  .album-grid figure,
  .lightbox {
    transition: none !important;
  }
}

/* tree header: white text and lowered placement */
.tree-hero {
  text-align: center;
  color: #fff;
  padding-top: 128px;
  /* push header downward on desktop */
  padding-bottom: 20px;
}

.tree-hero .section-title,
.tree-hero p {
  color: #fff;
}

@media (max-width: 640px) {
  .tree-hero {
    padding-top: 72px;
  }
}

/* Use Elements/illu4.png as subtle background for the tree header */
.tree-hero {
  /* keep layout/spacing in the earlier rule; positioning and stacking handled here */
  position: relative;
  z-index: 3;
  overflow: visible;
}

/* Create a pseudo-element that covers the full viewport width and holds the header artwork.
   It's placed above the page overlay (body.hero-bg::before) but behind the header text. */
.tree-hero::before {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  width: 100vw;
  height: 100%;
  background-image: url('Elements/illu4.png');
  background-repeat: no-repeat;
  background-position: center top;
  background-size: 100% auto;
  /* 横向铺满，按宽度缩放 */
  opacity: 0;
  /* start transparent, animate to visible */
  animation: illuFade 1980ms cubic-bezier(.2, .9, .2, 1) 0.06s forwards;
  pointer-events: none;
  z-index: 1;
}

/* Ensure header text sits above the pseudo-element and page overlay */
.tree-hero>* {
  position: relative;
  z-index: 4;
}

/* Album header: white text and lowered placement */
.album-hero {
  text-align: center;
  color: #fff;
  padding-top: 120px;
  /* push header downward on desktop */
  padding-bottom: 20px;
}

.album-hero .section-title,
.album-hero p {
  color: #fff;
}

@media (max-width: 640px) {
  .album-hero {
    padding-top: 64px;
  }
}

/* Use Elements/illu2.png as subtle background for the album header */
.album-hero {
  /* keep layout/spacing in the earlier rule; positioning and stacking handled here */
  position: relative;
  z-index: 3;
  overflow: visible;
}

/* Create a pseudo-element that covers the full viewport width and holds the header artwork.
   It's placed above the page overlay (body.hero-bg::before) but behind the header text. */
.album-hero::before {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  width: 100vw;
  height: 100%;
  background-image: url('Elements/illu2.png');
  background-repeat: no-repeat;
  background-position: center top;
  background-size: 100% auto;
  /* 横向铺满，按宽度缩放 */
  opacity: 0;
  /* start transparent, animate to visible */
  animation: illuFade 1980ms cubic-bezier(.2, .9, .2, 1) 0.06s forwards;
  pointer-events: none;
  z-index: 1;
}

/* Ensure header text sits above the pseudo-element and page overlay */
.album-hero>* {
  position: relative;
  z-index: 4;
}

/* ========= 时间轴（纪念册） ========= */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-left: 8px;
  border-left: 3px solid #ffc0d6;
  /* 容器保持可见；单个项由各自的 .visible 控制 */
  opacity: 1;
  transform: none;
}

/* 确保整个时间轴容器位于页面遮罩之上 */
#timeline {
  position: relative;
  z-index: 2;
}

#timeline {
  padding-bottom: 48px;
  /* 增加底部内边距让容器更长 */
}

/* 标题下移，给时间轴上方留出空间 */
#timeline .section-title {
  margin-top: 36px;
  margin-bottom: 18px;
  color: #ffffff;
  text-shadow: none;
  position: relative;
  z-index: 3;
}

.timeline-item {
  position: relative;
  padding-left: 16px;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 520ms cubic-bezier(.2, .9, .2, 1), transform 520ms cubic-bezier(.2, .9, .2, 1);
}

/* 单个时间轴项进入视口时添加 .visible 显示（类似 Apple 的平滑上浮效果） */
.timeline-item.visible {
  opacity: 1;
  transform: none;
}

.timeline-item::before {
  content: "";
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  position: absolute;
  left: -6px;
  top: 4px;
}

/* ========= 翻页书样式（Memory Page Flip） ========= */
.book {
  perspective: 1800px;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  position: relative;
  height: auto;
}

.book-stage {
  position: relative;
  width: 100%;
  /* 使用视口高度以更灵活地撑满页面：增高翻页区以占据更多纵向空间 */
  min-height: 85vh;
  transform-style: preserve-3d;
}

@media (max-width: 900px) {
  .book-stage {
    min-height: 78vh;
  }
}

@media (max-width: 600px) {
  .book-stage {
    min-height: 70vh;
  }
}

.page {
  position: absolute;
  inset: 0;
  width: 100%;
  /* Frosted glass effect (Apple-like) */
  background: rgba(255, 255, 255, 0.36);
  border: 1px solid rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  backdrop-filter: blur(10px) saturate(120%);
  /* subtle noise/film overlay for tactile feel */
  background-image: linear-gradient(rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.02));
  border-radius: 12px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transform-origin: left center;
  backface-visibility: hidden;
  transform: rotateY(180deg);
  transition: transform 700ms cubic-bezier(.2, .9, .2, 1), box-shadow 300ms ease;
  padding: 28px;
  /* Ensure each page fills the book-stage vertically */
  min-height: 100%;
  box-sizing: border-box;
  color: #111;
  overflow: hidden;
}

.page.front {
  transform: rotateY(0deg);
}

.page.flipped {
  transform: rotateY(-180deg);
}

.page .page-meta {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 8px;
}

.page h3 {
  margin-top: 0;
}

.book-controls {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.book-controls button {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.06);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06);
}

.book-controls button:disabled {
  opacity: 0.45;
  cursor: default;
}

/* Back side visual: slightly inset content when page is flipped */
.page::before,
.page::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 36px;
  pointer-events: none;
  z-index: 6;
  border-radius: 0 10px 10px 0;
}

.page::after {
  right: 0;
  /* frosted edge highlight */
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.25) 18%, rgba(255, 255, 255, 0.06) 36%, rgba(0, 0, 0, 0) 100%);
  mix-blend-mode: screen;
  opacity: 0.95;
}

.page::before {
  left: 0;
  /* subtle inner tint at the binding for depth */
  background: linear-gradient(270deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.04) 20%, rgba(0, 0, 0, 0) 60%);
  border-radius: 10px 0 0 10px;
  opacity: 0.6;
}


/* reduce effect on small screens */
@media (max-width: 480px) {

  .page::before,
  .page::after {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {

  .page,
  .page.flipped,
  .page.front {
    transition: none !important;
    transform: none !important;
  }
}

/* ========= 小树苗（成长页） ========= */
.tree-box {
  text-align: center;
  padding: 30px;
  /* place above the page overlay and use frosted-glass styling like the book pages */
  position: relative;
  z-index: 3;
  background: rgba(255, 255, 255, 0.36);
  border: 1px solid rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  backdrop-filter: blur(10px) saturate(120%);
  border-radius: 12px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}






/* Tree-page: remove button black borders and default outline, keep an accessible focus ring */
.tree-box .btn,
.tree-box .btn-light {
  border: none;
  outline: none;
}

.tree-box .btn:focus,
.tree-box .btn-light:focus {
  outline: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08), 0 0 0 4px rgba(86, 193, 120, 0.12);
}

/* Prevent the tree card from lifting on hover/active/focus (it should not behave like a button) */
.tree-box.card:hover,
.tree-box.card:active,
.tree-box.card:focus {
  transform: none !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.tree-img {
  width: 120px;
  transition: 0.4s ease;
}

.tree-img.grow {
  transform: scale(1.15);
}

/* ========= 留言板样式 (Message board) ========= */
.message-board {
  margin-top: 24px;
  padding: 18px;
  border-radius: 12px;
  /* frosted glass like the pages */
  background: rgba(255, 255, 255, 0.36);
  border: 1px solid rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  backdrop-filter: blur(10px) saturate(120%);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
  position: relative;
}

.message-board h3 {
  margin-top: 0;
  margin-bottom: 8px;
}

.mb-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mb-form .row {
  display: flex;
  gap: 8px;
}

.mb-form input[type="text"] {
  flex: 0 0 160px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.mb-form textarea {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  min-height: 72px;
  resize: vertical;
}

.mb-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 6px;
}

.mb-list {
  list-style: none;
  margin: 12px 0 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mb-item {
  padding: 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.04);
}

.mb-meta {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.mb-text {
  white-space: pre-wrap;
  color: #111;
}

.mb-delete {
  background: transparent;
  border: none;
  color: #c33;
  cursor: pointer;
  font-size: 0.95rem;
}

/* Remove black border from message-board buttons and make focus ring accessible */
.message-board .btn,
.message-board .btn-light {
  border: none;
  outline: none;
}

.message-board .btn:focus,
.message-board .btn-light:focus {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08), 0 0 0 4px rgba(86, 193, 120, 0.12);
}

/* Hide single-item delete by default; reveal when message-board has admin class */
.message-board .mb-delete {
  display: none;
}

.message-board.admin .mb-delete {
  display: inline-block;
}

/* Admin controls container (login/logout/delete all) */
.mb-admin {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 8px;
}

.admin-toggle {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  opacity: 0.5;
}

.admin-toggle:hover {
  opacity: 0.95;
  background: rgba(255, 255, 255, 0.12);
}

.message-board.admin .admin-toggle {
  background: rgba(86, 193, 120, 0.12);
  color: #2b6a36;
  opacity: 1;
}

/* reveal admin-controls container when admin */
.message-board .admin-controls {
  display: none;
  position: absolute;
  right: 56px;
  top: 10px;
  gap: 8px;
}

.message-board.admin .admin-controls {
  display: flex;
}

/* Prevent message-board card from lifting on hover/active/focus */
.message-board.card:hover,
.message-board.card:active,
.message-board.card:focus {
  transform: none !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.mb-admin .admin-note {
  color: #666;
  font-size: 0.9rem;
  margin-right: auto;
}

@media (max-width:640px) {
  .mb-form input[type="text"] {
    flex: 1;
  }
}

/* ========= 轻动画 ========= */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeIn 0.8s ease forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Illu2 subtle fade-in (opacity-only so position isn't changed) */
@keyframes illuFade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .album-hero::before {
    animation: none !important;
    opacity: 1 !important;
  }
}

/* ========= 雪花效果 ========= */
.snow-container {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--navbar-height);
  height: calc(100vh - var(--navbar-height));
  pointer-events: none;
  overflow: hidden;
  z-index: 60;
}

.snowflake {
  position: absolute;
  top: -10vh;
  left: 0;
  color: #ffffff;
  opacity: 0.95;
  will-change: transform, opacity;
  font-family: serif;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  /* per-element CSS variables (set by JS):
     --left: 10%; --size: 14px; --duration: 8s; --delay: 0s; --sway: 30px; */
  left: var(--left, 50%);
  font-size: var(--size, 14px);
  animation: fall var(--duration, 8s) linear var(--delay, 0s) infinite;
}

@keyframes fall {
  from {
    transform: translateX(0) translateY(-10vh) rotate(0deg);
    opacity: 0.9;
  }

  to {
    transform: translateX(var(--sway, 30px)) translateY(110vh) rotate(360deg);
    opacity: 0.95;
  }
}

/* Accessibility: 不要在偏好减少动画的用户上播放雪花 */
@media (prefers-reduced-motion: reduce) {
  .snow-container {
    display: none !important;
  }
}