:root {
  --ink: #172033;
  --muted: #64748b;
  --line: #d9e2ec;
  --surface: #f7fafc;
  --white: #ffffff;
  --blue: #17617d;
  --green: #2f7d57;
  --amber: #b7791f;
  --red: #a93c3c;
  --purple: #6254a3;
  --cyan-soft: #e6f4f8;
  --green-soft: #e7f5ed;
  --amber-soft: #fff4d6;
  --red-soft: #fde8e8;
  --purple-soft: #eeecfb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--surface);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  padding: 24px 32px 18px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-weight: 700;
  font-size: 12px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: 28px;
}

.subtitle {
  margin-bottom: 0;
  max-width: 760px;
  color: var(--muted);
  line-height: 1.55;
}

.top-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tab-button,
.select {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  border-radius: 6px;
  min-height: 36px;
  padding: 8px 12px;
  font: inherit;
  cursor: pointer;
}

.seg-button {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  min-height: 34px;
  padding: 7px 11px;
  font: inherit;
  cursor: pointer;
}

.seg-button:first-child {
  border-radius: 6px 0 0 6px;
}

.seg-button:last-child {
  border-radius: 0 6px 6px 0;
}

.seg-button + .seg-button {
  margin-left: -1px;
}

.seg-button.active {
  background: var(--green);
  border-color: var(--green);
  color: var(--white);
}

.tab-button.active {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}

main {
  padding: 24px 32px 40px;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin-bottom: 6px;
  font-size: 22px;
}

.section-heading p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.status-counts {
  display: grid;
  grid-template-columns: repeat(3, minmax(100px, 1fr));
  gap: 8px;
  min-width: 340px;
}

.demand-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(96px, 1fr));
  gap: 8px;
  min-width: 320px;
}

.count-card {
  padding: 10px 12px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.count-card strong {
  display: block;
  font-size: 22px;
}

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

.demand-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
}

.demand-toolbar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.goal-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 7px 10px;
  align-items: center;
  min-height: 96px;
  padding: 13px 13px 13px 16px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 10%, #fff), #fff 48%);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  text-align: left;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.goal-card:hover,
.goal-card.active {
  border-color: color-mix(in srgb, var(--accent) 70%, #1f2937);
  border-left-color: var(--accent);
  box-shadow: 0 10px 26px rgba(23, 97, 125, 0.15);
  transform: translateY(-2px);
}

.goal-card.active::after {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid color-mix(in srgb, var(--accent) 44%, transparent);
  border-radius: 6px;
  pointer-events: none;
}

.goal-code {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 30px;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.goal-card strong {
  grid-column: 2;
  font-size: 16px;
  line-height: 1.25;
}

.goal-count {
  grid-column: 3;
  justify-self: end;
  padding: 4px 7px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.goal-scenes {
  grid-column: 1 / 4;
  color: #475569;
  font-size: 12px;
  line-height: 1.4;
}

.demand-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.12fr 1.25fr;
  gap: 14px;
  min-height: 560px;
}

.demand-column {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 12px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.demand-column-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.demand-node {
  width: 100%;
  min-height: 92px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.demand-node:hover,
.demand-node.active {
  border-color: var(--blue);
  box-shadow: 0 8px 22px rgba(23, 97, 125, 0.12);
  transform: translateY(-1px);
}

.demand-node.primary {
  background: var(--cyan-soft);
  border-color: #bfdeea;
}

.demand-node span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.demand-node strong {
  display: block;
  line-height: 1.35;
}

.demand-node p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.item-node {
  background: #f8fafc;
}

.demand-detail {
  align-self: start;
}

.timeline-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(112px, 1fr));
  gap: 8px;
  min-width: 420px;
}

.timeline-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
  padding: 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 5px solid var(--blue);
  border-radius: 8px;
}

.timeline-hero h3 {
  margin-bottom: 8px;
  font-size: 20px;
}

.timeline-hero p {
  max-width: 860px;
  margin-bottom: 0;
  color: #334155;
  line-height: 1.65;
}

.timeline-decision {
  display: grid;
  gap: 8px;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.timeline-decision strong {
  color: var(--blue);
}

.timeline-decision span {
  padding: 8px 10px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
}

.project-timeline {
  position: relative;
  display: grid;
  gap: 14px;
}

.project-timeline::before {
  content: "";
  position: absolute;
  left: 23px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: linear-gradient(var(--green), var(--blue), var(--red));
  opacity: 0.35;
}

.project-step {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
}

.project-step-marker {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 48px;
}

.project-step-marker span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--blue);
  color: var(--white);
  font-size: 12px;
  font-weight: 900;
}

.project-step.done .project-step-marker span {
  background: var(--green);
}

