The GUAPOS project. VII. Physical structure and molecular environment of the G31.41+0.31 HII region | Synapse