/* 动画效果样式 */
@charset "utf-8";

/* ==================== 雪花飘落动画 ==================== */
.snowflake {
  position: absolute;
  background: #fff;
  border-radius: 50%;
  opacity: 0.8;
  pointer-events: none;
  animation: snowfall linear infinite;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
}

@keyframes snowfall {
  0% {
    transform: translateY(-100px) translateX(0) rotate(0deg);
    opacity: 0.8;
  }
  50% {
    transform: translateY(calc(50vh + 100px)) translateX(20px) rotate(180deg);
    opacity: 0.6;
  }
  100% {
    transform: translateY(calc(100vh + 200px)) translateX(-20px) rotate(360deg);
    opacity: 0;
  }
}

/* ==================== 热气上升动画 ==================== */
.steam {
  position: absolute;
  background: linear-gradient(
    to top,
    rgba(255, 255, 255, 0.8) 0%,
    rgba(255, 255, 255, 0.4) 50%,
    transparent 100%
  );
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  pointer-events: none;
  animation: steamRise ease-in-out infinite;
  filter: blur(2px);
}

@keyframes steamRise {
  0% {
    transform: translateY(0) translateX(0) scale(1);
    opacity: 0.6;
  }
  50% {
    transform: translateY(-200px) translateX(10px) scale(1.2);
    opacity: 0.4;
  }
  100% {
    transform: translateY(-400px) translateX(-10px) scale(1.5);
    opacity: 0;
  }
}

/* ==================== 响应式动画调整 ==================== */
@media screen and (max-width: 768px) {
  .snowflake {
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.6);
  }

  @keyframes snowfall {
    0% {
      transform: translateY(-100px) translateX(0) rotate(0deg);
      opacity: 0.6;
    }
    50% {
      transform: translateY(calc(50vh + 50px)) translateX(15px) rotate(180deg);
      opacity: 0.4;
    }
    100% {
      transform: translateY(calc(100vh + 150px)) translateX(-15px)
        rotate(360deg);
      opacity: 0;
    }
  }

  .steam {
    width: 15px !important;
    height: 22px !important;
  }

  @keyframes steamRise {
    0% {
      transform: translateY(0) translateX(0) scale(1);
      opacity: 0.5;
    }
    50% {
      transform: translateY(-60px) translateX(5px) scale(1.1);
      opacity: 0.3;
    }
    100% {
      transform: translateY(-120px) translateX(-5px) scale(1.3);
      opacity: 0;
    }
  }
}

/* ==================== 头区文案入场动画 ==================== */
.header-title,
.header-subtitle {
  animation: textRevealCenter 1s ease-out forwards;
  opacity: 0;
  transform-origin: center;
  display: inline-block;
}

.header-title {
  animation-delay: 0.3s;
}

.header-subtitle {
  animation-delay: 0.6s;
}

@keyframes textRevealCenter {
  0% {
    opacity: 0;
    clip-path: inset(0 50% 0 50%);
  }
  50% {
    opacity: 0.7;
  }
  100% {
    opacity: 1;
    clip-path: inset(0 0% 0 0%);
  }
}

/* ==================== 内容区滚动入场动画 ==================== */
.section {
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity 0.8s ease-out,
    transform 0.8s ease-out;
}

.section.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.section-title {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.6s ease-out,
    transform 0.6s ease-out;
}

.section-title.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.intro-content {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.8s ease-out 0.2s,
    transform 0.8s ease-out 0.2s;
}

.intro-content.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.food-carousel {
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity 0.8s ease-out 0.3s,
    transform 0.8s ease-out 0.3s;
}

.food-carousel.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.food-grid {
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity 0.8s ease-out 0.2s,
    transform 0.8s ease-out 0.2s;
}

.food-grid.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.food-item {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.6s ease-out,
    transform 0.6s ease-out;
}

.food-item.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* 为每个 food-item 添加不同的延迟，实现依次出现 */
.food-grid.animate-in .food-item:nth-child(1) {
  transition-delay: 0.1s;
}

.food-grid.animate-in .food-item:nth-child(2) {
  transition-delay: 0.2s;
}

.food-grid.animate-in .food-item:nth-child(3) {
  transition-delay: 0.3s;
}

.food-grid.animate-in .food-item:nth-child(4) {
  transition-delay: 0.4s;
}

.food-grid.animate-in .food-item:nth-child(5) {
  transition-delay: 0.5s;
}

.food-grid.animate-in .food-item:nth-child(6) {
  transition-delay: 0.6s;
}

/* ==================== 减少动画（无障碍） ==================== */
@media (prefers-reduced-motion: reduce) {
  .snowflake,
  .steam {
    animation: none;
    opacity: 0.3;
  }

  .header-title,
  .header-subtitle {
    animation: none;
    opacity: 1;
    clip-path: none;
    transform: none;
  }

  .section,
  .section-title,
  .intro-content,
  .food-carousel,
  .food-grid,
  .food-item {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
