/* ===== Description页面通用样式  ===== */

/* 1. Banner区域样式 */
.desc-section-one {
  background-image: url('https://static.igem.wiki/teams/5721/img/desc-banner-bg.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  width: 100%;
  height: 1064px;
  padding: 0 !important;
  margin: 0 !important;
}

/* Banner标题样式 */
.desc-banner-title {
  font-family: Arial-BoldMT;
  font-weight: bold;
  font-size: 100px;
  color: #FDFBFB;
  text-align: center;
}

/* 2. 主要布局样式 */
.desc-section-two {
  background-color: #F6F9F8;
  padding: 50px 0;
  min-height: 600px;
}

/* 确保容器支持 sticky 定位 */
.desc-section-two .container {
  position: relative;
  overflow: visible; /* 确保不限制 sticky 定位 */
}

.desc-section-two .row {
  position: relative;
  overflow: visible; /* 确保不限制 sticky 定位 */
}

.desc-section-two .col-lg-4 {
  overflow: visible; /* 确保列容器不限制 sticky 定位 */
}

/* 2. 左侧导航栏样式 */
.desc-left-nav {
  background-color: #EBF6FC;
  border-radius: 15px;
  padding: 30px;
  position: sticky !important; /* 使用 sticky 定位实现固定效果，!important 确保优先级 */
  top: 120px !important; /* 距离顶部 120px 时开始固定 */
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  max-height: 80vh; /* 限制最大高度为视窗高度的80% */
  overflow: visible; /* 允许装饰图片显示在容器外 */
  z-index: 10; /* 确保在其他元素之上 */
}

/* 确保 Bootstrap 不会覆盖 sticky 定位  */
.desc-section-two .col-lg-4 .desc-left-nav {
  position: sticky !important;
  top: 120px !important;
}

/* 移除导航栏本身的滚动条样式，只使用内容区域的滚动条 */

/* 导航内容区域的滚动条样式 */
.desc-left-nav-content::-webkit-scrollbar {
  width: 6px;
}

.desc-left-nav-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.desc-left-nav-content::-webkit-scrollbar-thumb {
  background: #A87779;
  border-radius: 3px;
}

.desc-left-nav-content::-webkit-scrollbar-thumb:hover {
  background: #8a5f61;
}

/* 添加平滑滚动 - */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px; /* 为导航栏留出空间 */
}

/* 移除调试样式，恢复正常外观 */

.desc-nav-top-image {
  position: absolute;
  top: -30px; /* 增加上边距，确保图片完全显示 */
  right: -30px; /* 增加右边距，确保图片完全显示 */
  width: 90px; /* 增加宽度 */
  height: 95px; /* 增加高度 */
  z-index: 15; /* 提高层级，确保显示在最上层 */
  pointer-events: none; /* 避免图片干扰点击事件 */
}

.desc-nav-top-image img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* 保持图片比例 */
  display: block; /* 确保图片正确显示 */
}

.desc-left-nav-content {
  margin-top: 0px;
  max-height: calc(80vh - 80px); /* 为装饰图片留出更多空间 */
  overflow-y: auto; /* 只显示垂直滚动条 */
  overflow-x: hidden; /* 完全隐藏水平滚动条 */
  position: relative; /* 确保内容区域正确定位 */
  z-index: 5; /* 确保在装饰图片下方 */
  width: 100%; /* 确保宽度正确 */
}

.desc-nav-item {
  display: flex;
  align-items: center;
  margin-bottom: 2px;
  padding: 3px 0;
  transition: all 0.3s ease;
}

.desc-nav-bullet {
  width: 14.4px;
  height: 14.4px;
  margin-right: 15px;
  flex-shrink: 0;
  background-image: url('https://static.igem.wiki/teams/5721/img/desc/desc-left-nav-arrow-default.webp');
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  transition: background-image 0.3s ease;
}

.desc-nav-link {
  font-family: Arial;
  font-weight: 400;
  font-size: 16px;
  color: #666666;
  line-height: 1.2;
  text-decoration: none;
  transition: color 0.3s ease;
}

.desc-nav-link:hover {
  color: #A87779;
}

/* 导航项hover效果 */
.desc-nav-item:hover {
  background-color: rgba(168, 119, 121, 0.1);
  border-radius: 8px;
  transform: translateX(5px);
}

/* 导航项hover时，项目符号切换 */
.desc-nav-item:hover .desc-nav-bullet {
  background-image: url('https://static.igem.wiki/teams/5721/img/desc/desc-left-nav-arrow-hover.webp');
}

/* 导航项激活状态 - 基于subcat-peking的实现 */
.desc-nav-item.active {
  background-color: #A87779;
  border-radius: 8px;
  transform: translateX(5px);
}

.desc-nav-item.active .desc-nav-bullet {
  background-image: url('https://static.igem.wiki/teams/5721/img/desc/desc-left-nav-arrow-hover.webp');
}

.desc-nav-item.active .desc-nav-link {
  color: #FFFFFF;
  font-weight: 600;
}

/* 3. 右侧内容区域 */
.desc-section-two-right {
  padding-left: 40px;
}

