Distorted magnetic orders and electronic structures of tetragonal FeSe from first principles