  We develop a model of early X-ray afterglows of gamma-ray bursts originating
from the reverse shock (RS) propagating through ultra-relativistic, highly
magnetized pulsar-like winds produced by long-lasting central engines. We first
perform fluid and MHD numerical simulations of relativistic double explosions.
We demonstrate that even for constant properties of the wind a variety of
temporal behaviors can be produced, depending on the energy of the initial
explosion and the wind power, the delay time for the switch-on of the wind, and
magnetization of the wind. X-ray emission of the highly magnetized RS occurs in
the fast cooling regime - this ensures high radiative efficiency and allows
fast intensity variations. We demonstrate that: (i) RS emission naturally
produces light curves showing power-law temporal evolution with various
temporal indices; (ii) mild wind power, of the order of $\sim 10^{46}$ erg
s$^{-1}$ (equivalent isotropic), can reproduce the afterglows' plateau phase;
(iii) termination of the wind can produce sudden steep decays; (iv)
short-duration afterglow flares are due to mild variations in the wind
luminosity, with small total injected energy.