.desc-right-text-box {
  margin-bottom: 40px;
  background-color: #F6F9F8;
  border-radius: 10px;
  padding: 30px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.desc-right-title-bg {
  width: fit-content;
  min-width: 220px;
  height: 49px;
  background-color: #A87779;
  border-radius: 0px 20px 20px 0px;
  display: inline-flex;
  align-items: center;
  justify-content: left;
  margin-bottom: 20px;
  padding: 0 20px;
}

.desc-right-title {
  font-family: Arial;
  font-weight: bold;
  font-size: 22px;
  color: #FFFFFF;
  line-height: 1.2;
  margin: 0;
  text-align: left;
}

.desc-right-content {
  color: #333333;
  font-family: Arial;
  font-size: 16px;
  line-height: 1.6;
  text-align: justify;
}


/* 4. 响应式设计 */
@media (max-width: 1200px) {
  .desc-section-one {
    height: 900px !important;
  }

  .desc-banner-title {
    font-size: 80px;
  }
}

@media (max-width: 992px) {
  .desc-section-one {
    height: 800px !important;
  }

  .desc-banner-title {
    font-size: 70px;
  }

  .desc-section-two {
    padding: 40px 0;
  }

  /* 中等屏幕下取消 sticky 定位，改为普通布局 */
  .desc-left-nav {
    position: relative !important;
    top: auto !important;
    max-width: 350px;
    max-height: 70vh; /* 移动端稍微降低高度 */
  }

  .desc-left-nav-content {
    max-height: calc(70vh - 50px); /* 移动端导航内容高度 */
    overflow-y: auto; /* 只显示垂直滚动条 */
    overflow-x: hidden; /* 完全隐藏水平滚动条 */
    width: 100%; /* 确保宽度正确 */
  }

  .desc-section-two-right {
    padding-left: 20px;
  }
}

@media (max-width: 768px) {
  .desc-section-one {
    height: 600px !important;
  }

  .desc-banner-title {
    font-size: 50px;
  }

  .desc-section-two {
    padding: 30px 0;
  }

  .desc-left-nav {
    margin-bottom: 30px;
    max-width: 100%;
    padding: 25px;
    max-height: 60vh; /* 小屏幕设备降低高度 */
  }

  .desc-left-nav-content {
    max-height: calc(60vh - 40px); /* 小屏幕导航内容高度 */
    overflow-y: auto; /* 只显示垂直滚动条 */
    overflow-x: hidden; /* 完全隐藏水平滚动条 */
    width: 100%; /* 确保宽度正确 */
  }

  .desc-nav-bullet {
    width: 16px;
    height: 16px;
  }

  .desc-nav-item {
    margin-bottom: 2px;
    padding: 3px 0;
  }

  .desc-section-two-right {
    padding-left: 0;
  }

  .desc-right-text-box {
    padding: 20px;
    margin-bottom: 30px;
  }

  .desc-right-title-bg {
    width: fit-content;
    min-width: 180px;
    max-width: 100%;
  }

  .desc-nav-link {
    font-size: 14px;
  }
}

@media (max-width: 576px) {
  .desc-section-one {
    height: 500px !important;
  }

  .desc-banner-title {
    font-size: 40px;
  }

  .desc-section-two {
    padding: 20px 0;
  }

  .desc-left-nav {
    padding: 20px;
    margin: 0 10px;
    max-height: 50vh; /* 超小屏幕设备进一步降低高度 */
  }

  .desc-left-nav-content {
    max-height: calc(50vh - 35px); /* 超小屏幕导航内容高度 */
    overflow-y: auto; /* 只显示垂直滚动条 */
    overflow-x: hidden; /* 完全隐藏水平滚动条 */
    width: 100%; /* 确保宽度正确 */
  }

  .desc-nav-bullet {
    width: 18px;
    height: 18px;
    margin-right: 12px;
  }

  .desc-nav-item {
    margin-bottom: 3px;
    padding: 4px 0;
  }

  .desc-right-text-box {
    padding: 15px;
    margin: 0 10px 20px 10px;
  }

  .desc-right-title {
    font-size: 18px;
  }

  .desc-right-content {
    font-size: 14px;
  }

  .desc-nav-link {
    font-size: 12px;
  }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
  .desc-section-one {
    height: 400px !important;
  }

  .desc-banner-title {
    font-size: 32px;
  }

  .desc-section-two {
    padding: 15px 0;
  }

  .desc-left-nav {
    padding: 15px;
    margin: 0 5px;
    max-height: 45vh; /* 最小屏幕设备最低高度 */
  }

  .desc-left-nav-content {
    max-height: calc(45vh - 30px); /* 最小屏幕导航内容高度 */
    overflow-y: auto; /* 只显示垂直滚动条 */
    overflow-x: hidden; /* 完全隐藏水平滚动条 */
    width: 100%; /* 确保宽度正确 */
  }

  .desc-nav-bullet {
    width: 20px;
    height: 20px;
    margin-right: 10px;
  }

  .desc-nav-item {
    margin-bottom: 4px;
    padding: 5px 0;
  }

  .desc-right-text-box {
    padding: 12px;
    margin: 0 5px 15px 5px;
  }

  .desc-right-title-bg {
    min-width: 150px;
    height: 40px;
    padding: 0 15px;
  }

  .desc-right-title {
    font-size: 16px;
  }

  .desc-right-content {
    font-size: 13px;
  }

  .desc-nav-link {
    font-size: 11px;
  }
}


/* 5. 通用工具样式 */
/* 锚点样式 */
.anchor {
  display: block;
  position: relative;
  top: -100px;
  visibility: hidden;
  height: 0;
}

/* 二级导航样式 */
.desc-nav-sub {
  margin-left: 20px;
  font-size: 0.9em;
}

.desc-nav-sub .desc-nav-bullet {
  width: 6px;
  height: 6px;
  background-color: #666;
}

/* 首行缩进两个英文字符 */
.text-indent-2en {
  text-indent: 1em;
  display: inline-block;
  margin-bottom: 0;
}

/* 引用文本样式 - 无缩进 */
.reference-text {
  text-indent: 0 !important;
  text-align: left;
  margin: 0;
  padding: 0;
}

