/**
 * China-Compatible Fonts
 * 
 * Google Fonts are blocked by the Great Firewall of China.
 * This CSS file provides system font fallbacks that work in China.
 * 
 * Font Stack Strategy:
 * 1. System fonts (available on all devices)
 * 2. Chinese fonts for Chinese text
 * 3. Fallback to sans-serif
 */

/* Override Google Fonts with system fonts */
body {
  font-family: 
    /* System fonts for Western languages */
    -apple-system, BlinkMacSystemFont, 
    "Segoe UI", "Roboto", "Helvetica Neue", "Arial",
    /* Chinese fonts */
    "Microsoft YaHei", "微软雅黑",
    "PingFang SC", "苹方-简",
    "Hiragino Sans GB", "冬青黑体简体中文",
    "Source Han Sans CN", "思源黑体",
    "Noto Sans CJK SC",
    /* Fallback */
    sans-serif,
    /* Emoji fonts */
    "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: 
    -apple-system, BlinkMacSystemFont,
    "Segoe UI", "Roboto", "Helvetica Neue", "Arial",
    "Microsoft YaHei", "微软雅黑",
    "PingFang SC", "苹方-简",
    sans-serif;
  font-weight: 700;
}

/* Monospace fonts (for code) */
code, pre, kbd, samp {
  font-family: 
    "SF Mono", "Monaco", "Cascadia Code", "Roboto Mono",
    "Consolas", "Courier New",
    "Microsoft YaHei", "微软雅黑",
    monospace;
}

/* Chinese-specific font optimization */
:lang(zh), :lang(zh-CN), :lang(zh-Hans) {
  font-family: 
    "Microsoft YaHei", "微软雅黑",
    "PingFang SC", "苹方-简",
    "Hiragino Sans GB", "冬青黑体简体中文",
    "Source Han Sans CN", "思源黑体",
    "Noto Sans CJK SC",
    "WenQuanYi Micro Hei", "文泉驿微米黑",
    sans-serif;
  
  /* Better rendering for Chinese characters */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Font weights for Chinese fonts */
:lang(zh) h1, :lang(zh) h2, :lang(zh) h3 {
  font-weight: 600; /* Chinese fonts look better with slightly lighter weight */
}

:lang(zh) strong, :lang(zh) b {
  font-weight: 600;
}

/* Optimize line-height for Chinese text */
:lang(zh) p, :lang(zh) li {
  line-height: 1.8; /* Chinese text needs more line-height */
  letter-spacing: 0.05em; /* Slightly more spacing for readability */
}

/* Remove Google Fonts preconnect (not needed anymore) */
/* These will be removed from HTML files */
