Thick-brane cosmology