/* 微信公众号 H5 - 收件信息登记 */
:root {
  --bg: #f3f6f8;
  --card: #ffffff;
  --text: #1a2332;
  --muted: #6b7a8f;
  --accent: #0d8f7a;
  --accent-dark: #067a68;
  --accent-soft: rgba(13, 143, 122, 0.12);
  --danger: #e5484d;
  --border: #e8edf2;
  --radius: 14px;
  --shadow: 0 8px 32px rgba(26, 35, 50, 0.08);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: calc(24px + var(--safe-bottom));
}

.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px 32px;
}

/* 顶部 */
.hero {
  padding: 28px 4px 20px;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.hero h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.hero p {
  font-size: 14px;
  color: var(--muted);
}

/* 卡片区块 */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 16px;
  margin-bottom: 14px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.card-title .icon {
  font-size: 18px;
}

/* 表单 */
.field {
  margin-bottom: 14px;
}

.field-row {
  display: flex;
  gap: 10px;
}

.field-half {
  flex: 1;
  min-width: 0;
}

.field-third {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

.region-group > label {
  margin-bottom: 8px;
}

.region-row {
  flex-wrap: nowrap;
  gap: 8px;
}

.region-row .field-third select {
  padding-left: 8px;
  padding-right: 24px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}

.req {
  color: var(--danger);
}

.optional {
  font-weight: 400;
  color: var(--muted);
  font-size: 12px;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  font-size: 16px; /* 防止 iOS 缩放 */
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fafbfc;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: #fff;
}

.field input.error,
.field textarea.error,
.field select.error {
  border-color: var(--danger);
}

.field textarea {
  resize: vertical;
  min-height: 80px;
}

.field select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7a8f' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.field select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background-color: #f0f2f5;
}

.hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.field-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
  display: none;
}

.field-error.show {
  display: block;
}

/* 协议勾选 */
.agree {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
  margin: 8px 0 20px;
  cursor: pointer;
}

.agree input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--accent);
}

/* 提交按钮 */
.btn-submit {
  width: 100%;
  padding: 15px;
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(13, 143, 122, 0.35);
  transition: transform 0.15s, opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.btn-submit:active:not(:disabled) {
  transform: scale(0.98);
}

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

.footer {
  text-align: center;
  padding: 20px 0;
  font-size: 12px;
  color: var(--muted);
}

/* 成功弹层 */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(26, 35, 50, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
  animation: fadeIn 0.25s ease;
}

.modal[hidden] {
  display: none;
}

.modal-panel {
  background: var(--card);
  border-radius: 18px;
  padding: 32px 24px;
  text-align: center;
  max-width: 320px;
  width: 100%;
  animation: slideUp 0.3s ease;
}

.modal-icon {
  width: 56px;
  height: 56px;
  line-height: 56px;
  margin: 0 auto 16px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 28px;
  font-weight: 700;
  border-radius: 50%;
}

.modal-panel h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.modal-panel p {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 24px;
}

.btn-modal {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 10px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(80px + var(--safe-bottom));
  transform: translateX(-50%);
  background: rgba(26, 35, 50, 0.88);
  color: #fff;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 8px;
  z-index: 200;
  max-width: 90%;
  text-align: center;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
