/* ===================================
   新导航系统 - Mega Menu方案
   ================================ */

/* 重置导航基础样式 */
.header_area {
    position: relative;
    z-index: 99;
}

.main_menu {
    background: linear-gradient(135deg, #412fb3 0%, #5940d4 100%);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.main_menu .navbar {
    padding: 0;
}

.navbar-brand {
    padding: 15px 0;
}

/* 导航菜单容器 */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 5px;
    list-style: none;
    margin: 0;
    padding: 0;
}

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

/* 导航链接 */
.nav-link {
    display: block;
    padding: 20px 18px;
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s;
    border-radius: 8px;
    position: relative;
}

.nav-link:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
    transform: translateY(-2px);
}

/* Mega Menu 基础样式 */
.mega-menu,
.mega-menu-wide {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #ffffff 0%, #f8f7ff 100%);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(65, 47, 179, 0.2), 0 0 0 1px rgba(65, 47, 179, 0.05);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 20px;
    z-index: 1000;
    min-width: 700px;
    overflow: hidden;
}

.mega-menu-wide {
    min-width: 900px;
}

.mega-menu::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #412fb3, #6610f2, #7952ec);
}

.nav-item:hover .mega-menu,
.nav-item:hover .mega-menu-wide {
    opacity: 1;
    visibility: visible;
    margin-top: 10px;
}

/* 简单下拉菜单（产品菜单） - 使用更高优先级选择器 */
.nav-menu .nav-item .submenu {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    background: #fff !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 30px rgba(65, 47, 179, 0.15) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: all 0.3s !important;
    margin-top: 20px !important;
    z-index: 1000 !important;
    min-width: 180px !important;
    list-style: none !important;
    padding: 8px 0 !important;
    display: block !important;
}

.nav-menu .nav-item:hover .submenu {
    opacity: 1 !important;
    visibility: visible !important;
    margin-top: 10px !important;
}

.nav-menu .nav-item .submenu li {
    padding: 0 !important;
    margin: 0 !important;
}

.nav-menu .nav-item .submenu li a {
    display: block !important;
    padding: 10px 20px !important;
    color: #333 !important;
    text-decoration: none !important;
    font-size: 14px !important;
    transition: all 0.2s !important;
}

.nav-menu .nav-item .submenu li a:hover {
    background: linear-gradient(135deg, #f5f3ff 0%, #ebe7ff 100%) !important;
    color: #412fb3 !important;
    padding-left: 25px !important;
}

/* 产品菜单图标样式 */
.menu-item-with-icon {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

.menu-item-with-icon .menu-icon {
    font-size: 18px !important;
    line-height: 1 !important;
    transition: transform 0.3s ease !important;
}

.menu-item-with-icon:hover .menu-icon {
    transform: scale(1.2) !important;
}

/* Mega Menu 内容区 */
.mega-content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    padding: 35px 30px 25px 30px;
}

.mega-content-4col {
    grid-template-columns: repeat(4, 1fr);
}

/* 列样式 */
.mega-column {
    position: relative;
    padding: 0 20px;
}

.mega-column:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 10px;
    bottom: 10px;
    width: 1px;
    background: linear-gradient(180deg, transparent, #e8e3ff 20%, #e8e3ff 80%, transparent);
}

/* 特色列 */
.mega-column.featured {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe9f5 100%);
    margin: -35px 0 -25px 0;
    padding: 35px 20px 25px 20px;
    border-radius: 12px;
}

.mega-column.featured::after {
    display: none;
}

.mega-column.featured + .mega-column::after {
    display: none;
}

/* 4列布局特殊样式 */
.mega-content-4col .mega-column:nth-child(3) {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe9f5 100%);
    margin: -35px 0 -25px 0;
    padding: 35px 20px 25px 20px;
    border-radius: 12px;
}

.mega-content-4col .mega-column:nth-child(3)::after {
    display: none;
}

.mega-content-4col .mega-column:nth-child(3) + .mega-column::after {
    display: none;
}

