China is extremely shrewd. It will extract its pound of flesh at some point. But China also wants to show itself as a global superpower alternative to the US. From what I understand there is blowback even within their own nation against the Taliban. China is adept at walking a tightrope. I don't doubt they will recognize the Taliban but they will keep them at arms length.
Will read up on Iran.
Pak has had some theory of strategic depth that a friendly Afghanistan Taliban gives it for them to concentrate on India. So yes, it helps them with that theory. Whether it is worth the blowback in their own country is their own headache to deal with.