/* =============================================================================
 * 商品评价界面（订单评价页 / 商品详情页写评价表单 / 评价图片上传预览）
 *  - 评价卡片布局
 *  - 交互式星级评分
 *  - 图片上传网格（预览 / 删除 / 数量限制）
 *  - 评价图片灯箱
 * ========================================================================== */

/* ---------- 订单评价页整体布局 ---------- */
.review-page-wrap {
    max-width: 960px;
    margin: 0 auto;
}

.review-order-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 16px;
    background: #fff;
    border: 1px solid #eef1f5;
    border-radius: 10px;
    padding: 14px 20px;
    margin-bottom: 20px;
    color: #6c757d;
    font-size: 13px;
}
.review-order-meta .bi {
    color: #adb5bd;
    margin-right: 4px;
}

/* ---------- 单个商品评价卡片 ---------- */
.rv-card {
    background: #fff;
    border: 1px solid #eef1f5;
    border-radius: 12px;
    margin-bottom: 18px;
    overflow: hidden;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.rv-card:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.07);
    border-color: #d6dde6;
}

.rv-product {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #eef1f5;
}
.rv-product-img {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e9ecef;
    flex-shrink: 0;
}
.rv-product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.rv-product-img-empty {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f3f5;
    color: #adb5bd;
    font-size: 22px;
}
.rv-product-name {
    font-weight: 600;
    color: #212529;
    font-size: 15px;
    line-height: 1.4;
}
.rv-product-sku {
    color: #868e96;
    font-size: 13px;
    margin-top: 3px;
}

.rv-body {
    padding: 20px;
}

/* ---------- 表单字段 ---------- */
.rv-field {
    margin-bottom: 18px;
}
.rv-field:last-of-type {
    margin-bottom: 0;
}
.rv-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #343a40;
    margin-bottom: 8px;
}
.rv-label .rv-label-opt {
    font-weight: 400;
    color: #adb5bd;
    font-size: 12px;
    margin-left: 6px;
}

/* ---------- 星级评分 ---------- */
.rating-stars {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    direction: ltr;
}
.rating-star {
    background: none;
    border: none;
    padding: 0;
    font-size: 28px;
    line-height: 1;
    color: #dee2e6;
    cursor: pointer;
    transition: color 0.15s, transform 0.15s;
}
.rating-star i {
    font-style: normal;
}
.rating-star:hover {
    transform: scale(1.12);
}
.rating-star.active {
    color: #ffb400;
}
.rating-star-labels {
    margin-left: 10px;
    font-size: 13px;
    color: #adb5bd;
}

/* ---------- 评价内容输入 ---------- */
.rv-content {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 10px 12px;
    width: 100%;
    font-size: 14px;
    line-height: 1.6;
    color: #212529;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.rv-content:focus {
    outline: none;
    border-color: #86b7fe;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.12);
}
.rv-content-counter {
    text-align: right;
    font-size: 12px;
    color: #adb5bd;
    margin-top: 4px;
}

/* ---------- 图片上传网格 ---------- */
.rv-upload-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.rv-upload-tile {
    width: 84px;
    height: 84px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    background: #fff;
    border: 1px solid #e9ecef;
    flex-shrink: 0;
}
.rv-upload-add {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: 1.5px dashed #ced4da;
    background: #f8f9fa;
    color: #868e96;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}
.rv-upload-add i {
    font-size: 22px;
    line-height: 1;
}
.rv-upload-add:hover {
    border-color: #86b7fe;
    color: #0d6efd;
    background: #f0f6ff;
}
.rv-upload-add.disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}
.rv-upload-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.rv-upload-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 11px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 2;
}
.rv-upload-remove:hover {
    background: #dc3545;
}
.rv-upload-count {
    margin-top: 8px;
    font-size: 12px;
    color: #adb5bd;
}
.rv-upload-count b {
    color: #495057;
}

/* ---------- 表单底部 ---------- */
.rv-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #eef1f5;
}
.rv-anon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #6c757d;
    cursor: pointer;
    user-select: none;
}
.rv-anon input {
    accent-color: #0d6efd;
}
.rv-submit {
    min-width: 130px;
    padding: 9px 26px;
}

/* ---------- 已评价占位态 ---------- */
.rv-done {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #198754;
    font-size: 14px;
    padding: 12px 0;
}

/* ---------- 评价图片灯箱 ---------- */
.rv-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1060;
    background: rgba(0, 0, 0, 0.82);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.rv-lightbox.open {
    display: flex;
}
.rv-lightbox img {
    max-width: min(92vw, 1100px);
    max-height: 88vh;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    object-fit: contain;
}
.rv-lightbox-close {
    position: absolute;
    top: 18px;
    right: 24px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.rv-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.32);
}
.rv-gallery-img {
    cursor: zoom-in;
}

/* =============================================================================
 * 评价管理（查看态 / 编辑态 / 删除确认）
 * ========================================================================== */

/* ---------- 商品头部的状态徽章 ---------- */
.rv-product {
    flex-wrap: wrap;
}
.rv-product-info {
    flex: 1;
    min-width: 0;
}
.rv-product-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #6c757d;
    background: #f1f3f5;
    border-radius: 999px;
    padding: 4px 12px;
    white-space: nowrap;
}
.rv-product-badge-done {
    color: #198754;
    background: #e9f7ef;
}
.rv-product-badge .bi {
    font-size: 12px;
}

