/* ============================================================
   预约产品演示弹窗 - 公共样式
   所有页面共用，不要写在 pages 下
   ============================================================ */

/* 遮罩层 */
.reserve-modal-mask {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  animation: maskFadeIn 0.25s ease;
}

.reserve-modal-mask.active {
  display: flex;
}

@keyframes maskFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 弹窗主体 */
.reserve-modal {
  background: #fff;
  border-radius: 12px;
  width: 460px;
  max-width: 90vw;
  max-height: 90vh;
  overflow: hidden;
  /* 纵向 flex：内容超高时由 .reserve-modal-body 内部滚动，避免提交按钮被裁切 */
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 弹窗头部 */
.reserve-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #f0f0f0;
}

.reserve-modal-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0;
}

.reserve-modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 6px;
  color: #999;
  transition: all 0.2s;
}

.reserve-modal-close:hover {
  background: #f5f5f5;
  color: #333;
}

.reserve-modal-close svg {
  width: 20px;
  height: 20px;
}

/* 弹窗内容区 */
.reserve-modal-body {
  padding: 16px 40px 40px 40px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.reserve-modal-desc {
  font-size: 14px;
  color: #666;
  margin: 0 0 20px;
  line-height: 1.6;
}

/* 表单 */
.reserve-modal-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-item label {
  font-size: 14px;
  color: #333;
  font-weight: 500;
}

.required {
  color: #ff4d4f;
  margin-left: 2px;
}

.form-item input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
  color: #333;
  background: #fff;
  transition: border-color 0.2s;
  box-sizing: border-box;
  outline: none;
}

.form-item input:focus {
  border-color: var(--color-accent-orange, #ff8c00);
  box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.1);
}

.form-item input.error {
  border-color: #ff4d4f;
}

.form-code-row {
  display: flex;
  gap: 10px;
  width: 100%;
}

/*.form-code-row input {
  flex: 1;
}*/

