@Daniel ******
Of course my initial Comment is relevant because it is pertinent information that Hong Kong is NOT a part of China for Mainland China immigration and transit purposes, and Hong Kong is NOT a part of China's Visa–Free Transit Policy
Therefore, you would be making a direct entry into China at Beijing, as Hong Kong is NOT 1 of the 60 Ports of Entry China has specified for their 10-Day Visa-Free Transit Policy