Attribution and modifications for WWJ-3392 Adapted documentation - “Using templates and slots” by Mozilla Contributors: https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_templates_and_slots - “Using custom elements” by Mozilla Contributors: https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_custom_elements - “Using shadow DOM” by Mozilla Contributors: https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_shadow_DOM MDN states that its documentation is available under CC BY-SA 2.5 or any later version. This Chinese translation and adaptation of the documentation is shared under CC BY-SA 2.5 or any later version. MDN documents code samples separately: samples added on/after 2010-08-20 are CC0 and earlier samples are MIT, but MDN says the current Yari platform does not identify which category an individual sample belongs to. This package makes no sample-specific CC0 date claim. License information: https://creativecommons.org/licenses/by-sa/2.5/ . The applicable license text is available at https://creativecommons.org/licenses/by-sa/2.5/legalcode.en . MDN's attribution and code-sample policy is at https://developer.mozilla.org/en-US/docs/MDN/Writing_guidelines/Attrib_copyright_license . Modifications: translated into Chinese; combined material from the three linked guides; shortened and restyled examples; added a template-presence check and a host-scoped selector; and added explanatory notes about lifecycle behavior, CSS inheritance, compatibility, and security. No MDN screenshots or other external images are included. Original image “diagram.png” is an original editorial diagram by 未完纪, drawn for this article. It is not an MDN image, screenshot, or browser test result. It is permitted for use together with this article under separate authorization; the image is not independently offered under the documentation's CC BY-SA license. Image file SHA-256 is recorded in final-publication-manifest.json. This is an independent translation and adaptation. It is not an official MDN or Mozilla publication and is not endorsed by MDN or Mozilla.