/* ===== yixiang_modal.css - 意向线索弹窗 ===== */
/* 断点: PC(≥1024px,默认) / 折叠屏(600~1023px) / 手机(≤599px) */

/* --- 遮罩层 --- */
.yx-overlay {
  position: fixed;
  inset: 0;                 /* top/right/bottom/left 全 0 */
  background: rgba(0, 0, 0, 0.55);
  z-index: 9999;
  display: none;            /* 默认隐藏 */
  align-items: center;
  justify-content: center;
  padding: 20px;
  /* 锁滚动靠 JS，这里只负责视觉 */
  -webkit-overflow-scrolling: touch;
}
.yx-overlay.show {
  display: flex;
  /* 淡入动画 */
  animation: yx-fade-in 0.2s ease-out;
}

/* --- 弹窗主体 --- */
.yx-modal {
  background: #fff;
  width: 100%;
  max-width: 440px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  /* 弹出动画：从略微缩小+透明 放大变实 */
  animation: yx-pop-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- 顶部标题栏（红底白字，呼应站点主色） --- */
.yx-header {
  background: #b8363a;
  color: #fff;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.yx-title {
  font-size: 22px;
  font-weight: bold;
}
.yx-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0.9;
  transition: opacity 0.2s;
}
.yx-close:hover {
  opacity: 1;
}

/* --- 主体表单区 --- */
.yx-body {
  padding: 22px 24px 8px;
}
.yx-subtitle {
  font-size: 18px;
  color: #777;
  margin-bottom: 18px;
  line-height: 1.5;
}
.yx-field {
  margin-bottom: 16px;
}
.yx-label {
  display: block;
  font-size: 14px;
  color: #333;
  margin-bottom: 6px;
  font-weight: 500;
}
.yx-label .yx-required {
  color: #b8363a;
  margin-left: 2px;
}
.yx-input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #d0c8bc;
  border-radius: 6px;
  font-size: 15px;
  color: #333;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}
.yx-input:focus {
  outline: none;
  border-color: #b8363a;
  box-shadow: 0 0 0 3px rgba(184, 54, 58, 0.12);
}
.yx-input.yx-error {
  border-color: #e6a700;
  box-shadow: 0 0 0 3px rgba(230, 167, 0, 0.12);
}
.yx-hint {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}
.yx-hint.yx-error-msg {
  color: #c47b00;
}

/* --- 底部按钮区 --- */
.yx-footer {
  padding: 8px 24px 22px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}
.yx-btn {
  height: 42px;
  padding: 0 26px;
  border-radius: 6px;
  font-size: 15px;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: background 0.2s, opacity 0.2s;
}
.yx-btn-cancel {
  background: #f5f0ea;
  color: #666;
  border: 1px solid #d0c8bc;
}
.yx-btn-cancel:hover {
  background: #ede5db;
}
.yx-btn-submit {
  background: #b8363a;
  color: #fff;
  font-weight: 500;
}
.yx-btn-submit:hover {
  background: #a22e31;
}
.yx-btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* --- Toast 提示 --- */
.yx-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 14px;
  z-index: 10001;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
  max-width: 90%;
  text-align: center;
}
.yx-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.yx-toast.success {
  background: #2c8a4a;
}
.yx-toast.error {
  background: #c47b00;
}

/* --- 动画 keyframes --- */
@keyframes yx-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes yx-pop-in {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ===== 折叠屏（600~1023px）===== */
@media (min-width: 600px) and (max-width: 1023px) {
  .yx-modal {
    max-width: 420px;
  }
  .yx-header {
    padding: 16px 22px;
  }
  .yx-body {
    padding: 20px 22px 8px;
  }
  .yx-footer {
    padding: 8px 22px 20px;
  }
}

/* ===== 手机端（≤599px）===== */
@media (max-width: 599px) {
  .yx-overlay {
    padding: 12px;
    align-items: flex-end;        /* 手机端从底部滑入更自然 */
  }
  .yx-modal {
    max-width: 100%;
    border-radius: 12px 12px 0 0;
    animation: yx-slide-up 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .yx-header {
    padding: 14px 18px;
  }
  .yx-title {
    font-size: 18px;
  }
  .yx-body {
    padding: 18px 18px 6px;
  }
  .yx-subtitle {
    font-size: 16px;
    margin-bottom: 14px;
  }
  .yx-input {
    height: 40px;
    font-size: 14px;
  }
  .yx-footer {
    padding: 6px 18px 18px;
    gap: 10px;
  }
  .yx-btn {
    flex: 1;                      /* 手机端两个按钮等宽 */
    height: 40px;
    font-size: 14px;
  }
}

/* 手机端从底部滑入 */
@keyframes yx-slide-up {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
