CX is generally good at protecting flights on separate bookings. You could ring to make a note that the bookings are connected but when you check in at Shanghai you will be able to check through for your whole journey and if there is a delay they will protect you.
Unfortunately you are flying from Shanghai which suffers terrible delays so hopefully you do have a lot of transit time in HK so you can still experience the lounge. Other advice is to get to PVG earlier and request to get out on an earlier flight. They will often allow this as they are familiar with delays.
I have four hours to connect, although I could move onto an earlier Cathay Dragon flight now as I’m still in the BA cooling off period.