/**
 * [INPUT]: 依赖站点变量与原生主题节点的 data-shell-role。
 * [OUTPUT]: 补齐主题包装层、玻璃、字标、模式和手机导航样式。
 * [POS]: layouts 的主题外壳适配；原生节点样式拥有覆盖权。
 * [PROTOCOL]: 变更时更新此头部，然后检查 AGENTS.md
 */
:where(:root:has([data-site-shell])) {
	--emvb-c-brand-primary: var(--color-brand);
	--emvb-c-brand-on-primary: var(--color-on-brand);
	--emvb-c-brand-accent: var(--color-accent);
	--emvb-f-brand-body: var(--font-body);
	--emvb-f-brand-display: var(--font-display);
	background: var(--color-bg);
}
:where([data-site-shell], [data-site-shell] *) { box-sizing: border-box; }
:where([data-site-shell] a) { color: inherit; text-decoration: none; }
/* ---- 原生主题包装层不限制页头的粘性包含块。---- */
:where(.emvb-theme-header:has([data-site-shell="header"]), .emvb-theme-footer:has([data-site-shell="footer"])) { display: contents; }
:where([data-site-shell]) {
	color: var(--color-text);
}
:where([data-site-shell] [data-shell-role="nav"]) {
	background: var(--glass-bg);
	box-shadow: var(--shadow-glass);
	-webkit-backdrop-filter: saturate(1.6) blur(18px);
	backdrop-filter: saturate(1.6) blur(18px);
}
:where([data-site-shell] [data-shell-role="wordmark"]) {
	min-width: 0;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}
:where([data-site-shell] [data-shell-role="navigation"], [data-site-shell] [data-shell-role="footer-link"]) {
	color: var(--color-text-secondary);
}
:where([data-site-shell] [data-shell-role="navigation"]) { margin-inline-start: auto; }
:where([data-site-shell] [data-shell-role="navigation"] .emvb-menu__list) { gap: inherit; }
:where([data-site-shell] [data-shell-role="navigation"] a) { white-space: nowrap; }
:where([data-site-shell] [data-shell-role="admin"], [data-site-shell] [data-shell-role="muted"], [data-site-shell] [data-shell-role="theme-button"]) {
	color: var(--color-muted);
}
:where([data-site-shell] [data-shell-role="menu-toggle"]) { color: var(--color-text); }
:where([data-site-shell] [data-shell-role="cta"]) { white-space: nowrap; }
:where([data-site-shell] [data-shell-role="container"]) {
	width: min(var(--wide-width), calc(100% - var(--gutter) * 2));
	margin-inline: auto;
}
:where([data-site-shell] [data-shell-role="theme-switcher"]) { background: var(--color-sunken); }
:where([data-site-shell]) [data-shell-role="theme-button"][aria-pressed="true"] {
	background: var(--color-surface);
	color: var(--color-text);
	box-shadow: var(--shadow-card);
}
:where([data-site-shell] [data-shell-role="large-wordmark"]) {
	margin-block: 40px -0.2em;
	font-size: min(clamp(128px, 27vw, 440px), 250vw / var(--wordmark-length, 6));
	white-space: nowrap;
	color: transparent;
	background: linear-gradient(180deg, color-mix(in srgb, var(--color-text) 9%, transparent), color-mix(in srgb, var(--color-text) 2%, transparent) 75%);
	-webkit-background-clip: text;
	background-clip: text;
	user-select: none;
	pointer-events: none;
}
/* ---- 展开状态控制可见性；导航内部链接不是独立样式节点。---- */
:where([data-site-shell]) [data-shell-role="navigation"][hidden] { display: none; }
@media (max-width: 1024.98px) {
	:where([data-site-shell]) [data-shell-role="navigation"]:not([data-shell-open="true"]) { display: none; }
	:where([data-site-shell] [data-shell-role="navigation"]) {
		max-height: calc(100dvh - 96px);
		overflow-y: auto;
		background: var(--color-surface);
		box-shadow: var(--shadow-glass);
	}
	:where([data-site-shell] [data-shell-role="navigation"]) .emvb-menu-item__link {
		display: flex; align-items: center; width: 100%; min-height: 48px; padding-inline: 18px; border-radius: 18px; font-size: 16px;
	}
}
@media (forced-colors: active) {
	:where([data-site-shell] [data-shell-role="theme-button"][aria-pressed="true"]) { outline: 1px solid CanvasText; }
	:where([data-site-shell] [data-shell-role="large-wordmark"]) { display: none; }
}
