* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: #f7f7f7;
    color: #1f2329;
    font: 14px/1.6 Inter, "Microsoft YaHei", sans-serif
}

a {
    text-decoration: none;
    color: inherit
}

.wrap {
    width: min(1280px, calc(100% - 40px));
    margin: auto
}

.shop-top {
    height: 34px;
    background: #f2f3f5;
    color: #666;
    font-size: 12px
}

.shop-top .wrap,
.head {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between
}

.shop-top span:last-child {
    display: flex;
    gap: 18px
}

/* 只作用于模板自带的页头。站点头部是 <header class="gr-market-header">（由
   commerce.css 接管，两级导航合计约 168px），元素选择器会把它的高度锁成 72px，
   导航就会溢出并压住正文（面包屑叠在导航上）。*/
body>header:not(.gr-market-header) {
    height: 72px;
    background: #fff;
    border-bottom: 1px solid #e8e8e8
}

.head {
    gap: 35px
}

.brand-logo img {
    width: 155px;
    display: block
}

.head nav {
    display: flex;
    gap: 28px;
    font-weight: 700
}

.order-entry {
    margin-left: auto;
    border: 1px solid #e7272d;
    color: #e7272d;
    border-radius: 20px;
    padding: 7px 16px;
    font-weight: 800
}

.product-page {
    padding: 18px 0 60px
}

.crumb {
    color: #777;
    margin-bottom: 16px
}

/* 商品页只有两栏：左商品图、右商品信息（名称/价格/租赁套餐/规格参数）。
   所有下单选择都在确认订单页，所以这里不再留第三栏给下单表单。 */
.product-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(340px, 1fr);
    gap: 26px;
    align-items: start
}

.gallery,
.product-info,
.rental-box {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px
}

.gallery {
    padding: 18px
}

.main-image {
    height: 540px;
    border-radius: 9px;
    background: linear-gradient(145deg, #f5f6f8, #e9edf2);
    display: grid;
    place-items: center;
    overflow: hidden
}

/* 主图用 contain：商品页封面横竖比差别很大（实测 750x509、750x1334 都有），
   cover 会按盒子比例裁掉一截（横图裁两侧、竖图裁上下），用户看到的就是「展示不全」。 */
.main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain
}

.main-image strong {
    font-size: 28px;
    color: #bdc4ce
}

.trust {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    margin-top: 14px
}

.trust span {
    text-align: center;
    color: #666;
    font-size: 12px
}

.product-info {
    padding: 22px
}

.badges {
    display: flex;
    gap: 8px
}

.badges span {
    background: #fff0ed;
    color: #d62328;
    padding: 3px 8px;
    border-radius: 3px
}

/* 平台精选：金底金字，与普通红底徽标区分（商品页按当前方案的 is_featured 显示）。 */
.badges span.featured {
    background: #fff7e6;
    color: #b26a00
}

.product-info h1 {
    font-size: 30px;
    line-height: 1.35;
    margin: 14px 0
}

.summary {
    color: #687386;
    font-size: 15px
}

/* 租赁价做成贴合内容的小色块（inline-block），占满整行会显得笨重。
   标签在金额上方一行，避免窄栏时「租赁价 + 金额 + 单位」互相挤压换行。 */
.price {
    display: inline-block;
    background: linear-gradient(90deg, #fff0ec, #fff8f5);
    border-radius: 8px;
    padding: 10px 16px;
    margin: 14px 0 0
}

.price small {
    display: block;
    color: #8b95a5;
    font-size: 12px;
    margin-bottom: 2px
}

.price b {
    font-size: 24px;
    color: #e1252d
}

.price span {
    color: #8b95a5;
    font-size: 13px;
    margin-left: 4px
}

.facts {
    display: grid;
    gap: 12px
}

.facts div {
    display: grid;
    grid-template-columns: 90px 1fr;
    border-bottom: 1px solid #eee;
    padding: 9px 0
}

.facts span {
    color: #888
}

.service-strip {
    margin-top: 22px;
    padding: 14px;
    background: #fafafa;
    display: flex;
    flex-wrap: wrap;
    gap: 13px
}

.service-strip b {
    color: #e1252d
}

.rental-box {
    padding: 22px;
    position: sticky;
    top: 12px
}

.box-title {
    display: flex;
    justify-content: space-between;
    align-items: start
}

.box-title small {
    color: #e1252d;
    font-weight: 900
}

.box-title h2 {
    font-size: 23px;
    margin: 2px 0
}

.box-title>span {
    font-size: 12px;
    color: #777;
    padding: 5px 8px;
    background: #f4f4f4;
    border-radius: 4px
}

.box-title>span.ok {
    color: #167743;
    background: #eef9f2
}

.box-title>span.sold {
    color: #b5252b;
    background: #fff0f0
}

.date-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 14px
}

