/* ==========================================================================
   toast.css —— 顶部居中提示条（自包含）
   --------------------------------------------------------------------------
   不依赖任何其他样式表，也不影响页面既有样式。
   由 toast.js 创建 .toast-region 容器与 .toast 元素。

   变体：.toast--error（默认） / .toast--success
   ========================================================================== */

.toast-region {
  position: fixed;
  top: 4rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: max-content;
  max-width: calc(100vw - 2rem);
  /* 容器本身不拦截鼠标，只有提示条可交互 */
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  pointer-events: auto;
  max-width: 100%;
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: #ffffff;
  overflow-wrap: anywhere;
  opacity: 0;
  transition: opacity 150ms ease;
}

.toast--error {
  background-color: #A65353;
}

.toast--success {
  background-color: #4F7561;
}

.toast.is-visible {
  opacity: 1;
}

.toast__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: none;
  border-radius: 3px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 1.25rem;
  cursor: pointer;
}

.toast__close:hover {
  background: rgba(255, 255, 255, 0.15);
}

.toast__close:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}
