:root {
  --ink: #eaffff;
  --muted: #8bb6bc;
  --dim: #46737b;
  --cyan: #59edf5;
  --cyan-soft: rgba(89, 237, 245, 0.28);
  --orange: #ffa65a;
  --night: #02080d;
  --panel: rgba(6, 24, 34, 0.72);
  --line: rgba(116, 239, 244, 0.2);
  --ease-orbit: cubic-bezier(0.22, 0.78, 0.24, 1);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--night);
  color-scheme: dark;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow: hidden;
  background: var(--night);
  color: var(--ink);
  font-family: "Bahnschrift", "Microsoft YaHei UI", "PingFang SC", sans-serif;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 1px solid var(--orange);
  outline-offset: 5px;
}

.app {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  min-height: 620px;
  overflow: hidden;
  overflow: clip;
  isolation: isolate;
  background:
    radial-gradient(circle at 30% 48%, rgba(32, 128, 150, 0.19), transparent 36%),
    radial-gradient(circle at 88% 46%, rgba(29, 81, 101, 0.15), transparent 32%),
    linear-gradient(125deg, #061722 0%, #030a10 58%, #010407 100%);
}

.app::before,
.app::after {
  position: absolute;
  z-index: 2;
  content: "";
  pointer-events: none;
}

.app::before {
  inset: 0;
  opacity: 0.33;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.11'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.app::after {
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.22), transparent 22%, transparent 82%, rgba(0, 0, 0, 0.3));
}

.topbar {
  position: absolute;
  z-index: 40;
  top: 0;
  left: 0;
  display: flex;
  width: 100%;
  height: 112px;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(26px, 3.5vw, 64px);
  border-bottom: 1px solid rgba(112, 229, 235, 0.09);
  pointer-events: none;
}

.brand {
  display: flex;
  flex-direction: column;
  color: var(--ink);
  text-decoration: none;
  pointer-events: auto;
}

.brand-name {
  font-family: "Century Gothic", "Bahnschrift", sans-serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.34em;
}

.brand-sub {
  margin-top: 7px;
  color: #75b9c1;
  font-size: 9px;
  letter-spacing: 0.26em;
}

.system-status {
  display: grid;
  grid-template-columns: auto 14px;
  column-gap: 16px;
  align-items: center;
  justify-items: end;
  color: #79c4ca;
  font-size: 9px;
  letter-spacing: 0.22em;
}

.system-status time {
  grid-column: 1 / 2;
  margin-top: 7px;
  color: #3c7179;
}

.status-light {
  grid-row: 1 / 3;
  grid-column: 2;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 8px var(--orange), 0 0 22px rgba(255, 166, 90, 0.68);
  animation: status-pulse 2.4s ease-in-out infinite;
}

.lab {
  position: absolute;
  z-index: 1;
  inset: 0;
}

.scene,
.scene canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.scene canvas {
  display: block;
}

.grid-plane {
  position: absolute;
  z-index: 0;
  inset: 0;
  opacity: 0.42;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(92, 220, 228, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(92, 220, 228, 0.055) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 92%);
}

.scanline {
  position: absolute;
  z-index: 4;
  top: -10%;
  left: 0;
  width: 100%;
  height: 20%;
  opacity: 0.09;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--cyan), transparent);
  animation: scan 8s linear infinite;
}

.hud-panel {
  border: 1px solid rgba(111, 235, 241, 0.24);
  background:
    linear-gradient(135deg, rgba(20, 58, 72, 0.66), rgba(4, 15, 23, 0.82)),
    linear-gradient(90deg, rgba(96, 236, 242, 0.04), transparent);
  box-shadow: inset 0 0 40px rgba(71, 208, 220, 0.035), 0 30px 80px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(16px) saturate(115%);
}

.intro-panel {
  position: absolute;
  z-index: 20;
  top: 23%;
  right: 5.2%;
  width: min(31vw, 460px);
  padding: 34px 36px 32px;
  clip-path: polygon(0 18px, 18px 0, 100% 0, 100% calc(100% - 24px), calc(100% - 24px) 100%, 0 100%);
  transition: opacity 0.5s ease, transform 0.7s var(--ease-orbit), visibility 0.5s;
}

