Different Degrees of Nitrogen and Carbon Depletion in the Warm Molecular Layers of Protoplanetary Disks