Constraint-Conditioned Policy Optimization for Versatile Safe Reinforcement Learning