In situ preparation of a CsPbBr3/black phosphorus heterostructure with an optimized interface and photodetector application.