/* 排版样式 */

/* 基础排版 */
body {
    font-family: var(--font-family-sans);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--neutral-text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 标题 */
h1, h2, h3, h4, h5, h6, 
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    color: var(--neutral-text-primary);
}

h1, .h1 {
    font-size: var(--font-size-5xl);
    margin-bottom: var(--spacing-6);
    line-height: 1.2;
}

h2, .h2 {
    font-size: var(--font-size-4xl);
    margin-bottom: var(--spacing-5);
}

h3, .h3 {
    font-size: var(--font-size-3xl);
}

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

h5, .h5 {
    font-size: var(--font-size-xl);
}

h6, .h6 {
    font-size: var(--font-size-lg);
}

.lead {
    font-size: var(--font-size-lg);
    line-height: var(--line-height-relaxed);
    margin-bottom: var(--spacing-6);
}

.small {
    font-size: var(--font-size-sm);
}

.micro {
    font-size: var(--font-size-xs);
}

/* 文本样式 */
.text-primary {
    color: var(--primary-brand);
}

.text-secondary {
    color: var(--neutral-text-secondary);
}

.text-tertiary {
    color: var(--neutral-text-tertiary);
}

.text-success {
    color: var(--accent-emerald);
}

.text-warning {
    color: var(--accent-warning);
}

.text-danger {
    color: var(--accent-danger);
}

.text-info {
    color: var(--accent-info);
}

/* 字重 */
.font-light {
    font-weight: var(--font-weight-light);
}

.font-normal {
    font-weight: var(--font-weight-normal);
}

.font-medium {
    font-weight: var(--font-weight-medium);
}

.font-semibold {
    font-weight: var(--font-weight-semibold);
}

.font-bold {
    font-weight: var(--font-weight-bold);
}

/* 文本装饰 */
.underline {
    text-decoration: underline;
}

.no-underline {
    text-decoration: none;
}

.italic {
    font-style: italic;
}

.uppercase {
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.lowercase {
    text-transform: lowercase;
}

.capitalize {
    text-transform: capitalize;
}

/* 文本对齐 */
.text-left {
    text-align: left;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-justify {
    text-align: justify;
}

/* 文本换行和溢出 */
.text-wrap {
    white-space: normal;
}

.text-nowrap {
    white-space: nowrap;
}

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 文本缩进 */
.text-indent {
    text-indent: 2em;
}

/* 行高 */
.leading-none {
    line-height: var(--line-height-none);
}

.leading-tight {
    line-height: var(--line-height-tight);
}

.leading-snug {
    line-height: var(--line-height-snug);
}

.leading-normal {
    line-height: var(--line-height-normal);
}

.leading-relaxed {
    line-height: var(--line-height-relaxed);
}

.leading-loose {
    line-height: var(--line-height-loose);
}

/* 链接样式 */
a {
    color: var(--primary-brand);
    text-decoration: none;
    transition: color var(--transition-duration-fast) var(--transition-timing-function);
}

a:hover {
    color: var(--accent-teal);
}

.link-subtle {
    color: var(--neutral-text-secondary);
}

.link-subtle:hover {
    color: var(--neutral-text-primary);
}

/* 强调文本 */
.text-highlight {
    position: relative;
    display: inline;
    padding: 0 0.1em;
}

.text-highlight::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0.4em;
    background-color: rgba(52, 144, 220, 0.2);
    z-index: -1;
    transform: skewX(-15deg);
}

/* 引用样式 */
blockquote {
    padding-left: var(--spacing-5);
    margin-left: 0;
    margin-right: 0;
    margin-bottom: var(--spacing-6);
    border-left: 4px solid var(--primary-brand);
    color: var(--neutral-text-secondary);
    font-style: italic;
}

blockquote > *:last-child {
    margin-bottom: 0;
}

/* 自定义列表样式 */
.list-unstyled {
    list-style: none;
    padding-left: 0;
}

.list-inline {
    list-style: none;
    padding-left: 0;
}

.list-inline li {
    display: inline-block;
    margin-right: var(--spacing-3);
}

.list-check {
    list-style: none;
    padding-left: 0;
}

.list-check li {
    position: relative;
    padding-left: var(--spacing-6);
    margin-bottom: var(--spacing-3);
}

.list-check li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.25em;
    width: 1.2em;
    height: 1.2em;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233490dc' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M20 6L9 17l-5-5'/%3e%3c/svg%3e");
    background-size: contain;
    background-repeat: no-repeat;
}

/* 分隔符 */
hr {
    margin-top: var(--spacing-6);
    margin-bottom: var(--spacing-6);
    border: 0;
    border-top: 1px solid var(--neutral-border);
}

/* 代码和预格式化文本 */
code {
    font-family: var(--font-family-mono);
    font-size: 0.9em;
    padding: 0.2em 0.4em;
    border-radius: var(--border-radius-sm);
    background-color: rgba(0, 0, 0, 0.04);
    color: var(--neutral-text-primary);
}

pre {
    font-family: var(--font-family-mono);
    padding: var(--spacing-4);
    margin-bottom: var(--spacing-5);
    overflow: auto;
    border-radius: var(--border-radius-md);
    background-color: rgba(0, 0, 0, 0.03);
    color: var(--neutral-text-primary);
}

pre code {
    padding: 0;
    background-color: transparent;
}

/* 响应式排版 */
@media (max-width: 767px) {
    h1, .h1 {
        font-size: var(--font-size-4xl);
    }
    
    h2, .h2 {
        font-size: var(--font-size-3xl);
    }
    
    h3, .h3 {
        font-size: var(--font-size-2xl);
    }
    
    h4, .h4 {
        font-size: var(--font-size-xl);
    }
    
    h5, .h5 {
        font-size: var(--font-size-lg);
    }
    
    h6, .h6 {
        font-size: var(--font-size-base);
    }
    
    .lead {
        font-size: var(--font-size-base);
    }
}

img, video, svg {
    max-width: 100%;
    height: auto;
    display: block;
} 