/*
 * 文章评论区样式 - 米白色配色方案
 */

/* ========== 评论区容器 ========== */
.comments-section {
    background: var(--bg-primary);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #e8e6e3;
    margin-top: 16px;
}

.comments-section .section-title {
    font-size: 15px;
    font-weight: 700;
    color: #4a4a4a;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.section-icon {
    width: 16px;
    height: 16px;
    color: #8a8a8a;
    flex-shrink: 0;
}

.comment-count {
    background: #d4d0c8;
    color: #5a5a5a;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
}

/* ========== 评论表单 ========== */
.comment-form-wrapper {
    background: var(--bg-primary);
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 12px;
    border: 1px solid #e8e6e3;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.comment-form-wrapper h4 {
    font-size: 13px;
    font-weight: 600;
    color: #4a4a4a;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.form-icon {
    width: 13px;
    height: 13px;
    color: #8a8a8a;
    flex-shrink: 0;
}

.comment-form-wrapper .form-group {
    margin-bottom: 8px;
}

.comment-form-wrapper textarea {
    width: 100%;
    min-height: 60px;
    padding: 8px 10px;
    border: 1px solid #e0ddd8;
    border-radius: 6px;
    background: var(--bg-primary);
    color: #4a4a4a;
    font-size: 13px;
    line-height: 1.5;
    resize: vertical;
    transition: all 0.3s ease;
    font-family: inherit;
}

.comment-form-wrapper textarea:focus {
    outline: none;
    border-color: #c9c5be;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(201, 197, 190, 0.15);
}

.comment-form-wrapper textarea::placeholder {
    color: #a8a4a0;
}

.comment-form-wrapper .form-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.comment-form-wrapper .form-row input {
    flex: 1;
    min-width: 100px;
    padding: 8px 10px;
    border: 1px solid #e0ddd8;
    border-radius: 5px;
    background: var(--bg-primary);
    color: #4a4a4a;
    font-size: 13px;
    transition: all 0.3s ease;
}

.comment-form-wrapper .form-row input:focus {
    outline: none;
    border-color: #c9c5be;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(201, 197, 190, 0.15);
}

