/* 动画关键帧定义 */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes hover-lift {
  0% {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transform: translateY(0);
  }
  100% {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-5px);
  }
}

body {
  font-family: "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: #F9FAFB;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

.container {
  max-width: 1000px;
  margin: 15px auto;
  padding: 0 15px;
}

.page-header {
  background-image: url('/static/img/留言.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  text-align: center;
  animation: fadeIn 0.8s ease-out, hover-lift 0.3s ease-out 0.5s both;
  transition: all 0.3s ease;
  position: relative;
}

.page-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 10px;
}

.page-header > * {
  position: relative;
  z-index: 1;
}

.page-header:hover {
  animation: fadeIn 0.8s ease-out, hover-lift 0.3s ease-out both;
}

.page-title {
  font-size: 26px;
  color: #5D9C59;
  margin: 0;
  padding-bottom: 10px;
  border-bottom: 2px solid #5D9C59;
  font-weight: bold;
  animation: slideUp 0.6s ease-out 0.2s both;
  background: linear-gradient(135deg, #5D9C59, #4A8C47);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}

.page-subtitle {
  color: #666;
  font-size: 15px;
  margin-top: 10px;
  animation: slideUp 0.6s ease-out 0.4s both;
}

.contact-container {
  display: flex;
  gap: 20px;
  align-items: stretch;
}

.contact-form-section {
  flex: 2;
  animation: slideUp 0.8s ease-out 0.6s both;
  display: flex;
}

.contact-form-section .section {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.contact-form-section .section form {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.contact-form-section .form-group:last-of-type {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.contact-form-section .form-textarea {
  flex: 1;
  min-height: 180px;
}

.contact-info-section {
  flex: 1;
  animation: slideInRight 0.8s ease-out 0.8s both;
  display: flex;
}

.contact-info-section .section {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.contact-info-section .section .section-title {
  flex-shrink: 0;
}

.contact-info-section .section .contact-method {
  flex-shrink: 0;
}

.contact-info-section .section .contact-qrcode {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-top: auto;
}

.section {
  background-color: white;
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border: 1px solid #f0f0f0;
}

.section:hover {
  animation: hover-lift 0.3s ease-out both;
}

.section-title {
  font-size: 20px;
  color: #333;
  margin-top: 0;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #5D9C59;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.title-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: #4A8C47;
  transition: width 0.3s ease;
}

.section:hover .section-title::after {
  width: 100%;
}

.form-group {
  margin-bottom: 15px;
  transition: all 0.3s ease;
  position: relative;
}

.form-group:hover .form-label {
  color: #5D9C59;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #333;
  transition: color 0.3s ease;
  font-size: 14px;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-family: "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  transition: all 0.3s ease;
  background-color: #fff;
  box-sizing: border-box;
}

.form-input:focus,
.form-textarea:focus {
  border-color: #5D9C59;
  outline: none;
  background-color: white;
  box-shadow: 0 0 0 3px rgba(93, 156, 89, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: #aaa;
}

.form-textarea {
  min-height: 180px;
  resize: vertical;
}

.char-count {
  text-align: right;
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

.form-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #888;
  margin-bottom: 15px;
  padding: 8px 12px;
  background-color: #f8f9fa;
  border-radius: 6px;
}

.form-hint svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.submit-btn {
  background: linear-gradient(135deg, #5D9C59, #4A8C47);
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.3s ease;
  width: 100%;
  box-shadow: 0 4px 15px rgba(93, 156, 89, 0.3);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.submit-btn svg {
  width: 18px;
  height: 18px;
}

.submit-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.submit-btn:hover::before {
  left: 100%;
}

.submit-btn:hover {
  background: linear-gradient(135deg, #4A8C47, #3D7A3A);
  box-shadow: 0 6px 20px rgba(93, 156, 89, 0.4);
  transform: translateY(-2px);
}

.submit-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(93, 156, 89, 0.3);
}

.contact-method {
  display: flex;
  align-items: center;
  padding: 12px 10px;
  border-radius: 8px;
  margin-bottom: 8px;
  background-color: #f8f9fa;
  transition: all 0.3s ease;
}

.contact-method:last-child {
  margin-bottom: 0;
}

.contact-method:hover {
  background-color: #e8f5e9;
  transform: translateX(5px);
}

.contact-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5D9C59, #4A8C47);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  flex-shrink: 0;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(93, 156, 89, 0.3);
}



.contact-method:hover .contact-icon {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(93, 156, 89, 0.4);
}

.contact-icon svg,
.contact-icon img {
  width: 20px;
  height: 20px;
  transition: all 0.3s ease;
}

.contact-icon img {
  width: 32px;
  height: 32px;
}

.contact-icon svg {
  color: white;
}

.contact-method:hover .contact-icon svg,
.contact-method:hover .contact-icon img {
  transform: scale(1.1);
}

.contact-details {
  flex: 1;
}

.contact-name {
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
  font-size: 14px;
  transition: color 0.3s ease;
}

.contact-method:hover .contact-name {
  color: #5D9C59;
}

.contact-value {
  color: #666;
  font-size: 13px;
  transition: all 0.3s ease;
}

.contact-method:hover .contact-value {
  color: #5D9C59;
}

.contact-qrcode {
  text-align: center;
  margin-top: 15px;
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 8px;
  border: 1px dashed #e0e0e0;
  transition: all 0.3s ease;
}

.contact-qrcode:hover {
  background-color: #e8f5e9;
  border-color: #5D9C59;
}

.qrcode-wrapper {
  display: inline-block;
  padding: 8px;
  background: white;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 10px;
}

.qrcode-image {
  width: 130px;
  height: 130px;
  border-radius: 4px;
  transition: all 0.3s ease;
  display: block;
}

.contact-qrcode:hover .qrcode-image {
  transform: scale(1.05);
}

.qrcode-desc {
  color: #333;
  font-size: 14px;
  font-weight: 600;
  transition: color 0.3s ease;
  margin-bottom: 4px;
}

.qrcode-subdesc {
  color: #888;
  font-size: 12px;
  transition: color 0.3s ease;
}

.contact-qrcode:hover .qrcode-desc {
  color: #5D9C59;
}

.contact-qrcode:hover .qrcode-subdesc {
  color: #5D9C59;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .contact-container {
    flex-direction: column;
  }

  .page-header {
    padding: 15px;
  }

  .page-title {
    font-size: 22px;
  }

  .section {
    padding: 15px;
  }

  .qrcode-image {
    width: 110px;
    height: 110px;
  }

  .contact-form-section .form-textarea {
    min-height: 150px;
  }
}
