:root {
  color-scheme: light;
  --bg: #f9f9fb;
  --surface: #ffffff;
  --surface-soft: #f3f5f9;
  --surface-blue: #eef4ff;
  --surface-strong: #e7edf8;
  --ink: #1a1c1d;
  --muted: #626a7f;
  --subtle: #8a91a3;
  --line: #dce3ef;
  --line-strong: #c3cde0;
  --primary: #003d9b;
  --primary-2: #0052cc;
  --primary-soft: #dae6ff;
  --cyan: #0f8fb3;
  --green: #0f8a62;
  --green-soft: #e2f5ee;
  --amber: #b66c00;
  --amber-soft: #fff1d6;
  --red: #ba1a1a;
  --red-soft: #ffe5e2;
  --shadow: 0 22px 46px -26px rgba(0, 61, 155, 0.38);
  --shadow-soft: 0 12px 32px -22px rgba(26, 28, 29, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(135deg, rgba(218, 230, 255, 0.74) 0%, rgba(249, 249, 251, 0) 34%),
    linear-gradient(180deg, #f9f9fb 0%, #f3f6fb 100%);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0, 61, 155, 0.045) 1px, transparent 1px),
    linear-gradient(rgba(0, 61, 155, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 72%);
}

button,
select,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

h1 {
  max-width: 780px;
  margin-bottom: 10px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 21px;
  line-height: 1.25;
}

h3 {
  margin-bottom: 10px;
  font-size: 18px;
}

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

.app-shell > *,
.sidebar,
main,
.topbar,
.panel,
.metric,
.operator-card {
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px 18px;
  background: rgba(255, 255, 255, 0.82);
  border-right: 1px solid rgba(195, 205, 224, 0.72);
  box-shadow: 18px 0 46px -42px rgba(0, 61, 155, 0.45);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid rgba(195, 205, 224, 0.72);
  box-shadow: var(--shadow-soft);
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  font-weight: 900;
  box-shadow: 0 16px 28px -18px rgba(0, 82, 204, 0.8);
}

.brand-mark svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.brand span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

nav {
  display: grid;
  gap: 7px;
}

nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 14px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 800;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

nav a:hover,
nav a.active {
  color: var(--primary);
  background: var(--primary-soft);
  box-shadow: inset 3px 0 0 var(--primary-2);
  transform: translateX(2px);
}

.nav-icon,
.metric-icon {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--primary);
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
}

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

nav a.active .nav-icon,
nav a:hover .nav-icon {
  background: #fff;
}

.sidebar-note {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(195, 205, 224, 0.8);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(218, 230, 255, 0.78), rgba(255, 255, 255, 0.96)),
    var(--surface);
  box-shadow: var(--shadow-soft);
}

.sidebar-note span {
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.sidebar-note strong {
  display: block;
  margin: 8px 0;
  line-height: 1.4;
}

.sidebar-note p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

main {
  display: grid;
  gap: 16px;
  padding: 24px;
}

.topbar,
.panel,
.metric {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(195, 205, 224, 0.7);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: fadeInUp 0.55s ease-out both;
}

.topbar::after,
.panel::after,
.metric::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.7), transparent 34%);
}

.topbar > *,
.panel > *,
.metric > * {
  position: relative;
  z-index: 1;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 22px;
  align-items: stretch;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(218, 230, 255, 0.92), rgba(255, 255, 255, 0.9) 42%, rgba(255, 255, 255, 0.96)),
    var(--surface);
}

.hero-copy {
  min-width: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(15, 138, 98, 0.12);
  animation: livePulse 1.8s ease-in-out infinite;
}

.lead {
  max-width: 920px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

h1,
h2,
h3,
p,
small,
strong,
.lead,
.sidebar-note p,
.operator-card small,
.policy-list span {
  overflow-wrap: anywhere;
}

.operator-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(195, 205, 224, 0.74);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 20px 36px -28px rgba(0, 61, 155, 0.42);
}

.dynamic-card {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  align-items: center;
}

