﻿/* =============================================================================
 * 配载发车（蓝桥发车单操作台）页面样式
 * -----------------------------------------------------------------------------
 * 只引用 design-system/tokens.css 的 --ds-* 令牌，不新增色值；
 * 「.ds-drawer」按设计规范 §4.4（右侧抽屉 480/720、圆角 6、shadow-3）实现，
 * 后续其它页面可直接复用。
 * ========================================================================== */

/* ---------- 1. 右抽屉（设计规范 §4.4） ---------- */
.ds-drawer-mask {
  position: fixed; inset: 0; z-index: 120;
  display: flex; justify-content: flex-end;
  background: var(--ds-scrim, rgba(16, 22, 28, .55));
}
.ds-drawer {
  width: 560px; max-width: 100%; height: 100%;
  display: flex; flex-direction: column;
  background: var(--ds-surface-2);
  border-left: 1px solid var(--ds-border);
  box-shadow: var(--ds-shadow-3);
}
.ds-drawer-wide { width: 760px; }
.ds-drawer-hd {
  display: flex; align-items: center; justify-content: space-between; gap: var(--ds-space-4);
  height: 52px; padding: 0 var(--ds-space-6);
  border-bottom: 1px solid var(--ds-border);
  flex: 0 0 auto;
}
.ds-drawer-hd h3 {
  margin: 0; font-size: var(--ds-fs-section); font-weight: 600;
  color: var(--ds-text-primary); line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ds-drawer-x {
  background: none; border: none; cursor: pointer;
  font-size: 20px; line-height: 1; padding: 2px var(--ds-space-3);
  color: var(--ds-text-secondary); border-radius: var(--ds-radius-sm);
}
.ds-drawer-x:hover { background: var(--ds-surface-3); color: var(--ds-text-primary); }
.ds-drawer-bd { flex: 1 1 auto; overflow: auto; padding: var(--ds-space-6); }
.ds-drawer-ft {
  flex: 0 0 auto; display: flex; align-items: center; gap: var(--ds-space-4);
  padding: var(--ds-space-4) var(--ds-space-6);
  border-top: 1px solid var(--ds-border);
  flex-wrap: wrap;
}
.ds-drawer-ft .spacer { flex: 1 1 auto; }

/* ---------- 2. 页面提示与空态 ---------- */
.lp-tip {
  margin-bottom: var(--ds-space-5);
  padding: var(--ds-space-3) var(--ds-space-5);
  border-left: 3px solid var(--ds-warning);
  background: var(--ds-warning-subtle, rgba(251, 179, 96, .14));
  border-radius: var(--ds-radius-sm);
  font-size: var(--ds-fs-dense);
  color: var(--ds-text-secondary);
}
.lp-pending {
  padding: var(--ds-space-9) var(--ds-space-6);
  text-align: center;
  background: var(--ds-surface-2);
  border: 1px dashed var(--ds-border-strong);
  border-radius: var(--ds-radius-md);
}
.lp-pending-t { font-size: var(--ds-fs-widget); font-weight: 600; color: var(--ds-text-primary); }
.lp-pending-s { margin-top: var(--ds-space-3); font-size: var(--ds-fs-dense); color: var(--ds-text-muted); }
.lp-pending-k {
  margin-top: var(--ds-space-4); font-size: var(--ds-fs-micro);
  color: var(--ds-text-disabled); letter-spacing: .02em;
}
.lp-empty {
  padding: var(--ds-space-10) var(--ds-space-6);
  text-align: center;
  background: var(--ds-surface-2);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-md);
}
.lp-empty-t { font-size: var(--ds-fs-widget); font-weight: 600; color: var(--ds-text-primary); }
.lp-empty-s { margin: var(--ds-space-3) 0 var(--ds-space-5); font-size: var(--ds-fs-dense); color: var(--ds-text-muted); }
.lp-empty-acts { display: flex; gap: var(--ds-space-4); justify-content: center; }

/* ---------- 3. 列表 ---------- */
.lp-batch {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ds-text-primary);
}
.lp-acts { display: flex; align-items: center; gap: var(--ds-space-2); flex-wrap: nowrap; }

/* 行内「更多」菜单 */
.lp-more { position: relative; display: inline-block; }
.lp-more-btn { min-width: 28px; padding: 0 var(--ds-space-3); font-weight: 700; letter-spacing: 1px; }
.lp-more-pop {
  display: none;
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 40;
  min-width: 132px; padding: var(--ds-space-2);
  background: var(--ds-surface-3);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-md);
  box-shadow: var(--ds-shadow-2);
}
.lp-more.on .lp-more-pop { display: block; }
.lp-more-item {
  display: block; width: 100%; text-align: left;
  padding: 6px var(--ds-space-4);
  background: none; border: none; cursor: pointer;
  border-radius: var(--ds-radius-sm);
  font-size: var(--ds-fs-body); color: var(--ds-text-primary);
}
.lp-more-item:hover { background: var(--ds-surface-4); }
.lp-more-item.danger { color: var(--ds-danger-text); }

