Single-shot reconstruction of core 4D phase space of high-brightness electron beams using metal grids