/* ============================================================
   NestArcade 游戏站样式 v4 —— Q版暖色风
   米白奶油底 + 圆润 Q 版字体 + 柔和彩色渐变
   ============================================================ */

/* 圆润开源字体（本地，OFL 授权，见 assets/fonts/OFL.txt） */
@font-face {
  font-family: "Fredoka";
  src: url("../assets/fonts/Fredoka.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Baloo 2";
  src: url("../assets/fonts/Baloo2.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

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

:root {
  --bg: #fdf6e9;
  --card: #ffffff;
  --card-hi: #fdeed3;
  --card-border: #f0e2c8;
  --text: #3a2e22;
  --text-dim: #8a7a66;
  --accent: #ff8a4c;      /* 暖橙点缀 */
  --accent-2: #ff6b9d;    /* 粉 */
  --accent-3: #ffb84c;
  --accent-4: #a98bff;
  --radius: 18px;
  --font-display: "Fredoka", "Baloo 2", "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif;
  --font-body: "Baloo 2", "Fredoka", "PingFang SC", "Microsoft YaHei", -apple-system, "Segoe UI", sans-serif;
  --shadow-card: 0 3px 12px rgba(180, 130, 60, .10);
  --shadow-card-hi: 0 12px 30px rgba(180, 130, 60, .18);
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* 背景柔和装饰层：云朵 + 圆点 + 波浪（固定、低透明度、不挡内容） */
.bg-decor {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.bg-decor::before {
  content: "";
  position: absolute;
  top: -120px;
  right: -100px;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 184, 76, .22), transparent 65%);
}
.bg-decor::after {
  content: "";
  position: absolute;
  bottom: -140px;
  left: -120px;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 107, 157, .14), transparent 65%);
}
.bg-decor .dots {
  position: absolute;
  top: 30%;
  left: 6%;
  width: 220px;
  height: 220px;
  background-image: radial-gradient(rgba(169, 139, 255, .18) 2.5px, transparent 2.5px);
  background-size: 26px 26px;
  border-radius: 50%;
}
.bg-decor .waves {
  position: absolute;
  bottom: 8%;
  right: 8%;
  width: 300px;
  height: 120px;
  opacity: .35;
}
/* 保证内容在装饰层之上 */
.site-header, .main, .site-footer { position: relative; z-index: 1; }

::selection { background: rgba(108, 124, 255, .25); }

.hidden { display: none !important; }

/* ---------- 顶栏 ---------- */
.site-header {
  background: rgba(255, 251, 240, .9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  font-size: 20px;
  font-weight: 800;
  text-decoration: none;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.brand .logo { font-size: 24px; }

.brand-text {
  font-family: var(--font-display);
  letter-spacing: .5px;
}

.brand .accent { color: var(--accent); }

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.header-nav > a,
.nav-toggle {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 10px;
  transition: color .2s, background .2s;
  -webkit-tap-highlight-color: transparent;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.header-nav > a:hover,
.nav-toggle:hover { color: var(--text); background: var(--card-hi); }

.nav-caret { font-size: 10px; opacity: .7; }

/* Games 下拉菜单 */
.nav-dropdown { position: relative; }

.nav-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 320px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  box-shadow: var(--shadow-card-hi);
  padding: 14px;
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 6px 18px;
  z-index: 120;
}

.nav-dropdown:hover .nav-menu,
.nav-dropdown:focus-within .nav-menu { display: grid; }

.nav-menu-group { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.nav-menu-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-dim);
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: 4px 8px 6px;
}

.nav-menu-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 7px 8px;
  border-radius: 8px;
  transition: background .15s, color .15s;
}

.nav-menu-link i {
  font-style: normal;
  font-size: 11px;
  color: var(--text-dim);
  background: var(--card-hi);
  border-radius: 999px;
  padding: 1px 8px;
}

.nav-menu-link:hover { background: var(--card-hi); color: var(--accent); }
.nav-menu-all { color: var(--accent); }
.nav-menu-empty { padding: 6px 8px; font-size: 13px; color: var(--text-dim); }

/* 汉堡按钮（小屏显示） */
.nav-burger {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text);
  padding: 6px 10px;
  border-radius: 10px;
  line-height: 1;
}
.nav-burger:hover { background: var(--card-hi); }

