:root {
  --bg: #0f1222;
  --bg-panel: #1a1e33;
  --bg-card: #222741;
  --text: #e8eaf2;
  --text-dim: #9aa0b8;
  --accent: #6c8cff;
  --accent-hover: #89a3ff;
  --danger: #ff6c6c;
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-header {
  background: var(--bg-panel);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.user-area { display: flex; align-items: center; gap: 12px; }
.user-area .user-name { color: var(--text-dim); font-size: 14px; }
.user-area img { width: 34px; height: 34px; border-radius: 50%; }

.btn {
  display: inline-block;
  padding: 8px 18px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.btn:hover { background: var(--accent-hover); }
.btn-outline {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}
.btn-outline:hover { background: rgba(108, 140, 255, 0.12); }

.page-title { margin: 28px 0 20px; font-size: 26px; }

.error-banner {
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(255, 108, 108, 0.12);
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  color: var(--danger);
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
  padding-bottom: 40px;
}

.game-card {
  display: block;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s, box-shadow 0.15s;
}
.game-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); }
.game-card .icon { font-size: 40px; margin-bottom: 12px; }
.game-card h3 { font-size: 18px; margin-bottom: 8px; }
.game-card p { color: var(--text-dim); font-size: 14px; line-height: 1.5; }
.game-card .version { margin-top: 10px; font-size: 12px; color: var(--text-dim); }

.loading, .empty { color: var(--text-dim); padding: 20px 0; }

/* 游玩页 */
.play-page .play-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  align-items: start;
}
@media (max-width: 860px) {
  .play-page .play-layout { grid-template-columns: 1fr; }
}

.iframe-wrap {
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
}
#iframe-wrap iframe, #game-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.panel {
  background: var(--bg-panel);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 16px;
}
.panel h2 { font-size: 16px; margin-bottom: 12px; color: var(--text-dim); }

.leaderboard { list-style: none; }
.leaderboard li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  font-size: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.leaderboard li:last-child { border-bottom: none; }
.leaderboard .rank { width: 24px; color: var(--text-dim); text-align: center; }
.leaderboard .rank.top { color: #ffd76c; font-weight: 700; }
.leaderboard img { width: 26px; height: 26px; border-radius: 50%; }
.leaderboard .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard .best { font-variant-numeric: tabular-nums; }

.my-best { font-size: 22px; font-weight: 700; margin-bottom: 10px; }
.my-history { list-style: none; font-size: 13px; color: var(--text-dim); }
.my-history li {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.site-footer {
  margin-top: auto;
  padding: 20px 0;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
