/* Author: TDULinks - 石家庄丰硕肥业有限公司 H5 留言页 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #2d6a4f;
  --primary-light: #40916c;
  --primary-dark: #1b4332;
  --accent: #95d5b2;
  --bg: #f0f7f4;
  --card: #ffffff;
  --text: #1b2838;
  --text-secondary: #5a6b7d;
  --border: #d8e2dc;
  --error: #dc2626;
  --radius: 12px;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 头部 */
.header {
  position: relative;
  padding: 40px 20px 50px;
  overflow: hidden;
}

.header-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
}

.header-bg::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 30px;
  background: var(--bg);
  border-radius: 24px 24px 0 0;
}

.header-content {
  position: relative;
  text-align: center;
  color: #fff;
}

.company-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  color: #fff;
}

.company-logo svg {
  width: 100%;
  height: 100%;
}

.company-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.company-slogan {
  font-size: 13px;
  opacity: 0.85;
  letter-spacing: 2px;
}

/* 主内容 */
.main {
  flex: 1;
  padding: 0 16px 24px;
  margin-top: -20px;
  position: relative;
  z-index: 1;
}

.form-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: 0 4px 24px rgba(45, 106, 79, 0.08);
}

.form-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 4px;
}

.form-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.form-item {
  margin-bottom: 16px;
}

.form-item label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text);
}

.required {
  color: var(--error);
}

.form-item input,
.form-item textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 15px;
  color: var(--text);
  background: #fafcfa;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}

.form-item input:focus,
.form-item textarea:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(64, 145, 108, 0.15);
  background: #fff;
}

.form-item textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
}

.char-count {
  text-align: right;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.field-error {
  font-size: 12px;
  color: var(--error);
  margin-top: 4px;
  min-height: 16px;
}

/* 协议勾选 */
.agreement-section {
  margin: 20px 0;
  padding: 16px;
  background: #f7faf8;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.checkbox-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  margin-bottom: 12px;
  position: relative;
}

.checkbox-item:last-of-type {
  margin-bottom: 0;
}

.checkbox-item input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-custom {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  background: #fff;
}

.checkbox-item input:checked + .checkbox-custom {
  background: var(--primary);
  border-color: var(--primary);
}

.checkbox-item input:checked + .checkbox-custom::after {
  content: '';
  width: 6px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -2px;
}

.checkbox-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.checkbox-text a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.checkbox-text a:active {
  opacity: 0.7;
}

/* 提交按钮 */
.submit-btn {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 2px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  margin-top: 8px;
}

.submit-btn:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 页脚 */
.footer {
  text-align: center;
  padding: 20px 0 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* 弹窗 */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.modal-panel {
  position: relative;
  background: var(--card);
  width: 100%;
  max-height: 85vh;
  border-radius: 16px 16px 0 0;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-header h3 {
  font-size: 17px;
  color: var(--primary-dark);
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

.modal-body h4 {
  font-size: 15px;
  color: var(--primary-dark);
  margin: 16px 0 8px;
}

.modal-body h4:first-child {
  margin-top: 0;
}

.modal-body p,
.modal-body li {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 8px;
}

.modal-body ul {
  padding-left: 20px;
  margin-bottom: 8px;
}

.modal-body strong {
  color: var(--text);
}

.privacy-update {
  font-size: 12px !important;
  color: var(--text-secondary) !important;
  background: #f7faf8;
  padding: 8px 12px;
  border-radius: 6px;
  text-align: center;
}

.modal-footer {
  padding: 12px 20px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-btn {
  width: 100%;
  height: 44px;
  border: none;
  border-radius: 22px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.modal-btn:active {
  opacity: 0.9;
}

/* 成功弹窗 */
.success-panel {
  position: relative;
  background: var(--card);
  border-radius: 16px;
  padding: 32px 24px;
  margin: auto 32px;
  text-align: center;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
}

.success-icon svg {
  width: 100%;
  height: 100%;
}

.success-panel h3 {
  font-size: 18px;
  color: var(--primary-dark);
  margin-bottom: 8px;
}

.success-panel p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

@media (min-width: 480px) {
  .main {
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
  }

  .modal {
    align-items: center;
  }

  .modal-panel {
    max-width: 480px;
    border-radius: 16px;
    max-height: 80vh;
  }
}
