/* ==================== 评论系统样式 ==================== */

.comments-section {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.comments-container {
    max-width: 1100px;
    margin: 0 auto;
}

.comments-header {
    text-align: center;
    margin-bottom: 1rem;
}

.comments-header h4 {
    color: #2c3e50;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.comments-header p {
    color: #6c757d;
    font-size: 0.95rem;
}

/* ==================== 评论表单 ==================== */

.comment-form-container {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.comment-form-container h4 {
    color: #2c3e50;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    border-bottom: 2px solid #DC512D;
    padding-bottom: 0.25rem;
    display: inline-block;
}

.comment-form .form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.comment-form .form-group {
    flex: 1;
}

.comment-form .form-group label {
    display: block;
    color: #495057;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.comment-form .form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.comment-form .form-control:focus {
    outline: none;
    border-color: #DC512D;
    box-shadow: 0 0 0 3px rgba(220, 81, 45, 0.1);
}

.comment-form textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

.comment-form .btn {
    background: #DC512D;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.comment-form .btn:hover {
    background: #c44a29;
    transform: translateY(-1px);
}

/* ==================== 评论列表 ==================== */

.comments-list {
    margin-top: 2rem;
}

.comments-list h4 {
    color: #2c3e50;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #42A469;
    padding-bottom: 0.5rem;
    display: inline-block;
}

.comment-item {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    gap: 1rem;
    transition: box-shadow 0.3s ease;
}

.comment-item:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
}

.comment-item.reply {
    margin-left: 3rem;
    margin-top: 1rem;
    background: #f8f9fa;
    border-left: 3px solid #DC512D;
}

.comment-avatar {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #DC512D, #42A469);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.comment-author {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1rem;
}

.comment-date {
    color: #6c757d;
    font-size: 0.9rem;
}

.comment-text {
    color: #495057;
    line-height: 1.6;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.comment-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.comment-like-btn,
.comment-reply-btn {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.comment-like-btn:hover {
    color: #DC512D;
    background: rgba(220, 81, 45, 0.1);
}

.comment-reply-btn:hover {
    color: #42A469;
    background: rgba(66, 164, 105, 0.1);
}

.like-count {
    font-weight: 500;
}

/* ==================== 回复表单 ==================== */

.reply-form-container {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.reply-form .form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.reply-form .form-group {
    flex: 1;
}

.reply-form .form-control {
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.9rem;
}

.reply-form .form-control:focus {
    border-color: #DC512D;
    box-shadow: 0 0 0 2px rgba(220, 81, 45, 0.1);
}

.reply-actions {
    display: flex;
    gap: 0.5rem;
}

.reply-actions .btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reply-actions .btn-primary {
    background: #DC512D;
    color: white;
    border: none;
}

.reply-actions .btn-primary:hover {
    background: #c44a29;
}

.reply-actions .btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
}

.reply-actions .btn-secondary:hover {
    background: #5a6268;
}

/* ==================== 无评论状态 ==================== */

.no-comments {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
}

.no-comments-content i {
    font-size: 2rem;
    color: #DC512D;
    margin-bottom: 0.5rem;
}

.no-comments-content h4 {
    color: #2c3e50;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.no-comments-content p {
    color: #6c757d;
    font-size: 0.9rem;
}

/* ==================== 评论回复嵌套 ==================== */

.comment-replies {
    margin-top: 1rem;
}

.comment-replies .comment-item {
    margin-left: 0;
    border-left: 3px solid #42A469;
    background: #f8f9fa;
}

/* ==================== 响应式设计 ==================== */

@media (max-width: 768px) {
    .comments-container {
        padding: 0 1rem;
    }
    
    .comment-form-container,
    .comment-item {
        padding: 1rem;
    }
    
    .comment-form .form-row {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .comment-item {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .comment-avatar {
        align-self: flex-start;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .comment-item.reply {
        margin-left: 1rem;
    }
    
    .comment-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .reply-form .form-row {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .comments-header h3 {
        font-size: 1.5rem;
    }
    
    .comment-form-container h4,
    .comments-list h4 {
        font-size: 1.1rem;
    }
    
    .comment-item.reply {
        margin-left: 0.5rem;
    }
}

/* ==================== 动画效果 ==================== */

.comment-item {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reply-form-container {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

/* ==================== 加载状态 ==================== */

.comment-like-btn.loading {
    opacity: 0.6;
    pointer-events: none;
}

.comment-like-btn.loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
