/* RoofScan 报告模板样式 — 视觉真源: docs/report.html
 * 全部挂在 .report-tpl 下，避免与主站全局样式冲突
 */
.report-tpl {
  --rpt-primary: #1f4e8c;
  --rpt-danger: #b3261e;
  --rpt-warning: #9a6700;
  --rpt-success: #1e7d44;
  --rpt-purple: #5b3a8c;
  --rpt-bg: #f4f6f9;
  --rpt-card: #fff;
  --rpt-ink: #1d2733;
  --rpt-muted: #6b7785;
  --rpt-line: #e6e9ee;
  --rpt-shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .05);
  --rpt-radius: 14px;

  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--rpt-bg);
  color: var(--rpt-ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.report-tpl *,
.report-tpl *::before,
.report-tpl *::after {
  box-sizing: border-box;
}

/* ===== Header ===== */
.report-tpl .hd {
  background: linear-gradient(120deg, #0f2747 0%, #1f4e8c 100%);
  color: #fff;
  padding: 46px 44px 34px;
  position: relative;
  overflow: hidden;
}
.report-tpl .hd::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -80px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .05);
}
.report-tpl .hd-top {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  z-index: 1;
}
.report-tpl .hd-mark {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .14);
  display: flex;
  align-items: center;
  justify-content: center;
}
.report-tpl .hd-mark svg {
  width: 26px;
  height: 26px;
}
.report-tpl .hd h1 {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: .4px;
  margin: 0;
  color: #fff;
}
.report-tpl .hd .sub {
  font-size: 14px;
  color: #aebfd6;
  margin-top: 3px;
  font-weight: 400;
  letter-spacing: 1px;
}
.report-tpl .hd-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 22px;
  position: relative;
  z-index: 1;
}
.report-tpl .hd-meta span {
  font-size: 12.5px;
  color: #cdd9ec;
  background: rgba(255, 255, 255, .1);
  padding: 6px 14px;
  border-radius: 20px;
  letter-spacing: .3px;
}

.report-tpl .wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 34px 20px 28px;
}

/* ===== KPI ===== */
.report-tpl .kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 16px;
  margin-bottom: 30px;
}
.report-tpl .kpi {
  background: var(--rpt-card);
  border-radius: var(--rpt-radius);
  padding: 22px 20px;
  box-shadow: var(--rpt-shadow);
  border: 1px solid var(--rpt-line);
  position: relative;
  overflow: hidden;
}
.report-tpl .kpi::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--rpt-primary);
}
.report-tpl .kpi.k-danger::before { background: var(--rpt-danger); }
.report-tpl .kpi.k-warning::before { background: var(--rpt-warning); }
.report-tpl .kpi.k-success::before { background: var(--rpt-success); }
.report-tpl .kpi .v {
  font-size: 38px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.5px;
  font-variant-numeric: tabular-nums;
  color: var(--rpt-primary);
}
.report-tpl .kpi.k-danger .v { color: var(--rpt-danger); }
.report-tpl .kpi.k-warning .v { color: var(--rpt-warning); }
.report-tpl .kpi.k-success .v { color: var(--rpt-success); }
.report-tpl .kpi .l {
  font-size: 12.5px;
  color: var(--rpt-muted);
  margin-top: 8px;
  letter-spacing: .3px;
}

