/* 粒子效果CSS文件 - 统一版 */
/* 所有页面使用相同的粒子效果，通过参数调整 */

:root {
  /* 蓝紫色系颜色定义 */
  --particle-blue: rgba(71, 118, 230, 0.8); /* 深蓝色 */
  --particle-purple: rgba(110, 72, 170, 0.8); /* 深紫色 */
  --particle-blue-purple: rgba(90, 95, 210, 0.8); /* 蓝紫色过渡 */
}

/* 粒子容器 */
#particles-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

/* 粒子样式 */
.particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  will-change: transform, opacity;
}

/* 粒子漂浮动画 */
@keyframes particleFloat {
  0% {
    transform: translateY(100vh) translateX(var(--start-x)) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.9;
  }
  90% {
    opacity: 0.9;
  }
  100% {
    transform: translateY(-100px)
      translateX(calc(var(--start-x) + var(--x-movement))) rotate(360deg);
    opacity: 0;
  }
}

/* 彩带动画效果 */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 20px;
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 50%,
    var(--accent-color) 100%
  );
  top: -20px;
  opacity: 0;
  border-radius: 4px;
  animation: confetti-fall 3s ease-in-out forwards;
}

.confetti:nth-child(2n) {
  background: linear-gradient(
    135deg,
    var(--success-color) 0%,
    #27ae60 50%,
    #2ecc71 100%
  );
  width: 12px;
  height: 15px;
}

.confetti:nth-child(3n) {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 50%, #d35400 100%);
  width: 8px;
  height: 18px;
}

.confetti:nth-child(5n) {
  background: linear-gradient(135deg, #f1c40f 0%, #f39c12 50%, #e67e22 100%);
  width: 14px;
  height: 12px;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(0) rotate(0deg) scale(0.3);
    opacity: 0;
  }
  10% {
    opacity: 1;
    transform: translateY(0) rotate(180deg) scale(1);
  }
  100% {
    transform: translateY(100vh) rotate(720deg) scale(0.5);
    opacity: 0;
  }
}

/* 庆祝文字动画 */
/* 确保弹窗的opacity动画正常工作 */
body .celebration-popup {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 99999 !important;
  animation: celebration-popup-animation 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards !important;
  pointer-events: none !important;
  opacity: 1 !important; /* 确保初始不透明 */
}

/* 确保弹窗内容继承opacity */
body .celebration-popup .celebration-content,
body .celebration-popup .celebration-icon,
body .celebration-popup .celebration-text {
  opacity: inherit !important; /* 继承父元素的opacity */
}
/* 庆祝消息框 */
.celebration-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(
    135deg,
    rgba(46, 204, 113, 0.95),
    rgba(39, 174, 96, 0.95)
  );
  padding: 30px 50px;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 60px rgba(46, 204, 113, 0.5);
  color: white;
  font-size: 28px;
  font-weight: bold;
  text-align: center;
  z-index: 10000;
  border: 3px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
  animation: message-pop 0.5s ease-out forwards;
}

@keyframes message-pop {
  0% {
    transform: translate(-50%, -50%) scale(0.3);
    opacity: 0;
  }
  70% {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

.celebration-message::before {
  content: "🎉";
  font-size: 40px;
  display: block;
  margin-bottom: 15px;
  animation: celebration-icon 2s ease-in-out infinite;
}

@keyframes celebration-icon {
  0%,
  100% {
    transform: scale(1) rotate(0deg);
  }
  25% {
    transform: scale(1.2) rotate(-10deg);
  }
  50% {
    transform: scale(1.2) rotate(10deg);
  }
  75% {
    transform: scale(1) rotate(0deg);
  }
}

/* ============ 庆祝弹窗样式 ============ */
body .celebration-popup {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 99999 !important;
  animation: celebration-popup-animation 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards !important;
  pointer-events: none !important;
}

body .celebration-popup .celebration-content {
  background: linear-gradient(135deg, 
    rgba(46, 204, 113, 0.95),  /* 深绿色 */
    rgba(39, 174, 96, 0.95),   /* 中绿色 */
    rgba(255, 255, 255, 0.15)  /* 增加白色透明层 */) !important;
  padding: 30px 40px !important;
  border-radius: 25px !important;
  box-shadow: 
    0 25px 50px rgba(0, 0, 0, 0.5),
    0 0 80px rgba(46, 204, 113, 0.6),
    0 0 120px rgba(52, 152, 219, 0.4) !important;
  color: #ffffff !important;  /* 纯白色文字 */
  font-weight: bold !important;
  text-align: center !important;
  border: 3px solid rgba(255, 255, 255, 0.6) !important; /* 更白的边框 */
  backdrop-filter: blur(15px) !important;
  transform-origin: center !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 350px !important;
  position: relative !important;
}

/* 在背景上添加白色渐变，让文字更清晰 */
body .celebration-popup .celebration-content::before {
  content: '';
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.05) 50%,
    rgba(255, 255, 255, 0.1) 100%
  ) !important;
  border-radius: 22px !important;
  pointer-events: none !important;
  z-index: 1 !important;
}

