/* ===== Home page styles (cleaned and consolidated) ===== */

/* Prevent horizontal scrollbar globally */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

/* Main container */
.main-container {
  background-image: url('https://static.igem.wiki/teams/5735/img/home/p1-juxing-bg.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  height: 961px;
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  padding-left: 0;
  padding-right: 0;
  overflow: visible;
}

/* Full-bleed container override */
.container .main-container {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  overflow-x: hidden;
}

/* Carousel container - 7 images carousel, show 5 by default */
.carousel-container {
  width: 100vw !important;
  margin-left: calc(50% - 50vw) !important;
  margin-right: calc(50% - 50vw) !important;
  height: 700px !important;
  overflow: hidden !important;
  position: relative !important;
  margin-top: 40px !important;
  /* 移除遮罩效果，实现真正的全屏显示 */
}

.carousel-track {
  display: flex !important;
  align-items: center !important;
  height: 100% !important;
  gap: 20px !important; /* 设置20px间隙 */
  width: calc(14 * 400px + 13 * 20px) !important; /* 14张图片 + 13个20px间隙 */
  animation: scroll 25s linear infinite !important;
  position: relative !important;
  justify-content: flex-start !important;
}

/* 轮播动画 - 移动一半距离实现无缝循环 */
@keyframes scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(calc(-7 * 400px - 7 * 20px)); /* 移动7张图片 + 7个间隙的距离 */
  }
}

/* 暂停动画当鼠标悬停 */
.carousel-container:hover .carousel-track {
  animation-play-state: paused !important;
}

/* 图片包装器样式 - 统一所有7张图片 */
.image-wrapper {
  position: relative;
  width: 400px !important;
  height: 600px !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  flex-shrink: 0 !important;
  padding: 0px;
}

.image-wrapper .content-image {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: 15px !important;
  box-shadow: none !important;
  transition: transform 0.3s ease !important;
  display: block !important;
}

/* 鼠标悬停效果 - 显示背面图片 */
.image-wrapper:hover .content-image {
  opacity: 0 !important;
}

.image-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('https://static.igem.wiki/teams/5735/img/home/p1-back.webp');
  background-size: cover !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  border-radius: 15px !important;
  box-shadow: none !important;
  transform: none !important;
  z-index: 2 !important;
}

.image-wrapper:hover::after {
  opacity: 1;
}

.image-wrapper:hover .content-image {
  transform: none !important;
}

