/* 隐患排查治理页（EHS 双控系统清单）：补充 anomaly-center.css 未覆盖的专用样式 */
.ehs-level { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; line-height: 20px; white-space: nowrap; background: #eef2f8; color: #5a7291; }
.ehs-level::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; }
.ehs-level.major { background: #fdeceb; color: #cf2a20; }
.ehs-level.larger { background: #fef3e6; color: #c4700f; }
.ehs-level.general { background: #eaf2ff; color: #1663d6; }
.ehs-level.unknown { background: #f1f4f9; color: #78899c; }

.ehs-due { display: inline-flex; flex-direction: column; gap: 2px; font-size: 12.5px; color: #33506f; white-space: nowrap; }
.ehs-due small { font-size: 11px; color: #8496ab; }
.ehs-due.is-overdue { color: #cf2a20; font-weight: 600; }
.ehs-due.is-overdue small { color: #cf2a20; font-weight: 500; }
.ehs-due.is-soon { color: #c4700f; }
.ehs-due.is-soon small { color: #c4700f; }

.lg-row.is-overdue td:first-child { box-shadow: inset 3px 0 0 #e2483c; }
.lg-row.is-overdue:hover td:first-child { box-shadow: inset 3px 0 0 #cf2a20; }

.ehs-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: #33506f; padding: 0 10px; height: 32px; border: 1px solid #dde6f2; border-radius: 8px; background: #fff; cursor: pointer; white-space: nowrap; }
.ehs-check input { accent-color: #1674ff; margin: 0; }
.ehs-check:hover { border-color: #b7cdea; }

.ehs-detail-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.ehs-tag { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 20px; font-size: 12px; line-height: 20px; background: #eef2f8; color: #5a7291; }
.ehs-tag.danger { background: #fdeceb; color: #cf2a20; font-weight: 600; }
.ehs-detail-text { margin: 0 0 16px; font-size: 13px; line-height: 1.85; color: #33506f; background: #fafcff; border: 1px solid #eef3fa; border-radius: 8px; padding: 12px 14px; white-space: pre-wrap; word-break: break-word; }
.ehs-detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 0; background: #eef3fa; border: 1px solid #eef3fa; border-radius: 10px; overflow: hidden; }
.ehs-detail-list > div { background: #fff; padding: 10px 12px; }
.ehs-detail-list dt { font-size: 11.5px; color: #8496ab; margin-bottom: 3px; }
.ehs-detail-list dd { margin: 0; font-size: 13px; color: #10274b; word-break: break-all; }
.ehs-photos { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.ehs-photos > div { flex: 1 1 200px; border: 1px solid #eef3fa; border-radius: 8px; padding: 10px 12px; background: #fafcff; display: flex; flex-direction: column; gap: 6px; }
.ehs-photos span { font-size: 11.5px; color: #8496ab; }
.ehs-photos a { font-size: 13px; color: #1674ff; text-decoration: none; }
.ehs-photos em { font-size: 12.5px; color: #5a7291; font-style: normal; word-break: break-all; }
.ehs-source-photos { margin: 0 0 16px; color: #5a7291; font-size: 12px; }
.ehs-photo-preview { display: block; }
.ehs-photo-preview img { display: block; width: 100%; max-height: 260px; object-fit: contain; border-radius: 6px; background: #edf5ff; }

@media (max-width: 900px) {
  .ehs-detail-list { grid-template-columns: 1fr; }
}

/* 台账照片列：链接化展示，文本型文件名截断 */
.lg-photo { color: #1674ff; text-decoration: none; white-space: nowrap; }
.lg-photo:hover { text-decoration: underline; }
.lg-photo-text { display: inline-block; max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; color: #5b7594; }

/* 隐患页沿用主区域留白，与异常管理页保持同一套清爽布局 */
.main-content.ehs-page {
  padding: 14px 18px 18px;
}

.ehs-page .ehs-hero {
  position: relative;
  isolation: isolate;
  align-items: center;
  margin: 0;
  padding: 12px 20px;
  min-height: 72px;
  background: linear-gradient(105deg, #0e3266, #12487e 64%, #3f78aa);
}

.ehs-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 0 19%;
  background:
    linear-gradient(180deg, #183d6233 5%, #234c7920 65%, #376897bd),
    url("../assets/factory-panorama.png") center 40% / cover no-repeat;
  background-image:
    linear-gradient(180deg, #183d6233 5%, #234c7920 65%, #376897bd),
    image-set(
      url("../assets/factory-panorama.webp") type("image/webp"),
      url("../assets/factory-panorama.png") type("image/png")
    );
  mask-image: linear-gradient(90deg, transparent 0%, #0004 19%, #000b 41%, #000 63%);
}

.ehs-page .ehs-hero h2 {
  color: #fff;
  font-size: clamp(21px, 2vw, 30px);
  font-weight: 700;
  text-shadow: 0 2px 8px #00162b80;
}

.ehs-hero .lg-head-actions { flex-wrap: wrap; }
.ehs-hero .lg-btn { color: #fff; background: #173b65e8; border-color: #9cc5ebbb; }
.ehs-hero .lg-btn:hover { color: #fff; background: #255786; border-color: #c4e5ff; }
.ehs-hero .lg-btn.primary { background: #1260cb; border-color: #9cc5ebbb; }

.ehs-overview { padding: 0 10px 10px; }
.ehs-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.ehs-kpi {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.2vw, 18px);
  min-height: 104px;
  padding: 12px clamp(9px, 1.2vw, 18px);
  border: 1px solid #ffffffcc;
  border-radius: 11px;
  background:
    radial-gradient(ellipse at 99% 110%, #ffffff46 0%, #ffffff14 27%, transparent 42%),
    linear-gradient(125deg, var(--kpi-glow), var(--kpi-dark) 38%, var(--kpi-dark) 66%, var(--kpi-glow));
  box-shadow: inset 0 0 13px #ffffff35, 0 4px 12px #1a66a536;
  color: #fff;
}
.ehs-kpi.blue { --kpi-dark: #0759c9; --kpi-glow: #0d96e9; }
.ehs-kpi.red { --kpi-dark: #b63246; --kpi-glow: #ee6471; }
.ehs-kpi.amber { --kpi-dark: #a95705; --kpi-glow: #eb9c16; }
.ehs-kpi.green { --kpi-dark: #007a56; --kpi-glow: #0aae78; }
.ehs-kpi.violet { --kpi-dark: #4536c1; --kpi-glow: #7666e9; }
.ehs-kpi > .icon { width: clamp(22px, 2.5vw, 38px); height: auto; stroke-width: 2; }
.ehs-kpi > div { min-width: 0; }
.ehs-kpi span { display: block; font-size: 13px; font-weight: 650; }
.ehs-kpi strong { display: block; margin-top: 2px; font-size: clamp(22px, 2.5vw, 38px); line-height: 1.12; font-variant-numeric: tabular-nums; }
.ehs-kpi small { margin-left: 5px; font-size: 12px; }
.ehs-kpi p { margin: 3px 0 0; font-size: 12px; }

.ehs-charts {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.28fr) minmax(0, 1.04fr);
  gap: 10px;
  margin-top: 10px;
}
.ehs-chart {
  display: flex;
  flex-direction: column;
  min-height: 200px;
  overflow: hidden;
  border: 1px solid #f8fcff;
  border-radius: 11px;
  background: linear-gradient(135deg, #f5faff, #e8f3ff);
  box-shadow: 0 3px 9px #36689f19;
}
.ehs-chart header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 5px 12px;
  min-height: 39px;
  padding: 7px 12px;
  background: linear-gradient(100deg, #e9f3ff, #d4e8fc);
}
.ehs-chart h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; }
.ehs-chart h3::before { content: ""; width: 4px; height: 17px; border-radius: 4px; background: #1674ff; }
.ehs-chart-empty { display: grid; flex: 1; place-items: center; margin: 0; color: #5d7496; }

.ehs-level-chart {
  display: grid;
  grid-template-columns: minmax(74px, 132px) minmax(90px, 1fr);
  flex: 1;
  align-items: center;
  gap: clamp(8px, 1.6vw, 22px);
  padding: 10px 14px;
}
.ehs-ring { display: grid; place-items: center; aspect-ratio: 1; border-radius: 50%; background: var(--ring); }
.ehs-ring > span {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  width: 69%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #eef6ff;
  font-size: 11px;
  white-space: nowrap;
}
.ehs-ring strong { font-size: clamp(15px, 1.55vw, 23px); font-variant-numeric: tabular-nums; }
.ehs-level-legend, .ehs-sources { list-style: none; margin: 0; padding: 0; }
.ehs-level-legend li { display: flex; justify-content: space-between; gap: 4px; padding: 5px 0; border-bottom: 1px solid #d8e8f8; white-space: nowrap; }
.ehs-level-legend li:last-child { border: 0; }
.ehs-level-legend span { display: flex; align-items: center; gap: 6px; }
.ehs-level-legend span::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--level-color); }

.ehs-trend { flex: 1; width: 100%; min-height: 145px; padding: 4px 8px 0; }
.ehs-trend text { font-size: 11px; fill: #3c5778; }
.ehs-trend-grid line { stroke: #cadff4; }
.ehs-trend-bars { fill: #2585f8; }
.ehs-trend-line { fill: none; stroke: #008965; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.ehs-trend-legend { display: flex; gap: 10px; font-size: 11px; color: #385574; white-space: nowrap; }
.ehs-trend-legend span { display: inline-flex; align-items: center; gap: 4px; }
.ehs-trend-legend span::before { content: ""; width: 12px; height: 7px; border-radius: 3px; background: #2585f8; }
.ehs-trend-legend span + span::before { height: 2px; background: #008965; }

.ehs-sources { display: grid; align-content: center; flex: 1; gap: 8px; padding: 10px 12px; }
.ehs-sources li { display: grid; grid-template-columns: minmax(68px, 1fr) minmax(35px, 2fr) minmax(26px, auto); gap: 7px; align-items: center; }
.ehs-sources li > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ehs-sources li > div { height: 8px; border-radius: 8px; background: #dbe9f9; overflow: hidden; }
.ehs-sources i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #1481ff, #124ddd); }
.ehs-sources li:nth-child(2) i { background: #0097ad; }
.ehs-sources li:nth-child(3) i { background: #08a86b; }
.ehs-sources li:nth-child(4) i { background: #e89519; }
.ehs-sources li:nth-child(5) i { background: #7251ed; }
.ehs-sources li > b { justify-self: end; font-variant-numeric: tabular-nums; }

.ehs-page .lg-panel { overflow: visible; margin: 0; border-color: #e1eaf5; background: #fff; }
.ehs-page .lg-table-wrap { max-height: calc(100dvh - var(--header, 58px) - var(--footer, 36px) - 210px); }
.ehs-page .lg-status, .ehs-page .ehs-level { border-radius: 5px; }
.ehs-page .ehs-level::before { display: none; }
.ehs-page .ehs-level.general { background: #ebf3ff; color: #1d64cf; }
.ehs-page .lg-status.closed { background: #e8f7f0; color: #12845b; }
.ehs-page .lg-status.processing { background: #fff4e0; color: #b56b08; }
.ehs-page .lg-status.pending { background: #fdeceb; color: #cf2a20; }
.ehs-page .ehs-action { text-align: center; }
.ehs-detail-button { border: 1px solid #d5e4f7; border-radius: 5px; padding: 2px 8px; color: #1665d8; background: #f7fbff; white-space: nowrap; font-size: 12px; cursor: pointer; }
.ehs-detail-button:hover { background: #e8f2ff; border-color: #9bc1f5; }
.ehs-record-number { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ehs-page .lg-foot { padding: 9px 12px; background: #fafcff; border-radius: 0 0 10px 10px; }

.ehs-charts-collapse { margin-bottom: 8px; }
.ehs-charts-collapse > summary { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 6px; border: 1px solid #dce6f4; background: #fff; color: #46648a; font-size: 12px; cursor: pointer; user-select: none; }
.ehs-charts-collapse > summary:hover { border-color: #9dc2f5; color: #1674ff; }
.ehs-charts-collapse[open] > summary { margin-bottom: 8px; color: #1674ff; border-color: #9dc2f5; background: #f5f9ff; }
.ehs-charts-collapse .ehs-overview { padding: 0; }

@media (max-width: 1120px) {
  .ehs-kpi { gap: 6px; }
  .ehs-kpi small { margin-left: 3px; }
  .ehs-kpi > .icon { width: 22px; }
  .ehs-charts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 740px) {
  .ehs-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .ehs-kpi { min-height: 76px; }
  .ehs-charts { grid-template-columns: minmax(0, 1fr); }
  .ehs-page .lg-table-wrap { max-height: none; }
}

.ehs-page #ehs-department { max-width: 155px; }
