/* ==========================================================================
   AI炒股助手 - 统一导航栏样式
   ========================================================================== */

/* ===== CSS变量定义 ===== */
:root {
    --primary-color: #1976D2;
    --primary-hover: #1565C0;
    --success-color: #4CAF50;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-light: #999999;
    --bg-white: #FFFFFF;
    --bg-gray: #F8F9FA;
    --border-color: #E0E0E0;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.15);
    --orange-primary: #FF6B35;
    --orange-secondary: #F7931E;
    
    /* 深色导航栏主题 */
    --nav-bg-dark: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    --nav-text-primary: #ffffff;
    --nav-text-secondary: rgba(255, 255, 255, 0.8);
    --nav-text-light: rgba(255, 255, 255, 0.6);
    --nav-border-dark: rgba(255, 255, 255, 0.1);
    --nav-shadow-dark: 0 2px 16px rgba(0, 0, 0, 0.15);
}

/* ===== 导航条主体样式 ===== */
.main-navigation {
    background: var(--nav-bg-dark);
    box-shadow: var(--nav-shadow-dark);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--nav-border-dark);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 80px;
}

/* ===== 品牌区域样式 ===== */
.brand-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--orange-primary), var(--orange-secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    font-weight: bold;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.brand-info h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--nav-text-primary);
    margin: 0;
    line-height: 1.2;
}

.brand-info p {
    font-size: 14px;
    color: var(--nav-text-secondary);
    margin: 0;
    font-weight: 400;
}

.brand-info .ai-highlight {
    font-size: 18px;
    font-weight: 700;
    color: var(--orange-primary);
    margin-right: 2px;
}

/* ===== 导航菜单样式 ===== */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 48px;
    margin-left: 60px;
}

.nav-item {
    position: relative;
    color: var(--nav-text-secondary);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    padding: 8px 0;
    transition: all 0.3s ease;
}

.nav-item:hover {
    color: var(--nav-text-primary);
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #FF6B35, #F7931E);
    transition: width 0.3s ease;
    border-radius: 2px;
}

.nav-item:hover::after {
    width: 100%;
}

.nav-item.active {
    color: var(--nav-text-primary);
    font-weight: 600;
}

.nav-item.active::after {
    width: 100%;
}

/* ===== 用户操作区域样式 ===== */
.user-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* 登录按钮样式 */
.login-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: var(--nav-text-primary);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(10px);
}

.login-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    color: var(--nav-text-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.login-btn:active {
    transform: translateY(0);
}

/* 用户信息显示样式 */
.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: var(--bg-gray);
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-profile:hover {
    background: #E3F2FD;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

/* ===== 移动端菜单样式 ===== */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--nav-text-primary);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
    margin-left: auto;
}

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

.mobile-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--nav-bg-dark);
    border-top: 1px solid var(--nav-border-dark);
    box-shadow: var(--nav-shadow-dark);
    z-index: 1000;
}

.mobile-menu.hidden {
    display: none;
}

.mobile-menu-content {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    padding: 16px 0;
    color: var(--nav-text-secondary);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    border-bottom: 1px solid var(--nav-border-dark);
    transition: all 0.3s ease;
}

.mobile-nav-item:hover {
    color: var(--nav-text-primary);
    padding-left: 8px;
}

.mobile-nav-item.active {
    color: var(--nav-text-primary);
    font-weight: 600;
    border-left: 3px solid #FF6B35;
    padding-left: 12px;
}

.mobile-nav-item:last-child {
    border-bottom: none;
}

.mobile-nav-item.login-item {
    margin-top: 16px;
    padding: 12px 16px;
    background: var(--primary-color);
    color: white;
    border-radius: 8px;
    border: none;
    justify-content: center;
}

.mobile-nav-item.login-item:hover {
    background: var(--primary-hover);
    padding-left: 16px;
}

.mobile-menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 16px 0;
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 16px;
        height: 70px;
    }

    .brand-info p {
        display: none;
    }

    .nav-menu {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    .brand-info h1 {
        font-size: 20px;
    }

    .logo {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .brand-info .ai-highlight {
        font-size: 16px;
    }

    .login-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 12px;
        height: 64px;
    }

    .brand-section {
        gap: 12px;
    }

    .brand-info h1 {
        font-size: 18px;
    }

    .logo {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .login-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .mobile-menu-content {
        padding: 16px;
    }
}

/* ===== 辅助工具类 ===== */
.hidden {
    display: none !important;
}

.mr-2 {
    margin-right: 8px;
}

/* ===== 动画效果增强 ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-menu {
    animation: fadeIn 0.3s ease-out;
}

/* ===== 高对比度模式支持 ===== */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000000;
        --text-secondary: #000000;
        --bg-gray: #F0F0F0;
    }
}

/* ===== 减少动画偏好支持 ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
} 