/* 导航栏容器 - 修复版 */
.nav-container {
    position: relative;
    background: var(--card-bg);
    border: var(--card-border);
    border-radius: 12px;
    padding: 0.5rem;
    margin: 1.5rem 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    z-index: 1000;
}

/* 导航菜单 */
.nav-menu {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
}

/* 导航项 */
.nav-item {
    position: relative;
}

/* 带Mega Menu的导航项 */
.nav-item.has-megamenu {
    position: static; /* 关键修复 */
}

/* 导航链接 */
.nav-head-link {
    display: block;
    padding: 1rem 1.8rem;
    color: rgba(224, 224, 255, 0.8);
    text-decoration: none;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.95rem;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

.nav-head-link:hover {
    color: var(--primary);
    text-shadow: 0 0 10px rgba(0, 247, 255, 0.5);
}

.nav-head-link.active {
    color: var(--primary);
}

.nav-head-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 3px;
    box-shadow: 0 0 10px var(--primary);
}

/* 普通下拉菜单 */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--card-bg);
    border: var(--card-border);
    border-radius: 8px;
    min-width: 220px;
    padding: 0.5rem 0;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1001;
    margin-top: 5px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.8rem 1.5rem;
    color: rgba(224, 224, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    font-family: 'Roboto', sans-serif;
    font-size: 0.9rem;
}

.dropdown-item i {
    margin-right: 0.8rem;
    width: 20px;
    text-align: center;
}

.dropdown-item:hover {
    background: rgba(0, 247, 255, 0.1);
    color: var(--primary);
    padding-left: 1.8rem;
}

/* Mega Menu 样式 - 完全修复版 */
.dropdown-megamenu {
    position: absolute;
    left: 0;
    right: 0;
    width: 100%;
    /*background: var(--card-bg);*/
    background: #070713;
    border: var(--card-border);
    border-top: none;
    border-radius: 0 0 12px 12px;
    padding: 2rem 0;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    max-height: 0;
    overflow: hidden;
    /* 修复鼠标滑动消失的问题 */
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease, max-height 0.3s ease;
}

/* 修复鼠标滑动问题 */
.has-megamenu:hover .dropdown-megamenu {
    pointer-events: auto;
}

.megamenu-container {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    gap: 2rem;
    padding: 0 2rem;
}

.megamenu-column {
    flex: 1;
    min-width: 200px;
}

.megamenu-title {
    color: var(--primary);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0, 247, 255, 0.2);
    font-family: 'Orbitron', sans-serif;
}

.megamenu-item {
    display: flex;
    padding: 1.2rem;
    margin-bottom: 0.8rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--light);
    background: rgba(10, 10, 26, 0.5);
    border: 1px solid rgba(0, 247, 255, 0.05);
    align-items: flex-start;
}

.megamenu-item:hover {
    background: rgba(0, 247, 255, 0.15);
    border-color: rgba(0, 247, 255, 0.3);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 247, 255, 0.2);
}

.megamenu-icon {
    font-size: 1.5rem;
    color: var(--primary);
    margin-right: 1.2rem;
    width: 40px;
    text-align: center;
    flex-shrink: 0;
    margin-top: 0.2rem;
}

.megamenu-content {
    flex: 1;
}

.megamenu-content h4 {
    margin: 0 0 0.5rem 0;
    color: var(--light);
    font-size: 1.05rem;
    font-weight: 500;
}

.megamenu-content p {
    margin: 0;
    color: rgba(224, 224, 255, 0.7);
    font-size: 0.9rem;
    line-height: 1.5;
}

.megamenu-badge {
    display: inline-block;
    background: var(--accent);
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 0.8rem;
    border-radius: 10px;
    margin-top: 0.3rem;
    float: right;
    font-family: 'Orbitron', sans-serif;
}

.megamenu-badge.new {
    background: var(--success);
}

.promo-column {
    max-width: 280px;
}

.megamenu-promo {
    background: linear-gradient(135deg, rgba(0, 103, 255, 0.15), rgba(0, 247, 255, 0.15));
    border: 1px solid rgba(0, 247, 255, 0.3);
    border-radius: 10px;
    padding: 1.8rem;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.megamenu-promo h3 {
    color: var(--primary);
    margin-top: 0;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.megamenu-promo p {
    color: rgba(224, 224, 255, 0.9);
    margin: 0 0 1.5rem 0;
    font-size: 0.95rem;
    line-height: 1.6;
}

.promo-btn {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border: none;
    color: var(--darker);
    padding: 0.8rem 1.8rem;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    letter-spacing: 1px;
    text-align: center;
}

.promo-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 247, 255, 0.4);
}

.promo-corner {
    position: absolute;
    top: 10px;
    right: -30px;
    background: var(--accent);
    color: white;
    font-size: 0.75rem;
    padding: 0.3rem 2rem;
    transform: rotate(45deg);
    width: 120px;
    text-align: center;
    font-family: 'Orbitron', sans-serif;
}

/* 悬停效果 - 修复鼠标滑动问题 */
@media (min-width: 993px) {
    .nav-item:hover .dropdown-menu,
    .has-megamenu:hover .dropdown-megamenu {
        opacity: 1;
        visibility: visible;
        max-height: 800px;
        pointer-events: auto;
        transition-delay: 0.1s; /* 添加延迟防止快速滑动时消失 */
    }
    
    .has-megamenu:hover .nav-head-link {
        background: rgba(0, 247, 255, 0.05);
        border-radius: 6px 6px 0 0;
    }
    
    .has-megamenu:hover .nav-container {
        border-radius: 12px 12px 0 0;
    }
    
    /* 添加悬停区域扩展 */
    .dropdown-megamenu::before {
        content: '';
        position: absolute;
        top: -20px;
        left: 0;
        right: 0;
        height: 20px;
    }
}

/* 移动端样式 */
@media (max-width: 992px) {
    .nav-menu {
        flex-direction: column;
        align-items: stretch;
    }
    
    .nav-head-link {
        padding: 1.2rem 1.5rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .dropdown-menu,
    .dropdown-megamenu {
        position: static;
        display: none;
        width: 100%;
        margin: 0;
        padding: 0;
        box-shadow: none;
        border: none;
        background: transparent;
        max-height: none;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    
    .dropdown-menu {
        padding-left: 2rem;
    }
    
    .dropdown-item {
        padding: 1rem 1.2rem;
    }
    
    .megamenu-container {
        flex-direction: column;
        gap: 0;
        padding: 0.5rem 1.5rem 1.5rem;
    }
    
    .megamenu-column {
        margin-bottom: 1.5rem;
    }
    
    .megamenu-item {
        padding: 1rem;
    }
    
    .megamenu-icon {
        font-size: 1.3rem;
        width: 35px;
    }
    
    .promo-column {
        max-width: 100%;
        margin-top: 1rem;
    }
    
    .nav-item.active .dropdown-menu,
    .nav-item.active .dropdown-megamenu {
        display: block;
    }
    
    .nav-head-link .dropdown-arrow {
        transition: transform 0.3s ease;
    }
    
    .nav-item.active .dropdown-arrow {
        transform: rotate(180deg);
    }
}