including the imperial capital. At first the recommendation of an elite local sponsor was important; increasing the imperial government relied more on merit exams, and thus entry into the national ruling class became more difficult. Downward social mobility into the peasantry was possible for less successful sons; upward mobility from the peasant class was unheard of. Qing dynasty: 1644–1912 The Manchus (a tribe from Manchuria) conquered the Shun dynasty (which was established after the Ming fell due to a peasant rebellion) around 1644–1683 in wars that killed perhaps 25 million people. The Manchus ruled it as the Qing dynasty until the early 20th century. Notably, Han men were forced to wear the long queue (or pigtail) as a mark of their inferior status. That said, some Han did achieve high rank in the civil service via the Imperial Examination system. Until the 19th century, Han immigration into Manchuria was forbidden. Chinese had an advanced artistic culture and well-developed science and technology. However, its science and technology stood still after 1700 and in the 21st century very little survives outside museums and remote villages, except in for the ever-popular forms of traditional medicine like acupuncture. In the late Qing era (1900 to 1911), the country was beset by large-scale civil wars, major famines, military defeats by Britain and Japan, regional control by powerful warlords and foreign intervention such as the Boxer Rebellion of 1900. Final collapse came in 1911. Military success in 18th century The Ten Great Campaigns of the Qianlong Emperor from the 1750s to the 1790s extended Qing control into Inner Asia. During the peak of the Qing dynasty, the empire ruled over the entirety of today's Mainland China, Hainan, Taiwan, Mongolia, Outer Manchuria and Outer Northwest China. Military defeats in 19th century Despite its origin in military conquest, and the long warlike tradition of the Manchu people who formed its ruling class, by the 19th century the Qing state was militarily extremely weak, poorly trained, lacking modern weapons and plagued by corruption and incompetence. They repeatedly lost against the Western powers. Two Opium Wars (鸦片战争 yāpiàn zhànzhēng), pitted China against Western powers, notably Britain and France. China quickly lost both wars. After each defeat, the victors forced the Chinese government to make major concessions. After the first war 1839–1842, the treaty ceded Hong Kong island to Britain, and opened five "treaty ports" including Shanghai and Guangzhou (Canton), and