/* Base Reset */
:root {
  --bg-color: #f9f9f9;
  --text-color: #333;
  --accent-color: #e0a96d;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  min-height: 100vh;
}

/* Main Content Area */
.main-content {
  flex: 1;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Floating Actions (Like & Views) */
.floating-actions {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 1000;
}

.action-btn {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  padding: 12px 20px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  font-family: inherit;
  font-weight: 500;
}

.action-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.action-btn.disbled {
  cursor: default;
}

.heart-icon {
  color: #ff4757;
  font-size: 1.2rem;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.action-btn:active .heart-icon {
  transform: scale(1.3);
}

.view-icon {
  color: #5352ed;
  font-size: 1.2rem;
}

/* Common Theme Container */
.theme-container {
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  animation: fadeIn 1s ease-in-out;
}

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

/* ==================================
   DYNAMIC EFFECTS & ANIMATIONS
   ================================== */
   
/* Scroll Reveal Classes */
.reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: all 1s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left { transform: translateX(-50px); transition: all 1s ease-out; opacity: 0; }
.reveal-left.active { transform: translateX(0); opacity: 1; }

.reveal-right { transform: translateX(50px); transition: all 1s ease-out; opacity: 0; }
.reveal-right.active { transform: translateX(0); opacity: 1; }

.reveal-zoom { transform: scale(0.8); transition: all 1s ease-out; opacity: 0; }
.reveal-zoom.active { transform: scale(1); opacity: 1; }

/* 3D Image Float effect */
.hover-float {
  transition: transform 0.4s ease-out;
}
.hover-float:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

/* Base Particle (Cherry Petals, Stars) */
.particle {
  position: fixed;
  top: -10%;
  pointer-events: none;
  z-index: 50;
}

/* CSS 花瓣形状粒子 */
.particle-petal {
  position: fixed;
  top: -5%;
  pointer-events: none;
  z-index: 50;
  border-radius: 80% 0 55% 50% / 55% 0 80% 50%;
  transform-origin: center center;
}

/* CSS 叶子形状粒子 */
.particle-leaf {
  position: fixed;
  top: -5%;
  pointer-events: none;
  z-index: 50;
  border-radius: 5% 50% 50% 50%;
  transform-origin: 70% 70%;
}

/* 花瓣飘落动画 — 左摇右摆 */
@keyframes petalFall1 {
  0%   { transform: translateY(-5vh) rotate(0deg) translateX(0); opacity: 0; }
  8%   { opacity: 1; }
  25%  { transform: translateY(25vh) rotate(70deg) translateX(30px); }
  50%  { transform: translateY(50vh) rotate(150deg) translateX(-20px); }
  75%  { transform: translateY(75vh) rotate(240deg) translateX(25px); }
  92%  { opacity: 1; }
  100% { transform: translateY(110vh) rotate(360deg) translateX(-10px); opacity: 0; }
}

/* 花瓣飘落动画 — 大弧线飘移 */
@keyframes petalFall2 {
  0%   { transform: translateY(-5vh) rotate(0deg) translateX(0); opacity: 0; }
  10%  { opacity: 1; }
  30%  { transform: translateY(30vh) rotate(-50deg) translateX(-40px); }
  60%  { transform: translateY(60vh) rotate(100deg) translateX(35px); }
  90%  { opacity: 0.8; }
  100% { transform: translateY(110vh) rotate(200deg) translateX(-15px); opacity: 0; }
}

/* 花瓣飘落动画 — 轻柔下降 */
@keyframes petalFall3 {
  0%   { transform: translateY(-5vh) rotate(0deg) translateX(0); opacity: 0; }
  12%  { opacity: 1; }
  35%  { transform: translateY(35vh) rotate(60deg) translateX(15px); }
  65%  { transform: translateY(65vh) rotate(-30deg) translateX(-30px); }
  88%  { opacity: 0.7; }
  100% { transform: translateY(110vh) rotate(90deg) translateX(20px); opacity: 0; }
}

/* 叶子飘落动画 — 缓慢翻转 */
@keyframes leafFall1 {
  0%   { transform: translateY(-5vh) rotateX(0) rotateZ(0) translateX(0); opacity: 0; }
  8%   { opacity: 0.9; }
  30%  { transform: translateY(30vh) rotateX(60deg) rotateZ(40deg) translateX(20px); }
  55%  { transform: translateY(55vh) rotateX(120deg) rotateZ(-20deg) translateX(-30px); }
  80%  { transform: translateY(80vh) rotateX(200deg) rotateZ(30deg) translateX(15px); }
  94%  { opacity: 0.6; }
  100% { transform: translateY(110vh) rotateX(280deg) rotateZ(-10deg) translateX(-10px); opacity: 0; }
}

/* 叶子飘落动画 — 旋转飘落 */
@keyframes leafFall2 {
  0%   { transform: translateY(-5vh) rotateZ(0) translateX(0); opacity: 0; }
  10%  { opacity: 0.85; }
  25%  { transform: translateY(25vh) rotateZ(-60deg) translateX(-35px); }
  50%  { transform: translateY(50vh) rotateZ(45deg) translateX(25px); }
  75%  { transform: translateY(75vh) rotateZ(-30deg) translateX(-20px); }
  92%  { opacity: 0.5; }
  100% { transform: translateY(110vh) rotateZ(70deg) translateX(10px); opacity: 0; }
}

/* 叶子飘落动画 — 优雅慢摆 */
@keyframes leafFall3 {
  0%   { transform: translateY(-5vh) rotate(0deg) translateX(0) scale(1); opacity: 0; }
  10%  { opacity: 0.8; }
  40%  { transform: translateY(40vh) rotate(50deg) translateX(30px) scale(0.95); }
  70%  { transform: translateY(70vh) rotate(-40deg) translateX(-25px) scale(0.9); }
  90%  { opacity: 0.4; }
  100% { transform: translateY(110vh) rotate(20deg) translateX(10px) scale(0.85); opacity: 0; }
}

/* ============================================================
   Swiper 相册通用样式
   ============================================================ */
.wedding-swiper {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
}
/* 每张内容居中，背景色由各风格覆盖 */
.wedding-swiper .swiper-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 560px;
  background: #111;
  background-size: cover;
  background-position: center;
  overflow: hidden;
  position: relative;
}
/* 模糊背景层：用同一张图模糊填充空白区域 */
.wedding-swiper .swiper-slide::before {
  content: '';
  position: absolute;
  inset: -20px;
  background: inherit;
  background-size: cover;
  background-position: center;
  filter: blur(25px) brightness(0.4);
  z-index: 0;
}
/* 图片完整展示，不裁剪 */
.wedding-swiper .swiper-slide img {
  position: relative;
  z-index: 1;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
/* Ken Burns 动态缩放：活跃幻灯片图片缓慢平移缩放 */
.wedding-swiper .swiper-slide-active img {
  animation: kenBurns 8s ease-in-out infinite alternate;
}
@keyframes kenBurns {
  0%   { transform: scale(1) translate(0, 0); }
  100% { transform: scale(1.06) translate(-1%, -0.5%); }
}
/* 3D 特效辅助：保证 creative/cube/flip 的透视效果 */
.wedding-swiper {
  perspective: 1200px;
}
.wedding-swiper .swiper-slide {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.wedding-swiper .swiper-button-next,
.wedding-swiper .swiper-button-prev {
  color: #fff;
  background: rgba(0,0,0,0.35);
  width: 40px;
  height: 40px;
  border-radius: 50%;
}
.wedding-swiper .swiper-button-next::after,
.wedding-swiper .swiper-button-prev::after {
  font-size: 14px;
  font-weight: 700;
}
.wedding-swiper .swiper-pagination-bullet-active {
  background: #c41e3a;
}
@media (max-width: 768px) {
  .wedding-swiper .swiper-slide { height: 320px; }
}

/* ============================================================
   地图通用样式
   ============================================================ */
.map-section {
  padding: 4rem 2rem;
  text-align: center;
}
#weddingMap {
  height: 400px;
  width: 100%;
  max-width: 1000px;
  margin: 1.5rem auto 0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  z-index: 1;
}
@media (max-width: 768px) {
  #weddingMap { height: 280px; }
}

/* ============================================================
   弹幕系统
   ============================================================ */
.gallery-with-danmaku {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

#danmakuContainer {
  position: absolute;
  top: 10px;
  bottom: 60px;    /* 留出分页点空间 */
  left: 0;
  right: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 10;
}

.danmaku-item {
  position: absolute;
  left: 100%;                          /* 从容器右边进入 */
  white-space: nowrap;
  font-size: 0.88rem;
  padding: 0.25rem 0.8rem;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.38);
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  animation: danmakuFly linear forwards;
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: inherit;
}

@keyframes danmakuFly {
  from { transform: translateX(0); }
  to   { transform: translateX(-300vw); }
}

.attend-badge {
  font-size: 0.75rem;
  background: #c41e3a;
  color: #fff;
  padding: 1px 5px;
  border-radius: 10px;
  margin-left: 3px;
}
.attend-tag {
  font-size: 0.75rem;
  background: #4caf50;
  color: #fff;
  padding: 1px 5px;
  border-radius: 10px;
  margin-left: 4px;
}
.blessing-empty {
  color: #999;
  text-align: center;
  padding: 2rem;
}

/* ============================================================
   农历日期样式
   ============================================================ */
.lunar-date {
  display: block;
  font-size: 0.85em;
  opacity: 0.85;
  margin-top: 0.4rem;
  letter-spacing: 0.1rem;
}

/* ============================================================
   背景音乐播放器
   ============================================================ */
.music-player {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  z-index: 1100;
}
.music-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: rgba(196, 30, 58, 0.9);
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(196, 30, 58, 0.4);
  transition: transform 0.3s, background 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.music-btn:hover   { transform: scale(1.1); }
.music-btn.playing { background: #4caf50; box-shadow: 0 4px 15px rgba(76,175,80,0.4); animation: musicPulse 1.5s ease-in-out infinite; }
@keyframes musicPulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.12); }
}

/* ============================================================
   Toast 提示
   ============================================================ */
.toast-msg {
  position: fixed;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(0,0,0,0.8);
  color: #fff;
  padding: 0.8rem 2rem;
  border-radius: 30px;
  font-size: 1rem;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 9999;
  pointer-events: none;
}
.toast-msg.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
   移动端响应式布局
   ============================================================ */
@media (max-width: 768px) {
  .floating-actions {
    bottom: 1.2rem;
    right: 1rem;
    gap: 0.6rem;
  }
  .action-btn {
    padding: 8px 14px;
    font-size: 0.85rem;
    border-radius: 24px;
  }
  .music-player {
    bottom: 1.2rem;
    left: 1rem;
  }
  .music-btn {
    width: 42px;
    height: 42px;
    font-size: 1.2rem;
  }
  #weddingMap {
    height: 250px;
  }
}
