For gold, the word carat defines its purity whereas in diamonds it indicates its weight. This seems inconsistent -- what does the unit 'carat' actually refer to?
The karat is a unit used specifically for describing the purity of gold alloys:
Various ways of expressing fineness have been used and two remain in common use: millesimal fineness expressed in units of parts per 1,000 and karats used only for gold. Karats measure the parts per 24, so that 18 karat = 18/24 = 75% and 24 karat gold is considered 100% gold.
The karat (not carat as a unit of mass) (symbol: K or kt) (US) or carat (symbol: C) is a unit of purity for gold alloys.
Note that in the U.S., the symbol K or kt is used; in your locale, the symbol C and the word carat might be used, from which confusion might arise when talking about the unit of mass carat.
The carat is a unit of mass used for, well, telling us what the mass of gemstones are:
The carat (ct) is a unit of mass equal to 200 mg (0.2 g; 0.007055 oz) and is used for measuring gemstones and pearls. The current definition, sometimes known as the metric carat, was adopted in 1907 at the Fourth General Conference on Weights and Measures, and soon afterwards in many countries around the world. The carat is divisible into one hundred points of two milligrams each. Other subdivisions, and slightly different mass values, have been used in the past in different locations.