* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  background: #0a0e14;
  color: #c9d1d9;
  font-family: 'SF Mono', 'JetBrains Mono', Monaco, Menlo, Consolas, 'Courier New', monospace;
  font-size: 13px;
  overflow: hidden;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 12px;
  gap: 12px;
}

/* ============================================================
   状态栏
   ============================================================ */
.status-bar {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 10px 18px;
  background: #161b22;
  border: 1px solid #2d3138;
  border-radius: 4px;
}

.status-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.status-item .label {
  color: #6e7681;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.status-item .value {
  color: #c9d1d9;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.danger-value {
  color: #f47067;
}

.status-actions {
  margin-left: auto;
}

button {
  background: #1f2937;
  color: #c9d1d9;
  border: 1px solid #2d3138;
  border-radius: 3px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s, color 0.1s;
}

button:hover {
  background: #2a3441;
  border-color: #56d4dd;
  color: #56d4dd;
}

button:active {
  background: #0d1117;
}

/* ============================================================
   单屏：月面实时态势
   ============================================================ */
.stage {
  display: flex;
  flex: 1;
  min-height: 0;
}

.viewport {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background: #161b22;
  border: 1px solid #2d3138;
  border-radius: 4px;
  overflow: hidden;
}

.viewport-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 8px 16px;
  border-bottom: 1px solid #2d3138;
  background: #0d1117;
}

.viewport-title {
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #d2a8ff;
}

.legend {
  display: flex;
  gap: 18px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #8b949e;
  font-size: 11px;
}

.legend .lg {
  width: 12px;
  height: 12px;
  flex: none;
}

.lg-rover {
  background: #79c0ff;
  border-radius: 2px;
  box-shadow: 0 0 5px rgba(121, 192, 255, 0.6);
}

.lg-ghost {
  border: 1.5px dashed #79c0ff;
  border-radius: 2px;
  background: rgba(121, 192, 255, 0.12);
}

.lg-sample {
  border-radius: 50%;
  background: #d2a8ff;
  box-shadow: 0 0 6px rgba(210, 168, 255, 0.8);
}

.canvas-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  min-height: 0;
  background:
    radial-gradient(ellipse at 50% 40%, #0b1018 0%, #050709 100%);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 3px;
}

/* ============================================================
   上行链路操控台
   ============================================================ */
.command-panel {
  background: #161b22;
  border: 1px solid #2d3138;
  border-radius: 4px;
  padding: 10px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 140px;
  max-height: 184px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
}

.panel-title {
  color: #56d4dd;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.panel-hint {
  color: #6e7681;
  font-size: 11px;
}

/* 发送 → 上行链路 → 执行 三段式布局 */
.uplink-flow {
  display: grid;
  grid-template-columns: 1fr 1.5fr 1fr;
  gap: 14px;
  align-items: stretch;
  flex: 1;
  min-height: 0;
}

.flow-node {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 12px;
  background: #0d1117;
  border: 1px solid #2d3138;
  border-radius: 3px;
}

.flow-node-title {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6e7681;
}

.flow-send { border-left: 2px solid #56d4dd; }
.flow-exec { border-left: 2px solid #7ee787; }

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

/* 方向指示灯：默认暗，.on 时点亮 */
.dir {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 4px;
  border-radius: 2px;
  background: #161b22;
  border: 1px solid #21262d;
  color: #4d5560;
  font-size: 12px;
  font-weight: 600;
  transition: background 80ms linear, color 80ms linear, border-color 80ms linear;
}

.flow-send .dir.on {
  background: rgba(86, 212, 221, 0.16);
  border-color: #56d4dd;
  color: #79e0e8;
}

.flow-exec .dir.on {
  background: rgba(126, 231, 135, 0.16);
  border-color: #7ee787;
  color: #9fe8a5;
}

/* 中间的上行链路管道 */
.flow-pipe {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.flow-pipe-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6e7681;
}

.flow-pipe-track {
  position: relative;
  width: 100%;
  height: 10px;
  background: #0d1117;
  border: 1px solid #2d3138;
  border-radius: 5px;
  overflow: hidden;
}

.flow-pipe-dash {
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 100%;
  background-image: repeating-linear-gradient(
    90deg,
    rgba(86, 212, 221, 0.45) 0 7px,
    transparent 7px 14px
  );
  animation: flow-scroll 0.8s linear infinite;
  will-change: transform;
}

@keyframes flow-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-14px); }  /* 一个 pattern 周期 = 14px */
}

.flow-pipe-note {
  font-size: 10px;
  color: #4d5560;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .flow-pipe-dash { animation: none; }
}
