/* ==========================================================
   借车管理 · 移动端样式
   移动优先，适配微信内置浏览器
   ========================================================== */
:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1a1d21;
  --text-2: #6b7280;
  --text-3: #9ca3af;
  --line: #e8eaed;
  --primary: #2563eb;
  --primary-soft: #eef4ff;
  --green: #16a34a;
  --green-soft: #e9f8ef;
  --amber: #d97706;
  --amber-soft: #fef6e7;
  --red: #dc2626;
  --red-soft: #fdecec;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 14px rgba(16, 24, 40, .05);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101215;
    --card: #1a1d22;
    --text: #eef1f5;
    --text-2: #9aa3af;
    --text-3: #6b7280;
    --line: #272b31;
    --primary: #4f8bff;
    --primary-soft: #16233c;
    --green: #34d399;
    --green-soft: #14291f;
    --amber: #fbbf24;
    --amber-soft: #2d2413;
    --red: #f87171;
    --red-soft: #2e1a1a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
body.has-tabbar { padding-bottom: calc(62px + var(--safe-b)); }

a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; display: block; }
input, select, textarea, button { font-family: inherit; font-size: 15px; }

/* ---------------- 顶部栏 ---------------- */
.appbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 10px;
  height: 52px; padding: 0 14px;
  background: var(--card);
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.appbar h1 { flex: 1; font-size: 17px; font-weight: 600; margin: 0; letter-spacing: .2px; }
.appbar .sub { font-size: 12px; color: var(--text-3); font-weight: 400; margin-left: 6px; }
.appbar-btn {
  border: 0; background: transparent; color: var(--primary);
  font-size: 15px; padding: 6px 2px; cursor: pointer;
}
.appbar-btn.ghost { color: var(--text-2); }

/* ---------------- 布局 ---------------- */
.page { padding: 14px; max-width: 720px; margin: 0 auto; }
.section { margin-bottom: 18px; }
.section-title {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; color: var(--text-2); font-weight: 600;
  margin: 0 2px 8px; letter-spacing: .3px;
}
.section-title .count { font-weight: 400; color: var(--text-3); }
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px; margin-bottom: 12px;
}
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--text-2); }
.tiny { font-size: 12.5px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.mb0 { margin-bottom: 0; }

/* ---------------- 车牌号 ---------------- */
.plate {
  display: inline-flex; align-items: center;
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-weight: 700; letter-spacing: 1px;
  background: var(--primary); color: #fff;
  padding: 3px 9px; border-radius: 7px; font-size: 14px;
}
.plate.lg { font-size: 20px; padding: 6px 14px; border-radius: 10px; letter-spacing: 2px; }
.plate.gray { background: var(--text-3); }

/* ---------------- 车辆卡片 ---------------- */
.vehicle-card { position: relative; overflow: hidden; }
.vehicle-card .head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.vehicle-card .name { font-size: 15px; font-weight: 600; margin-top: 8px; }
.vehicle-card .specs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
/* 已借出车辆：借车人 / 起租日期 / 月租金 */
.vehicle-card .rental {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px;
  margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--line);
  font-size: 12.5px; color: var(--text-2);
}
.vehicle-card .rental .who { color: var(--text); font-weight: 600; }
/* 头部右侧：已收租金合计 + 状态徽标（合计在最左边，紧挨状态左侧） */
.vehicle-card .head-right { display: flex; align-items: center; gap: 8px; flex: none; }
.vehicle-card .rent-sum {
  font-size: 12px; color: var(--text-2); white-space: nowrap;
}
.vehicle-card .rent-sum b { color: var(--text); font-weight: 700; margin-left: 4px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--bg); color: var(--text-2);
  border-radius: 999px; padding: 3px 10px; font-size: 12.5px;
}
.chip.warn { background: var(--amber-soft); color: var(--amber); }
.chip.danger { background: var(--red-soft); color: var(--red); }
.chip.ok { background: var(--green-soft); color: var(--green); }
.chip.info { background: var(--primary-soft); color: var(--primary); }

.badge {
  font-size: 11.5px; padding: 2px 8px; border-radius: 6px; font-weight: 600;
  background: var(--bg); color: var(--text-2); white-space: nowrap;
}
.badge.rented { background: var(--primary-soft); color: var(--primary); }
.badge.idle { background: var(--green-soft); color: var(--green); }
.badge.maintenance { background: var(--amber-soft); color: var(--amber); }
.badge.offline { background: var(--bg); color: var(--text-3); border: 1px solid var(--line); }
.badge.red { background: var(--red-soft); color: var(--red); }

