/* ===== 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;
  min-height: 100vh;
}
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: 16px;
  font-weight: 700;
  color: var(--accent);
}
.nav-logo-domain {
  font-size: 11px;
  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: 14px;
  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: 14px;
  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;
}

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

/* 移动端抽屉菜单 */
.nav-drawer {
  display: none;
  position: fixed;
  top: var(--nav-h); left: 0; right: 0;
  background: var(--nav-bg);
  border-bottom: 1px solid #1e3048;
  padding: 12px 16px;
  z-index: 99;
  flex-direction: column;
  gap: 4px;
}
.nav-drawer.open { display: flex; }
.nav-drawer a {
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 15px;
  color: var(--text-muted);
  transition: background .2s;
}
.nav-drawer a:hover { background: #1e3a55; color: var(--text); }

/* ===== PAGE LAYOUT ===== */
.page-body {
  margin-top: var(--nav-h);
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 12px;
  max-width: 1600px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== LEFT SIDEBAR：小游戏列表 ===== */
.sidebar-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebar-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--card-bg);
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.08);
  transition: transform .2s, box-shadow .2s;
}
.sidebar-card:hover { transform: scale(1.06); box-shadow: 0 6px 22px rgba(0,0,0,.55); }
.sidebar-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.sidebar-card .card-title {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 22px 6px 5px;
  background: linear-gradient(transparent, rgba(0,0,0,.88));
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  line-height: 1.3;
  z-index: 1;
}

/* 角标 */
.badge {
  position: absolute;
  top: 5px; left: 5px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  z-index: 2;
}
.badge-new      { background: #22c55e; color: #fff; }
.badge-hot      { background: #ef4444; color: #fff; }
.badge-trending { background: #f59e0b; color: #fff; }

/* ===== CENTER：主游戏区 ===== */
.main-game {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
}

/* 游戏 iframe 容器 */
.game-frame-wrap {
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16/9;
  position: relative;
}
.game-frame-wrap iframe {
  width: 100%; height: 100%;
  border: none;
  display: block;
}

/* 游戏封面（未开始时显示） */
.game-cover {
  position: absolute;
  inset: 0;
  cursor: pointer;
}
.cover-bg {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #0a1e30, #152a40);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.cover-name {
  font-size: clamp(20px, 3vw, 36px);
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 2px 12px rgba(0,0,0,.8);
  pointer-events: none;
}
.play-btn {
  position: absolute;
  width: 64px; height: 64px;
  background: rgba(0,0,0,.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, transform .2s;
}
.play-btn:hover { background: var(--accent); transform: scale(1.1); }
.play-btn svg { fill: #fff; margin-left: 4px; }

/* 游戏标题栏 */
.game-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 8px 14px;
}
.game-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.game-bar-icon {
  width: 36px; height: 36px;
  border-radius: 6px;
  flex-shrink: 0;
}
.game-bar-name { font-weight: 600; font-size: 15px; }
.game-bar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.icon-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .2s, background .2s;
}
.icon-btn:hover { color: var(--text); background: #1e3a55; }
.like-count { font-size: 13px; color: var(--text-muted); }

/* ===== RIGHT：大小混合 Grid ===== */
.sidebar-right {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  align-content: start;
}

/* 更多游戏区 */
.more-games { margin-top: 4px; }
.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.more-games-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

/* 普通卡片：1×1 */
.game-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--card-bg);
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.08);
  transition: transform .2s, box-shadow .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;
}
.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: 11px;
  font-weight: 600;
  text-align: center;
  z-index: 1;
}

