Bialgebras, the classical Yang–Baxter equation and Manin triples for 3-Lie algebras