:root {
  --ops-bg: #f3f5f7;
  --ops-panel: #ffffff;
  --ops-panel-soft: #f8fafc;
  --ops-line: #d9e2ec;
  --ops-text: #17212b;
  --ops-muted: #667085;
  --ops-ok: #1f7a45;
  --ops-warn: #b7791f;
  --ops-danger: #b42318;
  --ops-accent: #175cd3;
  --ops-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  --ops-radius: 14px;
  --ops-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --ops-sans: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #edf1f5 0%, #f8fafc 100%);
  color: var(--ops-text);
  font-family: var(--ops-sans);
}

#app {
  min-height: 100vh;
}

.shell {
  max-width: 1460px;
  margin: 0 auto;
  padding: 24px;
}

.positioning-banner {
  margin-bottom: 18px;
  padding: 18px 20px;
  border-radius: var(--ops-radius);
  border: 1px solid rgba(23, 92, 211, 0.18);
  background:
    linear-gradient(135deg, rgba(23, 92, 211, 0.12), rgba(23, 92, 211, 0.02)),
    #ffffff;
  box-shadow: var(--ops-shadow);
}

.positioning-eyebrow {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ops-accent);
  font-weight: 700;
}

.positioning-title {
  margin-top: 8px;
  font-size: 24px;
  font-weight: 800;
  color: var(--ops-text);
}

.positioning-subtitle {
  margin-top: 8px;
  font-size: 14px;
  color: var(--ops-muted);
  letter-spacing: 0.02em;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 20px;
}

.hero-title {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.hero-subtitle {
  margin-top: 6px;
  font-size: 14px;
  color: var(--ops-muted);
}

.hero-status {
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--ops-panel);
  border: 1px solid var(--ops-line);
  box-shadow: var(--ops-shadow);
  font-size: 13px;
  color: var(--ops-muted);
}

.metric-card,
.ops-panel {
  border-radius: var(--ops-radius);
  border: 1px solid var(--ops-line);
  background: var(--ops-panel);
  box-shadow: var(--ops-shadow);
}

.metric-card {
  height: 136px;
  min-height: 136px;
  overflow: hidden;
}

.metric-row {
  row-gap: 14px;
}

.metric-row > .el-col {
  display: flex;
}

.metric-row .metric-card {
  width: 100%;
}

.status-strip {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  align-items: stretch;
  gap: 18px;
  margin-bottom: 18px;
  padding: 18px 20px;
  border-radius: var(--ops-radius);
  border: 1px solid var(--ops-line);
  background:
    radial-gradient(circle at top left, rgba(23, 92, 211, 0.08), transparent 28%),
    linear-gradient(180deg, #fbfdff 0%, #f4f7fb 100%);
  box-shadow: var(--ops-shadow);
}

.status-divider {
  width: 1px;
  background: linear-gradient(180deg, rgba(23, 92, 211, 0), rgba(23, 92, 211, 0.18), rgba(23, 92, 211, 0));
}

.status-card {
  min-width: 0;
}

.status-kicker {
  margin-bottom: 10px;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ops-muted);
  text-transform: uppercase;
}

.status-kicker-cn {
  margin-left: 8px;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
  color: #98a2b3;
  font-weight: 500;
}

.status-main {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.status-summary {
  min-width: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--ops-text);
}

.status-meta {
  font-size: 13px;
  line-height: 1.7;
  color: var(--ops-muted);
}

.metric-body {
  padding: 16px 18px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ops-muted);
  text-transform: uppercase;
}

