/* 自定义头部容器 */
.custom-header-wrapper {
    width: 100%;
    height: 80px;
    background-color: #ffffff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: fixed;
    /* 改为fixed定位，确保在页面滚动时保持在顶部 */
    top: 0;
    left: 0;
    z-index: 9999;
    transition: transform 0.3s ease;
}

/* 添加滚动隐藏类 */
.custom-header-wrapper.hidden {
    transform: translateY(-100%);
}

/* 头部布局 */
.site-header.custom-header {
    height: 100%;
}

.custom-header-container {
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 100%;
}

/* 添加宽度和对齐样式 */
.ast-justify-content-space-between {
    width: 100%;
}

/* 左侧logo区域 - 靠左 */
.custom-site-branding {
    flex-shrink: 0;
    margin-right: auto;
    /* 确保logo固定在最左边 */
    max-width: 200px;
    /* 限制logo宽度 */
    display: flex;
    align-items: center;
    padding-left: 20px;
    /* 上下居中 */
}

/* Logo图片样式 */
.custom-logo-link img {
    max-width: 200px;
    height: auto;
}

/* 右侧区域整体 - 靠右 */
.header-right-section {
    display: flex;
    align-items: center;
    margin-left: auto;
    /* 确保整个右侧区域靠右 */
}

/* 主导航菜单 */
.custom-main-navigation {
    flex-shrink: 0;
}

.custom-main-header-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.custom-main-header-menu .menu-item {
    margin: 0 10px;
    position: relative;
}

.custom-main-header-menu .menu-item .menu-link {
    display: block;
    padding: 15px 12px;
    text-decoration: none;
    color: #333333;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.custom-main-header-menu .menu-item .menu-link:hover {
    color: #0039A5;
}

/* 当前页面菜单项样式 */
.custom-main-header-menu .menu-item.current-menu-item .menu-link,
.custom-main-header-menu .menu-item.current_page_item .menu-link {
    color: #0039A5;
}

/* 当前页面菜单项下划线 */
.custom-main-header-menu .menu-item.current-menu-item .menu-link::after,
.custom-main-header-menu .menu-item.current_page_item .menu-link::after {
    content: '';
    position: absolute;
    left: 30%;
    /* 使下划线居中 */
    bottom: 0;
    width: 40%;
    /* 长度40% */
    height: 5px;
    /* 高度5px */
    background-color: #0039A5;
    /* 颜色#0039A5 */
    border-radius: 5px;
    /* 圆边 */
}

/* 子菜单样式 */
.ast-sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid #eee;
    border-radius: 4px;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 9999;
}

.ast-sub-menu.show,
.menu-item:hover .ast-sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.ast-sub-menu .menu-item {
    width: 100%;
    border-bottom: 1px solid #eee;
}

.ast-sub-menu .menu-item:last-child {
    border-bottom: none;
}

.ast-sub-menu .menu-item .menu-link {
    padding: 12px 20px;
}

/* 分隔符竖线 */
.header-separator {
    width: 1px;
    height: 30px;
    background-color: #ddd;
    margin: 0 15px;
    /* 给竖线添加一些边距 */
}

/* 操作按钮区域 */
.header-action-buttons {
    flex-shrink: 0;
}

.header-buttons-container {
    display: flex;
    align-items: center;
}

/* 首页按钮 - 使用图片，无底色 */
.home-button-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    padding: 0;
}

.home-button-image:hover {
    background-color: #f5f5f5;
}

.home-button-image img {
    width: 24px;
    height: 24px;
}

/* 竖线分隔符 */
.button-divider {
    width: 1px;
    height: 30px;
    background-color: #ddd;
    margin: 0 15px;
}

/* 搜索按钮 - 无底色，黑色图标 */
.search-button.no-bg {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: none;
    border: none;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    padding: 0;
}

.search-button.no-bg:hover {
    background-color: #f5f5f5;
    color: #0039A5;
}

.search-button.no-bg i {
    font-size: 18px;
}

/* 搜索表单样式 */
.header-search-form {
    position: absolute;
    top: calc(100% + 10px);
    right: 20px;
    background: white;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #eee;
    z-index: 10000;
    width: 350px;
}

.header-search-form form {
    margin: 0;
    display: flex;
    align-items: center;
}

.header-search-form input[type="search"],
.header-search-form input[type="text"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 200px;
    margin-right: 10px;
    flex-grow: 1;
}

.header-search-form button[type="submit"] {
    padding: 8px 15px;
    background-color: #013BA6;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.header-search-form button[type="submit"]:hover {
    background-color: #002a8a;
}

/* 移动端头部样式 */
.mobile-header-wrapper {
    display: none;
    /* 桌面端隐藏 */
}

/* 移动端菜单按钮样式 */
.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 24px;
    height: 24px;
    cursor: pointer;
    transition: all 0.3s linear;
    position: relative;
    z-index: 10001;
}