.dynamic-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  box-shadow: 0 18px 34px -20px rgba(0, 82, 204, 0.92);
  transition: transform 0.35s ease, background 0.35s ease;
}

.dynamic-card.is-changing .dynamic-icon {
  animation: swapIcon 0.48s ease both;
}

.dynamic-card.is-changing strong,
.dynamic-card.is-changing small {
  animation: textSwap 0.48s ease both;
}

.operator-card span,
.metric span,
.result-card span,
.result-grid span,
.cost-list span,
.approval-cards span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.operator-card strong,
.operator-card small {
  display: block;
}

.operator-card strong {
  margin: 7px 0;
  font-size: 18px;
}

.operator-card small,
.metric small,
.result-card small,
.approval-cards small {
  color: var(--muted);
  line-height: 1.55;
}

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

.metric {
  min-height: 150px;
  padding: 18px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric:nth-child(2) { animation-delay: 0.04s; }
.metric:nth-child(3) { animation-delay: 0.08s; }
.metric:nth-child(4) { animation-delay: 0.12s; }

.metric:hover {
  transform: translateY(-3px);
  box-shadow: 0 26px 48px -28px rgba(0, 61, 155, 0.52);
}

.metric span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.metric strong {
  display: block;
  margin: 11px 0 8px;
  color: var(--primary);
  font-size: 31px;
  line-height: 1;
}

.metric.alert strong {
  color: var(--red);
}

.chart-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1.45fr) minmax(260px, 0.8fr) minmax(260px, 0.75fr) minmax(220px, 0.65fr);
  gap: 16px;
}

.chart-panel {
  min-height: 260px;
}

.panel {
  padding: 20px;
}

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

.section-head.compact {
  margin-bottom: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.status-pill.green {
  background: var(--green-soft);
  color: var(--green);
}

.pulse {
  animation: pillPulse 1.8s ease-in-out infinite;
}

.line-chart {
  width: 100%;
  height: 238px;
  display: block;
}

.chart-gridline {
  stroke: rgba(98, 106, 127, 0.18);
  stroke-width: 1;
}

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

.chart-area {
  fill: url("#areaGlow");
}

.chart-line {
  fill: none;
  stroke: url("#lineGlow");
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 8px 10px rgba(0, 82, 204, 0.18));
  stroke-dasharray: 900;
  animation: drawLine 1.2s ease-out both;
}

.chart-dot {
  fill: #fff;
  stroke: var(--primary-2);
  stroke-width: 2;
}

.donut-wrap {
  display: grid;
  grid-template-columns: 142px 1fr;
  gap: 18px;
  align-items: center;
  min-height: 180px;
}

.donut {
  --donut: 68%;
  width: 138px;
  height: 138px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle, #fff 0 54%, transparent 55%),
    conic-gradient(var(--primary-2) 0 var(--donut), rgba(15, 143, 179, 0.2) var(--donut) 100%);
  box-shadow: inset 0 0 0 1px var(--line), 0 22px 36px -24px rgba(0, 82, 204, 0.52);
}

.donut span {
  color: var(--primary);
  font-size: 28px;
  font-weight: 900;
}

.legend {
  display: grid;
  gap: 9px;
}

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

.legend strong {
  color: var(--ink);
}

.legend-dot,
.stack-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.dot-0 { background: var(--primary-2); }
.dot-1 { background: var(--cyan); }
.dot-2 { background: var(--amber); }
.dot-3 { background: var(--green); }

.stack-chart {
  display: grid;
  gap: 18px;
  min-height: 160px;
  align-content: center;
}

.stack-bar {
  height: 34px;
  display: flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
}

.stack-bar span {
  display: block;
  height: 100%;
  transition: width 0.35s ease;
}

.stack-running,
.stack-legend .stack-running { background: var(--primary-2); }
.stack-waiting,
.stack-legend .stack-waiting { background: var(--amber); }
.stack-approval,
.stack-legend .stack-approval { background: var(--red); }

.stack-legend {
  display: grid;
  gap: 10px;
}

