/**
 * Prime Freight Net - Incoterms Executive Knowledge Engine Styles v3.0
 * Features: Mobile Step-Card Engine, Luxury Trust Strip, Clean Typography
 * Performance: 0ms TBT, Zero Layout Shift
 */

/* ==========================================================================
   1. GLOBAL SYSTEM RESET & SAFETY
   ========================================================================== */
/* 强制使用设备原生系统字体，杜绝网络字体下载阻塞与 CLS 布局偏移 */
/* 移除通用选择器，避免触发全局 DOM 重排与图标损毁 */
.pfn-incoterm-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1e293b;
    background: #f8fafc;
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    width: 100%;
    max-width: 100vw;
    overflow-x: clip;
}
.pfn-inco-container {
    max-width: 1220px;
    margin: 0 auto;
    padding: 0 18px;
    box-sizing: border-box;
}

/* ==========================================================================
   2. HERO BANNER
   ========================================================================== */
.pfn-inco-hero {
    background: radial-gradient(circle at 85% 20%, rgba(37, 99, 235, 0.22) 0%, transparent 50%),
                linear-gradient(135deg, #091428 0%, #0f274a 100%);
    color: #ffffff;
    padding: 38px 0 32px;
    border-bottom: 3px solid #f97316;
}

.pfn-inco-breadcrumb {
    font-size: 0.82rem;
    color: #94a3b8;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.pfn-inco-breadcrumb a {
    color: #93c5fd;
    text-decoration: none;
    transition: color 0.2s ease;
}

.pfn-inco-breadcrumb a:hover {
    color: #ffffff;
}

.pfn-inco-badge-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.pfn-term-pill {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.84rem;
    padding: 3px 10px;
    border-radius: 6px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    box-shadow: 0 2px 6px rgba(249, 115, 22, 0.3);
}

.pfn-category-pill {
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    font-size: 0.76rem;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.pfn-inco-hero h1 {
    font-size: clamp(1.4rem, 3.8vw, 2.3rem);
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 12px;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.pfn-inco-lead {
    font-size: clamp(0.9rem, 1.8vw, 1.02rem);
    color: #cbd5e1;
    max-width: 860px;
    margin: 0;
    line-height: 1.6;
}

/* ==========================================================================
   3. TRUST STATS STRIP (与国家页一致的数据矩阵)
   ========================================================================== */
.pfn-inco-trust-strip {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 16px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.pfn-trust-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.pfn-trust-box {
    display: flex;
    flex-direction: column;
    border-right: 1px solid #f1f5f9;
    padding-right: 12px;
}

.pfn-trust-box:last-child {
    border-right: none;
}

.pfn-trust-label {
    font-size: 0.72rem;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}

.pfn-trust-val {
    font-size: 0.92rem;
    color: #0f172a;
    font-weight: 700;
    line-height: 1.35;
}

.val-orange {
    color: #ea580c;
}

/* ==========================================================================
   4. LAYOUT & SIDEBAR
   ========================================================================== */
.pfn-inco-main-grid {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 32px;
    padding: 36px 0 60px;
}

.pfn-inco-sidebar {
    position: relative;
    min-width: 0;
}

.pfn-sticky-toc-box {
    position: sticky;
    top: 90px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px 20px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.03);
}

.pfn-toc-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.pfn-toc-title::-webkit-details-marker {
    display: none;
}

.pfn-toc-arrow {
    font-size: 0.8rem;
    color: #94a3b8;
    transition: transform 0.2s ease;
}

details[open] .pfn-toc-arrow {
    transform: rotate(180deg);
}

.pfn-toc-list {
    list-style: none;
    margin: 14px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: calc(100vh - 350px);
    overflow-y: auto;
}

.pfn-toc-list a {
    color: #475569;
    text-decoration: none;
    font-size: 0.84rem;
    line-height: 1.45;
    padding: 6px 10px;
    border-left: 2px solid #e2e8f0;
    display: block;
    border-radius: 0 6px 6px 0;
    transition: all 0.2s ease;
}

.pfn-toc-list a:hover {
    color: #2563eb;
    background: #eff6ff;
    border-left-color: #2563eb;
    padding-left: 12px;
}

.pfn-sidebar-cta {
    margin-top: 20px;
    padding: 16px;
    background: linear-gradient(135deg, #f0fdf4 0%, #eff6ff 100%);
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    text-align: center;
}

.pfn-sidebar-cta h4 {
    margin: 0 0 6px;
    font-size: 0.9rem;
    color: #1e3a8a;
    font-weight: 700;
}

.pfn-sidebar-cta p {
    font-size: 0.78rem;
    color: #64748b;
    margin: 0 0 10px;
    line-height: 1.45;
}

.btn-sidebar-inquiry {
    display: block;
    width: 100%;
    padding: 8px 12px;
    background: #f97316;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.82rem;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.btn-sidebar-inquiry:hover {
    background: #ea580c;
    color: #ffffff;
}

/* ==========================================================================
   5. QUICK SPEC CARD & 移动端卡片流
   ========================================================================== */
.pfn-quick-spec-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 22px 24px;
    margin-bottom: 30px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
    border-left: 4px solid #2563eb;
}

.pfn-spec-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.pfn-spec-header i {
    font-size: 1.15rem;
    color: #2563eb;
}

.pfn-spec-header h3 {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    font-size: 1.08rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
}

.pfn-spec-pro-tip {
    font-size: 0.92rem;
    color: #475569;
    line-height: 1.65;
    margin: 0 0 16px !important;
}

/* 移动端 6 步卡片流 */
.pfn-mobile-step-cards {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed #cbd5e1;
}

.pfn-step-flow-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #1e3a8a;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 10px;
}

.pfn-step-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.pfn-step-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.step-name {
    font-size: 0.8rem;
    color: #334155;
    font-weight: 600;
}

.step-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}

/* ==========================================================================
   6. ARTICLE BODY & EDITORIAL STYLES
   ========================================================================== */
.pfn-inco-article-body {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 34px 40px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.03);
    min-width: 0;
    max-width: 100%;
}

