/* 停车买单预约助手 · H5 版（移动优先） */
:root {
  --brand: #07c160;
  --brand-2: #059d50;
  --brand-weak: #e9f9f0;
  --bg: #f4f5f7;
  --card: #ffffff;
  --ink: #1f2329;
  --ink-2: #666b73;
  --ink-3: #9aa0a8;
  --line: #eceef1;
  --danger: #e64340;
  --warn: #ff9900;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 14px rgba(16, 24, 40, 0.05);
}
* { 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(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}
.app {
  max-width: 540px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 16px 14px calc(28px + env(safe-area-inset-bottom));
}
.boot { color: var(--ink-3); text-align: center; padding: 60px 0; }

/* 卡片 / 区块 */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}
.card-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.muted { color: var(--ink-2); font-size: 13px; }
.faint { color: var(--ink-3); font-size: 12px; }
.mono { letter-spacing: 1px; font-family: ui-monospace, Menlo, Consolas, monospace; }

/* 顶部 */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.topbar .gname { font-size: 19px; font-weight: 800; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .today { font-size: 12px; color: var(--ink-3); }
.link-btn { color: var(--brand); font-size: 13px; font-weight: 600; background: none; border: 0; padding: 6px 2px; cursor: pointer; }

/* 按钮 */
.btn {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 13px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; }
.btn-primary:disabled { opacity: 0.45; }
.btn-ghost { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.btn-soft { background: var(--brand-weak); color: var(--brand-2); font-weight: 600; }
.btn-danger { background: #fdecec; color: var(--danger); font-weight: 600; }
.btn-sm { display: inline-flex; align-items: center; justify-content: center; width: auto; padding: 6px 12px; font-size: 13px; border-radius: 8px; font-weight: 600; }
.btn-xs { display: inline-flex; align-items: center; justify-content: center; padding: 4px 9px; font-size: 12px; border-radius: 7px; border: 0; cursor: pointer; }

.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.row .btn { flex: 1; }

/* 表单 */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.input, .select, textarea.input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 15px;
  background: #fff;
  color: var(--ink);
  outline: none;
}
.input:focus { border-color: var(--brand); }
.input::placeholder { color: var(--ink-3); }

/* 今日状态 */
.status-big {
  display: flex; align-items: center; gap: 14px;
  border-radius: var(--radius);
  padding: 16px;
  color: #fff;
  background: linear-gradient(135deg, #07c160, #059d50);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.status-big.free { background: linear-gradient(135deg, #8a919c, #6c737d); }
.status-big .ic { font-size: 30px; }
.status-big .t1 { font-size: 16px; font-weight: 800; }
.status-big .t2 { font-size: 13px; opacity: 0.92; margin-top: 2px; }
.status-big .t2 b { letter-spacing: 1px; }

/* 成员选本人车牌 列表 */
.slot-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: 12px; box-shadow: var(--shadow);
  padding: 13px 14px; margin-bottom: 10px;
}
.slot-card .avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--brand-weak); color: var(--brand-2);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 17px; flex: none;
}
.slot-card .body { flex: 1; min-width: 0; }
.slot-card .nm { font-weight: 700; }
.slot-card .pl { color: var(--ink-3); font-size: 12px; margin-top: 1px; letter-spacing: 1px; }
.chip { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 3px 9px; flex: none; }
.chip-ok { background: var(--brand-weak); color: var(--brand-2); }
.chip-empty { background: #f0f1f3; color: var(--ink-3); }

/* 弹层 */
.overlay {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(0, 0, 0, 0.45);
  display: flex; align-items: flex-end; justify-content: center;
}
.overlay .sheet {
  width: 100%; max-width: 540px;
  background: #fff; border-radius: 18px 18px 0 0;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  max-height: 88vh; overflow-y: auto;
  animation: up 0.18s ease;
}
@keyframes up { from { transform: translateY(30px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.overlay .sheet h3 { margin: 0 0 4px; font-size: 17px; }
.sheet .close-x { float: right; border: 0; background: #f0f1f3; width: 28px; height: 28px; border-radius: 50%; color: var(--ink-2); font-size: 14px; cursor: pointer; }

/* 时间 chips */
.time-grid { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 2px; }
.time-chip {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 7px 13px; font-size: 14px; cursor: pointer; color: var(--ink);
}
.time-chip.on { background: var(--brand-weak); border-color: var(--brand); color: var(--brand-2); font-weight: 700; }
.time-chip.custom { border-style: dashed; }

/* 管理员 组卡 / 行 */
.grp-card { display: block; }
.grp-top { display: flex; align-items: center; gap: 10px; }
.grp-top .nm { font-weight: 800; font-size: 16px; flex: 1; }
.grp-meta { color: var(--ink-3); font-size: 12px; margin-top: 6px; }
.grp-actions { display: flex; gap: 8px; margin-top: 12px; }

.admin-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.admin-row:last-child { border-bottom: 0; }
.admin-row .b { flex: 1; min-width: 0; }
.admin-row .qbtn { border: 1px solid var(--line); background: #fff; width: 32px; height: 32px; border-radius: 8px; font-size: 16px; color: var(--ink-2); cursor: pointer; flex: none; }
.admin-row .act-col { flex: none; display: flex; flex-direction: column; align-items: stretch; }
.admin-row .nm { font-weight: 700; font-size: 15px; }
.admin-row .pl { color: var(--ink); font-size: 15px; margin-top: 3px; }
.admin-row .pl .none { color: var(--ink-3); }

.kv { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 7px 0; }
.kv .k { color: var(--ink-2); font-size: 13px; }
.kv .v { font-weight: 700; text-align: right; }
.li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.li:last-child { border-bottom: 0; }
.li .t { flex: 1; color: var(--ink-2); }
.delta { font-weight: 800; flex: none; }
.delta.plus { color: var(--brand-2); }
.delta.minus { color: var(--danger); }
.badge-danger { background: #fdecec; color: var(--danger); }
.badge-plain { background: #f0f1f3; color: var(--ink-2); }
.badge-super { background: #fff1d1; color: #9a6a00; border: 1px solid #f5d488; }
.badge { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 8px; flex: none; }

.tabs { display: flex; background: #eceef1; border-radius: 10px; padding: 3px; margin-bottom: 16px; }
.tabs .tab { flex: 1; text-align: center; padding: 9px; border-radius: 8px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.tabs .tab.on { background: #fff; color: var(--brand-2); box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.center { text-align: center; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }
.hint { font-size: 12px; color: var(--ink-3); margin-top: 8px; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 12%;
  transform: translateX(-50%);
  background: rgba(20, 22, 26, 0.92); color: #fff;
  padding: 9px 16px; border-radius: 999px; font-size: 14px;
  max-width: 82vw; z-index: 99; text-align: center;
}
.toast.ok { background: rgba(7, 193, 96, 0.95); }
.toast.err { background: rgba(230, 67, 64, 0.95); }

.spin { text-align: center; padding: 30px 0; color: var(--ink-3); }
.inline-code { background: #f0f1f3; border-radius: 6px; padding: 1px 7px; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }

/* 三天状态：无人预约=绿色，有人预约=灰色 */
.days { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.status-day {
  background: linear-gradient(135deg, #8a919c, #6c737d); color: #fff; /* 已约：灰 */
  border-radius: 14px; padding: 10px 10px 11px; box-shadow: var(--shadow);
}
.status-day.free { background: linear-gradient(135deg, #07c160, #059d50); } /* 空闲：绿 */
.status-day .d-top { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.status-day .d-top b { font-size: 15px; font-weight: 800; }
.status-day .d-date { font-size: 10px; font-weight: 600; opacity: .9; margin-top: 1px; }
.status-day em {
  font-style: normal; font-size: 10px; font-weight: 700;
  background: rgba(255,255,255,.28); border-radius: 999px; padding: 1px 6px; white-space: nowrap;
}
.status-day .d-b { margin-top: 6px; font-size: 11.5px; opacity: .96; line-height: 1.4; word-break: break-all; }
.status-day.free .d-b { opacity: .92; }

/* pick 开关（日期/时间 chips） */
.pick-grid { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 4px; }
.pick {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 7px 13px; font-size: 14px; cursor: pointer; color: var(--ink);
}
.pick.on { background: var(--brand-weak); border-color: var(--brand); color: var(--brand-2); font-weight: 700; }
.pick.dis { background: #f0f1f3; border-color: var(--line); color: #b6bbc4; cursor: not-allowed; }

/* 二次确认强提示（红字）/ 组预约提示 / 分隔 / 小节标题 */
.warn-line {
  background: #fdecec; color: #c62828; border: 1px solid #f3c1c1;
  border-radius: 10px; padding: 9px 11px; font-size: 13px; line-height: 1.6; margin: 6px 0 12px;
}
.warn-line b { color: #b71c1c; }
.tips-line {
  background: #fff7e0; color: #8a5a00; border: 1px solid #f0dc9c;
  border-radius: 10px; padding: 9px 11px; font-size: 13px; line-height: 1.6; margin: 4px 0 10px;
}
.tips-line > div { margin: 0; }
/* 圆点列表：只有"普通/左对齐"行显示圆点；居中/右对齐行是强调行，不画 */
.tips-ed > div.ta-l::before,
.tips-line > div.ta-l::before { content: '•\00a0\00a0'; color: inherit; }
.tips-ed > div.ta-c, .tips-line > div.ta-c { text-align: center; }
.tips-ed > div.ta-c::before, .tips-line > div.ta-c::before { content: none; }
.tips-ed > div.ta-r, .tips-line > div.ta-r { text-align: right; }
.tips-ed > div.ta-r::before, .tips-line > div.ta-r::before { content: none; }

/* 组提示 · 轻量富文本工具栏 + 编辑器 */
.tips-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px;
  background: #f4f5f7; border: 1px solid var(--line); border-bottom: 0;
  border-radius: 10px 10px 0 0; padding: 6px 8px;
}
.tips-bar .tb {
  border: 1px solid var(--line); background: #fff; border-radius: 6px;
  min-width: 28px; height: 27px; padding: 0 7px; font-size: 13px; line-height: 1;
  cursor: pointer; color: var(--ink-2);
}
.tips-bar .tb:active { background: var(--brand-weak); color: var(--brand-2); }
.tips-bar .tb-label { font-size: 11px; color: var(--ink-3); margin-left: 2px; }
.tips-bar .sw {
  width: 20px; height: 20px; border-radius: 50%; border: 1px solid rgba(0,0,0,.18);
  cursor: pointer; flex: none; padding: 0;
}
.tips-bar .tsep { width: 1px; height: 16px; background: var(--line); margin: 0 2px; }
.tips-ed {
  min-height: 64px; border: 1px solid var(--line); border-radius: 0 0 10px 10px;
  padding: 8px 10px; background: #fff; font-size: 14px; color: var(--ink);
  line-height: 1.6; outline: none; word-break: break-word;
}
.tips-ed:focus { border-color: var(--brand); }
.tips-ed:empty::before { content: attr(data-placeholder); color: var(--ink-3); }
.tips-ed > div { margin: 0 0 2px; }
.tips-ed > div:last-child { margin-bottom: 0; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.block-t { font-size: 14px; font-weight: 800; margin: 4px 0 8px; }

/* 查剩余结果 */
.q-result { min-height: 2px; margin-top: 4px; font-size: 13px; }
.q-ok { color: var(--brand-2); background: var(--brand-weak); border-radius: 8px; padding: 8px 10px; line-height: 1.6; }
.q-err { color: var(--danger); background: #fdecec; border-radius: 8px; padding: 8px 10px; line-height: 1.5; }

/* 查剩余 · 可视化补字格子：已显字 + 空框 */
.plate-row { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin: 16px 0 8px; }
.mcell {
  width: 36px; height: 44px; border-radius: 8px;
  font-size: 20px; font-weight: 700; line-height: 44px;
  text-align: center;
}
.mcell.fx { background: #eef1f5; border: 1px solid var(--line); color: var(--ink); }
.mcell.qbox {
  border: 1.5px dashed #b9bfc9; background: #fff;
  outline: none; color: var(--brand-2);
  font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0;
  caret-color: var(--brand);
}
.mcell.qbox.filled { border-style: solid; border-color: var(--brand); }
.mcell.qbox:focus { border-style: solid; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.18); }

/* ---------- 访问控制：登录分段 / 秘钥 / 勾选 / 徽章 ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chips .chip {
  font-size: 13px; font-weight: 700; padding: 8px 14px; border-radius: 999px;
  background: #eceef1; color: var(--ink-2); border: 1px solid transparent; cursor: pointer;
}
.chips .chip.on { background: #fff; color: var(--brand-2); border-color: var(--brand); }
.keyonce {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 22px; font-weight: 800;
  letter-spacing: 4px; text-align: center; color: var(--brand-2);
  background: var(--brand-weak); border: 1px dashed var(--brand); border-radius: 10px;
  padding: 14px 8px; margin: 6px 0 14px; user-select: all;
}
.checkgroup { display: flex; flex-direction: column; gap: 7px; padding: 10px 12px; background: #f6f7f9; border-radius: 10px; max-height: 220px; overflow: auto; }
.check { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); flex: none; }
.txt-danger { color: var(--danger) !important; border-color: #f2b8b8 !important; }
.badge-ok { background: #e7f8ee; color: var(--brand-2); }

/* 超管停车组：创建人筛选 + 组名搜索联想 */
.super-filters { padding: 12px; margin-bottom: 12px; }
.sugwrap { position: relative; flex: 2 1 180px; min-width: 160px; }
.sugwrap .input { width: 100%; }
.sugbox { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 50; background: #fff;
  border: 1px solid #e3e6ea; border-radius: 10px; box-shadow: 0 8px 20px rgba(0,0,0,.09); overflow: hidden; }
.sugbox .sugitem { padding: 9px 12px; font-size: 14px; cursor: pointer; border-bottom: 1px solid #f0f1f3; }
.sugbox .sugitem:last-child { border-bottom: 0; }
.sugbox .sugitem:hover { background: #f3f6fb; }
.sugbox .sugempty { padding: 9px 12px; font-size: 13px; color: var(--ink-3); }

/* ============ 后台首页日历（横轴近3天 × 纵轴停车组） ============ */
.cal-card { padding: 10px 6px 12px; }
.cal-head, .cal-row {
  display: grid;
  grid-template-columns: minmax(118px, 158px) repeat(3, minmax(0, 1fr));
  gap: 6px;
  align-items: stretch;
  min-width: 360px;
}
.cal-card { overflow-x: auto; }
.cal-h { display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 6px 4px; border-radius: 10px; background: #fff; border: 1px solid #e9ebef; }
.cal-h b { font-size: 14px; color: var(--ink-2, #333); }
.cal-h span { font-size: 11px; color: #9aa2ab; margin-top: 1px; }
.cal-row { margin-top: 6px; }
.cal-g { background: #fff; border: 1px solid #e9ebef; border-radius: 10px; padding: 7px 9px;
  display: flex; flex-direction: column; justify-content: center; min-width: 0; cursor: pointer; }
.cal-gname { font-weight: 700; font-size: 13px; color: #222; line-height: 1.35;
  white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
.cal-gsub { font-size: 10px; color: #9aa2ab; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-c { border-radius: 10px; padding: 5px 8px; min-height: 46px; cursor: pointer;
  display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.cal-free { background: var(--brand-weak); color: #0a8a48; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; gap: 2px; }
.cal-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); display: inline-block; }
.cal-busy { background: #eceff2; color: #57606b; }
.cal-busy .cal-who { font-size: 12px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-busy .cal-plate { font-size: 11px; font-weight: 600; color: #454c56; letter-spacing: .4px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-busy .cal-line2 { font-size: 10.5px; color: #8a939e; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-foot { text-align: center; margin: 10px 0 2px; font-size: 13px; }
.cal-foot .link-btn { color: #8a939e; font-weight: 500; }
