Asian shares mostly gain and South Korea and Japan recover some losses from AI stock sell-offs