/* =========================================================
   四川石化学习平台 · 企业报告风设计系统
   版本: report-style v0.1 (Design Lab Fork)
   说明: 完全独立样式表，不影响主项目 assets/css/main.css
   设计理念: 白底 / 纯色块 / 数据至上 / 无装饰 / 12栏网格
   参考: 麦肯锡·BCG 咨询报告 + 上市公司年报 + 券商研报
   ========================================================= */

/* ---------- 设计令牌 ---------- */
:root {
  /* 中性 - 纯白到近黑，五阶灰 */
  --paper: #ffffff;
  --paper-alt: #f6f7f9;
  --paper-dark: #eceff3;
  --ink: #101828;
  --ink-2: #475467;
  --ink-3: #667085;
  --ink-4: #98a2b3;
  --line: #d0d5dd;
  --line-soft: #eaecf0;
  --line-hard: #101828;

  /* 主色 - 深墨蓝 (咨询/金融报告标准色) */
  --navy: #0a2540;
  --navy-2: #1d4e7c;
  --navy-3: #3b7ea8;
  --navy-tint: #eaf0f6;

  /* 强调 - 砖红 (数据焦点/警示) */
  --accent: #b8322a;
  --accent-tint: #fdf0ef;

  /* 语义色 */
  --pos: #0e7c5a;      /* 正贡献 / 回收 */
  --pos-tint: #e8f5f0;
  --neg: #b8322a;      /* 消耗 / 负项 */
  --amber: #b26b12;    /* 中间项 */
  --grey: #667085;

  /* 图表色板 - 报告风固定 6 色，克制不花哨 */
  --c1: #0a2540;
  --c2: #1d4e7c;
  --c3: #3b7ea8;
  --c4: #7ba9c4;
  --c5: #b8322a;
  --c6: #0e7c5a;

  /* 排版 - 全无衬线，报告风不用衬线 */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-num: "SF Mono", "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;

  --fs-mega: 64px;     /* KPI 大数字 */
  --fs-kpi: 40px;      /* 次级 KPI */
  --fs-h1: 34px;       /* 章节标题 */
  --fs-h2: 20px;
  --fs-h3: 16px;
  --fs-body: 14px;     /* 报告风正文偏小，信息密度高 */
  --fs-small: 12px;
  --fs-micro: 10px;

  --lh-tight: 1.1;
  --lh-snug: 1.4;
  --lh-body: 1.65;

  /* 间距 - 4px 基准 */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;

  /* 网格 */
  --content-w: 1280px;   /* 报告风更宽，容纳更多数据 */
  --gutter: 40px;
  --col: 12;

  /* 零圆角 - 报告风不用圆角 */
  --r: 0px;
}

/* ---------- 重置 ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--navy-2); text-decoration: none; }
a:hover { text-decoration: underline; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }

/* 全站数字等宽对齐 */
table, .num { font-variant-numeric: tabular-nums; }

/* ---------- 报告页眉 (Report Header) ---------- */
.rp-header {
  border-bottom: 2px solid var(--navy);
  background: var(--paper);
}
.rp-header-inner {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 14px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.rp-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}
.rp-logo .mark {
  width: 28px; height: 28px;
  background: var(--navy);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; letter-spacing: -0.5px;
}
.rp-logo .txt {
  font-size: 14px; font-weight: 600; color: var(--ink);
  letter-spacing: 0.5px;
}
.rp-header-meta {
  display: flex; gap: 0;
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--ink-3);
  font-weight: 600;
}
.rp-header-meta span {
  padding: 0 14px;
  border-left: 1px solid var(--line);
}
.rp-header-meta span:last-child { padding-right: 0; }
.rp-header-meta .conf { color: var(--accent); }

