/* 首屏关键样式（从 index.html 的内联 <style> 抽出）
 *
 * ⚠️ 为什么必须独立成文件、而不是写在 index.html 里，
 * Vite 的 html 插件会把 HTML 里的内联 <style> 抽成一个虚拟模块
 *   index.html?html-proxy&inline-css&index=0.css
 * 在部分构建环境（实测 EdgeOne Makers 的构建容器）里，这个虚拟模块的注册会丢失，
 * 构建直接失败：
 *   [vite:html-inline-proxy] Could not load ... No matching HTML proxy module found
 * 本机 `npm run build` 正常、但云端构建失败，极难定位。
 * 放到 public/ 下由 index.html 以绝对路径 /boot.css 引用，Vite 不做处理、原样拷贝，
 * 彻底绕开这条代码路径，任何构建环境都不会再出问题。
 *
 * 字体说明：原来依赖 fonts.googleapis.com 的站酷庆科黄油体，
 * 国内网络 + 微信环境下这个域名经常连不上，会拖慢首屏甚至卡住渲染。
 * 现已改为纯系统字体栈，零外部依赖，微信里也能秒开。
 */

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

html, body, #app { width: 100%; height: 100%; overflow: hidden; }

html {
  background: #FFF7EC;
  /* 微信里 100vh 不准，用 JS 写入的 --vh 兜底 */
  --vh: 1vh;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  -webkit-user-select: none;
  user-select: none;
}

/* 输入框保留选择能力 */
input, textarea { -webkit-user-select: text; user-select: text; }

/* 微信内禁用长按呼出菜单（图片/按钮被长按会弹出系统菜单，很干扰游戏） */
.is-wechat img { -webkit-touch-callout: none; pointer-events: none; }
.is-wechat button, .is-wechat .no-callout { -webkit-touch-callout: none; }

/* 首屏 Loading：JS 还没跑起来时先显示，避免微信里出现纯白屏 */
#boot-loading {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: #FFF7EC;
  z-index: 99999;
  transition: opacity .3s ease;
}
#boot-loading .planet {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 4px solid #FFE0B8;
  border-top-color: #FF9A3C;
  animation: boot-spin .9s linear infinite;
}
#boot-loading .txt {
  font-size: 14px;
  color: #B08968;
  letter-spacing: 2px;
}
@keyframes boot-spin { to { transform: rotate(360deg); } }
#boot-loading.gone { opacity: 0; pointer-events: none; }

/* JS 完全被拦截（老内核不认识 module）时的兜底提示 */
#boot-fallback {
  display: none;
  position: fixed;
  inset: 0;
  padding: 40px 28px;
  background: #FFF7EC;
  color: #6B4F3A;
  font-size: 15px;
  line-height: 1.9;
  z-index: 100000;
  flex-direction: column;
  justify-content: center;
}
#boot-fallback b { color: #FF9A3C; display: block; margin-bottom: 12px; font-size: 17px; }
#boot-retry {
  margin-top: 22px;
  padding: 11px 30px;
  border: 0;
  border-radius: 12px;
  background: #FF9A3C;
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 700;
  align-self: flex-start;
}