.date-grid label,
.field {
    font-weight: 700
}

.date-grid input,
.field>input,
.field>select {
    display: block;
    width: 100%;
    height: 42px;
    margin-top: 5px;
    border: 1px solid #d8dbe0;
    border-radius: 6px;
    padding: 0 10px
}

.field>select {
    background: #fff
}

.field {
    display: block;
    margin-top: 15px
}

/* 逐字段错误提示：显示在各自输入框下方（validate() 不再把错误汇总到 #result） */
.field-error {
    display: block;
    margin-top: 4px;
    color: #b5252b;
    font-size: 12px;
    font-style: normal;
    font-weight: 400;
    line-height: 1.5
}

.field-error:empty {
    display: none
}

.quantity {
    display: flex;
    align-items: center;
    margin-top: 6px
}

.quantity button,
.quantity input {
    width: 40px;
    height: 38px;
    border: 1px solid #d8dbe0;
    background: #fff;
    text-align: center
}

.quantity input {
    border-left: 0;
    border-right: 0
}

.quantity span {
    margin-left: 9px;
    color: #777
}

/* 规格选择：仿电商「维度名 + 选项块」的形态，但沿用本站的红色/圆角/字号体系 */
.spec-group {
    margin-top: 16px
}

.spec-group>b {
    display: block;
    font-weight: 700
}

.spec-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px
}

.spec-chips label {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 7px 13px;
    border: 1px solid #d8dbe0;
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
    line-height: 1.5;
    cursor: pointer
}

.spec-chips label:hover {
    border-color: #c9131b
}

.spec-chips label:has(input:checked) {
    border-color: #c9131b;
    background: #fff5f5;
    color: #c9131b;
    font-weight: 700
}

/* 单/多选框视觉隐藏。必须用 `.spec-chips label input`（超出 commerce.css 里
   `input[type=radio]{width/height:16px!important}` 的特异度），否则同样带 !important 时
   会因 commerce.css 后加载而被覆盖成 16×16。 */
.spec-chips label input {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    min-height: 0 !important;
    margin: 0 !important;
    opacity: 0;
    pointer-events: none
}

.spec-input {
    display: block;
    width: 100%;
    height: 42px;
    margin-top: 8px;
    padding: 0 10px;
    border: 1px solid #d8dbe0;
    border-radius: 6px
}

.spec-hint {
    margin: 7px 0 0;
    color: #5f6874;
    font-size: 12px
}

.spec-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin: 8px 0 0;
    padding: 0;
    list-style: none
}

.spec-list li {
    color: #5f6874;
    font-size: 12px
}

.spec-list li:before {
    content: '·';
    margin-right: 4px;
    color: #c9131b;
    font-weight: 900
}

.in-stock {
    margin-left: 10px;
    color: #1a6b3c;
    font-size: 12px;
    font-style: normal
}

.quote {
    border-top: 1px solid #eee;
    margin-top: 17px;
    padding-top: 12px
}

.quote div {
    display: flex;
    justify-content: space-between;
    padding: 3px 0
}

.quote .discount {
    color: #15934c
}

.quote .total {
    border-top: 1px solid #eee;
    margin-top: 8px;
    padding-top: 10px;
    font-size: 18px
}

.quote .total b {
    color: #e1252d;
    font-size: 24px
}

.submit {
    width: 100%;
    height: 48px;
    border: 0;
    border-radius: 7px;
    background: #e1252d;
    color: #fff;
    font-size: 16px;
    font-weight: 900;
    margin-top: 12px;
    cursor: pointer
}

.notice {
    font-size: 12px;
    color: #888;
    text-align: center
}

.result {
    display: none;
    padding: 10px;
    background: #fff0ed;
    color: #b5252b;
    border-radius: 6px
}

.result.success {
    background: #eef9f2;
    color: #167743
}

.detail-content {
    background: #fff;
    border-radius: 14px;
    margin-top: 22px;
    padding: 30px 34px 22px;
    box-shadow: 0 10px 34px rgba(20, 31, 48, .07)
}

.detail-content article {
    padding: 22px 0 24px;
    border-bottom: 1px solid #f0f1f4
}

.detail-content article:first-child {
    padding-top: 4px
}

.detail-content article:last-child {
    border-bottom: 0;
    padding-bottom: 6px
}

