/* games-portal · 设计令牌与布局
   方向：ui-ux-pro-max --design-system「gaming portal dark immersive」
   深空藏蓝底 + 霓虹紫主色 + 玫红 CTA；Chakra Petch 展示字 + 系统中文栈 */

:root {
  --bg: #0f0f23;
  --fg: #e2e8f0;
  --card: #1e1c35;
  --muted: #27273b;
  --muted-fg: #94a3b8;
  --primary: #7c3aed;
  --primary-2: #a78bfa;
  --cta: #e11d48;
  --cta-hover: #f43f5e;
  --border: rgba(167, 139, 250, 0.22);
  --ring: #a78bfa;
  --radius: 18px;
  --font-display: 'Chakra Petch', 'PingFang SC', 'HarmonyOS Sans SC', 'MiSans', 'Microsoft YaHei', system-ui, sans-serif;
  --font-body: system-ui, -apple-system, 'PingFang SC', 'HarmonyOS Sans SC', 'MiSans', 'Microsoft YaHei', sans-serif;
  --shadow-card: 0 1px 2px rgba(3, 6, 14, 0.4), 0 10px 30px rgba(3, 6, 14, 0.35);
  --ease-back: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}

::selection { background: rgba(124, 58, 237, 0.55); }

a { color: inherit; }

button { font-family: inherit; }

:is(a, button):focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: 6px;
}

svg { display: block; }

/* ---------- 顶栏 ---------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(20px, 5vw, 48px);
  background: rgba(15, 15, 35, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(167, 139, 250, 0.12);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--cta));
  color: #fff;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.4);
}

.brand b {
  font-family: var(--font-display);
  font-size: 19px;
  letter-spacing: 2.5px;
  line-height: 1.1;
  display: block;
}

.brand small {
  color: var(--muted-fg);
  font-size: 11.5px;
  letter-spacing: 1px;
}

.head-tag {
  color: var(--muted-fg);
  font-size: 12.5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
}

/* ---------- Hero 轮播 ---------- */

.hero {
  position: relative;
  height: clamp(430px, 58vh, 660px);
  overflow: hidden;
  background: var(--muted);
  outline-offset: -2px;
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.55s ease, visibility 0s linear 0.55s;
}

.slide.is-active {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
  z-index: 1;
}

.slide-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: 60% 40%;
}

.slide.is-active .slide-bg { animation: kenburns 8s ease-out both; }

@keyframes kenburns {
  from { transform: scale(1.09); }
  to { transform: scale(1); }
}

.slide-grad {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(15, 15, 35, 0.55) 0%, rgba(15, 15, 35, 0) 26%),
    linear-gradient(76deg, rgba(15, 15, 35, 0.92) 0%, rgba(15, 15, 35, 0.55) 42%, rgba(15, 15, 35, 0.05) 75%),
    linear-gradient(0deg, var(--bg) 0%, rgba(15, 15, 35, 0) 34%);
}

.slide-inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 34px);
  padding: clamp(20px, 5vw, 48px);
  max-width: 1280px;
  margin: 0 auto;
}

.slide.is-active .slide-txt > * {
  animation: rise 0.55s var(--ease-back) both;
}

.slide.is-active .slide-txt > *:nth-child(2) { animation-delay: 0.08s; }
.slide.is-active .slide-txt > *:nth-child(3) { animation-delay: 0.16s; }
.slide.is-active .slide-txt > *:nth-child(4) { animation-delay: 0.24s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.slide-icon {
  width: clamp(64px, 8vw, 92px);
  height: clamp(64px, 8vw, 92px);
  border-radius: 20px;
  flex-shrink: 0;
  background: var(--card);
  box-shadow: 0 10px 34px rgba(3, 6, 14, 0.55), 0 0 0 1px var(--border);
  align-self: flex-start;
  margin-top: clamp(4px, 1vh, 12px);
}

.slide-txt { min-width: 0; }

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.badge {
  font-size: 12px;
  letter-spacing: 0.6px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--primary-2);
  background: rgba(30, 28, 53, 0.6);
  backdrop-filter: blur(4px);
}

.badge-hot {
  background: linear-gradient(90deg, var(--primary), var(--cta));
  border: none;
  color: #fff;
  font-weight: 600;
}

.slide-txt h2 {
  font-family: var(--font-display);
  font-size: clamp(26px, 4.6vw, 46px);
  line-height: 1.12;
  margin: 0 0 10px;
  text-shadow: 0 2px 24px rgba(3, 6, 14, 0.65);
}

.slide-txt p {
  margin: 0 0 22px;
  max-width: 560px;
  color: #cdd5ea;
  font-size: clamp(14px, 1.6vw, 16.5px);
  text-shadow: 0 1px 12px rgba(3, 6, 14, 0.6);
}

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

.btn-cta,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 15.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s var(--ease-back), background 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.btn-cta {
  border: none;
  background: var(--cta);
  color: #fff;
  box-shadow: 0 8px 26px rgba(225, 29, 72, 0.42);
}

.btn-cta:hover { background: var(--cta-hover); transform: translateY(-2px); }

.btn-ghost {
  border: 1px solid rgba(226, 232, 240, 0.4);
  background: rgba(15, 15, 35, 0.38);
  color: var(--fg);
  backdrop-filter: blur(6px);
}

