:root {
  --ink: #17211d;
  --muted: #65736d;
  --line: #dce6df;
  --panel: #ffffff;
  --soft: #f4f7f3;
  --rail: #121b17;
  --green: #187a58;
  --blue: #255d8d;
  --amber: #b7791f;
  --red: #b63d3d;
  --shadow: 0 18px 42px rgba(18, 27, 23, .1);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: #eef2ed;
  color: var(--ink);
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
}
button,
input { font: inherit; }
button { cursor: pointer; }

.flow-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}
.flow-rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 18px;
  padding: 18px;
  background: var(--rail);
  color: #fff;
}
.brand,
.flow-rail nav a {
  color: #fff;
  text-decoration: none;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #edf8f2;
  color: var(--green);
  font-weight: 950;
}
.flow-rail nav {
  display: grid;
  gap: 8px;
}
.flow-rail nav a {
  min-height: 40px;
  display: flex;
  align-items: center;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  padding: 0 12px;
  color: rgba(255,255,255,.76);
}
.flow-rail nav a:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}
.rail-card {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  background: rgba(255,255,255,.07);
  padding: 14px;
}
.rail-card span {
  color: rgba(255,255,255,.66);
  font-size: 12px;
  font-weight: 850;
}
.rail-card input {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 8px;
  background: rgba(255,255,255,.10);
  color: #fff;
  padding: 0 10px;
}
.rail-card button,
.section-head button,
.link-card a {
  min-height: 38px;
  border: 1px solid #edf8f2;
  border-radius: 8px;
  background: #edf8f2;
  color: var(--rail);
  font-weight: 850;
}

.flow-main {
  display: grid;
  gap: 16px;
  padding: 18px;
}
.hero,
.surface,
.snapshot-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow);
}
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 18px;
  align-items: stretch;
  padding: 22px;
}
.hero span,
.score-card span,
.section-head span,
.snapshot-card span,
.mini-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
}
.hero h1 {
  margin: 6px 0 10px;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1;
  letter-spacing: 0;
}
.hero p {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}
.score-card {
  display: grid;
  align-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 16px;
}
.score-card b {
  font-size: 42px;
}
.score-card small {
  color: var(--muted);
  font-weight: 800;
}
.snapshot-grid,
.persistence-grid,
.link-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.snapshot-card {
  min-height: 126px;
  padding: 14px;
}
.snapshot-card strong {
  display: block;
  margin: 8px 0;
  font-size: 26px;
}
.snapshot-card p,
.project-panel p,
.evidence-item p,
.dispatch-item p,
.command-box p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.snapshot-card.ok strong { color: var(--green); }
.snapshot-card.warn strong { color: var(--amber); }
.snapshot-card.fail strong { color: var(--red); }
.surface {
  overflow: hidden;
}
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 14px;
}
.section-head h2 {
  margin: 2px 0 0;
  font-size: 20px;
}
.section-head button {
  padding: 0 14px;
}
.project-panel,
.evidence-list,
.dispatch-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}
.project-panel {
  grid-template-columns: 1.2fr .8fr;
}
.project-card,
.fact-list,
.evidence-item,
.dispatch-item,
.command-box,
.link-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 14px;
}
.project-card h3,
.link-card h3 {
  margin: 4px 0 8px;
  font-size: 20px;
}
.fact-list {
  display: grid;
  gap: 9px;
}
.fact-list div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}
.fact-list b {
  overflow-wrap: anywhere;
}
.link-card,
.persistence-card {
  display: grid;
  gap: 10px;
}
.persistence-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 14px;
}
.persistence-card strong {
  font-size: 16px;
}
.persistence-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}
.link-card a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  text-decoration: none;
}
.link-card p {
  min-height: 42px;
}
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.split > div:first-child {
  border-right: 1px solid var(--line);
}
.evidence-item,
.dispatch-item {
  display: grid;
  gap: 8px;
}
.evidence-item header,
.dispatch-item header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  background: #e7f2ed;
  color: var(--green);
  padding: 0 9px;
  font-size: 12px;
  font-weight: 850;
}
.pill.warn {
  background: #fff1d9;
  color: var(--amber);
}
.pill.fail {
  background: #ffe8e8;
  color: var(--red);
}
.command-box {
  margin: 14px;
}
.command-box b {
  display: block;
  margin-bottom: 6px;
  font-family: Consolas, "SFMono-Regular", monospace;
}

@media (max-width: 1080px) {
  .snapshot-grid,
  .persistence-grid,
  .link-grid,
  .project-panel,
  .split {
    grid-template-columns: 1fr;
  }
  .split > div:first-child {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 760px) {
  .flow-shell {
    grid-template-columns: 1fr;
  }
  .flow-rail {
    position: relative;
    height: auto;
  }
  .hero {
    grid-template-columns: 1fr;
  }
}
