/* ============================================================
   前端 - 全局样式（PC 端）
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 14px; color: #222; background: #f4f6f9; }
a { color: #2a7bea; text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }
input[type=number]::-webkit-outer-spin-button, input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }

/* 顶部 / 登录 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #2a7bea 0%, #4a9df0 100%); }
.login-box { width: 380px; background: #fff; border-radius: 10px; padding: 32px; box-shadow: 0 10px 40px rgba(0,0,0,.12); }
.login-box h1 { font-size: 20px; margin-bottom: 6px; color: #2a7bea; text-align: center; }
.login-box .sub { text-align: center; color: #888; font-size: 13px; margin-bottom: 24px; }
.login-box label { display: block; margin-bottom: 6px; color: #555; font-size: 13px; }
.login-box input { width: 100%; padding: 10px 12px; border: 1px solid #e0e0e0; border-radius: 6px; margin-bottom: 16px; outline: none; }
.login-box input:focus { border-color: #2a7bea; }
.login-box button { width: 100%; padding: 10px; background: #2a7bea; color: #fff; border: none; border-radius: 6px; font-size: 15px; }
.login-box button:hover { background: #1c6bd4; }
.login-box .tips { margin-top: 16px; font-size: 12px; color: #999; text-align: center; }
.login-box .tabs { display: flex; border-bottom: 1px solid #eee; margin-bottom: 20px; }
.login-box .tabs a { flex: 1; text-align: center; padding: 10px; color: #888; border-bottom: 2px solid transparent; cursor: pointer; }
.login-box .tabs a.active { color: #2a7bea; border-bottom-color: #2a7bea; font-weight: 600; }

/* 主布局 */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #1f2a3c; color: #c5d0e2; }
.sidebar h2 { padding: 18px 16px; font-size: 15px; color: #fff; background: #172236; border-bottom: 1px solid #2a384e; }
.sidebar .nav { padding: 8px 0; }
.sidebar .nav a { display: block; padding: 12px 18px; color: #c5d0e2; cursor: pointer; border-left: 3px solid transparent; }
.sidebar .nav a:hover { background: #24304a; color: #fff; }
.sidebar .nav a.active { background: #2a7bea; color: #fff; border-left-color: #fff; }
.sidebar .user { padding: 12px 16px; font-size: 12px; border-top: 1px solid #2a384e; }
.sidebar .user a { color: #ffc9c9; cursor: pointer; }

.main {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: linear-gradient(180deg, #eef4fb 0%, #e8eef7 100%);
  min-height: 100vh;
}
.page-title { font-size: 20px; margin-bottom: 16px; color: #333; }
.card { background: #fff; border-radius: 8px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.06); margin-bottom: 16px; border: 1px solid #e8edf4; }

/* 表单 */
.form-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.form-item { flex: 1; min-width: 160px; }
.form-item label { display: block; font-size: 13px; color: #555; margin-bottom: 6px; }
.form-item input, .form-item select, .form-item textarea { width: 100%; padding: 8px 10px; border: 1px solid #dfe2e8; border-radius: 5px; background: #fff; outline: none; }
.form-item textarea { min-height: 70px; resize: vertical; }
.form-item input:focus, .form-item select:focus, .form-item textarea:focus { border-color: #2a7bea; }

/* 顶部 Tab（库存管理等） */
.tab-bar { display: flex; gap: 0; border-bottom: 2px solid #e6ebf3; margin-bottom: 14px; }
.tab-bar a { padding: 10px 24px; color: #666; border: none; background: transparent; font-size: 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tab-bar a:hover { color: #2a7bea; text-decoration: none; }
.tab-bar a.active { color: #2a7bea; font-weight: bold; border-bottom-color: #2a7bea; background: #fff; }

/* 按钮 */
.btn { padding: 8px 16px; border-radius: 5px; border: none; background: #2a7bea; color: #fff; font-size: 13px; }
.btn:hover { background: #1c6bd4; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-warning { background: #e6a23c; }
.btn-danger { background: #f56c6c; }
.btn-success { background: #67c23a; }
.btn-default { background: #f0f2f5; color: #333; }
.btn-default:hover { background: #e4e7eb; }

/* 表格 */
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 10px 12px; border-bottom: 1px solid #eef0f3; text-align: left; font-size: 13px; }
th { background: #fafbfc; font-weight: 600; color: #555; }
tr:hover td { background: #f8fafc; }

/* ============ 信息密度高的列表表格 ============ */
.dense-table { font-size: 12px; }
.dense-table th, .dense-table td { padding: 6px 10px; border-bottom: 1px solid #e8ecf0; white-space: nowrap; }
.dense-table th { background: #f5f7fa; color: #334155; font-weight: 600; font-size: 12px; position: sticky; top: 0; z-index: 3; }
.dense-table tr:nth-child(even) td { background: #fafbfc; }
.dense-table tr:hover td { background: #eaf3ff; }
.dense-table td.num, .dense-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.dense-table td.center, .dense-table th.center { text-align: center; }
.dense-table td.sticky-col-1, .dense-table th.sticky-col-1 { position: sticky; left: 0; background: #fff; z-index: 2; box-shadow: 1px 0 0 #e8ecf0; }
.dense-table td.sticky-col-2, .dense-table th.sticky-col-2 { position: sticky; left: 120px; background: #fff; z-index: 2; box-shadow: 1px 0 0 #e8ecf0; }
.dense-table tr:nth-child(even) td.sticky-col-1,
.dense-table tr:nth-child(even) td.sticky-col-2 { background: #fafbfc; }
.dense-table th.sticky-col-1, .dense-table th.sticky-col-2 { background: #f5f7fa; z-index: 4; }
.dense-table tr:hover td.sticky-col-1,
.dense-table tr:hover td.sticky-col-2 { background: #eaf3ff; }
.dense-table .wb-no { color: #2a7bea; font-weight: 600; cursor: pointer; text-decoration: none; }
.dense-table .wb-no:hover { text-decoration: underline; }
.dense-table .status-sm { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 11px; line-height: 1.4; }
.dense-table .status-sm.created { background: #e3f2fd; color: #1976d2; }
.dense-table .status-sm.departed { background: #fff4e5; color: #f57c00; }
.dense-table .status-sm.arrived  { background: #e8f5e9; color: #388e3c; }
.dense-table .status-sm.signed   { background: #f3e5f5; color: #7b1fa2; }
.table-scroll { overflow-x: auto; border: 1px solid #e8ecf0; border-radius: 6px; background: #fff; }
.table-scroll::-webkit-scrollbar { height: 10px; width: 10px; }
.table-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 5px; }
.table-scroll::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ============ 运单详情只读弹窗 ============ */
.wb-viewer { padding: 0; font-size: 12px; color: #333; max-height: 82vh; overflow: auto; }
.wb-viewer-title { font-size: 16px; font-weight: bold; text-align: center; padding: 12px 0 6px; letter-spacing: 4px; }
.wb-viewer-sub { text-align: center; color: #666; font-size: 12px; padding-bottom: 12px; border-bottom: 1px dashed #ccc; }
.wb-viewer-section { padding: 10px 16px; border-bottom: 1px solid #e8ecf0; }
.wb-viewer-section h4 { margin: 0 0 8px 0; font-size: 12px; color: #1976d2; font-weight: bold; padding-left: 8px; border-left: 3px solid #1976d2; }
.wb-viewer-grid { display: grid; grid-template-columns: 100px 1fr 100px 1fr; gap: 4px 10px; }
.wb-viewer-grid > div { padding: 4px 6px; }
.wb-viewer-grid .label { color: #888; font-weight: bold; }
.wb-viewer-grid .value { color: #333; }
.wb-viewer-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 4px; }
.wb-viewer-table th { background: #f5f7fa; color: #333; font-weight: bold; padding: 6px 8px; border: 1px solid #e0e0e0; text-align: center; }
.wb-viewer-table td { padding: 6px 8px; border: 1px solid #e0e0e0; text-align: center; }
.wb-viewer-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.wb-viewer-fee { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 1fr; gap: 0; }
.wb-viewer-fee > div { padding: 8px 10px; border-right: 1px solid #e8ecf0; border-bottom: 1px solid #e8ecf0; }
.wb-viewer-fee > div:last-child { border-right: none; }
.wb-viewer-fee .lbl { color: #888; font-size: 11px; }
.wb-viewer-fee .val { color: #d32f2f; font-weight: bold; font-size: 13px; text-align: right; }
.wb-viewer-total { padding: 12px 16px; background: #fff8e1; text-align: right; font-weight: bold; color: #d32f2f; font-size: 14px; }
.status-tag { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 12px; background: #e6f0fa; color: #2a7bea; }
.status-tag.signed { background: #e8f5e9; color: #67c23a; }
.status-tag.departed { background: #fff4e5; color: #e6a23c; }
.status-tag.arrived { background: #e6f0fa; color: #4a9df0; }
.status-tag.created { background: #f4f4f4; color: #888; }
.status-tag.frozen { background: #fde2e2; color: #f56c6c; }

/* 仪表盘 */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.stat-card { background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.stat-card .label { color: #888; font-size: 13px; margin-bottom: 8px; }
.stat-card .value { font-size: 28px; color: #2a7bea; font-weight: 600; }
.stat-card:nth-child(2) .value { color: #67c23a; }
.stat-card:nth-child(3) .value { color: #e6a23c; }
.stat-card:nth-child(4) .value { color: #f56c6c; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: flex-start; justify-content: center; z-index: 1000; padding: 24px 0; overflow-y: auto; }
.modal-box { background: #fff; border-radius: 8px; width: 560px; max-width: 92vw; min-height: 0; box-shadow: 0 8px 32px rgba(0,0,0,.15); }
.modal-head { padding: 14px 20px; border-bottom: 1px solid #eee; font-weight: 600; }
.modal-body { padding: 20px; }
.modal-foot { padding: 12px 20px; border-top: 1px solid #eee; text-align: right; }

/* 弹窗可调整大小 */
.modal-resizable {
  position: relative;
  display: flex;
  flex-direction: column;
}
.modal-resizable .modal-body {
  flex: 1;
  overflow-y: auto;
  min-height: 200px;
}
.modal-resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 18px;
  height: 18px;
  cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, #ccc 50%, #ccc 60%, transparent 60%, transparent 70%, #ccc 70%, #ccc 80%, transparent 80%);
  z-index: 10;
}
.modal-resize-handle:hover {
  background: linear-gradient(135deg, transparent 50%, #2a7bea 50%, #2a7bea 60%, transparent 60%, transparent 70%, #2a7bea 70%, #2a7bea 80%, transparent 80%);
}

/* 工具 */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar input, .toolbar select { padding: 8px 10px; border: 1px solid #dfe2e8; border-radius: 5px; }
.spacer { flex: 1; }
.tip-box { background: #fff8e6; color: #8b6a1a; border-left: 3px solid #f5c743; padding: 8px 12px; border-radius: 5px; font-size: 13px; margin-bottom: 14px; }
.msg { position: fixed; top: 20px; right: 20px; padding: 12px 18px; background: #333; color: #fff; border-radius: 6px; z-index: 2000; font-size: 13px; min-width: 200px; }
.msg.success { background: #67c23a; }
.msg.error { background: #f56c6c; }

/* ============= 货物托运单表单 ============= */
.wf-modal { width: 1250px !important; max-width: 96%; font-size: 12px; color: #333; position: relative; }
.wf-modal .modal-body { padding: 0; }
.wf-close-btn { position: absolute; top: 6px; right: 8px; width: 22px; height: 22px; line-height: 20px; text-align: center; cursor: pointer; color: #888; font-size: 13px; z-index: 10; border-radius: 50%; transition: all .15s; }
.wf-close-btn:hover { background: #f0f0f0; color: #d32f2f; transform: scale(1.1); }

.wf-title { display: flex; align-items: center; justify-content: space-between; padding: 5px 12px; background: #fff; border-bottom: 1px solid #e0e0e0; }
.wf-title-left { flex: 1; text-align: left; color: #333; font-size: 12px; }
.wf-title-center { flex: 1; text-align: center; font-size: 18px; font-weight: bold; color: #222; padding: 2px 0; }
.wf-title-right { flex: 1; text-align: right; color: #555; font-size: 11px; }
.wf-no { color: #d32f2f; font-weight: bold; margin-left: 4px; }
.wf-icon { margin: 0 4px 0 6px; color: #2a7bea; }

/* 行与单元格 */
.wf-row { display: flex; align-items: stretch; border-bottom: 1px solid #e0e0e0; flex-wrap: nowrap; }
.wf-row:last-child { border-bottom: none; }
.wf-cell { display: flex; align-items: center; padding: 3px 5px; border-right: 1px solid #e0e0e0; white-space: nowrap; }
.wf-cell:last-child { border-right: none; }
.wf-cell input { border: none; background: transparent; outline: none; width: 100%; padding: 2px 4px; font-size: 12px; }
.wf-cell input:focus { background: #f0f7ff; }
.wf-cell select { border: 1px solid #ddd; border-radius: 3px; padding: 2px 5px; background: transparent; outline: none; font-size: 12px; max-width: 140px; }

.wf-cell-label { color: #555; white-space: nowrap; font-weight: normal; font-size: 12px; }
.wf-cell-input { flex: 1; }
.wf-cell-input input { min-width: 60px; }
.wf-cell-input-sm input { width: 40px; text-align: center; }
.wf-cell-big { flex: 2; }
.wf-cell-from { background: #f5f9ff; }
.wf-required { color: #d32f2f; font-weight: bold; }
.wf-req-red { color: #d32f2f; }
.wf-search-icon { margin-left: 3px; color: #888; font-size: 10px; }

/* 网点行 */
.wf-branch-row { background: #fafbfc; }
.wf-branch-row .wf-cell { padding: 4px 6px; }
.wf-branch-row input { border-bottom: 1px dashed #bbb; }

/* 发货人 / 收货人双列 */
.wf-party-row { padding: 0; }
.wf-party { display: flex; flex: 1; align-items: stretch; border-right: 1px solid #e0e0e0; }
.wf-party:last-child { border-right: none; }
.wf-party-icon { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 6px 10px; background: #e8f0fc; color: #1565c0; font-size: 22px; }
.wf-party-icon div { font-size: 11px; margin-top: 3px; color: #1565c0; font-weight: bold; }
.wf-party-body { flex: 1; padding: 4px 8px; }
.wf-party-line { display: flex; align-items: center; padding: 2px 0; }
.wf-party-line .wb-label { width: 60px; color: #d32f2f; font-weight: bold; font-size: 12px; white-space: nowrap; }
.wf-party-line:nth-child(2) .wb-label { color: #333; font-weight: normal; }
.wf-party-line:nth-child(3) .wb-label { color: #333; font-weight: normal; }
.wf-party-line input { flex: 1; border: none; border-bottom: 1px solid #d0d0d0; background: transparent; padding: 2px 4px; font-size: 12px; outline: none; }
.wf-party-line input:focus { border-bottom-color: #2a7bea; background: #f0f7ff; }
.w-search-input { position: relative; }
.w-search-icon { margin-left: 4px; color: #2a7bea; font-size: 11px; }

/* 货物行 - 禁止换行 */
.wf-goods-row { background: #fafbfc; flex-wrap: nowrap; }
.wf-goods-row .wf-cell { padding: 3px 4px; }
.wf-goods-row .wf-cell-label { font-size: 11px; }
.wf-cell-s { min-width: 70px; }
.wf-cell-action-front { min-width: 30px; max-width: 30px; display: flex; justify-content: center; align-items: center; }

/* 费用区 */
.wf-fee-head { background: #e3edf8; color: #1565c0; font-weight: bold; flex-wrap: nowrap; }
.wf-fee-col { display: flex; align-items: center; padding: 4px 8px; border-right: 1px solid #d5e0ec; gap: 4px; flex-wrap: nowrap; min-height: 28px; }
.wf-fee-col:last-child { border-right: none; }
.wf-fee-freight { flex: 4; }
.wf-fee-pay { flex: 3; background: #e8f4e8; }
.wf-fee-cod { flex: 2; background: #fdebd0; }
.wf-fee-title { color: #d32f2f; font-weight: bold; font-size: 12px; white-space: nowrap; }
.wf-fee-amount { color: #d32f2f; font-weight: bold; font-size: 13px; min-width: 60px; display: inline-block; }
.wf-fee-label { color: #333; white-space: nowrap; font-size: 11px; min-width: 44px; text-align: right; display: inline-block; }
.wf-fee-col input { width: 65px; border: 1px solid #d0d0d0; border-radius: 3px; padding: 3px 4px; font-size: 12px; outline: none; text-align: right; background: #fff; font-family: inherit; }
.wf-fee-col input:focus { border-color: #2a7bea; background: #f0f7ff; }
.wf-fee-col select { border: 1px solid #d0d0d0; border-radius: 3px; padding: 3px 6px; font-size: 12px; background: #fff; outline: none; min-width: 72px; }
.wf-fee-row .wf-fee-pay { background: #f5fbf5; }
.wf-fee-row .wf-fee-cod { background: #fef5e8; }

/* 费用区对齐工具：让每一组 (标签+输入) 作为固定单位，保证各行列对齐 */
.wf-fee-unit { display: flex; align-items: center; gap: 4px; min-width: 120px; }
.wf-fee-spacer { min-width: 120px; visibility: hidden; }

/* 底部 */
.wf-bottom-row { background: #fafafa; padding: 3px 6px; flex-wrap: nowrap; }
.wf-cell-handler { color: #d32f2f; font-weight: bold; }
.wf-cell-handler input { border: 1px solid #d0d0d0; border-radius: 3px; padding: 3px 5px; font-size: 12px; background: #fff; outline: none; margin-left: 3px; width: 120px; }
.wf-add-icon { margin-left: 4px; color: #2a7bea; cursor: pointer; font-size: 13px; }
.wf-cell-check label { display: flex; align-items: center; gap: 3px; font-size: 12px; }
.wf-cell-check input { width: auto; }
.wf-cell-receipt input { border: 1px solid #ddd; border-radius: 3px; padding: 2px 3px; font-size: 11px; width: 36px; }
.wf-cell-receipt-no { flex: 1; }
.wf-cell-receipt-no input { border: 1px solid #d0d0d0; border-radius: 3px; padding: 3px 5px; font-size: 12px; width: 120px; }
.wf-cell-remark { flex: 2; }
.wf-cell-remark input { border: 1px solid #d0d0d0; border-radius: 3px; padding: 3px 5px; font-size: 12px; width: 100%; }

/* 操作栏 */
.wf-action-bar { display: flex; align-items: center; padding: 8px 12px; background: #f0f2f5; border-top: 1px solid #d8dce3; gap: 10px; }
.wf-action-print { display: flex; gap: 12px; align-items: center; }
.wf-action-print label { display: flex; align-items: center; gap: 3px; font-size: 11px; color: #555; }
.wf-action-print input { width: auto; }
.wf-action-btns { flex: 1; display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.wf-action-right { color: #888; font-size: 15px; }

.wf-btn { padding: 6px 14px; border: none; border-radius: 4px; font-size: 12px; cursor: pointer; color: #fff; transition: all .15s; }
.wf-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.wf-btn-scan { background: #e67e22; }
.wf-btn-sms { background: #27ae60; }
.wf-btn-primary { background: #d32f2f; }
.wf-btn-blue { background: #2a7bea; }
.wf-btn-save { background: #555; }

/* 响应式 */
@media (max-width: 1300px) {
  .wf-modal { width: 98% !important; }
}

/* 打印 */
@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
}

/* ============================================================
   新版运单管理页面 - 简洁专业风格
   ============================================================ */

/* 页面布局 */
.wb-page {
  padding: 0 24px 24px;
  max-width: 1400px;
  margin: 0 auto;
}

/* 加载状态 */
.wb-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  color: #888;
  font-size: 14px;
}
.wb-loading-icon {
  font-size: 48px;
  margin-bottom: 16px;
  animation: wb-spin 1s linear infinite;
}
@keyframes wb-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* 顶部标题栏 */
.wb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 16px;
  border-bottom: 1px solid #e8ecf0;
  margin-bottom: 20px;
}
.wb-title h1 {
  font-size: 22px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 2px;
}
.wb-date {
  font-size: 13px;
  color: #888;
}

/* 统计栏（紧凑一行） */
.wb-stats-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
  padding: 14px 20px;
  background: linear-gradient(135deg, #fff 0%, #f8fbff 100%);
  border-radius: 10px;
  margin-bottom: 16px;
  border: 1px solid #d6e3f3;
  box-shadow: 0 2px 8px rgba(42, 123, 234, 0.06);
  flex-wrap: wrap;
}
.wb-stat-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
}
.wb-stat-item .wb-stat-label {
  color: #666;
  font-size: 13px;
}
.wb-stat-item .wb-stat-num {
  font-size: 18px;
  font-weight: 600;
}
.wb-stat-item .wb-stat-unit {
  color: #999;
  font-size: 12px;
}
.wb-stat-divider {
  width: 1px;
  height: 16px;
  background: #e5e7eb;
}
.wb-stat-primary { color: #2a7bea; }
.wb-stat-warning { color: #f59e0b; }
.wb-stat-danger { color: #ef4444; }
.wb-stat-success { color: #10b981; }

/* 工具栏 */
.wb-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 14px 18px;
  background: #fff;
  border-radius: 10px;
  border: 1px solid #e8ecf0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}
.wb-toolbar-left {
  display: flex;
  gap: 10px;
}
.wb-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* 按钮 */
.wb-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.wb-btn-icon {
  font-size: 16px;
  font-weight: 700;
}
.wb-btn-primary {
  background: linear-gradient(135deg, #2a7bea, #4090f0);
  color: #fff;
}
.wb-btn-primary:hover {
  background: linear-gradient(135deg, #1c6bd4, #2a7bea);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(42,123,234,.3);
}
.wb-btn-success {
  background: #10b981;
  color: #fff;
}
.wb-btn-success:hover {
  background: #059669;
}
.wb-btn-default {
  background: #f5f5f5;
  color: #333;
}
.wb-btn-default:hover {
  background: #e8e8e8;
}
.wb-btn-search {
  background: #2a7bea;
  color: #fff;
  padding: 8px 12px;
}
.wb-btn-search:hover {
  background: #1c6bd4;
}

/* 输入框 */
.wb-input {
  padding: 8px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  transition: border-color .15s;
  width: 180px;
}
.wb-input:focus {
  border-color: #2a7bea;
  box-shadow: 0 0 0 3px rgba(42,123,234,.1);
}
.wb-input::placeholder {
  color: #aaa;
}
.wb-input-date {
  width: 130px;
}
.wb-select {
  padding: 8px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  background: #fff;
  cursor: pointer;
  min-width: 90px;
}
.wb-select:focus {
  border-color: #2a7bea;
}
.wb-date-sep {
  color: #888;
  font-size: 13px;
}

/* 表格 */
.wb-table-wrap {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e8ecf0;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.wb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.wb-table thead {
  background: linear-gradient(180deg, #f5f8fc 0%, #eef3f9 100%);
}
.wb-table th {
  padding: 12px 10px;
  font-weight: 600;
  color: #4a5568;
  text-align: left;
  border-bottom: 1px solid #e8ecf0;
  white-space: nowrap;
  font-size: 12px;
}
.wb-table td {
  padding: 12px 10px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}
.wb-table tr:hover td {
  background: #f4f8fd;
}
.wb-table tr:last-child td {
  border-bottom: none;
}

/* 表头列宽 */
.wb-th-check { width: 40px; text-align: center; }
.wb-th-date { width: 70px; }
.wb-th-no { width: 130px; }
.wb-th-route { width: 140px; }
.wb-th-party { width: 120px; }
.wb-th-goods { width: 100px; }
.wb-th-num { width: 60px; text-align: right; }
.wb-th-pay { width: 60px; }
.wb-th-status { width: 80px; }
.wb-th-action { width: 120px; }

/* 表格行样式 */
.wb-td-check { text-align: center; }
.wb-td-check input {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #2a7bea;
}
.wb-td-date {
  color: #666;
  font-size: 12px;
}
.wb-td-no a {
  color: #2a7bea;
  font-weight: 600;
  text-decoration: none;
}
.wb-td-no a:hover {
  text-decoration: underline;
}
.wb-td-route {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}
.wb-route-from {
  color: #10b981;
  font-weight: 500;
}
.wb-route-arrow {
  color: #999;
}
.wb-route-to {
  color: #ef4444;
  font-weight: 500;
}
.wb-td-party {
  font-size: 13px;
}
.wb-td-phone {
  font-size: 11px;
  color: #888;
}
.wb-td-goods {
  color: #444;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wb-td-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #666;
}
.wb-td-freight {
  text-align: right;
  font-weight: 600;
  color: #d32f2f;
  font-size: 14px;
}
.wb-td-pay {
  text-align: center;
}
.wb-pay-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  background: #f0f9ff;
  color: #0284c7;
}
.wb-td-status {
  text-align: center;
}
.wb-status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}
.wb-status-created { background: #f1f5f9; color: #64748b; }
.wb-status-departed { background: #fef3c7; color: #d97706; }
.wb-status-arrived { background: #dbeafe; color: #2563eb; }
.wb-status-signed { background: #dcfce7; color: #16a34a; }

.wb-td-action {
  display: flex;
  gap: 6px;
  align-items: center;
}
.wb-action-btn {
  padding: 4px 10px;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
}
.wb-action-print {
  background: #f0fdf4;
  color: #16a34a;
}
.wb-action-print:hover {
  background: #16a34a;
  color: #fff;
}
.wb-action-arrive {
  background: #fff7ed;
  color: #d97706;
}
.wb-action-arrive:hover {
  background: #d97706;
  color: #fff;
}
.wb-action-edit {
  background: #f1f5f9;
  color: #475569;
}
.wb-action-edit:hover {
  background: #475569;
  color: #fff;
}
.wb-action-sign {
  background: #dbeafe;
  color: #2563eb;
}
.wb-action-sign:hover {
  background: #2563eb;
  color: #fff;
}
.wb-action-del {
  background: #fee2e2;
  color: #dc2626;
  padding: 4px 8px;
}
.wb-action-del:hover {
  background: #dc2626;
  color: #fff;
}

/* 底部 */
.wb-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  color: #888;
  font-size: 13px;
}
.wb-footer b {
  color: #333;
  font-weight: 600;
}
.wb-footer-tip {
  font-size: 12px;
  color: #aaa;
}

/* 响应式 */
@media (max-width: 1200px) {
  .wb-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .wb-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .wb-toolbar-left,
  .wb-toolbar-right {
    justify-content: flex-start;
  }
}

/* ============================================================
   发车弹窗 - 新布局
   ============================================================ */
.dep-header {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d3748 100%);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}
.dep-header-row {
  display: flex;
  gap: 14px;
  margin-bottom: 12px;
}
.dep-header-row:last-child {
  margin-bottom: 0;
}
.dep-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dep-field label {
  font-size: 12px;
  color: rgba(255,255,255,.7);
  font-weight: 500;
}
.dep-field select,
.dep-field input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 6px;
  font-size: 13px;
  background: rgba(255,255,255,.1);
  color: #fff;
  outline: none;
  box-sizing: border-box;
}
.dep-field select option {
  background: #333;
  color: #fff;
}
.dep-field select:focus,
.dep-field input:focus {
  border-color: #2a7bea;
  background: rgba(255,255,255,.15);
}
.dep-field input[type="datetime-local"] {
  color-scheme: dark;
}
.dep-field-time {
  flex: 1.2;
}

/* 备注 */
.dep-remark {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.dep-remark label {
  padding-top: 10px;
  font-size: 13px;
  color: #666;
  white-space: nowrap;
  min-width: 50px;
}
.dep-remark textarea {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #dfe2e8;
  border-radius: 6px;
  font-size: 13px;
  resize: vertical;
  min-height: 50px;
  outline: none;
  box-sizing: border-box;
}
.dep-remark textarea:focus {
  border-color: #2a7bea;
  box-shadow: 0 0 0 3px rgba(42,123,234,.1);
}

/* 运单勾选区 */
.dep-waybills {
  border: 1px solid #e8ecf0;
  border-radius: 10px;
  overflow: hidden;
}
.dep-waybills-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e8ecf0;
  font-size: 13px;
}
.dep-waybills-header b {
  color: #333;
}
.dep-waybills-tip {
  color: #888;
  font-size: 12px;
  flex: 1;
}
.dep-check-all {
  color: #2a7bea;
  cursor: pointer;
  font-size: 12px;
}
.dep-check-all:hover {
  text-decoration: underline;
}
.dep-waybills-table {
  max-height: 280px;
  overflow-y: auto;
}
.dep-waybills-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.dep-waybills-table th {
  background: #fafafa;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: #555;
  font-size: 12px;
  position: sticky;
  top: 0;
}
.dep-waybills-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0;
}
.dep-waybills-table tr:hover td {
  background: #f8fafc;
}
.dep-waybills-table input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #2a7bea;
}
.dep-waybills-table td:first-child {
  text-align: center;
}
/* ============================================================
   响应式布局 - 手机/平板适配
   ============================================================ */

/* 汉堡菜单按钮 */
.hamburger {
  display: none;
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1100;
  width: 36px;
  height: 36px;
  background: #2a7bea;
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1050;
}

/* 平板及以下 */
@media (max-width: 768px) {
  /* 汉堡菜单 */
  .hamburger { display: flex; align-items: center; justify-content: center; }
  .sidebar-overlay.show { display: block; }

  /* 侧边栏改为浮层 */
  .layout { flex-direction: column; }
  .sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    bottom: 0;
    width: 250px;
    z-index: 1060;
    transition: left .25s;
    overflow-y: auto;
  }
  .sidebar.open { left: 0; }
  .main {
    padding: 12px;
    padding-top: 50px;
    width: 100%;
  }

  /* 登录 */
  .login-box { width: 92%; max-width: 380px; padding: 24px 20px; }

  /* 统计卡片 */
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 14px 12px; }
  .stat-card .value { font-size: 22px; }

  /* 表格横向滚动 */
  .card { padding: 12px; }
  .card table { min-width: 600px; }
  .card { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* 表单行纵向堆叠 */
  .form-row { flex-direction: column; gap: 10px; }
  .form-item { min-width: 100%; }

  /* 工具栏 */
  .toolbar { flex-direction: column; align-items: stretch; gap: 8px; }
  .toolbar input, .toolbar select { width: 100%; }

  /* 弹窗全屏 */
  .modal-mask { padding: 0; align-items: stretch; }
  .modal-box { width: 100% !important; max-width: 100% !important; border-radius: 0; min-height: 100vh; }
  .modal-body { padding: 14px; }
  .modal-head { padding: 12px 16px; font-size: 16px; }

  /* 运单管理页面 */
  .wb-stats-bar { gap: 12px; padding: 10px 14px; }
  .wb-stat-item .wb-stat-num { font-size: 16px; }
  .wb-stat-divider { height: 14px; }
  .wb-header { flex-direction: column; gap: 10px; align-items: flex-start; }
  .wb-header h1 { font-size: 18px; }
  .wb-page { padding: 0 8px 12px; }
  .wb-toolbar { flex-direction: column; align-items: stretch; padding: 10px; gap: 8px; }
  .wb-toolbar-left, .wb-toolbar-right { width: 100%; flex-wrap: wrap; }
  .wb-input { width: 100%; }
  .wb-input-date { width: 100%; }
  .wb-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .wb-table { min-width: 800px; font-size: 12px; }
  .wb-table th, .wb-table td { padding: 8px 6px; }
  .wb-btn { padding: 8px 14px; font-size: 13px; }

  /* 运单表单弹窗 */
  .wf-modal { width: 100% !important; max-width: 100% !important; border-radius: 0; }
  .wf-row { flex-wrap: wrap; }
  .wf-cell { min-width: 80px; }
  .wf-title-center { font-size: 14px; }
  .wf-title-left, .wf-title-right { font-size: 10px; }
  .wf-action-bar { flex-direction: column; gap: 8px; }
  .wf-action-btns { width: 100%; justify-content: flex-start; }
  .wf-btn { padding: 8px 12px; font-size: 13px; }
  .wf-party { flex-direction: column; }
  .wf-party-icon { flex-direction: row; gap: 8px; padding: 8px; }
  .wf-party-line .wb-label { width: 50px; font-size: 11px; }
  .wf-fee-row { flex-wrap: wrap; }
  .wf-fee-col { flex: 1 1 100%; min-width: 100%; }
  .wf-fee-unit { min-width: 100px; }
  .wf-bottom-row { flex-wrap: wrap; }
  .wf-cell-handler, .wf-cell-receipt-no, .wf-cell-remark { flex: 1 1 100%; }
  .wf-cell-check { flex: 1 1 auto; }

  /* 发车弹窗 */
  .dep-header-row { flex-direction: column; gap: 10px; }
  .dep-header { padding: 12px; }
  .dep-waybills-table { max-height: 200px; }
  .dep-remark { flex-direction: column; }

  /* 详情页 grid */
  .wb-viewer-grid { grid-template-columns: 80px 1fr; gap: 4px 8px; }
  .wb-viewer-fee { grid-template-columns: repeat(2, 1fr); }

  /* 库存管理 */
  .dense-table { font-size: 11px; }
  .dense-table th, .dense-table td { padding: 6px 8px; }

  /* 表格滚动容器 */
  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* 分页 */
  .page-info { flex-wrap: wrap; gap: 8px; }
  .page-info .btn { padding: 6px 10px; font-size: 12px; }

  /* 顶部标题 */
  .page-title { font-size: 16px; margin-bottom: 10px; }
}

/* 小屏手机 */
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 10px 8px; }
  .stat-card .value { font-size: 20px; }
  .stat-card .label { font-size: 11px; }

  .wb-stats-bar { gap: 8px; padding: 8px 10px; }
  .wb-stat-item { font-size: 12px; }
  .wb-stat-item .wb-stat-num { font-size: 15px; }
  .wb-stat-item .wb-stat-label { font-size: 12px; }
  .wb-stat-divider { display: none; }

  .login-box { padding: 20px 16px; }
  .login-box h1 { font-size: 18px; }

  .modal-body { padding: 10px; }
  .modal-head { padding: 10px 14px; font-size: 15px; }

  .btn { padding: 8px 12px; font-size: 12px; }
  .wb-btn { padding: 8px 12px; font-size: 12px; }

  .dep-header { padding: 10px; }
  .dep-field label { font-size: 11px; }
  .dep-field select, .dep-field input { padding: 8px 10px; font-size: 12px; }
}

/* 手机版全屏表单 */
.mobile-page {
  position: fixed;
  inset: 0;
  background: #f5f6f8;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  font-size: 14px;
}
.mobile-topbar {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  background: #fff;
  border-bottom: 1px solid #e8ecf0;
  position: sticky;
  top: 0;
  z-index: 10;
  gap: 10px;
}
.mobile-topbar .back {
  font-size: 18px;
  color: #2a7bea;
  cursor: pointer;
  padding: 4px 8px;
  border: none;
  background: none;
}
.mobile-topbar .title {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  color: #222;
}
.mobile-topbar .save-btn {
  padding: 6px 16px;
  background: #2a7bea;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}
.mobile-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  -webkit-overflow-scrolling: touch;
}
.mobile-section {
  background: #fff;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.mobile-section-title {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f0f0f0;
}
.mobile-field {
  margin-bottom: 12px;
}
.mobile-field:last-child { margin-bottom: 0; }
.mobile-field label {
  display: block;
  font-size: 12px;
  color: #888;
  margin-bottom: 4px;
}
.mobile-field input,
.mobile-field select,
.mobile-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  background: #fafcff;
  box-sizing: border-box;
}
.mobile-field input:focus,
.mobile-field select:focus,
.mobile-field textarea:focus {
  border-color: #2a7bea;
  background: #fff;
}
.mobile-field textarea {
  min-height: 70px;
  resize: vertical;
}
.mobile-row {
  display: flex;
  gap: 10px;
}
.mobile-row .mobile-field { flex: 1; }
.mobile-field-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: #fafcff;
  border-radius: 8px;
  margin-bottom: 8px;
  border: 1px solid #e8ecf0;
}
.mobile-field-row .field-label {
  font-size: 12px;
  color: #888;
  white-space: nowrap;
}
.mobile-field-row input {
  flex: 1;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  outline: none;
  background: #fff;
}
.mobile-field-row input:focus {
  border-color: #2a7bea;
}
.mobile-add-btn {
  display: inline-block;
  padding: 6px 14px;
  background: #e8f0fc;
  color: #2a7bea;
  border: 1px dashed #2a7bea;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  margin-top: 6px;
}
.mobile-del-btn {
  padding: 4px 8px;
  background: #fee2e2;
  color: #dc2626;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
}
.mobile-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
}
.mobile-checkbox input {
  width: 18px;
  height: 18px;
  accent-color: #2a7bea;
}
.mobile-checkbox label {
  font-size: 13px;
  color: #444;
}
.mobile-bottom-bar {
  padding: 12px 14px;
  background: #fff;
  border-top: 1px solid #e8ecf0;
  position: sticky;
  bottom: 0;
  z-index: 10;
}
.mobile-bottom-bar .btn-save {
  width: 100%;
  padding: 12px;
  background: #2a7bea;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.mobile-bottom-bar .btn-save:active {
  background: #1c6bd4;
}
.mobile-wb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid #f0f0f0;
}
.mobile-wb-item:last-child { border-bottom: none; }
.mobile-wb-item input[type=checkbox] {
  width: 18px;
  height: 18px;
  accent-color: #2a7bea;
  flex-shrink: 0;
}
.mobile-wb-info { flex: 1; }
.mobile-wb-info .no { font-size: 13px; color: #2a7bea; font-weight: 600; }
.mobile-wb-info .detail { font-size: 12px; color: #888; margin-top: 2px; }
