html,
body {
  min-height: 100%;
  background: #05070b;
}

body {
  overflow: hidden;
}

.satellite-shell {
  --panel-bg: rgba(7, 13, 23, 0.84);
  --panel-border: rgba(142, 188, 210, 0.24);
  --text-main: #eef7ff;
  --text-muted: #91a7b8;
  --cyan: #58d8ff;
  --amber: #f3c969;
  --green: #71e4a6;
  --red: #ff7878;
  --site-chrome-height: 73px;
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr) minmax(260px, 330px);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0;
  height: calc(100vh - var(--site-chrome-height));
  min-height: calc(100vh - var(--site-chrome-height));
  overflow: hidden;
  color: var(--text-main);
  background:
    radial-gradient(circle at 50% 42%, rgba(55, 165, 220, 0.16), transparent 34%),
    linear-gradient(150deg, #05070b 0%, #0a111c 46%, #07090f 100%);
  font-family: "Helvetica Neue", Arial, "Noto Sans TC", sans-serif;
}

.satellite-shell * {
  box-sizing: border-box;
}

.left-panel,
.detail-panel,
.timeline-panel {
  position: relative;
  z-index: 3;
  background: var(--panel-bg);
  border-color: var(--panel-border);
  backdrop-filter: blur(14px);
}

.left-panel {
  grid-column: 1;
  grid-row: 1 / span 2;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 18px 16px;
  border-right: 1px solid var(--panel-border);
}

.brand-block {
  margin-bottom: 16px;
}

.eyebrow {
  display: block;
  color: var(--cyan);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand-block h1 {
  margin: 5px 0 6px;
  font-size: 24px;
  line-height: 1.22;
  font-weight: 700;
}

.brand-block p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  margin-bottom: 14px;
  border: 1px solid rgba(88, 216, 255, 0.22);
  border-radius: 8px;
  background: rgba(15, 28, 44, 0.72);
}

.status-card span,
.search-box span,
.speed-control span,
.time-slider-wrap span {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
}

.status-card strong {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  color: #fff;
}

button,
select,
input {
  font: inherit;
}

button {
  border: 1px solid rgba(88, 216, 255, 0.36);
  border-radius: 6px;
  color: var(--text-main);
  background: rgba(30, 64, 86, 0.75);
  min-height: 34px;
  padding: 0 12px;
  white-space: nowrap;
}

button:hover,
button:focus {
  border-color: rgba(243, 201, 105, 0.78);
  background: rgba(47, 80, 86, 0.92);
  outline: none;
}

.icon-btn {
  width: 38px;
  padding: 0;
}

.search-box {
  display: block;
  margin-bottom: 14px;
}

.search-box input,
.speed-control select {
  width: 100%;
  min-height: 36px;
  margin-top: 6px;
  border: 1px solid rgba(142, 188, 210, 0.24);
  border-radius: 6px;
  color: var(--text-main);
  background: rgba(3, 8, 14, 0.72);
  padding: 0 10px;
}

.group-filter {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid rgba(142, 188, 210, 0.2);
  border-radius: 8px;
}

.group-filter legend {
  width: auto;
  margin: 0;
  padding: 0 5px;
  color: var(--text-muted);
  border: 0;
  font-size: 11px;
}

.group-filter label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: #d9ecf6;
  font-size: 12px;
  line-height: 1;
}

.list-summary {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-bottom: 8px;
  color: var(--text-muted);
}

.list-summary strong {
  color: var(--green);
  font-size: 20px;
}

.satellite-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 3px;
}

.satellite-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 9px;
  width: 100%;
  align-items: center;
  margin-bottom: 7px;
  padding: 9px;
  border: 1px solid rgba(142, 188, 210, 0.16);
  border-radius: 8px;
  background: rgba(10, 19, 31, 0.64);
  cursor: pointer;
}

.satellite-item:hover,
.satellite-item.active {
  border-color: rgba(88, 216, 255, 0.68);
  background: rgba(18, 43, 61, 0.84);
}

