Invariance Principle Meets Information Bottleneck for Out-of-Distribution Generalization