/* ---------- 标题区 (Title Block) ---------- */
.rp-title {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  border-bottom: 1px solid var(--line);
}
.rp-title-main {
  background: var(--navy);
  color: #fff;
  padding: 40px 40px 36px;
  margin-right: -1px;
}
.rp-title-main .eyebrow {
  display: flex; align-items: center; gap: 12px;
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: rgba(255,255,255,0.6);
  font-weight: 700;
  margin-bottom: 20px;
}
.rp-title-main .eyebrow .no {
  background: var(--accent);
  color: #fff;
  padding: 3px 8px;
  letter-spacing: 1px;
}
.rp-title-main h1 {
  font-size: 46px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -1px;
  margin-bottom: 10px;
}
.rp-title-main .en {
  font-size: 15px;
  color: rgba(255,255,255,0.65);
  font-weight: 400;
  letter-spacing: 0.5px;
  margin-bottom: 24px;
  text-transform: uppercase;
}
.rp-title-main .spec {
  display: flex;
  gap: 0;
  border-top: 1px solid rgba(255,255,255,0.2);
  padding-top: 20px;
}
.rp-title-main .spec div {
  flex: 1;
  padding-right: 16px;
}
.rp-title-main .spec .k {
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.55);
  margin-bottom: 6px;
  font-weight: 600;
}
.rp-title-main .spec .v {
  font-size: 17px;
  font-weight: 600;
  color: #fff;
}
.rp-title-photo {
  position: relative;
  overflow: hidden;
  background: var(--navy);
}
.rp-title-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(100%) contrast(1.08);
  opacity: 0.92;
}
.rp-title-photo::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,37,64,0.15), rgba(10,37,64,0.55));
}
.rp-title-photo .cap {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 2;
  padding: 14px 20px;
  background: rgba(10,37,64,0.88);
  color: rgba(255,255,255,0.92);
  font-size: var(--fs-micro);
  letter-spacing: 0.5px;
  line-height: 1.5;
}
.rp-title-photo .cap b {
  display: block;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin-bottom: 4px;
  font-weight: 600;
}

/* ---------- KPI 数据带 ---------- */
.rp-kpi {
  border-bottom: 1px solid var(--line);
  background: var(--paper-alt);
}
.rp-kpi-inner {
  max-width: var(--content-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
}
.rp-kpi .kpi {
  padding: 22px 18px;
  border-right: 1px solid var(--line);
  background: var(--paper);
}
.rp-kpi .kpi:nth-child(odd) { background: var(--paper-alt); }
.rp-kpi .kpi:last-child { border-right: none; }
.rp-kpi .kpi .v {
  font-family: var(--font-num);
  font-size: var(--fs-kpi);
  font-weight: 700;
  line-height: 1;
  color: var(--navy);
  letter-spacing: -1.5px;
  font-variant-numeric: tabular-nums;
}
.rp-kpi .kpi .v small {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
  margin-left: 4px;
  letter-spacing: 0;
  font-family: var(--font-sans);
}
.rp-kpi .kpi .k {
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--ink-3);
  margin-top: 10px;
  font-weight: 600;
  line-height: 1.35;
}
.rp-kpi .kpi.hl { background: var(--navy); }
.rp-kpi .kpi.hl .v { color: #fff; }
.rp-kpi .kpi.hl .v small { color: rgba(255,255,255,0.6); }
.rp-kpi .kpi.hl .k { color: rgba(255,255,255,0.65); }

/* ---------- 执行摘要 (Executive Summary) ---------- */
.rp-exec {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 44px var(--gutter) 40px;
  border-bottom: 2px solid var(--navy);
}
.rp-exec-label {
  display: flex; align-items: center; gap: 12px;
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 22px;
}
.rp-exec-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.rp-exec-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-left: 1px solid var(--line);
}
.rp-exec .ex {
  padding: 0 28px;
  border-right: 1px solid var(--line);
}
.rp-exec .ex:first-child { padding-left: 0; }
.rp-exec .ex:last-child { border-right: none; }
.rp-exec .ex .no {
  font-family: var(--font-num);
  font-size: 11px;
  color: var(--ink-4);
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 10px;
}
.rp-exec .ex h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 10px;
  line-height: 1.35;
  letter-spacing: -0.2px;
}
.rp-exec .ex p {
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-2);
}
.rp-exec .ex p b { color: var(--ink); font-weight: 600; }
.rp-exec .ex .tag {
  display: inline-block;
  margin-top: 12px;
  font-family: var(--font-num);
  font-size: 10px;
  background: var(--navy-tint);
  color: var(--navy-2);
  padding: 3px 8px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* ---------- 主体 12 栏网格 ---------- */
.rp-body {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 0 var(--gutter) 80px;
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 48px;
}

/* 左侧章节索引 - 报告风细线数字 */
.rp-toc {
  position: sticky;
  top: 24px;
  align-self: start;
  padding-top: 44px;
}
.rp-toc-label {
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--ink-4);
  font-weight: 700;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--navy);
  margin-bottom: 4px;
}
.rp-toc ol { list-style: none; }
.rp-toc li { border-bottom: 1px solid var(--line-soft); }
.rp-toc li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  font-size: 12px;
  color: var(--ink-2);
  text-decoration: none;
  transition: all 0.12s;
}
.rp-toc li a:hover { color: var(--accent); text-decoration: none; padding-left: 4px; }
.rp-toc li .n {
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-4);
  min-width: 18px;
}
.rp-toc li.active a { color: var(--navy); font-weight: 700; }
.rp-toc li.active .n { color: var(--accent); }

