/* ==========================================================================
   枢衡信贷 — 现代机构风控工作台（统一浅色高质感 · 业务/技术双视角无缝切换）
   遵循 frontend-design：
   - 开放式冷白画布 (#F6F7F9 / #FFFFFF) + 1px 发丝线，无盒套盒卡片堆砌
   - 业务与技术视角均采用克制浅色系，切换无刺眼黑屏跳变
   - 明确聚光联动（聚焦态清晰提亮 + 非相关区退后；全部显示态清晰可辨且随时切回）
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f6f7f9;
  color: #0e1726;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

html body.gf-has-portal-bar {
  padding-top: 86px !important;
}

html body:not(.gf-has-portal-bar) {
  padding-top: 52px;
}

.tnum {
  font-variant-numeric: tabular-nums;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---------------- 顶部极简导航栏 ---------------- */
.cr-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
  background: rgba(246, 247, 249, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e4e8ee;
}

body.gf-has-portal-bar .cr-header {
  top: 34px;
}

.cr-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.cr-brand-seal {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  background: #0e1726;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.cr-brand-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.cr-mode-nav {
  display: inline-flex;
  align-items: center;
  gap: 24px;
  height: 100%;
}

.cr-mode-tab {
  position: relative;
  appearance: none;
  border: 0;
  background: transparent;
  color: #5b6678;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  height: 100%;
  padding: 0 2px;
  cursor: pointer;
  transition: color 0.15s ease;
}

.cr-mode-tab:hover,
.cr-mode-tab.is-active {
  color: #0e1726;
}

.cr-mode-tab.is-active {
  font-weight: 600;
}

.cr-mode-tab.is-active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: #0e1726;
}

.cr-header-ops {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* 统一浅色分段切换器 */
.cr-lens,
.cr-seg {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border-radius: 7px;
  background: #e9edf3;
}

.cr-lens-btn,
.cr-seg-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: #5b6678;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.cr-lens-btn.is-active,
.cr-seg-btn.is-active {
  background: #ffffff;
  color: #0e1726;
  box-shadow: 0 1px 2px rgba(14, 23, 38, 0.08);
}

.cr-lens-btn.is-tech.is-active {
  color: #0b7285;
}

.cr-text-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: #5b6678;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 6px;
  cursor: pointer;
}

.cr-text-btn:hover {
  color: #0e1726;
}

/* ---------------- 按钮系统 ---------------- */
.cr-btn {
  appearance: none;
  border: 1px solid #d4dbe5;
  background: #ffffff;
  color: #0e1726;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 15px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
  white-space: nowrap;
}

.cr-btn:hover:not(:disabled) {
  background: #f1f4f8;
  border-color: #b7c3d4;
}

.cr-btn.is-primary {
  background: #0e1726;
  border-color: #0e1726;
  color: #ffffff;
}

.cr-btn.is-primary:hover:not(:disabled) {
  background: #1e2d45;
  border-color: #1e2d45;
}

.cr-btn.is-teal {
  background: #0b7285;
  border-color: #0b7285;
  color: #ffffff;
}

.cr-btn.is-teal:hover:not(:disabled) {
  background: #095d6d;
}

.cr-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ==========================================================================
   视图一：全景架构图（保持极简开放画布，双视角统一浅色）
   ========================================================================== */
.cr-ov {
  min-height: calc(100vh - 86px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 44px 36px 52px;
}

.cr-ov-inner {
  width: 100%;
  max-width: 1180px;
  display: flex;
  flex-direction: column;
  gap: 52px;
}

.cr-ov-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
}

.cr-ov-title h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.cr-ov-title p {
  margin: 10px 0 0;
  font-size: 14px;
  color: #5b6678;
}

.cr-ov-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cr-flow-stage {
  position: relative;
  padding: 6px 0 8px;
}

.cr-flow-cols {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 28px;
}

.cr-flow-cols::before {
  content: '';
  position: absolute;
  top: 5px;
  left: 5px;
  right: calc(20% - 10px);
  height: 1.5px;
  background: #d4dbe5;
  pointer-events: none;
}

