Unifying Theory for Casimir Forces: Bulk and Surface Formulations