body .celebration-popup .celebration-icon {
  font-size: 80px !important; /* 增大图标 */
  margin-bottom: 70px !important; /*图标和文字的间距*/
  display: block !important;
  transform-origin: center !important;
  line-height: 1 !important;
  position: relative !important;
  z-index: 2 !important; /* 确保在背景之上 */
  
  /* 礼炮动画效果 - 放在字符上面 */
  animation: 
    celebration-icon-animation 1.5s ease-in-out infinite alternate,
    celebration-icon-rotate 2s ease-in-out infinite !important;
  
  /* 添加发光效果 */
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.8)) 
          drop-shadow(0 0 20px rgba(255, 215, 0, 0.6)) 
          drop-shadow(0 0 30px rgba(255, 165, 0, 0.4));
}

body .celebration-popup .celebration-text {
  font-size: 28px !important; /* 增大字体 */
  font-weight: 800 !important; /* 更粗的字体 */
  letter-spacing: 2px !important; /* 增加字间距 */
  line-height: 1.2 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 100% !important;
  margin-top: 5px !important;
  position: relative !important;
  z-index: 2 !important; /* 确保在背景之上 */
  
  /* 文字颜色和效果 */
  color: #ffffff !important;
  text-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.5), /* 深色阴影增加可读性 */
    0 0 10px rgba(255, 255, 255, 0.8), /* 白色发光 */
    0 0 20px rgba(46, 204, 113, 0.6), /* 绿色发光 */
    0 0 30px rgba(46, 204, 113, 0.3) !important;
  
  /* 文字边框效果 */
  -webkit-text-stroke: 1px rgba(0, 0, 0, 0.3);
}

/* 礼炮图标的主动画 - 上下跳动和缩放 */
@keyframes celebration-icon-animation {
  0% {
    transform: translateY(0) scale(1) rotate(0deg);
  }
  25% {
    transform: translateY(-15px) scale(1.2) rotate(-10deg);
  }
  50% {
    transform: translateY(0) scale(1.3) rotate(0deg);
  }
  75% {
    transform: translateY(-10px) scale(1.1) rotate(10deg);
  }
  100% {
    transform: translateY(0) scale(1.2) rotate(0deg);
  }
}

/* 礼炮图标的旋转动画 */
@keyframes celebration-icon-rotate {
  0% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-15deg);
  }
  50% {
    transform: rotate(0deg);
  }
  75% {
    transform: rotate(15deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

@keyframes celebration-popup-animation {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.1) rotate(-30deg) !important;
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2) rotate(5deg) !important;
  }
  70% {
    transform: translate(-50%, -50%) scale(1.1) rotate(-2deg) !important;
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg) !important;
  }
}

/* 响应式调整 */
@media (max-width: 768px) {
  body .celebration-popup .celebration-content {
    padding: 20px 25px !important;
    min-width: 280px !important;
    max-width: 90% !important;
  }
  
  body .celebration-popup .celebration-icon {
    font-size: 60px !important;
  }
  
  body .celebration-popup .celebration-text {
    font-size: 22px !important;
    letter-spacing: 1px !important;
  }
}

/* 非常小的屏幕 */
@media (max-width: 480px) {
  body .celebration-popup .celebration-content {
    min-width: 250px !important;
    padding: 15px 20px !important;
  }
  
  body .celebration-popup .celebration-icon {
    font-size: 50px !important;
    margin-bottom: 15px !important;
  }
  
  body .celebration-popup .celebration-text {
    font-size: 18px !important;
  }
}
