/* Mega Menu 样式 */
.mega-menu-trigger {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.2s;
    margin-right: 10px;
    color: var(--text-color);
}

.mega-menu-trigger:hover {
    background-color: rgba(37, 99, 235, 0.1);
}

.mega-menu-trigger i {
    margin-right: 6px;
}

.mega-menu {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 24px;
    width: 90vw;
    max-width: 1200px;
    max-height: 80vh;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 9999;
}

.mega-menu.active {
    opacity: 1;
    visibility: visible;
}

.mega-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e5e7eb;
}

.mega-menu-title {
    font-size: 20px;
    font-weight: bold;
    color: #1f2937;
}

.mega-menu-close {
    cursor: pointer;
    font-size: 24px;
    color: #6b7280;
    transition: color 0.2s;
    line-height: 1;
}

.mega-menu-close:hover {
    color: #ef4444;
}

.mega-menu-search {
    margin-bottom: 20px;
    position: relative;
}

.mega-menu-search input {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.mega-menu-search input:focus {
    outline: none;
    border-color: #2563eb;
}

.mega-menu-search i {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

.mega-menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.mega-menu-category {
    background: #f9fafb;
    border-radius: 10px;
    padding: 16px;
}

.mega-menu-category-title {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
}

.mega-menu-tools {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mega-menu-tool {
    display: block;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    text-decoration: none;
    color: #4b5563;
    font-size: 13px;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.mega-menu-tool:hover {
    background: #eff6ff;
    border-color: #2563eb;
    color: #2563eb;
    transform: translateX(4px);
}

.mega-menu-tool-name {
    font-weight: 500;
    margin-bottom: 2px;
}

.mega-menu-tool-desc {
    font-size: 11px;
    color: #9ca3af;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 暗色模式 */
body.dark-mode .mega-menu-trigger {
    color: var(--text-secondary-dark);
}

body.dark-mode .mega-menu-trigger:hover {
    background-color: rgba(59, 130, 246, 0.2);
}

body.dark-mode .mega-menu {
    background: #1e293b;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

body.dark-mode .mega-menu-header {
    border-bottom-color: #334155;
}

body.dark-mode .mega-menu-title {
    color: #f1f5f9;
}

body.dark-mode .mega-menu-search input {
    background: #334155;
    border-color: #475569;
    color: #f1f5f9;
}

body.dark-mode .mega-menu-category {
    background: #334155;
}

body.dark-mode .mega-menu-category-title {
    color: #e2e8f0;
}

body.dark-mode .mega-menu-tool {
    background: #475569;
    color: #cbd5e1;
}

body.dark-mode .mega-menu-tool:hover {
    background: #1e40af;
    border-color: #3b82f6;
    color: #dbeafe;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .mega-menu {
        width: 95vw;
        max-height: 85vh;
        padding: 16px;
        top: 70px;
    }
    
    .mega-menu-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .mega-menu-category {
        padding: 12px;
    }
    
    .mega-menu-trigger span {
        display: none;
    }
}

/* 滚动条样式 */
.mega-menu::-webkit-scrollbar {
    width: 8px;
}

.mega-menu::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.mega-menu::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.mega-menu::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

body.dark-mode .mega-menu::-webkit-scrollbar-track {
    background: #1e293b;
}

body.dark-mode .mega-menu::-webkit-scrollbar-thumb {
    background: #475569;
}