/* ASTRA 星际宇宙 · 深空黑 + 霓虹青 + 星紫 + 品红点缀 */
:root {
  --bg: #080a10;
  --accent: #29ffdf;
  --purple: #c0a4ff;
  --pink: #ff2d6f;
  --text: #f0f2f6;
  --dim: #b6bfd0;
  --mono: "SFMono-Regular", Consolas, "Courier New", monospace;
  --sans: Inter, "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#cosmos {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 1.2s ease;
}
#cosmos.ready { opacity: 1; }

/* ---- WebGL 降级静态星空 ---- */
.fallback-sky { display: none; }
body.no-webgl #cosmos { display: none; }
body.no-webgl .fallback-sky {
  display: block;
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1px 1px at 22% 31%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 68% 18%, #cfe9ff 50%, transparent 51%),
    radial-gradient(1px 1px at 81% 64%, #e6d9ff 50%, transparent 51%),
    radial-gradient(2px 2px at 41% 76%, #29ffdf 50%, transparent 51%),
    radial-gradient(1px 1px at 12% 59%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 55% 8%, #c0a4ff 50%, transparent 51%),
    radial-gradient(1px 1px at 90% 35%, #fff 50%, transparent 51%),
    radial-gradient(ellipse 80% 50% at 65% 70%, rgba(192, 164, 255, .12), transparent 70%),
    radial-gradient(ellipse 70% 45% at 25% 35%, rgba(41, 255, 223, .08), transparent 70%),
    var(--bg);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 30;
  background: var(--accent);
  color: #062019;
  padding: 10px 18px;
  font-weight: 600;
  border-radius: 0 0 8px 0;
}
.skip-link:focus-visible { left: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---- 顶栏 ---- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 26px 34px;
  pointer-events: none;
  transition: opacity 1.1s ease 0.15s;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  pointer-events: auto;
  min-height: 44px;
  align-items: center;
}
.brand-icon { color: var(--accent); font-size: 20px; line-height: 1; }
.brand span:last-child { font-weight: 700; letter-spacing: .12em; font-size: 15px; }
.brand small {
  display: block;
  font-weight: 400;
  font-size: 10px;
  letter-spacing: .34em;
  color: var(--dim);
  margin-top: 2px;
}

.header-note {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .22em;
  color: var(--dim);
  padding-top: 6px;
}

/* ---- 主文案 ---- */
main { position: relative; z-index: 5; }

.hero-copy {
  position: fixed;
  left: 34px;
  bottom: 120px;
  max-width: 560px;
  pointer-events: none;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .26em;
  color: var(--accent);
  margin-bottom: 18px;
}
.tiny-cross { color: var(--dim); margin-right: 6px; }

h1 {
  font-size: clamp(34px, 5.2vw, 64px);
  line-height: 1.14;
  font-weight: 700;
  letter-spacing: .02em;
  margin-bottom: 20px;
}
.accent { color: var(--accent); }

.hero-description {
  color: var(--dim);
  font-size: clamp(13px, 1.3vw, 15px);
  line-height: 2;
}

/* ---- HUD 角标 ---- */
.orbital-label {
  position: fixed;
  left: 34px;
  top: 96px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .2em;
  color: var(--dim);
  pointer-events: none;
}
.orbital-label span:first-child::after {
  content: "";
  display: block;
  width: 34px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
  margin-top: 8px;
}

.hero-index {
  position: fixed;
  right: 34px;
  bottom: 116px;
  z-index: 5;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .2em;
  color: var(--dim);
  pointer-events: none;
}

/* ---- 行星信息条（交互反馈，也是内容扩展的落点） ---- */
.planet-badge {
  position: fixed;
  right: 34px;
  top: 96px;
  z-index: 6;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .18em;
  color: var(--accent);
  min-height: 20px;
  text-align: right;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .25s ease, transform .25s ease;
}
.planet-badge.show { opacity: 1; transform: none; }
.planet-badge small { display: block; color: var(--dim); margin-top: 4px; }

/* ---- 操作提示 ---- */
.controls-hint {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  z-index: 5;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .24em;
  color: var(--dim);
  pointer-events: none;
  white-space: nowrap;
}
.hint-touch { display: none; }
@media (hover: none) and (pointer: coarse) {
  .hint-mouse { display: none; }
  .hint-touch { display: inline; }
}

/* ---- 页脚 ---- */
footer {
  position: fixed;
  left: 34px;
  bottom: 26px;
  z-index: 5;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .18em;
  color: var(--dim);
  pointer-events: none;
}
.footer-note { margin-top: 4px; opacity: .65; }

.noscript-note {
  position: fixed;
  inset: auto 0 50% 0;
  text-align: center;
  color: var(--dim);
  font-family: var(--mono);
}

/* ---- 响应式 ---- */
@media (max-width: 720px) {
  .site-header { padding: 20px 20px; }
  .hero-copy { left: 20px; right: 20px; bottom: 104px; }
  .orbital-label { left: 20px; top: 84px; }
  .hero-index { display: none; }
  .planet-badge { right: 20px; top: 84px; max-width: 46vw; }
  footer { left: 20px; bottom: 20px; }
  .controls-hint { bottom: 74px; }
}

/* ---- 天体信息卡 ---- */
.planet-card {
  position: fixed;
  right: 34px;
  bottom: 116px;
  z-index: 8;
  width: 292px;
  padding: 22px 24px 18px;
  background: rgba(8, 10, 16, 0.82);
  border: 1px solid rgba(41, 255, 223, 0.22);
  backdrop-filter: blur(8px);
  pointer-events: auto;
}
.planet-card[hidden] { display: none; }
.planet-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 24px;
  width: 46px;
  height: 1px;
  background: var(--accent);
}

.card-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  color: var(--dim);
  font-size: 20px;
  cursor: pointer;
}
.card-close:hover { color: var(--accent); }

.card-eyebrow {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .24em;
  color: var(--pink);
  margin-bottom: 10px;
}

#card-title {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 6px;
}
#card-title small {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: .26em;
  color: var(--dim);
  margin-top: 5px;
}

