/* ============================================================
 * print-report.css — 深度测评报告统一排版（科技数据风 · v2026110501）
 *
 * 设计基调：现代数据科技感（靛蓝紫渐变主色 / 极浅蓝底 / 数据卡 / 发光进度条），
 *          同时保证 A4 打印、PDF、移动长图、离线单文件多端一致、配色克制可打印。
 * 统一策略：保持全部 .pr-* / #pr-* 类名不变，仅重设计视觉 —— 历史快照、
 * 补快照、历史页 rebuild 全部渲染同一套样式，天然统一，无需改 DOM 结构。
 * 2026-11-05 v2026110501 排版美化：结果卡分数/等级同行排布、维度表斑马纹、
 * 深度解读小节锚点标题、理论基础轻边卡、数据卡数值加深印刷对比度。
 * 依赖：各模块 index.html 中 #print-report 为 <body> 直接子元素。
 * ============================================================ */

/* —— 屏幕侧：报告容器隐藏 —— */
#print-report { display: none; }

/* —— 打印：仅显示报告，白纸版式 —— */
@media print {
    @page {
        size: A4;
        margin: 12mm 11mm 16mm;
        /* 注：Chrome print-to-PDF 不支持 @page margin-box（@bottom-center），
           页码由浏览器打印对话框自带页眉页脚提供，此处不再声明。 */
    }
    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
    body > :not(#print-report):not(.pr-dl-page) { display: none !important; }
    html, body { background: #fff !important; background-color: #fff !important; }
    #print-report {
        display: block !important;
        position: relative; left: 0; top: 0;
        width: 100%; margin: 0; padding: 0;
        background: #fff; color: #0f172a;
        font-family: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
        font-size: 12px; line-height: 1.7;
    }
    #print-report h1, #print-report h2, #print-report h3 { color: #0f172a; }
    #print-report strong { color: #0f172a; }
    #print-report a { color: #4f46e5 !important; text-decoration: none; }
    #print-report ul { padding-left: 18px; margin: 4px 0; }
    #print-report p { margin: 4px 0; }

    #pr-summary *, #pr-analysis *, #pr-actions *, #pr-theories *, #pr-quote * {
        color: #475569 !important;
        background: none !important;
        background-color: transparent !important;
        box-shadow: none !important;
        text-shadow: none !important;
        border-color: #e3e9f7 !important;
    }
    #pr-analysis, #pr-theories, #pr-summary { color: #475569; }
    #print-report .pr-qr { break-inside: avoid; page-break-inside: avoid; }

    /* —— 分数可读性（print 端降级）：background-clip:text 在 print-to-PDF 渲染不完整
       （背景矩形不按文字形状裁剪，整块色底叠在文字后面，分数看不清）。
       打印端统一降级为纯色主色，保证 PDF 清晰可读。 */
    #print-report .pr-score,
    #print-report .pr-acc-total strong {
        background: none !important;
        background-image: none !important;
        -webkit-background-clip: initial !important;
        background-clip: initial !important;
        -webkit-text-fill-color: #4f46e5 !important;
        color: #4f46e5 !important;
    }

    /* —— 个性化建议策略卡（print 端重建）：中和规则针对快照旧内容，
       系统构建的 #pr-actions li 结构需恢复策略卡视觉（选择器优先级高于中和规则）。 */
    #print-report #pr-actions li {
        background: linear-gradient(135deg, #f8faff, #f6f4ff) !important;
        border: 1px solid #e3e9f7 !important;
        border-radius: 12px !important;
        box-shadow: none !important;
    }
    #print-report #pr-actions li > p.pr-act-title {
        color: #0f172a !important;
        font-weight: 700 !important;
    }
    #print-report #pr-actions li > p.pr-act-desc {
        color: #475569 !important;
    }
    #print-report #pr-actions li::before {
        background: linear-gradient(135deg, #4f46e5, #7c3aed) !important;
        color: #fff !important;
        -webkit-text-fill-color: #fff !important;
        box-shadow: none !important;
    }
}

