/* 按钮容器 */
.em-btn-container {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}

/* 触发按钮样式 */
.em-open-btn {
  text-align: center;
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
}

.em-submit-btn {
  background: #007bff;
  color: white;
}

.em-lost-btn {
  background: #dc3545;
  color: white;
}

.em-open-btn:hover {
  opacity: 0.9;
}

/* 遮罩层样式 */
.em-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 999;
}

/* 弹窗容器样式 - 固定宽高 + 非线性下滑动画 */
.em-modal-content {
  width: 600px;
  height: 600px;
  background: white;
  border-radius: 30px;
  padding: 20px;
  transform: translateY(100vh);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* 弹窗显示状态 */
.em-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.em-modal-overlay.active .em-modal-content {
  transform: translateY(0);
}

/* 关闭按钮样式 */
.em-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #f0f0f0;
  border: none;
  font-size: 20px;
  color: #666;
  cursor: pointer;
  position: absolute;
  top: 15px;
  right: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
  transition: background-color 0.2s ease;
  z-index: 10;
}

.em-close-btn:hover {
  background-color: #e0e0e0;
  color: #333;
}

/* 步骤容器样式 */
.em-steps-wrapper {
  flex: 1;
  overflow: hidden;
  position: relative;
  margin-top: 20px;
}

.em-steps-container {
  display: flex;
  height: 100%;
  transition: transform 0.3s ease;
}

/* step-item 优化 - 启用滚动 */
.em-step-item {
  min-width: 100%;
  height: 100%;
  padding: 0 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #ccc #f5f5f5;
}

/* Chrome滚动条优化 - step-item */
.em-step-item::-webkit-scrollbar {
  width: 6px;
}
.em-step-item::-webkit-scrollbar-track {
  background: #f5f5f5;
  border-radius: 4px;
}
.em-step-item::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}
.em-step-item::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* 核心：支持Markdown的滚动框样式（通用） */
.em-scroll-box {
  background-color: #e7e7e7;
  height: 300px;
  overflow-y: auto;
  padding: 15px;
  border: 1px solid #eee;
  border-radius: 8px;
  margin: 10px 0;
  width: 100%;
  font-family: 'Microsoft Yahei', sans-serif;
  line-height: 1.8;
  scrollbar-width: thin;
  scrollbar-color: #ccc #f5f5f5;
}

/* Markdown 渲染样式优化（核心） */
.em-scroll-box h1 {
  font-size: 20px;
  margin: 10px 0;
  color: #333;
}
.em-scroll-box h2 {
  font-size: 18px;
  margin: 8px 0;
  color: #444;
}
.em-scroll-box h3 {
  font-size: 16px;
  margin: 6px 0;
  color: #555;
}
.em-scroll-box p {
  margin: 6px 0;
}
.em-scroll-box ul,
.em-scroll-box ol {
  margin: 8px 0 8px 20px;
}
.em-scroll-box li {
  margin: 4px 0;
}
.em-scroll-box code {
  background: #f5f5f5;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Consolas', monospace;
  font-size: 14px;
}
.em-scroll-box pre {
  background: #f5f5f5;
  padding: 10px;
  border-radius: 6px;
  margin: 8px 0;
  overflow-x: auto;
}
.em-scroll-box pre code {
  padding: 0;
}
.em-scroll-box a {
  color: #007bff;
  text-decoration: none;
}
.em-scroll-box a:hover {
  text-decoration: underline;
}
.em-scroll-box blockquote {
  border-left: 4px solid #ddd;
  padding-left: 10px;
  color: #666;
  margin: 8px 0;
}

/* Chrome滚动条优化 */
.em-scroll-box::-webkit-scrollbar {
  width: 6px;
}
.em-scroll-box::-webkit-scrollbar-track {
  background: #f5f5f5;
  border-radius: 4px;
}
.em-scroll-box::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}
.em-scroll-box::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* 完成页面样式 */
.em-complete-page {
  min-width: 100%;
  height: 100%;
  padding: 0 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.8s ease,
    transform 0.8s ease;
}

.em-complete-page.active {
  opacity: 1;
  transform: translateY(0);
}

#em-modal-title {
  text-align: center;
  font-size: 200%;
  padding-bottom: 20px;
  margin-top: 10px;
}

