Among these people were combat units, research units, command units, and so on. The division of labor was clear, and each had a role.
Many times, a mission for the Cosmic Fleet would take years, or even over a decade, to complete. Some people wouldn't return home for half their lifetime once they left.
Therefore, romantic relationships were not forbidden within the Spaceship Fleet. In fact, to maintain the morale and balance of the soldiers, there were always a significant number of female service members. Hence, there were also quite a few female commanders.
The Interstellar Commanding Department of higher education institutions even gave preferential treatment to female students during recruitment, requiring additional attention to their appearance and demeanor. So, the fleet always had no shortage of beauties.