/* ================= 全局：数据科技术语 ================= */
#print-report {
    font-variant-numeric: tabular-nums;
}
#print-report .pr-score,
#print-report .pr-d-score,
#print-report .pr-level,
#print-report .pr-meta-item em,
#print-report .pr-acc-total strong {
    font-variant-numeric: tabular-nums;
}

/* ================= 页眉：渐变光线 + 数据卡 meta ================= */
.pr-header {
    position: relative;
    padding: 22px 0 16px;
    margin-bottom: 22px;
    border-bottom: 1px solid #e3e9f7;
}
/* 顶部一条靛蓝→紫→青 渐变光带（签名元素之一） */
.pr-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 4px;
    border-radius: 2px;
    background: linear-gradient(90deg, #4f46e5 0%, #7c3aed 45%, #0ea5e9 100%);
}
.pr-brand {
    font-size: 11px;
    letter-spacing: 3px;
    color: #7c3aed;
    text-transform: uppercase;
    font-weight: 700;
}
.pr-brand::before { content: '◈ '; color: #7c3aed; letter-spacing: 0; }
.pr-title {
    font-size: 27px; font-weight: 800; color: #0f172a;
    margin: 7px 0 14px; letter-spacing: .5px;
    line-height: 1.25;
}
/* 数据卡：自适应宽度 + 自动换行
   2026-11-04：报告编号移到右上角后剩 4 项。用 flex 按内容定宽而不是 grid 均分，
   避免「题目数量：44 题」这类短内容在 350px 宽卡里右侧留大片空白；
   4 项合计约 560px，在 710px 内容宽下一行放得下且「测评日期 2026-11-04 10:29」不截断。 */
.pr-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
    padding: 0;
}
.pr-meta-item {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 8px 12px;
    flex: 0 0 auto;      /* 按内容定宽，不参与均分，避免短内容右侧留白 */
    max-width: 100%;
    background: #f4f7ff;
    border: 1px solid #e3e9f7;
    border-radius: 10px;
    font-size: 11px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pr-meta-item em {
    font-style: normal;
    font-weight: 700;
    color: #4338ca; /* v2026110501：加深一档（#4f46e5→#4338ca），印刷对比度更好 */
    letter-spacing: .2px;
    white-space: nowrap;
}
/* 报告编号：常规排版置于页眉右上角，与左上角 .pr-brand 同一行。
   纯 CSS 定位，不改任何 HTML —— 历史快照 / 补快照 / 前台实时构建全部自动生效；
   移出 meta 网格后，剩余 4 项自动铺满一行，页眉更紧凑。 */
.pr-meta-item:first-child {
    position: absolute;
    top: 22px;                 /* 对齐 .pr-header 的 padding-top，与 brand 同基线 */
    right: 0;
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    padding: 0;
    min-width: 0;
    background: none;
    border: none;
    border-radius: 0;
    font-size: 11px;
    color: #64748b;
    letter-spacing: .3px;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
}
.pr-meta-item:first-child em {
    white-space: nowrap;
    word-break: normal;
    letter-spacing: .3px;
}
/* 窄屏（前台移动端报告页，<520px）回退为卡片整行：右上角绝对定位会与 brand 重叠 */
@media (max-width: 520px) {
    .pr-meta-item:first-child {
        position: static;
        grid-column: 1 / -1;
        display: flex;
        justify-content: space-between;
        padding: 8px 12px;
        background: #f4f7ff;
        border: 1px solid #e3e9f7;
        border-radius: 10px;
    }
}

/* ================= 正文区块标题：编号方块 + 渐变细线 ================= */
.pr-body h2 {
    position: relative;
    font-size: 14.5px; font-weight: 800; color: #0f172a;
    margin: 26px 0 12px;
    padding-left: 14px;
    letter-spacing: .4px;
    border-left: none;
    break-after: avoid;
    page-break-after: avoid;
}
/* 编号左侧：靛蓝渐变小方块（科技锚点） */
.pr-body h2::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 5px; height: 17px;
    border-radius: 3px;
    background: linear-gradient(180deg, #4f46e5, #7c3aed);
}
/* 标题下：1px 弱渐变细线（结构分隔） */
.pr-body h2::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -5px;
    height: 1px;
    background: linear-gradient(90deg, #a5b4fc, transparent);
    opacity: .7;
}
.pr-overview { margin: 10px 0 0; color: #475569; }

/* ================= 测评结果：数据卡 + 渐变分数（签名） ================= */
.pr-result-box {
    position: relative;
    background: linear-gradient(135deg, #f4f7ff, #f8f5ff);
    border: 1px solid #e3e9f7;
    border-radius: 16px;
    padding: 22px 26px;
    margin: 10px 0 4px;
    overflow: hidden;
}
/* 左侧渐变竖条 */
.pr-result-box::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 5px;
    background: linear-gradient(180deg, #4f46e5, #7c3aed, #0ea5e9);
}
/* 右上角数据网格光晕 */
.pr-result-box::after {
    content: '';
    position: absolute;
    right: -40px; top: -40px;
    width: 170px; height: 170px;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(124, 58, 237, .08), transparent);
}
.pr-score {
    font-size: 46px; font-weight: 800; line-height: 1;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #4f46e5;
    display: inline-block;
    position: relative;
    z-index: 1;
    margin-left: 10px;
}
.pr-level {
    display: inline-block;
    margin: 12px 0 0;
    padding: 5px 18px;
    border-radius: 999px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    font-size: 13px; font-weight: 700;
    letter-spacing: .3px;
    box-shadow: 0 3px 10px rgba(79, 70, 229, .25);
    border: none;
}
/* v2026110501 美化：结果卡改横向数据条——大分数居左、等级徽章同行随行，
   信息密度更高（人格类无分数时等级徽章单独居左，flex 自动兼容） */
.pr-result-box { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 22px; }
.pr-result-box .pr-level { margin: 0; }
#pr-summary { margin-top: 12px; color: #475569; }
#pr-summary b, #pr-summary strong { color: #4f46e5; }

/* ================= 各维度得分表：渐变表头 + 卡片化 ================= */
.pr-table { width: 100%; border-collapse: separate; border-spacing: 0 6px; margin: 6px 0 4px; }
.pr-table thead th {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #fff;
    font-size: 11px; font-weight: 700;
    text-align: left;
    padding: 10px 12px; /* v2026110501：9→10，表头更挺括 */
    letter-spacing: .5px;
    border: none;
}
.pr-table thead th:first-child { border-radius: 8px 0 0 8px; }
.pr-table thead th:last-child { border-radius: 0 8px 8px 0; }
.pr-table tbody td {
    background: #fbfcff;
    border: 1px solid #eef1fb;
    padding: 12px 12px;
    vertical-align: top;
    font-size: 12px;
}
/* v2026110501 美化：斑马纹（偶数行极浅蓝底），多行维度表扫读更省力 */
.pr-table tbody tr:nth-child(even) td { background: #f6f9ff; }
.pr-table tbody tr td:first-child { border-left: 2px solid #a5b4fc; border-radius: 8px 0 0 8px; }
.pr-table tbody tr td:last-child { border-radius: 0 8px 8px 0; }
.pr-table tbody tr { break-inside: avoid; page-break-inside: avoid; box-shadow: 0 1px 4px rgba(79,70,229,.04); }
/* 2026-11-04 设计优化：列宽再平衡——解读列内容短，改为自然宽（auto），
   得分列（含进度条）加宽，消除大空白 */
.pr-d-name { font-weight: 700; color: #0f172a; width: 18%; }
.pr-d-score { width: 30%; font-weight: 800; color: #4f46e5; font-size: 16px; text-align: right; }
.pr-d-score small { font-weight: 400; color: #94a3b8; font-size: 11px; display: block; text-align: right; }
.pr-d-level { width: 13%; color: #7c3aed; font-weight: 700; }
.pr-d-desc { color: #1e293b; font-weight: 500; }
/* 2026-11-04 可读性修复：后台暗色主题的全局 p/div 颜色会渗入报告，白底上呈浅灰。
   深度解读的正文在快照里不一定是 <p>（各模块提取结构不同，也有 div/span 直接承载文本），
   所以对 #pr-analysis 全子树做兜底加深；标题用更高特异性单独保住 #0f172a 的层级。
   v2026110522：正文由 #334155 再深化到 #1e293b —— 12px 常规字重在 2x 截图 + JPEG 压缩后
   仍显灰，加深并配合 500 字重后 PDF 里才清晰可读。 */
#print-report #pr-analysis * { color: #1e293b !important; }
#print-report #pr-analysis h3,
#print-report #pr-analysis .ana-mod-title { color: #0f172a !important; }
#print-report #pr-summary,
#print-report #pr-summary * { color: #1e293b !important; }
/* 渐变进度条 */
.pr-bar {
    display: block; height: 7px;
    background: #e9edf9; border-radius: 4px;
    margin-top: 9px; overflow: hidden;
}
.pr-bar > i {
    display: block; height: 100%;
    background: linear-gradient(90deg, #4f46e5, #0ea5e9);
    border-radius: 4px;
}
.pr-bar-sm { height: 4px; margin: 5px 0; }

/* ================= 测评可信度 ================= */
.pr-acc-total {
    font-size: 13px; color: #0f172a; font-weight: 600; margin-bottom: 10px;
    display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px;
}
.pr-acc-total strong {
    font-size: 19px;
    color: #4f46e5;
    background: linear-gradient(135deg, #4f46e5, #0ea5e9);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    display: inline-block;
}
#pr-acc-desc { color: #64748b; font-size: 11px; margin-left: 0; font-weight: 400; }
.pr-acc-item { padding: 9px 2px; border-bottom: 1px solid #eef1fb; break-inside: avoid; page-break-inside: avoid; }
.pr-acc-item:last-child { border-bottom: none; }
.pr-acc-row { display: flex; justify-content: space-between; font-size: 12px; color: #475569; }
.pr-acc-row em { font-style: normal; font-weight: 700; color: #4f46e5; }
.pr-acc-desc { font-size: 11px; color: #475569; margin: 2px 0 0; }

/* ================= 深度解读：小节锚点标题 + 排版正文（v2026110501 新增） =================
   快照正文为各模块提取的 h3/p（health 为 .ana-mod* 包装）结构，此前完全无样式：
   屏幕端继承宿主页面字号/颜色（后台暗色 body 下白底浅字几乎不可见），
   打印端仅靠中和规则兜底。此处按报告排版体系补齐——标题用渐变锚点方块，
   正文 12px/1.85 两端对齐；颜色 !important 需压过打印中和规则（#pr-analysis *）。 */
#pr-analysis h3, #pr-analysis .ana-mod-title {
    font-size: 13px; font-weight: 800;
    color: #0f172a !important;
    margin: 16px 0 7px;
    padding-left: 11px;
    position: relative;
    line-height: 1.5;
}
#pr-analysis h3:first-child, #pr-analysis .ana-mod:first-child .ana-mod-title { margin-top: 2px; }
#pr-analysis h3::before, #pr-analysis .ana-mod-title::before {
    content: '';
    position: absolute; left: 0; top: 2px;
    width: 4px; height: 14px;
    border-radius: 2px;
    background: linear-gradient(180deg, #4f46e5, #7c3aed);
}
#pr-analysis p, #pr-analysis .ana-mod-text {
    font-size: 12px; line-height: 1.85;
    margin: 0 0 4px;
    text-align: justify;
    font-weight: 500;   /* v2026110522：加粗一档，提升 2x 截图后的笔画密度 */
}
#pr-analysis .ana-mod {
    padding-bottom: 8px; margin-bottom: 8px;
    border-bottom: 1px solid #e3e9f7;
    break-inside: avoid; page-break-inside: avoid;
}
#pr-analysis .ana-mod:last-child { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }

/* ================= 理论基础：轻边卡（v2026110501 新增） =================
   与建议策略卡同语系：浅描边圆角卡，卡内标题/正文层级化。
   不设背景色，兼容打印中和规则与历史快照残留的内联浅色底。 */
#pr-theories .theory-item {
    border: 1px solid #e3e9f7;
    border-radius: 10px;
    padding: 11px 14px;
    margin: 0 0 10px;
    break-inside: avoid; page-break-inside: avoid;
}
#pr-theories .theory-item:last-child { margin-bottom: 0; }
#pr-theories h3, #pr-theories .theory-title {
    font-size: 12.5px; font-weight: 800;
    color: #0f172a !important;
    margin: 0 0 5px;
    line-height: 1.5;
}
#pr-theories p, #pr-theories .theory-desc {
    font-size: 11.5px; line-height: 1.8;
    color: #334155 !important;
    margin: 0;
    text-align: justify;
}

/* ================= 个性化建议：策略卡（独立UI） =================
   设计要点：渐变编号方块(01/02…) + 浅渐变卡底 + 层级化标题/描述，
   既强化“逐步实施策略”的引导感，又保证 A4 打印可读（无 background-clip:text）。 */
#pr-actions {
    padding-left: 0; margin: 12px 0; list-style: none;
    counter-reset: pr-act;
}
#pr-actions li {
    position: relative;
    counter-increment: pr-act;
    break-inside: avoid; page-break-inside: avoid;
    margin-bottom: 12px;
    padding: 15px 16px 14px 66px;
    background: linear-gradient(135deg, #f8faff, #f6f4ff);
    border: 1px solid #e3e9f7;
    border-radius: 12px;
    color: #475569;
    box-shadow: 0 2px 8px rgba(79, 70, 229, .05);
}
/* 编号块：靛紫渐变圆角方块 + 白色两位序号（科技步骤感） */
#pr-actions li::before {
    content: counter(pr-act, decimal-leading-zero);
    position: absolute;
    left: 14px; top: 50%;
    transform: translateY(-50%);
    width: 36px; height: 36px;
    line-height: 36px;
    text-align: center;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    font-size: 15px; font-weight: 800;
    letter-spacing: .5px;
    font-variant-numeric: tabular-nums;
    border-radius: 10px;
    box-shadow: 0 3px 8px rgba(79, 70, 229, .3);
}
.pr-act-title {
    font-weight: 700; color: #0f172a; margin: 0;
    font-size: 13px; letter-spacing: .2px;
}
.pr-act-desc {
    margin: 5px 0 0; color: #475569;
    line-height: 1.75; font-size: 12px;
}

/* ================= 名言：渐变左条 + 浅卡 ================= */
.pr-quote {
    border-left: 4px solid #7c3aed;
    background: linear-gradient(90deg, #f8f5ff, #fbfcff);
    padding: 14px 18px; margin: 18px 0;
    border-radius: 0 12px 12px 0;
    color: #475569;
    font-style: italic;
}
.pr-quote-t { margin: 0; font-size: 12.5px; line-height: 1.8; } /* v2026110501 新增：名言正文字号锚定 */
.pr-quote .pr-quote-a { text-align: right; color: #94a3b8; font-size: 11px; margin: 6px 0 0; font-style: normal; }

/* ================= 页脚：渐变顶线 ================= */
.pr-footer { border-top: none; margin-top: 26px; padding-top: 14px; position: relative; }
.pr-footer::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, #4f46e5, #0ea5e9);
    opacity: .5;
}
.pr-statement { font-size: 10px; color: #64748b; margin: 0 0 6px; line-height: 1.6; }
.pr-footer-line { font-size: 10px; color: #94a3b8; margin: 0; letter-spacing: .3px; }
.pr-footer-line em { font-style: normal; color: #4f46e5; font-weight: 700; }

/* ================= 底部二维码：数据卡 ================= */
.pr-qr {
    display: flex; justify-content: center; align-items: center; gap: 18px;
    margin-top: 14px; padding-top: 14px;
    border-top: 1px dashed #d3dcef;
}
.pr-qr-img {
    flex: 0 0 auto; width: 92px; height: 92px;
    background: #fff; border: 1px solid #e3e9f7; border-radius: 12px;
    padding: 6px; box-sizing: border-box;
    box-shadow: 0 3px 10px rgba(79, 70, 229, .08);
}
.pr-qr-img img { display: block; width: 100%; height: 100%; }
.pr-qr-title { font-size: 14px; font-weight: 700; color: #0f172a; margin: 0 0 4px; }
.pr-qr-sub { font-size: 11px; color: #64748b; margin: 0; line-height: 1.6; }