/* 科特利 · 车货对接 H5 */
:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-soft: #eff6ff;
  --orange: #f97316;
  --green: #16a34a;
  --red: #dc2626;
  --bg: #f2f4f8;
  --card: #fff;
  --text: #1f2937;
  --muted: #8a929e;
  --line: #eef1f6;
  --radius: 14px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  -webkit-font-smoothing: antialiased;
}
input, button, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--blue); text-decoration: none; }
img { max-width: 100%; }

#app { min-height: 100vh; max-width: 640px; margin: 0 auto; background: var(--bg); position: relative; }
.main { padding: 14px 14px calc(80px + var(--safe-bottom)); }
.main.no-tab { padding-bottom: 24px; }

/* 顶部栏 */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255,255,255,.94);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  display: flex; align-items: center; gap: 10px;
}
.topbar h1 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: .3px; }
.topbar .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.topbar .back {
  width: 32px; height: 32px; border-radius: 50%; border: 0; background: #f1f4f9;
  color: #374151; font-size: 18px; line-height: 1; display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex: 0 0 auto;
}
.topbar .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* 卡片 */
.card {
  background: var(--card); border-radius: var(--radius); padding: 16px;
  margin-bottom: 12px; box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 6px 18px rgba(16,24,40,.04);
}
.card.tight { padding: 12px; }
.card-title { font-size: 15px; font-weight: 600; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.card-title .hint { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: auto; }

/* 表单 */
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field > label { display: block; font-size: 13px; color: #5b6474; margin-bottom: 7px; font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid #e3e8f0; background: #fbfcfe; border-radius: 10px;
  padding: 12px 13px; outline: none; transition: border-color .15s, background .15s;
  font-size: 15px; appearance: none;
}
.field select { background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238a929e' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 34px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); background: #fff; box-shadow: 0 0 0 3px rgba(37,99,235,.09); }
.field textarea { resize: vertical; min-height: 74px; }
.field .tip { font-size: 12px; color: var(--muted); margin-top: 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* 按钮 */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; border: 0; border-radius: 11px; padding: 13px 16px;
  background: var(--blue); color: #fff; font-size: 16px; font-weight: 600;
  cursor: pointer; transition: opacity .15s, transform .06s;
}
.btn:active { transform: scale(.99); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn.ghost { background: var(--blue-soft); color: var(--blue); }
.btn.gray { background: #f1f4f9; color: #4b5563; }
.btn.orange { background: var(--orange); }
.btn.red { background: var(--red); }
.btn.sm { width: auto; padding: 8px 14px; font-size: 14px; border-radius: 9px; }
.btn.link { background: none; color: var(--blue); padding: 6px; width: auto; font-size: 14px; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

/* 身份选择 */
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-pick button {
  border: 1.5px solid #e3e8f0; background: #fff; border-radius: 12px; padding: 16px 12px;
  cursor: pointer; text-align: left; transition: all .15s;
}
.role-pick button .ico { font-size: 22px; display: block; margin-bottom: 6px; }
.role-pick button .nm { font-weight: 600; font-size: 15px; display: block; }
.role-pick button .ds { font-size: 12px; color: var(--muted); margin-top: 2px; display: block; }
.role-pick button.on { border-color: var(--blue); background: var(--blue-soft); box-shadow: 0 0 0 3px rgba(37,99,235,.08); }
.notice {
  background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; border-radius: 10px;
  padding: 10px 12px; font-size: 12px; line-height: 1.7; margin-bottom: 14px;
}

/* 状态标签 */
.st { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.pill { display: inline-block; font-size: 12px; padding: 3px 9px; border-radius: 20px; background: #f1f4f9; color: #6b7280; }

/* 列表项 */
.item { display: block; color: inherit; text-decoration: none; }
.item + .item { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.item .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.item .title { font-weight: 600; font-size: 15px; }
.item .route { display: flex; align-items: center; gap: 6px; font-size: 14px; color: #374151; margin-top: 8px; flex-wrap: wrap; }
.item .route .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--blue); flex: 0 0 auto; }
.item .route .arrow { color: #c3cad6; margin: 0 2px; }
.item .meta { font-size: 12px; color: var(--muted); margin-top: 6px; }
.time { font-size: 12px; color: var(--muted); }

/* 价格 */
.price { color: var(--orange); font-weight: 700; font-size: 18px; }
.price small { font-weight: 400; font-size: 12px; color: var(--muted); }

/* 空状态 / 加载 */
.empty { text-align: center; color: var(--muted); padding: 60px 20px; font-size: 14px; line-height: 1.8; }
.loading { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); padding: 50px 0; font-size: 14px; }
.spin { width: 16px; height: 16px; border: 2px solid #dbe3ef; border-top-color: var(--blue); border-radius: 50%; animation: sp .7s linear infinite; display: inline-block; }
@keyframes sp { to { transform: rotate(360deg); } }

/* 分段筛选 */
.seg { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button {
  flex: 0 0 auto; border: 0; background: #fff; color: #5b6474; padding: 8px 14px; border-radius: 20px;
  font-size: 13px; cursor: pointer; box-shadow: 0 1px 2px rgba(16,24,40,.05); white-space: nowrap;
}
.seg button.on { background: var(--blue); color: #fff; font-weight: 600; }

/* 底部导航 */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; max-width: 640px; margin: 0 auto;
  background: rgba(255,255,255,.97); border-top: 1px solid var(--line);
  display: flex; padding-bottom: var(--safe-bottom); z-index: 40;
  backdrop-filter: blur(10px);
}
.tabbar a {
  flex: 1; text-align: center; padding: 8px 0 7px; color: var(--muted);
  font-size: 11px; text-decoration: none; position: relative;
}
.tabbar a .ico { display: block; font-size: 20px; line-height: 1.3; }
.tabbar a.on { color: var(--blue); font-weight: 600; }
.tabbar a .badge {
  position: absolute; top: 4px; right: 50%; margin-right: -22px; min-width: 16px; height: 16px;
  background: var(--red); color: #fff; font-size: 10px; line-height: 16px; border-radius: 8px; padding: 0 4px;
}

/* 详情 */
.hero-price { display: flex; align-items: baseline; gap: 8px; }
.hero-price .big { font-size: 26px; font-weight: 700; color: var(--orange); }
.kv { display: flex; padding: 9px 0; font-size: 14px; border-bottom: 1px dashed var(--line); }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); width: 88px; flex: 0 0 auto; font-size: 13px; }
.kv .v { flex: 1; word-break: break-all; }

/* 时间线 */
.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 8px; width: 2px; background: #e8edf5; }
.timeline .node { position: relative; padding-bottom: 14px; font-size: 14px; }
.timeline .node:last-child { padding-bottom: 0; }
.timeline .node::before {
  content: ''; position: absolute; left: -19px; top: 5px; width: 10px; height: 10px; border-radius: 50%;
  background: #fff; border: 2px solid var(--blue);
}
.timeline .node.danger::before { border-color: var(--red); }
.timeline .node .t { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* 订单码 */
.code-card { background: linear-gradient(135deg, #2563eb, #3b82f6); color: #fff; border-radius: var(--radius); padding: 18px; text-align: center; margin-bottom: 12px; }
.code-card .lb { font-size: 12px; opacity: .85; }
.code-card .code { font-size: 34px; font-weight: 700; letter-spacing: 8px; margin: 6px 0 2px; }

/* 提示条 */
.notice { background: #fff8ed; border: 1px solid #fde4c4; color: #9a5b10; font-size: 13px; padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; line-height: 1.6; }
.notice.blue { background: var(--blue-soft); border-color: #dbe7ff; color: #1e4bb8; }

/* 弹层 */
.mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 60; display: flex; align-items: flex-end; justify-content: center; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  background: #fff; width: 100%; max-width: 640px; border-radius: 18px 18px 0 0;
  padding: 20px 18px calc(20px + var(--safe-bottom)); animation: up .22s ease; max-height: 88vh; overflow-y: auto;
}
@keyframes up { from { transform: translateY(30px); opacity: .6; } }
.sheet h3 { margin: 0 0 6px; font-size: 17px; }
.sheet .desc { color: #5b6474; font-size: 14px; line-height: 1.65; margin: 0 0 16px; white-space: pre-wrap; }
.sheet .sheet-input {
  width: 100%; border: 1px solid #e3e8f0; background: #fbfcfe; border-radius: 10px;
  padding: 12px; margin-bottom: 14px; outline: none; font-size: 16px;
}
.sheet .sheet-input:focus { border-color: var(--blue); background: #fff; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
  background: rgba(17,24,39,.9); color: #fff; font-size: 14px; padding: 10px 18px;
  border-radius: 20px; z-index: 90; max-width: 80vw; text-align: center; animation: fade .15s ease;
}

/* 已选地址 */
.loc-box { border: 1px dashed #d8e0ec; border-radius: 10px; padding: 10px 12px; background: #fbfcfe; margin-top: 8px; font-size: 13px; color: #4b5563; display: flex; gap: 8px; align-items: flex-start; }
.loc-box .tag { font-size: 11px; color: var(--green); background: #ecfdf3; padding: 2px 7px; border-radius: 6px; flex: 0 0 auto; margin-top: 1px; }

/* 地图选点 */
.map-page { position: fixed; inset: 0; z-index: 70; background: #fff; display: flex; flex-direction: column; }
.map-page .map-head { padding: 12px 14px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.map-page .map-head .t { font-weight: 600; }
.map-page #map-canvas { flex: 1; position: relative; background: #eef2f7; }
.map-page .center-pin {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -100%);
  font-size: 30px; pointer-events: none; filter: drop-shadow(0 3px 5px rgba(0,0,0,.28));
}
.map-page .map-info { padding: 12px 14px calc(14px + var(--safe-bottom)); border-top: 1px solid var(--line); }
.map-page .map-info .ad { font-size: 14px; font-weight: 600; min-height: 21px; }
.map-page .map-info .sub { font-size: 12px; color: var(--muted); margin: 3px 0 10px; min-height: 18px; }
.map-search { display: flex; gap: 8px; padding: 10px 14px; }
.map-search input { flex: 1; border: 1px solid #e3e8f0; border-radius: 10px; padding: 10px 12px; outline: none; background: #fbfcfe; }
.map-result { position: absolute; left: 10px; right: 10px; top: 56px; background: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(16,24,40,.16); max-height: 50vh; overflow-y: auto; z-index: 5; }
.map-result .ri { padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 14px; cursor: pointer; }
.map-result .ri:last-child { border-bottom: 0; }
.map-result .ri .s { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* 统计格 */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stats .s { background: #f8fafd; border-radius: 12px; padding: 12px 8px; text-align: center; }
.stats .s .v { font-size: 20px; font-weight: 700; color: var(--blue); }
.stats .s .l { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* 管理端 */
.mgr-tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; scrollbar-width: none; }
.mgr-tabs::-webkit-scrollbar { display: none; }
.mgr-tabs button { flex: 0 0 auto; border: 0; background: #fff; padding: 9px 14px; border-radius: 10px; font-size: 13px; color: #5b6474; cursor: pointer; position: relative; }
.mgr-tabs button.on { background: var(--blue); color: #fff; font-weight: 600; }
.mgr-tabs button .n { background: var(--red); color: #fff; font-size: 10px; border-radius: 8px; padding: 0 5px; margin-left: 4px; }

.logo { width: 58px; height: 58px; border-radius: 16px; background: linear-gradient(135deg, #2563eb, #60a5fa); color: #fff; font-size: 26px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; box-shadow: 0 8px 22px rgba(37,99,235,.28); }
.auth-wrap { padding: 8vh 20px 30px; }
.auth-wrap h2 { text-align: center; margin: 0 0 4px; font-size: 21px; }
.auth-wrap .sub { text-align: center; color: var(--muted); font-size: 13px; margin: 0 0 22px; }
.switch-line { text-align: center; font-size: 14px; color: var(--muted); padding: 16px 0 4px; }
.switch-line a { font-weight: 600; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 18px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* 异常订单 */
.ex-party { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 6px; margin-right: 6px; }
.ex-item { padding: 0; }
.ex-item + .ex-item { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.ex-line { font-size: 14px; color: #374151; margin-top: 8px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.ex-detail { font-size: 13px; color: #5b6474; background: #f8fafd; border-radius: 9px; padding: 9px 11px; margin-top: 8px; line-height: 1.6; }
.ex-detail .lb { color: var(--muted); font-size: 12px; }
.ex-photos { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 9px; }
.ex-photos img { width: 68px; height: 68px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; }
.ex-actions { display: flex; gap: 8px; margin-top: 10px; }

/* 到达打卡 */
.ck-block { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fbfcfe; }
.ck-block + .ck-block { margin-top: 10px; }
.ck-block.done { background: #f0fdf4; border-color: #bbf7d0; }
.ck-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ck-head .t { font-weight: 600; font-size: 14px; }
.ck-meta { font-size: 12px; color: #5b6474; margin-top: 6px; line-height: 1.65; }
.ck-meta .warn { color: var(--orange); font-weight: 600; }
.ck-photos { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 9px; }
.ck-photos img { width: 60px; height: 60px; object-fit: cover; border-radius: 8px; border: 1px solid #cfe9d8; cursor: pointer; }

/* 图片查看 */
.lightbox { align-items: center; background: rgba(8,12,20,.88); }
.lightbox .lb-wrap { width: 100%; max-width: 640px; display: flex; flex-direction: column; align-items: center; }
.lightbox img { max-height: 76vh; max-width: 100%; border-radius: 10px; object-fit: contain; }
.lightbox .lb-bar { display: flex; align-items: center; gap: 14px; color: #fff; font-size: 13px; margin-top: 14px; }
.lightbox .lb-btn { border: 0; background: rgba(255,255,255,.16); color: #fff; width: 38px; height: 38px; border-radius: 50%; font-size: 20px; line-height: 1; cursor: pointer; }

/* 上报弹层里的类型选择 */
.type-pick { display: grid; grid-template-columns: 1fr; gap: 6px; max-height: 210px; overflow-y: auto; margin-bottom: 12px; }
.type-pick label { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 9px 11px; border: 1px solid #e3e8f0; border-radius: 9px; background: #fbfcfe; cursor: pointer; }
.type-pick label.on { border-color: var(--blue); background: var(--blue-soft); color: #1e4bb8; font-weight: 600; }
.type-pick input { width: 16px; height: 16px; accent-color: var(--blue); }
.up-photos { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.up-photos .up { width: 72px; height: 72px; border-radius: 9px; border: 1px dashed #cbd5e1; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 22px; cursor: pointer; background: #fbfcfe; }
.up-photos .ph { position: relative; width: 72px; height: 72px; }
.up-photos .ph img { width: 100%; height: 100%; object-fit: cover; border-radius: 9px; }
.up-photos .ph .x { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; background: rgba(17,24,39,.8); color: #fff; font-size: 12px; line-height: 20px; text-align: center; cursor: pointer; }
.ck-sub { font-size: 12px; color: var(--muted); }

/* 通知设置 */
.notify-sec { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 12px; background: #fbfcfe; }
.notify-sec .hd { font-weight: 600; font-size: 14px; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; }
.notify-sec .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.code-input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px !important; }
.tpl-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.tpl-row:last-child { border-bottom: 0; }
.tpl-row .nm { flex: 1; font-size: 13px; }
.tpl-row input { flex: 1.2; border: 1px solid #e3e8f0; background: #fff; border-radius: 8px; padding: 7px 9px; outline: none; font-size: 13px; }