.btn-ghost:hover { border-color: var(--primary-2); color: #fff; transform: translateY(-2px); }

.btn-cta:active, .btn-ghost:active { transform: translateY(0) scale(0.97); }

/* 轮播控件 */

.hero-arrow {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  z-index: 5;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(15, 15, 35, 0.55);
  color: var(--fg);
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background 0.2s, transform 0.18s var(--ease-back);
}

.hero-arrow:hover { background: rgba(124, 58, 237, 0.5); transform: translateY(-50%) scale(1.06); }
.hero-arrow.prev { left: clamp(12px, 2.4vw, 30px); }
.hero-arrow.next { right: clamp(12px, 2.4vw, 30px); }

.hero-foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 5vw, 48px);
}

.dots { display: flex; gap: 9px; }

.dot {
  width: 30px;
  height: 7px;
  border-radius: 999px;
  border: none;
  padding: 0;
  cursor: pointer;
  background: rgba(226, 232, 240, 0.28);
  transition: background 0.25s, transform 0.2s;
}

.dot:hover { background: rgba(226, 232, 240, 0.55); }
.dot.is-on { background: linear-gradient(90deg, var(--primary-2), var(--cta)); transform: scaleY(1.25); }

.pp {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(15, 15, 35, 0.55);
  color: var(--fg);
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background 0.2s;
}

.pp:hover { background: rgba(124, 58, 237, 0.5); }

/* ---------- 游戏网格 ---------- */

.all {
  width: min(1200px, 100% - 2 * clamp(20px, 5vw, 48px));
  margin: 0 auto;
  padding: clamp(34px, 5vh, 58px) 0 20px;
}

.sec-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
}

.sec-head h2 {
  font-family: var(--font-display);
  font-size: 21px;
  letter-spacing: 1px;
  margin: 0;
}

.sec-head .count { color: var(--muted-fg); font-size: 13px; }

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.gcard {
  background: var(--card);
  border: 1px solid rgba(167, 139, 250, 0.1);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  opacity: 0;
  transform: translateY(16px) scale(0.985);
  transition: opacity 0.45s ease, transform 0.45s var(--ease-back), box-shadow 0.25s;
}

.gcard.in {
  opacity: 1;
  transform: none;
}

.gcard:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 44px rgba(124, 58, 237, 0.22), var(--shadow-card);
}

.cover {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: none;
  background: var(--muted);
  cursor: pointer;
}

.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.gcard:hover .cover img { transform: scale(1.045); }

.play-badge {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(15, 15, 35, 0.36);
  opacity: 0;
  transition: opacity 0.22s;
}

.play-badge span {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(225, 29, 72, 0.92);
  color: #fff;
  box-shadow: 0 8px 28px rgba(225, 29, 72, 0.5);
  transform: scale(0.82);
  transition: transform 0.22s var(--ease-back);
}

.cover:hover .play-badge, .cover:focus-visible .play-badge { opacity: 1; }
.cover:hover .play-badge span, .cover:focus-visible .play-badge span { transform: scale(1); }

.gmeta {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 16px;
}

.gmeta img {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  flex-shrink: 0;
  background: var(--muted);
}

.gtxt { flex: 1; min-width: 0; }

.gtxt h3 {
  margin: 0 0 3px;
  font-size: 15.5px;
  font-family: var(--font-display);
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gtxt p {
  margin: 0;
  color: var(--muted-fg);
  font-size: 12.8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.btn-mini {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--primary-2);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.btn-mini:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- 预览弹窗 ---------- */

.modal { position: fixed; inset: 0; z-index: 60; }

.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 14, 0.72);
  backdrop-filter: blur(4px);
}

.modal-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  width: min(1120px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 30px 90px rgba(3, 6, 14, 0.7);
  overflow: hidden;
  animation: pop 0.28s var(--ease-back);
}

@keyframes pop {
  from { opacity: 0; transform: scale(0.94) translateY(10px); }
  to { opacity: 1; transform: none; }
}

.modal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(167, 139, 250, 0.14);
}

.modal-bar h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 15.5px;
  letter-spacing: 0.4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-actions { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.2s;
}

.icon-btn:hover { background: rgba(124, 58, 237, 0.35); }

.modal-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #08080f;
}

.modal-stage iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.pv-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted-fg);
  font-size: 14px;
  letter-spacing: 2px;
}

.modal-stage.loaded .pv-loading { display: none; }

.pv-tip {
  margin: 0;
  padding: 9px 16px;
  color: var(--muted-fg);
  font-size: 12px;
  border-top: 1px solid rgba(167, 139, 250, 0.14);
}

/* ---------- 页脚 ---------- */

footer {
  margin-top: auto;
  padding: 26px clamp(20px, 5vw, 48px) 30px;
  color: #6b7494;
  font-size: 12.5px;
  border-top: 1px solid rgba(167, 139, 250, 0.08);
}

/* ---------- 响应式 ---------- */

@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .hero { height: min(78vh, 620px); }
  .hero-arrow { display: none; }
  .slide-grad {
    background:
      linear-gradient(180deg, rgba(15, 15, 35, 0.4) 0%, rgba(15, 15, 35, 0) 22%),
      linear-gradient(0deg, var(--bg) 2%, rgba(15, 15, 35, 0.25) 46%, rgba(15, 15, 35, 0) 72%);
  }
  .slide-inner {
    align-items: flex-end;
    padding-bottom: 64px;
  }
  .slide-icon { width: 58px; height: 58px; border-radius: 16px; }
  .grid { grid-template-columns: 1fr; }
  .head-tag { display: none; }
}

/* ---------- 动效降级 ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .slide.is-active .slide-bg { animation: none; }
  .slide.is-active .slide-txt > * { animation: none; }
  .slide, .gcard, .btn-cta, .btn-ghost, .cover img, .modal-panel { transition: none !important; }
  .gcard { opacity: 1; transform: none; }
  .modal-panel { animation: none; }
}
