/* 文章页面专用样式 */

/* 文章头部 */
.article-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 120px 0 60px;
    margin-top: 80px;
}

.breadcrumb {
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: white;
}

.breadcrumb span {
    margin: 0 10px;
    color: rgba(255, 255, 255, 0.6);
}

.article-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 2rem;
    line-height: 1.2;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.meta-item {
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
}

.meta-item i {
    margin-right: 8px;
    color: #ffd700;
}

/* 文章主要内容 */
.article-main {
    padding: 60px 0;
    background: white;
}

.article-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 4rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 文章内容区域 */
.article-content {
    line-height: 1.8;
    color: #333;
}

.article-content h2 {
    font-size: 2rem;
    margin: 3rem 0 1.5rem;
    color: #333;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0.5rem;
}

.article-content h3 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
    color: #444;
}

.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.5rem;
}

/* 文章摘要 */
.article-summary {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 3rem;
    border-left: 4px solid #667eea;
}

.article-summary h2 {
    margin-top: 0;
    color: #667eea;
}

/* 目录 */
.article-toc {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 3rem;
}

.article-toc h3 {
    margin-top: 0;
    color: #333;
    margin-bottom: 1rem;
}

.article-toc ul {
    list-style: none;
    padding: 0;
}

.article-toc li {
    margin-bottom: 0.5rem;
}

.article-toc a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s ease;
}

.article-toc a:hover {
    color: #667eea;
}

/* 代码块样式 */
.article-content pre {
    background: #2d3748;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
    overflow-x: auto;
    font-size: 0.9rem;
    line-height: 1.5;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid #4a5568;
}

/* 统一所有代码样式 */
.article-content code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    background: #2d3748;
    color: #e2e8f0;
    border-radius: 4px;
    border: 1px solid #4a5568;
}

/* 代码块内的代码 */
.article-content pre code {
    background: none; /* 继承pre的背景 */
    padding: 0;
    border-radius: 0;
    border: none;
    color: #e2e8f0;
}

/* 行内代码 */
.article-content p code,
.article-content li code,
.article-content h1 code,
.article-content h2 code,
.article-content h3 code,
.article-content h4 code,
.article-content h5 code,
.article-content h6 code {
    padding: 2px 6px;
    font-size: 0.9em;
    display: inline-block;
}

/* 引用块 */
.article-content blockquote {
    border-left: 4px solid #667eea;
    background: #f8f9fa;
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    font-style: italic;
    position: relative;
}

.article-content blockquote::before {
    content: '"';
    font-size: 4rem;
    color: #667eea;
    position: absolute;
    top: -10px;
    left: 10px;
    opacity: 0.3;
}

/* 文章标签 */
.article-tags {
    margin: 3rem 0;
    padding: 2rem 0;
    border-top: 1px solid #e9ecef;
}

.article-tags h3 {
    margin-bottom: 1rem;
    color: #333;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag {
    background: #e9ecef;
    color: #666;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.tag:hover {
    background: #667eea;
    color: white;
}

/* 分享按钮 */
.article-share {
    margin: 2rem 0;
    padding: 2rem 0;
    border-top: 1px solid #e9ecef;
}

.article-share h3 {
    margin-bottom: 1rem;
    color: #333;
}

.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    text-decoration: none;
}

.share-btn[data-platform="twitter"] {
    background: #1da1f2;
    color: white;
}

.share-btn[data-platform="linkedin"] {
    background: #0077b5;
    color: white;
}

.share-btn[data-platform="weibo"] {
    background: #e6162d;
    color: white;
}

.share-btn[data-platform="copy"] {
    background: #6c757d;
    color: white;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* 侧边栏样式 */
.article-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

/* 作者卡片 */
.author-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    text-align: center;
}

/* 作者卡片中的头像组件样式调整 */
.author-card .about-header {
    justify-content: center;
    margin-bottom: 1rem;
    gap: 0;
}

.author-card .about-header h2 {
    display: none; /* 隐藏标题，只显示头像 */
}