.detail-content article h2 {
    position: relative;
    margin: 0 0 14px;
    padding-left: 14px;
    font-size: 20px;
    letter-spacing: -.01em
}

.detail-content article h2:before {
    content: "";
    position: absolute;
    left: 0;
    top: 3px;
    bottom: 3px;
    width: 4px;
    border-radius: 2px;
    background: linear-gradient(180deg, #f2423a, #c1121c)
}

.detail-content article>p {
    margin: 0;
    color: #4b5563;
    font-size: 15px;
    line-height: 1.85
}

/* 商品页（原详情页 + 原选规格页合并）新增区块：参数表、场景标签、方案对比。
   统一用 rp- 前缀，避免与页面里已有的 .card/.price 等通用类名冲突。 */
.rp-param {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 30px
}

.rp-param>div {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 0;
    border-bottom: 1px solid #f0f1f4
}

.rp-param span {
    color: #778398;
    font-size: 13px
}

.rp-param b {
    text-align: right
}

.rp-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 9px
}

.rp-tags span {
    background: #fff1ed;
    color: #c92b31;
    padding: 6px 13px;
    border-radius: 18px;
    font-size: 13px
}

/* 租赁套餐：每项占满一行的长条，从上到下排列（用户明确不要并排的小方块）。
   条内第一行套餐名、第二行内容说明；说明取自 gr_rental_package.description。 */
.spec-chips.packages {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px
}

.spec-chips.packages label {
    display: block;
    padding: 10px 12px;
    text-align: left
}

.spec-chips.packages label b {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45
}

/* 套餐标价：与套餐名同一行、右对齐（租金单价 = 方案单价 × 套餐倍率）。 */
.spec-chips.packages label b .pkg-price {
    color: #e1252d;
    font-weight: 800;
    white-space: nowrap
}

.spec-chips.packages label em {
    display: block;
    margin-top: 4px;
    color: #8b95a5;
    font-size: 12px;
    font-style: normal;
    line-height: 1.5
}

.spec-chips.packages label:has(input:checked) em {
    color: #c9131b
}

/* 方案卡片在商品页右栏（窄栏）里当「规格」用，做成紧凑对比行：
   左侧方案信息、右侧价格与「选此方案」入口。字号与内边距都按窄栏压过。 */
.rp-offer-list {
    display: grid;
    gap: 10px
}

.rp-offer-card {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid #e5e9ef;
    border-radius: 10px;
    padding: 12px 14px
}

.rp-offer-card.current {
    border-color: #e3262e;
    background: #fff8f7
}

.rp-offer-card small {
    color: #8b95a5;
    font-size: 11px
}

.rp-offer-card.current small {
    color: #c1121c;
    font-weight: 800
}

.rp-offer-card h3 {
    margin: 2px 0;
    font-size: 14px;
    line-height: 1.45
}

.rp-offer-card p {
    margin: 2px 0;
    color: #69768a;
    font-size: 12px;
    line-height: 1.55
}

.rp-offer-price {
    flex: none;
    min-width: 116px;
    text-align: right
}

.rp-offer-price b {
    color: #e3262e;
    font-size: 18px
}

.rp-offer-price span {
    color: #69768a;
    font-size: 12px
}

.rp-offer-price a {
    display: inline-block;
    margin-top: 8px;
    padding: 7px 12px;
    border-radius: 6px;
    background: #e3262e;
    color: #fff;
    font-weight: 800;
    font-size: 12px
}

.rp-offer-card.current .rp-offer-price a {
    background: #fff;
    color: #c1121c;
    border: 1px solid #e3262e
}

.rental-box.empty .submit {
    display: block;
    margin-top: 16px;
    text-align: center
}

@media(max-width:800px) {
    .rp-param {
        grid-template-columns: 1fr
    }

    .rp-offer-card {
        display: block
    }

    .rp-offer-price {
        text-align: left
    }
}

.detail-rules {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px
}

.detail-rules li {
    position: relative;
    padding-left: 26px;
    color: #4b5563;
    font-size: 15px;
    line-height: 1.75
}

.detail-rules li:before {
    content: "";
    position: absolute;
    left: 6px;
    top: 7px;
    width: 6px;
    height: 10px;
    border-right: 2px solid #d3232b;
    border-bottom: 2px solid #d3232b;
    transform: rotate(45deg)
}

.supplier-card {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    padding: 20px;
    border: 1px solid #eef0f3;
    border-radius: 12px;
    background: #f8f9fb
}

.supplier-logo {
    width: 74px;
    height: 74px;
    border-radius: 12px;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: #fff4f1;
    border: 1px solid #f3ddd9;
    color: #b5252b;
    font-size: 26px;
    font-weight: 900
}

