/* 中文页面导航栏覆盖样式（仅作用于 html[lang="zh-CN"]） */

html[lang="zh-CN"] .main-nav {
  /* 保持英文版导航容器的整体位置，避免整体左移/右移造成视觉“不对” */
  width: 26.774rem !important;
  margin: 0.667rem 0 0 15.6rem !important;
  padding: 0 0.8rem;
  flex-wrap: nowrap;
  justify-content: flex-start;
  align-items: center;
  /* 使用 gap 控制一级菜单之间的水平间距（兼容性更好） */
  gap: 0 1.05rem;
}

/* 取消英文版为导航项写死的宽度/左外边距 */
html[lang="zh-CN"] .main-nav-link,
html[lang="zh-CN"] .main-nav-link--home,
html[lang="zh-CN"] .main-nav-link--team,
html[lang="zh-CN"] .main-nav-link--research,
html[lang="zh-CN"] .main-nav-link--publications,
html[lang="zh-CN"] .main-nav-link--news,
html[lang="zh-CN"] .main-nav-link--activities,
html[lang="zh-CN"] .main-nav-link--contact {
  width: auto !important;
  margin-left: 0 !important;
}

html[lang="zh-CN"] .nav-dropdown {
  margin-left: 0 !important;
}

/* 下拉图标间距在中文布局里更紧凑一点 */
html[lang="zh-CN"] .thumbnail_3 {
  /* 与“团队成员(下拉)”更贴近：在保留 common.css 顶部间距的同时，轻微向左收 */
  margin: 0.087rem 0 0 0.22rem !important;
}

/* 下划线位置：英文页使用的 left 偏移在中文时容易显得错位 */
html[lang="zh-CN"] .main-nav a.nav-active::after,
html[lang="zh-CN"] .main-nav a.main-nav-link--home::after,
html[lang="zh-CN"] .main-nav a.main-nav-link--team::after,
html[lang="zh-CN"] .nav-dropdown > a.nav-active::after {
  left: 0 !important;
}

/* detail_lanmu(PI) 中文页：只让“团队成员”呈现激活态（覆盖 detail_pi.css 的强制高亮） */
html[lang="zh-CN"][data-cn-nav-active="team"] .main-nav a.main-nav-link--research,
html[lang="zh-CN"][data-cn-nav-active="team"] .main-nav a.main-nav-link--publications {
  color: rgba(0, 102, 204, 1) !important;
}

html[lang="zh-CN"][data-cn-nav-active="team"] .main-nav a.main-nav-link--research::after,
html[lang="zh-CN"][data-cn-nav-active="team"] .main-nav a.main-nav-link--publications::after {
  content: none !important;
}

/* 小屏稍微降一点字号，避免一行塞不下 */
@media (max-width: 768px) {
  html[lang="zh-CN"] .main-nav {
    flex-wrap: wrap;
    column-gap: 0.8rem;
    row-gap: 0.4rem;
  }

  html[lang="zh-CN"] .main-nav-link {
    font-size: 0.44rem;
  }
}

/* 底部栏：四个链接在中文页下对齐（移除固定 width/margin-left） */
html[lang="zh-CN"] .group_10 .box_4,
html[lang="zh-CN"] .group_9 .box_8 {
  width: auto !important;
  display: flex !important;
  align-items: center !important;
  /* 仅用于四个直系 a（logo 在前面是 div.text-wrapper_*） */
  gap: 0 0.9rem !important;
}

/* 只处理 box_4 / box_8 里的四个直系链接，避免影响 logo 容器内部的 a */
html[lang="zh-CN"] .group_10 .box_4 > a,
html[lang="zh-CN"] .group_9 .box_8 > a {
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
  margin-left: 0.25rem !important;
}

.site-header-lang-text{
  margin: 0.05rem 0rem 0 0.1rem !important;
}

/* 中文页通用：语义化底部栏 */
html[lang="zh-CN"] .site-footer {
  background-color: rgba(0, 102, 204, 1);
  width: 100%;
  min-height: 3.2rem;
  margin: 0;
}

html[lang="zh-CN"] .site-footer-main {
  width: 20.56rem;
  margin: 0.72rem 0 0 8.747rem;
  display: flex;
  align-items: center;
  gap: 0 0.9rem;
}

html[lang="zh-CN"] .site-footer-brand {
  width: 5.52rem;
  min-width: 5.52rem;
  font-size: 0;
  white-space: nowrap;
}

html[lang="zh-CN"] .site-footer-brand a {
  display: inline-flex;
  align-items: baseline;
  text-decoration: none;
  color: rgba(255, 255, 255, 1);
}

