﻿/* 帖子详情基础样式 */
.card {
    border: none;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    overflow: hidden;
}

.card-header {
    background: linear-gradient(135deg, #0d6efd 0%, #2580ff 100%);
    color: white;
    padding: 15px 20px;
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center; /* 垂直居中 */
}

/* 新增：返回按钮样式 */
.btn-back {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 14px;
    transition: all 0.2s ease;
}

    .btn-back:hover {
        background: rgba(255, 255, 255, 0.3);
        color: white;
        transform: translateY(-1px);
    }

.card-body {
    padding: 30px;
}

/* Markdown内容样式 */
.post-content {
    line-height: 1.8;
    font-size: 16px;
    color: #212529;
}

    /* 强制表情放大样式（最高优先级） */
    .post-content .emoji-display,
    .comment-content .emoji-display {
        font-size: 24px !important;
        line-height: 1 !important;
        vertical-align: middle !important;
        margin: 0 2px !important;
        background-color: transparent !important;
    }

    /* Markdown标题样式 */
    .post-content h1 {
        font-size: 2rem;
        margin: 1.5rem 0 1rem;
        color: #0d6efd;
        border-bottom: 1px solid #e2e8f0;
        padding-bottom: 0.5rem;
    }

    .post-content h2 {
        font-size: 1.75rem;
        margin: 1.25rem 0 0.75rem;
        color: #0b5ed7;
        border-bottom: 1px solid #e9ecef;
        padding-bottom: 0.5rem;
    }

    .post-content h3 {
        font-size: 1.5rem;
        margin: 1rem 0 0.5rem;
        color: #0a58ca;
    }

    /* Markdown列表样式 */
    .post-content ul, .post-content ol {
        padding-left: 2rem;
        margin: 1rem 0;
    }

    .post-content li {
        margin: 0.5rem 0;
    }

    /* Markdown引用样式 */
    .post-content blockquote {
        border-left: 4px solid #0d6efd;
        padding: 1rem 1.5rem;
        margin: 1rem 0;
        background-color: #f8f9fa;
        border-radius: 0 8px 8px 0;
    }

    /* Markdown代码块样式 */
    .post-content pre {
        background-color: #f1f3f5;
        padding: 1rem;
        border-radius: 8px;
        overflow-x: auto;
        margin: 1rem 0;
    }

    .post-content code {
        background-color: #f8f9fa;
        padding: 0.2rem 0.4rem;
        border-radius: 4px;
        font-family: 'Consolas', 'Monaco', monospace;
    }

    .post-content pre code {
        background-color: transparent;
        padding: 0;
    }

    /* Markdown链接样式 */
    .post-content a {
        color: #0d6efd;
        text-decoration: none;
    }

        .post-content a:hover {
            text-decoration: underline;
        }

    /* Markdown图片样式 */
    .post-content img {
        max-width: 100%;
        border-radius: 8px;
        margin: 1rem 0;
    }

    /* Markdown删除线/粗体/斜体样式 */
    .post-content strong {
        font-weight: 700;
    }

    .post-content em {
        font-style: italic;
    }

    .post-content del {
        text-decoration: line-through;
        color: #6c757d;
    }

/* 评论区样式适配 */
.comment-item {
    transition: all 0.3s ease;
    display: flex; /* 新增：使用flex布局展示头像和内容 */
    gap: 12px; /* 头像和内容之间的间距 */
}

    .comment-item:hover {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    }

    .comment-item .post-content {
        font-size: 14px;
        line-height: 1.6;
    }

/* 新增：评论头像样式 */
.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0; /* 防止头像被压缩 */
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    font-weight: 600;
    background-color: #0d6efd; /* 默认颜色 */
    overflow: hidden; /* 图片头像时裁剪 */
}

    .comment-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover; /* 保持图片比例 */
    }

/* 评论内容容器 */
.comment-content-wrapper {
    flex: 1; /* 占满剩余空间 */
}

/* 按钮样式优化 */
.btn-sm {
    border-radius: 6px;
    padding: 4px 10px;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .card-body {
        padding: 20px;
    }

    .post-content {
        font-size: 15px;
    }
    /* 移动端返回按钮适配 */
    .card-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
        padding: 12px 15px;
    }

        .card-header h3 {
            font-size: 1.2rem;
            margin-bottom: 0;
        }
    /* 移动端评论头像缩小 */
    .comment-avatar {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
}
