This.
British colonial policy has for the past 40 or 50 years been all about spinning off as many countries as independant as possible. There is little 'nationalism' about it, no chance of it becoming part of the UK- because its on the other side of the world, not because of its race-, no British profits from it.
Hong Kong is certainly a viable nation on its own.
Viable before or after China cut off water and electricity supply?
Oh, and demand 85% of the land area back (the leased part of the land, Britain has no choice in this matter in handing it over. Disputing the treaty's validity is not a can of worm you want to open). And the majority of the REST of the local water supply. And the bulk of the rail infrastructure. And the territory's large and only container port. And the one and only airport.
Let's face it. Hong Kong is viable for precisely as long as the People's Republic of China let it, and not one second more. Madam Thatcher knew this. Deng knew this. And they both knew that China will not let Hong Kong be anything other than a Chinese territory after the lease runs out... hence the result.
All things considered, this wasn't a terribly bad deal. I speak English here. I go to the Cricket Club. The press criticise the Chinese government freely. People demonstrate. The police are the least corrupt and most efficient I've seen ANYWHERE. Falungong demonstrates with irritating regularity. Tiananmen is commemorated every year with large gatherings. Madam Thatcher had a lousy hand and she played pretty much as well as anyone could be expected to.