/* 燃油宝寄存 · 手机/平板通用样式
   设计原则：大字号、大按钮、无动画（适配低配工控机显卡） */

:root {
  --bg: #f1f5f9;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --blue: #2563eb;
  --blue-d: #1d4ed8;
  --green: #16a34a;
  --red: #dc2626;
  --amber: #d97706;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: #0f172a;
  color: #f8fafc;
}
.brand { font-size: 19px; font-weight: 700; letter-spacing: .5px; display: flex; align-items: center; gap: 8px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #22c55e; display: inline-block; }
#staffSel {
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 15px;
  max-width: 40vw;
}

/* ---------- 标签页 ---------- */
.tabs {
  position: sticky;
  top: 56px;
  z-index: 19;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.tab {
  border: 0;
  background: transparent;
  padding: 15px 4px;
  font-size: 16px;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  border-bottom: 3px solid transparent;
}
.tab.active { color: var(--blue); border-bottom-color: var(--blue); }

/* ---------- 面板 ---------- */
main { padding: 14px 14px 40px; max-width: 760px; margin: 0 auto; }
.panel { display: none; }
.panel.active { display: block; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
}

/* ---------- 表单 ---------- */
.lbl {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin: 14px 0 6px;
  font-weight: 600;
}
.lbl:first-child { margin-top: 0; }
.muted { color: var(--muted); font-weight: 400; font-size: 13px; }

input {
  width: 100%;
  padding: 14px 14px;
  font-size: 18px;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  color: var(--ink);
  outline: none;
}
input:focus { border-color: var(--blue); background: #fff; }
input.plate { font-size: 24px; letter-spacing: 3px; font-weight: 700; text-align: center; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.inline { display: flex; gap: 10px; }
.inline input { flex: 1; min-width: 0; }
.inline .btn { width: auto; white-space: nowrap; padding: 0 22px; }
.inline .btn.icon {
  flex: 0 0 56px;
  width: 56px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

.preview {
  margin: 16px 0 6px;
  padding: 14px;
  border-radius: 10px;
  background: #eff6ff;
  border: 1px dashed #93c5fd;
  color: #1e40af;
  font-size: 17px;
  font-weight: 700;
  text-align: center;
}

.btn {
  display: block;
  width: 100%;
  padding: 14px;
  font-size: 17px;
  font-weight: 700;
  border-radius: 10px;
  border: 1.5px solid transparent;
  cursor: pointer;
  margin-top: 12px;
  background: #e2e8f0;
  color: var(--ink);
}
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:active { background: var(--blue-d); }
.btn.ghost { background: #fff; border-color: #cbd5e1; color: var(--muted); font-weight: 600; }
.btn.big { padding: 18px; font-size: 19px; margin-top: 18px; }
.btn:disabled { opacity: .55; }

.tips { color: var(--muted); font-size: 13px; text-align: center; margin: 4px 0 0; }

/* ---------- 结果卡片 ---------- */
.who { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.who .plate-no { font-size: 22px; font-weight: 800; letter-spacing: 1px; }
.who .phone { color: var(--muted); font-size: 15px; }

.remain-line {
  margin: 14px 0;
  padding: 16px;
  border-radius: 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  text-align: center;
  font-size: 16px;
  color: #166534;
}
.remain-line b { font-size: 40px; font-weight: 800; margin: 0 6px; color: var(--green); }
.remain-line.zero { background: #f8fafc; border-color: var(--line); color: var(--muted); }
.remain-line.zero b { color: var(--muted); }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }

.rec { border-top: 1px solid var(--line); padding: 10px 0; font-size: 14px; }
.rec:first-child { border-top: 0; }
.rec .row1 { display: flex; justify-content: space-between; gap: 8px; }
.rec .tag { font-weight: 700; }
.rec .tag.dep { color: var(--green); }
.rec .tag.take { color: var(--amber); }
.rec .time { color: var(--muted); font-size: 13px; }
.rec .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.rec a { color: var(--blue); text-decoration: none; font-weight: 600; }

.empty { text-align: center; color: var(--muted); padding: 28px 10px; font-size: 15px; }

/* ---------- 汇总 ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 8px; text-align: center; }
.stat .n { font-size: 26px; font-weight: 800; color: var(--ink); }
.stat .t { font-size: 12px; color: var(--muted); margin-top: 4px; }

table.list { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; font-size: 14px; }
table.list th, table.list td { padding: 10px 8px; text-align: right; border-bottom: 1px solid var(--line); }
table.list th:first-child, table.list td:first-child { text-align: left; }
table.list th { background: #f8fafc; color: var(--muted); font-weight: 600; font-size: 13px; }

/* ---------- 签名弹层 ---------- */
.mask {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(15, 23, 42, .65);
  display: flex; align-items: center; justify-content: center;
  padding: 12px;
}
.mask.hidden { display: none; }
.sign-box { width: 100%; max-width: 720px; background: #fff; border-radius: 16px; padding: 16px; }
.sign-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; font-size: 17px; }
#signCanvas {
  width: 100%;
  height: 42vh;
  min-height: 220px;
  background: #fff;
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  touch-action: none;
  display: block;
}
.sign-actions { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 10px; margin-top: 12px; }
.sign-actions .btn { margin-top: 0; }

/* ---------- 提示 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%);
  z-index: 60; max-width: 86vw;
  background: #0f172a; color: #fff;
  padding: 12px 20px; border-radius: 24px;
  font-size: 15px; opacity: 0; pointer-events: none;
}
.toast.show { opacity: 1; }
.toast.err { background: var(--red); }

/* ---------- 图片来源选择（底部弹层） ---------- */
#srcMask { align-items: flex-end; }
.sheet {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  background: #fff;
  border-radius: 18px 18px 16px 16px;
  padding: 18px 16px 16px;
}
.sheet-title {
  font-size: 17px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 10px;
}
.sheet .btn.big { padding: 16px; font-size: 18px; }
.sheet .btn.ghost.big { border-width: 1.5px; font-weight: 700; color: var(--ink); }
.sheet-tip {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  margin: 12px 2px 0;
}
.sheet-warn {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 13px;
  line-height: 1.6;
  border-radius: 10px;
  padding: 10px 12px;
  margin: 12px 0 0;
}
.sheet-warn.hidden { display: none; }

/* 透明铺满的 file input：点到哪儿都是它，不依赖 JS 触发 */
.src-opt {
  position: relative;
  margin-top: 12px;
}
.src-opt .btn { margin-top: 0; }
.src-input {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  z-index: 2;
  cursor: pointer;
  font-size: 100px;
}

/* 界面版本水印：用来确认手机拿到的不是缓存旧页 */
.ver {
  text-align: center;
  color: #a8b3c2;
  font-size: 12px;
  padding: 18px 0 26px;
  letter-spacing: .5px;
}

@media (min-width: 720px) {
  html, body { font-size: 17px; }
  main { padding: 20px; }
  .card { padding: 20px; }
}
/* ===== 员工设置按钮 ===== */
.top-right { display: flex; align-items: center; gap: 10px; }
.gear {
  width: 40px; height: 40px; border-radius: 10px;
  background: #1e293b; border: 1px solid #334155; color: #e2e8f0;
  font-size: 18px; cursor: pointer; line-height: 1;
}

/* ===== 寄存页两个大按钮 ===== */
.cap-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 6px; }
.cap-opt { position: relative; }
.cap-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; height: 96px; border-radius: 14px;
  background: var(--blue); color: #fff; font-size: 30px; font-weight: 700;
}
.cap-btn em { font-style: normal; font-size: 16px; font-weight: 700; }
.cap-btn.ghost { background: #fff; border: 1.5px solid #cbd5e1; color: var(--ink); }
.hint { color: var(--muted); font-size: 13px; margin: 10px 0 0; text-align: center; }

/* ===== 车牌输入 + 键盘按钮 ===== */
.plate-wrap { display: flex; gap: 10px; align-items: stretch; }
.plate-wrap .plate { flex: 1; min-width: 0; }
.kb-btn {
  flex: 0 0 auto; padding: 0 16px; border-radius: 10px;
  border: 1.5px solid #cbd5e1; background: #fff;
  font-size: 15px; font-weight: 700; color: #475569; cursor: pointer;
}

/* ===== 联想下拉 ===== */
.sug { display: none; margin-top: 8px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.sug.show { display: block; }
.sug-item {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 12px 14px; border-top: 1px solid #eef2f7; font-size: 15px; cursor: pointer;
}
.sug-item:first-child { border-top: 0; }
.sug-item:active { background: #f1f5f9; }
.sug-plate { font-weight: 800; letter-spacing: 1px; }
.sug-phone { color: var(--muted); flex: 1; text-align: left; padding-left: 8px; }
.sug-remain { color: var(--green); font-weight: 700; }

/* ===== 车牌键盘 ===== */
#kbMask { align-items: flex-end; }
.kb {
  width: 100%; max-width: 720px; margin: 0 auto;
  background: #fff; border-radius: 18px 18px 0 0; padding: 14px 12px 16px;
}
.kb-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 6px 10px; }
.kb-head b { font-size: 22px; letter-spacing: 2px; }
.kb-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; margin-bottom: 6px; }
.kb-grid button {
  padding: 10px 0; font-size: 17px; border-radius: 8px;
  border: 1px solid #dbe3ec; background: #f8fafc; font-weight: 700; cursor: pointer;
}
.kb-grid button:active { background: #e2e8f0; }
.kb-grid.letters { grid-template-columns: repeat(8, 1fr); }
.kb-grid.specials { grid-template-columns: repeat(8, 1fr); }
.kb-grid.specials button { font-size: 15px; }
.kb-actions { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 8px; margin-top: 8px; }
.kb-actions .btn { margin-top: 0; }

/* ===== 员工列表 ===== */
.staff-list { max-height: 40vh; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.staff-row { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-top: 1px solid #eef2f7; }
.staff-row:first-child { border-top: 0; }
.staff-name { flex: 1; font-weight: 700; }
.mini {
  padding: 7px 12px; font-size: 14px; border-radius: 8px;
  border: 1px solid #cbd5e1; background: #fff; cursor: pointer; font-weight: 600;
}
.mini.danger { color: var(--red); border-color: #fecaca; }
.kb-grid.prov { grid-template-columns: repeat(8, 1fr); }
/* 手机端：只能选员工，不提供员工管理和导出，避免误操作 */
@media (max-width: 640px) {
  .gear { display: none !important; }
  #sExport { display: none !important; }
}

/* 客户卡片里的关联车牌 */
.plates-line {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.plates-line .tagp {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  border-radius: 999px;
  padding: 2px 10px;
  font-weight: 600;
}
.bind-btn {
  margin-left: auto;
  background: #fff;
  border: 1px dashed #93c5fd;
  color: #1d4ed8;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.sec-title {
  font-size: 14px;
  color: var(--muted);
  margin: 18px 4px 8px;
  font-weight: 700;
}
/* ===== 顶栏 LOGO 与站名 ===== */
.brand { gap: 10px; min-width: 0; }
.logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex: 0 0 32px;
  background: #fff;
  object-fit: cover;
}
.brand-text {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== 商品下拉 ===== */
.select {
  width: 100%;
  padding: 14px;
  font-size: 17px;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  color: var(--ink);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #64748b 50%),
                    linear-gradient(135deg, #64748b 50%, transparent 50%);
  background-position: calc(100% - 22px) 22px, calc(100% - 16px) 22px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

/* ===== 最近领取列表 ===== */
.recent-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid #eef2f7;
  font-size: 15px;
}
.recent-item:first-child { border-top: 0; }
.recent-item .r-plate { font-weight: 800; letter-spacing: .5px; }
.recent-item .r-meta { flex: 1; color: var(--muted); font-size: 13px; }
.recent-item .r-qty { color: var(--amber); font-weight: 700; }
.recent-item a { color: var(--blue); font-size: 13px; font-weight: 600; text-decoration: none; }
.hidden { display: none !important; }
/* ===== 瓶数 / 商品 / 加注 三合一一行 ===== */
.grid3 {
  display: grid;
  grid-template-columns: 0.72fr 2.4fr 0.72fr;
  gap: 8px;
  align-items: end;
}
.grid3 .lbl {
  font-size: 12px;
  margin: 14px 0 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.grid3 input {
  padding: 13px 6px;
  font-size: 17px;
  text-align: center;
}
.grid3 .select {
  padding: 13px 8px;
  font-size: 13px;
  background-position: calc(100% - 16px) 21px, calc(100% - 11px) 21px;
}
@media (min-width: 720px) {
  .grid3 { grid-template-columns: 1fr 1.6fr 1fr; }
  .grid3 .select { font-size: 16px; }
}
/* ===== 顶栏员工按钮 ===== */
.staff-btn {
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  max-width: 42vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.staff-btn.unset {
  border-color: #f59e0b;
  color: #fbbf24;
}

/* ===== 选员工 ===== */
.staff-pick {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 14px 0 4px;
}
.staff-pick button {
  padding: 16px 10px;
  font-size: 17px;
  font-weight: 700;
  border-radius: 12px;
  border: 1.5px solid #cbd5e1;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.staff-pick button:active { background: #eff6ff; border-color: #93c5fd; }
.staff-pick button.current {
  background: #eff6ff;
  border-color: var(--blue);
  color: var(--blue);
}
/* 拍车牌卡片头部：标题 + 一行状态提示，替掉原来占一行的说明 */
.cap-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.cap-title {
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}
.cap-tip {
  font-size: 12px;
  color: #94a3b8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* ============ 顶部四个标签：卡片式 + 过渡动画 ============ */
.tabs {
  position: sticky;
  top: 60px;
  z-index: 19;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 10px 12px 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 10px rgba(15, 23, 42, .04);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 10px 4px 9px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  color: #64748b;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease,
              transform .12s ease, box-shadow .2s ease;
}
.tab i {
  font-style: normal;
  font-size: 17px;
  line-height: 1;
  transition: transform .2s ease;
}
.tab:active { transform: scale(.95); }
.tab.active {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border-color: #1d4ed8;
  color: #fff;
  box-shadow: 0 6px 14px rgba(37, 99, 235, .30);
}
.tab.active i { transform: scale(1.12); }

/* 面板切换淡入，很轻，不拖累低配机器 */
.panel.active { animation: panelIn .18s ease-out; }
@keyframes panelIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============ 下拉刷新 ============ */
.ptr {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 70;
  transform: translate(-50%, -60px);
  opacity: 0;
  background: #0f172a;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 0 0 14px 14px;
  transition: transform .12s ease, opacity .12s ease;
  pointer-events: none;
}
/* ============ 批量导入 ============ */
.batch-area {
  width: 100%;
  min-height: 220px;
  padding: 12px;
  font-size: 15px;
  line-height: 1.7;
  font-family: Consolas, "Microsoft YaHei", monospace;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  color: var(--ink);
  outline: none;
  resize: vertical;
}
.batch-area:focus { border-color: var(--blue); background: #fff; }
.batch-err {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.7;
  margin: 10px 0;
}
.batch-ok {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  border-radius: 10px;
  padding: 12px;
  font-size: 16px;
  font-weight: 700;
  margin: 10px 0;
}

/* ============ 工业平板 / 大屏适配（10–15 寸） ============ */
@media (min-width: 900px) {
  main { max-width: 920px; padding: 22px; }
  .card { padding: 22px 24px; }
  .tab { font-size: 16px; padding: 14px 6px; }
  .tab i { font-size: 20px; }
  .cap-btn { height: 118px; font-size: 36px; }
  .cap-btn em { font-size: 18px; }
  .plate-wrap .plate { font-size: 26px; }
  input, .select { font-size: 19px; padding: 16px 16px; }
  .grid3 .select { font-size: 16px; }
  .grid3 input { font-size: 19px; }
  .btn { font-size: 18px; padding: 16px; }
  .btn.big { padding: 20px; font-size: 20px; }
  .remain-line b { font-size: 48px; }
  .staff-pick { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1280px) {
  main { max-width: 1080px; }
  html, body { font-size: 18px; }
  .tab { font-size: 17px; padding: 16px 8px; }
}
/* 手机号：可点击拨号 */
.phone.call {
  color: var(--blue);
  text-decoration: none;
  font-weight: 700;
  border-bottom: 1px dashed rgba(37, 99, 235, .5);
  padding-bottom: 1px;
}
.phone.call:active { opacity: .6; }
/* 本地常用字符高亮 */
.kb-grid button.hot {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border-color: #3b82f6;
  color: #1d4ed8;
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, .35);
}
.kb-grid button.hot:active { background: #93c5fd; }
/* 数字键分两行、整体加大 */
.kb-grid button { font-size: 22px; padding: 13px 0; }
.kb-grid.digits { grid-template-columns: repeat(5, 1fr); }
.kb-grid.prov button { font-size: 23px; }
.kb-grid.letters button { font-size: 22px; }
/* 页脚 */
.ver a {
  color: #64748b;
  text-decoration: none;
  border-bottom: 1px dashed #94a3b8;
}
.ver a:active { color: var(--blue); }
.dot-sep { margin: 0 6px; opacity: .6; }
/* 员工行里的手机号 */
.staff-phone {
  display: block;
  font-style: normal;
  font-size: 12px;
  color: #64748b;
  font-weight: 400;
  margin-top: 2px;
}
.rec-admin { margin-left: 8px; }
.rec-admin .mini { padding: 3px 8px; font-size: 12px; margin-left: 4px; }
.bind-btn.danger {
  border-color: #fecaca;
  color: #b91c1c;
  border-style: solid;
}
