50nA is the D2 leakage current?If I count D2, the current is about 50nA. It is very small. How do I apply for it?

What do you mean I didn't include the 1.3V forward drop of the input diode which subtracts from the voltage drop across the resistor 3k?

Is it 5.23V - 1.3V = 3.93V? I already know the current is about 60mA. Please let me know.

The other issue is that 0.33uF is so big size and not cost efficiency. Can we use high value resistors to made voltage divider?

The forward current, whcn it clamps the voltage is about 18mA peak.

Yes, the voltage across the resistor in series with the opto input is indeed 6.5V (from my simulation) - 1.3V = 5.2V.

This gives a current of 5.2V /3k = 1.73mA.

How do you "know" that the current is 60mA?

Yes, you could use an 8K resistor in place of C2 but it would need to dissipate 1.7W so should be a 3W device.

Not sure how that compares in size and cost with a 0.33uF, 500V cap.