/* 主内容 */
.rp-main { min-width: 0; padding-top: 44px; }

/* ---------- 章节 ---------- */
.rp-sec {
  margin-bottom: 72px;
  scroll-margin-top: 20px;
}
.rp-sec:last-child { margin-bottom: 0; }

/* 章节头 - 报告风：编号方块 + 标题 + Takeaway */
.rp-sec-head {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 20px;
  margin-bottom: 8px;
}
.rp-sec-no {
  width: 56px; height: 56px;
  background: var(--navy);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-num);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.rp-sec-title h2 {
  font-size: var(--fs-h1);
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.8px;
  line-height: 1.15;
  margin-bottom: 6px;
}
.rp-sec-title .en {
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--ink-4);
  font-weight: 600;
}

/* 关键结论条 - 报告风灵魂 */
.rp-takeaway {
  display: flex;
  gap: 14px;
  margin: 20px 0 28px;
  padding: 16px 20px;
  background: var(--navy-tint);
  border-left: 4px solid var(--navy);
}
.rp-takeaway .lbl {
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: 1.8px;
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
  padding-top: 3px;
}
.rp-takeaway .txt {
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink);
}
.rp-takeaway .txt b { color: var(--navy); font-weight: 700; }

.rp-sec p.body {
  font-size: var(--fs-body);
  line-height: 1.75;
  color: var(--ink-2);
  margin-bottom: 20px;
}
.rp-sec p.body b { color: var(--ink); font-weight: 600; }

