/**
 * Platform page_comments — ownership: platform capability.
 *
 * Pairs with:
 *   - themes/platform/assets/js/bootstrap.js (page_comments presence init)
 *   - themes/platform/partials/detail_comments（summary + list + form）
 *   - themes/platform/partials/detail_comment_summary
 *   - themes/platform/partials/detail_comment_form
 *   - shared_templates/{product,blog}_comments.ejs · comment_node.ejs
 *
 * Historical DOM ABI class names (pinLUe / Lipinl / …) are the public interface —
 * do not rename in this migration.
 *
 * Brand accent via --platform-comment-accent (theme :root overrides; same pattern as
 * --platform-contact-accent / --platform-search-accent). Platform default #1a1a1a.
 * Stars (rev-send-star / .rating-stars) follow --platform-comment-star → defaults to comment accent.
 * MUST NOT hardcode a site brand into this file.
 * Load: detail page head that includes detail_comment_form
 *   <link rel="stylesheet" href="{{ platform_asset('css/comment.css') }}">
 *
 * Stars (heart / emptyheart): self-contained via @font-face below — not Blueprint
 * iconfont / template1 prodet.css. Glyph file = themes/platform/assets/fonts/icomoon_pl.*
 */

@font-face {
    font-family: "ico";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src:
        url("../fonts/icomoon_pl.eot?#iefix") format("embedded-opentype"),
        url("../fonts/icomoon_pl.woff") format("woff"),
        url("../fonts/icomoon_pl.ttf") format("truetype"),
        url("../fonts/icomoon_pl.svg#ico") format("svg");
}

