/* 道路救援 · 移动端 H5 设计（独立壳层，不复用桌面端布局） */
:root {
  --h5-primary: #6366f1;
  --h5-primary-dark: #4f46e5;
  --h5-ink: #0f172a;
  --h5-muted: #64748b;
  --h5-line: #e8ecf3;
  --h5-bg: #f4f6fb;
  --h5-card: #ffffff;
  --h5-green: #059669;
  --h5-amber: #d97706;
  --h5-red: #dc2626;
  --h5-safe: env(safe-area-inset-bottom, 0px);
  --h5-tab: 58px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--h5-bg);
  color: var(--h5-ink);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
}
a { color: var(--h5-primary); text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: 14px; }
img { max-width: 100%; display: block; }
.h5-app { max-width: 720px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(var(--h5-tab) + var(--h5-safe) + 12px); }
.h5-top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #4f46e5, #6d28d9 70%, #7c3aed);
  color: #fff;
  border-radius: 0 0 18px 18px;
  box-shadow: 0 6px 18px rgba(79,70,229,.22);
}
.h5-top.plain { background: #fff; color: var(--h5-ink); border-bottom: 1px solid var(--h5-line); border-radius: 0; box-shadow: none; position: sticky; }
.h5-top .back { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 9px; background: rgba(255,255,255,.18); color: inherit; border: 0; font-size: 17px; }
.h5-top.plain .back { background: #f1f5f9; }
.h5-top h1 { font-size: 16px; margin: 0; flex: 1; font-weight: 700; letter-spacing: .01em; }
.h5-top .sub { font-size: 11px; opacity: .82; font-weight: 400; display: block; margin-top: 1px; }
.h5-top .act { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 9px; background: rgba(255,255,255,.18); border: 0; color: inherit; font-size: 15px; position: relative; }
.h5-body { padding: 14px 14px 0; }
.h5-tab {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: calc(var(--h5-tab) + var(--h5-safe));
  padding-bottom: var(--h5-safe);
  display: flex; max-width: 720px; margin: 0 auto;
  background: rgba(255,255,255,.96);
  backdrop-filter: saturate(180%) blur(10px);
  border-top: 1px solid var(--h5-line);
}
.h5-tab a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: #94a3b8; font-size: 10px; font-weight: 600;
}
.h5-tab a .ic { font-size: 19px; line-height: 1; }
.h5-tab a.on { color: var(--h5-primary); }
.h5-tab a .ic { position: relative; }
.h5-dot, .h5-bell-dot {
  position: absolute; top: -2px; right: -7px; min-width: 15px; height: 15px; padding: 0 4px;
  border-radius: 999px; background: #ef4444; color: #fff; font-size: 9px; font-style: normal;
  display: flex; align-items: center; justify-content: center; font-weight: 700; border: 2px solid #fff;
}
.h5-bell-dot { top: -3px; right: -3px; }
.h5-tab a.mid { position: relative; }
.h5-tab a.mid .ic {
  width: 44px; height: 44px; margin-top: -22px; border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5, #7c3aed); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  box-shadow: 0 8px 18px rgba(79,70,229,.34); border: 3px solid #fff;
}
.h5-hero { padding: 4px 2px 12px; }
.h5-hero h2 { margin: 0; font-size: 21px; letter-spacing: -.01em; }
.h5-hero p { margin: 4px 0 0; color: var(--h5-muted); font-size: 12px; }
.h5-card { background: var(--h5-card); border: 1px solid var(--h5-line); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.h5-card.flush { padding: 0; overflow: hidden; }
.h5-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.h5-card-head h3 { font-size: 14px; margin: 0; flex: 1; }
.h5-card-head a { font-size: 12px; color: var(--h5-muted); }
.h5-kpis { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-bottom: 12px; }
.h5-kpi { background: #fff; border: 1px solid var(--h5-line); border-radius: 14px; padding: 12px 14px; }
.h5-kpi .k { font-size: 11px; color: var(--h5-muted); display: flex; align-items: center; justify-content: space-between; }
.h5-kpi .v { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.h5-kpi .v small { font-size: 11px; font-weight: 500; color: var(--h5-muted); margin-left: 3px; }
.h5-kpi.warn .v { color: var(--h5-amber); }
.h5-kpi.bad .v { color: var(--h5-red); }
.h5-kpi.good .v { color: var(--h5-green); }
.h5-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.h5-quick a { background: #fff; border: 1px solid var(--h5-line); border-radius: 12px; padding: 12px 4px; display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 11px; color: #475569; font-weight: 600; text-align: center; }
.h5-quick a .ic { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 17px; background: #eef2ff; }
.h5-quick a:active { transform: scale(.97); }
.h5-list { display: flex; flex-direction: column; }
.h5-item { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--h5-line); background: #fff; }
.h5-item:last-child { border-bottom: 0; }
.h5-item .main { flex: 1; min-width: 0; }
.h5-item .row1 { display: flex; align-items: center; gap: 6px; }
.h5-item .no { font-size: 13px; font-weight: 700; color: var(--h5-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h5-item .meta { font-size: 11px; color: var(--h5-muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h5-item .amt { font-size: 13px; font-weight: 700; color: var(--h5-ink); }
.h5-item .side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 4px; flex: 0 0 auto; }
.h5-badge { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; background: #eef2ff; color: #4338ca; white-space: nowrap; }
.h5-badge.green { background: #ecfdf5; color: #047857; }
.h5-badge.red { background: #fef2f2; color: #b91c1c; }
.h5-badge.amber { background: #fffbeb; color: #b45309; }
.h5-badge.gray { background: #f1f5f9; color: #475569; }
.h5-badge.blue { background: #eff6ff; color: #1d4ed8; }
.h5-badge.indigo { background: #eef2ff; color: #4338ca; }

/* 大图查看 */
.h5-lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(2,6,23,.92); display: none; align-items: center; justify-content: center; padding: 16px; }
.h5-lightbox.on { display: flex; }
.h5-lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; }
.h5-chips { display: flex; gap: 8px; padding: 10px 14px; overflow-x: auto; scrollbar-width: none; background: #fff; border-bottom: 1px solid var(--h5-line); position: sticky; top: 0; z-index: 20; }
.h5-chips::-webkit-scrollbar { display: none; }
.h5-chips button { flex: 0 0 auto; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--h5-line); background: #fff; color: #475569; font-size: 12px; font-weight: 600; }
.h5-chips button.on { background: var(--h5-primary); border-color: var(--h5-primary); color: #fff; }
.h5-empty { text-align: center; padding: 46px 16px; color: var(--h5-muted); font-size: 13px; }
.h5-empty .ic { font-size: 34px; margin-bottom: 8px; opacity: .5; }
.h5-skel { padding: 14px; }
.h5-skel .line { height: 12px; border-radius: 6px; background: linear-gradient(90deg,#eef2f7 25%,#f8fafc 37%,#eef2f7 63%); background-size: 400% 100%; animation: h5sk 1.2s ease infinite; margin-bottom: 8px; }
@keyframes h5sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.h5-field { margin-bottom: 12px; }
.h5-field label { display: block; font-size: 12px; color: var(--h5-muted); font-weight: 600; margin-bottom: 5px; }
.h5-field label .req { color: var(--h5-red); }
.h5-field input, .h5-field select, .h5-field textarea {
  width: 100%; border: 1px solid var(--h5-line); border-radius: 10px; padding: 10px 12px;
  background: #fff; color: var(--h5-ink); font-size: 14px; min-height: 42px; outline: none;
}
.h5-field textarea { min-height: 76px; resize: vertical; }
.h5-field input:focus, .h5-field select:focus, .h5-field textarea:focus { border-color: var(--h5-primary); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.h5-field .hint { font-size: 11px; color: var(--h5-muted); margin-top: 4px; }
.h5-field .err { border-color: var(--h5-red) !important; }
.h5-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.h5-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; min-height: 44px; border-radius: 12px; border: 0;
  background: linear-gradient(135deg, #4f46e5, #6d28d9); color: #fff;
  font-size: 15px; font-weight: 700; padding: 0 16px;
  box-shadow: 0 8px 20px rgba(79,70,229,.24);
}
.h5-btn:active { transform: translateY(1px); }
.h5-btn:disabled { opacity: .55; }
.h5-btn.ghost { background: #fff; color: var(--h5-ink); border: 1px solid var(--h5-line); box-shadow: none; }
.h5-btn.danger { background: #fff; color: var(--h5-red); border: 1px solid #fecaca; box-shadow: none; }
.h5-btn.sm { width: auto; min-height: 34px; font-size: 12px; padding: 0 12px; border-radius: 9px; }
.h5-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 14px calc(12px + var(--h5-safe)); }
.h5-sticky-actions { position: sticky; bottom: 0; background: rgba(255,255,255,.96); border-top: 1px solid var(--h5-line); backdrop-filter: blur(8px); z-index: 25; }
.h5-timeline { list-style: none; margin: 0; padding: 0 0 0 4px; }
.h5-timeline li { position: relative; padding: 0 0 14px 20px; border-left: 2px solid #e5eaf4; font-size: 13px; }
.h5-timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.h5-timeline li::before { content: ''; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: #cbd5e1; }
.h5-timeline li.done::before { background: var(--h5-primary); }
.h5-timeline .t { font-size: 11px; color: var(--h5-muted); margin-top: 2px; }
.h5-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.h5-photos .ph { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--h5-line); background: #f8fafc; aspect-ratio: 1; }
.h5-photos .ph img { width: 100%; height: 100%; object-fit: cover; }
.h5-photos .ph span { position: absolute; left: 0; right: 0; bottom: 0; font-size: 10px; padding: 2px 5px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.6)); }
.h5-photos .add { display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px dashed #c7d2fe; color: var(--h5-primary); background: #f8faff; font-size: 11px; font-weight: 600; gap: 2px; border-radius: 10px; aspect-ratio: 1; }
.h5-photos .add .ic { font-size: 20px; }
.h5-kv { display: grid; grid-template-columns: 78px 1fr; gap: 8px 10px; font-size: 13px; }
.h5-kv .k { color: var(--h5-muted); }
.h5-kv .v { color: var(--h5-ink); word-break: break-all; }
.h5-slideup { position: fixed; inset: 0; z-index: 90; display: none; }
.h5-slideup.on { display: block; }
.h5-slideup .mask { position: absolute; inset: 0; background: rgba(15,23,42,.45); }
.h5-slideup .panel { position: absolute; left: 0; right: 0; bottom: 0; background: #fff; border-radius: 18px 18px 0 0; padding: 16px 16px calc(16px + var(--h5-safe)); max-height: 86vh; overflow: auto; animation: up .2s ease; }
@keyframes up { from { transform: translateY(40px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }
.h5-slideup h3 { margin: 0 0 12px; font-size: 15px; }
.h5-loading { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 16px; color: var(--h5-muted); font-size: 12px; }
.h5-loading .sp { width: 16px; height: 16px; border: 2px solid #c7d2fe; border-top-color: var(--h5-primary); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.h5-offline { display: none; background: #fffbeb; color: #92400e; font-size: 12px; padding: 8px 14px; border-bottom: 1px solid #fde68a; }
body.offline .h5-offline { display: block; }
.h5-note { font-size: 11px; color: var(--h5-muted); text-align: center; padding: 10px 0 0; }
.h5-seg { display: flex; background: #eef2f7; border-radius: 10px; padding: 3px; margin-bottom: 12px; }
.h5-seg button { flex: 1; border: 0; background: transparent; padding: 7px; border-radius: 8px; font-size: 12px; font-weight: 700; color: #64748b; }
.h5-seg button.on { background: #fff; color: var(--h5-primary); box-shadow: 0 1px 4px rgba(15,23,42,.08); }
.h5-login { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 28px 20px; background: linear-gradient(160deg, #eef2ff 0%, #f8fafc 45%, #fff 100%); }
.h5-login .brand { text-align: center; margin-bottom: 24px; }
.h5-login .brand .mark { width: 58px; height: 58px; border-radius: 18px; margin: 0 auto 12px; background: linear-gradient(135deg,#4f46e5,#7c3aed); color: #fff; font-size: 26px; font-weight: 800; display: flex; align-items: center; justify-content: center; box-shadow: 0 12px 30px rgba(79,70,229,.3); }
.h5-login h1 { font-size: 21px; margin: 0; }
.h5-login .sub { color: var(--h5-muted); font-size: 12px; margin-top: 4px; }
.h5-login .h5-card { padding: 18px; }
.h5-login .roles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.h5-login .roles button { border: 1px solid var(--h5-line); background: #fff; border-radius: 12px; padding: 10px; text-align: left; }
.h5-login .roles button strong { display: block; font-size: 13px; }
.h5-login .roles button span { font-size: 10px; color: var(--h5-muted); }
.h5-toast-wrap { position: fixed; left: 50%; bottom: calc(var(--h5-tab) + 30px); transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.h5-toast { background: rgba(15,23,42,.9); color: #fff; padding: 9px 16px; border-radius: 999px; font-size: 13px; }
.h5-toast.ok { background: rgba(5,150,105,.94); }
.h5-toast.bad { background: rgba(220,38,38,.94); }
@media (min-width: 721px) {
  body { background: #e9edf5; }
  .h5-app { box-shadow: 0 0 60px rgba(15,23,42,.12); background: var(--h5-bg); }
}
