/* ============================================
   Game Portal — 赛博朋克游戏门户样式
   ============================================ */

/* ----- CSS 变量 ----- */
:root {
  --color-bg: #0a0a1a;
  --color-bg-alt: #12122a;
  --color-cyan: #00f0ff;
  --color-pink: #ff00aa;
  --color-purple: #8b5cf6;
  --color-purple-dark: #6d28d9;
  --color-text: #e2e8f0;
  --color-text-muted: #94a3b8;
  --color-glass: rgba(255, 255, 255, 0.06);
  --color-glass-border: rgba(255, 255, 255, 0.10);
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --max-width: 1200px;
  --nav-height: 64px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ----- Reset & Base ----- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  opacity: 0;
  animation: fadeIn 0.8s ease forwards;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ----- Canvas 星空粒子背景 ----- */
#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  width: 100%;
  height: 100%;
}

/* ----- 导航栏 ----- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  background: rgba(10, 10, 26, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(0, 240, 255, 0.15);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.05);
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.navbar__logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.5px;
}

.navbar__logo-icon {
  font-size: 1.5rem;
}

.navbar__nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.navbar__link {
  position: relative;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-muted);
  border-radius: 8px;
  transition: color var(--transition), background var(--transition);
}

.navbar__link:hover {
  color: var(--color-cyan);
  background: rgba(0, 240, 255, 0.06);
}

.navbar__link--active {
  color: var(--color-cyan);
}

.navbar__link--active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--color-cyan);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--color-cyan);
}

/* 移动端菜单按钮 */
.navbar__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.navbar__toggle-bar {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.navbar__toggle[aria-expanded="true"] .navbar__toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.navbar__toggle[aria-expanded="true"] .navbar__toggle-bar:nth-child(2) {
  opacity: 0;
}

.navbar__toggle[aria-expanded="true"] .navbar__toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ----- Hero 区域 ----- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-height) + 40px) 0 60px;
  overflow: hidden;
}

/* 科技网格背景 */
.hero__grid-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}

.hero__inner {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 700px;
}

.hero__title {
  margin-bottom: 20px;
}

.hero__title-line--main {
  display: block;
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 800;
  letter-spacing: -2px;
  color: #fff;
  text-shadow:
    0 0 20px rgba(0, 240, 255, 0.5),
    0 0 40px rgba(0, 240, 255, 0.3),
    0 0 80px rgba(0, 240, 255, 0.15);
  animation: glowPulse 3s ease-in-out infinite alternate;
}

@keyframes glowPulse {
  0%   { text-shadow: 0 0 20px rgba(0, 240, 255, 0.4), 0 0 40px rgba(0, 240, 255, 0.2); }
  100% { text-shadow: 0 0 30px rgba(0, 240, 255, 0.6), 0 0 60px rgba(0, 240, 255, 0.4), 0 0 100px rgba(0, 240, 255, 0.2); }
}

.hero__title-line--sub {
  display: block;
  font-size: clamp(1rem, 3vw, 1.5rem);
  font-weight: 600;
  color: var(--color-cyan);
  margin-top: 8px;
  text-shadow: 0 0 12px rgba(0, 240, 255, 0.3);
}

.hero__description {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  margin-bottom: 36px;
  line-height: 1.7;
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 36px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-bg);
  background: var(--color-cyan);
  border-radius: 12px;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
}

.hero__cta:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 40px rgba(0, 240, 255, 0.5);
}

.hero__cta-arrow {
  transition: transform var(--transition);
}

.hero__cta:hover .hero__cta-arrow {
  transform: translateX(4px);
}

/* ----- 游戏区域 ----- */
.games {
  position: relative;
  z-index: 1;
  padding: 80px 0;
}

.games__heading {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 40px;
  text-align: center;
  color: #fff;
}

.games__heading::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  margin: 12px auto 0;
  background: linear-gradient(90deg, var(--color-cyan), var(--color-pink));
  border-radius: 3px;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
}

.games__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

