#GameDiv, #Cocos3dGameContainer, #GameCanvas {
  position: fixed !important; /* 使用 fixed 锁定位置，不随页面高度变化 */
  width: 100vw !important;
  height: 100vh !important;

  top: 0;
  left: 0;
  z-index: 99; /* 盖在 SEO 文字上方 */
}

/* 底层：专门给 Google AdSense 爬虫抓取的文字 */
#static-content-for-adsense {
  background: #f9f7f2;
  position: absolute;
  top: 60px; /* 避开顶部的 Header 视觉区 */
  /* left: 50%; */
  /* transform: translateX(-50%); */
  /* width: 90%; */
  /* max-width: 800px; */
  z-index: 10; /* 放在最底层，用户被 Canvas 挡住看不见 */
  color: #888;
  text-align: left;
  line-height: 1.6;
}

/* 顶层：UI 浮动层容器 */
#game-ui-root {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 101; /* 永远在游戏之上 */
  pointer-events: none; /* 确保点击可以穿透到下方的游戏画布 */
}

/* 允许 UI 内部的可点击元素响应事件 */
.header, .footer, .main-content, .repair-btn, .static-content-for-adsense {
  pointer-events: auto;
}

/* --- 3. Header & Footer 样式 (从 game-ui.js 迁移) --- */

.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  backdrop-filter: blur(5px);
}

.header-inner {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 20px;
}

/* UI 浮层容器 */
.ui-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 101;
  pointer-events: none;   /* 默认不挡游戏 */
}
.ui-overlay * {
  pointer-events: auto;   /* UI 自己能点 */
}

.logo {
  width: 45px;
  height: 45px;
  margin-right: 15px;
}

.nav-links {
  display: flex;
  gap: 20px;
}

.nav-links a {
  text-decoration: none;
  color: #000;
  /* font-size: 16px; */
  font-size: 1.2em;
  /* font-weight: bold; */
  border-left: 1px solid #ccc;
  padding: 0 15px;
}

.englins {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);  /* 垂直居中在 header 内 */
  /* z-index: 101; */
  cursor: pointer;
}

.main-content {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
}

.game-ui {
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.main-content.ui-hidden {
  display: none; 
}

.header-left.ui-hidden {
  display: none; 
}

.game-ui.ui-hidden { 
  display: none; 
}

.footer-left,
.footer-right {
  display: flex;
}

.footer-left.ui-hidden,
.footer-right.ui-hidden {
  display: none;
}

.app-info-container {
  display: flex;
  justify-content: center;
  gap: 50px;
  flex-wrap: wrap;
}

.app-item {
  display: flex;
  align-items: center;
  gap: 15px;
  background: rgba(255, 255, 255, 0.9);
  padding: 15px 25px;
  border-radius: 12px;
  text-decoration: none;
  color: #333;
  transition: transform 0.2s;
}

.app-item:hover { transform: scale(1.05); }

.app-icon { width: 60px; height: auto; }

.app-content { text-align: left; }

.app-name { font-weight: bold; font-size: 18px; }

.stars { color: #f1c40f; margin: 3px 0; }

.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50px;
}

.social-container {
  position: absolute;
  left: 20px;
  bottom: 5px;
  display: flex;
  gap: 15px;
  align-items: center;
  background: rgba(0,0,0,0.5);
  padding: 8px 15px;
  border-radius: 20px;
}

.social-container span {color: rgba(232, 228, 228, 0.9);}

.social-icons { display: flex; gap: 15px; }

.social-icons img { width: 20px; height: 20px; }

.legal-links {
  position: fixed;
  right: 20px;
  bottom: 15px;

  display: flex;
  gap: 30px;
  font-size: 1em;
  color: #666;

  pointer-events: auto;   /* 允许点击链接 */
}

.legal-links a {
  /* text-decoration: underline; */
  text-decoration: none;
  color: #666;
}

.legal-links a:hover {
  color: #000;
}



/* 允许内容区内的链接可点
#static-content-for-adsense a {
  pointer-events: auto;
  color: #2c5530;
  text-decoration: none;
}

#static-content-for-adsense a:hover {
  text-decoration: underline;
} */

/* .nav-container {
  background: white;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-container ul {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-container a {
  padding: 0.5rem 1rem;
  background: #e0e0e0;
  border-radius: 4px;
  text-decoration: none;
  color: #2c5530;
  font-weight: 600;
  transition: all 0.2s;
}
.nav-container a:hover {
  background: #d4af37;
  color: #000;
}
section {
  margin-bottom: 2.5rem;
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: #2c5530;
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 0.5rem;
}
p, ul, ol {
  margin: 0 0 1rem 0;
}
ul, ol {
  padding-left: 2em;
}
li {
  margin-bottom: 0.3rem;
}
/* a {
  color: #2c5530;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
} */
/* .emoji {
  font-size: 1.2em;
}  */

/* --- 4. 移动端适配 (Screen size < 768px) --- */
@media screen and (max-width: 768px) {
  
  /* 1. 缩小 Header 高度，适配刘海屏 */
  .header {
    height: 44px; /* 从 60px 缩小 */
    padding-top: var(--safe-top); /* 适配 iOS 刘海 */
  }

  #static-content-for-adsense {
    top: 44px; /* 避开顶部的 Header 视觉区 */
  }

  .logo {
    width: 30px;
    height: 30px;
    margin-right: 10px;
  }

  /* 2. 隐藏不重要的导航文字，或缩小字号 */
  .nav-links {
    gap: 10px;
  }
  
  .nav-links a {
    font-size: 0.9em;
    padding: 0 8px;
  }

  /* 如果手机端还是太挤，可以考虑隐藏部分导航 */
  /* .nav-links a:nth-child(n+3) { display: none; } */

  /* 3. 调整右侧语言/按钮位置 */
  .englins {
    right: 15px;
    font-size: 0.85em;
  }

  /* 4. 缩小 Footer 占用的空间 */
  .footer {
    height: auto; /* 让内容自适应 */
    bottom: var(--safe-bottom); /* 适配 iOS 底部横条 */
  }

  /* 5. 社交栏缩小并下移 */
  .social-container {
    left: 10px;
    bottom: 10px;
    padding: 5px 10px;
    scale: 0.8; /* 整体缩放比微调位置更容易 */
    transform-origin: left bottom;
  }

  /* 6. 法律链接通常在移动端很占地方，建议缩小并简化 */
  .legal-links {
    right: 10px;
    bottom: 10px;
    gap: 12px;
    font-size: 0.75em;
  }

  /* 7. 中间的主内容（如果是广告或推荐）在手机上要缩小 */
  .app-info-container {
    gap: 15px;
  }

  .app-item {
    padding: 8px 15px;
  }

  .app-icon {
    width: 40px;
  }

  .app-name {
    font-size: 14px;
  }
}

/* 针对超小屏幕 (如 iPhone SE) 的极致压缩 */
@media screen and (max-width: 380px) {
  .nav-links {
    display: none; /* 屏幕太窄时直接隐藏中间导航，只留 Logo */
  }
}