/**
 * 前端移动页头：md3-mobile-top-nav 与 #topAppBar 搜索条叠层修复
 * 顶栏固定 56px 时，原搜索行被完全遮挡；将 #topAppBar 下移并只保留搜索区。
 */
/* ======== sanxio 移动前端页头搜索 start =========== */

@media (max-width: 767px) {
	body:not(.member-md3-page):has(.md3-mobile-top-nav):has(#topAppBar) {
		--sanxio-header-mobile-front: calc(56px + 56px);
		padding-top: var(--sanxio-header-mobile-front) !important;
	}

	body:not(.member-md3-page):has(.md3-mobile-top-nav):has(#topAppBar) #searchDropdown.mdc-search-dropdown {
		top: var(--sanxio-header-mobile-front, 112px) !important;
	}

	body:not(.member-md3-page):has(.md3-mobile-top-nav) #topAppBar.mdc-top-app-bar--fixed {
		top: 56px !important;
		z-index: 999;
		left: 0;
		right: 0;
		background: var(--md3-color-surface, #fff);
		border-bottom: 1px solid var(--md3-color-outline-variant, rgba(0, 0, 0, 0.12));
		box-shadow: none !important;
	}

	body:not(.member-md3-page):has(.md3-mobile-top-nav) #topAppBar .mdc-top-app-bar__section--align-start,
	body:not(.member-md3-page):has(.md3-mobile-top-nav) #topAppBar .mdc-top-app-bar__section--align-end {
		display: none !important;
	}

	body:not(.member-md3-page):has(.md3-mobile-top-nav) #topAppBar .mdc-top-app-bar__row {
		height: auto;
		min-height: 56px;
		padding: var(--sanxio-gap-sm, 8px) var(--sanxio-block-px, 12px);
		box-sizing: border-box;
	}

	body:not(.member-md3-page):has(.md3-mobile-top-nav) #topAppBar .mdc-search-section {
		flex: 1 1 auto;
		width: 100%;
		max-width: none;
		margin: 0 !important;
		padding: 0 !important;
	}

	body:not(.member-md3-page):has(.md3-mobile-top-nav) #topAppBar .sanxio-header-search-cluster {
		width: 100%;
	}

	body:not(.member-md3-page):has(.md3-mobile-top-nav) #topAppBar #destoon-search.md3-search-bar {
		width: 100%;
		max-width: none;
		height: 40px !important;
		min-height: 40px;
		padding: 0 var(--sanxio-gap-sm, 8px) 0 var(--sanxio-block-px, 12px) !important;
		border-radius: 20px !important;
		overflow: hidden !important;
		display: flex !important;
		align-items: center !important;
		gap: var(--sanxio-gap-sm, 8px) !important;
		box-sizing: border-box;
	}

	body:not(.member-md3-page):has(.md3-mobile-top-nav) #topAppBar #destoon-search .md3-search-bar__input-wrapper {
		flex: 1 1 auto;
		min-width: 0;
	}

	body:not(.member-md3-page):has(.md3-mobile-top-nav) #topAppBar #destoon-search .md3-search-bar__actions {
		flex-shrink: 0;
		margin: 0 !important;
		padding: 0 !important;
		gap: var(--sanxio-gap-sm, 8px) !important;
		align-items: center;
	}

	body:not(.member-md3-page):has(.md3-mobile-top-nav) #topAppBar #destoon-search .md3-search-bar__module-select {
		margin-right: var(--sanxio-gap-sm, 8px);
		padding-right: var(--sanxio-gap-sm, 8px);
	}

	body:not(.member-md3-page):has(.md3-mobile-top-nav) #topAppBar #destoon-search .custom-md3-select__selected-text {
		max-width: 4.5rem;
		font-size: var(--text-sm, 13px);
	}

	body:not(.member-md3-page):has(.md3-mobile-top-nav) #topAppBar #destoon-search .md3-search-bar__submit,
	body:not(.member-md3-page):has(.md3-mobile-top-nav) #topAppBar #destoon-search .md3-search-bar__adv {
		width: 32px !important;
		height: 32px !important;
		min-width: 32px !important;
		min-height: 32px !important;
		max-height: 32px !important;
		margin: 0 !important;
		border-radius: 50% !important;
		box-shadow: none !important;
		align-self: center;
	}

	body:not(.member-md3-page):has(.md3-mobile-top-nav) #topAppBar #destoon-search .md3-search-bar__submit .material-symbols-outlined {
		font-size: 20px !important;
	}

	body:not(.member-md3-page):has(.md3-mobile-top-nav) #topAppBar #destoon-search .md3-search-bar__adv {
		display: none;
	}

	/* 频道 Chip 已取消：首页金刚区已有入口，避免重复菜单 */
	.sanxio-mobile-search-channels {
		display: none !important;
	}

	/* 顶栏按钮：收起搜索行 */
	body:not(.member-md3-page).sanxio-mobile-search-bar-collapsed:has(.md3-mobile-top-nav):has(#topAppBar) {
		--sanxio-header-mobile-front: 56px;
		padding-top: 56px !important;
	}

	body:not(.member-md3-page).sanxio-mobile-search-bar-collapsed:has(.md3-mobile-top-nav) #topAppBar.mdc-top-app-bar--fixed {
		max-height: 0 !important;
		min-height: 0 !important;
		overflow: hidden !important;
		opacity: 0 !important;
		pointer-events: none !important;
		padding: 0 !important;
		border-bottom: none !important;
	}

	body:not(.member-md3-page).sanxio-mobile-search-bar-collapsed:has(.md3-mobile-top-nav) #searchDropdown.mdc-search-dropdown {
		top: 56px !important;
	}

	.md3-mobile-top-nav__btn.sanxio-mobile-top-nav__search-toggle[hidden] {
		display: none !important;
	}

	/* 抽屉打开时：页头底部分隔线会从卡片左侧露出来 */
	body:has(#settingsDrawer.mdc-drawer--open) .md3-mobile-top-nav,
	body:has(#navDrawer.mdc-drawer--open) .md3-mobile-top-nav {
		border-bottom-color: transparent;
	}
	body:has(#settingsDrawer.mdc-drawer--open) #topAppBar.mdc-top-app-bar--fixed,
	body:has(#navDrawer.mdc-drawer--open) #topAppBar.mdc-top-app-bar--fixed {
		border-bottom-color: transparent !important;
	}

	/* 标题展开卡片打开：顶栏底边线不得压在卡片圆角上 */
	body.sx-mobile-title-card-open .md3-mobile-top-nav,
	.md3-mobile-top-nav.is-title-card-open {
		border-bottom-color: transparent !important;
	}
	body.sx-mobile-title-card-open #topAppBar.mdc-top-app-bar--fixed {
		/* 卡片叠在搜索条之上，避免搜索条顶边线露出来 */
		box-shadow: none !important;
	}
}

