Detecting Out-of-Distribution Through the Lens of Neural Collapse