Predicting major solar flares, which pose significant risks to both space-based and terrestrial infrastructure, remains a critical challenge in space-weather research. In this paper, we propose a novel Convolutional Neural Network (CNN)-based framework that includes both a data preprocessing pipeline and a predictive model named $Cmod$ , designed to leverage Multivariate Time-Series (MVTS) data of solar magnetic field parameters to forecast flare events. Our framework is developed using a MVTS benchmark dataset SWAN-SF, which includes about 4100 Active Region (AR) sequences with 24 magnetic-field parameters sampled at 12-minute intervals. However, this dataset is characterized by over 10 million missing values, severe class imbalance, and strong temporal dependencies arising from its sliding-window construction. To address these challenges, we propose a new data preprocessing pipeline that incorporates an improved data-splitting strategy, designed to mitigate the scarcity and imbalance of major flares while preserving temporal independence between training and test sets. Experimental results show that, for predicting M-class or greater solar flares within 12 hours using SHARP magnetic-field data from 2010 – 2018, $Cmod$ achieves the highest overall True Skill Statistics (TSS) score of 0.86, outperforming eight existing MVTS-based approaches and three ablated variants of $Cmod$ . These findings demonstrate the effectiveness of our method in improving solar flare prediction and advancing space-weather forecasting.