:root {
    /* accent 不写死在此：主题 :root 设 --platform-comment-accent；未设则用下方 var 默认 #1a1a1a */
    --platform-comment-text: #1a1a1a;
    --platform-comment-muted: #666666;
    --platform-comment-surface: #f3f3f3;
    --platform-comment-border: #f0f0f0;
    --platform-comment-divider: #cccccc;
    /* 选中星跟随主题 comment accent；未设 accent 时回落金黄 */
    --platform-comment-star: var(--platform-comment-accent, #ffcc00);
    --platform-comment-star-empty: #cccccc;
    --platform-comment-error: #c80000;
    --platform-comment-error-bg: #fef2f2;
    --platform-comment-error-border: #fca5a5;
    --platform-comment-error-text: #991b1b;
    --platform-comment-success-bg: #ecfdf5;
    --platform-comment-success-border: #6ee7b7;
    --platform-comment-success-text: #065f46;
}

/* ------------------------------------------------------------------ */
/* detail_comment_summary                                              */
/* ------------------------------------------------------------------ */

.pinLu {
    margin-top: 33px;
}

.placeholder-detail-comment-summary {
    margin-top: 20px;
}

.pinLu_box,
.placeholder-detail-comment-summary .pinLu_box {
    width: 100%;
    box-sizing: border-box;
    padding: 28px 36px;
    background-color: var(--platform-comment-surface);
    border-radius: 12px;
}

.pinLun_flex {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.pinLun_flex .asgjff {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.pinLun_flex .asfwshuzi {
    font-size: 40px;
    font-weight: 700;
    line-height: 1;
    color: var(--platform-comment-accent, #1a1a1a);
}

.pinLun_flex .ssscasf {
    font-size: 18px;
    font-weight: 700;
    color: var(--platform-comment-text);
}

/* Product Review Summary v1 — 页可见汇总（与 AggregateRating 同源） */
.review-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
}

.review-summary__stars.shiwu {
    gap: 2px;
}

.review-summary__stars.shiwu i {
    font-size: 22px;
    line-height: 1;
}

.review-summary__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
    font-size: 18px;
    font-weight: 700;
    color: var(--platform-comment-text);
}

.review-summary__value {
    font-size: 32px;
    line-height: 1;
    color: var(--platform-comment-accent, #1a1a1a);
}

.review-summary__scale,
.review-summary__sep {
    font-weight: 700;
    color: var(--platform-comment-muted, #666);
}

.review-summary--empty .ssscasf {
    font-size: 18px;
}

.pinLun_flex .alshare {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.pinLun_flex .alsht {
    font-size: 16px;
    font-weight: 700;
    color: var(--platform-comment-text);
}

.pinLun_flex .alshare .al1,
.pinLun_flex .alshare .al2 {
    display: flex;
    align-items: center;
    justify-content: center;
}

.pinLun_flex .alshare a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    color: var(--platform-comment-accent, #1a1a1a);
    text-decoration: none;
    transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.pinLun_flex .alshare a:hover {
    color: #fff;
    background-color: var(--platform-comment-accent, #1a1a1a);
    transform: translateY(-2px);
}

.pinLun_flex .alshare .iconfont {
    font-size: 20px;
    line-height: 1;
}

@media (max-width: 991px) {
    .pinLu_box,
    .placeholder-detail-comment-summary .pinLu_box {
        padding: 22px 24px;
    }

    .pinLun_flex .asfwshuzi {
        font-size: 32px;
    }
}

@media (max-width: 575px) {
    .pinLun_flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .pinLun_flex .alshare {
        width: 100%;
    }
}

/* ------------------------------------------------------------------ */
/* Comment list / thread (Blade · EJS · page_comments/render.js)        */
/* ------------------------------------------------------------------ */

.pinLUe {
    margin-top: 33px;
    list-style: none;
    padding: 0;
}

.Lipinl {
    display: flex;
    justify-content: space-between;
}

.Lipinl.comment-root,
.Lipinl.comment-reply {
    display: block;
}

.comment-thread-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.toux {
    width: 50px;
    flex-shrink: 0;
}

.toux img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.Lipinl_right {
    width: calc(100% - 80px);
    flex: 1;
    min-width: 0;
}

.Jost_flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
}

.Jost {
    color: var(--platform-comment-muted);
}

.Jost span {
    font-size: 18px;
    font-weight: 700;
    color: var(--platform-comment-text);
}

.shiwu {
    display: flex;
}

.shiwu i {
    color: var(--platform-comment-accent, #1a1a1a);
}

.sizedsd {
    margin-top: 20px;
}

.pinLUe:not(.pinLUe-replies) > .Lipinl:not(:last-child) {
    position: relative;
    padding-bottom: 33px;
}

.pinLUe:not(.pinLUe-replies) > .Lipinl:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 1px;
    background-color: var(--platform-comment-divider);
}

.pinLUe:not(.pinLUe-replies) > .Lipinl:not(:nth-child(1)) {
    margin-top: 33px;
}

.pinLUe-replies.comment-replies {
    list-style: none;
    margin-top: 20px;
    margin-bottom: 0;
    padding-left: 0;
}

.pinLUe-replies.comment-replies > .Lipinl.comment-reply {
    margin-top: 16px;
}

.pinLUe-replies.comment-replies > .Lipinl.comment-reply:first-child {
    margin-top: 0;
}

.pinLUe-replies[data-depth="1"] {
    margin-left: 20px;
    padding-left: 16px;
    border-left: 2px solid rgba(0, 0, 0, 0.06);
}

.pinLUe-replies[data-depth="2"] {
    margin-left: 16px;
    padding-left: 14px;
}

.pinLUe-replies[data-depth="3"],
.pinLUe-replies[data-depth="4"],
.pinLUe-replies[data-depth="5"] {
    margin-left: 12px;
    padding-left: 12px;
}

.pinLUe-replies .toux {
    width: 42px;
}

.pinLUe-replies .toux img {
    width: 42px;
    height: 42px;
}

.pinLUe-replies .Lipinl_right {
    width: calc(100% - 58px);
}

.pinLUe-replies .Jost span {
    font-size: 16px;
}

.pinLUe-replies .sizedsd {
    margin-top: 12px;
}

@media (max-width: 575px) {
    .Lipinl {
        flex-direction: column;
    }

    .Lipinl_right {
        width: 100%;
        margin-top: 20px;
    }

    .comment-thread-row {
        flex-direction: column;
    }

    .comment-thread-row .Lipinl_right {
        width: 100%;
        margin-top: 0;
    }

    .pinLUe-replies[data-depth="1"] {
        margin-left: 12px;
        padding-left: 10px;
    }

    .pinLUe-replies[data-depth="2"],
    .pinLUe-replies[data-depth="3"],
    .pinLUe-replies[data-depth="4"],
    .pinLUe-replies[data-depth="5"] {
        margin-left: 8px;
        padding-left: 8px;
    }

    .pinLUe-replies .toux {
        width: 36px;
    }

    .pinLUe-replies .toux img {
        width: 36px;
        height: 36px;
    }

    .pinLUe-replies .Lipinl_right {
        width: calc(100% - 48px);
    }
}

/* ------------------------------------------------------------------ */
/* Comment form (platform partial detail_comment_form)                 */
/* ------------------------------------------------------------------ */

.comment-form .LeaveComment {
    margin-top: 50px;
}

.comment-form .xzLeavec {
    font-size: 18px;
    color: var(--platform-comment-text);
    font-weight: 700;
}

.comment-form .emailw {
    color: var(--platform-comment-muted);
    margin: 20px 0;
}

.comment-form .rating-container {
    position: relative;
}

.comment-form .rating-stars {
    font-size: 24px;
    color: var(--platform-comment-star-empty);
    cursor: pointer;
    user-select: none;
}

.comment-form .rating-stars .star {
    display: inline-block;
    margin-right: 4px;
}

.comment-form .rev-send-star-f {
    display: flex;
    margin-top: 15px;
}

.comment-form .rev-send-star-s {
    font-family: ico;
    font-size: 24px;
    color: var(--platform-comment-star-empty);
    width: 30px;
    height: 30px;
    position: relative;
    cursor: pointer;
}

.comment-form .rev-send-star-s.heart {
    color: var(--platform-comment-star);
}

.comment-form .heart:before {
    position: absolute;
    content: '\e9d9';
}

.comment-form .emptyheart:before {
    position: absolute;
    content: '\e9d7';
}

.comment-form .nput_box {
    display: flex;
    justify-content: space-between;
    margin-top: 33px;
    gap: 2%;
}

.comment-form .nput_box > div {
    width: 49%;
    height: 45px;
    border: 1px solid var(--platform-comment-border);
    position: relative;
    box-sizing: border-box;
}

.comment-form .nput_box input {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    padding: 0 12px;
    box-sizing: border-box;
    font-size: 16px;
    color: var(--platform-comment-text);
}

.comment-form .tex_x {
    margin-top: 20px;
    width: 100%;
    height: 120px;
    border: 1px solid var(--platform-comment-border);
    position: relative;
    box-sizing: border-box;
}

.comment-form .tex_x textarea {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    padding: 12px;
    box-sizing: border-box;
    resize: none;
    font-size: 16px;
    color: var(--platform-comment-text);
}

.comment-form .comment-attachments {
    margin-top: 16px;
}

.comment-form .comment-attachments-list {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.comment-form .comment-attachments-list:empty {
    display: none;
    margin: 0;
}

.comment-form .comment-attachments-item {
    position: relative;
    width: 88px;
    height: 88px;
    margin: 0;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    background: #f3f4f6;
    overflow: hidden;
}

.comment-form .comment-attachments-thumb,
.comment-form .comment-attachments-video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment-form .comment-attachments-video {
    object-fit: contain;
    background: #111;
}

.comment-form .comment-attachments-badge {
    position: absolute;
    left: 4px;
    bottom: 4px;
    padding: 1px 5px;
    border-radius: 3px;
    background: rgba(17, 24, 39, 0.75);
    color: #fff;
    font-size: 10px;
    line-height: 1.3;
    pointer-events: none;
}

.comment-form .comment-attachments-remove {
    position: absolute;
    top: 3px;
    right: 3px;
    z-index: 2;
    box-sizing: border-box;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: 3px;
    background: #ef4444;
    color: #fff;
    font-size: 14px;
    line-height: 18px;
    text-align: center;
    cursor: pointer;
}

.comment-form .comment-attachments-remove:hover {
    background: #dc2626;
}

.comment-form .comment-attachments-pick-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

.comment-form .comment-attachments-pick-caption {
    font-size: 14px;
    color: #333;
    line-height: 1.4;
}

.comment-form .comment-attachments-pick {
    display: inline-block;
    cursor: pointer;
    margin: 0;
}

.comment-form .comment-attachments-pick-btn {
    display: inline-block;
    box-sizing: border-box;
    padding: 7px 16px;
    border: 1px solid #c8c8c8;
    border-radius: 2px;
    background: #f0f0f0;
    color: #111;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    user-select: none;
}

.comment-form .comment-attachments-pick:hover .comment-attachments-pick-btn {
    background: #e8e8e8;
}

.comment-form .comment-attachments-hint {
    margin: 8px 0 0;
    font-size: 12px;
    line-height: 1.5;
    color: #999;
}

.comment-form .comment-attachments-error {
    display: none;
    color: #c0392b;
    font-size: 13px;
    margin-bottom: 8px;
}

.comment-form .anNiu {
    padding: 8px 20px;
    margin-top: 33px;
    display: inline-block;
    font-size: 18px;
    border-radius: 20px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid var(--platform-comment-accent, #1a1a1a);
    background-color: #fff;
    color: var(--platform-comment-accent, #1a1a1a);
    position: relative;
    z-index: 2;
}

.comment-form .anNiu:hover {
    background-color: var(--platform-comment-accent, #1a1a1a);
    color: #fff;
}

.comment-form .semin-send-error {
    position: absolute;
    padding: 8px;
    font-size: 12px;
    border: 1px solid var(--platform-comment-error);
    color: var(--platform-comment-error);
    right: 5px;
    top: 5px;
    border-radius: 10px;
    display: none;
    background: #fff;
    z-index: 2;
}

.comment-form .semin-send-error-2 {
    position: absolute;
    padding: 8px;
    font-size: 12px;
    border: 1px solid var(--platform-comment-error);
    color: var(--platform-comment-error);
    right: 5px;
    bottom: 5px;
    border-radius: 10px;
    display: none;
    background: #fff;
    z-index: 2;
}

.comment-form .comment-form-error.global-error {
    display: none;
    margin: 0 0 16px;
    padding: 12px 16px;
    border-radius: 6px;
    background-color: var(--platform-comment-error-bg);
    border: 1px solid var(--platform-comment-error-border);
    color: var(--platform-comment-error-text);
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

.comment-form .comment-form-error.global-error:empty {
    display: none !important;
}

.comment-form .comment-form-error.global-error.is-success {
    background-color: var(--platform-comment-success-bg);
    border-color: var(--platform-comment-success-border);
    color: var(--platform-comment-success-text);
}

.comment-form .rating-container .semin-send-error {
    right: 0;
    top: 0;
    z-index: 2;
}

@media (max-width: 575px) {
    .comment-form .nput_box {
        flex-direction: column;
        gap: 12px;
    }

    .comment-form .nput_box > div {
        width: 100%;
    }
}

/* ------------------------------------------------------------------ */
/* Aggregate / legacy review chrome (same comment ABI surface)         */
/* ------------------------------------------------------------------ */

.r0tip {
    margin-top: 30px;
    font-size: 16px;
    color: var(--platform-comment-text);
}

.r0t2 {
    color: var(--platform-comment-muted);
    padding-top: 20px;
}

.uploadify-button {
    margin: 0;
    margin-top: 30px;
}

.r-s-i-img-show {
    display: flex;
    flex-wrap: wrap;
    margin-top: 30px;
    gap: 15px;
}

.rsiimg-s {
    width: 20%;
    position: relative;
}

.rsisclose {
    position: absolute;
    right: 0;
    top: 0;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
}

.review-s {
    display: flex;
    gap: 20px;
}

.rev-s-left {
    width: 65px;
}

.rev-rigf {
    width: calc(100% - 65px);
}

.rev-s-top2 {
    display: flex;
    justify-content: space-between;
}

.rev-name-c {
    color: var(--platform-comment-text);
    font-size: 16px;
    font-weight: bold;
}

.rev-s-top3 {
    color: var(--platform-comment-muted);
    font-size: 16px;
    margin-top: 5px;
}

.rev-star-f {
    display: flex;
    gap: 10px;
}

.rev-star-s {
    font-family: ico;
    font-size: 16px;
    color: var(--platform-comment-accent, #1a1a1a);
}

.rev-star-s:before {
    content: '\e9d9';
}

.rev-content {
    margin-top: 15px;
}

.rev-s-picf {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.revs-p-s {
    width: 20%;
}

.revs-p-s img {
    width: 100%;
}

.tot-p {
    display: flex;
    margin-top: 30px;
    gap: 20px;
}

.aggrat-val {
    font-size: 22px;
    font-weight: 900;
    color: var(--platform-comment-accent, #1a1a1a);
    font-style: italic;
}

.aggrating-star-f {
    display: flex;
}

.aggrat-full {
    float: left;
    font-family: ico;
    font-size: 24px;
    color: var(--platform-comment-accent, #1a1a1a);
    width: 30px;
    height: 30px;
}

.aggrat-full:before {
    content: '\e9d9';
}

.agrf-emp:before {
    content: '\e9d7';
}

.aggrat-hs-f {
    width: 30px;
    height: 30px;
    font-family: ico !important;
    font-size: 24px;
    color: var(--platform-comment-accent, #1a1a1a);
    position: relative;
}

.aggrat-hs-full {
    position: absolute;
    width: 13px;
    height: 30px;
    overflow: hidden;
}

.aggrat-hs-full:before {
    content: '\e9d9';
    font-family: ico !important;
}

.aggrat-hs-emp {
    float: left;
    width: 30px;
    height: 30px;
}

.aggrat-hs-emp:before {
    content: '\e9d7';
    font-family: ico !important;
}

/* ------------------------------------------------------------------ */
/* UGC Attachments v1 · Slice D — approved images / videos             */
/* ------------------------------------------------------------------ */

.ugc-attachments {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ugc-attachments--images .ugc-attachments__thumb {
    display: block;
    padding: 0;
    margin: 0;
    border: 1px solid var(--platform-comment-border);
    border-radius: 8px;
    background: #fff;
    cursor: zoom-in;
    overflow: hidden;
    width: 88px;
    height: 88px;
}

.ugc-attachments--images .ugc-attachments__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ugc-attachments--videos .ugc-attachments__video {
    width: 100%;
    max-width: 420px;
}

.ugc-attachments--videos video {
    width: 100%;
    max-height: 280px;
    border-radius: 8px;
    background: #000;
    display: block;
}

.ugc-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.82);
    padding: 24px;
    box-sizing: border-box;
}

.ugc-lightbox.is-open {
    display: flex;
}

.ugc-lightbox__img {
    max-width: min(96vw, 1100px);
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
}

.ugc-lightbox__close {
    position: absolute;
    top: 16px;
    right: 16px;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 8px;
}