/* 已下架车辆：整体降低存在感，一眼可辨 */
.vehicle-card.is-offline { opacity: .6; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: var(--radius-sm); padding: 11px 16px;
  background: var(--primary); color: #fff; font-weight: 600; font-size: 15px;
  cursor: pointer; transition: opacity .15s, transform .1s; width: 100%;
}
.btn:active { transform: scale(.985); opacity: .9; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.secondary { background: var(--primary-soft); color: var(--primary); }
.btn.ghost { background: transparent; color: var(--text-2); border: 1px solid var(--line); }
.btn.danger { background: var(--red-soft); color: var(--red); }
.btn.sm { padding: 7px 12px; font-size: 13.5px; width: auto; border-radius: 9px; }
.btn.block { width: 100%; }
.btn-group { display: flex; gap: 8px; }

/* ---------------- 表单 ---------------- */
.field { margin-bottom: 14px; }
.field > label {
  display: block; font-size: 13px; color: var(--text-2);
  margin-bottom: 6px; font-weight: 500;
}
.field .req { color: var(--red); margin-left: 2px; }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text);
  padding: 11px 12px; outline: none; transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
select.select {
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%),
                    linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
  padding-right: 34px;
}
.textarea { min-height: 76px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary); background: var(--card);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent);
}
.field-hint { font-size: 12px; color: var(--text-3); margin-top: 5px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

/* ---------------- 概览统计条（四项合并一行） ---------------- */
.statbar {
  display: flex; align-items: stretch;
  padding: 9px 2px; margin-bottom: 12px;
}
.statbar .stat {
  position: relative; flex: 1 1 0; min-width: 0;
  text-align: center; padding: 2px 4px;
}
.statbar .stat + .stat::before {
  content: ''; position: absolute; left: 0; top: 18%; bottom: 18%;
  width: 1px; background: var(--line);
}
.statbar .stat .lb {
  font-size: 11.5px; color: var(--text-3); letter-spacing: .2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.statbar .stat .vv {
  font-size: 21px; font-weight: 700; line-height: 1.2; margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.statbar .stat.danger .vv { color: var(--red); }
.statbar .stat.ok .vv { color: var(--green); }
.statbar .stat.info .vv { color: var(--primary); }
/* 车辆总投入：独立一行，避免把四个大数字挤窄 */
.ptotal {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 0 4px 10px; margin-top: -4px;
}
.ptotal .lb { font-size: 12px; color: var(--text-3); }
.ptotal .vv { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 400px) { .grid2 { grid-template-columns: 1fr; } }

/* ---------------- 图片上传 ---------------- */
.uploader {
  position: relative; border: 1.5px dashed var(--line); border-radius: var(--radius-sm);
  background: var(--bg); min-height: 132px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; cursor: pointer;
}
.uploader.filled { border-style: solid; border-color: transparent; }
.uploader, .thumbs .add { cursor: pointer; }
/* file input 只做承载，不覆盖区域，避免移动端滑动页面时误触发选图 */
.uploader input[type=file],
.thumbs .add input,
.file-input-hidden {
  position: absolute; width: 1px; height: 1px;
  opacity: 0; pointer-events: none; overflow: hidden;
}
.uploader .ph { text-align: center; color: var(--text-3); font-size: 13px; padding: 12px; pointer-events: none; }
.uploader .ph .ico { font-size: 26px; display: block; margin-bottom: 4px; }
.uploader img { width: 100%; height: 132px; object-fit: cover; }
.uploader .clear {
  position: absolute; top: 6px; right: 6px; z-index: 3;
  width: 26px; height: 26px; border-radius: 50%; border: 0;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 15px; line-height: 1;
}
.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.thumbs .t { position: relative; aspect-ratio: 1; border-radius: 9px; overflow: hidden; background: var(--bg); }
.thumbs .t img { width: 100%; height: 100%; object-fit: cover; }
.thumbs .t .clear { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 13px; line-height: 1; }
/* 非图片附件（PDF）：出文件块而不是缩略图 */
.thumbs .t.pdf {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 4px; border: 1px solid var(--line); text-align: center;
}
.thumbs .t.pdf .ext { font-size: 14px; font-weight: 600; color: var(--red); letter-spacing: .5px; }
.thumbs .t.pdf .nm {
  font-size: 9.5px; color: var(--text-3); max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.thumbs .add {
  display: flex; align-items: center; justify-content: center; position: relative;
  border: 1.5px dashed var(--line); color: var(--text-3); font-size: 22px;
  aspect-ratio: 1; border-radius: 9px; background: var(--bg);
}

/* ---------------- 借车人证件位：合同照片 / 手持身份证合同照片 ---------------- */
.docslot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
.docslot {
  position: relative; aspect-ratio: 1.586; border-radius: var(--radius-sm);
  border: 1.5px dashed var(--line); background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; cursor: pointer;
}
/* 手持合影通常是竖构图，单独给它竖版比例，并用 contain 避免把人裁掉 */
.docslot.tall { aspect-ratio: 3 / 4; }
.docslot.filled { border-style: solid; border-color: transparent; }
.docslot.busy { pointer-events: none; }
.docslot input[type=file] {
  position: absolute; width: 1px; height: 1px;
  opacity: 0; pointer-events: none; overflow: hidden;
}
.docslot .ph {
  text-align: center; color: var(--text-3); font-size: 11.5px;
  line-height: 1.45; padding: 8px; pointer-events: none;
}
.docslot .ph .ico { font-size: 21px; display: block; margin-bottom: 3px; }
.docslot img { width: 100%; height: 100%; object-fit: cover; }
.docslot.tall img { object-fit: contain; }
.docslot .clear {
  position: absolute; top: 4px; right: 4px; z-index: 3;
  width: 22px; height: 22px; border-radius: 50%; border: 0;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 13px; line-height: 1;
}
.docslot .tag {
  position: absolute; left: 0; bottom: 0; z-index: 2;
  background: rgba(0, 0, 0, .55); color: #fff;
  font-size: 10.5px; padding: 2px 6px; border-radius: 0 8px 0 var(--radius-sm);
}
.docslot .loading-mask {
  position: absolute; inset: 0; z-index: 4;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .45); color: #fff; font-size: 12px;
}
/* 列表中的证件缩略图 */
.idmini { display: flex; gap: 6px; margin-top: 8px; }
.idmini img {
  width: 64px; height: 40px; object-fit: cover;
  border-radius: 6px; border: 1px solid var(--line); background: var(--bg);
}

/* ---------------- 开关 ---------------- */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.switch .sw {
  position: relative; width: 48px; height: 28px; flex: none;
  background: var(--line); border-radius: 999px; transition: background .2s;
}
.switch .sw::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  background: #fff; border-radius: 50%; transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.switch input { display: none; }
.switch input:checked + .sw { background: var(--green); }
.switch input:checked + .sw::after { transform: translateX(20px); }

/* ---------------- 提醒条目 ---------------- */
.noti { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.noti:last-child { border-bottom: 0; }
.noti .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex: none; background: var(--text-3); }
.noti.danger .dot { background: var(--red); }
.noti.warn .dot { background: var(--amber); }
.noti.info .dot { background: var(--primary); }
.noti .t { font-size: 14.5px; font-weight: 600; }
.noti .c { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.noti.read { opacity: .52; }
.noti.read .t { font-weight: 500; }
/* 「借车人汇总」行最右侧的已缴租金合计 */
.noti-amt { flex: none; align-self: center; text-align: right; white-space: nowrap; }
.noti-amt .lb { font-size: 11.5px; color: var(--text-3); }
.noti-amt .vv { font-size: 14px; font-weight: 700; margin-top: 2px; }

/* ---------------- 历史记录 ---------------- */
.log-item { border-bottom: 1px solid var(--line); padding: 14px 0; }
.log-item:last-child { border-bottom: 0; }
.log-date { font-weight: 700; font-size: 15px; letter-spacing: .3px; }
.log-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.log-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; margin-top: 10px; }
.log-imgs figure { margin: 0; position: relative; }
.log-imgs img {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 9px;
  background: var(--bg); border: 1px solid var(--line);
}
.log-imgs figcaption {
  position: absolute; left: 5px; bottom: 5px; font-size: 10.5px;
  background: rgba(0, 0, 0, .6); color: #fff; padding: 1px 6px; border-radius: 5px;
}

/* ---------------- 分页 ---------------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px 0 4px; }
.pager .info { font-size: 13px; color: var(--text-2); min-width: 76px; text-align: center; }
.pager button {
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  padding: 8px 14px; border-radius: 9px; font-size: 13.5px; cursor: pointer;
}
.pager button[disabled] { opacity: .4; pointer-events: none; }

/* ---------------- 底部导航 ---------------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  display: flex; background: var(--card);
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
}
.tabbar button {
  flex: 1; border: 0; background: transparent; color: var(--text-3);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 0 7px; font-size: 10.5px; cursor: pointer; position: relative;
}
.tabbar button .ico { font-size: 19px; line-height: 1; filter: grayscale(1); opacity: .65; }
.tabbar button.on { color: var(--primary); }
.tabbar button.on .ico { filter: none; opacity: 1; }
.tabbar .dotnum {
  position: absolute; top: 4px; left: 50%; margin-left: 6px;
  background: var(--red); color: #fff; font-size: 10px; line-height: 1;
  padding: 2px 5px; border-radius: 999px; min-width: 15px; text-align: center;
}

/* ---------------- 弹层 ---------------- */
.sheet-mask {
  position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .45);
  display: flex; align-items: flex-end; opacity: 0; pointer-events: none; transition: opacity .22s;
}
.sheet-mask.open { opacity: 1; pointer-events: auto; }
.sheet {
  width: 100%; max-width: 720px; margin: 0 auto; background: var(--card);
  border-radius: 18px 18px 0 0; padding: 16px 16px calc(18px + var(--safe-b));
  max-height: 90vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  transform: translateY(24px); transition: transform .26s cubic-bezier(.32,.72,0,1);
}
.sheet-mask.open .sheet { transform: translateY(0); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet-head h3 { margin: 0; font-size: 16.5px; font-weight: 600; }
.sheet-head .x { border: 0; background: var(--bg); color: var(--text-2); width: 28px; height: 28px; border-radius: 50%; font-size: 16px; line-height: 1; }

/* 二次确认弹窗（自绘，替代原生 confirm） */
.confirm-msg {
  font-size: 14.5px; line-height: 1.7; color: var(--text-2);
  white-space: normal; word-break: break-word; margin-bottom: 16px;
}
.confirm-actions { display: flex; gap: 10px; }
.confirm-actions .btn { flex: 1; width: auto; }

.viewer {
  position: fixed; inset: 0; z-index: 120; background: rgba(0, 0, 0, .94);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px;
  padding: 64px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.viewer.open { opacity: 1; pointer-events: auto; }
/* padding + flex:1 1 auto + min-height:0 让图片在竖向 flex 里自动收缩，不挤压下方说明与关闭按钮 */
.viewer img { flex: 1 1 auto; max-width: 100%; max-height: 100%; min-height: 0; object-fit: contain; }
.viewer .x { position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); right: 16px; z-index: 2; border: 0; background: rgba(255,255,255,.15); color: #fff; width: 36px; height: 36px; border-radius: 50%; font-size: 20px; }
.viewer .cap { flex: none; color: #fff; font-size: 13px; background: rgba(255,255,255,.14); padding: 4px 12px; border-radius: 999px; }
.viewer .cap:empty { display: none; }
/* 弹窗统一底部关闭按钮（图片查看器里是白底透明风格） */
.viewer .viewer-close {
  width: min(80vw, 320px); flex: none;
  background: rgba(255,255,255,.16); color: #fff; border: 1px solid rgba(255,255,255,.28);
}

/* ---------------- 提示 ---------------- */
.toast {
  position: fixed; left: 50%; bottom: calc(84px + var(--safe-b)); transform: translate(-50%, 14px);
  background: rgba(20, 22, 26, .93); color: #fff; font-size: 14px;
  padding: 10px 18px; border-radius: 999px; z-index: 200;
  opacity: 0; pointer-events: none; transition: all .24s; max-width: 86vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--red); }

.empty { text-align: center; color: var(--text-3); padding: 34px 16px; font-size: 14px; }
.empty .ico { font-size: 34px; display: block; margin-bottom: 8px; opacity: .5; }
.loading { text-align: center; padding: 20px; color: var(--text-3); font-size: 13.5px; }

/* ---------------- 登录页 ---------------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-box { width: 100%; max-width: 360px; }
.login-logo { text-align: center; margin-bottom: 26px; }
.login-logo .em { font-size: 46px; }
.login-logo h2 { margin: 8px 0 2px; font-size: 20px; }
.login-logo p { margin: 0; color: var(--text-3); font-size: 13px; }

/* 登录滑块验证码 */
.slider-cap { margin-top: 2px; }
.sc-stage {
  position: relative; width: 100%; overflow: hidden; line-height: 0;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #e9edf2;
  -webkit-user-select: none; user-select: none;
}
.sc-bg { display: block; width: 100%; height: auto; pointer-events: none; -webkit-user-drag: none; }
.sc-piece {
  position: absolute; left: 0; top: 0; pointer-events: none; -webkit-user-drag: none;
  filter: drop-shadow(0 1px 3px rgba(15, 23, 42, .45));
}
.sc-reload {
  position: absolute; right: 6px; top: 6px; width: 26px; height: 26px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; cursor: pointer; color: #fff;
  font-size: 14px; line-height: 1; background: rgba(15, 23, 42, .42);
}
.sc-reload:active { transform: scale(.9); }

.sc-track {
  position: relative; height: 40px; margin-top: 10px;
  border-radius: 20px; background: var(--line); overflow: hidden;
}
.sc-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 40px; background: #bfdbfe; }
.sc-tip {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--text-3);
}
.sc-handle {
  position: absolute; left: 0; top: 0; width: 40px; height: 40px; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  border-radius: 20px; background: #fff; color: var(--primary);
  box-shadow: 0 1px 4px rgba(16, 24, 40, .28);
  font-size: 16px; font-weight: 700; letter-spacing: 1px;
  cursor: grab; touch-action: none;
}
.sc-handle:active { cursor: grabbing; }

/* 状态：通过=绿，未对齐=红（纯色兜底，不用 color-mix） */
.slider-cap.ok .sc-track { background: #d7f2e2; }
.slider-cap.ok .sc-fill { background: #a7e3c2; }
.slider-cap.ok .sc-handle { color: var(--green); cursor: default; }
.slider-cap.ok .sc-tip { color: var(--green); }
.slider-cap.bad .sc-track { background: #fbe0e0; }
.slider-cap.bad .sc-fill { background: #f6bcbc; }
.slider-cap.bad .sc-handle { color: var(--red); }
.slider-cap.bad .sc-tip { color: var(--red); }

/* ---------------- 借车人页 ---------------- */
.borrow-hero {
  background: linear-gradient(135deg, #2563eb, #1d4ed8 55%, #1e40af);
  color: #fff; padding: calc(20px + env(safe-area-inset-top, 0px)) 16px 22px;
}
@media (prefers-color-scheme: dark) {
  .borrow-hero { background: linear-gradient(135deg, #1e3a8a, #1e40af 60%, #172554); }
}
/* 车牌 + 品牌车型 同一行 */
.borrow-hero .hero-row {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 10px; margin: 8px 0 10px;
}
.borrow-hero .brand { font-size: 13.5px; opacity: .88; }
.borrow-hero .plate-hero {
  display: inline-block; font-family: "SF Mono", ui-monospace, Menlo, monospace;
  font-size: 18px; font-weight: 800; letter-spacing: 1.5px;
  background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .28);
  padding: 5px 12px; border-radius: 10px;
}
.borrow-hero .facts { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12.5px; }
.borrow-hero .facts span { background: rgba(255, 255, 255, .16); padding: 3px 10px; border-radius: 999px; }

/* ---------------- 借车人端：顶部到期提醒卡片 ---------------- */
.due-card { padding: 12px 14px; }
.due-card .due-head {
  font-size: 13px; font-weight: 600; color: var(--text-2);
  letter-spacing: .3px; margin-bottom: 2px;
}
.due-card .due-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 8px 0;
}
.due-card .due-row + .due-row { border-top: 1px solid var(--line); }
.due-card .due-label { font-size: 13px; color: var(--text-2); flex: none; }
.due-card .due-val {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13.5px; font-weight: 600; white-space: nowrap;
}

/* ---------------- 借车人端：可折叠的「用车人信息」（默认收起） ---------------- */
.collapse-head {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: 0; padding: 0; margin: 0;
  font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.collapse-ico { font-size: 18px; line-height: 1.2; flex: none; }
.collapse-title { display: block; font-size: 14px; font-weight: 600; }
.collapse-sub { display: block; font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.collapse-sub.warn { color: var(--amber); }
.collapse-arrow {
  flex: none; font-size: 12.5px; font-weight: 600;
  color: var(--primary); background: var(--primary-soft);
  padding: 4px 10px; border-radius: 999px;
}
.collapse-body { margin-top: 12px; }

.steps { display: flex; gap: 6px; margin-bottom: 14px; }
.steps div { flex: 1; height: 4px; border-radius: 999px; background: var(--line); }
.steps div.on { background: var(--primary); }

.done-banner {
  background: var(--green-soft); color: var(--green); border-radius: var(--radius);
  padding: 14px; display: flex; gap: 10px; align-items: flex-start;
}
.done-banner .ico { font-size: 22px; line-height: 1.1; }
.done-banner b { display: block; font-size: 15px; }
.done-banner span { font-size: 13px; opacity: .9; }

.hidden { display: none !important; }
.spin { display: inline-block; width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: sp .7s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
