Semiempirical theory for surface core-level shifts