/* Author: TDULinks - 瓜子二手车访客留言 H5 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --gz-green: #22ac38;
  --gz-green-dark: #1a8c2e;
  --gz-green-light: #e8f7eb;
  --gz-orange: #ff6633;
  --gz-bg: #f5f5f5;
  --gz-card: #ffffff;
  --gz-text: #303741;
  --gz-text-secondary: #5f6670;
  --gz-text-light: #8f96a0;
  --gz-border: #e8e8e8;
  --gz-error: #ff4d4f;
  --gz-radius: 8px;
}

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

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

.hidden { display: none !important; }

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

/* 顶部导航栏 - 瓜子官方风格 */
.top-bar {
  height: 44px;
  background: var(--gz-card);
  display: flex;
  align-items: center;
  justify-content: center;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--gz-border);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-icon {
  width: 28px;
  height: 28px;
  background: var(--gz-green);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--gz-green);
  letter-spacing: 0.5px;
}

.brand-sub {
  font-size: 10px;
  color: var(--gz-text-light);
  letter-spacing: 1px;
}

/* 头部 Banner */
.header {
  background: linear-gradient(180deg, var(--gz-green) 0%, #2ec04a 100%);
  padding: 28px 20px 40px;
  position: relative;
  overflow: hidden;
}

.header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 20px;
  background: var(--gz-bg);
  border-radius: 16px 16px 0 0;
}

.header-deco {
  position: absolute;
  right: -20px;
  top: 10px;
  width: 120px;
  height: 120px;
  opacity: 0.12;
}

.header-deco svg {
  width: 100%;
  height: 100%;
}

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

.header-title {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 8px;
}

.header-desc {
  font-size: 13px;
  opacity: 0.9;
  line-height: 1.6;
}

.header-tags {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.header-tag {
  font-size: 11px;
  padding: 4px 10px;
  background: rgba(255,255,255,0.2);
  border-radius: 12px;
  backdrop-filter: blur(4px);
}

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

.form-card {
  background: var(--gz-card);
  border-radius: var(--gz-radius);
  padding: 20px 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.form-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--gz-text);
  margin-bottom: 4px;
}

.form-desc {
  font-size: 13px;
  color: var(--gz-text-secondary);
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--gz-border);
}

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

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

.required {
  color: var(--gz-orange);
}

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

.form-item input::placeholder,
.form-item textarea::placeholder {
  color: var(--gz-text-light);
}

.form-item input:focus,
.form-item textarea:focus {
  border-color: var(--gz-green);
  background: #fff;
}

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

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

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

/* 协议区域 */
.agreement-section {
  margin: 18px 0;
  padding: 14px;
  background: var(--gz-green-light);
  border-radius: var(--gz-radius);
}

.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: 18px;
  height: 18px;
  border: 2px solid #c8c8c8;
  border-radius: 50%;
  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(--gz-green);
  border-color: var(--gz-green);
}

.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: 12px;
  color: var(--gz-text-secondary);
  line-height: 1.6;
}

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

/* 提交按钮 - 瓜子绿主色 */
.submit-btn {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 24px;
  background: var(--gz-green);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  margin-top: 6px;
}

.submit-btn:active {
  background: var(--gz-green-dark);
  transform: scale(0.98);
}

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

/* 页脚 */
.footer {
  text-align: center;
  padding: 20px 16px 10px;
  font-size: 11px;
  color: var(--gz-text-light);
  line-height: 1.6;
}

.footer-legal {
  margin-top: 6px;
  font-size: 10px;
  color: #b0b5bc;
}

/* 弹窗 */
.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(--gz-card);
  width: 100%;
  max-height: 85vh;
  border-radius: 12px 12px 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(--gz-border);
  flex-shrink: 0;
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--gz-text);
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--gz-text-light);
  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: 14px;
  font-weight: 600;
  color: var(--gz-text);
  margin: 16px 0 8px;
}

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

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

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

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

.privacy-update {
  font-size: 12px !important;
  color: var(--gz-text-light) !important;
  background: var(--gz-green-light);
  padding: 8px 12px;
  border-radius: var(--gz-radius);
  text-align: center;
}

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

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

.success-panel {
  position: relative;
  background: var(--gz-card);
  border-radius: 12px;
  padding: 36px 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;
  font-weight: 600;
  color: var(--gz-text);
  margin-bottom: 8px;
}

.success-panel p {
  font-size: 14px;
  color: var(--gz-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: 12px;
    max-height: 80vh;
  }
}
