/* 评论系统基础样式 */
.clp-comments {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

/* 评论标题 */
.clp-comments-header {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.clp-comments-title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

/* 评论表单容器 */
.clp-comment-form-container {
    margin-bottom: 40px;
    padding: 20px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
}

.clp-comment-form-container:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* 评论表单 */
.clp-comment-form {
    position: relative;
}

.clp-comment-form-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.clp-comment-form-field {
    display: flex;
    flex-direction: column;
}

.clp-comment-form-field label {
    font-weight: 500;
    margin-bottom: 8px;
    color: #555;
    font-size: 14px;
}

.clp-comment-form-field input,
.clp-comment-form-field textarea {
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background-color: #fff;
}

.clp-comment-form-field input:focus,
.clp-comment-form-field textarea:focus {
    outline: none;
    border-color: #4a6cf7;
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.1);
}

.clp-comment-form-field textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

/* 验证码样式 */
.clp-comment-form-captcha {
    margin-top: 15px;
}

.clp-captcha-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#clp-captcha-image {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 24px;
    letter-spacing: 10px;
    color: #374151;
    text-align: center;
    user-select: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

#clp-captcha-image:hover {
    background-color: #f3f4f6;
}

.clp-captcha-refresh-btn {
    padding: 8px 16px;
    border: 1px solid #e0e0e0;
    background-color: #f9fafb;
    color: #666;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    align-self: flex-start;
}

.clp-captcha-refresh-btn:hover {
    border-color: #4a6cf7;
    color: #4a6cf7;
    background-color: #f0f4ff;
}

/* 评论操作按钮 */
.clp-comment-form-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

.clp-comment-login-prompt {
    flex: 1;
    color: #666;
    font-size: 14px;
}

.clp-comment-login-prompt a {
    color: #4a6cf7;
    text-decoration: none;
    font-weight: 500;
}

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

.clp-comment-submit-btn,
.clp-comment-cancel-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clp-comment-submit-btn {
    background-color: #4a6cf7;
    color: white;
}

.clp-comment-submit-btn:hover:not(:disabled) {
    background-color: #3a5ad9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 108, 247, 0.3);
}

.clp-comment-submit-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.clp-comment-cancel-btn {
    background-color: #f5f5f5;
    color: #666;
}

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

/* 评论列表 */
.clp-comments-list {
    margin-top: 30px;
}

.clp-comments-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #666;
}

