* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  background: #111;
  color: #fff;
  font-family: Arial, sans-serif;
}
.header {
  padding: 20px;
  text-align: center;
  background: #222;
}
.emu-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 15px;
  background: #1a1a1a;
  flex-wrap: wrap;
}
.emu-tabs button {
  padding: 10px 14px;
  background: #333;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}
.emu-tabs button:hover {
  background: #007bff;
}
.game-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  padding: 20px;
  min-height: 200px;
  max-width: 820px;
  margin: 0 auto;
}

/* ========== 游戏卡片 ========== */
.game-card {
  width: 100%;
  background: #222;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s;
  text-align: center;
  padding-bottom: 8px;
}
.game-card:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* 图片容器 */
.game-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  background: #333;
}

/* 无封面时显示 */
.game-card img:empty::before {
  content: "无封面";
  color: #aaa;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

/* 游戏名称（永远显示！） */
.game-name {
  padding: 8px 0 0 0;
  text-align: center;
  font-weight: bold;
  font-size: 14px;
  color: white;
}

/* ========== 模拟器页面 ========== */
#emulator {
  width: 95%;
  max-width: 900px;
  height: 550px;
  margin: 20px auto;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
}

.back-btn {
  position: fixed;
  top: 10px;
  left: 20px;
  width: 90px;
  height: 38px;
  padding: 0;
  background: #007bff;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
/* ====================== 游戏操作提示样式 ====================== */
.game-help-btn {
  position: fixed;
  top: 10px;
  left: 120px;
  width: 90px;
  height: 38px;
  padding: 0;
  background: #007bff;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.game-help-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.help-content {
  background: #222;
  padding: 25px;
  border-radius: 10px;
  color: #fff;
  width: 320px;
}

.help-item {
  display: flex;
  justify-content: space-between;
  margin: 10px 0;
}

.key {
  background: #444;
  padding: 4px 10px;
  border-radius: 4px;
  font-family: monospace;
}

.close-btn {
  width: 100%;
  padding: 10px;
  background: #007bff;
  color: #fff;
  border: none;
  border-radius: 6px;
  margin-top: 15px;
  cursor: pointer;
}

/* ====================== 响应式（行业标准） ====================== */
@media (max-width: 768px) {
  .game-list {
    grid-template-columns: repeat(2, 1fr);
  }
  body { padding:10px; }
  .emu-tabs { gap:6px; }
  #emulator { width:100% !important; height:auto !important; }
  .back-btn, .game-help-btn { padding:8px 12px; font-size:14px; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .game-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1025px) {
  .game-list {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* 分页样式 */
.pagination {
  text-align: center;
  margin: 20px 0;
}
.pagination button {
  padding: 8px 16px;
  background: #111;
  color: #fff;
  border: 2px solid #ffcc00;
  cursor: pointer;
  margin: 0 5px;
}
.pagination button:disabled {
  opacity: 0.5;
}
#pageInfo {
  color: #fff;
  font-size: 16px;
}

/* ======================  footer ====================== */
.footer {
  display: block !important;
  background: #111;
  border-top: 3px solid #ffcc00;
  color: #fff;
  text-align: center;
  padding: 30px 20px;
  margin-top: 50px;
  width: 100%;
  clear: both;
}
.footer-links a {
  color: #ffcc00;
  margin: 0 10px;
}

/* 搜索按钮点击反馈 */
#searchBtn {
  transition: transform 0.1s ease, opacity 0.1s ease;
}
#searchBtn:active {
  transform: scale(0.95);
  opacity: 0.8;
}