.pfn-inco-article-body h2,
.pfn-inco-article-body h3 {
    color: #0f172a;
    font-weight: 750;
    margin-top: 32px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
    scroll-margin-top: 100px;
    font-size: 1.28rem;
}

.pfn-inco-article-body h4 {
    color: #1e293b;
    font-weight: 650;
    margin-top: 20px;
    margin-bottom: 8px;
    font-size: 1.05rem;
}

.pfn-inco-article-body p {
    margin-bottom: 16px;
    font-size: 0.96rem;
    color: #334155;
    line-height: 1.8;
}

.pfn-inco-article-body ul,
.pfn-inco-article-body ol {
    margin-bottom: 20px;
    padding-left: 18px;
}

.pfn-inco-article-body li {
    margin-bottom: 6px;
    color: #334155;
}

.pfn-inco-article-body strong {
    color: #0f172a;
}

/* ==========================================================================
   7. MATRIX TABLE (桌面端对比大表)
   ========================================================================== */
.pfn-matrix-table-wrap {
    margin-top: 40px;
    padding-top: 25px;
    border-top: 2px solid #f1f5f9;
    max-width: 100%;
}

.pfn-section-title {
    margin: 0 0 6px !important;
    padding: 0 !important;
    border: none !important;
    font-size: 1.2rem !important;
}

.pfn-section-sub {
    font-size: 0.86rem;
    color: #64748b;
    margin-bottom: 12px;
}

.pfn-table-responsive {
    overflow-x: auto;
    max-width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    -webkit-overflow-scrolling: touch;
}

.pfn-inco-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.84rem;
    text-align: center;
}

.pfn-inco-table th {
    background: #0f172a;
    color: #ffffff;
    padding: 10px 8px;
    font-weight: 600;
    white-space: nowrap;
}

.pfn-inco-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #f1f5f9;
    white-space: nowrap;
}

.pfn-inco-table th:first-child,
.pfn-inco-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    text-align: left;
    padding-left: 14px;
    background: #ffffff;
    box-shadow: 2px 0 5px rgba(0,0,0,0.04);
}

.pfn-inco-table th:first-child {
    background: #0f172a;
    z-index: 3;
}

.pfn-inco-table tr.current-row td {
    background: #fff7ed;
}

.pfn-inco-table tr.current-row td:first-child {
    background: #fff7ed;
    border-left: 4px solid #f97316;
}

.badge-seller {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    background: #dcfce7;
    color: #15803d;
    font-weight: 700;
    font-size: 0.74rem;
}

.badge-buyer {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    background: #e0f2fe;
    color: #0369a1;
    font-weight: 700;
    font-size: 0.74rem;
}

/* ==========================================================================
   8. 9 INCOTERMS MATRIX & BOTTOM CTA
   ========================================================================== */
.pfn-matrix-section {
    margin-top: 40px;
    padding-top: 25px;
    border-top: 2px solid #f1f5f9;
}

