/* =================================================================================
   1. SINGLE PRODUCT LAYOUT (详情页主骨架与锁定)
   ================================================================================= */
.uyaai-single-wrap { 
    max-width: 1200px; 
    margin: 40px auto; 
    padding: 0 20px; 
    overflow: hidden; 
}

.uyaai-p-flex { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 50px; 
    align-items: flex-start; 
}

/* 左侧画廊列 */
.uyaai-col-gal { 
    flex: 1; 
    min-width: 350px; 
}

/* 右侧详情列：强制左对齐，移除冗余内边距 */
.uyaai-col-info { 
    flex: 0 0 450px; 
    max-width: 450px; 
    padding-left: 0 !important; 
    display: flex;
    flex-direction: column;
    align-items: flex-start !important; 
}

/* =================================================================================
   2. GALLERY & VIDEO SYSTEM (画廊与视频中心裁剪算法 V3)
   ================================================================================= */

/* 1:1 正方形展示窗口 */
.gal-main-frame { 
    position: relative !important;
    width: 100% !important; 
    aspect-ratio: 1 / 1 !important; 
    background: #f9f9f9; 
    border: 1px solid var(--uyaai-border); 
    border-radius: 8px; 
    overflow: hidden; 
    margin-bottom: 15px; 
}

.gal-main-frame img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
}

/* 视频包装盒：锁死 1:1 并中心裁剪 */
.v-frame-box { 
    position: absolute !important;
    inset: 0 !important;
    display: none; /* 由 JS 切换 */
    z-index: 5;
    background: #000;
    overflow: hidden;
}

/* 核心：16:9/9:16 视频在正方形框内的杂志感位移算法 */
.v-frame-box iframe {
    position: absolute !important;
    width: 102% !important; /* 轻微溢出消除黑边 */
    height: 181.3% !important; 
    left: 50% !important;
    top: 0 !important; 
    /* PC 端位移：绝对居中基础上向上推 150px 实现视觉平衡 */
    margin-top: calc(-40.65% - 150px) !important;
    transform: translateX(-50%) !important;
    border: none !important;
    pointer-events: none !important;
    will-change: transform;
}

/* 缩略图网格 */
.gal-thumb-grid { 
    display: grid !important; 
    grid-template-columns: repeat(5, 1fr) !important; 
    gap: 10px !important; 
}

.thumb-unit { 
    aspect-ratio: 1/1 !important; 
    border: 2px solid #eee; 
    border-radius: 4px; 
    overflow: hidden; 
    cursor: pointer;
    transition: var(--transition);
}

.thumb-unit.active { border-color: var(--uyaai-pink); }
.thumb-unit img { width: 100% !important; height: 100% !important; object-fit: cover !important; }

/* =================================================================================
   3. PRODUCT INFO & SWATCHES (标题与颜色选项卡)
   ================================================================================= */
