/* Local fonts fallback for China optimization */

/* System font stack for optimal performance */
:root {
  --font-sans-cn: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-sans-en: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* Base font setup */
body {
  font-family: var(--font-sans-cn);
  font-feature-settings: 'tnum' 1, 'case' 1;
  text-rendering: optimizeLegibility;
}

/* Font weights mapping */
.font-inter {
  font-family: var(--font-sans-cn);
}

.font-light {
  font-weight: 300;
}

.font-normal {
  font-weight: 400;
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

/* Chinese font optimization */
.font-cn {
  font-family: 'PingFang SC', 'Microsoft YaHei', 'Source Han Sans CN', 'Noto Sans CJK SC', var(--font-sans-cn);
}

/* Ensure consistent monospace for code */
.font-mono {
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Consolas', 'Courier New', monospace;
}

/* Responsive font sizing */
@media (max-width: 768px) {
  body {
    font-size: 14px;
    line-height: 1.5;
  }
}

@media (min-width: 769px) {
  body {
    font-size: 16px;
    line-height: 1.6;
  }
}

/* Font loading optimization */
html {
  font-display: swap;
}