body{
  overflow-x: clip;
  --icnav-bg-color: #334466; /* f3f1f7 */
  --icnav-font-color: #FFFFFF; /* 333333 */
}

#top-sections-container {
  /* --- 核心修改 --- */
  position: sticky;
  z-index: 900; /* 确保它在滚动时能覆盖在其他内容之上 */

  /* --- 原有样式保留 --- */
  background-color: transparent; /* 背景交由伪元素处理 */
  padding-left: 0;
  padding-right: 0;
}

/*
  全屏背景伪元素方案 (保持不变)
  这个方案在 position: sticky 下依然完美工作。
*/
#top-sections-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 100%;
  background-color: var(--icnav-bg-color);
  border: none;
  z-index: -1; /* 将伪元素置于父元素内容的下方 */
}

/*
  移除了所有的 #top-sections-container.sticky 规则，
  因为 position: sticky 会自动处理，不再需要这些。
*/

/*
  针对移动端的内边距调整 (保持不变)
  这部分逻辑与粘性定位无关，是针对小屏幕的布局适应，应当保留。
*/
@media (max-width: 1200px) {
  #top-sections-container {
    /*
      3. 确保 padding 被计算在元素的总宽度之内，
         防止容器超出视口宽度。
    */
    box-sizing: border-box;
  }
}


/* 以下为内部元素样式，保持不变 */

.top-tab-content {
  display: none;
}

.top-tab-content.active {
  display: block;
}

#top-sections {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  white-space: nowrap;
  padding-left: 0;
}

#top-sections::-webkit-scrollbar {
  display: none; /* Chrome, Safari and Opera */
}

/* 修改选择器，适配 a 标签 */
#top-sections a {
  display: flex; /* Flex 布局以垂直居中文字 */
  flex: 0 0 auto;
  margin-left: 0.5em;
  margin-top: 2.5px;
  margin-bottom: 2.5px;
  height: 35px;
  padding: 0 1em;
  cursor: pointer;
  border: 1px solid #FFFFFF;
  border-radius: 17px;
  background-color: transparent;

  /* 字体设置 */
  font-family: inherit;
  color: var(--icnav-font-color);
  font-weight: normal;
  text-decoration: none; /* 去除下划线 */

  transition: all 0.3s;
  justify-content: center;
  align-items: center;
}

/* Hover 状态 */
#top-sections a:hover {
  background-color: #FF6D65;
  border-color: #FF6D65;
  color: #fff;
}

/* Active 状态 */
#top-sections a.active {
  border: 1px solid #FF6D65; /* 保持边框或者去掉视设计而定 */
  background-color: #FF6D65;
  font-weight: 700;
  color: #fff;
}