/* ---------- 4. 详情抽屉 ---------- */
.lp-detail-hd {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--ds-space-6); flex-wrap: wrap;
  padding-bottom: var(--ds-space-5);
  border-bottom: 1px solid var(--ds-border-subtle);
  margin-bottom: var(--ds-space-5);
}
.lp-detail-batch {
  font-size: 18px; font-weight: 600; color: var(--ds-text-primary);
  font-variant-numeric: tabular-nums;
}
.lp-detail-tags { display: flex; gap: var(--ds-space-2); margin-top: var(--ds-space-3); flex-wrap: wrap; }
.lp-detail-figs { display: flex; gap: var(--ds-space-7); flex-wrap: wrap; }
.lp-fig-v {
  font-size: 20px; font-weight: 600; color: var(--ds-text-primary);
  font-variant-numeric: tabular-nums; line-height: 1.2;
}
.lp-fig-l { margin-top: 2px; font-size: var(--ds-fs-micro); color: var(--ds-text-muted); }

.lp-kv {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 var(--ds-space-6); margin: 0 0 var(--ds-space-5);
}
.lp-kv-item { display: flex; gap: var(--ds-space-4); align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--ds-border-subtle); min-width: 0; }
.lp-kv-item dt { flex: 0 0 auto; min-width: 64px; font-size: var(--ds-fs-dense); color: var(--ds-text-muted); }
.lp-kv-item dd { flex: 1 1 auto; margin: 0; font-size: var(--ds-fs-body); color: var(--ds-text-primary); text-align: right; font-variant-numeric: tabular-nums; }
.lp-detail-sub { margin: var(--ds-space-5) 0 var(--ds-space-3); font-size: var(--ds-fs-widget); font-weight: 600; color: var(--ds-text-primary); }
.lp-detail-ft { display: flex; align-items: center; gap: var(--ds-space-4); flex-wrap: wrap; }
.lp-detail-note { font-size: var(--ds-fs-micro); color: var(--ds-text-muted); }

