/* ===== LEC 助手 · 岗位固有风险/剩余风险评价 ===== */
/* 设计风格：主站统一工具骨架（tokens 全复用），红橙警示三角入口 */
.lec-tool { --tool-accent: #e5484d; }

/* ── Hero：红/橙警示三角（对齐入口 tone '#dc2626'→'#ea580c'） ── */
.tool-hero.is-lec {
  --tool-hero: linear-gradient(118deg, #9f1239 0%, #dc2626 48%, #ea580c 100%);
  --tool-shadow: rgba(185, 28, 28, .22);
}

/* ── 表单区（主站 form-card / field / nm-photo-slot / nm-loading 已由公共模块提供） ── */
.lec-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 14px;
}
.lec-form-card .field + .field { margin-top: 12px; }
.lec-grid .field { margin-top: 0 !important; }
/* LEC 表单与表格内的示例文字（placeholder）适当调小 */
.lec-form-card input::placeholder,
.lec-form-card textarea::placeholder,
.lec-grid input::placeholder,
.lec-grid textarea::placeholder,
.lec-big input::placeholder,
.lec-big textarea::placeholder,
.a4-big input::placeholder,
.a4-big textarea::placeholder {
  font-size: 11px;
  opacity: .78;
  letter-spacing: 0;
}
.lec-count {
  float: right;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}
.lec-hint {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff2f0;
  color: #c0392b;
  font-size: 12.5px;
  line-height: 1.5;
}
.lec-hint svg { width: 15px; height: 15px; flex: none; margin-top: 1px; }

.lec-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.lec-actions .btn { flex: 1; }
.lec-actions .btn.btn-ghost { flex: none; min-width: 96px; }

/* ── 结果区 ── */
.lec-result {
  margin-top: 4px;
}
.lec-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin: 4px 0 12px;
}
.lec-h3 {
  font-size: 17px;
  font-weight: var(--fw-semibold);
  color: var(--ink);
  margin: 0;
}
.lec-head-ops {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.lec-export-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.a4-host { display: none; }

/* ── 分数大卡 + 四色块 ── */
.score-main {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.score-d {
  flex: 1;
  min-width: 0;
  border-radius: 16px;
  padding: 14px 16px;
  color: #fff;
  box-shadow: 0 10px 24px rgba(24, 39, 75, .08);
}
.score-d + .score-d { margin-top: 0; }
.score-d span {
  display: block;
  font-size: 12px;
  opacity: .9;
  letter-spacing: .04em;
}
.score-d b {
  display: block;
  font-size: 38px;
  font-weight: 800;
  line-height: 1.08;
  margin: 2px 0;
}
.score-d em {
  display: inline-block;
  font-style: normal;
  font-size: 13px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .22);
}
.score-d.is-rest { margin-top: 10px; }
.score-meta {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
}

.d-fill {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 42px;
  padding: 4px 8px;
  border-radius: 8px;
  font-weight: 700;
  line-height: 1.2;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.d-fill b { font-size: 17px; }
.d-fill i { font-style: normal; font-size: 10px; opacity: .94; }

.gap-card {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #8a6d1d;
  font-size: 12.5px;
  line-height: 1.6;
}
.gap-card strong { display: block; margin-bottom: 2px; font-weight: var(--fw-semibold); }
.gap-card ul { margin: 0; padding-left: 18px; }

/* ── 同一张大表 ── */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 8px 22px rgba(24, 39, 75, .05);
}
.lec-big {
  border-collapse: collapse;
  width: 100%;
  min-width: 1180px;
  font-size: 12.5px;
}
.lec-big th,
.lec-big td {
  border: 1px solid #edf0f5;
  padding: 8px 9px;
  vertical-align: top;
  text-align: left;
}
.lec-big thead th {
  background: #f1f5f9;
  font-weight: var(--fw-semibold);
  color: var(--ink-2);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: center;
}
.lec-big .col-no { width: 40px; text-align: center; color: var(--muted); }
.lec-big .col-act { min-width: 130px; }
.lec-big .col-src { min-width: 220px; }
.lec-big .td-act { min-width: 130px; }
.lec-big .td-src { min-width: 220px; }
.lec-big .col-hazard { min-width: 190px; }
.lec-big .td-hazard { min-width: 190px; }
.lec-big .col-lec { width: 92px; text-align: center; }
.lec-big .col-d { width: 88px; text-align: center; }
.lec-big .col-m { min-width: 132px; }
.lec-big .c-no { text-align: center; color: var(--muted); }
.lec-big .td-d { text-align: center; vertical-align: middle; }
.lec-big .td-lec { text-align: center; vertical-align: middle; }
.lec-big .td-measure { background: #fbfcfe; }

.cell-name {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 4px 6px;
  font-size: 13px;
  font-weight: var(--fw-semibold);
  color: var(--ink);
  background: transparent;
  box-sizing: border-box;
}
.cell-desc {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 3px 6px;
  font-size: 12px;
  color: var(--ink-2);
  background: transparent;
  resize: vertical;
  font-family: inherit;
  line-height: 1.45;
  box-sizing: border-box;
}
.cell-act,
.cell-src {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 4px 6px;
  font-size: 12px;
  color: var(--ink-2);
  background: transparent;
  resize: vertical;
  font-family: inherit;
  line-height: 1.45;
  box-sizing: border-box;
  font-weight: 400;
}
.cell-act { font-weight: var(--fw-semibold); color: var(--ink); }
.cell-name:focus,
.cell-desc:focus,
.cell-act:focus,
.cell-src:focus,
.cell-edit:focus {
  outline: none;
  border-color: var(--tool-accent, var(--blue));
  background: #fff;
  box-shadow: 0 0 0 2px rgba(47, 124, 246, .12);
}

.td-measure .measure-lab {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 3px;
  font-weight: var(--fw-medium);
}
.cell-edit {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 3px 6px;
  font-size: 12px;
  color: var(--ink);
  background: transparent;
  resize: vertical;
  font-family: inherit;
  line-height: 1.45;
  box-sizing: border-box;
}

.lec-select {
  width: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 4px;
  font-size: 12.5px;
  color: var(--ink);
  background: #fff;
  text-align: center;
  font-family: inherit;
}

/* ── 历史（云端） ── */
.lec-history { margin-top: 22px; }
.lec-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.lec-history-head h3 {
  font-size: 16px;
  font-weight: var(--fw-semibold);
  color: var(--ink);
  margin: 0;
}
.history-empty {
  padding: 26px 14px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  background: #fff;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
}
.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.history-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(24, 39, 75, .04);
}
.history-main { min-width: 0; }
.history-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.history-title b {
  font-size: 14.5px;
  font-weight: var(--fw-semibold);
  color: var(--ink);
}
.lv-mini {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: var(--fw-semibold);
}
.history-meta {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-ops {
  display: flex;
  gap: 4px;
  flex: none;
}

/* ── 现场照片区（云端存储，按 key 回源显示） ── */
.lec-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.lec-photos img {
  width: 128px;
  height: 96px;
  object-fit: cover;
  border-radius: var(--radius-sm, 10px);
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(15, 23, 42, .06));
}

/* ── 移动端 ── */
@media (max-width: 720px) {
  .lec-grid { grid-template-columns: 1fr; }
  .score-d b { font-size: 30px; }
}

/* ── A4 横版打印 / Word（lecr.js 输出） ── */
.a4-sheet {
  width: 100%;
  font-family: inherit;
  color: #111;
}
.a4-sheet .a4-head { margin-bottom: 10px; }
.a4-top { text-align: left; margin-bottom: 2px; }
.a4-title {
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 2px;
}
.a4-sub {
  font-size: 11px;
  text-align: center;
  color: #666;
  margin-bottom: 10px;
}
.a4-meta {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px;
  font-size: 12px;
}
.a4-meta th,
.a4-meta td { border: 1px solid #333; padding: 4px 6px; text-align: left; }
.a4-meta th { background: #f1f5f9; width: 88px; }
.a4-big {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 11px;
}
.a4-big th,
.a4-big td { border: 1px solid #333; padding: 4px 6px; text-align: center; vertical-align: top; word-break: break-word; overflow-wrap: anywhere; }
.a4-big thead th { background: #f1f5f9; font-weight: 600; }
.a4-big .s-hazard { text-align: left; }
.a4-big .s-act,
.a4-big .s-src { text-align: left; min-width: 120px; }
.a4-big .s-hazard b { display: block; }
.a4-big .s-hazard span { color: #555; font-size: 10px; }
.a4-big .s-measure { text-align: left; font-size: 10.5px; }
.a4-big .s-d { font-weight: 700; }
/* 列宽统一由 buildSheetHtml 的 colgroup 内联百分比控制（铺满横版，杜绝右侧空白） */
.a4-big .s-no { text-align: center; }
.a4-big .s-lec { text-align: center; }
.a4-big .s-d { text-align: center; }
.a4-big .s-measure { font-size: 10px; }
.a4-big td.s-d { white-space: normal; }
.a4-big td.s-lec { font-size: 12px; font-weight: 600; }
.a4-big td.s-no { color: #777; }
.a4-big .a4-dcell { margin: -4px -3px; padding: 2px 1px; border-radius: 4px; background: #1e88e5; color: #fff; }
.a4-big .a4-dcell b { display: block; font-size: 15px; line-height: 1.15; }
.a4-big .a4-dcell i { display: block; font-style: normal; font-size: 9px; opacity: .96; }
.a4-big .a4-empty { text-align: center; color: #999; padding: 20px 0 !important; }
.a4-big thead .a4-grp th { background: #1e3a5f; color: #fff; font-weight: 700; font-size: 11px; letter-spacing: .5px; text-align: center; }
.a4-big thead .a4-grp .lec-grp { background: #2c5282; color: #fff; }
.a4-big thead .a4-grp .m-grp { background: #2f6e4e; color: #fff; }
.a4-big thead .a4-subhead th { background: #eef2f7; font-weight: 600; font-size: 10.5px; color: #222; }
.a4-big thead th,
.a4-big thead td { vertical-align: middle; }
.a4-big .s-measure,
.a4-big .s-act,
.a4-big .s-src,
.a4-big .s-hazard { text-align: left; }

/* 页脚区：现场照片（左） + 确认签署（右） */
.a4-foot { display: flex; gap: 16px; margin-top: 12px; align-items: stretch; }
.a4-photo-col { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.a4-photos { display: flex; gap: 8px; flex-wrap: wrap; align-items: stretch; }
.a4-photo { margin: 0; border: 1px solid #333; border-radius: 4px; overflow: hidden; background: #fff; text-align: center; width: 158px; }
.a4-photo img { display: block; width: 156px; height: 104px; object-fit: cover; }
.a4-photo figcaption { font-size: 10px; color: #333; padding: 2px 0; border-top: 1px solid #ddd; background: #fafafa; }
.a4-photo-empty { border: 1px dashed #999; color: #888; text-align: center; padding: 16px 10px; border-radius: 4px; background: #fafbfc; font-size: 12px; }
.a4-photo-empty i { display: block; font-style: normal; font-size: 10px; margin-top: 4px; color: #aaa; }
.a4-verdict { border: 1px solid #333; border-radius: 4px; padding: 8px 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.a4-verdict b { width: 100%; font-size: 12px; margin-bottom: 2px; color: #1e3a5f; }
.a4-verdict span { padding: 3px 10px; border-radius: 3px; font-size: 12px; font-weight: 700; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.a4-sign { flex: none; width: 210px; border: 1px solid #333; border-radius: 4px; padding: 10px 14px; display: flex; flex-direction: column; justify-content: space-between; }
.a4-sign-title { font-size: 13px; font-weight: 700; text-align: center; border-bottom: 1px solid #eee; padding-bottom: 6px; margin-bottom: 4px; color: #1e3a5f; letter-spacing: 2px; }
.a4-sign .sign-item { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 0; font-size: 12px; }
.a4-sign .sign-item label { color: #555; flex: none; }
.a4-sign .sign-item span { letter-spacing: .5px; }
.a4-footnote { margin-top: 12px; text-align: center; font-size: 10px; color: #666; border-top: 1px solid #ddd; padding-top: 6px; }
.a4-code { display: inline-block; font-size: 11px; color: #1e3a5f; border: 1px solid #1e3a5f; border-radius: 3px; padding: 0 6px; letter-spacing: .5px; }
@media print {
  .a4-photo img,
  .a4-dcell,
  .a4-verdict span,
  .lv-chip { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}
.lv-chip {
  padding: 1px 8px;
  border-radius: 3px;
  font-weight: 600;
}
@media print {
  @page { size: A4 landscape; margin: 10mm 12mm; }
  body { background: #fff !important; }
  #print-root.lec-print { width: 297mm !important; }
  #print-root.lec-print .a4-sheet { width: 297mm !important; max-width: none !important; margin: 0 !important; box-shadow: none !important; }
  .a4-sheet .d-fill { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}