.contact-page {
  background: #f5f6fa;
  padding: 80px 0 80px;
}
.contact-header {
  background-color: #0b0c1b;
  padding: 140px 0 60px;
}
.contact-hero {
  max-width: 1100px;
  margin: 0 auto 24px;
  text-align: left;
  padding: 18px 16px 0;
}

.contact-hero-badge {
  display: inline-block;
  font-size: 24px;
  font-weight: 600;
  padding: 4px 0;
  border-radius: 999px;
  background: #0b0c1b;
  color: #fff;
  margin-bottom: 10px;
}

.contact-hero-title {
  font-size: 32px;
  line-height: 1.25;
  font-weight: 700;
  color: #fff;
}

.contact-card {
  max-width: 1100px;
  margin: 0 auto;
  background: transparent;
  border-radius: 0;
  padding: 0 16px;
  display: flex;
  gap: 70px;
  align-items: flex-start;
  box-shadow: none;
}

.contact-left {
  flex: 1;
  min-width: 280px;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* 左侧文档信息（来自 resource_post_id） */
.contact-download-context {
  width: 100%;
  max-width: 350px;
  border-radius: 18px;
}

.contact-download-thumb {
  width: 100%;
  margin: 0 auto;
  /* overflow: hidden; */
  background: #f4f6fb;
}

.contact-download-thumb img {
  width: 150px;
  height: auto;
  object-fit: cover;
  border-radius: 5px;
  box-shadow: 0px 0px 5px 3px #e6e6e6;
  display: block;
}

.contact-download-title {
  margin-top: 24px;
  font-weight: 600;
  font-size: 16px;
  color: #0b0c1b;
}

.contact-download-excerpt {
  margin-top: 8px;
  color: #5a5c76;
  font-size: 15px;
  line-height: 1.85;
}

.contact-left-text {
  color: #5a5c76;
  font-size: 14px;
  line-height: 1.8;
}

.contact-review {
  margin-top: 18px;
}

.contact-stars {
  letter-spacing: 2px;
  color: #f6b500;
  font-size: 16px;
}

.contact-quote {
  margin-top: 12px;
  color: #444;
  font-size: 14px;
  line-height: 1.8;
}

.contact-quote-meta {
  margin-top: 10px;
  color: #5a5c76;
  font-size: 12px;
}

.contact-right {
  flex: 1.35;
  min-width: 320px;
  background: #fff;
  border-radius: 10px;
  padding: 28px 30px;
  border: 1px solid #e6e6e6;
}

.contact-alert {
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 14px;
  font-size: 14px;
}

.contact-alert-success {
  background: #eefaf0;
  color: #1f6b2a;
  border: 1px solid #cfead4;
}
.contact-alert-error {
  background: #fff2f2;
  color: #8a1f1f;
  border: 1px solid #f2c9c9;
}

.contact-form label {
  display: flex;
  align-items: center;
  font-size: 12px;
  color: #333;
  margin: 0 0 6px;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.contact-field {
  margin-bottom: 14px;
}

.contact-control {
  position: relative;
  align-items: center;
  justify-content: center;
}

.contact-control input,
.contact-control textarea {
  padding-right: 44px;
}

.contact-control.is-invalid input,
.contact-control.is-invalid textarea {
  border-color: #ff1e00;
}

.contact-control .contact-error-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  font-weight: 800;
  font-size: 12px;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: default;
  pointer-events: none;
  padding: 0;
}
.contact-error-icon img {
  width: 100%;
}
.contact-control .contact-error-icon:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 77, 79, 0.25);
}

/* .contact-control .contact-error-tooltip {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 50;
  display: none;
  background: #fff;
  border: 1px solid #ffb3b3;
  color: #8a1f1f;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.4;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  max-width: 320px;
} */

/* 不展示 hover/focus 的错误提示气泡，仅显示图标 */
.contact-error-tooltip,
.contact-error-tooltip--consent {
  display: none !important;
}

.contact-consent {
  position: relative;
}

.contact-consent.is-invalid {
  padding-right: 44px;
}

.contact-consent .contact-error-icon--consent {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
}

.contact-consent .contact-error-tooltip--consent {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 50;
  display: none;
  background: #fff;
  border: 1px solid #ffb3b3;
  color: #8a1f1f;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.4;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  max-width: 320px;
}

/* consent 的 hover/focus 提示也关闭 */

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="tel"],
.contact-form input[type="url"],
.contact-form textarea {
  width: 100%;
  border: 1px solid #e9ebf2;
  background: #fff;
  border-radius: 8px;
  padding: 12px 14px;
  outline: none;
  font-size: 14px;
  color: #0b0c1b;
}

.contact-form textarea {
  resize: none;
  min-height: 120px;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: #0b0c1b;
}