/* ---------- 5. 加单 / 减单 ---------- */
.lp-order-add { margin-bottom: var(--ds-space-6); display: flex; flex-direction: column; gap: var(--ds-space-3); }
.lp-order-remove { display: flex; flex-direction: column; gap: var(--ds-space-3); }
.lp-remove-list { display: flex; flex-direction: column; gap: var(--ds-space-2); max-height: 320px; overflow: auto; }
.lp-remove-row {
  display: grid; grid-template-columns: 20px 110px minmax(0, 1fr) 76px;
  align-items: center; gap: var(--ds-space-4);
  padding: var(--ds-space-3);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-sm);
  font-size: var(--ds-fs-dense);
}
.lp-remove-row.on { background: var(--ds-danger-subtle); border-color: var(--ds-danger-border, var(--ds-border-strong)); }
.lp-remove-unit { font-weight: 600; color: var(--ds-text-primary); font-variant-numeric: tabular-nums; }
.lp-remove-name { color: var(--ds-text-secondary); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-remove-row .lp-qty { width: 76px; min-width: 0; height: 28px; padding: 0 6px; text-align: right; }
.lp-order-foot { display: flex; gap: var(--ds-space-4); margin-top: var(--ds-space-6); }

/* ---------- 6. 新建车次 ---------- */
.lp-new .form-grid { gap: var(--ds-space-5) var(--ds-space-6); }
.lp-new textarea.input { min-height: 76px; }

/* ---------- 7. 窄屏 ---------- */
@media (max-width: 720px) {
  .ds-drawer, .ds-drawer-wide { width: 100%; }
  .ds-drawer-bd { padding: var(--ds-space-5); }
  .ds-drawer-ft { padding: var(--ds-space-4) var(--ds-space-5); }
  .lp-kv { grid-template-columns: 1fr; }
  .lp-detail-figs { gap: var(--ds-space-6); }
  .lp-remove-row { grid-template-columns: 20px 96px minmax(0, 1fr) 68px; gap: var(--ds-space-3); }
  .lp-detail-hd { flex-direction: column; gap: var(--ds-space-4); }
}

/* ---------- 8. 车辆档案（1066 台）与选车下拉 ---------- */
.lp-plate {
  display: inline-flex; align-items: center; gap: 4px;
  font-variant-numeric: tabular-nums; font-weight: 600;
  color: var(--ds-text-primary);
}
.lp-plate-warn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--ds-warning-subtle); color: var(--ds-warning-text);
  font-size: 10px; font-weight: 700; line-height: 1;
}
.lp-owner-sel {
  height: 24px; width: 92px; padding: 0 var(--ds-space-3);
  font-size: var(--ds-fs-dense);
}
.lp-pick-list .pick-title { display: flex; align-items: center; gap: var(--ds-space-3); }
.lp-pick-plate { font-variant-numeric: tabular-nums; font-weight: 600; }
@media (max-width: 720px) {
  .lp-owner-sel { width: 84px; }
}/* 列表里的删除按钮：红字但不实心，避免整屏红块 */
.lp-del { color: var(--ds-danger-text); }
.lp-del:hover:not(:disabled) { color: var(--ds-danger-text); border-color: var(--ds-danger-text); }.lp-remove-head {
  display: grid; grid-template-columns: 20px 110px minmax(0, 1fr) 76px;
  gap: var(--ds-space-4); padding: 0 var(--ds-space-3) var(--ds-space-2);
  font-size: var(--ds-fs-micro); color: var(--ds-text-muted);
}
.lp-remove-head span:last-child { text-align: right; }
@media (max-width: 720px) {
  .lp-remove-head { grid-template-columns: 20px 96px minmax(0, 1fr) 68px; gap: var(--ds-space-3); }
}
/* ---------- 9. 视图切换、合计条、按车聚合表 ---------- */
.lp-seg {
  display: inline-flex; gap: 2px; padding: 2px;
  background: var(--ds-surface-2);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-md);
}
.lp-seg-btn {
  height: 24px; padding: 0 var(--ds-space-4);
  background: transparent; border: 0; cursor: pointer;
  border-radius: var(--ds-radius-xs);
  color: var(--ds-text-secondary); font-size: var(--ds-fs-dense);
}
.lp-seg-btn:hover { color: var(--ds-text-primary); }
.lp-seg-btn.on {
  background: var(--ds-surface-4); color: var(--ds-text-primary);
  font-weight: 600;
}
.lp-seg-label { font-size: var(--ds-fs-micro); color: var(--ds-text-muted); }

.lp-sum {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--ds-space-4) var(--ds-space-5);
  margin-bottom: var(--ds-space-4);
  padding: var(--ds-space-3) var(--ds-space-5);
  background: var(--ds-surface-2);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-sm);
  font-size: var(--ds-fs-dense); color: var(--ds-text-secondary);
  font-variant-numeric: tabular-nums;
}
.lp-sum > span + span::before {
  content: '·'; margin-right: var(--ds-space-4); color: var(--ds-text-disabled);
}
.lp-sum-strong { color: var(--ds-text-primary); font-weight: 600; }

/* 按车聚合表 */
.lp-agg-table { table-layout: fixed; }
.lp-agg-table th, .lp-agg-table td { padding: 0 var(--ds-space-3); }
.lp-agg-row { cursor: pointer; }
.lp-agg-row:hover { background: var(--ds-surface-3); }
.lp-agg-row.on { background: var(--ds-accent-subtle); }
.lp-caret-cell { text-align: center; }
.lp-caret {
  display: inline-block; color: var(--ds-text-muted);
  transition: transform 120ms cubic-bezier(.4, 0, .2, 1);
}
.lp-caret.on { transform: rotate(90deg); color: var(--ds-accent-text); }
.lp-agg-exp-cell {
  height: auto !important; line-height: normal !important;
  padding: var(--ds-space-3) var(--ds-space-4) var(--ds-space-4) !important;
  background: var(--ds-surface-1);
}
.lp-agg-exp .table-wrap { box-shadow: none; }
.lp-agg-exp .table td { height: 28px; line-height: 28px; }
.lp-amount-cell { white-space: nowrap; }
.lp-amount-warn {
  display: inline-block; margin-left: var(--ds-space-2);
  min-width: 15px; padding: 0 4px; border-radius: 8px;
  background: var(--ds-warning-subtle); color: var(--ds-warning-text);
  font-size: 10px; line-height: 15px; text-align: center;
  vertical-align: 1px;
}
@media (max-width: 720px) {
  .lp-sum { gap: var(--ds-space-3) var(--ds-space-4); }
  .lp-sum > span + span::before { margin-right: var(--ds-space-3); }
}.lp-viewbar { display: flex; align-items: center; gap: var(--ds-space-3); flex-wrap: nowrap; }