* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #dc2626;
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
}
html, body { height: 100%; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px;
}
#app { max-width: 1100px; margin: 0 auto; padding-bottom: 60px; }

/* 顶栏 */
.topbar {
  background: var(--primary); color: #fff; padding: 0 16px;
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  position: sticky; top: 0; z-index: 50;
}
.topbar .brand { font-size: 17px; font-weight: 700; margin-right: 16px; padding: 12px 0; }
.topbar a.nav {
  color: #dbeafe; text-decoration: none; padding: 14px 12px; font-size: 15px; border-bottom: 3px solid transparent;
}
.topbar a.nav.active { color: #fff; font-weight: 600; border-bottom-color: #fff; }
.topbar .spacer { flex: 1; }
.topbar .user { font-size: 13px; color: #bfdbfe; }
.topbar button.linkbtn {
  background: none; border: none; color: #dbeafe; font-size: 14px; cursor: pointer; padding: 8px;
}

/* 通用 */
.wrap { padding: 16px; }
.card {
  background: var(--card); border-radius: 12px; padding: 20px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .08); margin-bottom: 16px;
}
.card h2 { font-size: 17px; margin-bottom: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.field label .req { color: var(--danger); }
input, select, textarea {
  width: 100%; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 15px; font-family: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid #bfdbfe; border-color: var(--primary); }
input[readonly] { background: #f8fafc; color: var(--muted); }
.btn {
  display: inline-block; background: var(--primary); color: #fff; border: none; border-radius: 8px;
  padding: 11px 22px; font-size: 15px; cursor: pointer; font-family: inherit;
}
.btn:hover { background: var(--primary-dark); }
.btn.big { font-size: 17px; padding: 14px 30px; }
.btn.ghost { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn.gray { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn.danger { background: var(--danger); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

/* 首页 */
.home-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; }
.home-hero a {
  display: block; text-decoration: none; border-radius: 16px; padding: 40px 20px; text-align: center; color: #fff;
}
.home-hero .fuel { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.home-hero .tire { background: linear-gradient(135deg, #0f766e, #14b8a6); }
.home-hero .icon { font-size: 44px; }
.home-hero .t { font-size: 22px; font-weight: 700; margin: 10px 0 6px; }
.home-hero .d { font-size: 13px; opacity: .85; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 16px; }
.stat { background: var(--card); border-radius: 12px; padding: 14px 16px; box-shadow: 0 1px 3px rgba(15,23,42,.08); }
.stat .n { font-size: 24px; font-weight: 700; color: var(--primary); }
.stat .l { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* 照片上传 */
.drop {
  border: 2px dashed #cbd5e1; border-radius: 12px; padding: 28px 16px; text-align: center;
  color: var(--muted); cursor: pointer; background: #f8fafc; transition: border-color .15s, background .15s, transform .1s;
}
.drop:hover { border-color: #94a3b8; }
.drop.on { border-color: var(--primary); background: #eff6ff; transform: scale(1.01); }
.drop .d-icon { font-size: 36px; line-height: 1; margin-bottom: 8px; }
.drop .d-t { font-size: 15px; font-weight: 600; color: var(--text); }
.drop .d-d { font-size: 12px; margin-top: 5px; }
.file-meta { font-size: 13px; color: var(--primary); margin-top: 8px; font-weight: 600; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.thumbs .th { position: relative; width: 86px; height: 86px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.thumbs .th img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.thumbs .th .del {
  position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: rgba(220,38,38,.9); color: #fff; border: none; cursor: pointer; font-size: 12px; line-height: 1;
}
.thumbs .th.newmark::after { content: "新"; position: absolute; left: 2px; top: 2px; background: #16a34a; color:#fff; font-size: 11px; padding: 1px 4px; border-radius: 4px; }

/* 车牌自动完成 */
.combo { position: relative; }
.combo-list {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: #fff; z-index: 80;
  border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 28px rgba(15,23,42,.14);
  max-height: 262px; overflow-y: auto;
}
.combo-item { padding: 9px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 1px; border-bottom: 1px solid #f1f5f9; }
.combo-item:last-child { border-bottom: none; }
.combo-item b { font-size: 15px; }
.combo-item span { font-size: 12px; color: var(--muted); }
.combo-item:hover, .combo-item.active { background: #eff6ff; }
.combo-empty { padding: 14px; font-size: 13px; color: var(--muted); text-align: center; }

input.invalid, select.invalid, textarea.invalid { border-color: var(--danger); outline: 2px solid #fecaca; }
.btn[disabled] { opacity: .55; cursor: default; }
#toast div.ok { background: #16a34a; }

/* 记录表 */
.filterbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.filterbar .field { min-width: 130px; }
.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tabs button {
  border: 1px solid var(--border); background: #fff; padding: 8px 20px; border-radius: 20px; cursor: pointer; font-size: 15px;
}
.tabs button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th, table.list td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
table.list th { color: var(--muted); font-weight: 600; font-size: 13px; background: #f8fafc; }
table.list thead th { position: sticky; top: 0; z-index: 5; }
table.list tbody tr:hover td { background: #f8fafc; }
table.list td .mini { display: flex; gap: 4px; }
table.list td .mini img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; cursor: zoom-in; border: 1px solid var(--border); }
.count-note { color: var(--muted); font-size: 13px; margin: 10px 0; }
.pager { display: flex; gap: 10px; align-items: center; margin-top: 12px; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 30px 12px; overflow: auto; }
.modal { background: #fff; border-radius: 12px; padding: 22px; width: 100%; max-width: 760px; }
.modal h3 { margin-bottom: 14px; }
.lightbox img { max-width: 96vw; max-height: 88vh; border-radius: 8px; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); z-index: 200; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 10px; }
.lightbox .lb-bar { display: flex; gap: 14px; align-items: center; color: #fff; }
.lightbox button { background: rgba(255,255,255,.15); color: #fff; border: none; padding: 8px 16px; border-radius: 8px; cursor: pointer; font-size: 15px; }

/* 提醒中心 */
.rem {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px;
  margin-bottom: 8px; font-size: 14px; border-left: 4px solid #f59e0b; background: #fffbeb;
}
.rem.danger { border-left-color: var(--danger); background: #fef2f2; }
.rem-i { font-size: 18px; }
.rem span:nth-child(2) { flex: 1; }
.rem-go { color: var(--primary); text-decoration: none; font-size: 13px; white-space: nowrap; }

/* 提示 */
#toast { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; }
#toast div { background: #0f172a; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 14px; box-shadow: 0 4px 12px rgba(0,0,0,.2); }
#toast div.err { background: var(--danger); }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.lastinfo { background: #eff6ff; border-radius: 8px; padding: 10px 12px; font-size: 13px; color: #1e40af; margin-bottom: 12px; }
.quick-dates { display: flex; gap: 8px; flex-wrap: wrap; }
.quick-dates button { border: 1px solid var(--border); background: #fff; border-radius: 6px; padding: 4px 12px; cursor: pointer; font-size: 13px; }

/* 页脚备案 */
footer.icp { text-align: center; padding: 26px 0 18px; font-size: 13px; }
footer.icp a { color: var(--muted); text-decoration: none; }
footer.icp a:hover { color: var(--primary); }

/* 手机拍照页 */
.phone { max-width: 480px; margin: 0 auto; padding: 16px 12px 40px; }
.phone-head { text-align: center; color: #fff; background: var(--primary); border-radius: 12px; padding: 14px; font-size: 18px; font-weight: 700; margin-bottom: 14px; }
.cam-btn {
  display: block; background: var(--primary); color: #fff; border-radius: 14px;
  padding: 18px; font-size: 20px; font-weight: 700; text-align: center; cursor: pointer; margin-top: 14px;
}
.cam-btn:active { transform: scale(.98); }
.cam-btn.gray2 { background: #fff; color: var(--primary); border: 2px solid var(--primary); font-size: 17px; padding: 14px; }

/* 手机待认领照片条 */
.pending { background: #ecfdf5; border: 1px solid #bbf7d0; border-radius: 10px; padding: 10px 12px; }
.pending-t { font-size: 13px; color: #15803d; margin-bottom: 8px; font-weight: 600; }
.pending .th { cursor: pointer; }
.pending .th.off { opacity: .3; }

/* 照片区"手机拍照传入"链接 */
.qr-link { color: var(--primary); font-weight: 700; font-size: 13px; text-decoration: none; white-space: nowrap; }
.qr-link:hover { text-decoration: underline; }

/* 手机上传队列角标 */
.q-badge {
  position: absolute; left: 0; right: 0; bottom: 0; background: rgba(15,23,42,.72); color: #fff;
  font-size: 11px; padding: 2px 0; text-align: center; line-height: 1.3;
}
.q-badge.up { background: rgba(37,99,235,.85); }
.q-badge.err { background: rgba(220,38,38,.9); font-weight: 700; }
.q-th.err { border-color: var(--danger); }
.q-th.err img { opacity: .45; }

@media (max-width: 640px) {
  .home-hero { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr 1fr; }
  .topbar a.nav { padding: 12px 8px; font-size: 14px; }
  .topbar .brand { font-size: 15px; margin-right: 6px; }
}
