Gradient theory of the electric double layer at hydrocarbon–water interfaces