The construction of structural complexity and diversity of natural products is crucial for drug discovery and development. To overcome high dark toxicity and poor photostability of natural photosensitizer perylenequinones (PQs) for photodynamic therapy, herein, we aim to introduce the structural complexity and diversity to biosynthesize the desired unnatural PQs in fungus Cercospora through synthetic biology‐based strategy. Thus, we first elucidate the intricate biosynthetic pathways of class B PQs and reveal how the branching enzymes create their structural complexity and diversity from a common ancestor. This enables the rational reprogramming of cercosporin biosynthetic pathway in Cercospora to generate diverse unnatural PQs without chemical modification. Among them, unnatural cercosporin A displays remarkably low dark toxicity and high photostability with retention of great photodynamic anticancer and antimicrobial activities. Moreover, it is found that, unlike cercosporin, the unnatural cercosporin A could be selectively accumulated in cancer cells, providing potential targets for drug development. Therefore, this work provides a comprehensive foundation for preparing unnatural products with customized functions through synthetic biology‐based strategies, thus facilitating drug discovery pipelines from nature.