/* 参照 h5-web/app/assets/styles/common.scss */
* {
  padding: 0;
  margin: 0;
  box-sizing: border-box !important;
}

body, html {
  max-width: 450px;
  font-size: 14px;
  /* 欧美 H5 主阅读语言为英文：系统西文字体优先，中文回退置后 */
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'PingFang SC', 'Hiragino Sans GB', sans-serif !important;
  color: #212223 !important;
  max-height: 100vh;
  width: 100vw;
  padding: 0;
  background-color: #FFFFFF !important;
  margin: 0 auto;
}

/* 桌面端响应式 - 移除最大宽度限制 */
@media screen and (min-width: 768px) {
  body, html {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
  }
  
  /* 阅读器页面特殊处理 */
  body.reader-body,
  html.reader-html {
    max-width: 100vw !important;
    width: 100vw !important;
    margin: 0 !important;
  }
}

body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, code, form, fieldset, legend, input, button, textarea, p, blockquote, th, td {
  margin: 0;
  padding: 0;
}

#app {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  max-height: 100vh;
  width: 100vw;
  position: relative;
}

a, a:focus, a:hover {
  cursor: pointer;
  color: inherit;
  text-decoration: none;
}

a:focus, a:active {
  outline: none;
}

.clearfix:after {
  visibility: hidden;
  display: block;
  font-size: 0;
  content: " ";
  clear: both;
  height: 0;
}

li, ul, h3, p {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* 改变滚动条样式 */
::-webkit-scrollbar {
  display: none; /* Chrome Safari */
  width: 5px;
}

::-webkit-scrollbar-thumb {
  border-radius: 10px;
  -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,.3);
  background-color: rgba(0,0,0,0.1);
}

/* rem 适配 - 参照 h5-web/app/utils/rem.ts */
html {
  font-size: 37.5px; /* baseSize = 37.5，基于 375px 设计稿 */
}

@media screen and (max-width: 375px) {
  html {
    font-size: 37.5px;
  }
}

@media screen and (min-width: 375px) {
  html {
    font-size: calc(37.5px * (100vw / 375));
  }
}

@media screen and (min-width: 450px) {
  html {
    font-size: 45px; /* 最大不超过 2 倍 */
  }
}

