html {
  -ms-touch-action: none;
  /* 锁 html/body 不滚动:Cocos web ScreenAdapter 在 Android 上有一段补偿:
     body.scrollHeight > innerHeight 时把差值加到 innerHeight。
     WebViewV (Portrait) + 横屏拿手机会让引擎给 #GameDiv 加 transform:rotate(90deg) + margin-left:e,
     旋转前的 layout box + 左 margin 推出视口右侧 → body.scrollHeight 变大 → 触发补偿 →
     Game Frame 被错误放大,下次旋转继续吃补偿,出现"每旋转一次放大一档"的现象。
     overflow:hidden 强制 scrollHeight == innerHeight,补偿分支永远不命中。 */
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  /* Web 端对齐 Native WebView 滚动条策略：不显示滚动条，不给首帧 loading / 方向切换留下白边指示器。 */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body, canvas, div {
  display: block;
  outline: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);

  user-select: none;
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  -khtml-user-select: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

/* Remove spin of input type number */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    /* display: none; <- Crashes Chrome on hover */
    -webkit-appearance: none;
    margin: 0; /* <-- Apparently some margin are still there even though it's hidden */
}

body {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  margin: 0;
  /* 见 html 的注释 */
  overflow: hidden;
  overscroll-behavior: none;
  scrollbar-width: none;
  -ms-overflow-style: none;

  cursor: default;
  color: #888;
  background-color: #333;

  text-align: center;
  font-family: Helvetica, Verdana, Arial, sans-serif;

  display: flex;
  flex-direction: column;
}

/* 隐藏 WebKit/Blink 滚动条：对应 Android WebView setVertical/HorizontalScrollBarEnabled(false)。 */
html::-webkit-scrollbar,
body::-webkit-scrollbar,
iframe::-webkit-scrollbar,
div::-webkit-scrollbar,
canvas::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
  background: transparent !important;
}

/* 禁止页面边界 overscroll 回弹/发光，避免边缘闪白。 */
html,
body,
#GameDiv,
#Cocos3dGameContainer,
#GameCanvas,
iframe {
  overscroll-behavior: none;
}

iframe {
  overflow: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

canvas {
  background-color: rgba(0, 0, 0, 0);
}

#GameDiv, #Cocos3dGameContainer, #GameCanvas {
  width: 100%;
  height: 100%;
}

:root {
  --safe-top: env(safe-area-inset-top);
  --safe-right: env(safe-area-inset-right);
  --safe-bottom: env(safe-area-inset-bottom);
  --safe-left: env(safe-area-inset-left);
}