.satellite-item strong {
  display: block;
  overflow: hidden;
  color: #f7fbff;
  font-size: 13px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.satellite-item small {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 11px;
}

.flag-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 26px;
  border-radius: 6px;
  color: #fff;
  background: rgba(88, 216, 255, 0.14);
  border: 1px solid rgba(88, 216, 255, 0.22);
  font-size: 15px;
  line-height: 1;
}

.group-pill {
  max-width: 76px;
  overflow: hidden;
  padding: 4px 6px;
  border-radius: 999px;
  color: #071019;
  background: var(--amber);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.globe-stage {
  position: relative;
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.globe-canvas {
  position: absolute;
  inset: 0;
}

.globe-canvas canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.scene-overlay {
  position: absolute;
  z-index: 4;
  min-width: 156px;
  padding: 10px 12px;
  border: 1px solid rgba(142, 188, 210, 0.22);
  border-radius: 8px;
  background: rgba(7, 13, 23, 0.68);
  backdrop-filter: blur(10px);
}

.scene-overlay span {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
}

.scene-overlay strong {
  display: block;
  margin-top: 3px;
  color: var(--text-main);
  font-size: 14px;
}

.top-left {
  top: 18px;
  left: 18px;
}

.top-right {
  top: 18px;
  right: 18px;
}

.weather-toggle-panel {
  position: absolute;
  z-index: 5;
  left: 18px;
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 36px);
  padding: 9px 10px;
  border: 1px solid rgba(142, 188, 210, 0.22);
  border-radius: 8px;
  background: rgba(7, 13, 23, 0.72);
  backdrop-filter: blur(10px);
}

.weather-status {
  min-width: 132px;
  padding-right: 4px;
}

.weather-status span,
.timeline-readout span {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
}

.weather-status strong,
.timeline-readout strong {
  display: block;
  margin-top: 2px;
  color: var(--text-main);
  font-size: 13px;
}

.weather-toggle {
  min-height: 32px;
  border-color: rgba(142, 188, 210, 0.22);
  background: rgba(8, 17, 28, 0.72);
}

.weather-toggle.active,
.weather-toggle[aria-pressed="true"] {
  border-color: rgba(70, 228, 209, 0.64);
  color: #061018;
  background: #46e4d1;
}

.legend-bar {
  position: absolute;
  z-index: 4;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: min(520px, calc(100% - 36px));
  padding: 10px 12px;
  border: 1px solid rgba(142, 188, 210, 0.2);
  border-radius: 8px;
  color: #dbeefa;
  background: rgba(7, 13, 23, 0.66);
  font-size: 12px;
}

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

.dot,
.line {
  display: inline-block;
  flex: 0 0 auto;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.dot.satellite.china {
  background: var(--red);
  box-shadow: 0 0 10px rgba(255, 120, 120, 0.9);
}

.dot.satellite.taiwan {
  background: var(--green);
  box-shadow: 0 0 10px rgba(113, 228, 166, 0.9);
}

.dot.satellite.other {
  background: var(--amber);
  box-shadow: 0 0 10px rgba(243, 201, 105, 0.9);
}

.dot.footprint {
  background: var(--green);
  box-shadow: 0 0 10px rgba(113, 228, 166, 0.9);
}

.dot.cloud {
  background: #f8fbff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.78);
}

.dot.typhoon {
  background: var(--red);
  box-shadow: 0 0 10px rgba(255, 120, 120, 0.9);
}

.line.orbit {
  width: 18px;
  height: 2px;
  background: #89d8ff;
}

.detail-panel {
  grid-column: 3;
  grid-row: 1 / span 2;
  padding: 18px 16px;
  border-left: 1px solid var(--panel-border);
}

.detail-panel header {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  margin-bottom: 16px;
}

.detail-panel h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
}

.detail-panel p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.detail-grid {
  display: grid;
  gap: 9px;
  margin: 0;
}

.detail-grid div {
  padding: 10px 11px;
  border: 1px solid rgba(142, 188, 210, 0.18);
  border-radius: 8px;
  background: rgba(8, 17, 28, 0.62);
}

.detail-grid dt {
  margin: 0 0 4px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 400;
}

.detail-grid dd {
  margin: 0;
  color: #f6fbff;
  font-size: 13px;
  line-height: 1.35;
  word-break: break-word;
}

.footprint-note {
  margin-top: 14px;
  padding: 10px 11px;
  border-left: 3px solid var(--amber);
  color: #f9df9f;
  background: rgba(102, 78, 25, 0.22);
  border-radius: 6px;
}

.timeline-panel {
  grid-column: 2;
  grid-row: 2;
  z-index: 5;
  display: grid;
  grid-template-columns: 38px 76px 150px minmax(0, 1fr) 88px;
  align-items: center;
  gap: 10px;
  min-height: 86px;
  padding: 12px 16px;
  border-top: 1px solid var(--panel-border);
}

.timeline-readout {
  min-width: 0;
}

#nowBtn {
  min-width: 72px;
}

