/**
 * 前台顶部合面权威（轻表面工作台）
 * 桌面：#topBar + #topAppBar + .mdc-module-menu 同色、层间无阴影
 * 合面外缘轻边（两态 + 防闪，禁止再「全开/全关」反复）：
 *   html[data-sx-vr-front=pending|1] → 外缘无边（pending 防首屏双线闪；1=有叫车）
 *   html[data-sx-vr-front=0]         → 外缘 1px outline-variant（确认无叫车）
 * 属性由 header-vr-edge-sync.js 写入；不改叫车锁定文件
 * 登记：sanxio/docs/ui-fixed-registry.md → F-20261115-header-edge-clear
 */
/* ======== sanxio 顶部合面 start =========== */

:root {
	--sanxio-header-surface: var(--md3-color-surface-container-low, #f3f5f9);
	--sanxio-header-surface-edge: var(--md3-color-outline-variant, #c3c6cf);
}

/* html 勿留纯白：与页底 surface-container-low 同色，避免页脚/回弹露白边 */
html:not(:has(body.member-md3-page)) {
	background-color: var(--md3-color-surface-container-low, #f3f5f9);
}
body:not(.member-md3-page) {
	background-color: var(--md3-color-surface-container-low, #f3f5f9);
}

/* ----- 桌面：三截合为一面；默认无外缘（pending/有叫车）；仅 data=0 画轻边 ----- */
@media (min-width: 768px) {
	body:not(.member-md3-page) #topBar.mdc-top-bar,
	body:not(.member-md3-page) #topBar .mdc-top-bar__row {
		background-color: var(--sanxio-header-surface) !important;
		background-image: none !important;
		box-shadow: none !important;
		border-bottom: 0 !important;
	}

	body:not(.member-md3-page) #topAppBar.mdc-top-app-bar,
	body:not(.member-md3-page) #topAppBar.mdc-top-app-bar--fixed {
		background-color: var(--sanxio-header-surface) !important;
		background-image: none !important;
		box-shadow: none !important;
		border-bottom: 0 !important;
	}

	body:not(.member-md3-page) .mdc-module-menu,
	body:not(.member-md3-page) nav.mdc-module-menu {
		background-color: var(--sanxio-header-surface) !important;
		background-image: none !important;
		box-shadow: none !important;
		border: 0 !important;
		border-bottom: 0 !important;
	}

	html[data-sx-vr-front="0"] body:not(.member-md3-page) .mdc-module-menu,
	html[data-sx-vr-front="0"] body:not(.member-md3-page) nav.mdc-module-menu {
		border-bottom: 1px solid var(--sanxio-header-surface-edge) !important;
	}

	/* 无频道菜单时，AppBar 即为合面外缘 */
	body:not(.member-md3-page):not(:has(.mdc-module-menu)) #topAppBar.mdc-top-app-bar {
		border-bottom: 0 !important;
	}

	html[data-sx-vr-front="0"] body:not(.member-md3-page):not(:has(.mdc-module-menu)) #topAppBar.mdc-top-app-bar {
		border-bottom: 1px solid var(--sanxio-header-surface-edge) !important;
	}
}

/* ----- 移动：顶栏合面；默认无外缘；仅 data=0 画轻边 ----- */
@media (max-width: 767px) {
	body:not(.member-md3-page) #js-mobile-top-nav.md3-mobile-top-nav,
	body:not(.member-md3-page) .md3-mobile-top-nav {
		background-color: var(--sanxio-header-surface) !important;
		background-image: none !important;
		box-shadow: none !important;
		border-bottom: 0 !important;
	}

	body:not(.member-md3-page) #topAppBar.mdc-top-app-bar,
	body:not(.member-md3-page) #topAppBar.mdc-top-app-bar--fixed {
		background-color: var(--sanxio-header-surface) !important;
		background-image: none !important;
		box-shadow: none !important;
		border-bottom: 0 !important;
	}

	html[data-sx-vr-front="0"] body:not(.member-md3-page) #topAppBar.mdc-top-app-bar,
	html[data-sx-vr-front="0"] body:not(.member-md3-page) #topAppBar.mdc-top-app-bar--fixed {
		border-bottom: 1px solid var(--sanxio-header-surface-edge) !important;
	}
}

/* ======== sanxio 顶部合面 end =========== */
