/* Extracted from index.html. Generated result stack, loader, timers, and result image actions. */

.result-stack-wrap {
  position: relative;
}

.result-error-overlay {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 2;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 14px;
  pointer-events: none;
}
.result-panel.has-error .result-error-overlay {
  display: flex;
}
/* 至少有一张成功图时，错误提示改为底部轻提示，不遮挡图片交互 */
.result-panel.has-error.has-success-image .result-error-overlay {
  inset: auto 0 0 0;
  min-height: 48px;
  align-items: flex-end;
  justify-content: center;
  padding: 8px 10px 9px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.14), rgba(0, 0, 0, 0));
  border-radius: 0 0 14px 14px;
}
.result-error-text {
  font-size: 13px;
  color: var(--muted);
  word-break: break-word;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  line-clamp: 4;
}
.result-panel.has-error.has-success-image .result-error-text {
  color: #f8fafc;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.result-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.result-item {
  border: none;
  border-radius: 0;
  overflow: visible;
  background: transparent;
  width: min(100%, 221px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  position: relative;
}

.result-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #fff;
  flex-shrink: 0;
}

.result-item.sb-edit-background-running .result-frame::after,
.result-item.sb-edit-highlight-pulse .result-frame::after {
  content:"";
  position:absolute;
  z-index:7;
  inset:2px;
  border-radius:12px;
  padding:3px;
  background:conic-gradient(from var(--sb-edit-glow-angle,0deg),#ff67c8,#8c7dff,#55dfff,#65f0a9,#ffe16d,#ff8b67,#ff67c8);
  -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);
  -webkit-mask-composite:xor;
  mask-composite:exclude;
  pointer-events:none;
  filter:drop-shadow(0 0 5px rgba(120,180,255,.5));
  opacity:.72;
  animation:sb-edit-border-flow 2.6s linear infinite;
}
.result-item.sb-edit-background-running .result-frame::after { opacity:.52; }
.result-item.sb-edit-highlight-pulse .result-frame::after {
  padding:4px;
  filter:drop-shadow(0 0 8px rgba(255,105,200,.72)) drop-shadow(0 0 13px rgba(85,223,255,.48));
  animation:sb-edit-border-flow 1.7s linear infinite,sb-edit-highlight-fade 5s ease-out forwards;
}
@property --sb-edit-glow-angle { syntax:"<angle>"; initial-value:0deg; inherits:false; }
@keyframes sb-edit-border-flow { to { --sb-edit-glow-angle:360deg; } }
@keyframes sb-edit-highlight-fade { 0%,72% { opacity:.95; } 100% { opacity:0; } }
@media (prefers-reduced-motion:reduce) {
  .result-item.sb-edit-background-running .result-frame::after,
  .result-item.sb-edit-highlight-pulse .result-frame::after { animation:none; }
}

.result-panel.generating-slot-1 .result-slot-1 .result-frame::before {
  content: none;
}
@keyframes result-slot-1-loading {
  0%, 100% {
    filter: blur(0);
    opacity: 1;
    background: rgba(255, 255, 255, 0.55);
    box-shadow: 0 0 16px rgba(255, 120, 180, 0.35), 0 0 28px rgba(120, 180, 255, 0.25);
  }
  50% {
    filter: blur(3px);
    opacity: 0.88;
    background: rgba(220, 210, 255, 0.6);
    box-shadow: 0 0 24px rgba(120, 200, 255, 0.45), 0 0 36px rgba(200, 120, 255, 0.3);
  }
}
html.theme-dark .result-panel.generating-slot-1 .result-slot-1 .result-frame::before {
  animation-name: result-slot-1-loading-dark;
}
@keyframes result-slot-1-loading-dark {
  0%, 100% {
    filter: blur(0);
    opacity: 1;
    background: rgba(0, 0, 0, 0.35);
    box-shadow: 0 0 20px rgba(255, 140, 200, 0.4), 0 0 32px rgba(140, 180, 255, 0.3);
  }
  50% {
    filter: blur(3px);
    opacity: 0.85;
    background: rgba(40, 35, 55, 0.5);
    box-shadow: 0 0 28px rgba(160, 220, 255, 0.5), 0 0 40px rgba(220, 160, 255, 0.35);
  }
}

