Structure design enables stable anionic and cationic redox chemistry in a T2-type Li-excess layered oxide cathode.