.header-nav a.nav-active { color: var(--accent); }

/* ---------- 广告位（浅色、不突兀、不占大块） ---------- */
.ad-slot {
  background: var(--card-hi);
  border: 1px dashed #c9cfdf;
  border-radius: 12px;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 12px;
  text-align: center;
  overflow: hidden;
  margin: 14px auto;
  max-width: 1120px;
  padding: 8px;
}

.ad-slot.ad-banner { min-height: 72px; }
.ad-slot.ad-side { min-height: 160px; }

/* ---------- 主容器 ---------- */
.main {
  flex: 1;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 18px 20px 44px;
}

/* ---------- 搜索栏 ---------- */
.search-bar {
  margin: 18px 0 6px;
  position: relative;
}

.search-input {
  width: 100%;
  font-size: 16px;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--card);
  border: 3px solid #2b2118;
  border-radius: 999px;
  padding: 13px 20px 13px 48px;
  outline: none;
  box-shadow: 3px 3px 0 rgba(43, 33, 24, .15);
  transition: border-color .2s, box-shadow .2s, transform .15s;
}

.search-input:hover {
  border-color: #111;
  box-shadow: 4px 4px 0 rgba(43, 33, 24, .22);
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 138, 76, .22), 4px 4px 0 rgba(43, 33, 24, .18);
  transform: translateY(-1px);
}

.search-bar::before {
  content: "🔍";
  position: absolute;
  left: 17px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  opacity: .6;
  pointer-events: none;
}

/* ---------- 区块标题 ---------- */
.sec-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--text);
  text-align: center;
  margin: 26px 0 16px;
}

/* ---------- Q 版大标题 logo（首页顶部 / game 顶部） ---------- */
.site-logo {
  text-align: center;
  padding: 26px 16px 10px;
  margin: 6px auto 4px;
}
.site-logo .logo-emoji {
  font-size: 30px;
  margin: 0 6px;
  display: inline-block;
  vertical-align: middle;
}
.site-logo .logo-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 44px;
  letter-spacing: 1px;
  line-height: 1.1;
  background: linear-gradient(95deg, #ff9a3d 0%, #ff6b9d 55%, #a98bff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
  vertical-align: middle;
  filter: drop-shadow(0 3px 0 rgba(255, 255, 255, .9)) drop-shadow(0 6px 12px rgba(255, 138, 76, .25));
}
.site-logo .logo-tagline {
  margin-top: 8px;
  font-size: 14.5px;
  color: var(--text-dim);
  font-weight: 600;
}
/* game.html 顶部小一号 logo */
.site-logo.logo-sm .logo-title { font-size: 26px; }
.site-logo.logo-sm { padding: 12px 16px 4px; }
.site-logo.logo-sm .logo-emoji { font-size: 20px; }
.site-logo.logo-sm .logo-tagline { font-size: 12.5px; margin-top: 4px; }

/* ---------- 热门游戏横向自动滚动大卡 ---------- */
/* 原生横向滚动容器：触摸/鼠标滑动天然支持，JS 驱动 scrollLeft 自动滚动，
   内容始终在 DOM 中滚动，不会出现 transform 位移导致的消失/重叠 */
.hot-rail {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 6px 2px 14px;
  position: relative;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  touch-action: pan-x pan-y; /* 允许水平与垂直手势：水平滑动控制热门区，垂直滑动滚动页面 */
}
.hot-rail::-webkit-scrollbar { display: none; }
.hot-rail:active { cursor: grabbing; }

/* 一份容器包两份内容，JS 驱动 scrollLeft 无缝循环（回绕点 = 内容总宽/2） */
.hot-track {
  display: flex;
  flex-shrink: 0;
}
.hot-group {
  display: flex;
  gap: 14px;
  padding-right: 14px;
}

.hot-card {
  position: relative;
  flex: 0 0 230px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hot-card .game-cover { border-radius: 16px; }

.hot-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- 封面图区域：1:1 正方形（卡片共用） ---------- */
.game-cover {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, #ffe4b8, #ffd0d8);
  border-radius: 14px;
  overflow: hidden;
}

.cover-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 46px;
}

