// 统一自适应弹窗组件样式
.unified-modal-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  visibility: visible;
  z-index: 1000;
  pointer-events: none;
  &.unified-fullscreen {
    .unified-modal-content {
      left: 0 !important;
      right: 0 !important;
      bottom: 0 !important;
      transform: none !important;
      top: 0 !important;
      width: 100% !important;
      height: 100% !important;
      .unified-modal-body {
        width: 100% !important;
        height: 100% !important;
        transform: none !important;
      }
    }
  }
  .unified-modal-content {
    z-index: 1001;
    opacity: 1;
    pointer-events: none;
    &.unified-modal-content-dragging {
      transition: none !important;
    }
    .unified-modal-body {
      height: 100%;
      overflow: auto;
      pointer-events: auto;
    }
  }
  // 基础容器样式
  &[data-mode='drawer'] {
    .unified-modal-content {
      position: absolute;
      top: 0;
      right: 0;
      bottom: 0;
      transition: transform 0.2s ease-in-out;
      box-shadow: 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
      .unified-modal-body {
        transform: none !important;
      }
    }
  }
  &[data-mode='modal'] {
    // 模态框模式样式
    .unified-modal-content {
      position: absolute;
      top: 100px;
      left: 50%;
      transform: translateX(-50%) scale(0);
      transition: transform 0.2s ease-in-out;
    }
  }
  &[data-mode='fullscreen'] {
    .unified-modal-content {
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      width: 100%;
      height: 100%;
      box-shadow: none;
    }
  }

  // 过渡动画状态（如需可在此增强动画效果）
  &.unified-modal-transitioning {
    // 保留占位以便将来扩展；避免空规则警告
    outline: none;
  }

  // 模式切换按钮样式
  .unified-modal-mode-buttons {
    button {
      &:hover:not([style*='background: #1890ff']) {
        background: #f5f5f5 !important;
        border-color: #d9d9d9 !important;
      }
    }
  }

  // 遮罩层样式
  .unified-modal-mask {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  &[data-visible='true'] {
    .unified-modal-mask {
      opacity: 1;
    }
  }
}

// 动画关键帧
@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(100%);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes fadeOutScale {
  from {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
}

@keyframes fullscreenIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fullscreenOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.9);
  }
}
