/* ============================================================
   XYY App Shell v3.13 — APK / WebView 专用布局（不影响手机浏览器）
   触发：body.xyy-app-shell（UA 含 XiyiCloudApp 或 MainActivity 注入）
   ⚠️ 禁止在此文件写背景壁纸规则 — 背景仅由 xyy-env.js + html[data-xyy-bg]
   ============================================================ */

@media (max-width: 992px) {
	body.xyy-theme.xyy-app-shell {
		--xyy-topbar-h: 52px;
		--xyy-content-gap: 8px;
		overscroll-behavior-y: none;
		min-height: 100dvh;
	}

	html.xyy-app-shell {
		overscroll-behavior-y: none;
		background-color: #1a1035;
	}

	/* 顶栏：App 沉浸式 */
	body.xyy-theme.xyy-app-shell #page-topbar {
		background: rgba(15, 10, 35, 0.82) !important;
		border-bottom-color: rgba(255, 255, 255, 0.06) !important;
	}

	body.xyy-theme.xyy-app-shell #page-topbar .navbar-header {
		padding: 0 10px;
	}

	body.xyy-theme.xyy-app-shell #vertical-menu-btn {
		width: 44px;
		height: 44px;
		min-width: 44px;
		display: inline-flex !important;
		align-items: center;
		justify-content: center;
		padding: 0 !important;
	}

	body.xyy-theme.xyy-app-shell #page-topbar .xyy-logo-full {
		max-height: 28px !important;
	}

	/* APK 顶栏显示消息、购物车（原 d-lg 隐藏） */
	body.xyy-theme.xyy-app-shell #page-topbar a[href="message"],
	body.xyy-theme.xyy-app-shell #page-topbar a[href="cart?action=viewcart"],
	body.xyy-theme.xyy-app-shell #page-topbar a[href="/message"],
	body.xyy-theme.xyy-app-shell #page-topbar a[href="/cart?action=viewcart"] {
		display: inline-block !important;
	}

	body.xyy-theme.xyy-app-shell #page-topbar .dropdown.d-none.d-lg-inline-block.ml-1 {
		display: inline-block !important;
	}

	body.xyy-theme.xyy-app-shell #page-topbar .header-item.noti-icon {
		width: 44px;
		height: 44px;
		display: inline-flex !important;
		align-items: center;
		justify-content: center;
		padding: 0 !important;
	}

	body.xyy-theme.xyy-app-shell #page-topbar .header-item.noti-icon i {
		margin-top: 0 !important;
		font-size: 22px;
	}

	body.xyy-theme.xyy-app-shell #page-topbar .navbar-header > .d-flex:last-child {
		gap: 2px;
	}

	/* 内容区最大化 */
	body.xyy-theme.xyy-app-shell .main-content {
		padding-top: calc(var(--xyy-topbar-h) + 6px + env(safe-area-inset-top, 0px)) !important;
	}

	body.xyy-theme.xyy-app-shell .page-content {
		padding: 10px 10px calc(12px + env(safe-area-inset-bottom, 0px)) !important;
	}

	body.xyy-theme.xyy-app-shell.xyy-page-clientarea .page-content {
		padding-top: calc(var(--xyy-topbar-h) + 4px + env(safe-area-inset-top, 0px)) !important;
	}

	body.xyy-theme.xyy-app-shell .card {
		margin-bottom: 8px !important;
	}

	body.xyy-theme.xyy-app-shell .card-body {
		padding: 14px !important;
	}

	body.xyy-theme.xyy-app-shell .page-title-box {
		padding: 10px 12px !important;
		margin-bottom: 10px !important;
	}

	/* 侧栏抽屉：全高 App 风格 */
	body.xyy-theme.xyy-app-shell .vertical-menu {
		width: min(280px, 86vw) !important;
		padding-top: env(safe-area-inset-top, 0px);
	}

	body.xyy-theme.xyy-app-shell.sidebar-enable .vertical-menu {
		box-shadow: 8px 0 32px rgba(0, 0, 0, 0.45);
	}

	/* 消息页操作栏 */
	body.xyy-theme.xyy-app-shell .xyy-mobile-action-bar {
		padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
	}

	body.xyy-theme.xyy-app-shell.xyy-page-message .page-content {
		padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
	}

	/* 登录页全屏 */
	body.xyy-theme.xyy-app-shell.auth-body-bg .account-pages {
		min-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
	}
}