.game-cover img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- 游戏卡片网格（1:1 封面，卡片缩小到约 170px） ---------- */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 14px;
}

.game-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 10px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-card);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 138, 76, .55);
  box-shadow: var(--shadow-card-hi);
}

.game-card .title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-card .desc {
  font-size: 12.5px;
  color: var(--text-dim);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.game-card .card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.game-card .tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
  color: #c25a1e;
  background: rgba(255, 138, 76, .13);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}

.plat-badge {
  font-size: 11px;
  color: var(--text-dim);
  background: var(--card-hi);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}

/* 🔥→"热门 / Hot" Q 版角标 */
.badge-hot {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .5px;
  background: linear-gradient(94deg, #ffb03d, #ff5f4d);
  color: #fff;
  border-radius: 999px;
  padding: 5px 10px;
  box-shadow: 0 3px 10px rgba(255, 110, 60, .4);
}

/* ---------- 板块（手机端 / Windows端） ---------- */
.platform-section {
  margin-top: 30px;
  border: 2.5px solid #ffe0c2;            /* Q版暖色大框 */
  border-radius: 22px;
  padding: 20px 16px 14px;
  background: linear-gradient(180deg, #fff8ee, #fffdf8);
  box-shadow: 0 8px 22px rgba(255, 140, 60, .10);
}

.platform-head { text-align: center; margin-bottom: 10px; }

.platform-head h2 {
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: 1.5px;
  text-shadow: 0 2px 0 rgba(255, 140, 60, .12);
}

.platform-head .platform-note {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dim);
  margin-top: 5px;
}

/* 板块内分类细分 */
.cat-block { margin: 18px 0 6px; }

.cat-title {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 10px;
}

.cat-title a {
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 2px;
}

.cat-title a:hover { color: var(--accent); }
.cat-arrow { color: var(--accent); font-weight: 700; }

/* 空状态 */
.section-empty,
.search-empty {
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
  padding: 36px 20px;
  background: var(--card);
  border: 1px dashed var(--card-border);
  border-radius: 14px;
  margin: 18px 0;
}

.search-empty .se-title {
  display: block;
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}

/* ---------- 首页底部 SEO 文字块 ---------- */
.seo-text {
  max-width: 860px;
  margin: 40px auto 0;
  color: var(--text-dim);
}

.seo-text h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  margin: 22px 0 10px;
}

.seo-text p {
  font-size: 14px;
  line-height: 1.8;
  margin: 0 0 12px;
}

/* ---------- 游戏详情页 ---------- */
.back-link {
  display: inline-block;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  transition: color .2s;
}
.back-link:hover { color: var(--accent); }

.game-layout { display: flex; gap: 20px; flex-wrap: wrap; }

.game-stage {
  flex: 1 1 640px;
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.game-stage h1 { font-size: 22px; font-weight: 800; margin-bottom: 4px; }

.game-stage .g-desc { color: var(--text-dim); font-size: 13.5px; margin-bottom: 12px; }

.game-frame-wrap {
  position: relative;
  width: 100%;
  background: #0b0e18;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--card-border);
}

.game-frame {
  width: 100%;
  height: 70vh;
  height: 70dvh;   /* 动态视口：iPhone Safari 的 vh 偏大导致 iframe 底部溢出，dvh 始终=当前可视高度 */
  min-height: 420px;
  border: 0;
  display: block;
  background: #0b0e18;
}

.g-tip { margin-top: 10px; font-size: 12.5px; color: var(--text-dim); }

.game-side { flex: 0 0 300px; display: flex; flex-direction: column; gap: 16px; }

.side-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-dim);
  letter-spacing: .6px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.more-games { display: flex; flex-direction: column; gap: 8px; }

.mini-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 10px 12px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: border-color .18s, transform .18s;
}

.mini-card:hover { border-color: var(--accent); transform: translateX(3px); }
.mini-card .icon { font-size: 22px; }
.mini-card .name { font-size: 14px; font-weight: 600; }

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--card-border);
  background: var(--card);
  padding: 18px 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: 12.5px;
}

