A pH-sensitive colorimetric bilayer film was constructed on the basis of layer-by-layer self-assembly, with chitosan (CS)-loaded purple carrot anthocyanin (PCA) as the inner indicator layer and gellan gum (GG)-loaded Mg-doped carbon dots (Mg-CDs) as the protective outer layer. X-ray diffraction and scanning electron microscopy analyses confirmed the successful preparation of the bilayer film and the incorporation of Mg-CDs. Fourier transform infrared spectroscopy indicated that the Mg-CDs formed hydrogen bonds with the film matrix. Thermogravimetric analysis revealed that the Mg-CDs improved the thermal stability of the double-layer films. Moreover, the addition of 7wt% Mg-CDs increased the water vapor permeability, oxygen permeability, and tensile strength of the films by 0.94-, 0.79-, and 3.18-fold, respectively. The antioxidant and antimicrobial activities of the films were significantly enhanced by including Mg-CDs as the active agents. Illumination experiments revealed that the relative color change (S values) increased by only 2.76% and 4.69% after the addition of 7wt% Mg-CDs to the GG -Mg-CDs layer after 21 days of visible light and 72hours of UV light exposure, respectively. These bilayer films containing PCA and Mg-CDs exhibit good pH color responsiveness and biosafety. The C-P/G-7%CD film had the best overall performance and can effectively reflect pork freshness during storage. Therefore, this research has great potential for developing a double-layer film for monitoring meat quality changes in intelligent food packaging.