:root {
  /* 明快糖果色系 */
  --bg: #fff7f2;
  --bg-soft: #ffffff;
  --card: #ffffff;
  --border: #ffe4d6;
  --text: #332a4d;
  --text-dim: #877f9e;
  --accent: #ff5f9e;
  --accent-2: #22c1ff;
  --grad: linear-gradient(135deg, #ff5f9e, #ffb246);
  --grad-2: linear-gradient(135deg, #7b5cff, #22c1ff);
  --shadow: 0 8px 22px rgba(126, 87, 194, .12);
  --shadow-hover: 0 18px 40px rgba(255, 95, 158, .28);
  --radius: 22px;
  --container: 1640px;
}

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

/* 允许 2 倍模式的画面溢出裁切，同时不破坏 sticky 导航 */
html { overflow-x: clip; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  min-height: 100vh;
  background:
    radial-gradient(60vw 40vw at 12% -8%, rgba(255, 178, 70, .35), transparent 60%),
    radial-gradient(55vw 38vw at 88% 4%, rgba(34, 193, 255, .32), transparent 60%),
    radial-gradient(50vw 36vw at 50% 42%, rgba(255, 95, 158, .22), transparent 62%),
    linear-gradient(180deg, #fff9f4 0%, #f6f2ff 55%, #eefbff 100%);
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(16px, 2.4vw, 40px);
}

/* ===== 顶部导航 ===== */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, .9);
  box-shadow: 0 4px 18px rgba(126, 87, 194, .08);
}
.navbar .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 21px; font-weight: 800; letter-spacing: .3px;
}
.logo .icon {
  width: 38px; height: 38px; border-radius: 13px;
  background: var(--grad);
  display: grid; place-items: center;
  font-size: 20px;
  box-shadow: 0 6px 16px rgba(255, 95, 158, .4);
  transition: transform .3s;
}
.logo:hover .icon { transform: rotate(-12deg) scale(1.08); }
.logo em {
  font-style: normal; background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nav-links { display: flex; gap: 10px; font-size: 14px; font-weight: 600; color: var(--text-dim); }
.nav-links a {
  padding: 7px 16px; border-radius: 999px; transition: all .2s;
}
.nav-links a:hover {
  color: #fff; background: var(--grad-2);
  box-shadow: 0 6px 16px rgba(123, 92, 255, .35);
}

/* ===== 首页 Hero ===== */
.hero { text-align: center; padding: 66px clamp(16px, 2.4vw, 40px) 40px; }
.hero h1 {
  font-size: clamp(32px, 5.2vw, 54px);
  line-height: 1.25; margin-bottom: 16px; font-weight: 800;
}
.hero h1 span {
  background: linear-gradient(100deg, #ff5f9e, #ffb246 45%, #22c1ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p {
  color: var(--text-dim); font-size: 16.5px; max-width: 580px;
  margin: 0 auto 30px; line-height: 1.75;
}

/* 英文为主、中文为辅 */
.hero-zh { color: var(--text-dim); font-size: 14px; margin: -18px auto 28px; max-width: 580px; }
.zh-sub {
  font-size: .62em; font-weight: 600; color: var(--text-dim);
  margin-left: 6px; opacity: .9;
}
.section-title .zh-sub { font-size: 14px; }

/* 搜索框 */
.search-box {
  max-width: 470px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 2px solid #fff;
  border-radius: 999px; padding: 12px 22px;
  box-shadow: var(--shadow);
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 10px 30px rgba(255, 95, 158, .28);
  transform: translateY(-2px);
}
.search-box svg { flex: none; color: #ff8ab8; opacity: .9; }
.search-box input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-size: 15px;
}
.search-box input::placeholder { color: #b4adc6; }

/* ===== 分类过滤 ===== */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center; margin: 10px 0 34px;
}
.filter-btn {
  border: 2px solid #fff; background: #fff;
  color: var(--text-dim); padding: 8px 20px; border-radius: 999px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 12px rgba(126, 87, 194, .1);
  transition: all .2s;
}
.filter-btn:hover {
  color: var(--accent); transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(255, 95, 158, .22);
}
.filter-btn.active {
  background: var(--grad); border-color: transparent; color: #fff;
  font-weight: 700; box-shadow: 0 8px 20px rgba(255, 95, 158, .4);
}

/* ===== 游戏网格 ===== */
.section-title {
  font-size: 23px; font-weight: 800; margin-bottom: 20px;
  display: flex; align-items: center; gap: 10px;
}
.section-title::before {
  content: ""; width: 16px; height: 16px; border-radius: 6px;
  background: var(--grad); box-shadow: 0 4px 10px rgba(255, 95, 158, .4);
}
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(150px, 13vw, 230px), 1fr));
  gap: clamp(14px, 1.4vw, 22px);
  padding-bottom: 80px;
}
.game-card {
  background: var(--card); border: 2px solid #fff;
  border-radius: var(--radius); overflow: hidden;
  cursor: pointer; display: block;
  box-shadow: var(--shadow);
  transition: transform .25s, box-shadow .25s;
}
.game-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
}
.game-card .cover {
  position: relative; aspect-ratio: 1 / 1; overflow: hidden;
  background: #ffeef6;
}
.game-card .cover img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .35s;
}
.game-card:hover .cover img { transform: scale(1.07); }
.game-card .tag {
  position: absolute; top: 12px; left: 12px;
  padding: 4px 12px; border-radius: 999px; font-size: 12px;
  font-weight: 700; color: #fff;
  background: #7b5cff; box-shadow: 0 4px 10px rgba(0, 0, 0, .18);
}
.game-card .tag[data-tag="Arcade"] { background: linear-gradient(135deg, #ff5f9e, #ff8a5c); }
.game-card .tag[data-tag="Puzzle"] { background: linear-gradient(135deg, #7b5cff, #a55cff); }
.game-card .tag[data-tag="Casual"] { background: linear-gradient(135deg, #2ecf73, #6fe3a8); }
.game-card .tag[data-tag="Board"]  { background: linear-gradient(135deg, #22c1ff, #5ad6ff); }
.game-card .play-hint {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: rgba(51, 42, 77, .35);
  opacity: 0; transition: opacity .25s;
}
.game-card:hover .play-hint { opacity: 1; }
.play-btn-circle {
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--grad); display: grid; place-items: center;
  box-shadow: 0 8px 24px rgba(255, 95, 158, .55);
  animation: pop .5s ease;
}
@keyframes pop { from { transform: scale(.6); } to { transform: scale(1); } }
.game-card .info { padding: 14px 16px 16px; }
.game-card .info h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.game-card .meta {
  display: flex; justify-content: space-between;
  color: var(--text-dim); font-size: 12.5px;
}
.game-card .meta .rating { color: #ff9500; font-weight: 700; }

/* 无 JS 时给爬虫的游戏链接兜底列表 */
.seo-list { list-style: none; padding: 4px 0 60px; }
.seo-list li { padding: 9px 0; border-bottom: 1px dashed var(--border); }
.seo-list a { color: var(--accent); font-weight: 600; }
.seo-list a:hover { text-decoration: underline; }

.empty-tip {
  grid-column: 1 / -1; text-align: center;
  color: var(--text-dim); padding: 60px 0; font-size: 15px;
}

/* ===== 详情页 ===== */
.detail { padding: 26px 0 72px; }
/* 单列：信息条 + 超宽画面（Poki 风格） */
.detail-layout { display: block; }
.detail-side {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 18px; margin-bottom: 14px;
  background: var(--card); border: 2px solid #fff;
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.detail-side img {
  width: 74px; height: 74px; flex: none;
  aspect-ratio: 1 / 1; object-fit: cover; border-radius: 16px;
}
.detail-side .side-body { padding: 0; min-width: 0; }
.detail-side h1 {
  font-size: clamp(18px, 1.7vw, 24px); font-weight: 800; margin-bottom: 8px;
}
.stat-row { display: flex; gap: 14px; color: var(--text-dim); font-size: 13px; flex-wrap: wrap; align-items: center; }
.stat-row .rating { color: #ff9500; font-weight: 700; }
.stat-row .tag {
  background: var(--grad-2); color: #fff; font-weight: 700;
  padding: 3px 12px; border-radius: 999px;
}

/* 画面：彩色“糖果边框”包裹游戏屏 */
.play-area {
  background: linear-gradient(135deg, #ffd9ea, #d9f0ff 55%, #fff3d6);
  border: 3px solid #fff;
  border-radius: 26px; padding: 10px;
  box-shadow: 0 18px 44px rgba(126, 87, 194, .22);
}
.play-area iframe {
  width: 100%; height: clamp(420px, 78vh, 920px);
  border: none; border-radius: 16px; background: #12172a; display: block;
}
.detail-desc {
  margin-top: 22px; background: var(--card);
  border: 2px solid #fff; border-radius: var(--radius);
  padding: 22px 24px; max-width: 880px; box-shadow: var(--shadow);
}
.detail-desc h2 { font-size: 17px; font-weight: 800; margin-bottom: 10px; }
.detail-desc h2::before { content: "🎯 "; }
.detail-desc + .detail-desc h2::before { content: "🕹️ "; }
.detail-desc p { color: var(--text-dim); line-height: 1.85; font-size: 14.5px; }

.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-dim); font-size: 14px; font-weight: 600; margin-bottom: 22px;
  padding: 7px 18px; background: #fff; border-radius: 999px;
  box-shadow: 0 4px 12px rgba(126, 87, 194, .12);
  transition: all .2s;
}
.back-link:hover { color: #fff; background: var(--grad-2); transform: translateX(-3px); }

/* ===== 画面大小控制 ===== */
.view-controls {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 8px; margin-top: 14px; flex-wrap: wrap;
}
.vc-label { font-size: 13px; color: var(--text-dim); margin-right: auto; font-weight: 600; }
.vc-btn {
  border: 2px solid #fff; background: #fff; color: var(--text-dim);
  padding: 7px 18px; border-radius: 999px; font-size: 13px; font-weight: 600;
  cursor: pointer; box-shadow: 0 4px 12px rgba(126, 87, 194, .12);
  transition: all .2s;
}
.vc-btn:hover { color: var(--accent); transform: translateY(-2px); }
.vc-btn.active {
  background: var(--grad); border-color: transparent; color: #fff; font-weight: 700;
  box-shadow: 0 8px 20px rgba(255, 95, 158, .4);
}

/* 2 倍模式：画面跳出容器，铺到接近整个视口宽度，高度也拉满 */
body.mode-2x .play-area {
  width: min(98vw, 2400px);
  position: relative; left: 50%; transform: translateX(-50%);
  padding: 12px;
}
body.mode-2x .play-area iframe {
  width: 100%; height: min(94vh, 1400px); display: block;
}
body.mode-2x .view-controls { justify-content: flex-end; }

/* 全屏模式：对 iframe 本身全屏，游戏内部通过 html:fullscreen 自适应铺满 */
#gameFrame:fullscreen {
  width: 100vw; height: 100vh; border-radius: 0; background: #12172a;
}

/* 详情页“更多游戏” */
.more-games { padding: 0 0 80px; }
.more-games .game-grid { padding-bottom: 0; }

/* ===== 页脚 ===== */
.footer {
  border-top: 2px solid #fff;
  padding: 28px 0; text-align: center;
  color: var(--text-dim); font-size: 13px;
  background: rgba(255, 255, 255, .55);
}
.footer .container::before { content: "🌈 "; }

/* ===== 响应式 ===== */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .hero { padding-top: 44px; }
  .detail { padding-top: 16px; }
  .detail-side { padding: 10px 14px; gap: 12px; }
  .detail-side img { width: 56px; height: 56px; }
  .play-area { padding: 6px; }
  .play-area iframe { height: min(62vh, 560px); }
  .view-controls { justify-content: center; }
  .vc-label { margin-right: 0; }
}
