.custom-header-wrapper {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

/* Mobile menu overlay - hidden by default on all screens */
.mobile-menu-overlay {
    display: none;
}

.custom-header {
    background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.9);
}
.custom-header .container-fluid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}
.custom-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    gap: 0;
}
.custom-header-logo { flex-shrink: 0; margin-right: auto; }
.custom-header-logo .logo-link {
    display: flex; align-items: center; text-decoration: none; color: #333;
    font-size: 18px; font-weight: 700; padding: 8px 0;
}
.custom-header-logo .site-name {
    font-size: 22px; font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.custom-header-right {
    display: flex; align-items: center; gap: 24px;
    flex-shrink: 0; flex-direction: row-reverse;
}
.custom-header-search { flex-shrink: 0; width: 320px; }
.custom-header-user { flex-shrink: 0; }

/* 搜索框 */
.search-form { width: 100%; }
.search-input-wrapper {
    position: relative; display: flex; align-items: center; width: 100%;
    background: rgba(255,255,255,0.8); border-radius: 12px;
    border: 1px solid #e2e8f0; box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    padding-right: 46px; box-sizing: border-box;
}
.search-category-wrapper {
    flex-shrink: 0; display: flex; align-items: center;
    border-right: 1px solid #e2e8f0; padding: 0 8px 0 10px;
}
.search-category-select {
    border: none; background: transparent; font-size: 13px; color: #4a5568;
    padding: 0 4px; outline: none; max-width: 120px; cursor: pointer;
}
.search-input-wrapper .search-input {
    width: 100% !important; padding: 12px 50px 12px 12px !important;
    border: none !important; border-radius: 12px !important;
    font-size: 14px !important; background: transparent !important;
    outline: none !important; height: 44px !important; box-sizing: border-box !important;
}
.search-input-wrapper .search-submit {
    position: absolute !important; right: 6px !important; top: 50% !important;
    transform: translateY(-50%) !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none !important; color: #fff !important; cursor: pointer !important;
    display: flex !important; align-items: center !important;
    justify-content: center !important; width: 32px !important; height: 32px !important;
    border-radius: 8px !important; z-index: 1 !important;
    box-shadow: 0 2px 8px rgba(102,126,234,0.3) !important;
}

/* 登录/注册按钮 */
.user-auth-links { display: flex; align-items: center; gap: 12px; }
.user-auth-links a {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 20px; border-radius: 25px; text-decoration: none;
    font-size: 14px; font-weight: 500; white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.user-auth-links .login-link {
    color: #667eea; border: 2px solid #667eea; background: transparent;
}
.user-auth-links .register-link {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff; border: 2px solid transparent;
}

/* 用户菜单 */
.user-menu-wrapper { position: relative; }
.user-menu-trigger {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 16px; border-radius: 25px; text-decoration: none;
    color: #333; cursor: pointer;
    background: rgba(255,255,255,0.8); border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.user-menu-trigger img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.user-menu-trigger .user-name {
    font-size: 14px; font-weight: 600;
    max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-menu-dropdown {
    position: absolute; top: calc(100% + 8px); right: 0; width: 280px;
    background: #fff; border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    opacity: 0; visibility: hidden;
    transform: translateY(-10px); transition: all 0.3s ease;
    z-index: 1001;
}
.user-menu-wrapper.active .user-menu-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.user-menu-header {
    display: flex; align-items: center; gap: 12px; padding: 20px;
    border-bottom: 1px solid #f1f5f9;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px 16px 0 0; color: #fff;
}
.user-menu-header img { width: 50px; height: 50px; border-radius: 50%; }
.user-info { flex: 1; min-width: 0; }
.user-menu-list { list-style: none; margin: 0; padding: 12px 0; }
.user-menu-list li a {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 20px; color: #475569; text-decoration: none;
    font-size: 14px; font-weight: 500; transition: all 0.3s ease;
}
.user-menu-list li a:hover { background: #f8fafc; color: #667eea; padding-left: 24px; }
.user-menu-list li:last-child a { color: #ef4444; }

/* 移动端 */
.mobile-menu-toggle { display: none; }
@media (max-width: 768px) {
    .custom-header .container-fluid { padding: 0 20px; }
    .custom-header-search { display: none; }
    .custom-header-user { display: none; }
    .mobile-menu-toggle {
        display: flex; flex-direction: column; justify-content: space-around;
        width: 32px; height: 32px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border: none; cursor: pointer; border-radius: 8px; padding: 6px;
    }
    .mobile-menu-toggle span { display: block; width: 20px; height: 2px; background: #fff; border-radius: 2px; margin: 0 auto; }
    .mobile-menu-toggle span + span { margin-top: 3px; }
    .mobile-menu-overlay {
        display: none; position: fixed; top: 70px; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.5); z-index: 1000;
    }
    .mobile-menu-overlay.active { display: block; }
    .mobile-menu-content {
        background: #fff; padding: 20px; border-radius: 0 0 16px 16px;
        max-height: 80vh; overflow-y: auto;
    }
    .mobile-menu-links a {
        display: block; padding: 14px 0; border-bottom: 1px solid #f1f5f9;
        color: #475569; font-size: 15px; font-weight: 500;
    }
}
