/* 主导航 */
.main-nav {
    background-color: #0056b3;
    height: 60px;
    line-height: 60px;
}

.main-nav .container {
    padding: 0  15px; /* 确保导航容器没有内边距 */
}

.nav-list {
    display: flex;
    height: 100%;
    margin: 0;
    padding: 0;
    justify-content: space-between; /* 改为space-between更合理分配空间 */
    width: 100%;
}

.nav-item {
    position: relative;
    text-align: center;
    padding: 0;
    flex: 1; /* 使用flex:1让每个导航项平均分配空间 */
    /* 移除固定宽度 */
}

.nav-item a {
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center; /* 居中对齐内容 */
    font-size: 17px;
    text-decoration: none;
    height: 100%;
}

/* 添加响应式样式 */
@media (max-width: 768px) {
    .search-box {
        display: none;
    }
    
    .main-nav {
        height: auto;
        line-height: normal;
    }
    
    .nav-list {
        flex-direction: column;
        height: auto;
    }
    
    .nav-item {
        line-height: 45px;
        height: 45px;
    }
    
    .nav-item a {
        justify-content: flex-start;
        padding-left: 15px;
    }
    
    .nav-dropdown {
        position: static;
        width: 100%;
        box-shadow: none;
    }
    
    .nav-dropdown li {
        padding-left: 20px;
    }
    
    /* 添加汉堡菜单按钮样式 */
    .nav-toggle {
        display: block;
    }
    
    /* 默认隐藏导航菜单 */
    .nav-list {
        display: none;
    }
    
    /* 当添加active类时显示导航菜单 */
    .nav-list.active {
        display: block;
    }
}

.nav-item a i {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 8px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.nav-item:hover, .nav-item.active {
    background-color: #1e70c1; /* 调整为更浅的蓝色 */
}

/* 确保鼠标悬停时链接文字保持白色 */
.nav-item:hover a, .nav-item.active a {
    color: #fff;
}

/* 导航图标 
.nav-home i {
     background-image: url('../images/iconnav_home.png'); 
}

.nav-xinwenzhongxin i {
    background-image: url('../images/iconnav_xinwenzhongxin.png');
}

.nav-xinxigongkai i {
    background-image: url('../images/iconnav_xinxigongkai.png');
}

.nav-kejiyinling i {
    background-image: url('../images/iconnav_kejiyinling.png');
}

.nav-yanjiulingyu i {
    background-image: url('../images/iconnav_yanjiulingyu.png');
}

.nav-rencaiduiwu i {
    background-image: url('../images/iconnav_rencaiduiwu.png');
}

.nav-fuwuzhicheng i {
    background-image: url('../images/iconnav_fuwuzhicheng.png');
}

.nav-dangjianwenhua i {
    background-image: url('../images/iconnav_dangjianwenhua.png');
}
.nav-lianxiwomen i {
    background-image: url('../images/iconnav_lianxiwomen.png');
}
.nav-zhuanlanzhuanti i {
    background-image: url('../images/nav-zhuanlanzhuanti.png');
}*/

/* 下拉菜单样式 */
.nav-dropdown {
    position: absolute;
    top: 60px;
    left: 0;
    width: 100%; /* 宽度与父元素一致 */
    background-color: #1e70c1 !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 100;
    padding: 0;
    border: none !important;
    border-radius: 0 !important; /* 去掉圆角 */
    margin: 0 !important;
}

.nav-dropdown li {
    line-height: 35px; /* 增加行高 */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%; /* 确保列表项宽度与父元素一致 */
}

.nav-dropdown li:last-child {
    border-bottom: none;
}

.nav-dropdown li a {
    color: #fff !important;
    font-size: 16px; /* 增大字体大小 */
    padding: 0 5px;
    text-align: center;
    display: block;
    width: 100%; /* 确保链接宽度占满列表项 */
    background-color: transparent !important;
}

.nav-dropdown li a:hover {
    background-color: #3a85d0 !important;
    color: #fff !important;
}

.nav-item:hover .nav-dropdown {
    display: block;
}


/* 汉堡菜单按钮样式 */
.nav-toggle {
    display: none; /* 默认隐藏 */
    cursor: pointer;
    padding: 15px;
    position: absolute;
    right: 15px;
    top: 10px;
    z-index: 101;
}

.nav-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #fff;
    margin: 5px 0;
    transition: all 0.3s ease;
}

/* 当菜单打开时的样式 */
.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}