.app[data-state="active"] .intro-panel {
  visibility: hidden;
  opacity: 0;
  transform: translateX(48px);
}

.intro-panel::before,
.project-info::before {
  position: absolute;
  top: -1px;
  left: 18px;
  width: 84px;
  height: 2px;
  content: "";
  background: var(--cyan);
  box-shadow: 0 0 12px rgba(89, 237, 245, 0.7);
}

.eyebrow,
.project-coordinate,
.capability-label {
  color: var(--cyan);
  font-size: 9px;
  letter-spacing: 0.24em;
}

.intro-panel h1 {
  margin: 24px 0 14px;
  font-size: clamp(30px, 3vw, 48px);
  font-weight: 300;
  letter-spacing: 0.08em;
}

.intro-panel h1 span {
  color: #8ef8fb;
  font-family: "STSong", "SimSun", serif;
  font-weight: 400;
}

.intro-lead {
  margin: 0 0 22px;
  color: #c3e6e8;
  font-size: 15px;
  line-height: 1.8;
}

.intro-author {
  margin: 0;
  color: #7fa9af;
  font-size: 12px;
  line-height: 2;
}

.intro-command {
  display: flex;
  margin-top: 29px;
  padding-top: 20px;
  align-items: center;
  gap: 12px;
  border-top: 1px solid rgba(108, 226, 232, 0.13);
  color: #9cd8dc;
  font-size: 10px;
  letter-spacing: 0.12em;
}

.command-dot,
.live-dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 10px var(--orange);
}

.markers {
  position: absolute;
  z-index: 18;
  inset: 0;
  pointer-events: none;
}

.location-marker {
  --marker-size: 52px;
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  width: var(--marker-size);
  height: var(--marker-size);
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  opacity: 0;
  color: #d8feff;
  background: rgba(3, 17, 25, 0.68);
  cursor: pointer;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(var(--depth-scale, 1));
  transition: opacity 0.3s ease, filter 0.3s ease;
}

.marker-ring,
.marker-ring::before,
.marker-ring::after {
  position: absolute;
  border-radius: 50%;
  content: "";
}

.marker-ring {
  inset: 1px;
  border: 1px solid rgba(105, 241, 247, 0.85);
  box-shadow: inset 0 0 10px rgba(67, 218, 226, 0.14), 0 0 14px rgba(67, 218, 226, 0.14);
}

.marker-ring::before {
  inset: 7px;
  border: 1px dashed rgba(105, 241, 247, 0.68);
  animation: marker-spin 15s linear infinite;
}

