/* 骑手端样式：正文>=18px，标题>=24px，按钮>=56px，高对比，系统字体，不依赖任何外部资源 */
:root {
  --fg: #1a1a1a; --muted: #4d4d4d; --bg: #f4f6f9; --card: #fff; --line: #c9d1dc;
  --pri: #0a58ca; --pri-bg: #e7f0ff; --ok: #14663a; --ok-bg: #e4f5ea;
  --warn: #5c3d00; --warn-bg: #fff3cd; --bad: #b3261e; --bad-bg: #fdeceb;
  --nav-h: 80px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg); font-size: 18px; line-height: 1.6;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}
h1 { font-size: 26px; line-height: 1.35; margin: 8px 0 14px; }
h2 { font-size: 24px; line-height: 1.35; margin: 22px 0 10px; }
h3 { font-size: 20px; margin: 16px 0 8px; }
p { margin: 8px 0; }
a { color: var(--pri); }
.wrap { max-width: 640px; margin: 0 auto; padding: 14px 16px 190px; }
.wrap.top { padding-top: 78px; }
.muted { color: var(--muted); }
.small { font-size: 18px; }
.center { text-align: center; }
.hide { display: none !important; }

/* 顶栏 */
.topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--line); }
.topbar .row { max-width: 640px; margin: 0 auto; padding: 8px 16px 6px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.topbar .stepno { font-weight: 700; font-size: 20px; }
.saved { font-size: 18px; color: var(--ok); }
.saved.bad { color: var(--bad); }
.bar { height: 8px; background: #dde3ec; }
.bar > i { display: block; height: 100%; background: var(--pri); transition: width .25s; }

/* 按钮 */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 56px; padding: 10px 18px;
  font-size: 20px; font-weight: 700; border-radius: 14px; border: 2px solid var(--pri); background: #fff; color: var(--pri);
  cursor: pointer; text-decoration: none; font-family: inherit;
}
.btn.pri { background: var(--pri); color: #fff; }
.btn.bad { border-color: var(--bad); color: var(--bad); }
.btn.badfill { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.inline { display: inline-flex; width: auto; }
.btn.sm { min-height: 56px; font-size: 18px; }
.btnrow { display: flex; gap: 10px; margin: 10px 0; }
.btnrow > .btn { flex: 1; }

/* 底部导航 */
.nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; background: #fff; border-top: 1px solid var(--line); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
.nav .in { max-width: 640px; margin: 0 auto; display: flex; gap: 12px; }
.nav .btn { flex: 1; }
.nav .btn.pri { flex: 2; }
.fab {
  position: fixed; right: 12px; bottom: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom)); z-index: 21;
  min-height: 56px; padding: 0 18px; border-radius: 30px; border: 2px solid #fff; background: #d9480f; color: #fff;
  font-size: 20px; font-weight: 700; box-shadow: 0 3px 10px rgba(0,0,0,.3); cursor: pointer; font-family: inherit;
}
.fab.low { bottom: 18px; }

/* 选项大卡片 */
.opts { display: grid; gap: 12px; margin: 12px 0; }
.opt {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 76px; padding: 12px 16px; text-align: left;
  background: #fff; border: 3px solid var(--line); border-radius: 16px; font-size: 20px; color: var(--fg); cursor: pointer; font-family: inherit;
}
.opt .ic { flex: none; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; font-size: 34px; }
.opt .tx { flex: 1; font-weight: 700; }
.opt .tx small { display: block; font-size: 18px; font-weight: 400; color: var(--muted); }
.opt .chk { flex: none; width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 20px; color: #fff; }
.opt.sel { border-color: var(--pri); background: var(--pri-bg); }
.opt.sel .chk { background: var(--pri); border-color: var(--pri); }
.opt.multi .chk { border-radius: 8px; }

/* 提示卡 */
.note { border-radius: 14px; padding: 12px 16px; margin: 12px 0; border: 2px solid; }
.note.info { background: var(--pri-bg); border-color: #9bbcf0; }
.note.warn { background: var(--warn-bg); border-color: #e0b94a; color: var(--warn); }
.note.bad { background: var(--bad-bg); border-color: #e59a95; color: var(--bad); }
.note.ok { background: var(--ok-bg); border-color: #8fcaa3; color: var(--ok); }
.note b.t { display: block; font-size: 20px; margin-bottom: 4px; }
.note ul { margin: 6px 0 0; padding-left: 22px; }
.note li { margin: 4px 0; }
.alarm { background: var(--bad); color: #fff; border-radius: 16px; padding: 16px; margin: 10px 0; text-align: center; }
.alarm b { font-size: 26px; display: block; margin-bottom: 8px; }
.alarm .btnrow .btn { background: #fff; color: var(--bad); border-color: #fff; }

/* 表单 */
label.f { display: block; font-weight: 700; margin: 14px 0 6px; }
input[type=text], input[type=tel], input[type=datetime-local], input[type=search], textarea, select {
  width: 100%; min-height: 56px; padding: 10px 14px; font-size: 20px; border: 2px solid #8a96a8; border-radius: 12px; background: #fff; color: var(--fg); font-family: inherit;
}
textarea { min-height: 120px; }
input:focus, textarea:focus { outline: 3px solid #7fb0ff; border-color: var(--pri); }
.err { color: var(--bad); font-weight: 700; margin: 8px 0; }

/* 流程图 */
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 12px 0; }
.flow span.s { background: var(--pri); color: #fff; border-radius: 12px; padding: 8px 12px; font-weight: 700; }
.flow span.a { color: var(--pri); font-weight: 700; }
.contact { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.contact:first-of-type { border-top: 0; }
.contact .who { flex: 1; }
.contact .who small { display: block; color: var(--muted); font-size: 18px; }
.contact .btn { width: auto; min-width: 128px; }

/* 上传位 */
.slot { background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 14px; margin: 14px 0; }
.slot.redo { border-color: var(--bad); border-width: 4px; background: var(--bad-bg); }
.slot h3 { margin: 0 0 4px; font-size: 20px; }
.slot .tag { display: inline-block; font-size: 18px; border-radius: 8px; padding: 0 8px; margin-left: 6px; background: var(--warn-bg); color: var(--warn); }
.slot .tag.st { background: var(--ok-bg); color: var(--ok); }
.slot .how { background: none; border: 0; color: var(--pri); font-size: 18px; text-decoration: underline; padding: 6px 0; cursor: pointer; font-family: inherit; }
.slot .hint { background: #f1f4f8; border-radius: 10px; padding: 10px 12px; margin: 6px 0; }
.slot .hint img { max-width: 100%; border-radius: 8px; display: block; margin-top: 8px; }
.redo-note { color: var(--bad); font-weight: 700; margin: 6px 0; }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0; }
.th { position: relative; width: 100%; height: 0; padding-bottom: 100%; border: 2px solid var(--line); border-radius: 12px; overflow: hidden; background: #eef1f5; }
.th.redo { border: 4px solid var(--bad); }
.th img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; display: block; cursor: pointer; }
.th .ph { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 40px; cursor: pointer; }
.th .del { position: absolute; top: 4px; right: 4px; min-width: 40px; min-height: 40px; border-radius: 20px; border: 0; background: rgba(0,0,0,.7); color: #fff; font-size: 18px; cursor: pointer; padding: 0 8px; }
.th .pg { position: absolute; left: 0; right: 0; bottom: 0; height: 10px; background: rgba(0,0,0,.25); }
.th .pg i { display: block; height: 100%; background: #35c26a; }
.th .stt { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.65); color: #fff; font-size: 16px; text-align: center; padding: 2px; }
.th.fail { border-color: var(--bad); }
.th .re { position: absolute; left: 4px; right: 4px; bottom: 26px; min-height: 40px; border: 0; border-radius: 8px; background: var(--bad); color: #fff; font-size: 16px; cursor: pointer; }
.confirm { background: var(--bad-bg); border: 2px solid var(--bad); border-radius: 12px; padding: 10px; margin: 8px 0; }

/* 弹层 */
.mask { position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: rgba(0,0,0,.55); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: #fff; width: 100%; max-width: 640px; border-radius: 22px 22px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
.sheet h2 { margin-top: 0; }
.sheet .btn { margin: 10px 0; }
.lightbox { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 60; background: #000; display: flex; flex-direction: column; }
.lightbox .top { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: #111; }
.lightbox .top .btn { width: auto; min-height: 56px; }
.lightbox .body { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y pinch-zoom; display: flex; align-items: flex-start; justify-content: center; }
.lightbox img { max-width: 100%; height: auto; display: block; margin: auto; }
.lightbox img.big { max-width: none; width: 260%; }
.lightbox video, .lightbox audio { max-width: 100%; margin: auto; }

/* 检查页 */
.grp { background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 6px 14px 10px; margin: 14px 0; }
.grp h3 { margin: 10px 0 4px; }
.row-it { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid #e3e8ef; }
.row-it:first-of-type { border-top: 0; }
.row-it .l { flex: 1; }
.row-it .l small { display: block; color: var(--muted); font-size: 18px; }
.st-done { color: var(--ok); } .st-later { color: var(--warn); } .st-missing, .st-redo { color: var(--bad); font-weight: 700; }
.pill { display: inline-block; border-radius: 20px; padding: 2px 12px; font-weight: 700; background: var(--pri-bg); color: var(--pri); }
.qr { text-align: center; margin: 12px 0; }
.qr canvas { width: 220px; height: 220px; image-rendering: pixelated; border: 1px solid var(--line); }
.linkbox { word-break: break-all; background: #f1f4f8; border-radius: 10px; padding: 10px 12px; user-select: all; -webkit-user-select: all; }
.statusbar { border-radius: 16px; padding: 14px 16px; font-size: 22px; font-weight: 700; background: var(--pri-bg); color: var(--pri); margin: 8px 0; }
.statusbar.need { background: var(--bad-bg); color: var(--bad); }
.statusbar.done { background: var(--ok-bg); color: var(--ok); }
.statusbar.stop { background: #e9ecef; color: #333; }
details.fold { background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 4px 14px; margin: 12px 0; }
details.fold > summary { min-height: 56px; display: flex; align-items: center; font-weight: 700; cursor: pointer; }
.tabs-case { display: grid; gap: 10px; }
.case-item { display: block; text-decoration: none; color: var(--fg); background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.case-item b { font-size: 20px; }
.empty { text-align: center; padding: 40px 10px; }
.empty .big { font-size: 64px; }
.spin { display: inline-block; width: 22px; height: 22px; border: 3px solid #ccd; border-top-color: var(--pri); border-radius: 50%; animation: sp 1s linear infinite; vertical-align: middle; }
@keyframes sp { to { transform: rotate(360deg); } }
.help-img { max-width: 100%; border: 2px solid var(--line); border-radius: 12px; display: block; margin: 10px 0; background: #eef1f5; min-height: 80px; }
.help-step { background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 4px 16px 14px; margin: 16px 0; }
.help-step h2 { margin-top: 12px; }
.help-step .no { display: inline-flex; width: 40px; height: 40px; border-radius: 50%; background: var(--pri); color: #fff; align-items: center; justify-content: center; margin-right: 8px; font-size: 22px; }
@media (max-width: 360px) { .thumbs { grid-template-columns: repeat(2, 1fr); } }
