/* Banner容器样式 */
#banner {
  position: relative;
  width: 100%;
  height: 600px; /* 可根据需求调整高度 */
  overflow: hidden;
}

.swiper {
  width: 100%;
  height: 100%;
}

.swiper-slide {
  position: relative;
  width: 100%;
  height: 100%;
}

/* 内容盒子样式 */
.box {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 100%;
  padding: 0 20px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.txt {
  color: #fff;
  max-width: 600px;
}

.h21 {
  font-size: 32px;
  margin-bottom: 10px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.8s ease;
}

.h22 {
  font-size: 48px;
  margin-bottom: 20px;
  font-weight: bold;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.8s ease 0.2s;
}

.key {
  margin-bottom: 30px;
}

.key p {
  font-size: 18px;
  margin-bottom: 8px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.8s ease 0.4s;
}

/* 数字统计盒子 */
.sz_box {
  display: flex;
  gap: 40px;
  margin-top: 40px;
}

.sz_box li {
  list-style: none;
  text-align: center;
  color: #fff;
}

.sz {
  font-size: 48px;
  font-weight: bold;
  margin-bottom: 10px;
}

.sz span {
  font-size: 32px;
}

.sz_box p {
  font-size: 16px;
}

/* 图片和视频背景 */
.img img,
.video-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* 保持比例填充容器 */
}

.video-background {
  background: #000;
}

/* 轮播激活状态动画 */
.swiper-slide-active .h21,
.swiper-slide-active .h22,
.swiper-slide-active .key {
  opacity: 1;
  transform: translateY(0);
}

/* 轮播控制按钮 */
.swiper-button-prev,
.swiper-button-next {
  color: #fff;
  width: 50px;
  height: 50px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 50%;
}

.swiper-button-prev:after,
.swiper-button-next:after {
  font-size: 20px;
}

.swiper-pagination-bullet {
  width: 12px;
  height: 12px;
  background: rgba(255, 255, 255, 0.6);
}

.swiper-pagination-bullet-active {
  background: #fff;
  width: 30px;
  border-radius: 6px;
}

/* 响应式调整 */
@media (max-width: 768px) {
  #banner {
    height: 400px;
  }

  .h21 {
    font-size: 24px;
  }

  .h22 {
    font-size: 32px;
  }

  .key p {
    font-size: 16px;
  }

  .sz {
    font-size: 32px;
  }

  .sz_box {
    gap: 20px;
    flex-wrap: wrap;
  }
}
.banner_1 .box {
  justify-content: space-around;
}
.banner_1 .box .txt {
  max-width: 100%;
  text-align: center;
  position: relative;
  top: 100px;
}
.banner_1 .box .txt h2 {
  font-size: 40px;
}
.banner_1 .box .txt_2 {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.banner_1 .box .txt_2 .key {
  margin: 0 30px;
  font-size: 14px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.8s ease 0.4s;
}
.banner_1 .box .txt_2 .sns {
  margin-top: -40px;
  color: #ff4444;
}
.banner_1 .sz_box {
  display: none;
}
.banner_2 .box {
  justify-content: space-around;
  transform: translateX(0%);
  left: 0;
}
.banner_2 .box .txt {
  max-width: 100%;
  margin-left: 21%;
  padding-top: 55px;
  position: relative;
  top: 130px;
}
@media screen and (max-width: 1700px) {
  .banner_2 .box .txt {
    margin-left: 17%;
  }
}
@media screen and (max-width: 1600px) {
  .banner_2 .box .txt {
    margin-left: 13%;
  }
}
@media screen and (max-width: 1400px) {
  .banner_2 .box .txt {
    margin-left: 7%;
  }
}

.banner_2 .box .txt h2 {
  font-size: 40px;
}
.banner_2 .box .txt .key p {
  font-size: 14px;
}
.banner_2 .box .sz_box {
  display: flex;
  justify-content: end;
  margin-right: 18%;
  margin-top: 40px;
}
.banner_2 .box .sz_box li > p {
  font-size: 14px;
}
.banner_2 .box .sz_box .sz {
  display: flex;
  align-items: end;
  justify-content: center;
}
.banner_2 .box .sz_box .sz .counter {
  font-size: 30px;
}
.banner_2 .box .sz_box .sz span {
  font-size: 14px;
  display: inline-block;
  padding-bottom: 6px;
}

.h21,
.h22,
.key p,
.txt_2 .key {
  opacity: 0;
  transform: translateY(20px);
  transition: all 1s ease; /* 改为1s与swiper速度匹配 */
}
/* 层级延迟设置 */
.swiper-slide-active .h21 {
  transition-delay: 0.2s;
}
.swiper-slide-active .h22 {
  transition-delay: 0.4s;
}
.swiper-slide-active .key p {
  transition-delay: 0.6s;
}
.swiper-slide-active .txt_2 .key {
  transition-delay: 0.8s; /* 每个key可以有顺序延迟 */
}
/* 为每个动画元素添加自定义延迟 */
.swiper-slide-active .txt_2 .key:nth-child(1) {
  transition-delay: 0.4s;
}
.swiper-slide-active .txt_2 .key:nth-child(2) {
  transition-delay: 0.5s;
}
.swiper-slide-active .txt_2 .key:nth-child(3) {
  transition-delay: 0.6s;
}
.swiper-slide-active .txt_2 .key:nth-child(4) {
  transition-delay: 0.7s;
}
.swiper-slide-active .txt_2 .key:nth-child(5) {
  transition-delay: 0.8s;
}

/* 计数器数字动画 */
.counter {
  font-size: 48px;
  font-weight: bold;
  transition: all 0.3s ease; /* 数字变化时添加轻微过渡 */
}

/* 确保动画不会重复触发 */
.swiper-slide:not(.swiper-slide-active) .h21,
.swiper-slide:not(.swiper-slide-active) .h22,
.swiper-slide:not(.swiper-slide-active) .key p,
.swiper-slide:not(.swiper-slide-active) .txt_2 .key {
  opacity: 0 !important;
  transform: translateY(20px) !important;
  transition: none !important; /* 非激活状态禁用过渡 */
}

/* 
.banner_1 {
  .box {
    justify-content: space-around;
    .txt {
      max-width: 100%;
      text-align: center;
      position: relative;
      top: 100px;
      h2 {
        font-size: 40px;
      }
    }
    .txt_2 {
      display: flex;
      align-items: center;
      justify-content: center;
      color: #fff;
      .key {
        margin: 0 30px;
        font-size: 14px;
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.8s ease 0.4s;
      }
      .sns {
        margin-top: -40px;
        color: #ff4444;
      }
    }
  }
  .sz_box {
    display: none;
  }
}
.banner_2 {
  .box {
    justify-content: space-around;
    transform: translateX(0%);
    left: 0;
    .txt {
      max-width: 100%;
      margin-left: 30%;
      padding-top: 55px;
      position: relative;
      top: 130px;
      h2 {
        font-size: 40px;
      }
      .key {
        p {
          font-size: 14px;
        }
      }
    }
    .sz_box {
      display: flex;
      justify-content: end;
      margin-right: 30%;
      margin-top: 40px;
      li {
        & > p {
          font-size: 14px;
        }
      }
      .sz {
        display: flex;
        align-items: end;
        justify-content: center;
        .counter {
          font-size: 30px;
        }
        span {
          font-size: 14px;
          display: inline-block;
          padding-bottom: 6px;
        }
      }
    }
  }
} */