.marker-ring::after {
  inset: -8px;
  border: 1px solid rgba(105, 241, 247, 0.09);
  transform: scale(0.75);
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.marker-core {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b7fdff;
  box-shadow: 0 0 8px #73f4fa, 0 0 18px rgba(115, 244, 250, 0.8);
}

.marker-label {
  position: absolute;
  left: calc(100% + 12px);
  width: max-content;
  max-width: 150px;
  color: #bdeef0;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-align: left;
  text-shadow: 0 2px 6px #001016;
  transition: color 0.3s, transform 0.3s;
}

.location-marker:hover .marker-ring::after,
.location-marker:focus-visible .marker-ring::after {
  opacity: 0.7;
  transform: scale(1.12);
}

.location-marker:hover .marker-label,
.location-marker:focus-visible .marker-label {
  color: white;
  transform: translateX(3px);
}

.location-marker.is-selected {
  z-index: 3;
  color: #fff3de;
  background: rgba(36, 25, 14, 0.76);
  filter: drop-shadow(0 0 12px rgba(255, 166, 90, 0.35));
}

.location-marker.is-selected .marker-ring {
  border-color: var(--orange);
  box-shadow: inset 0 0 12px rgba(255, 166, 90, 0.16), 0 0 18px rgba(255, 166, 90, 0.35);
}

.location-marker.is-selected .marker-ring::before,
.location-marker.is-selected .marker-ring::after {
  border-color: rgba(255, 177, 105, 0.7);
}

.location-marker.is-selected .marker-core {
  background: #ffd09e;
  box-shadow: 0 0 10px var(--orange), 0 0 22px rgba(255, 166, 90, 0.9);
}

.location-marker.is-selected .marker-label {
  color: #ffd09e;
}

.app[data-state="active"] .location-marker:not(.is-selected) {
  filter: saturate(0.6) brightness(0.55);
}

.project-stage {
  position: absolute;
  z-index: 16;
  top: 18%;
  right: 4.2%;
  bottom: 14%;
  width: min(36vw, 560px);
  visibility: hidden;
  pointer-events: none;
}

.app[data-state="active"] .project-stage {
  visibility: visible;
}

.close-project {
  position: absolute;
  z-index: 8;
  top: -42px;
  right: 0;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(99, 229, 236, 0.42);
  background: rgba(4, 17, 25, 0.86);
  cursor: pointer;
  opacity: 0;
  pointer-events: auto;
  transform: rotate(-45deg) scale(0.75);
  transition: opacity 0.35s 0.45s, transform 0.5s 0.45s var(--ease-orbit), border-color 0.25s;
}

.app[data-state="active"] .close-project {
  opacity: 1;
  transform: rotate(0) scale(1);
}

.close-project:hover {
  border-color: var(--orange);
}

.close-project span {
  position: absolute;
  top: 15px;
  left: 8px;
  width: 15px;
  height: 1px;
  background: var(--cyan);
}

.close-project span:first-child { transform: rotate(45deg); }
.close-project span:last-child { transform: rotate(-45deg); }

.project-info {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(112, 239, 244, 0.52);
  opacity: 0;
  pointer-events: auto;
  clip-path: polygon(0 22px, 22px 0, calc(100% - 52px) 0, calc(100% - 40px) 10px, 100% 10px, 100% calc(100% - 28px), calc(100% - 28px) 100%, 0 100%);
  box-shadow:
    0 36px 90px rgba(0, 0, 0, 0.48),
    0 0 36px rgba(61, 210, 222, 0.08),
    inset 0 0 52px rgba(50, 208, 220, 0.05);
  transform: translateX(76px) scale(0.96);
  transform-origin: right center;
  transition: opacity 0.5s 0.12s ease, transform 0.78s 0.08s var(--ease-orbit);
}

.project-info::before {
  z-index: 4;
  width: 112px;
  background: linear-gradient(90deg, var(--cyan), rgba(89, 237, 245, 0));
}

.project-info::after {
  position: absolute;
  z-index: 3;
  inset: 8px;
  border: 1px solid rgba(118, 236, 241, 0.13);
  content: "";
  pointer-events: none;
  clip-path: polygon(0 15px, 15px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%);
}

.app[data-state="active"] .project-info {
  opacity: 1;
  transform: translateX(0) scale(1);
}

.project-info-bg {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.4;
  filter: saturate(0.68) contrast(1.06) brightness(0.56) blur(0.7px);
  transform: scale(1.06);
  transition: opacity 0.55s ease, transform 1.1s var(--ease-orbit);
}

.app[data-state="active"] .project-info-bg {
  transform: scale(1);
}

.project-info-shade {
  position: absolute;
  z-index: 1;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(3, 17, 25, 0.5) 0%, rgba(3, 15, 23, 0.72) 42%, rgba(2, 10, 16, 0.97) 78%),
    linear-gradient(90deg, rgba(3, 15, 23, 0.86), rgba(3, 15, 23, 0.18) 76%);
  backdrop-filter: blur(1.5px);
}

.project-info-content {
  position: relative;
  z-index: 2;
  display: flex;
  height: 100%;
  padding: clamp(34px, 3vw, 52px) clamp(28px, 2.8vw, 46px) clamp(28px, 2.4vw, 40px);
  flex-direction: column;
}

