:root {
  --mint: #7fc0ac;
  --sea: #5db99d;
  --aqua: #36ad99;
  --sky: #97cff1;
  --ink: #17231f;
  --storm: #55555b;
  --grey: #76777b;
  --silver: #a1a0a2;
  --line: #d9e3df;
  --line-strong: #bfd3cc;
  --surface: #ffffff;
  --soft: #f5f9f7;
  --mint-soft: #e8f3ef;
  --warn: #c78b2d;
  --warn-soft: #fff7e8;
  --danger: #a94b43;
  --danger-soft: #fbebe9;
  --shadow: 0 18px 42px rgba(23, 35, 31, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(127, 192, 172, 0.055) 1px, transparent 1px),
    linear-gradient(180deg, rgba(127, 192, 172, 0.055) 1px, transparent 1px),
    #fbfdfc;
  background-size: 28px 28px;
  font-family: "Microsoft YaHei UI", "Noto Sans SC", "PingFang SC", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.ops-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  align-items: start;
}

.ops-rail {
  position: sticky;
  top: 0;
  min-height: 100vh;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
}

.ops-rail {
  padding: 22px 18px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  color: #fff;
  background: var(--ink);
  font-weight: 800;
  letter-spacing: 0;
}

.brand-row strong {
  display: block;
  font-size: 17px;
  line-height: 1.2;
}

.brand-row small,
.source-status,
.panel-head small,
.dashboard-intent small,
.definition-list,
.bar-note,
.metric-card small {
  color: var(--grey);
}

.section-nav {
  display: grid;
  gap: 6px;
  margin: 0 0 22px;
}

.section-nav a,
.ghost-button,
.primary-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  background: #fff;
  color: var(--ink);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.section-nav a {
  justify-content: flex-start;
}

.section-nav a:hover,
.ghost-button:hover {
  border-color: var(--sea);
  background: var(--mint-soft);
}

.primary-button {
  border-color: var(--sea);
  background: var(--sea);
  color: #fff;
  font-weight: 700;
}

.primary-button:hover {
  transform: translateY(-1px);
}

.filter-panel {
  display: grid;
  gap: 14px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.filter-panel label {
  display: grid;
  gap: 6px;
  color: var(--storm);
  font-size: 12px;
}

.filter-panel select,
.filter-panel input {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
}

.source-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--sea);
  box-shadow: 0 0 0 5px rgba(93, 185, 157, 0.12);
}

.ops-main {
  min-width: 0;
  padding: 24px;
}

.top-command {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--sea);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(20px, 2.2vw, 30px);
  line-height: 1.22;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 0;
  font-size: 16px;
  letter-spacing: 0;
}

.command-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dashboard-intent {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 22px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.86);
}

.dashboard-intent div {
  padding: 18px;
  border-right: 1px solid var(--line);
}

.dashboard-intent div:last-child {
  border-right: 0;
}

.dashboard-intent span {
  display: block;
  color: var(--sea);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 8px;
}

.dashboard-intent strong,
.dashboard-intent small {
  display: block;
}

.workspace-section {
  scroll-margin-top: 20px;
  margin-top: 28px;
  padding-top: 8px;
}

.section-heading,
.panel-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 999px;
  padding: 0 12px;
  color: #08694f;
  background: var(--mint-soft);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.meta-pill.is-risk {
  color: var(--danger);
  background: var(--danger-soft);
}

.metric-ladder {
  display: grid;
  grid-template-columns: repeat(7, minmax(118px, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
}

.metric-card {
  min-height: 132px;
  padding: 16px;
  border-right: 1px solid var(--line);
  animation: riseIn 420ms ease both;
}

.metric-card:last-child {
  border-right: 0;
}

.metric-card b {
  display: block;
  margin-bottom: 12px;
  color: var(--storm);
  font-size: 12px;
}

.metric-card strong {
  display: block;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1;
}

.metric-card .track {
  height: 5px;
  margin: 14px 0 10px;
  background: #e7eeeb;
  border-radius: 999px;
  overflow: hidden;
}

.metric-card .fill {
  display: block;
  height: 100%;
  width: var(--width, 0%);
  background: var(--sea);
}

.workspace-grid {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.two-col {
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1.3fr);
}

.strategy-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.8fr);
}

.data-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  padding: 16px;
  min-width: 0;
}

.table-wrap {
  overflow: auto;
  max-height: 430px;
  border-top: 1px solid var(--line);
}

.table-wrap.compact {
  max-height: none;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--storm);
  background: #f8fbfa;
  font-size: 12px;
  font-weight: 800;
}

tbody tr {
  cursor: default;
  transition: background 160ms ease;
}