/* ---------- 数据表格 (报告风核心组件) ---------- */
.rp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 4px;
  border-top: 2px solid var(--navy);
}
.rp-table caption {
  caption-side: top;
  text-align: left;
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: 1.8px;
  font-weight: 700;
  color: var(--ink-3);
  padding-bottom: 8px;
}
.rp-table thead th {
  background: var(--paper-alt);
  color: var(--navy);
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 700;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.rp-table tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
  vertical-align: top;
}
.rp-table tbody tr:hover { background: var(--paper-alt); }
.rp-table td.r, .rp-table th.r { text-align: right; font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.rp-table td.c, .rp-table th.c { text-align: center; }
.rp-table .strong { font-weight: 700; color: var(--navy); }
.rp-table tfoot td {
  padding: 10px 12px;
  border-top: 2px solid var(--navy);
  border-bottom: none;
  font-weight: 700;
  color: var(--navy);
  background: var(--paper-alt);
  font-family: var(--font-num);
}
.rp-table .sub {
  display: block;
  font-size: 11px;
  color: var(--ink-4);
  margin-top: 2px;
  font-weight: 400;
}
.rp-table tr.group td {
  background: var(--navy);
  color: #fff;
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: 1.8px;
  font-weight: 700;
  padding: 7px 12px;
  border: none;
}
.rp-table tr.group td .g-sum {
  float: right;
  font-family: var(--font-num);
  letter-spacing: 0;
}

/* 数据来源脚注 */
.rp-source {
  font-size: 11px;
  color: var(--ink-4);
  padding-top: 8px;
  margin-bottom: 24px;
  line-height: 1.6;
}
.rp-source b { color: var(--ink-3); font-weight: 600; }

/* ---------- 图表：帕累托条形 (物料平衡) ---------- */
.rp-chart {
  border: 1px solid var(--line);
  padding: 24px 28px 20px;
  margin-bottom: 8px;
  background: var(--paper);
}
.rp-chart-title {
  font-size: var(--fs-h3);
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
  letter-spacing: -0.2px;
}
.rp-chart-sub {
  font-size: 11px;
  color: var(--ink-4);
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.rp-pareto { position: relative; }
.rp-pareto-row {
  display: grid;
  grid-template-columns: 110px 1fr 70px 60px;
  gap: 14px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}
.rp-pareto-row.head {
  border-bottom: 1px solid var(--ink);
  padding-bottom: 7px;
  margin-bottom: 6px;
}
.rp-pareto-row.head span {
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 700;
  color: var(--ink-3);
}
.rp-pareto-row .nm { color: var(--ink); font-weight: 500; }
.rp-pareto-row .nm i {
  font-style: normal;
  display: block;
  font-size: 11px;
  color: var(--ink-4);
  margin-top: 1px;
}
.rp-pareto-row .track {
  height: 20px;
  background: var(--paper-dark);
  position: relative;
}
.rp-pareto-row .bar {
  height: 100%;
  background: var(--navy-2);
  position: relative;
}
.rp-pareto-row .bar.top3 { background: var(--navy); }
.rp-pareto-row .bar.resid { background: var(--accent); }
.rp-pareto-row .bar.byprod { background: var(--c4); }
/* 累计折线锚点 */
.rp-pareto-row .track::after {
  content: "";
  position: absolute;
  top: -3px; bottom: -3px;
  width: 2px;
  background: var(--accent);
  left: var(--cum, 0%);
  z-index: 2;
}
.rp-pareto-row .pct {
  font-family: var(--font-num);
  font-size: 13px;
  text-align: right;
  font-weight: 600;
  color: var(--ink);
}
.rp-pareto-row .cum {
  font-family: var(--font-num);
  font-size: 11px;
  text-align: right;
  color: var(--ink-4);
}

/* 帕累托图例 */
.rp-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  font-size: 11px;
  color: var(--ink-3);
}
.rp-legend i {
  display: inline-block;
  width: 14px; height: 10px;
  margin-right: 6px;
  vertical-align: middle;
}
.rp-legend .l1 { background: var(--navy); }
.rp-legend .l2 { background: var(--navy-2); }
.rp-legend .l3 { background: var(--accent); }
.rp-legend .l4 { background: var(--c4); }
.rp-legend .l5 { background: var(--accent); width: 2px; height: 12px; margin-right: 12px; }

/* ---------- 图表：瀑布图 (能耗) ---------- */
.rp-waterfall {
  border: 1px solid var(--line);
  padding: 24px 28px 20px;
  margin-bottom: 8px;
}
.rp-wf {
  position: relative;
  height: 260px;
  margin: 30px 0 8px;
  border-bottom: 1px solid var(--ink);
  border-left: 1px solid var(--ink);
}
.rp-wf .grid-line {
  position: absolute;
  left: 0; right: 0;
  border-top: 1px dotted var(--line);
  font-family: var(--font-num);
  font-size: 10px;
  color: var(--ink-4);
}
.rp-wf .grid-line span {
  position: absolute;
  right: 4px;
  top: -14px;
  background: var(--paper);
  padding: 0 3px;
}
.rp-wf .col {
  position: absolute;
  bottom: 0;
  height: 0;              /* 高度为 0，作为瀑布图定位基线 */
}
.rp-wf .col .bar {
  position: absolute;     /* 必须 absolute，bottom 才相对 col 基线生效 */
  left: 0;
  width: 100%;
  min-height: 2px;        /* 极小项（如净化水 +0.02）仍可见 */
  background: var(--navy-2);
}
.rp-wf .col.plus .bar { background: var(--navy-2); }
.rp-wf .col.minus .bar { background: var(--pos); }
.rp-wf .col.total .bar { background: var(--navy); }
.rp-wf .col .bar .val {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-num);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  color: var(--ink);
}
.rp-wf .col .xlab {
  position: absolute;
  bottom: -24px;
  font-size: 9px;
  color: var(--ink-3);
  text-align: center;
  line-height: 1.25;
  white-space: nowrap;
  left: 50%;
  transform: translateX(-50%);
}
/* 连接线 */
.rp-wf .connector {
  position: absolute;
  height: 1px;
  background: var(--ink-4);
  z-index: 3;
}

