/* 自定义导航栏样式 */
.navbar {
    margin-bottom: 0;
}

.navbar-custom {
    background-color: #0B1C3C;
    border-color: #0B1C3C;
    min-height: 70px;
    margin-bottom: 0;
    border-radius: 0;
    border: none;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1030;
}

body {
    padding-top: 70px;
}

.navbar-custom .navbar-brand {
    color: #fff;
    height: 70px;
    line-height: 70px;
    padding-top: 0;
}

.navbar-custom .brand-logo {
    height: 40px;
    width: auto;
    margin-right: 10px;
    display: inline-block;
    vertical-align: middle;
}

.navbar-custom .navbar-toggle {
    margin-top: 18px;
    margin-bottom: 18px;
}

.navbar-custom .navbar-toggle .icon-bar {
    background-color: #fff;
}

.navbar-custom .navbar-nav {
    margin: 0 15px;
}

.navbar-custom .navbar-nav>li>a {
    color: #fff;
    padding: 25px 20px;
    position: relative;
    display: flex;
    align-items: center;
    font-size: 16px;
}

.navbar-custom .navbar-nav>li>a:hover,
.navbar-custom .navbar-nav>li>a:focus {
    color: #F7941E;
    background-color: transparent !important;
}

.navbar-custom .navbar-nav>li>a::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 20px;
    right: 20px;
    height: 2px;
    background-color: transparent;
    transition: all 0.3s ease;
}

.navbar-custom .navbar-nav>li>a:hover::after,
.navbar-custom .navbar-nav>li>a:focus::after {
    background-color: #F7941E;
}

/* Mega Menu 样式 */
.nav-item {
    position: static !important;
    /* 覆盖 Bootstrap 的 relative 定位 */
}

.mega-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background-color: #f2f2f2;
    padding: 20px 150px;
    display: none;
    flex-direction: row;
    flex-wrap: wrap;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    border-top: 1px solid #ddd;
}

/* 悬停效果 */
/* 移除悬停触发效果，仅保留点击触发 */
.nav-item:hover .mega-menu {
    display: flex;
}

/* 点击保持效果 */
/* 移除或注释掉点击保持效果的样式 */
/* .nav-item.active .mega-menu {
    padding: 20px 150px;
    display: flex;
} */

.mega-column {
    flex: 1;
    min-width: 200px;
    padding: 0 20px;
}

.mega-column h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
    text-align: center;
}

.mega-column h3:hover {
    color: #007bff;
}

.mega-column a {
    display: block;
    color: #555;
    padding: 8px 0;
    text-decoration: none;
    text-align: center;
}

.mega-column a:hover {
    color: #007bff;
}

/* 活动状态样式 */
.nav-item.active>a {
    color: #F7941E !important;
}

.nav-item.active>a::after {
    background-color: #F7941E !important;
}

.mega-title-link {
    text-decoration: none;
    color: inherit;
    padding: 0;
    /* 添加此行移除额外内边距 */
}

.mega-title-link h3 {
    margin: 0;
    /* 强制移除所有外边距 */
    padding-bottom: 10px;
    /* 保持与其他标题一致的下边框间距 */
}

.mega-title-link h3:hover {
    color: #007bff;
    /* 保持与其他链接一致的悬停颜色 */
}

/* 语言下拉菜单样式 */
.navbar-custom .navbar-right .dropdown {
    position: relative;
}

.navbar-custom .navbar-right .dropdown-menu {
    position: absolute;
    right: 0;
    left: auto;
    display: none;
    float: left;
    min-width: 100px;
    padding: 5px 0;
    margin: 2px 0 0;
    font-size: 14px;
    text-align: left;
    list-style: none;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
    z-index: 1050;
    /* 提高z-index确保下拉菜单显示在其他元素上方 */
}

/* 添加下拉菜单显示状态的样式 */
.navbar-custom .navbar-right .dropdown.open .dropdown-menu {
    display: block;
}

.navbar-custom .navbar-right .dropdown-menu>li>a {
    display: block;
    padding: 3px 20px;
    clear: both;
    font-weight: normal;
    line-height: 1.42857143;
    color: #333;
    white-space: nowrap;
    text-align: center;
}

.navbar-custom .navbar-right .dropdown-menu>li>a:hover,
.navbar-custom .navbar-right .dropdown-menu>li>a:focus {
    color: #262626;
    text-decoration: none;
    background-color: #f5f5f5;
}

/* 移动端适配 */
@media (max-width: 767px) {
    .navbar-custom .navbar-nav>li>a {
        padding: 10px 15px;
    }

    .navbar-custom .navbar-nav>li>a::after {
        left: 15px;
        right: auto;
        width: calc(100% - 30px);
        transform: scaleX(0);
        transform-origin: left center;
    }

    .navbar-custom .navbar-nav>li>a:hover::after,
    .navbar-custom .navbar-nav>li>a:focus::after {
        transform: scaleX(1);
    }

    .mega-menu {
        position: static;
        display: none !important;
        /* 移动端默认隐藏 */
        flex-direction: row;
        flex-wrap: wrap;
        padding: 10px;
        max-height: 70vh;
        overflow-y: auto;
        width: 100%;
        /* 添加宽度控制 */
        box-sizing: border-box;
        /* 确保内边距不影响宽度 */
    }

    .nav-item.active .mega-menu {
        padding: 10px;
        display: block !important;
        /* 点击后显示 */
    }

    .mega-column {
        padding: 10px;
        flex: 1 0 45%;
        min-width: 150px;
    }

    /* 移动端语言下拉菜单样式 */
    .navbar-custom .navbar-right .dropdown-menu {
        position: static;
        float: none;
        width: auto;
        margin-top: 0;
        background-color: transparent;
        border: 0;
        box-shadow: none;
    }
}