When did a civil war over succession lead to the collapse of imperial Tibet