/* ============================================
   Header 头部导航样式
   ============================================ */

/* 公告栏 */
.announcement-bar {
    background: #6B5B7A;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    padding: 10px 0;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1002;
    font-family: var(--font-body);
}

/* Header 全新架构 */
.header {
    position: relative;
    background: #FAFAFA;
    width: 100%;
    z-index: 1000;
    height: 90px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
}

/* 吸顶状态 */
.header.fixed {
    position: fixed;
    top: 0;
    left: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    height: 80px;
}

/* 全宽容器 */
.container-wide {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 40px;
    height: 100%;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

/* Logo 区域 */
.header-brand {
    flex-shrink: 0;
    width: 180px;
}

.logo {
    display: flex;
    align-items: center;
    height: 100%;
    text-decoration: none;
}

.logo-img {
    height: 44px;
    width: auto;
    display: block;
}

/* 导航区域 */
.nav {
    flex: 1;
    display: flex;
    justify-content: center;
    height: 100%;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
    height: 100%;
}

.nav-item {
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
}

.nav-link {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 0;
    position: relative;
    transition: color 0.3s ease;
}

/* 下划线动效 */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: var(--color-primary);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* 功能区 */
.header-actions {
    width: 240px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
}

.action-btn {
    color: #333;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    width: 36px;
}

.action-btn:hover {
    color: var(--color-primary);
}

.action-btn svg {
    width: 20px;
    height: 20px;
}

/* 语言切换器 */
.language-switcher {
    position: relative;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: #333;
    cursor: pointer;
    padding: 0 12px;
    height: 36px;
    border-radius: 6px;
    transition: background 0.2s;
    font-family: var(--font-body);
}

.lang-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.lang-text {
    font-size: 14px;
    font-weight: 500;
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 140px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.lang-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: block;
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}

.lang-option:hover {
    background: #f5f5f5;
}

.lang-option.active {
    color: var(--color-primary);
    font-weight: 600;
}

.lang-option:first-child {
    border-radius: 8px 8px 0 0;
}

.lang-option:last-child {
    border-radius: 0 0 8px 8px;
}

/* Mega Menu */
.mega-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(15px);
    background: #fff;
    width: 220px;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.06);
    border: 1px solid #f0f0f0;
    border-radius: 4px;
    z-index: 900;
}

.mega-menu::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 0;
    width: 100%;
    height: 20px;
}

.nav-item:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.mega-menu-content {
    display: flex;
    gap: 60px;
}

.mega-menu-links {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-right: none;
    padding-right: 0;
    align-items: flex-start;
}

.mega-menu-link {
    font-size: 15px;
    color: #555;
    text-decoration: none;
    transition: all 0.2s;
    position: relative;
    padding-left: 12px;
}

.mega-menu-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 1px;
    background: var(--color-primary);
    transition: width 0.2s;
}

.mega-menu-link:hover {
    color: #000;
    padding-left: 15px;
}

.mega-menu-link:hover::before {
    width: 8px;
}

.mega-menu-feature {
    width: 260px;
    flex-shrink: 0;
}

.mega-feature-image {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #f9f9f9;
    margin-bottom: 16px;
}

.mega-feature-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.mega-feature-link:hover .mega-feature-image img {
    transform: scale(1.03);
}

.mega-feature-title {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #333;
    text-align: center;
    margin: 0;
}

/* 移动端菜单按钮 */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.menu-toggle span {
    width: 24px;
    height: 2px;
    background: #333;
    transition: 0.3s;
}

/* 响应式 */
@media (max-width: 991px) {
    .header {
        height: 70px;
        padding: 0;
    }

    .container-wide {
        padding: 0 20px;
    }

    .nav {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: #fff;
        z-index: 1000;
        padding: 80px 40px;
        overflow-y: auto;
    }

    .nav.active {
        display: block;
    }

    .nav-list {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
    }

    .nav-item {
        height: auto;
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-link {
        padding: 20px 0;
        width: 100%;
        font-size: 16px;
    }

    .header-brand,
    .header-actions {
        width: auto;
    }

    .menu-toggle {
        display: flex;
    }

    .mega-menu {
        position: static;
        width: 100%;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        padding: 0 0 20px 20px;
        display: none;
    }

    .nav-item:hover .mega-menu {
        display: block;
    }

    .mega-menu-content {
        flex-direction: column;
        gap: 20px;
        padding: 0;
    }

    .mega-menu-links {
        border: none;
        padding: 0;
    }

    .mega-menu-feature {
        display: none;
    }
}
