Touhou character. The physical component for Alice Margatroid's spellcard "Eerily Luminous Shanghai Doll" in Perfect Cherry Blossom / Immaterial and Missing Power, as well as her familiar in Imperishable Night.
Shanghai is a very popular supporting character (or artifact) in Touhou fan art depicting Alice.
Some comic artists give the doll a personality and feelings of its own, making it a "master doll" that helps control the lesser dolls. Others show it as Alice's primary magically-controlled "puppet". These points of view can be mixed, possibly to give an impression of Alice "debating with herself" through doll use, reminiscent of the way ventriloquists use puppets. Sometimes she/it is even depicted as lacking "doll" traits entirely, resembling a minigirl.
Another view is that Shanghai is a type or class of magical dolls rather than an individual doll. This is based on the fact that several Shanghai dolls are seen simultaneously in Perfect Cherry Blossom.
Canonically, Shanghai, like all the rest of Alice's dolls, is a mindless drone that requires direct supervision for all but the most basic of autonomous action, despite Alice's ongoing efforts to create a truly sapient construct. When a fanwork depicts Alice finally succeeding, Shanghai is usually the subject.