  AT2018cow is the most extensively observed and widely studied fast blue
optical transient to date; its unique observational properties challenge all
existing standard models. In this paper, we model the luminosity evolution of
the optical, soft X-ray, and hard X-ray emission, as well as the X-ray spectrum
of AT2018cow with a magnetar-centered engine model. We consider a two-zone
model with a striped magnetar wind in the interior and an expanding ejecta
outside. The soft and hard X-ray emission of AT2018cow can be explained by the
leakage of high-energy photons produced by internal gradual magnetic
dissipation in the striped magnetar wind, while the luminous thermal UV/optical
emission results from the thermalization of the ejecta by the captured photons.
The two-component energy spectrum yielded by our model with a quasi-thermal
component from the optically thick region of the wind superimposed on an
optically thin synchrotron component well reproduces the X-ray spectral shape
of AT2018cow. The Markov Chain Monte Carlo fitting results suggest that in
order to explain the very short rise time to peak of the thermal optical
emission, a low ejecta mass $M_{\rm ej}\approx0.1~M_\odot$ and high ejecta
velocity $v_{\rm SN}\approx0.17c$ are required. A millisecond magnetar with
$P_0\approx3.7~\rm ms$ and $B_p\approx2.4\times10^{14}~\rm G$ is needed to
serve as the central engine of AT2018cow.
