:root {
  --xlightPurple: #efecfa;
  --grey: #9c9c9c;
  --darkGrey: #595859;
  --darkPurple: #231c41;
  --purple: #5d537f;
  --lightPurple: #b0a7ce;
}

@font-face {
  font-family: "Nunito";
  src: url(https://static.igem.wiki/teams/5301/font/nunito-regular.ttf);
}

@font-face {
  font-family: "Nunito-bold";
  src: url(https://static.igem.wiki/teams/5301/font/nunito-extrabold.ttf);
}

@font-face {
  font-family: "Montserrat";
  src: url(https://static.igem.wiki/teams/5301/font/montserrat-bold.ttf);
}
@font-face {
  font-family: "Fredoka";
  src: url(https://static.igem.wiki/teams/5301/font/fredoka-bold.ttf);
}
@font-face {
  font-family: "Ubuntu";
  src: url(https://static.igem.wiki/teams/5301/font/ubuntu-bold.ttf);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body {
  padding-top: 56px;
  background-color: var(--xlightPurple);
}

body.fix {
  overflow: hidden;
}

.left-aligned {
  margin-left: auto;
}

/* CALLOUT */
.bd-callout {
  padding: 1.25rem;
  margin-top: 1.25rem;
  margin-bottom: 1.25rem;
  border: 1px solid #e9ecef;
  border-left-width: 0.25rem;
  border-radius: 0.25rem;
}

.bd-callout h4 {
  margin-bottom: 0.25rem;
}

.bd-callout p:last-child {
  margin-bottom: 0;
}

.bd-callout code {
  border-radius: 0.25rem;
}

.bd-callout + .bd-callout {
  margin-top: -0.25rem;
}

.bd-callout-info {
  border-left-color: #5bc0de;
}

.bd-callout-warning {
  border-left-color: #f0ad4e;
}

.bd-callout-danger {
  border-left-color: #d9534f;
}

/* loading */
#loading {
  width: 100%;
  height: calc(100vh - 64px);
  position: fixed;
  z-index: 1000;
  bottom: 0;
  left: 0;
  background-color: var(--lightPurple);
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  flex-direction: column;
  gap: 20px;
  visibility: visible;
  opacity: 1;
  transition: visibility 0.5s, opacity 0.5s ease;
}

#loading.hide {
  visibility: hidden;
  opacity: 0;
}

.loading-image {
  max-width: 50vw;
  width: 100%;
  height: 50vh;
  display: block;
  background-image: url(https://static.igem.wiki/teams/5301/img/loading.png);
  background-position-y: center;
  background-position-x: center;
  background-repeat: no-repeat;
  background-size: contain;
  position: relative;
  top: -30px;
  animation: up-and-down 1.5s ease infinite;
}

@keyframes up-and-down {
  0% {
    top: -30px;
  }
  66% {
    top: -50px;
  }
  100% {
    top: -30px;
  }
}

.loading-text {
  position: relative;
  font-size: 3rem;
  top: -100px;
}

.loading-text::after {
  content: "";
  animation: dot-blink 1.5s steps(3) infinite;
}

@keyframes dot-blink {
  0% {
    content: " .";
  }
  33% {
    content: " . .";
  }
  66% {
    content: " . . .";
  }
  100% {
    content: " .";
  }
}

/* navbar */
.navbar-brand {
  padding: 0;
}

.navbar-brand > img {
  width: 290px;
  margin-top: 8px;
  margin-left: 0px;
}

.montserrat-500n {
  font-family: "Montserrat", sans-serif;
  font-optical-sizing: auto;
  font-weight: 500;
  font-style: normal;
}

/* 修改渐变色为 #b0a7ce */
.navbar {
  background: linear-gradient(
    var(--lightPurple) 0%,
    var(--lightPurple) 80%,
    transparent 100%
  );
  padding: 0.5rem min(5%, 50px);
  padding-bottom: 1.5rem;
}

/* 导航链接默认颜色 */
.navbar-dark .navbar-nav .nav-link {
  color: #e1ddef;
  position: relative;
  bottom: 0px;
  transition: color 0.3s ease, bottom 0.3s ease;
}

/* 悬停时链接颜色 */
.navbar-nav > .nav-item:hover .nav-link {
  color: white;
  bottom: 2px;
  /* 悬停颜色保持亮白 */
}

/* 下拉菜单样式 */
.dropdown-menu {
  position: absolute;
  top: 100%;
  z-index: 1000;
  display: block;
  min-width: 11rem;
  padding: 0.5rem 0;
  margin: 0;
  font-size: 1rem;
  color: #212529;
  text-align: left;
  list-style: none;
  background-color: #e1d1ed;
  /* 修改为浅紫色 (#e1d1ed) */
  background-clip: padding-box;
  border: 2px solid rgba(0, 0, 0, 0.3);
  border-radius: 0.6rem;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0s, opacity 0.5s ease;
}

.dropdown-menu.show {
  visibility: visible;
  opacity: 0.95;
  margin-top: 0;
}

.nav-item:hover > .dropdown-menu {
  visibility: visible;
  opacity: 0.95;
  margin-top: 0;
}

/* 隐藏下拉菜单箭头 */
.dropdown-toggle::after {
  display: none;
}

/* 下拉项的颜色和悬停效果 */
.dropdown-item {
  color: #836e9b;
  /* 修改为 #836E9B */
}

.dropdown-item:focus,
.dropdown-item:hover {
  color: var(--darkPurple);
  background-color: #f4f4f4;
  /* 悬停时背景色 */
  font-weight: 500;
}

/* footer */
footer a {
  color: white;
  font-weight: bold;
  text-decoration: none;
}

footer a:hover {
  color: white;
  text-decoration: underline;
}

/* 侧边栏 */
.sidebar {
  flex: none;
  width: 270px;
  margin: 50px 0 0 10px;
  /* overflow: hidden; */
  transition: 0.5s;
  font-family: "Ubuntu", sans-serif;
  font-weight: 700;
  font-style: normal;
}

.side-fixed {
  position: fixed;
  top: 150px;
  width: 280px;
}

#side {
  top: 150px;
}

#side .t1 {
  position: relative;
  text-transform: capitalize;
  padding: 5px;
  font-size: 20px;
  opacity: 0.8;
  transition: 0.2s;
}

#side .t1 a {
  text-decoration: none;
  color: var(--darkPurple);
}

#side .t2 a {
  text-decoration: none;
  color: var(--purple);
}