/* 瀑布图下方的能耗明细表 */
.rp-wf-note {
  display: flex;
  gap: 14px;
  margin-top: 40px;
  padding: 14px 18px;
  background: var(--paper-alt);
  border-left: 3px solid var(--navy);
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-2);
}
.rp-wf-note b { color: var(--navy); font-weight: 700; }

/* ---------- 投入产出流向矩阵 ---------- */
.rp-io {
  display: grid;
  grid-template-columns: 1fr 90px 2fr;
  border: 1px solid var(--line);
}
.rp-io-col { padding: 20px 22px; }
.rp-io-col.mid {
  background: var(--paper-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}
.rp-io-col h4 {
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: 1.8px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.rp-io-col h4.down { color: var(--pos); }
.rp-io-item {
  padding: 9px 0 9px 12px;
  border-left: 3px solid var(--navy-3);
  margin-bottom: 8px;
  background: var(--paper-alt);
}
.rp-io-item.down { border-left-color: var(--c6); }
.rp-io-item .n { font-size: 13px; font-weight: 600; color: var(--ink); }
.rp-io-item .m { font-size: 11px; color: var(--ink-3); margin-top: 3px; line-height: 1.5; }
.rp-io-item .m b { font-family: var(--font-num); color: var(--navy); font-weight: 700; }
.rp-io-center {
  text-align: center;
}
.rp-io-center .box {
  background: var(--navy);
  color: #fff;
  padding: 20px 16px;
}
.rp-io-center .box .nm { font-size: 19px; font-weight: 700; margin-bottom: 6px; letter-spacing: -0.3px; }
.rp-io-center .box .mt { font-size: 11px; color: rgba(255,255,255,0.7); line-height: 1.5; }
.rp-io-center .arrow { font-size: 20px; color: var(--ink-4); margin: 10px 0; }

/* ---------- 三剂 / 化学品条 ---------- */
.rp-chem-bars { margin-top: 4px; }
.rp-chem-row {
  display: grid;
  grid-template-columns: 130px 1fr 80px;
  gap: 14px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}
.rp-chem-row .nm { font-weight: 500; }
.rp-chem-row .nm i { font-style: normal; font-size: 11px; color: var(--ink-4); display: block; }
.rp-chem-row .track { height: 16px; background: var(--paper-dark); }
.rp-chem-row .bar { height: 100%; background: var(--c3); }
.rp-chem-row .bar.hi { background: var(--navy); }
.rp-chem-row .v { font-family: var(--font-num); text-align: right; font-weight: 600; }

/* ---------- 财务数据矩阵 ---------- */
.rp-fin {
  border-top: 2px solid var(--navy);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.rp-fin .f {
  padding: 20px 18px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.rp-fin .f:nth-child(4n) { border-right: none; }
.rp-fin .f .k {
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
  color: var(--ink-4);
  margin-bottom: 10px;
  line-height: 1.35;
  min-height: 26px;
}
.rp-fin .f .v {
  font-family: var(--font-num);
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.8px;
  line-height: 1.2;
}
.rp-fin .f .v small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
  margin-top: 4px;
  letter-spacing: 0;
  font-family: var(--font-sans);
}
.rp-fin .f .d {
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.6;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dotted var(--line);
}
.rp-fin .f .src {
  font-family: var(--font-num);
  font-size: 10px;
  color: var(--ink-4);
  margin-top: 8px;
}
.rp-fin .f.hl { background: var(--navy); }
.rp-fin .f.hl .k { color: rgba(255,255,255,0.6); }
.rp-fin .f.hl .v { color: #fff; }
.rp-fin .f.hl .v small { color: rgba(255,255,255,0.65); }
.rp-fin .f.hl .d { color: rgba(255,255,255,0.85); border-top-color: rgba(255,255,255,0.25); }
.rp-fin .f.hl .src { color: rgba(255,255,255,0.5); }
.rp-fin .f.wide { grid-column: span 2; }

/* ---------- 备注 / 免责 ---------- */
.rp-note {
  margin-top: 28px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  background: var(--paper-alt);
  font-size: 12px;
  line-height: 1.75;
  color: var(--ink-2);
}
.rp-note .t {
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: 1.8px;
  font-weight: 700;
  color: var(--ink-3);
  margin-bottom: 8px;
}
.rp-note b { color: var(--ink); font-weight: 600; }

/* ---------- 页脚 ---------- */
.rp-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.8);
  padding: 40px 0 28px;
  margin-top: 72px;
}
.rp-footer-inner {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.rp-footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255,255,255,0.18);
}
.rp-footer h5 {
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 10px;
  font-weight: 700;
}
.rp-footer p { font-size: 12px; line-height: 1.7; color: rgba(255,255,255,0.8); }
.rp-footer a { color: #fff; text-decoration: underline; }
.rp-footer .meta-row {
  display: flex;
  justify-content: space-between;
  padding-top: 16px;
  font-family: var(--font-num);
  font-size: 10px;
  letter-spacing: 0.5px;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  :root { --content-w: 100%; --gutter: 24px; --fs-mega: 48px; --fs-kpi: 32px; --fs-h1: 28px; }
  .rp-title { grid-template-columns: 1fr; }
  .rp-title-main { margin-right: 0; padding: 32px 24px; }
  .rp-kpi-inner { grid-template-columns: repeat(3, 1fr); }
  .rp-kpi .kpi { border-bottom: 1px solid var(--line); }
  .rp-exec-grid { grid-template-columns: 1fr; border-left: none; }
  .rp-exec .ex { padding: 16px 0; border-right: none; border-bottom: 1px solid var(--line); }
  .rp-body { grid-template-columns: 1fr; gap: 24px; }
  .rp-toc { position: relative; top: 0; padding-top: 24px; }
  .rp-toc ol { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 12px; }
  .rp-fin { grid-template-columns: repeat(2, 1fr); }
  .rp-fin .f:nth-child(4n) { border-right: 1px solid var(--line); }
  .rp-fin .f:nth-child(2n) { border-right: none; }
  .rp-fin .f.wide { grid-column: span 2; }
  .rp-io { grid-template-columns: 1fr; }
  .rp-io-col.mid { border: none; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 16px; }
  .rp-pareto-row { grid-template-columns: 90px 1fr 56px; }
  .rp-pareto-row .cum { display: none; }
}

@media print {
  .rp-toc, .rp-header { display: none; }
  .rp-sec { page-break-inside: avoid; }
  body { font-size: 11px; }
}

/* =========================================================
   生成器补充组件（递归渲染 / 交互态）
   ========================================================= */

/* ---------- 嵌套表格（通用递归渲染时缩进展示） ---------- */
.rp-table--inner {
  width: 100%;
  margin: 4px 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
  background: transparent;
}
.rp-table--inner td {
  padding: 5px 10px;
  border-bottom: 1px dotted var(--line-soft);
  color: var(--ink);
  line-height: 1.55;
}
.rp-table--inner td:first-child {
  width: 42%;
  color: var(--ink-3);
  font-weight: 500;
}
.rp-table--inner tr:last-child td { border-bottom: none; }
.rp-table--inner .rp-table--inner {
  background: var(--paper-alt);
}

/* 嵌套列表 */
.rp-list {
  list-style: none;
  margin: 4px 0;
}
.rp-list li {
  position: relative;
  padding: 5px 0 5px 16px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-2);
  border-bottom: 1px dotted var(--line-soft);
}
.rp-list li:last-child { border-bottom: none; }
.rp-list li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--ink-4);
}

