Salvia miltiorrhiza, a widely used traditional Chinese medicine, contains a complex matrix of hydrophobic diterpenoids and hydrophilic phenolic acids, presenting significant challenges in comprehensive analysis. In this study, an online polarity-partitioned two-dimensional liquid chromatography coupled with mass spectrometry (2D-LC-MS) method was developed for comprehensive analysis of both lipophilic and hydrophilic active components in Salvia miltiorrhiza. The method integrated hydrophilic interaction liquid chromatography (HILIC) and reversed-phase liquid chromatography (RPLC), facilitating the efficient separation of compounds across a wide range of polarities. An online dilution strategy was implemented, minimizing sample loss and enhancing the method's utility for quality control and chemical characterization of complex herbal matrices. Compared with other LC methods, this approach significantly improved analyte coverage, resolution, and analysis efficiency. Under optimal conditions, 150 active components were successfully identified, including 33 compounds newly discovered in Salvia miltiorrhiza. Additionally, the validated online method was applied to the quantitative determination of 16 quality markers of Salvia miltiorrhiza from different sources. The results demonstrated the online method's potential as a superior alternative to existing techniques, offering broader applicability in traditional Chinese medicine research.