/* Invalid should also apply when NOT focused (override base input styles) */
.contact-form .contact-control.is-invalid input,
.contact-form .contact-control.is-invalid textarea {
  border-color: #ff1e00 !important;
}

/* Invalid should win over focus (keep red border when focused) */
.contact-control.is-invalid input:focus,
.contact-control.is-invalid textarea:focus {
  border-color: #ff1e00;
  box-shadow: 0 0 0 3px rgba(255, 30, 0, 0.12);
}

.contact-consent {
  margin: 8px 0 16px;
  font-size: 12px;
  color: #5a5c76;
}

.contact-consent-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.contact-consent-text {
  flex: 1;
  min-width: 0;
  line-height: 1.5;
}

/* Switch */
.contact-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  user-select: none;
}
.contact-switch:hover {
  cursor: pointer;
}
.contact-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-switch-slider {
  width: 28px;
  height: 18px;
  border-radius: 999px;
  background: #d9deea;
  border: 1px solid #cfd6e6;
  position: relative;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.contact-switch-slider::after {
  content: "";
  position: absolute;
  left: 1px;
  top: 1px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #fff;
  transition: transform 0.2s ease;
}

.contact-switch input:checked + .contact-switch-slider {
  background: #007dfc;
  border-color: #007dfc;
}

.contact-switch input:checked + .contact-switch-slider::after {
  transform: translateX(10px);
}

.contact-switch input:focus + .contact-switch-slider {
  outline: none;
}

/* Invalid state: red border around the switch ("input box") */
.contact-consent.is-invalid .contact-switch-slider {
  border-color: #ff1e00;
  box-shadow: 0 0 0 3px rgba(255, 30, 0, 0.12);
}

.contact-submit {
  width: 100%;
  border: 0;
  border-radius: 8px;
  height: 44px;
  background: #0b0c1b;
  color: #fff;
  font-size: 14px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.contact-submit:hover {
  opacity: 0.92;
}

.contact-submit:disabled {
  cursor: not-allowed;
  opacity: 0.85;
}

.contact-submit.is-loading::before {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  animation: ping32-contact-spin 0.8s linear infinite;
}

@keyframes ping32-contact-spin {
  to {
    transform: rotate(360deg);
  }
}

.contact-hp {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.formtitle {
  margin-bottom: 24px;
  font-size: 20px;
  font-weight: 600;
  color: #0b0c1b;
}
@media only screen and (min-width: 1024px) and (max-width: 991px) {
  .contact-left,
  .contact-right {
    min-width: 600px;
  }
}
@media (max-width: 991px) {
  .contact-card {
    flex-direction: column;
    gap: 22px;
    padding: 0 16px;
  }
  .contact-hero-title {
    font-size: 24px;
  }
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .contact-right {
    padding: 22px;
  }
  .contact-left {
    display: none;
  }
  .contact-right {
    width: 100%;
  }
}
/* 576px - 767px：小屏平板/大屏手机 */
@media only screen and (min-width: 576px) and (max-width: 767px) {
  .contact-header {
    padding: 120px 0 50px;
  }
  .contact-left {
    display: block;
  }
  .contact-hero {
    max-width: 520px;
    padding: 16px 20px 0;
  }

  .contact-hero-badge {
    font-size: 20px;
  }

  .contact-hero-title {
    font-size: 26px;
  }

  .contact-page {
    padding: 70px 0 70px;
  }

  .contact-card {
    max-width: 520px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    gap: 18px;
  }

  .contact-left,
  .contact-right {
    width: 100%;
  }

  .contact-right {
    padding: 22px;
  }

  .contact-download-context {
    max-width: none;
  }
}

/* <=575px：手机端 */
@media only screen and (max-width: 575px) {
  .contact-header {
    padding: 110px 0 40px;
  }
  .contact-left {
    display: block;
  }
  .contact-hero {
    max-width: 420px;
    width: 100%;
    margin: 0 auto 18px;
    padding: 14px 20px 0;
  }

  .contact-hero-badge {
    font-size: 18px;
    margin-bottom: 8px;
  }

  .contact-hero-title {
    font-size: 22px;
  }

  .contact-page {
    padding: 60px 0 60px;
  }

  .contact-card {
    max-width: 420px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    gap: 16px;
  }

  .contact-left,
  .contact-right {
    width: 100%;
  }

  .contact-right {
    padding: 20px;
  }

  .formtitle {
    font-size: 16px;
    margin-bottom: 18px;
  }

  .contact-download-context {
    max-width: none;
  }

  .contact-download-thumb {
    display: flex;
    justify-content: flex-start;
  }

  .contact-download-thumb img {
    width: 120px;
  }

  .contact-download-title {
    margin-top: 18px;
  }
}
