/* 电脑端强制手机版布局（必须在 index.css 之后加载）
 * 凡是 position:fixed + left/right:0 的层，必须用 --window-left/right 夹进 480 壳。
 * 只写 max-width:480 会贴到屏幕最左边（顶栏返回、弹窗都踩过这个坑）。
 */
html {
	background: #f2f6f7 !important;
}

body {
	margin: 0 !important;
	padding: 0 !important;
	background: #f2f6f7 !important;
	overflow-x: hidden !important;
}

#app,
uni-app,
uni-page,
uni-page-wrapper,
uni-page-body {
	max-width: 480px !important;
	width: 100% !important;
	margin-left: auto !important;
	margin-right: auto !important;
	box-sizing: border-box !important;
}

#app {
	min-height: 100vh !important;
	position: relative !important;
	overflow-x: hidden !important;
	background: #fff !important;
	box-shadow: 0 0 24px rgba(0, 0, 0, 0.08) !important;
}

/*
 * 统一：把 fixed 全宽层夹进手机壳
 * 覆盖 uView / 自定义顶栏 / 底栏 / 弹层 / 系统组件
 */
.u-drawer,
.u-mask,
.u-popup,
.u-navbar,
.u-navbar-fixed,
.nav-bar,
.nav-header,
uni-view.nav-bar,
uni-view.nav-header,
uni-view.u-navbar,
uni-view.u-navbar-fixed,
uni-view.u-drawer,
uni-view.u-mask,
uni-modal,
uni-toast,
.uni-mask,
.tab-bar,
uni-view.tab-bar,
.uni-tabbar,
uni-tabbar.uni-tabbar-bottom .uni-tabbar,
uni-tabbar.uni-tabbar-top .uni-tabbar,
.uni-page-head,
uni-page-head .uni-page-head,
.footer-fixed,
.bottom-fixed,
.fixed-bottom,
.fixed-top,
.contract-action-bar,
uni-view.contract-action-bar {
	left: var(--window-left, 0px) !important;
	right: var(--window-right, 0px) !important;
	width: auto !important;
	max-width: none !important;
	box-sizing: border-box !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}

/* 系统 / 自定义底栏外观 */
uni-tabbar,
uni-tabbar.uni-tabbar-bottom,
uni-tabbar.uni-tabbar-top {
	background: transparent !important;
}

.uni-tabbar {
	border-top: 1px solid #eee !important;
	box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.04) !important;
	background: #ffffff !important;
}

.tab-bar,
uni-view.tab-bar {
	background: #ffffff !important;
	border-top: 1px solid #eee !important;
	z-index: 1000 !important;
	transform: none !important;
}

/* 顶栏内部布局不受 left/right 影响（仍相对顶栏自身） */
.nav-bar__content,
.nav-header .left,
.nav-header .right,
.u-navbar-inner {
	max-width: 100% !important;
}

/* uni 原生弹层 */
uni-actionsheet .uni-actionsheet {
	left: calc(var(--window-left, 0px) + 6px) !important;
	right: calc(var(--window-right, 0px) + 6px) !important;
}

uni-modal .uni-modal {
	max-width: min(300px, calc(100vw - var(--window-left, 0px) - var(--window-right, 0px) - 40px)) !important;
}

/* toast：相对视口居中 = 壳中心；限制最大宽度 */
.u-toast.u-position-center,
.u-top-tips {
	max-width: calc(100vw - var(--window-left, 0px) - var(--window-right, 0px) - 40px) !important;
}

/* 右下角悬浮倒计时：贴壳右侧 */
.fixed-count-down {
	right: calc(var(--window-right, 0px) + 15px) !important;
	left: auto !important;
	width: auto !important;
	max-width: none !important;
}

/*
 * 兜底：任意带 fixed 且铺满左右的内联样式元素
 *（部分页面写 style="position: fixed; left: 0; right: 0"）
 */
[style*="position: fixed"][style*="left: 0"],
[style*="position:fixed"][style*="left:0"],
[style*="position: fixed"][style*="left:0"],
[style*="position:fixed"][style*="left: 0"],
[style*="position: fixed"][style*="inset: 0"],
[style*="position:fixed"][style*="inset:0"] {
	left: var(--window-left, 0px) !important;
	right: var(--window-right, 0px) !important;
	width: auto !important;
	max-width: none !important;
	box-sizing: border-box !important;
}