.cr-flow-node {
  position: relative;
  appearance: none;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 28px 0 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cr-flow-node::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #0e1726;
  border: 2px solid #f6f7f9;
  z-index: 2;
  transition: background 0.15s ease, transform 0.15s ease;
}

.cr-flow-node.is-done::before {
  background: #0b7285;
}

.cr-flow-node:hover::before {
  transform: scale(1.25);
}

.cr-flow-node-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.cr-flow-node-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.015em;
  transition: color 0.15s ease;
}

.cr-flow-node:hover .cr-flow-node-title {
  color: #0b7285;
}

.cr-flow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #cbd5e1;
  flex-shrink: 0;
}

.cr-flow-node.is-done .cr-flow-dot {
  background: #0b7285;
}

.cr-flow-lines {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13.5px;
}

.cr-flow-ai {
  color: #0e1726;
  font-weight: 500;
}

body.is-tech-lens .cr-flow-ai {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  color: #0b7285;
}

.cr-flow-human {
  color: #5b6678;
}

.cr-flow-pass {
  padding-top: 12px;
  border-top: 1px solid #e4e8ee;
  font-size: 12.5px;
  font-weight: 600;
  color: #475569;
}

.cr-flow-node.is-done .cr-flow-pass {
  color: #0b7285;
}

body.is-tech-lens .cr-flow-pass {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  color: #0b7285;
}

.cr-base-strata {
  padding-top: 24px;
  border-top: 1px dashed #d4dbe5;
  display: grid;
  grid-template-columns: 150px 1fr auto;
  align-items: center;
  gap: 24px;
}

.cr-base-label {
  font-size: 12px;
  font-weight: 600;
  color: #5b6678;
}

.cr-base-engines {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  font-size: 13px;
  color: #334155;
}

.cr-base-status {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 12.5px;
  color: #5b6678;
  white-space: nowrap;
}

.cr-base-status b {
  color: #0e1726;
  font-weight: 600;
}

.cr-base-status b.is-ok {
  color: #0b7285;
}

/* ==========================================================================
   视图二：岗位工作台（统一浅色 · 左精简导航 + 右开放式视觉台）
   ========================================================================== */
.cr-desk-shell {
  min-height: calc(100vh - 86px);
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
}

.cr-rail {
  border-right: 1px solid #e4e8ee;
  padding: 26px 14px 24px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  background: #f6f7f9;
  position: sticky;
  top: 86px;
  height: calc(100vh - 86px);
  align-self: start;
  min-width: 0;
}

.cr-rail-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cr-rail-item {
  appearance: none;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: 7px;
  font: inherit;
  color: #475569;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: background 0.15s ease, color 0.15s ease;
}

.cr-rail-item:hover {
  background: rgba(14, 23, 38, 0.04);
  color: #0e1726;
}

.cr-rail-item.is-active {
  background: #ffffff;
  color: #0e1726;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(14, 23, 38, 0.06);
}

