.c-header{
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 10000;
}
/* 话题标签区域 */
.topic-tags {
    min-height: 120px;
    display: flex;
    align-items: center;
    padding: 15px 0;
}

.topic-tabs {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* 确保包含滚动按钮的容器允许overflow */
.topic-nav-wrapper.container,
.tags-content.container {
    overflow: visible !important;
}

.topic-nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    position: relative;
    overflow: visible; /* 确保滚动按钮可以超出显示 */
}

.topic-nav-container {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow-x: auto;
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    cursor: grab;
    user-select: none;
    -webkit-overflow-scrolling: touch; /* iOS 滚动优化 */
}

.topic-nav-container:active {
    cursor: grabbing;
}

.topic-nav-container::-webkit-scrollbar {
    display: none;
}

.topic-nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 10px;
    flex-wrap: nowrap;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    flex: 1;
    min-width: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    cursor: grab;
}

.topic-nav::-webkit-scrollbar {
    display: none;
}

.topic-nav:active {
    cursor: grabbing;
}

.topic-item {
    margin: 0;
    flex-shrink: 0;
}

.topic-link {
    display: inline-block;
    padding: 8px 16px;
    text-decoration: none;
    color: #231815;
    font-weight: 500;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
}

.topic-link:hover {
    color: #006ADB;
    background-color: rgba(0, 106, 219, 0.1);
    text-decoration: none;
}

.topic-link.active {
    color: #006ADB;
    background-color: rgba(0, 106, 219, 0.1);
    font-weight: 600;
}

.topic-more {
    margin-left: 20px;
}

.more-link {
    color: #231815;
    font-weight: 500;
    background: none;
    border: none;
}

.more-link:hover {
    color: #006ADB;
    text-decoration: none;
}

.more-span {
    padding: 8px 0;
    text-decoration: none;
}

/* Tags部分 */
.tags-section {
    min-height: 60px;
    padding: 15px 0;
    display: flex;
    align-items: center;
    box-sizing: border-box;
}

.tags-content {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    position: relative;
}

.tags-scroll-container-wrapper {
    flex: 1;
    min-width: 0;
    max-width: calc(100% - 200px); /* 为搜索框预留200px空间 */
    position: relative;
    display: flex;
    align-items: center;
}

.tags-wrapper-container {
    flex: 1;
    min-width: 0;
    display: flex;
    white-space: nowrap;
    overflow-x: auto;
    gap: 10px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    cursor: grab;
}

.tags-wrapper-container::-webkit-scrollbar {
    display: none;
}

.tags-wrapper-container:active {
    cursor: grabbing;
}



.tags-wrapper:active {
    cursor: grabbing;
}

.tags-search {
    margin-left: 10px;
    flex-shrink: 0;
    min-width: 120px;
}

.search-wrapper {
    display: flex;
    width: 200px;
    border: none;
    border-radius: 5px;
    background-color: #f1f3f4;
    transition: background-color 0.15s ease-in-out;
    overflow: hidden;
}

.search-wrapper:focus-within {
    background-color: #e8eaed;
}

.search-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    background-color: transparent;
    border: none;
    color: #9aa0a6;
}

.search-input-custom {
    flex: 1;
    border: none;
    outline: none;
    padding: 8px 12px 8px 0;
    font-size: 14px;
    background: transparent;
    color: #3c4043;
}

.search-input-custom::placeholder {
    color: #9aa0a6;
    font-size: 14px;
}

.search-input-bootstrap::placeholder {
    color: #9ca3af;
    font-size: 13px;
}

