/*
 * Theme Name: WebStack
 * Theme URI: https://www.iotheme.cn/
 * Description: Header Banner Navigation Styles
 */

/* Header Banner 容器 */
.header-banner {
    background: #EFC3CA; /* 改为浅蓝色背景 */
    box-shadow: none; /* 移除阴影 */
    position: relative;
    z-index: 1000;
    width: 100%;
    display: block;
    clear: both;
}

.banner-container {
    width: 100%; /* 改为100%宽度 */
    max-width: none; /* 移除最大宽度限制 */
    margin: 0; /* 移除所有边距 */
    padding: 0 20px; /* 保持内边距 */
    box-sizing: border-box; /* 确保盒模型正确 */
}

/* 导航菜单 */
.banner-nav {
    display: flex;
    align-items: center;
    justify-content: flex-start; /* 改为左对齐 */
    height: 60px;
    width: 100%; /* 确保导航占满容器宽度 */
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
}

.nav-item {
    position: relative;
    margin: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0 20px;
    height: 60px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
}

.nav-link:hover {
    color: #007bff;
    background-color: #f8f9fa;
    border-bottom-color: #007bff;
}

.nav-link i {
    margin-right: 8px;
    font-size: 16px;
}

.nav-link .fa-chevron-down {
    margin-left: 8px;
    font-size: 12px;
    transition: transform 0.3s ease;
}

/* 下拉菜单 */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    border: 1px solid #e4ecf3;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
    list-style: none;
    margin: 0;
    padding: 8px 0;
    pointer-events: none;
}

/* 修复悬停选择器 - 使用更具体的选择器 */
.nav-item.dropdown:hover .dropdown-menu,
.nav-item.dropdown:hover .dropdown-menu,
.ai-tools-dropdown:hover .dropdown-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
}

/* 确保下拉菜单在悬停时显示 */
.nav-item.dropdown:hover .dropdown-menu {
    display: block !important;
}

/* 普通下拉菜单样式 */
.dropdown-menu li {
    margin: 0;
}

