﻿/* ── Product Detail Page - Professional Two-Column Layout ───────────────── */
/* Main container override for product detail */
.product-detail-container {
    max-width: 1320px;
    margin: 24px auto 80px;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
}

@media (max-width: 992px) {
    .product-detail-container {
        grid-template-columns: 1fr;
    }
}

/* ── Skeleton + Fade-in ── */
.skeleton-box {
    background: linear-gradient(90deg, #e2e8f0 25%, #f0f4f8 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    display: block;
}
@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.content-fade-in {
    animation: contentFadeIn .35s ease both;
}
@keyframes contentFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Left Column - Main Content */
.product-main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Product Header Card */
.product-header-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
}

@media (max-width: 768px) {
    .product-header-card {
        grid-template-columns: 1fr;
    }
}

/* Product Image */
.product-image-wrap {
    background: var(--bg-light);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.product-main-img {
    max-width: 100%;
    max-height: 240px;
    object-fit: contain;
    border-radius: var(--radius);
}

.product-image-placeholder {
    font-size: 80px;
    color: #94a3b8;
}

/* Product Info */
.product-info-wrap {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.product-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.4;
    margin: 0;
}

.product-model-highlight {
    color: #f97316;
}

.product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}

.product-model {
    font-size: 13px;
    color: var(--text-muted);
    background: var(--bg-light);
    padding: 4px 12px;
    border-radius: 20px;
    font-family: 'Courier New', monospace;
}

.product-manufacturer,
.product-package {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

.product-manufacturer i,
.product-package i {
    color: var(--accent);
    font-size: 12px;
}

.product-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}

    .product-category-badge:hover {
        color: var(--accent);
    }

.product-short-desc {
    font-size: 14px;
    color: #374151;
    line-height: 1.6;
    padding: 12px;
    background: #f8fafc;
    border-radius: var(--radius);
    border-left: 3px solid var(--accent);
}

/* Product Specification Table */
.product-spec-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin: 4px 0;
}

.product-spec-table th,
.product-spec-table td {
    padding: 8px 12px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid #f0f2f5;
}

.product-spec-table th {
    width: 130px;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
    background: #f8fafc;
}

.product-spec-table td {
    color: #374151;
}

.product-spec-table tr:last-child th,
.product-spec-table tr:last-child td {
    border-bottom: none;
}

.product-spec-table tr:hover th,
.product-spec-table tr:hover td {
    background: #f1f5f9;
}

.spec-datasheet-link {
    display: inline;
    color: #dc2626;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}

.spec-datasheet-link:hover {
    color: #b91c1c;
    text-decoration: underline;
}

.spec-datasheet-link i {
    font-size: 14px;
}

/* ── Manufacturer link in spec table ── */
.spec-manufacturer-link {
    display: inline;
    color: inherit;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}
.spec-manufacturer-link:hover {
    color: #f97316;
    text-decoration: underline;
}

/* ── SSR: render skybiaoge list-group as 2-col key-value grid ── */
.prod-desc-rendered .skybiaoge .list-group {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
    border: 1px solid #e2e8f0;
}

.prod-desc-rendered .skybiaoge .list-group-item {
    width: 50%;
    display: flex;
    flex-direction: row;
    padding: 0;
    border: none;
    border-bottom: 1px solid #e2e8f0;
    box-sizing: border-box;
}

.prod-desc-rendered .skybiaoge .list-group-item:nth-child(odd) {
    border-right: 1px solid #e2e8f0;
}

.prod-desc-rendered .skybiaoge .list-group-item .col-lg-3,
.prod-desc-rendered .skybiaoge .list-group-item .col-md-3 {
    width: 40%;
    font-weight: 600;
    color: #64748b;
    background: #f8fafc;
    padding: 6px 8px 6px 12px;
    flex-shrink: 0;
}

.prod-desc-rendered .skybiaoge .list-group-item .col-lg-9,
.prod-desc-rendered .skybiaoge .list-group-item .col-md-9 {
    width: 60%;
    color: #374151;
    padding: 6px 12px 6px 8px;
}

.prod-desc-rendered .skybiaoge .list-group-item .clear {
    display: none;
}

/* SSR: original tables render as-is but with consistent borders */
.prod-desc-rendered table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    border: 1px solid #e2e8f0;
}

