/* 节点生成遮罩：深灰底 + 白色渐变流光；上计时、中「正在生成中」 */

@keyframes mirror-gen-bg-flow {
  0%,
  100% {
    background-position: 0% 50%, 100% 50%, 0% 0%;
  }
  50% {
    background-position: 100% 50%, 0% 50%, 100% 100%;
  }
}

[data-mirror-gen-overlay-active] [data-testid="text-node-generating-placeholder"] {
  opacity: 0 !important;
  visibility: hidden !important;
}

@keyframes mirror-gen-shimmer-sweep {
  0% {
    transform: translateX(-70%) skewX(-10deg);
    opacity: 0;
  }
  15% {
    opacity: 0.7;
  }
  85% {
    opacity: 0.7;
  }
  100% {
    transform: translateX(70%) skewX(-10deg);
    opacity: 0;
  }
}

@keyframes mirror-gen-breathe {
  0%,
  100% {
    opacity: 0.15;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 0.4;
    transform: translate(-50%, -50%) scale(1.06);
  }
}

@keyframes mirror-gen-label-pulse {
  0%,
  100% {
    opacity: 0.78;
  }
  50% {
    opacity: 1;
  }
}

/* 深灰底 + 白色渐变层 */
div[data-mirror-gen-overlay-backdrop] {
  background-color: #2a2a2e !important;
  background-image: radial-gradient(
      ellipse 100% 80% at 50% 18%,
      rgba(255, 255, 255, 0.14) 0%,
      transparent 55%
    ),
    radial-gradient(
      ellipse 85% 70% at 85% 88%,
      rgba(255, 255, 255, 0.06) 0%,
      transparent 50%
    ),
    linear-gradient(
      155deg,
      #3a3a40 0%,
      #2e2e32 35%,
      #252528 68%,
      #2c2c30 100%
    ) !important;
  background-size: 200% 200%, 200% 200%, 300% 300% !important;
  animation: mirror-gen-bg-flow 8s ease-in-out infinite !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  overflow: hidden !important;
  isolation: isolate;
}

/* 白色流光 */
div[data-mirror-gen-overlay-backdrop]::before {
  content: "";
  position: absolute;
  inset: -40%;
  z-index: 1;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.04) 38%,
    rgba(255, 255, 255, 0.22) 50%,
    rgba(255, 255, 255, 0.04) 62%,
    transparent 100%
  );
  animation: mirror-gen-shimmer-sweep 2.8s cubic-bezier(0.45, 0.05, 0.2, 1) infinite;
  pointer-events: none;
}

/* 中心白色柔光 */
div[data-mirror-gen-overlay-backdrop]::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(80%, 200px);
  height: min(65%, 160px);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.03) 45%,
    transparent 72%
  );
  animation: mirror-gen-breathe 3.8s ease-in-out infinite;
  pointer-events: none;
}

/* HUD 铺满，内容居中 */
div[data-mirror-gen-overlay-hud] {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 60 !important;
  pointer-events: none !important;
}

div[data-mirror-gen-overlay-hud] > svg,
div[data-mirror-gen-overlay-hud] > img {
  display: none !important;
}

/* 竖排：上时间、下文案 */
div[data-mirror-gen-overlay-stack] {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  text-align: center;
  user-select: none;
  pointer-events: none;
}

/* 时间（上方，小号） */
div[data-mirror-gen-overlay-hud] [data-mirror-gen-overlay-timer] {
  order: 1;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace !important;
  font-size: 0.6875rem !important;
  font-weight: 400 !important;
  line-height: 1 !important;
  letter-spacing: 0.1em !important;
  color: rgba(255, 255, 255, 0.48) !important;
}

div[data-mirror-gen-overlay-hud] [data-mirror-gen-overlay-timer]::before {
  display: none !important;
}

/* 正在生成中（中间主文案） */
div[data-mirror-gen-overlay-hud] [data-mirror-gen-overlay-label] {
  order: 2;
  font-size: 0.8125rem !important;
  font-weight: 500 !important;
  line-height: 1.35 !important;
  letter-spacing: 0.06em !important;
  color: rgba(255, 255, 255, 0.88) !important;
  animation: mirror-gen-label-pulse 2.4s ease-in-out infinite;
}

/* 关闭按钮右上角 */
div[data-mirror-gen-overlay-hud] button[aria-label="取消当前生成"] {
  position: absolute !important;
  top: 0.5rem !important;
  right: 0.5rem !important;
  margin: 0 !important;
  z-index: 4 !important;
  pointer-events: auto !important;
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  box-shadow: none !important;
  color: rgba(255, 255, 255, 0.65) !important;
}

div[data-mirror-gen-overlay-hud] button[aria-label="取消当前生成"]:hover {
  background: rgba(239, 68, 68, 0.85) !important;
  border-color: rgba(239, 68, 68, 0.5) !important;
  color: #fff !important;
}