.code-btn {
  flex-shrink: 0;
  width: 120px;
  height: 42px;
  padding: 0 14px;
  background: #fff;
  border: 1px solid var(--color-accent-orange, #ff8c00);
  color: var(--color-accent-orange, #ff8c00);
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

/* 服务端图形验证码：按原始 88×26 像素显示，避免放大模糊导致看错 */
.code-btn.is-image {
  padding: 0;
  overflow: hidden;
}

.code-btn.is-image img {
  display: block;
  width: 88px;
  height: 26px;
  margin: 0 auto;
  object-fit: none;
  filter: contrast(1.6) brightness(0.85);
}

/* 提交失败提示 */
.reserve-submit-error {
  display: none;
  margin: -4px 0 10px;
  font-size: 13px;
  line-height: 18px;
  color: #e34d59;
}

.code-btn:hover:not(:disabled) {
  background: var(--color-accent-orange, #ff8c00);
  color: #fff;
}

.code-btn:disabled {
  border-color: #ccc;
  color: #999;
  background: #f5f5f5;
  cursor: not-allowed;
}

/* 表单错误信息样式 */
/* 表单错误消息样式 */
/*.form-error {
  font-size: 12px;
  color: #ff4d4f;
  min-height: 16px;
  line-height: 16px;
}*/

/* 提交按钮 */
.reserve-submit-btn {
  width: 100%;
  height: 46px;
  background: var(--color-accent-orange, #ff8c00);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 4px;
}

.reserve-submit-btn:hover {
  background: #e88c1e;
}

.reserve-submit-btn:active {
  background: #d47f1a;
}

/* 成功提示 */
.reserve-success {
  display: none;
  text-align: center;
  padding: 20px 0;
}

.reserve-success.active {
  display: block;
  animation: successFadeIn 0.3s ease;
}

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

.reserve-success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  background: #52c41a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reserve-success-icon svg {
  width: 28px;
  height: 28px;
  color: #fff;
}

.reserve-success h4 {
  font-size: 18px;
  color: #333;
  margin: 0 0 8px;
}

.reserve-success p {
  font-size: 14px;
  color: #666;
  margin: 0;
}

/* ============================================================
   移动端适配
   ============================================================ */
@media (max-width: 768px) {
  .reserve-modal {
    width: calc(100% - 32px);
    max-height: calc(100vh - 32px);
    border-radius: 10px;
  }

  .reserve-modal-header {
    padding: 16px 20px;
  }

  .reserve-modal-header h3 {
    font-size: 16px;
  }

  .reserve-modal-body {
    padding: 20px;
  }

  .reserve-modal-desc {
    font-size: 13px;
    margin-bottom: 16px;
  }

  .reserve-modal-form {
    gap: 14px;
  }

  .form-item input {
    height: 40px;
    font-size: 15px;
  }

  .code-btn {
    width: 110px;
    height: 40px;
    font-size: 13px;
  }

  .reserve-submit-btn {
    height: 44px;
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  .reserve-modal {
    width: calc(100% - 24px);
  }

  .reserve-modal-body {
    padding: 16px;
  }

  .form-code-row {
    flex-direction: column;
    gap: 8px;
  }

  .code-btn {
    width: 100%;
  }
}

/* ============================================================
   预约演示弹窗 - 选择需求下拉（组件内置，全站统一，与首页一致）
   层级与导航「产品中心」一致；叶子 16px、悬浮加粗、选中红 #DA0029
   ============================================================ */
.form-item-demand {
  position: relative;
}

.form-item-demand > label {
  display: block;
}

.demand-select {
  position: relative;
  width: 100%;
}

.demand-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  height: 49px;
  padding: 0 14px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-size: 16px;
  color: #57575C;
  cursor: pointer;
  box-sizing: border-box;
  text-align: left;
}

.demand-trigger:focus {
  border-color: var(--color-accent-orange, #ff8c00);
  box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.1);
  outline: none;
}

.demand-trigger-value {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #57575C;
}

.demand-trigger-value.is-placeholder {
  color: #93959D;
}

.demand-trigger-arrow {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: #93959D;
  transition: transform 0.2s ease;
}

.demand-select.is-open .demand-trigger-arrow {
  transform: rotate(180deg);
}

.demand-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 320px;
  overflow-y: auto;
  background: #FFFFFF;
  border: 2px solid #E9EEF3;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 12px 0;
  display: none;
  z-index: 10;
}

.demand-select.is-open .demand-dropdown {
  display: block;
}

.demand-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 6px 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 18px;
  font-weight: 600;
  color: #57575C;
  text-align: left;
  box-sizing: border-box;
}

.demand-group-title.demand-sub {
  font-weight: 400;
  padding-left: 40px;
}

.demand-group-title:hover {
  font-weight: 600;
}

.demand-chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: #93959D;
  transition: transform 0.2s ease;
}

.demand-group.is-open > .demand-group-title > .demand-chevron {
  transform: rotate(180deg);
}

.demand-group-body {
  display: none;
}

.demand-group.is-open > .demand-group-body {
  display: block;
}

.demand-option {
  display: block;
  width: 100%;
  padding: 5px 20px 5px 60px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 16px;
  font-weight: 300;
  color: #57575C;
  text-align: left;
  line-height: 24px;
  box-sizing: border-box;
}

.demand-option:hover {
  font-weight: 600;
}

.demand-option.selected {
  color: #DA0029;
}

/* 字段标签右侧校验提示 */
.form-item label.rm-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.rm-label-text {
  flex: 0 0 auto;
}

.rm-hint {
  display: none;
  font-size: 14px;
  font-weight: 400;
  color: #DA0029;
  white-space: nowrap;
}

.form-item label.rm-label-row.has-error .rm-hint {
  display: inline;
}

/* 验证码字符按钮（加减法，点击刷新） */
#getCodeBtn {
  width: 120px;
  height: 42px;
  padding: 0 8px;
  font-family: Consolas, 'Courier New', 'Microsoft YaHei', monospace;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #333;
  background: #F0F2F5;
  border: 1px solid #AAAAAA;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

#getCodeBtn:hover {
  background: #E6E8EB;
  border-color: #999;
}

@media (max-width: 480px) {
  .demand-dropdown {
    max-height: 240px;
  }

  .demand-group-title.demand-sub {
    padding-left: 24px;
  }

  .demand-option {
    padding-left: 40px;
    padding-right: 12px;
  }
}