.prod-desc-rendered table th,
.prod-desc-rendered table td {
    padding: 6px 12px;
    text-align: left;
    border: 1px solid #e2e8f0;
}

/* Product Detail Table: 2 properties per row = 4 cells (th+td) × 2 */
.product-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 8px;
    table-layout: fixed;
    border: 1px solid #e2e8f0;
}

.product-detail-table th.detail-label {
    width: 25%;
    font-weight: 600;
    color: #64748b;
    background: #f8fafc;
    padding: 6px 8px 6px 12px;
    text-align: left;
    vertical-align: top;
    border: 1px solid #e2e8f0;
}

.product-detail-table td.detail-value {
    width: 25%;
    color: #374151;
    padding: 6px 12px 6px 8px;
    text-align: left;
    vertical-align: top;
    border: 1px solid #e2e8f0;
}

/* Divider between the 2 property columns */
.product-detail-table th.detail-label:nth-child(3) {
    border-left: 2px solid #cbd5e1;
}

.product-detail-table td.detail-value:nth-child(2) {
    border-right: 2px solid #cbd5e1;
}

.product-detail-table tr:hover th.detail-label,
.product-detail-table tr:hover td.detail-value {
    background: #f1f5f9;
}

.product-detail-table tr:hover th.detail-label {
    background: #e8edf5;
}

.product-actions {
    margin-top: auto;
    display: flex;
    gap: 12px;
}

