/* Inter 字体配置 - 用于英文 */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100;
  src: url('../fonts/inter/Inter_18pt-Thin.ttf') format('truetype');
}

@font-face {
  font-family: 'Inter';
  font-style: italic;
  font-weight: 100;
  src: url('../fonts/inter/Inter_18pt-ThinItalic.ttf') format('truetype');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 200;
  src: url('../fonts/inter/Inter_18pt-ExtraLight.ttf') format('truetype');
}

@font-face {
  font-family: 'Inter';
  font-style: italic;
  font-weight: 200;
  src: url('../fonts/inter/Inter_18pt-ExtraLightItalic.ttf') format('truetype');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300;
  src: url('../fonts/inter/Inter_18pt-Light.ttf') format('truetype');
}

@font-face {
  font-family: 'Inter';
  font-style: italic;
  font-weight: 300;
  src: url('../fonts/inter/Inter_18pt-LightItalic.ttf') format('truetype');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  src: url('../fonts/inter/Inter_18pt-Regular.ttf') format('truetype');
}

@font-face {
  font-family: 'Inter';
  font-style: italic;
  font-weight: 400;
  src: url('../fonts/inter/Inter_18pt-Italic.ttf') format('truetype');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  src: url('../fonts/inter/Inter_18pt-Medium.ttf') format('truetype');
}

@font-face {
  font-family: 'Inter';
  font-style: italic;
  font-weight: 500;
  src: url('../fonts/inter/Inter_18pt-MediumItalic.ttf') format('truetype');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  src: url('../fonts/inter/Inter_18pt-SemiBold.ttf') format('truetype');
}

@font-face {
  font-family: 'Inter';
  font-style: italic;
  font-weight: 600;
  src: url('../fonts/inter/Inter_18pt-SemiBoldItalic.ttf') format('truetype');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  src: url('../fonts/inter/Inter_18pt-Bold.ttf') format('truetype');
}

@font-face {
  font-family: 'Inter';
  font-style: italic;
  font-weight: 700;
  src: url('../fonts/inter/Inter_18pt-BoldItalic.ttf') format('truetype');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 800;
  src: url('../fonts/inter/Inter_18pt-ExtraBold.ttf') format('truetype');
}

@font-face {
  font-family: 'Inter';
  font-style: italic;
  font-weight: 800;
  src: url('../fonts/inter/Inter_18pt-ExtraBoldItalic.ttf') format('truetype');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 900;
  src: url('../fonts/inter/Inter_18pt-Black.ttf') format('truetype');
}

@font-face {
  font-family: 'Inter';
  font-style: italic;
  font-weight: 900;
  src: url('../fonts/inter/Inter_18pt-BlackItalic.ttf') format('truetype');
}

/* 霞鹜文楷 - 用于中文 */
@font-face {
  font-family: 'LXGW WenKai Screen';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/lxgw-wenkai/regular/LXGWWenKaiScreen-Regular.ttf') format('truetype');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD, U+4E00-9FFF, U+3400-4DBF, U+20000-2A6DF, U+2A700-2B73F, U+2B740-2B81F, U+2B820-2CEAF, U+F900-FAFF, U+2F800-2FA1F;
}

@font-face {
  font-family: 'LXGW WenKai Screen';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/lxgw-wenkai/bold/LXGWWenKaiScreen-Bold.ttf') format('truetype');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD, U+4E00-9FFF, U+3400-4DBF, U+20000-2A6DF, U+2A700-2B73F, U+2B740-2B81F, U+2B820-2CEAF, U+F900-FAFF, U+2F800-2FA1F;
}

@font-face {
  font-family: 'LXGW WenKai Screen Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/lxgw-wenkai/regular/LXGWWenKaiScreen-Regular.ttf') format('truetype');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD, U+4E00-9FFF, U+3400-4DBF, U+20000-2A6DF, U+2A700-2B73F, U+2B740-2B81F, U+2B820-2CEAF, U+F900-FAFF, U+2F800-2FA1F;
}

