:root {
  --ink: #eef3fa;
  --muted: rgba(206, 220, 236, 0.42);
  --cool: #7fbbef;
  --silver: #f0f5fc;
}

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

html,
body {
  height: 100%;
}

body {
  background: #05070b;
  color: var(--ink);
  overflow: hidden;
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

.scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
}

/* 背景网格：细线 + 径向遮罩，只在中部隐约可见 */
.bg-grid {
  position: absolute;
  inset: -12%;
  background-image:
    repeating-linear-gradient(to bottom, rgba(150, 180, 210, 0.075) 0 1px, transparent 1px 88px),
    repeating-linear-gradient(to right, rgba(150, 180, 210, 0.075) 0 1px, transparent 1px 88px);
  -webkit-mask-image: radial-gradient(72% 68% at 50% 50%, #000 18%, transparent 78%);
  mask-image: radial-gradient(72% 68% at 50% 50%, #000 18%, transparent 78%);
  opacity: 0.55;
  pointer-events: none;
}

/* 环境光斑 */
.bg-glow {
  position: absolute;
  inset: -18%;
  background:
    radial-gradient(36% 36% at 50% 49%, rgba(127, 187, 239, 0.2), rgba(127, 187, 239, 0.05) 46%, transparent 70%),
    radial-gradient(26% 26% at 79% 84%, rgba(124, 57, 237, 0.13), transparent 70%),
    radial-gradient(34% 30% at 16% 12%, rgba(184, 216, 248, 0.07), transparent 65%);
  filter: blur(26px);
  pointer-events: none;
}

#planet {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.9s ease 0.1s;
  cursor: grab;
  touch-action: none;
}

#planet.dragging {
  cursor: grabbing;
}

/* 星球中心文案：对齐 ai.lingzhixy.com 的字体、字号与位置 */
.orbit-copy {
  position: absolute;
  left: 50%;
  top: 49%;
  z-index: 4;
  width: clamp(280px, 27vw, 360px);
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  user-select: none;
  opacity: 0;
  transition: opacity 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.orbit-copy.is-visible {
  opacity: 1;
}

.orbit-headline {
  display: grid;
  gap: 4px;
  margin: 0;
}

.orbit-prefix {
  display: block;
  font-family: var(--font-cn);
  font-size: clamp(22px, 2.92vw, 42px);
  font-weight: 600;
  line-height: 1.19;
  letter-spacing: -0.0125em;
  color: #f1f4f2;
  white-space: nowrap;
}

.orbit-verb {
  display: block;
  font-family: var(--font-cn);
  font-size: clamp(32px, 4.45vw, 64px);
  font-weight: 700;
  line-height: 1.0625;
  letter-spacing: -0.0125em;
  color: #b9f0ec;
  white-space: nowrap;
}

.orbit-line {
  margin: 18px auto 0;
  max-width: 100%;
  min-height: 48px;
  font-family: var(--font-sans);
  font-size: clamp(11px, 0.972vw, 14px);
  font-weight: 400;
  line-height: 1.714;
  color: #b7bdc5;
  text-wrap: balance;
}

.orbit-line-row {
  display: block;
}

.orbit-copy .ch {
  visibility: hidden;
}

.orbit-copy .ch.shown {
  visibility: visible;
}

.orbit-copy .ch.cursor {
  position: relative;
}

.orbit-copy .ch.cursor::after {
  content: "";
  position: absolute;
  right: -2px;
  bottom: 0.12em;
  width: 2px;
  height: 0.9em;
  background: currentColor;
}

/* 嵌入模式：透明背景，只保留星球本体 */
html.embed,
html.embed body {
  background: transparent;
}

html.embed .bg-glow,
html.embed .bg-grid,
html.embed .vignette,
html.embed .hud,
html.embed .hint {
  display: none;
}

/* 嵌入到首页时，中心文案按容器大小缩放 */
html.embed .orbit-copy {
  width: clamp(250px, 62vw, 360px);
}

html.embed .orbit-prefix {
  font-size: clamp(20px, 5.2vh, 32px);
}

html.embed .orbit-verb {
  font-size: clamp(28px, 7.9vh, 48px);
}

html.embed .orbit-line {
  margin-top: 12px;
  min-height: 42px;
  font-size: clamp(10px, 2.2vh, 13px);
  line-height: 1.6;
}

html.embed .scene {
  position: absolute;
}

.scene.ready #planet {
  opacity: 1;
}

/* 暗角 */
.vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, transparent 38%, rgba(2, 4, 8, 0.55) 100%);
  pointer-events: none;
}

.hud {
  position: absolute;
  top: 26px;
  left: 32px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(220, 232, 246, 0.68);
  pointer-events: none;
  user-select: none;
}

.hud .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8fd0ff;
  box-shadow: 0 0 10px rgba(143, 208, 255, 0.9);
}

.hud em {
  font-family: var(--font-cn);
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.hint {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: rgba(200, 215, 235, 0.32);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .hud {
    top: 18px;
    left: 18px;
  }

  .hint {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bg-glow {
    filter: none;
  }
}