.comment-form-wrapper .btn-submit {
    padding: 8px 20px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.comment-form-wrapper .btn-submit:hover {
    background: #5a5a5a;
}

.comment-form-wrapper .btn-cancel {
    padding: 8px 12px;
    background: #f0eeeb;
    color: #6b6b6b;
    border: 1px solid #e0ddd8;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.comment-form-wrapper .btn-cancel:hover {
    background: #e8e6e3;
}

/* ========== 评论列表 ========== */
.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ========== 评论项 ========== */
.comment-item {
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 6px;
    padding: 10px;
    border: 1px solid #e8e6e3;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

/* 回复评论 - 米白色背景区分 */
.comment-list .comment-reply-item {
    margin-top: 2px;
    margin-left: 20px;
    position: relative;
}

.comment-list .comment-reply-item:hover {
    background: #f0eeeb;
    border-color: #d4d0c8;
}

/* 回复连接线 */
.comment-list .comment-reply-item::before {
    content: '';
    position: absolute;
    left: -14px;
    top: 14px;
    width: 8px;
    height: 8px;
    border-left: 1.5px solid #d4d0c8;
    border-bottom: 1.5px solid #d4d0c8;
    border-radius: 0 0 0 2px;
}

/* ========== 评论头像 ========== */
.comment-avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background: #e0ddd8;
    border: 1px solid #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

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

.comment-list .comment-reply-item .comment-avatar {
    width: 28px;
    height: 28px;
}

.comment-content {
    flex: 1;
    min-width: 0;
}

/* ========== 评论头部 ========== */
.comment-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 6px;
}

.comment-author-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.comment-author {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.comment-author a {
    color: #6b6b6b;
    text-decoration: none;
}

.comment-author a:hover {
    text-decoration: underline;
}

/* 博主徽章 */
.comment-badge {
    background: #ffcd36;
    color: white;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 500;
}

/* ========== 回复信息 ========== */
.comment-reply-info {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;

    padding: 1px 6px;
    color: white;
    background: var(--accent-primary);
    border-radius: 6px;
    border: 1px solid var(--border-color);
    font-weight: 500;
}
    


/* ========== 楼层号 ========== */
.comment-floor {
    display: inline-block;
    font-size: 10px;
    color: #8a8a8a;
    background: #e5e7eb;
    padding: 1px 6px;
    border-radius: 6px;
    font-weight: 500;
}

/* ========== 评论内容 ========== */
.comment-text-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 6px;
}

.comment-text {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    line-height: 1.5;
    color: #4a4a4a;
    background: #faf9f7;
    padding: 8px 10px;
    border-radius: 6px;
    word-wrap: break-word;
    word-break: break-word;
    background: var(--bg-primary);
}

.comment-text p {
    margin-bottom: 6px;
}

.comment-text p:last-child {
    margin-bottom: 0;
}

.comment-text a {
    color: #6b6b6b;
    text-decoration: none;
    font-weight: 500;
}

.comment-text a:hover {
    text-decoration: underline;
}

.comment-text pre {
    background: #f5f4f2;
    border: 1px solid #e0ddd8;
    border-radius: 4px;
    padding: 8px;
    overflow-x: auto;
    margin: 8px 0;
    font-size: 11px;
}

.comment-text code {
    background: #f0eeeb;
    color: #6b6b6b;
    padding: 1px 4px;
    border-radius: 2px;
    font-size: 11px;
}

.comment-text blockquote {
    border-left: 2px solid #d4d0c8;
    padding-left: 10px;
    margin: 8px 0;
    color: #6b6b6b;
    font-style: italic;
    background: #f5f4f2;
    padding: 6px 10px;
    border-radius: 0 4px 4px 0;
}

/* ========== 评论底部 - 时间和回复按钮 ========== */
.comment-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.comment-time {
    font-size: 11px;
    color: #a8a4a0;
}

.comment-pc {
    display: none;
}

.comment-reply-link {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    color: #6b6b6b;
    background: #f0eeeb;
    padding: 4px 10px;
    border-radius: 3px;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    font-weight: 500;
    border: 1px solid #e0ddd8;
}

.comment-reply-link:hover {
    background: #e8e6e3;
    color: #4a4a4a;
}

/* ========== 无评论 ========== */
.no-comments {
    text-align: center;
    padding: 20px 12px;
    color: #a8a4a0;
    font-size: 13px;
    background: #f5f4f2;
    border-radius: 6px;
    border: 1px dashed #d4d0c8;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    
    .comment-text-wrapper {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }
.comment-actions {

    flex-direction: row;
    width: 100%;
}
    .comments-section {
        padding: 10px;
        border-radius: 6px;
    }

    .comment-form-wrapper {
        padding: 10px;
    }

    .comment-form-wrapper .form-row {
        flex-direction: column;
        gap: 6px;
    }

    .comment-form-wrapper .form-row input {
        width: 100%;
        min-width: 100%;
        box-sizing: border-box;
    }

    .comment-form-wrapper textarea {
        width: 100%;
        box-sizing: border-box;
    }

    .comment-item {
        padding: 10px;
    }

    .comment-list .comment-reply-item {
        margin-left: 12px;
        padding: 8px;
    }

    .comment-list .comment-reply-item::before {
        left: -10px;
        width: 6px;
        height: 6px;
    }

    .comment-avatar {
        width: 32px;
        height: 32px;
    }

    .comment-list .comment-reply-item .comment-avatar {
        width: 24px;
        height: 24px;
    }

    .comment-author {
        font-size: 14px;
    }

    .comment-text {
        font-size: 12px;
        padding: 8px 10px;
        width: 100%;
        margin-bottom: 6px;
    }

    .comment-actions {
        gap: 6px;
        justify-content: space-between;
    }

    .comment-time {
        display: none;
    }

    .comment-pc {
        display: inline-block;
        font-size: 13px;
        margin:  0 0 0 10px;
    }

    .comment-reply-link {
        padding: 2px 10px;
        font-size: 10px;
    }
}
