/* 电脑端：整站按手机宽度居中；底栏钉在视口底部（不要给 #app 加 transform） */

html.kariz-pc-frame,
html.kariz-pc-frame body {
  background: #e8e8e8 !important;
  min-height: 100% !important;
}

html.kariz-pc-frame #app,
html.kariz-pc-frame uni-app {
  max-width: 430px !important;
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  background: #fff !important;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.12);
  position: relative !important;
  /* 关键：不要 transform/filter，否则内部 fixed 底栏会跟着页面滑走 */
  overflow-x: clip;
}

html.kariz-pc-frame uni-page,
html.kariz-pc-frame uni-page-wrapper,
html.kariz-pc-frame uni-page-body,
html.kariz-pc-frame .page {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/*
 * 底栏：相对浏览器视口 fixed，并水平居中到 430 手机框
 * （不能依赖 transform 包裹层）
 */
html.kariz-pc-frame .tabbar,
html.kariz-pc-frame uni-view.tabbar,
html.kariz-pc-frame .uni-tabbar-bottom,
html.kariz-pc-frame .uni-tabbar-bottom .uni-tabbar {
  position: fixed !important;
  left: 50% !important;
  right: auto !important;
  bottom: 0 !important;
  width: 100% !important;
  max-width: 430px !important;
  margin: 0 !important;
  transform: translateX(-50%) !important;
  -webkit-transform: translateX(-50%) !important;
  z-index: 999999 !important;
}

/* 兜底：挂到 body 的遮罩/弹层限制在中间手机框 */
html.kariz-pc-frame body > .uni-mask,
html.kariz-pc-frame body > .uni-modal,
html.kariz-pc-frame body > .uni-popup,
html.kariz-pc-frame body > [class*="mask"],
html.kariz-pc-frame body > [class*="popup"],
html.kariz-pc-frame body > [class*="overlay"],
html.kariz-pc-frame body > #almas-pc-tabbar-host {
  max-width: 430px !important;
  left: 50% !important;
  right: auto !important;
  width: 100% !important;
}

html.kariz-pc-frame body > .uni-mask,
html.kariz-pc-frame body > .uni-modal,
html.kariz-pc-frame body > .uni-popup,
html.kariz-pc-frame body > [class*="mask"],
html.kariz-pc-frame body > [class*="popup"],
html.kariz-pc-frame body > [class*="overlay"] {
  margin-left: 0 !important;
  transform: translateX(-50%) !important;
}

html.kariz-pc-frame body > #almas-pc-tabbar-host {
  position: fixed !important;
  left: 50% !important;
  bottom: 0 !important;
  transform: translateX(-50%) !important;
  z-index: 999999 !important;
  pointer-events: none;
}

html.kariz-pc-frame body > #almas-pc-tabbar-host .tabbar {
  pointer-events: auto;
  position: relative !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  transform: none !important;
  width: 100% !important;
  max-width: 430px !important;
}

@media (min-width: 768px) and (hover: hover) and (pointer: fine) {
  html:not(.kariz-pc-frame) body {
    background: #e8e8e8;
  }
  html:not(.kariz-pc-frame) #app,
  html:not(.kariz-pc-frame) uni-app {
    max-width: 430px;
    margin-left: auto;
    margin-right: auto;
    min-height: 100vh;
    background: #fff;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.12);
    position: relative;
    overflow-x: clip;
  }
}
