:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --line: #d7e4ef;
  --line-strong: #b8d0e4;
  --text: #173041;
  --muted: #6c8191;
  --blue: #1381d6;
  --blue-soft: #edf6ff;
  --yellow: #f2a316;
  --red: #ea5a47;
  --green: #36a973;
  --shadow: 0 16px 40px rgba(15, 46, 70, 0.08);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --font: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  background: linear-gradient(180deg, #f8fbfd 0%, #f1f6fa 100%);
  color: var(--text);
}

.app {
  min-height: 100vh;
}

.header {
  height: 70px;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 220px;
  align-items: center;
  gap: 20px;
  padding: 0 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

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

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1b8ee2, #0f66b5);
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 1rem;
}

.brand span {
  color: var(--muted);
  font-size: 0.8rem;
}

.nav {
  display: flex;
  gap: 8px;
}

.nav button,
.toolbar button,
.workspace-mode button,
.ghost-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  font: 600 0.9rem/1 var(--font);
}

.nav button.active,
.toolbar button.active,
.workspace-mode button.active {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: #cae1f5;
}

.header-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  color: var(--muted);
  font-size: 0.85rem;
}

.ghost-btn {
  color: var(--blue);
  border-color: #cae1f5;
  background: var(--blue-soft);
}

.main {
  padding: 18px 20px 22px;
}

.view {
  display: none;
}

.view-active {
  display: block;
}

.dashboard-layout,
.workspace,
.split-layout,
.flow-layout,
.street-layout {
  display: grid;
  gap: 18px;
}

.dashboard-layout {
  grid-template-columns: 280px minmax(0, 1fr);
}

.dashboard-left,
.dashboard-center,
.workspace-side,
.workspace-main,
.workspace-inspector,
.split-map,
.split-side,
.flow-main,
.flow-side {
  min-width: 0;
}

.dashboard-left,
.workspace-side,
.workspace-inspector,
.flow-side {
  display: grid;
  gap: 14px;
}

.dashboard-card,
.panel-title,
.side-search,
.side-list,
.inspector-card,
.chart-panel,
.chart-box,
.flow-side-card,
.bottom-card {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: var(--radius-lg);
}

.dashboard-card {
  min-height: 114px;
  padding: 18px;
  border: 2px solid #1d8de0;
}

.dashboard-card strong,
.bottom-card strong,
.side-item strong,
.inspector-card strong,
.flow-side-card strong,
.chart-panel strong {
  display: block;
  margin-top: 8px;
  font-size: 1rem;
}

.dashboard-card span,
.bottom-card span,
.panel-title span,
.side-item span,
.inspector-card span,
.flow-side-card span,
.chart-panel span {
  color: var(--muted);
  font-size: 0.82rem;
}

.dashboard-card p,
.bottom-card p,
.side-item p,
.inspector-card p,
.flow-side-card p,
.chart-panel p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.panel-title {
  margin-bottom: 12px;
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-title h2 {
  margin: 4px 0 0;
  font-size: 1.3rem;
}

.toolbar,
.workspace-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.map-frame {
  overflow: hidden;
  border-radius: 26px;
  border: 1px solid var(--line-strong);
  background: #e9f2f9;
  box-shadow: var(--shadow);
}

.map-frame svg {
  width: 100%;
  height: 100%;
  display: block;
}

.map-scene {
  position: relative;
  width: 100%;
  height: 100%;
}

.map-frame-dashboard {
  height: 590px;
}

.map-frame-large {
  height: 760px;
}

.map-frame-medium {
  height: 680px;
}

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

.bottom-card {
  min-height: 110px;
  padding: 16px 18px;
}

.workspace {
  grid-template-columns: 250px minmax(0, 1fr) 320px;
}

.side-search {
  padding: 12px;
}

.side-search input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  font: 0.92rem var(--font);
  color: var(--text);
  background: #f9fbfd;
}

.side-list {
  padding: 10px;
}

.side-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  background: transparent;
}

.side-item.active {
  background: var(--blue-soft);
  border-color: #cae1f5;
}

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

.inspector-card,
.chart-panel,
.flow-side-card {
  padding: 18px;
}

.inspector-head {
  margin: -18px -18px 16px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--line);
}

.inspector-head small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.inspector-head-blue {
  color: #fff;
  background: linear-gradient(135deg, #2394ef, #1874d3);
  border-radius: 22px 22px 0 0;
  border-bottom: 0;
}

.inspector-head-blue span,
.inspector-head-blue small {
  color: rgba(255, 255, 255, 0.82);
}

.mini-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.mini-stat-grid div {
  padding: 12px;
  border-radius: 14px;
  background: #f6fafd;
  border: 1px solid var(--line);
}

.mini-stat-grid span,
.inspector-info span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.mini-stat-grid strong,
.inspector-info strong {
  display: block;
  margin-top: 6px;
  font-size: 0.95rem;
}

.inspector-chart {
  margin-bottom: 14px;
}

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

.inspector-info {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.inspector-info div {
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fbfd;
  border: 1px solid var(--line);
}

.inspector-card ul,
.chart-panel ul,
.flow-side-card ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.6;
}

.split-layout {
  grid-template-columns: minmax(0, 1fr) 380px;
}

.flow-layout {
  grid-template-columns: minmax(0, 1fr) 320px;
}

.chart-stack {
  display: grid;
  gap: 16px;
}

.chart-box {
  padding: 14px;
  min-height: 300px;
}

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

.street-layout {
  grid-template-columns: minmax(0, 1fr) 320px;
}

.map-tool-rail {
  position: absolute;
  top: 150px;
  right: 14px;
  display: grid;
  gap: 10px;
}

.map-tool-rail button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: var(--blue);
  cursor: pointer;
  font: 700 0.92rem/1 var(--font);
  box-shadow: var(--shadow);
}

.map-tool-rail button.active {
  background: var(--blue);
  color: #fff;
}

.map-status-switch {
  position: absolute;
  left: 14px;
  bottom: 14px;
  display: flex;
  gap: 8px;
}

.map-status-switch button,
.case-chip {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--muted);
  cursor: pointer;
  font: 600 0.84rem/1 var(--font);
}

.map-status-switch button.active,
.case-chip.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.table-shell {
  height: 100%;
  overflow: auto;
  background: #fff;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 0.9rem;
}

.data-table th {
  position: sticky;
  top: 0;
  background: #f7fbfe;
  color: var(--muted);
  font-size: 0.8rem;
}

.selected-row {
  background: #f3f9ff;
}

.street-case-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.pill.red {
  color: #b83d2d;
  background: #fde7e2;
}

.pill.green {
  color: #257b53;
  background: #e4f6ec;
}

.pill.yellow {
  color: #95620b;
  background: #fff2d8;
}

.chart-grid {
  stroke: rgba(23, 48, 65, 0.08);
  stroke-width: 1;
}

.chart-label,
.map-text {
  fill: #355366;
  font: 12px/1 var(--font);
}

@media (max-width: 1360px) {
  .header {
    grid-template-columns: 1fr;
    height: auto;
    padding: 14px 18px;
  }

  .dashboard-layout,
  .workspace,
  .split-layout,
  .flow-layout,
  .street-layout,
  .dashboard-bottom {
    grid-template-columns: 1fr;
  }
}
