/* 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.5);
  animation: msc-fade-in 0.3s ease;
  z-index: 10000;
}

/* 关闭按钮 */
.msc-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.3s;
  z-index: 10002;
}

.msc-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

/* 内容容器 */
.msc-content {
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  min-width: 320px;
  max-width: 500px;
  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: 20px 24px;
  font-size: 18px;
  font-weight: 600;
  color: #333;
  border-bottom: 1px solid #f0f0f0;
}

/* 内容区域 */
.msc-body {
  padding: 24px;
  color: #666;
  font-size: 14px;
  line-height: 1.6;
}

.msc-body p {
  margin: 0;
}

.msc-sub {
  color: #999;
  font-size: 13px;
  margin-top: 8px;
}

/* 按钮区域 */
.msc-action {
  padding: 16px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid #f0f0f0;
  background: #fafafa;
}

.msc-action button {
  padding: 8px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 500;
}

.msc-ok {
  background: #1890ff;
  color: white;
}

.msc-ok:hover {
  background: #40a9ff;
}

.msc-ok:active {
  background: #096dd9;
}

.msc-cancel {
  background: white;
  color: #666;
  border: 1px solid #d9d9d9;
}

.msc-cancel:hover {
  color: #1890ff;
  border-color: #1890ff;
}

/* 通知框样式变体 */
.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;
  }
}
