* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page-bg);
  overflow-x: hidden;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background: var(--page-bg);
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  overflow: hidden;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  color: inherit;
  border: 0;
  cursor: pointer;
}

img,
canvas {
  display: block;
}

.cinematic-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 82% 50%, rgba(34, 106, 255, 0.22), transparent 28%),
    radial-gradient(circle at 54% 42%, rgba(83, 47, 208, 0.12), transparent 34%),
    linear-gradient(120deg, rgba(2, 7, 18, 0.98), rgba(1, 4, 12, 1)),
    #020712;
}

.intro-reveal-canvas {
  position: fixed;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 1;
  will-change: opacity;
  transition:
    opacity 460ms var(--ease-cinematic),
    visibility 460ms var(--ease-cinematic);
}

.intro-reveal-canvas.is-done {
  opacity: 0;
  visibility: hidden;
}

.webgl-fallback .cinematic-canvas {
  background:
    linear-gradient(135deg, rgba(16, 55, 118, 0.7), rgba(30, 18, 72, 0.8)),
    radial-gradient(circle at 78% 48%, rgba(49, 140, 255, 0.24), transparent 34%),
    #020712;
}

.atmosphere-grain,
.scanline-layer {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.atmosphere-grain {
  opacity: 0.07;
  mix-blend-mode: screen;
  background-image:
    repeating-radial-gradient(circle at 28% 32%, rgba(255, 255, 255, 0.11) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(120deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 5px);
  animation: grainDrift 8s steps(8) infinite;
}

.scanline-layer {
  opacity: 0.13;
  background:
    linear-gradient(90deg, transparent 0 16%, rgba(73, 156, 255, 0.04) 16% 16.2%, transparent 16.2% 100%),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.028) 0 1px, transparent 1px 8px);
  mask-image: linear-gradient(180deg, transparent, #000 16%, #000 82%, transparent);
  animation: scanDrift 7.5s linear infinite;
}

.app-shell {
  position: relative;
  z-index: 2;
  min-height: 100vh;
}

.site-nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 80;
  height: var(--nav-height);
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto minmax(150px, 1fr);
  align-items: center;
  padding: 0 7vw;
  color: rgba(245, 250, 255, 0.9);
  background: transparent;
}

.brand-mark {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  height: 44px;
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  font-weight: 700;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.brand-symbol {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.92), rgba(124, 92, 255, 0.92)),
    #0d2a63;
  box-shadow: 0 0 26px rgba(47, 140, 255, 0.48);
}

.brand-mark span:last-child {
  display: inline-flex;
  align-items: center;
  height: 28px;
}

.nav-links {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border: 0;
  border-radius: 18px;
  background: rgba(13, 37, 78, 0.08);
  box-shadow: none;
}

.nav-links button,
.nav-links a {
  min-width: 78px;
  padding: 10px 15px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(225, 241, 255, 0.68);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition:
    color 260ms ease,
    border-color 260ms ease,
    background 260ms ease,
    box-shadow 260ms ease;
}

.nav-links button:hover,
.nav-links a:hover {
  color: #fff;
  border-color: rgba(18, 36, 70, 0.56);
  background: rgba(11, 28, 58, 0.22);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.nav-links button.is-current,
.nav-links a.is-current {
  color: #fff7ec;
  border-color: rgba(255, 159, 47, 0.46);
  background:
    linear-gradient(135deg, rgba(255, 159, 47, 0.42), rgba(255, 119, 58, 0.22)),
    rgba(26, 37, 61, 0.14);
  box-shadow:
    0 12px 34px rgba(255, 159, 47, 0.22),
    inset 0 1px 0 rgba(255, 244, 228, 0.2);
}

.brand-mark {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

a.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.page {
  display: none;
}

.page.is-active {
  display: block;
}

html:not(.is-ready) .app-shell {
  opacity: 0;
  transform: translateY(14px) scale(0.996);
  filter: blur(5px);
}

.app-shell {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
  will-change: opacity, transform, filter;
  transition:
    opacity 820ms var(--ease-cinematic),
    transform 820ms var(--ease-cinematic),
    filter 820ms var(--ease-cinematic);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

@keyframes grainDrift {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-18px, 14px, 0);
  }
}

@keyframes scanDrift {
  0% {
    background-position: 0 0, 0 0;
  }
  100% {
    background-position: 96px 0, 0 80px;
  }
}
