/**
 * 评论预览插件 - 前端样式
 */

/* 预览框容器 */
.zcp-preview-box {
    position: absolute;
    width: 350px;
    max-width: calc(100vw - 20px);
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    overflow: hidden;
}

.zcp-preview-box.zcp-show {
    opacity: 1;
    transform: translateY(0);
}

/* 加载状态 */
.zcp-loading,
.zcp-error,
.zcp-no-comments {
    padding: 30px 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

.zcp-loading i {
    margin-right: 5px;
}

.zcp-error {
    color: #f56c6c;
}

.zcp-no-comments {
    color: #909399;
}

.zcp-no-comments i {
    font-size: 24px;
    display: block;
    margin-bottom: 10px;
    opacity: 0.5;
}

/* 评论列表 */
.zcp-comments-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 15px;
}

/* 滚动条样式 */
.zcp-comments-list::-webkit-scrollbar {
    width: 6px;
}

.zcp-comments-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.zcp-comments-list::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 3px;
}

.zcp-comments-list::-webkit-scrollbar-thumb:hover {
    background: #b0b0b0;
}

/* 评论项 */
.zcp-comment-item {
    display: flex;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.zcp-comment-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* 头像 */
.zcp-avatar {
    flex-shrink: 0;
    margin-right: 10px;
}

.zcp-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: block;
}

/* 评论内容区 */
.zcp-comment-content {
    flex: 1;
    min-width: 0;
}

/* 评论元信息 */
.zcp-comment-meta {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    font-size: 12px;
}

.zcp-author {
    font-weight: 600;
    color: #333;
    margin-right: 8px;
}

.zcp-date {
    color: #999;
    font-size: 12px;
}

/* 评论文本 */
.zcp-text {
    color: #666;
    font-size: 13px;
    line-height: 1.6;
    word-wrap: break-word;
    word-break: break-all;
}

/* 查看更多链接 */
.zcp-more-link {
    padding: 12px 15px;
    background: #f8f9fa;
    border-top: 1px solid #e5e5e5;
    text-align: center;
}

.zcp-more-link a {
    color: #409eff;
    text-decoration: none;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s;
}

.zcp-more-link a:hover {
    color: #66b1ff;
}

.zcp-more-link a i {
    margin-left: 4px;
    transition: transform 0.3s;
}

.zcp-more-link a:hover i {
    transform: translateX(3px);
}

/* 响应式 */
@media (max-width: 768px) {
    .zcp-preview-box {
        width: 320px;
        max-width: calc(100vw - 20px);
    }
    
    .zcp-comments-list {
        max-height: 250px;
    }
    
    .zcp-avatar img {
        width: 28px;
        height: 28px;
    }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    .zcp-preview-box {
        background: #1e1e1e;
        border-color: #333;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }
    
    .zcp-comment-item {
        border-bottom-color: #333;
    }
    
    .zcp-author {
        color: #e0e0e0;
    }
    
    .zcp-text {
        color: #b0b0b0;
    }
    
    .zcp-date {
        color: #888;
    }
    
    .zcp-more-link {
        background: #2a2a2a;
        border-top-color: #333;
    }
    
    .zcp-comments-list::-webkit-scrollbar-track {
        background: #2a2a2a;
    }
    
    .zcp-comments-list::-webkit-scrollbar-thumb {
        background: #555;
    }
    
    .zcp-comments-list::-webkit-scrollbar-thumb:hover {
        background: #666;
    }
}

/* 子比主题适配 */
body.theme-dark .zcp-preview-box {
    background: #1e1e1e;
    border-color: #333;
}

body.theme-dark .zcp-author {
    color: #e0e0e0;
}

body.theme-dark .zcp-text {
    color: #b0b0b0;
}

body.theme-dark .zcp-more-link {
    background: #2a2a2a;
    border-top-color: #333;
}

body.theme-dark .zcp-comment-item {
    border-bottom-color: #333;
}

