Backgroup: Immune checkpoint inhibitors (ICIs) have revolutionized cancer treatment; however, their efficacy remains limited due to immunosuppressive microenvironments, especially in “cold” tumors. Objective: Construct a predictive model with less than 10 genes, which has excellent predictive ability for pan-cancer survival and ICI response. Methods: Using in scRNA-seq analysis from 17 cancer types and 34 datasets, furthermore machine learning-based analysis that identified inflammation-related genes (I.Sig) and core signature (Hub-I.Sig) associated with ICI resistance. Mapping of Hub-I.Sig onto macrophages and fibroblasts at single-cell resolution revealed that is recognized as a key factor in the formation of this immunosuppressive milieu for pan-cancer survival and ICI response. Targeting MC.Sig were further validated in cold tumors (ovarian cancer) using in vivo model and multiplex immunohistochemistry (mIHC) analyses. Results: Leveraging single-cell RNA sequencing (scRNA-Seq), we identified 84 inflammation-related genes (I.Sig) associated with ICI resistance. Machine learning-based analysis yielded a 32-gene core signature (Hub-I.Sig). Mapping of Hub-I.Sig onto macrophages and fibroblasts at single-cell resolution revealed that a refined 8-gene signature (MC.Sig) from eight macrophage/fibroblast subtypes exhibited excellent predictive power for pan-cancer survival and ICI response. Targeting MC.Sig could improve the efficacy of PD-1 inhibitors in cold tumors (ovarian cancer) using in vivo model. Our findings revealed macrophage-fibroblast-driven inflammatory networks as a key driver of immune suppression, offering a single-cell-derived marker replacement for identifying novel biomarkers and therapeutic targets for enhancing immunotherapy response. Conclusion: This study developed a two-level gene signature framework (Hub-I.Sig, MC.Sig) for precision immunotherapy, bridging the gap between inflammation and immune resistance in cancer.