/**
 * 产品评价系统 — 专用样式
 * 包含布局网格等（不依赖 Tailwind 编译的 class）
 */

/* ── 桌面端双栏布局 ── */
@media (min-width: 1024px) {
    #reviews .yyj-reviews-grid {
        display: grid;
        grid-template-columns: 1fr 380px;
        gap: 64px;
    }
    #review_form_wrapper {
        position: sticky;
        top: 96px;
        align-self: start;
        padding-left: 24px;
        border-left: 1px solid #eee;
    }
    #review_form_wrapper .mt-8 {
        margin-top: 0;
    }
}

/* ── 预览图网格：手机 1 列 / 桌面 4 列 ── */
[data-js-review-preview] {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 12px;
}
@media (min-width: 640px) {
    [data-js-review-preview] {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ── 图片正方形裁剪 ── */
[data-js-review-preview] img {
    aspect-ratio: 1 / 1;
    width: 100%;
    object-fit: cover;
}

/* ── 文字截断 ── */
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── 空状态横跨双栏居中 ── */
[data-js-review-empty] {
    grid-column: 1 / -1;
    padding: 80px 0;
}

/* ── 标题下间距 ── */
#comments .mb-6 { margin-bottom: 12px; }

/* ── 星级评分（保留 radio star 模式，尺寸加大）── */
#review_form .stars {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 4px;
}
#review_form .stars input[type="radio"] {
    display: none;
}
#review_form .stars label {
    cursor: pointer;
    font-size: 28px;
    color: #ddd;
    transition: color 0.15s;
    line-height: 1;
    user-select: none;
}
#review_form .stars label:before {
    content: '★';
}
#review_form .stars input[type="radio"]:checked ~ label,
#review_form .stars label:hover,
#review_form .stars label:hover ~ label {
    color: #f5a623;
}

/* 评价列表中的已评分星星 */
.review-stars-display {
    display: inline-flex;
    gap: 1px;
}
.review-stars-display .star-on {
    color: #f5a623;
}
.review-stars-display .star-off {
    color: #ddd;
}

/* ── 图片灯箱 ── */
[data-js-review-lightbox].is-open {
    display: flex !important;
}
[data-js-review-lightbox] img {
    transition: opacity 0.2s;
}

/* ── 拖拽上传区 active 态 ── */
[data-js-review-dropzone].is-dragover {
    border-color: var(--brandmaincolor);
    background-color: rgba(var(--brandmaincolor-rgb, 0 0 0), 0.05);
}

/* ── 有用/无用投票按钮 hover ── */
.review-vote-btn:hover {
    color: var(--brandmaincolor);
}
.review-vote-btn.is-voted {
    color: var(--brandmaincolor);
    font-weight: 600;
}

/* ── 预览图 ── */
.review-preview-thumb {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.review-preview-thumb img {
    display: block;
}
.review-preview-thumb .review-preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 14px;
    line-height: 22px;
    text-align: center;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.review-preview-thumb .review-preview-remove:hover {
    background: rgba(220,38,38,0.85);
}
