Structure of nonuniform three-component fluid mixtures: A density-functional approach