/* Teaching overlays for the offline Cosmos Explore module. */
.cosmos-page,
.galaxy-page,
.solar-page,
.earth-moon-page,
.cosmos-viewport,
.galaxy-viewport,
.solar-viewport,
.earth-moon-viewport {
  position: relative;
}

.cosmos-fine-particles,
.galaxy-fine-particles {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  mix-blend-mode: screen;
}

.cosmos-labels,
.galaxy-labels {
  z-index: 2;
}

.cosmos-viewport > canvas.cosmos-stage,
.galaxy-viewport > canvas.galaxy-stage {
  opacity: 1;
}

.cosmos-scope-legend,
.galaxy-motion-note {
  position: absolute;
  right: clamp(14px, 2vw, 28px);
  bottom: clamp(102px, 14vh, 148px);
  z-index: 7;
  display: grid;
  gap: 7px;
  max-width: min(370px, calc(100vw - 28px));
  padding: 11px 13px;
  border: 1px solid rgba(125, 211, 252, 0.25);
  border-radius: 14px;
  background: rgba(3, 10, 27, 0.78);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  color: #dbeafe;
  font-size: 12px;
  line-height: 1.55;
  backdrop-filter: blur(12px);
  pointer-events: none;
}

.cosmos-scope-legend strong,
.galaxy-motion-note strong {
  color: #fff;
  font-size: 13px;
}

.cosmos-scope-legend .scope-known::before,
.cosmos-scope-legend .scope-unknown::before {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 7px;
  border-radius: 50%;
  content: "";
}

.cosmos-scope-legend .scope-known::before {
  background: #67e8f9;
  box-shadow: 0 0 10px #38bdf8;
}

.cosmos-scope-legend .scope-unknown::before {
  border: 1px dashed #c4b5fd;
  background: rgba(167, 139, 250, 0.18);
}

.phenomenon-toolbar {
  position: absolute;
  z-index: 9;
  left: 50%;
  bottom: 76px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  width: min(780px, calc(100vw - 30px));
  padding: 9px;
  border: 1px solid rgba(125, 211, 252, 0.22);
  border-radius: 16px;
  background: rgba(3, 10, 27, 0.8);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.3);
  transform: translateX(-50%);
  backdrop-filter: blur(12px);
}

.phenomenon-toolbar-label {
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  color: #bae6fd;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.phenomenon-btn {
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid rgba(148, 210, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: #e0f2fe;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  transition: 160ms ease;
}

.phenomenon-btn:hover,
.phenomenon-btn:focus-visible,
.phenomenon-btn.is-active {
  border-color: rgba(103, 232, 249, 0.75);
  background: rgba(14, 165, 233, 0.2);
  color: #fff;
  outline: none;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.18);
}

.phenomenon-panel {
  position: absolute;
  z-index: 8;
  inset: clamp(84px, 12vh, 118px) clamp(16px, 5vw, 72px) 126px;
  display: grid;
  grid-template-rows: auto minmax(210px, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(125, 211, 252, 0.32);
  border-radius: 22px;
  background: radial-gradient(circle at 50% 45%, rgba(17, 42, 79, 0.94), rgba(2, 8, 23, 0.98) 68%);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.phenomenon-panel[hidden] {
  display: none;
}

.phenomenon-panel-head,
.phenomenon-panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 18px;
  border-bottom: 1px solid rgba(148, 210, 255, 0.12);
}

.phenomenon-panel-foot {
  border-top: 1px solid rgba(148, 210, 255, 0.12);
  border-bottom: 0;
  color: #cbd5e1;
  font-size: 13px;
}

.phenomenon-panel-title {
  margin: 0;
  color: #fff;
  font-size: clamp(18px, 2.1vw, 25px);
}

.phenomenon-close {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  cursor: pointer;
}

.phenomenon-canvas {
  width: 100%;
  height: 100%;
  min-height: 220px;
}

.satellite-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  overflow: hidden;
  pointer-events: none;
}

.satellite-caption {
  position: absolute;
  right: 18px;
  top: 210px;
  max-width: 250px;
  padding: 8px 10px;
  border: 1px solid rgba(125, 211, 252, 0.2);
  border-radius: 12px;
  background: rgba(3, 10, 27, 0.68);
  color: #bae6fd;
  font-size: 11px;
  line-height: 1.45;
  backdrop-filter: blur(9px);
}

.satellite-key {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 10px;
}

.satellite-key::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #67e8f9;
  box-shadow: 0 0 10px #38bdf8;
  content: "";
}

.satellite-key--moon::before {
  background: #c4b5fd;
  box-shadow: 0 0 10px #8b5cf6;
}

.satellite-system {
  position: absolute;
  transform: translate(-50%, -50%);
}

.satellite-system--earth {
  left: 45%;
  top: 53%;
  width: 174px;
  height: 72px;
}

.satellite-system--moon {
  left: 69%;
  top: 47%;
  width: 104px;
  height: 43px;
}

.satellite-orbit {
  position: absolute;
  inset: 0;
  border: 1px dashed rgba(125, 211, 252, 0.35);
  border-radius: 50%;
  animation: satellite-spin 13s linear infinite;
}

.satellite-system--moon .satellite-orbit {
  border-color: rgba(196, 181, 253, 0.36);
  animation-duration: 9s;
  animation-direction: reverse;
}

.satellite-system--earth .satellite-orbit--outer {
  inset: -16px -26px;
  border-color: rgba(56, 189, 248, 0.22);
  animation-duration: 19s;
  animation-direction: reverse;
}

.satellite-system--earth .satellite-orbit--outer .satellite-marker {
  transform: scale(0.78);
}

