/* 文章详情页样式 */
.article-detail {
    padding: 20px;
    margin-bottom: 20px;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* 文章头部样式 */
.article-header {
    margin-bottom: 10px;
    position: relative;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.article-header h2 {
    margin-bottom: 8px;
}

.article-title {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    line-height: 1.4;
}

/* 文章元数据区域样式 */
.article-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 10px;
    color: #999;
    font-size: 14px;
}

.article-meta span {
    margin-right: 15px;
}

/* 添加按钮容器，使按钮靠右显示 */
.article-meta-buttons {
    margin-left: auto;
    display: flex;
    gap: 5px;
}

/* 小型按钮样式优化 */
.like-btn-small, .share-btn-small {
    padding: 0 8px;
    height: 24px;
    line-height: 24px;
    border-radius: 4px;
    transition: all 0.3s;
}

.like-btn-small:hover, .share-btn-small:hover {
    color: #ff4d4f;
    border-color: #ff4d4f;
}

.article-meta .layui-icon {
    margin-right: 5px;
    color: #ff4d4f;
}

.follow-btn {
    margin-left: auto;
    font-size: 12px;
    padding: 0 10px;
    height: 24px;
    line-height: 22px;
    border: 1px solid #ff4d4f;
    color: #ff4d4f;
}

.follow-btn:hover {
    background-color: #ff4d4f;
    color: #fff;
}
/* 文章内容样式 */
.article-content {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
    margin-bottom: 30px;
}

/* 代码块样式 */
.article-content pre {
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 15px 0;
    position: relative; /* 添加相对定位 */
}

.article-content pre::before {
    content: "复制";
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(255, 255, 255, 0.7);
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    border: 1px solid #ddd;
    transition: all 0.2s;
    z-index: 10;
}

.article-content pre:hover::before {
    background-color: #ff4d4f;
    color: #fff;
    border-color: #ff4d4f;
}

.article-content pre.copied::before {
    content: "已复制";
    background-color: #52c41a;
    color: #fff;
    border-color: #52c41a;
}
.article-content code {
    background-color: #f5f5f5;
    padding: 2px 5px;
    border-radius: 3px;
    font-family: Consolas, Monaco, 'Andale Mono', monospace;
}

/* 行内代码不显示复制按钮 */
.article-content p > code::before {
    display: none;
}
.article-content p {
    margin-bottom: 15px;
}

.article-content img {
    max-width: 100%;
    height: auto;
    margin: 15px 0;
    border-radius: 4px;
}

.article-content h1, 
.article-content h2, 
.article-content h3, 
.article-content h4, 
.article-content h5, 
.article-content h6 {
    margin: 20px 0 15px;
    color: #333;
    font-weight: bold;
}

.article-content blockquote {
    padding: 10px 15px;
    margin: 15px 0;
    border-left: 4px solid #ff4d4f;
    background-color: rgba(255, 77, 79, 0.05);
    color: #666;
}

.article-content pre {
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 15px 0;
}

.article-content code {
    background-color: #f5f5f5;
    padding: 2px 5px;
    border-radius: 3px;
    font-family: Consolas, Monaco, 'Andale Mono', monospace;
}

.article-content a {
    color: #ff4d4f;
    text-decoration: none;
}

.article-content a:hover {
    text-decoration: underline;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.article-content table th,
.article-content table td {
    border: 1px solid #e6e6e6;
    padding: 8px 12px;
    text-align: left;
}

.article-content table th {
    background-color: #f5f5f5;
    font-weight: bold;
}

/* 文章底部样式 */
.article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.article-tags .layui-badge-rim {
    padding: 5px 10px;
    border-radius: 2px;
    background-color: rgba(255, 77, 79, 0.1);
    color: #ff4d4f;
    border: none;
}

.article-actions {
    display: flex;
    gap: 10px;
}

.article-actions .layui-btn {
    border: 1px solid #e6e6e6;
}

.article-actions .layui-btn:hover {
    color: #ff4d4f;
    border-color: #ff4d4f;
}
/* 评论区样式优化 */
.comment-item {
    display: flex;
    flex-direction: column;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-user-info {
    display: flex;
    align-items: center;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    margin-right: 10px;
    flex-shrink: 0;
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.comment-user-meta {
    display: flex;
    align-items: center;
}

.comment-author {
    font-weight: bold;
    color: #333;
    margin-right: 10px;
}

.comment-body {
    margin-left: 50px;
}

.comment-text {
    line-height: 1.6;
    color: #333;
    margin-bottom: 10px;
}

.comment-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #999;
}

.comment-time {
    display: flex;
    align-items: center;
}

.comment-time .layui-icon {
    margin-right: 5px;
}

.comment-actions {
    display: flex;
    gap: 15px;
}

.comment-actions a {
    color: #999;
    display: flex;
    align-items: center;
}

.comment-actions a:hover {
    color: #ff4d4f;
}

.comment-actions .layui-icon {
    margin-right: 5px;
}

.like-btn span {
    margin-left: 3px;
}
.comment-content {
    flex: 1;
}

.comment-info {
    margin-bottom: 5px;
}

.comment-author {
    font-weight: bold;
    color: #333;
    margin-right: 10px;
}

.comment-time {
    color: #999;
    font-size: 12px;
}

.comment-text {
    line-height: 1.6;
    color: #333333ad;
    margin-bottom: 5px;
}

.comment-actions {
    text-align: right;
}

.comment-actions a {
    color: #999;
    font-size: 12px;
    margin-left: 10px;
}

.comment-actions a:hover {
    color: #ff4d4f;
}

/* 分享弹窗样式 */
.share-container {
    padding: 15px;
}

.share-container p {
    margin-bottom: 10px;
}

/* 响应式调整 */
@media screen and (max-width: 768px) {
    .article-title {
        font-size: 20px;
    }
    
    .article-meta {
        gap: 10px;
    }
    
    .article-content {
        font-size: 15px;
    }
    
    .article-footer {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .article-actions {
        margin-top: 15px;
    }
    
    .comment-section {
        margin-bottom: 30px; /* 移动端稍微减少间距 */
    }
}