/* ═══════════════════════════════════════════════════════════════
   多寰科技·浮生系列 — 银河宇宙 UI (v3)
   ═══════════════════════════════════════════════════════════════ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #020617;
  font-family: "PingFang SC", "Microsoft YaHei", ui-sans-serif, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#galaxy-canvas {
  display: block;
  width: 100%;
  height: 100%;
  vertical-align: top;
  touch-action: none;
  cursor: default;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ═══ Top Brand Bar ═══ */
.brand-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 18px 16px 14px;
  pointer-events: none;
  background: linear-gradient(180deg,
    rgba(2,6,23,0.65) 0%,
    rgba(2,6,23,0.20) 65%,
    transparent 100%
  );
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  mask-image: linear-gradient(180deg,
    rgba(0,0,0,1) 0%,
    rgba(0,0,0,1) 55%,
    rgba(0,0,0,0) 100%
  );
  -webkit-mask-image: linear-gradient(180deg,
    rgba(0,0,0,1) 0%,
    rgba(0,0,0,1) 55%,
    rgba(0,0,0,0) 100%
  );
}

.brand-bar-text {
  font-weight: 800;
  font-size: clamp(1rem, 3.2vw, 1.4rem);
  letter-spacing: 0.30em;
  text-indent: 0.30em;
  color: rgba(226,232,240,0.92);
  text-shadow:
    0 0 30px rgba(56,189,248,0.40),
    0 0 60px rgba(56,189,248,0.15),
    0 1px 2px rgba(0,0,0,0.85);
}

/* ═══ Tagline Rotator ═══ */
.tagline-bar {
  position: fixed;
  top: 52px; left: 0; right: 0;
  z-index: 9;
  text-align: center;
  pointer-events: none;
  font-size: clamp(10px, 1.4vw, 13px);
  font-weight: 400;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  color: rgba(148,163,184,0.45);
  text-shadow: 0 0 20px rgba(0,0,0,0.9);
  transition: opacity 0.6s ease;
  opacity: 0;
  animation: taglineIn 1.2s ease 2s forwards;
}

@keyframes taglineIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tagline-fade {
  opacity: 1;
}

/* ═══ Interaction Hint ═══ */
.hint-bar {
  display: none; /* 已被入口卡片网格替代，不再需要提示 */
}

.hint-bar-icon { font-size: 10px; color: rgba(148,163,184,0.50); }
.hint-bar-text {
  font-size: 10px;
  letter-spacing: 0.06em;
  color: rgba(148,163,184,0.50);
  font-weight: 400;
  white-space: nowrap;
}

@keyframes fadeInHint {
  from { opacity: 0; transform: translateX(-50%) translateY(6px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ═══ Footer Credit（已隐藏，由入口卡片网格代替） ═══ */
.footer-credit {
  display: none;
}

/* ═══ Loading Screen ═══ */
#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #020617;
  transition: opacity 0.8s ease;
}

#loading-screen.loading-fade {
  opacity: 0;
  pointer-events: none;
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.loading-ring {
  width: 32px;
  height: 32px;
  border: 2px solid rgba(56,189,248,0.12);
  border-top-color: rgba(56,189,248,0.70);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading-text {
  font-size: 12px;
  letter-spacing: 0.15em;
  color: rgba(148,163,184,0.50);
  font-weight: 400;
}

/* ═══ Info Widget (right side, above entrance grid) ═══ */
.info-widget {
  position: fixed;
  bottom: 240px;
  right: 18px;
  z-index: 20;
}

.info-widget-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(2,6,23,0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(148,163,184,0.70);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  margin-left: auto;
}

.info-widget-toggle:hover,
.info-widget-active {
  background: rgba(56,189,248,0.15);
  border-color: rgba(56,189,248,0.30);
  color: rgba(56,189,248,0.80);
  box-shadow: 0 0 16px rgba(56,189,248,0.15);
}

.info-widget-panel {
  position: absolute;
  bottom: 44px;
  right: 0;
  width: 200px;
  padding: 16px;
  border-radius: 12px;
  background: rgba(2,6,23,0.80);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.08);
  opacity: 0;
  transform: translateY(4px) scale(0.96);
  pointer-events: none;
  transition: all 0.25s ease;
}

.info-widget-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.info-widget-title {
  font-size: 14px;
  font-weight: 700;
  color: rgba(226,232,240,0.90);
  margin-bottom: 4px;
}

.info-widget-desc {
  font-size: 11px;
  color: rgba(148,163,184,0.55);
  margin-bottom: 10px;
  letter-spacing: 0.05em;
}

.info-widget-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.info-widget-links a {
  font-size: 12px;
  color: rgba(56,189,248,0.65);
  text-decoration: none;
  transition: color 0.2s;
}

.info-widget-links a:hover {
  color: rgba(56,189,248,0.95);
}

.info-widget-footer {
  margin-top: 10px;
  font-size: 10px;
  color: rgba(148,163,184,0.25);
  letter-spacing: 0.05em;
}

/* ═══ Entrance Grid (DOM 功能入口) ═══ */
.entrance-grid {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  z-index: 1000;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 14px;
  border-radius: 22px;
  background: rgba(8, 12, 22, 0.55);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow:
    0 12px 50px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  width: min(640px, calc(100vw - 24px));
  opacity: 0;
  transition: opacity 1s ease 0.4s, transform 1s cubic-bezier(0.16, 1, 0.3, 1) 0.4s;
}

.entrance-grid-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.entrance-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 6px 10px;
  border-radius: 12px;
  text-decoration: none;
  color: rgba(226, 232, 240, 0.85);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.entrance-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: hsl(var(--card-hue, 200), 35%, 55%);
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}

.entrance-card:hover {
  color: rgba(255, 255, 255, 0.98);
  transform: translateY(-3px);
}

.entrance-card:hover::before {
  opacity: 0.12;
}

.entrance-card:active {
  transform: translateY(-1px) scale(0.98);
}

.entrance-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: linear-gradient(
    135deg,
    hsla(var(--card-hue, 200), 40%, 28%, 0.50),
    hsla(var(--card-hue, 200), 30%, 12%, 0.85)
  );
  border: 1px solid hsla(var(--card-hue, 200), 40%, 55%, 0.18);
  overflow: hidden;
  position: relative;
  z-index: 1;
  transition: all 0.25s;
}

.entrance-card:hover .entrance-icon {
  border-color: hsla(var(--card-hue, 200), 60%, 65%, 0.45);
  box-shadow: 0 0 18px hsla(var(--card-hue, 200), 60%, 55%, 0.30);
}

.entrance-icon img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

.entrance-glyph {
  font-size: 20px;
  line-height: 1;
}

.entrance-title {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 1;
}

/* ═══ Responsive ═══ */
@media (max-width: 640px) {
  .brand-bar { padding: 14px 12px 10px; }
  .hint-bar { display: none; }
  .info-widget { bottom: 220px; right: 12px; }
  .info-widget-toggle { width: 32px; height: 32px; font-size: 12px; }
  .info-widget-panel { width: 170px; }

  .entrance-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    padding: 10px;
    bottom: 18px;
    border-radius: 18px;
  }
  .entrance-icon { width: 32px; height: 32px; border-radius: 8px; }
  .entrance-icon img { width: 22px; height: 22px; }
  .entrance-title { font-size: 9.5px; }
}

@media (max-width: 380px) {
  .entrance-title { font-size: 9px; }
  .entrance-icon { width: 28px; height: 28px; }
  .entrance-icon img { width: 18px; height: 18px; }
}
