/* 顶部导航栏样式 */

.header {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 50%, #f0f7fc 100%);
    box-shadow: 0 2px 8px rgba(40, 117, 174, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 50%, var(--accent-gold) 100%) 1;
}

.header.scrolled {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 50%, #f5f9fc 100%);
    box-shadow: 0 4px 12px rgba(40, 117, 174, 0.15);
    border-image: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 50%, var(--accent-gold) 100%) 1;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    gap: 12px;
}

.logo-image {
    width: 45px;
    height: 45px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.logo:hover .logo-image {
    transform: scale(1.05);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    margin-right: 12px;
    font-size: 20px;
    font-weight: 700;
}

/* 导航菜单 */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 40px;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 500;
    padding: 8px 0;
    display: block;
    transition: color 0.3s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-color);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    transition: width 0.3s ease;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

/* 移动端菜单按钮 */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* 移动端响应式 */
@media (max-width: 768px) {
    .header-container {
        height: 70px;
    }

    .logo {
        font-size: 20px;
    }

    .logo-image {
        width: 38px;
        height: 38px;
    }

    .logo-icon {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        background-color: white;
        flex-direction: column;
        gap: 0;
        padding: 20px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        transition: left 0.3s ease;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-menu li {
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-menu li:last-child {
        border-bottom: none;
    }
    
    .nav-menu a {
        padding: 15px 0;
        font-size: 16px;
    }
    
    .nav-menu a::after {
        display: none;
    }
    
    /* 菜单打开时的动画 */
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(7px, 7px);
    }
    
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }
}

/* 为固定导航栏预留空间 */
body {
    padding-top: 80px;
}

@media (max-width: 768px) {
    body {
        padding-top: 70px;
    }
}
