Interfacial resistive switching by multiphase polarization in ion-intercalation nanofilms