.p-title-h1 { font-size: 28px; font-weight: 800; margin: 0 0 10px 0; color: var(--uyaai-black); }
.p-sku-sub { font-size: 14px; color: #888; margin-bottom: 20px; }

.swatch-label { 
    font-size: 11px; font-weight: 700; color: var(--uyaai-muted); 
    text-transform: uppercase; margin-bottom: 12px; 
}

.swatch-list { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 30px; }

.swatch-btn { 
    text-decoration: none; padding: 10px 18px; background: #fff; 
    border: 1.5px solid #eee; border-radius: 50px; font-size: 13px; 
    color: #444; font-weight: 600; transition: var(--transition);
}

.swatch-btn:hover { border-color: var(--uyaai-pink); color: var(--uyaai-pink); }

.swatch-btn.active { 
    background: var(--uyaai-pink) !important; 
    color: #fff !important; 
    border-color: var(--uyaai-pink) !important; 
    box-shadow: 0 5px 15px rgba(237, 0, 142, 0.3); 
}

/* =================================================================================
   4. PURCHASE BLOCK (加购区与数量框 4 位扩容修正)
   ================================================================================= */
.buy-box-card { background: #f9f9f9; padding: 20px 0; width: 100%; margin-bottom: 10px; }
.u-buy-flex-wrapper { display: flex !important; align-items: center !important; gap: 12px !important; width: 100% !important; }

/* 加购按钮：占据大部空间 */
.btn-add-list { 
    order: 1 !important; 
    flex: 3 !important; 
    background: var(--uyaai-pink) !important; 
    color: #fff !important; 
    border-radius: 6px !important; 
    padding: 14px !important; 
    font-weight: 700 !important; 
    border: none; 
    cursor: pointer;
    transition: var(--transition);
}

/* 数量选择器：空间扩容补丁 */
.u-main-qty-box {
    order: 2 !important;
    display: flex !important;
    border: 1px solid #ddd !important;
    border-radius: 6px;
    height: 48px;
    background: #fff;
    flex: 0 0 140px !important; /* 锁定宽度，确保 4 位数不溢出 */
    overflow: hidden;
}

.u-main-qty-box button {
    width: 35px !important;
    flex: 0 0 35px !important;
    background: #fff !important;
    color: var(--uyaai-black) !important;
    font-size: 20px;
    font-weight: bold;
    border: none !important;
    cursor: pointer;
}

.u-main-qty-box input {
    flex: 1 !important;
    width: 60px !important;
    color: var(--uyaai-black) !important;
    background: #fff !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    border: none !important;
    border-left: 1px solid #eee !important;
    border-right: 1px solid #eee !important;
    text-align: center !important;
    -moz-appearance: textfield; /* Firefox 兼容 */
}

/* 询盘按钮 */
.btn-inquiry-now { 
    width: 100%; 
    background: var(--uyaai-black) !important; 
    color: #fff !important; 
    border-radius: 6px; padding: 16px; font-weight: 700; 
    text-align: center; text-decoration: none; display: block; margin-top: 10px;
}

/* =================================================================================
   5. TRUST BAR & ACCORDION (认证背书与规格表)
   ================================================================================= */
.uyaai-trust-bar { 
    display: flex !important; 
    justify-content: space-between;
    align-items: center;
    gap: 10px; 
    font-size: 13px !important;
    color: #2ecc71; 
    font-weight: 700; 
    margin: 10px 0 !important; 
    padding: 15px 0 !important; 
    border-top: 1px solid #eee; 
    border-bottom: 1px solid #eee; 
    width: 100%; 
}

/* 规格表与抽屉 */
.uyaai-accordion-wrap { margin-top: 20px; border-top: 1px solid #eee; width: 100%; }
.acc-item { border-bottom: 1px solid #eee; padding: 5px 0; }
.acc-header { padding: 15px 0; display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.acc-header span:first-child { font-weight: 700; color: var(--uyaai-black); font-size: 15px; }
.acc-content { display: none; padding-bottom: 25px; }
.acc-item.active .acc-content { display: block !important; }
.acc-item.active .acc-header span:first-child { color: var(--uyaai-pink); }

.spec-table { width: 100% !important; border-collapse: collapse; table-layout: fixed; }
.spec-table td { padding: 12px 0; border-bottom: 1px solid #f6f6f6; font-size: 13px; text-align: left !important; }
.spec-table td:first-child { width: 130px !important; color: var(--uyaai-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.spec-table td:last-child { color: var(--uyaai-black); font-weight: 600; padding-left: 10px; }

/* =================================================================================
   6. RELATED PRODUCTS (相关产品滑动模块)
   ================================================================================= */
.uyaai-related-section { width: 100%; margin: 60px 0 20px 0; }

.related-scroll-wrapper { 
    display: flex; gap: 20px; overflow-x: auto; 
    scrollbar-width: none; -webkit-overflow-scrolling: touch; 
}
.related-scroll-wrapper::-webkit-scrollbar { display: none; }

.related-card { flex: 0 0 180px; text-align: center; }
.r-thumb { aspect-ratio: 1/1; border-radius: 8px; overflow: hidden; margin-bottom: 10px; border: 1px solid #eee; }
.r-thumb img { width: 100%; height: 100%; object-fit: cover; }
.r-series-tag { display: block; font-size: 9px; font-weight: 800; color: var(--uyaai-pink); margin-bottom: 4px; }
.r-cycle-label { display: block; font-size: 14px; font-weight: 700; color: var(--uyaai-black); }

/* =================================================================================
   7. MOBILE ADAPTATION (详情页移动端终极锁死)
   ================================================================================= */
@media (max-width: 768px) {
    .uyaai-col-info { flex: 1 0 100% !important; max-width: 100% !important; }
    
    /* 视频移动端位移微调 */
    .v-frame-box iframe { margin-top: -65% !important; }

    /* 购买区手机端不换行逻辑 */
    .u-buy-flex-wrapper { flex-wrap: nowrap !important; gap: 8px !important; }
    .u-main-qty-box { flex: 0 0 100px !important; width: 100px !important; }
    .btn-add-list { font-size: 14px !important; white-space: nowrap !important; }

    /* 信任栏手机端变更为淡绿卡片样式 */
    .uyaai-trust-bar { 
        flex-direction: column !important; 
        align-items: flex-start !important;
        background: #f0fff4 !important;
        padding: 15px !important; 
        border-radius: 8px; 
        margin: 20px 0 !important;
    }

    .spec-table td:first-child { width: 110px !important; }
    .related-card { flex: 0 0 145px !important; }
}