﻿:root {
    /* 默认Header高度 */
    --header-height: 3.5rem;

    /* 响应式Header高度变量 - 可以根据需要调整 */
    --header-height-mobile: 4rem;
    --header-height-tablet: 3.5rem;
    --header-height-desktop: 3.5rem;

    /* 内容区域的顶部间距 */
    --content-top-spacing: 0.5rem;
    --content-top-spacing-mobile: 0.25rem;
    --content-top-spacing-desktop: 1rem;
}

.headerbar {
    color: white;
    height: var(--header-height);
    min-height: var(--header-height) !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    width: 100%;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    margin: 0 !important;
}

/* 为body添加固定的padding-top，避免内容被Header遮挡 */
body {
    padding-top: var(--header-height);
    /* 确保smooth transition */
    transition: padding-top 0.3s ease;
}

/* 确保body-root不需要额外的margin */
.body-root {
    margin-top: 0 !important;
}

/* 确保顶部广告区域有适当的间距 */
.global-top-ads {
    padding-top: var(--content-top-spacing);
    transition: padding-top 0.3s ease;
}

/* 响应式调整 - 移动端 */
@media (max-width: 768px) {
    :root {
        --header-height: var(--header-height-mobile);
        --content-top-spacing: var(--content-top-spacing-mobile);
    }
}

/* 响应式调整 - 平板端 */
@media (min-width: 769px) and (max-width: 1199px) {
    :root {
        --header-height: var(--header-height-tablet);
        --content-top-spacing: var(--content-top-spacing);
    }
}

/* 响应式调整 - 桌面端 */
@media (min-width: 1200px) {
    :root {
        --header-height: var(--header-height-desktop);
        --content-top-spacing: var(--content-top-spacing-desktop);
    }
}

.logo {
    display: flex;
    min-width: 8rem;
    width: 8rem;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    align-items: center;
}

.logo a {
    width: 100%;
    height: 100%;
    display: block;
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}


.user-icon {
    height: 2rem;
    max-height: 2rem;
}

.slogan {
    font-size: 1rem;
    color: #6c757d;
    display: inline-block;
    max-width: 15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/*
.input-group {
    width: 15rem;
    max-width:15rem;
    min-width:15rem;
}
*/

nav {
    display: none;
    flex-direction: row;
    align-items: center;
    overflow-x: hidden;
    /* 改为hidden，由JS控制滚动 */
    white-space: nowrap;
    flex-shrink: 1;
    min-width: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    height: 100%;
}

nav span {
    height: 100%;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    position: relative;
    display: flex;
    align-items: center;
}

nav span:hover {
    cursor: pointer;
}

nav span::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: transparent;
    transition: background-color 0.2s ease;
    pointer-events: none;
    /* 防止伪元素干扰鼠标事件 */
}

nav span:hover::after {
    background-color: red;
}

.navselect::after {
    background-color: red !important;
}

.top-search {
    display: none;
    max-width: 10rem;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
}

.search-result-item {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
}

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

.search-result-item a {
    color: #333;
    text-decoration: none;
    display: block;
}

.search-result-item a:hover {
    color: #007bff;
    background-color: #f8f9fa;
}

.top-slogan {
    display: none;
    flex-wrap: nowrap;
    text-wrap: nowrap;
    overflow: hidden;
    flex: 0 0 auto;
    margin-right: 1rem;
    /* 添加这行：不增长、不收缩、自动宽度 */
}

.input-group {
    position: relative;
    display: none;
}



.input-button-only .search-btn {
    display: flex;
    justify-content: center;
}

.input-button-only .search-btn:hover {
    cursor: pointer;
}

.mobile-menu {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
}



@media(max-width:480px) {}

@media(min-width:481px) {}

@media(min-width:769px) {}

@media(min-width:1024px) {}

@media (min-width:1280px) {
    nav {
        display: flex;
    }

    nav span {
        padding-left: 0.6rem;
        padding-right: 0.6rem;
    }

    .mobile-menu {
        display: none;
    }

    .top-search {
        display: flex;
    }

}

@media (min-width:1536px) {
    nav span {
        padding-left: 0.6rem;
        padding-right: 0.6rem;
    }

    .top-slogan {
        display: flex;
    }

}

@media (min-width:1920px) {
    nav span {
        padding-left: 1.1rem;
        padding-right: 1.1rem;
    }

    .input-group-header {
        display: flex;
    }

    .input-button-only {
        display: none;
    }



}

@media (min-width:2560px) {
    nav span {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

}

/* 导航滚动样式 - Swiper风格 */
.nav-scrollable {
    cursor: grab;
    user-select: none;
    will-change: scroll-position;
    touch-action: pan-x;
    /* 只允许水平滑动 */
    -webkit-overflow-scrolling: touch;
    /* iOS平滑滚动 */
}

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

/* 隐藏滚动条 */
.nav-scrollable::-webkit-scrollbar {
    display: none;
}

.nav-scrollable {
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

/* 导航项的过渡效果 */
.nav-scrollable span {
    transition: all 0.2s ease;
}

/* 移动端菜单滚动容器 - 隐藏滚动条 */
.menu-scroll-container {
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
}

.menu-scroll-container::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}