.card-type {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  color: var(--accent);
  border: 1px solid rgba(41, 255, 223, 0.3);
  padding: 3px 10px;
  margin-bottom: 14px;
}

.card-data {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  border-top: 1px solid rgba(182, 191, 208, 0.16);
  padding-top: 12px;
  margin-bottom: 12px;
}
.card-data dt {
  font-size: 10px;
  color: var(--dim);
  margin-bottom: 3px;
}
.card-data dd {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
}

.card-feature {
  font-size: 12px;
  line-height: 1.9;
  color: var(--dim);
}

.card-hint {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .18em;
  color: var(--dim);
  opacity: .55;
  margin-top: 12px;
}

@media (max-width: 720px) {
  .planet-card {
    right: 16px;
    left: 16px;
    width: auto;
    bottom: 96px;
  }
}

/* ---- 开场 2D 星月夜层（盖在 3D 上，命中后放大淡出交棒给 3D） ---- */
#vg-static, #vg-dynamic {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transform-origin: 50% 46%;
  will-change: opacity, transform;
}
#vg-static {
  z-index: 2;
  background: #080a10 url('../images/starry-night.jpg') center / cover no-repeat;
}
#vg-dynamic { z-index: 3; }
#vg-flash {
  position: fixed;
  inset: 0;
  z-index: 4;
  background: #fff8e8;
  opacity: 0;
  pointer-events: none;
}
body.intro #vg-dynamic { z-index: 3; }
body.no-webgl #vg-static, body.no-webgl #vg-dynamic { z-index: 1; }
.art-credit {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 5;
  margin: 0;
  color: rgba(238, 232, 215, 0.72);
  font: 500 9px/1.4 "Inter", "Helvetica Neue", sans-serif;
  letter-spacing: 0.16em;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 0.8s ease;
  white-space: nowrap;
}
body.no-webgl .art-credit { opacity: 1; }

/* ---- 开场转场：intro 期间隐藏文案，完成后淡入 ---- */
.hero-copy, .orbital-label, .hero-index, .controls-hint, footer {
  transition: opacity 1.1s ease 0.15s;
}
body.intro .hero-copy,
body.intro .orbital-label,
body.intro .hero-index,
body.intro .controls-hint,
body.intro footer,
body.intro .site-header,
body.intro .art-credit,
body.intro .noscript-note { opacity: 0; }

/* ---- 动效偏好 ---- */
@media (prefers-reduced-motion: reduce) {
  #cosmos { transition: none; }
  .planet-badge { transition: none; }
}
