/* 字体优化 */
:root {
    /* 主要字体变量 */
    --font-primary: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', 'Microsoft YaHei', 'Source Han Sans SC', 'Noto Sans CJK SC', 'WenQuanYi Micro Hei', sans-serif;
    --font-secondary: 'Helvetica Neue', Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    
    /* 字体大小变量 - 使用rem单位便于响应式调整 */
    --font-size-xs: 0.75rem;     /* 12px */
    --font-size-sm: 0.875rem;    /* 14px */
    --font-size-base: 1rem;      /* 16px */
    --font-size-md: 1.125rem;    /* 18px */
    --font-size-lg: 1.25rem;     /* 20px */
    --font-size-xl: 1.5rem;      /* 24px */
    --font-size-2xl: 1.75rem;    /* 28px */
    --font-size-3xl: 2rem;       /* 32px */
    --font-size-4xl: 2.25rem;    /* 36px */
    
    /* 字体粗细变量 */
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    /* 行高变量 */
    --line-height-tight: 1.2;
    --line-height-snug: 1.4;
    --line-height-normal: 1.6;
    --line-height-relaxed: 1.8;
    --line-height-loose: 2;
    
    /* 字间距变量 */
    --letter-spacing-tighter: -0.05em;
    --letter-spacing-tight: -0.025em;
    --letter-spacing-normal: 0;
    --letter-spacing-wide: 0.025em;
    --letter-spacing-wider: 0.05em;
}

/* 基础字体设置 */
html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-primary);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-normal);
    color: #333;
}

/* 标题样式 */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    margin-bottom: 0.5em;
    color: #222;
}

h1 {
    font-size: var(--font-size-4xl);
    letter-spacing: var(--letter-spacing-tight);
}

h2 {
    font-size: var(--font-size-3xl);
}

h3 {
    font-size: var(--font-size-2xl);
}

h4 {
    font-size: var(--font-size-xl);
}

h5 {
    font-size: var(--font-size-lg);
}

h6 {
    font-size: var(--font-size-md);
}

/* 段落样式 */
p {
    margin-bottom: 1rem;
    line-height: var(--line-height-relaxed);
}

/* 链接样式 */
a {
    color: #2196F3;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #0d8aee;
}

/* 按钮文字样式 */
.btn {
    font-family: var(--font-primary);
    font-weight: var(--font-weight-medium);
    letter-spacing: var(--letter-spacing-wide);
}

/* 导航文字样式 */
.nav a {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
}

/* Logo文字样式 */
.logo {
    font-family: var(--font-secondary);
    font-weight: var(--font-weight-bold);
}

/* 响应式字体调整 */
@media (max-width: 768px) {
    html {
        font-size: 15px;
    }
    
    h1 {
        font-size: var(--font-size-3xl);
    }
    
    h2 {
        font-size: var(--font-size-2xl);
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    h1 {
        font-size: var(--font-size-2xl);
    }
    
    h2 {
        font-size: var(--font-size-xl);
    }
}