Provided herein are compounds having a structure of Formula (I) and pharmaceutically acceptable salts thereof which can act as modulators of cyclin-dependent kinase 12 (CDK12). Further disclosed herein are methods for treating cancer and cancer-related diseases and disorders, such as breast cancer, ovarian cancer, prostate cancer, and gastric cancer.