.custom-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  overflow: hidden;
  -webkit-box-align: center;
  -webkit-box-pack: center;
  -ms-flex-align: center;
  -ms-flex-pack: center;
  flex-direction: column;
  pointer-events: none;
  /* 确保弹窗在滚动时保持居中 */
  will-change: transform;
  backface-visibility: hidden;
}

.custom-modal.show {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

.custom-modal-content {
  background-color: white;
  border-radius: 10px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  /* 优化动画效果，确保居中 */
  transform: scale(0.9);
  opacity: 0;
  transition: all 0.3s ease;
  /* 确保内容不会溢出 */
  max-height: 90vh;
  overflow-y: auto;
}

.custom-modal.show .custom-modal-content {
  transform: scale(1);
  opacity: 1;
}

.custom-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e0e0e0;
}

.custom-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin: 0;
}

.custom-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
  transition: color 0.2s ease;
}

.custom-modal-close:hover {
  color: #333;
}

.custom-modal-body {
  margin-bottom: 20px;
  color: #666;
  line-height: 1.5;
}

.custom-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 15px;
  border-top: 1px solid #e0e0e0;
}

.custom-modal-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.custom-modal-btn-primary {
  background-color: #4c4eb5;
  color: white;
}

.custom-modal-btn-primary:hover {
  background-color: #8a7e96;
}

.custom-modal-btn-secondary {
  background-color: #f0f0f0;
  color: #333;
}

.custom-modal-btn-secondary:hover {
  background-color: #e0e0e0;
}

/* 响应式设计 */
@media (max-width: 600px) {
  .custom-modal-content {
    padding: 20px;
    width: 95%;
  }
  
  .custom-modal-title {
    font-size: 16px;
  }
  
  .custom-modal-btn {
    padding: 6px 12px;
    font-size: 13px;
  }
}
