/* ============================================================
   产品详情页（view_product.htm）样式
   ============================================================ */

/* ---- CSS Variables ---- */
:root {
    --pd-primary: #2CAFDE;
    --pd-primary-dark: #1a8fb8;
    --pd-text: #333;
    --pd-muted: #888;
    --pd-border: #e5e5e5;
    --pd-bg: #f8f9fa;
    --pd-white: #fff;
    --pd-radius-sm: 6px;
    --pd-radius-md: 10px;
    --pd-shadow-sm: 0 2px 8px rgba(0,0,0,.06);
}

/* ---- 主容器 ---- */
.pd-wrap { padding: 40px 0 60px; }

/* ========== 顶部双列 ========== */
.pd-top-row {
    display: flex;
    gap: 36px;
    margin-bottom: 40px;
    align-items: flex-start;
}

/* --- 左列 Gallery --- */
.pd-gallery {
    flex: 1.5;                /* 比右列宽 50%，给图片/视频更大展示空间 */
    min-width: 0;
    background: var(--pd-white);
    border-radius: var(--pd-radius-md);
    padding: 20px;
    box-shadow: var(--pd-shadow-sm);
}
.pd-main-img {
    position: relative;
    background: var(--pd-bg);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 16px;
    min-height: 420px;        /* 与下面 img max-height 对齐，也给 iframe 更多高度 */
    display: flex;
    align-items: center;
    justify-content: center;
}
.pd-main-img img {
    max-width: 100%;
    max-height: 420px;
    z-index: 1;
    position: relative;
    object-fit: contain;
}
.pd-thumbs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 6px;
}
.pd-thumb-item {
    width: 72px;
    height: 72px;
    background: var(--pd-bg);
    border-radius: 6px;
    padding: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    flex-shrink: 0;
    transition: border-color .15s;
}
.pd-thumb-item.active,
.pd-thumb-item:hover { border-color: var(--pd-primary); }
.pd-thumb-item img { width: 100%; height: 100%; object-fit: contain; }

.pd-video-block {
    position: relative;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    min-height: 360px;
}
.pd-video-block video { width: 100%; height: 100%; }
.pd-video-block iframe { width: 100%; height: 100%; border: 0; }

/* YouTube / Vimeo 等嵌入视频的容器
   - 在隐藏的 .pd-video-block 中：保持 16:9（padding-top 技巧，兼容旧 Safari）
   - 在 .pd-main-img 中播放时：撑满整个 mainBox（iframe 自己处理画面比例） */
.pd-iframe-wrap {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 默认 16:9，仅在隐藏状态生效 */
}
/* 播放态 —— iframe-wrap 被 JS 插入 .pd-main-img 后，覆盖为铺满容器 */
.pd-main-img > .pd-iframe-wrap {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    padding-top: 0;
    width: 100%;
    height: 100%;
}
.pd-iframe-wrap iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    -webkit-transform: translateZ(0); /* Safari 硬件加速，避免滚动错位 */
            transform: translateZ(0);
}

/* --- 右列 Basic Info --- */
.pd-basic {
    flex: 1;
    min-width: 320px;
    background: var(--pd-white);
    border-radius: var(--pd-radius-md);
    padding: 28px 26px;
    box-shadow: var(--pd-shadow-sm);
}
.pd-badge {
    display: inline-block;
    background: #e8f6fb;
    color: var(--pd-primary-dark);
    font-size: 12px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 14px;
}
.pd-name {
    font-size: 26px;
    font-weight: 600;
    color: var(--pd-text);
    margin: 0 0 12px;
    line-height: 1.3;
}
.pd-tagline {
    font-size: 14px;
    color: var(--pd-muted);
    margin: 0 0 16px;
    line-height: 1.6;
}
.pd-model {
    font-size: 14px;
    color: var(--pd-text);
    font-weight: 500;
    margin-bottom: 16px;
}

.pd-quote-box {
    background: #f0f7fb;
    border-left: 3px solid var(--pd-primary);
    padding: 14px 16px;
    border-radius: 4px;
    margin-bottom: 22px;
}
.pd-quote-lead {
    font-size: 14px;
    font-weight: 600;
    color: var(--pd-primary-dark);
    margin-bottom: 4px;
}
.pd-quote-note {
    font-size: 13px;
    color: var(--pd-muted);
    line-height: 1.5;
}

/* ====== 通用参数列表（后台 product_custom_param 渲染） ====== */
.pd-spec-list {
    list-style: none;
    margin: 0 0 24px;
    padding: 0;
    border-top: 1px solid var(--pd-border);
}
.pd-spec-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid var(--pd-border);
    font-size: 14px;
    gap: 16px;
}
.pd-spec-row dt {
    color: var(--pd-muted);
    font-weight: 400;
    flex: 0 0 auto;
    min-width: 110px;
}
.pd-spec-row dd {
    color: var(--pd-text);
    font-weight: 500;
    margin: 0;
    text-align: right;
    word-break: break-word;
    flex: 1;
}

