/* Fault Analysis page styles.
   故障解析页专属样式：只负责 35 卡片入口、灰度状态和开发中抽屉。 */

.fault-analysis-page {
  min-height: 0 !important;
  padding-top: 12px;
  padding-bottom: 28px;
  overflow-x: auto;
}

#faultAnalysisMount {
  display: grid;
  grid-template-columns: repeat(7, var(--fault-analysis-section-width, minmax(190px, 1fr)));
  align-items: start;
  gap: 12px;
  min-width: var(--fault-analysis-mount-width, 1402px);
}

/* One framed workspace for each D1-D7 analysis group. */
.fault-analysis-sec {
  width: auto;
  min-width: 0;
  box-sizing: border-box;
  padding: 10px;
  border: 1px solid #4c5057;
  border-radius: 22px;
  background: #383b40;
}

.fault-analysis-sec .tools-g.fault-analysis-grid {
  grid-template-columns: minmax(0, 1fr) !important;
}

body.light .fault-analysis-sec {
  border-color: #d1d5db;
  background: #ffffff;
}

.fault-analysis-sec .tools-sec-hdr h2 {
  font-size: 16px;
  letter-spacing: 0;
}

.fault-analysis-sec .tools-sec-hdr {
  gap: 6px;
}

.fault-analysis-sec .tools-sec-hdr .sec-icon {
  margin-right: 4px;
  font-size: 24px;
}

.tools-g.fault-analysis-grid {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 10px;
}

.fault-analysis-page .fault-analysis-sec {
  margin-bottom: 0;
}

.tools-c.fault-analysis-card {
  --fault-card-ring: 0 0 0 0 rgba(0, 0, 0, 0);
  width: 100% !important;
  box-sizing: border-box;
  height: auto;
  min-height: 0;
  padding: 12px 14px 10px;
  background-color: #282e36;
  background-image:
    linear-gradient(180deg,
      rgba(255, 255, 255, 0.065) 0%,
      rgba(255, 255, 255, 0.018) 12%,
      rgba(255, 255, 255, 0) 30%,
      rgba(0, 0, 0, 0.18) 100%),
    linear-gradient(105deg, #242a31 0%, #303740 52%, #292f37 100%);
  background-clip: padding-box;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    inset 1px 0 0 rgba(255, 255, 255, 0.025),
    inset 0 -1px 0 rgba(0, 0, 0, 0.55),
    inset -1px 0 0 rgba(0, 0, 0, 0.32),
    var(--fault-card-ring),
    0 2px 3px rgba(0, 0, 0, 0.48),
    0 6px 12px rgba(0, 0, 0, 0.32);
}

.tools-c.fault-analysis-card:hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    inset 1px 0 0 rgba(255, 255, 255, 0.025),
    inset 0 -1px 0 rgba(0, 0, 0, 0.60),
    inset -1px 0 0 rgba(0, 0, 0, 0.36),
    var(--fault-card-ring),
    0 3px 5px rgba(0, 0, 0, 0.55),
    0 9px 18px rgba(0, 0, 0, 0.38);
  transform: translateY(-2px);
}

.fault-card-width-resizer {
  position: absolute;
  top: 0;
  right: -5px;
  z-index: 3;
  width: 11px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
  background: transparent;
}

.fault-card-width-resizer::after {
  position: absolute;
  top: 12px;
  right: 4px;
  bottom: 12px;
  width: 2px;
  border-radius: 1px;
  background: transparent;
  transition: background .16s ease;
  content: '';
}

.fault-card-width-resizer:hover::after,
.fault-card-width-resizer:focus-visible::after,
.fault-card-width-resizer.dragging::after {
  background: #00d4aa;
}

.fault-card-width-resizer:focus-visible {
  outline: 2px solid #00d4aa;
  outline-offset: 1px;
}

body.fault-card-resizing,
body.fault-card-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

body.fault-card-resizing .fault-analysis-card {
  transform: none !important;
}

.fault-analysis-card .tools-c-top {
  gap: 8px;
  margin-bottom: 8px;
}