.cr-rail-item-left {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.cr-rail-num {
  font-size: 11.5px;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

.cr-rail-name {
  font-size: 13.5px;
  white-space: nowrap;
}

.cr-rail-check {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d4dbe5;
  flex-shrink: 0;
}

.cr-rail-item.is-done .cr-rail-check {
  background: #0b7285;
}

.cr-rail-sep {
  height: 1px;
  background: #e4e8ee;
  margin: 8px 6px;
}

.cr-rail-foot {
  padding: 14px 10px 0;
  border-top: 1px solid #e4e8ee;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  color: #5b6678;
}

.cr-rail-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cr-rail-stat b {
  color: #0e1726;
  font-weight: 600;
}

.cr-stage {
  background: #ffffff;
  padding: 36px 52px 52px;
  display: flex;
  justify-content: center;
  min-width: 0;
}

.cr-stage-inner {
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* 舞台页头（极简：标题 + 短锚点 + 状态） */
.cr-stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e4e8ee;
  flex-wrap: wrap;
}

.cr-stage-title-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.cr-stage-head h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.cr-stage-sub {
  margin: 0;
  font-size: 13px;
  color: #64748b;
}

.cr-status-tag {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.cr-status-tag.is-risk { background: #fdf2f2; color: #c92a2a; }
.cr-status-tag.is-ok { background: #e6f4f6; color: #0b7285; }
.cr-status-tag.is-warn { background: #fef9e7; color: #9a6700; }

/* ---------------- 业务视角：协查轨迹 + 单步聚焦/全部显示双向控制 ---------------- */
.cr-agent-strip {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e4e8ee;
}

.cr-agent-strip-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.cr-agent-strip-title {
  font-size: 12px;
  font-weight: 600;
  color: #5b6678;
}

.cr-agent-strip-ops {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cr-play-btn {
  appearance: none;
  border: 1px solid #d4dbe5;
  background: #ffffff;
  color: #0e1726;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.cr-play-btn:hover {
  background: #f1f4f8;
  border-color: #0e1726;
}

.cr-play-btn.is-playing {
  background: #0b7285;
  border-color: #0b7285;
  color: #ffffff;
}

.cr-agent-track {
  position: relative;
  display: grid;
  gap: 20px;
}

.cr-agent-track.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cr-agent-track.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.cr-agent-track::before {
  content: '';
  position: absolute;
  top: 5px;
  left: 5px;
  right: 16%;
  height: 1.5px;
  background: #e2e7ef;
  pointer-events: none;
}

.cr-agent-step {
  position: relative;
  appearance: none;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 18px 0 0;
  font: inherit;
  color: #64748b;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: color 0.15s ease;
}

.cr-agent-step::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #cbd5e1;
  border: 2px solid #ffffff;
  z-index: 2;
  transition: background 0.18s ease, transform 0.18s ease;
}

.cr-agent-step.is-reached::before { background: #0e1726; }
.cr-agent-step.is-all-mode { color: #0e1726; }
.cr-agent-step.is-all-mode::before { background: #0b7285; }

.cr-agent-step.is-active {
  color: #0e1726;
}

.cr-agent-step.is-active::before {
  background: #0b7285;
  transform: scale(1.28);
  box-shadow: 0 0 0 3px rgba(11, 114, 133, 0.18);
}

.cr-agent-step.is-gate.is-active::before {
  background: #c92a2a;
  box-shadow: 0 0 0 3px rgba(201, 42, 42, 0.18);
}

.cr-agent-step-head {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.cr-agent-step-name {
  font-size: 13px;
  font-weight: 700;
}

.cr-agent-step-tool {
  font-size: 11px;
  color: #64748b;
}

.cr-agent-step-out {
  font-size: 12px;
  color: #5b6678;
}

.cr-agent-step.is-active .cr-agent-step-out,
.cr-agent-step.is-all-mode .cr-agent-step-out {
  color: #0e1726;
  font-weight: 500;
}

/* 精炼单行做法条 */
.cr-agent-how {
  padding: 8px 14px;
  border-left: 3px solid #0b7285;
  background: #f0f9fa;
  border-radius: 0 6px 6px 0;
  font-size: 13px;
  color: #0e1726;
  font-weight: 500;
}

.cr-agent-how.is-gate {
  border-left-color: #c92a2a;
  background: #fdf2f2;
}

.cr-agent-how b {
  color: #0b7285;
  margin-right: 6px;
}

.cr-agent-how.is-gate b {
  color: #c92a2a;
}

/* 证据区聚光对比：聚焦态对比极明显，全部显示态全部回归纯净 100% */
.cr-ev-zone {
  transition: opacity 0.22s ease, background 0.22s ease, border-color 0.22s ease;
  border-radius: 8px;
}

.cr-ev-zone.is-dim {
  opacity: 0.28;
  filter: grayscale(0.35);
}

.cr-ev-zone.is-lit {
  opacity: 1;
  background: #f2f9fa;
  box-shadow: inset 3px 0 0 #0b7285;
  padding: 12px 14px;
}

.cr-ev-zone.is-lit.is-gate-lit {
  background: #fdf4f4;
  box-shadow: inset 3px 0 0 #c92a2a;
}

/* 比例条分段不加 padding，仅控透明度 */
.cr-prop-seg.cr-ev-zone.is-lit {
  padding: 0;
  background: inherit;
  box-shadow: 0 0 0 2px #0e1726;
}
.cr-prop-seg.is-risk.cr-ev-zone.is-lit { background: #c92a2a; }
.cr-prop-seg.is-mid.cr-ev-zone.is-lit { background: #94a3b8; }
.cr-prop-seg.is-ok.cr-ev-zone.is-lit { background: #0b7285; }

/* 上游联动细条 */
.cr-link-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #f6f8fb;
  border: 1px solid #e4e8ee;
  font-size: 13px;
  flex-wrap: wrap;
}

.cr-link-strip.is-warn {
  background: #fffbeb;
  border-color: #f6d58e;
  color: #7c4d00;
}

/* ---------------- 业务视觉仪表 ---------------- */
.cr-waterfall {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cr-wf-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.cr-wf-label { font-size: 13px; color: #5b6678; }

.cr-wf-nums {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.cr-wf-old { font-size: 15px; color: #8c98a9; text-decoration: line-through; }
.cr-wf-real { font-size: 26px; font-weight: 700; color: #c92a2a; letter-spacing: -0.02em; }

.cr-wf-bar {
  height: 12px;
  width: 100%;
  border-radius: 999px;
  background: #e9edf3;
  overflow: hidden;
  display: flex;
}

.cr-wf-bridge { background: #cbd5e1; height: 100%; }
.cr-wf-clean { background: #c92a2a; height: 100%; }

.cr-wf-foot {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #5b6678;
}

.cr-tri-ledger {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  padding: 20px 0;
  border-top: 1px solid #e4e8ee;
  border-bottom: 1px solid #e4e8ee;
}

.cr-tri-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cr-tri-item span { font-size: 12px; color: #5b6678; }
.cr-tri-item strong { font-size: 16px; font-weight: 700; color: #0e1726; }
.cr-tri-item strong.is-risk { color: #c92a2a; }
.cr-tri-item strong.is-ok { color: #0b7285; }
.cr-tri-item small { font-size: 12px; color: #64748b; }

.cr-scope-row {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 13.5px;
}

.cr-scope-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: #0e1726;
  font-weight: 500;
}

.cr-scope-check input {
  accent-color: #0b7285;
  width: 15px;
  height: 15px;
}

.cr-uw-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.cr-uw-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cr-uw-col.is-right {
  border-left: 1px solid #e4e8ee;
  padding-left: 40px;
}

.cr-col-tag { font-size: 12.5px; font-weight: 700; }
.cr-col-tag.is-risk { color: #c92a2a; }
.cr-col-tag.is-ok { color: #0b7285; }

.cr-wave-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cr-wave-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #5b6678;
}

.cr-quote {
  font-size: 15px;
  font-weight: 600;
  color: #0e1726;
  line-height: 1.5;
  padding-left: 10px;
  border-left: 2.5px solid #c92a2a;
}

.cr-quote b { color: #c92a2a; }

.cr-fact-line {
  display: flex;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid #eef1f5;
  font-size: 13px;
}

.cr-fact-line span { color: #5b6678; }

.cr-dti-meter {
  position: relative;
  padding: 26px 0 22px;
}

.cr-dti-track {
  height: 8px;
  width: 100%;
  border-radius: 999px;
  background: #e9edf3;
  position: relative;
}

.cr-dti-redline {
  position: absolute;
  top: -12px;
  bottom: -14px;
  left: 62.5%;
  width: 1.5px;
  background: #c92a2a;
}

.cr-dti-redline::after {
  content: '安全红线';
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 600;
  color: #c92a2a;
  white-space: nowrap;
}

.cr-dti-pin {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2.5px solid #ffffff;
  box-shadow: 0 1px 4px rgba(14, 23, 38, 0.22);
  transition: left 0.3s ease;
}

.cr-dti-pin.is-risk { background: #c92a2a; }
.cr-dti-pin.is-warn { background: #d97706; }
.cr-dti-pin.is-ok { background: #0b7285; }

.cr-dti-pin-val {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.cr-dti-pin.is-risk .cr-dti-pin-val { color: #c92a2a; }
.cr-dti-pin.is-warn .cr-dti-pin-val { color: #b45309; }
.cr-dti-pin.is-ok .cr-dti-pin-val { color: #0b7285; }

.cr-prop-bar {
  height: 16px;
  width: 100%;
  display: flex;
  gap: 3px;
}

.cr-prop-seg { height: 100%; border-radius: 3px; }
.cr-prop-seg.is-risk { background: #c92a2a; }
.cr-prop-seg.is-mid { background: #cbd5e1; }
.cr-prop-seg.is-ok { background: #0b7285; }

.cr-big-stat { font-size: 30px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.1; }
.cr-big-stat.is-risk { color: #c92a2a; }
.cr-big-stat.is-ok { color: #0b7285; }

.cr-diff-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.cr-diff-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cr-diff-col.is-right {
  border-left: 1px solid #e4e8ee;
  padding-left: 40px;
}

.cr-script-body { margin: 0; font-size: 15.5px; line-height: 1.75; color: #1e293b; }
.cr-script-body.is-muted { color: #64748b; }

.cr-strike {
  color: #c92a2a;
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  background: #fdf2f2;
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 600;
}

.cr-highlight-ok { color: #0b7285; font-weight: 700; }

.cr-rule-rows {
  display: flex;
  flex-direction: column;
}

.cr-rule-row {
  display: grid;
  grid-template-columns: 110px 1fr 20px 1fr;
  align-items: center;
  gap: 14px;
  padding: 16px 8px;
  border-bottom: 1px solid #e4e8ee;
  font-size: 14px;
}

.cr-rule-key { font-size: 12.5px; font-weight: 600; color: #5b6678; }
.cr-rule-bad { color: #c92a2a; text-decoration: line-through; }
.cr-rule-good { color: #0b7285; font-weight: 600; }

/* 底部操作条 */
.cr-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
  border-top: 1px solid #e4e8ee;
  flex-wrap: wrap;
}

.cr-engine-footnote {
  font-size: 12px;
  color: #64748b;
}

.cr-action-btns {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ==========================================================================
   技术机制视图（统一浅色精密工程图纸风）
   ========================================================================== */
.cr-tech-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.cr-tech-progress {
  font-size: 12.5px;
  color: #5b6678;
}

.cr-tech-rail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.cr-tech-node {
  appearance: none;
  text-align: left;
  padding: 13px 15px;
  border-radius: 8px;
  border: 1px solid #e2e7ef;
  background: #f8fafc;
  color: #0e1726;
  font: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.cr-tech-node:hover:not(:disabled) {
  border-color: #0b7285;
  background: #ffffff;
}

.cr-tech-node.is-selected {
  border-color: #0b7285;
  background: #f0f9fa;
}

.cr-tech-node.is-alert {
  border-color: #f3c6c6;
}

.cr-tech-node.is-alert.is-selected {
  border-color: #c92a2a;
  background: #fdf2f2;
}

.cr-tech-node:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.cr-tech-node-top {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #64748b;
}

.cr-tech-node-role {
  font-size: 13px;
  font-weight: 700;
  color: #0e1726;
}

.cr-tech-node-io {
  font-size: 12px;
  color: #475569;
  line-height: 1.4;
}

/* 浅色遥测抽屉 */
.cr-drawer {
  border: 1px solid #e2e7ef;
  border-radius: 10px;
  background: #f8fafc;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cr-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e4e8ee;
  font-size: 12.5px;
  flex-wrap: wrap;
}

.cr-drawer-call {
  color: #0b7285;
  font-size: 12px;
  font-weight: 600;
  word-break: break-word;
}

.cr-drawer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.cr-drawer-pane {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.cr-drawer-pane label {
  font-size: 11px;
  font-weight: 600;
  color: #5b6678;
}

.cr-drawer-pre {
  margin: 0;
  padding: 11px 12px;
  border-radius: 7px;
  background: #ffffff;
  border: 1px solid #e4e8ee;
  font-size: 11.5px;
  line-height: 1.5;
  color: #334155;
  white-space: pre-wrap;
  word-break: break-word;
}

.cr-drawer-pre.is-out {
  color: #0b7285;
  border-color: #cde8ec;
  background: #fbfefe;
}

.cr-drawer-consume {
  font-size: 12.5px;
  color: #0e1726;
  padding-top: 8px;
  border-top: 1px solid #e4e8ee;
}

/* ---------------- 06 交接与熔断台 ---------------- */
.cr-clean-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.cr-clean-table th,
.cr-clean-table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid #e4e8ee;
}

.cr-clean-table th {
  font-size: 12px;
  font-weight: 600;
  color: #5b6678;
}

.cr-pulse-line {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cr-pulse-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 7px;
  background: #f6f8fb;
  border: 1px solid #e4e8ee;
  font-size: 13px;
}

.cr-pulse-row.is-alert {
  background: #fdf2f2;
  border-color: #f3c6c6;
  color: #9b1c1c;
}

.cr-pulse-row.is-ok {
  background: #e6f4f6;
  border-color: #b7dfe6;
  color: #0b7285;
}

.cr-log-details {
  border-top: 1px solid #e4e8ee;
  padding-top: 12px;
}

.cr-log-details summary {
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: #5b6678;
}

.cr-log-items {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cr-log-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: #475569;
  padding: 5px 0;
  border-bottom: 1px solid #f1f4f8;
}

/* ---------------- 视图三：Agent / Skill / 工具层 ---------------- */
.cr-stack-ribbon {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.cr-stack-step {
  border: 1px solid #e4e8ee;
  border-radius: 8px;
  background: #f8fafc;
  padding: 11px 14px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.cr-stack-step:hover {
  border-color: #b7dfe6;
  background: #ffffff;
}

.cr-stack-step.is-active {
  border-color: #0b7285;
  background: #f2fafb;
}

.cr-stack-step strong {
  font-size: 13px;
  font-weight: 700;
  color: #0e1726;
}

.cr-stack-step.is-active strong {
  color: #0b7285;
}

.cr-stack-step span {
  font-size: 11.5px;
  color: #5b6678;
}

.cr-stack-arrow {
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
}

.cr-cat-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.cr-cat-filter-btn {
  border: 1px solid #e4e8ee;
  background: #ffffff;
  color: #5b6678;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cr-cat-filter-btn:hover {
  border-color: #cbd5e1;
  color: #0e1726;
}

.cr-cat-filter-btn.is-active {
  background: #0e1726;
  border-color: #0e1726;
  color: #ffffff;
  font-weight: 600;
}

.cr-cat-split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.15fr);
  gap: 24px;
  align-items: start;
}

.cr-cat-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid #e4e8ee;
}

.cr-cat-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #e4e8ee;
  border-left: 2.5px solid transparent;
  background: transparent;
  padding: 12px 12px 12px 14px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.cr-cat-row:hover {
  background: #f8fafc;
}

.cr-cat-row.is-active {
  background: #f2fafb;
  border-left-color: #0b7285;
}

.cr-cat-row.is-active.is-gate {
  background: #fdf2f2;
  border-left-color: #c92a2a;
}

.cr-cat-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cr-cat-row-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #0e1726;
}

.cr-cat-row.is-active .cr-cat-row-name {
  color: #0b7285;
}

.cr-cat-row.is-active.is-gate .cr-cat-row-name {
  color: #c92a2a;
}

.cr-cat-row-meta {
  font-size: 11.5px;
  color: #64748b;
  white-space: nowrap;
}

.cr-cat-row-desc {
  font-size: 12.5px;
  color: #475569;
  line-height: 1.45;
}

.cr-cat-detail {
  border: 1px solid #e2e7ef;
  border-radius: 10px;
  background: #f8fafc;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 108px;
}

.cr-cat-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e4e8ee;
}

.cr-cat-detail-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #0e1726;
}

.cr-cat-detail-sub {
  margin-top: 4px;
  font-size: 12.5px;
  color: #5b6678;
}

.cr-cat-badge {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
  background: #e6f4f6;
  color: #0b7285;
}

.cr-cat-badge.is-risk {
  background: #fdf2f2;
  color: #c92a2a;
}

.cr-cat-badge.is-neutral {
  background: #eef2f6;
  color: #475569;
}

.cr-cat-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cr-cat-block-label {
  font-size: 11.5px;
  font-weight: 600;
  color: #64748b;
}

.cr-cat-block-text {
  margin: 0;
  font-size: 13px;
  color: #0e1726;
  line-height: 1.55;
}

.cr-cat-steps {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  color: #0e1726;
  line-height: 1.5;
}

.cr-cat-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.cr-cat-chip {
  border: 1px solid #d5dde8;
  background: #ffffff;
  color: #0e1726;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.14s ease, color 0.14s ease, background 0.14s ease;
}

.cr-cat-chip:hover {
  border-color: #0b7285;
  color: #0b7285;
  background: #fbfefe;
}

.cr-cat-detail-foot {
  padding-top: 12px;
  border-top: 1px solid #e4e8ee;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 960px) {
  html body.gf-has-portal-bar { padding-top: 120px !important; }
  .cr-header { height: auto; padding: 10px 16px; flex-wrap: wrap; gap: 8px; }
  .cr-mode-nav { order: 3; width: 100%; height: 34px; gap: 18px; }
  .cr-ov { padding: 28px 18px 40px; }
  .cr-ov-title h1 { font-size: 24px; }
  .cr-flow-cols::before, .cr-flow-node::before { display: none; }
  .cr-flow-cols { grid-template-columns: 1fr; gap: 20px; }
  .cr-flow-node { padding: 0 0 16px; border-bottom: 1px solid #e4e8ee; }
  .cr-base-strata { grid-template-columns: 1fr; gap: 12px; }
  .cr-desk-shell { grid-template-columns: minmax(0, 1fr); }
  .cr-rail { position: static; height: auto; min-width: 0; max-width: 100%; overflow: hidden; border-right: 0; border-bottom: 1px solid #e4e8ee; padding: 14px 16px; }
  .cr-rail-list { flex-direction: row; overflow-x: auto; gap: 6px; max-width: 100%; }
  .cr-rail-sep, .cr-rail-foot { display: none; }
  .cr-stage { padding: 24px 18px 40px; }
  .cr-tri-ledger, .cr-uw-split, .cr-diff-grid, .cr-drawer-grid, .cr-cat-split { grid-template-columns: 1fr; gap: 20px; }
  .cr-cat-detail { position: static; }
  .cr-stack-ribbon { grid-template-columns: 1fr; gap: 8px; }
  .cr-stack-arrow { display: none; }
  .cr-uw-col.is-right, .cr-diff-col.is-right { border-left: 0; border-top: 1px solid #e4e8ee; padding-left: 0; padding-top: 20px; }
  .cr-rule-row { grid-template-columns: 1fr; gap: 6px; }
  .cr-agent-track.cols-3, .cr-agent-track.cols-4 { grid-template-columns: 1fr; gap: 10px; }
  .cr-agent-track::before, .cr-agent-step::before { display: none; }
  .cr-agent-step { padding: 6px 0; border-bottom: 1px solid #eef1f5; }
}