tbody tr[data-store] {
  cursor: pointer;
}

tbody tr:hover {
  background: var(--soft);
}

.result-chip,
.stage-chip,
.risk-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
  background: var(--mint-soft);
  color: #0c6b52;
  white-space: nowrap;
}

.stage-chip {
  color: var(--storm);
  background: #eef4f2;
}

.risk-chip {
  color: var(--danger);
  background: var(--danger-soft);
}

.quality-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.quality-item {
  padding: 16px;
  border-right: 1px solid var(--line);
}

.quality-item:last-child {
  border-right: 0;
}

.quality-item strong {
  display: block;
  margin: 6px 0 8px;
  font-size: 28px;
  line-height: 1;
}

.quality-meter,
.bar-track {
  height: 7px;
  border-radius: 999px;
  background: #e9efed;
  overflow: hidden;
}

.quality-meter span,
.bar-track span {
  display: block;
  width: var(--width, 0%);
  height: 100%;
  background: var(--sea);
}

.bar-list,
.angle-ranking,
.list-stack,
.decision-columns,
.risk-band,
.action-list {
  display: grid;
  gap: 10px;
}

.bar-row,
.angle-row,
.list-item,
.decision-block,
.risk-cell,
.action-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.bar-row:last-child,
.angle-row:last-child,
.list-item:last-child,
.decision-block:last-child,
.risk-cell:last-child,
.action-item:last-child {
  border-bottom: 0;
}

.bar-label,
.angle-label,
.list-item strong,
.risk-cell strong {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-weight: 800;
}

.strategy-matrix {
  display: grid;
  grid-template-columns: 118px repeat(var(--stage-count, 6), minmax(96px, 1fr));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.matrix-cell {
  min-height: 72px;
  padding: 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--sea) var(--heat, 0%), #fff);
}

.matrix-cell.is-head {
  min-height: 46px;
  color: var(--storm);
  background: #f8fbfa;
  font-size: 12px;
  font-weight: 800;
}

.matrix-cell.is-row-head {
  font-weight: 800;
  background: #fff;
}

.matrix-cell button {
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.matrix-cell strong,
.matrix-cell small {
  display: block;
}

.matrix-cell strong {
  margin-bottom: 4px;
  font-size: 20px;
}

.angle-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 14px;
  align-items: center;
}

.angle-score {
  color: var(--sea);
  font-size: 24px;
  font-weight: 800;
  text-align: right;
}

.decision-columns {
  grid-template-columns: 1fr 1fr;
}

.decision-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.decision-block h4 {
  margin: 0 0 10px;
}

.decision-block ul,
.definition-list {
  margin: 0;
  padding-left: 18px;
}

.decision-block li,
.definition-list li {
  margin: 8px 0;
}

.risk-band {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.risk-cell {
  padding: 16px;
  border-right: 1px solid var(--line);
  border-bottom: 0;
}

.risk-cell:last-child {
  border-right: 0;
}

.risk-cell b {
  display: block;
  margin-top: 6px;
  font-size: 28px;
  line-height: 1;
}

.action-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.action-item strong,
.action-item small {
  display: block;
}

.action-item small {
  margin-top: 6px;
  color: var(--grey);
  line-height: 1.5;
}

.empty-state {
  padding: 24px;
  color: var(--grey);
  text-align: center;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1280px) {
  .ops-shell {
    grid-template-columns: 236px minmax(0, 1fr);
  }

  .metric-ladder {
    grid-template-columns: repeat(4, minmax(136px, 1fr));
  }

  .metric-card:nth-child(4n) {
    border-right: 0;
  }

  .risk-band,
  .quality-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .ops-shell {
    display: block;
  }

  .ops-rail {
    position: static;
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .section-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .filter-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .top-command,
  .section-heading,
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-intent,
  .two-col,
  .strategy-grid,
  .quality-strip,
  .risk-band {
    grid-template-columns: 1fr;
  }

  .dashboard-intent div,
  .quality-item,
  .risk-cell {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .dashboard-intent div:last-child,
  .quality-item:last-child,
  .risk-cell:last-child {
    border-bottom: 0;
  }

  .ops-main {
    padding: 18px;
  }
}

@media (max-width: 620px) {
  .section-nav,
  .filter-panel,
  .metric-ladder,
  .decision-columns {
    grid-template-columns: 1fr;
  }

  .metric-card,
  .metric-card:nth-child(4n) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metric-card:last-child {
    border-bottom: 0;
  }

  .strategy-matrix {
    grid-template-columns: 100px repeat(var(--stage-count, 6), minmax(112px, 1fr));
  }
}
