/* 1. 閃光效果 S (Light/Flash Effect) */
.light {
  width: 100%;
  text-align: center;
  overflow: hidden; /* 保持 overflow: hidden 來隱藏移動到外部的閃光 */
  display: block;
  position: relative;
}

.light:after {
  content: "";
  display: block;
  position: absolute;
  left: 0;
  top: 0;
  width: 50%;
  height: 100%;
  background: -webkit-linear-gradient(
    left,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.7) 100% /* 稍微調亮顏色以便觀察 */
  );
  background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.7) 100%);
  animation: light-transform 3s infinite ease-in-out;
}

/* 將 keyframes 的 left 改為 transform */
@keyframes light-transform {
  0% {
    /* 結合 skewX 和 translateX */
    transform: skewX(-25deg) translateX(-300%);
  }
  70% {
    transform: skewX(-25deg) translateX(300%);
  }
  100% {
    transform: skewX(-25deg) translateX(300%);
  }
}
/* 閃光效果 E */

/* 2. 果凍跳動效果 S (Bouncing/Jelly Effect) */
.ani-bounce {
  animation: bounce 2s infinite ease-in-out;
}
@keyframes bounce {
  0% {
    transform: scale(1, 1) translate3d(0, 0, 0);
  }
  10% {
    transform: scale(1.05, 0.95) translate3d(0, 0, 0);
  }
  30% {
    transform: scale(0.95, 1.05) translate3d(0, -8%, 0);
  }
  50% {
    transform: scale(1.02, 0.97) translate3d(0, 0, 0);
  }
  57% {
    transform: scale(1, 1) translate3d(0, -2%, 0);
  }
  64% {
    transform: scale(1, 1) translate3d(0, 0, 0);
  }
  100% {
    transform: scale(1, 1) translate3d(0, 0, 0);
  }
}
/* 果凍跳動效果 E */

/* 3. 縮放效果 S (Scaling Effect) */
.ani-scale {
  animation: scale 1s infinite ease-in-out;
}
.ani-scale_2 {
  animation: scale 1s infinite ease-in-out;
  animation-delay: 0.5s;
}
.ani-scale_3 {
  animation: scale 1s infinite ease-in-out;
  animation-delay: 0.7s;

}
@keyframes scale {
  0% {
    transform: scale(1, 1);
  }
  50% {
    transform: scale(1.1, 1.1);
  }
  100% {
    transform: scale(1, 1);
  }
}
/* 縮放效果 E */

/* 4. 浮動效果 S (Floating Effect) */
.ani-float-horizontal {
  animation: float-horizontal 1.5s ease-in-out infinite;
}
.ani-float-vertical {
  animation: float-vertical 1.5s ease-in-out infinite;
}
.ani-float-vertical-2 {
  animation: float-vertical 1.5s ease-in-out infinite;
  animation-delay: 0.3s;
}
.ani-float-vertical-3 {
  animation: float-vertical 1.5s ease-in-out infinite;
  animation-delay: 0.7s;
}
@keyframes float-horizontal {
  0% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(20px);
  }
  100% {
    transform: translateX(0);
  }
}
@keyframes float-vertical {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
  100% {
    transform: translateY(0);
  }
}
/* 浮動效果 E */
/* 揭示 */
.ani-grow-up {
  animation: grow-up 2s infinite ease-in-out;
  clip-path: polygon(0% 100%, 100% 100%, 100% 100%, 0% 100%);
}
.ani-grow-down {
  animation: grow-down 2s infinite ease-in-out;
  clip-path: polygon(0% 0%, 100% 0%, 100% 0%, 0% 0%);
}
.ani-grow-right {
  animation: grow-right 2s infinite ease-in-out;
  clip-path: polygon(0% 100%, 100% 100%, 100% 100%, 0% 100%);
}
@keyframes grow-right {
  0% {
    clip-path: polygon(0% 0%, 0% 0%, 0% 100%, 0% 100%);
  }
  100% {
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
  }
}
@keyframes grow-up {
  0% {
    clip-path: polygon(0% 100%, 100% 100%, 100% 100%, 0% 100%);
  }
  100% {
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
  }
}

@keyframes grow-down {
  0% {
    clip-path: polygon(0% 0%, 100% 0%, 100% 0%, 0% 0%);
  }
  100% {
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
  }
}
/* ===== 閃爍 (.ani-twinkle) ===== */
.ani-twinkle {
  animation: twinkle 1.5s infinite ease-in-out;
}
@keyframes twinkle {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}
/* ===== 鐘擺搖晃 (.ani-swing) ===== */
.ani-swing {
  animation: swing 2s ease-in-out infinite;
  transform-origin: top center;
}
.ani-swing-lamp {
    animation: swing 2.5s ease-in-out infinite;
    transform-origin: 80px 0;
}
.ani-swing-lamp-minor {
    animation: swing-minor 2.5s ease-in-out infinite;
    transform-origin: 70px 0;
}
.ani-swing-lamp-minor_B {
    animation: swing-minor 2.5s ease-in-out infinite;
    transform-origin: 210px 0;
    animation-delay: 1.2s;
}
@keyframes swing {
  0%,
  100% {
    transform: rotate3d(0, 0, 1, 15deg);
  }
  50% {
    transform: rotate3d(0, 0, 1, -15deg);
  }
}
@keyframes swing-minor {
  0%,
  100% {
    transform: rotate3d(0, 0, 1, 5deg);
  }
  50% {
    transform: rotate3d(0, 0, 1, -5deg);
  }
}
.BeAf_container {
  position: relative;
  width: 100%;
  height: 370px;
  overflow: hidden;
}

.BeAf_image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.BeAf_top {
  animation: revealClip 2s infinite alternate ease-in-out;
  clip-path: polygon(var(--pos, 50%) 0%,
      100% 0%,
      100% 100%,
      var(--pos, 50%) 100%);
}

.BeAf_line {
  position: absolute;
  top: 0;
  width: 5px;
  height: 100%;
  background: linear-gradient(to bottom,
      rgba(255, 255, 255, 0.8),
      white,
      rgba(255, 255, 255, 0.8));
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.6),
    0 0 40px rgba(255, 255, 255, 0.4), 0 0 60px rgba(255, 255, 255, 0.2);
  filter: blur(0.5px);
  animation: moveLine 4s infinite alternate ease-in-out;
  pointer-events: none;
  z-index: 10;
  animation: moveLine 2s infinite alternate ease-in-out;
  pointer-events: none;
}

.BeAf_line_B {
  animation-delay: 0.7s;
}

.BeAf_line_C {
  animation-delay: 1s;
}

@media screen and (width: 768px) {

  .BeAf_image,
  .BeAf_line {
    height: 76%;
  }
}

@media screen and (max-width: 768px) {
  .BeAf_image,
  .BeAf_line {
    height: 38%;
  }
}

@keyframes revealClip {
  0% {
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
  }

  10% {
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
  }

  90% {
    clip-path: polygon(100% 0%, 100% 0%, 100% 100%, 100% 100%);
  }

  100% {
    clip-path: polygon(100% 0%, 100% 0%, 100% 100%, 100% 100%);
  }
}

@keyframes moveLine {
  0% {
    left: 0%;
  }

  10% {
    left: 0%;
  }

  90% {
    left: 100%;
  }

  100% {
    left: 100%;
  }
}