.btn-quote {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

    .btn-quote:hover {
        background: var(--accent-hover);
        transform: translateY(-1px);
    }

/* RFQ button - matches category listing style */
.btn-rfq {
    display: inline-block;
    background: #e94560;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 10px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

    .btn-rfq:hover {
        background: #c73652;
        color: #fff;
        transform: translateY(-1px);
    }

    .btn-rfq:active {
        transform: translateY(0);
    }

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--border);
    padding: 12px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

    .btn-outline:hover {
        background: var(--bg-light);
        border-color: var(--primary);
    }

/* Product Details Section */
.product-details-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.details-header {
    background: var(--bg-light);
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

    .details-header i {
        color: var(--accent);
        font-size: 16px;
    }

    .details-header h2 {
        font-size: 15px;
        font-weight: 700;
        color: var(--text-dark);
        margin: 0;
    }

.details-body {
    padding: 20px;
}

/* Right Column - Sidebar */
.product-sidebar {
    display: flex;
    flex-direction: column;
}

.sidebar-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.sidebar-header {
    background: var(--bg-light);
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

    .sidebar-header i {
        color: var(--accent);
    }

.sidebar-body {
    padding: 16px;
}

/* Quick Contact */
.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

    .contact-item:last-child {
        border-bottom: none;
    }

.contact-icon {
    width: 36px;
    height: 36px;
    background: var(--bg-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 14px;
    flex-shrink: 0;
}

.contact-info {
    flex: 1;
}

.contact-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.contact-value {
    font-size: 13px;
    color: var(--text-dark);
    font-weight: 500;
}

/* Related Products */
.related-product {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: background var(--transition);
}

    .related-product:last-child {
        border-bottom: none;
    }

    .related-product:hover {
        background: var(--bg-light);
        margin: 0 -16px;
        padding-left: 16px;
        padding-right: 16px;
    }

.related-img {
    width: 60px;
    height: 60px;
    background: var(--bg-light);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

    .related-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: var(--radius);
    }

.related-info {
    flex: 1;
    min-width: 0;
}

.related-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 4px;
}

.related-field {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Datasheet Section */
.datasheet-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.datasheet-header {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.datasheet-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.datasheet-header i {
    font-size: 18px;
}

.datasheet-body {
    padding: 16px;
}

.datasheet-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius);
    color: #dc2626;
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition);
}

.datasheet-link:hover {
    background: #fee2e2;
    border-color: #f87171;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.15);
}

.datasheet-link i {
    font-size: 20px;
}

.datasheet-size {
    font-size: 12px;
    color: #999;
    font-weight: normal;
}

/* FAQ Section */
.faq-section {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.faq-header {
    background: var(--bg-light);
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

    .faq-header i {
        color: var(--accent);
    }

    .faq-header h3 {
        font-size: 15px;
        font-weight: 700;
        color: var(--text-dark);
        margin: 0;
    }

.faq-list {
    padding: 8px 0;
}

.faq-item {
    border-bottom: 1px solid var(--border);
}

    .faq-item:last-child {
        border-bottom: none;
    }

.faq-question {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    cursor: pointer;
    user-select: none;
    transition: background var(--transition);
}

    .faq-question:hover {
        background: var(--bg-light);
    }

.faq-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.faq-item.open .faq-num {
    background: var(--accent);
}

.faq-q-text {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.faq-toggle {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 12px;
    transition: transform .3s ease, color var(--transition);
    flex-shrink: 0;
}

.faq-item.open .faq-toggle {
    transform: rotate(180deg);
    color: var(--accent);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s ease, padding .35s ease;
}

.faq-item.open .faq-answer {
    max-height: 400px;
}

.faq-answer-inner {
    padding: 0 20px 16px 56px;
    font-size: 13px;
    color: #374151;
    line-height: 1.7;
}

/* ── Inquiry Modal ───────────────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

    .modal-overlay.active {
        display: flex;
    }

.modal-box {
    background: #fff;
    border-radius: 10px;
    width: 100%;
    max-width: 860px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    animation: modalIn .25s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(.97);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.modal-header {
    padding: 18px 36px 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
    border-radius: 10px 10px 0 0;
}

    .modal-header h2 {
        font-size: 16px;
        font-weight: 700;
        color: var(--text-dark);
        display: flex;
        align-items: center;
        gap: 10px;
        line-height: 1;
    }

        .modal-header h2::before {
            content: '';
            display: block;
            width: 4px;
            height: 16px;
            background: var(--accent);
            border-radius: 2px;
            flex-shrink: 0;
        }

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    border-radius: 4px;
    transition: all var(--transition);
}

    .modal-close:hover {
        color: var(--accent);
        background: #fef2f2;
    }

.modal-body {
    padding: 24px 36px;
}

/* ── 弹窗表头行（rfq 风格） ── */
.modal-table-header {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1.4fr 0.7fr 1.2fr auto;
    gap: 10px;
    align-items: center;
    border-bottom: 2px solid #eaeef2;
    padding-bottom: 12px;
    margin-bottom: 0;
    font-weight: 700;
    font-size: 10.5px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .4px;
    white-space: nowrap;
}

/* ── 弹窗数据行（rfq 风格） ── */
.modal-item-row {
    display: grid;
    grid-template-columns: 2fr 1fr 2fr 0.8fr 1.2fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f2f5;
    transition: border-color 0.3s, box-shadow 0.3s;
}

/* 新增行红色边框动画 */
.modal-item-row.row-new {
    border: 2px solid #e94560;
    border-radius: 6px;
    padding: 8px 4px;
    box-shadow: 0 0 0 2px rgba(233, 69, 96, 0.15);
    animation: modalNewRowFade 3s ease forwards;
}
@keyframes modalNewRowFade {
    0%, 70% { border-color: #e94560; box-shadow: 0 0 0 2px rgba(233, 69, 96, 0.15); }
    100% { border-color: transparent; border-width: 0; box-shadow: none; padding: 10px 0; border-bottom: 1px solid #f0f2f5; }
}

    .modal-item-row .form-input,
    .modal-item-row input {
        margin: 0;
        font-size: 13px;
        padding: 10px 14px;
        border: 1px solid var(--border);
        border-radius: 6px;
        outline: none;
        transition: border-color var(--transition), box-shadow var(--transition);
        font-family: inherit;
        color: var(--text-dark);
        background: #fff;
        width: 100%;
    }

    .modal-item-row .form-input:focus,
    .modal-item-row input:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(15,23,42,.08);
    }

    .modal-item-row input[readonly] {
        background: #f8f9fc;
        color: #64748b;
        cursor: default;
        font-weight: 600;
    }

/* ── 弹窗删除按钮（与 cart.css 一致） ── */
.modal-item-row .btn-remove-item {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1.5px solid #f0f2f5;
    background: #fff;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
    flex-shrink: 0;
    font-size: 13px;
}

    .modal-item-row .btn-remove-item:hover {
        border-color: #e94560;
        color: #e94560;
        background: #fff1f3;
    }

/* ── 弹窗表单区域 ── */
#cart-form-wrap {
    padding: 24px 36px;
}

/* ── Add Part 按钮 ── */
#cart-form-wrap .btn-add-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f8f9fc;
    border: 1.5px dashed #c8d6e8;
    color: #0f3460;
    font-size: 13px;
    font-weight: 600;
    padding: 9px 18px;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 12px;
    transition: all .15s;
}

#cart-form-wrap .btn-add-row:hover {
    border-color: #0f3460;
    background: #eef2ff;
}

.modal-product-hint {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

    .modal-product-hint strong {
        color: var(--text-dark);
    }

.inquiry-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}

    .form-row.full {
        grid-template-columns: 1fr;
    }

.field-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

    .field-group label {
        font-size: 12px;
        font-weight: 600;
        color: var(--text-dark);
    }

        .field-group label .req {
            color: var(--accent);
            margin-left: 2px;
        }

    .field-group input,
    .field-group select,
    .field-group textarea {
        width: 100%;
        padding: 9px 12px;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        font-size: 13px;
        color: var(--text-dark);
        background: #fff;
        outline: none;
        transition: border-color var(--transition), box-shadow var(--transition);
        font-family: inherit;
    }

        .field-group input:focus,
        .field-group select:focus,
        .field-group textarea:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(15,23,42,.08);
        }

        .field-group input.error,
        .field-group select.error,
        .field-group textarea.error {
            border-color: var(--accent);
            box-shadow: 0 0 0 3px rgba(220,38,38,.08);
        }

.field-error {
    font-size: 11px;
    color: var(--accent);
    min-height: 14px;
}

.field-group textarea {
    resize: vertical;
    min-height: 90px;
}

.field-group select {
    appearance: none;
    cursor: pointer;
}

.select-wrap {
    position: relative;
}

    .select-wrap::after {
        content: '\f078';
        font-family: 'Font Awesome 6 Free';
        font-weight: 900;
        font-size: 10px;
        color: var(--text-muted);
        position: absolute;
        right: 12px;
        top: 50%;
        transform: translateY(-50%);
        pointer-events: none;
    }

.modal-footer {
    padding: 14px 0 0;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-cancel {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

    .btn-cancel:hover {
        background: var(--bg-light);
        color: var(--text-dark);
    }

.btn-submit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

    .btn-submit:hover {
        background: var(--accent-hover);
    }

    .btn-submit:disabled {
        opacity: .6;
        cursor: not-allowed;
    }

.modal-success {
    text-align: center;
    padding: 40px 36px;
    display: none;
}

    .modal-success.active {
        display: block;
    }

    .modal-success .success-icon {
        width: 64px;
        height: 64px;
        background: #f0fdf4;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 28px;
        color: #16a34a;
        margin: 0 auto 16px;
    }

    .modal-success h3 {
        font-size: 18px;
        font-weight: 700;
        color: var(--text-dark);
        margin-bottom: 8px;
    }

    .modal-success p {
        font-size: 13px;
        color: var(--text-muted);
        line-height: 1.6;
    }

/* ── Rich HTML Content ──────────────────────────────────── */
.rich-html-content {
    line-height: 1.7;
    color: var(--text-dark);
    font-size: 14px;
    word-break: break-word;
    overflow-wrap: anywhere;
}

    .rich-html-content p {
        margin: 0 0 10px;
    }

        .rich-html-content p:last-child {
            margin-bottom: 0;
        }

    .rich-html-content h1,
    .rich-html-content h2,
    .rich-html-content h3,
    .rich-html-content h4 {
        font-weight: 700;
        color: var(--text-dark);
        margin: 16px 0 10px;
        line-height: 1.3;
    }

    .rich-html-content h1 {
        font-size: 18px;
    }

    .rich-html-content h2 {
        font-size: 16px;
    }

    .rich-html-content h3 {
        font-size: 15px;
    }

    .rich-html-content h4 {
        font-size: 14px;
    }

    .rich-html-content ul,
    .rich-html-content ol {
        padding-left: 20px;
        margin: 8px 0 12px;
    }

    .rich-html-content li {
        margin-bottom: 4px;
    }

    .rich-html-content table {
        width: 100%;
        border-collapse: collapse;
        font-size: 13px;
        margin: 12px 0;
    }

        .rich-html-content table th,
        .rich-html-content table td {
            border: 1px solid #e5e7eb;
            padding: 8px 12px;
            text-align: left;
            vertical-align: top;
        }

        .rich-html-content table th {
            background: #f8fafc;
            font-weight: 600;
            color: #374151;
        }

        .rich-html-content table tr:nth-child(even) td {
            background: #fafbfc;
        }

    .rich-html-content img {
        max-width: 100%;
        height: auto;
        border-radius: 4px;
        margin: 8px 0;
    }

    .rich-html-content strong,
    .rich-html-content b {
        font-weight: 600;
        color: inherit;
    }

    .rich-html-content code {
        background: #f1f5f9;
        padding: 2px 6px;
        border-radius: 3px;
        font-family: 'Courier New', monospace;
        font-size: 12px;
        color: #0f172a;
    }

    .rich-html-content hr {
        border: none;
        border-top: 1px solid #e5e7eb;
        margin: 16px 0;
    }

    .rich-html-content a {
        color: var(--primary);
        text-decoration: none;
    }

        .rich-html-content a:hover {
            color: var(--accent);
            text-decoration: underline;
        }

@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .faq-answer-inner {
        padding-left: 20px;
    }

    .faq-question {
        padding: 12px 16px;
    }

    .faq-answer-inner {
        padding: 0 16px 12px 16px;
    }

    .faq-header {
        padding: 12px 16px;
    }
}



/* Cart modal: rfq.html Part Requirements style */
.modal-table-header {
    display: grid;
    grid-template-columns: 2fr 1fr 2fr 0.8fr 1.2fr auto;
    gap: 10px;
    padding-bottom: 12px;
    align-items: center;
    border-bottom: 2px solid #eaeef2;
    font-weight: 700;
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .5px;
    white-space: nowrap;
}

    .modal-table-header span {
        padding-left: 0;
    }

.modal-item-row {
    display: grid;
    grid-template-columns: 2fr 1fr 2fr 0.8fr 1.2fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f2f5;
    transition: border-color 0.3s, box-shadow 0.3s;
}
    /* 新增行红色边框动画 */
    .modal-item-row.row-new {
        border: 2px solid #e94560;
        border-radius: 6px;
        padding: 8px 4px;
        box-shadow: 0 0 0 2px rgba(233, 69, 96, 0.15);
        animation: modalNewRowFade 3s ease forwards;
    }

@keyframes modalNewRowFade {
    0%, 70% {
        border-color: #e94560;
        box-shadow: 0 0 0 2px rgba(233, 69, 96, 0.15);
    }

    100% {
        border-color: transparent;
        border-width: 0;
        box-shadow: none;
        padding: 10px 0;
        border-bottom: 1px solid #f0f2f5;
    }
}

.modal-item-row .form-input,
.modal-item-row .cart-input {
    margin: 0;
    font-size: 13px;
    padding: 9px 12px;
    border-radius: 6px;
    box-sizing: border-box;
    border: 1px solid #e2e8f0;
    width: 100%;
}

    .modal-item-row .form-input[readonly],
    .modal-item-row .cart-input[readonly] {
        background: #f8f9fc;
        color: #64748b;
        cursor: default;
    }

.btn-remove-item {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1.5px solid #f0f2f5;
    background: #fff;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
    flex-shrink: 0;
}

    .btn-remove-item:hover {
        border-color: #e94560;
        color: #e94560;
        background: #fff1f3;
    }

.btn-add-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f8f9fc;
    border: 1.5px dashed #c8d6e8;
    color: #0f3460;
    font-size: 13px;
    font-weight: 600;
    padding: 9px 18px;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 12px;
    transition: all .15s;
}

    .btn-add-row:hover {
        border-color: #0f3460;
        background: #eef2ff;
    }