.footer-links a { color: var(--text-dim); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }
.footer-links { margin-left: 10px; }

/* ---------- 语言切换器 ---------- */
.lang-select {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--card-border);
  border-radius: 9px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: border-color .2s;
}
.lang-select:hover { border-color: var(--accent); }

/* ---------- 分类页 ---------- */
.cat-page-head { margin: 8px 0 18px; }
.cat-page-head h1 { font-size: 26px; font-weight: 900; margin-bottom: 4px; }
.cat-page-head p { color: var(--text-dim); font-size: 14px; }
.cat-notfound {
  text-align: center;
  padding: 48px 20px;
  background: var(--card);
  border: 1px dashed var(--card-border);
  border-radius: 16px;
  color: var(--text-dim);
}
.cat-notfound .nf-back { display: inline-block; margin-top: 14px; color: var(--accent); text-decoration: none; font-weight: 700; }

/* ---------- 法律 / 关于页面 ---------- */
.legal-page { background: var(--bg); }

.legal-main { max-width: 820px; }
.legal-main h1 { font-size: 26px; font-weight: 900; margin: 26px 0 6px; }
.legal-main h2 { font-size: 17px; font-weight: 800; margin: 26px 0 8px; color: var(--text); }
.legal-main p, .legal-main li {
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--text-dim);
  margin: 0 0 10px;
}
.legal-main ul { padding-left: 22px; margin-bottom: 12px; }
.legal-main a { color: var(--accent); }
.legal-main .legal-date { color: var(--text-dim); font-size: 12.5px; margin-bottom: 22px; opacity: .8; }

/* ============================================================
   工具板块（浅色适配，类名沿用）
   ============================================================ */
.hero-tools h1 { color: var(--text); }

.cat-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 22px 0 6px; }

.chip {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-dim);
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 8px 18px;
  cursor: pointer;
  transition: all .18s;
  letter-spacing: .3px;
}
.chip:hover { color: var(--text); border-color: rgba(108, 124, 255, .55); }
.chip.active {
  color: #fff;
  background: linear-gradient(120deg, var(--accent), #8f9bff);
  border-color: transparent;
}

.tool-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; margin-top: 26px; }

.tool-card {
  position: relative;
  overflow: hidden;
  width: calc((100% - 36px) / 3);
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 14px;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 7px;
  box-shadow: var(--shadow-card);
  transition: transform .18s ease, box-shadow .18s ease;
}
.tool-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card-hi); }
.tool-card .icon { font-size: 38px; line-height: 1; }
.tool-card .title { font-size: 16px; font-weight: 800; }
.tool-card .desc { font-size: 12.5px; color: var(--text-dim); flex: 1; }

.dl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  align-self: flex-start;
  font-size: 12.5px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  padding: 7px 16px;
  text-decoration: none;
}
.dl-ico { font-size: 13px; }

.tool-list { display: flex; flex-direction: column; gap: 10px; max-width: 860px; margin: 24px auto 0; }

