Taiwan's premier resigns after election loss