/* 列标题 */
.mega-column h3 {
    color: #2b1f5c;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e8e3ff;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.mega-column h3::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, #412fb3, #6610f2);
}

.mega-column h3 .icon-title {
    font-size: 18px;
}

.mega-column h3 .tag-recommended {
    margin-left: auto;
    background: linear-gradient(135deg, #ff6b6b, #ff5252);
    color: #fff;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 600;
}

/* 列描述 */
.column-desc {
    color: #666;
    font-size: 13px;
    margin-bottom: 15px;
    line-height: 1.5;
}

/* 链接列表 */
.mega-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mega-links li {
    margin-bottom: 6px;
}

.mega-links a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: #555;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
    position: relative;
    overflow: hidden;
}

.mega-links a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #412fb3, #6610f2);
    transform: scaleY(0);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.mega-links a .icon {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border-radius: 6px;
    background: linear-gradient(135deg, #f0edff 0%, #e8e3ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #412fb3;
    flex-shrink: 0;
    transition: all 0.25s;
}

.mega-links a:hover {
    background: linear-gradient(135deg, #f5f3ff 0%, #ebe7ff 100%);
    color: #21146a;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(65, 47, 179, 0.08);
}

.mega-links a:hover::before {
    transform: scaleY(1);
}

.mega-links a:hover .icon {
    background: linear-gradient(135deg, #412fb3, #6610f2);
    color: #fff;
    transform: scale(1.1) rotate(5deg);
}

/* 链接内容 */
.link-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.link-title {
    font-weight: 500;
}

.link-desc {
    font-size: 12px;
    color: #999;
}

/* 主链接样式 */
.mega-links a.link-primary {
    background: linear-gradient(135deg, #f8f7ff 0%, #f0edff 100%);
    border: 1px solid #e8e3ff;
    font-weight: 600;
}

.mega-links a.link-primary:hover {
    background: linear-gradient(135deg, #f0edff 0%, #e8e3ff 100%);
    border-color: #412fb3;
}

/* 标签 */
.mega-links a .badge {
    margin-left: auto;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.mega-links a .badge.hot {
    background: linear-gradient(135deg, #ff6b6b, #ff5252);
    color: #fff;
}

.mega-links a .badge.new {
    background: linear-gradient(135deg, #51cf66, #37b24d);
    color: #fff;
}

.mega-links a .badge.popular {
    background: linear-gradient(135deg, #845ef7, #7048e8);
    color: #fff;
}

.mega-links a .badge.free {
    background: linear-gradient(135deg, #748ffc, #5c7cfa);
    color: #fff;
}

/* 底部栏 */
.mega-footer {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 20px 30px;
    background: linear-gradient(135deg, #f8f7ff 0%, #f0edff 100%);
    border-top: 1px solid #e8e3ff;
}

.footer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: #fff;
    border: 1px solid #e8e3ff;
    border-radius: 10px;
    transition: all 0.3s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.footer-item:hover {
    box-shadow: 0 4px 15px rgba(65, 47, 179, 0.1);
    transform: translateY(-2px);
    border-color: #412fb3;
}

.footer-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.footer-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.footer-content strong {
    color: #2b1f5c;
    font-size: 14px;
}

.footer-content span {
    color: #999;
    font-size: 12px;
}

.footer-link {
    color: #412fb3;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
}

/* 普通下拉菜单 */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: linear-gradient(135deg, #ffffff 0%, #f8f7ff 100%);
    min-width: 220px;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(65, 47, 179, 0.15), 0 0 0 1px rgba(65, 47, 179, 0.05);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 10px;
    list-style: none;
    padding: 12px 8px;
    overflow: hidden;
    z-index: 1000;
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #412fb3, #6610f2);
}

.nav-item:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    margin-top: 5px;
}

.dropdown-menu li {
    margin-bottom: 4px;
}

.dropdown-menu li:last-child {
    margin-bottom: 0;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    color: #555;
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
    position: relative;
}

.dropdown-menu a::before {
    content: '•';
    color: #412fb3;
    font-weight: bold;
    margin-right: 8px;
    opacity: 0;
    transform: translateX(-5px);
    transition: all 0.2s;
}

.dropdown-menu a:hover {
    background: linear-gradient(135deg, #f5f3ff 0%, #ebe7ff 100%);
    color: #412fb3;
    padding-left: 20px;
}

.dropdown-menu a:hover::before {
    opacity: 1;
    transform: translateX(0);
}

/* 语言切换 */
.lang-switch {
    position: relative;
}

.lang-btn {
    color: #fff;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s;
    text-decoration: none;
}

.lang-btn:hover {
    background: rgba(255,255,255,0.2);
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    min-width: 150px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
    z-index: 1000;
}

.lang-switch:hover .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}

.lang-dropdown a:first-child {
    border-radius: 8px 8px 0 0;
}

.lang-dropdown a:last-child {
    border-radius: 0 0 8px 8px;
}

.lang-dropdown a:hover {
    background: #f5f3ff;
}

.lang-dropdown img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

/* 移动端子菜单 - 默认隐藏 */
.mobile-submenu {
    display: none;
}

.mobile-menu-wrapper {
    display: none;
}

/* 移动端菜单按钮 */
.mobile-toggle {
    display: none;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

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

/* 响应式 */
@media (max-width: 1024px) {
    .mega-menu {
        min-width: 600px;
    }
    
    .mega-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .mobile-toggle {
        display: flex;
    }

    .lang-switch {
        display: none;
    }

    /* 隐藏桌面端菜单 */
    .nav-menu {
        display: none !important;
    }

    /* 显示移动端菜单 */
    .mobile-menu-wrapper {
        display: block;
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        background: #412fb3;
        padding: 70px 0 20px 0;
        transition: left 0.3s ease;
        overflow-y: auto;
        z-index: 9999;
        box-shadow: 2px 0 20px rgba(0,0,0,0.3);
    }

    .mobile-menu-wrapper.active {
        left: 0;
    }

    /* 移动菜单项 */
    .mobile-menu-item {
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .mobile-menu-link {
        display: block;
        padding: 15px 20px;
        color: #fff;
        text-decoration: none;
        font-size: 16px;
    }

    /* details实现折叠 */
    .mobile-menu-details {
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .mobile-menu-details summary {
        padding: 15px 20px;
        color: #fff;
        font-size: 16px;
        cursor: pointer;
        list-style: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
        user-select: none;
    }

    .mobile-menu-details summary::-webkit-details-marker {
        display: none;
    }

    .mobile-menu-details summary::after {
        content: '›';
        font-size: 20px;
        font-weight: bold;
        transition: transform 0.3s;
    }

    .mobile-menu-details[open] summary::after {
        transform: rotate(90deg);
    }

    .mobile-submenu-content {
        background: rgba(0,0,0,0.2);
        padding: 5px 0;
    }

    .mobile-submenu-group {
        padding: 10px 0;
    }

    .mobile-submenu-title {
        color: rgba(255,255,255,0.6);
        font-size: 11px;
        padding: 8px 20px 8px 35px;
        text-transform: uppercase;
        letter-spacing: 1px;
    }

    .mobile-submenu-link {
        display: block;
        color: rgba(255,255,255,0.9);
        padding: 12px 20px 12px 35px;
        text-decoration: none;
        font-size: 14px;
        border-left: 3px solid transparent;
        transition: all 0.2s;
    }

    .mobile-submenu-link:active {
        background: rgba(255,255,255,0.15);
        color: #fff;
        border-left-color: #fff;
    }

    /* 遮罩层 */
    body::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0,0,0,0.5);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s;
        z-index: 9998;
    }

    body.menu-open::before {
        opacity: 1;
        visibility: visible;
    }

    body.menu-open {
        overflow: hidden;
    }
}
