:root {
  --color-bg: #edf2f7;
  --color-card: #ffffff;
  --color-card-inner: #f5f7fb;
  --color-blue: #3b82f6;
  --color-green: #10b981;
  --color-amber: #f59e0b;
  --color-purple: #701cd1;
  --color-red: #ef4444;
  --color-text: #172033;
  --color-text-secondary: #4b5563;
  --color-text-muted: #6f7b8d;
  --color-border: #dce3ee;
  --radius-card: 12px;
  --radius-pill: 9999px;
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-hover: 0 8px 25px rgba(59, 130, 246, 0.12);
  --font-h1: 28px;
  --font-h2: 23px;
  --font-h3: 18px;
  --font-body: 15px;
  --font-caption: 13px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  color: var(--color-text);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background: var(--color-bg);
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  color: inherit;
}

#particleCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.screen-shell {
  position: relative;
  z-index: 10;
  width: min(100vw, 2560px);
  height: 100vh;
  margin: 0 auto;
  padding: 6px 14px;
  display: grid;
  grid-template-rows: 56px minmax(0, 1.95fr) minmax(0, 0.82fr) 40px;
  gap: 8px;
  overflow: hidden;
}

.dashboard-card {
  border-radius: var(--radius-card);
  background: var(--color-card);
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.dashboard-card:hover {
  box-shadow: var(--shadow-hover);
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 450px 238px;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

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

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--color-blue), var(--color-green));
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

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

.title-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.gradient-text {
  flex-shrink: 0;
  font-size: var(--font-h1);
  font-weight: 800;
  line-height: 1.15;
  background: linear-gradient(135deg, var(--color-blue), var(--color-green));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

h1 {
  font-size: var(--font-h2);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
  white-space: nowrap;
}

.meta-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-top: 3px;
  color: var(--color-text-muted);
  font-size: var(--font-caption);
  white-space: nowrap;
}

.meta-line span,
.meta-line a {
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--color-text-muted);
  text-decoration: none;
}

.meta-line a {
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  color: var(--color-blue);
  background: rgba(59, 130, 246, 0.08);
  font-weight: 600;
}

.health-card {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 14px;
  border: 1px solid rgba(16, 185, 129, 0.15);
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.06);
}

.health-card .metric {
  text-align: center;
  flex-shrink: 0;
}

.health-card span {
  display: block;
  color: var(--color-text-muted);
  font-size: 9px;
}

.health-card strong {
  display: block;
  color: var(--color-green);
  font-size: var(--font-body);
  line-height: 1.2;
}

.health-card em {
  display: block;
  color: var(--color-amber);
  font-size: var(--font-body);
  font-style: normal;
  font-weight: 700;
  line-height: 1.2;
}

.health-card p {
  max-width: 205px;
  color: var(--color-text-secondary);
  font-size: var(--font-caption);
  line-height: 1.35;
}

.health-card .divider {
  width: 1px;
  height: 24px;
  flex-shrink: 0;
  background: rgba(16, 185, 129, 0.2);
}

.clock-card {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.clock-card span {
  color: var(--color-text-muted);
  font-size: var(--font-caption);
}

.clock-card strong {
  min-width: 72px;
  color: var(--color-text);
  font-family: "JetBrains Mono", "SF Mono", Consolas, monospace;
  font-size: var(--font-h3);
  font-weight: 700;
  letter-spacing: 0;
  text-align: center;
}

.clock-card em {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--color-green);
  font-size: var(--font-caption);
  font-style: normal;
  font-weight: 600;
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  background: var(--color-green);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.8);
  }
}

.map-schedule-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 8px;
  min-height: 0;
  overflow: hidden;
}