#side .t1::before {
  content: "";
  display: block;
  width: 32px;
  height: 24px;
  background-image: url("https://static.igem.wiki/teams/5301/img/icon-light-purple.png");
  background-size: cover;
  /* opacity: 0.5; */
  position: absolute;
  left: -5px;
  top: 6px;
  transform: translateX(-100%);
  transition: 0.2s;
}

#side .t1.unfold {
  /* font: 25px bold; */
  font-size: 24px;
  font-weight: 700;
  font-style: normal;
  opacity: 1;
}

#side .t1.unfold::before {
  /* opacity: 1; */
  background-image: url("https://static.igem.wiki/teams/5301/img/icon-dark-purple.png");
  width: 40px;
  height: 30px;
}

#side .h2-sec {
  overflow: hidden;
  display: grid;
  grid-template-rows: 0fr;
  transition: grid 0.2s, opacity 0.5s;
  opacity: 0;
  font-size: 0;
}

#side .t1.unfold + .h2-sec .t2 {
  opacity: 0.5;
}

#side .t1.unfold + .h2-sec .t2.show {
  opacity: 1;
  font-weight: bold;
}

#side .t1.unfold + .h2-sec {
  grid-template-rows: 1fr;
  opacity: 1;
  font-size: 16px;
  margin-left: 6px;
}

/* page-content*/
.justify-text {
  text-align: justify;
}

/* 段落和标题字体 */
p {
  font-family: "Nunito", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
  font-variation-settings: "wdth" 100;
  font-size: 1.25rem;
}

#content li {
  font-family: "Nunito", sans-serif;
  padding-bottom: 0.5rem;
}

h2,
h3,
h4,
h5,
h6 {
  font-family: "Ubuntu", sans-serif;
  font-weight: 700;
  font-style: normal;
  margin: 30px 0;
}

h2 {
  font-size: 32px;
  text-align: center;
  line-height: 150%;
}

h3 {
  font-size: 26px;
  color: var(--darkGrey);
  line-height: 150%;
}

h4 {
  font-size: 22px;
  color: var(--darkGrey);
}

h5 {
  font-size: 20px;
  color: var(--darkGrey);
}

.background-border {
  background-color: #fdf9ef;
  border: 4px dashed #5d537f;
  border-radius: 15px;
  padding: 30px 50px;
}

/* 添加表格 */
table {
  border-collapse: collapse;
  margin: 20px auto;
  width: 100%;
  background-color: #fdf9ef;
  border: 2px solid #5d537f;
  padding: 2px;
  border-radius: 15px;
  table-layout: fixed;
  font-size: 16px;
}