.dropdown-menu a {
    display: block;
    padding: 10px 20px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.dropdown-menu a:hover {
    background-color: #f8f9fa;
    color: #007bff;
}

/* AI工具集下拉菜单特殊样式 */
.ai-tools-dropdown .dropdown-menu {
    min-width: 800px;
    max-width: 900px;
    padding: 0;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border: 1px solid #e1e8ed;
}

.ai-tools-grid {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.ai-tools-header {
    padding: 20px 25px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-tools-header h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.ai-tools-header p {
    margin: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    opacity: 0.9;
}

.ai-tools-categories {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: rgba(255, 255, 255, 0.1);
    padding: 1px;
}

.ai-category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 15px;
    background: white;
    color: #333;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    min-height: 80px;
    position: relative;
    overflow: hidden;
}

.ai-category-item:hover {
    background: #f8f9fa;
    color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

.ai-category-item i {
    font-size: 20px;
    margin-bottom: 8px;
    color: #007bff;
    transition: all 0.3s ease;
}

.ai-category-item:hover i {
    color: #0056b3;
    transform: scale(1.1);
}

.ai-category-item span {
    line-height: 1.3;
    word-break: break-word;
}

/* 响应式设计 */
@media (max-width: 768px) {
    /* PC端隐藏移动端元素 */
    .mobile-menu-toggle,
    .mobile-nav-overlay,
    .mobile-nav-menu {
        display: none !important;
    }
    
    .banner-container {
        width: 100%; /* 确保移动端全宽 */
        max-width: 100%; /* 移动端全宽 */
        padding: 0 15px;
        margin: 0; /* 移除所有边距 */
        box-sizing: border-box; /* 确保盒模型正确 */
    }
    
    .nav-menu {
        gap: 0;
        flex-wrap: wrap;
        justify-content: flex-start; /* 移动端也保持左对齐 */
        width: 100%; /* 确保菜单占满容器宽度 */
    }
    
    .nav-link {
        padding: 0 15px;
        font-size: 13px;
    }
    
    .nav-link i {
        margin-right: 6px;
        font-size: 14px;
    }
    
    /* 移动端下拉菜单样式 */
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        background: #f8f9fa;
        margin-top: 5px;
        border-radius: 0;
    }
    
    .dropdown-menu li {
        border-bottom: 1px solid #e9ecef;
    }
    
    .dropdown-menu a {
        padding: 8px 15px;
        font-size: 12px;
    }
    
    /* 移动端AI工具集样式 */
    .ai-tools-dropdown .dropdown-menu {
        min-width: auto;
        max-width: none;
    }
    
    .ai-tools-categories {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .ai-category-item {
        padding: 15px 10px;
        min-height: 70px;
        font-size: 12px;
    }
    
    .ai-category-item i {
        font-size: 18px;
        margin-bottom: 6px;
    }
    
    /* 移动端单列布局优化 */
    .header-banner .ai-tools-dropdown .dropdown-menu {
        min-width: 280px !important;
        max-width: 320px !important;
        left: -100px !important;
    }
    
    .header-banner .ai-tools-categories {
        max-height: 350px !important;
    }
    
    .header-banner .ai-category-item {
        padding: 14px 18px !important;
        font-size: 13px !important;
    }
    
    /* 移动端汉堡菜单按钮样式 */
    .mobile-menu-toggle {
        display: block !important;
        position: fixed !important;
        top: 20px !important;
        right: 20px !important;
        z-index: 1001 !important;
        background: #6366f1 !important;
        color: white !important;
        border: none !important;
        border-radius: 50% !important;
        width: 50px !important;
        height: 50px !important;
        font-size: 20px !important;
        cursor: pointer !important;
        box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3) !important;
        align-items: center !important;
        justify-content: center !important;
        transition: all 0.3s ease !important;
    }
    
    .mobile-menu-toggle:hover {
        background: #4f46e5 !important;
        transform: translateY(-50%) scale(1.05) !important;
    }
    
    .mobile-menu-toggle i {
        font-size: 18px !important;
    }
    
    /* 移动端侧边导航菜单样式 */
    .mobile-nav-overlay {
        display: block !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        background: rgba(0, 0, 0, 0.5) !important;
        z-index: 999 !important;
        opacity: 0 !important;
        transition: opacity 0.3s ease !important;
    }
    
    .mobile-nav-menu {
        display: block !important;
        position: fixed !important;
        top: 0 !important;
        right: -280px !important;
        width: 280px !important;
        height: 100% !important;
        background: white !important;
        z-index: 1000 !important;
        transition: right 0.3s ease !important;
        overflow-y: auto !important;
        padding: 20px 0 !important;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1) !important;
    }
    
    .mobile-nav-menu.active {
        right: 0 !important;
    }
    
    .mobile-nav-header {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 0 20px 20px 20px !important;
        border-bottom: 1px solid #f0f0f0 !important;
        margin-bottom: 20px !important;
    }
    
    .mobile-nav-header h3 {
        margin: 0 !important;
        font-size: 18px !important;
        color: #333 !important;
        font-weight: 600 !important;
    }
    
    .mobile-nav-close {
        background: none !important;
        border: none !important;
        font-size: 20px !important;
        color: #666 !important;
        cursor: pointer !important;
        padding: 5px !important;
        border-radius: 4px !important;
        transition: all 0.3s ease !important;
    }
    
    .mobile-nav-close:hover {
        background: #f0f0f0 !important;
        color: #333 !important;
    }
    
    .mobile-nav-content {
        padding: 0 20px !important;
    }
    
    .mobile-nav-menu .nav-item {
        border-bottom: 1px solid #f0f0f0 !important;
    }
    
    .mobile-nav-menu .nav-link {
        padding: 15px 0 !important;
        height: auto !important;
        border-bottom: none !important;
        font-size: 16px !important;
        color: #333 !important;
        display: block !important;
        text-decoration: none !important;
    }
    
    .mobile-nav-menu .nav-link:hover {
        background: none !important;
        color: #6366f1 !important;
    }
    
    .mobile-nav-menu .dropdown-menu {
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        box-shadow: none !important;
        border: none !important;
        background: #f8f9fa !important;
        margin: 0 !important;
        padding: 0 !important;
        display: none !important;
    }
    
    .mobile-nav-menu .dropdown-menu a {
        padding: 12px 20px !important;
        font-size: 14px !important;
        color: #666 !important;
        display: block !important;
        text-decoration: none !important;
        border-bottom: 1px solid #f0f0f0 !important;
    }
    
    .mobile-nav-menu .dropdown-menu a:hover {
        background: #f0f0f0 !important;
        color: #333 !important;
    }
}
}

