A systematic theory for optical properties of phenylene-based polymers