/* ============================================================
   异常管理台账 v2（lg-*）
   规格见 docs/DESIGN-SPEC-异常管理台账.md
   ============================================================ */

/* ---- 页头 ---- */
.lg-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 2px 0 12px; flex-wrap: wrap; }
.lg-head h2 { margin: 0; font-size: 21px; font-weight: 600; letter-spacing: .2px; display: flex; align-items: center; gap: 10px; color: #10274b; }
.lg-head p { margin: 7px 0 0; font-size: 12px; color: #7b90ab; }
.lg-tag { font-size: 11px; font-weight: 500; color: #1a6fd4; background: #eaf3ff; border: 1px solid #d3e6ff; border-radius: 4px; padding: 3px 8px; }
.lg-head-actions { display: flex; gap: 8px; }

/* ---- 按钮 ---- */
.lg-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 13px; border-radius: 6px; background: #fff; border: 1px solid #d9e5f3; color: #46648a; font-size: 12px; transition: border-color 120ms ease-out, color 120ms ease-out, background 120ms ease-out; }
.lg-btn:hover { border-color: #a8c8ee; color: #1674ff; background: #f7fbff; }
.lg-btn.primary { background: #1674ff; border-color: #1674ff; color: #fff; }
.lg-btn.primary:hover { background: #0b63e0; border-color: #0b63e0; color: #fff; }
.lg-btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---- 洞察条：主指标 + 3 次指标 + 结论 ---- */
.lg-insight { display: grid; grid-template-columns: 210px 1fr; gap: 0; background: #fff; border: 1px solid #e4edf8; border-radius: 10px; box-shadow: 0 1px 2px rgba(16, 39, 75, .04); margin-bottom: 12px; overflow: hidden; }
.lg-insight-main { padding: 16px 20px; border-right: 1px solid #eef3fa; display: flex; flex-direction: column; justify-content: center; gap: 3px; }
.lg-insight-main > span { font-size: 12px; color: #6d85a3; }
.lg-insight-main > strong { font-family: Arial, sans-serif; font-size: 30px; line-height: 1.15; font-weight: 600; color: #10274b; letter-spacing: -.5px; }
.lg-insight-main > strong small { font-family: inherit; font-size: 12px; font-weight: 400; color: #8fa4bd; margin-left: 5px; letter-spacing: 0; }
.lg-insight-main > em { font-style: normal; font-size: 11px; color: #8093ab; }
.lg-insight-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lg-insight-cell { position: relative; padding: 16px 18px; display: flex; flex-direction: column; justify-content: center; gap: 3px; }
.lg-insight-cell + .lg-insight-cell { border-left: 1px solid #eef3fa; }
.lg-insight-cell > span { font-size: 12px; color: #6d85a3; }
.lg-insight-cell > strong { font-family: Arial, sans-serif; font-size: 22px; line-height: 1.2; font-weight: 600; color: #17324f; }
.lg-insight-cell > strong small { font-family: inherit; font-size: 11px; font-weight: 400; color: #8fa4bd; margin-left: 4px; }
.lg-insight-cell > em { font-style: normal; font-size: 11px; color: #8093ab; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-insight-cell.is-danger > strong { color: #d93a35; }
.lg-insight-cell.is-warn > strong { color: #d98614; }
.lg-insight-note { grid-column: 1 / -1; display: flex; align-items: center; gap: 7px; margin: 0; padding: 9px 20px; background: #fbfdff; border-top: 1px solid #eef3fa; font-size: 12px; color: #5b7594; }
.lg-insight-note .icon { color: #e08a20; flex: none; }

/* ---- 工具栏 ---- */
.lg-panel { padding: 0; overflow: hidden; }
.lg-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #eef3fa; flex-wrap: wrap; }
/* 下钻筛选提示条 */
.lg-scope { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px; background: #f4f9ff; border-bottom: 1px solid #e2eefc; font-size: 12px; color: #41618a; }
.lg-scope[hidden] { display: none; }
.lg-scope span { display: inline-flex; align-items: center; gap: 6px; }
.lg-scope-clear { font-size: 12px; color: #1674ff; padding: 2px 8px; border-radius: 5px; border: 1px solid #cfe1fb; background: #fff; transition: background 120ms ease-out, border-color 120ms ease-out; }
.lg-scope-clear:hover { background: #eaf3ff; border-color: #a8c8ee; }
.lg-seg { display: inline-flex; background: #f2f6fb; border: 1px solid #e6eef9; border-radius: 7px; padding: 3px; gap: 2px; }
.lg-seg button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 5px; font-size: 12px; color: #5c7594; transition: color 120ms ease-out, background 120ms ease-out; }
.lg-seg button:hover { color: #1674ff; }
.lg-seg button b { font-family: Arial, sans-serif; font-size: 11px; font-weight: 400; color: #90a4bd; }
.lg-seg button.is-active { background: #fff; color: #1674ff; font-weight: 600; box-shadow: 0 1px 3px rgba(22, 116, 255, .16); }
.lg-seg button.is-active b { color: #1674ff; font-weight: 600; }
.lg-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lg-search { position: relative; display: inline-flex; align-items: center; }
.lg-search-icon { position: absolute; left: 10px; width: 13px; height: 13px; border: 1.8px solid #9db3cd; border-radius: 50%; pointer-events: none; }
.lg-search-icon::after { content: ''; position: absolute; right: -4px; bottom: -3px; width: 6px; height: 1.8px; background: #9db3cd; transform: rotate(45deg); border-radius: 2px; }
.lg-search input { height: 32px; width: 258px; padding: 0 10px 0 30px; border: 1px solid #dbe6f3; border-radius: 6px; font-size: 12px; background: #fbfdff; color: #17324f; }
.lg-search input::placeholder { color: #9aadc3; }
.lg-search input:focus { border-color: #7fb4f6; background: #fff; outline: none; box-shadow: 0 0 0 3px rgba(22, 116, 255, .1); }
.lg-filters select { height: 32px; padding: 0 8px; border: 1px solid #dbe6f3; border-radius: 6px; font-size: 12px; color: #46648a; background: #fbfdff; transition: border-color 120ms ease-out; }
.lg-filters select:hover { border-color: #b8d0ea; }
.lg-filters select:focus { border-color: #7fb4f6; outline: none; box-shadow: 0 0 0 3px rgba(22, 116, 255, .1); }

/* ---- 表格：统一纯白单层表头 + 左右冻结列 ---- */
.lg-table-wrap { overflow: auto; max-height: calc(100dvh - var(--header, 58px) - var(--footer, 36px) - 210px); min-height: 280px; transition: opacity 120ms ease-out; position: relative; }
.lg-table-wrap.is-loading { opacity: .55; }
.lg-table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 12.5px; min-width: 960px; }
.lg-col-row th { position: sticky; top: 0; z-index: 3; height: 36px; padding: 0 11px; background: #f5f8fc; color: #4f6a8a; font-size: 12px; font-weight: 600; text-align: left; border-bottom: 1px solid #dfe8f3; white-space: nowrap; user-select: none; }
.lg-col-row th.is-sortable { cursor: pointer; }
.lg-col-row th.is-sortable:hover { color: #1674ff; background: #eef4fc; }
.lg-sort-arrow { margin-left: 4px; font-size: 11px; color: #9eb2ca; font-weight: 400; }
.lg-col-row th.sort-asc .lg-sort-arrow, .lg-col-row th.sort-desc .lg-sort-arrow { color: #1674ff; font-weight: 600; }
.lg-table tbody td { padding: 8px 11px; border-bottom: 1px solid #eff4fa; color: #2b4766; background: #fff; vertical-align: middle; }
.lg-table tbody tr:last-child td { border-bottom: 0; }

/* 左右冻结列 */
.lg-table .lg-sticky-left { position: sticky; left: 0; z-index: 2; box-shadow: 4px 0 8px -4px rgba(16, 39, 75, .09); }
.lg-table thead th.lg-sticky-left { z-index: 5; background: #f5f8fc; }
.lg-table .lg-sticky-right { position: sticky; right: 0; z-index: 2; box-shadow: -4px 0 8px -4px rgba(16, 39, 75, .09); text-align: center; }
.lg-table thead th.lg-sticky-right { z-index: 5; background: #f5f8fc; text-align: center; }

/* 行状态色条与已闭环降灰 */
.lg-row { cursor: pointer; transition: background 120ms ease-out; }
.lg-row:hover td { background: #f6faff; }
.lg-row:hover .lg-title { color: #1674ff; }
.lg-row:focus-visible { outline: 2px solid #258cff; outline-offset: -2px; }
.lg-row.is-risk-high > td:first-child { box-shadow: inset 3px 0 0 #d93a35, 4px 0 8px -4px rgba(16, 39, 75, .09); }
.lg-row.is-risk-warn > td:first-child { box-shadow: inset 3px 0 0 #e58e14, 4px 0 8px -4px rgba(16, 39, 75, .09); }
.lg-row.is-closed td { color: #8da2bb; }
.lg-row.is-closed .lg-title { color: #7c93ae; font-weight: 400; }
.lg-row.is-closed .lg-dep,
.lg-row.is-closed .lg-owner,
.lg-row.is-closed .lg-text,
.lg-row.is-closed .lg-date { color: #8fa4bd; }
.lg-row.is-closed .lg-level { opacity: .72; }

/* 列宽 */
.col-date { width: 90px; } .col-dep { width: 100px; } .col-level { width: 60px; } .col-upgrade { width: 56px; }
.col-title { width: 24%; } .col-text { width: 16%; } .col-owner { width: 86px; }
.col-status { width: 126px; } .col-days { width: 62px; } .col-op { width: 108px; }
/* AI表格其他列（动态列）：统一窄列宽，单行截断，鼠标悬停看全文 */
.col-raw { width: 132px; background: #fbfdff; }
.lg-table td.lg-raw { max-width: 132px; color: #5b7594; display: table-cell; -webkit-line-clamp: unset; -webkit-box-orient: unset; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.lg-date { color: #5b7594; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lg-dep { color: #4d6a8c; white-space: nowrap; }
.lg-upgrade { display: inline-block; font-size: 10px; line-height: 17px; padding: 0 6px; border-radius: 4px; background: #f2f6fb; color: #8fa4bd; white-space: nowrap; }
.lg-upgrade.yes { background: #fff5e6; color: #b5730c; border: 1px solid #f8e3bd; }

/* 部门分组头 */
.lg-group-head { cursor: pointer; user-select: none; }
.lg-group-head > td { padding: 0 16px !important; border-top: 1px solid #e8eff9; border-bottom: 1px solid #e8eff9; background: #f8fbfe; }
.lg-group-head:first-child > td { border-top: 0; }
.lg-group-head:hover > td { background: #f1f6fc; }
.lg-group-inner { display: flex; align-items: center; gap: 9px; height: 38px; }
.lg-fold { width: 22px; height: 22px; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; color: #7b90ab; transition: background 120ms ease-out; }
.lg-fold:hover { background: #e6eef9; color: #1674ff; }
.lg-group-head.is-folded .lg-fold .icon { transform: rotate(90deg); }
.lg-group-head strong { font-size: 12px; font-weight: 600; color: #17324f; }
.lg-group-head span { font-size: 11px; color: #7b90ab; font-variant-numeric: tabular-nums; }
.lg-group-blank > td { padding: 14px 16px 18px !important; color: #9aadc3; font-size: 11px; background: #fdfeff; }

/* 行内常驻轻量操作按钮 */
.lg-quick { display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.lg-quick button { font-size: 11.5px; line-height: 20px; padding: 1px 7px; border-radius: 5px; border: 1px solid #d5e4f7; background: #f7fbff; color: #1665d8; white-space: nowrap; cursor: pointer; }
.lg-quick button:hover { border-color: #9bc1f5; background: #e8f2ff; }
.lg-quick button[data-quick="CLOSED"]:hover { border-color: #8fdcb8; color: #12895f; background: #f2fbf7; }
.lg-quick button:disabled { opacity: .5; }
.lg-op-col { white-space: nowrap; text-align: center; }
.lg-level { display: inline-block; font-size: 11px; line-height: 18px; padding: 0 7px; border-radius: 4px; white-space: nowrap; }
.lg-level.larger { background: #fff0ee; color: #d93a35; border: 1px solid #ffdcd8; }
.lg-level.general { background: #eef4fd; color: #3f74b8; border: 1px solid #dce9fa; }
.lg-main .lg-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: #1c3a5b; font-weight: 500; line-height: 1.5; transition: color 120ms ease-out; }
.lg-id { display: block; margin-top: 3px; color: #a3b4c9; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-text { color: #5b7594; line-height: 1.55; overflow: hidden; word-break: break-word; }
/* 多行截断必须写在单元格内层元素上：display:-webkit-box 直接写在 td 上会使其失去
   table-cell 身份，浏览器会把相邻同类单元格合并成匿名单元格，导致整行错列。 */
.lg-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lg-none { color: #b3c2d4; font-style: normal; }
.lg-owner { color: #46648a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 责任人：提取不出姓名（源表填的是岗位）时保留原文并用虚线下划线提示待补 */
.lg-owner .lg-own.is-raw { color: #9a7b4f; border-bottom: 1px dashed #d9b98a; cursor: help; }
.lg-owner-more { display: block; font-size: 9px; color: #93a7bf; line-height: 1.2; margin-top: 2px; }
.lg-row:hover .lg-owner { overflow: visible; }
.lg-status { display: inline-block; font-size: 11px; line-height: 19px; padding: 0 8px; border-radius: 10px; white-space: nowrap; }
.lg-status.pending { background: #fdeceb; color: #d93a35; }
.lg-status.processing { background: #fff5e6; color: #b5730c; }
.lg-status.closed { background: #e9f8f1; color: #12895f; }
.lg-status.disposed { background: #eef4ff; color: #1b63c6; border: 1px solid #cfe1fb; }
.lg-status.full-closed { background: #e9f8f1; color: #12895f; }
.lg-status.historical { background: #f2f5f9; color: #7c90a8; }
.lg-status-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.lg-rc-hint { font-size: 10px; line-height: 1.2; color: #b56b08; padding-left: 2px; }
.lg-days { white-space: nowrap; color: #6d85a3; font-variant-numeric: tabular-nums; }
.lg-days.is-long { color: #d93a35; font-weight: 600; }

/* 空状态 / 骨架屏 */
.lg-empty-cell { padding: 0 !important; }
.lg-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 200px; color: #90a4bd; }
.lg-empty svg { color: #c3d5e9; margin-bottom: 4px; }
.lg-empty strong { font-size: 13px; color: #647d9b; font-weight: 500; }
.lg-empty span { font-size: 11px; }
.lg-skeleton-row .lg-bar { display: block; height: 9px; border-radius: 3px; background: linear-gradient(90deg, #eef3fa 25%, #f7fafd 37%, #eef3fa 63%); background-size: 400% 100%; animation: lgShimmer 1.4s ease infinite; margin: 4px 0; }
.lg-skeleton-row .lg-bar.w40 { width: 40%; } .lg-skeleton-row .lg-bar.w60 { width: 60%; }
.lg-skeleton-row .lg-bar.w70 { width: 70%; } .lg-skeleton-row .lg-bar.w90 { width: 90%; }
.lg-skeleton-row .lg-bar.w95 { width: 95%; }
@keyframes lgShimmer { from { background-position: 100% 50%; } to { background-position: 0 50%; } }

/* ---- 页脚分页 ---- */
.lg-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 16px; background: #fbfdff; border-top: 1px solid #eef3fa; flex-wrap: wrap; }
.lg-count { font-size: 11px; color: #7b90ab; font-variant-numeric: tabular-nums; }
.lg-pager { display: flex; align-items: center; gap: 4px; }
.lg-pager button { min-width: 28px; height: 28px; padding: 0 7px; border-radius: 5px; border: 1px solid #e2ebf6; background: #fff; color: #5b7594; font-size: 12px; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; justify-content: center; transition: border-color 120ms ease-out, color 120ms ease-out; }
.lg-pager button:hover:not(:disabled) { border-color: #a8c8ee; color: #1674ff; }
.lg-pager button.is-active { background: #1674ff; border-color: #1674ff; color: #fff; font-weight: 600; }
.lg-pager button:disabled { opacity: .45; cursor: not-allowed; }
.lg-pager .lg-gap { color: #a3b4c9; padding: 0 2px; }
.lg-pager select { height: 28px; margin-left: 6px; border: 1px solid #e2ebf6; border-radius: 5px; font-size: 11px; color: #5b7594; background: #fff; }
.lg-flip { transform: rotate(180deg); }
.lg-message { margin: 0; padding: 0 16px 11px; font-size: 11px; color: #12895f; background: #fbfdff; }
.lg-message.error { color: #d93a35; }

/* ---- 详情抽屉 ---- */
.lg-drawer-root:empty { display: none; }
.lg-overlay { position: fixed; inset: 0; background: rgba(16, 39, 75, .32); z-index: 60; animation: lgFade 180ms ease-out; }
.lg-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 94vw); background: #fff; z-index: 61; display: flex; flex-direction: column; box-shadow: 0 12px 36px rgba(16, 39, 75, .16); animation: lgSlide 220ms cubic-bezier(.22, .8, .3, 1); }
@keyframes lgFade { from { opacity: 0; } }
@keyframes lgSlide { from { transform: translateX(28px); opacity: .45; } }
.lg-drawer > header { padding: 20px 22px 16px; border-bottom: 1px solid #eef3fa; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.lg-drawer > header h3 { margin: 9px 0 0; font-size: 15px; line-height: 1.55; font-weight: 600; color: #10274b; }
.lg-close { width: 30px; height: 30px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; color: #8fa4bd; flex: none; transition: background 120ms ease-out, color 120ms ease-out; }
.lg-close:hover { background: #f2f6fb; color: #33506f; }
.lg-drawer-body { flex: 1; overflow: auto; padding: 18px 22px 24px; }
.lg-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0 0 20px; background: #eef3fa; border: 1px solid #eef3fa; border-radius: 8px; overflow: hidden; }
.lg-meta > div { background: #fbfdff; padding: 10px 13px; }
.lg-meta > div.is-wide { grid-column: 1 / -1; background: #fff; }
.lg-meta > div.is-wide dd { line-height: 1.75; white-space: pre-wrap; word-break: break-word; }
.lg-meta dt { font-size: 11px; color: #8fa4bd; }
.lg-meta dd { margin: 4px 0 0; font-size: 12px; color: #233f5e; word-break: break-all; }
.lg-drawer-body section { margin-bottom: 20px; }
.lg-drawer-body h4 { margin: 0 0 10px; font-size: 12px; color: #6d85a3; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.lg-drawer-body h4::before { content: ''; width: 3px; height: 12px; border-radius: 2px; background: #1674ff; }
.lg-drawer-body p { margin: 0; font-size: 13px; line-height: 1.85; color: #33506f; white-space: pre-wrap; word-break: break-word; background: #fafcff; border: 1px solid #eef3fa; border-radius: 8px; padding: 12px 14px; }

/* 抽屉时间线 */
.lg-timeline { list-style: none; margin: 0; padding: 4px 0 0; display: flex; }
.lg-timeline li { position: relative; flex: 1; padding-top: 18px; }
.lg-timeline li::before { content: ''; position: absolute; top: 6px; left: 0; right: 0; height: 2px; background: #e6eef9; }
.lg-timeline li:first-child::before { left: 5px; }
.lg-timeline li:last-child::before { right: calc(100% - 5px); background: #e6eef9; }
.lg-timeline li > i { position: absolute; top: 0; left: 0; width: 10px; height: 10px; border-radius: 50%; border: 2px solid #cfdcec; background: #fff; }
.lg-timeline li.done > i { background: #12895f; border-color: #12895f; }
.lg-timeline li.current > i { background: #fff; border-color: #1674ff; box-shadow: 0 0 0 3px rgba(22, 116, 255, .16); }
.lg-timeline li.done::before { background: #b9e3d1; }
.lg-timeline li:nth-child(2)::before { background: linear-gradient(90deg, #b9e3d1 0%, #e6eef9 100%); }
.lg-timeline li strong { display: block; font-size: 12px; font-weight: 500; color: #33506f; }
.lg-timeline li.todo strong { color: #a3b4c9; font-weight: 400; }
.lg-timeline li span { display: block; margin-top: 2px; font-size: 11px; color: #8fa4bd; }

.lg-drawer > footer { border-top: 1px solid #eef3fa; padding: 13px 22px; display: flex; flex-direction: column; gap: 8px; }
.lg-stage-card { border: 1px solid #e4edf8; border-radius: 10px; padding: 14px 15px; background: #fff; }
.lg-stage-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.lg-stage-head h4 { margin: 0; }
.lg-stage-badges { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lg-stage-badge { font-size: 11px; line-height: 20px; padding: 0 8px; border-radius: 10px; font-weight: 500; }
.lg-stage-badge.is-done { background: #e9f8f1; color: #12895f; }
.lg-stage-badge.is-open { background: #eef4ff; color: #1b63c6; }
.lg-stage-badge.is-warn { background: #fff5e6; color: #b56b08; }
.lg-stage-badge.is-muted { background: #f2f5f9; color: #7c90a8; }
.lg-subblock { margin-bottom: 12px; }
.lg-subblock > strong { display: block; font-size: 11px; color: #7b90ab; font-weight: 500; margin-bottom: 5px; }
.lg-stage-card .lg-meta { margin-bottom: 0; }
.lg-ai-review { margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: #fffaf2; border: 1px solid #f4dec0; }
.lg-ai-review > strong { display: block; font-size: 11px; color: #9a5d08; margin-bottom: 5px; }
.lg-ai-review > p { background: transparent; border: 0; padding: 0; font-size: 12px; color: #5c4218; }
.lg-raw-more { border: 1px solid #e8eff9; border-radius: 8px; background: #fbfdff; padding: 10px 12px; }
.lg-raw-more > summary { cursor: pointer; font-size: 12px; color: #5b7594; font-weight: 500; list-style: none; }
.lg-raw-more > summary::-webkit-details-marker { display: none; }
.lg-raw-more[open] > summary { margin-bottom: 10px; }
.lg-raw-more .lg-meta { margin-bottom: 0; }
.lg-drawer-actions { display: flex; gap: 8px; }
.lg-done { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #12895f; }
.lg-hint { font-size: 11px; color: #9aadc3; }

/* ---- 响应式 ---- */
@media (max-width: 1439px) {
  .lg-insight { grid-template-columns: 180px 1fr; }
  .lg-insight-main > strong { font-size: 26px; }
}
@media (max-width: 1230px) {
  .lg-insight { grid-template-columns: 1fr; }
  .lg-insight-main { border-right: 0; border-bottom: 1px solid #eef3fa; }
  .lg-insight-grid .lg-insight-cell:first-child { border-left: 0; }
  .lg-search input { width: 200px; }
}
@media (max-width: 760px) {
  .lg-head { align-items: flex-start; }
  .lg-head h2 { font-size: 17px; flex-wrap: wrap; }
  .lg-insight-grid { grid-template-columns: 1fr; }
  .lg-insight-cell + .lg-insight-cell { border-left: 0; border-top: 1px solid #eef3fa; }
  .lg-toolbar { align-items: stretch; }
  .lg-seg { width: 100%; }
  .lg-seg button { flex: 1; justify-content: center; padding: 6px 4px; }
  .lg-seg button b { display: none; }
  .lg-filters { width: 100%; }
  .lg-search, .lg-search input { width: 100%; }
  .lg-filters select { flex: 1; }
  .lg-meta { grid-template-columns: 1fr; }
  .lg-timeline { flex-direction: column; gap: 12px; }
  .lg-timeline li { padding-top: 0; padding-left: 20px; }
  .lg-timeline li::before { display: none; }
  .lg-timeline li > i { top: 4px; }
}

/* ============ 首页 · 较大异常数据带 ============ */
.an-band { grid-column: 1 / 3; display: flex; flex-direction: column; overflow: hidden; }
.an-band .panel-heading { gap: 10px; }
.an-band .an-band-more { font-size: 12px; white-space: nowrap; margin-left: auto; }
.an-band-body { flex: 1; display: flex; align-items: stretch; gap: 14px; padding: 10px 14px 12px; min-height: 0; }
.an-dims { flex: 1.35; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; min-width: 0; }
.an-dim { display: flex; flex-direction: column; justify-content: center; gap: 3px; background: #f4f8fd; border: 1px solid #e4edf8; border-radius: 6px; padding: 6px 8px; min-width: 0; }
.an-dim > span { font-size: 10px; color: #58718e; }
.an-dim > strong { font-size: 24px; line-height: 1.1; font-family: Arial, sans-serif; color: #277deb; }
.an-dim > strong.an-hot { color: #e74c3c; }
.an-dim > small { font-size: 9px; color: #8094ac; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-band-cards { flex: 1.35; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.an-band-card { display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 8px 11px; border-radius: 6px; background: #f4f8fd; border: 1px solid #e4edf8; min-width: 0; }
.an-band-card > span { font-size: 10px; color: #58718e; }
.an-band-card > strong { font-size: 24px; line-height: 1.1; font-family: Arial, sans-serif; color: #277deb; }
.an-band-card > strong small { font-size: 10px; color: #8094ac; font-weight: 400; margin-left: 3px; }
.an-band-card > small { font-size: 9px; color: #8094ac; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-band-card.red { background: #fff7f5; border-color: #ffebe6; }
.an-band-card.red strong { color: #f25b50; }
.an-band-card.orange { background: #fffbf4; border-color: #f8ecdb; }
.an-band-card.orange strong { color: #e99833; }
.an-band-card:hover { border-color: #87b6f6; }
@media (max-width: 1439px) { .an-band-body { flex-direction: column; gap: 8px; } .an-band-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .an-band { grid-column: auto; } .an-band-body { flex-direction: column; } .an-dims { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ============ 首页 · 异常管理卡片 ============ */
.an-date { font-size: 13px; color: var(--text-secondary, #5b6b7c); }
.an-date b { font-size: 18px; margin: 0 2px; }
.an-hot { color: #c0392b; }
.an-cards .supervision-card small.an-card-note { font-size: 10px; color: #8094ac; line-height: 1.4; }
.an-cards-loading { grid-column: 1 / -1; font-size: 11px; color: var(--muted, #7f92ac); padding: 14px 0; }

/* 部门名称排版：核心词（化工/动保）大字体，「制造一部」后缀小字体 */
.dep-core { font-weight: 600; color: #3f5d7c; font-style: normal; }
.dep-suffix { font-size: 9px; color: #8a9db5; font-weight: 400; margin-left: 1px; }
.an-cards .supervision-card > span .dep-core { font-size: 16px; }
.an-cards .supervision-card > span .dep-suffix { font-size: 10px; }
.an-band-card > span .dep-core { font-size: 14px; }
.an-band-card > span .dep-suffix { font-size: 9px; }
.an-card-note .dep-core { font-size: 12px; color: #5b7896; }

/* 车间标签（部门列下方小字） */
.lg-ws { display: block; font-size: 9px; color: #8094ac; margin-top: 2px; }

/* ============================================================
   台账视图增强：列显示设置 / 行密度 / 数字列对齐
   适用于异常管理台账与隐患排查台账（共用 lg-table 结构）
   ============================================================ */

/* 列宽补全：直接原因 / 处置措施拆为独立列名，保持与原 col-text 一致的 16% */
.col-reason, .col-measure, .col-detail { width: 16%; }
.col-due { width: 92px; }

/* 数字列右对齐，便于人工纵向比对 */
.lg-col-row th.col-days { text-align: right; }
.lg-table .lg-days { text-align: right; }

/* 视图控件：列设置 / 密度 */
.lg-view { position: relative; display: inline-flex; }
.lg-view-btn { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 11px; border-radius: 6px; border: 1px solid #dbe6f3; background: #fbfdff; color: #46648a; font-size: 12px; white-space: nowrap; transition: border-color 120ms ease-out, color 120ms ease-out, background 120ms ease-out; }
.lg-view-btn:hover { border-color: #b8d0ea; color: #1674ff; }
.lg-view-btn[aria-expanded="true"] { border-color: #7fb4f6; color: #1674ff; background: #fff; box-shadow: 0 0 0 3px rgba(22, 116, 255, .1); }
.lg-view-btn::after { content: ''; width: 0; height: 0; border-left: 3.5px solid transparent; border-right: 3.5px solid transparent; border-top: 4px solid currentColor; opacity: .6; }

.lg-pop { position: absolute; top: 38px; right: 0; z-index: 30; min-width: 176px; padding: 6px; background: #fff; border: 1px solid #e2ebf6; border-radius: 8px; box-shadow: 0 8px 24px rgba(16, 39, 75, .12); animation: lgPopIn 120ms ease-out; }
.lg-pop[hidden] { display: none; }
@keyframes lgPopIn { from { opacity: 0; transform: translateY(-4px); } }
.lg-pop-title { padding: 3px 8px 7px; font-size: 11px; color: #90a4bd; }
.lg-pop-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 5px; font-size: 12px; color: #33506f; cursor: pointer; transition: background 100ms ease-out; }
.lg-pop-item:hover { background: #f5f9ff; }
.lg-pop-item input { accent-color: #1674ff; margin: 0; flex: none; }
.lg-pop-item.is-locked { color: #a3b4c9; cursor: not-allowed; }
.lg-pop-item.is-locked:hover { background: transparent; }
.lg-pop-sep { height: 1px; margin: 6px 4px; background: #eef3fa; }
.lg-density { display: flex; gap: 4px; padding: 0 2px 2px; }
.lg-density button { flex: 1; height: 28px; border-radius: 5px; font-size: 12px; color: #5b7594; transition: background 100ms ease-out, color 100ms ease-out; }
.lg-density button:hover { background: #f5f9ff; color: #1674ff; }
.lg-density button.is-active { background: #eaf3ff; color: #1674ff; font-weight: 500; }

/* 行密度：紧凑 / 标准 / 宽松 */
.lg-table[data-density="compact"] tbody td { padding: 5px 11px; }
.lg-table[data-density="compact"] .lg-main .lg-title { -webkit-line-clamp: 1; }
.lg-table[data-density="compact"] .lg-clamp { -webkit-line-clamp: 1; }
.lg-table[data-density="compact"] .lg-quick { margin-top: 0; }
.lg-table[data-density="loose"] tbody td { padding: 13px 11px; }

/* ============================================================
   紧凑单行汇总条 + 直达组合筛选 + 可删条件胶囊 + 自定义列排序弹层
   ============================================================ */
.lg-head.lg-compact-head { align-items: center; margin: 0 0 8px; gap: 10px; }
.lg-head.lg-compact-head h2 { font-size: 18px; }
.lg-head-meta { font-size: 12px; color: #7b90ab; margin-left: 4px; font-weight: 400; }

.lg-summary-strip { display: flex; align-items: center; background: #fff; border: 1px solid #e1eaf5; border-radius: 8px; overflow: hidden; margin-bottom: 8px; min-height: 38px; flex-wrap: wrap; box-shadow: 0 1px 2px rgba(16, 39, 75, .03); }
.lg-sum-item { border: 0; background: transparent; display: inline-flex; align-items: baseline; gap: 6px; padding: 7px 14px; cursor: pointer; color: #5b7594; font-size: 12px; white-space: nowrap; position: relative; transition: background 120ms ease-out, color 120ms ease-out; }
.lg-sum-item + .lg-sum-item::before { content: ''; position: absolute; left: 0; top: 9px; bottom: 9px; width: 1px; background: #eaf0f8; }
.lg-sum-item:hover { background: #f5f9ff; }
.lg-sum-item.is-active { background: #eaf3ff; color: #1674ff; font-weight: 600; }
.lg-sum-item strong { font-family: Arial, sans-serif; font-size: 16px; font-weight: 700; line-height: 1; color: #10274b; font-variant-numeric: tabular-nums; }
.lg-sum-item.is-danger strong { color: #d93a35; }
.lg-sum-item.is-warn strong { color: #d47b0a; }
.lg-sum-item.is-ok strong { color: #12895f; }
.lg-sum-item.is-active strong { color: #1674ff; }
.lg-sum-note { margin-left: auto; padding: 0 14px; font-size: 11.5px; color: #7e95b0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.lg-panel { overflow: visible; }
.lg-toolbar.lg-direct-toolbar { padding: 8px 12px; gap: 8px; }
.lg-direct-pills { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lg-pill { height: 30px; padding: 0 10px; border-radius: 6px; border: 1px solid #dce6f4; background: #f8fbff; color: #415e80; font-size: 12px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; transition: all 120ms ease-out; }
.lg-pill:hover { border-color: #9dc2f5; color: #1674ff; background: #fff; }
.lg-pill b { font-family: Arial, sans-serif; font-size: 11.5px; font-weight: 600; color: #8298b2; font-variant-numeric: tabular-nums; }
.lg-pill.is-active { background: #1674ff; border-color: #1674ff; color: #fff; }
.lg-pill.is-active b { color: #dcebff; }
.lg-pill.tone-danger:not(.is-active) { border-color: #f7d0cd; background: #fff8f7; color: #c4322d; }
.lg-pill.tone-danger:not(.is-active) b { color: #d95752; }
.lg-pill.tone-danger.is-active { background: #d93a35; border-color: #d93a35; }
.lg-pill.tone-warn:not(.is-active) { border-color: #f4dec0; background: #fffbf4; color: #b56b08; }
.lg-pill.tone-warn:not(.is-active) b { color: #c77c16; }
.lg-pill.tone-warn.is-active { background: #d47b0a; border-color: #d47b0a; }
.lg-pill.tone-ok:not(.is-active) { border-color: #bfe8d5; background: #f2fbf7; color: #12895f; }
.lg-pill.tone-ok:not(.is-active) b { color: #12895f; }
.lg-pill.tone-ok.is-active { background: #12895f; border-color: #12895f; }

.lg-filters.lg-compact-filters { gap: 6px; }
.lg-filters.lg-compact-filters select { height: 30px; padding: 0 7px; background: #fff; }
.lg-filters.lg-compact-filters select.is-set { border-color: #7eb2f7; color: #1674ff; background: #f5f9ff; font-weight: 500; }
.lg-filters.lg-compact-filters .lg-search input { height: 30px; width: 185px; padding-right: 24px; }
.lg-search-clear { position: absolute; right: 5px; border: 0; background: transparent; color: #93a7bf; cursor: pointer; font-size: 14px; line-height: 1; padding: 2px 4px; }
.lg-search-clear:hover { color: #17324f; }
.lg-mini-toggle { height: 30px; padding: 0 9px; border-radius: 6px; border: 1px solid #d9e5f3; background: #fff; color: #4f6b8a; font-size: 12px; cursor: pointer; white-space: nowrap; }
.lg-mini-toggle:hover { border-color: #9dc2f5; color: #1674ff; }
.lg-mini-toggle.is-active { border-color: #1674ff; background: #eaf3ff; color: #1674ff; font-weight: 600; }

.lg-density-inline { display: inline-flex; border: 1px solid #d9e5f3; border-radius: 6px; overflow: hidden; background: #fff; }
.lg-density-inline button { border: 0; background: transparent; color: #5b7594; font-size: 12px; height: 28px; padding: 0 8px; cursor: pointer; }
.lg-density-inline button + button { border-left: 1px solid #e6eef8; }
.lg-density-inline button.is-active { background: #eaf3ff; color: #1674ff; font-weight: 600; }

/* 可单项删除条件胶囊条 */
.lg-chips-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 12px; background: #f5f9ff; border-bottom: 1px solid #e4eefb; flex-wrap: wrap; }
.lg-chips-bar[hidden] { display: none; }
.lg-chips-list { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lg-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px 2px 9px; border-radius: 999px; background: #fff; border: 1px solid #c9dffb; color: #1c57a8; font-size: 12px; }
.lg-chip button { border: 0; background: transparent; color: #7ea3d4; cursor: pointer; font-size: 13px; line-height: 1; padding: 0 2px; }
.lg-chip button:hover { color: #d93a35; }

/* 列配置弹层（支持拖拽排序 + ↑↓ 微调 + 显示勾选） */
.lg-pop.lg-col-pop { width: 276px; padding: 8px; top: 36px; z-index: 40; }
.lg-col-pop-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 8px; border-bottom: 1px solid #eef3fa; margin-bottom: 6px; font-size: 12px; color: #4f6a8a; font-weight: 600; }
.lg-col-pop-actions { display: flex; gap: 8px; }
.lg-col-pop-actions button { border: 0; background: transparent; color: #1674ff; font-size: 12px; font-weight: 400; cursor: pointer; padding: 0; }
.lg-col-pop-actions button:hover { text-decoration: underline; }
.lg-col-pop-list { max-height: 310px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.lg-col-item { display: flex; align-items: center; gap: 6px; padding: 5px 6px; border-radius: 6px; border: 1px solid transparent; background: #fff; font-size: 12px; color: #243f5e; user-select: none; }
.lg-col-item:hover { background: #f5f9ff; }
.lg-col-item.is-dragging { opacity: .45; border-color: #9dc2f5; }
.lg-col-item.is-drag-over { border-top: 2px solid #1674ff; }
.lg-drag-handle { cursor: grab; color: #9bb0c8; font-size: 13px; line-height: 1; padding: 0 2px; flex: none; }
.lg-drag-handle:active { cursor: grabbing; }
.lg-col-item label { flex: 1; display: flex; align-items: center; gap: 6px; cursor: pointer; min-width: 0; }
.lg-col-item label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-col-item input[type="checkbox"] { accent-color: #1674ff; margin: 0; flex: none; }
.lg-col-item.is-locked label { color: #8da2bb; cursor: not-allowed; }
.lg-col-move { display: inline-flex; gap: 2px; flex: none; }
.lg-col-move button { width: 22px; height: 22px; border-radius: 4px; border: 1px solid #e2ebf6; background: #fff; color: #5b7594; font-size: 11px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.lg-col-move button:hover:not(:disabled) { border-color: #1674ff; color: #1674ff; }
.lg-col-move button:disabled { opacity: .35; cursor: not-allowed; }
.lg-col-pop-tip { margin-top: 6px; padding-top: 6px; border-top: 1px solid #eef3fa; font-size: 11px; color: #7e95b0; text-align: center; }

@media (max-width: 760px) {
  .lg-table-wrap { max-height: none; }
  .lg-sum-note { display: none; }
  .lg-filters.lg-compact-filters .lg-search input { width: 100%; }
}

/* 大版图片预览弹窗（异常管理 & 隐患排查共用） */
.lg-lightbox { position: fixed; inset: 0; z-index: 95; background: rgba(9, 20, 38, .86); display: flex; flex-direction: column; animation: lgFade 150ms ease-out; }
.lg-lb-bar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; color: #eef5ff; background: rgba(9, 20, 38, .65); border-bottom: 1px solid rgba(255, 255, 255, .12); }
.lg-lb-title { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-lb-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.lg-lb-btn { display: inline-flex; align-items: center; height: 30px; padding: 0 11px; border-radius: 6px; border: 1px solid rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .1); color: #fff; font-size: 12px; text-decoration: none; cursor: pointer; }
.lg-lb-btn:hover { background: rgba(255, 255, 255, .2); }
.lg-lb-close { width: 32px; height: 32px; border-radius: 6px; border: 1px solid rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .12); color: #fff; font-size: 20px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.lg-lb-close:hover { background: #d93a35; border-color: #d93a35; }
.lg-lb-stage { flex: 1; min-height: 0; position: relative; display: flex; align-items: center; justify-content: center; padding: 18px 64px; overflow: auto; }
.lg-lb-img { max-width: 92vw; max-height: 84vh; width: auto; height: auto; object-fit: contain; border-radius: 8px; box-shadow: 0 16px 48px rgba(0, 0, 0, .45); cursor: zoom-in; background: #102038; }
.lg-lb-stage.is-zoomed { align-items: flex-start; justify-content: flex-start; }
.lg-lb-stage.is-zoomed .lg-lb-img { max-width: none; max-height: none; cursor: zoom-out; margin: auto; }
.lg-lb-nav { position: fixed; top: 50%; transform: translateY(-50%); width: 44px; height: 64px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .24); background: rgba(9, 20, 38, .65); color: #fff; font-size: 32px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.lg-lb-nav:hover { background: rgba(22, 116, 255, .85); border-color: rgba(255, 255, 255, .45); }
.lg-lb-nav.is-prev { left: 16px; }
.lg-lb-nav.is-next { right: 16px; }
.ehs-photo-preview { cursor: zoom-in; }

/* 明细表格内图片缩略图（点击直接弹出大版预览） */
.lg-thumb-wrap { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; }
.lg-thumb-btn { position: relative; display: inline-flex; padding: 0; border: 1px solid #d5e4f7; border-radius: 5px; overflow: hidden; background: #edf4fc; width: 48px; height: 34px; cursor: zoom-in; transition: border-color 120ms ease-out, transform 120ms ease-out; }
.lg-thumb-btn:hover { border-color: #1674ff; transform: scale(1.06); }
.lg-thumb-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lg-thumb-count { position: absolute; right: 2px; bottom: 2px; padding: 0 4px; border-radius: 3px; background: rgba(16, 39, 75, .74); color: #fff; font-size: 10px; line-height: 14px; font-variant-numeric: tabular-nums; }
.lg-thumb-loading { font-size: 11px; color: #90a4bd; }
