/**
 * 首页样式 - 优化版
 * 移除冗余，使用CSS变量
 */

/* ==================== 背景图片 ==================== */
.mzjy {
  background: url("../images/home/home_banner_1.webp") no-repeat center/cover;
}

.introduction {
  background: url("../images/home/home_bg_gsjs.webp") no-repeat center/cover;
}

.training {
  background: url("../images/home/bg_xxdz_2.png") no-repeat center/cover;
}

.application {
  background-image: 
    url("../images/home/bg_xxdz_2.png"),
    url("../images/home/bg_xxdz_1.png");
  background-repeat: no-repeat;
  background-position: top, bottom;
  background-size: 100% 80%, 100% 20%;
}

@media (min-width: 768px) {
  .mzjy {
    background-image: url("../images/home/home_banner_2.webp");
  }
}

/* ==================== 布局 ==================== */
html,
body,
section {
  position: relative;
  height: 100%;
  width: 100%;
}

.index-page body > div {
  position: relative;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

.mySwiper {
  overflow: hidden;
  position: relative;
  width: 100%;
  height: 100vh;
}

.mySwiper .swiper-wrapper {
  display: flex;
  flex-direction: column;
  position: relative;
  width: 100%;
  height: 100%;
}

.mySwiper .swiper-wrapper .swiper-slide {
  flex-shrink: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* ==================== 新闻区块 ==================== */
.home-news-cover {
  flex-shrink: 0;
  object-fit: cover;
}

.home-news-cover--placeholder {
  background: #eef1f6;
}

.home-news-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 620px;
}

.home-news-status {
  margin-top: 40px;
  font-size: 15px;
  color: #666f83;
}

.home-news-status--error {
  color: #d4380d;
}

/* ==================== 业务介绍卡片 ==================== */
.busines {
  overflow: hidden;
  transition: all 0.5s ease;
}

.busines.active {
  height: 290px;
  color: #fff;
  background: #287cfa;
  padding-top: 0;
}

.busines.active .line-bottom {
  border-bottom-color: #ffffff !important;
}

.busines .more,
.busines .busines_imgs {
  display: none;
}

.busines.active .more,
.busines.active .busines_imgs {
  display: block !important;
}

.busines.active .more {
  animation: shake 1s linear infinite;
}

@keyframes shake {
  0%, 100% {
    transform: translateX(-5px);
  }
  50% {
    transform: translateX(5px);
  }
}

/* ==================== 移动端优化 ==================== */
@media (max-width: 767px) {
  /* 首页布局 */
  html.index-page,
  html.index-page body,
  html.index-page section {
    height: auto !important;
    min-height: 100%;
  }

  .index-page body > div {
    height: auto !important;
    overflow: visible !important;
  }

  .mySwiper,
  .mySwiper .swiper-wrapper {
    height: auto !important;
    display: block !important;
    transform: none !important;
  }

  .mySwiper .swiper-wrapper .swiper-slide {
    height: auto !important;
    min-height: 100vh;
  }

  /* 业务卡片：移动端取消展开效果，只保留背景色变化 */
  .busines {
    transition: background-color 0.3s ease, color 0.3s ease !important;
  }

  .busines.active {
    height: auto !important;
    padding-top: 0;
  }

  .business-section--mobile {
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
  }

  .business-section--desktop {
    display: none !important;
  }

  .business-section--mobile > .flex {
    margin-top: 18px;
    /* margin-bottom: 16px;
    padding: 0 16px; */
  }


  .mobile-business-card {
    flex: 1 1 0;
    min-width: 0;
    height: 120px;
    transition: background-color 0.3s ease, color 0.3s ease;
    position: relative;
  }

  .mobile-business-card.active {
    background: #287cfa !important;
  }

  .mobile-business-card:not(.active) {
    background: rgba(255, 255, 255, 0.78) !important;
  }

  .mobile-business-icon {
    width: 50px;
    height: 50px;
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
  }

  .mobile-business-icon--inactive {
    display: none;
  }

  .mobile-business-card.active .mobile-business-icon--active {
    display: block;
  }

  .mobile-business-card.active .mobile-business-icon--inactive {
    display: none;
  }

  .mobile-business-card:not(.active) .mobile-business-icon--active {
    display: none;
  }

  .mobile-business-card:not(.active) .mobile-business-icon--inactive {
    display: block;
  }

  .mobile-business-card .font-size-14 {
    margin-top: 10px;
    line-height: 1.3;
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 14px;
    color: #333333 !important;
  }

  .mobile-business-card.active .font-size-14 {
    color: #ffffff !important;
  }

  .business-section--desktop .busines .busines_img,
  .business-section--desktop .busines .more {
    display: block !important;
  }

  .business-section--desktop .busines .busines_imgs {
    display: none !important;
  }

  .business-section--desktop .busines.active .more {
    animation: shake 1s linear infinite;
  }

  /* 间距调整 */
  .p-t-200,
  .p-t-206,
  .p-t-130,
  .p-t-123 {
    padding-top: 15px !important;
  }

  .m-t-212 {
    margin-top: 48px !important;
  }

  /* 新闻列表 */
  .home-news-item {
    flex-direction: column !important;
    gap: 0;
    background: #ffffff;
    border: 1px solid rgba(40, 124, 250, 0.14);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(17, 34, 68, 0.06);
  }

  .home-news-item .p-l-50,
  .home-news-item .w-800 {
    width: 100% !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    padding-top: 12px !important;
    padding-bottom: 16px !important;
    box-sizing: border-box;
  }

  .home-news-cover {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 308 / 174;
    border-bottom: 1px solid rgba(40, 124, 250, 0.12);
  }

  .home-news-title {
    max-width: none;
    white-space: normal;
  }

  /* 应用展示 */
  .application .flex[class*="w-1200"] {
    flex-direction: column !important;
    padding-top: 15px !important;
    gap: 24px;
  }

  .application .mt375 {
    margin-top: 32px !important;
    flex-direction: column !important;
    gap: 20px;
    width: 100% !important;
  }

  /* 培训展示 */
  .training .flex[class*="w1200"] {
    flex-direction: column !important;
    gap: 16px;
  }

  /* 字号调整 */
  .font-size-40 { font-size: 28px !important; }
  .font-size-38 { font-size: 26px !important; }
  .font-size-32 { font-size: 22px !important; }
}