.metric-value {
  margin-top: 10px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.metric-meta {
  margin-top: 8px;
  font-size: 13px;
  color: var(--ops-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ops-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid #e9eef4;
}

.ops-panel-title {
  font-size: 16px;
  font-weight: 700;
}

.panel-title-cn {
  margin-left: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #98a2b3;
}

.ops-panel-hint {
  font-size: 13px;
  color: var(--ops-muted);
}

.ops-panel-body {
  padding: 16px 18px 18px;
}

.balanced-row {
  align-items: stretch;
}

.balanced-row > .el-col {
  display: flex;
}

.stretch-panel {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.stretch-panel .ops-panel-body {
  flex: 1;
}

.stage-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.timeline-panel {
  background:
    radial-gradient(circle at top right, rgba(23, 92, 211, 0.08), transparent 28%),
    var(--ops-panel);
}

.timeline-list {
  display: grid;
  gap: 0;
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
}

.timeline-rail {
  position: relative;
  display: flex;
  justify-content: center;
}

.timeline-dot {
  width: 12px;
  height: 12px;
  margin-top: 20px;
  border-radius: 999px;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 3px rgba(102, 112, 133, 0.16);
  z-index: 1;
}

.timeline-dot.tone-success {
  background: var(--ops-ok);
  box-shadow: 0 0 0 3px rgba(31, 122, 69, 0.14);
}

.timeline-dot.tone-warning {
  background: var(--ops-warn);
  box-shadow: 0 0 0 3px rgba(183, 121, 31, 0.14);
}

.timeline-dot.tone-danger {
  background: var(--ops-danger);
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.14);
}

.timeline-dot.tone-info {
  background: var(--ops-muted);
}

.timeline-line {
  position: absolute;
  top: 34px;
  bottom: 0;
  width: 1px;
  background: #dce5ef;
}

.timeline-item:last-child .timeline-line {
  display: none;
}

.timeline-card {
  margin-bottom: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #e8edf3;
  background: rgba(255, 255, 255, 0.88);
}

.timeline-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.timeline-title {
  font-weight: 800;
  color: var(--ops-text);
}

.timeline-meta {
  margin-top: 4px;
  color: var(--ops-muted);
  font-size: 12px;
}

.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.timeline-summary {
  margin-top: 10px;
  color: var(--ops-muted);
  font-size: 13px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.stage-card {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #e8edf3;
  background:
    linear-gradient(180deg, #fcfdff 0%, #f7faff 100%);
}

.stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stage-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ops-muted);
}

.stage-calls {
  margin-top: 14px;
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
}

.stage-meta {
  margin-top: 10px;
  font-size: 13px;
  color: var(--ops-muted);
}

.json-box {
  margin: 0;
  padding: 16px;
  min-height: 320px;
  border-radius: 12px;
  background: #111927;
  color: #dce5ef;
  font-family: var(--ops-mono);
  font-size: 13px;
  line-height: 1.6;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.trace-json-box {
  min-height: 0;
  height: 420px;
  max-height: min(58vh, 520px);
  overflow: auto;
}

.execution-json-box {
  min-height: 0;
  height: 240px;
  max-height: min(38vh, 320px);
}

.recommendation-json-box {
  min-height: 0;
  height: 360px;
  max-height: min(50vh, 460px);
  overflow: auto;
}

.process-table-scroll {
  height: 360px;
  max-height: min(50vh, 460px);
  overflow: auto;
  border-radius: 12px;
  border: 1px solid #edf2f7;
}

.process-table-scroll .ops-table {
  border-radius: 0;
}

.policy-checks {
  display: grid;
  gap: 10px;
}

.policy-checks-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.policy-check {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #e8edf3;
  background: var(--ops-panel-soft);
}

.policy-mark {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  margin-top: 1px;
}

.policy-mark.pass {
  color: var(--ops-ok);
  background: rgba(31, 122, 69, 0.12);
}

.policy-mark.fail {
  color: var(--ops-danger);
  background: rgba(180, 35, 24, 0.12);
}

.policy-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.policy-detail {
  color: var(--ops-muted);
  font-size: 13px;
}

.final-box {
  padding: 18px;
  border-radius: 12px;
  border: 1px solid #dbe5ef;
  background: linear-gradient(180deg, #fcfdff 0%, #f4f7fb 100%);
  min-height: 100%;
}

.final-label {
  font-size: 12px;
  color: var(--ops-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.final-action {
  margin: 10px 0 12px;
  font-size: 30px;
  font-weight: 800;
}

.final-reason {
  color: var(--ops-muted);
  font-size: 13px;
  line-height: 1.7;
}

.trace-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  height: 420px;
  max-height: min(58vh, 520px);
}

.trace-summary-item {
  min-width: 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #e8edf3;
  background: var(--ops-panel-soft);
}

.trace-summary-item.wide {
  grid-column: 1 / -1;
}

.trace-summary-item span {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--ops-muted);
}

.trace-summary-item strong {
  display: block;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ops-text);
  overflow-wrap: anywhere;
}

.review-panel .ops-panel-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 240px;
}

.action-zone {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.approval-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.footnote {
  font-size: 13px;
  color: var(--ops-muted);
  line-height: 1.7;
}

.process-risk {
  min-width: 84px;
  text-align: center;
}

.ops-table .el-table__cell {
  padding: 10px 0;
}

.ops-table th.el-table__cell {
  color: var(--ops-muted);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
  background: #fafcff;
}

.ops-table .cell {
  word-break: break-word;
}

@media (max-width: 1200px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .stage-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .shell {
    padding: 16px;
  }

  .status-strip {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 16px;
  }

  .status-divider {
    display: none;
  }

  .status-main {
    align-items: flex-start;
    flex-direction: column;
  }

  .status-summary {
    font-size: 16px;
  }

  .timeline-head {
    flex-direction: column;
  }

  .timeline-tags {
    justify-content: flex-start;
  }

  .hero-title {
    font-size: 24px;
  }

  .positioning-title {
    font-size: 20px;
  }

  .metric-value,
  .final-action,
  .stage-calls {
    font-size: 24px;
  }

  .stage-grid {
    grid-template-columns: 1fr;
  }

  .policy-checks-compact,
  .trace-summary-grid {
    grid-template-columns: 1fr;
  }

  .trace-json-box {
    height: 340px;
    max-height: 52vh;
  }

  .trace-summary-grid,
  .execution-json-box,
  .review-panel .ops-panel-body {
    height: auto;
    min-height: 0;
    max-height: none;
  }
}