/* 大卡片：横跨2列，高度×2 */
.game-card.span-2 {
  grid-column: span 2;
  grid-row: span 2;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .page-body {
    grid-template-columns: 120px 1fr 240px;
  }
}
@media (max-width: 768px) {
  .nav-menu  { display: none; }
  .nav-search { display: none; }
  .nav-burger { display: flex; }

  .page-body {
    grid-template-columns: 1fr;
    padding: 8px;
  }
  .sidebar-left {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .sidebar-left .sidebar-card {
    min-width: 90px;
    flex-shrink: 0;
  }
  .sidebar-right {
    grid-auto-rows: 100px;
  }
  /* 移动端所有卡片统一为小卡片 */
  .game-card.span-2 {
    grid-column: span 1;
    grid-row: span 1;
  }
  .more-games-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .sidebar-right {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ===== ARTICLE ===== */
.bj-article {
  max-width: 1400px;
  margin: 40px auto 0;
  padding: 0 48px 56px;
}
.bj-h1 {
  font-size: clamp(1.6em, 2.8vw, 2.2em);
  font-weight: 800;
  color: var(--text);
  margin: 0 0 28px;
  line-height: 1.3;
}
.bj-h2 {
  font-size: 1.45em;
  font-weight: 700;
  color: var(--accent);
  margin: 40px 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.bj-h3 {
  font-size: 1.1em;
  font-weight: 700;
  color: var(--text);
  margin: 24px 0 12px;
}
.bj-article p {
  font-size: 16px;
  line-height: 1.85;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* TOC */
.bj-toc {
  background: var(--card-bg);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 18px 24px;
  margin-bottom: 32px;
}
.bj-toc-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--accent);
  margin-bottom: 10px;
}
.bj-toc ol {
  padding-left: 18px;
  margin: 0;
}
.bj-toc li {
  font-size: 15px;
  line-height: 2.1;
  color: var(--text-muted);
}
.bj-toc a {
  color: var(--text-muted);
  transition: color .15s;
}
.bj-toc a:hover { color: var(--accent); }
.bj-toc ol ol { margin-top: 0; }

/* Lists */
.bj-list {
  padding-left: 0;
  list-style: none;
  margin-bottom: 12px;
}
.bj-list li {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-muted);
  padding-left: 22px;
  position: relative;
  margin-bottom: 8px;
}
.bj-list li::before {
  content: '';
  position: absolute;
  left: 0; top: 9px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.bj-list-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 24px;
}

/* Table */
.bj-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  margin: 14px 0 18px;
}
.bj-table th {
  text-align: left;
  padding: 11px 14px;
  background: rgba(255,255,255,0.05);
  color: var(--text);
  font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.bj-table td {
  padding: 11px 14px;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.bj-table tr:last-child td { border-bottom: none; }

/* Tip box */
.bj-tip {
  background: rgba(59,232,176,0.08);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 14px 18px;
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-muted);
  margin: 16px 0;
}
.bj-tip b { color: var(--accent); }

/* FAQ */
.bj-faq { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.bj-faq-item {
  background: var(--card-bg);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.bj-faq-q {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.bj-faq-item p {
  font-size: 15px;
  margin-bottom: 0;
}

/* Screenshot */
.bj-screenshot {
  margin: 24px auto;
  max-width: 400px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
}
.bj-screenshot img {
  width: 100%;
  max-height: 600px;
  object-fit: cover;
  display: block;
}
.bj-screenshot figcaption {
  background: var(--card-bg);
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
}

/* YouTube embed */
.bj-yt {
  position: relative;
  width: 100%;
  max-width: 360px;
  aspect-ratio: 9/16;
  margin: 16px auto 24px;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  background: #000;
}
.bj-yt-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}
.bj-yt-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.35);
  transition: background .2s;
}
.bj-yt-play::after {
  content: '';
  width: 64px; height: 64px;
  border-radius: 50%;
  background: rgba(255,0,0,.85);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 36px;
  box-shadow: 0 4px 18px rgba(0,0,0,.5);
  transition: transform .2s;
}
.bj-yt:hover .bj-yt-play { background: rgba(0,0,0,.5); }
.bj-yt:hover .bj-yt-play::after { transform: scale(1.1); }
.bj-cta {
  background: linear-gradient(135deg, #0e2a3a, #0a1e2e);
  border: 1px solid rgba(59,232,176,0.2);
  border-radius: var(--radius);
  padding: 36px 24px;
  text-align: center;
  margin-top: 36px;
}
.bj-cta h2 {
  font-size: 1.4em;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
}
.bj-cta p {
  color: var(--text-muted);
  margin-bottom: 20px;
}
.bj-cta a {
  display: inline-block;
  background: var(--accent);
  color: #0f1923;
  font-weight: 700;
  font-size: 15px;
  padding: 12px 32px;
  border-radius: 24px;
  transition: opacity .2s, transform .2s;
}
.bj-cta a:hover { opacity: .88; transform: scale(1.03); }

/* ===== 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: 13px;
  line-height: 1.7;
  color: var(--text-muted);
}
.footer-col-title {
  font-size: 11px;
  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: 13px;
  color: #6a8aa8;
  transition: color .15s;
}
.footer-col a:hover { color: var(--text); }
.footer-copy {
  text-align: center;
  font-size: 12px;
  color: #4a6070;
  padding-top: 20px;
  border-top: 1px solid #1e3048;
  max-width: 1100px;
  margin: 0 auto 8px;
}
.footer-disclaimer {
  text-align: center;
  font-size: 11px;
  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: 13px;
  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) {
  .bj-list-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .bj-article { padding: 0 12px 40px; }
  .footer-inner { grid-template-columns: 1fr; gap: 20px; }
  #backToTop { right: 16px; bottom: 24px; }
}