/* ===== Section ===== */
.report-tpl .sec {
  background: var(--rpt-card);
  border-radius: var(--rpt-radius);
  box-shadow: var(--rpt-shadow);
  border: 1px solid var(--rpt-line);
  margin-bottom: 22px;
  overflow: hidden;
}
.report-tpl .sec-h {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 17px 24px;
  border-bottom: 1px solid var(--rpt-line);
}
.report-tpl .ico {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.report-tpl .ico svg {
  width: 19px;
  height: 19px;
  display: block;
}
.report-tpl .ic-indigo { background: #eaf0fa; color: #1f4e8c; }
.report-tpl .ic-red { background: #fbecea; color: #b3261e; }
.report-tpl .ic-orange { background: #fbf0e6; color: #9a5600; }
.report-tpl .ic-green { background: #e9f5ee; color: #1e7d44; }
.report-tpl .ic-purple { background: #f1ebf8; color: #5b3a8c; }
.report-tpl .sec-t {
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: .3px;
}
.report-tpl .sec-b { padding: 20px 24px; }
.report-tpl .sec-b.sec-b-flush { padding: 0; }

/* conclusion */
.report-tpl .concl {
  background: #f3f6fb;
  border-left: 3px solid var(--rpt-primary);
  border-radius: 0 10px 10px 0;
  padding: 18px 22px;
  font-size: 14.5px;
  line-height: 1.8;
  color: #28384d;
}
.report-tpl .concl strong {
  color: var(--rpt-primary);
  font-weight: 600;
}

/* table */
.report-tpl .tw { overflow-x: auto; }
.report-tpl table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.report-tpl th {
  background: #f7f9fc;
  padding: 11px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 12.5px;
  color: var(--rpt-muted);
  white-space: nowrap;
  border-bottom: 1px solid var(--rpt-line);
}
.report-tpl td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--rpt-line);
  vertical-align: middle;
  color: var(--rpt-ink);
}
.report-tpl tbody tr:last-child td { border-bottom: none; }
.report-tpl tbody tr:hover td { background: #fafbfd; }
.report-tpl .rpt-badge {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.report-tpl .b-high { background: #fbecea; color: #b3261e; }
.report-tpl .b-mid { background: #fbf3e3; color: #9a5600; }
.report-tpl .b-low { background: #e9f5ee; color: #1e7d44; }
.report-tpl .bar-svg {
  display: inline-block;
  width: 88px;
  height: 8px;
  vertical-align: middle;
  margin-right: 9px;
  overflow: visible;
}
.report-tpl .bar {
  width: 88px;
  height: 6px;
  border-radius: 4px;
  background: #e3e7ee;
  display: inline-block;
  vertical-align: middle;
  margin-right: 9px;
  overflow: hidden;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.report-tpl .bar-fill {
  display: block;
  height: 100%;
  min-height: 6px;
  border-radius: 4px;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
/* 兼容旧结构 .bar > i */
.report-tpl .bar i {
  display: block;
  height: 100%;
  min-height: 6px;
  border-radius: 4px;
}
.report-tpl .bar.d i,
.report-tpl .bar.d .bar-fill { background-color: #b3261e; }
.report-tpl .bar.w i,
.report-tpl .bar.w .bar-fill { background-color: #9a6700; }
.report-tpl .bar.s i,
.report-tpl .bar.s .bar-fill { background-color: #1e7d44; }

/* repair */
.report-tpl .note {
  font-size: 13px;
  color: var(--rpt-muted);
  background: #f3f6fb;
  border-left: 3px solid var(--rpt-primary);
  border-radius: 0 8px 8px 0;
  padding: 11px 16px;
  margin-bottom: 14px;
  line-height: 1.7;
}
.report-tpl .grp { margin-bottom: 20px; }
.report-tpl .grp:last-child { margin-bottom: 0; }
.report-tpl .gtag {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 15px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  letter-spacing: .3px;
}
.report-tpl .gtag .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .95);
}
.report-tpl .t-urgent { background: linear-gradient(135deg, #c0392b, #b3261e); }
.report-tpl .t-med { background: linear-gradient(135deg, #b9770b, #9a6700); }
.report-tpl .t-long { background: linear-gradient(135deg, #2f5fa3, #1f4e8c); }
.report-tpl ul.rlist {
  list-style: none;
  margin: 11px 0 0;
  padding: 0;
}
.report-tpl ul.rlist li {
  position: relative;
  padding: 9px 14px 9px 28px;
  background: #fafbfd;
  border-radius: 8px;
  margin-bottom: 7px;
  font-size: 14px;
  border: 1px solid #f0f2f6;
}
.report-tpl ul.rlist li::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 17px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--rpt-primary);
}

/* cost */
.report-tpl .cat { font-weight: 600; white-space: nowrap; }
.report-tpl .c-mat { color: #b3261e; }
.report-tpl .c-lab { color: #1e7d44; }
.report-tpl .c-oth { color: #1f4e8c; }
.report-tpl .num {
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.report-tpl tr.sub td {
  background: #f6f8fb;
  font-weight: 600;
}
.report-tpl tr.total td {
  background: #eef3fb;
  font-weight: 700;
  font-size: 15px;
  color: #1f4e8c;
}

/* schedule */
.report-tpl .sch {
  list-style: none;
  counter-reset: s;
  margin: 0;
  padding: 0;
}
.report-tpl .sch li {
  counter-increment: s;
  position: relative;
  padding: 13px 18px 13px 54px;
  background: #fafbfd;
  border-radius: 10px;
  margin-bottom: 9px;
  font-size: 14px;
  border: 1px solid #f0f2f6;
}
.report-tpl .sch li::before {
  content: counter(s);
  position: absolute;
  left: 16px;
  top: 13px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: var(--rpt-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
}
.report-tpl .sch .d {
  float: right;
  color: var(--rpt-primary);
  font-weight: 600;
}
.report-tpl .cap {
  font-size: 13px;
  color: var(--rpt-muted);
  margin-top: 12px;
  padding-left: 4px;
}

.report-tpl .ft {
  text-align: center;
  padding: 26px 20px;
  color: var(--rpt-muted);
  font-size: 12.5px;
  border-top: 1px solid var(--rpt-line);
  margin-top: 10px;
  letter-spacing: .3px;
}

.report-tpl .rd-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 8px 20px 28px;
}

@media print {
  .report-tpl { background: #fff; }
  .report-tpl .hd {
    background: #0f2747 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .report-tpl .sec,
  .report-tpl .kpi,
  .report-tpl tr,
  .report-tpl .grp,
  .report-tpl .sch li,
  .report-tpl .concl,
  .report-tpl .note {
    break-inside: avoid;
    page-break-inside: avoid;
    box-shadow: none;
  }
  .report-tpl .no-print,
  .no-print { display: none !important; }
}

@media (max-width: 620px) {
  .report-tpl .hd { padding: 34px 22px 26px; }
  .report-tpl .hd h1 { font-size: 23px; }
  .report-tpl .kpis { grid-template-columns: 1fr 1fr; }
  .report-tpl .kpi .v { font-size: 30px; }
  .report-tpl table { font-size: 12.5px; }
  .report-tpl th,
  .report-tpl td { padding: 8px 10px; }
}