/* ----- 游戏卡片 ----- */
.game-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  display: block;
  isolation: isolate;
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
}

.game-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(0, 240, 255, 0.2);
}

/* 卡片渐变背景 */
.game-card__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.3;
  transition: transform 0.5s ease, filter 0.5s ease, opacity 0.3s ease;
}

.game-card:hover .game-card__bg {
  transform: scale(1.08);
  filter: brightness(1.2);
}

.game-card__bg--soon {
  background: linear-gradient(135deg, #1a1a3e, #0a0a2a);
  border: 1px dashed rgba(255, 255, 255, 0.15);
}

/* 卡片内容 */
.game-card__content {
  position: relative;
  z-index: 1;
  padding: 28px 24px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.game-card__icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  transition: transform var(--transition);
}

.game-card:hover .game-card__icon {
  transform: scale(1.15);
}

.game-card__title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.game-card__desc {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
  flex: 1;
}

.game-card__action {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-cyan);
  padding: 6px 16px;
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 20px;
  transition: background var(--transition), border-color var(--transition);
}

.game-card:hover .game-card__action {
  background: rgba(0, 240, 255, 0.1);
  border-color: var(--color-cyan);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
}

/* 即将上线卡片 */
.game-card--soon {
  cursor: default;
  opacity: 0.7;
}

.game-card--soon:hover {
  transform: none;
  box-shadow: none;
}

/* ----- 页脚 ----- */
.footer {
  position: relative;
  z-index: 1;
  padding: 24px 0;
  background: rgba(10, 10, 26, 0.8);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
}

.footer__copy {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* ----- 响应式 ----- */
@media (max-width: 768px) {
  .navbar__nav {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 4px;
    padding: 16px;
    background: rgba(10, 10, 26, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(0, 240, 255, 0.15);
    transform: translateY(-110%);
    opacity: 0;
    transition: transform 0.35s ease, opacity 0.35s ease;
  }

  .navbar__nav--open {
    transform: translateY(0);
    opacity: 1;
  }

  .navbar__link {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
  }

  .navbar__link--active::after {
    display: none;
  }

  .navbar__toggle {
    display: flex;
  }

  .hero__title-line--sub {
    font-size: 1rem;
  }

  .games__grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
  }

  .game-card__content {
    min-height: 170px;
    padding: 20px 16px;
  }
}

@media (max-width: 480px) {
  .games__grid {
    grid-template-columns: 1fr;
  }
}

/* ----- 滚动条美化 ----- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 240, 255, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 240, 255, 0.4);
}

/* ----- 选中文本颜色 ----- */
::selection {
  background: rgba(0, 240, 255, 0.2);
  color: #fff;
}

/* ----- 右下角联系浮动按钮 ----- */
.contact-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.contact-float__btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--color-cyan), var(--color-purple));
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 240, 255, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-main);
}

.contact-float__btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(0, 240, 255, 0.5);
}

.contact-float__card {
  display: none;
  width: 260px;
  padding: 20px;
  background: rgba(15, 15, 40, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 240, 255, 0.15);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.contact-float__card--show {
  display: block;
  animation: cardSlideIn 0.3s ease;
}

@keyframes cardSlideIn {
  from { opacity: 0; transform: translateY(10px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.contact-float__card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}

.contact-float__card h3 span {
  color: var(--color-cyan);
}

.contact-float__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.contact-float__item:hover {
  background: rgba(0, 240, 255, 0.06);
  color: var(--color-cyan);
}

.contact-float__item .icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.contact-float__divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 6px 0;
}

/* ===== SEO 内容区 ===== */
.seo-content {
  padding: 32px 0 8px;
  text-align: center;
}
.seo-content__text {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.8;
  max-width: 700px;
  margin: 0 auto;
}
.seo-content__text strong {
  color: var(--color-cyan);
}
.seo-content__keywords {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.seo-keyword {
  display: inline-block;
  padding: 4px 14px;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
}
