:root {
  --fl-red: #aa2d1e;
  --fl-red-soft: #fbefec;
  --fl-green: #26864a;
  --fl-blue: #286b9f;
  --fl-ink: #1e2938;
  --fl-muted: #6f7b8d;
  --fl-line: #d8dfe7;
  --fl-panel: #ffffff;
  --fl-bg: #f4f6f8;
}

.dashboard-main { background: var(--fl-bg); }
.page-heading { padding-bottom: 12px; }
.page-heading h1 { font-size: 25px; margin-top: 5px; }
.page-heading #page-subtitle { display: none !important; }
.page-heading .eyebrow { color: var(--fl-red); }
#core-conclusion[hidden] { display: none !important; }

.fl2-shell { color: var(--fl-ink); padding-bottom: 42px; }
.fl2-shell h2,
.fl2-shell h3,
.fl2-shell p { margin: 0; }
.fl2-shell button,
.fl2-shell input,
.fl2-shell select,
.fl2-shell textarea { font: inherit; }

.fl2-section { margin-top: 24px; }
.fl2-section > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}
.fl2-section > header h2 { font-size: 19px; letter-spacing: .02em; }
.fl2-section > header h3 { font-size: 16px; }

.fl2-card,
.fl2-toolbar,
.fl2-chart,
.fl2-table-card,
.fl2-param-group,
.fl2-run-card {
  background: var(--fl-panel);
  border: 1px solid var(--fl-line);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(22, 34, 48, .035);
}