.map-card,
.summary-card,
.mini-card,
.detail-card {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.map-card {
  display: flex;
  flex-direction: column;
  padding: 14px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 30px;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.card-head.tight {
  margin-bottom: 5px;
}

.section-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.section-title h2 {
  color: var(--color-text);
  font-size: var(--font-h3);
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.icon {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  display: inline-block;
  flex-shrink: 0;
  position: relative;
}

.icon.globe {
  border: 2px solid var(--color-blue);
  border-radius: 50%;
}

.icon.layers {
  background: linear-gradient(135deg, var(--color-blue), #60a5fa);
}

.icon.calendar {
  border: 2px solid var(--color-amber);
}

.icon.check {
  border: 2px solid var(--color-green);
  border-radius: 50%;
}

.icon.shield {
  background: linear-gradient(135deg, #8b5cf6, var(--color-purple));
  clip-path: polygon(50% 0, 92% 18%, 82% 78%, 50% 100%, 18% 78%, 8% 18%);
}

.legend {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--color-text-secondary);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.legend i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.legend .done {
  background: var(--color-green);
}

.legend .active {
  background: var(--color-amber);
}

.legend .idle {
  background: #d8dee8;
}

.map-stage {
  flex: 1;
  min-height: 0;
  position: relative;
}

.china-map {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.map-tooltip {
  position: absolute;
  z-index: 50;
  min-width: 170px;
  max-width: 260px;
  padding: 10px 14px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 10px;
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(20px);
  pointer-events: none;
}

.map-tooltip-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font-size: var(--font-body);
  font-weight: 700;
}

.map-tooltip-title .abbr {
  font-size: 16px;
  font-weight: 800;
}

.map-tooltip-title .tag {
  margin-left: auto;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.map-tooltip p {
  margin: 2px 0;
  color: var(--color-text-secondary);
  font-size: var(--font-caption);
}

.map-tooltip strong {
  color: var(--color-blue);
  font-family: "JetBrains Mono", "SF Mono", Consolas, monospace;
}

.right-stack {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 8px;
  min-height: 0;
  overflow: hidden;
}

.summary-card {
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
}

.summary-card .card-head > span {
  margin-left: auto;
  color: var(--color-text-muted);
  font-size: var(--font-caption);
  white-space: nowrap;
}

.summary-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.summary-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 7px 12px;
  border-radius: 8px;
  border-left: 4px solid var(--row-color, var(--color-amber));
  color: var(--color-text);
  background: var(--color-card-inner);
  cursor: pointer;
}

.summary-row.done {
  background: rgba(16, 185, 129, 0.05);
}

.summary-row.selected {
  outline: 2px solid rgba(59, 130, 246, 0.14);
  background: rgba(59, 130, 246, 0.06);
}

.short-badge {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #ffffff;
  background: var(--row-color, var(--color-amber));
  font-size: 13px;
  font-weight: 800;
}

.summary-row strong {
  min-width: 56px;
  font-size: 15px;
  font-weight: 800;
}

.row-progress,
.card-progress {
  height: 7px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.row-progress {
  flex: 1;
  min-width: 42px;
}

.row-progress i,
.card-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--row-color, var(--color-amber));
}

.summary-row b {
  min-width: 42px;
  color: var(--row-color, var(--color-amber));
  font-family: "JetBrains Mono", "SF Mono", Consolas, monospace;
  font-size: 14px;
  font-weight: 800;
  text-align: right;
}

.summary-row span.metric {
  min-width: 42px;
  color: var(--color-text-secondary);
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

.summary-empty {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 12px;
  border-left: 4px solid #d7dce5;
  border-radius: 8px;
  color: var(--color-text-muted);
  background: var(--color-card-inner);
  font-size: var(--font-caption);
}

.schedule-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  min-height: 0;
  overflow: hidden;
}

.mini-card {
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
}

.month-plan,
.node-plan {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.month-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 34px;
  padding: 4px 8px;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.month-row.active {
  background: rgba(59, 130, 246, 0.08);
}

.month-row b {
  min-width: 36px;
  color: var(--color-blue);
  font-family: "JetBrains Mono", "SF Mono", Consolas, monospace;
  font-size: 16px;
}

.month-row span {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.month-row em,
.more {
  padding: 2px 8px;
  border-radius: 6px;
  color: #9a5b00;
  background: rgba(245, 158, 11, 0.16);
  font-size: 13px;
  font-style: normal;
  font-weight: 600;
  white-space: nowrap;
}

.month-row.active em {
  color: var(--color-blue);
  background: rgba(59, 130, 246, 0.12);
}

.node-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--color-card-inner);
}

.node-row.done {
  background: rgba(16, 185, 129, 0.05);
}

.node-row.active {
  background: rgba(245, 158, 11, 0.08);
}

.node-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #ffffff;
  background: #e5e7eb;
  font-size: 12px;
  font-weight: 800;
}

.node-row.done .node-dot {
  background: var(--color-green);
}

.node-row.active .node-dot {
  background: var(--color-amber);
}

.node-copy {
  min-width: 0;
  flex: 1;
}

.node-copy div {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.node-copy strong {
  color: var(--color-text);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.node-copy span {
  color: var(--color-text-secondary);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.node-copy em {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  color: var(--node-color, var(--color-text-muted));
  background: color-mix(in srgb, var(--node-color, #9ca3af) 12%, transparent);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.node-copy p {
  margin-top: 4px;
  color: var(--color-text-muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.province-detail-grid {
  display: grid;
  grid-template-columns: 3.35fr 1.35fr;
  gap: 8px;
  min-height: 0;
  overflow: hidden;
}

.province-cards {
  --province-card-count: 5;
  display: grid;
  grid-template-columns: repeat(var(--province-card-count), minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
  min-height: 0;
}

.province-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  cursor: pointer;
}

.province-card.selected {
  border-color: rgba(59, 130, 246, 0.42);
  box-shadow: var(--shadow-hover);
}

.province-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.province-card-head .short-badge {
  width: 36px;
  height: 36px;
  font-size: 16px;
}

.province-card-title {
  min-width: 0;
}

.province-card-title h3 {
  color: var(--color-text);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.province-card-title p {
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 600;
}

.province-card-head em,
.status-pill {
  margin-left: auto;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  color: var(--row-color, var(--color-amber));
  background: color-mix(in srgb, var(--row-color, #f59e0b) 10%, transparent);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.province-progress-value {
  color: var(--row-color, var(--color-amber));
  font-family: "JetBrains Mono", "SF Mono", Consolas, monospace;
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}

.metric-card {
  padding: 6px 5px;
  border-radius: 7px;
  background: var(--color-card-inner);
  text-align: center;
}

.metric-card span {
  display: block;
  margin-bottom: 1px;
  color: var(--color-text-muted);
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 600;
}

.metric-card b {
  display: block;
  color: var(--metric-color, var(--color-text));
  font-family: "JetBrains Mono", "SF Mono", Consolas, monospace;
  font-size: 14px;
  font-weight: 800;
}

.timeline-list {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  justify-content: flex-start;
  gap: 5px;
  margin-top: 2px;
  min-height: 0;
}

.timeline-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 600;
}

.timeline-item i {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--row-color, var(--color-amber));
  background: color-mix(in srgb, var(--row-color, #f59e0b) 12%, transparent);
  font-style: normal;
}

.timeline-item.pending i {
  color: #d1d5db;
  background: #f3f4f6;
}

.timeline-item span {
  min-width: 68px;
  color: var(--color-text-secondary);
}

.timeline-item.pending span,
.timeline-item.pending b {
  color: var(--color-text-muted);
  font-weight: 400;
}

.timeline-item b {
  margin-left: auto;
  color: var(--color-text);
  font-family: "JetBrains Mono", "SF Mono", Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.province-next {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.province-next b {
  color: var(--color-text);
}

.detail-stack {
  min-height: 0;
  overflow: hidden;
}

.detail-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
}

.detail-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
  flex-shrink: 0;
  overflow: hidden;
}

.detail-tabs button {
  height: 26px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  color: var(--color-text-secondary);
  background: var(--color-card-inner);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.detail-tabs button.active {
  color: var(--color-blue);
  background: rgba(59, 130, 246, 0.1);
  font-weight: 700;
}

.detail-content {
  display: grid;
  grid-template-rows: auto auto;
  gap: 6px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.detail-section {
  padding: 8px 10px;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: var(--shadow-card);
  overflow: visible;
}

.detail-section h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px;
  color: var(--color-text);
  font-size: 16px;
  font-weight: 600;
}

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

.touch-grid div {
  min-height: 46px;
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--color-card-inner);
  font-size: 13px;
}

.touch-grid .done,
.touch-grid .key {
  background: rgba(16, 185, 129, 0.05);
}

.touch-grid span {
  display: block;
  color: var(--color-text-secondary);
  font-size: 10px;
  font-weight: 600;
}

.touch-grid strong {
  display: block;
  color: var(--color-text);
  margin-top: 2px;
  font-size: 13px;
  font-weight: 800;
}

.touch-grid b {
  display: block;
  margin-top: 2px;
  color: var(--touch-color, var(--color-amber));
  font-size: 11px;
  font-weight: 800;
}

.risk-section {
  flex-shrink: 0;
}

.risk-section p {
  margin: 0 0 4px;
  color: var(--color-text-secondary);
  font-size: 13px;
  line-height: 1.42;
}

.risk-section b {
  color: var(--color-text);
}

.status-bar {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  padding: 6px 12px;
  min-width: 0;
}

.status-message {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--color-text-secondary);
  font-size: var(--font-caption);
  white-space: nowrap;
  overflow: hidden;
}

.footer-milestones,
.footer-staff {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.footer-item,
.footer-staff-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--color-text-muted);
  font-size: var(--font-caption);
  white-space: nowrap;
}

.footer-item.done {
  color: var(--color-green);
  font-weight: 600;
}

.footer-item.active {
  color: var(--color-amber);
  font-weight: 600;
}

.footer-staff-item i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--resource-color, var(--color-green));
}

.footer-staff-item b {
  color: var(--resource-color, var(--color-green));
}

.fatal-error {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 100;
  padding: 12px;
  border: 1px solid #ff6578;
  border-radius: 10px;
  color: #7a271a;
  background: #fff1f3;
}

::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border-radius: 2px;
  background: #d1d5db;
}

@media (max-height: 1200px) {
  body {
    overflow: auto;
  }

  .screen-shell {
    height: auto;
    min-height: 1180px;
    grid-template-rows: 52px 620px 430px 38px;
  }
}

@media (max-width: 1500px) {
  .screen-shell {
    height: auto;
    min-height: 1220px;
    grid-template-rows: auto 620px auto auto;
    overflow: visible;
  }

  .topbar {
    grid-template-columns: 1fr;
    height: auto;
  }

  .map-schedule-grid,
  .province-detail-grid {
    grid-template-columns: 1fr;
  }

  .map-schedule-grid {
    grid-template-rows: 620px auto;
    overflow: visible;
  }

  .right-stack {
    grid-template-rows: 360px auto;
    overflow: visible;
  }

  .province-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .status-bar {
    grid-template-columns: 1fr;
    height: auto;
  }
}
