* { box-sizing: border-box; font-family: Arial, sans-serif; }
body { margin: 0; padding: 0; background-color: aliceblue; font-size: 18px; }

@media (min-width: 992px) { 
  body { overflow-x: hidden; }
}
@media (max-width: 991.99px) { 
  body { overflow-x: visible; }
}

a { 
  text-decoration: none; 
  color: #F47B5E;
}
a:hover { 
  /* text-decoration: underline;  */
  transform: scale(1.02);
  transition: transform 0.2s ease-in-out;
}

p { font-size: 1.125rem; }

::selection {
background: #FED2C0;
color: #fff;
} 

h1, h2, h3, h4, h5, h6 { font-weight: 700; margin-bottom: 1rem; }

hr { border: none; height: 2px; background-color: #336EA7; margin: 10px 0 20px 0; }

.awards{
  border-radius: 20px;
}
.awards:hover{
  background-color: rgba(255,255,255,0.2); 
  color: #fff; 
  transition: background-color 0.3s ease; 
}

.content li { margin: 1rem 0; padding-left: 5px; }

.scroll-anchor { margin: 2rem 0; scroll-margin-top: 80px; }

.figure {
  max-width: 1000px;          /* 限制整體寬度 */
  margin: 1% auto 1.5% auto;          /* 水平置中 */
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  border: 1px solid rgba(255,255,255,0.3);
  padding: 1%;
}

.figure .row {
  justify-content: center;    /* 圖片置中排列 */
}

.figure img {
  width: 100%;                /* 滿欄寬 */
  height: auto;
  border-radius: 10px;
  object-fit: cover;
}

.figure-caption {
  text-align: center;
  color: #555;
  margin-top: 8px;
}
.figure p {
  padding-top: 0.5rem;
  margin-bottom: 0rem;
}

.color-table { 
  /* background-color: #fff; */
  width: 100%; 
  border-collapse: collapse; 
  border-spacing: 0;
  margin: 2rem 0; 
  box-shadow: 0 8px 16px rgba(0,0,0,0.1); 
  border-radius: 20px; 
  border-collapse: separate;
  overflow: hidden;
}
.color-table th, .color-table td { 
  padding: 12px 15px; 
  margin: 0; 
  text-align: center; 
  border: none; 
}
.color-table th { 
  backdrop-filter: blur(20px); 
  font-weight: 600; 
  font-size: 20px;  
  color: #fff;
  background: rgba(87,125,181,1);
}
.color-table tr:nth-child(even) {
  background-color: rgba(183, 224, 228, 0.3); 
}

.page-header { 
  background: url(https://static.igem.wiki/teams/5797/pictures/blue-ink-v3.webp) no-repeat; 
  background-size: 100% 100%; 
  height: 600px; 
  color: #F9F8FF; 
  /* box-shadow: 2px 2px 5px rgba(0,0,0,0.1); */
}
.members-header {
  /* background: url(https://static.igem.wiki/teams/5797/pictures/members/all.webp) no-repeat;  */
  background: 
    linear-gradient(
    to bottom, 
    rgba(0, 0, 0, 0), 
    rgba(240, 248, 255, 0.5) 60%,
    aliceblue),  /* 漸層：上透明 → 下白 */
    url(https://static.igem.wiki/teams/5797/pictures/members/all.webp) no-repeat;
  background-attachment: fixed;
  background-size: 100% auto; 
  background-position : top 60% center;
  height: 800px; 
  color: #F9F8FF; 
  /* margin-bottom: 100px; */
}
@media screen and (max-width: 991px) { .page-header { height: 400px; } }

/* Navbar */
.nav-background { width: 100%; height: 70px; }
@media (min-width: 992px) { .nav-background { background: rgba(51, 110, 167, 0.7); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); } }
@media (max-width: 991.99px) { .nav-background { background: transparent; } }
@media (min-width: 992px) { #navbar { background: transparent; } }
@media (max-width: 991.99px) { #navbar { background: rgba(51, 110, 167, 0.7); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); } }

.navbar-hide { transition: transform 0.3s ease; transform: translateY(-100%); }

.nav-link { 
  color: #fff; 
  font-size: 20px; 
  font-weight: 600; 
  text-decoration: none; 
  padding: 12px 16px !important;
  border-radius: 20px; 
  transition: background-color 0.3s ease; 
}
.nav-link:hover { 
  background-color: rgba(255,255,255,0.2); 
  color: #fff; 
}
.nav-link:active, .nav-link:focus { 
  color: #fff !important; 
}
.navbar-toggler-icon { 
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='white' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E"); 
}
.navbar-toggler { 
  border: 1.5px solid white; 
}
.dropdown-menu { 
  background-color: rgba(255, 255, 255, 0.7); 
  backdrop-filter: blur(12px); 
  -webkit-backdrop-filter: blur(100px); 
  border-radius: 20px; 
  border: 1px solid rgba(255,255,255,0.3); 
  box-shadow: 0 8px 32px rgba(0,0,0,0.1); 
  padding: 0; 
  margin-top: 0;
  min-width: 180px; 
  /* max-width: 240px; */
}
.dropdown-item { 
  font-size: 20px; 
  padding: 10px 20px; 
  font-weight: 600; 
  color: #333; 
  background: transparent; 
  border-radius: 20px; 
  box-shadow: none; 
  transition: background-color 0.3s ease, font-weight 0.3s ease; 
}
.dropdown-item:hover { 
  background-color: rgba(47,95,135,0.08); 
  color: #000; 
  /* font-weight: 600; s */
  /* text-shadow: 0 0 1.2px currentColor; */
  /* transform: scale(1.02); */
}

/* 滑鼠懸浮時展開 dropdown */
.nav-item.dropdown:hover .dropdown-menu,
.nav-item.dropdown .dropdown-menu:hover {
  display: block;
  margin-top: 0;
}

footer { 
  width: 100%;
  color: #333; 
  padding-top: 1.5rem; 
  padding-bottom: 60px; 
  font-size: 14px; 
  margin-top: 50px; 
  border-radius: 12px 12px 0 0; 
  display: flex; 
  justify-content: center; 
  align-items: center;
}
.footer-legal a { font-weight: bold; text-decoration: none; color: #333; }
.footer-legal a:hover { text-decoration: underline; color: #333; }
footer img { width: 100%; border-radius: 0px;padding: 0.5rem; }
.footer-icon {
  width: 50px;
  height: 50px;
  padding: 10px;
  border-radius: 10px;
  background-color: #fff;
}
.footer-icon:hover {
  background-color: #f0f0f0;
  transform: scale(1.1);
  transition: transform 0.2s ease-in-out, background-color 0.2s ease-in-out;
}
.email img {
  transition: 0.3s ease;
}
.email:hover img {
  content: url("https://static.igem.wiki/teams/5797/pictures/footer/envelope-open-solid-full.svg"); /* hover 時換圖 */
}

/* sticky-sidebar */
.sticky-sidebar { 
  position: sticky;
  top: 80px; 
  background: rgba(51,110,167,0.5);
   backdrop-filter: blur(12px); 
   border-radius: 20px; 
   padding: 20px 0; 
   margin: 5px; 
   box-shadow: 0 8px 16px rgba(0,0,0,0.08); 
   border: 1px solid rgba(255,255,255,0.2);  
  max-height: calc(100vh - 100px); 
  overflow-y: auto; 
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.6) transparent;
  scroll-behavior: smooth;
 }
.sticky-sidebar::-webkit-scrollbar {
  width: 8px;
}
.sticky-sidebar::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 20px;
}
.sticky-sidebar::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(255,255,255,0.65), rgba(255,255,255,0.35));
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.2);
}
.sticky-sidebar::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(255,255,255,0.8), rgba(255,255,255,0.5));
}
.toc-link { display: block; color: #fff; padding: 10px 12px 10px 36px; margin: 0; transition: background-color 0.3s ease, transform 0.2s ease; text-decoration: none; font-size: 18px; font-weight: 500; position: relative; }
.toc-link::before { content: ""; position: absolute; left: 4px; top: 50%; width: 27px; height: 27px; transform: translateY(-50%); background-image: url("https://static.igem.wiki/teams/5797/pictures/homepage/bpfit-v2.webp"); background-size: contain; background-repeat: no-repeat; opacity: 0; }
.toc-link:hover { transform: translateY(-2px); }
.toc-banner:hover { border-radius: 20px; background-color: rgba(255,255,255,0.2); transition: background-color 0.2s ease; }
.toc-link.active { color: #fff; font-weight: 600; transform: translateX(10px); }
.toc-link.active::before { opacity: 1; }

/* Sticky 整個右側容器 */
#switcher {
  position: sticky;
  top: 80px;
  width: 100%;
}

#switcher .swap {
  display: block;
  width: 100%;
  margin: 5px 0;
  padding: 12px;
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.35);
  border-radius: 20px;
  color: #333;
  font-weight: 600;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.08);
  transition: transform 0.2s ease, background-color 0.3s ease;
}
#switcher .swap:hover {
  /* transform: translateY(-2px); */
  scale: 1.02;
}
#switcher .swap.active{
  background: rgba(51,110,167,0.5);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}


