Molecular mechanism of photoactivation and inhibition of blue light receptor CRY2