Toward a quantitative theory of Hofmeister phenomena: From quantum effects to thermodynamics