Features in cosmic-ray lepton data unveil the properties of nearby cosmic accelerators