Six-dimensional (1,0) effective action of F-theory via M-theory on Calabi-Yau threefolds