:root {
  --bg: #f4f7f6;
  --panel: #ffffff;
  --ink: #17211f;
  --muted: #68746f;
  --line: #d8e1dd;
  --green: #207456;
  --green-2: #e8f6ef;
  --blue: #285f9d;
  --blue-2: #e8eff9;
  --amber: #b36b00;
  --amber-2: #fff3d7;
  --red: #b94242;
  --red-2: #fae7e7;
  --violet: #6951a8;
  --violet-2: #efeafa;
  --shadow: 0 20px 70px rgba(20, 39, 35, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1180px;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 0%, rgba(32, 116, 86, 0.14), transparent 32%),
    radial-gradient(circle at 82% 6%, rgba(40, 95, 157, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(244, 247, 246, 0.92), rgba(244, 247, 246, 1)),
    url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23d7ded7' stroke-width='1'%3E%3Cpath d='M0 40h80M40 0v80'/%3E%3C/g%3E%3C/svg%3E");
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
}

.app-shell {
  padding: 26px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
  padding: 20px 0 6px;
}

.hero-copy-wrap {
  max-width: 880px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  max-width: 840px;
  margin: 0;
  font-size: 42px;
  line-height: 1.05;
  letter-spacing: 0;
}

.subtitle {
  max-width: 800px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.hero-badges,
.topbar-actions {
  display: flex;
  gap: 10px;
}

.hero-badges {
  flex-wrap: wrap;
  margin-top: 14px;
}

.hero-badges span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid rgba(32, 116, 86, 0.18);
  border-radius: 999px;
  color: var(--green);
  background: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 800;
}

button,
select {
  font: inherit;
}

.primary-btn,
.ghost-btn {
  height: 40px;
  border-radius: 8px;
  padding: 0 16px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 750;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.primary-btn:hover,
.ghost-btn:hover {
  transform: translateY(-1px);
}

.primary-btn {
  color: #fff;
  background: linear-gradient(135deg, var(--ink), #315b51);
  box-shadow: 0 10px 24px rgba(23, 33, 31, 0.14);
}

.ghost-btn {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

.formula-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid #cfd9d1;
  border-radius: 8px;
  background: #eef6f1;
  box-shadow: 0 12px 36px rgba(32, 116, 86, 0.08);
}

.formula-band strong {
  margin-right: 10px;
  color: var(--green);
  font-size: 13px;
}

.formula-band span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.formula-band code {
  color: var(--blue);
  font-size: 13px;
  white-space: nowrap;
}

.stage-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.stage-card {
  display: grid;
  grid-template-columns: 34px 1fr;
  column-gap: 10px;
  row-gap: 2px;
  align-items: center;
  min-height: 82px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 28px rgba(20, 39, 35, 0.06);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.stage-card:hover {
  transform: translateY(-2px);
}

.stage-card span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: var(--muted);
  background: #edf1ee;
  font-weight: 900;
}

.stage-card strong {
  font-size: 14px;
}

.stage-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.stage-card.active {
  border-color: rgba(32, 116, 86, 0.34);
  background: #f4fbf7;
}

.stage-card.active span {
  color: #fff;
  background: var(--green);
}

.dashboard {
  display: grid;
  grid-template-columns: 1fr 1.05fr 1.2fr;
  gap: 16px;
  align-items: stretch;
}

.panel {
  min-height: 260px;
  overflow: hidden;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.panel:hover {
  transform: translateY(-1px);
  box-shadow: 0 24px 78px rgba(20, 39, 35, 0.13);
}

.workspace-panel {
  grid-row: span 2;
  min-height: 360px;
}

.graph-panel,
.task-panel {
  min-height: 360px;
}

.task-panel {
  grid-column: span 2;
}

.insight-panel {
  grid-column: span 3;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-header h2 {
  margin: 0;
  font-size: 17px;
}

.panel-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.step-pill {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 8px;
  color: var(--green);
  background: var(--green-2);
  font-weight: 850;
  font-size: 13px;
}

.field-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.select {
  width: 100%;
  height: 42px;
  margin-bottom: 14px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.profile-card,
.event-card,
.workunit-card,
.task-card,
.coverage-box,
.legend-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf9;
}

.profile-card,
.coverage-box,
.legend-box,
.workunit-card,
.task-card {
  padding: 14px;
}

.legend-box {
  margin-top: 12px;
  background: #fff;
}

.profile-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.profile-title strong {
  font-size: 15px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--blue-2);
  color: var(--blue);
  font-size: 11px;
  font-weight: 780;
}

.profile-card p,
.task-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.metric-card,
.task-block,
.meta-item,
.insight-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.metric-card {
  padding: 10px;
}

.metric-card span,
.meta-item span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.metric-card strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
}

.coverage-box h3,
.legend-box h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

ul {
  margin: 0;
  padding-left: 18px;
}

li {
  margin: 6px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  color: var(--muted);
  font-size: 12px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.legend-dot.base {
  background: #a7b1ab;
}

.legend-dot.new {
  background: var(--green);
}

.legend-dot.updated {
  background: var(--blue);
}

.legend-dot.stale {
  background: var(--amber);
}

.legend-dot.final {
  background: var(--violet);
}

.event-card {
  min-height: 230px;
  padding: 14px;
}

.empty-state {
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  border-style: dashed;
}

.event-type {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--red);
  background: var(--red-2);
  font-size: 12px;
  font-weight: 800;
}

.event-card h3,
.workunit-card h3,
.task-card h3 {
  margin: 12px 0 8px;
  font-size: 18px;
}

.event-card p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.json-grid {
  display: grid;
  gap: 8px;
}

.json-row {
  display: grid;
  grid-template-columns: 122px 1fr;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
  font-size: 12px;
}

.json-row span:first-child {
  color: var(--muted);
  font-weight: 750;
}

.agent-note {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf8;
}

.agent-note strong {
  color: var(--green);
  font-size: 12px;
}

.agent-note span {
  color: var(--muted);
  font-size: 12px;
}

.event-flow {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto 1fr auto;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.event-flow span {
  height: 2px;
  background: var(--line);
}

.snapshot-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.tab {
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-weight: 750;
}

.tab.active {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.file-tree {
  display: grid;
  gap: 8px;
}

.file-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  transition: transform 140ms ease, border-color 140ms ease;
}

.file-row:hover {
  transform: translateX(3px);
  border-color: rgba(32, 116, 86, 0.28);
}

.file-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #f1f3ef;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.file-path {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status {
  min-width: 74px;
  padding: 4px 8px;
  border-radius: 999px;
  text-align: center;
  font-size: 11px;
  font-weight: 820;
}

.status.base {
  color: var(--muted);
  background: #f1f3ef;
}

.status.new {
  color: var(--green);
  background: var(--green-2);
}

.status.updated {
  color: var(--blue);
  background: var(--blue-2);
}

.status.stale {
  color: var(--amber);
  background: var(--amber-2);
}

.status.final {
  color: var(--violet);
  background: var(--violet-2);
}

.workunit-card {
  margin-bottom: 16px;
}

.workunit-card h3 {
  margin-top: 0;
}

.workunit-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.meta-item {
  padding: 10px;
}

.meta-item span {
  margin-bottom: 4px;
}

.meta-item strong {
  font-size: 13px;
}

.timeline {
  display: grid;
  gap: 8px;
}

.timeline-step {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
}

.timeline-dot {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: #fff;
  background: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.timeline-text {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}

.graph-canvas {
  position: relative;
  min-height: 292px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(220, 226, 220, 0.4) 1px, transparent 1px),
    linear-gradient(rgba(220, 226, 220, 0.4) 1px, transparent 1px);
  background-size: 32px 32px;
}

.graph-node {
  position: absolute;
  width: 128px;
  min-height: 48px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(21, 31, 25, 0.09);
  font-size: 12px;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.graph-node:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(21, 31, 25, 0.14);
}

.graph-node strong {
  display: block;
  margin-bottom: 3px;
  font-size: 12px;
}

.graph-node span {
  color: var(--muted);
}

.graph-node.event {
  border-color: #e8c3c3;
  background: var(--red-2);
}

.graph-node.data {
  border-color: #c8d7ef;
  background: var(--blue-2);
}

.graph-node.output {
  border-color: #d6c9f0;
  background: var(--violet-2);
}

.graph-node.decoy {
  border-color: #f0d49b;
  background: var(--amber-2);
}

.graph-edge {
  position: absolute;
  height: 2px;
  background: rgba(32, 116, 86, 0.65);
  transform-origin: 0 50%;
}

.task-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.task-block {
  padding: 12px;
}

.task-block h4 {
  margin: 0 0 8px;
  font-size: 13px;
}

.rubric-list li {
  color: var(--ink);
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.insight-item {
  min-height: 96px;
  padding: 16px;
  background: #fbfcf9;
}

.insight-item strong {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
}

.insight-item span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.demo-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 16px 4px 4px;
  color: var(--muted);
  font-size: 12px;
}

.demo-footer strong {
  color: var(--green);
}

@media (max-width: 1240px) {
  body {
    min-width: 0;
  }

  .dashboard,
  .stage-strip,
  .insight-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .formula-band {
    align-items: flex-start;
    flex-direction: column;
  }

  .formula-band code {
    white-space: normal;
  }

  .workspace-panel,
  .task-panel,
  .insight-panel {
    grid-column: auto;
    grid-row: auto;
  }
}
