Introduction: Impaired sleep quality is prevalent among university students. While rumination disrupts sleep, the daily mechanisms of Self-Critical Rumination (SCR) and its interaction with affective states remain underexplored. Purpose: This study utilized a diary method to investigate the mediating mechanisms of Positive Affect (PA) and Negative Affect (NA) in the relationship between pre-sleep SCR and sleep quality at both within- and between-person levels. Method: A sample of 177 Chinese university students (Mage = 20.56) completed baseline surveys and daily questionnaires for 14 consecutive days (N = 2,478 observations). Multilevel modeling with Bayesian estimation was conducted. Results: At the within-person level, elevated daily pre-sleep SCR predicted poorer sleep quality, heightened NA, and diminished PA. Both daily affective states significantly influenced sleep, suggesting SCR impairs sleep by concurrently downregulating PA and upregulating NA. In contrast, between-person findings diverged, revealing that although trait SCR directly predicted worse sleep, it unexpectedly associated with higher trait PA. This elevated PA exerted a positive indirect effect, buffering SCR's overall detrimental impact. Notably, while daily NA disrupted sleep, trait NA showed no such association, underscoring that sleep regulation mechanisms differ fundamentally across timeframes. Conclusions: Our findings demonstrate that the mechanisms linking SCR to sleep differ significantly between intra-individual and inter-individual levels. While daily SCR harms sleep through immediate affective dysregulation, trait-level dynamics involve a compensatory mechanism where PA serves as a protective buffer. Interventions should therefore distinguish between managing daily emotional fluctuations and addressing habitual traits to effectively improve youth sleep health.