A generalized equation of state for associating fluids in nanopores: Application to CO2-H2O, CH4-H2O, CO2-CH4, and CO2-CH4-H2O systems and implication for extracting dissolved CH4 by CO2 injection