/* ShareResource全局样式 - 用于模态框和其他需要全局生效的样式 */

.share-modal.custom-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;  /* 使用视口宽度 */
  height: 100vh; /* 使用视口高度 */
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
  padding: 20px;
  overflow-y: auto; /* 允许在小屏幕上滚动 */
}

.share-modal .modal-dialog {
  width: 100%;
  max-width: 450px; /* 稍微减小宽度，更适合手机屏幕 */
  margin: 0 auto;
  max-height: 95vh; /* 增大最大高度以显示更多内容 */
  display: flex;
  flex-direction: column;
}

.share-modal .modal-content {
  width: 100%;
  background-color: #ffffff; /* 使用白色背景，更符合浅色主题 */
  border-radius: 12px; /* 更圆润的圆角 */
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  border: none; /* 移除边框 */
  animation: modal-appear 0.3s ease-out;
  overflow: hidden; /* 确保内容不会溢出 */
  position: relative; /* 用于关闭按钮定位 */
}

/* 关闭按钮样式 */
.modal-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
}

.modal-close-btn .btn-close {
  width: 32px;
  height: 32px;
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.modal-close-btn .btn-close i {
  font-size: 20px;
  color: #64748b;
}

.modal-close-btn .btn-close:hover {
  background-color: #ffffff;
}

.modal-close-btn .btn-close:hover i {
  color: #1e293b;
}

.copy-success-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(16, 185, 129, 0.9);
  color: white;
  padding: 12px 24px;
  border-radius: 6px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 10000;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  animation: toast-in-out 3s ease-in-out;
}

.copy-success-toast i {
  font-size: 18px;
}

@keyframes toast-in-out {
  0% { 
    opacity: 0;
    transform: translate(-50%, -20px);
  }
  15% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  85% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  100% { 
    opacity: 0;
    transform: translate(-50%, -20px);
  }
}

@keyframes modal-appear {
  from { 
    opacity: 0;
    transform: translateY(-20px);
  }
  to { 
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 576px) {
  .share-modal.custom-modal {
    padding: 15px;
    align-items: center; /* 确保模态框在移动设备上居中 */
  }
  
  .share-modal .modal-dialog {
    max-width: 90%; /* 减小移动端的宽度 */
    width: 320px; /* 设置固定宽度，避免过大 */
    margin: 0 auto;
    max-height: 85vh; /* 降低最大高度，避免铺满整个屏幕 */
  }
  
  .share-modal .modal-content {
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  }
  
  .share-modal .share-modal-body {
    padding: 15px;
  }
  
  .modal-close-btn {
    top: 8px;
    right: 8px;
  }
  
  .modal-close-btn .btn-close {
    width: 28px;
    height: 28px;
  }
  
  .copy-success-toast {
    padding: 10px 18px;
    font-size: 14px;
    top: 15px;
  }
} 

/* 添加更小屏幕的特殊处理 */
@media (max-width: 360px) {
  .share-modal.custom-modal {
    padding: 10px;
  }
  
  .share-modal .modal-dialog {
    width: 92%; /* 更小屏幕使用百分比宽度 */
    max-width: 300px;
    max-height: 80vh;
  }
  
  .share-modal .share-modal-body {
    padding: 12px;
  }
}

/* 添加平板设备的优化 */
@media (min-width: 577px) and (max-width: 768px) {
  .share-modal .modal-dialog {
    max-width: 400px;
    max-height: 90vh;
  }
} 