/* 文章页面样式 */
.article-main {
    margin-top: 70px;
    min-height: 100vh;
    background: #fff;
}

.article-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0 2rem;
    text-align: center;
    position: relative;
}

.article-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.article-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.article-category {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
}

.article-date,
.article-read-time {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
}

.article-title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.article-subtitle {
    font-size: 1.3rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    opacity: 0.9;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 1;
}

.article-author {
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.author-info h4 {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.author-info p {
    opacity: 0.8;
    font-size: 0.9rem;
}

/* 文章目录 */
.article-toc {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 2rem;
    margin: 3rem 0;
    position: sticky;
    top: 100px;
    float: right;
    width: 300px;
    margin-left: 2rem;
}

.article-toc h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #2d3748;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

.article-toc ul {
    list-style: none;
    padding: 0;
}

.article-toc li {
    margin-bottom: 0.5rem;
}

.article-toc a {
    color: #718096;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
    display: block;
    padding: 0.3rem 0;
}

.article-toc a:hover {
    color: #667eea;
}

/* 文章内容 */
.article-content {
    max-width: 800px;
    margin: 3rem 0;
    line-height: 1.8;
    color: #2d3748;
}

.article-content h2 {
    font-size: 2rem;
    font-weight: 700;
    margin: 3rem 0 1.5rem;
    color: #1a202c;
    border-bottom: 3px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

.article-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
    color: #2d3748;
}

.article-content h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 1.5rem 0 0.8rem;
    color: #4a5568;
}

.article-content p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.article-content ul,
.article-content ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.article-content li {
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

.article-content strong {
    font-weight: 600;
    color: #1a202c;
}

.article-content code {
    background: #f1f5f9;
    color: #e53e3e;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
}

/* 代码块 */
.code-block {
    margin: 2rem 0;
    background: #1a202c;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.code-block pre {
    margin: 0;
    padding: 2rem;
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.code-block code {
    background: none;
    color: #e2e8f0;
    padding: 0;
    border-radius: 0;
}

/* 代码语法高亮 */
.language-javascript .token.keyword {
    color: #c3dafe;
}

.language-javascript .token.string {
    color: #9ae6b4;
}

.language-javascript .token.function {
    color: #fbb6ce;
}

.language-javascript .token.comment {
    color: #a0aec0;
    font-style: italic;
}

.language-javascript .token.number {
    color: #fed7d7;
}

.language-javascript .token.operator {
    color: #feebc8;
}

/* 引用块 */
blockquote {
    background: #f7fafc;
    border-left: 4px solid #667eea;
    margin: 2rem 0;
    padding: 1.5rem 2rem;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    position: relative;
}

blockquote::before {
    content: '"';
    font-size: 4rem;
    color: #667eea;
    position: absolute;
    top: -0.5rem;
    left: 1rem;
    line-height: 1;
}

blockquote p {
    margin: 0;
    font-size: 1.1rem;
    color: #4a5568;
}

/* 相关文章 */
.related-articles {
    margin: 4rem 0;
    padding: 2rem 0;
    border-top: 1px solid #e2e8f0;
}

.related-articles h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: #2d3748;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.related-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    text-decoration: none;
    transition: all 0.3s ease;
    display: block;
}

.related-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.related-card h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    color: #2d3748;
}

.related-card p {
    color: #718096;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .article-toc {
        position: static;
        float: none;
        width: 100%;
        margin-left: 0;
        margin-bottom: 2rem;
    }
}

@media (max-width: 768px) {
    .article-header {
        padding: 2rem 0 1rem;
    }
    
    .article-title {
        font-size: 2rem;
    }
    
    .article-subtitle {
        font-size: 1.1rem;
    }
    
    .article-meta {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    
    .article-content {
        margin: 2rem 0;
    }
    
    .article-content h2 {
        font-size: 1.5rem;
    }
    
    .article-content h3 {
        font-size: 1.3rem;
    }
    
    .code-block pre {
        padding: 1rem;
        font-size: 0.8rem;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
    }
}

/* 导航链接样式覆盖 */
.nav-logo a {
    color: inherit;
    text-decoration: none;
}

.nav-logo a:hover {
    color: inherit;
}

/* 滚动指示器 */
.reading-progress {
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(102, 126, 234, 0.2);
    z-index: 999;
}

.reading-progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.1s ease;
}

/* 代码复制按钮 */
.code-block {
    position: relative;
}

.copy-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: white;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.copy-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 图片样式 */
.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* 表格样式 */
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.article-content th,
.article-content td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.article-content th {
    background: #f8fafc;
    font-weight: 600;
    color: #2d3748;
}

.article-content tr:hover {
    background: #f8fafc;
}

/* 警告框样式 */
.warning-box {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-left: 4px solid #e53e3e;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.info-box {
    background: #ebf8ff;
    border: 1px solid #bee3f8;
    border-left: 4px solid #3182ce;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.success-box {
    background: #f0fff4;
    border: 1px solid #c6f6d5;
    border-left: 4px solid #38a169;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
} 