@font-face {
  font-family: Alimama;
  /* src: url("alimamadongfangdakai-regular.otf") format('opentype'); */
  src: url("alimamadongfangdakai-regular.otf") format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bs-font-sans-serif: Alimama;
  --bs-body-font-family: Alimama;
  --bs-heading-font-family: Alimama;
}

html {
  font-family: Alimama;
}


/* Cloud backgrounds for H2 headings on all pages */
h2 {
  position: relative;
  padding: 1.25rem 1rem 1rem 1rem;
  border-bottom: none;
  color: #0b3a6f;
  display: inline-block;
  max-width: 100%;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 100% 100%;
  border-radius: 12px;
}

/* Explicit classes for rotating backgrounds */
.h2-bg-1 { background-image: url('https://static.igem.wiki/teams/5971/team-members/title-field-1.webp'); }
.h2-bg-2 { background-image: url('https://static.igem.wiki/teams/5971/team-members/title-field-2.webp'); }
.h2-bg-3 { background-image: url('https://static.igem.wiki/teams/5971/team-members/title-field-3.webp'); }

@media (max-width: 768px) {
  .content-wrapper h2,
  h2 {
    background-size: 100% 100%;
    padding: 1rem 0.75rem 0.75rem 0.75rem;
  }
}

/* Note styling for protocol pages */
.note {
  margin-left: 20px;
  font-style: italic;
  margin-bottom: 10px;
  color: #666;
  font-size: 0.9em;
}

/* Chart description styling for entrepreneurship page */
.chart-desc {
  margin: 10px 0;
  font-style: italic;
  font-size: 0.9em;
  color: #666;
}

body {
  padding-top: 56px;
  font-family: Alimama;
  background-color: #d5f9ff;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6,
p, a, li,
button, input, textarea, select {
  font-family: Alimama;
}

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

.bg-dark {
  background-color: #0046D4 !important;
}

.bg-hero {
  background-color: #0046d4;
}

/* Page frame and right side decoration */
.page-frame {
  position: relative;
}

.page-frame .side-deco {
  position: absolute;
  top: 0;
  left: 0;
  width: 10%;
  height: calc(100% - 1px);
  background-repeat: repeat-y;
  background-position: left top;
  background-size: 100% auto;
  pointer-events: none;
  z-index: 100;
}

/* Keep content above decoration when needed */
.page-frame header,
.page-frame .container {
  position: relative;
  z-index: 2;
}

@media (max-width: 992px) {
  .page-frame .side-deco {
    display: none;
  }
}

/* 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;
}

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

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

/* ========== 页面蓝色背景层 ========== */
.page-blue-layer {
  position: fixed;
  left: 0;
  top: 66px;
  bottom: 0;
  width: 92px;
  background: #0046D4;
  z-index: 0;
}

/* ========== 侧边导航样式 ========== */
.side-nav {
  position: fixed;
  left: 0;
  top: 460px;
  width: 172px;
  background: transparent;
  padding: 20px 0;
  max-height: calc(100vh - 460px);
  overflow-y: auto;
  z-index: 10;
  transition: all 0.3s ease;
  box-shadow: none;
}

.side-nav.fixed {
  top: 80px;
  max-height: calc(100vh - 80px);
  z-index: 10;
}

.side-nav.below-footer {
  z-index: 10;
}

.side-nav-title {
  font-size: 16px;
  font-weight: bold;
  color: white;
  margin-bottom: 20px;
  text-transform: uppercase;
  padding: 0 20px;
  letter-spacing: 1px;
}

.side-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.side-nav-item {
  margin-bottom: 2px;
}

.side-nav-link {
  display: block;
  padding: 12px 20px 12px 1em; /* 左侧2个字符距离 */
  color: white;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.3s ease;
  background-image: url('https://static.igem.wiki/teams/5971/team-members/left-navbox-1.webp');
  background-size: calc(100% + 30px) 100%; /* 向右拉伸30px */
  background-position: -30px center; /* 左移30px */
  background-repeat: no-repeat;
  margin: 0;
  border-radius: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-nav-link:hover {
  background-image: url('https://static.igem.wiki/teams/5971/team-members/left-navbox-2.webp');
  background-size: calc(100% + 30px) 100%; /* 向右拉伸30px */
  background-position: -30px center;
}

.side-nav-link.active {
  background-image: url('https://static.igem.wiki/teams/5971/team-members/left-navbox-2.webp');
  background-size: calc(100% + 32px) 100%; /* 向右拉伸30px + 2px偏移 */
  background-position: -32px center;
  font-weight: 600;
}

/* 二级导航 */
.side-nav-sublist {
  list-style: none;
  padding-left: 0;
  margin: 5px 0 10px 0;
}

.side-nav-subitem {
  margin-bottom: 2px;
}

.side-nav-sublink {
  display: block;
  padding: 8px 20px 8px 35px;
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-size: 13px;
  transition: all 0.3s ease;
}

.side-nav-sublink:hover {
  color: white;
  transform: translateX(5px);
}

.side-nav-sublink.active {
  color: white;
  font-weight: 500;
  background: rgba(255,255,255,0.1);
  margin: 0 10px;
  border-radius: 4px;
}

/* 为内容区域添加左侧margin */
.page-content-with-nav {
  margin-left: 162px;
}

/* 移动端隐藏侧边栏 */
@media (max-width: 992px) {
  .side-nav {
    display: none;
  }
  .page-content-with-nav {
    margin-left: 0;
  }
}

/* 侧边导航滚动条样式 */
.side-nav::-webkit-scrollbar {
  width: 4px;
}

.side-nav::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
}

.side-nav::-webkit-scrollbar-track {
  background: transparent;
}