.timeline-readout small {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.time-slider-wrap {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.time-slider-wrap input {
  width: 100%;
  accent-color: var(--cyan);
}

.speed-control {
  margin: 0;
}

.speed-control select {
  min-height: 32px;
  margin-top: 2px;
}

.toast {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%);
  max-width: min(560px, calc(100% - 32px));
  padding: 10px 14px;
  border: 1px solid rgba(243, 201, 105, 0.4);
  border-radius: 8px;
  color: #fff7dd;
  background: rgba(53, 38, 13, 0.9);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.toast.visible {
  opacity: 1;
}

.satellite-label-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.satellite-label {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 132px;
  padding: 4px 7px;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: var(--amber);
  background: rgba(4, 10, 18, 0.76);
  box-shadow: 0 0 14px currentColor;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
  transform: translate(-50%, -125%);
}

.satellite-label.china {
  color: var(--red);
}

.satellite-label.taiwan {
  color: var(--green);
}

.satellite-label.other {
  color: var(--amber);
}

.satellite-label.selected {
  color: #fff;
  background: rgba(35, 65, 82, 0.92);
}

.label-flag {
  font-size: 13px;
}

@media (max-width: 1180px) {
  .satellite-shell {
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  }

  .detail-panel {
    position: absolute;
    right: 14px;
    top: 78px;
    width: min(310px, calc(100% - 328px));
    max-height: calc(100% - 166px);
    overflow: auto;
    padding-bottom: 18px;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
  }

  .timeline-panel {
    grid-column: 2;
    grid-row: 2;
  }
}

@media (max-width: 760px) {
  body {
    overflow: auto;
  }

  .satellite-shell {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .left-panel,
  .detail-panel,
  .timeline-panel {
    position: relative;
    inset: auto;
    width: 100%;
    max-height: none;
    border: 0;
    border-bottom: 1px solid var(--panel-border);
    border-radius: 0;
  }

  .left-panel {
    min-height: 340px;
    height: 430px;
    order: 1;
    padding: 14px;
  }

  .globe-stage {
    min-height: 58vh;
    order: -1;
  }

  .detail-panel {
    order: 2;
    padding: 14px;
  }

  .timeline-panel {
    order: 0;
    display: grid;
    grid-template-columns: 42px 76px minmax(0, 1fr);
    gap: 8px;
    min-height: auto;
    padding: 10px 12px;
  }

  .timeline-readout {
    grid-column: 3;
    grid-row: 1;
  }

  .time-slider-wrap {
    grid-column: 1 / -1;
  }

  .speed-control {
    grid-column: 1 / -1;
  }

  .legend-bar {
    right: 10px;
    bottom: 118px;
    max-width: calc(100% - 20px);
    gap: 6px;
    padding: 8px;
    font-size: 11px;
  }

  .weather-toggle-panel {
    left: 10px;
    right: 10px;
    bottom: 10px;
    flex-wrap: wrap;
    gap: 6px;
  }

  .weather-status {
    flex: 1 1 100%;
  }

  .scene-overlay {
    min-width: 128px;
  }

  .top-left {
    top: 10px;
    left: 10px;
  }

  .top-right {
    top: 10px;
    right: 10px;
  }

  .satellite-label {
    max-width: 96px;
    padding: 4px 6px;
    font-size: 10px;
  }
}