/* ======== sanxio 移动前端页头搜索 end =========== */

/* 125: compact public navigation and a single-row inner-page search mode. */
@media(max-width:767px){
body.sx-mobile-nav-v2{--sx-mobile-top-height:calc(56px + env(safe-area-inset-top,0px))}
body.sx-mobile-nav-v2 #js-mobile-top-nav{height:var(--sx-mobile-top-height)!important;padding:env(safe-area-inset-top,0px) 4px 0!important;gap:0}
body.sx-mobile-nav-v2 #js-mobile-top-nav .md3-mobile-top-nav__leading{width:44px!important}
body.sx-mobile-nav-v2 #js-mobile-top-nav .md3-mobile-top-nav__actions{display:flex;flex:0 0 auto;gap:0!important}
body.sx-mobile-nav-v2 #js-mobile-top-nav .md3-mobile-top-nav__btn:not(#js-mobile-drawer-toggle){width:44px!important;min-width:44px!important;height:44px!important;min-height:44px!important}
body.sx-mobile-nav-v2 #js-mobile-top-nav .md3-mobile-top-nav__title{padding:0 4px!important;flex:1 1 0%;min-width:0}
body.sx-mobile-nav-v2 #js-mobile-top-nav .material-symbols-outlined{width:24px!important;height:24px!important;min-width:0!important;display:inline-flex;align-items:center;justify-content:center;font-size:24px!important;overflow:hidden}
body.sx-mobile-nav-v2 #js-mobile-top-nav svg{flex-shrink:0}
body.sx-mobile-nav-v2 #js-mobile-settings-toggle{position:relative!important;display:flex;align-items:center;justify-content:center}
body.sx-mobile-nav-v2 #js-mobile-top-nav .mdc-top-app-bar__user-avatar-fallback{position:absolute!important;inset:0!important;margin:auto!important;transform:none!important}
body.sx-mobile-nav-v2 #js-translate-btn-mobile{display:none!important}
body.sx-mobile-nav-v2.sx-mobile-nav-inner:not(.member-md3-page):has(#topAppBar){--sanxio-header-mobile-front:var(--sx-mobile-top-height);padding-top:var(--sx-mobile-top-height)!important}
body.sx-mobile-nav-v2.sx-mobile-nav-home:not(.member-md3-page):has(#topAppBar){--sanxio-header-mobile-front:calc(var(--sx-mobile-top-height) + 56px);padding-top:var(--sanxio-header-mobile-front)!important}
body.sx-mobile-nav-v2.sx-mobile-nav-home #topAppBar{top:var(--sx-mobile-top-height)!important}
body.sx-mobile-nav-v2 #js-mobile-top-nav .sx-mobile-search-mode[hidden]{display:none!important}
body.sx-mobile-nav-v2 #js-mobile-top-nav .sx-mobile-search-mode{display:flex;align-items:center;gap:4px;width:100%;min-width:0;position:relative}
body.sx-mobile-searching #js-mobile-top-nav{overflow:visible!important;z-index:2102!important}
body.sx-mobile-searching #js-mobile-top-nav>.md3-mobile-top-nav__leading,body.sx-mobile-searching #js-mobile-top-nav>.md3-mobile-top-nav__title,body.sx-mobile-searching #js-mobile-top-nav>.md3-mobile-top-nav__actions{display:none!important}
body.sx-mobile-nav-v2 #sx-mobile-search-mode .sx-mobile-search-close{display:flex;align-items:center;justify-content:center;flex:0 0 44px;width:44px;height:44px;min-height:44px;border:0;background:transparent;color:var(--md3-color-on-surface,#202124);cursor:pointer}
body.sx-mobile-nav-v2 #sx-mobile-search-mode #destoon-search{display:flex!important;align-items:center;flex:1 1 auto;min-width:0;width:auto!important;height:44px!important;min-height:44px!important;margin:0!important;padding:0 0 0 10px!important;border-radius:22px!important;overflow:visible!important;gap:0!important}
body.sx-mobile-nav-v2 #sx-mobile-search-mode .md3-search-bar__input-wrapper{flex:1 1 auto;min-width:0;display:flex;align-items:center}
body.sx-mobile-nav-v2 #sx-mobile-search-mode #destoon-kw{min-width:0;width:100%;height:42px;box-sizing:border-box;font-size:16px!important}
body.sx-mobile-nav-v2 #sx-mobile-search-mode .md3-search-bar__module-select,body.sx-mobile-nav-v2 #sx-mobile-search-mode #searchAdvBtn,body.sx-mobile-nav-v2 #sx-mobile-search-mode #desktopSearchSuggestionPanel{display:none!important}
body.sx-mobile-nav-v2 #sx-mobile-search-mode .md3-search-bar__actions{display:flex;align-items:center;margin:0!important;padding:0!important;flex:0 0 auto}
body.sx-mobile-nav-v2 #sx-mobile-search-mode .md3-search-bar__submit{display:flex!important;align-items:center;justify-content:center;width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;margin:0!important;box-shadow:none!important}
body.sx-mobile-nav-v2 #sx-mobile-search-mode #search-cls{position:static!important;flex:0 0 44px;width:44px;min-height:44px;align-items:center;justify-content:center;cursor:pointer;transform:none!important}
body.sx-mobile-nav-v2 #sx-mobile-search-mode #searchDropdown{position:fixed!important;top:var(--sx-mobile-top-height)!important;left:0!important;right:0!important;width:100%!important;max-width:none!important;z-index:2103!important}
}

/* 128: fixed navigation uses one shared center line. Home keeps its layout slot. */
@media(max-width:767px){
body.sx-mobile-nav-v2 #js-mobile-top-nav .md3-mobile-top-nav__leading,
body.sx-mobile-nav-v2 #js-mobile-top-nav .md3-mobile-top-nav__actions{display:flex;align-items:center!important;height:44px}
body.sx-mobile-nav-v2 #js-mobile-top-nav .md3-mobile-top-nav__btn:not(#js-mobile-drawer-toggle){display:inline-flex;align-items:center!important;justify-content:center!important;padding:0!important;line-height:1!important;transform:none!important;box-sizing:border-box}
body.sx-mobile-nav-v2 #js-mobile-top-nav .md3-mobile-top-nav__title{display:flex;align-items:center!important;height:44px;line-height:24px!important}
body.sx-mobile-nav-v2 #js-mobile-top-nav .md3-mobile-top-nav__title-text{line-height:24px!important}
body.sx-mobile-nav-v2 #js-mobile-top-nav .material-symbols-outlined{line-height:1!important;vertical-align:middle;transform:none!important}
body.sx-mobile-nav-v2 #js-mobile-top-nav svg{display:block}
body.sx-mobile-nav-v2 #js-mobile-top-nav .mdc-top-app-bar__user-avatar-img{position:absolute!important;inset:0!important;margin:auto!important;transform:none!important;object-fit:cover}
body.sx-mobile-nav-home #topAppBar{transition:transform .18s ease,opacity .18s ease!important}
body.sx-mobile-nav-home.sx-home-search-hidden #topAppBar{transform:translateY(-100%)!important;opacity:0!important;pointer-events:none!important}
body.sx-mobile-nav-home.sx-home-search-hidden #js-mobile-top-nav{z-index:2102!important}
}
@media(max-width:767px) and (prefers-reduced-motion:reduce){body.sx-mobile-nav-home #topAppBar{transition:none!important}}
@media(max-width:767px){body.sx-mobile-searching #js-mobile-top-nav>.md3-mobile-top-nav__leading,body.sx-mobile-searching #js-mobile-top-nav>.md3-mobile-top-nav__title,body.sx-mobile-searching #js-mobile-top-nav>.md3-mobile-top-nav__actions{display:none!important}}

/* 129: hide the complete search header, including its decoration layer. */
@media(max-width:767px){
body.sx-mobile-nav-home.sx-home-search-hidden #topAppBar.mdc-top-app-bar{visibility:hidden!important;border-color:transparent!important;box-shadow:none!important}
body.sx-mobile-nav-home.sx-home-search-hidden #topAppBar::before,
body.sx-mobile-nav-home.sx-home-search-hidden #topAppBar::after{visibility:hidden!important;opacity:0!important;border:0!important;box-shadow:none!important}
}
@media(max-width:767px){body.sx-mobile-nav-home.sx-home-search-hidden #categoryDrawer:not(.mdc-category-drawer--open){visibility:hidden!important;border:0!important;box-shadow:none!important}}
