/* P5 风格通知 — 读者站与编辑部共用（依赖 :root 上的 --sans/--zine-shout 或 admin 的 --font-util/--font-shout） */
.anth-p5-notify-wrap {
  --anth-p5-n-red: #e50000;
  --anth-p5-n-black: #000000;
  --anth-p5-n-white: #ffffff;
  --anth-p5-n-snap: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --p5n-sans: var(--sans, var(--font-util, "Inter", system-ui, sans-serif));
  --p5n-shout: var(--zine-shout, var(--font-shout, "Archivo Black", "Inter", system-ui, sans-serif));
  position: fixed;
  top: 28px;
  right: 28px;
  left: auto;
  bottom: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: flex-end;
  /* 高于后台 desk-nav-loader (99999)，避免「加载中」盖住通知 */
  z-index: 200000;
  pointer-events: none;
  max-width: min(calc(100vw - 56px), 400px);
}

.anth-p5-notify {
  position: relative;
  width: 380px;
  max-width: 100%;
  background: var(--anth-p5-n-white);
  border: 5px solid var(--anth-p5-n-black);
  overflow: hidden;
  box-shadow: 12px 12px 0 var(--anth-p5-n-black);
  opacity: 0;
  transform: translateX(120%) rotate(8deg) scale(0.7);
  animation: anthP5NotifyIn 0.55s var(--anth-p5-n-snap) forwards;
  pointer-events: auto;
}

.anth-p5-notify::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(135deg, var(--anth-p5-n-accent) 0%, var(--anth-p5-n-accent) 14%, transparent 14%),
    linear-gradient(-35deg, transparent 0%, transparent 94%, var(--anth-p5-n-black) 94%, var(--anth-p5-n-black) 100%);
}

.anth-p5-notify--success {
  --anth-p5-n-accent: #e50000;
}

.anth-p5-notify--error {
  --anth-p5-n-accent: #000000;
}

.anth-p5-notify--review {
  --anth-p5-n-accent: #e50000;
}

.anth-p5-notify--warning {
  --anth-p5-n-accent: #ff7a00;
}

.anth-p5-notify__speed {
  position: absolute;
  width: 220px;
  height: 10px;
  background: var(--anth-p5-n-white);
  top: 0;
  right: -180px;
  transform: rotate(-34deg);
  opacity: 0;
  z-index: 2;
  pointer-events: none;
  animation: anthP5NotifySpeed 0.5s ease;
}

.anth-p5-notify__top {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px 0;
}

.anth-p5-notify__label {
  background: var(--anth-p5-n-black);
  color: var(--anth-p5-n-white);
  padding: 7px 12px;
  font-family: var(--p5n-sans);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  transform: skewX(-14deg);
}

.anth-p5-notify__code {
  font-family: var(--p5n-sans);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--anth-p5-n-black);
}

.anth-p5-notify__content {
  position: relative;
  z-index: 3;
  padding: 18px 20px 52px;
}

.anth-p5-notify__title {
  font-family: var(--p5n-shout);
  font-size: clamp(1.35rem, 4.5vw, 1.75rem);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 14px;
  color: var(--anth-p5-n-black);
  transform: skewX(-5deg);
}

.anth-p5-notify__desc {
  font-family: var(--p5n-sans);
  font-size: 14px;
  line-height: 1.75;
  font-weight: 500;
  color: #1f1f1f;
  text-transform: none;
  letter-spacing: 0.02em;
}

.anth-p5-notify__tag {
  position: absolute;
  right: 16px;
  bottom: 16px;
  background: var(--anth-p5-n-accent);
  color: var(--anth-p5-n-white);
  border: 3px solid var(--anth-p5-n-black);
  padding: 7px 10px;
  font-family: var(--p5n-sans);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  transform: skewX(-14deg) rotate(-5deg);
  z-index: 5;
  box-shadow: 4px 4px 0 var(--anth-p5-n-black);
  max-width: calc(100% - 32px);
  word-break: break-word;
}

.anth-p5-notify.is-out {
  animation: anthP5NotifyOut 0.45s ease forwards !important;
}

@keyframes anthP5NotifySpeed {
  0% {
    opacity: 0;
    transform: translateX(0) rotate(-34deg);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(-260px) rotate(-34deg);
  }
}

@keyframes anthP5NotifyIn {
  0% {
    opacity: 0;
    transform: translateX(120%) rotate(12deg) scale(0.7);
  }
  70% {
    opacity: 1;
    transform: translateX(-10px) rotate(-2deg) scale(1.04);
  }
  100% {
    opacity: 1;
    transform: translateX(0) rotate(0deg) scale(1);
  }
}

@keyframes anthP5NotifyOut {
  to {
    opacity: 0;
    transform: translateX(120%) rotate(8deg) scale(0.8);
  }
}

@media (max-width: 640px) {
  .anth-p5-notify-wrap {
    right: 14px;
    left: 14px;
    top: 14px;
    align-items: stretch;
    max-width: none;
  }

  .anth-p5-notify {
    width: min(92vw, 380px);
  }
}
