/* ========================================
   导航栏 - 现代化重新设计
   温暖配色，简洁扁平化
   ======================================== */

/* ===== 1. 导航栏主体 ===== */
.main-header {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-bottom: 1px solid rgba(255, 184, 0, 0.1) !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05) !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    transition: all 0.3s ease !important;
}

.main-header.scrolled {
    background: rgba(255, 255, 255, 0.98) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
    border-bottom: 1px solid rgba(255, 184, 0, 0.2) !important;
}

.main-header .container {
    max-width: 1280px !important;
    margin: 0 auto !important;
    padding: 0 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    min-height: 70px !important;
    gap: 40px !important;
}

/* ===== 2. Logo区域 ===== */
.logo {
    display: flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
    min-width: 140px !important;
}

.logo a {
    display: flex !important;
    align-items: center !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
}

.logo a:hover {
    transform: translateY(-2px) scale(1.02) !important;
}

.logo-full {
    height: 42px !important;
    width: auto !important;
    filter: drop-shadow(0 2px 4px rgba(255, 184, 0, 0.2)) !important;
    transition: all 0.3s ease !important;
}

.logo a:hover .logo-full {
    filter: drop-shadow(0 4px 8px rgba(255, 184, 0, 0.3)) !important;
}

/* ===== 3. 主导航菜单 ===== */
.main-nav {
    display: flex !important;
    align-items: center !important;
    flex: 1 !important;
    justify-content: center !important;
}

