/* 文章详情页样式 */
.article-container {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 30px;
    margin-top: 30px;
    margin-bottom: 50px;
}

.article-content {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* 文章头部 */
.article-header {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #ecf0f1;
}

.article-title {
    font-size: 32px;
    color: #2c3e50;
    margin-bottom: 15px;
    line-height: 1.4;
}

.article-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 15px;
}

.meta-item a {
    color: #3498db;
}

.article-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* 文章正文 */
.article-body {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
    margin-top: 30px;
    margin-bottom: 20px;
    color: #2c3e50;
}

.markdown-body h1 {
    font-size: 28px;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 10px;
}

.markdown-body h2 {
    font-size: 24px;
    border-bottom: 1px solid #ecf0f1;
    padding-bottom: 8px;
}

.markdown-body p {
    margin-bottom: 20px;
}

.markdown-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
    border-radius: 4px;
}

.markdown-body pre {
    background: #282c34;
    color: #abb2bf;
    padding: 20px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 20px 0;
    font-size: 14px;
    line-height: 1.5;
}

.markdown-body code {
    font-family: 'Consolas', 'Monaco', monospace;
}

.markdown-body p code {
    background: #f5f5f5;
    padding: 3px 8px;
    border-radius: 3px;
    color: #e83e8c;
}

.markdown-body ul,
.markdown-body ol {
    margin: 20px 0;
    padding-left: 30px;
}

.markdown-body li {
    margin-bottom: 10px;
}

.markdown-body blockquote {
    border-left: 4px solid #3498db;
    padding-left: 20px;
    margin: 20px 0;
    color: #666;
    background: #f8f9fa;
    padding: 15px 20px;
}

.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.markdown-body th,
.markdown-body td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

.markdown-body th {
    background: #f5f5f5;
    font-weight: bold;
}

.markdown-body tr:nth-child(even) {
    background: #fafafa;
}

/* 点赞按钮 */
.article-actions {
    text-align: center;
    margin: 40px 0;
    padding: 20px;
}

.like-btn {
    background: #fff;
    border: 2px solid #ecf0f1;
    padding: 12px 30px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.like-btn:hover {
    border-color: #3498db;
    transform: translateY(-2px);
}

.like-btn.liked {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

/* 上一篇/下一篇导航 */
.article-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #ecf0f1;
}

.prev-article,
.next-article {
    flex: 1;
}

.next-article {
    text-align: right;
}

.nav-label {
    display: block;
    font-size: 13px;
    color: #95a5a6;
    margin-bottom: 8px;
}

.article-navigation a {
    font-size: 15px;
    color: #2c3e50;
    font-weight: 500;
}

.article-navigation a:hover {
    color: #3498db;
}

/* 评论区 */
.comments-section {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid #ecf0f1;
}

.comments-title {
    font-size: 22px;
    margin-bottom: 25px;
    color: #2c3e50;
}

.comment-form {
    margin-bottom: 30px;
}

.comment-input,
.reply-input {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
}

.comment-input:focus,
.reply-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.comment-actions,
.reply-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.submit-btn,
.reply-actions button {
    padding: 10px 25px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.submit-btn:hover,
.reply-actions button:hover {
    background-color: #2980b9;
}

.reply-actions button {
    background-color: #95a5a6;
}

.reply-actions button:hover {
    background-color: #7f8c8d;
}

.no-login {
    text-align: center;
    padding: 30px;
    color: #7f8c8d;
}

.no-login a {
    color: #3498db;
}

/* 评论列表 */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.comment-item {
    display: flex;
    gap: 15px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.comment-avatar img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.comment-author {
    font-weight: bold;
    color: #2c3e50;
}

.comment-date {
    font-size: 13px;
    color: #95a5a6;
}

.comment-text {
    color: #333;
    line-height: 1.6;
    margin-bottom: 12px;
}

.comment-actions {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.reply-btn,
.like-btn-small {
    background: none;
    border: none;
    color: #7f8c8d;
    cursor: pointer;
    font-size: 13px;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.3s;
}

.reply-btn:hover,
.like-btn-small:hover {
    background: #ecf0f1;
    color: #3498db;
}

/* 回复列表 */
.replies-list {
    margin-top: 15px;
    padding-left: 15px;
    border-left: 2px solid #ecf0f1;
}

.reply-item {
    padding: 12px;
    background: #fff;
    margin-top: 10px;
    border-radius: 6px;
}

.reply-author {
    font-weight: bold;
    color: #2c3e50;
    font-size: 14px;
    margin-bottom: 5px;
}

.reply-content {
    color: #333;
    font-size: 14px;
    margin-bottom: 5px;
}

.reply-date {
    font-size: 12px;
    color: #95a5a6;
}

/* 目录侧边栏 */
.article-sidebar {
    position: sticky;
    top: 90px;
    height: fit-content;
}

.toc-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.toc-card h3 {
    font-size: 16px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

.toc-list {
    display: flex;
    flex-direction: column;
}

.toc-item {
    font-size: 14px;
    color: #555;
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
    transition: all 0.3s;
}

.toc-item:last-child {
    border-bottom: none;
}

.toc-item:hover,
.toc-item.active {
    color: #3498db;
    padding-left: 10px;
}

/* 响应式 */
@media (max-width: 900px) {
    .article-container {
        grid-template-columns: 1fr;
    }

    .article-sidebar {
        position: static;
    }

    .article-content {
        padding: 25px;
    }

    .article-title {
        font-size: 24px;
    }

    .article-navigation {
        flex-direction: column;
        gap: 20px;
    }

    .prev-article,
    .next-article {
        text-align: left;
    }
}
