/* 评论和评分功能样式 */

/* 评论区域 */
.comments-section {
    margin: 3rem 0;
    padding: 2rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.comments-section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comments-section h3 i {
    color: #667eea;
}

/* 评论表单 */
.comment-form {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f9f9f9;
    border-radius: 8px;
}

.comment-form h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
}

.comment-form form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: #555;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    padding: 0.75rem;
    border: 1px solid #e0e6ed;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* 评分星级 */
.rating-section {
    margin-bottom: 1rem;
}

.rating-section label {
    font-weight: 500;
    color: #555;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: block;
}

.rating-stars {
    display: flex;
    gap: 0.5rem;
}

.rating-stars .star {
    font-size: 1.5rem;
    color: #ddd;
    cursor: pointer;
    transition: color 0.3s ease;
}

.rating-stars .star:hover,
.rating-stars .star.active {
    color: #ffd700;
}

/* 表单操作按钮 */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.submit-btn {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.cancel-btn {
    padding: 0.75rem 1.5rem;
    background: #f0f0f0;
    color: #333;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-btn:hover {
    background: #e0e0e0;
}

/* 评论列表 */
.comments-list {
    margin-top: 2rem;
}

.comment-item {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.3s ease;
}

.comment-item:hover {
    background-color: #f9f9f9;
}

.comment-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

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

.comment-content {
    flex: 1;
}

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

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

.comment-date {
    font-size: 0.85rem;
    color: #999;
}

.comment-rating {
    display: flex;
    gap: 0.25rem;
}

.comment-rating i {
    color: #ffd700;
    font-size: 1rem;
}

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

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

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

.like-btn:hover,
.reply-btn:hover {
    background-color: #f0f0f0;
    color: #333;
}

.like-btn.liked {
    color: #667eea;
}

/* 回复列表 */
.comment-replies {
    margin-top: 1rem;
    margin-left: 3rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.reply-item {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    background: #f9f9f9;
    border-radius: 8px;
}

.reply-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

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

.reply-content {
    flex: 1;
}

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

.reply-author {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.reply-date {
    font-size: 0.75rem;
    color: #999;
}

.reply-text {
    color: #333;
    line-height: 1.5;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

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

/* 回复表单 */
.reply-form-container {
    margin-top: 1rem;
    margin-left: 3rem;
    padding: 1rem;
    background: #f9f9f9;
    border-radius: 8px;
}

.reply-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.reply-form .form-group input {
    width: 100%;
    max-width: 300px;
}

.reply-form .form-actions {
    margin-top: 0;
}

/* 提示信息 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 4px;
    color: white;
    font-size: 1rem;
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast.success {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
}

.toast.error {
    background: linear-gradient(135deg, #f44336 0%, #da190b 100%);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .comments-section {
        padding: 1.5rem;
    }

    .comment-form {
        padding: 1rem;
    }

    .comment-item {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
    }

    .comment-avatar {
        margin-bottom: 0.5rem;
    }

    .comment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .submit-btn,
    .cancel-btn {
        width: 100%;
        text-align: center;
    }

    .comment-replies {
        margin-left: 0;
    }

    .reply-form-container {
        margin-left: 0;
    }

    .reply-form .form-group input {
        max-width: 100%;
    }
}