* { box-sizing: border-box; }
[v-cloak] { display: none; }

/* 设置弹窗内容过高时可滚动 */
.el-dialog__body { max-height: 74vh; overflow-y: auto; }

body {
  margin: 0;
  background: #f2f4f7;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: #1f2329;
}

/* 顶部 */
.topbar {
  height: 62px;
  background: linear-gradient(90deg, #1f3a8a, #2b5cd9 60%, #3b82f6);
  color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .15);
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 38px; height: 38px; border-radius: 10px;
  background: rgba(255, 255, 255, .18);
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.title { font-size: 18px; font-weight: 700; letter-spacing: .5px; }
.sub { font-size: 12px; opacity: .75; margin-top: 2px; }
.welcome { color: #fff; font-size: 15px; font-weight: 600; letter-spacing: .5px; }
.actions { display: flex; align-items: center; gap: 10px; }

/* 布局 */
.layout {
  display: flex; gap: 14px; padding: 14px;
  height: calc(100vh - 62px);
}
.left { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.left > * { flex-shrink: 0; }   /* 屏幕矮时左列整体滚动，卡片内容不许被压扁截断 */
.list-card { flex: 0 0 660px; display: flex; flex-direction: column; }
.list-card .el-card__body { flex: 1; padding: 0; min-height: 0; display: flex; flex-direction: column; }
.list-body { flex: 1; min-height: 0; }
/* 记录列表底部的固定操作条（读数归属 + 流程按钮） */
.list-ops {
  padding: 12px 14px; border-top: 1px solid #ebeef5; background: #fafbfc;
  display: flex; flex-direction: column; gap: 16px; flex-shrink: 0;
}
.ops-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ops-k { color: #606266; font-size: 13px; }
.ops-row .print-btn { min-width: 130px; font-weight: 700; }
.list-head { display: flex; align-items: center; justify-content: space-between; }
.list-tools { display: flex; gap: 8px; align-items: center; }
.sec-title { font-weight: 700; font-size: 15px; }

/* 摄像头 */
.cam-row { display: flex; gap: 14px; }
.cam-card { flex: 1; min-width: 0; }
.cam-head { display: flex; align-items: center; gap: 8px; }
.cam-head .cam-name { margin-right: auto; }   /* 名称靠左，状态+存图靠右 */
.cam-name { font-weight: 700; }
.cam-view {
  width: 100%; aspect-ratio: 16 / 9;
  background: #000; border-radius: 8px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.cam-view img { width: 100%; height: auto; display: block; }
.cam-view video { width: 100%; height: auto; display: block; background: #000; }
.cam-fit { position: relative; width: 100%; }
/* 主页画面上的识别区域框（与设置里的框选同一套百分比坐标） */
.cam-roi {
  position: absolute; pointer-events: none; border-radius: 2px;
  border: 2px solid #34d399; background: rgba(52, 211, 153, .16);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .35);
}
.cam-ph {
  color: #9aa3af; text-align: center; font-size: 14px; line-height: 1.9;
  /* 无论画面区里还有什么元素，提示都钉在正中间 */
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 100%; padding: 0 12px; box-sizing: border-box;
}
.cam-ph small { display: block; font-size: 12px; opacity: .7; }

/* 表单 */
.form-card :deep(.el-card__body) { padding-top: 16px; }
.gb-form .el-form-item { margin-bottom: 24px; }
.btn-row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }
.print-btn { min-width: 150px; font-weight: 700; }

.empty { color: #9aa3af; font-size: 13px; }
.hint { margin-left: 10px; color: #909399; font-size: 12px; font-weight: 400; }
.sub-sec { margin-top: 4px; }
.sub-title { font-weight: 700; font-size: 14px; margin-bottom: 10px; }
.scan-box { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- 登录 / 注册 ---------- */
.auth-screen { position: fixed; inset: 0; display: flex; background: #fff; z-index: 100; }
.auth-left { flex: 1.15; min-width: 0;
  background: linear-gradient(135deg, #eaf3ff 0%, #dbe9ff 55%, #cfe0ff 100%); }
.auth-left img { width: 100%; height: 100%; object-fit: cover; display: block; }
.auth-right { flex: 1; display: flex; align-items: center; justify-content: center; }
.auth-card { width: 330px; padding: 12px 0 0; }
.auth-logo { text-align: center; font-size: 40px; line-height: 1; }
.auth-title { text-align: center; font-size: 20px; font-weight: 700; color: #1d2129; margin-top: 10px; }
.auth-sub { text-align: center; color: #86909c; font-size: 13px; margin: 6px 0 4px; }
.auth-tabs { margin-bottom: 6px; }
.auth-label { font-size: 13px; color: #4e5969; margin: 14px 0 6px; }
.auth-label i { color: #f53f3f; font-style: normal; margin-right: 2px; }
.auth-btn { width: 100%; margin-top: 22px; letter-spacing: 6px; }
.auth-foot { text-align: center; color: #86909c; font-size: 13px; margin-top: 14px; }
.auth-foot a { color: #1f6feb; cursor: pointer; }

/* ---------- 顶部自动识别开关 ---------- */
.auto-wrap { display: inline-flex; align-items: center; gap: 6px; }
.auto-label { font-size: 13px; color: #4e5969; }

/* ---------- 设置-高级区 ---------- */
.adv-box { border: 1px solid #e5e6eb; border-radius: 8px; padding: 10px 12px 12px; margin-bottom: 10px; }
.adv-row { display: flex; gap: 10px; align-items: flex-end; }
.adv-row + .adv-row { margin-top: 8px; }
.adv-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.adv-label { font-size: 12px; color: #86909c; line-height: 1; white-space: nowrap; }

/* 记录行内操作按钮横向排列 */
.row-ops { display: flex; justify-content: center; }
.row-ops .el-button + .el-button { margin-left: 4px; }
/* 重量格内的单位小字（suffix）与净重强调样式 */
.wt-u { color: #909399; font-size: 12px; }
.gb-form .net-input .el-input__inner { font-weight: 700; color: #e6a23c; }
.gb-form .el-input__suffix { gap: 5px; }   /* 小叉和单位字并排留缝 */

/* 车牌/重量输入框内的「×重新识别」按钮 */
.reclear-btn { cursor: pointer; color: #909399; transition: color .15s; flex-shrink: 0; }
.reclear-btn:hover { color: #409eff; }
/* append 里的按钮不允许被压缩（压缩会导致按钮互相遮挡） */
.gb-form .el-input-group__append .el-button { flex-shrink: 0; }
.sub-tip { color: #909399; font-size: 12px; margin-top: 4px; }
.roi-wrap { position: relative; width: 100%; user-select: none; cursor: crosshair; }
.roi-wrap img { width: 100%; display: block; -webkit-user-drag: none; }
.roi-box { position: absolute; border: 2px solid #67c23a; background: rgba(103, 194, 58, .18); pointer-events: none; }
.roi-tip { color: #909399; font-size: 12px; margin: 6px 0; }

@media (max-width: 1400px) {
  .layout { flex-direction: column; height: auto; }
  .list-card { flex: 1 1 auto; }
  .list-card .el-table { height: 420px !important; }
}

/* ============ 打印 ============ */
/* 纸：A4 三分之一（DL 收据纸），横着走纸 → 页面 210mm 宽 × 99mm 高 */
@media print {
  body * { visibility: hidden !important; }
  #print-area, #print-area * { visibility: visible !important; }
  #print-area {
    position: absolute; left: 0; top: 0; width: 100%;
    display: block !important;
  }
  @page { size: 210mm 99mm; margin: 4mm; }
}
.ticket {
  width: 200mm; margin: 0 auto; padding: 2mm 4mm;
  font-family: "Microsoft YaHei", serif; color: #000;
}
.t-title { text-align: center; font-size: 18px; font-weight: 700; letter-spacing: 6px; margin-bottom: 2mm; }
.t-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.t-table td { border: 1px solid #333; padding: 2mm 3mm; }
.t-table td.k { width: 26mm; background: #f2f2f2; font-weight: 700; }
.t-table td.big { font-size: 16px; font-weight: 700; }
