/* =========================================
  Sticky Bar Container
  定位基准：下拉菜单将相对于此容器进行全宽定位
  ========================================= */
#top-icsections-container {
  position: sticky;
  top: var(--topnav-height-margin); /* 确保定义了此变量 */
  height: 40px;
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0;
  background-color: transparent;
}

/* 全屏深色背景伪元素 */
#top-icsections-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 100%;
  background-color: #334466;
  z-index: -1;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#top-icsections {
  display: flex;
  flex-grow: 1; /* 占据剩余空间 */
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  white-space: nowrap;
  padding-left: 10px;
  height: 40px;
  align-items: center;
}

#top-icsections::-webkit-scrollbar {
  display: none;
}

#top-icsections button {
  flex: 0 0 auto;
  margin-right: 1em;
  height: 100%;
  line-height: 1.5;
  padding: 0 0.8em;
  cursor: pointer;
  border: none;
  background-color: transparent;
  font-family: inherit;
  color: #fff;
  font-size: var(--font-size-nav);
  font-weight: normal;
  transition: color 0.3s;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* 按钮底部游标动画 */
#top-icsections button::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  background-color: #FF6D65;
  width: 0;
  transition: width 0.3s ease;
}

#top-icsections button:hover::after,
#top-icsections button.active::after {
  width: 100%;
}

#top-icsections button.active {
  font-weight: 700;
  background-color: #FF6D65;
}
