:root {
  --bg: #06131e;
  --bg-soft: #0d2233;
  --panel: rgba(6, 19, 30, 0.72);
  --line: rgba(120, 232, 255, 0.36);
  --line-strong: rgba(148, 245, 255, 0.92);
  --text: #edf7ff;
  --muted: rgba(237, 247, 255, 0.72);
  --accent: #6cf7ff;
  --accent-2: #5aa7ff;
  --hot: #ffd86b;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Microsoft YaHei UI", "PingFang SC", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(90, 167, 255, 0.18), transparent 28%),
    radial-gradient(circle at 80% 20%, rgba(108, 247, 255, 0.15), transparent 22%),
    radial-gradient(circle at center, rgba(8, 60, 91, 0.22), transparent 35%),
    linear-gradient(135deg, #030912 0%, #071521 40%, #03070d 100%);
  overflow: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at center, black 25%, transparent 80%);
}

body::after {
  background:
    radial-gradient(circle at center, transparent 55%, rgba(0, 0, 0, 0.34) 100%);
}

.page-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 28px;
  min-height: 100vh;
  padding: 24px;
}

.hero-copy,
.hud-card,
.hud-tip {
  backdrop-filter: blur(18px);
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
}

.hero-copy {
  position: relative;
  z-index: 2;
  align-self: center;
  padding: 28px;
  border-radius: 28px;
}

.eyebrow {
  margin: 0 0 10px;
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--accent);
  font-size: 0.78rem;
}

h1 {
  margin: 0;
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: clamp(2.2rem, 5vw, 4.5rem);
  line-height: 1.04;
}

.intro {
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.8;
  font-size: 0.98rem;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-top: 26px;
  color: var(--muted);
  font-size: 0.92rem;
}

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

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

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(108, 247, 255, 0.8);
}

.legend-dot.active {
  background: var(--hot);
  box-shadow: 0 0 14px rgba(255, 216, 107, 0.85);
}

.legend-line {
  width: 26px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}

.visual-stage {
  position: relative;
  min-height: calc(100vh - 48px);
  border-radius: 32px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(5, 14, 24, 0.5), rgba(5, 14, 24, 0.18));
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.zoom-controls {
  position: absolute;
  left: 22px;
  bottom: 22px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 999px;
  backdrop-filter: blur(18px);
  background: rgba(6, 19, 30, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
}

.zoom-button {
  appearance: none;
  border: 0;
  min-width: 42px;
  height: 42px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(108, 247, 255, 0.2), rgba(90, 167, 255, 0.18));
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
  border: 1px solid rgba(108, 247, 255, 0.2);
}

.zoom-button:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, rgba(108, 247, 255, 0.32), rgba(90, 167, 255, 0.28));
}

.zoom-value {
  min-width: 64px;
  padding: 0 12px;
  font-size: 0.9rem;
}

#neural-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}

#neural-canvas.dragging {
  cursor: grabbing;
}

.hud {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  pointer-events: none;
}

.hud-card,
.hud-tip {
  pointer-events: auto;
}

.hud-card {
  width: min(380px, calc(100% - 8px));
  align-self: flex-end;
  padding: 18px 20px;
  border-radius: 22px;
  position: relative;
  overflow: hidden;
  transition: transform 280ms ease, border-color 280ms ease, box-shadow 280ms ease, opacity 220ms ease;
}

.hud-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(108, 247, 255, 0.12), transparent 42%, rgba(255, 216, 107, 0.1));
  opacity: 0.75;
  pointer-events: none;
}

.hud-card.is-focused {
  transform: translateY(-4px) scale(1.01);
  border-color: rgba(108, 247, 255, 0.34);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(108, 247, 255, 0.16), 0 0 40px rgba(108, 247, 255, 0.16);
}

.hud-card.is-hidden {
  opacity: 0;
  transform: translateY(18px) scale(0.98);
  pointer-events: none;
}

.hud-beacon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(237, 247, 255, 0.84);
  font-size: 0.8rem;
}

.hud-beacon-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hot);
  box-shadow: 0 0 0 rgba(255, 216, 107, 0.75);
  animation: beaconPulse 1.8s infinite;
}

.hud-content {
  transition: opacity 220ms ease, transform 220ms ease;
}

.hud-content.is-swapping {
  opacity: 0;
  transform: translateY(8px);
}

.hud-label {
  margin: 0;
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
}

.hud-card h2 {
  margin: 10px 0 8px;
  font-size: 1.5rem;
}

.hud-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.hud-card a {
  display: inline-flex;
  margin-top: 14px;
  color: var(--text);
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(108, 247, 255, 0.22), rgba(90, 167, 255, 0.22));
  border: 1px solid rgba(108, 247, 255, 0.26);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

@keyframes beaconPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 216, 107, 0.72);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(255, 216, 107, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 216, 107, 0);
  }
}

.hud-card a:hover {
  transform: translateY(-1px);
  border-color: rgba(108, 247, 255, 0.5);
  background: linear-gradient(135deg, rgba(108, 247, 255, 0.34), rgba(90, 167, 255, 0.3));
}

.hud-tip {
  display: inline-flex;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.88rem;
}

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

  .page-shell {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 16px;
  }

  .hero-copy {
    order: 2;
    align-self: stretch;
    padding: 22px;
  }

  .visual-stage {
    order: 1;
    min-height: 68svh;
    border-radius: 26px;
  }

  .hud {
    padding: 14px;
    gap: 12px;
  }

  .zoom-controls {
    left: 14px;
    bottom: 14px;
  }

  .hud-card {
    width: 100%;
    align-self: stretch;
    padding: 18px;
    border-radius: 20px;
    background: rgba(6, 19, 30, 0.84);
  }

  .hud-card h2 {
    font-size: 1.35rem;
  }

  .hud-card a {
    width: 100%;
    justify-content: center;
    min-height: 46px;
  }

  .hud-tip {
    align-self: flex-start;
    flex-wrap: wrap;
    max-width: min(100%, 360px);
    border-radius: 18px;
    background: rgba(6, 19, 30, 0.8);
  }
}

@media (max-width: 640px) {
  .page-shell {
    gap: 14px;
    padding: 12px;
  }

  .hero-copy {
    padding: 18px;
    border-radius: 20px;
  }

  h1 {
    font-size: clamp(1.8rem, 9vw, 2.7rem);
  }

  .intro {
    font-size: 0.92rem;
    line-height: 1.72;
  }

  .legend {
    gap: 10px 14px;
    margin-top: 20px;
    font-size: 0.84rem;
  }

  .visual-stage {
    min-height: 62svh;
    border-radius: 22px;
  }

  .zoom-controls {
    left: 12px;
    right: 12px;
    bottom: auto;
    top: 12px;
    justify-content: center;
    padding: 6px;
  }

  .zoom-button {
    min-width: 44px;
    height: 44px;
  }

  .hud {
    justify-content: flex-end;
    padding: 12px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .hud-tip {
    display: none;
  }

  .hud-card {
    padding: 16px;
    border-radius: 18px;
  }

  .hud-beacon {
    margin-bottom: 12px;
    font-size: 0.76rem;
  }

  .hud-label {
    font-size: 0.72rem;
  }

  .hud-card h2 {
    font-size: 1.2rem;
    margin: 8px 0 6px;
  }

  .hud-card p {
    font-size: 0.92rem;
    line-height: 1.6;
  }

  .hud-card a {
    margin-top: 12px;
    font-size: 0.92rem;
  }
}
