/* ============================================================
   styles/base.css — 全局重置 / 画布 / 快捷栏 / 覆盖层 / 通用面板
   （原 styles/main.css 拆解而来：1~261 行）
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #07080f;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    system-ui, -apple-system, sans-serif;
  color: #f0e9dd;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  image-rendering: pixelated;
}

/* ---------------- 顶部提示 ---------------- */

#top-hint {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(12, 14, 28, 0.62);
  border: 1px solid rgba(255, 226, 150, 0.16);
  backdrop-filter: blur(8px);
  font-size: 13px;
  color: #cfc6b8;
  white-space: nowrap;
  pointer-events: none;
  letter-spacing: 0.02em;
}

#top-hint .key {
  display: inline-block;
  min-width: 18px;
  padding: 1px 6px;
  margin: 0 2px;
  border-radius: 5px;
  background: rgba(255, 226, 150, 0.13);
  border: 1px solid rgba(255, 226, 150, 0.25);
  color: #ffe296;
  font-size: 12px;
  text-align: center;
}

/* ---------------- 快捷栏 ---------------- */

#hotbar {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(12, 14, 28, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  min-height: 68px;
  min-width: 68px;
  justify-content: center;
  align-items: center;
}

#hotbar:empty::after {
  content: "空";
  color: rgba(255, 255, 255, 0.18);
  font-size: 13px;
  padding: 0 12px;
}

.slot {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.12s, transform 0.12s, background 0.12s;
}

.slot:hover {
  background: rgba(255, 255, 255, 0.1);
}

.slot.selected {
  border-color: #ffd97a;
  background: rgba(255, 217, 122, 0.14);
  transform: translateY(-4px);
  box-shadow: 0 6px 18px rgba(255, 217, 122, 0.18);
}

.slot canvas {
  width: 34px;
  height: 34px;
  image-rendering: pixelated;
}

.slot .count {
  position: absolute;
  right: 4px;
  bottom: 1px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 4px #000, 0 1px 2px #000;
}

.slot .num {
  position: absolute;
  left: 5px;
  top: 2px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.35);
}

/* ---------------- 覆盖层 ---------------- */

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 5, 12, 0.66);
  backdrop-filter: blur(4px);
  z-index: 50;
}

/* 注意：这是 10 个面板（合成/背包/箱子/凝炼台/蜂箱/图纸/存档/进度/暂停/协议警告）
   共同的"隐藏开关"，它们都写 className = 'overlay hidden'。
   优先级只有 (0,2,0)，所以本文件必须最先加载，否则会被后面的 .overlay { display:flex } 盖掉。 */
.overlay.hidden {
  display: none;
}

/* ---------------- 通用面板外壳 ---------------- */

.panel {
  width: min(700px, 92vw);
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  background: linear-gradient(180deg, #1c1f38, #141628);
  border: 1px solid rgba(255, 226, 150, 0.18);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.panel-small {
  width: min(520px, 92vw);
  padding: 24px 28px;
  gap: 8px;
  line-height: 1.7;
  font-size: 14px;
  color: #cfc6b8;
}

.panel-small h2 {
  margin: 0 0 10px;
  font-size: 18px;
  color: #ffe296;
}

.panel-small pre {
  margin: 6px 0;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.4);
  color: #8ee6a0;
  font-size: 13px;
  overflow-x: auto;
}

.panel-small code {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffe296;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.panel-head h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: 0.08em;
  color: #ffe296;
}

.panel-head button {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #cfc6b8;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.panel-head button:hover {
  background: rgba(255, 120, 120, 0.2);
  color: #ffb3b3;
}

.panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}

.panel-foot b {
  color: #ffe296;
}

.panel-foot .tip {
  color: #8ee6a0;
}

.panel-foot .tip.warn {
  color: #ffb36b;
}
