/* =========================================================
   通用询盘弹窗 · inquiry-modal.css
   复用站点主色变量；所有规则限定在 .ky-modal 作用域，
   不影响联系页 / 首页内嵌的公共表单。
   ========================================================= */

.ky-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.ky-modal.is-on {
  display: flex;
}

/* ---------- 遮罩 ---------- */
.ky-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 18, 26, 0.58);
  backdrop-filter: saturate(150%) blur(5px);
  -webkit-backdrop-filter: saturate(150%) blur(5px);
  animation: kyFadeIn 0.22s var(--ease, ease) both;
}

/* ---------- 面板 ---------- */
.ky-modal__panel {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
  border: 1px solid var(--line, #e6eaef);
  border-radius: 20px;
  box-shadow:
    0 30px 80px -24px rgba(14, 18, 26, 0.42),
    0 4px 16px rgba(14, 18, 26, 0.08);
  padding: clamp(24px, 3.2vw, 34px);
  animation: kyModalIn 0.28s var(--ease, ease) both;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong, #d3dae2) transparent;
}

.ky-modal__panel::-webkit-scrollbar { width: 6px; }
.ky-modal__panel::-webkit-scrollbar-thumb {
  background: var(--line-strong, #d3dae2);
  border-radius: 999px;
}
.ky-modal__panel::-webkit-scrollbar-track { background: transparent; }

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

@keyframes kyModalIn {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- 关闭按钮 ---------- */
.ky-modal__close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line, #e6eaef);
  border-radius: 50%;
  background: #f6f8fa;
  color: var(--ink-2, #333a44);
  cursor: pointer;
  transition: transform 0.22s var(--ease, ease), background 0.22s var(--ease, ease),
    border-color 0.22s var(--ease, ease), color 0.22s var(--ease, ease);
}

.ky-modal__close:hover {
  background: var(--accent-soft, #ebf4fd);
  border-color: var(--accent-line, #b9d9f5);
  color: var(--accent, #1a7fd4);
  transform: rotate(90deg);
}

.ky-modal__close svg {
  width: 15px;
  height: 15px;
}

/* ---------- 标题区 ---------- */
.ky-modal .form-head {
  padding-right: 36px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  gap: 14px;
}

.ky-modal .form-head h3 {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ink, #101319);
  padding-left: 13px;
  border-left: 3px solid var(--accent, #1a7fd4);
  line-height: 1.3;
}

.ky-modal .form-head p {
  font-size: 13px;
  color: var(--muted, #6b7381);
  margin-top: 7px;
  line-height: 1.7;
}

.ky-modal .form-badge {
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 11px;
  letter-spacing: 0.04em;
  font-weight: 600;
}

/* ---------- 表单栅格 ---------- */
.ky-modal .form-grid {
  gap: 16px;
}

/* ---------- 字段与输入控件 ---------- */
.ky-modal .field label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2, #333a44);
  margin-bottom: 2px;
}

.ky-modal .field input,
.ky-modal .field select,
.ky-modal .field textarea {
  background: #f7f9fc;
  border: 1px solid var(--line-strong, #d3dae2);
  border-radius: 11px;
  padding: 11px 14px;
  font-size: 14px;
  transition: border-color 0.22s var(--ease, ease),
    box-shadow 0.22s var(--ease, ease), background 0.22s var(--ease, ease);
}

.ky-modal .field input::placeholder,
.ky-modal .field textarea::placeholder {
  color: var(--muted-2, #98a0ac);
}

.ky-modal .field input:hover,
.ky-modal .field select:hover,
.ky-modal .field textarea:hover {
  border-color: var(--accent-line, #b9d9f5);
  background: #fff;
}

.ky-modal .field input:focus,
.ky-modal .field select:focus,
.ky-modal .field textarea:focus {
  outline: none;
  background: #fff;
  border-color: var(--accent, #1a7fd4);
  box-shadow: 0 0 0 3px rgba(26, 127, 212, 0.12);
}

.ky-modal .field textarea {
  min-height: 92px;
  line-height: 1.7;
  resize: vertical;
}

/* ---------- 成功 / 失败提示 ---------- */
.ky-modal .form-success,
.ky-modal .form-error {
  border-radius: 12px;
  padding: 13px 15px 13px 16px;
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 18px;
}

.ky-modal .form-success {
  border-left: 3px solid #1c7a48;
}

.ky-modal .form-error {
  border-left: 3px solid #a8323e;
}

/* ---------- 底部与提交按钮 ---------- */
.ky-modal .form-foot {
  margin-top: 22px;
  gap: 14px;
}

.ky-modal .btn--accent {
  min-width: 172px;
  justify-content: center;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--accent, #1a7fd4) 0%, #3d9be0 100%);
  box-shadow: 0 10px 22px -10px rgba(26, 127, 212, 0.55);
  transition: transform 0.22s var(--ease, ease), box-shadow 0.22s var(--ease, ease),
    background 0.22s var(--ease, ease), opacity 0.22s var(--ease, ease);
}

.ky-modal .btn--accent:hover {
  background: linear-gradient(135deg, var(--accent-dark, #0f5f9f) 0%, var(--accent, #1a7fd4) 100%);
  transform: translateY(-1px);
  box-shadow: 0 14px 26px -10px rgba(26, 127, 212, 0.6);
}

.ky-modal .btn--accent:active {
  transform: translateY(0);
}

.ky-modal .btn--accent svg {
  transition: transform 0.22s var(--ease, ease);
}

.ky-modal .btn--accent:hover svg {
  transform: translateX(3px);
}

.ky-modal .btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.ky-modal .form-foot small {
  font-size: 12px;
  color: var(--muted-2, #98a0ac);
  line-height: 1.6;
}

/* ---------- 蜜罐（不可见防刷字段） ---------- */
.ky-honey {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

body.ky-modal-open {
  overflow: hidden;
}

/* ---------- 响应式 ---------- */
@media (max-width: 600px) {
  .ky-modal { padding: 12px; }
  .ky-modal__panel {
    max-height: 94vh;
    border-radius: 16px;
    padding: 22px 18px;
  }
  .ky-modal .form-grid {
    grid-template-columns: 1fr;
  }
  .ky-modal .form-foot {
    flex-direction: column;
    align-items: stretch;
  }
  .ky-modal .btn--accent {
    width: 100%;
  }
}