/* ---------- 查看态：评价内容展示 ---------- */
.rv-view-head {
    display: flex;
    align-items: center;
    gap: 8px 14px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.rv-view-stars {
    display: inline-flex;
    gap: 2px;
    font-size: 18px;
    line-height: 1;
    color: #ffb400;
}
.rv-view-stars .off {
    color: #dee2e6;
}
.rv-view-time,
.rv-view-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #adb5bd;
}
.rv-view-tag {
    color: #495057;
    background: #f1f3f5;
    border-radius: 999px;
    padding: 2px 10px;
}
.rv-view-content {
    font-size: 14px;
    line-height: 1.75;
    color: #343a40;
    white-space: pre-wrap;
    word-break: break-word;
}
.rv-view-images {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.rv-view-img {
    width: 72px;
    height: 72px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e9ecef;
    display: block;
    cursor: zoom-in;
    transition: box-shadow 0.2s, transform 0.2s;
}
.rv-view-img:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
    transform: translateY(-1px);
}
.rv-view-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.rv-hidden-note {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    padding: 8px 12px;
    font-size: 13px;
    color: #b45309;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
}

/* 商家回复 */
.rv-reply {
    margin-top: 14px;
    padding: 10px 14px;
    background: #f8fafc;
    border-left: 3px solid #0d6efd;
    border-radius: 0 8px 8px 0;
}
.rv-reply-title {
    font-size: 13px;
    font-weight: 600;
    color: #0d6efd;
    margin-bottom: 4px;
}
.rv-reply-content {
    font-size: 13px;
    color: #495057;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.6;
}
.rv-reply-time {
    margin-top: 5px;
    font-size: 12px;
    color: #adb5bd;
}

/* 查看态操作按钮 */
.rv-view-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #eef1f5;
    flex-wrap: wrap;
}
.rv-view-actions .btn {
    padding: 5px 14px;
}

/* ---------- 编辑态：保留图 + 新上传合并管理 ---------- */
.rv-edit-imgs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.rv-edit-imgs .rv-upload-tile {
    width: 84px;
    height: 84px;
}
.rv-keep-tile .rv-upload-remove {
    z-index: 3;
}
.rv-keep-tile input[type="hidden"] {
    display: none;
}
.rv-edit .rv-content {
    background: #fff;
}

/* ---------- 响应式 ---------- */
@media (max-width: 576px) {
    .rv-product-img {
        width: 52px;
        height: 52px;
    }
    .rv-body {
        padding: 16px;
    }
    .rating-star {
        font-size: 26px;
    }
    .rv-upload-tile {
        width: 72px;
        height: 72px;
    }
    .rv-form-footer {
        flex-direction: column;
        align-items: stretch;
    }
    .rv-submit {
        width: 100%;
    }
}

/* ---------- 评价进度概览条 ---------- */
.rv-progress {
    background: #fff;
    border: 1px solid #eef1f5;
    border-radius: 10px;
    padding: 12px 18px;
    margin-bottom: 18px;
}
.rv-progress-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-bottom: 10px;
}
.rv-progress-title {
    font-size: 14px;
    font-weight: 600;
    color: #343a40;
}
.rv-progress-title .bi {
    color: #0d6efd;
}
.rv-progress-pending {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    color: #b45309;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 999px;
    padding: 2px 10px;
}
.rv-progress-all {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    color: #198754;
}
.rv-progress-track {
    height: 6px;
    border-radius: 999px;
    background: #eef1f5;
    overflow: hidden;
}
.rv-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #34d399, #0d6efd);
    transition: width 0.4s ease;
}

/* ---------- 追评展示 ---------- */
.rv-extra {
    margin-top: 14px;
    padding: 12px 14px;
    background: #fffdf5;
    border: 1px solid #f3e7c9;
    border-left: 3px solid #e8a33d;
    border-radius: 0 8px 8px 0;
}
.rv-extra-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.rv-extra-title {
    font-size: 13px;
    font-weight: 600;
    color: #b8860b;
}
.rv-extra-title .bi {
    font-size: 14px;
}
.rv-extra-time {
    display: inline-flex;
    align-items: center;
    margin-left: auto;
    font-size: 12px;
    color: #adb5bd;
}
.rv-extra-content {
    font-size: 13px;
    line-height: 1.65;
    color: #495057;
    white-space: pre-wrap;
    word-break: break-word;
}
.rv-extra-images {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.rv-extra-img {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #f0e2c0;
    display: block;
    cursor: zoom-in;
    transition: box-shadow 0.2s, transform 0.2s;
}
.rv-extra-img:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
    transform: translateY(-1px);
}
.rv-extra-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.rv-extra-done {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #b8860b;
}

/* ---------- 追评表单 ---------- */
.rv-extra-form {
    border: 1px dashed #f0d9a0;
    border-radius: 10px;
    padding: 16px;
    margin-top: 14px;
    background: #fffdf5;
}
.rv-extra-form .rv-label {
    color: #8a6d3b;
}

/* ---------- 商品链接 ---------- */
.rv-product-name-link {
    color: #212529;
    text-decoration: none;
    transition: color 0.2s;
}
.rv-product-name-link:hover {
    color: #0d6efd;
    text-decoration: underline;
}
.rv-product-link {
    color: #adb5bd;
    font-size: 17px;
    line-height: 1;
    text-decoration: none;
    padding: 6px;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
    flex-shrink: 0;
}
.rv-product-link:hover {
    color: #0d6efd;
    background: #e9f0ff;
}

@media (prefers-reduced-motion: reduce) {
    .rv-card,
    .rating-star,
    .rv-upload-add,
    .rv-upload-remove,
    .rv-lightbox,
    .rv-lightbox-close {
        transition: none;
    }
}