Dirac nodal lines and nodal loops in the topological kagome superconductor CsV3Sb5