/* ==================== 响应式设计和缩放适配专用文件 ==================== */

/* 基础响应式变量 */
:root {
  --base-font-size: 16px;
  --container-max-width: 1400px;
  --header-height: 96px;
  --scale-factor: 1;
}

/* 防止缩放时的字体大小问题 */
html {
  /* 防止移动端自动调整字体大小 */
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* 针对不同缩放级别的适配 */
@media screen and (max-width: 1600px) {
  :root {
    --base-font-size: 15px;
    --scale-factor: 0.95;
    --header-height: 92px;
  }
  
  body {
    font-size: var(--base-font-size);
  }
  
  /* 需要缩放的组件 */
  .scale-aware {
    transform: scale(var(--scale-factor));
    transform-origin: center top;
  }
}

@media screen and (max-width: 1440px) {
  :root {
    --base-font-size: 14px;
    --scale-factor: 0.9;
    --header-height: 86px;
  }
  
  body {
    font-size: var(--base-font-size);
  }
  
  .scale-aware {
    transform: scale(var(--scale-factor));
    transform-origin: center top;
  }
  
  .side-bar-wrapper {
    height: var(--header-height);
  }
  
  .main-container {
    margin-top: var(--header-height);
  }
}

@media screen and (max-width: 1366px) {
  :root {
    --base-font-size: 13px;
    --scale-factor: 0.85;
    --header-height: 80px;
  }
  
  body {
    font-size: var(--base-font-size);
  }
  
  .scale-aware {
    transform: scale(var(--scale-factor));
    transform-origin: center top;
  }
  
  .side-bar-wrapper {
    height: var(--header-height);
    padding: 0 30px;
  }
  
  .main-container {
    margin-top: var(--header-height);
  }
  
  .jspc-logo {
    width: 320px;
    height: 52px;
  }
  
  .banner-content-wrapper {
    padding-left: 200px;
    padding-top: 80px;
  }
}

/* 针对Mac Retina屏等高DPI显示器的优化 */
@media screen and (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  body {
    -webkit-font-smoothing: subpixel-antialiased;
  }
}

/* 防止浏览器缩放导致的布局错乱 */
@supports (zoom: 100%) {
  html {
    zoom: 100%;
  }
}

/* 针对IE11的兼容性处理 */
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
  body {
    min-width: 1200px;
  }
}

/* 小屏幕适配 */
@media screen and (max-width: 1200px) {
  :root {
    --base-font-size: 12px;
    --scale-factor: 0.8;
    --header-height: 70px;
    --container-max-width: 1000px;
  }
  
  body {
    font-size: var(--base-font-size);
    min-width: 1000px;
  }
  
  .scale-aware {
    transform: scale(var(--scale-factor));
    transform-origin: center top;
  }
  
  .side-bar-wrapper {
    height: var(--header-height);
    padding: 0 20px;
  }
  
  .main-container {
    margin-top: var(--header-height);
  }
  
  .jspc-logo {
    width: 280px;
    height: 46px;
  }
  
  .menu-box-title {
    font-size: 18px;
  }
  
  .banner-content-wrapper {
    padding-left: 150px;
    padding-top: 60px;
  }
}

/* 针对超宽屏幕的优化 */
@media screen and (min-width: 1920px) {
  :root {
    --base-font-size: 18px;
    --container-max-width: 1600px;
  }
  
  body {
    font-size: var(--base-font-size);
  }
}

/* 缩放时的动态调整 */
@media screen and (min-resolution: 120dpi) and (max-resolution: 144dpi) {
  /* 标准缩放 */
  .responsive-text {
    font-size: calc(var(--base-font-size) * 1);
  }
}

@media screen and (min-resolution: 145dpi) and (max-resolution: 168dpi) {
  /* 125% 缩放 */
  .responsive-text {
    font-size: calc(var(--base-font-size) * 0.9);
  }
}

@media screen and (min-resolution: 169dpi) and (max-resolution: 192dpi) {
  /* 150% 缩放 */
  .responsive-text {
    font-size: calc(var(--base-font-size) * 0.8);
  }
}

/* 通用响应式容器类 */
.responsive-container {
  width: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

/* 响应式文字大小 */
.responsive-text {
  font-size: var(--base-font-size);
  line-height: 1.5;
}

/* 响应式间距 */
.responsive-spacing {
  padding: calc(20px * var(--scale-factor));
  margin: calc(20px * var(--scale-factor));
}

/* 防止缩放时图片失真 */
img {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  backface-visibility: hidden;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  -ms-transform: translateZ(0);
}

/* 弹性图片 */
.responsive-img {
  max-width: 100%;
  height: auto;
  object-fit: cover;
}

/* 防止缩放时边框变粗 */
.responsive-border {
  border-width: calc(1px / var(--scale-factor));
}

/* 缩放时的阴影优化 */
.responsive-shadow {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  transform: translateZ(0);
}