Distinct genomic signatures of adaptation in pre- and postnatal environments during human evolution