/* ==========================================
   全屏菜单容器修复
========================================== */

/* 确保全屏菜单不受容器限制 */
.frontend-header {
    position: relative;
    z-index: 100; /* 确保header在合适的层级 */
}

.nav-item.dropdown {
    position: static; /* 重要：改为static定位，避免fixed子元素的定位问题 */
}

/* ==========================================
   基础头部样式
========================================== */

/* 头部容器 */
.frontend-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    z-index: 1000;
    transition: box-shadow 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.frontend-header.scrolled {
    background: #ffffff;
    border-bottom-color: #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 75px;
}

/* Logo区域 */
.header-logo {
    flex-shrink: 0;
    margin-right: 30px;
}

.site-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #1e293b;
    transition: all 0.3s ease;
}

.site-logo:hover {
    transform: translateY(-1px);
}

.logo-image {
    height: 42px;
    width: auto;
    margin-right: 10px;
}

.logo-text-container {
    display: flex;
    flex-direction: column;
}

.logo-text {
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-subtitle {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
    margin-top: 2px;
    letter-spacing: 0.5px;
}

/* 主导航 */
.main-navigation {
    flex: 1;
    display: flex;
    justify-content: center;
    max-width: 800px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 16px 16px;
    text-decoration: none;
    color: #475569;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: transparent;
    border: 1px solid transparent;
    white-space: nowrap;
}

.nav-link:hover {
    color: #ff7a59;
    background: rgba(255, 122, 89, 0.06);
    border-color: rgba(255, 122, 89, 0.15);
}

/* 首页链接特殊样式 */
.home-link {
    background: transparent;
    border-color: transparent;
}

.home-link:hover {
    color: #ff7a59;
    background: rgba(255, 122, 89, 0.06);
    border-color: rgba(255, 122, 89, 0.15);
}

.nav-item.active .nav-link {
    color: #ff7a59;
    font-weight: 600;
}

.nav-item.active .home-link {
    background: transparent;
    border-color: transparent;
}

.dropdown-arrow {
    font-size: 0.7rem;
    color: currentColor;
    transition: transform 0.3s ease;
    margin-left: 2px;
}

.nav-item:hover .dropdown-arrow {
    transform: rotate(180deg);
}

/* 下拉菜单 - 全屏展开设计 */
.dropdown-menu {
    position: fixed !important;
    top: 75px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: calc(100vh - 75px) !important;
    background: white;
    border: none;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999 !important;
    margin: 0 !important;
    overflow: hidden;
    pointer-events: none;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* 关闭按钮 - 参考Backlinko */
.dropdown-close {
    position: absolute;
    top: 20px;
    right: 24px;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10000;
    color: #64748b;
    font-size: 20px;
    font-weight: 400;
    line-height: 1;
}

.dropdown-close:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.dropdown-content {
    display: flex;
    width: 100%;
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    gap: 0;
    overflow: hidden;
}

/* 左侧Tab导航区域 - 参考Backlinko比例 */
.dropdown-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    padding: 32px 0;
    margin: 0;
    overflow-y: auto;
}

.dropdown-sidebar-title {
    display: none; /* 隐藏顶级菜单名称 */
}

.dropdown-tab {
    display: block;
    width: 100%;
    padding: 14px 24px;
    margin: 0;
    color: #475569;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 0;
    transition: all 0.2s ease;
    background: transparent;
    text-align: left;
    cursor: pointer;
    position: relative;
    line-height: 1.4;
}

.dropdown-tab:hover {
    color: #1e293b;
    background: #f1f5f9;
}

.dropdown-tab.active {
    color: #1e293b;
    font-weight: 600;
    background: white;
    border-right: 3px solid #3b82f6;
}

/* 右侧内容区域 - 参考Backlinko */
.dropdown-main {
    flex: 1;
    padding: 32px 40px;
    overflow-y: auto;
    background: white;
}

.dropdown-section {
    display: none;
}

.dropdown-section.active {
    display: block;
}

.dropdown-section-title {
    display: none; /* 隐藏子菜单标题 */
}

.dropdown-section-desc {
    display: none; /* 隐藏描述 */
}

.dropdown-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 32px 40px;
    padding-top: 8px;
}

/* 链接样式 - 参考Backlinko */
.dropdown-link {
    display: block;
    padding: 0;
    color: inherit;
    text-decoration: none;
    border: none;
    border-radius: 0;
    transition: all 0.2s ease;
    background: transparent;
    position: relative;
}

.dropdown-link:hover {
    transform: none;
}

.dropdown-link-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
    transition: color 0.2s ease;
    line-height: 1.4;
}

.dropdown-link:hover .dropdown-link-title {
    color: #3b82f6;
}

.dropdown-link-desc {
    font-size: 14px;
    color: #64748b;
    line-height: 1.5;
    margin: 0;
    font-weight: 400;
}

