/**
 * 旧文章兼容样式
 * 用于替代59篇旧模式文章中的内联 <style> 块
 * 保持原有视觉效果，同时支持暗色主题
 */

/* 旧文章变量定义 - 与 main.css 兼容 */
.article-legacy {
    --primary-color: var(--primary, #6366f1);
    --secondary-color: var(--secondary, #8b5cf6);
    --accent-color: var(--accent, #ec4899);
    --text-color: var(--text-primary, #1e293b);
    --background-color: var(--bg-primary, #ffffff);
    --card-background: var(--bg-secondary, #f8fafc);
    --border-color: var(--border-color, #e2e8f0);
    --code-background: var(--bg-secondary, #f8fafc);
}

/* 旧文章正文区域样式 */
.article-legacy .container,
article .container,
main .container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.article-legacy h1,
article h1,
main h1 {
    color: var(--primary);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.article-legacy h2,
article h2,
main h2 {
    color: var(--secondary);
    font-size: 1.5rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.article-legacy h3,
article h3,
main h3 {
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 500;
    margin: 1.5rem 0 0.8rem;
}

.article-legacy p,
article p,
main p {
    margin: 1rem 0;
    text-align: justify;
}

.article-legacy ul,
.article-legacy ol,
article ul,
article ol,
main ul,
main ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.article-legacy li,
article li,
main li {
    margin: 0.5rem 0;
}

/* 代码块样式 - 增强版 */
.article-legacy pre,
article pre,
main pre {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin: 1.5rem 0;
    overflow-x: auto;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.article-legacy pre code,
article pre code,
main pre code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    background: none;
    padding: 0;
    border-radius: 0;
    color: #24292e;
}

[data-theme="dark"] .article-legacy pre code,
[data-theme="dark"] article pre code,
[data-theme="dark"] main pre code {
    color: #cdd6f4;
}

/* 行内代码（排除 pre 内的代码块） */
.article-legacy code:not(pre code),
article code:not(pre code),
main code:not(pre code) {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    background-color: rgba(99, 102, 241, 0.08);
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    color: var(--primary);
}

/* 复制按钮 - 新版样式 */
.article-legacy .copy-button,
article .copy-button,
main .copy-button {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text-secondary);
}

.article-legacy .copy-button:hover,
article .copy-button:hover,
main .copy-button:hover {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 卡片样式 */
.article-legacy .card,
article .card,
main .card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin: 1.5rem 0;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
}

.article-legacy .card:hover,
article .card:hover,
main .card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* 提示框样式 */
.article-legacy .note,
article .note,
main .note {
    background-color: rgba(59, 130, 246, 0.08);
    border-left: 4px solid #3b82f6;
    padding: 1rem;
    margin: 1.5rem 0;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.article-legacy .note-title,
article .note-title,
main .note-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2563eb;
}

/* 高亮文本 */
.article-legacy .highlight,
article .highlight,
main .highlight {
    background-color: rgba(245, 158, 11, 0.15);
    padding: 0.1rem 0.3rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    color: var(--text-primary);
}

/* 技术关键词 */
.article-legacy .tech,
article .tech,
main .tech {
    color: var(--primary);
    font-weight: 500;
}

/* 暗色主题适配 */
[data-theme="dark"] .article-legacy .note,
[data-theme="dark"] article .note,
[data-theme="dark"] main .note {
    background-color: rgba(59, 130, 246, 0.1);
    border-left-color: #60a5fa;
}

[data-theme="dark"] .article-legacy .note-title,
[data-theme="dark"] article .note-title,
[data-theme="dark"] main .note-title {
    color: #60a5fa;
}

[data-theme="dark"] .article-legacy .highlight,
[data-theme="dark"] article .highlight,
[data-theme="dark"] main .highlight {
    background-color: rgba(245, 158, 11, 0.2);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .article-legacy .container,
    article .container,
    main .container {
        padding: 1.5rem 1rem;
    }

    .article-legacy h1,
    article h1,
    main h1 {
        font-size: 1.8rem;
    }

    .article-legacy h2,
    article h2,
    main h2 {
        font-size: 1.3rem;
    }

    .article-legacy h3,
    article h3,
    main h3 {
        font-size: 1.1rem;
    }

    .article-legacy pre,
    article pre,
    main pre {
        padding: 0.8rem;
    }

    .article-legacy code,
    article code,
    main code {
        font-size: 0.85rem;
    }
}