.result-panel.generating-slot-2 .result-slot-2 .result-frame::before {
  content: none;
}
html.theme-dark .result-panel.generating-slot-2 .result-slot-2 .result-frame::before {
  animation-name: result-slot-1-loading-dark;
}

.result-frame.result-frame-loading {
  background: linear-gradient(180deg, #fffdf4 0%, #f8fafc 100%);
}
.result-frame.result-frame-loading::before {
  content: none !important;
}
.banana-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  pointer-events: none;
}
.banana-loader-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 10px;
}
.banana-loader-dots span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #FFC106;
  animation: banana-dot-bounce 1.05s ease-in-out infinite;
  will-change: transform, opacity;
}
.banana-loader-dots span:nth-child(1) {
  opacity: 0.35;
  animation-delay: 0s;
}
.banana-loader-dots span:nth-child(2) {
  opacity: 0.65;
  animation-delay: 0.16s;
}
.banana-loader-dots span:nth-child(3) {
  opacity: 1;
  animation-delay: 0.32s;
}
@keyframes banana-dot-bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-4px); }
}
html.theme-dark .result-frame.result-frame-loading {
  background: linear-gradient(180deg, #202020 0%, #171717 100%);
}
html.theme-dark .banana-loader-label {
  color: rgba(240, 240, 240, 0.66);
}

.result-slot-timer {
  display: none;
  margin-top: 10px;
  padding: 0;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  color: var(--muted);
  opacity: 0.65;
  background: none;
  border: none;
}
.result-item.generating .result-slot-timer,
.result-item .result-slot-timer.result-slot-timer-done {
  display: inline-block;
}
.result-item .result-slot-timer.result-slot-timer-done {
  display: inline-block;
  min-width: 84px;
  text-align: center;
}
.result-slot-timer.result-slot-timer-done {
  animation: result-timer-done-in 0.35s ease forwards;
}
@keyframes result-timer-done-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-slot-add-one-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: transparent;
  border: none;
  box-sizing: border-box;
}
.result-slot-add-one-frame.result-slot-add-one-enter {
  animation: result-slot-add-one-in 0.35s ease forwards;
}
@keyframes result-slot-add-one-in {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.result-slot-add-one-btn {
  flex-shrink: 0;
}

.result-item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.28s ease;
}
.result-item:hover img {
  transform: scale(1.06);
}

.result-download-btn,
.result-select-btn,
.result-close-btn,
.result-person-detection-btn {
  position: absolute;
  height: 28px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  color: #1d1d1f;
  font: inherit;
  font-size: 12px;
  padding: 0 9px;
  cursor: pointer;
  opacity: 0;
  pointer-events: auto;
  transition: opacity 0.14s ease, transform 0.14s ease;
  z-index: 2;
}
.result-download-btn,
.result-select-btn,
.result-close-btn,
.result-person-detection-btn {
  width: 28px;
  min-width: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: rgba(255, 255, 255, 0.9);
  filter:
    drop-shadow(0 0 1px rgba(0, 0, 0, 0.65))
    drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35));
}
.result-action-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.result-select-btn .result-action-icon {
  transform: translateY(1px);
}
.result-download-btn::before,
.result-select-btn::before,
.result-close-btn::before,
.result-person-detection-btn::before {
  content: "";
  position: absolute;
  z-index: -1;
}
.result-download-btn {
  right: 4px;
  bottom: 4px;
  transform: translateY(0);
}
.result-download-btn.is-downloaded {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  min-width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #FFC106;
  box-shadow: none;
  opacity: 1;
  transform: translateY(0);
}
.result-download-btn.is-downloaded:hover {
  width: 28px;
  min-width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #FFC106;
  box-shadow: none;
}
.result-download-btn.is-downloading,
.result-download-btn.is-downloading:hover {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  min-width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  opacity: 0.92;
  transform: translateY(0);
  cursor: default;
}
.result-download-btn.is-downloading .result-action-icon {
  display: none;
}
.result-download-spinner {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid rgba(29, 29, 31, 0.18);
  border-top-color: #FFC106;
  animation: result-download-spin 0.78s linear infinite;
}
@keyframes result-download-spin {
  to { transform: rotate(360deg); }
}
.result-download-btn::before {
  right: -8px;
  bottom: -8px;
  width: 44px;
  height: 44px;
  left: auto;
  top: auto;
}
.result-select-btn {
  left: 4px;
  bottom: 4px;
  transform: translateY(0);
}
.result-select-btn.is-selected {
  color: #FFC106;
}
.result-select-btn::before {
  left: -8px;
  bottom: -8px;
  width: 44px;
  height: 44px;
  right: auto;
  top: auto;
}
.result-close-btn {
  right: 4px;
  top: 4px;
  transform: translateY(0);
  color: #ff453a;
  pointer-events: none;
}
html.command-key-held .result-frame:hover .result-close-btn {
  opacity: 1;
  pointer-events: auto;
}
.result-close-btn::before {
  right: -8px;
  top: -8px;
  width: 44px;
  height: 44px;
  left: auto;
  bottom: auto;
}

