/* 文字散开 */
#text-container {
  opacity: 0;
  transition: opacity 1s ease-out;
}

.text {
  font-family: 'Nunito';
  position: absolute;
  font-size: 35px;
  color: #e8d3f0;
  opacity: 0;
  transform: scale(0.1);
  transition: opacity 1.5s, transform 1.5s ease-out;
}

.text-fade-in {
  opacity: 1;
  transform: scale(1) translate(var(--x), var(--y));
}
.text:nth-child(1) {
  --x: -150px;
  --y: -150px;
}
.text:nth-child(2) {
  --x: 0px;
  --y: -200px;
}
.text:nth-child(3) {
  --x: 150px;
  --y: -150px;
}
.text:nth-child(4) {
  --x: 200px;
  --y: 0px;
}
.text:nth-child(5) {
  --x: 150px;
  --y: 150px;
}
.text:nth-child(6) {
  --x: 0px;
  --y: 200px;
}
.text:nth-child(7) {
  --x: -150px;
  --y: 150px;
}
.text:nth-child(8) {
  --x: -200px;
  --y: 0px;
}
.text:nth-child(9) {
  --x: 100px;
  --y: 100px;
}
.text:nth-child(10) {
  --x: -100px;
  --y: -100px;
}
.text:nth-child(11) {
  --x: 50px;
  --y: -50px;
}

/* 骷髅头 */
#myImage {
  z-index: 999;
  transition: transform 0.2s;
}

/* drug */
.drugcontainer {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 2vw; /* 保持间距 */
}

.drugcontainer .dcard {
  position: relative;
  width: 20vw; /* 确保一行四个 */
  height: 40vh; /* 调整卡片高度为相对于视口的高度 */
  min-height: 460px;
  background-color: #fff;
  border-radius: 20px;
  box-shadow: 0 35px 80px rgba(0, 0, 0, 0.15);
  transition: 0.5s;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  max-height: 550px;
}

.drugcontainer .dcard:hover {
  height: 65vh; /* 悬停时卡片高度增加 */
}

.drugcontainer .dcard .imgBox {
  position: absolute;
  top: 20px;
  left: 0;
  right: 0;
  width: 80%; /* 调整为相对于卡片宽度的百分比 */
  height: 20vh; /* 使用相对高度 */
  margin: 0 auto; /* 使图片盒子水平居中 */
  border-radius: 12px;
  transition: 0.5s;
  overflow: hidden;
}

.drugcontainer .dcard:hover .imgBox {
  top: -2vh; /* 图片在悬停时向上移动 */
  scale: 0.75;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.2);
}

.drugcontainer .dcard .imgBox img {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.drugcontainer .dcard .content {
  position: absolute;
  top: 25vh;
  width: 100%;
  padding: 0 5%;
  height: 10vh;
  overflow: hidden;
  text-align: center;
  transition: 0.5s;
}

.drugcontainer .dcard:hover .content {
  top: 20vh;
  height: 50vh; /* 悬停时内容展开 */
}

.drugcontainer .dcard .content h2 {
  font-size: 1.5em; /* 名字的字体大小 */
  font-weight: 700;
  color: var(--clr);
  margin-top: 5px;
}

.drugcontainer .dcard .content p {
  color: #333;
  opacity: 0;
  transition: opacity 0.5s;
}

.drugcontainer .dcard:hover .content p {
  opacity: 1;
}

.fade-in-title {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1s ease-in-out, transform 1s ease-in-out;
}
.fade-in-title.visible {
  opacity: 1;
  transform: translateY(0);
}

#text1 {
  position: absolute;
  opacity: 0;
}
#text2 {
  position: absolute;
  opacity: 0;
}

.centering {
  position: relative !important;
  left: 50vw !important;
  transform: translateX(-50%) !important;
}

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1s ease-in-out, transform 1s ease-in-out;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

#tutorial {
  position: relative;
  z-index: 5;
  top: 0px;
  scroll-behavior: smooth;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

/* 从右边出现图片 */
.right-in-image {
  opacity: 0;
  transform: translateX(100%); /* 从右侧移入 */
  transition: opacity 1s ease-out, transform 1s ease-out;
}
/* 从左边出现图片 */
.left-in-image {
  opacity: 0;
  transform: translateX(-100%);
  transition: opacity 1s ease-out, transform 1s ease-out;
}
.visible {
  opacity: 1;
  transform: translateX(0); /* 图片移回原始位置 */
}

/* 从下面出现图片 */
.illustrations {
  opacity: 0;
  transition: opacity 1s ease-in-out, transform 1s ease-in-out;
  transform: translateY(20px);
  border-radius: 8px;
}

.illustrations.visible {
  opacity: 1;
  transform: translateY(0);
}

.nanodisk {
  position: relative;
  width: 800px;
  padding: 0px;
  display: flex;
  align-items: flex-start;
  gap: 5px;
  margin-top: 0%;
  left: 5%;
}

