Yup - US customs will be at YVR, and once you drop your luggage off at check in, you won’t see it again until you land at PEK (though actually, when you clear Into the US in YVR, you may be asked to visually identify your bag on a screen, and if they want to have a look inside, they can call it to be brought up for inspection, but no, you won’t need to pick up in SFO).
Youll likely land at T3 in SFO (though theoretically possible you could gate in G, but not likely). Either way, they are connected airside so you’ll have access to any lounge in T3, and then no need to clear security to get to G for your next flight departure.