/**
 * 模态框组件样式
 */

/* 模态框容器 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1050;
  display: none;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal.show {
  display: block;
}

/* 模态框对话框 */
.modal-dialog {
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  margin: 0;
  pointer-events: none;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  padding: 0;
  overflow: hidden;
}

/* 模态框内容 */
.modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  pointer-events: auto;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 0.3rem;
  outline: 0;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* 模态框头部 */
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1rem 1rem;
  border-bottom: 1px solid #dee2e6;
  border-top-left-radius: calc(0.3rem - 1px);
  border-top-right-radius: calc(0.3rem - 1px);
  flex-shrink: 0;
}

.modal-title {
  margin-bottom: 0;
  line-height: 1.5;
}

/* 关闭按钮 */
.close {
  padding: 1rem 1rem;
  margin: -1rem -1rem -1rem auto;
  background-color: transparent;
  border: 0;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: #000;
  text-shadow: 0 1px 0 #fff;
  opacity: 0.5;
  cursor: pointer;
}

.close:hover {
  color: #000;
  text-decoration: none;
  opacity: 0.75;
}

/* 模态框主体 */
.modal-body {
  position: relative;
  flex: 1 1 auto;
  padding: 1rem;
  overflow-y: auto;
  max-height: calc(80vh - 120px);
}

/* 模态框底部 */
.modal-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  padding: 0.75rem;
  border-top: 1px solid #dee2e6;
  border-bottom-right-radius: calc(0.3rem - 1px);
  border-bottom-left-radius: calc(0.3rem - 1px);
  flex-shrink: 0;
  background-color: #fff;
}

.modal-footer > * {
  margin: 0.25rem;
}

/* 响应式调整 */
@media (max-width: 575.98px) {
  .modal-dialog {
    max-width: 95%;
    width: 95%;
    max-height: 85vh;
    top: 5%;
  }
  
  .modal-content {
    border-radius: 0.5rem;
  }
  
  .modal-body {
    max-height: calc(85vh - 120px);
  }
}
