.contact-page {
  color: #333;
  font-size: clamp(14px, 1.041667vw, 20px);
  line-height: 1.5;
}
.contact-page .container {
  width: min(75%, 1440px);
}
.contact-main {
  position: relative;
  padding: calc(260 * var(--design-unit)) 0 calc(120 * var(--design-unit));
}
.contact-main::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  width: 100%;
  aspect-ratio: 3840 / 1500;
  background: #000 url("../image/contact-bg-pc.png") center / cover no-repeat;
  z-index: -1;
}
.contact-main h1 {
  margin: 0 0 calc(138 * var(--design-unit));
  color: #fff;
  font-size: clamp(40px, 4.166667vw, 80px);
  line-height: 1.2;
  text-align: center;
  animation: hero-enter 0.9s ease both;
}
.contact-panel {
  display: grid;
  grid-template-columns: 648fr 792fr;
  background: #f7f7f7;
  border-radius: calc(24 * var(--design-unit));
}
.contact-photo {
  width: 100%;
  height: auto;
  aspect-ratio: 1296 / 1280;
  align-self: start;
  object-fit: cover;
  border-radius: calc(24 * var(--design-unit));
}
.contact-form {
  --field-error-space: 22px;
  padding: calc(64 * var(--design-unit)) calc(80 * var(--design-unit))
    calc(50 * var(--design-unit)) calc(72 * var(--design-unit));
  min-width: 0;
}
.contact-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: max(0px, calc(30 * var(--design-unit) - var(--field-error-space)))
    calc(36 * var(--design-unit));
}
.contact-field {
  position: relative;
  min-width: 0;
}
.contact-field-wide {
  grid-column: 1 / -1;
}
.contact-field label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.contact-field input,
.contact-field textarea {
  width: 100%;
  display: block;
  height: calc(60 * var(--design-unit));
  min-height: 42px;
  border: 1px solid #d6d6d6;
  border-radius: 8px;
  background: #fff;
  padding: 12px 16px;
  color: #333;
  font: inherit;
  font-size: 18px;
  line-height: 1.5;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.contact-field textarea {
  height: calc(160 * var(--design-unit));
  min-height: 110px;
  resize: vertical;
}
.contact-field input::placeholder,
.contact-field textarea::placeholder {
  color: #888;
  opacity: 1;
}
.contact-field input:focus,
.contact-field textarea:focus {
  outline: none;
  border-color: #c78d53;
  box-shadow: 0 0 0 2px #eec59340;
}
.contact-field [aria-invalid="true"] {
  border-color: #b33131;
}
/* Keep the same error slot when empty; subtract it from the existing row spacing. */
.field-error {
  margin-top: 4px;
  height: calc(var(--field-error-space) - 4px);
  font-size: 13px;
  color: #b33131;
  line-height: 18px;
}
.field-error:empty {
  visibility: hidden;
}
.contact-submit {
  display: flex;
  margin: max(0px, calc(36 * var(--design-unit) - var(--field-error-space)))
    auto 0;
  width: calc(240 * var(--design-unit));
  min-height: calc(60 * var(--design-unit));
}
.contact-submit:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}
.contact-submit:hover {
  transform: none;
}
.form-status {
  font-size: 14px;
  text-align: center;
  margin-top: 16px;
}
.form-status:empty {
  display: none;
}
.form-status[data-state="success"] {
  color: #91633b;
}
.form-status[data-state="error"] {
  color: #b33131;
}
body.contact-success-open {
  overflow: hidden;
}
.contact-success {
  width: min(460px, calc(100% - 40px));
  max-height: calc(100dvh - 40px);
  padding: 48px 40px 36px;
  border: 1px solid #eedbc5;
  border-radius: 20px;
  background: linear-gradient(180deg, #fffaf4, #fff 48%);
  color: #333;
  text-align: center;
  box-shadow: 0 24px 90px #0003;
}
.contact-success[open] {
  animation: success-enter 0.3s ease both;
}
.contact-success::backdrop {
  background: #14161899;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.success-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  border-radius: 50%;
  color: #888;
}
.success-close:hover {
  color: #91633b;
  background: #f8efe3;
}
.success-close svg {
  width: 22px;
  height: 22px;
}
.success-icon {
  display: grid;
  place-items: center;
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: #f9ecd9;
  color: #cb955f;
}
.success-icon svg {
  width: 48px;
  height: 48px;
}
.contact-success h2 {
  font-size: 28px;
  line-height: 1.3;
  letter-spacing: 0;
}
.contact-success p {
  margin: 16px 0 30px;
  color: #666;
  font-size: 16px;
  line-height: 1.7;
}
.success-confirm {
  min-width: 180px;
  min-height: 46px;
}
.success-confirm:hover {
  transform: none;
}
@keyframes success-enter {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (max-width: 767px) {
  .contact-success {
    padding: 40px 24px 28px;
    border-radius: 16px;
  }
  .contact-success h2 {
    font-size: 24px;
  }
  .success-icon {
    width: 72px;
    height: 72px;
    margin-bottom: 20px;
  }
}
.contact-offices {
  padding-top: calc(64 * var(--design-unit));
  background: #f7f7f7;
  overflow: hidden;
}
.office-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: calc(30 * var(--design-unit));
}
.office-card {
  min-width: 0;
  padding: calc(40 * var(--design-unit)) calc(42 * var(--design-unit))
    calc(30 * var(--design-unit));
  border-radius: calc(24 * var(--design-unit));
  background: #fff;
  display: flex;
  flex-direction: column;
}
.office-heading {
  display: flex;
  align-items: center;
  gap: calc(24 * var(--design-unit));
  margin-bottom: calc(26 * var(--design-unit));
}
.office-heading img {
  width: calc(64 * var(--design-unit));
  height: calc(64 * var(--design-unit));
  flex-shrink: 0;
}
.office-heading h2 {
  font-size: clamp(17px, 1.25vw, 24px);
  line-height: 1.3;
  text-align: left;
  letter-spacing: 0;
}
html[lang="zh-CN"] .contact-page .office-heading h2 {
  font-size: clamp(17px, 1.25vw, 24px);
}
.office-address {
  min-height: calc(108 * var(--design-unit));
}
.office-details {
  padding-top: calc(20 * var(--design-unit));
  min-height: calc(82 * var(--design-unit));
  margin-top: auto;
  border-top: 1px solid #e5e5e5;
  font-size: clamp(13px, 0.9375vw, 18px);
  line-height: 1.7;
}
.office-details a:hover {
  color: #a96932;
}
.contact-map {
  display: block;
  margin-top: calc(60 * var(--design-unit));
}
.contact-map img {
  width: 100%;
}
@media (min-width: 768px) and (max-width: 1399px) {
  .contact-form {
    --field-error-space: 40px;
  }
}
@media (min-width: 768px) and (max-width: 1100px) {
  html[data-page="contact"] .header-inner {
    width: calc(100% - 40px);
  }
  .contact-main {
    padding-top: 150px;
  }
  .contact-main h1 {
    margin-bottom: 70px;
  }
  .contact-form {
    padding: 30px 24px;
  }
  .contact-fields {
    gap: 0 14px;
  }
  .contact-field input,
  .contact-field textarea {
    font-size: 14px;
    padding-inline: 10px;
  }
  .office-heading {
    gap: 12px;
  }
  .office-heading h2,
  html[lang="zh-CN"] .contact-page .office-heading h2 {
    font-size: 15px;
  }
  .office-address {
    min-height: 110px;
  }
}
@media (max-width: 767px) {
  .contact-page {
    font-size: 16px;
  }
  .contact-page .container {
    width: calc(100% - 40px);
  }
  .contact-main {
    padding: 142px 0 40px;
  }
  .contact-main::before {
    aspect-ratio: 750 / 1120;
    background-image: url("../image/contact-bg-mob.png");
  }
  .contact-main h1 {
    font-size: 36px;
    margin-bottom: 108px;
  }
  .contact-panel {
    display: flex;
    flex-direction: column;
    border-radius: 12px;
  }
  .contact-form {
    order: -1;
    padding: 36px 18px 40px;
  }
  .contact-fields {
    grid-template-columns: minmax(0, 1fr);
    gap: calc(30px - var(--field-error-space));
  }
  .contact-field input,
  .contact-field textarea {
    height: 60px;
    font-size: 18px;
    padding: 16px;
  }
  .contact-field textarea {
    height: 160px;
  }
  .contact-submit {
    min-width: 180px;
    min-height: 44px;
    width: 180px;
    margin-top: calc(30px - var(--field-error-space));
  }
  .contact-photo {
    height: auto;
    aspect-ratio: 1296 / 1280;
    border-radius: 12px;
  }
  .contact-offices {
    padding: 40px 0;
  }
  .office-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .office-card {
    padding: 28px 18px 20px;
    border-radius: 14px;
  }
  .office-heading {
    gap: 16px;
    margin-bottom: 22px;
  }
  .office-heading img {
    width: 48px;
    height: 48px;
  }
  .office-heading h2,
  html[lang="zh-CN"] .contact-page .office-heading h2 {
    font-size: 18px;
  }
  .office-address {
    min-height: 80px;
  }
  .office-details {
    padding-top: 14px;
    min-height: 0;
    font-size: 16px;
    line-height: 1.5;
  }
  .contact-offices .contact-map {
    width: 100%;
    margin-top: 30px;
  }
}
@media (max-width: 359px) {
  .contact-main h1 {
    font-size: 32px;
  }
  .contact-form {
    padding-inline: 16px;
  }
  .contact-field input,
  .contact-field textarea {
    font-size: 16px;
  }
}
