/* ============================================================ */
/*  Toast 容器（提示用） */
/* ============================================================ */
#toastContainer {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  width: 90%;
  max-width: 420px;
}

.toast-item {
  pointer-events: auto;
  padding: 13px 24px;
  border-radius: 12px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translateY(-30px) scale(0.95);
  transition: opacity 0.35s ease, transform 0.35s ease;
  width: 100%;
  text-align: center;
}

.toast-item.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast-item.hide {
  opacity: 0;
  transform: translateY(-30px) scale(0.95);
  transition: opacity 0.3s ease-in, transform 0.3s ease-in;
}

.toast-item.success {
  background: rgba(34, 197, 94, 0.93);
}
.toast-item.error {
  background: rgba(239, 68, 68, 0.93);
}
.toast-item.warning {
  background: rgba(245, 158, 11, 0.93);
}
.toast-item.info {
  background: rgba(6, 182, 212, 0.93);
}

/* ============================================================ */
/*  Modal 遮罩 & 弹窗 */
/* ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  z-index: 100000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal-overlay.show {
  opacity: 1;
}

.modal-overlay.hide {
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal-box {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  padding-bottom: 36px;
  max-width: 400px;
  width: 60%;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: scale(0.92) translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.modal-overlay.show .modal-box {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.modal-overlay.hide .modal-box {
  opacity: 0;
  transform: scale(0.92) translateY(20px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.modal-box .modal-icon {
  font-size: 44px;
  text-align: center;
  margin-bottom: 6px;
  line-height: 1.2;
}

.modal-box .modal-title {
  font-size: 19px;
  font-weight: 700;
  text-align: center;
  color: #1a1a2e;
  margin-bottom: 6px;
}

.modal-box .modal-content {
  font-size: 14px;
  color: #555;
  text-align: center;
  margin-bottom: 20px;
  line-height: 1.7;
}

.modal-box .modal-content .highlight {
  color: #ef4444;
  font-weight: 600;
}

/* 输入框样式 */
.modal-box .modal-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border 0.2s;
  margin-bottom: 18px;
  font-family: inherit;
  box-sizing: border-box;
}

.modal-box .modal-input:focus {
  border-color: #4a6cf7;
  box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.15);
}

.modal-box .modal-input.error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* 加载动画 */
.modal-box .loading-spinner {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 8px 0 16px;
}

.modal-box .loading-spinner span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #4a6cf7;
  animation: bounce 1.2s ease-in-out infinite;
}

.modal-box .loading-spinner span:nth-child(2) {
  animation-delay: 0.2s;
}
.modal-box .loading-spinner span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes bounce {
  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.4;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-box .modal-actions {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-top: 4px;
}

.modal-box .modal-actions .btn {
  min-width: 76px;
  padding: 10px 20px;
}

/* 响应式优化 */
@media (max-width: 480px) {
  .modal-box {
    padding: 24px 20px 20px;
    width: 95%;
  }
  
  .modal-box .modal-actions {
    flex-direction: column;
  }
  
  .modal-box .modal-actions .btn {
    width: 100%;
  }
}

/* 加载动画样式 */
.loading-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.3);
  z-index: 9998;
  justify-content: center;
  align-items: center;
}
.loading-overlay.active {
  display: flex;
}
.loading-spinner {
  background: white;
  padding: 20px 40px;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #2196f3;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 10px;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.handle {
  margin: 0;
}
