/* ============================================================
   SOLA 月度经营分析报告 · 打印样式
   A4 纵向 210×297mm，页边距 16mm。屏幕上呈现纸张感，
   打印 / 另存为 PDF 时自然分页。
   注意：headless Chrome 不嵌苹方，print 媒体里必须补黑体族，
   否则导出的 PDF 正文会整段消失。
   ============================================================ */

body.rpt{
  background:#ececea;
  color:#0b0b0b;
  font-family:system-ui,-apple-system,"PingFang SC","Hiragino Sans GB",
              "Heiti SC","Microsoft YaHei",sans-serif;
}

/* ---------- 屏幕工具条 ---------- */
.rpt-bar{
  position:sticky;top:0;z-index:60;background:#111;color:#fff;
  padding:11px 18px;display:flex;align-items:center;gap:14px;flex-wrap:wrap;
  font-size:13.5px;
}
.rpt-bar .t{font-weight:600;letter-spacing:-.01em}
.rpt-bar .sp{margin-left:auto;display:flex;gap:8px;flex-wrap:wrap}
.rpt-bar a, .rpt-bar button{
  font-family:inherit;font-size:13px;border-radius:8px;padding:6px 13px;
  border:1px solid rgba(255,255,255,.28);background:transparent;color:#fff;
  text-decoration:none;cursor:pointer;white-space:nowrap;
}
.rpt-bar button.primary{background:#fff;color:#111;border-color:#fff;font-weight:600}
.rpt-bar a:hover,.rpt-bar button:hover{border-color:#fff}
.rpt-bar select{
  font-family:inherit;font-size:13px;padding:6px 10px;border-radius:8px;
  background:#111;color:#fff;border:1px solid rgba(255,255,255,.28);
}
.rpt-hint{
  max-width:210mm;margin:16px auto 0;padding:0 4mm;
  font-size:12.5px;color:#6b6a66;line-height:1.6;
}

/* ---------- 纸张 ---------- */
.sheet{
  width:210mm;min-height:297mm;margin:16px auto;background:#fff;
  padding:16mm 16mm 18mm;box-shadow:0 2px 16px rgba(0,0,0,.13);
  box-sizing:border-box;
}
.sheet *{box-sizing:border-box}

/* ---------- 报告抬头 ---------- */
.rpt-head{border-bottom:2px solid #0b0b0b;padding-bottom:14px;margin-bottom:20px}
.rpt-head .brand{
  display:flex;align-items:center;gap:8px;font-size:12px;color:#6b6a66;
  letter-spacing:.08em;margin-bottom:12px;
}
.rpt-head .brand i{width:7px;height:7px;border-radius:50%;background:#2a78d6;display:block}
.rpt-head h1{font-size:25px;font-weight:680;margin:0 0 5px;letter-spacing:-.02em;line-height:1.25}
.rpt-head .sub{font-size:14px;color:#52514e;margin:0}

.rpt-meta{
  display:grid;grid-template-columns:repeat(4,1fr);gap:0;
  border:1px solid #d9d8d2;border-radius:8px;overflow:hidden;margin-bottom:22px;
}
.rpt-meta div{padding:9px 11px;border-right:1px solid #e6e5e0}
.rpt-meta div:last-child{border-right:none}
.rpt-meta dt{font-size:10.5px;color:#8a8983;margin:0 0 3px}
.rpt-meta dd{font-size:12.5px;margin:0;font-weight:560;line-height:1.4}

/* ---------- 章节 ---------- */
.rpt-sec{margin-bottom:24px;break-inside:avoid}
.rpt-sec > h2{
  font-size:14.5px;font-weight:660;margin:0 0 12px;padding-bottom:7px;
  border-bottom:1px solid #d9d8d2;letter-spacing:-.01em;
}
.rpt-sec > h2 small{font-weight:400;color:#8a8983;font-size:11.5px;margin-left:9px;letter-spacing:0}
.rpt-sec h3{font-size:12.8px;font-weight:620;margin:16px 0 8px}
.rpt-sec p{font-size:12.6px;line-height:1.78;margin:0 0 9px;color:#2c2b29}
.rpt-sec p b{font-weight:640;color:#0b0b0b}
.rpt-sec p em{font-style:normal;font-weight:620;font-variant-numeric:tabular-nums}

.page-break{break-before:page}

/* ---------- 摘要块 ---------- */
.summary{
  background:#f6f6f4;border-left:3px solid #2a78d6;border-radius:0 8px 8px 0;
  padding:13px 15px;margin-bottom:16px;
}
.summary p{margin:0 0 7px;font-size:12.8px;line-height:1.8}
.summary p:last-child{margin-bottom:0}

/* ---------- KPI 网格 ---------- */
.rpt-kpi{
  display:grid;grid-template-columns:repeat(3,1fr);
  border:1px solid #d9d8d2;border-radius:8px;overflow:hidden;
}
.rpt-kpi .k{padding:11px 13px;border-right:1px solid #e6e5e0;border-bottom:1px solid #e6e5e0}
.rpt-kpi .k:nth-child(3n){border-right:none}
.rpt-kpi .k:nth-last-child(-n+3){border-bottom:none}
.rpt-kpi .lb{font-size:10.5px;color:#8a8983;margin:0 0 4px}
.rpt-kpi .v{font-size:18px;font-weight:650;letter-spacing:-.02em;line-height:1.2}
.rpt-kpi .v.bad{color:#c0322f}
.rpt-kpi .v.good{color:#006300}
.rpt-kpi .d{font-size:10.8px;color:#6b6a66;margin-top:3px}

/* ---------- 风险条目 ---------- */
.risk{border:1px solid #e0dfd9;border-radius:8px;padding:12px 14px;margin-bottom:10px;break-inside:avoid}
.risk .hd{display:flex;align-items:center;gap:8px;margin-bottom:6px;flex-wrap:wrap}
.risk .lv{
  font-size:10.5px;font-weight:640;padding:2px 8px;border-radius:999px;color:#fff;letter-spacing:.04em;
}
.risk.critical{border-left:3px solid #c0322f}
.risk.serious{border-left:3px solid #d9743f}
.risk.warning{border-left:3px solid #c98a10}
.risk.good{border-left:3px solid #0a8a0a}
.risk.critical .lv{background:#c0322f}
.risk.serious .lv{background:#d9743f}
.risk.warning .lv{background:#c98a10}
.risk.good .lv{background:#0a8a0a}
.risk .ti{font-size:12.8px;font-weight:640}
.risk .body{font-size:12.3px;line-height:1.72;color:#2c2b29}
.risk .body em{font-style:normal;font-weight:620;font-variant-numeric:tabular-nums}
.risk .act{
  margin-top:8px;padding-top:8px;border-top:1px dashed #ddd;
  font-size:12.2px;line-height:1.68;color:#2c2b29;
}
.risk .act b{color:#0b0b0b}

/* ---------- 表格 ---------- */
.rpt-tbl{width:100%;border-collapse:collapse;font-size:11.8px;margin:8px 0 4px}
.rpt-tbl th,.rpt-tbl td{padding:6px 9px;text-align:right;border-bottom:1px solid #e6e5e0}
.rpt-tbl th:first-child,.rpt-tbl td:first-child{text-align:left}
.rpt-tbl thead th{
  font-weight:560;font-size:10.8px;color:#6b6a66;
  border-bottom:1px solid #c3c2b7;background:#fafaf8;
}
.rpt-tbl td.num{font-variant-numeric:tabular-nums}
.rpt-tbl td.neg{color:#c0322f}
.rpt-tbl tr.total td{font-weight:640;border-top:1px solid #c3c2b7;background:#fafaf8}
.rpt-tbl caption{caption-side:top;text-align:left;font-size:11.5px;color:#6b6a66;padding-bottom:5px}

/* ---------- 图表容器 ---------- */
.rpt-fig{margin:10px 0 14px;break-inside:avoid}
.rpt-fig .cap{font-size:11.5px;color:#6b6a66;margin:0 0 8px}
.rpt-fig .note{font-size:11px;color:#8a8983;margin:6px 0 0;line-height:1.6}
.fig2{display:grid;grid-template-columns:1fr 1fr;gap:18px}

/* 报告里的图表统一浅色令牌（覆盖 sola.css 的主题变量） */
.sheet{
  --surface:#fff; --ink:#0b0b0b; --ink-2:#2c2b29; --muted:#6b6a66;
  --grid:#e6e5e0; --axis:#c3c2b7; --border:#d9d8d2; --wash:#f6f6f4;
  --s1:#2a78d6; --s2:#eb6834; --s3:#1baf7a; --s4:#eda100;
  --critical:#c0322f; --deemph:#c9c8c1;
}
.sheet .hb{gap:9px}
.sheet .hb-lb{font-size:11.5px}
.sheet .hb-val{font-size:11.5px;min-width:58px}
.sheet .legend{margin-top:10px;padding-top:9px}
.sheet .legend span{font-size:11px}
.sheet svg .tick{font-size:9.5px}
.sheet svg .lbl{font-size:10px}
.sheet .tip{display:none}

/* ---------- 落款 ---------- */
.rpt-foot{
  margin-top:26px;padding-top:12px;border-top:1px solid #d9d8d2;
  font-size:11px;color:#8a8983;line-height:1.7;
}
.rpt-sign{display:flex;justify-content:space-between;gap:20px;margin-top:22px;font-size:12px}
.rpt-sign div{flex:1}
.rpt-sign .line{border-bottom:1px solid #b9b8b2;height:30px;margin-top:5px}

/* ---------- 打印 ---------- */
@page{size:A4 portrait;margin:14mm 14mm 16mm}
@media print{
  html,body{background:#fff !important}
  body.rpt{
    font-family:"Heiti SC","SimHei","PingFang SC","Microsoft YaHei",
                system-ui,-apple-system,sans-serif;
  }
  .rpt-bar,.rpt-hint,.wm{display:none !important}
  .sheet{
    width:auto;min-height:0;margin:0;padding:0;box-shadow:none;
  }
  *{-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .rpt-sec{break-inside:auto}
  .rpt-sec > h2{break-after:avoid}
  .risk,.rpt-fig,.rpt-kpi,.rpt-meta,.summary{break-inside:avoid}
  .rpt-tbl{break-inside:auto}
  .rpt-tbl tr{break-inside:avoid}
  thead{display:table-header-group}
}

/* 实时数据标记（打印时隐藏，随 .rpt-bar 一起） */
.live-tag{
  font-size:12px;padding:3px 10px;border-radius:999px;
  background:#2a78d6;color:#fff;white-space:nowrap;
  overflow:hidden;text-overflow:ellipsis;max-width:42vw;
}
@media print{ .live-bar{display:none !important} }
