Nanoscale structure and magnetic properties of Nd-Fe-Nb-B-C permanent magnets