Scaling cosmology with variable dark-energy equation of state