/* ============================================================
   styles/craft.css — 合成列表 / 合成面板 v2 / 合成详情弹窗
   （原 styles/main.css 拆解而来：262~403、875~1197 行）
   ============================================================ */

/* ---------------- 合成列表（旧版） ---------------- */

.craft-list {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.craft-list::-webkit-scrollbar {
  width: 8px;
}

.craft-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}

.recipe {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: border-color 0.15s, background 0.15s;
}

.recipe.can-craft {
  border-color: rgba(255, 217, 122, 0.35);
  background: rgba(255, 217, 122, 0.05);
}

.recipe.locked {
  opacity: 0.42;
}

.recipe .flow {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  flex-wrap: wrap;
}

.ing-group {
  display: flex;
  gap: 6px;
}

.ing {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ing canvas {
  width: 28px;
  height: 28px;
  image-rendering: pixelated;
}

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

.ing.lack canvas {
  filter: grayscale(1) brightness(0.5);
}

.ing.lack .n {
  color: #ff8b8b;
}

.arrow {
  color: rgba(255, 255, 255, 0.3);
  font-size: 16px;
}

.recipe .out {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 110px;
}

.recipe .out-name {
  font-size: 13px;
  color: #e6ddcd;
}

.recipe button {
  padding: 8px 16px;
  border: none;
  border-radius: 9px;
  background: rgba(255, 217, 122, 0.16);
  border: 1px solid rgba(255, 217, 122, 0.3);
  color: #ffe296;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, transform 0.08s;
  white-space: nowrap;
}

.recipe button:hover:not(:disabled) {
  background: rgba(255, 217, 122, 0.28);
}

.recipe button:active:not(:disabled) {
  transform: scale(0.95);
}

.recipe button:disabled {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.25);
  cursor: not-allowed;
}

.recipe .station-tag {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(140, 200, 255, 0.14);
  color: #9fd0ff;
  border: 1px solid rgba(140, 200, 255, 0.2);
}

/* ============================================================
   合成面板 v2
   ============================================================ */

.craft-panel {
  width: min(880px, 96vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

.craft-tabs {
  display: flex;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  flex-wrap: wrap;
}

.craft-tab {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #cfc6b8;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}

.craft-tab:hover {
  background: rgba(255, 255, 255, 0.09);
}

.craft-tab.active {
  background: rgba(255, 217, 122, 0.18);
  border-color: rgba(255, 217, 122, 0.5);
  color: #ffe296;
}

.craft-grid {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 12px;
  align-content: start;
}

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

.craft-card {
  position: relative;
  padding: 12px 8px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.12s;
  user-select: none;
}

.craft-card:hover {
  background: rgba(255, 255, 255, 0.09);
  transform: translateY(-2px);
}

.craft-card.ready {
  border-color: rgba(255, 217, 122, 0.4);
  background: rgba(255, 217, 122, 0.06);
}

.craft-card.ready:hover {
  background: rgba(255, 217, 122, 0.12);
  border-color: rgba(255, 217, 122, 0.7);
}

.craft-card.lack {
  opacity: 0.5;
}

.craft-card.no-station {
  opacity: 0.7;
}

.craft-card.no-station::after {
  content: attr(data-station);
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(140, 200, 255, 0.15);
  color: #9fd0ff;
  border: 1px solid rgba(140, 200, 255, 0.3);
}

.craft-card canvas {
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
  pointer-events: none;
}

.craft-card .card-count {
  position: absolute;
  right: 6px;
  top: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.5);
  color: #ffe296;
}

.craft-card .card-name {
  font-size: 12px;
  color: #e6ddcd;
  text-align: center;
  line-height: 1.2;
  word-break: break-all;
  pointer-events: none;
}

.craft-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 0;
  color: rgba(255, 255, 255, 0.3);
  font-size: 14px;
}

/* ============================================================
   合成详情弹窗
   ============================================================ */

#craft-detail {
  z-index: 70;
}

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

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

.detail-head h3 {
  margin: 0;
  font-size: 16px;
  color: #ffe296;
}

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

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

.detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.detail-item-info {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.di-desc {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
  margin-bottom: 4px;
}

.di-sat {
  font-size: 12px;
  color: #a3d47a;
  margin-top: 2px;
}

.detail-section-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.08em;
  margin-top: 4px;
}

.detail-mats {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail-mat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.detail-mat.lack {
  border-color: rgba(255, 100, 100, 0.25);
  background: rgba(255, 100, 100, 0.05);
}

.detail-mat canvas {
  width: 28px;
  height: 28px;
  image-rendering: pixelated;
}

.dm-name {
  flex: 1;
  font-size: 13px;
  color: #e6ddcd;
}

.dm-count {
  font-size: 13px;
  font-weight: 700;
  color: #a3d47a;
  font-variant-numeric: tabular-nums;
}

.detail-mat.lack .dm-count {
  color: #ff8b8b;
}

.detail-foot {
  display: flex;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.detail-foot button {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
}

.detail-craft-btn {
  background: rgba(255, 217, 122, 0.18);
  border: 1px solid rgba(255, 217, 122, 0.4);
  color: #ffe296;
}

.detail-craft-btn:hover:not(:disabled) {
  background: rgba(255, 217, 122, 0.3);
}

.detail-craft-btn:disabled {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.25);
  cursor: not-allowed;
}

.detail-cancel-btn {
  background: rgba(255, 255, 255, 0.06);
  color: #cfc6b8;
}

.detail-cancel-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}
