/* typography.css - 文字排版系统 */

/**
 * 字体家族定义
 */
:root {
    --font-family-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --font-family-monospace: 'SFMono-Regular', 'Consolas', 'Liberation Mono', 'Menlo', monospace;
    --font-family-heading: var(--font-family-base); /* 标题可单独定义 */
}

body {
    font-family: var(--font-family-base);
    color: var(--color-neutral-text); /* 使用颜色系统中的变量 */
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/**
 * 标题等级系统 (建议使用clamp实现响应式字号)
 */
h1, .h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h2, .h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.875rem;
}

h3, .h3 {
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.75rem;
}

h4, .h4 {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.625rem;
}

h5, .h5 {
    font-size: 1.125rem;
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

h6, .h6 {
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

/* 段落与正文 */
p {
    margin-bottom: 1em;
}

.text-lg {
    font-size: 1.125rem;
    line-height: 1.7;
}

.text-sm {
    font-size: 0.875rem;
    line-height: 1.5;
}

.text-xs {
    font-size: 0.75rem;
    line-height: 1.3;
}

/* 文字颜色辅助类（绑定颜色系统） */
.text-primary {
    color: var(--color-primary);
}

.text-success {
    color: var(--color-success);
}

.text-muted {
    color: var(--color-neutral-text-tertiary);
}

/* 文字对齐、粗细、样式 */
.text-left {
    text-align: left;
}

.text-center {
    text-align: center;
}

.font-normal {
    font-weight: 400;
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.italic {
    font-style: italic;
}

/* 链接基础样式 (可结合颜色系统扩展:hover等状态) */
a {
    color: var(--color-link);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-link-hover);
}