<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>谛听多维报告</title>
    <style>
        /* PDF 报告容器 - A4 宽度 */
        .pdf-report {
            width: 794px; /* A4 宽度 (210mm) */
            max-width: 100%;
            margin: 0 auto;
            background-color: #ffffff;
            padding: 0;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
            color: #333333;
            line-height: 1.6;
            box-sizing: border-box;
        }

        /* 章节样式 */
        .pdf-section {
            margin-bottom: 32px;
            page-break-inside: avoid;
            padding: 0 24px;
        }

        .pdf-section-title {
            font-size: 20px;
            font-weight: 600;
            color: #1a1a1a;
            margin: 0 0 20px 0;
            padding: 16px 0 12px 0;
            position: relative;
            border-bottom: none;
        }

        .pdf-section-title::before {
            content: '';
            position: absolute;
            left: -24px;
            top: 16px;
            bottom: 12px;
            width: 4px;
            background: linear-gradient(180deg, #4a90e2 0%, #357abd 100%);
            border-radius: 2px;
        }

        /* 卡片样式 */
        .pdf-card {
            background-color: #ffffff;
            border: 1px solid #e8eaed;
            border-radius: 8px;
            padding: 20px 24px;
            margin-bottom: 16px;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.04);
        }

        .pdf-card-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 16px;
            padding-bottom: 12px;
            border-bottom: 1px solid #f0f0f0;
        }

        .pdf-suggestion-card {
            background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
            border: 1px solid #e0e7ff;
            border-left: 4px solid #4a90e2;
        }

        /* 标签和值 */
        .pdf-label {
            font-size: 15px;
            font-weight: 500;
            color: #1a1a1a;
            letter-spacing: 0.2px;
        }

        .pdf-value {
            font-size: 18px;
            font-weight: 600;
            letter-spacing: 0.3px;
        }

        .pdf-value-danger {
            color: #e53e3e;
        }

        .pdf-value-success {
            color: #38a169;
        }

        .pdf-value-warning {
            color: #d69e2e;
        }

        /* 标签样式 */
        .pdf-tag {
            display: inline-block;
            padding: 5px 14px;
            border-radius: 12px;
            font-size: 12px;
            font-weight: 500;
            color: #ffffff;
            letter-spacing: 0.2px;
            line-height: 1.4;
        }

        .pdf-tag-danger {
            background: linear-gradient(135deg, #fc8181 0%, #e53e3e 100%);
            box-shadow: 0 2px 4px rgba(229, 62, 62, 0.2);
        }

        .pdf-tag-warning {
            background: linear-gradient(135deg, #f6ad55 0%, #d69e2e 100%);
            box-shadow: 0 2px 4px rgba(214, 158, 46, 0.2);
        }

        .pdf-tag-success {
            background: linear-gradient(135deg, #68d391 0%, #38a169 100%);
            box-shadow: 0 2px 4px rgba(56, 161, 105, 0.2);
        }

        .pdf-tag-info {
            background: linear-gradient(135deg, #63b3ed 0%, #3182ce 100%);
            box-shadow: 0 2px 4px rgba(49, 130, 206, 0.2);
        }

        .pdf-tag-default {
            background: linear-gradient(135deg, #a0aec0 0%, #718096 100%);
            box-shadow: 0 2px 4px rgba(113, 128, 150, 0.2);
        }

        /* 子标题 */
        .pdf-subtitle {
            font-size: 16px;
            font-weight: 600;
            color: #1a1a1a;
            margin: 0 0 16px 0;
            padding: 0 0 12px 0;
            border-bottom: 1px solid #f0f0f0;
            position: relative;
        }

        .pdf-subtitle::after {
            content: '';
            position: absolute;
            left: 0;
            bottom: -1px;
            width: 40px;
            height: 2px;
            background: linear-gradient(90deg, #4a90e2 0%, #357abd 100%);
            border-radius: 1px;
        }

        .pdf-mini-title {
            font-size: 15px;
            font-weight: 600;
            color: #1a1a1a;
            margin: 20px 0 12px 0;
            padding: 0 0 8px 0;
            border-bottom: 1px solid #f5f5f5;
        }

        /* 信息表格 */
        .pdf-info-table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 8px;
        }

        .pdf-info-table tr {
            border-bottom: 1px solid #f5f5f5;
        }

        .pdf-info-table tr:last-child {
            border-bottom: none;
        }

        .pdf-info-table td {
            padding: 12px 16px;
            font-size: 14px;
            vertical-align: top;
        }

        .pdf-info-label {
            color: #666666;
            width: 100px;
            font-weight: 400;
            letter-spacing: 0.1px;
        }

        .pdf-info-value {
            color: #1a1a1a;
            font-weight: 500;
            letter-spacing: 0.1px;
        }

        /* 评分网格 */
        .pdf-score-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 16px;
            margin-top: 16px;
        }

        .pdf-score-item {
            padding: 20px;
            border-radius: 8px;
            border: 1px solid #e8eaed;
            position: relative;
            background: #ffffff;
        }

        .pdf-score-high {
            background: linear-gradient(135deg, #fff5f5 0%, #ffe5e5 100%);
            border-color: #feb2b2;
        }

        .pdf-score-medium {
            background: linear-gradient(135deg, #fffaf0 0%, #fff5e1 100%);
            border-color: #fbd38d;
        }

        .pdf-score-low {
            background: linear-gradient(135deg, #f0fff4 0%, #e6ffed 100%);
            border-color: #9ae6b4;
        }

        .pdf-score-info {
            background: linear-gradient(135deg, #ebf8ff 0%, #d6f0ff 100%);
            border-color: #90cdf4;
        }

        .pdf-score-default {
            background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
            border-color: #e2e8f0;
        }

        .pdf-score-label {
            font-size: 13px;
            color: #666666;
            margin-bottom: 10px;
            font-weight: 400;
            letter-spacing: 0.2px;
        }

        .pdf-score-value {
            font-size: 28px;
            font-weight: 700;
            color: #1a1a1a;
            margin-bottom: 8px;
            letter-spacing: -0.5px;
        }

        .pdf-score-tag {
            position: absolute;
            top: 12px;
            right: 12px;
            padding: 4px 10px;
            border-radius: 10px;
            font-size: 11px;
            font-weight: 500;
            color: #ffffff;
            line-height: 1.3;
        }

        /* 验证结果 */
        .pdf-verification-result {
            padding: 16px;
            border-radius: 6px;
            margin-top: 12px;
            border: 1px solid;
        }

        .pdf-result-success {
            background: linear-gradient(135deg, #f0fff4 0%, #e6ffed 100%);
            border-color: #9ae6b4;
        }

        .pdf-result-danger {
            background: linear-gradient(135deg, #fff5f5 0%, #ffe5e5 100%);
            border-color: #feb2b2;
        }

        .pdf-result-default {
            background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
            border-color: #e2e8f0;
        }

        .pdf-result-label {
            font-size: 14px;
            color: #1a1a1a;
            margin-bottom: 6px;
            font-weight: 500;
            letter-spacing: 0.1px;
        }

        .pdf-result-value {
            font-size: 14px;
            color: #1a1a1a;
            margin-bottom: 4px;
            font-weight: 500;
        }

        .pdf-result-detail {
            font-size: 12px;
            color: #666666;
            margin-top: 6px;
            letter-spacing: 0.1px;
        }

        /* 逾期统计 */
        .pdf-overdue-stats {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 12px;
            margin-top: 16px;
        }

        .pdf-stat-item {
            text-align: center;
            padding: 18px 12px;
            background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
            border-radius: 8px;
            border: 1px solid #e8eaed;
        }

        .pdf-stat-value {
            font-size: 26px;
            font-weight: 700;
            color: #1a1a1a;
            margin-bottom: 6px;
            letter-spacing: -0.5px;
        }

        .pdf-stat-label {
            font-size: 12px;
            color: #666666;
            letter-spacing: 0.2px;
            line-height: 1.4;
        }

        /* 时间分布 */
        .pdf-time-distribution {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 12px;
            margin-top: 16px;
        }

        .pdf-time-item {
            text-align: center;
            padding: 16px 12px;
            border-radius: 8px;
            border: 1px solid;
        }

        .pdf-time-success {
            background: linear-gradient(135deg, #f0fff4 0%, #e6ffed 100%);
            border-color: #9ae6b4;
        }

        .pdf-time-danger {
            background: linear-gradient(135deg, #fff5f5 0%, #ffe5e5 100%);
            border-color: #feb2b2;
        }

        .pdf-time-default {
            background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
            border-color: #e2e8f0;
        }

        .pdf-time-value {
            font-size: 15px;
            font-weight: 600;
            margin-bottom: 6px;
            color: #1a1a1a;
            letter-spacing: 0.2px;
        }

        .pdf-time-label {
            font-size: 11px;
            color: #666666;
            letter-spacing: 0.2px;
        }

        /* 借贷评估 */
        .pdf-loan-section {
            margin-top: 24px;
            padding-top: 24px;
            border-top: 1px solid #f0f0f0;
        }

        .pdf-loan-item {
            margin-bottom: 20px;
            padding: 20px;
            background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
            border-radius: 8px;
            border: 1px solid #e8eaed;
        }

        .pdf-loan-type {
            font-size: 15px;
            font-weight: 600;
            color: #1a1a1a;
            margin-bottom: 12px;
            padding-bottom: 10px;
            border-bottom: 1px solid #e8eaed;
            letter-spacing: 0.2px;
        }

        .pdf-loan-data {
            margin-top: 12px;
        }

        .pdf-loan-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 0;
            border-bottom: 1px solid #f5f5f5;
        }

        .pdf-loan-row:last-child {
            border-bottom: none;
        }

        .pdf-loan-label {
            font-size: 13px;
            color: #666666;
            letter-spacing: 0.1px;
        }

        .pdf-loan-value {
            font-size: 14px;
            font-weight: 600;
            color: #1a1a1a;
            letter-spacing: 0.1px;
        }

        /* 案件列表 */
        .pdf-case-list {
            margin-top: 16px;
        }

        .pdf-case-item {
            padding: 16px;
            margin-bottom: 12px;
            background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
            border-radius: 8px;
            border: 1px solid #e8eaed;
            border-left: 4px solid #4a90e2;
        }

        .pdf-case-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 12px;
        }

        .pdf-case-number {
            font-size: 14px;
            font-weight: 600;
            color: #1a1a1a;
        }

        .pdf-case-type {
            font-size: 12px;
            color: #666666;
            padding: 4px 10px;
            background: #e8eaed;
            border-radius: 4px;
        }

        .pdf-case-info {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 8px;
            font-size: 13px;
        }

        .pdf-case-info-item {
            color: #666666;
        }

        .pdf-case-info-value {
            color: #1a1a1a;
            font-weight: 500;
            margin-left: 8px;
        }

        @page {
            size: A4;
            margin: 0;
        }
    </style>
</head>
<body>
    <div class="pdf-report">
        <!-- 1. 风险评分与等级 -->
        <section class="pdf-section">
            <h2 class="pdf-section-title">风险评分与等级</h2>
            
            <div class="pdf-card">
                <div class="pdf-card-header">
                    <span class="pdf-label">审核建议</span>
                    <span class="pdf-value {{ check_suggest_class }}">{{ check_suggest or '建议拒绝' }}</span>
                </div>
                <div class="pdf-score-grid">
                    <div class="pdf-score-item {{ fraud_score_bg_class }}">
                        <div class="pdf-score-label">反欺诈评分</div>
                        <div class="pdf-score-value">{{ fraud_score_display }}</div>
                        <div class="pdf-score-tag {{ fraud_risk_tag_class }}">
                            {{ fraud_risk_level }}
                        </div>
                    </div>
                    <div class="pdf-score-item {{ credit_score_bg_class }}">
                        <div class="pdf-score-label">信用评分</div>
                        <div class="pdf-score-value">{{ credit_score_display }}</div>
                        <div class="pdf-score-tag {{ credit_risk_tag_class }}">
                            {{ credit_level }}
                        </div>
                    </div>
                    <div class="pdf-score-item {{ verify_rule_class }}">
                        <div class="pdf-score-label">验证规则</div>
                        <div class="pdf-score-value">{{ verify_rule or '未评估' }}</div>
                        <div class="pdf-score-tag {{ verify_rule_tag_class }}">
                            {{ verify_rule or '未评估' }}
                        </div>
                    </div>
                    <div class="pdf-score-item {{ fraud_rule_class }}">
                        <div class="pdf-score-label">反欺诈规则</div>
                        <div class="pdf-score-value">{{ fraud_rule or '未评估' }}</div>
                        <div class="pdf-score-tag {{ fraud_rule_tag_class }}">
                            {{ fraud_rule or '未评估' }}
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- 2. 基本信息 -->
        <section class="pdf-section">
            <h2 class="pdf-section-title">基本信息</h2>
            
            <div class="pdf-card">
                <table class="pdf-info-table">
                    <tr>
                        <td class="pdf-info-label">姓名：</td>
                        <td class="pdf-info-value">{{ base_info.name_masked }}</td>
                        <td class="pdf-info-label">年龄：</td>
                        <td class="pdf-info-value">{{ base_info.age }}岁</td>
                    </tr>
                    <tr>
                        <td class="pdf-info-label">性别：</td>
                        <td class="pdf-info-value">{{ base_info.sex }}</td>
                        <td class="pdf-info-label">手机号：</td>
                        <td class="pdf-info-value">{{ base_info.phone_masked }}</td>
                    </tr>
                    <tr>
                        <td class="pdf-info-label">身份证号：</td>
                        <td class="pdf-info-value">{{ base_info.id_card_masked }}</td>
                        <td class="pdf-info-label">户籍所在地：</td>
                        <td class="pdf-info-value">{{ base_info.location }}</td>
                    </tr>
                    <tr>
                        <td class="pdf-info-label">号码归属地：</td>
                        <td class="pdf-info-value" colspan="3">{{ base_info.phone_area }}</td>
                    </tr>
                </table>
            </div>
        </section>

        <!-- 3. 要素核验 -->
        {% if element_verification %}
        <section class="pdf-section">
            <h2 class="pdf-section-title">要素核验</h2>
            
            {% if element_verification.person_check_details %}
            <div class="pdf-card">
                <div class="pdf-card-header">
                    <span class="pdf-label">身份证二要素验证</span>
                    <span class="pdf-tag {{ element_verification.sfzeys_flag_tag_class }}">
                        {{ element_verification.sfzeys_flag_text }}
                    </span>
                </div>
                <div class="pdf-verification-result {{ element_verification.person_result_class }}">
                    <div class="pdf-result-label">{{ element_verification.person_check_details.ele or '身份证号、姓名' }}</div>
                    <div class="pdf-result-value">{{ element_verification.person_result_text }}</div>
                </div>
            </div>
            {% endif %}

            {% if element_verification.phone_check_details %}
            <div class="pdf-card">
                <div class="pdf-card-header">
                    <span class="pdf-label">手机三要素验证</span>
                    <span class="pdf-tag {{ element_verification.sjsys_flag_tag_class }}">
                        {{ element_verification.sjsys_flag_text }}
                    </span>
                </div>
                <div class="pdf-verification-result {{ element_verification.phone_result_class }}">
                    <div class="pdf-result-label">{{ element_verification.phone_check_details.ele or '身份证号、手机号、姓名' }}</div>
                    <div class="pdf-result-value">{{ element_verification.phone_result_text }}</div>
                    {% if element_verification.phone_check_details.phoneCompany %}
                    <div class="pdf-result-detail">
                        运营商: {{ element_verification.phone_check_details.phoneCompany }}
                    </div>
                    {% endif %}
                </div>
            </div>
            {% endif %}
        </section>
        {% endif %}

        <!-- 4. 运营商核验 -->
        {% if operator_verification and operator_verification.has_data %}
        <section class="pdf-section">
            <h2 class="pdf-section-title">运营商核验</h2>
            
            {% if operator_verification.online_risk_list %}
            <div class="pdf-card">
                <div class="pdf-card-header">
                    <span class="pdf-label">手机在网时长</span>
                    <span class="pdf-tag {{ operator_verification.online_risk_flag_tag_class }}">
                        {{ operator_verification.online_risk_flag_text }}
                    </span>
                </div>
                <div class="pdf-verification-result pdf-result-default">
                    <div class="pdf-result-label">运营商类型：{{ operator_verification.online_risk_list.lineType or '-' }}</div>
                    <div class="pdf-result-value">在网时长：{{ operator_verification.online_risk_list.onLineTimes or '-' }}</div>
                </div>
            </div>
            {% endif %}

            {% if operator_verification.phone_vail_risks %}
            <div class="pdf-card">
                <div class="pdf-card-header">
                    <span class="pdf-label">手机信息验证</span>
                    <span class="pdf-tag {{ operator_verification.phone_vail_risk_flag_tag_class }}">
                        {{ operator_verification.phone_vail_risk_flag_text }}
                    </span>
                </div>
                <div class="pdf-verification-result pdf-result-default">
                    <div class="pdf-result-label">运营商：{{ operator_verification.phone_vail_risks.phoneCompany or '-' }}</div>
                    <div class="pdf-result-value">手机状态：{{ operator_verification.phone_vail_risks.phoneStatus or '-' }}</div>
                    <div class="pdf-result-detail">在网时长：{{ operator_verification.phone_vail_risks.phoneTimes or '-' }}</div>
                </div>
            </div>
            {% endif %}

            {% if operator_verification.belong_risks %}
            <div class="pdf-card">
                <div class="pdf-card-header">
                    <span class="pdf-label">归属地核验</span>
                    <span class="pdf-tag {{ operator_verification.belong_risk_flag_tag_class }}">
                        {{ operator_verification.belong_risk_flag_text }}
                    </span>
                </div>
                <div class="pdf-verification-result pdf-result-default">
                    <div class="pdf-result-label">身份证归属地：{{ operator_verification.belong_risks.personProvence or '-' }}{{ operator_verification.belong_risks.personCity or '' }}</div>
                    <div class="pdf-result-value">手机归属地：{{ operator_verification.belong_risks.phoneProvence or '-' }}{{ operator_verification.belong_risks.phoneCity or '' }}</div>
                </div>
            </div>
            {% endif %}
        </section>
        {% endif %}

        <!-- 5. 公安重点人员核验 -->
        {% if key_person_verification and key_person_verification.has_data %}
        <section class="pdf-section">
            <h2 class="pdf-section-title">公安重点人员核验</h2>
            
            <div class="pdf-card">
                <div class="pdf-card-header">
                    <span class="pdf-label">公安重点人员核验</span>
                    <span class="pdf-tag {{ key_person_verification.high_risk_flag_tag_class }}">
                        {{ key_person_verification.high_risk_flag_text }}
                    </span>
                </div>
                {% if key_person_verification.key_person_check_list %}
                <div class="pdf-verification-result pdf-result-default" style="margin-top: 12px;">
                    <div class="pdf-result-label">前科标识：{{ '是' if key_person_verification.key_person_check_list.fontFlag else '否' }}</div>
                    <div class="pdf-result-label">经济类前科：{{ '是' if key_person_verification.key_person_check_list.jingJiFontFlag else '否' }}</div>
                    <div class="pdf-result-label">妨害社会管理秩序：{{ '是' if key_person_verification.key_person_check_list.fangAiFlag else '否' }}</div>
                    <div class="pdf-result-label">重点人员：{{ '是' if key_person_verification.key_person_check_list.zhongDianFlag else '否' }}</div>
                    <div class="pdf-result-label">涉交通案件：{{ '是' if key_person_verification.key_person_check_list.sheJiaoTongFlag else '否' }}</div>
                </div>
                {% endif %}
                {% if key_person_verification.anti_fraud_info %}
                <div class="pdf-verification-result pdf-result-default" style="margin-top: 12px;">
                    <div class="pdf-result-label">涉赌涉诈风险</div>
                    <div class="pdf-result-value">疑似跑分风险：{{ key_person_verification.anti_fraud_info.moneyLaundering or '无' }}</div>
                    <div class="pdf-result-value">疑似欺诈风险：{{ key_person_verification.anti_fraud_info.deceiver or '无' }}</div>
                    <div class="pdf-result-value">疑似赌博玩家风险：{{ key_person_verification.anti_fraud_info.gamblerPlayer or '无' }}</div>
                    <div class="pdf-result-value">疑似赌博庄家风险：{{ key_person_verification.anti_fraud_info.gamblerBanker or '无' }}</div>
                </div>
                {% endif %}
            </div>
        </section>
        {% endif %}

        <!-- 6. 逾期风险 -->
        {% if overdue_risk and overdue_risk.has_data %}
        <section class="pdf-section">
            <h2 class="pdf-section-title">逾期风险</h2>
            
            <div class="pdf-card">
                <div class="pdf-card-header">
                    <span class="pdf-label">逾期风险概览</span>
                    <span class="pdf-tag {{ overdue_risk.status_tag_class }}">
                        {{ overdue_risk.status_text }}
                    </span>
                </div>
                <div class="pdf-overdue-stats">
                    <div class="pdf-stat-item">
                        <div class="pdf-stat-value">{{ overdue_risk.current_overdue_institution_count }}</div>
                        <div class="pdf-stat-label">当前逾期机构数</div>
                    </div>
                    <div class="pdf-stat-item">
                        <div class="pdf-stat-value">{{ overdue_risk.current_overdue_amount }}</div>
                        <div class="pdf-stat-label">当前逾期金额</div>
                    </div>
                    <div class="pdf-stat-item">
                        <div class="pdf-stat-value">{{ overdue_risk.settled_institution_count }}</div>
                        <div class="pdf-stat-label">已结清机构数</div>
                    </div>
                    <div class="pdf-stat-item">
                        <div class="pdf-stat-value">{{ overdue_risk.total_loan_institutions }}</div>
                        <div class="pdf-stat-label">贷款总机构</div>
                    </div>
                </div>
            </div>

            <div class="pdf-card">
                <h3 class="pdf-subtitle">逾期时间分布</h3>
                <div class="pdf-time-distribution">
                    <div class="pdf-time-item {{ overdue_risk.time_1day_class }}">
                        <div class="pdf-time-value">{{ overdue_risk.time_1day_text }}</div>
                        <div class="pdf-time-label">近1天</div>
                    </div>
                    <div class="pdf-time-item {{ overdue_risk.time_7days_class }}">
                        <div class="pdf-time-value">{{ overdue_risk.time_7days_text }}</div>
                        <div class="pdf-time-label">近7天</div>
                    </div>
                    <div class="pdf-time-item {{ overdue_risk.time_14days_class }}">
                        <div class="pdf-time-value">{{ overdue_risk.time_14days_text }}</div>
                        <div class="pdf-time-label">近14天</div>
                    </div>
                    <div class="pdf-time-item {{ overdue_risk.time_30days_class }}">
                        <div class="pdf-time-value">{{ overdue_risk.time_30days_text }}</div>
                        <div class="pdf-time-label">近30天</div>
                    </div>
                </div>
            </div>
        </section>
        {% endif %}

        <!-- 7. 法院曝光台（使用司法涉诉数据） -->
        {% if court_exposure %}
        <section class="pdf-section">
            <h2 class="pdf-section-title">法院曝光台</h2>
            
            {% if court_exposure.execution_cases %}
            <div class="pdf-card">
                <h3 class="pdf-subtitle">执行案件</h3>
                <div class="pdf-case-list">
                    {% for case in court_exposure.execution_cases[:5] %}
                    <div class="pdf-case-item">
                        <div class="pdf-case-header">
                            <span class="pdf-case-number">{{ case.c_ah or case.caseNumber or '-' }}</span>
                            <span class="pdf-case-type">执行案件</span>
                        </div>
                        <div class="pdf-case-info">
                            <div class="pdf-case-info-item">法院：<span class="pdf-case-info-value">{{ case.n_jbfy or case.executiveCourt or '-' }}</span></div>
                            <div class="pdf-case-info-item">立案时间：<span class="pdf-case-info-value">{{ case.d_larq or case.filingTime or '-' }}</span></div>
                            <div class="pdf-case-info-item">结案时间：<span class="pdf-case-info-value">{{ case.d_jarq or case.disposalTime or '-' }}</span></div>
                            <div class="pdf-case-info-item">案件状态：<span class="pdf-case-info-value">{{ case.n_ajjzjd or case.caseStatus or '-' }}</span></div>
                        </div>
                    </div>
                    {% endfor %}
                </div>
            </div>
            {% endif %}

            {% if court_exposure.disin_cases %}
            <div class="pdf-card">
                <h3 class="pdf-subtitle">失信案件</h3>
                <div class="pdf-case-list">
                    {% for case in court_exposure.disin_cases[:5] %}
                    <div class="pdf-case-item">
                        <div class="pdf-case-header">
                            <span class="pdf-case-number">{{ case.caseNumber or '-' }}</span>
                            <span class="pdf-case-type">失信</span>
                        </div>
                        <div class="pdf-case-info">
                            <div class="pdf-case-info-item">执行法院：<span class="pdf-case-info-value">{{ case.executiveCourt or '-' }}</span></div>
                            <div class="pdf-case-info-item">立案时间：<span class="pdf-case-info-value">{{ case.fileDate or '-' }}</span></div>
                            <div class="pdf-case-info-item">发布日期：<span class="pdf-case-info-value">{{ case.issueDate or '-' }}</span></div>
                            <div class="pdf-case-info-item">履行情况：<span class="pdf-case-info-value">{{ case.fulfillStatus or '-' }}</span></div>
                        </div>
                    </div>
                    {% endfor %}
                </div>
            </div>
            {% endif %}

            {% if court_exposure.limit_cases %}
            <div class="pdf-card">
                <h3 class="pdf-subtitle">限制消费</h3>
                <div class="pdf-case-list">
                    {% for case in court_exposure.limit_cases[:5] %}
                    <div class="pdf-case-item">
                        <div class="pdf-case-header">
                            <span class="pdf-case-number">{{ case.caseNumber or '-' }}</span>
                            <span class="pdf-case-type">限高</span>
                        </div>
                        <div class="pdf-case-info">
                            <div class="pdf-case-info-item">执行法院：<span class="pdf-case-info-value">{{ case.executiveCourt or '-' }}</span></div>
                            <div class="pdf-case-info-item">立案时间：<span class="pdf-case-info-value">{{ case.fileDate or '-' }}</span></div>
                            <div class="pdf-case-info-item">发布日期：<span class="pdf-case-info-value">{{ case.issueDate or '-' }}</span></div>
                        </div>
                    </div>
                    {% endfor %}
                </div>
            </div>
            {% endif %}
        </section>
        {% endif %}

        <!-- 8. 借贷评估 -->
        {% if loan_evaluation and loan_evaluation.has_data %}
        <section class="pdf-section">
            <h2 class="pdf-section-title">借贷评估</h2>
            
            <div class="pdf-card">
                <div class="pdf-card-header">
                    <span class="pdf-label">借贷评估概览</span>
                    <span class="pdf-tag {{ loan_evaluation.risk_flag_tag_class }}">
                        {{ loan_evaluation.risk_flag_text }}
                    </span>
                </div>

                {% if loan_evaluation.organ_loan_performances %}
                <div class="pdf-loan-section">
                    <h4 class="pdf-mini-title">机构借贷表现</h4>
                    {% for item in loan_evaluation.organ_loan_performances %}
                    <div class="pdf-loan-item">
                        <div class="pdf-loan-type">{{ item.type_name }}</div>
                        <div class="pdf-loan-data">
                            <div class="pdf-loan-row">
                                <span class="pdf-loan-label">近7天：</span>
                                <span class="pdf-loan-value">{{ item.last7Day or '0/0' }}</span>
                            </div>
                            <div class="pdf-loan-row">
                                <span class="pdf-loan-label">近15天：</span>
                                <span class="pdf-loan-value">{{ item.last15Day or '0/0' }}</span>
                            </div>
                            <div class="pdf-loan-row">
                                <span class="pdf-loan-label">近1个月：</span>
                                <span class="pdf-loan-value">{{ item.last1Month or '0/0' }}</span>
                            </div>
                        </div>
                    </div>
                    {% endfor %}
                </div>
                {% endif %}
            </div>
        </section>
        {% endif %}

        <!-- 9. 司法涉诉 -->
        {% if judicial_data and judicial_data.has_data %}
        <section class="pdf-section">
            <h2 class="pdf-section-title">司法涉诉</h2>
            
            {% if judicial_data.count %}
            <div class="pdf-card">
                <h3 class="pdf-subtitle">案件统计</h3>
                <div class="pdf-overdue-stats">
                    <div class="pdf-stat-item">
                        <div class="pdf-stat-value">{{ judicial_data.count.count_total or 0 }}</div>
                        <div class="pdf-stat-label">案件总数</div>
                    </div>
                    <div class="pdf-stat-item">
                        <div class="pdf-stat-value">{{ judicial_data.count.count_jie_total or 0 }}</div>
                        <div class="pdf-stat-label">已结案件</div>
                    </div>
                    <div class="pdf-stat-item">
                        <div class="pdf-stat-value">{{ judicial_data.count.count_wei_total or 0 }}</div>
                        <div class="pdf-stat-label">未结案件</div>
                    </div>
                    <div class="pdf-stat-item">
                        <div class="pdf-stat-value">{{ judicial_data.count.count_beigao or 0 }}</div>
                        <div class="pdf-stat-label">被告总数</div>
                    </div>
                </div>
            </div>
            {% endif %}

            {% if judicial_data.civil and judicial_data.civil.cases %}
            <div class="pdf-card">
                <h3 class="pdf-subtitle">民事案件</h3>
                <div class="pdf-case-list">
                    {% for case in judicial_data.civil.cases[:5] %}
                    <div class="pdf-case-item">
                        <div class="pdf-case-header">
                            <span class="pdf-case-number">{{ case.c_ah or '-' }}</span>
                            <span class="pdf-case-type">民事</span>
                        </div>
                        <div class="pdf-case-info">
                            <div class="pdf-case-info-item">法院：<span class="pdf-case-info-value">{{ case.n_jbfy or '-' }}</span></div>
                            <div class="pdf-case-info-item">立案时间：<span class="pdf-case-info-value">{{ case.d_larq or '-' }}</span></div>
                            <div class="pdf-case-info-item">结案时间：<span class="pdf-case-info-value">{{ case.d_jarq or '-' }}</span></div>
                            <div class="pdf-case-info-item">案由：<span class="pdf-case-info-value">{{ case.n_laay or '-' }}</span></div>
                        </div>
                    </div>
                    {% endfor %}
                </div>
            </div>
            {% endif %}

            {% if judicial_data.criminal and judicial_data.criminal.cases %}
            <div class="pdf-card">
                <h3 class="pdf-subtitle">刑事案件</h3>
                <div class="pdf-case-list">
                    {% for case in judicial_data.criminal.cases[:5] %}
                    <div class="pdf-case-item">
                        <div class="pdf-case-header">
                            <span class="pdf-case-number">{{ case.c_ah or '-' }}</span>
                            <span class="pdf-case-type">刑事</span>
                        </div>
                        <div class="pdf-case-info">
                            <div class="pdf-case-info-item">法院：<span class="pdf-case-info-value">{{ case.n_jbfy or '-' }}</span></div>
                            <div class="pdf-case-info-item">立案时间：<span class="pdf-case-info-value">{{ case.d_larq or '-' }}</span></div>
                            <div class="pdf-case-info-item">结案时间：<span class="pdf-case-info-value">{{ case.d_jarq or '-' }}</span></div>
                            <div class="pdf-case-info-item">定罪罪名：<span class="pdf-case-info-value">{{ case.n_dzzm or '-' }}</span></div>
                        </div>
                    </div>
                    {% endfor %}
                </div>
            </div>
            {% endif %}

            {% if judicial_data.implement and judicial_data.implement.cases %}
            <div class="pdf-card">
                <h3 class="pdf-subtitle">执行案件</h3>
                <div class="pdf-case-list">
                    {% for case in judicial_data.implement.cases[:5] %}
                    <div class="pdf-case-item">
                        <div class="pdf-case-header">
                            <span class="pdf-case-number">{{ case.c_ah or '-' }}</span>
                            <span class="pdf-case-type">执行</span>
                        </div>
                        <div class="pdf-case-info">
                            <div class="pdf-case-info-item">法院：<span class="pdf-case-info-value">{{ case.n_jbfy or '-' }}</span></div>
                            <div class="pdf-case-info-item">立案时间：<span class="pdf-case-info-value">{{ case.d_larq or '-' }}</span></div>
                            <div class="pdf-case-info-item">结案时间：<span class="pdf-case-info-value">{{ case.d_jarq or '-' }}</span></div>
                            <div class="pdf-case-info-item">申请执行标的金额：<span class="pdf-case-info-value">{{ case.n_sqzxbdje or '-' }}</span></div>
                        </div>
                    </div>
                    {% endfor %}
                </div>
            </div>
            {% endif %}
        </section>
        {% endif %}
    </div>
</body>
</html>
