/* MSC Modal System - 全局弹窗系统 */

/* 遮罩层 */
.msc-confirm,
.msc-alert,
.msc-notify {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: none;
}

.msc-confirm.show,
.msc-alert.show,
.msc-notify.show {
  display: block;
}

/* 背景遮罩 */
.msc-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  animation: msc-fade-in 0.2s ease;
  z-index: 10000;
}

/* 关闭按钮 */
.msc-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.8);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
}

.msc-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

/* 内容容器 */
.msc-content {
  position: fixed;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  min-width: 320px;
  max-width: 420px;
  overflow: hidden;
  z-index: 10001;
}

/* 确认框动画 */
.msc-confirm--animate {
  animation: msc-bounce-in 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* 警告框动画 */
.msc-alert--animate {
  animation: msc-slide-down 0.3s ease;
}

/* 通知框容器 */
.msc-notify {
  pointer-events: none;
}

.msc-notify .msc-overlay {
  display: none;
}

.msc-notify .msc-content {
  pointer-events: all;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 300px;
  max-width: 400px;
  animation: msc-slide-down 0.3s ease;
}

/* 标题 */
.msc-title {
  margin: 0;
  padding: 24px 24px 16px;
  font-size: 16px;
  font-weight: 500;
  color: #1a1a1a;
  border-bottom: none;
  text-align: center;
}

/* 内容区域 */
.msc-body {
  padding: 0 24px 24px;
  color: #666;
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
}

.msc-body p {
  margin: 0;
}

.msc-sub {
  color: #666;
  font-size: 14px;
  margin: 0;
  line-height: 1.6;
}

/* 按钮区域 */
.msc-action {
  padding: 0 24px 24px;
  display: flex;
  justify-content: center;
  gap: 12px;
  border-top: none;
  background: transparent;
}

.msc-action .msc-ok {
  border: 1px solid #d0d0d0;
  color: #333;
}

.msc-action button {
  padding: 10px 32px;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 400;
  background: white;
  color: #666;
  min-width: 80px;
}

.msc-ok {
  background: white;
  color: #333;
  border-color: #d0d0d0;
}

.msc-ok:hover {
  background: #f5f5f5;
  border-color: #b0b0b0;
}

.msc-ok:active {
  background: #e8e8e8;
}

/* 成功/失败：让 OK 按钮样式更接近截图 */
.msc-modal-success .msc-ok {
  border-color: #52c41a;
  color: #52c41a;
}

.msc-modal-success .msc-ok:hover {
  background: rgba(82, 196, 26, 0.08);
  border-color: #52c41a;
}

.msc-modal-error .msc-ok {
  border-color: #ff4d4f;
  color: #ff4d4f;
}

.msc-modal-error .msc-ok:hover {
  background: rgba(255, 77, 79, 0.08);
  border-color: #ff4d4f;
}

/* 标题更醒目（类似截图） */
.msc-modal-success .msc-title,
.msc-modal-error .msc-title {
  font-size: 20px;
  font-weight: 600;
  padding-top: 28px;
  padding-bottom: 14px;
}

.msc-cancel {
  background: white;
  color: #666;
  border: 1px solid #e0e0e0;
}

.msc-cancel:hover {
  background: #f5f5f5;
  border-color: #b0b0b0;
}

/* 通知框样式变体 */
.msc-notify .msc-content {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.msc-notify .msc-title {
  color: white;
  border-bottom-color: rgba(255, 255, 255, 0.2);
}

.msc-notify .msc-body {
  color: rgba(255, 255, 255, 0.9);
}

.msc-notify .msc-action {
  border-top-color: rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.1);
}

.msc-notify .msc-ok {
  background: white;
  color: #667eea;
}

.msc-notify .msc-ok:hover {
  background: rgba(255, 255, 255, 0.9);
}

/* 警告框样式 */
.msc-alert .msc-title {
  color: #faad14;
}

/* 成功提示 */
.msc-notify.success .msc-content {
  background: linear-gradient(135deg, #52c41a 0%, #73d13d 100%);
}

/* 错误提示 */
.msc-notify.error .msc-content {
  background: linear-gradient(135deg, #ff4d4f 0%, #ff7875 100%);
}

/* 警告提示 */
.msc-notify.warning .msc-content {
  background: linear-gradient(135deg, #faad14 0%, #ffc53d 100%);
}

/* 信息提示 */
.msc-notify.info .msc-content {
  background: linear-gradient(135deg, #1890ff 0%, #40a9ff 100%);
}

/* 动画 */
@keyframes msc-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes msc-bounce-in {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }

  50% {
    transform: translate(-50%, -50%) scale(1.05);
  }

  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes msc-slide-down {
  from {
    opacity: 0;
    transform: translate(-50%, -100%);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* 响应式 */
@media screen and (max-width: 500px) {
  .msc-content {
    min-width: 280px;
    max-width: calc(100vw - 40px);
  }

  .msc-notify .msc-content {
    min-width: 260px;
    max-width: calc(100vw - 40px);
  }

  .msc-title {
    font-size: 16px;
    padding: 16px 20px;
  }

  .msc-body {
    padding: 20px;
    font-size: 13px;
  }

  .msc-action {
    padding: 12px 20px;
  }
}