.fl2-toolbar { padding: 14px 16px; }
.fl2-toolbar-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}
.fl2-toolbar-row.is-compact { grid-template-columns: 2fr 1fr 1fr 1fr auto; }
.fl2-field { display: grid; gap: 6px; min-width: 0; }
.fl2-field > span { color: #4b596d; font-size: 13px; font-weight: 700; }
.fl2-field input,
.fl2-field select,
.fl2-field textarea {
  width: 100%;
  min-height: 42px;
  padding: 8px 11px;
  color: var(--fl-ink);
  background: #fff;
  border: 1px solid #cfd7e1;
  border-radius: 7px;
  outline: none;
}
.fl2-field input:focus,
.fl2-field select:focus,
.fl2-field textarea:focus { border-color: var(--fl-red); box-shadow: 0 0 0 3px rgba(170,45,30,.08); }
.fl2-field textarea { min-height: 108px; resize: vertical; }

.fl2-params { display: grid; gap: 12px; }
.fl2-param-group { overflow: hidden; }
.fl2-param-group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}
.fl2-param-group > summary::-webkit-details-marker { display: none; }
.fl2-param-group > summary::after { content: "展开"; color: var(--fl-muted); font-size: 12px; font-weight: 500; }
.fl2-param-group[open] > summary::after { content: "收起"; }
.fl2-param-body { border-top: 1px solid #e8ecf1; padding: 14px 16px 16px; }
.fl2-param-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.fl2-advanced { margin-top: 12px; border: 1px dashed #cfd7e1; border-radius: 8px; }
.fl2-advanced summary { padding: 11px 13px; cursor: pointer; color: #59677a; font-weight: 700; }
.fl2-advanced .fl2-param-grid { padding: 0 13px 13px; }

.fl2-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; margin-top: 14px; }
.fl2-button {
  min-height: 38px;
  padding: 8px 16px;
  border: 1px solid #ccd4de;
  border-radius: 7px;
  color: #334155;
  background: #fff;
  cursor: pointer;
  font-weight: 700;
}
.fl2-button:hover { border-color: #aab5c2; background: #f8fafc; }
.fl2-button.primary { border-color: var(--fl-red); background: var(--fl-red); color: #fff; }
.fl2-button.primary:hover { background: #912416; }
.fl2-button.danger { color: #a92e1f; border-color: #dfb8b2; }

.fl2-tabs { display: flex; gap: 4px; padding: 4px; background: #e9edf2; border-radius: 9px; width: max-content; }
.fl2-tab { min-height: 36px; padding: 7px 15px; border: 0; border-radius: 7px; background: transparent; color: #536176; cursor: pointer; font-weight: 750; }
.fl2-tab.is-active { background: #fff; color: var(--fl-red); box-shadow: 0 1px 3px rgba(20,30,45,.1); }

.fl2-conclusion {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 12px;
  border: 1px solid var(--fl-line);
  border-left: 4px solid var(--fl-red);
  border-radius: 9px;
  overflow: hidden;
  background: var(--fl-line);
}
.fl2-conclusion > div { background: #fff; padding: 13px 15px; }
.fl2-conclusion small { display: block; color: var(--fl-muted); margin-bottom: 4px; }
.fl2-conclusion strong { font-size: 14px; line-height: 1.45; }

.fl2-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.fl2-kpi { min-height: 92px; padding: 14px; background: #fff; border: 1px solid var(--fl-line); border-radius: 9px; }
.fl2-kpi small { display: block; color: var(--fl-muted); font-size: 12px; margin-bottom: 9px; }
.fl2-kpi strong { display: block; font-size: 22px; font-family: Arial, sans-serif; }
.fl2-kpi em { display: block; margin-top: 6px; color: #7b8798; font-size: 11px; font-style: normal; }
.fl2-kpi.good strong { color: var(--fl-green); }
.fl2-kpi.bad strong { color: #b73426; }

.fl2-chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fl2-chart-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fl2-chart { min-width: 0; padding: 12px 13px 8px; }
.fl2-chart.is-wide { grid-column: 1 / -1; }
.fl2-chart h3 { font-size: 14px; margin: 0 0 3px; }
.fl2-chart .fl2-chart-conclusion { min-height: 18px; color: var(--fl-muted); font-size: 12px; }
.fl2-plot { width: 100%; height: 285px; }
.fl2-chart.is-wide .fl2-plot { height: 320px; }

.fl2-gates { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.fl2-gate { padding: 11px 12px; border: 1px solid var(--fl-line); border-radius: 8px; background: #fff; }
.fl2-gate b { display: block; min-height: 34px; font-size: 12px; }
.fl2-gate strong { font-family: Arial, sans-serif; font-size: 13px; }
.fl2-gate.pass strong { color: var(--fl-green); }
.fl2-gate.fail { border-color: #eccbc6; background: #fffafa; }
.fl2-gate.fail strong { color: #b73426; }

.fl2-table-card { overflow: hidden; }
.fl2-table-card > header { padding: 12px 14px; border-bottom: 1px solid #e7ebf0; }
.fl2-table-scroll { overflow: auto; max-height: 450px; }
.fl2-table { width: 100%; border-collapse: collapse; white-space: nowrap; font-size: 12px; }
.fl2-table th { position: sticky; top: 0; z-index: 1; padding: 10px 12px; text-align: left; color: #59677a; background: #f7f9fb; border-bottom: 1px solid #dfe5ec; }
.fl2-table td { padding: 10px 12px; border-bottom: 1px solid #edf0f4; }
.fl2-table tbody tr:hover { background: #faf7f5; }
.fl2-table .num { text-align: right; font-family: Arial, sans-serif; }

.fl2-run-card { padding: 14px 16px; }
.fl2-run-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.fl2-run-name { font-size: 16px; font-weight: 850; }
.fl2-run-meta { display: flex; gap: 8px 14px; flex-wrap: wrap; color: var(--fl-muted); font-size: 12px; margin-top: 7px; }
.fl2-progress { height: 7px; margin-top: 12px; background: #e8edf2; border-radius: 999px; overflow: hidden; }
.fl2-progress > i { display: block; height: 100%; background: var(--fl-red); }
.fl2-status { display: inline-flex; align-items: center; min-height: 26px; padding: 3px 9px; border-radius: 999px; background: #eef2f6; font-size: 12px; font-weight: 750; }
.fl2-status.completed { color: #1f7a42; background: #edf8f1; }
.fl2-status.failed { color: #a52d21; background: #fff0ed; }
.fl2-status.running,
.fl2-status.queued { color: #27679b; background: #edf6fc; }

.fl2-family-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; }
.fl2-family { padding: 10px; border: 1px solid var(--fl-line); border-radius: 8px; background: #fff; cursor: pointer; text-align: left; }
.fl2-family span { display: block; color: #566478; font-size: 12px; }
.fl2-family strong { display: block; margin-top: 6px; font-size: 18px; }
.fl2-family.is-active { border-color: var(--fl-red); background: var(--fl-red-soft); }

.fl2-empty { padding: 26px; color: var(--fl-muted); text-align: center; background: #fff; border: 1px dashed #cdd5df; border-radius: 9px; }
.fl2-code { padding: 12px; border-radius: 7px; background: #17202c; color: #e8edf3; white-space: pre-wrap; word-break: break-word; font: 12px/1.6 Consolas, monospace; }
.fl2-split { display: grid; grid-template-columns: 1fr 2fr; gap: 12px; }

@media (max-width: 1300px) {
  .fl2-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fl2-gates { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fl2-family-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .fl2-toolbar-row,
  .fl2-toolbar-row.is-compact,
  .fl2-param-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fl2-chart-grid,
  .fl2-chart-grid.three,
  .fl2-split { grid-template-columns: 1fr; }
  .fl2-conclusion { grid-template-columns: 1fr; }
}

/* Canonical advanced-parameter layout. */
.fl2-param-grid > .fl2-advanced { grid-column: 1 / -1; }
.fl2-advanced .fl2-param-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fl2-param-grid > .fl2-param-group { grid-column: 1 / -1; }
@media (max-width: 980px) {
  .fl2-advanced .fl2-param-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Final factor laboratory framework: dashboard-style live tables and Plotly charts. */
.flx-shell {
  --flx-red: #aa2d1e;
  --flx-table-red: #c00000;
  --flx-green: #00b050;
  --flx-blue: #2f75b5;
  --flx-ink: #1e2938;
  --flx-muted: #667085;
  --flx-line: #d8dfe7;
  --flx-soft: #f7f4f1;
  color: var(--flx-ink);
  display: grid;
  gap: 18px;
  padding-bottom: 44px;
}

.flx-shell h2,
.flx-shell h3,
.flx-shell p {
  margin: 0;
}

.flx-shell button,
.flx-shell input,
.flx-shell select,
.flx-shell textarea {
  font: inherit;
}

.flx-section,
.flx-table-card,
.flx-chart,
.flx-metric {
  background: #fff;
  border: 1px solid var(--flx-line);
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(17, 24, 39, .05);
}

.flx-section {
  padding: 16px 18px;
}

.flx-section.flx-inner {
  padding: 14px;
}

.flx-section > header {
  margin-bottom: 12px;
}

.flx-section h2,
.flx-table-card h3 {
  color: #0f172a;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

.flx-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.flx-metric {
  min-height: 96px;
  padding: 16px;
}

.flx-metric span,
.flx-metric em {
  display: block;
  color: var(--flx-muted);
  font-style: normal;
}

.flx-metric span {
  font-size: 13px;
  font-weight: 700;
}

.flx-metric strong {
  display: block;
  margin: 8px 0 5px;
  color: #111827;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  font-size: 23px;
  font-weight: 800;
  line-height: 1.1;
}

.flx-metric em {
  font-size: 12px;
}

.flx-champion {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.flx-champion article {
  min-height: 82px;
  padding: 12px 14px;
  border: 1px solid #ead6d0;
  border-left: 4px solid var(--flx-red);
  border-radius: 8px;
  background: #fff;
}

.flx-champion span,
.flx-champion em {
  display: block;
  color: var(--flx-muted);
  font-style: normal;
}

.flx-champion span {
  font-size: 12px;
  font-weight: 700;
}

.flx-champion strong {
  display: block;
  margin: 7px 0 4px;
  color: #111827;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
}

.flx-champion em {
  font-size: 12px;
}

.flx-taxonomy {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.flx-taxonomy article {
  min-height: 144px;
  padding: 14px;
  border: 1px solid #e3e8ef;
  border-left: 4px solid var(--flx-red);
  border-radius: 8px;
  background: #fff;
}

.flx-taxonomy h3 {
  color: var(--flx-red);
  font-size: 16px;
  font-weight: 800;
}

.flx-taxonomy p {
  min-height: 52px;
  margin-top: 8px;
  color: var(--flx-muted);
  font-size: 12px;
  line-height: 1.65;
}

.flx-taxonomy strong {
  display: inline-block;
  margin-top: 10px;
  color: #111827;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  font-size: 24px;
  line-height: 1;
}

.flx-taxonomy span {
  margin-left: 7px;
  color: var(--flx-muted);
  font-size: 12px;
}

.flx-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
  align-items: stretch;
}

.flx-flow-node {
  min-height: 88px;
  padding: 13px 12px;
  border: 1px solid #e3e8ef;
  border-radius: 8px;
  background: var(--flx-soft);
}

.flx-flow-node b {
  display: block;
  color: var(--flx-red);
  font-size: 15px;
  font-weight: 800;
}

.flx-flow-node span {
  display: block;
  margin-top: 7px;
  color: #475467;
  font-size: 12px;
  line-height: 1.55;
}

.flx-flow i {
  display: none;
}

.flx-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.flx-controls-tight {
  grid-template-columns: minmax(220px, 1.2fr) minmax(140px, .7fr) auto;
}

.flx-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.flx-field.flx-wide {
  grid-column: span 2;
}

.flx-field span {
  color: #4b5565;
  font-size: 13px;
  font-weight: 700;
}

.flx-field select,
.flx-field textarea {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  color: #111827;
  background: #fff;
  border: 1px solid #cfd7e1;
  border-radius: 8px;
  outline: none;
}

.flx-field textarea {
  min-height: 90px;
  resize: vertical;
}

.flx-field select:focus,
.flx-field textarea:focus {
  border-color: var(--flx-red);
  box-shadow: 0 0 0 3px rgba(170, 45, 30, .08);
}

.flx-button {
  min-height: 42px;
  padding: 8px 16px;
  color: #334155;
  background: #fff;
  border: 1px solid #cfd7e1;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}

.flx-button.primary,
.flx-button:hover {
  color: #fff;
  background: var(--flx-red);
  border-color: var(--flx-red);
}

.flx-formula-status {
  align-self: center;
  color: var(--flx-red);
  font-weight: 800;
}

.flx-grid {
  display: grid;
  gap: 14px;
}

.flx-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.flx-chart {
  min-width: 0;
  padding: 10px 10px 8px;
}

.flx-plot {
  width: 100%;
  height: 330px;
}

.flx-empty {
  display: grid;
  min-height: 160px;
  place-items: center;
  color: var(--flx-muted);
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #fff;
}

.flx-table-card {
  min-width: 0;
  overflow: hidden;
}

.flx-table-card > header {
  padding: 14px 16px;
  border-bottom: 1px solid #e5e7eb;
}

.flx-table-scroll {
  max-height: 520px;
  overflow: auto;
}

.flx-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  white-space: nowrap;
  font-size: 12px;
}

.flx-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px 12px;
  color: #fff;
  background: var(--flx-table-red);
  border: 1px solid rgba(255, 255, 255, .75);
  font-weight: 800;
  text-align: center;
}

.flx-table td {
  position: relative;
  padding: 9px 12px;
  color: #111827;
  background: #f6f6f6;
  border: 1px solid #fff;
  font-weight: 400;
  vertical-align: middle;
}

.flx-table tbody tr:nth-child(odd) td {
  background: #e6e6e6;
}

.flx-table tbody tr:nth-child(even) td {
  background: #f4f4f4;
}

.flx-table tbody td:first-child,
.flx-table td.flx-first {
  background: #f2ece6 !important;
  font-weight: 800;
}

.flx-table .flx-num {
  text-align: right;
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

.flx-bar-cell {
  min-width: 92px;
  background-clip: padding-box;
}

.flx-zero,
.flx-data-bar,
.flx-cell-value {
  pointer-events: none;
}

.flx-zero {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 50%;
  width: 1px;
  background: #111827;
  opacity: .85;
  z-index: 0;
}

.flx-data-bar {
  position: absolute;
  top: 5px;
  bottom: 5px;
  z-index: 0;
  border-radius: 2px;
}

.flx-bar-cell.pos .flx-data-bar {
  left: 50%;
  border: 1px solid var(--flx-table-red);
  background: linear-gradient(90deg, rgba(192, 0, 0, .98), rgba(192, 0, 0, .28));
}

.flx-bar-cell.neg .flx-data-bar {
  right: 50%;
  border: 1px solid var(--flx-green);
  background: linear-gradient(270deg, rgba(0, 176, 80, .98), rgba(0, 176, 80, .28));
}

.flx-cell-value {
  position: relative;
  z-index: 1;
  font-weight: 400;
}

@media (max-width: 1360px) {
  .flx-taxonomy {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .flx-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .flx-grid.two,
  .flx-controls,
  .flx-controls-tight {
    grid-template-columns: 1fr;
  }

  .flx-field.flx-wide {
    grid-column: auto;
  }

  .flx-taxonomy,
  .flx-metrics {
    grid-template-columns: 1fr;
  }
}
