We report a new full-dimensional variational algorithm to calculate rovibrational spectra of polyatomic molecules using an exact quantum mechanical Hamiltonian. The rovibrational Hamiltonian of system is derived in a set of orthogonal polyspherical coordinates in the body-fixed frame. It is expressed in an explicitly Hermitian form. The Hamiltonian has a universal formulation regardless of the choice of orthogonal polyspherical coordinates and the number of atoms in molecule, which is suitable for developing a general program to study the spectra of many polyatomic systems. An efficient coupled-state approach is also proposed to solve the eigenvalue problem of the Hamiltonian using a multi-layer Lanczos iterative diagonalization approach via a set of direct product basis set in three coordinate groups: radial coordinates, angular variables, and overall rotational angles. A simple set of symmetric top rotational functions is used for the overall rotation whereas a potential-optimized discrete variable representation method is employed in radial coordinates. A set of contracted vibrationally diabatic basis functions is adopted in internal angular variables. Those diabatic functions are first computed using a neural network iterative diagonalization method based on a reduced-dimension Hamiltonian but only once. The final rovibrational energies are computed using a modified Lanczos method for a given total angular momentum J, which is usually fast. Two numerical applications to CH4 and H2CO are given, together with a comparison with previous results.