:root {
  --bg-deep: #070b19;
  --bg-surface: rgba(15, 23, 42, 0.78);
  --bg-card: rgba(30, 41, 59, 0.66);
  --border-subtle: rgba(148, 163, 184, 0.18);
  --border-glow: rgba(56, 189, 248, 0.48);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --brand-cyan: #38bdf8;
  --brand-indigo: #6366f1;
  --brand-amber: #f59e0b;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  background-color: var(--bg-deep);
  background-image:
    radial-gradient(circle at 12% 15%, rgba(56, 189, 248, 0.16) 0%, transparent 38%),
    radial-gradient(circle at 88% 20%, rgba(168, 85, 247, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 50% 90%, rgba(16, 185, 129, 0.11) 0%, transparent 45%);
  color: var(--text-main);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  line-height: 1.5;
}

.portal-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

/* 顶部导航栏 */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  background: var(--bg-surface);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  margin-bottom: 28px;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: linear-gradient(135deg, #38bdf8 0%, #6366f1 100%);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 18px;
  color: #fff;
  box-shadow: 0 8px 22px rgba(56, 189, 248, 0.35);
}

.brand-text h1 {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.brand-text p {
  font-size: 12px;
  color: var(--text-muted);
}

.topbar-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.stat-chip {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  color: #cbd5e1;
}

.stat-chip strong {
  color: #38bdf8;
  margin-left: 4px;
}

/* 英雄横幅区 */
.hero-banner {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  padding: 34px 32px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.88) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(99, 102, 241, 0.32);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
  margin-bottom: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.hero-copy {
  max-width: 720px;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #7dd3fc;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 12px;
}

.hero-copy h2 {
  font-size: clamp(24px, 3.4vw, 36px);
  font-weight: 900;
  line-height: 1.22;
  margin-bottom: 10px;
  background: linear-gradient(90deg, #ffffff 0%, #bae6fd 55%, #c4b5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-copy p {
  color: #cbd5e1;
  font-size: 14px;
  max-width: 640px;
}

.hero-quick-btn {
  flex-shrink: 0;
  appearance: none;
  border: none;
  cursor: pointer;
  padding: 15px 26px;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  box-shadow: 0 12px 28px rgba(99, 102, 241, 0.42);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.hero-quick-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(99, 102, 241, 0.55);
}

/* 筛选与搜索栏 */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.category-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cat-tab {
  appearance: none;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.72);
  color: #cbd5e1;
  padding: 8px 15px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}

.cat-tab:hover {
  border-color: rgba(56, 189, 248, 0.5);
  color: #fff;
}

.cat-tab.active {
  background: linear-gradient(135deg, #0284c7 0%, #4f46e5 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 18px rgba(56, 189, 248, 0.3);
}

.search-input {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-subtle);
  color: #fff;
  padding: 9px 15px;
  border-radius: 12px;
  font-size: 13px;
  min-width: 230px;
  outline: none;
}

.search-input:focus {
  border-color: var(--brand-cyan);
}

/* 游戏卡片矩阵 */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.game-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: 22px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-glow);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.45);
}

.card-cover {
  padding: 20px 20px 18px;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.card-icon-box {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.26);
  display: grid;
  place-items: center;
  font-size: 30px;
  flex-shrink: 0;
}

.card-cover-meta {
  flex: 1;
}

.manual-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(0, 0, 0, 0.32);
  padding: 3px 9px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.card-title {
  font-size: 19px;
  font-weight: 900;
  color: #ffffff;
  line-height: 1.25;
}

.card-subtitle {
  font-size: 12px;
  color: rgba(248, 250, 252, 0.85);
  margin-top: 3px;
}

.card-body {
  padding: 16px 20px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-badge {
  font-size: 11px;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.22);
  padding: 3px 9px;
  border-radius: 8px;
}

.benchmark-box {
  background: rgba(15, 23, 42, 0.58);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12px;
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.benchmark-box strong {
  color: #e2e8f0;
}

.record-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #38bdf8;
  font-weight: 700;
}

.card-actions {
  display: flex;
  gap: 10px;
}

.btn-stage-play,
.btn-full-open {
  appearance: none;
  border: none;
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.btn-stage-play {
  flex: 1.5;
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.32);
}

.btn-full-open {
  flex: 1;
  background: rgba(51, 65, 85, 0.65);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.btn-stage-play:hover,
.btn-full-open:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

/* 内嵌竖屏手机试玩抽屉模态框 */
.stage-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(2, 6, 23, 0.86);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.stage-overlay.open {
  display: flex;
}

.stage-dialog {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: 920px;
}

.phone-bezel {
  width: 404px;
  height: min(868px, 92vh);
  background: #0f172a;
  border-radius: 42px;
  border: 7px solid #334155;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.75);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.phone-bezel iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #090d16;
}

.stage-sidepanel {
  width: 290px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid var(--border-subtle);
  border-radius: 22px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stage-sidepanel h3 {
  font-size: 20px;
  font-weight: 800;
}

.stage-sidepanel p {
  font-size: 13px;
  color: var(--text-muted);
}

.stage-btn-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.portal-footer {
  margin-top: 48px;
  text-align: center;
  font-size: 12px;
  color: #64748b;
}

@media (max-width: 820px) {
  .hero-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 24px 20px;
  }
  .stage-sidepanel {
    display: none;
  }
  .stage-overlay {
    padding: 0;
  }
  .phone-bezel {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
    border: none;
  }
  .games-grid {
    grid-template-columns: 1fr;
  }
}