.tool-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 14px 18px;
  text-decoration: none;
  color: var(--text);
  transition: transform .18s ease, box-shadow .18s ease;
}
.tool-row:hover { transform: translateX(4px); box-shadow: var(--shadow-card); }
.tool-row .icon { font-size: 34px; flex: 0 0 auto; }
.tool-row .body { flex: 1; min-width: 0; }
.tool-row .name { font-size: 16px; font-weight: 800; }
.tool-row .desc {
  font-size: 12.5px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tool-row .arrow { font-size: 18px; color: var(--text-dim); }

.tool-empty {
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
  padding: 48px 20px;
  background: var(--card);
  border: 1px dashed var(--card-border);
  border-radius: 14px;
  max-width: 860px;
  margin: 24px auto 0;
}

.tool-detail {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 34px 28px 28px;
  text-align: center;
  box-shadow: var(--shadow-card);
}
.td-icon { font-size: 84px; line-height: 1; margin-bottom: 12px; }
.td-name { font-size: 32px; font-weight: 900; color: var(--text); margin-bottom: 8px; }
.td-cat {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(108, 124, 255, .10);
  border-radius: 999px;
  padding: 5px 16px;
  margin-bottom: 16px;
}
.td-desc { color: var(--text); font-size: 15px; line-height: 1.8; max-width: 560px; margin: 0 auto 22px; }
.td-btns { display: flex; justify-content: center; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.dl-big { font-size: 15px; padding: 12px 30px; }

.home-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  background: var(--card-hi);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 11px 24px;
  text-decoration: none;
  transition: all .18s;
}
.home-btn:hover { border-color: var(--accent); color: var(--accent); }
.td-safe { font-size: 12px; color: var(--text-dim); }
.tool-notfound { padding: 60px 20px; text-align: center; color: var(--text-dim); font-size: 15px; }

/* ---------- 首页工具介绍区 ---------- */
.tool-intro {
  margin: 34px 0 10px;
  padding: 26px;
  border-radius: 22px;
  background: var(--card);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-card);
}
.tool-intro .ti-title { font-size: 22px; font-weight: 800; color: var(--text); margin-bottom: 12px; }
.tool-intro .ti-title-link { color: var(--text); text-decoration: none; }
.tool-intro .ti-title-link:hover { color: var(--accent); }
.tool-intro .ti-p { font-size: 14.5px; color: var(--text-dim); line-height: 1.75; margin-bottom: 10px; }
.tool-intro .ti-entry {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
  padding: 18px 22px;
  border-radius: 18px;
  text-decoration: none;
  background: linear-gradient(92deg, var(--accent) 0%, #8f9bff 55%, var(--accent-2) 100%);
  transition: transform .2s ease, box-shadow .2s ease;
}
.tool-intro .ti-entry:hover { transform: translateY(-3px); }
.tool-intro .ti-entry-icon { font-size: 38px; flex-shrink: 0; }
.tool-intro .ti-entry-main { flex: 1; min-width: 0; }
.tool-intro .ti-entry-title { display: block; font-size: 20px; font-weight: 800; color: #fff; margin-bottom: 4px; }
.tool-intro .ti-entry-sub { display: block; font-size: 13.5px; color: rgba(255, 255, 255, .88); line-height: 1.5; }
.tool-intro .ti-entry-arrow { font-size: 26px; color: #fff; flex-shrink: 0; font-weight: 800; }

/* ============================================================
   沉浸式游戏页（沿用原结构，浅色适配）
   ============================================================ */
body.pg-game { overflow: hidden; }

body.pg-game .main {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 62px);
  min-height: 0;
  max-width: none;
  margin: 0;
  padding: 10px 12px 12px;
}
@supports (height: 100dvh) {
  body.pg-game .main { height: calc(100dvh - 62px); }
}

body.pg-game .main .back-link { display: none; }
body.pg-game .main .ad-banner { display: none; }

/* 舞台+侧栏：整体 flex 填满剩余高度，frame 自动填充、永不超出视口 */
body.pg-game .game-layout {
  flex: 1;
  min-height: 0;
  align-items: stretch;
}

body.pg-game .game-stage {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
body.pg-game .game-stage h1 { font-size: 15px; margin-bottom: 6px; flex-shrink: 0; }
body.pg-game .game-stage .g-desc { display: block; font-size: 13px; margin: 12px 0 0; flex-shrink: 0; }

body.pg-game .game-frame-wrap {
  width: 100%;
  flex: 1;
  min-height: 0;
  border-radius: 10px;
}

body.pg-game .game-frame { height: 100%; min-height: 0; }
body.pg-game .game-side { flex-basis: 300px; min-height: 0; overflow-y: auto; }
body.pg-game .g-tip { display: none; }
body.pg-game .site-footer { display: none; }

.g-review {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-dim);
  margin: 8px 0 14px;
}
body.pg-game .g-review { display: block; max-width: 860px; margin: 14px auto 10px; padding: 0 4px; flex-shrink: 0; }

/* G6：外站游戏降级提示 */
.g-ext-note {
  max-width: 860px;
  margin: 10px auto 0;
  padding: 10px 14px;
  background: #fff7e0;
  border: 1px solid #f0d9a0;
  border-radius: var(--radius);
  font-size: 13px;
  color: #8a6d3b;
  line-height: 1.6;
  word-break: break-all;
}
.g-ext-note a { color: #6c7cff; text-decoration: underline; }

/* ---------- gift-grabber 手机端专属布局（≤768）：字幕在顶部 logo 下方，游戏格子紧贴字幕下方铺满（不留上下空白） ---------- */
@media (max-width: 768px) {
  body.pg-game.g-gift-grabber { overflow-y: auto; }
  body.pg-game.g-gift-grabber .main { height: auto; min-height: calc(100vh - 62px); min-height: calc(100dvh - 62px); }
  /* 字幕提到最前（logo 下方），随后棋盘紧贴字幕下方、高度匹配格子内容（下方铺满不空） */
  body.pg-game.g-gift-grabber .game-stage .g-desc { order: -2; display: block !important; margin: 2px 0 6px; font-size: 12px; }
  body.pg-game.g-gift-grabber .game-stage .g-review { order: -1; display: block; margin: 0 0 8px; font-size: 12px; line-height: 1.5; }
  body.pg-game.g-gift-grabber .game-frame-wrap { order: 1; margin-top: 0; flex: 0 0 auto; width: 100%; height: auto; }
  body.pg-game.g-gift-grabber .game-frame { height: 470px; min-height: 0; }
}

/* ---------- gift-grabber 电脑端（>768）：原始布局基础上，游戏整体下移 20%，iframe 加高以完整容纳棋盘格子（格子不溢出盖字幕） ---------- */
@media (min-width: 769px) {
  body.pg-game.g-gift-grabber { overflow-y: auto; }
  body.pg-game.g-gift-grabber .main { height: auto; min-height: calc(100vh - 62px); min-height: calc(100dvh - 62px); }
  body.pg-game.g-gift-grabber .game-frame-wrap { margin-top: 20vh; min-height: 720px; }
}

/* ---------- 阿拉伯语 RTL ---------- */
[dir="rtl"] .header-inner,
[dir="rtl"] .game-layout,
[dir="rtl"] .game-side,
[dir="rtl"] .more-games { direction: rtl; }
[dir="rtl"] .game-card,
[dir="rtl"] .mini-card { text-align: right; }
[dir="rtl"] .nav-menu { left: auto; right: 0; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 768px) {
  /* 平板/手机：导航直接横排显示（紧凑），不再默认收进汉堡 */
  .nav-burger { display: none; }

  .header-nav {
    position: static;
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 2px;
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .header-nav::-webkit-scrollbar { display: none; }
  .site-header.nav-open .header-nav { display: flex; }

  .header-nav > a,
  .nav-toggle {
    display: inline-flex;
    justify-content: flex-start;
    width: auto;
    font-size: 12px;
    padding: 3px 5px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .nav-dropdown { width: auto; flex-shrink: 0; }
  .nav-menu { display: none; }
  .lang-select { font-size: 11px; padding: 2px 4px; flex-shrink: 0; max-width: 92px; }

  .header-inner { padding: 8px 10px; }
  .brand { font-size: 12px; }
  .brand .logo { font-size: 15px; }
  .main { padding: 14px 14px 36px; }

  .game-frame { height: 52vh; height: 52dvh; min-height: 320px; }
  /* gift-grabber 手机端：9:16 竖幅布局已在上述专属规则中定义（此处的旧规则已废弃） */
  .game-side { flex-basis: 100%; }
  .ad-slot.ad-side { min-height: 90px; }

  body.pg-game .main { padding: 6px 6px 10px; }
  body.pg-game .game-stage h1 { display: none; }
  body.pg-game .game-stage .g-desc { display: none; }
  body.pg-game .g-review { display: none; }
  body.pg-game .game-side { display: none; }
  /* 高度由桌面 flex 规则接管（flex:1 自动填满，永不裁切底部） */

  .sec-title { font-size: 19px; }
  .platform-head h2 { font-size: 22px; }
  .platform-section { padding: 14px 10px 10px; border-radius: 16px; border-width: 2px; }
  .tool-intro { padding: 20px 16px; }
  .tool-intro .ti-title { font-size: 18px; }
  .tool-intro .ti-entry { padding: 14px 16px; gap: 12px; }
  .tool-intro .ti-entry-icon { font-size: 30px; }
  .tool-intro .ti-entry-title { font-size: 17px; }
}

/* iPad 竖屏（768-1024 宽）：隐藏侧栏让游戏画面最大化，压缩上方空间 */
@media (max-width: 1024px) and (orientation: portrait) {
  /* Safari 地址栏展开时，按最小可视高度分配游戏区域。 */
  body.pg-game {
    height: 100vh;
    min-height: 100vh;
  }
  @supports (height: 100svh) {
    body.pg-game {
      height: 100svh;
      min-height: 100svh;
    }
  }
  body.pg-game .main {
    height: auto;
    flex: 1 1 0;
    min-height: 0;
  }

  body.pg-game .game-side { display: none; }
  body.pg-game .game-stage h1 { font-size: 13px; margin-bottom: 4px; }
  body.pg-game .game-stage .g-desc { font-size: 12.5px; margin: 8px 0 0; }
  body.pg-game .main { padding: 8px 10px 10px; }
}

@media (max-width: 430px) {
  .game-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .hot-card { flex: 0 0 168px; }
  .hot-name { font-size: 13px; }
  .site-logo .logo-title { font-size: 32px; }
  /* G4：收窄导航，避免"中文"被切 */
  .header-inner { padding: 8px 8px; }
  .header-nav > a, .nav-toggle { font-size: 11px; padding: 3px 4px; }
  .lang-select { font-size: 11px; padding: 2px 4px; max-width: 84px; }
  /* G3：游戏页极窄屏吃满宽度 */
  body.pg-game .main { padding: 4px 4px 8px; }
  body.pg-game .game-stage { padding: 0; }
}

@media (max-width: 430px) {
  /* 极窄屏（≤430）：横排放不下，收进汉堡菜单。
     burger 按钮在 .header-nav 内部，因此 nav 默认仍 flex 显示（只露出 burger），
     点击后 nav-open 才把整条菜单下拉为列。 */
  .nav-burger { display: block; }

  .header-nav {
    position: static;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
  }
  /* 默认状态：顶部链接和语言切换常显在 burger 旁；其余菜单项隐藏，点击 burger 展开 */
  .header-nav > a:not([data-i18n="nav_top"]),
  .header-nav > .nav-dropdown { display: none; }
  .header-nav > a[data-i18n="nav_top"] { display: inline-flex; }
  .header-nav > #lang-switch { display: flex; }

  /* 展开状态：整条菜单下拉为列 */
  .site-header.nav-open .header-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card);
    border-bottom: 1px solid var(--card-border);
    box-shadow: var(--shadow-card-hi);
    flex-direction: column;
    align-items: stretch;
    padding: 10px 16px 16px;
    display: flex;
  }
  .site-header.nav-open .header-nav > a,
  .site-header.nav-open .header-nav > .nav-dropdown,
  .site-header.nav-open .header-nav > #lang-switch { display: flex; }

  .header-nav > a,
  .nav-toggle {
    justify-content: space-between;
    width: 100%;
    font-size: 16px;
    padding: 12px 10px;
  }

  /* 覆盖 nav-open 展开时的 flex：dropdown 用 block，避免子项 width:100% 相互挤压导致 nav-menu 坍缩为 0 宽 */
  .site-header.nav-open .header-nav > .nav-dropdown { width: 100%; display: block; }
  .nav-menu {
    display: grid;
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr)); /* 列不溢出，允许收缩 */
    width: 100%;
    min-width: 0;              /* 覆盖桌面 min-width:320，小屏不再溢出右缘 */
    box-shadow: none;
    border: none;
    padding: 4px 0 8px;
  }
  /* 展开时 header-nav 绝对定位不滚动，避免与菜单挤压 */
  .header-nav { overflow: visible; }
  .nav-menu-group { min-width: 0; }
  .nav-menu-link { min-width: 0; }
  /* 默认常显的「顶部」与语言切换：收起状态下按自然宽度排布，不被展开菜单的全宽样式挤爆 */
  .header-nav > a[data-i18n="nav_top"] { width: auto; flex: 0 0 auto; font-size: 12px; padding: 6px 8px; justify-content: center; }
  .header-nav > #lang-switch { flex: 0 0 auto; }
}
