Panthers rally to beat Bears, 31-24