/* ============================================================
   炼物 Sprint2 - 分时投料 / 侧边物品格 / 维修店 / 好友 / 广场媒体 / 银行卡
   仅使用 :root 已有色板变量，不引入新色相
   ============================================================ */

/* ---------- 投料时机条 ---------- */
#refine-feed-bar {
  position: relative;
  height: 22px;
  margin: 8px 16px 0;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 11px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.feed-mark {
  position: absolute;
  top: 0;
  width: 4px;
  height: 100%;
  transform: translateX(-50%);
  border-radius: 2px;
  background: var(--text-dim);
}
.feed-mark.pending { background: rgba(201, 160, 76, 0.6); }
.feed-mark.active {
  background: var(--gold-light);
  box-shadow: 0 0 10px var(--gold-light);
  animation: feed-pulse 1s ease-in-out infinite;
}
.feed-mark.fed { background: #6bd98f; }
.feed-mark.missed { background: #7a6a55; opacity: 0.6; }
@keyframes feed-pulse {
  0%, 100% { box-shadow: 0 0 10px rgba(228, 200, 122, 0.5); }
  50% { box-shadow: 0 0 22px rgba(228, 200, 122, 0.85); }
}

/* ---------- 炉口投放热区 + 盖子 ---------- */
#refine-furnace-mouth {
  position: absolute;
  inset: 0;
  z-index: 20;
  border-radius: 50%;
  pointer-events: none; /* 仅作视觉热区，落点用坐标判定 */
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.2s, border-color 0.2s;
}
#refine-furnace-mouth.is-drop-target {
  box-shadow: inset 0 0 30px rgba(228, 200, 122, 0.8);
  border: 2px solid var(--gold-light);
}
#refine-furnace-mouth.is-rejected {
  box-shadow: inset 0 0 24px rgba(255, 90, 74, 0.6);
}
#refine-lid {
  width: 58%;
  height: 58%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 200, 90, 0) 40%, rgba(255, 120, 40, 0) 100%);
  transform: translateY(0) scale(1);
  transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s;
}
#refine-furnace-mouth.is-open #refine-lid {
  background: radial-gradient(circle, rgba(255, 200, 90, 0.28) 0%, rgba(255, 120, 40, 0.55) 70%, rgba(255, 80, 20, 0) 100%);
  transform: translateY(-18%) scale(1.05);
}

/* ---------- 侧边物品格 ---------- */
#refine-side-grid {
  position: absolute;
  right: 4px;
  top: 60px;
  bottom: 120px;
  width: 66px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  overflow-y: auto;
  padding: 4px 0;
  z-index: 30;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
#refine-side-grid::-webkit-scrollbar { display: none; }
#refine-side-grid.collapsed {
  right: auto;
  left: 8px;
  top: auto;
  bottom: 88px;
  width: auto;
  height: 56px;
  flex-direction: row;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
}
.side-slot {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(201, 160, 76, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  touch-action: none;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.side-slot.is-feed { border-color: rgba(201, 160, 76, 0.55); }
.side-slot.feed-ready {
  border-color: var(--gold-light);
  box-shadow: 0 0 16px rgba(228, 200, 122, 0.6);
  transform: scale(1.12);
  animation: feed-pulse 1s ease-in-out infinite;
}
.side-slot.is-dragging { opacity: 0.35; }
.side-slot.is-focused {
  transform: scale(1.25);
  z-index: 5;
  border-color: var(--gold-light);
  box-shadow: 0 0 14px rgba(228, 200, 122, 0.5);
}
.slot-icon { font-size: 24px; }
.slot-count { font-size: 10px; color: var(--text-dim); margin-top: 2px; }
.slot-feed-dot { position: absolute; top: 2px; right: 4px; font-size: 10px; }

/* 拖拽 ghost */
.slot-ghost {
  position: fixed;
  z-index: 9999;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  border-radius: 10px;
  background: rgba(38, 30, 20, 0.92);
  border: 1px solid var(--gold-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  pointer-events: none;
  transform: scale(1.18) rotate(-3deg);
  filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.6)) brightness(1.15);
}

/* 收起/展开切换 */
#side-grid-toggle {
  position: absolute;
  left: 6px;
  top: 40%;
  z-index: 31;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(38, 30, 20, 0.9);
  border: 1px solid var(--gold);
  color: var(--gold);
  font-size: 16px;
  cursor: pointer;
}