.project-info h2 {
  margin: 20px 0 8px;
  font-size: clamp(24px, 2.2vw, 36px);
  font-weight: 300;
  letter-spacing: 0.08em;
}

.project-kicker {
  margin: 0;
  color: var(--orange);
  font-size: 9px;
  letter-spacing: 0.22em;
}

.info-rule {
  width: 100%;
  height: 1px;
  margin: 28px 0 24px;
  background: linear-gradient(to right, rgba(96, 230, 236, 0.34), transparent);
}

.project-description {
  min-height: 84px;
  margin: 0 0 30px;
  color: #9fc3c7;
  font-size: 12px;
  line-height: 2;
}

.capability-label {
  color: #4f7e85;
}

.capability-list {
  display: grid;
  margin: 20px 0 30px;
  padding: 0;
  grid-template-columns: 1fr 1fr;
  gap: 13px 10px;
  list-style: none;
}

.capability-list li {
  color: #b7e2e4;
  font-size: 9px;
  letter-spacing: 0.08em;
}

.capability-list b {
  margin-right: 7px;
  color: #5bcbd2;
  font-weight: 400;
}

.enter-project {
  display: flex;
  margin-top: auto;
  width: 100%;
  height: 54px;
  padding: 0 18px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(103, 232, 239, 0.4);
  color: #e8ffff;
  background: rgba(13, 46, 59, 0.62);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-decoration: none;
  transition: border-color 0.25s, background 0.25s, transform 0.25s;
}

.enter-project:hover {
  border-color: var(--orange);
  background: rgba(35, 50, 52, 0.8);
  transform: translateX(3px);
}

.enter-project svg {
  width: 25px;
  fill: none;
  stroke: var(--orange);
  stroke-width: 1.5;
}

.lock-note {
  display: block;
  margin-top: 21px;
  color: #3c6a71;
  font-size: 8px;
  letter-spacing: 0.15em;
}

.lab-index {
  position: absolute;
  z-index: 24;
  right: 5%;
  bottom: 6.5%;
  display: grid;
  width: min(36vw, 560px);
  grid-template-columns: repeat(3, 1fr);
  gap: 9px 22px;
  pointer-events: auto;
  transition: opacity 0.45s, transform 0.65s var(--ease-orbit);
}

.index-button {
  display: flex;
  padding: 3px 0;
  gap: 8px;
  border: 0;
  color: #507c82;
  background: transparent;
  font-size: 8px;
  letter-spacing: 0.12em;
  text-align: left;
  cursor: pointer;
  transition: color 0.25s, transform 0.25s;
}

.index-button:hover,
.index-button.is-selected {
  color: var(--orange);
  transform: translateX(3px);
}

.index-button b {
  font-weight: 400;
}

.planet-meta {
  position: absolute;
  z-index: 14;
  bottom: 5.6%;
  left: 3.5%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #47747b;
  font-size: 8px;
  letter-spacing: 0.18em;
}

.planet-meta strong {
  color: #a8d8db;
  font-size: 9px;
  font-weight: 400;
}

.planet-meta b {
  color: var(--cyan);
  font-weight: 400;
}

.footerbar {
  position: absolute;
  z-index: 30;
  bottom: 0;
  left: 0;
  display: flex;
  width: 100%;
  height: 36px;
  padding: 0 clamp(26px, 3.5vw, 64px);
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(112, 229, 235, 0.08);
  color: #315b61;
  background: rgba(0, 5, 8, 0.34);
  font-size: 7px;
  letter-spacing: 0.18em;
}

.footerbar nav {
  display: flex;
  gap: 22px;
}

.footerbar a {
  color: #4d7c82;
  text-decoration: none;
  transition: color 0.2s;
}

.footerbar a:hover { color: var(--cyan); }

.loader {
  position: absolute;
  z-index: 100;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 18px;
  background: #02080d;
  transition: opacity 0.7s ease, visibility 0.7s;
}

.app.is-ready .loader {
  visibility: hidden;
  opacity: 0;
}