.hamburger-line {
    display: block;
    height: 2px;
    width: 100%;
    background-color: #023BA5;
    /* 按钮颜色 */
    border-radius: 10px;
    transition: all 0.25s cubic-bezier(0.645, 0.045, 0.355, 1);
    position: relative;
}

.hamburger-line:nth-child(1) {
    transform-origin: 0% 0%;
}

.hamburger-line:nth-child(3) {
    transform-origin: 0% 100%;
}

.menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.menu-toggle:hover {
    background-color: transparent;
}

.menu-toggle:focus {
    outline: none;
}

/* 激活状态下的汉堡菜单动画 */
.menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* 侧滑菜单样式 */
.mobile-slide-menu {
    position: fixed;
    top: 0;
    left: -280px;
    /* 初始位置在屏幕外 */
    width: 280px;
    height: 100vh;
    background-color: #fff;
    z-index: 10000;
    transition: left 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.mobile-slide-menu.open {
    left: 0;
    /* 滑入屏幕 */
}

/* 侧滑菜单头部 */
.mobile-slide-menu-header {
    display: flex;
    justify-content: flex-end;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.close-slide-menu {
    background: none;
    border: none;
    font-size: 20px;
    color: #023BA5;
    cursor: pointer;
    padding: 5px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-slide-menu:hover {
    background-color: #f5f5f5;
}

/* 侧滑菜单内容 */
.mobile-slide-menu-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px 0;
}

.mobile-slide-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-slide-menu-list .menu-item {
    border-bottom: 1px solid #eee;
}

.mobile-slide-menu-list .menu-item:last-child {
    border-bottom: none;
}

.mobile-slide-menu-list .menu-item .menu-link {
    display: block;
    padding: 15px 20px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
}

.mobile-slide-menu-list .menu-item .menu-link:hover {
    color: #023BA5;
    background-color: #f9f9f9;
}

.mobile-slide-menu-list .menu-item.current-menu-item .menu-link,
.mobile-slide-menu-list .menu-item.current_page_item .menu-link {
    color: #023BA5;
}

/* 背景遮罩 */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 解决固定导航栏遮挡页面内容的问题 */
body {
    padding-top: 80px;
    /* 根据导航栏高度调整，确保页面内容不会被导航栏遮挡 */
}

.ast-main-header {
    padding-top: 80px;
}

.page-header {
    margin-top: 80px;
}

/* .site-content {
    padding-top: 70px;
} */

@media (max-width: 992px) {

    /* 桌面端内容隐藏 */
    .custom-site-branding,
    .header-right-section {
        display: none;
    }

    /* 显示移动端头部 */
    .mobile-header-wrapper {
        display: block;
        width: 100%;
    }

    .mobile-header-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 15px;
        width: 100%;
    }

    /* 移动端菜单按钮样式 */
    .mobile-menu-toggle {
        flex: 0 0 auto;
    }

    /* 移动端Logo样式 */
    .mobile-site-branding {
        flex: 1;
        text-align: center;
        display: flex;
        justify-content: center;
    }

    .mobile-site-branding .custom-logo-link img {
        max-height: 40px;
        max-width: 120px;
        height: auto;
    }

    .mobile-site-branding .site-title {
        margin: 0;
        font-size: 1.2em;
    }

    /* 移动端搜索按钮样式 */
    .mobile-search-wrapper {
        flex: 0 0 auto;
    }

    .mobile-search-button.no-bg {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: none;
        border: none;
        color: #023BA5;
        /* 搜索按钮颜色 #023BA5 */
        cursor: pointer;
        transition: all 0.3s ease;
        text-decoration: none;
        padding: 0;
    }

    .mobile-search-button.no-bg:hover {
        background-color: #f5f5f5;
    }

    .mobile-search-button.no-bg i {
        font-size: 18px;
    }

    /* 移动端搜索表单样式 */
    .mobile-header-search-form {
        position: absolute;
        top: calc(100% + 10px);
        right: 15px;
        background: white;
        padding: 15px;
        border-radius: 5px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        border: 1px solid #eee;
        z-index: 10000;
        width: calc(100% - 30px);
    }

    .mobile-header-search-form form {
        margin: 0;
        display: flex;
        align-items: center;
    }

    .mobile-header-search-form input[type="search"],
    .mobile-header-search-form input[type="text"] {
        padding: 8px 12px;
        border: 1px solid #ddd;
        border-radius: 4px;
        flex-grow: 1;
        margin-right: 10px;
    }

    .mobile-header-search-form button[type="submit"] {
        padding: 8px 15px;
        background-color: #013BA6;
        color: white;
        border: none;
        border-radius: 4px;
        cursor: pointer;
        display: flex;
        align-items: center;
    }

    .mobile-header-search-form button[type="submit"]:hover {
        background-color: #002a8a;
    }
}

@media (max-width: 768px) {
    .mobile-header-container {
        padding: 10px;
    }

    .mobile-site-branding .custom-logo-link img {
        max-width: 100px;
    }
}