Unified equation of state based on the lattice fluid theory for phase equilibria of complex mixtures part I. Molecular thermodynamic framework