:root {
  --green: #07c160;
  --green-d: #06ad56;
  --green-light: #e8f9ef;
  --bg: #f4f6f9;
  --card: #fff;
  --text: #1f2329;
  --sub: #8a8f99;
  --border: #ebedf1;
  --err: #fa5151;
  --pending: #ff9f0a;
  --shadow: 0 2px 12px rgba(17, 24, 39, .05);
  --radius: 14px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  padding-bottom: 96px;
  line-height: 1.5;
}

svg { display: block; }

/* 头部 */
.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(135deg, #07c160 0%, #10b981 100%);
  color: #fff;
  padding: 16px 16px 12px;
  box-shadow: 0 2px 10px rgba(7, 193, 96, .25);
}
.header-top { display: flex; align-items: center; }
.app-header .title { font-size: 18px; font-weight: 600; letter-spacing: .5px; }
.tabs { display: flex; gap: 8px; margin-top: 14px; }
.tab {
  flex: 1;
  border: none;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  padding: 9px 0;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  transition: all .2s;
}
.tab.active { background: #fff; color: var(--green-d); font-weight: 600; }

.view { padding: 14px; }
.hidden { display: none !important; }

/* 卡片 */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.card h2 {
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.step-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--green);
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}
.card-icon { color: var(--green); display: inline-flex; }

/* 主体选择 */
.subject-pick { display: flex; gap: 12px; }
.pick { flex: 1; }
.pick input { display: none; }
.pick-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 12px;
  border: 2px solid var(--border);
  border-radius: 12px;
  text-align: center;
  transition: all .2s;
}
.pick-icon { color: var(--sub); transition: color .2s; }
.pick-box strong { font-size: 16px; }
.pick-box small { color: var(--sub); font-size: 12px; }
.pick input:checked + .pick-box {
  border-color: var(--green);
  background: var(--green-light);
}
.pick input:checked + .pick-box .pick-icon { color: var(--green); }
.pick input:checked + .pick-box strong { color: var(--green-d); }

/* 字段 */
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field label { display: block; font-size: 13px; color: #4b5563; margin-bottom: 7px; font-weight: 500; }
.field input, .field select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 13px;
  font-size: 15px;
  background: #fafbfc;
  outline: none;
  transition: all .2s;
  color: var(--text);
}
.field input:focus, .field select:focus {
  border-color: var(--green);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(7, 193, 96, .1);
}
.hint { display: block; color: var(--sub); font-size: 11.5px; margin-top: 5px; }

/* 图片上传 */
.image-field .img-preview {
  width: 100%;
  max-width: 200px;
  height: 124px;
  border: 1.5px dashed #c5cad3;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--sub);
  font-size: 13px;
  transition: all .2s;
}
.image-field .img-preview .up-icon { color: var(--sub); }
.img-preview.uploaded { border-color: var(--green); border-style: solid; }
.img-preview.failed { border-color: var(--err); }

/* 费率选择 */
.rate-list { display: flex; flex-direction: column; gap: 10px; }
.rate-empty {
  text-align: center;
  color: var(--sub);
  font-size: 13px;
  padding: 18px;
  background: #fafbfc;
  border-radius: 10px;
}
.rate-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: #fafbfc;
  cursor: pointer;
  transition: all .2s;
}
.rate-item:active { transform: scale(.99); }
.rate-radio {
  width: 20px; height: 20px;
  border: 2px solid #c5cad3;
  border-radius: 50%;
  flex-shrink: 0;
  transition: all .2s;
}
.rate-main { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.rate-label { font-size: 15px; font-weight: 600; color: var(--text); }
.rate-value { font-size: 13px; color: var(--green-d); font-weight: 600; }
.rate-check { color: var(--green); display: none; }
.rate-item.active {
  border-color: var(--green);
  background: var(--green-light);
}
.rate-item.active .rate-radio {
  border-color: var(--green);
  background: var(--green);
  box-shadow: inset 0 0 0 3px #fff;
}
.rate-item.active .rate-check { display: inline-flex; }

/* 提交栏 */
.submit-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, .04);
}
.btn-primary {
  width: 100%;
  background: var(--green);
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .2s;
}
.btn-primary:active { background: var(--green-d); }
.btn-icon { display: inline-flex; }