/* ---------- 炼制屏震动（炸炉） ---------- */
#screen-refine.shake { animation: refine-shake 0.5s; }
@keyframes refine-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

/* ---------- 配方投料提示 ---------- */
.recipe-feed { margin-top: 4px; font-size: 11px; color: var(--gold); }
.feed-list { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.feed-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
}
.feed-row.ok { border-left: 3px solid #6bd98f; }
.feed-row.lack { border-left: 3px solid var(--fire-red); color: var(--text-dim); }
.feed-tip { font-size: 11px; color: var(--text-dim); margin-top: 6px; }

/* ---------- 背包入口高亮 ---------- */
.inventory-entry { background: rgba(201, 160, 76, 0.12); }

/* ---------- 维修店 ---------- */
.repair-tip { font-size: 12px; color: var(--text-dim); margin: 6px 0; }
.repair-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.repair-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
}
.repair-card-head { display: flex; justify-content: space-between; align-items: center; }
.repair-tool-name { color: var(--gold-light); font-weight: bold; }
.repair-tool-lv { font-size: 10px; color: var(--text-dim); }
.repair-tool-dur { color: var(--text-main); }
.dur-bar { height: 8px; background: rgba(0, 0, 0, 0.4); border-radius: 4px; margin: 8px 0; overflow: hidden; }
.dur-fill { height: 100%; background: linear-gradient(90deg, var(--fire-red), var(--fire-orange)); }
.repair-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.repair-partial { margin-top: 8px; font-size: 12px; color: var(--text-dim); }
.repair-resmelt-cost { margin-top: 6px; font-size: 12px; color: var(--gold); }
.btn-small.disabled, .btn-tiny.disabled { opacity: 0.45; pointer-events: none; }

/* ---------- 加好友结果 ---------- */
.add-friend-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(201, 160, 76, 0.15);
}
.add-friend-info { flex: 1; }
.add-friend-id { font-size: 11px; color: var(--text-dim); }
.add-friend-done { color: var(--gold); font-size: 12px; }

/* ---------- 银行卡 ---------- */
.bank-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px solid rgba(201, 160, 76, 0.15);
}
.bank-list { margin-top: 10px; }

/* ---------- 广场媒体 ---------- */
.moment-media-bar { display: flex; gap: 8px; margin: 10px 0; }
.media-btn {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  background: rgba(201, 160, 76, 0.1);
  border: 1px solid rgba(201, 160, 76, 0.3);
  color: var(--gold-light);
  font-size: 13px;
  cursor: pointer;
}
.moment-media-preview { margin-bottom: 8px; }
.moment-media-thumb { position: relative; display: inline-block; }
.media-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border: none;
  cursor: pointer;
}
.moment-media {
  border-radius: 10px;
  overflow: hidden;
  max-width: 200px;
  position: relative;
  cursor: pointer;
  margin-top: 6px;
}
.moment-media img { width: 100%; display: block; }
.moment-media.video .play-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.moment-media.video.simulated { animation: video-shimmer 2.4s ease-in-out infinite; }
@keyframes video-shimmer {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.15); }
}
.moment-media-wrap { margin-top: 6px; }
.moment-enlarge { text-align: center; }
.moment-enlarge img { max-width: 100%; border-radius: 10px; }

/* ---------- 减弱动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  .side-slot.feed-ready,
  .feed-mark.active,
  .moment-media.video.simulated { animation: none !important; }
  #refine-lid, #screen-refine.shake { transition-duration: 0.01ms !important; animation: none !important; }
}