/* 平板端适配 */
@media (min-width: 769px) and (max-width: 1024px) {
    .banner-container {
        width: 100%; /* 确保平板端全宽 */
        max-width: 100%; /* 平板端全宽 */
        margin: 0; /* 移除所有边距 */
        padding: 0 20px;
        box-sizing: border-box; /* 确保盒模型正确 */
    }
    
    .ai-tools-dropdown .dropdown-menu {
        min-width: 600px;
        max-width: 700px;
    }
    
    .ai-tools-categories {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* 平板端单列布局优化 */
    .header-banner .ai-tools-dropdown .dropdown-menu {
        min-width: 320px !important;
        max-width: 380px !important;
    }
    
    .header-banner .ai-tools-categories {
        max-height: 380px !important;
    }
    
    .header-banner .ai-category-item {
        padding: 15px 20px !important;
        font-size: 14px !important;
    }
    
    /* 小屏设备单列布局优化 */
    .header-banner .ai-tools-dropdown .dropdown-menu {
        min-width: 260px !important;
        max-width: 300px !important;
        left: -120px !important;
    }
    
    .header-banner .ai-tools-categories {
        max-height: 300px !important;
    }
    
    .header-banner .ai-category-item {
        padding: 12px 15px !important;
        font-size: 12px !important;
    }
}

@media (max-width: 576px) {
    .banner-nav {
        height: 50px;
    }
    
    .nav-link {
        height: 50px;
        padding: 0 10px;
        font-size: 12px;
    }
    
    .nav-link i {
        margin-right: 4px;
        font-size: 12px;
    }
    
    .dropdown-menu {
        min-width: 140px;
    }
    
    .ai-tools-categories {
        grid-template-columns: 1fr;
    }
    
    .ai-category-item {
        padding: 12px 8px;
        min-height: 60px;
        font-size: 11px;
    }
    
    /* 小屏设备单列布局优化 */
    .header-banner .ai-tools-dropdown .dropdown-menu {
        min-width: 260px !important;
        max-width: 300px !important;
        left: -120px !important;
    }
    
    .header-banner .ai-tools-categories {
        max-height: 300px !important;
    }
    
    .header-banner .ai-category-item {
        padding: 12px 15px !important;
        font-size: 12px !important;
    }
    
    .header-banner .ai-category-item i {
        font-size: 15px !important;
        margin-right: 10px !important;
        width: 16px !important;
    }
}

/* 动画效果 */
.nav-item:hover .fa-chevron-down {
    transform: rotate(180deg);
}

/* 激活状态 */
.nav-item.active .nav-link {
    color: #007bff;
    border-bottom-color: #007bff;
}

/* Header-banner 在主内容区域内的定位 */
.main-content .header-banner {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
    position: relative;
}

.main-content .banner-container {
    max-width: 100%;
    margin: 0;
    padding: 0 20px;
}

/* 确保Header-banner在table-cell布局中正确显示 */
.page-container .main-content .header-banner {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* 强制修复下拉菜单显示问题 */
.header-banner .nav-item.dropdown {
    position: relative !important;
}

.header-banner .nav-item.dropdown .dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    background: #ffffff !important;
    border: 1px solid #e4ecf3 !important;
    border-radius: 4px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    min-width: 160px !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-10px) !important;
    transition: all 0.3s ease !important;
    z-index: 9999 !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 8px 0 !important;
    pointer-events: none !important;
    display: block !important;
}

/* 强制悬停显示 */
.header-banner .nav-item.dropdown:hover .dropdown-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
}

/* 强制AI工具集下拉菜单显示 */
.header-banner .ai-tools-dropdown .dropdown-menu {
    min-width: 300px !important;
    max-width: 350px !important;
    padding: 0 !important;
    border-radius: 12px !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15) !important;
    border: none !important;
    overflow: hidden !important;
}

.header-banner .ai-tools-grid {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
}

.header-banner .ai-tools-categories {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    background: transparent !important;
    padding: 0 !important;
    max-height: 400px !important;
    overflow-y: auto !important;
}

/* 自定义滚动条 */
.header-banner .ai-tools-categories::-webkit-scrollbar {
    width: 6px !important;
}

.header-banner .ai-tools-categories::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1) !important;
}

.header-banner .ai-tools-categories::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3) !important;
    border-radius: 3px !important;
}

.header-banner .ai-tools-categories::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5) !important;
}

.header-banner .ai-category-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 16px 20px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    color: #333 !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    text-align: left !important;
    transition: all 0.3s ease !important;
    min-height: auto !important;
    position: relative !important;
    overflow: hidden !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
}

.header-banner .ai-category-item:last-child {
    border-bottom: none !important;
}

.header-banner .ai-category-item:hover {
    background: #ffffff !important;
    color: #007bff !important;
    transform: translateX(5px) !important;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.2) !important;
    z-index: 1 !important;
}

.header-banner .ai-category-item span {
    line-height: 1.4 !important;
    word-break: break-word !important;
    flex: 1 !important;
    text-align: left !important;
}

/* 移除调试边框 */
.header-banner .nav-item.dropdown {
    border: none !important;
}

.header-banner .nav-item.dropdown .dropdown-menu {
    border: none !important;
} 

/* 移动端隐藏header-banner */
@media (max-width: 768px) {
    .header-banner {
        display: none !important;
    }
    
    /* 确保移动端不显示任何header-banner相关元素 */
    .banner-container,
    .banner-nav,
    .nav-menu,
    .nav-item,
    .nav-link,
    .dropdown-menu {
        display: none !important;
    }
} 