/* ============================================================
   富青会展云 AI 体系 — Full-Screen Galaxy Design System
   ============================================================ */

/* === DESIGN TOKENS === */
:root {
  /* Background */
  --bg-void: #0A0F1D;
  --bg-card: rgba(14, 20, 38, 0.85);
  --bg-card-solid: #0E1426;

  /* Module Colors */
  --color-insight: #00F2FE;
  --color-management: #4FACFE;
  --color-matchmaking: #7F00FF;
  --color-decision: #FF007F;

  /* Text */
  --text-primary: #E8ECF4;
  --text-secondary: #8B95A8;
  --text-tertiary: #5A6478;

  /* Border */
  --border-subtle: rgba(200, 220, 255, 0.06);
  --border-glow: rgba(0, 242, 254, 0.15);

  /* Fonts */
  --font-heading: 'Exo 2', sans-serif;
  --font-body: 'IBM Plex Sans', -apple-system, 'PingFang SC', sans-serif;
  --font-mono: 'Fira Code', monospace;

  /* Spacing */
  --header-height: 56px;
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

::selection { background: rgba(0, 242, 254, 0.2); }

/* Custom scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(200, 220, 255, 0.1); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: rgba(200, 220, 255, 0.2); }

/* === VIDEO PLAYER (hidden, singleton) === */
#globalPlayer {
  position: fixed;
  top: -9999px; left: -9999px;
  width: 1px; height: 1px;
  pointer-events: none;
}

/* === HEADER === */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 50;
  background: linear-gradient(180deg, rgba(10, 15, 29, 0.9) 0%, transparent 100%);
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
}

.brand-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 242, 254, 0.08) 0%, transparent 70%);
  box-shadow:
    0 0 12px rgba(0, 242, 254, 0.15),
    0 0 24px rgba(0, 242, 254, 0.05);
  animation: iconOrbit 20s linear infinite;
}

.brand-icon::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 1px solid rgba(0, 242, 254, 0.08);
  animation: iconRingPulse 4s ease-in-out infinite;
}

.brand-icon svg {
  width: 32px;
  height: 32px;
  opacity: 0.9;
  filter: drop-shadow(0 0 3px rgba(0, 242, 254, 0.3));
}

.brand-icon-pulse {
  animation: corePulse 2.5s ease-in-out infinite;
}

h1.brand-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, var(--color-insight), var(--color-management));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
  line-height: 1.3;
}

.brand-subtitle {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-tertiary);
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* === FULL-SCREEN GALAXY === */
.galaxy-fullscreen {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1;
}

.galaxy-fullscreen canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* === BREADCRUMB === */
.breadcrumb {
  display: none !important;
  position: fixed;
  bottom: 135px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0;
  font-family: var(--font-body);
  font-size: 0.82rem;
  pointer-events: auto;
  padding: 8px 18px;
  border-radius: 20px;
  background: rgba(10, 15, 29, 0.7);
  border: 1px solid var(--border-subtle);
  opacity: 0;
  transition: opacity 0.3s ease;
  max-width: 90vw;
  overflow-x: auto;
  white-space: nowrap;
}

.breadcrumb::-webkit-scrollbar { display: none; }

.breadcrumb.visible {
  opacity: 1;
}

.breadcrumb-segment {
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
  flex-shrink: 0;
}

.breadcrumb-segment:hover {
  background: rgba(200, 220, 255, 0.06);
}

.breadcrumb-segment.active {
  color: var(--text-primary);
  font-weight: 500;
  cursor: default;
}

.breadcrumb-separator {
  color: var(--text-tertiary);
  opacity: 0.4;
  padding: 0 6px;
  font-size: 0.7rem;
  flex-shrink: 0;
}