.satellite-marker {
  position: absolute;
  left: 50%;
  top: -5px;
  width: 10px;
  height: 10px;
  border: 2px solid #7dd3fc;
  border-radius: 2px;
  background: #e0f2fe;
  box-shadow: -7px 0 0 -3px #38bdf8, 7px 0 0 -3px #38bdf8, 0 0 12px rgba(125, 211, 252, 0.8);
}

.satellite-system--moon .satellite-marker {
  border-color: #c4b5fd;
  box-shadow: -7px 0 0 -3px #8b5cf6, 7px 0 0 -3px #8b5cf6, 0 0 12px rgba(196, 181, 253, 0.8);
}

.satellite-label {
  position: absolute;
  left: 50%;
  bottom: -23px;
  width: max-content;
  transform: translateX(-50%);
  color: #dbeafe;
  font-size: 11px;
  text-shadow: 0 2px 8px #020617;
}

@keyframes satellite-spin {
  to { transform: rotate(360deg); }
}

.explorer-concept-tier {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  padding: 11px 14px;
  border: 1px dashed rgba(196, 181, 253, 0.5);
  border-radius: 15px;
  background: linear-gradient(90deg, rgba(76, 29, 149, 0.16), rgba(15, 23, 42, 0.5));
  color: #ddd6fe;
}

.explorer-concept-tier-index {
  display: inline-grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(196, 181, 253, 0.48);
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
}

.explorer-concept-tier strong {
  display: block;
  color: #fff;
  font-size: 14px;
}

.explorer-concept-tier span:last-child {
  color: #c4b5fd;
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 760px) {
  .cosmos-scope-legend,
  .galaxy-motion-note {
    right: 12px;
    bottom: 128px;
    max-width: calc(100vw - 24px);
  }

  .phenomenon-toolbar {
    bottom: 68px;
    gap: 5px;
  }

  .phenomenon-toolbar-label {
    width: 100%;
    justify-content: center;
  }

  .phenomenon-panel {
    inset: 76px 10px 154px;
  }

  .phenomenon-panel-foot {
    align-items: flex-start;
    flex-direction: column;
  }

  .satellite-caption {
    top: auto;
    right: 12px;
    bottom: 124px;
  }

  .satellite-system--earth {
    left: 42%;
    width: 132px;
    height: 56px;
  }

  .satellite-system--moon {
    left: 70%;
    width: 80px;
    height: 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .satellite-orbit { animation-play-state: paused; }
}

/* 真实自转 / 公转周期参照卡（太阳系 + 地月系）。 */
.solar-period-legend,
.earth-moon-period-legend {
  position: absolute;
  right: clamp(14px, 2vw, 28px);
  top: clamp(72px, 11vh, 118px);
  z-index: 7;
  max-width: min(340px, calc(100vw - 28px));
  color: #dbeafe;
  font-size: 12px;
  line-height: 1.5;
  pointer-events: auto;
}

.solar-period-legend details,
.earth-moon-period-legend details {
  border: 1px solid rgba(125, 211, 252, 0.25);
  border-radius: 14px;
  background: rgba(3, 10, 27, 0.82);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
  overflow: hidden;
}

.solar-period-legend summary,
.earth-moon-period-legend summary {
  padding: 9px 13px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.solar-period-legend summary::-webkit-details-marker,
.earth-moon-period-legend summary::-webkit-details-marker { display: none; }

.solar-period-legend summary::after,
.earth-moon-period-legend summary::after {
  content: "▸";
  float: right;
  color: #7dd3fc;
  transition: transform 0.2s ease;
}

.solar-period-legend details[open] summary::after,
.earth-moon-period-legend details[open] summary::after {
  transform: rotate(90deg);
}

.period-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 6px;
}

.period-table th,
.period-table td {
  padding: 4px 13px;
  text-align: left;
  white-space: nowrap;
  border-top: 1px solid rgba(125, 211, 252, 0.12);
}

.period-table thead th {
  color: #7dd3fc;
  font-weight: 600;
  border-top: none;
}

.period-table tbody th {
  color: #fff;
  font-weight: 600;
}

.period-table tbody td {
  color: #cbd5f5;
}

.period-note {
  display: block;
  padding: 2px 13px 11px;
  color: #a9c2e8;
  font-size: 11px;
  line-height: 1.5;
  white-space: normal;
}

/* 演示速度滑块（太阳系 + 地月系现场调速）。 */
.demo-speed-control {
  position: absolute;
  left: clamp(14px, 2vw, 28px);
  bottom: clamp(90px, 13vh, 150px);
  z-index: 8;
  display: grid;
  gap: 8px;
  width: min(230px, calc(100vw - 28px));
  padding: 11px 13px;
  border: 1px solid rgba(125, 211, 252, 0.25);
  border-radius: 14px;
  background: rgba(3, 10, 27, 0.82);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  color: #dbeafe;
  font-size: 12px;
  backdrop-filter: blur(12px);
  pointer-events: auto;
}

.demo-speed-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
}

.demo-speed-value {
  color: #7dd3fc;
  font-variant-numeric: tabular-nums;
}

.demo-speed-range {
  width: 100%;
  accent-color: #38bdf8;
  cursor: pointer;
}

.demo-speed-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.demo-speed-presets button {
  flex: 1 1 auto;
  padding: 4px 6px;
  border: 1px solid rgba(125, 211, 252, 0.3);
  border-radius: 8px;
  background: rgba(15, 30, 60, 0.7);
  color: #dbeafe;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.demo-speed-presets button:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: rgba(125, 211, 252, 0.6);
}
