Mediation analyses indicated that white blood cell count, C-reactive protein, and the low-grade chronic inflammation score played statistically significant but weak mediating roles in these associations.<h4>Conclusions</h4>Higher adherence to an HLCD is associated with reduced risks of depression, anxiety, and their comorbidity, potentially following a non-linear threshold pattern. This evidence concerns the gene CRP and depressive disorder.