/* 动画效果 */
@keyframes fadeInContent {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-section.active {
    animation: fadeInContent 0.2s ease-out;
}

/* 移除遮罩层 */
.dropdown-overlay {
    display: none !important;
}

/* 右侧功能区 */
.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

/* 搜索容器 */
.search-container {
    position: relative;
}

.search-form {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    padding: 2px 2px 2px 16px;
    transition: all 0.3s ease;
    width: 240px;
}

.search-form:focus-within {
    border-color: #ff7a59;
    box-shadow: 0 0 0 3px rgba(255, 122, 89, 0.1);
    background: white;
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 0;
    font-size: 0.9rem;
    outline: none;
    color: #1e293b;
}

.search-input::placeholder {
    color: #94a3b8;
}

.search-submit {
    background: #ff7a59;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(255, 122, 89, 0.3);
}

.search-submit:hover {
    background: #e5654b;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 122, 89, 0.4);
}

.search-icon {
    width: 16px;
    height: 16px;
}

/* 用户区域 */
.user-area {
    display: flex;
    align-items: center;
}

.admin-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.admin-link:hover {
    background: rgba(102, 126, 234, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.admin-icon {
    width: 16px;
    height: 16px;
}

/* 移动端菜单按钮 */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

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

.hamburger-line {
    display: block;
    width: 24px;
    height: 2px;
    background: #475569;
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 1px;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* 移动端覆盖菜单 */
.mobile-menu-overlay {
    position: fixed;
    top: 75px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

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

.mobile-nav {
    background: white;
    margin: 0;
    max-height: calc(100vh - 75px);
    overflow-y: auto;
}

.mobile-nav-menu {
    list-style: none;
    margin: 0;
    padding: 20px 0;
}

.mobile-nav-link {
    display: block;
    padding: 16px 24px;
    color: #475569;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.3s ease;
}

.mobile-nav-link:hover {
    background: #f8fafc;
    color: #ff7a59;
    padding-left: 32px;
}

/* ==========================================
   响应式设计
========================================== */

@media (max-width: 1200px) {
    .header-container {
        padding: 0 16px;
    }
    
    .nav-menu {
        gap: 2px;
    }
    
    .nav-link {
        padding: 12px 12px;
    }
    
    .dropdown-menu {
        min-width: 440px;
    }
    
    .search-form {
        width: 200px;
    }
}

@media (max-width: 1024px) {
    .header-logo {
        margin-right: 16px;
    }
    
    .nav-link {
        padding: 12px 10px;
        font-size: 0.9rem;
    }
    
    .dropdown-menu {
        min-width: 400px;
    }
    
    .dropdown-content {
        padding: 16px;
        gap: 16px;
    }
}

@media (max-width: 900px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    .main-navigation {
        display: none;
    }
    
    .search-container {
        display: none;
    }
    
    .header-container {
        justify-content: space-between;
        height: 65px;
    }
    
    .logo-text {
        font-size: 1.6rem;
    }
    
    .logo-subtitle {
        font-size: 0.7rem;
    }
    
    .logo-image {
        height: 36px;
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 0 12px;
    }
    
    .logo-text {
        font-size: 1.4rem;
    }
    
    .logo-subtitle {
        font-size: 0.65rem;
    }
    
    .user-area {
        margin-left: 8px;
    }
    
    .admin-link {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    .logo-image {
        height: 32px;
        margin-right: 8px;
    }
}

/* 移动端响应式调整 */
@media (max-width: 1200px) {
    .dropdown-content {
        max-width: 1000px;
    }
    
    .dropdown-sidebar {
        width: 200px;
    }
    
    .dropdown-main {
        padding: 24px 32px;
    }
    
    .dropdown-links-grid {
        grid-template-columns: 1fr 1fr;
        gap: 24px 32px;
    }
}

@media (max-width: 900px) {
    .dropdown-menu {
        display: none !important; /* 移动端隐藏全屏菜单 */
    }
    
    .dropdown-trigger .dropdown-arrow {
        display: none; /* 隐藏下拉箭头 */
    }
}

@media (max-width: 768px) {
    .dropdown-content {
        flex-direction: column;
    }
    
    .dropdown-close {
        top: 16px;
        right: 16px;
        width: 28px;
        height: 28px;
        font-size: 18px;
    }
    
    .dropdown-sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        padding: 16px 0;
        display: flex;
        overflow-x: auto;
        overflow-y: visible;
    }
    
    .dropdown-tab {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 12px 20px;
        margin-right: 8px;
        border-right: none;
        border-radius: 6px;
        font-size: 13px;
    }
    
    .dropdown-tab.active {
        background: #3b82f6;
        color: white;
        border-right: none;
    }
    
    .dropdown-main {
        padding: 20px 16px;
    }
    
    .dropdown-links-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .dropdown-link-title {
        font-size: 15px;
    }
    
    .dropdown-link-desc {
        font-size: 13px;
    }
} 