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

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

.custom-header {
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border-bottom: 1px solid #e2e8f0;
}
.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 { min-width:140px;
    display: flex; align-items: center; text-decoration: none; color: #1e293b;
    font-size: 18px; font-weight: 700; 
}
.site-logo { height: auto; max-height: 80%; width: auto; display: block; }
.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: #f8fafc; border-radius: 12px;
    border: 1px solid #e2e8f0; box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    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: #475569;
    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: #3b82f6 !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 6px rgba(59,130,246,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 1px 3px rgba(0,0,0,0.06);
}
.user-auth-links .login-link {
    color: #3b82f6; border: 2px solid #3b82f6; background: transparent;
}
.user-auth-links .register-link {
    background: #667eea; 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: #1e293b; cursor: pointer;
    background: #f8fafc; border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.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.12);
    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 #e2e8f0;
    background: #667eea;
    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: #3b82f6; 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: center; gap: 5px;
        width: 36px; height: 36px;
        background: #667eea;
        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: 0; }
    .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 #e2e8f0;
        color: #475569; font-size: 15px; font-weight: 500;
    }
}