/* === GALAXY STATS === */
.galaxy-stats {
  display: none !important;
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  pointer-events: none;
  background: rgba(14, 20, 38, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 242, 254, 0.15);
  padding: 12px 32px;
  border-radius: 20px;
  box-shadow: 
    0 4px 24px rgba(0, 0, 0, 0.4),
    0 0 15px rgba(0, 242, 254, 0.05),
    inset 0 0 10px rgba(0, 242, 254, 0.05);
  animation: statsFadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.stats-row {
  display: flex;
  gap: 32px;
}

.stats-footer {
  font-size: 0.65rem;
  color: var(--text-tertiary);
  letter-spacing: 1px;
  opacity: 0.8;
}

.stat-item { 
  text-align: center; 
  position: relative;
}

.stat-item:not(:last-child)::after {
  content: '';
  position: absolute;
  right: -16px;
  top: 20%;
  height: 60%;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(0, 242, 254, 0.25), transparent);
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  background: linear-gradient(135deg, #FFF, #00F2FE);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 1px;
}

.stat-label {
  font-size: 0.65rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 2px;
}

/* === DETAIL MODAL === */
.detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(5, 8, 16, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.detail-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.detail-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.92);
  z-index: 70;
  width: min(800px, 90vw);
  max-height: 85vh;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.detail-modal.active {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.detail-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 5;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  background: rgba(10, 15, 29, 0.6);
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.detail-close:hover {
  color: var(--text-primary);
  border-color: rgba(200, 220, 255, 0.15);
}

.detail-body {
  padding: 32px 28px 28px;
  overflow-y: auto;
  max-height: 80vh;
}

/* Detail content elements */
.detail-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.3;
}

.detail-desc {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.7;
  margin-bottom: 20px;
}

.detail-video-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(10, 15, 29, 0.95), rgba(20, 28, 50, 0.9));
  border: 1px solid var(--border-subtle);
  margin-bottom: 20px;
}

.detail-video-viewport .scanline-bg {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(200, 220, 255, 0.015) 2px,
    rgba(200, 220, 255, 0.015) 3px
  );
}

.detail-video-viewport .scanline {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  animation: scanline 3s linear infinite;
}

.detail-video-viewport .grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(200, 220, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(200, 220, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
}

.detail-video-viewport .center-icon {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid;
}

.detail-children-title {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-tertiary);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.detail-child-item {
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(14, 20, 38, 0.5);
  border: 1px solid var(--border-subtle);
  margin-bottom: 6px;
}

.detail-child-item-title {
  font-weight: 500;
  font-size: 0.88rem;
  margin-bottom: 2px;
}

.detail-child-detail {
  padding-left: 14px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.8;
  position: relative;
}

.detail-child-detail::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  opacity: 0.5;
}

.exploring-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 10px;
  border: 1px solid;
  margin-bottom: 12px;
}

.exploring-text {
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.7;
}

/* === ANIMATIONS === */
@keyframes scanline {
  0% { top: -2px; }
  100% { top: 100%; }
}

@keyframes iconOrbit {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes iconRingPulse {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.08);
  }
}

@keyframes corePulse {
  0%, 100% {
    opacity: 0.5;
    r: 1.2;
  }
  50% {
    opacity: 1;
    r: 1.8;
  }
}

@keyframes statsFadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, 20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* === RESPONSIVE: MOBILE === */
@media (max-width: 768px) {
  :root {
    --header-height: 48px;
  }

  .site-header {
    padding: 0 16px;
  }

  h1.brand-title {
    font-size: 0.95rem;
  }

  .brand-subtitle {
    font-size: 0.55rem;
  }

  .breadcrumb {
    bottom: 115px;
    font-size: 0.75rem;
    padding: 6px 14px;
  }

  .galaxy-stats {
    bottom: 16px;
    gap: 18px;
    padding: 6px 18px;
  }

  .stat-item:not(:last-child)::after {
    right: -9px;
  }

  .stat-value { font-size: 1.05rem; }
  .stat-label { font-size: 0.58rem; }

  /* Mobile perf: no backdrop blur */
  .detail-overlay {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(5, 8, 16, 0.88);
  }

  .detail-modal {
    width: 92vw;
    max-height: 85vh;
    border-radius: 14px;
  }

  .detail-body {
    padding: 28px 20px 24px;
  }

  .detail-title {
    font-size: 1.15rem;
  }
}

/* === RETURN GLOBAL BUTTON === */
.return-global-btn {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(10, 20, 40, 0.6);
  border: 1px solid rgba(0, 242, 254, 0.4);
  color: #00F2FE;
  padding: 10px 24px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 15px rgba(0, 242, 254, 0.15);
  z-index: 100;
}

.return-global-btn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.return-global-btn:hover {
  background: rgba(0, 242, 254, 0.15);
  border-color: rgba(0, 242, 254, 0.7);
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.4);
}

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .detail-modal {
    transition: none;
  }
}
