This paper presents a novel framework for robust robot walking in complex terrains. Based on the teacher-student paradigm, this framework integrates imitation learning and assistant task learning to improve learning efficiency and generalization performance. Unlike existing methods that heavily rely on encoder-based state embedding, our framework decouples the network design to facilitate the simplification and deployment of the policy network. First, we train a high-performance teacher policy that acquires generalizable motion skills using privileged information. Then, we transfer the teacher's motion distribution to the student policy through a generative adversarial network to mitigate the performance degradation due to distribution changes. The student policy uses only proprioceptive data with noise. In addition, we improve the feature representation of the student policy through assistant task learning to accelerate convergence and enhance its adaptability to various terrains. Experiments with humanoid robots demonstrate that the walking stability in dynamic terrains is significantly improved and the development cost is significantly reduced. This study provides a practical solution for deploying robust walking strategies in humanoid robots.