/* web/portal/_partials/lib/custom/toast/toast.css */
/* 粒粒学全局 Toast 提示插件 */
/* 说明：#llx-toast-message-root 只作为挂载点，不写任何样式 */
/* 真正定位和布局由 JS 自动创建的 .llx-toast-message 负责 */

.llx-toast-message {
  position: fixed;
  left: 22px;
  bottom: 22px;
  z-index: 12000;
  width: min(380px, calc(100vw - 44px));
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.llx-toast-message .llx-toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 20px;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 14px 14px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #e6eaf2;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.12);
  color: #172033;
  animation: llxToastIn 0.25s ease both;
}

.llx-toast-message .llx-toast.is-leaving {
  animation: llxToastOut 0.2s ease both;
}

.llx-toast-message .llx-toast-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.llx-toast-message .llx-toast-main {
  min-width: 0;
  padding-top: 1px;
}

.llx-toast-message .llx-toast-title {
  margin: 0;
  color: #172033;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  word-break: break-word;
}

.llx-toast-message .llx-toast-desc {
  margin: 4px 0 0;
  color: #667085;
  font-size: 13px;
  line-height: 1.6;
  word-break: break-word;
}

.llx-toast-message .llx-toast-desc:empty {
  display: none;
}

.llx-toast-message .llx-toast-close {
  width: 20px;
  height: 20px;
  border: 0;
  background: transparent;
  color: #98a2b3;
  font-size: 18px;
  line-height: 20px;
  padding: 0;
  cursor: pointer;
}

.llx-toast-message .llx-toast-close:hover {
  color: #667085;
}

.llx-toast-message .llx-toast-simple {
  align-items: center;
}

.llx-toast-message .llx-toast-simple .llx-toast-main {
  padding-top: 0;
}

.llx-toast-message .llx-toast-simple .llx-toast-close {
  align-self: center;
}

.llx-toast-message .llx-toast-loading .llx-toast-icon,
.llx-toast-message .llx-toast-info .llx-toast-icon {
  background: #edf3ff;
  color: #2f6bff;
}

.llx-toast-message .llx-toast-success .llx-toast-icon {
  background: #ecfdf3;
  color: #16a34a;
}

.llx-toast-message .llx-toast-error .llx-toast-icon {
  background: #fef2f2;
  color: #dc2626;
}

.llx-toast-message .llx-toast-warning .llx-toast-icon {
  background: #fffbeb;
  color: #f59e0b;
}

.llx-toast-message .llx-toast-spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid rgba(47, 107, 255, 0.18);
  border-top-color: #2f6bff;
  animation: llxToastSpin 0.85s linear infinite;
}

.llx-toast-message .llx-toast-check,
.llx-toast-message .llx-toast-error-icon,
.llx-toast-message .llx-toast-info-icon,
.llx-toast-message .llx-toast-warning-icon {
  width: 22px;
  height: 22px;
  position: relative;
  display: inline-block;
}

.llx-toast-message .llx-toast-check::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 7px;
  width: 12px;
  height: 7px;
  border-left: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  transform: rotate(-45deg);
  border-radius: 1px;
}

.llx-toast-message .llx-toast-error-icon::before,
.llx-toast-message .llx-toast-error-icon::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 3px;
  width: 3px;
  height: 17px;
  border-radius: 999px;
  background: currentColor;
}

.llx-toast-message .llx-toast-error-icon::before {
  transform: rotate(45deg);
}

.llx-toast-message .llx-toast-error-icon::after {
  transform: rotate(-45deg);
}

.llx-toast-message .llx-toast-info-icon {
  border: 2px solid currentColor;
  border-radius: 50%;
}

.llx-toast-message .llx-toast-info-icon::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 8px;
  width: 3px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}

.llx-toast-message .llx-toast-info-icon::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 4px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
}

.llx-toast-message .llx-toast-warning-icon::before {
  content: "!";
  position: absolute;
  left: 2px;
  top: 1px;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
}

/* GET / 列表加载提示 */
/* 默认在浏览器底部中间 */
/* 传 anchor 时，横向居中到 anchor 元素中间，但 DOM 仍挂在全局根节点 */
.llx-toast-fetch-message {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 12000;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  max-width: calc(100vw - 24px);
}

.llx-toast-fetch {
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  max-width: 100%;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(23, 32, 51, 0.9);
  color: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  animation: llxToastFetchIn 0.2s ease both;
}

.llx-toast-fetch.is-leaving {
  animation: llxToastFetchOut 0.18s ease both;
}

.llx-toast-fetch-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.llx-toast-fetch-text:empty {
  display: none;
}

.llx-toast-fetch-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding-top: 1px;
  flex: 0 0 auto;
}

.llx-toast-fetch-dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.45;
  animation: llxToastFetchDot 0.9s ease-in-out infinite;
}

.llx-toast-fetch-dots i:nth-child(2) {
  animation-delay: 0.15s;
}

.llx-toast-fetch-dots i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes llxToastSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes llxToastIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes llxToastOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  to {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

@keyframes llxToastFetchDot {
  0%, 80%, 100% {
    opacity: 0.35;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@keyframes llxToastFetchIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes llxToastFetchOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  to {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
}

@media (max-width: 540px) {
  .llx-toast-message {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
  }

  .llx-toast-message .llx-toast {
    grid-template-columns: 38px minmax(0, 1fr) 20px;
    gap: 10px;
  }

  .llx-toast-message .llx-toast-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .llx-toast-fetch-message {
    bottom: 16px;
  }
}