/* ui.css – UI 组件统一样式 */
:root {
  --toast-success-bg: #d1fae5;
  --toast-success-color: #065f46;
  --toast-error-bg: #fee2e2;
  --toast-error-color: #b91c1c;
  --toast-info-bg: #e0f2fe;
  --toast-info-color: #0369a1;
}

/* Toast container */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 2000;
}

.toast {
  min-width: 240px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: toastFadeIn 0.3s ease forwards;
}

.toast.success { background: var(--toast-success-bg); color: var(--toast-success-color); }
.toast.error   { background: var(--toast-error-bg);   color: var(--toast-error-color);   }
.toast.info    { background: var(--toast-info-bg);    color: var(--toast-info-color);    }

.toast button {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
}

@keyframes toastFadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes toastFadeOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-10px); }
}

/* Loading overlay */
.loading-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.7);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 1500;
}

body.dark-theme .loading-overlay {
  background: rgba(25,25,25,0.7);
}

.loading-overlay .spinner {
  border: 4px solid rgba(0,0,0,0.1);
  border-left-color: var(--primary);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

/* Modal styles (reuse existing modal but ensure overlay) */
.modal-overlay {
  display: none; /* will be toggled via JS */
}

/* Artifact Drawer – side panel */
.artifacts-drawer {
  position: relative;
  width: 0;
  max-width: 50%;
  height: 100%;
  background: var(--bg-main);
  border-left: 1px solid var(--border-color);
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 10;
}
.artifacts-drawer.open {
  width: 40%;
  min-width: 360px;
}
