Brock Purdy threw four touchdown passes, and two found George Kittle in the fourth quarter as the injury-ravaged 49ers (3-0) escaped with a 36-30 win over Arizona.