/* Engineering sticky-sidebar */
/* #toc .toc { list-style: none; margin: 0; padding-left: 0; }
#toc ul,
#toc li {
  list-style: none;
  margin: 0;
  padding: 0;
}

#toc li > ul { display: none; padding-left: 1rem; }
#toc li.open > ul { display: block; }
#toc li:hover > ul { display:block !important; } */
/* Engineering sticky-sidebar */
#toc-wet .toc,
#toc-dry .toc,
#toc-overview .toc {
  list-style: none;
  margin: 0;
  padding-left: 0;
}

#toc-wet ul,
#toc-wet li,
#toc-dry ul,
#toc-dry li,
#toc-overview ul,
#toc-overview li {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* 預設子清單收起 */
#toc-wet li > ul,
#toc-dry li > ul,
#toc-overview li > ul {
  display: none;
  padding-left: 1rem;
}

/* JS 加上 open 時才展開 */
#toc-wet li.open > ul,
#toc-dry li.open > ul,
#toc-overview li.open > ul {
  display: block;
}

/* 滑鼠移上時暫時展開 */
#toc-wet li:hover > ul,
#toc-dry li:hover > ul,
#toc-overview li:hover > ul {
  display: block !important;
}

/* engineering */
.engineering h2, .engineering h3, .engineering h5{ color: #2f5f87; }
.picture-card { background: rgba(255,255,255,0.7); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-radius: 20px; box-shadow: 0 8px 32px rgba(0,0,0,0.1); border: 1px solid rgba(255,255,255,0.3); margin: 20px auto; padding: 1rem 1rem 0rem 1rem; }
.picture-card img { max-height: 500px; }


.btn-primary { padding: 15px 30px; width: auto; margin: 40px auto; background-image: linear-gradient(135deg, #b7e0e47f, #e5b7677d); backdrop-filter: blur(50px); -webkit-backdrop-filter: blur(20px); border-radius: 100px; border: 1px solid rgba(255,255,255,0.2); box-shadow: 0 8px 32px rgba(0,0,0,0.15); color: #333; text-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.btn-primary:hover { background: rgba(255,255,255,0.9); color: #333; box-shadow: 0 12px 24px rgba(0,0,0,0.2); }

.rotating-center { animation: spin 4s linear infinite; }
.rotating-center:hover { animation: spin 0.1s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

@media (min-width: 992px) { .dialogue-img { display: none; } }
@media (max-width: 992px) { .dialogue-img { display: block; } }

.back-to-top-btn { position: fixed; bottom: 10px; right: 10px; z-index: 1000; display: none; width: 5%; transition: opacity 0.3s ease; }
.back-to-top-btn img { width: 100%; height: 100%; object-fit: cover;  transition: opacity 0.3s ease;}
.back-to-top-btn img.fade-out {
  opacity: 0;
}

.member-wrapper { 
  overflow: visible;
  border-radius: 20px;
  perspective: 2000px; /* 3D 透視 */
}
.member-inner{ 
  width: 100%;
  min-height: 300px;
  transition: transform 0.6s;
  transform-style: preserve-3d;
  border-radius: 20px;
  display: grid;
}
.member-front, .member-back {
  align-items: center;
  width: 100%;
  height: 100%;  
  padding: 0px; 
  margin: 0; 
  grid-area: 1 / 1;
  backface-visibility: hidden; /* 隱藏反面 */
  border-radius: 20px;
  /* overflow: visible; */
}
.member-front p { 
  font-weight: 600;
  font-size: clamp(1rem, 2vw, 1.6rem);
  margin: 0; 
}
.member-front { 
  background-color: #7ca6cb;
  backdrop-filter: blur(20px); 
  /* box-shadow: 0 8px 16px rgba(0,0,0,0.1);  */
  border: 1px solid rgba(255,255,255,0.2); 
  color: #fff; 
  z-index: 20; 
}
.member-back { 
  background-color: #2f5f87;
  border-radius: 20px;
  color: #fff; 
  transform: rotateY(180deg);
  z-index: 10;
}
.member-img { 
  max-width: 90%;
  max-width: 90%;
  border-radius: 50%; 
  margin: 10px;
  /* box-shadow: 0 4px 12px rgba(0,0,0,0.1);  */
}
.member-wrapper:hover .member-inner {
  transform: rotateY(180deg);
}
.member-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-right: 10px;
}
.member-title p {
  margin: 0;
  padding: 10px;
}

/* home */
.home-btn { display: inline-block; padding: 12px 24px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); background-color: rgba(255,255,255,0.2); box-shadow: 0 4px 8px rgba(0,0,0,0.1); transition: all 0.3s ease; }
.home-btn:hover { background-color: rgba(255,255,255,0.4); box-shadow: 0 4px 12px rgba(13,26,58,0.2); transform: translateY(-2px); }
.tv-frame {
  position: relative;
  width: 100%;
  max-width: 1100px; /* 控制最大寬度 */
  aspect-ratio: 16/9; /* 維持比例 */
  margin: 0 auto;
  background: url("https://static.igem.wiki/teams/5797/homepage/television-2.avif") no-repeat center/contain;
}
.tv-frame iframe {
  position: absolute;
  top: 3.9%;   /* 根據電視螢幕位置微調 */
  left: 7.3%;
  width: 85.5%;
  height: 80%;
  border: 0;
  border-radius: 10px;
}
.down-arrow {
  animation: floatDown 1.6s ease-in-out infinite;
}
@keyframes floatDown {
  0%, 100% {
    transform: translateY(0);
    opacity: 1;
  }
  50% {
    transform: translateY(12px);
    opacity: 0.7;
  }
}

.text-layer.is-active{ opacity:1; }

.swiper {
  width: 100%;
  /* padding-top: 50px;
  padding-bottom: 50px; */
}

.swiper-slide {
  background-position: center;
  background-size: cover;
  width: 70%;
}

.swiper-slide img {
  display: block;
  width: 100%;
}

/* page loader */
/* 全畫面遮罩 */
#pageloader{
  position: fixed; inset: 0; z-index: 9999;
  display: grid; place-items: center;
  background: rgba(249,248,255,0.9); /* #F9F8FF */
  backdrop-filter: blur(6px);
  transition: opacity .3s ease, visibility .3s ease;
}
#pageloader.hide{ opacity:0; visibility:hidden; }

/* 環形轉圈 */
.loader-circle {
  width: 100px; 
  height: 100px; 
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin{ to{ transform: rotate(360deg); } }

/* hp */
.chatbox { 
  background-color: #2f5f87;
  backdrop-filter: blur(12px); 
  border-radius: 20px; 
  padding: 20px; 
  margin: 20px; 
  box-shadow: 0 8px 16px rgba(0,0,0,0.08); 
  border: 1px solid rgba(255,255,255,0.2); 
}
.chat-avatar { 
  width: 100%;
  border-radius: 50%;
}
.chat-name {
  font-weight: bold; 
  margin: 0;
  font-size: 20px; 
  color: #ffffff;
}
.chat-message {
  position: relative;
  background: rgba(255,255,255,0.9); 
  padding: 0;
  border-radius: 20px; 
  box-shadow: 0 4px 12px rgba(0,0,0,0.1); 
  width: 100%; 
  /* overflow-x: hidden; */
}
/* 尖角 */ 
.chat-message::after { 
  content: ""; 
  position: absolute; 
  left: -15px;   /* 控制水平位置 */
  top: -13px;     /* 控制垂直位置 */
  width: 0;
  height: 0;
  border-top: 30px solid rgba(255,255,255,0.9); /* 箭頭的長度 */
  border-right: 27px solid transparent; /* 越小越尖 */
  transform: rotate(130deg); /* 旋轉箭頭 */
}
.ihp-character-avatar { 
  width: 100%; 
  border-radius: 50%; 
  box-shadow: 0 4px 12px rgba(0,0,0,0.1); 
  object-fit: cover; 
}
.ihp-btn {
  display: inline-block;
  padding: 10px 20px;
  background: rgba(47,95,135,0.1);
  border: none;
  border-radius: 100px;
  color: #2f5f87;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}
.ihp-btn:hover {
  background: rgba(47,95,135,0.2);
  color: #000;
  transform: translateY(-2px);
}
.ihp-detail{
  background: rgba(183, 224, 228, 0.8);
  border-radius: 20px;
}
.ihp-detail img {
  width: 100%;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  object-fit: cover;
}

/* part-collection */
.part h2 {
  color: #577db5;
}
.part p {
  color: #1c507d;
}
.part-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 3rem 0;
  font-family: system-ui, sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: #204f7a;
}
.part-title::before,
.part-title::after {
  content: "";
  flex: 1;
  height: 2px;
  background-color: #204f7a;
  opacity: 0.7;
}
.pill-title {
  display: inline-block; 
  padding: 18px 30px; 
  margin: 0;
  background-color: #2f5f87;
  color: #fff;
  backdrop-filter: blur(12px); 
  -webkit-backdrop-filter: blur(12px); 
  box-shadow: 0 4px 8px rgba(0,0,0,0.1); 
  transition: all 0.3s ease;
  text-align: center;
}
.part-table { 
  /* background-color: #fff; */
  width: 100%; 
  border-collapse: collapse; 
  border-spacing: 0;
  margin: 2rem 0; 
  box-shadow: 0 8px 16px rgba(0,0,0,0.1); 
  border-radius: 20px; 
  border-collapse: separate;
  overflow: hidden;
}
.part-table th, .part-table td { 
  padding: 15px 15px; 
  margin: 0; 
  text-align: center; 
  border: none; 
}
.part-table th { 
  backdrop-filter: blur(20px); 
  font-weight: 600; 
  font-size: 20px;  
  color: #fff;
  background: rgba(87,125,181,1);
}
.part-table tr:nth-child(even) {
  background-color: rgba(183, 224, 228, 0.3); 
}
.part-table th:nth-child(1),
.part-table th:nth-child(2),
.part-table th:nth-child(3),
.part-table td:nth-child(1),
.part-table td:nth-child(2),
.part-table td:nth-child(1) {
  text-align: center;
}
.part-table th:nth-child(4),
.part-table tbody td:nth-child(4) {
  text-align: left;
}
.part-table tbody td:nth-child(1),
.part-table tbody td:nth-child(3) {
  color: #2f5f87;
}

/* model */
.model-table { 
  /* background-color: #fff; */
  width: 100%; 
  margin: 20px 0;
  box-shadow: 0 8px 16px rgba(0,0,0,0.1); 
  border-radius: 20px; 
  border-collapse: separate;
  overflow: hidden;
}
.model-table th, .model-table td { 
  padding: 12px 15px; 
  margin: 0; 
  text-align: left; 
  border: none; 
}
.model-table th { 
  backdrop-filter: blur(20px); 
  font-weight: 600; 
  font-size: 20px;  
  color: #fff;
  background: rgba(87,125,181,1);
}
.model h2 { color: #2f5f87; text-align: center;}
.model h3 { color: #336EA7; }
.li-m-0 li {
  margin: 0 !important;
  padding: 0 !important;
}

/* safety */
.satety { 
  color: #1c242b;
}
.satety h2, .satety h3, .satety h4 { color: #2f5f87; }

/* experiments */
.experiments-link{
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  min-height: 120px;
  padding: 12px 16px;
  margin: 16px 0;
  background: rgba(47,95,135,0.1);
  border-radius: 20px;
  color: #2f5f87;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  font-weight: 700;
  font-size: 1.2rem;
  transition: background-color .3s ease, color .3s ease, transform .2s ease;
}

/* description */
.description h2 {
  color: #2f5f87;
}

/* result */
.result h2, .result h4 {
  color: #2f5f87;
}

/* contribution */
.contribution h1, .contribution h2, .contribution h3 {
  color: #2f5f87;
}

.software h2, .software h4 {
  color: #2f5f87;
}
