Phillies top Pirates on Fourth of July