Multiple heteroatom doping is one of the effective strategies to tune the structure of carbon supports and enhance the catalytic performance of nanozymes. Herein, the carbon-based copper nanozyme with sulfur/nitrogen co-doping (S/Cu-NC) was synthesized by one-step pyrolysis of Cu-doped ZIF-8 with thiourea encapsulated (Th/Cu@ZIF-8). Benefiting from the synergy of binary heteroatoms and 3D porous structure, the obtained S/Cu-NC had more active sites and exhibited outstanding peroxidase-like activity. Subsequently, a dual-channel (colorimetric/fluorescent) detection method for melatonin was developed by selecting 3,3,5,5-tetramethylbenzidine (TMB) and thiamine as the substrates of S/Cu-NC, which was based on the free radical scavenging effect of melatonin. Furthermore, a simple and portable paper-based device was designed to realize the rapid detection of melatonin through color changes under ultraviolet light and daylight, and the limit of detection were 0.87 μM and 1.42 μM, respectively. This paper-based device was successfully applied to detect melatonin in two kinds of drug samples with satisfactory results.