.main-nav ul {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.main-nav li {
    position: relative !important;
}

.main-nav a {
    display: inline-flex !important;
    align-items: center !important;
    padding: 10px 20px !important;
    color: #666 !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    border-radius: 12px !important;
    transition: all 0.3s ease !important;
    position: relative !important;
}

.main-nav a::before {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, #FFD700 0%, #FFA500 100%);
    border-radius: 2px;
    transition: transform 0.3s ease;
}

.main-nav a:hover {
    color: #FF6347 !important;
    background: rgba(255, 215, 0, 0.1) !important;
}

.main-nav a:hover::before {
    transform: translateX(-50%) scaleX(1);
}

.main-nav a.active {
    color: #FF6347 !important;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 165, 0, 0.15) 100%) !important;
    font-weight: 600 !important;
}

.main-nav a.active::before {
    transform: translateX(-50%) scaleX(1);
}

/* ===== 4. 搜索框 ===== */
.search-box {
    flex-shrink: 0 !important;
    min-width: 220px !important;
}

.search-box form {
    display: flex !important;
    align-items: center !important;
    background: rgba(248, 249, 250, 0.8) !important;
    border: 2px solid transparent !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    transition: all 0.3s ease !important;
}

.search-box form:hover {
    background: rgba(255, 248, 220, 0.6) !important;
    border-color: rgba(255, 184, 0, 0.3) !important;
}

.search-box form:focus-within {
    background: #ffffff !important;
    border-color: #FFB800 !important;
    box-shadow: 0 0 0 4px rgba(255, 184, 0, 0.1) !important;
}

.search-box input {
    flex: 1 !important;
    padding: 10px 16px !important;
    border: none !important;
    background: transparent !important;
    color: #333 !important;
    font-size: 14px !important;
    outline: none !important;
}

.search-box input::placeholder {
    color: #999 !important;
}

.search-box button {
    padding: 10px 16px !important;
    background: transparent !important;
    border: none !important;
    color: #999 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.search-box button:hover {
    color: #FFB800 !important;
    transform: scale(1.1) !important;
}

/* ===== 5. 用户区域 ===== */
.user-area {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    flex-shrink: 0 !important;
}

/* 未登录按钮 */
.user-area .login-btn,
.user-area .register-btn {
    display: inline-flex !important;
    align-items: center !important;
    padding: 10px 20px !important;
    border-radius: 12px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    border: 2px solid transparent !important;
}

.user-area .login-btn {
    color: #666 !important;
    background: transparent !important;
}

.user-area .login-btn:hover {
    color: #FF6347 !important;
    background: rgba(255, 215, 0, 0.1) !important;
}

.user-area .register-btn {
    color: #ffffff !important;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%) !important;
    box-shadow: 0 4px 12px rgba(255, 184, 0, 0.3) !important;
}

.user-area .register-btn:hover {
    background: linear-gradient(135deg, #FFA500 0%, #FF8C00 100%) !important;
    box-shadow: 0 6px 20px rgba(255, 184, 0, 0.4) !important;
    transform: translateY(-2px) !important;
}

/* 已登录用户信息 */
.user-info {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
}

.user-avatar {
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    border: 2px solid #FFD700 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.user-avatar:hover {
    border-color: #FFA500 !important;
    transform: scale(1.1) !important;
    box-shadow: 0 4px 12px rgba(255, 184, 0, 0.3) !important;
}

.user-avatar img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.user-name {
    color: #333 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    max-width: 100px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* ===== 6. 移动端菜单按钮 ===== */
.mobile-menu-toggle {
    display: none !important;
    flex-direction: column !important;
    gap: 5px !important;
    padding: 8px !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
}

.mobile-menu-toggle span {
    display: block !important;
    width: 24px !important;
    height: 3px !important;
    background: linear-gradient(90deg, #FFD700 0%, #FFA500 100%) !important;
    border-radius: 2px !important;
    transition: all 0.3s ease !important;
}

.mobile-menu-toggle:hover span {
    background: linear-gradient(90deg, #FFA500 0%, #FF8C00 100%) !important;
}

/* ===== 7. 响应式设计 ===== */
@media (max-width: 1024px) {
    .main-header .container {
        padding: 0 20px !important;
        gap: 20px !important;
    }
    
    .main-nav {
        display: none !important;
    }
    
    .search-box {
        min-width: 180px !important;
    }
    
    .mobile-menu-toggle {
        display: flex !important;
    }
}

@media (max-width: 768px) {
    .main-header .container {
        min-height: 60px !important;
        padding: 0 16px !important;
        gap: 12px !important;
    }
    
    .logo-full {
        height: 36px !important;
    }
    
    .search-box {
        display: none !important;
    }
    
    .user-name {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .main-header .container {
        min-height: 56px !important;
    }
    
    .logo-full {
        height: 32px !important;
    }
    
    .user-avatar {
        width: 32px !important;
        height: 32px !important;
    }
}

/* ===== 8. 移动端导航菜单 ===== */
.mobile-menu {
    position: fixed !important;
    top: 70px !important;
    left: 0 !important;
    right: 0 !important;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1) !important;
    transform: translateY(-100%) !important;
    transition: transform 0.3s ease !important;
    z-index: 999 !important;
    max-height: calc(100vh - 70px) !important;
    overflow-y: auto !important;
}

.mobile-menu.active {
    transform: translateY(0) !important;
}

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

.mobile-menu li {
    margin-bottom: 8px !important;
}

.mobile-menu a {
    display: block !important;
    padding: 14px 20px !important;
    color: #666 !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    border-radius: 12px !important;
    transition: all 0.3s ease !important;
}

.mobile-menu a:hover {
    background: rgba(255, 215, 0, 0.1) !important;
    color: #FF6347 !important;
}

.mobile-menu a.active {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 165, 0, 0.15) 100%) !important;
    color: #FF6347 !important;
    font-weight: 600 !important;
}

/* ===== 9. 加载动画 ===== */
.auth-loading {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.loading-spinner {
    width: 20px !important;
    height: 20px !important;
    border: 3px solid rgba(255, 215, 0, 0.3) !important;
    border-top-color: #FFD700 !important;
    border-radius: 50% !important;
    animation: spin 0.8s linear infinite !important;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== 10. 下拉菜单优化（如果有的话）===== */
.dropdown-menu {
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 184, 0, 0.2) !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1) !important;
    padding: 8px !important;
}

.dropdown-menu a {
    padding: 10px 16px !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
}

.dropdown-menu a:hover {
    background: rgba(255, 215, 0, 0.1) !important;
    color: #FF6347 !important;
}