td,
th {
  border: none;
  text-align: center;
  padding: 10px;
  border-radius: 5px;
  /* 使单元格内的内容也有圆角 */
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

/* 悬停效果 */
td:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  background-color: #efecfa;
  color: #000;
}

th:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  background-color: #efecfa;
  color: #000;
}

/* 点击侧栏滚动到标题时，设置与顶部的间距以免被导航栏遮住 */
:target {
  scroll-margin-top: 92px;
}

/* 第一、第二行以及第六行的底边框设置为实线 */
table tr:nth-child(1) th,
table tr:nth-child(2) th,
table tr:nth-child(1) td,
table tr:nth-child(6) td {
  border-bottom: 1px solid #5d537f;
  /* 将虚线变为实线 */
}

math,
la-tex {
  margin-bottom: 0rem;
  font-size: 1.25rem;
}

la-tex + p,
math + p {
  margin-top: 1rem;
}

/* 为图片添加渐进动效 */
.image-container {
  overflow: hidden;
  margin: 20px auto;
}

.illustrations {
  max-width: 800px;
  width: 100%;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  transform: translateY(20px);
  border-radius: 8px;
  margin: 10px auto;
  display: block;
}

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

figcaption {
  font-family: "Nunito", sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: 1.25rem;
}

.legend-container {
  width: 100%;
  position: relative;
  top: 16px;
  /* margin-bottom: 20px; */
}

.legend-container + .image-row img {
  background-origin: border-box;
  background-color: white;
}

/* 设置to top动效 */
#gotop {
  position: fixed;
  display: none;
  right: -100px;
  bottom: -40px;
}

#gotop img {
  z-index: 11000;
}

#gotop img:hover {
  cursor: pointer;
}

#gotop .text-wrap {
  user-select: none;
  opacity: 0;
  transition: 0.5s;
  position: absolute;
  top: 65%;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Fredoka", sans-serif;
  font-weight: bold;
  color: #595859;
  font-size: min(15px, 1vw);
  display: flex;
  flex-direction: column;
  align-items: center;
}

#gotop .text-wrap * {
  text-wrap: nowrap;
}

#gotop:hover .text-wrap {
  opacity: 1;
}

/* 副页的头部 */
.header {
  background: url("https://static.igem.wiki/teams/5301/homepage/.png") no-repeat;
  background-size: cover;
  height: 100vh;
  position: relative;
  background-position: 0px -20px;
}

.model-header {
  background: url("https://static.igem.wiki/teams/5301/dry-lab/model-header.png")
    no-repeat;
  background-size: cover;
  height: 100vh;
  position: relative;
  background-position: 0px -20px;
}

.header-content {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 95%;
  text-align: center;
}

.custom-title {
  font-family: "Ubuntu", sans-serif;
  font-size: 7rem;
  color: #ffffff;
  margin: 0;
  display: inline;
  /* Change from flex to inline to work with typewriter effect */
}

/* Typewriter cursor effect */
#cursor {
  /* display: inline; */
  width: 0.1em;
  height: 7rem;
  background-color: #ffffff;
  animation: blink 0.75s step-end infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.link {
  position: relative;
  color: #9c64fb;
  text-decoration: none; /* 移除默认下划线 */
  background: transparent; /* 初始背景透明 */
  overflow: hidden; /* 防止溢出 */
  transition: background 0.3s ease, color 0.3s ease; /* 背景过渡效果 */
}
.link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0; /* 初始位置在文字下方 */
  height: 3px;
  width: 100%;
  background: #9c64fb; /* 下划线颜色 */
  transform: translateY(0); /* 初始下划线位置 */
  transition: transform 3s ease; /* 动画过渡 */
}
.link:hover {
  background: var(--xlightPurple); /* 悬停时背景变为新颜色 */
  color: black; /* 确保字体颜色保持黑色 */
}

/* styles for model.html */

/* 父容器使用 Flexbox 布局 */
.image-row {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 0px;
  margin-bottom: 0px; /* 图片行与标注之间的间距 */
}

.image-row-two {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}
/* 每个图片容器的样式 */
.image-container {
  text-align: center; /* 文字居中 */
}

/* 标注区域的样式 */
.labels {
  text-align: center;
  font-family: "Nunito", sans-serif;
  line-height: 1.6;
  margin-bottom: 10px;
}

/* 每个标注项的样式 */
.label {
  display: block;
  margin: 0px 5px;
  font-weight: bold;
}

table tr:nth-child(1) td,
table tr:nth-child(6) td {
  border-bottom: none;
}