.orders-bar { margin-bottom: 14px; }
.btn-ghost {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--green);
  color: #fff;
  text-decoration: none;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 14px;
}

/* 订单卡片 */
.order-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.order-head strong { font-size: 16px; }
.badge { font-size: 12px; padding: 4px 10px; border-radius: 7px; color: #fff; font-weight: 500; }
.badge.ok { background: var(--green); }
.badge.err { background: var(--err); }
.badge.pending { background: var(--pending); }
.order-row { display: flex; justify-content: space-between; font-size: 13px; padding: 5px 0; color: var(--sub); }
.order-row b { color: var(--text); font-weight: 500; word-break: break-all; text-align: right; max-width: 62%; }
.order-desc { font-size: 12px; color: var(--sub); margin-top: 8px; background: #f7f8fa; padding: 10px; border-radius: 8px; word-break: break-all; }
.err-text { color: var(--err); }
.order-actions { display: flex; gap: 10px; margin-top: 14px; }
.empty { text-align: center; color: var(--sub); padding: 44px; }

/* toast / loading */
.toast {
  position: fixed;
  left: 50%;
  bottom: 110px;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, .82);
  color: #fff;
  padding: 11px 18px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 100;
  max-width: 88%;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .2);
}
.toast.ok { background: rgba(7, 193, 96, .96); }
.toast.err { background: rgba(250, 81, 81, .96); }
.loading {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, .5);
  backdrop-filter: blur(1px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.spinner {
  width: 38px; height: 38px;
  border: 3px solid #e5e7eb;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 准备资料页 ===== */
.prepare-hero {
  text-align: center;
  padding: 18px 0 4px;
}
.prepare-hero h2 { margin: 0 0 6px; font-size: 20px; color: var(--green-d); }
.prepare-hero p { margin: 0; color: var(--sub); font-size: 13px; }
.prepare-item { padding: 16px; }
.prepare-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.prepare-head strong { font-size: 16px; }
.prepare-icon { color: var(--green); display: inline-flex; }
.prepare-desc { margin: 0; color: var(--sub); font-size: 13px; line-height: 1.6; padding-left: 32px; }

.card-desc { margin: -6px 0 14px; color: var(--sub); font-size: 12.5px; }

/* ===== 底部 Tabbar ===== */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: calc(56px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 50;
}
.tabbar-item {
  flex: 1;
  border: none;
  background: none;
  color: var(--sub);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
}
.tabbar-item.active { color: var(--green); }
.tabbar-icon { display: inline-flex; }

/* 提交栏在 tabbar 之上 */
.submit-bar { bottom: calc(56px + env(safe-area-inset-bottom)); }
body { padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
.view { padding-bottom: 80px; }

/* ===== 驳回明细 ===== */
.order-reject {
  margin-top: 10px;
  background: #fff4f4;
  border: 1px solid #ffd9d9;
  border-radius: 8px;
  padding: 10px 12px;
}
.reject-title { color: var(--err); font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.order-reject ul { margin: 0; padding-left: 18px; }
.order-reject li { font-size: 12.5px; color: #7a3b3b; margin-bottom: 4px; line-height: 1.5; }
.order-reject b { color: var(--err); }

.btn-link {
  border: none;
  cursor: pointer;
}

/* ===== 二维码弹层 ===== */
.qr-modal { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; }
.qr-mask { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.qr-box {
  position: relative;
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  width: 300px;
  max-width: 86%;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0,0,0,.25);
}
.qr-box h3 { margin: 0 0 16px; font-size: 16px; }
.qr-box img { width: 220px; height: 220px; display: block; margin: 0 auto 14px; }
.qr-box p { color: var(--sub); font-size: 12.5px; line-height: 1.6; margin: 0 0 16px; }
.qr-box .btn-ghost { width: 100%; justify-content: center; }

/* 服务商未配置提示 */
.sp-warn {
  margin-top: 12px;
  background: #fff4e5;
  color: #b06a00;
  font-size: 12.5px;
  padding: 10px 12px;
  border-radius: 8px;
  line-height: 1.5;
}
