/* Header Styles */
.header {
    background: linear-gradient(135deg, #3b97b6 0%, #2a7a8f 100%);
    color: white;
    padding: 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(59, 151, 182, 0.3);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    height: 80px;
    position: relative;
}


.logo-icon img {
    width: 40px;  /* 根据你的需求调整大小 */
    height: 40px;
    object-fit: contain;
}

.logo i {
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.9);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0;
    align-items: center;
    height: 100%;
}

.nav-item {
    position: relative;
    height: 100%;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    padding: 1rem 1.5rem;
    display: block;
    height: 100%;
    display: flex;
    align-items: center;
    border-bottom: 3px solid transparent;
    font-size: 1rem;
}

.nav-menu a:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.1);
    border-bottom-color: rgba(255, 255, 255, 0.8);
}

/* Dropdown Styles - 智能定位 */
.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 250px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    border-radius: 0 0 12px 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 10000;
    border-top: 3px solid #3b97b6;
    overflow: hidden;
}

.dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 右对齐的dropdown */
.dropdown.right-aligned {
    left: auto;
    right: 0;
}

.dropdown-item {
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.3s ease;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: rgba(59, 151, 182, 0.05);
}

.dropdown-item a {
    color: #374151;
    padding: 1rem 1.5rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    border-bottom: none;
    height: auto;
    display: block;
    font-weight: 500;
}

.dropdown-item a:hover {
    color: #3b97b6;
    padding-left: 2rem;
    background: none;
}

/* Mega Menu Styles - 智能定位 */
.mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 500px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    border-radius: 0 0 12px 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 10000;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-top: 3px solid #3b97b6;
    overflow: hidden;
}

.mega-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 右对齐的mega menu */
.mega-menu.right-aligned {
    left: auto;
    right: 0;
}

.mega-column {
    padding: 2rem;
}

.mega-column h4 {
    color: #3b97b6;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid #e2e8f0;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mega-column ul {
    list-style: none;
}

.mega-column ul li {
    margin-bottom: 0.8rem;
}

.mega-column ul li a {
    color: #6b7280;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 0;
    display: block;
    border-radius: 6px;
}

.mega-column ul li a:hover {
    color: #3b97b6;
    background: rgba(59, 151, 182, 0.1);
    padding-left: 1rem;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Mobile Menu Styles */
.mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    z-index: 10001;
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

.mobile-menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.mobile-nav-list {
    list-style: none;
    padding: 0;
}

.mobile-nav-item {
    border-bottom: 1px solid #f1f5f9;
}

.mobile-nav-item:last-child {
    border-bottom: none;
}

.mobile-nav-link {
    display: block;
    padding: 1.2rem 2rem;
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.mobile-nav-link:hover {
    color: #3b97b6;
    background: rgba(59, 151, 182, 0.1);
    padding-left: 2.5rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .nav-container {
        padding: 0 1.5rem;
    }
    
    .logo {
        font-size: 1.6rem;
    }
    
    .nav-menu a {
        padding: 1rem 1.2rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 0 1rem;
        height: 70px;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .nav-menu {
        display: none;
    }
    
    .mobile-menu {
        display: block;
    }
    
    .logo {
        font-size: 1.4rem;
    }
    
    .logo i {
        font-size: 1.6rem;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 0.8rem;
    }
    
    .logo {
        font-size: 1.2rem;
        gap: 0.5rem;
    }
    
    .logo i {
        font-size: 1.4rem;
    }
    
    .mobile-nav-link {
        padding: 1rem 1.5rem;
        font-size: 0.95rem;
    }
}

/* 确保动画正常工作 */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown.active,
.mega-menu.active,
.mobile-menu.active {
    animation: fadeInDown 0.3s ease-out;
}

/* Focus states for accessibility */
.nav-menu a:focus,
.mobile-nav-link:focus,
.mobile-menu-toggle:focus {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

/* Active state for current page */
.nav-menu a.active {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.1);
    border-bottom-color: rgba(255, 255, 255, 0.8);
}