.stack-legend div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
}

.stack-legend strong {
  color: var(--ink);
  margin-left: auto;
}

.gauge {
  min-height: 180px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
}

.gauge-ring {
  width: 142px;
  height: 142px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle, #fff 0 58%, transparent 59%),
    conic-gradient(var(--green) 0 97.6%, var(--surface-strong) 97.6% 100%);
  box-shadow: inset 0 0 0 1px var(--line), 0 22px 36px -24px rgba(15, 138, 98, 0.5);
}

.gauge-ring span {
  color: var(--green);
  font-size: 26px;
  font-weight: 900;
}

.gauge p {
  margin: 0;
  color: var(--muted);
  text-align: center;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 16px;
}

.flow-stage {
  display: grid;
  grid-template-columns: repeat(9, auto);
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin-bottom: 18px;
}

.flow-step {
  min-width: 86px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  text-align: center;
  background: var(--surface-soft);
  color: var(--primary);
  font-weight: 900;
}

.flow-arrow {
  color: var(--primary-2);
  font-weight: 900;
  animation: arrowMove 1.6s ease-in-out infinite;
}

.internal-map {
  position: relative;
  min-height: 380px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(238, 244, 255, 0.96), rgba(255, 255, 255, 0.92)),
    var(--surface-blue);
}

.internal-map::before,
.internal-map::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 72%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 82, 204, 0.36), transparent);
  transform-origin: left;
}

.internal-map::before {
  transform: rotate(24deg) translate(-50%, -50%);
}

.internal-map::after {
  transform: rotate(-24deg) translate(-50%, -50%);
}

.hub-core,
.map-node {
  position: absolute;
  z-index: 2;
  border: 1px solid rgba(195, 205, 224, 0.82);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 20px 42px -30px rgba(0, 61, 155, 0.48);
}

.hub-core {
  left: 50%;
  top: 50%;
  width: min(278px, 72%);
  padding: 22px;
  transform: translate(-50%, -50%);
  text-align: center;
  animation: coreBreathe 3.8s ease-in-out infinite;
}

.hub-core span,
.hub-core small,
.map-node small {
  color: var(--muted);
}

.hub-core strong {
  display: block;
  margin: 7px 0;
  color: var(--primary);
  font-size: 24px;
}

.map-node {
  min-width: 184px;
  padding: 14px;
  animation: floatNode 5.8s ease-in-out infinite;
}

.node-b,
.node-d {
  animation-delay: -2s;
}

.map-node span,
.map-node strong,
.map-node small {
  display: block;
}

.map-node strong {
  margin: 4px 0;
  color: var(--ink);
}

.node-a {
  left: 7%;
  top: 18%;
}

.node-b {
  right: 7%;
  top: 18%;
}

.node-c {
  left: 7%;
  bottom: 15%;
}

.node-d {
  right: 7%;
  bottom: 15%;
}

.policy-list,
.cost-list,
.alert-list,
.approval-cards {
  display: grid;
  gap: 10px;
}

.policy-list div,
.cost-list div,
.approval-cards div,
.alert-item,
.empty-state {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.policy-list strong,
.policy-list span,
.cost-list span,
.cost-list strong,
.approval-cards strong {
  display: block;
}

.policy-list span {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.55;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th,
.data-table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.data-table th {
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 13px;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr {
  transition: background 0.2s ease;
}

.data-table tbody tr:hover {
  background: rgba(218, 230, 255, 0.34);
}

.mini-meter {
  display: inline-block;
  vertical-align: middle;
  width: 96px;
  height: 8px;
  margin-right: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-strong);
}

.mini-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary-2), var(--cyan));
  transition: width 0.35s ease;
}