/* ---------- 表格行选中态（横向对照长表格） ---------- */
.rp-table tbody tr.rp-row-sel {
  background: var(--navy-tint) !important;
  box-shadow: inset 3px 0 0 var(--navy);
}
.rp-table tbody tr { cursor: pointer; }

/* ---------- 无照片时的标题块 ---------- */
.rp-title[style*="1fr"] .rp-title-main {
  padding: 44px 40px 40px;
}
.rp-title[style*="1fr"] .rp-title-main h1 { font-size: 52px; }

/* ---------- 章节内嵌说明块 ---------- */
.rp-sec > .rp-table { margin-bottom: 4px; }
.rp-sec > .rp-chart,
.rp-sec > .rp-waterfall { margin-top: 4px; }

/* ---------- 打印优化 ---------- */
@media print {
  .rp-toc { display: none !important; }
  .rp-body { grid-template-columns: 1fr; }
  .rp-sec { page-break-inside: avoid; }
  .rp-table { page-break-inside: auto; }
  .rp-table thead { display: table-header-group; }
  .rp-header { position: static; }
  body { font-size: 10.5px; }
  .rp-title-main { padding: 20px 0; }
}

/* ---------- 修复：span 嵌套条形图不显示 ----------
   .bar 是 .track（block）的子元素，span 默认 inline，
   height 对 inline 无效导致条形高度塌为 0 */