.result-person-detection-btn {
  top: 4px;
  left: 4px;
  width: 30px;
  min-width: 30px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translateY(0);
  opacity: 0;
  pointer-events: none;
  border: 0;
  border-radius: 0;
  color: rgba(255, 255, 255, 0.96);
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.result-person-detection-btn::before {
  left: -8px;
  top: -8px;
  width: 44px;
  height: 44px;
}
.result-person-detection-btn svg {
  width: 21px;
  height: 21px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.result-person-detection-btn .person-detection-frame {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
}
.result-person-detection-btn .person-detection-head,
.result-person-detection-btn .person-detection-body {
  fill: currentColor;
  stroke: none;
}
.result-person-detection-btn.is-detected {
  color: #ffc106;
  border-color: transparent;
  background: transparent;
}
.result-person-detection-btn.is-detected svg {
  transform: translateX(0);
}
.result-person-detection-btn.is-clear {
  color: rgba(255, 255, 255, 0.92);
  border-color: transparent;
  background: transparent;
}
.result-person-detection-btn.is-error {
  color: rgba(255, 255, 255, 0.92);
  border-color: transparent;
  background: transparent;
}
.result-person-detection-btn.is-manual {
  box-shadow: none;
}
.result-person-detection-btn:hover {
  transform: scale(1.08);
  background: transparent;
}
.result-frame:hover .result-person-detection-btn {
  opacity: 1;
  pointer-events: auto;
}
.result-frame:hover .result-person-detection-btn:hover {
  opacity: 1;
  pointer-events: auto;
}
.result-person-detection-spinner {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1.5px solid rgba(29, 29, 31, 0.16);
  border-top-color: #c49000;
  animation: result-person-detection-spin 0.8s linear infinite;
}
@keyframes result-person-detection-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .result-person-detection-spinner { animation: none; }
}

.result-download-btn:hover,
.result-select-btn:hover,
.result-person-detection-btn:hover {
  opacity: 1;
  pointer-events: auto;
}
html.command-key-held .result-frame:hover .result-close-btn:hover {
  opacity: 1;
  pointer-events: auto;
}
.result-download-btn:hover,
.result-select-btn:hover,
.result-close-btn:hover {
  transform: scale(1.08);
}
.result-download-btn:active,
.result-select-btn:active,
.result-close-btn:active,
.result-person-detection-btn:active {
  transform: scale(0.9);
  transition-duration: 0.08s;
}

.result-selected-tag {
  display: block;
  width: 6px;
  height: 6px;
  margin-top: 6px;
  border-radius: 50%;
  background: #35c759;
  pointer-events: none;
  flex-shrink: 0;
}
