/* Header Component - 精简优化版 */
.header {
    width: 100%;
    height: var(--size-18);
    background: var(--color-neutral-bg);
    position: sticky;
    top: 0;
    z-index: var(--z-index-sticky);
    transition: height var(--transition-fast);
}

.header-scrolled {
    height: 48px;
    box-shadow: var(--shadow-sm);
}

.header-container {
    width: min(1200px, 100% - var(--spacing-8));
    height: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--spacing-4);
}

/* Logo 区域 */
.header-logo {
    display: flex;
    align-items: center;
    height: 100%;
    padding-right: var(--spacing-6);
    text-decoration: none;
    transition: opacity var(--transition-fast);
}

.header-logo:hover {
    opacity: 0.8;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-image {
    width: auto;
    height: 42px; /* 根据实际图片比例调整 */
    object-fit: contain;
    transition: transform var(--transition-fast);
}

.header-logo:hover .logo-image {
    transform: scale(1.05);
}

/* 滚动状态下的Logo调整 */
.header-scrolled .logo-image {
    height: 28px; /* 滚动后变小 */
}

/* 导航菜单 */
.nav {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
}
.nav-menu {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: center;
    height: 100%;
    margin: var(--spacing-0);
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: var(--spacing-0) var(--spacing-2);
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: var(--spacing-1) var(--spacing-2);
    color: var(--color-neutral-text);
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-base);
    text-decoration: none;
    border-radius: var(--radius-base);
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--color-primary);
    background: var(--color-state-hover);
}

.nav-link.active {
    color: var(--color-primary);
    background: var(--color-primary-bg);
}
/* 用户操作区域 */
.user-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
}

/* 未登录状态 */
.auth-state,
.logged-state {
    display: flex;
    align-items: center;
    gap: var(--spacing-8);
}

.member-link {
    color: var(--color-neutral-text);
    font-size: var(--font-size-base);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.member-link:hover {
    color: var(--color-primary);
}

/* 已登录状态 */
.welcome-message {
    font-size: var(--font-size-base);
    color: var(--color-neutral-text);
    font-weight: var(--font-weight-normal);
}

.nav-popover {
    position: absolute;
    visibility: hidden;
    cursor: default;

    z-index: var(--z-index-popover);
    transition: var(--transition-fast);

    padding: var(--size-2-5);
    left: var(--size--5);
    top: var(--size-full);
}

/* 箭头基础样式 */
.nav-popover .nav-popover__arrow {
    position: absolute;
    left: var(--size-10);
    top: var(--size--2-5);
    width: 0;
    height: 0;
    border: var(--size-2-5) solid transparent;
    border-bottom-color: white;
}

.nav-popover .nav-popover__content {
    background: white;
    box-shadow: 0 -5px 20px 0 rgb(0 0 0 / 10%);
    border-radius: var(--radius-base);
}

.nav-popover-trigger:hover > .nav-popover {
    visibility: visible;
}

/* 产品对 - 左右并排布局 */
.product-pair {
    display: flex;
    align-items: stretch;
    gap: var(--spacing-5);
    white-space: nowrap; /* 防止内部文本折行 */
}

/* 产品项 */
.product-item {
    display: flex;
    align-items: center;
    width: 370px;
    gap: var(--spacing-3);
    padding: var(--spacing-5) var(--spacing-5);
    text-decoration: none;
    white-space: nowrap; /* 确保产品描述不折行 */
    border-radius: var(--radius-base)
}

.product-item:hover {
    background-color: var(--color-neutral-bg-tertiary);
}

/* 产品图标 */
.product-item__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--size-11);
    height: var(--size-11);
    font-size: var(--font-size-2xl);
    border-radius: var(--radius-base);
    color: white;
    flex-shrink: 0;
}
.product-dxi > .product-item__icon {
    background: linear-gradient( 324deg, #46B7F8 0%, #97D7FF 100%);
}
.product-txi > .product-item__icon {
    background: linear-gradient( 324deg, #BC77F1 0%, #A297FF 100%);
}

/* 产品文本区域 */
.product-item__text {
    display: flex;
    flex-direction: column;
    min-width: 0; /* 防止文本溢出容器 */
}

/* 产品名称 */
.product-item__name {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-neutral-title);
    line-height: var(--line-height-tight);
    margin-bottom: var(--spacing-1);
    white-space: nowrap;
}

/* 产品描述 - 单行显示 */
.product-item__desc {
    font-size: var(--font-size-xs);
    color: var(--color-neutral-text-secondary);
    line-height: var(--line-height-snug);
    white-space: nowrap;
}


/* ==========================================================================
   黑色背景Header样式
   ========================================================================== */

/* 基础黑色背景样式 */
.header--black {
    background: var(--color-neutral-title);
}

.header--black.header-scrolled {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 黑色背景下的导航链接 */
.header--black .nav-link {
    color: rgba(255, 255, 255, 0.9);
}

.header--black .nav-link:hover {
    color: var(--color-primary);
    background: rgba(255, 255, 255, 0.08);
}

.header--black .nav-link.active {
    color: var(--color-primary);
    background: rgba(73, 201, 255, 0.15);
}

/* 黑色背景下的用户操作区域 */
.header--black .member-link {
    color: rgba(255, 255, 255, 0.9);
}

.header--black .member-link:hover {
    color: var(--color-primary);
}

.header--black .welcome-message {
    color: rgba(255, 255, 255, 0.9);
}

/* ==========================================================================
   无背景header样式，坐落在页面顶部
   ========================================================================== */

.header.header--none {
    background: transparent;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}

.header--none .nav-link {
    color: rgba(255, 255, 255, 0.9);
}

.header--none .nav-link:hover {
    color: var(--color-primary);
    background: rgba(255, 255, 255, 0.08);
}

.header--none .nav-link.active {
    color: var(--color-primary);
    background: rgba(73, 201, 255, 0.15);
}

/* 黑色背景下的用户操作区域 */
.header--none .member-link {
    color: rgba(255, 255, 255, 0.9);
}

.header--none .member-link:hover {
    color: var(--color-primary);
}

.header--none .welcome-message {
    color: rgba(255, 255, 255, 0.9);
}