Foam drainage agents enhance gas production by removing wellbore liquids. However, due to the ultra-high salinity environments of the Hechuan gas field (salinity up to 32.5 × 104 mg/L), no foam drainage agent is suitable for this gas field. To address this challenge, we developed a novel nanocomposite foam drainage system composed of quaternary ammonium and two types of nanoparticles. This work describes the design and synthesis of a quaternary ammonium foam drainage agent and nano-engineered stabilizers. Nonylphenol polyoxyethylene ether sulfosuccinate quaternary ammonium foam drainage agent was synthesized using maleic anhydride, sodium chloroacetate, N,N-dimethylpropylenediamine, etc., as precursors. We employed the Stöber method to create hydrophobic silica nanoparticles. Carbon quantum dots were then prepared and functionalized with dodecylamine. Finally, carbon quantum dots were incorporated into the mesopores of silica nanoparticles to enhance stability. Through optimization, the best performance was achieved with a (quaternary ammonium foam drainage agents)-(carbon quantum dots/silica nanoparticles) ratio of 5:1 and a total dosage of 1.1%. Under harsh conditions (salinity 35 × 104 mg/L, condensate oil 250 cm3/m3, temperature 80 °C), the system exhibited excellent stability with an initial foam height of 160 mm, remaining at 110 mm after 5 min. Additionally, it displayed good liquid-carrying capacity (160 mL), low surface tension (27.91 mN/m), and a long half-life (659 s). These results suggest the effectiveness of nanoparticle-enhanced foam drainage systems in overcoming high-salinity challenges. Previous foam drainage agents typically exhibited a salinity resistance of no more than 25 × 104 mg/L. In contrast, this innovative system demonstrates a superior salinity tolerance of up to 35 × 104 mg/L, addressing a significant gap in available agents for high-salinity gas fields. This paves the way for future development of advanced foam systems for gas well applications with high salinity.