td em {
  color: var(--muted);
  font-style: normal;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.badge.ok {
  background: var(--green-soft);
  color: var(--green);
}

.badge.warn {
  background: var(--amber-soft);
  color: var(--amber);
}

.badge.danger {
  background: var(--red-soft);
  color: var(--red);
}

.secondary-action,
.queue-filter,
.primary-action {
  min-height: 38px;
  border-radius: 12px;
  font-weight: 900;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.secondary-action,
.queue-filter {
  padding: 0 13px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.secondary-action:hover,
.queue-filter:hover,
.primary-action:hover {
  transform: translateY(-1px);
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.queue-filter.active {
  border-color: var(--primary-2);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 14px 28px -20px rgba(0, 61, 155, 0.86);
}

.dispatch-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.42fr) minmax(0, 0.58fr);
  gap: 16px;
}

.dispatch-form {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

select,
input[type="range"] {
  width: 100%;
}

select {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
}

input[type="range"] {
  accent-color: var(--primary-2);
}

.primary-action {
  min-height: 44px;
  border: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: 0 18px 30px -22px rgba(0, 82, 204, 0.92);
}

.dispatch-result {
  display: grid;
  gap: 12px;
}

.result-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.result-card.primary {
  background: linear-gradient(135deg, var(--primary-soft), #fff);
  border-color: #b7c7ef;
}

.result-card strong {
  display: block;
  margin: 7px 0;
  color: var(--primary);
  font-size: 26px;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.result-grid div {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.result-grid strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 20px;
}

.dispatch-steps {
  margin: 0;
  padding: 16px 16px 16px 36px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--muted);
  line-height: 1.75;
}

.bar-chart {
  min-height: 302px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  align-items: end;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.bar {
  display: grid;
  align-items: end;
  gap: 8px;
  height: 100%;
}

.bar-fill {
  display: grid;
  align-items: start;
  justify-items: center;
  min-height: 32px;
  padding-top: 10px;
  border-radius: 12px 12px 0 0;
  background: linear-gradient(180deg, var(--primary-2), var(--cyan));
  color: #fff;
  font-weight: 900;
  transform-origin: bottom;
  transition: height 0.35s ease;
  animation: riseBar 0.8s ease-out both;
}

.bar label {
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  font-weight: 900;
}

.cost-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cost-list strong {
  color: var(--primary);
  font-size: 22px;
}

.muted-copy,
footer p,
.alert-item p {
  color: var(--muted);
  line-height: 1.7;
}

.heatmap {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.heatmap p {
  margin-bottom: 10px;
  color: var(--muted);
}

.heatmap-grid {
  display: grid;
  grid-template-columns: 58px repeat(7, 1fr);
  gap: 6px;
  align-items: center;
}

.heatmap-grid b {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.heatmap-grid span {
  min-height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(0, 82, 204, 0.12);
  border-radius: 8px;
  background: rgba(0, 82, 204, calc(var(--level) * 0.28));
}

.heatmap-grid em {
  color: #062d73;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.ops-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.58fr) minmax(320px, 0.42fr);
  gap: 16px;
}

.alert-item span,
.alert-item small {
  color: var(--muted);
}

.alert-item strong {
  display: block;
  margin: 6px 0;
}

.alert-item.danger {
  background: var(--red-soft);
  border-color: #f3b7b0;
}

.alert-item.warn {
  background: var(--amber-soft);
  border-color: #efd49d;
}

.permission-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.permission-panel p {
  color: var(--muted);
  line-height: 1.7;
}

.empty-state {
  color: var(--muted);
}

.flash {
  animation: panelFlash 0.72s ease-out;
}

footer {
  padding: 0 4px 16px;
}

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

@keyframes livePulse {
  0%, 100% {
    box-shadow: 0 0 0 5px rgba(15, 138, 98, 0.12);
  }
  50% {
    box-shadow: 0 0 0 9px rgba(15, 138, 98, 0.04);
  }
}

@keyframes swapIcon {
  0% {
    transform: scale(1) rotate(0deg);
  }
  45% {
    transform: scale(0.72) rotate(-8deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

@keyframes textSwap {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  45% {
    opacity: 0;
    transform: translateY(6px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pillPulse {
  0%, 100% {
    box-shadow: 0 0 0 rgba(0, 82, 204, 0);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(0, 82, 204, 0.08);
  }
}

@keyframes drawLine {
  from {
    stroke-dashoffset: 900;
  }
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes arrowMove {
  0%, 100% {
    transform: translateX(0);
    opacity: 0.48;
  }
  50% {
    transform: translateX(3px);
    opacity: 1;
  }
}

@keyframes coreBreathe {
  0%, 100% {
    box-shadow: 0 20px 42px -30px rgba(0, 61, 155, 0.42), 0 0 0 1px rgba(0, 82, 204, 0.08);
  }
  50% {
    box-shadow: 0 28px 54px -32px rgba(0, 61, 155, 0.62), 0 0 0 7px rgba(0, 82, 204, 0.07);
  }
}

@keyframes floatNode {
  0%, 100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -5px;
  }
}

@keyframes riseBar {
  from {
    transform: scaleY(0.18);
    opacity: 0.55;
  }
  to {
    transform: scaleY(1);
    opacity: 1;
  }
}

@keyframes panelFlash {
  0% {
    box-shadow: var(--shadow);
  }
  35% {
    box-shadow: 0 0 0 1px rgba(0, 82, 204, 0.38), 0 24px 54px -26px rgba(0, 82, 204, 0.5);
  }
  100% {
    box-shadow: var(--shadow);
  }
}

/* Reference-style dashboard skin: rounded icon rail + soft analytics canvas */
.app-shell {
  grid-template-columns: 126px minmax(0, 1fr);
}

.sidebar {
  top: 24px;
  height: calc(100vh - 48px);
  margin: 24px 0 24px 22px;
  padding: 18px 12px;
  align-items: center;
  border: 0;
  border-radius: 40px;
  background: linear-gradient(180deg, #7892cf 0%, #5775bc 100%);
  box-shadow: 0 26px 44px -24px rgba(0, 61, 155, 0.58);
  color: #fff;
}

.brand {
  flex-direction: column;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
}

.brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 22px;
  background: #fff;
  color: var(--primary);
  box-shadow: 0 14px 24px -18px rgba(0, 0, 0, 0.45);
}

.brand strong {
  color: #fff;
  font-size: 13px;
}

.brand span {
  max-width: 72px;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  line-height: 1.35;
}

nav {
  width: 100%;
  justify-items: center;
  gap: 12px;
}

nav a {
  position: relative;
  justify-content: center;
  width: 58px;
  min-height: 58px;
  padding: 0;
  border-radius: 20px;
  color: rgba(255, 255, 255, 0.86);
}

nav a:hover,
nav a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
  transform: translateX(0);
}

.nav-icon {
  width: 34px;
  height: 34px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

nav a.active .nav-icon,
nav a:hover .nav-icon {
  background: #fff;
  color: var(--primary);
}

.nav-label {
  position: absolute;
  left: 72px;
  top: 50%;
  z-index: 20;
  padding: 8px 12px;
  border-radius: 12px;
  background: #fff;
  color: var(--primary);
  box-shadow: 0 18px 34px -24px rgba(0, 61, 155, 0.72);
  font-size: 13px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) translateX(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

nav a:hover .nav-label,
nav a:focus-visible .nav-label {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

nav .nav-label {
  display: none !important;
}

.sidebar-note {
  width: 76px;
  min-height: 92px;
  padding: 12px 8px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: none;
  text-align: center;
}

.sidebar-note span {
  color: #fff;
  font-size: 11px;
  line-height: 1.4;
}

.sidebar-note strong,
.sidebar-note p {
  display: none;
}

main {
  padding: 26px 28px 32px;
  gap: 16px;
}

.desktop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 4px 4px;
}

.desktop-head span,
.user-chip span,
.location-chip span,
.notice-chip span {
  color: var(--muted);
  font-size: 12px;
}

.desktop-head strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 18px;
}

.head-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.icon-action,
.notice-chip,
.user-chip,
.location-chip {
  min-height: 44px;
  border: 1px solid rgba(195, 205, 224, 0.78);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 20px 34px -28px rgba(0, 61, 155, 0.45);
}

.icon-action {
  width: 44px;
  padding: 0;
  color: var(--primary);
  font-size: 22px;
  font-weight: 900;
}

.notice-chip,
.user-chip,
.location-chip {
  display: grid;
  align-content: center;
  padding: 7px 13px;
}

.notice-chip {
  grid-template-columns: auto auto;
  gap: 7px;
  align-items: center;
}

.notice-chip strong {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin: 0;
  border-radius: 999px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 13px;
}

.user-chip strong,
.location-chip strong {
  margin: 0;
  font-size: 13px;
}

.topbar {
  grid-template-columns: minmax(0, 1fr) minmax(380px, 500px);
  min-height: 260px;
  padding: 30px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 88% 24%, rgba(0, 82, 204, 0.14), transparent 26%),
    linear-gradient(135deg, rgba(218, 230, 255, 0.94), rgba(255, 255, 255, 0.88) 48%, #fff);
}

h1 {
  max-width: 860px;
  font-size: clamp(34px, 4.1vw, 56px);
}

.hero-stack {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 12px;
  min-width: 0;
}

.hero-visual {
  position: relative;
  min-height: 138px;
  overflow: hidden;
  border: 1px solid rgba(195, 205, 224, 0.78);
  border-radius: 24px;
  background:
    radial-gradient(circle at 20% 20%, rgba(15, 143, 179, 0.18), transparent 28%),
    radial-gradient(circle at 82% 22%, rgba(0, 82, 204, 0.16), transparent 24%),
    linear-gradient(135deg, #f7faff 0%, #edf4ff 100%);
}

.hero-visual::before {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  border: 1px dashed rgba(0, 82, 204, 0.2);
  animation: orbitSpin 10s linear infinite;
}

.server-card {
  position: absolute;
  z-index: 2;
  min-width: 82px;
  padding: 10px 12px;
  border: 1px solid rgba(195, 205, 224, 0.9);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 34px -26px rgba(0, 61, 155, 0.5);
  animation: floatNode 5.5s ease-in-out infinite;
}

.server-card span,
.server-card strong {
  display: block;
}

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

.server-card strong {
  margin-top: 3px;
  color: var(--primary);
  font-size: 15px;
}

.card-a { left: 8%; top: 18%; }
.card-b { right: 8%; top: 20%; animation-delay: -1.6s; }
.card-c { left: 43%; bottom: 10%; animation-delay: -2.7s; }

.route-arc {
  position: absolute;
  left: 16%;
  right: 16%;
  bottom: 32px;
  height: 58px;
  border-top: 2px solid rgba(0, 82, 204, 0.22);
  border-radius: 50% 50% 0 0;
}

.route-arc::after {
  content: "";
  position: absolute;
  left: 48%;
  top: -5px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--primary-2);
  box-shadow: 0 0 0 8px rgba(0, 82, 204, 0.08);
  animation: routePoint 3.8s ease-in-out infinite;
}

.visual-core {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 28px;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  color: #fff;
  box-shadow: 0 22px 38px -24px rgba(0, 82, 204, 0.9);
  transform: translate(-50%, -50%);
}

.visual-core span,
.visual-core strong {
  color: #fff;
  line-height: 1.1;
}

.visual-core span {
  font-size: 15px;
  font-weight: 900;
}

.visual-core strong {
  margin: 0;
  font-size: 18px;
}

.operator-card {
  border-radius: 22px;
}

.dynamic-card {
  grid-template-columns: 58px 1fr;
}

.dynamic-card > div {
  min-width: 0;
}

.dynamic-icon {
  width: 58px;
  height: 58px;
  border-radius: 20px;
}

.metric,
.panel {
  border-radius: 24px;
}

.metric {
  min-height: 132px;
  padding: 20px;
}

.metric strong {
  color: var(--primary);
  font-size: 34px;
}

.chart-panel {
  min-height: 300px;
}

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

.donut {
  width: 158px;
  height: 158px;
}

.synergy-console {
  position: relative;
  min-height: 430px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(250px, 0.82fr) minmax(220px, 1fr);
  grid-template-areas:
    "network core electric"
    "production core absorb";
  gap: 14px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 50%, rgba(0, 82, 204, 0.12), transparent 30%),
    radial-gradient(circle at 10% 18%, rgba(15, 143, 179, 0.12), transparent 28%),
    linear-gradient(135deg, rgba(238, 244, 255, 0.96), rgba(255, 255, 255, 0.94));
}

.synergy-console::before,
.synergy-console::after {
  content: "";
  position: absolute;
  left: 9%;
  right: 9%;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 82, 204, 0.28), transparent);
}

.synergy-console::before {
  transform: rotate(18deg);
}

.synergy-console::after {
  transform: rotate(-18deg);
}

.synergy-card,
.synergy-core {
  position: relative;
  z-index: 1;
  border: 1px solid rgba(195, 205, 224, 0.84);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 22px 42px -32px rgba(0, 61, 155, 0.54);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.synergy-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 16px;
  border-radius: 22px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.synergy-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 28px 48px -30px rgba(0, 61, 155, 0.64);
}

.synergy-network { grid-area: network; }
.synergy-electric { grid-area: electric; }
.synergy-production { grid-area: production; }
.synergy-absorb { grid-area: absorb; }

.synergy-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--primary-soft), #fff);
  color: var(--primary);
}

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

.synergy-card span {
  display: block;
  color: var(--subtle);
  font-size: 12px;
  font-weight: 800;
}

.synergy-card h3 {
  margin: 3px 0 7px;
  color: var(--primary);
  font-size: 23px;
}

.synergy-card p {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.synergy-card strong {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
}

.synergy-electric .synergy-icon {
  background: linear-gradient(135deg, #fff1d6, #fff);
  color: var(--amber);
}

.synergy-electric strong {
  background: var(--amber-soft);
  color: var(--amber);
}

.synergy-production .synergy-icon {
  background: linear-gradient(135deg, #e2f5ee, #fff);
  color: var(--green);
}

.synergy-production strong {
  background: var(--green-soft);
  color: var(--green);
}

.synergy-absorb .synergy-icon {
  background: linear-gradient(135deg, #e9edff, #fff);
  color: #5e6fc3;
}

.synergy-absorb strong {
  background: #e9edff;
  color: #4c5d8d;
}

.synergy-core {
  grid-area: core;
  min-height: 100%;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  padding: 22px;
  border-radius: 28px;
  text-align: center;
}

.core-halo {
  position: relative;
  width: 136px;
  height: 136px;
  display: grid;
  place-items: center;
  margin-bottom: 6px;
}

.core-orbit {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px dashed rgba(0, 82, 204, 0.28);
  animation: orbitSpin 12s linear infinite;
}

.core-orbit::before,
.core-orbit::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--primary-2);
  box-shadow: 0 0 0 8px rgba(0, 82, 204, 0.08);
}

.core-orbit::before {
  left: 16px;
  top: 18px;
}

.core-orbit::after {
  right: 18px;
  bottom: 18px;
  background: var(--cyan);
}

.core-chip {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  border-radius: 30px;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  color: #fff;
  font-size: 28px;
  font-weight: 900;
  box-shadow: 0 24px 40px -24px rgba(0, 82, 204, 0.9);
}

.synergy-core span {
  color: var(--muted);
  font-size: 13px;
}

.synergy-core strong {
  display: block;
  color: var(--primary);
  font-size: 26px;
}

.synergy-core p {
  max-width: 250px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.synergy-rhythm {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.synergy-rhythm span {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--primary);
  font-weight: 900;
  font-size: 13px;
}

.synergy-rhythm i {
  width: 28px;
  height: 1px;
  background: linear-gradient(90deg, rgba(0, 82, 204, 0.12), rgba(0, 82, 204, 0.55));
}

h1,
h2,
h3,
p,
small,
strong,
.lead,
.sidebar-note p,
.operator-card span,
.operator-card small,
.policy-list span {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@keyframes orbitSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes routePoint {
  0%, 100% {
    transform: translateX(-110px);
  }
  50% {
    transform: translateX(110px);
  }
}

@media (max-width: 1580px) {
  .chart-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .sidebar {
    position: relative;
    top: auto;
    height: auto;
    margin: 14px;
    flex-direction: row;
    justify-content: flex-start;
    overflow-x: auto;
    border-radius: 30px;
  }

  .sidebar {
    scrollbar-width: none;
  }

  .sidebar::-webkit-scrollbar {
    display: none;
  }

  .brand {
    min-width: 172px;
    flex-direction: row;
    text-align: left;
  }

  .brand span {
    max-width: none;
  }

  nav {
    display: flex;
    width: auto;
    min-width: max-content;
    gap: 8px;
  }

  nav a {
    width: auto;
    min-width: 52px;
    padding: 0 12px;
  }

  .nav-label {
    position: static;
    padding: 0;
    background: transparent;
    color: #fff;
    box-shadow: none;
    opacity: 1;
    transform: none;
  }

  .sidebar-note {
    display: none;
  }

  .topbar,
  .dashboard-grid,
  .dispatch-layout,
  .ops-layout {
    grid-template-columns: 1fr;
  }

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

  .synergy-console {
    min-height: auto;
    grid-template-columns: 1fr;
    grid-template-areas:
      "core"
      "network"
      "electric"
      "production"
      "absorb";
  }

  .synergy-core {
    min-height: 260px;
  }
}

@media (max-width: 760px) {
  main {
    padding: 14px;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  h1 {
    font-size: 28px;
    word-break: break-all;
  }

  .desktop-head,
  .head-tools {
    align-items: flex-start;
    justify-content: flex-start;
  }

  .desktop-head {
    display: grid;
  }

  .topbar {
    display: block;
    width: 100%;
    max-width: calc(100vw - 28px);
    padding: 20px;
  }

  .hero-visual {
    min-height: 180px;
  }

  .sidebar {
    padding: 14px;
    flex-wrap: wrap;
    overflow: visible;
  }

  .brand {
    min-width: 126px;
  }

  .brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 18px;
  }

  nav {
    flex: 1 1 180px;
    min-width: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  nav a {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 16px;
  }

  .nav-icon {
    width: 30px;
    height: 30px;
    border-radius: 12px;
  }

  .nav-label {
    display: none;
  }

  .dynamic-card {
    display: flex;
    align-items: center;
  }

  .dynamic-icon {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    font-size: 20px;
  }

  .dynamic-card > div:last-child,
  .hero-copy,
  .hero-stack,
  .operator-card,
  .lead {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  nav,
  .metric-grid,
  .chart-grid,
  .result-grid,
  .bar-chart,
  .donut-wrap {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    gap: 12px;
  }

  nav {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(6, 44px);
    justify-content: start;
    gap: 8px;
  }

  .lead,
  h2,
  .operator-card span,
  .operator-card small,
  .sidebar-note p {
    word-break: break-all;
  }

  .flow-stage {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .flow-arrow {
    display: none;
  }

  .synergy-console {
    padding: 12px;
    border-radius: 20px;
  }

  .synergy-console::before,
  .synergy-console::after {
    display: none;
  }

  .synergy-card {
    grid-template-columns: 48px minmax(0, 1fr);
    padding: 14px;
    border-radius: 18px;
  }

  .synergy-icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
  }

  .synergy-card h3 {
    font-size: 20px;
  }

  .synergy-rhythm i {
    display: none;
  }

  .internal-map {
    min-height: 560px;
  }

  .map-node {
    left: 50%;
    right: auto;
    width: 76%;
    transform: translateX(-50%);
  }

  .node-a {
    top: 6%;
  }

  .node-b {
    top: 22%;
  }

  .node-c {
    bottom: 22%;
  }

  .node-d {
    bottom: 6%;
  }

  .donut {
    margin: 0 auto;
  }
}
