Lattice QCD study of confinement and chiral symmetry breaking with Dirac-mode expansion