/* 联系我们区域样式 */
.contact {
  padding: 80px 0;
  background-color: #f8f8f8;
  position: relative;
  overflow: hidden;
}

.contact .container {
  max-width: 1440px;
  margin: 0 auto;
}

.contact-wrapper {
  display: flex;
  margin-top: 50px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  overflow: hidden;
  background-color: #fff;
  position: relative;
  z-index: 1;
  transition: box-shadow 0.3s ease;
}

.contact-wrapper:hover {
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

/* 左侧图片区域 */
.contact-image-container {
  flex: 1;
  position: relative;
  min-height: 500px;
  overflow: hidden;
  cursor: pointer;
}

.contact-bg-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  transition: all 0.5s ease;
  will-change: transform; /* 优化性能 */
}

/* 移除单独的图片悬停效果，由JS控制 */

/* 添加图片容器的悬停效果 */
.contact-image-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 1;
}

.contact-image-container::before {
  content: 'CONTACT US / 联系我们';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 1.6rem;
  font-weight: 500;
  /* background-color: rgba(0, 0, 0, 0.6); */
  padding: 10px 20px;
  border-radius: 5px;
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.3s ease;
  z-index: 2;
  pointer-events: none;
}

/* 当整个contact-wrapper悬停时触发图片容器效果 */
.contact-wrapper:hover .contact-image-container::after {
  opacity: 1;
}

.contact-wrapper:hover .contact-image-container::before {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.05);
}

/* 浮动图片已被移除，此样式不再需要 */

/* 右侧表单区域 */
.contact-form-container {
  flex: 1;
  padding: 50px;
  background-color: #fff;
}

.contact-form {
  max-width: 500px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 20px;
}

.form-control {
  width: 100%;
  padding: 15px;
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  font-size: 16px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
  background-color: #f9f9f9;
}

.form-control:focus {
  border-color: var(--primary-color, #0066cc);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
  outline: none;
  background-color: #fff;
  transform: translateY(-2px);
}

textarea.form-control {
  min-height: 150px;
  resize: vertical;
}

/* 表单消息提示 */
.form-message {
  padding: 12px 15px;
  margin: 15px 0;
  border-radius: 5px;
  font-size: 14px;
  line-height: 1.5;
  animation: slideDown 0.3s ease;
}

.form-message.success {
  background-color: #f0f9ff;
  border: 1px solid #0284c7;
  color: #075985;
}

.form-message.error {
  background-color: #fef2f2;
  border: 1px solid #ef4444;
  color: #b91c1c;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.btn2 {
  background-color: var(--primary-color, #54578E);
  color: #fff;
  border: none;
  padding: 15px 30px;
  border-radius: 5px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
  z-index: 1;
  width: 100%;
}

.btn2::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  transition: left 0.5s ease;
  z-index: -1;
}

.btn2:hover {
  background-color: #54578E;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.btn2:hover::before {
  left: 100%;
}

.btn2:active {
  transform: translateY(0);
}

.btn2:disabled,
.btn2.loading {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn2.loading {
  position: relative;
  color: transparent;
}

.btn2.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: btn-spin 0.6s linear infinite;
}

@keyframes btn-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 响应式样式 */
@media (max-width: 992px) {
  .contact-wrapper {
    flex-direction: column;
  }
  
  .contact-image-container {
    min-height: 400px;
  }
  
  .contact-form-container {
    padding: 40px 30px;
  }
}

@media (max-width: 576px) {
  .contact-image-container {
    min-height: 300px;
  }
  
  .contact-form-container {
    padding: 30px 20px;
  }
  
  .contact-floating-image {
    width: 70%;
  }
}
