/* H5 响应式基础样式 - 配合 rem 适配使用 */

/* 1. 全局盒模型 */
*, *::before, *::after {
  box-sizing: border-box;
}

/* 2. 根元素基础 */
html {
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 3. 图片自适应 */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 4. 视频自适应 */
video {
  max-width: 100%;
  height: auto;
}

/* 5. 主容器自适应 */
#app,
.app-container,
.layout-content,
.container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

/* 6. 模块/卡片宽度自适应 */
.module,
.card-item,
.cont-wrap,
.timeline-item,
.honor-item,
.brand-item,
.img-item {
  width: 100%;
  max-width: 100%;
}

/* 7. 表单元素自适应 */
input,
textarea,
select,
button {
  max-width: 100%;
}

/* 8. 表格自适应 */
table {
  width: 100%;
  border-collapse: collapse;
}

/* 9. 弹性布局辅助 */
.flex-wrap {
  display: flex;
  flex-wrap: wrap;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

/* 10. 隐藏溢出 */
.overflow-hidden {
  overflow: hidden;
}

/* 11. 文字溢出处理 */
.text-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 12. 针对特定元素的适配 */
.doc-video-poster img,
.cont-view-img img,
.item-video img,
.hero-img-box img {
  width: 100%;
  height: auto;
}

/* 13. 弹窗居中适配 */
.popup-body,
.video-box,
.care-content-body {
  max-width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

/* 14. 横向滚动卡片容器 */
.cont-cards,
.cont-list,
.honor-grid,
.brands-wrapper {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

/* 15. 小屏幕优化 */
@media screen and (max-width: 320px) {
  html {
    font-size: 32px !important;
  }
}

/* 16. 横屏提示 */
@media screen and (orientation: landscape) and (max-height: 500px) {
  body::before {
    content: '建议竖屏浏览以获得最佳体验';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    text-align: center;
    padding: 10px;
    font-size: 14px;
    z-index: 9999;
  }
}
