Phase transition mechanism and bandgap engineering of Sb2S3 at gigapascal pressures