/* 共享帮助弹窗组件 — 4 款游戏通用
 * 用法：页面引入本 CSS + help.js，并放置 <script type="application/json" id="help-content">
 * help.js 会自动注入右下角 "?" 悬浮按钮和弹窗；带 data-help-open 的按钮也可打开弹窗
 */

/* 开源商用字体 JetBrains Mono（SIL OFL 1.1）：本文件被复制到各游戏目录，
 * 字体路径相对本 CSS 解析，dist 与 CG 包内都能命中 <game>/fonts/ 或 site/fonts/ */
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

/* 右下角 "?" 悬浮按钮 */
.help-fab {
  position: fixed;
  right: 14px;
  bottom: 14px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(160, 170, 210, 0.35);
  background: rgba(24, 22, 36, 0.88);
  color: #e8eaf5;
  font: 700 17px/1 "JetBrains Mono", system-ui, -apple-system, sans-serif;
  cursor: pointer;
  z-index: 60;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.help-fab:hover {
  border-color: rgba(255, 200, 120, 0.7);
  transform: scale(1.06);
}

/* 弹窗蒙层 */
.help-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 4, 10, 0.78);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 70;
}

/* hidden 属性优先于 display:flex */
.help-overlay[hidden] { display: none; }

/* 弹窗面板（深色中性风，兼容 4 款游戏的主题） */
.help-panel {
  width: min(440px, 100%);
  max-height: 82vh;
  overflow-y: auto;
  background: #171322;
  border: 1px solid rgba(160, 170, 210, 0.25);
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65);
  color: #eceaf5;
  font-family: "JetBrains Mono", system-ui, -apple-system, "PingFang SC", sans-serif;
}

.help-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 10px;
  border-bottom: 1px solid rgba(160, 170, 210, 0.14);
}

.help-panel h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: 0.03em;
}

.help-close {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(160, 170, 210, 0.28);
  background: rgba(160, 170, 210, 0.08);
  color: #eceaf5;
  font: 500 16px/1 "JetBrains Mono", system-ui, sans-serif;
  cursor: pointer;
}

.help-close:hover { border-color: rgba(255, 120, 120, 0.55); }

.help-body { padding: 8px 20px 20px; }

.help-body section { margin-top: 12px; }

.help-body h3 {
  margin: 0 0 5px;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9fa8c9;
}

.help-body p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: #d5d3e4;
}

.help-body ul {
  margin: 0;
  padding-left: 18px;
  font-size: 13.5px;
  line-height: 1.6;
  color: #d5d3e4;
}
