/* 导航栏样式 */

/* 导航栏容器 */
.main-nav {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    height: 100px;
    margin-top: 0;
}

/* 确保页面内容不会被导航栏遮挡 */
body.met-navfixed {
    padding-top: 100px !important;
}

/* 确保banner区域不会被导航栏遮挡 */
.banner_met_16_2_2 {
    margin-top: 0 !important;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    height: 100%;
}

/* Logo样式 */
.logo {
    height: 120px;
    width: auto;
    transition: transform 0.3s ease;
}

/* 导航链接 */
.nav-links {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 修改后的CSS */
.nav-item {
    position: relative;
}

.nav-item a {
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    display: block;
    font-size: 15px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-item a::before {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: white;
    transition: width 0.3s ease;
}

.nav-item:hover a::before,
.nav-item.active a::before {
    width: 60%;
}

.nav-item:hover a,
.nav-item.active a {
    background: rgba(255, 255, 255, 0.15);
}

/* 搜索框样式 */
.search-box {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 25px;
    padding: 8px 20px;
    margin-left: 20px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.search-input {
    background: transparent;
    border: none;
    outline: none;
    color: white;
    width: 150px;
    font-size: 14px;
    padding: 0 10px;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-box button {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.search-box button:hover {
    transform: scale(1.1);
}

.search-box:hover,
.search-box:focus-within {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
}

/* banner */
.banbg {
    width: 100%;
    height: 400px;
}

.ban {
    width: 100%;
    height: 100%;
    list-style-type: none;
    margin: 0;
    padding: 0;
}

.ban li {
    width: 100%;
    height: 100%;
}

.ban li img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 汉堡菜单按钮-普通显示 */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.menu-toggle span {
    display: block;
    width: 30px;
    height: 3px;
    background-color: white;
    margin: 6px 0;
    transition: all 0.3s ease;
}

/* 手机端样式调整 */
@media (max-width: 768px) {
    .main-nav {
        height: 80px;
        margin-top: 0;
        /* 保持渐变背景 */
    }

    .nav-container {
        padding: 0 20px;
        position: relative;
        display: flex;
        align-items: center;
        height: 100%;
    }

    .logo {
        height: 70px;
        width: auto;
        margin: 0;
    }

    /* 汉堡菜单显示 */
    .menu-toggle {
        display: block;
    }

    /* 导航链接默认隐藏 */
    .nav-links {
        display: none;
        position: fixed;
        top: 80px;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        flex-direction: column;
        padding: 20px;
        gap: 0;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    }

    /* 导航链接展开时显示 */
    .nav-links.show {
        display: flex;
        height: auto;
        max-height: 200vh;
        overflow-y: auto;
    }

    .nav-item {
        width: 100%;
        height: auto;
        padding: 0;
        border-bottom: none;
        transition: background 0.3s ease;
        position: relative;
        display: flex;
        flex-grow: 1;
    }

    .nav-item:hover {
        background: none;
    }

    .nav-item:last-child {
        border-bottom: none;
    }

    .nav-item a {
        height: auto;
        padding: 15px 20px;
        font-weight: 500;
        flex-grow: 1;
        position: static;
        border-radius: 8px;
    }

    .nav-item.active {
        background: none;
    }

    .nav-item.active::after {
        display: none;
    }

    /* 搜索框在移动端可见 */
    .search-box {
        margin: 20px 0 0 0;
        width: 100%;
        display: flex;
    }

    .search-input {
        width: 100%;
    }
}

/* 汉堡菜单动画 */
.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}