.loader-orbit {
  position: relative;
  width: 64px;
  height: 64px;
  border: 1px solid rgba(87, 235, 243, 0.18);
  border-radius: 50%;
  animation: marker-spin 2.8s linear infinite;
}

.loader-orbit::before {
  position: absolute;
  inset: 10px;
  border: 1px dashed rgba(87, 235, 243, 0.5);
  border-radius: 50%;
  content: "";
}

.loader-orbit span {
  position: absolute;
  top: -3px;
  left: 29px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 10px var(--orange);
}

.loader-label {
  color: #6ab1b8;
  font-size: 8px;
  letter-spacing: 0.26em;
}

.webgl-notice {
  position: fixed;
  z-index: 120;
  right: 24px;
  bottom: 52px;
  max-width: 320px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(3, 14, 21, 0.9);
  font-size: 11px;
}

.noscript-fallback {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: flex;
  padding: 40px;
  align-items: flex-start;
  flex-direction: column;
  gap: 16px;
  background: #041018;
}

.noscript-fallback a { color: var(--cyan); }

@keyframes status-pulse {
  50% { opacity: 0.45; transform: scale(0.78); }
}

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

@keyframes scan {
  from { transform: translateY(-30vh); }
  to { transform: translateY(120vh); }
}

@media (max-width: 1180px) {
  .intro-panel { width: min(34vw, 410px); }
  .project-stage {
    right: 3.2%;
    width: min(43vw, 500px);
  }
  .project-info-content { padding: 32px 28px 28px; }
  .project-description { font-size: 11px; }
}

@media (max-width: 900px) {
  .app { min-height: 560px; }
  .topbar { height: 84px; padding: 0 22px; }
  .brand-name { font-size: 19px; }
  .brand-sub { font-size: 7px; }
  .status-copy { display: none; }
  .system-status { grid-template-columns: auto 12px; }
  .system-status time { grid-row: 1; margin-top: 0; }
  .intro-panel {
    top: auto;
    right: 18px;
    bottom: 74px;
    left: 18px;
    width: auto;
    padding: 24px;
  }
  .intro-panel h1 { margin: 15px 0 8px; font-size: 29px; }
  .intro-lead { margin-bottom: 10px; font-size: 12px; }
  .intro-author { display: none; }
  .intro-command { margin-top: 14px; padding-top: 13px; }
  .app[data-state="active"] .intro-panel {
    visibility: hidden;
    opacity: 0;
    transform: translateY(30px);
  }
  .project-stage {
    z-index: 26;
    top: 43%;
    right: 12px;
    bottom: 43px;
    left: 12px;
    width: auto;
    overflow-x: hidden;
    overflow-y: auto;
  }
  .project-info {
    height: auto;
    min-height: 100%;
  }
  .project-info-content {
    height: auto;
    min-height: 100%;
    padding: 32px 26px 34px;
  }
  .project-info h2 { font-size: 25px; }
  .project-description { min-height: auto; margin-bottom: 20px; }
  .capability-list { margin: 15px 0 22px; }
  .close-project {
    position: absolute;
    z-index: 40;
    top: 12px;
    right: 12px;
    border-color: var(--orange);
    background: rgba(3, 18, 27, 0.96);
  }
  .lab-index { display: none; }
  .planet-meta { bottom: 48%; }
  .footerbar { padding: 0 20px; }
  .footerbar > span { display: none; }
  .footerbar { justify-content: flex-end; }
}

@media (max-width: 560px) {
  .brand-sub { letter-spacing: 0.14em; }
  .system-status time { display: none; }
  .intro-panel { bottom: 55px; }
  .eyebrow { font-size: 7px; }
  .intro-command { font-size: 8px; }
  .project-stage { top: 44%; }
  .project-info-content { padding: 27px 20px 30px; }
  .project-info h2 { margin-top: 15px; }
  .info-rule { margin: 20px 0 17px; }
  .project-description { font-size: 11px; }
  .planet-meta { left: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}