.supplier-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff
}

.supplier-body h3 {
    margin: 0 0 8px;
    font-size: 19px
}

.supplier-body h3 a:hover {
    color: #e7272d
}

.supplier-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px
}

.supplier-tags span {
    padding: 4px 10px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #4b5563;
    font-size: 12px;
    font-weight: 700
}

.supplier-tags .cert {
    background: #fff1ee;
    color: #b5252b
}

.supplier-summary {
    margin: 10px 0 0;
    color: #6b7280;
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden
}

.supplier-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 132px
}

.supplier-actions a {
    text-align: center;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    font-weight: 800;
    color: #374151
}

.supplier-actions .supplier-main {
    background: #e7272d;
    border-color: #e7272d;
    color: #fff
}

.supplier-note {
    margin: 14px 0 0;
    padding: 12px 14px;
    background: #fff;
    border: 1px dashed #e3e6ea;
    border-radius: 8px;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.7
}

@media(max-width:760px) {
    .supplier-card {
        grid-template-columns: 62px minmax(0, 1fr);
        gap: 14px
    }

    .supplier-logo {
        width: 62px;
        height: 62px;
        font-size: 22px
    }

    .supplier-actions {
        grid-column: 1 / -1;
        flex-direction: row;
        min-width: 0
    }

    .supplier-actions a {
        flex: 1
    }
}

.steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px
}

.steps span {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: #f8f9fb;
    border: 1px solid #eef0f3;
    border-radius: 10px;
    color: #374151;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5
}

.steps b {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #f2c6c4;
    color: #d3232b;
    font-size: 12px;
    font-weight: 900
}

@media(max-width:1180px) {
    .product-grid {
        grid-template-columns: minmax(0, 1.2fr) minmax(320px, 1fr)
    }

    .rental-box {
        grid-column: 1/-1;
        position: static
    }

    .main-image {
        height: 350px
    }
}

@media(max-width:760px) {
    .wrap {
        width: calc(100% - 24px)
    }

    .head nav {
        display: none
    }

    .product-grid {
        grid-template-columns: 1fr
    }

    .main-image {
        height: 310px
    }

    .product-info h1 {
        font-size: 25px
    }

    .date-grid {
        grid-template-columns: 1fr
    }

    .steps {
        grid-template-columns: 1fr 1fr
    }
}

/* 商品页：价格与「已租 N+ / 最短租期」并排。成交量取真实已支付订单数（rented_quantity），
   没有成交量时后端不下发 rented_text，这里只渲染最短租期。 */
.price-row {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 14px
}

.price-extra {
    display: grid;
    gap: 4px;
    padding-bottom: 6px
}

.price-extra b {
    color: #e1252d;
    font-size: 14px
}

.price-extra span {
    color: #8b95a5;
    font-size: 12px
}

/* 商品页「用户评价」：只展示已发布、且来自已完成订单的评价（PublicRentalReviews）。 */
.rv-summary {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 10px;
    background: #fff8f6
}

.rv-summary div {
    color: #e1252d;
    font-size: 30px;
    font-weight: 800;
    line-height: 1
}

.rv-summary div em {
    font-size: 13px;
    font-style: normal
}

.rv-summary p {
    margin: 0;
    color: #687386;
    font-size: 13px
}

.rv-list {
    display: grid;
    gap: 12px;
    margin-top: 14px
}

.rv-card {
    padding: 16px;
    border: 1px solid #eceff3;
    border-radius: 10px;
    background: #fff
}

.rv-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap
}

.rv-head em {
    margin-left: auto;
    color: #97a1b0;
    font-size: 12px;
    font-style: normal
}

.rv-stars {
    color: #f5a623;
    font-size: 13px;
    letter-spacing: 1px
}

.rv-content {
    margin: 10px 0 0;
    color: #33404f;
    font-size: 14px;
    line-height: 1.8;
    word-break: break-word
}

.rv-images {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px
}

.rv-images img {
    width: 84px;
    height: 84px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #eceff3
}

.rv-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px
}

.rv-metrics span {
    padding: 2px 8px;
    border-radius: 20px;
    background: #f4f6f9;
    color: #687386;
    font-size: 12px
}

.rv-reply {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f7f9fc
}

.rv-reply b {
    color: #c1121c;
    font-size: 12px
}

.rv-reply p {
    margin: 4px 0 0;
    color: #4b5866;
    font-size: 13px;
    line-height: 1.7
}

.rv-empty {
    color: #8b95a5;
    font-size: 13px
}