/* 转运珠 · 结果详情页悬浮坞 + 启灵仪式 */
.lb-convert-dock {
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(88px, calc(72px + env(safe-area-inset-bottom)));
  z-index: 185;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}
.has-module-result-dock .lb-convert-dock {
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
}
.lb-convert-dock > * {
  pointer-events: auto;
}

.lb-convert-tip {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  width: min(288px, calc(100vw - 32px));
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(216, 180, 254, 0.38);
  background: linear-gradient(155deg, rgba(49, 24, 82, 0.97), rgba(14, 8, 28, 0.95));
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.5), 0 0 40px rgba(168, 85, 247, 0.22);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.94);
  transition: opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0.28s;
  pointer-events: none;
}
.lb-convert-tip::after {
  content: '';
  position: absolute;
  right: 22px;
  bottom: -6px;
  width: 12px;
  height: 12px;
  background: rgba(28, 14, 48, 0.97);
  border-right: 1px solid rgba(216, 180, 254, 0.32);
  border-bottom: 1px solid rgba(216, 180, 254, 0.32);
  transform: rotate(45deg);
}
.lb-convert-dock:hover .lb-convert-tip,
.lb-convert-dock:focus-within .lb-convert-tip,
.lb-convert-dock.is-tip-open .lb-convert-tip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.lb-convert-tip-title {
  margin: 0 0 8px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fde68a;
}
.lb-convert-tip-list {
  margin: 0;
  padding: 0 0 0 1.1em;
  font-size: 0.73rem;
  line-height: 1.58;
  color: rgba(237, 233, 254, 0.9);
}
.lb-convert-tip-foot {
  display: block;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.68rem;
  color: rgba(196, 181, 253, 0.78);
}
.lb-convert-tip-foot a {
  color: #c4b5fd;
  text-decoration: none;
}
.lb-convert-tip-foot a:hover {
  color: #fde68a;
}

/* 主按钮 */
.lb-convert-btn {
  position: relative;
  display: flex;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
}
.lb-convert-btn:focus-visible {
  outline: 2px solid rgba(251, 191, 36, 0.75);
  outline-offset: 5px;
}
.lb-convert-btn-ring {
  position: absolute;
  inset: -5px;
  border-radius: 999px;
  border: 1px solid rgba(251, 191, 36, 0.4);
  opacity: 0.65;
  animation: lb-ring-pulse 2.6s ease-in-out infinite;
  pointer-events: none;
}
.lb-convert-btn-ring--2 {
  inset: -11px;
  border-color: rgba(168, 85, 247, 0.28);
  animation-duration: 3.8s;
  animation-direction: reverse;
}
@keyframes lb-ring-pulse {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.08); opacity: 0.9; }
}
.lb-convert-btn-glow {
  position: absolute;
  inset: -12px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.4) 0%, rgba(124, 58, 237, 0.15) 55%, transparent 72%);
  filter: blur(10px);
  opacity: 0.75;
  animation: lb-glow-breathe 2.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes lb-glow-breathe {
  0%, 100% { opacity: 0.5; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1.06); }
}
.lb-convert-btn-core {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px 12px 15px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(251, 191, 36, 0.55);
  background: linear-gradient(135deg, rgba(76, 29, 149, 0.92), rgba(120, 53, 15, 0.82));
  color: #fef3c7;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s ease, border-color 0.22s ease;
}
.lb-convert-btn-core::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.22) 48%, transparent 66%);
  transform: translateX(-120%);
  animation: lb-btn-shimmer 3.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes lb-btn-shimmer {
  0%, 55% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}
.lb-convert-btn:hover:not(:disabled) .lb-convert-btn-core {
  transform: translateY(-3px);
  border-color: rgba(253, 224, 138, 0.85);
  box-shadow: 0 14px 40px rgba(251, 191, 36, 0.32), 0 0 28px rgba(168, 85, 247, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.lb-convert-btn:active:not(:disabled) .lb-convert-btn-core {
  transform: translateY(0) scale(0.97);
}
.lb-convert-btn i {
  font-size: 1.05rem;
  color: #fde68a;
  filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.65));
}
.lb-convert-btn-badge {
  min-width: 1.4rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.38);
  color: #fde68a;
  border: 1px solid rgba(251, 191, 36, 0.4);
}
.lb-convert-btn:disabled .lb-convert-btn-core {
  opacity: 0.5;
  filter: grayscale(0.4);
  cursor: not-allowed;
}
.lb-convert-btn:disabled .lb-convert-btn-ring,
.lb-convert-btn:disabled .lb-convert-btn-glow,
.lb-convert-btn:disabled .lb-convert-btn-core::before {
  animation: none;
}
.lb-convert-btn.is-loading .lb-convert-btn-core {
  pointer-events: none;
}
.lb-convert-btn.is-loading .lb-convert-btn-label {
  opacity: 0.85;
}