/* --- 按钮组 --- */
.pd-inquiry-box {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.pd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 26px;
    border-radius: var(--pd-radius-sm);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all .15s;
    white-space: nowrap;
}
.pd-btn-primary {
    background: var(--pd-primary);
    color: #fff;
    border-color: var(--pd-primary);
}
.pd-btn-primary:hover {
    background: var(--pd-primary-dark);
    border-color: var(--pd-primary-dark);
    color: #fff;
}
.pd-btn-outline {
    background: transparent;
    color: var(--pd-primary);
    border-color: var(--pd-primary);
}
.pd-btn-outline:hover {
    background: var(--pd-primary);
    color: #fff;
}
.pd-btn.watch_video i { margin-right: 6px; }

/* ========== 全宽 Section ========== */
.pd-section {
    background: var(--pd-white);
    border-radius: var(--pd-radius-md);
    padding: 28px 26px;
    margin-bottom: 28px;
    box-shadow: var(--pd-shadow-sm);
}
.pd-section-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--pd-text);
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--pd-border);
}

/* --- Key Features Grid --- */
.pd-features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.pd-features-grid--wide {
    grid-template-columns: repeat(4, 1fr);
}
.pd-feature-item {
    display: flex;
    gap: 12px;
    padding: 14px;
    background: var(--pd-bg);
    border-radius: 8px;
    align-items: flex-start;
}
.pd-feature-icon {
    width: 28px;
    height: 28px;
    background: var(--pd-primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}
.pd-feature-body strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--pd-text);
    margin-bottom: 4px;
}
.pd-feature-body span {
    font-size: 13px;
    color: var(--pd-muted);
    line-height: 1.5;
}

/* --- 富文本内容（content/cssx/oems/questions） --- */
.pd-rich-content {
    font-size: 14px;
    line-height: 1.7;
    color: var(--pd-text);
}
.pd-rich-content p { margin-bottom: 12px; }
.pd-rich-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}
.pd-rich-content table th,
.pd-rich-content table td {
    padding: 10px 14px;
    border: 1px solid var(--pd-border);
    text-align: left;
    font-size: 14px;
}
.pd-rich-content table th {
    background: var(--pd-bg);
    font-weight: 500;
}

/* --- Supports 表格：参照参考图样式（铺满宽度 + 整体居中 + 第一列左对齐其余居中） --- */
.pd-section-supports .pd-rich-content table {
    display: table;
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    table-layout: auto;
}
.pd-section-supports .pd-rich-content table th,
.pd-section-supports .pd-rich-content table td {
    vertical-align: middle;
}
/* 第一列：参照参考图 Product 列左对齐 */
.pd-section-supports .pd-rich-content table th:first-child,
.pd-section-supports .pd-rich-content table td:first-child {
    text-align: left;
}
/* 其余列：居中 */
.pd-section-supports .pd-rich-content table th:not(:first-child),
.pd-section-supports .pd-rich-content table td:not(:first-child) {
    text-align: center;
}

/* ========== Applications 应用场景 ========== */
/* 覆盖后台 h2 内联样式 */
.pd-app-wrap h2,
.pd-section-applications .pd-app-wrap h2 {
    color: var(--pd-primary-dark) !important;
    font-size: 20px !important;
    font-weight: 600 !important;
    border-bottom: none !important;
    padding-bottom: 0 !important;
    margin-bottom: 8px !important;
}
.pd-app-wrap p {
    color: var(--pd-muted) !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
    margin-bottom: 20px !important;
}
/* apps-grid：后台富文本编辑器生成的网格容器，带内联样式需 !important 覆盖 */
.pd-app-wrap .apps-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 14px !important;
    margin: 0 !important;
}
/* JS 重构后的 app-item 卡片 */
.pd-app-wrap .apps-grid .app-card {
    background: var(--pd-white) !important;
    border: 1px solid var(--pd-border) !important;
    border-radius: var(--pd-radius-sm) !important;
    padding: 16px 18px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: var(--pd-text) !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    cursor: pointer !important;
    transition: all .15s !important;
    line-height: 1.5 !important;
    font-family: inherit !important;
    white-space: normal !important;
}
.pd-app-wrap .apps-grid .app-card:hover {
    border-color: var(--pd-primary) !important;
    background: #f0f7fb !important;
    color: var(--pd-primary-dark) !important;
}
/* app-card 内的 Font Awesome 箭头图标 */
.pd-app-wrap .apps-grid .app-card i,
.pd-app-wrap .apps-grid .app-card .fas,
.pd-app-wrap .apps-grid .app-card [class*="fa-"] {
    color: var(--pd-primary) !important;
    font-weight: bold !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: content-box !important;
}

