:root {
  --bg: #f4f6f2;
  --surface: #ffffff;
  --surface-2: #f9faf7;
  --ink: #17201d;
  --muted: #64706b;
  --line: #dfe5dc;
  --green: #2f8f6d;
  --green-2: #dff2ea;
  --blue: #2b6fb3;
  --blue-2: #e1ecf8;
  --orange: #c66a2b;
  --orange-2: #faeadf;
  --red: #b8443f;
  --red-2: #f5e1df;
  --yellow: #b18922;
  --yellow-2: #f5ecd0;
  --shadow: 0 10px 24px rgba(23, 32, 29, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 18px;
  background: #ffffff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

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

.brand h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

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

.side-nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  border: 0;
  background: transparent;
  color: var(--muted);
  min-height: 42px;
  padding: 0 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-align: left;
}

.nav-item:hover,
.nav-item.is-active {
  background: var(--green-2);
  color: var(--green);
}

.nav-icon {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 18px;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-note {
  margin-top: auto;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  word-break: break-all;
}

.note-label {
  color: var(--ink);
  font-weight: 700;
  margin-bottom: 6px;
}

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

.section {
  max-width: 1500px;
  margin: 0 auto 34px;
  scroll-margin-top: 22px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.head-actions,
.summary-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px var(--green-2);
}

.advisor-note {
  background: #fff;
  border: 1px solid #cbded4;
  border-left: 5px solid var(--green);
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.advisor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.advisor-head h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
}

.advisor-head span {
  flex: 0 0 auto;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--green-2);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.advisor-note ol {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 7px;
  color: #2c3935;
  font-size: 14px;
  line-height: 1.6;
}

.advisor-note li::marker {
  color: var(--green);
  font-weight: 800;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  min-height: 112px;
  display: grid;
  align-content: space-between;
  box-shadow: var(--shadow);
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.kpi-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
}

.kpi-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.kpi-icon.green {
  background: var(--green-2);
  color: var(--green);
}

.kpi-icon.blue {
  background: var(--blue-2);
  color: var(--blue);
}

.kpi-icon.orange {
  background: var(--orange-2);
  color: var(--orange);
}

.kpi-icon.red {
  background: var(--red-2);
  color: var(--red);
}

.kpi-value {
  margin-top: 12px;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 800;
}

.kpi-sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.grid {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.grid.two {
  grid-template-columns: minmax(0, 1.25fr) minmax(330px, 0.75fr);
}

.grid.two .wide {
  min-width: 0;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  min-width: 0;
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.panel h3 {
  margin: 0;
  font-size: 16px;
}

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

.flow-map {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 28px minmax(160px, 1fr) 28px minmax(160px, 1fr) 28px minmax(160px, 1fr);
  gap: 8px;
  align-items: center;
}

.flow-col {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 8px;
  padding: 12px;
  min-height: 252px;
  display: grid;
  align-content: start;
  gap: 8px;
}

.flow-title {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 2px;
}

.flow-card {
  border: 1px solid rgba(23, 32, 29, 0.1);
  background: #fff;
  border-left: 4px solid var(--green);
  border-radius: 6px;
  padding: 9px 10px;
  font-size: 13px;
}

.flow-col.model .flow-card {
  border-left-color: var(--blue);
}

.flow-col.workflow .flow-card {
  border-left-color: var(--orange);
}

.flow-col.output .flow-card {
  border-left-color: var(--red);
}

.flow-arrow {
  color: var(--muted);
  font-size: 24px;
  text-align: center;
}

.diagnosis-list {
  display: grid;
  gap: 9px;
}

.diagnosis-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 9px;
}

.diagnosis-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

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

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

.badge,
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.badge.green,
.pill.green {
  background: var(--green-2);
  border-color: #bfe3d4;
  color: var(--green);
}

.badge.orange,
.pill.orange {
  background: var(--orange-2);
  border-color: #e7c3ab;
  color: var(--orange);
}

.badge.red,
.pill.red {
  background: var(--red-2);
  border-color: #e1b7b4;
  color: var(--red);
}

.badge.blue,
.pill.blue {
  background: var(--blue-2);
  border-color: #bdd2ea;
  color: var(--blue);
}

.chart-svg {
  width: 100%;
  height: auto;
  display: block;
}

.axis,
.chart-label {
  fill: var(--muted);
  font-size: 11px;
}

.chart-value {
  fill: var(--ink);
  font-size: 11px;
  font-weight: 700;
}

.grid-line {
  stroke: #e8ede5;
  stroke-width: 1;
}

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

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.mini-stack {
  display: grid;
  gap: 12px;
}

.mini-stack h4 {
  margin: 0;
  font-size: 13px;
}

.compact-bars {
  display: grid;
  gap: 7px;
}

.compact-row {
  display: grid;
  grid-template-columns: 112px minmax(90px, 1fr) 56px;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.compact-row b {
  display: block;
  height: 9px;
  border-radius: 999px;
}

.compact-row em {
  font-style: normal;
  text-align: right;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.donut-wrap {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.donut {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: conic-gradient(var(--green) 0deg, var(--green) 90deg, var(--line) 90deg 360deg);
  position: relative;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 24px;
  border-radius: 50%;
  background: #fff;
}

.donut-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  z-index: 1;
}

.donut-center strong {
  display: block;
  font-size: 22px;
}

.donut-center span {
  color: var(--muted);
  font-size: 11px;
}

.donut-legend {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.donut-legend-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.table-panel {
  padding-bottom: 10px;
}

.table-wrap {
  overflow: auto;
  max-width: 100%;
  max-height: 390px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

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

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 800;
}

td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

tbody tr:hover {
  background: #f8fbf7;
}

.search-box,
.select-box {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 0 10px;
}

.search-box input,
.select-box select {
  border: 0;
  outline: 0;
  background: transparent;
  min-width: 220px;
  color: var(--ink);
}

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

.architecture {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.arch-step {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 6px;
  min-height: 112px;
  box-shadow: var(--shadow);
}

.arch-step span {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--green-2);
  color: var(--green);
  font-weight: 800;
}

.arch-step strong {
  font-size: 16px;
}

.arch-step em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

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

.recommendation {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.recommendation h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.recommendation dl {
  margin: 0;
  display: grid;
  gap: 8px;
}

.recommendation dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.recommendation dd {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.55;
}

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

@media (max-width: 1200px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 14px;
  }

  .side-nav {
    grid-template-columns: repeat(6, minmax(110px, 1fr));
    overflow: auto;
  }

  .sidebar-note {
    display: none;
  }

  .kpi-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

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

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

  .flow-arrow {
    transform: rotate(90deg);
  }

  .flow-col {
    min-height: 0;
  }

  .architecture {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

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

@media (max-width: 720px) {
  .main {
    padding: 14px;
  }

  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .advisor-head {
    flex-direction: column;
    gap: 8px;
  }

  .section h2 {
    font-size: 21px;
  }

  .kpi-grid,
  .architecture,
  .recommendation-grid {
    grid-template-columns: 1fr;
  }

  .side-nav {
    grid-template-columns: repeat(3, minmax(112px, 1fr));
  }

  .donut-wrap {
    grid-template-columns: 1fr;
  }

  .search-box input,
  .select-box select {
    min-width: 0;
    width: 100%;
  }
}
