/* 导航栏核心样式 */
header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    height: 70px;
    line-height: 70px;
}

.nav-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    gap: 60px;
    height: 100%;
}

.logo {
    display: inline-block;
    height: 80px;
    width: auto;
    overflow: hidden;
}

.logo img {
    width: auto;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
}

.nav-menu {
    display: flex;
    gap: 50px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-menu li a {
    font-size: 18px;
    font-weight: 500;
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-menu li a:hover {
    color: #2c6ed5;
}

.mobile-menu-btn {
    display: none;
    font-size: 24px;
    cursor: pointer;
}

/* 汉堡图标核心样式 */
.mobile-menu-btn .hamburger {
    width: 24px;  /* 图标宽度，可根据需求调整 */
    height: 20px; /* 图标总高度 */
    position: relative;
    user-select: none; /* 禁止选中文字 */
}

/* 三条横线的统一样式 */
.mobile-menu-btn .hamburger::before,
.mobile-menu-btn .hamburger::after,
.mobile-menu-btn .hamburger span {
    content: '';
    display: block;
    width: 100%;
    height: 2px;   /* 横线粗细 */
    background-color: #333; /* 横线颜色，适配你的页面风格 */
    border-radius: 1px;     /* 轻微圆角，更美观 */
    position: absolute;
    left: 0;
    transition: all 0.2s ease; /* 可选：悬浮/点击过渡动画 */
}

/* 中间横线 */
.mobile-menu-btn .hamburger span {
    top: 50%;
    transform: translateY(-50%);
}

/* 上方横线 */
.mobile-menu-btn .hamburger::before {
    top: 0;
}

/* 下方横线 */
.mobile-menu-btn .hamburger::after {
    bottom: 0;
}



.nav-item.has-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%; 
    left: 50%; 
    transform: translateX(-50%); 
    min-width: 180px;
    background-color: #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    border-radius: 4px;
    padding: 0;
    display: none;
    z-index: 9999;
    margin: 0;
    list-style: none;
}

/* 一级下拉菜单项基础样式 - 强制统一所有属性 */
.dropdown-item {
    display: block;
    font-size: 16px !important;
    font-weight: 400 !important;
    line-height: 1;
    text-align: center;
    color: #555 !important;  
    text-decoration: none;
    transition: all 0.3s ease; 
    white-space: nowrap;
    padding: 14px 0;
    border-bottom: 1px solid #eee;
}

.dropdown-menu > .dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item.has-submenu {
    position: relative;
    cursor: pointer;
}


.dropdown-item.has-submenu span {
    display: inline;
    padding: 0;
    font-size: inherit !important; 
    font-weight: inherit !important;
    line-height: inherit;
    color: inherit !important;
}

/* 统一hover效果：颜色和背景完全一致 */
.dropdown-item:hover,
.dropdown-item.has-submenu:hover,
.dropdown-item.has-submenu span:hover {
    background-color: #f8f9fa !important;
    color: #2c6ed5 !important;
}

.submenu {
    position: absolute;
    top: 0;
    left: 100%;
    min-width: 180px;
    background-color: #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    border-radius: 4px;
    padding: 0;
    display: none;
    z-index: 9999;
}

.submenu-item {
    display: block;
    font-size: 16px !important;
    font-weight: 400 !important;
    line-height: 1;
    color: #555 !important;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 14px 12px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.submenu > .submenu-item:last-child {
    border-bottom: none;
}

.submenu-item:hover {
    background-color: #f8f9fa !important;
    color: #2c6ed5 !important;
}

.nav-item.has-dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-item.has-submenu:hover .submenu {
    display: block;
}

.mobile-nav-overlay,
.mobile-nav-popup {
  display: none !important;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background-color: #fff;
        padding: 20px 0;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
        gap: 15px;
        text-align: center;
    }

    .nav-menu.active {
        display: flex;
    }

    .mobile-menu-btn {
        display: block;
    }

    /* 1. 隐藏原有移动端菜单，改用弹窗 */
    .mobile-nav-overlay {
        display: none !important; /* 初始隐藏遮罩层 */
    }
    .mobile-nav-popup {
        display: block !important; /* 弹窗容器显示（但默认 translateX(100%) 隐藏在右侧） */
    }

    /* 2. 汉堡按钮样式（保持原有位置，仅调整层级） */
    .mobile-menu-btn {
        display: block !important;
        position: relative;
        z-index: 10001;
        font-size: 24px;
        color: #333;
        cursor: pointer;
    }

    /* 3. 全屏遮罩层 */
    .mobile-nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9999;
        display: none;
    }

    /* 4. 右侧弹窗菜单容器 */
    .mobile-nav-popup {
        position: fixed;
        top: 0;
        right: 0;
        width: 80%;
        max-width: 320px;
        height: 100%;
        background: #4a89dc; /* 匹配示例图的蓝色 */
        z-index: 10000;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        padding: 20px 0;
    }

    /* 5. 弹窗菜单展开状态 */
    .mobile-nav-popup.active {
        transform: translateX(0);
    }

    /* 6. 弹窗头部（关闭按钮） */
    .mobile-nav-header {
        display: flex;
        justify-content: flex-end;
        padding: 0 20px 20px;
    }

    .mobile-nav-close {
        font-size: 24px;
        color: #fff;
        cursor: pointer;
    }

    /* 7. 弹窗菜单项 */
    .mobile-nav-list {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .mobile-nav-item {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .mobile-nav-link {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px 20px;
        color: #fff;
        text-decoration: none;
        font-size: 16px;
    }

    .mobile-nav-link:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    .mobile-nav-arrow {
        font-size: 18px;
        color: #fff;
    }

    /* 8. 子菜单样式（可折叠） */
    .mobile-submenu {
        list-style: none;
        padding: 0;
        margin: 0;
        background: rgba(0, 0, 0, 0.1);
        display: none;
    }

    .mobile-submenu.active {
        display: block;
    }

    .mobile-subitem {
        padding: 12px 20px 12px 40px;
    }

    .mobile-sublink {
        color: #fff;
        text-decoration: none;
        font-size: 15px;
    }
}