.author-card .profile-avatar {
    margin: 0 auto;
    position: relative;
}

.author-card .profile-avatar .avatar-image {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

.author-card .profile-avatar .avatar-placeholder {
    opacity: 0 !important;
    visibility: hidden !important;
}

/* 保持原有的头像样式作为备用 */
.author-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.author-avatar i {
    font-size: 2rem;
    color: white;
}

.author-info h3 {
    margin-bottom: 1rem;
    color: #333;
}

.author-info p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.author-social {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.author-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f8f9fa;
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
}

.author-social a:hover {
    background: #667eea;
    color: white;
}

/* 相关文章 */
.related-articles {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    /* 防止闪烁 */
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}

.related-articles h3 {
    margin-bottom: 1.5rem;
    color: #333;
}

.related-item {
    padding: 1rem 0;
    border-bottom: 1px solid #f1f3f4;
    /* 防止闪烁 */
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}

.related-item:last-child {
    border-bottom: none;
}

.related-item h4 {
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.related-item a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.related-item a:hover {
    color: #667eea;
}

.related-date {
    font-size: 0.85rem;
    color: #888;
}

/* 侧边栏目录 */
.toc-sidebar {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.toc-sidebar h3 {
    margin-bottom: 1.5rem;
    color: #333;
}

.toc-list {
    list-style: none;
    padding: 0;
}

.toc-list li {
    margin-bottom: 0.5rem;
}

.toc-link {
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
    display: block;
    padding: 5px 0;
    border-left: 3px solid transparent;
    padding-left: 15px;
}

.toc-link:hover,
.toc-link.active {
    color: #667eea;
    border-left-color: #667eea;
}

/* 评论区域 */
.comments-section {
    background: #f8f9fa;
    padding: 60px 0;
}

.comments-section h2 {
    text-align: center;
    margin-bottom: 3rem;
    color: #333;
}

/* 评论表单 */
.comment-form {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 3rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.comment-form h3 {
    margin-bottom: 1.5rem;
    color: #333;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: #667eea;
}

.comment-form button {
    background: #667eea;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.comment-form button:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

/* 评论列表 */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.comment {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    display: flex;
    gap: 1rem;
}

.comment.reply {
    margin-left: 3rem;
    background: #f8f9fa;
}

.comment-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.comment-avatar i {
    color: #666;
    font-size: 1.2rem;
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.comment-author {
    font-weight: 600;
    color: #333;
}

.comment-date {
    font-size: 0.85rem;
    color: #888;
}

.author-badge {
    background: #667eea;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.comment-content p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.comment-actions {
    display: flex;
    gap: 1rem;
}

.reply-btn,
.like-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.reply-btn:hover,
.like-btn:hover {
    color: #667eea;
}

.like-btn i {
    margin-right: 5px;
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #5a67d8;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* 响应式设计 */
@media screen and (max-width: 1024px) {
    .article-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .article-sidebar {
        position: static;
    }
    
    .toc-sidebar {
        display: none;
    }
}

@media screen and (max-width: 768px) {
    .article-title {
        font-size: 2.5rem;
    }
    
    .article-meta {
        flex-direction: column;
        gap: 1rem;
    }
    
    .article-header {
        padding: 100px 0 40px;
    }
    
    .article-main {
        padding: 40px 0;
    }
    
    .article-content h2 {
        font-size: 1.8rem;
    }
    
    .article-content h3 {
        font-size: 1.3rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .comment.reply {
        margin-left: 1rem;
    }
    
    .share-buttons {
        justify-content: center;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
    }
}

@media screen and (max-width: 480px) {
    .article-title {
        font-size: 2rem;
    }
    
    .article-content {
        font-size: 1rem;
    }
    
    .article-content p {
        font-size: 1rem;
    }
    
    .article-summary,
    .article-toc {
        padding: 1.5rem;
    }
    
    .author-card,
    .related-articles,
    .comment-form,
    .comment {
        padding: 1.5rem;
    }
}
