China’s video platform posts a sharp earnings turnaround, with advertising and mobile games driving revenue growth and margins improving after years of losses