.rp-pareto-row .track,
.rp-pareto-row .bar,
.rp-chem-row .track,
.rp-chem-row .bar {
  display: block;
}

/* ---------- 页眉导航 + 搜索 ---------- */
.rp-header-inner { gap: 20px; }
.rp-header-nav {
  display: flex;
  gap: 18px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.rp-header-nav a { color: var(--ink-2); text-decoration: none; padding: 4px 0; }
.rp-header-nav a:hover { color: var(--accent); }

.rp-search { position: relative; flex: 1; max-width: 260px; }
.rp-search input {
  width: 100%;
  padding: 7px 12px;
  border: 1px solid var(--line);
  background: var(--paper-alt);
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--ink);
  outline: none;
}
.rp-search input:focus {
  border-color: var(--navy);
  background: var(--paper);
}
.rp-search-results {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  z-index: 50;
  background: var(--paper);
  border: 1px solid var(--navy);
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.12);
  max-height: 380px;
  overflow-y: auto;
}
.rp-sr-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft);
  text-decoration: none;
}
.rp-sr-item:last-child { border-bottom: none; }
.rp-sr-item:hover { background: var(--navy-tint); }
.rp-sr-item .n { font-size: 13px; font-weight: 600; color: var(--ink); }
.rp-sr-item .d { font-size: 11px; color: var(--ink-4); white-space: nowrap; }
.rp-sr-empty {
  padding: 12px;
  font-size: 12px;
  color: var(--ink-4);
  text-align: center;
}

/* ---------- 全场流程图容器 ---------- */
.rp-diagram-card {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 24px;
}
.rp-diagram-card svg { width: 100%; height: auto; display: block; }
.rp-diagram-card .legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}
.rp-diagram-card .legend .item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-2);
}
.rp-diagram-card .legend .dot {
  width: 12px; height: 12px;
  border: 1px solid var(--line);
}

@media (max-width: 1100px) {
  .rp-header-inner { flex-wrap: wrap; }
  .rp-header-nav { order: 3; width: 100%; gap: 14px; }
  .rp-search { max-width: none; }
}

/* ---------- 全场流程图：主站 node 配色变量（从主站 main.css :root 提取，值保持一致） ---------- */
:root {
  --text: #1d1d1f;
  --text-soft: #6e6e73;
  --text-muted: #86868b;
  --node-refining: #ebebef;
  --node-refining-stroke: #d4d4d8;
  --node-refining-label: #1d1d1f;
  --node-chemical: #cce4ff;
  --node-chemical-stroke: #99c2ff;
  --node-chemical-label: #0058a3;
  --node-storage: #fde68a;
  --node-storage-stroke: #fbbf24;
  --node-storage-label: #7c5800;
  --node-utility: #d1fae5;
  --node-utility-stroke: #6ee7b7;
  --node-utility-label: #1d6b3a;
  --node-product: #ebebef;
  --node-pending-stroke: #c44e52;
}

/* ---------- 反馈修正（2026-09-04 海豹） ---------- */
/* 1) 标题块贴边全宽，与 KPI 数据带左右边缘对齐（原 padding 造成标题窄 80px） */
.rp-title { padding: 0; }
.rp-title-photo img { border-radius: 0; }
/* 2) VSD 原图内嵌容器：限高滚动，避免页面被 2188px 高的图拉长 */
.rp-vsd-frame {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 8px;
  max-height: 720px;
  overflow: auto;
}
.rp-vsd-frame img {
  width: 100%;
  min-width: 900px;
  height: auto;
  display: block;
}