.clp-loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4a6cf7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.clp-comments-container-inner {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* 评论项 */
.clp-comment-item {
    position: relative;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #f0f0f0;
}

.clp-comment-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.clp-comment-body {
    display: flex;
    gap: 20px;
}

/* 头像容器 */
.clp-comment-avatar-container {
    flex-shrink: 0;
}

.clp-comment-avatar-wrapper {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
}

.clp-comment-avatar-wrapper.has-avatar-frame {
    width: 74px;
    height: 74px;
}

/* 头像框 */
.clp-comment-avatar-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* 头像 */
.clp-comment-avatar {
    position: relative;
    z-index: 0;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    background-color: #f0f0f0;
}

.clp-comment-avatar-wrapper.has-avatar-frame .clp-comment-avatar {
    margin: 5px;
    width: 64px;
    height: 64px;
}

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

/* 评论内容包装器 */
.clp-comment-content-wrapper {
    flex: 1;
}

/* 评论头部 */
.clp-comment-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

/* 评论者信息 */
.clp-comment-author {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.clp-comment-author-name {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.clp-comment-author-link {
    text-decoration: none;
}

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

/* 勋章 */
.clp-comment-badges {
    display: flex;
    gap: 5px;
}

.clp-comment-badge {
    position: relative;
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    overflow: hidden;
    cursor: help;
}

.clp-comment-badge img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 用户角色标签 */
.clp-comment-role-tag {
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.clp-comment-role-tag.admin {
    background-color: #ff4d4f;
    color: white;
}

.clp-comment-role-tag.editor {
    background-color: #1890ff;
    color: white;
}

.clp-comment-role-tag.author {
    background-color: #52c41a;
    color: white;
}

/* 评论日期 */
.clp-comment-date {
    color: #999;
    font-size: 13px;
}

/* 评论操作按钮 */
.clp-comment-actions {
    display: flex;
    gap: 10px;
}

.clp-comment-reply-btn,
.clp-comment-edit-btn,
.clp-comment-delete-btn {
    padding: 5px 12px;
    border: none;
    background-color: transparent;
    color: #666;
    font-size: 13px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.clp-comment-reply-btn:hover,
.clp-comment-edit-btn:hover {
    background-color: #f0f0f0;
    color: #4a6cf7;
}

.clp-comment-delete-btn:hover {
    background-color: #fff2f0;
    color: #ff4d4f;
}

/* 评论内容 */
.clp-comment-content {
    color: #333;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 15px;
    word-wrap: break-word;
}

.clp-comment-content p {
    margin: 0 0 10px 0;
}

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

/* 评论编辑表单 */
.clp-comment-edit-form {
    margin-top: 15px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.clp-comment-edit-content {
    width: 100%;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
}

.clp-comment-edit-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.clp-comment-update-btn,
.clp-comment-cancel-edit-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clp-comment-update-btn {
    background-color: #4a6cf7;
    color: white;
}

.clp-comment-update-btn:hover {
    background-color: #3a5ad9;
}

.clp-comment-cancel-edit-btn {
    background-color: #f0f0f0;
    color: #666;
}

.clp-comment-cancel-edit-btn:hover {
    background-color: #e0e0e0;
}

/* 评论回复 */
.clp-comment-replies {
    list-style: none;
    padding: 0 0 0 84px;
    margin: 20px 0 0 0;
    position: relative;
}

.clp-comment-replies::before {
    content: '';
    position: absolute;
    left: 32px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #f0f0f0;
}

.clp-comment-item.clp-comment-reply {
    margin-bottom: 20px;
    padding-bottom: 20px;
    position: relative;
}

.clp-comment-item.clp-comment-reply::before {
    content: '';
    position: absolute;
    left: -84px;
    top: 32px;
    width: 20px;
    height: 2px;
    background-color: #f0f0f0;
}

/* 评论图片样式 */
.clp-comment-image-wrapper {
    margin: 15px 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.clp-comment-image-wrapper:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.clp-comment-image-link {
    display: block;
    text-decoration: none;
    cursor: pointer;
}

.clp-comment-image {
    display: block;
    max-width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: cover;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.clp-comment-image:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

/* 勋章预留位置样式 */
.clp-comment-medal-space {
    display: inline-block;
    margin-left: 5px;
    vertical-align: middle;
}

/* 分页 */
.clp-comments-pagination {
    margin-top: 40px;
    text-align: center;
}

.clp-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 20px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.clp-pagination-btn {
    padding: 10px 16px;
    border: 1px solid #e0e0e0;
    background-color: white;
    color: #666;
    font-size: 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.clp-pagination-btn:hover:not(:disabled) {
    border-color: #4a6cf7;
    color: #4a6cf7;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(74, 108, 247, 0.15);
}

.clp-pagination-btn.active {
    background-color: #4a6cf7;
    border-color: #4a6cf7;
    color: white;
    cursor: default;
    box-shadow: 0 4px 12px rgba(74, 108, 247, 0.3);
}

.clp-pagination-btn:disabled {
    background-color: #f5f5f5;
    color: #ccc;
    cursor: not-allowed;
    border-color: #e0e0e0;
    transform: none;
    box-shadow: none;
}

.clp-pagination-info {
    margin: 0 15px;
    color: #999;
    font-size: 14px;
}

/* 通知 */
.clp-comment-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.clp-comment-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.clp-comment-notification.success {
    background-color: #52c41a;
}

.clp-comment-notification.error {
    background-color: #ff4d4f;
}

.clp-comment-notification.info {
    background-color: #1890ff;
}

/* 错误信息 */
.clp-comments-error {
    padding: 20px;
    background-color: #fff2f0;
    border: 1px solid #ffccc7;
    border-radius: 8px;
    color: #ff4d4f;
    text-align: center;
}

/* 评论关闭提示 */
.clp-comments-closed {
    padding: 30px;
    background-color: #f5f5f5;
    border-radius: 8px;
    color: #999;
    text-align: center;
    font-size: 15px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .clp-comments {
        padding: 15px 0;
    }
    
    .clp-comments-header {
        margin-bottom: 20px;
    }
    
    .clp-comments-title {
        font-size: 20px;
    }
    
    .clp-comment-form-container {
        padding: 15px;
        margin-bottom: 30px;
    }
    
    .clp-comment-form-fields {
        grid-template-columns: 1fr;
    }
    
    .clp-comment-body {
        flex-direction: column;
        gap: 15px;
    }
    
    .clp-comment-avatar-container {
        align-self: flex-start;
    }
    
    .clp-comment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .clp-comment-replies {
        padding-left: 0;
        padding-left: 20px;
    }
    
    .clp-comment-notification {
        right: 10px;
        left: 10px;
    }
}