/* ========== 启灵仪式全屏 ========== */
.lb-convert-overlay {
  position: fixed;
  inset: 0;
  z-index: 9200;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.lb-convert-overlay[hidden] {
  display: none !important;
}
.lb-convert-overlay-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}
.lb-convert-overlay-veil {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 70% 55% at 50% 38%, rgba(168, 85, 247, 0.42) 0%, transparent 62%),
    radial-gradient(ellipse 50% 45% at 15% 80%, rgba(59, 130, 246, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse 40% 35% at 88% 25%, rgba(251, 191, 36, 0.18) 0%, transparent 50%),
    rgba(4, 2, 14, 0.9);
  backdrop-filter: blur(14px) saturate(1.15);
  animation: lb-veil-in 0.5s ease forwards;
}

/* 今日运势转运珠 · 星空穿梭（CosmicStarfield） */
.lb-convert-overlay.is-cosmic-style .lb-convert-overlay-veil {
  background: rgba(5, 3, 14, 0.82);
  backdrop-filter: blur(8px);
}
.lb-convert-overlay.is-cosmic-style .lb-convert-overlay-aurora,
.lb-convert-overlay.is-cosmic-style .lb-convert-overlay-stars {
  opacity: 0;
  animation: none;
}
.lb-convert-overlay-star-canvas {
  z-index: 1;
}
.lb-convert-overlay-particle-canvas {
  z-index: 2;
}
.lb-convert-overlay.is-cosmic-style .lb-convert-overlay-stage {
  z-index: 4;
}
@keyframes lb-veil-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.lb-convert-overlay-aurora {
  position: absolute;
  inset: -20%;
  z-index: 0;
  background: conic-gradient(from 0deg at 50% 50%,
    transparent 0deg,
    rgba(168, 85, 247, 0.08) 60deg,
    transparent 120deg,
    rgba(251, 191, 36, 0.06) 200deg,
    transparent 280deg);
  animation: lb-aurora-spin 24s linear infinite;
  opacity: 0.85;
  pointer-events: none;
}
@keyframes lb-aurora-spin {
  to { transform: rotate(360deg); }
}
.lb-convert-overlay-stars {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 8% 18%, rgba(255, 255, 255, 0.65), transparent),
    radial-gradient(1px 1px at 22% 72%, rgba(216, 180, 254, 0.5), transparent),
    radial-gradient(2px 2px at 48% 12%, rgba(253, 224, 138, 0.7), transparent),
    radial-gradient(1px 1px at 68% 38%, rgba(255, 255, 255, 0.45), transparent),
    radial-gradient(1.5px 1.5px at 84% 68%, rgba(196, 181, 253, 0.55), transparent),
    radial-gradient(1px 1px at 38% 92%, rgba(255, 255, 255, 0.4), transparent);
  animation: lb-stars-drift 20s linear infinite;
  opacity: 0.75;
  pointer-events: none;
}
@keyframes lb-stars-drift {
  to { transform: translateY(-32px); }
}
.lb-convert-overlay-stage {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 2rem 2.4rem;
  max-width: min(92vw, 400px);
  animation: lb-stage-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes lb-stage-rise {
  from { opacity: 0; transform: translateY(24px) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.lb-convert-overlay-sigil {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 220px;
  height: 220px;
  margin: -110px 0 0 -110px;
  border-radius: 50%;
  border: 1px dashed rgba(216, 180, 254, 0.22);
  pointer-events: none;
  animation: lb-sigil-spin 18s linear infinite;
}
.lb-convert-overlay-sigil::before {
  content: '✦ ☽ ✧ ☾ ✦';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  letter-spacing: 0.35em;
  color: rgba(253, 224, 138, 0.35);
  animation: lb-sigil-spin 18s linear infinite reverse;
}
@keyframes lb-sigil-spin {
  to { transform: rotate(360deg); }
}
.lb-convert-overlay-orbs {
  position: relative;
  width: 108px;
  height: 108px;
  margin: 0 auto 1.35rem;
}
.lb-convert-overlay-orbs .orb-main {
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 26%, #fffce8, #fcd34d 38%, #a855f7 78%, #4c1d95 100%);
  box-shadow:
    0 0 48px rgba(251, 191, 36, 0.6),
    0 0 90px rgba(124, 58, 237, 0.45),
    inset 0 -8px 20px rgba(76, 29, 149, 0.5);
  animation: lb-orb-float 2.4s ease-in-out infinite, lb-orb-pulse 1.8s ease-in-out infinite;
}
@keyframes lb-orb-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.15); }
}
.lb-convert-overlay-orbs .orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(216, 180, 254, 0.5);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.25);
  animation: lb-orb-spin 2.8s linear infinite;
}
.lb-convert-overlay-orbs .orb-ring--2 {
  inset: -14px;
  border-color: rgba(251, 191, 36, 0.3);
  animation-duration: 4.2s;
  animation-direction: reverse;
}
.lb-convert-overlay-orbs .orb-ring--3 {
  inset: -28px;
  border-style: dashed;
  border-color: rgba(168, 85, 247, 0.2);
  animation-duration: 6s;
}
.lb-convert-overlay-orbs .orb-spark {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fde68a;
  box-shadow: 0 0 12px #fbbf24;
}
.lb-convert-overlay-orbs .orb-spark--1 { top: 4px; left: 50%; margin-left: -3px; animation: lb-spark-orbit 3s linear infinite; }
.lb-convert-overlay-orbs .orb-spark--2 { bottom: 8px; right: 12px; animation: lb-spark-orbit 2.2s linear infinite reverse; }
.lb-convert-overlay-orbs .orb-spark--3 { top: 40%; left: 2px; animation: lb-spark-orbit 2.6s linear infinite 0.4s; }
@keyframes lb-orb-spin { to { transform: rotate(360deg); } }
@keyframes lb-orb-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes lb-spark-orbit {
  0% { transform: rotate(0deg) translateX(42px) rotate(0deg); opacity: 0.9; }
  50% { opacity: 1; }
  100% { transform: rotate(360deg) translateX(42px) rotate(-360deg); opacity: 0.7; }
}
.lb-convert-overlay-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: rgba(253, 224, 255, 0.95);
  background: rgba(124, 58, 237, 0.32);
  border: 1px solid rgba(216, 180, 254, 0.4);
  box-shadow: 0 0 24px rgba(168, 85, 247, 0.25);
}
.lb-convert-overlay-steps {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}
.lb-convert-overlay-steps li {
  width: 28px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  transition: background 0.35s ease, transform 0.35s ease, box-shadow 0.35s ease;
}
.lb-convert-overlay-steps li.is-active {
  background: linear-gradient(90deg, #a855f7, #fbbf24);
  transform: scaleX(1.15);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.45);
}
.lb-convert-overlay-stage > p {
  margin: 0;
  font-size: 0.95rem;
  color: #f3e8ff;
  letter-spacing: 0.05em;
  line-height: 1.55;
  min-height: 2.4em;
  transition: opacity 0.25s ease;
}
.lb-convert-overlay-stage > p.is-fading {
  opacity: 0.35;
}
.lb-convert-overlay-sub {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.72rem;
  color: rgba(196, 181, 253, 0.7);
  letter-spacing: 0.06em;
}
.lb-convert-overlay-burst {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 240px;
  height: 240px;
  margin: -120px 0 0 -120px;
  border-radius: 50%;
  border: 2px solid rgba(251, 191, 36, 0.55);
  opacity: 0;
  pointer-events: none;
}
.lb-convert-overlay-stage.is-success .orb-main {
  animation: lb-orb-success 0.75s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  box-shadow: 0 0 70px rgba(52, 211, 153, 0.55), 0 0 110px rgba(251, 191, 36, 0.4);
}
@keyframes lb-orb-success {
  0% { transform: scale(1); }
  35% { transform: scale(1.2); }
  100% { transform: scale(1); }
}
.lb-convert-overlay-stage.is-success .lb-convert-overlay-burst {
  animation: lb-burst-out 1s ease-out forwards;
}
.lb-convert-overlay-stage.is-success .lb-convert-overlay-sigil {
  border-color: rgba(52, 211, 153, 0.35);
}
@keyframes lb-burst-out {
  0% { transform: scale(0.15); opacity: 0.95; }
  100% { transform: scale(2.8); opacity: 0; }
}

body.lb-convert-reloading {
  opacity: 0;
  transition: opacity 0.5s ease;
}

@media (max-width: 640px) {
  .lb-convert-dock {
    right: max(10px, env(safe-area-inset-right));
    bottom: max(76px, calc(64px + env(safe-area-inset-bottom)));
  }
  .lb-convert-btn-core {
    padding: 10px 14px 10px 12px;
    font-size: 0.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lb-convert-btn-ring,
  .lb-convert-btn-glow,
  .lb-convert-btn-core::before,
  .lb-convert-overlay-stars,
  .lb-convert-overlay-aurora,
  .lb-convert-overlay-sigil,
  .lb-convert-overlay-orbs .orb-ring,
  .lb-convert-overlay-orbs .orb-main,
  .lb-convert-overlay-orbs .orb-spark {
    animation: none;
  }
}
