  The thermodynamics of the Universe is restudied by requiring its
compatibility with the holographic-style gravitational equations which govern
the dynamics of both the cosmological apparent horizon and the entire Universe,
and possible solutions are proposed to the existent confusions regarding the
apparent-horizon temperature and the cosmic entropy evolution. We start from
the generic Lambda Cold Dark Matter ($\Lambda$CDM) cosmology of general
relativity (GR) to establish a framework for the gravitational thermodynamics.
The Cai-Kim Clausius equation for the isochoric process of an instantaneous
apparent horizon indicates that, the Universe and its horizon entropies encode
the \emph{positive heat out} thermodynamic sign convention, which encourages us
to adjust the traditional positive-heat-in Gibbs equation into the
positive-heat-out version $dE_m=-T_mdS_m-P_mdV$. It turns out that the standard
and the generalized second laws (GSLs) of nondecreasing entropies are always
respected by the event-horizon system as long as the expanding Universe is
dominated by nonexotic matter $-1\leq w_m\leq 1$, while for the
apparent-horizon simple open system the two second laws hold if $-1\leq
w_m<-1/3$; also, the artificial local equilibrium assumption is abandoned in
the GSL. All constraints regarding entropy evolution are expressed by the
equation of state parameter, which show that from a thermodynamic perspective
the phantom dark energy is less favored than the cosmological constant and the
quintessence. Finally, the whole framework is extended from GR and $\Lambda$CDM
to modified gravities with field equations $R_{\mu\nu}-Rg_{\mu\nu}/2=8\pi
G_{\text{eff}} T_{\mu\nu}^{\text{(eff)}}$. Furthermore, this paper argues that
the Cai-Kim temperature is more suitable than Hayward, and the
Bekenstein-Hawking and Wald entropies cannot unconditionally apply to the event
and particle horizons.

General Relativity and Quantum Cosmology;Cosmology and Nongalactic Astrophysics