/* 滚动按钮通用样式 */
.scroll-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: none;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  color: #666;
}

.scroll-btn:hover {
  background-color: #fff;
  color: #0056b3;
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.scroll-btn:active {
  transform: translateY(-50%) scale(0.95);
}

/* 左右按钮位置 */
.scroll-btn-left,
.tags-scroll-btn-left {
  left: -5px; /* 按钮宽度32px，完全超出显示 */
}

.scroll-btn-right,
.tags-scroll-btn-right {
  right: -5px; /* 按钮宽度32px，完全超出显示 */
}

/* 滚动按钮容器样式 */
.scroll-container-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  overflow: visible; /* 确保按钮可以超出容器显示 */
}

/* 确保topic-nav-container在包装器中正确布局 */
.scroll-container-wrapper .topic-nav-container {
  flex: 1 !important;
  min-width: 0 !important;
  white-space: nowrap !important;
  overflow-x: auto !important;
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 10px !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  scroll-behavior: smooth !important;
}

.scroll-container-wrapper .topic-nav-container::-webkit-scrollbar {
  display: none !important;
}

/* 修复recommend-tab文字溢出问题 */
.scroll-container-wrapper .recommend-tab {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 150px !important;
  display: inline-block !important;
  vertical-align: top !important;
  font-size: 13px !important;
  line-height: 48px !important;
  font-weight: 500 !important;
  padding: 0 16px !important;
  cursor: pointer !important;
  float: none !important;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
}

/* 确保父容器不会裁剪按钮 */
.topic-nav-wrapper {
  overflow: visible !important;
}

.recommend-tabs {
  overflow: visible !important;
}

/* 当容器悬浮且有滚动条时显示按钮 */
.scroll-container-wrapper:hover .scroll-btn.show {
  opacity: 1;
  visibility: visible;
}

/* Tags区域滚动按钮样式 */
.tags-scroll-container-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

/* 确保tags-wrapper-container在包装器中正确布局 */
.tags-scroll-container-wrapper .tags-wrapper-container {
  flex: 1;
  min-width: 0;
  padding-right: 40px;
}

/* 修复tabs-item文字溢出问题 */
.tags-scroll-container-wrapper .tabs-item {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 120px !important;
  display: inline-block !important;
  vertical-align: top !important;
  float: none !important;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
}

/* 确保父容器不会裁剪按钮 */
.tabs-list {
  overflow: visible !important;
}

.tags-content {
  overflow: visible !important;
}

/* 当容器悬浮且有滚动条时显示按钮 */
.tags-scroll-container-wrapper:hover .scroll-btn.show {
  opacity: 1;
  visibility: visible;
}

/* 确保active样式正确应用 */
.recommend-tab.active {
  background-color: rgba(0, 106, 216, 0.08) !important;
  font-weight: 600 !important;
}

.tabs-item.active {
  border: 1px solid #006AD8 !important;
  color: #006AD8 !important;
  background-color: rgba(0, 106, 216, 0.08) !important;
}

/* 移动端隐藏滚动按钮 */
@media (max-width: 768px) {
  .scroll-btn {
    display: none;
  }
}
