Towards Low-Latency and Adaptive Ransomware Detection Using Contrastive Learning