img.nanodisk {
  height: 500px;
  width: auto;
  margin: 0px;
}

.nanodisk-dropdown {
  width: 300px;
  height: 70px;
  cursor: pointer;
  margin: 0;
  display: block;
  padding: 0px;
  position: relative;
}

.nanodisk-content {
  display: none;
  position: absolute;
  background-color: #feebcf;
  border-radius: 10px;
  border-style: dashed;
  border-width: 2px;
  border-color: #1e0b35;
  padding: 20px;
  margin-left: 10px;
  width: 170px;
}

.nanodisk-dropdown:hover .nanodisk-content {
  display: block;
}

.text-container {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 300px;
  margin-top: 100px;
  margin-left: 20px;
  position: relative;
}

/* 图层容器的样式 */
.image-container {
  position: relative;
  width: 500px;
  height: 500px;
  overflow: hidden;
  background-image: url("https://static.igem.wiki/teams/5301/homepage/whole.png"); /* 使用完整的图片 */
  background-size: cover;
  background-position: center;
}

/* 默认的图层样式 */
.layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("https://static.igem.wiki/teams/5301/homepage/whole.png"); /* 同样使用完整图片 */
  background-size: cover;
  background-position: center;
  transform: scale(1); /* 初始大小 */
  transition: transform 0.5s ease, opacity 0.5s ease; /* 平滑过渡效果 */
  opacity: 0; /* 初始隐藏 */
}
.mainlayer {
  background-image: url("https://static.igem.wiki/teams/5301/homepage/whole.png");
  opacity: 1;
  z-index: 999;
}

/* 替换图层背景为图片 */
.layer1 {
  background-image: url("https://static.igem.wiki/teams/5301/homepage/l1.png");
  opacity: 0; /* 初始隐藏 */
  z-index: 1000;
}

.layer2 {
  background-image: url("https://static.igem.wiki/teams/5301/homepage/l2.png");
  opacity: 0; /* 初始隐藏 */
  z-index: 1000;
}

.layer3 {
  background-image: url("https://static.igem.wiki/teams/5301/homepage/l3.png");
  opacity: 0; /* 初始隐藏 */
  z-index: 1000;
}

/* 当鼠标悬停时图层放大的效果 */
.layer-visible {
  opacity: 1; /* 完全显示 */
  transform: scale(1.1); /* 放大效果 */
}

/* 按钮样式 */
.buttons {
  margin-top: 20px;
}

.btn {
  cursor: pointer;
  border-radius: 10px;
  background: #feebc0;
  border: none;
  width: 300px;
}

.btn:hover {
  background-color: #ffdf94;
}

/* 页底链接 */
.bottom-link-container {
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bottom-link-container a {
  text-decoration: none;
}
.bottom-link-container p {
  position: relative;
  top: -30px;
  text-align: center;
  color: #c6c0dc;
  font-size: 1.8rem;
  font-weight: 700;
  transition: all 0.3s ease;
}

#design:hover > p,
#design:focus > p,
#hp:hover > p,
#hp:focus > p,
#result:hover > p,
#result:focus > p,
#model:hover > p,
#model:focus > p {
  color: #efecfa;
  font-weight: 800;
  top: -35px;
}

.bottom-link-container .bottom-link-img {
  background-size: contain;
  background-repeat: no-repeat;
  width: 300px;
  height: 300px;
  transition: all 0.3s ease;
  position: relative;
}
#design-img {
  background-image: url(https://static.igem.wiki/teams/5301/homepage/design.png);
  top: 0px;
}
#design:hover > #design-img,
#design:focus > #design-img {
  background-image: url(https://static.igem.wiki/teams/5301/homepage/design-hover.png);
  top: -5px;
}
#hp-img {
  background-image: url(https://static.igem.wiki/teams/5301/homepage/hp.png);
  top: 30px;
}
#hp:hover > #hp-img,
#hp:focus > #hp-img {
  background-image: url(https://static.igem.wiki/teams/5301/homepage/hp-hover.png);
  top: 25px;
}
#result-img {
  background-image: url(https://static.igem.wiki/teams/5301/homepage/result.png);
  top: 0px;
}
#result:hover > #result-img,
#result:focus > #result-img {
  background-image: url(https://static.igem.wiki/teams/5301/homepage/result-hover.png);
  top: -5px;
}
#model-img {
  background-image: url(https://static.igem.wiki/teams/5301/homepage/model.png);
  top: 30px;
}
#model:hover > #model-img,
#model:focus > #model-img {
  background-image: url(https://static.igem.wiki/teams/5301/homepage/model-hover.png);
  top: 25px;
}

.bottom-link-guide {
  margin-top: 150px;
  font-size: 4rem;
  color: #efecfa;
  text-shadow: #5d537f 2px 5px 5px;
}

.video {
  border-radius: 30px;
  box-shadow: #5d537f 2px 5px 5px;
}