/* Text container */
.text-container {
  background-image: url('https://static.igem.wiki/teams/5735/img/home/p1-juxing1.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  height: 148px;
  padding: 0 3rem;
  border-radius: 20px;
  text-align: center;
  max-width: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Text styles */
.text-content {
  color: #F8FAFC;
  font-family: Arial, sans-serif;
}

.text-content h2 {
  color: #F8FAFC;
  font-family: Arial, sans-serif;
  font-weight: 700;
  font-size: 36px;
  line-height: 1.2;
  margin: 0;
}

/* Side image */
.side-image {
  position: absolute;
  margin-left: 44.5%;
  margin-top: 63%;
  transform: translateY(-50%);
  width: 222px;
  height: 194px;
  object-fit: contain;
  z-index: 10;
}

/* ===== Section One: Text Title and Content ===== */
.section-one {
  margin-top: 0px;
  padding: 80px 0;
  background-color: #ffffff;
}

.section-one-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  text-align: left;
}

.section-one-title {
  margin-bottom: 30px;
  height: 33px;
  font-family: Arial;
  font-weight: 900;
  font-size: 36px;
  color: #010101;
  line-height: 38px;
}

.section-one-text {
  height: 56px;
  max-width: 800px;
  font-family: Arial;
  font-weight: 400;
  font-size: 24px;
  color: #010101;
  line-height: 38px;
}

/* ===== Section Two: Five Images with Background ===== */
.section-two {
  padding: 80px 0;
  height: 420px;
  width: 96%;
  background-image: url('https://static.igem.wiki/teams/5735/img/home/p2-juxing.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.section-two-container {
  max-width: 85%;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
}

.section-two-image {
  margin-top: -4%;
  width: 211px;
  height: 347px;
  object-fit: cover;
  border-radius: 10px;
  transition: transform 0.3s ease;
  cursor: pointer;
}

.section-two-image:hover {
  transform: scale(1.4);
}

/* 返回顶部组合容器 */
.back-to-top-group {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.back-to-top-group.show {
  opacity: 1;
  visibility: visible;
}

.section-two-vertical-image {
  position: absolute;
  right: 40px;
  bottom: 82px;
  width: 1px;
  height: 1784px;
  flex-shrink: 0;
}

.section-two-touying-image {
  position: relative;
  width: 82px;
  height: 82px;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.section-two-touying-image:hover {
  transform: scale(1.1);
  opacity: 0.8;
}

/* ===== 响应式设计 ===== */

/* 大屏幕 (1200px 以上) - 保持原有布局 */
@media (min-width: 1201px) {
  .image-container {
    gap: 0;
  }
}

/* 中等屏幕 (900px - 1200px) */
@media (max-width: 1200px) and (min-width: 901px) {
  .image-container {
    gap: 10px;
    margin-top: 150px;
  }

  .content-image {
    transform: scale(0.8);
  }

  .image-wrapper {
    transform: translateY(-30px) scale(1.0);
  }

  .section-two-container {
    max-width: 90%;
  }

  .section-two-image {
    width: 200px;
    height: 320px;
  }
}

/* 小屏幕 (600px - 900px) */
@media (max-width: 900px) and (min-width: 601px) {
  .image-container {
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: 100px;
  }

  .content-image {
    transform: scale(0.6);
  }

  .image-wrapper {
    transform: none;
    position: relative;
    top: auto;
  }

  .section-two-container {
    max-width: 95%;
    flex-direction: column;
    align-items: center;
  }

  .section-two-image {
    width: 180px;
    height: 280px;
    margin: 10px;
  }

  .section-three-content,
  .section-four-content {
    flex-direction: column;
    text-align: center;
  }

  .section-three-image,
  .section-four-image {
    margin: 20px auto 0 auto;
  }
}

/* 超小屏幕 (600px 以下) */
@media (max-width: 600px) {
  .main-container {
    height: auto;
    min-height: 100vh;
    padding: 20px 10px;
  }

  .image-container {
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 50px;
  }

  .content-image {
    transform: scale(0.5);
  }

  .image-wrapper {
    transform: none;
    position: relative;
    top: auto;
    width: 200px;
    height: 250px;
  }

  .text-container {
    max-width: 90%;
    margin-top: 30px;
  }

  .text-content h2 {
    font-size: 28px;
  }

  .section-one-title {
    font-size: 28px;
  }

  .section-one-text {
    font-size: 18px;
  }

  .section-two-container {
    max-width: 95%;
    flex-direction: column;
    align-items: center;
  }

  .section-two-image {
    width: 150px;
    height: 240px;
    margin: 5px;
  }

  .section-three-content,
  .section-four-content {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }

  .section-three-image,
  .section-four-image {
    margin: 0 auto;
  }

  .section-three-title,
  .section-four-title {
    font-size: 24px;
  }

  .section-three-text-content,
  .section-four-text-content {
    font-size: 18px;
  }

  .section-p5-text {
    font-size: 18px;
  }

  .section-p5-title {
    font-size: 28px;
  }
}

/* 照片轮播的响应式调整 */
@media (max-width: 600px) {
  .section-p5-dots {
    right: 20px;
    bottom: 10px;
  }

  .section-p5-dot {
    width: 15px;
    height: 15px;
  }
}

/* ===== Section Three: Text and Right Image ===== */
.section-three {
  width: 100%;
  padding: 80px 0;
  background-color: #ffffff;
}

.section-three-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: left;
  gap: 60px;
}

.section-three-text {
  flex: 1;
}

.section-three-title {
  margin-bottom: 25px;
  font-family: Arial-Black;
  font-weight: 800;
  font-size: 33px;
  color: #000000;
  word-wrap: nowrap;
}

.section-three-text-content {
  font-family: ArialMT;
  font-weight: 400;
  font-size: 24px;
  color: #010101;
  line-height: 38px;
}

.section-three-image {
  margin-right: -50px;
  margin-top: 70px;
  width: 177px;
  height: 144px;
  flex-shrink: 0;
}

/* ===== Section Four: Text and Right Image ===== */
.section-four {
  margin-top: -80px;
  width: 100%;
  padding: 80px 0;
  background-color: #ffffff;
}

.section-four-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: left;
  gap: 60px;
}

.section-four-text {
  flex: 1;
}

.section-four-title {
  margin-bottom: 25px;
  font-family: Arial-Black;
  font-weight: 800;
  font-size: 33px;
  color: #000000;
  word-wrap: nowrap;
}

.section-four-text-content {
  font-family: ArialMT;
  font-weight: 400;
  font-size: 24px;
  color: #010101;
  line-height: 38px;
}

.section-four-image {
  margin-right: -50px;
  width: 290px;
  height: 290px;
  flex-shrink: 0;
}

/* ===== Section P4: 38px高矩形，左右各11个图片 ===== */
.section-p4 {
  height: 38px;
  background-color: #EFE4E9;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  width: 90%;
  margin: 0 auto;
}

.section-p4-container {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 100%;
  margin: 0 auto;
}

.section-p4-left {
  display: flex;
  margin-left: -175px;
  gap: 1px;
}

.section-p4-right {
  display: flex;
  margin-right: -115px;
  gap: 1px;
}

.section-p4-image {
  width: 30px;
  height: 40px;
  object-fit: contain;
}

/* ===== Section P5: 团队介绍部分 ===== */
.section-p5 {
  margin-top: 25px;
  width: 90%;
  margin-left: auto;
  margin-right: auto;
  background-image: url('https://static.igem.wiki/teams/5735/img/home/p5-bg.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: 80px 0;
  position: relative;
  margin-bottom: 80px;
}

.section-p5-container {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 20px;
}

/* 上部标题元素 */
.section-p5-header {
  margin-top: -20px;
  text-align: center;
  margin-bottom: 30px;
}

.section-p5-title-bg {
  background-image: url('https://static.igem.wiki/teams/5735/img/home/p5-circle-rectangle.webp');
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  width: 313px;
  height: 71px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.section-p5-title {
  margin: 0;
  font-family: Arial;
  font-weight: 900;
  font-size: 36px;
  color: #FFFFFF;
}

/* 正文内容 */
.section-p5-content {
  text-align: left;
  margin-bottom: 60px;
}

.section-p5-text {
  line-height: 1.6;
  font-weight: 400;
  max-width: 1200px;
  margin: 0 auto;
  font-family: Arial;
  font-size: 24px;
  color: #000203;
}

/* 照片区域 */
.section-p5-photo-container {
  position: relative;
  text-align: center;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

/* 轮播容器 */
.photo-carousel {
  position: relative;
  width: 100%;
  height: auto;
  overflow: hidden;
}

.section-p5-photo {
  width: 100%;
  height: auto;
  display: none;
  margin: 0 auto;
  transition: opacity 0.5s ease-in-out;
}

.section-p5-photo.active {
  display: block;
}

/* 右下角三个小圆点 */
.section-p5-dots {
  position: absolute;
  bottom: 20px;
  right: 100px;
  display: flex;
  gap: 10px;
}

.section-p5-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.section-p5-dot.active {
  background-color: rgba(255, 255, 255, 1);
}

.section-p5-dot:hover {
  background-color: rgba(255, 255, 255, 0.8);
}

/* 响应式设计 */

/* 大屏幕 (1200px 以上) - 保持原有布局 */
@media (min-width: 1201px) {
  .carousel-track {
    gap: 20px;
    width: calc(14 * 400px + 13 * 20px) !important;
  }

  .image-wrapper {
    width: 400px !important;
    height: 600px !important;
  }
}

/* 中等屏幕 (900px - 1200px) */
@media (max-width: 1200px) and (min-width: 901px) {
  .carousel-container {
    height: 600px !important;
    margin-top: 150px;
  }

  .carousel-track {
    gap: 20px;
    width: calc(14 * 350px + 13 * 20px) !important;
  }

  .image-wrapper {
    width: 350px !important;
    height: 525px !important;
  }
}

/* 小屏幕 (600px - 900px) */
@media (max-width: 900px) and (min-width: 601px) {
  .carousel-container {
    height: 500px !important;
    margin-top: 100px;
  }

  .carousel-track {
    gap: 20px;
    width: calc(14 * 300px + 13 * 20px) !important;
  }

  .image-wrapper {
    width: 300px !important;
    height: 450px !important;
  }
}

/* 超小屏幕 (600px 以下) */
@media (max-width: 600px) {
  .carousel-container {
    height: 400px !important;
    margin-top: 50px;
  }

  .carousel-track {
    gap: 20px;
    width: calc(14 * 250px + 13 * 20px) !important;
  }

  .image-wrapper {
    width: 250px !important;
    height: 375px !important;
  }
}

