/* pages.css — 采汇代办 H5 新页面（agents / join / freight）公共样式 */

:root {
  --ch-green: #2e9e5b;
  --ch-green-2: #37b06a;
  --ch-bg: #f5f7f6;
  --ch-text: #222;
  --ch-sub: #7a8a80;
  --ch-line: #e8ece9;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ch-bg);
  color: var(--ch-text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

body {
  padding-bottom: 96px; /* 给底部固定 CTA 留位 */
}

a { color: var(--ch-green); text-decoration: none; }

/* ---------- 顶部返回栏 ---------- */
.ch-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  height: 48px;
  padding: 0 12px;
  background: #fff;
  border-bottom: 1px solid var(--ch-line);
}
.ch-back { font-size: 16px; color: var(--ch-green); flex: 0 0 auto; }
.ch-title { flex: 1; text-align: center; font-size: 17px; font-weight: 600; }
.ch-header-space { flex: 0 0 44px; }

/* ---------- 内容容器 ---------- */
.ch-wrap { padding: 16px; max-width: 640px; margin: 0 auto; }
.ch-section-title { font-size: 18px; font-weight: 700; margin: 8px 0 12px; }
.ch-note {
  background: #fff8e6;
  border: 1px solid #ffe6a8;
  color: #8a6d1a;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 14px;
}

/* ---------- 搜索框 ---------- */
.ch-search {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.ch-search input {
  flex: 1;
  height: 44px;
  border: 1px solid var(--ch-line);
  border-radius: 22px;
  padding: 0 16px;
  font-size: 15px;
  background: #fff;
  outline: none;
}
.ch-search input:focus { border-color: var(--ch-green); }
.ch-search button {
  flex: 0 0 auto;
  height: 44px;
  padding: 0 20px;
  border: none;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--ch-green), var(--ch-green-2));
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}

/* ---------- 卡片/列表 ---------- */
.ch-card {
  background: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}
.ch-card-name { font-size: 16px; font-weight: 700; margin: 0 0 6px; }
.ch-card-tags { margin: 0 0 8px; }
.ch-tag { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 4px; font-weight: 600; line-height: 1.4; }
.ch-tag-agent { background: #E3F2FD; color: #1565C0; }
.ch-tag-merchant { background: #FFF3E0; color: #EF6C00; }
.ch-card-row { display: flex; font-size: 13px; color: var(--ch-sub); margin: 3px 0; }
.ch-card-row .k { flex: 0 0 56px; color: #a3aea8; }
.ch-card-row .v { flex: 1; color: #4a5a50; word-break: break-all; }
.ch-card-row .v.ch-variety { color: #1f8a4c; font-weight: 600; }
.ch-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--ch-line);
}
.ch-call-btn {
  display: inline-block;
  padding: 7px 18px;
  background: linear-gradient(135deg, var(--ch-green), var(--ch-green-2));
  color: #fff;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
}

/* ---------- 空态/加载/失败 ---------- */
.ch-state {
  text-align: center;
  color: var(--ch-sub);
  padding: 48px 16px;
  font-size: 14px;
}
.ch-state .ico { font-size: 40px; display: block; margin-bottom: 8px; }
.ch-retry {
  margin-top: 12px;
  padding: 8px 22px;
  border: 1px solid var(--ch-green);
  background: #fff;
  color: var(--ch-green);
  border-radius: 20px;
  font-size: 14px;
}

/* ---------- 表单 ---------- */
.ch-form-item { margin-bottom: 16px; }
.ch-form-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.ch-form-label .req { color: #e14; margin-left: 2px; }
.ch-form-item input,
.ch-form-item textarea {
  width: 100%;
  border: 1px solid var(--ch-line);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px;
  background: #fff;
  outline: none;
  resize: none;
}
.ch-form-item input:focus,
.ch-form-item textarea:focus { border-color: var(--ch-green); }
.ch-form-tip { font-size: 12px; color: var(--ch-sub); margin-top: 4px; }
.ch-submit-btn {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--ch-green), var(--ch-green-2));
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  margin-top: 8px;
}
.ch-submit-btn[disabled] { opacity: .6; }

/* 提交成功态 */
.ch-success {
  text-align: center;
  padding: 40px 20px;
}
.ch-success .ico { font-size: 56px; }
.ch-success h3 { font-size: 20px; margin: 12px 0 8px; }
.ch-success p { color: var(--ch-sub); font-size: 14px; margin: 0 auto; max-width: 400px; }

/* ---------- 运费表 ---------- */
.ch-freight-table { width: 100%; }
.ch-freight-row {
  background: #fff;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 10px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}
.ch-freight-route { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.ch-freight-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--ch-sub); }
.ch-freight-price { color: #e07b00; font-weight: 600; }

/* ---------- 底部固定 CTA ---------- */
.ch-cta {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 200;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,0.96);
  border-top: 1px solid var(--ch-line);
  backdrop-filter: blur(6px);
}
.ch-cta-btn {
  display: block;
  width: 100%;
  height: 48px;
  line-height: 48px;
  border: none;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--ch-green), var(--ch-green-2));
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
}
.ch-cta wx-open-launch-weapp { display: block; width: 100%; }

/* ---------- 小程序码弹窗 ---------- */
.ch-qr-mask {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.55);
  align-items: center;
  justify-content: center;
}
.ch-qr-mask.show { display: flex; }
.ch-qr-box {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  width: 78%;
  max-width: 320px;
  text-align: center;
}
.ch-qr-img { width: 200px; height: 200px; }
.ch-qr-tip { font-size: 13px; color: var(--ch-sub); margin: 12px 0 16px; }
.ch-qr-close {
  padding: 8px 28px;
  border: 1px solid var(--ch-line);
  background: #fff;
  border-radius: 20px;
  font-size: 14px;
}

/* ---------- Toast ---------- */
.ch-toast {
  position: fixed;
  left: 50%;
  bottom: 120px;
  transform: translateX(-50%) translateY(10px);
  background: rgba(0,0,0,0.8);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 600;
  max-width: 80%;
  text-align: center;
}
.ch-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