#em-modal-second {
  text-align: center;
  font-size: 130%;
  padding-bottom: 20px;
}

#em-modal-rd {
  text-align: left;
  font-size: 130%;
  padding-bottom: 20px;
}

#em-modal-text {
  text-align: left;
  font-size: 120%;
}

.em-complete-text {
  font-size: 36px;
  color: #000000;
  font-weight: bold;
  margin-bottom: 20px;
}

.em-complete-desc {
  font-size: 20px;
  color: #666;
  text-align: center;
  line-height: 1.6;
}

/* 步骤按钮组样式 */
.em-step-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding: 20px 10px 10px;
  margin-top: 10px;
  width: 100%;
}

.em-step-btn {
  padding: 10px 0;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.2s ease;
  flex: 1;
  max-width: 200px;
  min-width: 120px;
}

.em-prev-btn {
  background-color: #f5f5f5;
  color: #666;
  display: none;
}

.em-prev-btn:hover {
  background-color: #e9e9e9;
}

.em-prev-btn:disabled {
  background-color: #fafafa;
  color: #ccc;
  cursor: not-allowed;
}

.em-next-btn {
  background-color: #007bff;
  color: white;
}

.em-next-btn:hover {
  background-color: #0056b3;
}

.em-complete-btn {
  background-color: #28a745;
  color: white;
}

.em-complete-btn:hover {
  background-color: #1e7e34;
}

/* modal-body 样式 */
.em-modal-body {
  line-height: 1.6;
  width: 100%;
  padding-left: 50px;
  padding-right: 50px;
  margin-top: 20px;
}

/* 表单样式 */
.em-form-group {
  margin-bottom: 15px;
  width: 100%;
}

.em-form-label {
  display: block;
  margin-bottom: 5px;
  font-size: 16px;
  color: #333;
}

/* 必填字段提示 */
.em-form-label.required::after {
  content: '*';
  color: #dc3545;
  margin-left: 5px;
}

.em-form-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 16px;
}

/* 表单验证错误样式 */
.em-form-input:invalid,
.em-form-textarea:invalid {
  border-color: #dc3545;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.1);
}

.em-form-input:focus:invalid,
.em-form-textarea:focus:invalid {
  border-color: #dc3545;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.em-form-textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 16px;
  min-height: 120px;
  resize: vertical;
}

.em-checkbox-group {
  display: flex;
  align-items: center;
  margin: 10px 0;
}

.em-form-checkbox {
  margin-right: 8px;
  width: 18px;
  height: 18px;
}

/* 选项按钮容器样式（em-option-buttons） */
.em-option-buttons {
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: center;
  width: 100%;
  margin-top: 20px;
}

/* 选项按钮样式（em-option-btn） */
.em-option-btn {
  padding: 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.2s ease;
}

/* 按钮hover交互效果（可选，提升体验） */
.em-option-btn:hover {
  background-color: #f5f5f5;
  border-color: #ccc;
}

.em-file-input {
  padding: 5px;
  border: 1px solid #ddd;
  border-radius: 6px;
  width: 100%;
}

/* 验证提示样式 */
.em-validation-message {
  color: #dc3545;
  font-size: 14px;
  margin-top: 5px;
  display: none;
}

.em-validation-message.show {
  display: block;
}

/* 新增：加载中样式 */
.em-loading-page {
  min-width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.8s ease,
    transform 0.8s ease;
}
.em-loading-page.active {
  opacity: 1;
  transform: translateY(0);
}
.em-loading-text {
  font-size: 24px;
  color: #333;
  margin-bottom: 20px;
  text-align: center;
}
.em-loading-desc {
  font-size: 16px;
  color: #666;
  text-align: center;
  line-height: 1.6;
}
/* 关闭按钮隐藏样式 */
.em-modal-overlay.loading .em-close-btn {
  display: none;
}

/* 错误高亮样式 */
.error-highlight {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .em-modal-content {
    width: 95%;
    height: 80vh;
    border-radius: 20px;
  }

  .em-modal-body {
    padding-left: 20px;
    padding-right: 20px;
  }

  .em-step-item {
    padding: 0 5px;
  }

  .em-step-buttons {
    padding: 15px 5px 10px;
  }
}