/* ========== Downloads 下载 ========== */
/* 覆盖后台 h2 内联样式 */
.pd-download-wrap h2 {
    color: var(--pd-primary-dark) !important;
    font-size: 20px !important;
    font-weight: 600 !important;
    border-bottom: none !important;
    padding-bottom: 0 !important;
    margin-bottom: 16px !important;
}
/* 后台 <p><a> 的 p 去掉默认边距 */
.pd-download-wrap > p {
    margin: 0 !important;
    padding: 0 !important;
}
/* JS 重构后的按钮列表容器 */
.pd-download-wrap .pd-download-list {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin: 0 !important;
    padding: 0 !important;
}
/* 下载按钮（保留后台原始 href，覆盖内联样式） */
.pd-download-wrap a {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px;
    padding: 12px 22px;
    border: 1px solid var(--pd-primary) !important;
    border-radius: var(--pd-radius-sm);
    background: var(--pd-white) !important;
    color: var(--pd-primary) !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    font-family: inherit !important;
    text-decoration: none !important;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
    line-height: 1.5 !important;
}
.pd-download-wrap a:hover {
    background: var(--pd-primary) !important;
    color: #fff !important;
}
/* 按钮内的 File/PDF 图标 */
.pd-download-wrap a .fa-file-pdf,
.pd-download-wrap a .fa-file,
.pd-download-wrap a [class*="fa-"] {
    font-size: 16px !important;
    color: inherit !important;
    flex-shrink: 0;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: content-box !important;
}

/* ========== Related Products ========== */
.pd-related {
    margin-bottom: 20px;
}
.pd-related-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--pd-text);
    margin: 0 0 20px;
}
.pd-related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.pd-related-card {
    background: var(--pd-white);
    border-radius: var(--pd-radius-md);
    overflow: hidden;
    box-shadow: var(--pd-shadow-sm);
    transition: transform .15s, box-shadow .15s;
}
.pd-related-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,.1);
}
.pd-related-img {
    height: 180px;
    background: var(--pd-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.pd-related-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.pd-related-info { padding: 14px; }
.pd-related-cat {
    font-size: 12px;
    color: var(--pd-primary-dark);
    font-weight: 500;
    margin-bottom: 6px;
}
.pd-related-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--pd-text);
    margin-bottom: 10px;
    line-height: 1.4;
    min-height: 38px;
}
.pd-related-more {
    padding: 7px 14px;
    font-size: 12px;
}

/* ========== 响应式 ========== */
@media (max-width: 992px) {
    .pd-top-row { flex-direction: column; gap: 24px; }
    .pd-gallery,
    .pd-basic { min-width: 0; width: 100%; }
    .pd-features-grid--wide { grid-template-columns: repeat(2, 1fr); }
    .pd-app-wrap .apps-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .pd-related-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}

@media (max-width: 768px) {
    .pd-wrap { padding: 24px 0 40px; }
    .pd-wrap .container { padding: 0 14px; }
    .pd-top-row { gap: 16px; margin-bottom: 24px; }
    .pd-gallery { padding: 16px; }
    .pd-main-img { min-height: 280px; }
    .pd-main-img img { max-height: 300px; }

    .pd-basic { padding: 22px; border-radius: 10px; }
    .pd-badge { font-size: 11px; padding: 3px 10px; }
    .pd-name { font-size: 22px; }
    .pd-tagline { font-size: 14px; }
    .pd-quote-box { padding: 12px 14px; margin-bottom: 18px; }

    .pd-spec-row { padding: 10px 0; font-size: 13px; gap: 10px; }
    .pd-spec-row dt { min-width: 85px; font-size: 13px; }
    .pd-spec-row dd { font-size: 13px; }

    .pd-inquiry-box { flex-direction: column; gap: 10px; }
    .pd-btn { width: 100%; }

    .pd-section { padding: 22px 18px; border-radius: 10px; }
    .pd-section-title { font-size: 18px; margin-bottom: 16px; }

    .pd-features-grid { grid-template-columns: 1fr; }
    .pd-features-grid--wide { grid-template-columns: 1fr; }

    .pd-app-wrap .apps-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
    .pd-app-wrap .apps-grid .app-card { padding: 12px 14px !important; font-size: 13px !important; }

    .pd-download-wrap .pd-download-list { flex-direction: column; gap: 10px; }
    .pd-download-wrap a { width: 100%; padding: 12px 18px; font-size: 13px; }

    .pd-related-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .pd-related-img { height: 140px; }
    .pd-related-title { font-size: 18px; }

    /* Supports 表格：移动端转为横向滚动块 */
    .pd-section-supports .pd-rich-content table {
        width: 100% !important;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
    .pd-section-supports .pd-rich-content table th,
    .pd-section-supports .pd-rich-content table td {
        word-break: break-word;
        overflow-wrap: break-word;
        -webkit-hyphens: auto;
        hyphens: auto;
    }
}

@media (max-width: 480px) {
    .pd-name { font-size: 18px; }
    .pd-thumb-item { width: 60px; height: 60px; }
    .pd-app-wrap .apps-grid { grid-template-columns: 1fr !important; }
    .pd-related-img { height: 120px; }

    /* Supports 表格：小屏压缩单元格内边距 */
    .pd-section-supports .pd-rich-content table th,
    .pd-section-supports .pd-rich-content table td {
        padding: 8px !important;
        font-size: 13px;
    }
}