.tag-item {
    display: inline-block;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 400;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #dee2e6;
    color: #6c757d;
    background-color: white;
    flex-shrink: 0;
    white-space: nowrap;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.tag-item:hover {
    border-color: #006ADB;
    color: #006ADB;
}

.tag-item:focus {
    outline: none;
}

.tag-item:active {
    transform: scale(0.98);
}

.tag-item.tag-active {
    background-color: #E3F2FD;
    border-color: #006ADB;
    color: #006ADB;
}

.tag-item.tag-active:hover {
    background-color: #BBDEFB;
    border-color: #0056B3;
    color: #0056B3;
}

.tag-item.tag-active:focus {
    background-color: #E3F2FD;
    border-color: #006ADB;
    color: #006ADB;
}

/* 移动设备特殊处理 */
@media (hover: none) and (pointer: coarse) {
    .tag-item:hover {
        border-color: #dee2e6;
        color: #6c757d;
    }

    .tag-item:not(.tag-active):focus {
        border-color: #dee2e6;
        color: #6c757d;
        background-color: white;
    }
}

/* 响应式设计 */

/* 超大屏幕 (大桌面) */
@media (min-width: 1400px) {
    .topic-tags {
        min-height: 130px;
    }

    .search-wrapper {
        width: 260px;
    }

    .topic-link {
        padding: 9px 18px;
        font-size: 15px;
    }

    .tag-item {
        padding: 7px 14px;
        font-size: 15px;
    }
}

/* 大屏幕 (桌面) */
@media (min-width: 1200px) and (max-width: 1399px) {
    .topic-tags {
        min-height: 125px;
    }

    .search-wrapper {
        width: 240px;
    }

    .topic-link {
        padding: 8px 16px;
        font-size: 14px;
    }

    .tag-item {
        padding: 6px 12px;
        font-size: 14px;
    }
}

/* 中等屏幕 (小桌面/大平板) */
@media (min-width: 992px) and (max-width: 1199px) {
    .topic-tags {
        min-height: 120px;
    }

    .search-wrapper {
        width: 180px;
    }

    .topic-nav {
        gap: 8px;
    }

    .topic-link {
        padding: 7px 14px;
        font-size: 13px;
    }

    .tag-item {
        font-size: 13px;
        padding: 6px 11px;
    }
}

/* 平板设备 (iPad等) */
@media (min-width: 769px) and (max-width: 991px) {
    .topic-tags {
        min-height: 115px;
    }

    .topic-nav {
        gap: 7px;
    }

    .topic-link {
        font-size: 12px;
        padding: 6px 12px;
    }

    .tags-section {
        min-height: 55px;
        padding: 12px 0;
    }

    .tags-wrapper {
        gap: 7px;
    }

    .tag-item {
        font-size: 12px;
        padding: 5px 10px;
    }

    .search-wrapper {
        width: 160px;
    }

    .search-input-custom {
        font-size: 13px;
        padding: 8px 10px 8px 0;
    }
}

/* 小平板/大手机 (横屏) */
@media (min-width: 577px) and (max-width: 768px) {
    .topic-tags {
        min-height: 110px;
    }

    .topic-nav {
        gap: 6px;
    }

    .topic-link {
        font-size: 11px;
        padding: 5px 10px;
    }

    .tags-section {
        min-height: 50px;
        padding: 10px 0;
    }

    .tags-wrapper {
        gap: 6px;
    }

    .tag-item {
        font-size: 11px;
        padding: 4px 8px;
    }

    .search-wrapper {
        width: 140px;
    }

    .search-input-custom {
        font-size: 12px;
        padding: 7px 8px 7px 0;
    }

    .search-icon-wrapper {
        padding: 0 8px;
    }
}

/* 手机设备 (竖屏) */
@media (max-width: 576px) {
    .topic-tags {
        min-height: 105px;
        padding: 10px 0;
    }

    .topic-nav {
        gap: 4px;
    }

    .topic-link {
        font-size: 10px;
        padding: 4px 8px;
        letter-spacing: 0.2px;
    }

    .tags-section {
        min-height: 45px;
        padding: 10px 0;
    }

    .tags-wrapper {
        gap: 4px;
    }

    .tag-item {
        font-size: 10px;
        padding: 3px 6px;
    }

    .search-wrapper {
        width: 120px;
        border-radius: 15px;
    }

    .search-input-custom {
        font-size: 11px;
        padding: 6px 6px 6px 0;
    }

    .search-icon-wrapper {
        padding: 0 6px;
    }

    .topic-more {
        margin-left: 6px;
    }

    .tags-search {
        margin-left: 6px;
    }

    .tags-scroll-container-wrapper {
        max-width: calc(100% - 140px); /* 为搜索框预留140px空间 */
    }
}

/* 超小屏幕 (小手机) */
@media (max-width: 375px) {
    .topic-tags {
        min-height: 100px;
        padding: 8px 0;
    }

    .topic-nav {
        gap: 3px;
    }

    .topic-link {
        font-size: 9px;
        padding: 3px 6px;
        letter-spacing: 0.1px;
    }

    .tags-section {
        min-height: 40px;
        padding: 8px 0;
    }

    .tags-wrapper {
        gap: 3px;
    }

    .tag-item {
        font-size: 9px;
        padding: 2px 5px;
    }

    .search-wrapper {
        width: 100px;
        border-radius: 12px;
    }

    .search-input-custom {
        font-size: 10px;
        padding: 5px 4px 5px 0;
    }

    .search-icon-wrapper {
        padding: 0 5px;
    }

    .topic-more {
        margin-left: 6px;
    }

    .tags-search {
        margin-left: 6px;
    }

    .tags-scroll-container-wrapper {
        max-width: calc(100% - 120px); /* 为搜索框预留120px空间 */
    }
}

/* 重写icon的样式 */
.bi-chevron-down::before {
    font-weight: 700 !important;
}

/* 为新的话题与标签结构添加样式 */
.recommend-tabs {
    background-color: rgba(8, 28, 58, 0.04);
    overflow: visible; /* 允许滚动按钮超出显示 */
}

.recommend-tab {
    font-size: 13px;
    line-height: 48px;
    font-weight: 500;
    padding: 0 16px;
    float: left;
    cursor: pointer;
    text-align: center;
}

.recommend-tab.active {
    background-color: rgba(0, 106, 216, 0.08);
}

.tabs-list {
    margin-top: 15px;
    overflow: visible; /* 允许滚动按钮超出显示 */
}

.tabs-list .tabs-item {
    font-size: 13px;
    background-color: rgba(8, 28, 58, 0.04);
    border: 1px solid rgba(8, 28, 58, 0.04);
    color: #000;
    padding: 8px 12px;
    float: left;
    cursor: pointer;
    text-align: center;
}

.tabs-list .tabs-item.active {
    border: 1px solid #006AD8;
    color: #006AD8;
}

/* ==================== 性能优化样式 ==================== */

/* 关键渲染路径优化 */
.topic-nav-container,
.tags-wrapper-container {
    contain: layout style paint;
    content-visibility: auto;
}

/* 减少重排重绘 */
.user-panel,
.dropdown-menu {
    contain: layout;
    will-change: auto;
}

/* 首屏内容优先渲染 */
.topic-tags,
.recommend-tabs {
    contain: layout style;
}

/* 图片懒加载样式 */
img[data-src] {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    background-color: #f5f5f5;
    background-image: linear-gradient(45deg, #f0f0f0 25%, transparent 25%),
                      linear-gradient(-45deg, #f0f0f0 25%, transparent 25%),
                      linear-gradient(45deg, transparent 75%, #f0f0f0 75%),
                      linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

img[data-src].loaded {
    opacity: 1;
}


.recommend-tabs {
  background-color: rgba(8, 28, 58, 0.04);
  overflow: visible; /* 允许滚动按钮超出显示 */
}

.recommend-tab {
  font-size: 13px;
  line-height: 48px;
  font-weight: 500;
  padding: 0 16px;
  float: left;
  cursor: pointer;
}

.recommend-tab.active {
  background-color: rgba(0, 106, 216, 0.08);
} 

/* 拖拽滚动优化 */
.tags-wrapper-container {
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.tags-wrapper-container:active {
    cursor: grabbing;
}


/* 用户界面优化 */
.user-panel {
    transition: all 0.3s ease;
}

.user-avatar {
    width: 32px;
    height: 32px;
    margin-right: 8px;
    cursor: pointer;
    border-radius: 50%;
    transition: transform 0.3s ease;
    border: 2px solid transparent;
}

.user-avatar-default {
    width: 32px;
    height: 32px;
    margin-right: 8px;
    cursor: pointer;
    border-radius: 50%;
    background-color: #c9cdd4;
    transition: transform 0.3s ease, background-color 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.user-avatar-default svg {
    width: 1em;
    height: 1em;
    color: white;
    display: block;
}

/* MEMBER按钮样式优化 */
.main-button {
    text-decoration: none !important;
}

.main-button:hover {
    text-decoration: none !important;
}

.user-info-container {
    transition: all 0.2s ease;
    border-radius: 8px;
    padding: 4px 8px;
}

/* 下拉菜单优化 */
.dropdown-menu {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: none;
    border-radius: 8px;
    overflow: hidden;
    padding: 5px 0px;
}

.dropdown-menu[style*="display: block"] {
    opacity: 1;
    visibility: visible;
    /* transform: translateY(0); */
    padding: 5px 0px;
}

.dropdown-item {
    transition: all 0.2s ease;
    padding: 5px;
    border-bottom: 1px solid #f0f0f0;
    height: 36px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    color: #1d2129;
    background-color: #f2f3f5 !important;
    transition: all .1s cubic-bezier(0,0,1,1);
}
.menu-btn {
    width: 24px;
    height: 24px;
    cursor: pointer;
}
.menu-btn img {
    width: 100%;
    height: 100%;
}

/* 性能优化 */
.recommend-tab,
.tabs-item,
.user-avatar,
.dropdown-menu {
    will-change: transform;
    transform: translateZ(0);
}

/* 移动端优化 */
@media (max-width: 768px) {
    .topic-nav-container,
    .tags-wrapper-container {
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
    }

    .recommend-tab,
    .tabs-item {
        scroll-snap-align: start;
        min-width: 120px;
        padding: 12px 16px;
    }

    .dropdown-menu {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        transform: translateY(100%);
        border-radius: 16px 16px 0 0;
        max-height: 50vh;
        overflow-y: auto;
    }

    .dropdown-menu[style*="display: block"] {
        /* transform: translateY(0); */
    }
    .mobile-text-overlay {
        bottom: 0;
        left: 0;
        right: 0;
        background: linear-gradient(transparent, rgba(0,0,0,0.5));
        padding: 20px;
        color: white;
    }
}

/* 减少动画（用户偏好） */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 菜单容器默认隐藏 */
.menu-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
}

/* 菜单可见时的样式 */
.menu-container.menu-visible {
    display: block;
}

/* 菜单叠层样式 */
/* .menu-overlay {
  display: none;
  position: absolute;
  top: 77px;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  align-items: center;
  justify-content: center;
} */

.menu-overlay-content {
  width: 100%;
  height: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  padding: 0;
  pointer-events: auto; /* 确保内容区域可以点击 */
}

.menu-overlay-content-list{
  background-color: #fff;
  padding: 14px 16px;
}

.menu-overlay-content-item {
  /* border-bottom: 1px solid #f0f0f0; */
  /* background-color: #fff; */
  border-bottom: 0.8px solid rgb(204, 204, 204);
  padding: 10px 0px;
  font-size: 20px;
  font-weight:500;
  height: auto;
  max-height: 52.42px;
  display: flex;
  align-items: center;
  box-sizing: border-box;
}

.menu-overlay-content-item > a {
  display: flex;
  align-items: center;
  /* height: 100%; */
  height: auto;
}

.menu-overlay-content-item:last-child {
  margin-bottom: 0;
}

.menu-overlay-content-item a {
  display: block;
  text-decoration: none;
  color: #333;
  font-size: 18px;
  font-weight: 600;
  padding: 0;
  transition: all 0.3s ease;
  width: 100%;
}

/* Personal Centre 折叠菜单样式 */
.menu-item-with-submenu {
  position: relative;
  display: block !important; /* 覆盖父级的flex，允许子菜单在下方显示 */
  height: auto !important;
  max-height: none !important; /* 允许内容自动扩展 */
}

.menu-item-with-submenu .menu-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  box-sizing: border-box;
}

.menu-arrow {
  flex-shrink: 0;
  margin-left: 10px;
}

.menu-item-with-submenu.active .menu-arrow {
  transform: rotate(180deg);
}

/* 子菜单样式 */
.submenu {
  background-color: #f8f9fa;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  max-height: 0;
  opacity: 0;
  width: 100%;
}

.submenu.show {
  max-height: 500px;
  opacity: 1;
}

.submenu-item {
  /* border-bottom: 0.8px solid rgb(230, 230, 230); */
  padding: 0;
  height: auto;
  line-height: normal;
}

.submenu-item:last-child {
  border-bottom: none;
}

.submenu-item a {
  font-size: 14px !important;
  font-weight: 400 !important;
  color: #4e5969 !important;
  padding: 0 12px  !important;
  display: block !important;
  height: auto !important;
  min-height: auto !important;
  line-height: 40px !important;
  margin-bottom: 4px !important;
}

.submenu-item a:hover    {
    background-color: #f2f3f5 !important;
    
  }