:root {
  --brand: #2f6bff;
  --brand-dark: #1f4fd8;
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --ok: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --radius: 12px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  padding-bottom: 64px;
}

.topbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--brand); color: #fff;
  padding: 12px 16px; font-size: 17px; font-weight: 600;
  display: flex; align-items: center; justify-content: space-between;
}
.topbar .sub { font-size: 12px; font-weight: 400; opacity: .85; }

.wrap { padding: 14px; max-width: 720px; margin: 0 auto; }

.card {
  background: var(--card); border-radius: var(--radius);
  padding: 14px; margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .06);
}
.card h3 { margin: 0 0 10px; font-size: 15px; }

textarea, input[type="text"], input[type="tel"] {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-size: 15px; font-family: inherit;
  background: #fff; color: var(--text); outline: none;
}
textarea { min-height: 120px; resize: vertical; }
textarea:focus, input:focus { border-color: var(--brand); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: 10px; padding: 11px 16px;
  background: var(--brand); color: #fff; font-size: 15px; cursor: pointer;
  font-family: inherit; min-height: 44px;
}
.btn:active { background: var(--brand-dark); }
.btn.block { display: flex; width: 100%; }
.btn.ghost { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.btn.gray { background: #eef1f5; color: var(--muted); }
.btn.small { padding: 6px 12px; min-height: 34px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

.hint { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.disclaimer { color: var(--muted); font-size: 12px; text-align: center; margin: 14px 0; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; background: #fff; border-top: 1px solid var(--line);
}
.tabbar button {
  flex: 1; border: none; background: none; padding: 9px 0 8px;
  font-size: 12px; color: var(--muted); font-family: inherit; cursor: pointer;
}
.tabbar button.active { color: var(--brand); font-weight: 600; }
.tabbar .ico { display: block; font-size: 19px; line-height: 1.2; }

.parcel {
  border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; margin-bottom: 10px; background: #fff;
}
.parcel .head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.parcel .no { font-weight: 600; word-break: break-all; }
.parcel .carrier { color: var(--muted); font-size: 13px; }
.parcel .msg { margin-top: 6px; font-size: 14px; }
.parcel .time { color: var(--muted); font-size: 12px; }
.parcel .actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 12px; color: #fff; background: var(--muted);
}
.badge.pending { background: #9ca3af; }
.badge.in_transit { background: var(--brand); }
.badge.delivering { background: var(--warn); }
.badge.signed { background: var(--ok); }
.badge.exception { background: var(--danger); }
.badge.stuck { background: #b45309; }

.timeline { margin-top: 10px; border-left: 2px solid var(--line); padding-left: 12px; }
.timeline .item { position: relative; padding: 6px 0; }
.timeline .item::before {
  content: ""; position: absolute; left: -17px; top: 12px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--line);
}
.timeline .item:first-child::before { background: var(--brand); }
.timeline .t { color: var(--muted); font-size: 12px; }
.timeline .d { font-size: 14px; }

.slots { display: flex; align-items: center; gap: 10px; }
.bar { flex: 1; height: 8px; background: #eef1f5; border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand); }

.group-title { margin: 14px 0 8px; font-size: 13px; color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 30px 0; font-size: 14px; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 80px; background: rgba(17, 24, 39, .92); color: #fff;
  padding: 10px 16px; border-radius: 8px; font-size: 14px; z-index: 99;
  max-width: 86%; text-align: center;
}

.kv { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--muted); }

.plan { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.plan.active { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(47, 107, 255, .12); }
.plan .price { color: var(--danger); font-weight: 600; }
