:root {
  --brand: #1a73e8;
  --brand-dark: #1559b0;
  --ok: #07a35a;
  --warn: #e6a23c;
  --danger: #e2554f;
  --bg: #f4f6fa;
  --card: #ffffff;
  --text: #1f2733;
  --muted: #8a94a6;
  --line: #e6eaf0;
  --radius: 14px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}
.app { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--bg); display: flex; flex-direction: column; }
.topbar {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff; padding: 18px 18px 14px; display: flex; align-items: center; justify-content: space-between;
}
.topbar h1 { font-size: 18px; margin: 0; font-weight: 700; }
.topbar .sub { font-size: 12px; opacity: .85; margin-top: 2px; }
.topbar .who { font-size: 12px; text-align: right; }
.topbar .who a { color: #fff; opacity: .9; text-decoration: underline; }
.content { flex: 1; padding: 14px; }
.card { background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; box-shadow: 0 2px 10px rgba(20,40,80,.05); }
.card h3 { margin: 0 0 10px; font-size: 15px; }
.muted { color: var(--muted); font-size: 13px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
input, select, textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 15px; background: #fff; color: var(--text); outline: none;
}
input:focus, select:focus { border-color: var(--brand); }
/* 复选框/单选框：不受全局 input 宽度与内距影响，保持原生小方框/圆点 */
input[type="checkbox"], input[type="radio"] {
  width: auto; height: auto; padding: 0; border: none; border-radius: 0;
  background: transparent; box-shadow: none; flex: 0 0 auto; margin: 0;
  accent-color: var(--brand); cursor: pointer;
}
.btn {
  display: inline-block; border: none; border-radius: 10px; padding: 12px 16px; font-size: 15px;
  background: var(--brand); color: #fff; text-align: center; cursor: pointer; width: 100%;
  font-weight: 600; transition: opacity .15s;
}
.btn:active { opacity: .85; }
.btn.block { width: 100%; }
.btn.ghost { background: #eef3fb; color: var(--brand); }
.btn.ok { background: var(--ok); }
.btn.warn { background: var(--warn); }
.btn.danger { background: var(--danger); }
.btn.sm { padding: 7px 12px; font-size: 13px; width: auto; }
.btn:disabled { background: #e2e7ef; color: #9aa4b2; cursor: not-allowed; }
.field input:disabled, .field select:disabled {
  background: #f2f4f8; color: #9aa4b2; cursor: not-allowed;
  -webkit-text-fill-color: #9aa4b2; opacity: 1;
}
.tabs { display: flex; background: #fff; border-top: 1px solid var(--line); }
.tabs a {
  flex: 1; text-align: center; padding: 10px 0; font-size: 13px; color: var(--muted);
  text-decoration: none; border-top: 2px solid transparent;
}
.tabs a.active { color: var(--brand); border-top-color: var(--brand); font-weight: 600; }
.tag { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 20px; font-weight: 600; }
.tag.pending { background: #fff4e5; color: var(--warn); }
.tag.paid { background: #e8f0fe; color: var(--brand); }
.tag.accepted { background: #e6f7ee; color: var(--ok); }
.tag.completed { background: #eef1f5; color: var(--muted); }
.tag.cancelled { background: #fdecec; color: var(--danger); }
/* 车检站卡片：左图右文 + 标签 + 区域角标 */
.station {
  display: flex; gap: 10px; align-items: flex-start; position: relative;
  border: 1px solid var(--line); border-radius: 12px; padding: 10px;
  margin-bottom: 10px; cursor: pointer; background: #fff;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.station:last-child { margin-bottom: 0; }
.station.sel { border-color: var(--brand); background: #f5f9ff; box-shadow: 0 0 0 2px rgba(26,115,232,.10); }
.station.sel::after {
  content: '✓'; position: absolute; right: 8px; bottom: 8px;
  width: 18px; height: 18px; border-radius: 50%; background: var(--brand); color: #fff;
  font-size: 12px; line-height: 18px; text-align: center; font-weight: 700;
}
.st-thumb {
  width: 96px; height: 76px; flex: 0 0 auto; border-radius: 10px;
  overflow: hidden; background: #eef2f8;
}
.st-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.st-main { flex: 1 1 auto; min-width: 0; }
.st-name {
  font-size: 15px; font-weight: 700; line-height: 1.35; color: var(--text);
  display: flex; align-items: center; gap: 6px;
}
.station.sel .st-name { color: var(--brand); }
.st-dist {
  flex: 0 0 auto; font-size: 11px; font-weight: 500; color: #e07b28;
  border: 1px solid #f6d6b3; background: #fff7ee; border-radius: 6px; padding: 1px 6px;
}
.st-addr, .st-hours { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.st-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.st-tag {
  font-size: 11.5px; color: #e07b28; border: 1px solid #f4cfa4;
  background: #fffaf3; border-radius: 6px; padding: 1px 7px; line-height: 1.5;
}
.st-fee { font-size: 12px; color: var(--muted); margin-top: 10px; }
.station .name { font-weight: 600; }
.station .meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.price { color: var(--danger); font-weight: 700; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.qr-box { text-align: center; padding: 10px 0; }
.qr-box canvas, .qr-box img { margin: 0 auto; display: block; border: 8px solid #fff; box-shadow: 0 2px 12px rgba(0,0,0,.1); border-radius: 8px; }
.list-item { border-bottom: 1px solid var(--line); padding: 12px 0; }
.list-item:last-child { border-bottom: none; }
.alert { background: #fff7e6; border: 1px solid #ffe0a3; color: #8a5a00; padding: 10px 12px; border-radius: 10px; font-size: 13px; margin-bottom: 12px; }
.toast {
  position: fixed; left: 50%; top: 40%; transform: translate(-50%,-50%);
  background: rgba(0,0,0,.82); color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 14px;
  z-index: 99; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 80%;
}
.toast.show { opacity: 1; }
.split { display: flex; gap: 10px; }
.split > * { flex: 1; }
.prov { flex: 0 0 68px !important; text-align: center; }
.code { font-family: Consolas, monospace; background: #f3f5f9; padding: 2px 6px; border-radius: 5px; }

/* 车牌分段录入 */
.plate-input { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.plate-prov { flex: 0 0 54px; width: 54px; text-align: center; font-weight: 600; padding: 10px 2px; }
.plate-dot { color: var(--muted); font-weight: 700; }
.plate-cells { display: flex; gap: 4px; flex-wrap: wrap; }
.plate-cell {
  width: 30px; height: 40px; text-align: center; text-transform: uppercase;
  font-size: 17px; font-weight: 700; padding: 0; border: 1px solid var(--line); border-radius: 8px;
}
.plate-cell:focus { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(26,115,232,.15); }
.plate-ev {
  border: 1px dashed var(--ok); color: var(--ok); background: #e6f7ee;
  border-radius: 8px; padding: 6px 8px; font-size: 12px; font-weight: 600;
}

/* 预约订单卡片字段 */
.kv { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.kv:last-of-type { border-bottom: none; }
.kv span { color: var(--muted); flex-shrink: 0; }
.kv b { font-weight: 600; text-align: right; word-break: break-all; }
.ops { display: flex; flex-wrap: wrap; gap: 8px; }

/* 二维码弹窗 */
.modal { position: fixed; inset: 0; z-index: 50; }
.modal-mask { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.modal-box {
  position: absolute; z-index: 1; background: #fff; border-radius: var(--radius);
  padding: 20px; width: 86%; max-width: 300px; text-align: center;
  top: 50%; left: 50%; transform: translate(-50%,-50%);
}
.modal-box h3 { margin: 0 0 12px; font-size: 15px; }
.modal-box .qr-box { padding: 6px 0 10px; }

/* 优惠券发放对象选择 */
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg-item {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 14px; cursor: pointer; background: #fff; user-select: none; white-space: nowrap;
}
.seg-item input { margin: 0; }
.seg-item:has(input:checked) { border-color: var(--brand); background: #eef5ff; color: var(--brand); font-weight: 600; }

.member-pick { max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: #fff; }
#selBox { margin: 2px 0 14px; }
#selBox > .muted { margin-bottom: 8px; }
.pick-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid transparent; border-radius: 8px;
  cursor: pointer; font-size: 14px; line-height: 1.4;
}
.pick-item + .pick-item { margin-top: 2px; }
.pick-item:hover { background: #f7faff; }
.pick-item:has(input:checked) { background: #eef5ff; border-color: #cfe1ff; }
.pick-item .pick-text { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-item .pick-phone { color: var(--muted); font-size: 13px; margin-left: 8px; }
.pick-item .tag { flex: 0 0 auto; }
.pick-item.disabled { opacity: .5; cursor: not-allowed; }
.pick-item.disabled:hover { background: transparent; }
.pick-item input { margin: 0; }

/* 年检提示行 */
.inspect-hint { display: inline-block; margin-top: 6px; font-size: 12.5px; line-height: 1.5; }

/* 车辆信息提示块（费用 + 年检状态），块级左对齐 */
.veh-notice { font-size: 14px; line-height: 1.6; text-align: left; }
.veh-notice .fee { color: var(--text); }
.veh-notice .inspect-box {
  margin-top: 8px; padding: 10px 12px; background: #f7f9fc;
  border: 1px solid #e9eef7; border-radius: 10px;
}
.veh-notice .kv-row {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13px; color: var(--muted);
}
.veh-notice .kv-row b { font-size: 16px; color: var(--text); letter-spacing: .5px; }
.veh-notice .state {
  display: inline-block; margin-top: 8px; padding: 3px 10px; border-radius: 8px;
  font-size: 13.5px; font-weight: 700; color: #fff;
}
.veh-notice .state.ok { background: var(--ok); }
.veh-notice .state.no { background: var(--danger); }
.veh-notice .basis { margin-top: 8px; font-size: 11.5px; color: #9aa4b2; }
.veh-notice .tip { margin-top: 6px; font-size: 12px; color: var(--muted); }
.veh-notice .tip-warn { color: #e67e22; }

/* 后台小标题 */
.card h4 { margin: 14px 0 6px; font-size: 14px; color: var(--text); }

/* ---------- 优惠券卡片 ---------- */
.cp-group-title { font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 2px 0 8px; }
.cp-group-title + .cp-group-title { margin-top: 16px; }
.coupon {
  display: flex; align-items: stretch; position: relative;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; margin-bottom: 12px;
}
.coupon:last-child { margin-bottom: 0; }
.coupon.dead { background: #fbfcfd; }
.cp-left {
  flex: 0 0 98px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 16px 6px; color: #fff;
  background: linear-gradient(135deg, #3b8cf7, var(--brand-dark));
}
.coupon.dead .cp-left { background: linear-gradient(135deg, #c8d0dc, #adb7c6); }
.cp-amt { font-size: 27px; font-weight: 800; line-height: 1; letter-spacing: -.6px; }
.cp-amt .cp-cur { font-size: 15px; font-weight: 700; margin-right: 1px; }
.cp-cond { font-size: 11px; opacity: .9; margin-top: 7px; }
.cp-split { position: relative; width: 0; border-left: 1.5px dashed #dce2eb; }
.cp-notch { position: absolute; left: -8px; width: 16px; height: 16px; border-radius: 50%; background: #fff; }
.cp-notch.t { top: -9px; }
.cp-notch.b { bottom: -9px; }
.cp-right { flex: 1; padding: 13px 14px; min-width: 0; }
.cp-head { display: flex; align-items: center; gap: 8px; }
.cp-title {
  font-size: 15px; font-weight: 700; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.coupon.dead .cp-title { color: #7d8798; }
.cp-state { flex: 0 0 auto; font-size: 11px; padding: 1px 8px; border-radius: 20px; font-weight: 600; }
.cp-state.free { background: #e6f7ee; color: var(--ok); }
.cp-state.used { background: #edf0f5; color: #8a94a6; }
.cp-state.expired { background: #fdeceb; color: var(--danger); }
.cp-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.cp-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 9px; }
.cp-use {
  border: none; background: #eef3fb; color: var(--brand);
  font-size: 12.5px; font-weight: 600; padding: 5px 13px; border-radius: 8px; cursor: pointer;
}
.cp-use:active { opacity: .8; }
.cp-state.soon { background: #fff3e6; color: #d98b1e; }
.cp-meta.warn { color: #d98b1e; }
.cp-code { font-family: Consolas, Menlo, monospace; letter-spacing: .6px; color: #5c6675; }

/* ---------- 我的预约（订单卡） ---------- */
.oc-bar { display: flex; align-items: baseline; justify-content: space-between; padding: 2px 4px 12px; }
.oc-bar h3 { margin: 0; font-size: 16px; }
.oc-bar .cnt { font-size: 12.5px; color: var(--muted); }
.oc-group-title { font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 0 4px 8px; }

.order-card {
  background: #fff; border-radius: 14px; margin-bottom: 12px;
  box-shadow: 0 2px 10px rgba(20, 40, 80, .05); overflow: hidden;
}
.order-card.dim { background: #fbfcfe; }
.oc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 14px 16px 0; }
.oc-station { font-size: 15.5px; font-weight: 700; line-height: 1.35; }
.oc-tip { margin: 8px 16px 0; font-size: 12.5px; line-height: 1.55; color: var(--muted); }
.oc-tip.brand { color: var(--brand); }
.oc-tip.warn { color: #d98b1e; }
.oc-info { padding: 9px 16px 10px; margin-top: 9px; border-top: 1px dashed var(--line); }
.oc-info .kv { font-size: 13.5px; padding: 7px 0; }
.oc-info .kv b { max-width: 68%; }
.oc-no { font-family: Consolas, Menlo, monospace; font-size: 12.5px; color: #5c6675; letter-spacing: .3px; }
.oc-disc { font-style: normal; color: var(--ok); font-size: 12px; font-weight: 600; margin-left: 5px; }
.oc-qr { padding: 16px 16px 16px; text-align: center; background: #f8fafd; border-top: 1px dashed var(--line); }
.qr-frame {
  display: inline-block; padding: 8px; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; cursor: zoom-in;
}
.qr-frame canvas, .qr-frame img { display: block; }
.qr-frame.big { padding: 10px; border-radius: 14px; cursor: default; }
.qr-label { margin-top: 8px; font-size: 12px; color: var(--muted); }
.oc-foot { display: flex; align-items: center; gap: 10px; padding: 0 16px 14px; }
.oc-title-wrap { min-width: 0; }
.oc-addr { font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
.oc-cancel {
  border: 1px solid #f1bdb9; background: #fff7f6; color: var(--danger);
  font-size: 13px; padding: 8px 14px; border-radius: 9px;
  cursor: pointer; font-family: inherit; white-space: nowrap;
}
.oc-cancel:active { background: #ffeae8; }

/* ---------- 自建日期面板 ---------- */
.date-picker-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; font-size: 15px; color: var(--text); cursor: pointer;
  font-family: inherit; text-align: left;
}
.date-picker-btn:disabled { background: #f2f4f8; color: #9aa4b2; cursor: not-allowed; }
.date-picker-btn .dp-caret { color: var(--muted); font-size: 12px; }
.date-picker-btn .placeholder { color: #b6bdc9; }

.dp-box { max-width: 340px; padding: 16px; }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.dp-title { font-size: 15px; font-weight: 700; }
.dp-nav {
  border: none; background: #eef3fb; color: var(--brand); width: 32px; height: 32px;
  border-radius: 9px; font-size: 17px; line-height: 1; cursor: pointer; font-family: inherit;
}
.dp-nav:disabled { background: #f2f4f8; color: #c9d0dc; cursor: not-allowed; }
.dp-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-bottom: 4px; }
.dp-week span { text-align: center; font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 2px 0; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dp-cell {
  position: relative; border: none; height: 38px; border-radius: 9px;
  background: #f7f9fc; color: var(--text); font-size: 13.5px;
  cursor: pointer; font-family: inherit; padding: 0;
}
.dp-cell.empty { background: transparent; cursor: default; }
.dp-cell.dis { background: #f4f6fa; color: #c7cedb; cursor: not-allowed; }
.dp-cell.sel { background: var(--brand); color: #fff; font-weight: 700; box-shadow: 0 2px 8px rgba(26,115,232,.32); }
.dp-cell.today::after {
  content: ''; position: absolute; left: 50%; bottom: 5px; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--brand);
}
.dp-cell.today.sel::after { background: #fff; }
.dp-legend { margin-top: 11px; font-size: 11.5px; color: var(--muted); line-height: 1.5; text-align: left; }

/* ---------- 经营汇总 ---------- */
.sum-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 4px; }
.sum-kpi { background: #f7f9fc; border: 1px solid var(--line); border-radius: 10px; padding: 12px 6px; text-align: center; }
.sum-kpi .n { font-size: 19px; font-weight: 700; line-height: 1.2; }
.sum-kpi .l { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
@media (max-width: 380px) { .sum-kpis { grid-template-columns: repeat(2, 1fr); } }

/* ---------- 会员列表（紧凑行式） ---------- */
.mem-filter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.mem-row { display: flex; align-items: center; gap: 10px; padding: 12px 2px; border-bottom: 1px dashed var(--line); }
.mem-row:last-child { border-bottom: none; }
.mem-av {
  flex: 0 0 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #3b8cf7, var(--brand-dark));
}
.mem-row.frozen .mem-av { background: linear-gradient(135deg, #c8d0dc, #adb7c6); }
.mem-main { flex: 1; min-width: 0; }
.mem-nm { display: flex; align-items: center; gap: 6px; min-width: 0; }
.mem-name { font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mem-row.frozen .mem-name { color: #7d8798; }
.mem-sub {
  font-size: 12px; color: var(--muted); margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
.mem-ops { flex: 0 0 auto; display: flex; gap: 6px; }
.mem-op {
  border: 1px solid var(--line); background: #fff; color: #5c6675;
  font-size: 12px; padding: 5px 9px; border-radius: 8px;
  cursor: pointer; font-family: inherit; white-space: nowrap;
}
.mem-op:active { background: #f5f7fa; }
.mem-op.danger { border-color: #f5c6c3; background: #fff6f5; color: var(--danger); }
.mem-op.ok { border-color: #bfe6cf; background: #f1fbf5; color: var(--ok); }

/* ---------- 订单时间线 ---------- */
.ap-time {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  margin-top: 10px; padding: 10px 2px 2px; border-top: 1px dashed var(--line);
}
.ap-time-item { text-align: center; min-width: 0; }
.ap-time-item .l { display: block; font-size: 11px; color: var(--muted); }
.ap-time-item .d {
  display: block; font-size: 12px; font-weight: 600; margin-top: 3px;
  font-variant-numeric: tabular-nums; color: var(--text);
}
.ap-time-item .t { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
.ap-time-item.ok .d { color: var(--ok); }
.ap-time-item.none .d { color: #c7cedb; }

/* ---------- 操作员管理 ---------- */
.op-role { flex: 0 0 auto; font-size: 11px; padding: 1px 8px; border-radius: 20px; font-weight: 600; }
.op-role.super { background: #eef3fb; color: var(--brand); }
.op-role.op { background: #edf0f5; color: #8a94a6; }
.op-del {
  border: none; background: none; color: var(--danger); font-size: 12.5px;
  padding: 4px 2px; cursor: pointer; font-family: inherit;
  text-decoration: underline; text-underline-offset: 3px;
}
.op-del:active { opacity: .7; }
.mem-ops .mem-op { padding: 5px 8px; }
