.detail-topbar {
    position: sticky;
    top: 0;
    z-index: 99;
    display: grid;
    grid-template-columns: 36px 1fr 36px;
    align-items: center;
    height: 48px;
    padding: 0 16px;
    border-bottom: 1px solid #eee;
    background: #fff;
    color: #333;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    box-sizing: border-box;
}
.detail-topbar .detail-back {
    display: grid;
    place-items: center start;
    height: 100%;
    color: inherit;
    font-size: 22px;
    text-decoration: none;
}
.detail-gallery { position: relative; width: 100%; background: #f8f5f1; }
.detail-gallery-track {
    display: flex;
    aspect-ratio: 1 / 1;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}
.detail-gallery-track::-webkit-scrollbar, .detail-spec-preview::-webkit-scrollbar { display: none; }
.detail-gallery-track img {
    display: block;
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    object-fit: cover;
    scroll-snap-align: start;
}
.detail-gallery-counter {
    position: absolute;
    right: 16px;
    bottom: 18px;
    padding: 4px 9px;
    border-radius: 20px;
    background: rgba(0, 0, 0, .48);
    color: #fff;
    font-size: 13px;
    line-height: 18px;
}
.detail-media-empty {
    display: grid;
    aspect-ratio: 1 / 1;
    place-items: center;
    color: #6f6056;
    font-size: 14px;
}
.detail-price-strip {
    position: relative;
    margin-top: -6px;
    padding: 9px 16px 13px;
    border-radius: 14px 14px 0 0;
    background: linear-gradient(135deg, #4d3423, #2b1d14 50%, #1a120d);
    color: #f5e7d8;
}
.detail-price-line, .detail-price-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.detail-price { font-size: 28px; font-weight: 400; letter-spacing: -1px; line-height: 1.1; }
.detail-shop-label { text-align: right; font-size: 15px; font-weight: 600; }
.detail-price-meta { margin-top: 4px; font-size: 13px; line-height: 18px; }
.detail-price-meta button {
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}
.detail-spec-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    overflow: auto;
    padding: 8px 16px 4px;
    border: 0;
    background: #fff;
    color: #666;
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
    box-sizing: border-box;
}
.detail-spec-preview:disabled { cursor: default; }
.detail-spec-preview img {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    object-fit: cover;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
}
.detail-product-title {
    margin: 0;
    padding: 12px 16px 10px;
    background: #fff;
    color: #171717;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.43;
    overflow-wrap: anywhere;
}
.detail-shop-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 32px;
    margin: 0 14px 6px;
    padding: 6px 10px;
    border-radius: 6px;
    background: linear-gradient(90deg, #5a3a22, #4a2e1a 50%, #3a2218);
    color: #f7e5d0 !important;
    font-size: 12px;
    text-decoration: none;
    box-sizing: border-box;
}
.reference-goods .fui-content { background: #fff; }
.reference-goods .fui-detail-group { margin-top: 0 !important; }
.reference-goods .fui-navbar {
    display: flex;
    align-items: stretch;
    height: auto;
    min-height: 60px;
    padding: 6px 12px calc(6px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    box-sizing: border-box;
}
.reference-goods .fui-navbar .nav-item:not(.buy-now) { flex: 0 0 45px; min-width: 0; }
.reference-goods #buyButton {
    align-self: center;
    display: grid;
    place-items: center;
    flex: 1 1 auto;
    height: 42px;
    margin: 0 0 0 8px;
    overflow: hidden;
    border-radius: 22px;
    background: linear-gradient(90deg, #ff4461, #ff2450);
    color: #fff;
}
.reference-goods #buyButton[aria-disabled="true"] { background: #e9e7e6; color: #6a605c; }
.reference-goods #buyButton .left-content, .reference-goods #buyButton .price-text { display: none !important; }
.reference-goods #buyButton .right-content {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    padding: 0;
    background: transparent !important;
}
.reference-goods #buyButton .buy-text { margin: 0; color: inherit; font-size: 16px; font-weight: 600; }
.reference-goods #buyPopup, .reference-goods #addressPopup { max-width: 480px; margin-inline: auto; }
.reference-goods #buyPopup button[onclick="submitOrder()"] { background: #ff2c55 !important; }
.detail-empty-page {
    margin: 0;
    background: #f6f5f4;
    color: #24201d;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
.detail-empty-shell { max-width: 480px; min-height: 100vh; margin-inline: auto; background: #fff; }
.detail-empty-state {
    display: grid;
    place-content: center;
    min-height: min(100vw, 420px);
    padding: 20px;
    background: linear-gradient(160deg, #fbf6ef, #f1e8dd);
    text-align: center;
    box-sizing: border-box;
}
.detail-empty-state h1 { margin: 0 0 8px; font-size: 20px; }
.detail-empty-state p { margin: 0; color: #675a50; font-size: 14px; }
.detail-empty-link { margin-top: 10px; }

body.reference-goods { width: 100%; max-width: 480px !important; margin-inline: auto; }
.reference-goods .page-goods-detail { width: 100%; max-width: 480px !important; }
.reference-goods .page-goods-detail .fui-content {
    right: 0 !important;
    left: 0 !important;
    max-width: 480px !important;
    margin-inline: auto;
    bottom: calc(60px + env(safe-area-inset-bottom, 0px)) !important;
}
.reference-goods .fui-navbar {
    left: 50% !important;
    right: auto !important;
    width: 100% !important;
    max-width: 480px !important;
    transform: translateX(-50%);
}
.reference-goods #buyButton { grid-template-columns: minmax(0, 1fr); justify-items: stretch; }
.reference-goods #buyButton::before, .reference-goods #buyButton::after,
.reference-goods #buyButton .right-content::before, .reference-goods #buyButton .right-content::after {
    content: none !important;
}
.reference-goods #buyButton .right-content {
    position: static !important;
    grid-area: 1 / 1;
    width: 100% !important;
    max-width: none !important;
}
