/* Modal 基础样式 */
.modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  width: fit-content;
  padding: 20px;
  background-color: white;
  box-shadow: 0 0 30px rgba(0,0,0,0.6);
  z-index: 9999999;
  border-radius: 5px;
  width: clamp(240px, 25vw, 350px);
}

.modalButton {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: black;
  color: white;
  border: none;
  font-size: 16px;
  cursor: pointer;
  z-index: 999;
}


/* Modal 关闭按钮 */
.modalClose {
  position: absolute;
  top: -12px;
  right: -12px;
  cursor: pointer;
  background: black;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 50px;
  background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYuNjk2IiBoZWlnaHQ9IjE2LjY5NiIgdmlld0JveD0iMCAwIDE2LjY5NiAxNi42OTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3R5bGU9IndpZHRoOjEycHgiPjxwYXRoIGQ9Im0uMzQ4LjM0OCAxNiAxNm0wLTE2LTE2IDE2IiBzdHJva2U9IiNGRkYiIGZpbGw9Im5vbmUiIHN0cm9rZS1saW5lY2FwPSJzcXVhcmUiLz48L3N2Zz4=);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 50%;
}
/* Modal 内部容器 */
.modalContainer {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 网格编辑区域 */
.grid {
  display: grid;
  gap: 1px;
  background-color: #ccc;
  border: 1px solid #ccc;
  min-width: 200px;
}

/* 网格单元 */
.grid-item {
  aspect-ratio: 1/1;
  background-color: #f0f0f0;
  cursor: pointer;
}


/* 库区域 */
.inventoryOuter {
  display: flex;
  max-height: 100px;
  overflow-y: auto;
}
.inventoryContainer {
  width: 100%;
  background: #e5e5e5;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
}
.inventoryContainer canvas {
  cursor: pointer;
  aspect-ratio: 1/1;
  width: 100%;
}
.inventoryContainer .inventory-item {
  position: relative;
  line-height: 0;
}