CosmoFlow: Scale-Aware Representation Learning for Cosmology with Flow Matching