The rapid expansion of the Internet of Things (IoT) has significantly increased the number of connected devices, leading to a dramatic rise in diverse and latency-sensitive computational demands. In heterogeneous Fog–Cloud environments, efficient task scheduling is crucial to meeting stringent requirements for energy efficiency and quality of service (QoS). However, this problem is inherently complex due to the multidimensional nature of tasks—characterized by computational length, deadline, and input file size—which strongly influence bandwidth utilization, transmission costs, and energy consumption. In addition, the dynamic availability of Fog and Cloud resources over time introduces further challenges in ensuring workload balance and system efficiency. To address these issues, this paper first formulates the task scheduling problem as a Mixed Integer Non-Linear Programming (MINLP) model that incorporates communication, processing, and queuing delays, aiming to minimize energy consumption while maximizing deadline satisfaction. Building on this formulation, we propose an Improved Priority-aware Genetic Algorithm (IPGA) that introduces three key innovations: (1) a Pareto-based non-dominating sorting strategy that classifies tasks using all three critical attributes—length, deadline, and input size—enabling more accurate and intelligent task categorization; (2) a dynamic resource-aware allocation mechanism that distributes tasks between Fog and Cloud nodes proportionally to their available resources, thereby balancing workloads, reducing makespan, and enhancing QoS; and (3) a guided mutation strategy that selectively reassigns tasks from overloaded nodes to underutilized ones, improving convergence while reducing overall energy consumption. Extensive simulations across diverse scenarios confirm the effectiveness of the proposed approach, demonstrating up to 60% energy savings, improved deadline adherence by up to 40%, and reduced operational costs compared to baseline algorithms. These results highlight the potential of IPGA as a robust and sustainable solution for intelligent task scheduling in Fog–Cloud systems.