Gating mechanisms of a natural anion channelrhodopsin