/* ==========================================================================
   inventory.css — 背包界面样式
   ========================================================================== */

/* 背包容器 */
.inventory-container {
  position: relative;
  width: 90%;
  max-width: 800px;
  max-height: 85vh;
  overflow-y: auto;
  background: rgba(10, 7, 4, 0.95);
  border: 3px solid #3a2c1a;
  border-radius: 12px;
  padding: 20px;
}

/* 头部 */
.inventory-header {
  text-align: center;
  margin-bottom: 20px;
}

.inventory-header h2 {
  color: #f4e7c6;
  font-size: 28px;
  margin: 0 0 8px 0;
  letter-spacing: 4px;
}

.inventory-header .hint {
  color: #8a7a5a;
  font-size: 14px;
  margin: 0;
}

/* 物品网格 */
.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

/* 空背包提示 */
.inventory-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #8a7a5a;
}

.inventory-empty[style*="display: none"] {
  display: none !important;
}

.empty-icon {
  font-size: 48px;
  opacity: 0.5;
  margin-bottom: 16px;
}

/* 物品卡片 */
.inventory-item {
  background: rgba(30, 24, 18, 0.8);
  border: 2px solid #4a3a28;
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.inventory-item:hover {
  border-color: #c9a878;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.inventory-item.selected {
  border-color: #ffd95a;
  background: rgba(70, 56, 40, 0.9);
  box-shadow: 0 0 16px rgba(255, 217, 90, 0.4);
}

.inventory-item canvas {
  width: 64px;
  height: 64px;
  image-rendering: pixelated;
}

.inventory-item-name {
  color: #f4e7c6;
  font-size: 12px;
  font-weight: bold;
  text-align: center;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 详情面板 */
.inventory-detail {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 20px;
  background: rgba(10, 7, 4, 0.95);
  border: 2px solid #5a4a38;
  border-radius: 12px;
  padding: 16px 24px;
  min-width: 400px;
}

.inventory-detail.hidden {
  display: none;
}

.detail-icon {
  flex-shrink: 0;
}

.detail-icon canvas {
  width: 72px;
  height: 72px;
  image-rendering: pixelated;
}

.detail-info {
  flex: 1;
}

.detail-info h3 {
  color: #ffd95a;
  font-size: 18px;
  margin: 0 0 6px 0;
}

.detail-info p {
  color: #c9b896;
  font-size: 14px;
  margin: 0 0 12px 0;
}

/* 危险按钮 */
.btn-danger {
  background: linear-gradient(180deg, #8f2020 0%, #5a1515 100%);
  border: 2px solid #bf3030;
  color: #ffd5d5;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-danger:hover {
  background: linear-gradient(180deg, #af2525 0%, #6f1818 100%);
  border-color: #ff4040;
}

/* 确认对话框 */
.confirm-dialog {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.confirm-dialog.hidden {
  display: none;
}

.confirm-dialog .dialog-content {
  background: rgba(15, 10, 5, 0.98);
  border: 3px solid #bf3030;
  border-radius: 12px;
  padding: 24px 32px;
  text-align: center;
  max-width: 320px;
}

.confirm-dialog p {
  color: #f4e7c6;
  font-size: 16px;
  margin: 0 0 8px 0;
}

.confirm-dialog .warning {
  color: #ff8080;
  font-size: 14px;
  margin-bottom: 20px;
}

.dialog-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}