.fault-analysis-card .tools-c-icon {
  width: 32px;
  height: 32px;
  font-size: 16px;
}

.fault-analysis-card .tools-c-top .tools-c-title {
  color: #cbd3dc;
  font-size: 15px;
  font-weight: 550;
  line-height: 1.25;
}

.fault-card-title {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.fault-card-id,
.fault-card-name {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.fault-card-name {
  color: inherit;
}

.fault-analysis-card .tools-c-info {
  gap: 10px;
  margin-top: 0;
  color: #7f8a96;
}

.fault-analysis-card:not(.disabled) {
  --fault-card-ring: 0 0 0 1px rgba(0, 212, 170, 0.88);
  border-color: #00d4aa;
}

.fault-analysis-card:not(.disabled) .fault-analysis-ready {
  color: #061a16;
  background: #00d4aa;
  border-color: #00d4aa;
}

.fault-analysis-card.disabled {
  filter: none;
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.09);
  cursor: pointer;
}

.fault-analysis-card.disabled .fault-card-id {
  color: #aab4bf;
  font-weight: 500;
}

.fault-analysis-card.disabled .fault-card-name {
  color: #929da9;
  font-weight: 500;
}

.fault-analysis-card.disabled .tools-c-info {
  color: #6f7a86;
}

.fault-analysis-card.disabled .tools-c-icon {
  color: #707b86;
  background: rgba(139, 148, 158, 0.06);
  filter: grayscale(1);
}

.fault-analysis-card.disabled > .tools-c-top,
.fault-analysis-card.disabled > .tools-c-info {
  opacity: 1;
}

.fault-analysis-card.disabled:hover {
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

.fault-analysis-ready,
.fault-analysis-dev {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.fault-analysis-ready {
  color: #00d4aa;
  background: rgba(0,212,170,0.12);
  border: 1px solid rgba(0,212,170,0.28);
}

.fault-analysis-dev {
  color: #8b949e;
  background: rgba(139,148,158,0.12);
  border: 1px solid rgba(139,148,158,0.24);
}

.fault-analysis-card.disabled .fault-analysis-dev {
  color: #747f8b;
  background: rgba(139, 148, 158, 0.08);
  border-color: rgba(139, 148, 158, 0.16);
  font-weight: 600;
}

.fault-analysis-dev-panel {
  min-height: 240px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 26px;
  border: 1px dashed #2d4a6f;
  border-radius: 8px;
  background: rgba(13,17,23,0.54);
  text-align: center;
}

.fault-analysis-dev-title {
  color: #e6edf3;
  font-size: 18px;
  font-weight: 800;
}

.fault-analysis-dev-sub {
  color: #8b949e;
  font-size: 13px;
  line-height: 1.8;
}

.tools-dr.faultwide {
  width: min(1760px, calc(100vw - 16px));
}

.fault-parser { display: flex; flex-direction: column; gap: 14px; }
.fault-upload-zone {
  position: relative;
  border: 2px dashed #1f3a5f;
  border-radius: 8px;
  padding: 26px 18px;
  background: rgba(13,17,23,0.42);
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.fault-upload-zone:hover, .fault-upload-zone.dragover {
  border-color: #00d4aa;
  background: rgba(0,212,170,0.06);
  box-shadow: 0 0 0 3px rgba(0,212,170,0.08);
}
.fault-upload-icon { color: #58a6ff; font-size: 34px; line-height: 1; margin-bottom: 8px; }
.fault-upload-title { color: #e6edf3; font-size: 15px; font-weight: 600; }
.fault-upload-sub { color: #8b949e; font-size: 12px; margin-top: 6px; }
.fault-file-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.fault-file-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(88,166,255,0.28);
  border-radius: 8px;
  background: rgba(88,166,255,0.08);
  color: #8b949e;
  font-size: 13px;
}
.fault-file-name { color: #e6edf3; font-weight: 600; flex: 1; min-width: 0; word-break: break-all; }
.fault-icon-btn {
  width: 28px; height: 28px; border: 0; border-radius: 50%;
  background: #1f3a5f; color: #8b949e; cursor: pointer;
}
.fault-icon-btn:hover { background: #2d4a6f; color: #fff; }
.fault-data-input { min-height: 142px; }
.fault-actions { align-items: center; gap: 8px; }
.fault-summary-grid { display: grid; grid-template-columns: repeat(6, minmax(118px, 1fr)); gap: 10px; }
.fault-summary-item {
  border: 1px solid #1f3a5f;
  border-radius: 8px;
  background: #0d1117;
  padding: 11px 12px;
  min-height: 70px;
}
.fault-summary-label { color: #8b949e; font-size: 12px; }
.fault-summary-value { color: #e6edf3; font-family: Consolas, monospace; font-size: 20px; font-weight: 700; margin-top: 5px; }
.fault-summary-value.warn { color: #f0883e; }
.fault-summary-value.err { color: #ff6b6b; }
.fault-summary-value.ok { color: #00d4aa; }
.fault-insight { line-height: 1.8; }
.d11-fault-event-result .fault-summary-label { font-size: 14px; }
.d11-fault-event-result .fault-summary-value { font-size: 22px; }
.d11-fault-event-result .fault-insight { font-size: 16px; }
.tools-dr-bd .d11-fault-event-result .fault-data-table th,
.tools-dr-bd .d11-fault-event-result .fault-data-table td { font-size: 14px; }
.d11-fault-event-result #d11FaultCsvBtn { font-size: 15px; }
.fault-help-wrap { position: relative; display: inline-flex; align-items: center; gap: 4px; }
.fault-help-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  background: rgba(88,166,255,0.16); color: #58a6ff;
  border: 1px solid rgba(88,166,255,0.35);
  font-size: 11px; font-weight: 800; cursor: help; line-height: 1;
}
.fault-help-pop {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 30;
  min-width: 320px;
  max-width: 520px;
  padding: 11px 13px;
  border-radius: 8px;
  border: 1px solid #2d4a6f;
  background: #0d1117;
  color: #d7dde5;
  box-shadow: 0 10px 28px rgba(0,0,0,0.45);
  font-size: 12px;
  line-height: 1.75;
  white-space: normal;
  text-align: left;
}
.fault-help-wrap:hover .fault-help-pop { display: block; }
.fault-inline-item { display: inline-flex; align-items: center; gap: 4px; margin-right: 10px; white-space: nowrap; }
.fault-checklist, .fault-attribution, .fault-diagnostics { display: flex; flex-direction: column; gap: 8px; }
.fault-section-title { color: #c9d1d9; font-size: 13px; font-weight: 700; margin: 2px 0 0; }
.fault-diag-grid { display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 8px; }
.fault-diag-item {
  border: 1px solid #1f3a5f;
  border-radius: 8px;
  background: rgba(13,17,23,0.54);
  padding: 10px 12px;
  min-height: 66px;
}
.fault-diag-label { color: #8b949e; font-size: 12px; display: flex; align-items: center; gap: 5px; }
.fault-diag-value { color: #e6edf3; font-family: Consolas, monospace; font-size: 13px; line-height: 1.6; margin-top: 5px; word-break: break-word; }
.fault-check-item, .fault-attr-item {
  border: 1px solid #1f3a5f;
  border-radius: 8px;
  background: rgba(13,17,23,0.54);
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  align-items: start;
}
.fault-priority {
  display: inline-flex; justify-content: center; align-items: center;
  min-width: 56px; height: 24px; border-radius: 999px;
  font-size: 12px; font-weight: 800;
}
.fault-priority.p1 { background: rgba(233,69,96,0.18); color: #ff6b6b; border: 1px solid rgba(233,69,96,0.38); }
.fault-priority.p2 { background: rgba(240,136,62,0.16); color: #f0883e; border: 1px solid rgba(240,136,62,0.35); }
.fault-priority.p3 { background: rgba(88,166,255,0.14); color: #58a6ff; border: 1px solid rgba(88,166,255,0.35); }
.fault-check-main, .fault-attr-main { color: #e6edf3; font-size: 13px; line-height: 1.7; }
.fault-check-main b, .fault-attr-main b { color: #00d4aa; }
.fault-check-sub, .fault-attr-sub { color: #8b949e; font-size: 12px; line-height: 1.7; margin-top: 3px; }
.fault-attr-meta { color: #f0883e; font-size: 12px; margin-top: 3px; }
.fault-filter-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fault-filter-row .tool-input { min-width: 150px; width: auto; }
.fault-filter-row input.tool-input { flex: 1; min-width: 220px; }
.fault-count { color: #8b949e; font-size: 13px; margin-left: auto; white-space: nowrap; }
.tools-dr-bd .fault-data-table-wrap { background: #0d1117; border-radius: 6px; max-height: 52vh; overflow-y: auto; overflow-x: hidden; }
.tools-dr-bd .fault-data-table { table-layout: fixed; width: 100%; min-width: 0; }
.tools-dr-bd .fault-data-table th { background: #1a2332; color: #c9d1d9; font-size: 12px; padding: 8px 8px; position: sticky; top: 0; z-index: 2; }
.tools-dr-bd .fault-data-table th, .tools-dr-bd .fault-data-table td { white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
.tools-dr-bd .fault-data-table td { background: #0d1117; color: #e6edf3; font-size: 12px; padding: 6px 8px; border-bottom-color: #1a2332; vertical-align: top; overflow: visible; text-overflow: clip; }
.tools-dr-bd .fault-data-table tr:hover td { background: #111d2e; }
.tools-dr-bd .fault-data-table th.d11-filter-heading { vertical-align: top; }
.d11-filter-heading > span { display: block; margin-bottom: 4px; }
.d11-column-filter {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 26px;
  padding: 3px 6px;
  color: #e6edf3;
  background: #0d1117;
  border: 1px solid #34445b;
  border-radius: 4px;
  font: inherit;
  font-weight: 400;
}
select.d11-column-filter { padding-right: 24px; cursor: pointer; }
.d11-column-filter::placeholder { color: #718096; }
.d11-column-filter:focus { outline: 2px solid rgba(0, 212, 170, 0.42); outline-offset: 0; border-color: #00d4aa; }
.d11-filter-count { padding: 5px 8px 0; color: #8b949e; font-size: 14px; text-align: right; }
.d11-restored-meaning { color: #3fb950 !important; font-weight: 700; }
.d11-meaning-tag {
  display: inline-block;
  box-sizing: border-box;
  max-width: 100%;
  padding: 2px 7px;
  color: hsl(var(--d11-meaning-hue) 48% 18%);
  background: hsl(var(--d11-meaning-hue) 72% 84%);
  border: 1px solid hsl(var(--d11-meaning-hue) 56% 66%);
  border-radius: 4px;
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
body.light .d11-column-filter {
  color: #111827;
  background: #ffffff;
  border-color: #cbd5e1;
}
body.light .d11-column-filter::placeholder { color: #64748b; }
body.light .d11-restored-meaning { color: #15803d !important; }
body.light .d11-meaning-tag {
  color: hsl(var(--d11-meaning-hue) 52% 20%);
  background: hsl(var(--d11-meaning-hue) 72% 88%);
  border-color: hsl(var(--d11-meaning-hue) 50% 72%);
}
.d11-timeline-panel {
  margin-top: 12px;
  border: 1px solid #1f3a5f;
  border-radius: 6px;
  background: #0d1117;
  overflow: hidden;
}
.d11-timeline-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 10px;
  border-bottom: 1px solid #1f3a5f;
  color: #8b949e;
  font-size: 13px;
}
.d11-timeline-head h3 { margin: 0; color: #e6edf3; font-size: 15px; font-weight: 700; }
.d11-timeline-legend { display: flex; flex-wrap: wrap; gap: 5px 12px; margin-left: auto; }
.d11-timeline-legend-item { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.d11-timeline-legend-item i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.d11-timeline-wrap { position: relative; overflow: hidden; background: #0f1923; }
.d11-timeline-canvas { display: block; width: 100%; min-width: 0; height: 330px; cursor: crosshair; touch-action: none; }
.d11-timeline-tooltip {
  position: absolute;
  z-index: 4;
  display: none;
  flex-direction: column;
  gap: 3px;
  min-width: 156px;
  max-width: calc(100% - 8px);
  box-sizing: border-box;
  padding: 7px 9px;
  color: #e6edf3;
  background: rgba(13, 17, 23, 0.94);
  border: 1px solid #34506f;
  border-radius: 5px;
  box-shadow: 0 4px 12px rgba(0,0,0,.32);
  font: 13px Consolas, monospace;
  line-height: 1.35;
  pointer-events: none;
  white-space: nowrap;
}
.d11-timeline-tooltip b { color: #7fe9d4; font-weight: 700; }
.d11-timeline-tooltip span { color: #c9d1d9; }
.d11-timeline-tooltip-value { display: grid; grid-template-columns: 8px auto auto minmax(0, 1fr); align-items: center; gap: 6px; }
.d11-timeline-tooltip-value i { width: 7px; height: 7px; border-radius: 50%; }
.d11-timeline-tooltip-value strong { font-weight: 600; white-space: nowrap; }
.d11-timeline-tooltip-value code { color: #7fe9d4; font: inherit; white-space: nowrap; }
.d11-timeline-tooltip-value em { overflow: hidden; color: #e6edf3; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.d11-timeline-tooltip-duration { grid-column: 2 / -1; font: inherit; font-weight: 600; white-space: nowrap; }
.d11-timeline-tooltip-duration.is-fault { color: #ffd08a; }
.d11-timeline-tooltip-duration.is-restored { color: #74d68a; }
body.light .d11-timeline-panel { border-color: #d1d5db; background: #ffffff; }
body.light .d11-timeline-head { border-bottom-color: #d1d5db; color: #64748b; }
body.light .d11-timeline-head h3 { color: #1f2937; }
body.light .d11-timeline-wrap { background: #ffffff; }
body.light .d11-timeline-tooltip { color: #111827; background: rgba(255,255,255,.96); border-color: #94a3b8; box-shadow: 0 4px 12px rgba(15,23,42,.16); }
body.light .d11-timeline-tooltip b { color: #047857; }
body.light .d11-timeline-tooltip span { color: #334155; }
body.light .d11-timeline-tooltip-value code { color: #047857; }
body.light .d11-timeline-tooltip-value em { color: #111827; }
body.light .d11-timeline-tooltip-duration.is-fault { color: #9a4d00; }
body.light .d11-timeline-tooltip-duration.is-restored { color: #15803d; }
.tools-dr-bd .fault-data-table th:nth-child(1), .tools-dr-bd .fault-data-table td:nth-child(1) { width: 5%; }
.tools-dr-bd .fault-data-table th:nth-child(2), .tools-dr-bd .fault-data-table td:nth-child(2) { width: 14%; }
.tools-dr-bd .fault-data-table th:nth-child(3), .tools-dr-bd .fault-data-table td:nth-child(3) { width: 7%; }
.tools-dr-bd .fault-data-table th:nth-child(4), .tools-dr-bd .fault-data-table td:nth-child(4) { width: 8%; }
.tools-dr-bd .fault-data-table th:nth-child(5), .tools-dr-bd .fault-data-table td:nth-child(5) { width: 8%; }
.tools-dr-bd .fault-data-table th:nth-child(6), .tools-dr-bd .fault-data-table td:nth-child(6) { width: 10%; }
.tools-dr-bd .fault-data-table th:nth-child(7), .tools-dr-bd .fault-data-table td:nth-child(7) { width: 9%; }
.tools-dr-bd .fault-data-table th:nth-child(8), .tools-dr-bd .fault-data-table td:nth-child(8) { width: 9%; }
.tools-dr-bd .fault-data-table th:nth-child(9), .tools-dr-bd .fault-data-table td:nth-child(9) { width: 8%; }
.tools-dr-bd .fault-data-table th:nth-child(10), .tools-dr-bd .fault-data-table td:nth-child(10) { width: 22%; }
.tools-dr-bd .d11-event-table th:nth-child(8), .tools-dr-bd .d11-event-table td:nth-child(8) { width: 18%; }
.tools-dr-bd .d11-event-table th:nth-child(10), .tools-dr-bd .d11-event-table td:nth-child(10) { width: 13%; }
.fault-level { display: inline-flex; min-width: 34px; justify-content: center; border-radius: 999px; padding: 1px 8px; font-weight: 700; font-size: 11px; }
.fault-level.info { color: #58a6ff; background: rgba(88,166,255,0.12); }
.fault-level.warn { color: #f0883e; background: rgba(240,136,62,0.14); }
.fault-level.error { color: #ff6b6b; background: rgba(233,69,96,0.18); }
.fault-event-badge { color: #00d4aa; font-family: Consolas, monospace; font-weight: 600; }
.fault-raw {
  margin: 0;
  padding: 14px;
  border: 1px solid #1f3a5f;
  border-radius: 8px;
  background: #0d1117;
  color: #c9d1d9;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 52vh;
  overflow: auto;
}

body.light .tools-c.fault-analysis-card {
  background-color: #f1f3f5;
  background-image:
    linear-gradient(180deg,
      rgba(255, 255, 255, 0.98) 0%,
      rgba(255, 255, 255, 0.52) 20%,
      rgba(255, 255, 255, 0) 52%,
      rgba(100, 116, 139, 0.12) 100%),
    linear-gradient(105deg, #fbfbfc 0%, #eef1f4 58%, #e3e7eb 100%);
  border-color: rgba(100, 116, 139, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 1px 0 0 rgba(255, 255, 255, 0.78),
    inset 0 -1px 0 rgba(71, 85, 105, 0.24),
    inset -1px 0 0 rgba(71, 85, 105, 0.14),
    var(--fault-card-ring),
    0 2px 4px rgba(15, 23, 42, 0.12),
    0 7px 14px rgba(15, 23, 42, 0.08);
}

body.light .tools-c.fault-analysis-card:hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 1px 0 0 rgba(255, 255, 255, 0.84),
    inset 0 -1px 0 rgba(71, 85, 105, 0.28),
    inset -1px 0 0 rgba(71, 85, 105, 0.17),
    var(--fault-card-ring),
    0 3px 6px rgba(15, 23, 42, 0.15),
    0 9px 18px rgba(15, 23, 42, 0.12);
}

body.light .fault-analysis-card.disabled {
  opacity: 1;
  border-color: rgba(100, 116, 139, 0.26);
}

body.light .fault-analysis-card:not(.disabled) {
  --fault-card-ring: 0 0 0 1px rgba(5, 150, 105, 0.72);
  border-color: #059669;
}

body.light .fault-analysis-card:not(.disabled) .fault-analysis-ready {
  color: #ffffff;
  background: #059669;
  border-color: #059669;
}

body.light .fault-analysis-ready {
  color: #047857;
  background: #d1fae5;
  border-color: #a7f3d0;
}

body.light .fault-analysis-dev {
  color: #64748b;
  background: #f1f5f9;
  border-color: #d1d5db;
}

body.light .fault-analysis-dev-panel {
  background: #f8fafc;
  border-color: #cbd5e1;
}

body.light .fault-analysis-dev-title {
  color: #111827;
}

body.light .fault-analysis-dev-sub {
  color: #64748b;
}

@media (max-width: 768px) {
  .fault-card-width-resizer {
    display: none;
  }

  .tools-g.fault-analysis-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .tools-dr.faultwide {
    width: 100vw;
  }

  .fault-diag-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== D5-4 升级日志解析表格行状态 ===== */
.fault-analysis-parser[data-zone="D5-4"] .fault-data-table-wrap { overflow-x: auto; overflow-y: auto; max-height: 32vh; }
.fault-analysis-parser[data-zone="D5-4"] .fault-data-table { min-width: 1680px; }
/* D5-4 展示全部 12 列，不再隐藏后列 */
.fault-analysis-parser[data-zone="D5-4"] .fault-data-table th,
.fault-analysis-parser[data-zone="D5-4"] .fault-data-table td { display: table-cell; }
/* 重新分配 12 列宽度，让长版本号/时间/详情能在一行内完整显示，避免换行把行高撑大 */
.fault-analysis-parser[data-zone="D5-4"] .fault-data-table th:nth-child(1),
.fault-analysis-parser[data-zone="D5-4"] .fault-data-table td:nth-child(1) { width: 3%; }
.fault-analysis-parser[data-zone="D5-4"] .fault-data-table th:nth-child(2),
.fault-analysis-parser[data-zone="D5-4"] .fault-data-table td:nth-child(2) { width: 11%; }
.fault-analysis-parser[data-zone="D5-4"] .fault-data-table th:nth-child(3),
.fault-analysis-parser[data-zone="D5-4"] .fault-data-table td:nth-child(3) { width: 13%; }
.fault-analysis-parser[data-zone="D5-4"] .fault-data-table th:nth-child(4),
.fault-analysis-parser[data-zone="D5-4"] .fault-data-table td:nth-child(4) { width: 6%; }
.fault-analysis-parser[data-zone="D5-4"] .fault-data-table th:nth-child(5),
.fault-analysis-parser[data-zone="D5-4"] .fault-data-table td:nth-child(5) { width: 6%; }
.fault-analysis-parser[data-zone="D5-4"] .fault-data-table th:nth-child(6),
.fault-analysis-parser[data-zone="D5-4"] .fault-data-table td:nth-child(6) { width: 11%; }
.fault-analysis-parser[data-zone="D5-4"] .fault-data-table th:nth-child(7),
.fault-analysis-parser[data-zone="D5-4"] .fault-data-table td:nth-child(7) { width: 7%; }
.fault-analysis-parser[data-zone="D5-4"] .fault-data-table th:nth-child(8),
.fault-analysis-parser[data-zone="D5-4"] .fault-data-table td:nth-child(8) { width: 4%; }
.fault-analysis-parser[data-zone="D5-4"] .fault-data-table th:nth-child(9),
.fault-analysis-parser[data-zone="D5-4"] .fault-data-table td:nth-child(9) { width: 4%; }
.fault-analysis-parser[data-zone="D5-4"] .fault-data-table th:nth-child(10),
.fault-analysis-parser[data-zone="D5-4"] .fault-data-table td:nth-child(10) { width: 4%; }
.fault-analysis-parser[data-zone="D5-4"] .fault-data-table th:nth-child(11),
.fault-analysis-parser[data-zone="D5-4"] .fault-data-table td:nth-child(11) { width: 5%; }
.fault-analysis-parser[data-zone="D5-4"] .fault-data-table th:nth-child(12),
.fault-analysis-parser[data-zone="D5-4"] .fault-data-table td:nth-child(12) { width: 26%; white-space: nowrap; line-height: 1.2; }
/* 升级日志行更紧凑：禁止换行、截断溢出、减小 padding 与行高，消灭记录之间的大段空白 */
.fault-analysis-parser[data-zone="D5-4"] .fault-data-table th,
.fault-analysis-parser[data-zone="D5-4"] .fault-data-table td { padding: 2px 4px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fault-analysis-parser[data-zone="D5-4"] .fault-data-table td:nth-child(12) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tools-dr-bd .fault-data-table tr.d54-row-fail td { background: rgba(233,69,96,0.12); color: #ff9bab; }
.tools-dr-bd .fault-data-table tr.d54-row-ok td { color: #dfffe8; }
.tools-dr-bd .fault-data-table tr.d54-row-ok:nth-child(4n+1) td { background: #f33501; }
.tools-dr-bd .fault-data-table tr.d54-row-ok:nth-child(4n+2) td { background: rgb(4, 154, 247); }
.tools-dr-bd .fault-data-table tr.d54-row-ok:nth-child(4n+3) td { background: rgba(5, 238, 121, 0.91); }
.tools-dr-bd .fault-data-table tr.d54-row-ok:nth-child(4n) td { background: rgba(186, 24, 167, 0.305); }
.tools-dr-bd .fault-data-table tr.d54-row-boot td { background: rgba(0,212,170,0.08); color: #7fe9d4; }
.tools-dr-bd .fault-data-table tr.d54-row-info td { color: #e6edf3; }
.tools-dr-bd .fault-data-table tr.d54-row-selected td { background: rgba(0,212,170,0.22) !important; box-shadow: inset 0 1px 0 rgba(0,212,170,0.35), inset 0 -1px 0 rgba(0,212,170,0.35); }
.d54-chg { color: #3fb950; font-weight: 700; }
.d54-detail-cell { color: #e6edf3; font-size: 12px; }

/* D5-4 耗时详情面板 */
.d54-detail-panel { margin-top: 12px; padding: 12px 14px; background: #0d1117; border: 1px solid #1f3a5f; border-radius: 8px; }
.d54-detail-title { font-size: 14px; font-weight: 700; color: #00d4aa; margin-bottom: 10px; }
.d54-detail-table { min-width: 0; width: 100%; }
.d54-detail-table th,
.d54-detail-table td { padding: 6px 10px; font-size: 12px; }
.d54-detail-table th { background: #1a2332; color: #c9d1d9; }
.d54-detail-table td { background: #111822; color: #e6edf3; border-bottom-color: #1a2332; }
.d54-detail-table tr:hover td { background: #161f2d; }
.d54-detail-check { margin-top: 10px; padding: 8px 10px; background: rgba(63,185,80,0.08); border-left: 3px solid #3fb950; border-radius: 4px; color: #9be8a8; font-size: 12px; }
body.light .d54-detail-panel { background: #fff; border-color: #d0d5dd; }
body.light .d54-detail-title { color: #008f6b; }
body.light .d54-detail-table th { background: #f3f4f6; color: #374151; }
body.light .d54-detail-table td { background: #fafafa; color: #111827; border-bottom-color: #e5e7eb; }
body.light .d54-detail-table tr:hover td { background: #f3f4f6; }
body.light .d54-detail-check { background: rgba(63,185,80,0.08); color: #166534; border-left-color: #3fb950; }

/* ===== D3-2 VI 曲线解析面板 (vi-curve-parser.js) ===== */
.vi-panel { display: flex; flex-direction: column; gap: 12px; }
.vi-info-bar {
  display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center;
  padding: 8px 12px; border: 1px solid #1f3a5f; border-radius: 8px;
  background: #0d1117; color: #a1afbd; font-size: 12px;
}
.vi-tag {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: rgba(0,212,170,0.14); color: #00d4aa; font-weight: 700; font-size: 11px;
}
.vi-ctrls { display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: flex-end; }
.vi-ctrl-item { display: flex; flex-direction: column; gap: 4px; }
.vi-ctrl-item > label { color: #8b949e; font-size: 12px; margin: 0; }
.vi-pv-list { display: flex; flex-wrap: wrap; gap: 6px 10px; }
.vi-pv-lbl { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; font-size: 12px; color: #c9d1d9; user-select: none; }
.vi-pv-lbl input { margin: 0; }
.vi-pv-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.vi-chart-wrap {
  width: 100%; overflow-x: auto; border: 1px solid #1f3a5f; border-radius: 8px;
  background: #0f1923; padding: 8px;
}
.vi-chart-wrap canvas { display: block; max-width: 100%; }
.vi-export-row { display: flex; gap: 8px; flex-wrap: wrap; }

body.light .vi-info-bar { background: #f1f5f9; border-color: #d1d5db; color: #475569; }
body.light .vi-chart-wrap { background: #fff; border-color: #d1d5db; }
body.light .vi-tag { background: #d1fae5; color: #047857; }
