﻿/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0f1923;
  --nav-bg: #152030;
  --card-bg: #1a2a3a;
  --accent: #3be8b0;
  --text: #e8eaf0;
  --text-muted: #8a9bb0;
  --radius: 12px;
  --nav-h: 60px;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.page-wrap {
  flex: 1;
}
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }

/* ===== NAVBAR ===== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--nav-bg);
  border-bottom: 1px solid #1e3048;
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 16px;
}
.nav-logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-logo img {
  border-radius: 8px;
  flex-shrink: 0;
}
.nav-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  gap: 1px;
}
.nav-logo-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--accent);
}
.nav-logo-domain {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: .3px;
}
.nav-menu {
  display: flex;
  gap: 4px;
  list-style: none;
  flex-shrink: 0;
}
.nav-menu a {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 15px;
  color: var(--text-muted);
  transition: background .2s, color .2s;
  white-space: nowrap;
}
.nav-menu a:hover { background: #1e3a55; color: var(--text); }

/* 搜索框 */
.nav-search {
  flex: 1;
  max-width: 320px;
  margin-left: auto;
  position: relative;
}
.nav-search input {
  width: 100%;
  padding: 7px 36px 7px 14px;
  border-radius: 20px;
  border: 1px solid #2a4060;
  background: #0f1923;
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color .2s;
}
.nav-search input:focus { border-color: var(--accent); }
.nav-search svg {
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: #152030;
  border: 1px solid #2a4060;
  border-radius: 10px;
  overflow: hidden;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
}
.search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background .15s;
  text-decoration: none;
}
.search-result:hover,
.search-result.active {
  background: #1e3048;
}
.search-result img {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}
.search-result-name {
  font-size: 14px;
  color: var(--text);
}
.search-result-name mark {
  background: none;
  color: var(--accent);
  font-weight: 600;
}
.search-no-result {
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text-muted);
}

/* 汉堡菜单按钮 */
.nav-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
  flex-shrink: 0;
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text);
}
.nav-burger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: .3s;
}

/* 移动端抽屉菜单 */
.nav-drawer {
  display: flex;
  position: fixed;
  top: var(--nav-h); left: 0;
  bottom: 0;
  width: 250px;
  background: var(--nav-bg);
  border-right: 1px solid #1e3048;
  padding: 12px 16px;
  z-index: 99;
  flex-direction: column;
  gap: 4px;
  transform: translateX(-100%);
  transition: transform .3s ease-out;
}
.nav-drawer.open { 
  transform: translateX(0);
}
/* 防止菜单打开时页面滚动 */
body.nav-open {
  overflow: hidden;
}
.nav-drawer a {
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 16px;
  color: var(--text-muted);
  transition: background .2s;
}
.nav-drawer a:hover { background: #1e3a55; color: var(--text); }

/* 角标 */
.badge {
  position: absolute;
  top: 8px;
  left: -14px;
  width: 52px;
  padding: 3px 0;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  text-align: center;
  letter-spacing: 0.4px;
  z-index: 3;
  transform: rotate(-45deg);
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.badge-new      { background: #10b981; color: #fff; }
.badge-hot      { background: #dc2626; color: #fff; }
.badge-trending { background: #d97706; color: #fff; }

/* ===== GAME CARD (shared) ===== */
.game-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 218 / 142;
  background: var(--card-bg);
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.08);
  will-change: transform;
  transition: transform .2s;
}
.game-card:hover { transform: scale(1.05); box-shadow: 0 6px 22px rgba(0,0,0,.55); }
.game-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
/* hover video preview */
.card-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}
.game-card:hover .card-preview { opacity: 1; }
.game-card .card-title {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 22px 7px 6px;
  background: linear-gradient(transparent, rgba(0,0,0,.88));
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  z-index: 1;
}

/* ===== FOOTER ===== */
.site-footer {
  background: #0b1520;
  border-top: 1px solid #1e3048;
  padding: 40px 24px 24px;
  margin-top: 0;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto 28px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
}
.footer-brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 12px;
}
.footer-brand p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-muted);
}
.footer-col-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-col a {
  font-size: 14px;
  color: #6a8aa8;
  transition: color .15s;
}
.footer-col a:hover { color: var(--text); }
.footer-copy {
  text-align: center;
  font-size: 13px;
  color: #4a6070;
  padding-top: 20px;
  border-top: 1px solid #1e3048;
  max-width: 1100px;
  margin: 0 auto 8px;
}
.footer-disclaimer {
  text-align: center;
  font-size: 12px;
  color: #3a5060;
  max-width: 1100px;
  margin: 0 auto;
}

/* Share dropdown */
.share-wrap {
  position: relative;
}
.share-panel {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  background: var(--card-bg);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 6px;
  min-width: 160px;
  box-shadow: 0 8px 28px rgba(0,0,0,.5);
  z-index: 200;
  flex-direction: column;
  gap: 2px;
}
.share-panel.open {
  display: flex;
}
.share-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-radius: 7px;
  font-size: 14px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.share-item:hover {
  background: rgba(255,255,255,0.07);
  color: var(--text);
}

/* Back to top */
#backToTop {
  display: none;
  position: fixed;
  right: 28px; bottom: 40px;
  z-index: 999;
  background: var(--accent);
  color: #0f1923;
  border: none;
  border-radius: 50%;
  width: 44px; height: 44px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(59,232,176,0.35);
  transition: opacity .2s, transform .2s;
}
#backToTop:hover { opacity: .85; transform: scale(1.08); }

@media (max-width: 900px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .nav-menu  { display: none; }
  .nav-search { display: none; }
  .nav-burger { display: flex; }
  .footer-inner { grid-template-columns: 1fr; gap: 20px; }
  #backToTop { right: 16px; bottom: 24px; }
}