A new muon and pion capture system is proposed for the China Spallation Neutron Source (CSNS), currently under construction. Using about 4% of the pulsed proton beam (1.6 GeV, 4 kW and 1 Hz) of CSNS to bombard a cylindrical graphite target inside a superconducting solenoid, both surface muons and pions can be acquired. The acceptance of this novel capture system - a graphite target wrapped up by a superconducting solenoid - is larger than the normal muon beam lines using quadrupoles at one side of the separated muon target. The muon and pion production at different capture magnetic fields was calculated using Geant4. The bending angle of the capture solenoid with respect to the proton beam was also optimized in simulation to achieve more muons and pions. Based on the layout of the muon experimental area reserved at the CSNS project, a preliminary muon beam line was designed with multi-purpose muon spin rotation areas (surface, decay and low-energy muons). Finally, high-flux surface muons (108/s) and decay muons (109/s) simulated by G4beamline will be available at the end of the decay solenoid based on the first phase of CSNS. This collection and transport system will be a very effective beam line at a proton current of 2.5 μA.