.project-step.decision .project-step-marker span {
  background: var(--red);
}

.project-step-body {
  padding: 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.project-step.done .project-step-body {
  border-color: #b8dfc8;
}

.project-step.decision .project-step-body {
  border-color: #f0b4b4;
  background: #fffafa;
}

.project-step-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.project-step-title h3 {
  margin-bottom: 0;
  font-size: 18px;
}

.project-step-body p {
  margin-bottom: 12px;
  color: #334155;
  line-height: 1.6;
}

.project-step-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.project-step-grid div {
  padding: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.project-step-grid b {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.project-step-grid span {
  line-height: 1.5;
}

.decision-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.decision-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  min-height: 164px;
}

.decision-card-critical {
  border-color: #f0b4b4;
  background: var(--red-soft);
}

.label {
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 8px;
  background: var(--cyan-soft);
  border: 1px solid #bfdeea;
  color: var(--blue);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.decision-card-critical .label {
  background: #fff;
  color: var(--red);
  border-color: #f0b4b4;
}

.decision-card h3 {
  margin-bottom: 8px;
  font-size: 17px;
}

.decision-card p {
  margin-bottom: 0;
  color: #334155;
  line-height: 1.6;
}

.table-panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.table-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.table-title h3 {
  margin-bottom: 0;
}

.table-title p {
  margin-bottom: 0;
  color: var(--muted);
}

.premise-list {
  display: grid;
}

.premise-row {
  display: grid;
  grid-template-columns: 68px 150px 1fr 150px;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.premise-row:last-child {
  border-bottom: 0;
}

.premise-row h4 {
  margin: 0 0 6px;
  font-size: 15px;
}

.premise-row p {
  margin: 0;
  color: #334155;
  line-height: 1.5;
}

.status {
  align-self: start;
  justify-self: start;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--line);
}

.status-wait {
  background: var(--amber-soft);
  color: var(--amber);
  border-color: #e8cb7b;
}

.status-discuss {
  background: var(--purple-soft);
  color: var(--purple);
  border-color: #c8c0ef;
}

.status-management {
  background: var(--red-soft);
  color: var(--red);
  border-color: #f0b4b4;
}

.status-ready {
  background: var(--green-soft);
  color: var(--green);
  border-color: #b8dfc8;
}

.timeline {
  display: grid;
  gap: 12px;
  counter-reset: step;
}

.diagram-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: stretch;
  margin-bottom: 18px;
}

.diagram-stage {
  position: relative;
  min-height: 560px;
  padding: 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
}

.lifecycle-rail {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(var(--lane-count), minmax(168px, 1fr));
  gap: 14px;
  min-width: 980px;
  align-items: stretch;
}

.swimlane-col {
  display: grid;
  grid-template-rows: auto;
  gap: 12px;
  align-content: start;
  min-height: 620px;
  padding: 10px;
  background: rgba(248, 250, 252, 0.72);
  border: 1px solid #e8eef5;
  border-radius: 8px;
}

.swimlane-head {
  min-height: 74px;
  padding: 12px;
  background: #e2f0d9;
  border: 1px solid #c7dfbb;
  border-radius: 8px;
}

.swimlane-head strong {
  display: block;
  margin-bottom: 6px;
  color: #0f3d2a;
  font-size: 14px;
}

.swimlane-head span {
  color: #516070;
  font-size: 11px;
  line-height: 1.35;
}

.swimlane-empty {
  padding: 16px 10px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  font-size: 12px;
  text-align: center;
}

.life-node {
  position: relative;
  width: 100%;
  min-height: 114px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.life-node:hover,
.life-node.active {
  border-color: var(--blue);
  box-shadow: 0 8px 20px rgba(23, 97, 125, 0.14);
  transform: translateY(-2px);
}

.life-node.pending {
  background: #fffafa;
  border-color: #f0b4b4;
}

.life-node.discuss {
  background: var(--purple-soft);
  border-color: #c8c0ef;
}

.life-index {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-bottom: 8px;
  border-radius: 7px;
  background: var(--cyan-soft);
  color: var(--blue);
  font-weight: 800;
}

.life-node h3 {
  margin-bottom: 6px;
  font-size: 15px;
}

.life-node p {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.life-owner {
  display: block;
  margin-bottom: 8px;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.flow-svg {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.flow-svg path {
  fill: none;
  stroke: #9fb7c8;
  stroke-width: 2;
  stroke-linecap: round;
}

.detail-panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  min-height: 260px;
}

.detail-panel h3 {
  margin-bottom: 8px;
  font-size: 19px;
}

.detail-panel .node-meta {
  margin-bottom: 12px;
}

.detail-section {
  padding-top: 12px;
  margin-top: 12px;
  border-top: 1px solid var(--line);
}

.detail-section h4 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.compact-list {
  margin-top: 18px;
}

.timeline-card {
  position: relative;
  display: grid;
  grid-template-columns: 80px 220px 1fr 190px;
  gap: 16px;
  align-items: stretch;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.step-number {
  display: grid;
  place-items: center;
  height: 52px;
  width: 52px;
  border-radius: 8px;
  background: var(--cyan-soft);
  color: var(--blue);
  font-weight: 800;
  font-size: 20px;
}

.node-meta {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.timeline-card h3 {
  margin-bottom: 8px;
  font-size: 17px;
}

.timeline-card p {
  margin-bottom: 0;
  line-height: 1.55;
}

.data-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: flex-start;
}

.data-pill {
  padding: 5px 8px;
  background: #f1f5f9;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
}

.architecture-map {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.architecture-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  margin-top: 14px;
}

.arch-view {
  display: none;
}

.arch-view.active {
  display: block;
}

.scope-board,
.stakeholder-matrix,
.flow-diagram {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  min-height: 540px;
}

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

.scope-column {
  display: grid;
  gap: 12px;
  align-content: start;
}

.scope-column h3 {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.scope-card {
  position: relative;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  min-height: 120px;
  transition: opacity 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.scope-card.core {
  border-color: #b8dfc8;
  background: var(--green-soft);
}

.scope-card.pending {
  border-color: #f0b4b4;
  background: var(--red-soft);
}

.scope-card.focused {
  box-shadow: 0 8px 22px rgba(23, 97, 125, 0.12);
  transform: translateY(-1px);
}

.scope-card.dimmed,
.flow-step.dimmed,
.dimmed-row {
  opacity: 0.38;
}

.scope-id {
  position: absolute;
  top: 10px;
  right: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.scope-card h4 {
  margin: 0 0 8px;
  font-size: 16px;
}

.scope-card p {
  margin-bottom: 0;
  color: #334155;
  line-height: 1.5;
}

.stakeholder-matrix {
  overflow: auto;
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 880px;
}

.matrix-table th,
.matrix-table td {
  border: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.matrix-table th {
  background: #e2f0d9;
  color: #0f3d2a;
}

.matrix-table td:first-child {
  font-weight: 700;
  color: var(--blue);
  width: 160px;
}

.flow-diagram {
  display: grid;
  gap: 12px;
}

.flow-step {
  display: grid;
  grid-template-columns: 170px 1fr 170px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: opacity 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.flow-step.pending {
  background: #fffafa;
  border-color: #f0b4b4;
}

.flow-step.focused {
  box-shadow: 0 8px 22px rgba(23, 97, 125, 0.12);
  transform: translateX(2px);
}

.flow-step strong {
  display: block;
  margin-bottom: 4px;
}

.flow-arrow {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  color: var(--muted);
}

.flow-arrow::before,
.flow-arrow::after {
  content: "";
  display: block;
  height: 1px;
  background: var(--line);
}

.view-switcher {
  display: flex;
}

.stakeholder-chips {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stakeholder-chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.stakeholder-chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 10px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.stakeholder-chip.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.stakeholder-chips p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.stakeholder-focus {
  display: inline-block;
  margin-bottom: 10px;
  padding: 5px 8px;
  color: var(--blue);
  background: var(--cyan-soft);
  border: 1px solid #bfdeea;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.arch-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
  min-height: 188px;
}

.arch-card.pending {
  border-color: #f0b4b4;
  background: #fffafa;
}

.arch-card.data-result {
  border-color: #b8dfc8;
  background: #f7fffa;
}

.arch-card h3 {
  margin-bottom: 8px;
  font-size: 17px;
}

.arch-card p {
  color: #334155;
  line-height: 1.55;
}

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

.flow-box {
  padding: 8px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.flow-box b {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 6px;
}

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

.dot-pending {
  background: var(--red);
}

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

@media (max-width: 1100px) {
  .topbar,
  .section-heading {
    display: block;
  }

  .top-actions {
    justify-content: flex-start;
    margin-top: 14px;
  }

  .status-counts,
  .demand-metrics,
  .timeline-summary,
  .demand-toolbar,
  .decision-grid,
  .architecture-map,
  .diagram-shell,
  .timeline-hero,
  .demand-shell,
  .demand-grid,
  .project-step-grid,
  .architecture-workspace,
  .scope-board {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .diagram-stage {
    min-height: auto;
  }

  .lifecycle-rail {
    grid-template-columns: repeat(var(--lane-count), minmax(168px, 1fr));
  }

  .flow-step {
    grid-template-columns: 1fr;
  }

  .timeline-card,
  .premise-row {
    grid-template-columns: 1fr;
  }
}
