﻿/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #120d0d;
  --nav-bg: rgba(28, 17, 17, 0.94);
  --card-bg: #211616;
  --accent: #c8a56a;
  --accent-ink: #1a110b;
  --accent-rgb: 200, 165, 106;
  --text: #f3ece3;
  --text-muted: #c3b2a4;
  --line: #3a2626;
  --line-soft: rgba(255,255,255,0.08);
  --hover-bg: #342121;
  --footer-link: #d3b789;
  --footer-copy: #8d7662;
  --footer-note: #725d4d;
  --radius: 12px;
  --nav-h: 60px;
}
body {
  background:
    radial-gradient(circle at top, rgba(106, 36, 36, 0.24), transparent 34%),
    radial-gradient(circle at 20% 18%, rgba(193, 143, 71, 0.08), transparent 20%),
    linear-gradient(180deg, #171010 0%, #120d0d 52%, #0d0909 100%);
  color: var(--text);
  font-family: Georgia, "Times New Roman", 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 var(--line);
  backdrop-filter: blur(10px);
  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: var(--hover-bg); 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 var(--line);
  background: rgba(15, 10, 10, 0.82);
  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: var(--nav-bg);
  border: 1px solid var(--line);
  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: var(--line);
}
.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 var(--line);
  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: var(--hover-bg); 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(200,165,106,0.12);
  will-change: transform;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.game-card:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 12px 28px rgba(0,0,0,.45);
  border-color: rgba(200,165,106,0.28);
}
.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: #100b0b;
  border-top: 1px solid var(--line);
  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: var(--footer-link);
  transition: color .15s;
}
.footer-col a:hover { color: var(--text); }
.footer-copy {
  text-align: center;
  font-size: 13px;
  color: var(--footer-copy);
  padding-top: 20px;
  border-top: 1px solid var(--line);
  max-width: 1100px;
  margin: 0 auto 8px;
}
.footer-disclaimer {
  text-align: center;
  font-size: 12px;
  color: var(--footer-note);
  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: var(--accent-ink);
  border: none;
  border-radius: 50%;
  width: 44px; height: 44px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(var(--accent-rgb), 0.22);
  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; }
}
