/* === 响应式优化 === */
@media (max-width: 768px) {
  .adventure-header {
    flex-direction: column;
    gap: 12px;
  }
  .market-sale-header,
  .market-sale-footer {
    align-items: stretch;
    flex-direction: column;
  }
  .quick-heal-area {
    flex: 0 0 auto;
  }
  .adventure-equip, .adventure-backpack {
    padding: 12px;
  }
  #adventureLog {
    max-height: 200px;
  }
}

/* === 手机端交互优化（480px以下） === */
/* ==========================
   弹窗显示优化样式（桌面 + 移动通用）
   ========================== */

/* 基础弹窗样式 */
#itemDetail {
  position: fixed;
  left: 50%;
  top: 15vh;
  transform: translateX(-50%);
  width: 380px;
  max-height: 60vh;
  overflow-y: auto;
  background: rgba(20,20,20,0.95);
  border: 1px solid #555;
  border-radius: 16px;
  box-shadow: 0 0 25px rgba(0,0,0,0.45);
  padding: 18px;
  color: #ddd;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  display: none;
}
#itemDetail.show {
  display: block;
  opacity: 1;
  transform: translate(-50%, 0);
}

/* 按钮美化 */
#itemDetail button.dynamic {
  background: #333;
  color: #eee;
  border: 1px solid #555;
  border-radius: 8px;
  padding: 6px 12px;
  margin: 6px;
  cursor: pointer;
  transition: background 0.2s;
}
#itemDetail button.dynamic:hover {
  background: #555;
}

/* 装备栏弹窗更靠近装备 */
#itemDetail.equip-mode {
  width: 280px;
  left: auto;
  transform: none;
  background: rgba(30,30,30,0.95);
  border-color: #666;
  box-shadow: 0 0 16px rgba(0,0,0,0.4);
}

/* 背包弹窗（气泡） */
#itemDetail.bag-mode {
  width: 260px;
  max-height: none;
  background: rgba(40,40,40,0.96);
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  border-radius: 12px;
}

/* 遮罩层（点击关闭） */
#detailOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1500;
  display: none;
  opacity: 0;
  transition: opacity 0.2s;
}
#detailOverlay.show {
  display: block;
  opacity: 1;
}

@media (max-width: 768px) {
  #itemDetail,
  #itemDetail.show,
  #itemDetail.equip-mode,
  #itemDetail.bag-mode {
    box-sizing: border-box;
    left: 12px !important;
    right: 12px !important;
    top: 50% !important;
    bottom: auto !important;
    width: auto !important;
    max-height: 72vh !important;
    max-height: min(72vh, calc(100dvh - 24px)) !important;
    padding: 16px;
    transform: translateY(-50%) !important;
    border-radius: 14px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #itemDetail h4 {
    margin: 0 0 8px;
    font-size: 17px;
  }

  #detailInfo {
    margin: 0 0 10px;
    line-height: 1.6;
  }

  #itemDetail button,
  #itemDetail button.dynamic {
    width: 100%;
    min-height: 44px;
    margin: 6px 0 0;
    padding: 10px 12px;
    font-size: 15px;
  }

  #facilityDetail {
    box-sizing: border-box;
    left: 12px !important;
    right: 12px !important;
    top: 50% !important;
    width: auto !important;
    max-height: 72vh;
    max-height: min(72vh, calc(100dvh - 24px));
    padding: 16px;
    transform: translateY(-50%) !important;
    border-radius: 14px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