@font-face {
  font-family: 'LXGW WenKai Screen Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/lxgw-wenkai/bold/LXGWWenKaiScreen-Bold.ttf') format('truetype');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD, U+4E00-9FFF, U+3400-4DBF, U+20000-2A6DF, U+2A700-2B73F, U+2B740-2B81F, U+2B820-2CEAF, U+F900-FAFF, U+2F800-2FA1F;
}

/* 字体应用 */
:root {
  --font-sans-en: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
  --font-sans-zh: 'LXGW WenKai', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
  --font-mono: 'LXGW WenKai Mono', 'SF Mono', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
}

/* 基于语言的字体自动切换 */
html[lang="zh-cn"] body,
html[lang="zh-CN"] body {
  font-family: var(--font-sans-zh);
}

html[lang="en-us"] body,
html[lang="en-US"] body,
html[lang="en"] body {
  font-family: var(--font-sans-en);
}

/* 混合语言文本处理 */
:lang(zh) {
  font-family: var(--font-sans-zh);
}

:lang(en) {
  font-family: var(--font-sans-en);
}

/* 中文特殊元素字体调整 */
html[lang="zh-cn"] h1, 
html[lang="zh-cn"] h2, 
html[lang="zh-cn"] h3, 
html[lang="zh-cn"] h4, 
html[lang="zh-cn"] h5, 
html[lang="zh-cn"] h6,
html[lang="zh-CN"] h1, 
html[lang="zh-CN"] h2, 
html[lang="zh-CN"] h3, 
html[lang="zh-CN"] h4, 
html[lang="zh-CN"] h5, 
html[lang="zh-CN"] h6 {
  font-family: var(--font-sans-zh);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

/* 代码块使用等宽字体 */
pre, code, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.9em;
} 

/* 优化中文排版 */
html[lang="zh-cn"] .post-content,
html[lang="zh-CN"] .post-content {
  text-align: justify;
  text-justify: inter-ideograph;
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.8;
}

/* 标点符号调整 */
html[lang="zh-cn"] .post-content p,
html[lang="zh-CN"] .post-content p {
  text-align: justify;
  hanging-punctuation: allow-end; /* 允许标点溢出 */
} 

/* 添加额外的字体定义以兼容原有的字体名称 */
@font-face {
  font-family: 'LXGW WenKai';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/lxgw-wenkai/regular/LXGWWenKaiScreen-Regular.ttf') format('truetype');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD, U+4E00-9FFF, U+3400-4DBF, U+20000-2A6DF, U+2A700-2B73F, U+2B740-2B81F, U+2B820-2CEAF, U+F900-FAFF, U+2F800-2FA1F;
}

@font-face {
  font-family: 'LXGW WenKai';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/lxgw-wenkai/bold/LXGWWenKaiScreen-Bold.ttf') format('truetype');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD, U+4E00-9FFF, U+3400-4DBF, U+20000-2A6DF, U+2A700-2B73F, U+2B740-2B81F, U+2B820-2CEAF, U+F900-FAFF, U+2F800-2FA1F;
}

@font-face {
  font-family: 'LXGW WenKai Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/lxgw-wenkai/regular/LXGWWenKaiScreen-Regular.ttf') format('truetype');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD, U+4E00-9FFF, U+3400-4DBF, U+20000-2A6DF, U+2A700-2B73F, U+2B740-2B81F, U+2B820-2CEAF, U+F900-FAFF, U+2F800-2FA1F;
}

@font-face {
  font-family: 'LXGW WenKai Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/lxgw-wenkai/bold/LXGWWenKaiScreen-Bold.ttf') format('truetype');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD, U+4E00-9FFF, U+3400-4DBF, U+20000-2A6DF, U+2A700-2B73F, U+2B740-2B81F, U+2B820-2CEAF, U+F900-FAFF, U+2F800-2FA1F;
} 