## 3 Results and Discussion
### Composition, Morphology, and Structure Analysis
Symbols such as red hearts and green diamonds indicate the characteristic diffraction planes of g-C\({}_{3}\)N\({}_{4}\) and hexagonal CdS, respectively. explained by the interaction between CdS and g-C3N4, which contributes to an elevated electron density in the aromatic rings of porous g-C3N4. SEM images (Figure 3) provided insights into the morphological characteristics of porous g-C3N4 and the CdS/g-C3N4 composites. The natural framework of g-C3N4 exhibits extensive void spaces favorable for hosting multiple active reaction centers (Figure 3a) (Figure S2). Subsequent incorporation of CdS nanoparticles, as depicted in Figure 3c-e, reveals that the CdS particles predominantly occupied the pores within the g-C3N4 matrix, resulting in a denser structural arrangement. The SEM analysis revealed variability in the size of CdS nanoparticles across composites formulated with different CdS-to-g-C3N4 ratios. Specifically, larger aggregates of CdS were noticeable in composites with higher ratios of CdS (Figure 3e), indicating a correlation between the CdS content and aggregate size. While this infilling may ostensibly reduce the surface area available for reactions due to partial pore blockage, it crucially strengthens the interface within the CdS and g-C3N4 heterostructure. This interface facilitates improved separation of photogenerated electron-hole pairs, optimizing the balance between available surface area and charge transfer efficiency. This morphological configuration enhances photocatalytic performance by supporting efficient charge dynamics and providing substantial reactive sites, critical for the observed superior photocatalytic activity of the composites. The pore structure and surface area of the photocatalyst were examined by nitrogen adsorption-desorption isotherms (Figure 4). The shape of both matched well with type IV in the Applied Chemistry classification. The adsorption of N2 became progressively more prominent with increasing P/P0, but did not have a limiting value of adsorption at high-pressure conditions, and, therefore, belonged to the H3 hysteresis loop (Figure 4a). These results are commonly observed in sheet-like materials with cleavage-type pores, suggesting that the material contains irregular mesoporous structures. The BET analysis indicated that the CdS/g-C3N4-2 composite had a specific surface area close to 123 m\({}^{2}\)/g, a value much higher than the 40 m\({}^{2}\)/g observed for pure porous g-C3N4 (Figure S3). This value was more than six times greater than the typically observed specific surface area of approximately 20 m\({}^{2}\)/g for pure CdS nanoparticles [29]. The corresponding pore size distributions showed that the sizes of both were distributed below 20 nm (Figure 4b). Figure 2: Infrared spectra of different ratios of CdS/g-C3N4 and porous g-C3N4. The content of larger pores in CdS/g-C\({}_{3}\)N\({}_{4}\)-2 decreased, and the small pore size content increased sharply, indicating that CdS was embedded within the pores of porous g-C\({}_{3}\)N\({}_{4}\). This observation aligns with the results of the EDS analysis (Figure S4) The improved pore architecture and increased BET-measured surface area of the CdS/g-C\({}_{3}\)N\({}_{4}\)-2 composite offer additional active sites, which improve the photocatalytic degradation efficiency for tetracycline hydrochloride. Moreover, the inherent porous structure of this material improves charge carrier separation and transport efficiency. Such architectural contributions are crucial for elevating the overall photocatalytic performance by providing increased surface contact between the catalyst and the contaminants, and by promoting more effective charge carrier dynamics. Compared to pure CdS, which has limited surface area and adsorption capacity, integrating CdS into the porous g-C\({}_{3}\)N\({}_{4}\) framework significantly enhances these properties This leads to more effective pollutant degradation.