/* ============================================
 * 上传按钮
 * ============================================ */
.bpci-upload-wrapper {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin: 0 4px;
    position: relative;
}

.bpci-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px 9px;
    font-size: 13px;
    line-height: 1.4;
    color: #555;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all .15s ease;
}

.bpci-upload-btn:hover {
    background: #eee;
    border-color: #ccc;
    color: #333;
}

.bpci-upload-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.bpci-upload-btn .dashicons {
    font-size: 15px;
    width: 15px;
    height: 15px;
    line-height: 15px;
}

.bpci-uploading {
    font-size: 12px;
    color: #888;
    margin-left: 4px;
}

/* ============================================
 * 图片预览
 * ============================================ */
.bpci-preview {
    display: inline-block;
    position: relative;
    margin: 6px 0 0 4px;
    vertical-align: middle;
}

.bpci-preview img {
    max-width: 90px;
    max-height: 90px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    display: block;
    object-fit: cover;
}

.bpci-remove-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e74c3c;
    color: #fff;
    border: 2px solid #fff;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

.bpci-remove-btn:hover {
    background: #c0392b;
}

/* ============================================
 * 评论中显示的图片（缩小版缩略图）
 * ============================================ */
.bpci-comment-image {
    margin-top: 8px;
    display: block;
}

.bpci-comment-image a {
    display: inline-block;
    line-height: 0;
    text-decoration: none;
}

.bpci-comment-image img {
    max-width: 50px;
    max-height: 50px;
    width: auto;
    height: auto;
    border-radius: 6px;
    border: 1px solid #e8e8e8;
    display: block;
    cursor: zoom-in;
    object-fit: cover;
    transition: opacity .2s ease, transform .2s ease;
}

.bpci-comment-image img:hover {
    opacity: .88;
    transform: scale(1.02);
}

/* ============================================
 * 灯箱
 * ============================================ */
.bpci-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, .88);
    z-index: 999999;
    cursor: zoom-out;
    text-align: center;
    padding: 40px;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

.bpci-lightbox::before {
    content: '';
    display: inline-block;
    height: 100%;
    vertical-align: middle;
}

.bpci-lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    display: inline-block;
    vertical-align: middle;
    border-radius: 6px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, .5);
    cursor: default;
    background: #fff;
}

.bpci-lightbox-close {
    position: absolute;
    top: 16px;
    right: 22px;
    color: #fff;
    font-size: 36px;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    opacity: .8;
    font-family: Arial, sans-serif;
    transition: opacity .15s ease;
    z-index: 10;
}

.bpci-lightbox-close:hover {
    opacity: 1;
}

/* 打开灯箱时禁止背景滚动 */
body.bpci-lightbox-open {
    overflow: hidden;
}

/* ============================================
 * 移动端
 * ============================================ */
@media (max-width: 480px) {
    .bpci-btn-text {
        display: none;
    }

    .bpci-preview img {
        max-width: 70px;
        max-height: 70px;
    }

    .bpci-comment-image img {
        max-width: 50px;
        max-height: 50px;
    }

    .bpci-lightbox {
        padding: 16px;
    }

    .bpci-lightbox-close {
        top: 8px;
        right: 14px;
        font-size: 30px;
    }

    .bpci-lightbox-img {
        max-width: 95vw;
        max-height: 85vh;
    }
}