html[lang="zh-CN"] .site-footer-brand-initial,
html[lang="zh-CN"] .site-footer-brand-text {
  color: rgba(255, 255, 255, 1);
  font-size: 0.906rem;
  font-family: SourceHanSerifCN-Heavy;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

html[lang="zh-CN"] .site-footer-link {
  color: rgba(255, 255, 255, 1);
  font-size: 0.426rem;
  font-family: MicrosoftYaHei-Bold;
  font-weight: 700;
  line-height: 1;
  margin-top: 0.187rem;
  white-space: nowrap;
}

html[lang="zh-CN"] .site-footer-copy-wrap {
  margin: 0.4rem 0 0 calc(8.747rem + 5.52rem + 0.9rem);
  justify-content: flex-start;
}

html[lang="zh-CN"] .site-footer-copy {
  color: rgba(255, 255, 255, 1);
  font-size: 0.426rem;
  font-family: MicrosoftYaHei;
  line-height: 1;
  white-space: nowrap;
  text-align: left;
}

/* Alumni 中文页：语义化底部栏 */
html[lang="zh-CN"] .page-alumni-cn .site-footer {
  background-color: rgba(0, 102, 204, 1);
  width: 100%;
  min-height: 3.2rem;
  margin: 0;
}

html[lang="zh-CN"] .page-alumni-cn .site-footer-main {
  width: 20.56rem;
  margin: 0.72rem 0 0 8.747rem;
  display: flex;
  align-items: center;
  gap: 0 0.9rem;
}

html[lang="zh-CN"] .page-alumni-cn .site-footer-brand {
  width: 5.52rem;
  min-width: 5.52rem;
  font-size: 0;
  white-space: nowrap;
}

html[lang="zh-CN"] .page-alumni-cn .site-footer-brand a {
  display: inline-flex;
  align-items: baseline;
  text-decoration: none;
  color: rgba(255, 255, 255, 1);
}

html[lang="zh-CN"] .page-alumni-cn .site-footer-brand-initial,
html[lang="zh-CN"] .page-alumni-cn .site-footer-brand-text {
  color: rgba(255, 255, 255, 1);
  font-size: 0.906rem;
  font-family: SourceHanSerifCN-Heavy;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

html[lang="zh-CN"] .page-alumni-cn .site-footer-link {
  color: rgba(255, 255, 255, 1);
  font-size: 0.426rem;
  font-family: MicrosoftYaHei-Bold;
  font-weight: 700;
  line-height: 1;
  margin-top: 0.187rem;
  white-space: nowrap;
}

html[lang="zh-CN"] .page-alumni-cn .site-footer-copy-wrap {
  margin: 0.4rem 0 0rem calc(8.747rem + 5.52rem + 0.9rem);
  justify-content: flex-start;
}

html[lang="zh-CN"] .page-alumni-cn .site-footer-copy {
  color: rgba(255, 255, 255, 1);
  font-size: 0.426rem;
  font-family: MicrosoftYaHei;
  line-height: 1;
  white-space: nowrap;
  text-align: left;
}

/* RI 中文页：语义化底部栏（与 alumni 一致） */
html[lang="zh-CN"] .page-research-detail-cn .site-footer {
  background-color: rgba(0, 102, 204, 1);
  width: 100%;
  min-height: 3.2rem;
  margin: 0;
}

html[lang="zh-CN"] .page-research-detail-cn .site-footer-main {
  width: 20.56rem;
  margin: 0.72rem 0 0 8.747rem;
  display: flex;
  align-items: center;
  gap: 0 0.9rem;
}

html[lang="zh-CN"] .page-research-detail-cn .site-footer-brand {
  width: 5.52rem;
  min-width: 5.52rem;
  font-size: 0;
  white-space: nowrap;
}

html[lang="zh-CN"] .page-research-detail-cn .site-footer-brand a {
  display: inline-flex;
  align-items: baseline;
  text-decoration: none;
  color: rgba(255, 255, 255, 1);
}

html[lang="zh-CN"] .page-research-detail-cn .site-footer-brand-initial,
html[lang="zh-CN"] .page-research-detail-cn .site-footer-brand-text {
  color: rgba(255, 255, 255, 1);
  font-size: 0.906rem;
  font-family: SourceHanSerifCN-Heavy;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

html[lang="zh-CN"] .page-research-detail-cn .site-footer-link {
  color: rgba(255, 255, 255, 1);
  font-size: 0.426rem;
  font-family: MicrosoftYaHei-Bold;
  font-weight: 700;
  line-height: 1;
  margin-top: 0.187rem;
  white-space: nowrap;
}

html[lang="zh-CN"] .page-research-detail-cn .site-footer-copy-wrap {
  margin: 0.4rem 0 0 calc(8.747rem + 5.52rem + 0.9rem);
  justify-content: flex-start;
}

html[lang="zh-CN"] .page-research-detail-cn .site-footer-copy {
  color: rgba(255, 255, 255, 1);
  font-size: 0.426rem;
  font-family: MicrosoftYaHei;
  line-height: 1;
  white-space: nowrap;
  text-align: left;
}

/* Alumni 中文页：research_detail.css 会误高亮“研究方向”，这里恢复普通态 */
html[lang="zh-CN"] .page-alumni-cn .main-nav a.main-nav-link--research {
  color: rgba(0, 102, 204, 1) !important;
}

html[lang="zh-CN"] .page-alumni-cn .main-nav a.main-nav-link--research::after {
  content: none !important;
}

/* 小屏：底部栏与 contact/news 等页统一为可换行、居中，避免横向溢出 */
@media (max-width: 768px) {
  html[lang="zh-CN"] .group_9 {
    height: auto !important;
    min-height: 3.2rem;
    padding: 0.48rem 0.4rem 0.56rem;
    box-sizing: border-box;
  }

  html[lang="zh-CN"] .group_9 .box_8 {
    flex-wrap: wrap !important;
    justify-content: center !important;
    margin-left: 0 !important;
    margin-top: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    row-gap: 0.36rem !important;
    column-gap: 0.5rem !important;
  }

  html[lang="zh-CN"] .group_9 .text-wrapper_3 {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    justify-content: center;
  }

  html[lang="zh-CN"] .group_9 .text-wrapper_4 {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0.2rem 0 0 !important;
    justify-content: center !important;
  }

  html[lang="zh-CN"] .group_9 .text_19 {
    white-space: normal !important;
    text-align: center !important;
    width: auto !important;
    max-width: 100%;
    height: auto !important;
    line-height: 1.35 !important;
    font-size: 0.36rem !important;
  }

  html[lang="zh-CN"] .site-footer {
    padding: 0.48rem 0.4rem 0.56rem;
    box-sizing: border-box;
  }

  html[lang="zh-CN"] .site-footer-main {
    width: 100%;
    margin: 0;
    flex-wrap: wrap;
    justify-content: flex-start;
    row-gap: 0.36rem;
    column-gap: 0.5rem;
  }

  html[lang="zh-CN"] .site-footer-brand {
    width: auto;
    min-width: 0;
  }

  html[lang="zh-CN"] .site-footer-copy-wrap {
    margin: 0.2rem 0 0;
  }

  html[lang="zh-CN"] .site-footer-copy {
    white-space: normal;
    line-height: 1.35;
    font-size: 0.36rem;
  }

  html[lang="zh-CN"] .page-alumni-cn .site-footer {
    padding: 0.48rem 0.4rem 0.56rem;
    box-sizing: border-box;
  }

  html[lang="zh-CN"] .page-alumni-cn .site-footer-main {
    width: 100%;
    margin: 0;
    flex-wrap: wrap;
    justify-content: flex-start;
    row-gap: 0.36rem;
    column-gap: 0.5rem;
  }

  html[lang="zh-CN"] .page-alumni-cn .site-footer-brand {
    width: auto;
    min-width: 0;
  }

  html[lang="zh-CN"] .page-alumni-cn .site-footer-copy-wrap {
    margin: 0.2rem 0 0;
  }

  html[lang="zh-CN"] .page-alumni-cn .site-footer-copy {
    white-space: normal;
    line-height: 1.35;
    font-size: 0.36rem;
  }

  html[lang="zh-CN"] .page-research-detail-cn .site-footer {
    padding: 0.48rem 0.4rem 0.56rem;
    box-sizing: border-box;
  }

  html[lang="zh-CN"] .page-research-detail-cn .site-footer-main {
    width: 100%;
    margin: 0;
    flex-wrap: wrap;
    justify-content: flex-start;
    row-gap: 0.36rem;
    column-gap: 0.5rem;
  }

  html[lang="zh-CN"] .page-research-detail-cn .site-footer-brand {
    width: auto;
    min-width: 0;
  }

  html[lang="zh-CN"] .page-research-detail-cn .site-footer-copy-wrap {
    margin: 0.2rem 0 0;
  }

  html[lang="zh-CN"] .page-research-detail-cn .site-footer-copy {
    white-space: normal;
    line-height: 1.35;
    font-size: 0.36rem;
  }
}

/*
 * 本文件仅被 *-cn 模板引入。部分环境下 html 的 lang 会被改写或省略，
 * 仅靠 html[lang="zh-CN"] 时顶部下划线滑块仍会被 team.css、research_detail.css
 * 等后加载样式里的 left: 0.2rem 盖住。以下不依赖 lang，并用 !important 保证生效。
 */
.main-nav a.nav-active::after,
.main-nav a.main-nav-link--home::after,
.main-nav a.main-nav-link--team::after,
.main-nav a.main-nav-link--research::after,
.main-nav a.main-nav-link--publications::after,
.main-nav a.main-nav-link--news::after,
.main-nav a.main-nav-link--activities::after,
.main-nav a.main-nav-link--contact::after,
.nav-dropdown > a.nav-active::after {
  left: 0 !important;
}

.main-nav-link,
.main-nav-link--home,
.main-nav-link--team,
.main-nav-link--research,
.main-nav-link--publications,
.main-nav-link--news,
.main-nav-link--activities,
.main-nav-link--contact {
  width: auto !important;
  margin-left: 0 !important;
}

.nav-dropdown {
  margin-left: 0 !important;
}