.pfn-matrix-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
    margin-top: 14px;
}

.pfn-matrix-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    text-decoration: none;
    color: #1e293b;
    display: flex;
    flex-direction: column;
    gap: 2px;
    transition: all 0.2s ease;
}

.pfn-matrix-card:hover {
    background: #ffffff;
    border-color: #2563eb;
    transform: translateY(-2px);
}

.pfn-matrix-card.active-term {
    background: #fff7ed;
    border-color: #f97316;
}

.pfn-matrix-code {
    font-weight: 800;
    color: #2563eb;
    font-size: 0.95rem;
}

.pfn-matrix-card.active-term .pfn-matrix-code {
    color: #ea580c;
}

.pfn-matrix-title {
    font-size: 0.78rem;
    color: #64748b;
}

/* 8. 底部 CTA 横幅与按钮 (增强盒子模型与垂直居中) */
.pfn-bottom-inquiry-banner {
    margin-top: 40px;
    padding: 26px 28px;
    background: linear-gradient(135deg, #091428 0%, #1e3a8a 100%);
    border-radius: 12px;
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    box-sizing: border-box;
}

.pfn-bottom-cta-txt h3 {
    margin: 0 0 4px !important;
    font-size: 1.18rem !important;
    color: #ffffff !important;
    border: none !important;
    padding: 0 !important;
}

.pfn-bottom-cta-txt p {
    margin: 0 !important;
    color: #cbd5e1 !important;
    font-size: 0.88rem !important;
}

.btn-bottom-quote {
    padding: 12px 24px;
    background: #f97316;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.9rem;
    border-radius: 8px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    box-sizing: border-box; /* 关键：锁定边框盒子，禁止向外撑破 */
    transition: background 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.btn-bottom-quote:hover {
    background: #ea580c;
    color: #ffffff;
    transform: translateY(-2px);
}

/* ==========================================================================
   9. RESPONSIVE BREAKPOINTS
   ========================================================================== */

/* 桌面端 (>=992px): 保留左右双栏，解锁自由折叠/展开 */
@media (min-width: 992px) {
    .pfn-sticky-toc-box summary {
        cursor: pointer;
        padding-bottom: 6px;
    }
    .pfn-sticky-toc-box summary:hover {
        color: #2563eb;
    }
    /* 当折叠收起时，给标头加底部虚线，指示可以重新展开 */
    .pfn-sticky-toc-box:not([open]) summary {
        border-bottom: none;
        margin-bottom: 0;
    }
    .pfn-sticky-toc-box[open] summary {
        border-bottom: 2px solid #f1f5f9;
        margin-bottom: 12px;
    }
    .pfn-toc-arrow {
        display: inline-block !important; /* 恢复折叠箭头 */
    }
}

/* 平板端 (<992px) */
@media (max-width: 991px) {
    .pfn-trust-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .pfn-trust-box:nth-child(2) {
        border-right: none;
    }

    .pfn-inco-main-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px 0 40px;
    }

    .pfn-sticky-toc-box {
        position: static;
        padding: 12px 16px;
    }

    .pfn-inco-article-body {
        padding: 24px 18px;
    }
}

/* 手机端 (<640px) */
@media (max-width: 640px) {
    .pfn-inco-container {
        padding: 0 12px;
    }

    .pfn-inco-hero {
        padding: 24px 0 20px;
    }

    /* 手机端数据条堆叠为 2 列紧凑卡片 */
    .pfn-trust-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .pfn-trust-box {
        border-right: none;
        background: #f8fafc;
        padding: 8px 10px;
        border-radius: 6px;
        border: 1px solid #edf2f7;
    }

    /* 手机端将 6 步卡片变为单列 */
    .pfn-step-grid {
        grid-template-columns: 1fr;
    }

    .pfn-quick-spec-card {
        padding: 14px 12px;
    }

    .pfn-inco-article-body {
        padding: 18px 12px;
        border-radius: 10px;
    }

    /* 手机端隐藏笨重的宽表格，使用上方的 6 步卡片流 */
    .pfn-matrix-table-wrap {
        display: none;
    }

/* 移动端整齐垂直堆叠，按钮居中全宽自适应 */
    .pfn-bottom-inquiry-banner {
        padding: 22px 18px;
        flex-direction: column;
        align-items: stretch;
        text-align: left;
        gap: 16px;
    }

    .btn-bottom-quote {
        width: 100%;
        box-sizing: border-box;
        justify-content: center;
        padding: 13px 20px;
        font-size: 0.95rem;
    }
    .pfn-matrix-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}