/* ============================================================
   styles/inventory.css — 背包 UI
   （原 styles/main.css 拆解而来：464~709 行）
   ============================================================ */

#inventory-panel {
  z-index: 60;
}

.inv-panel {
  width: min(612px, 96vw);
  max-height: 92vh;
  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;
}

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

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

.inv-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;
}

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

.inv-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}

.inv-body::-webkit-scrollbar { width: 8px; }
.inv-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}

.inv-top {
  display: flex;
  gap: 20px;
  align-items: stretch;
}

.inv-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.inv-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.08em;
}

/* ---- 装备区 ---- */

.equip-grid {
  display: grid;
  grid-template-columns: repeat(3, 52px);
  grid-template-rows: repeat(3, 52px);
  gap: 6px;
}

.armor-slot {
  background: rgba(255, 217, 122, 0.08) !important;
  border-color: rgba(255, 217, 122, 0.28) !important;
}

.accessory-slot {
  background: rgba(180, 140, 255, 0.06) !important;
  border-color: rgba(180, 140, 255, 0.2) !important;
}

/* ---- 转化区 ---- */

.convert-section {
  flex: 0 0 auto;
}

.convert-zone {
  width: 120px;
  height: 168px;          /* 和装备区 3×3 等高 */
  border: 2px dashed rgba(255, 217, 122, 0.35);
  border-radius: 14px;
  background: rgba(255, 217, 122, 0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #ffe296;
  transition: all 0.15s;
  padding: 8px;
}

.convert-zone:hover {
  background: rgba(255, 217, 122, 0.1);
  border-color: rgba(255, 217, 122, 0.65);
  transform: scale(1.02);
}

.convert-icon { font-size: 26px; }
.convert-hint { font-size: 12px; font-weight: 600; }
.convert-sub  { font-size: 10px; opacity: 0.6; }

/* ---- 背包 / 快捷栏 ---- */

.bp-grid {
  display: grid;
  grid-template-columns: repeat(10, 52px);
  grid-template-rows: repeat(3, 52px);
  gap: 6px;
}

.hb-grid {
  display: grid;
  grid-template-columns: repeat(10, 52px);
  gap: 6px;
}

.inv-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: grab;
  transition: background 0.1s, border-color 0.1s;
}

.inv-slot:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 217, 122, 0.4);
}

.inv-slot.empty { cursor: default; }
.inv-slot.empty:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

.inv-slot canvas {
  width: 34px;
  height: 34px;
  image-rendering: pixelated;
  pointer-events: none;
}

.inv-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;
  pointer-events: none;
}

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

/* ---- 拖拽跟随 ---- */

.inv-ghost {
  position: fixed;
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: rgba(255, 217, 122, 0.22);
  border: 2px solid rgba(255, 217, 122, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 9999;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55);
  transform: scale(1.05);
}

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

.inv-ghost .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;
}

/* ---- 底部提示 ---- */

.inv-foot {
  padding: 12px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.42);
  text-align: center;
}

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