/* =============================================================================
   渠道商下单平台 — 专业物流 SaaS 后台样式（桌面优先 / 响应式）
   零第三方依赖；品牌蓝 #1e50ae；8px 间距体系；统一圆角。
   ============================================================================= */

:root {
  --brand: #1e50ae;
  --brand-700: #173f8a;
  --brand-50: #eef3fc;
  --brand-100: #dfe8fa;
  --ink: #102b50;
  --text: #1b2a41;
  --muted: #5b6b82;
  --faint: #8b98ab;
  --line: #e3e9f2;
  --line-strong: #cfd9e8;
  --bg: #f2f5fa;
  --card: #ffffff;
  --ok: #1f8a5b;
  --ok-bg: #e8f6ef;
  --warn: #a86a12;
  --warn-bg: #fdf5e6;
  --danger: #c0392b;
  --danger-bg: #fdeceb;
  --info-bg: #eef3fc;
  --radius-sm: 8px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-card: 0 1px 2px rgba(16, 43, 80, 0.04), 0 4px 16px rgba(16, 43, 80, 0.05);
  --shadow-pop: 0 8px 32px rgba(16, 43, 80, 0.16);
  --header-h: 60px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--text); }
a { color: var(--brand); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: #fff; color: var(--text);
  font-size: 13.5px; font-weight: 500; white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}
.btn:hover { background: #f7f9fc; }
.btn:active { background: #eef2f8; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-700); border-color: var(--brand-700); }
.btn-primary:active { background: #123473; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: rgba(30, 80, 174, 0.07); color: var(--brand); }
.btn-outline { background: #fff; border-color: var(--line-strong); color: var(--brand); }
.btn-outline:hover { border-color: var(--brand); background: var(--brand-50); }
.btn-danger { background: #fff; border-color: #f0c9c5; color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 7px; }
.btn-lg { height: 42px; font-size: 15px; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: #fff; color: var(--muted); font-size: 14px;
}
.icon-btn:hover { color: var(--brand); border-color: var(--brand); }

/* ---------------- 输入 ---------------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; margin-bottom: 6px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.field .req { color: var(--danger); margin-left: 2px; }
.input, .field input, .field select, .field textarea, select.input {
  width: 100%; height: 38px; padding: 0 11px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: #fff; color: var(--text); outline: none; appearance: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea.input { height: auto; min-height: 72px; padding: 9px 11px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus, select.input:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(30, 80, 174, 0.12);
}
.field input.is-error, .field select.is-error, .input.is-error { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.1); }
select.input {
  background-image: linear-gradient(45deg, transparent 50%, var(--faint) 50%), linear-gradient(135deg, var(--faint) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 30px;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 16px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.checkbox-line { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); }
.checkbox-line input { width: 16px; height: 16px; accent-color: var(--brand); }

/* ---------------- 顶部栏 ---------------- */
.app-header { position: sticky; top: 0; z-index: 40; height: var(--header-h); background: #fff; border-bottom: 1px solid var(--line); }
.app-header-inner { max-width: 1280px; height: 100%; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; border: none; background: none; padding: 0; }
.brand-logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 11px; background: var(--brand);
  color: #fff; font-weight: 800; font-size: 16px; letter-spacing: 0.5px;
}
.brand-logo-sm { width: 32px; height: 32px; border-radius: 9px; font-size: 13px; }
.brand-text { font-size: 15.5px; font-weight: 700; color: var(--ink); letter-spacing: 0.2px; }
.app-nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.nav-item { height: 34px; padding: 0 14px; border: none; background: none; border-radius: 8px; color: var(--muted); font-size: 14px; font-weight: 500; }
.nav-item:hover { background: var(--brand-50); color: var(--brand); }
.nav-item.is-active { background: var(--brand-50); color: var(--brand); font-weight: 600; }
.app-user { display: flex; align-items: center; gap: 10px; }
.user-name { font-size: 13.5px; color: var(--text); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- 布局 ---------------- */
.app-main { max-width: 1280px; margin: 0 auto; padding: 22px 24px 64px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-head h1 { font-size: 22px; font-weight: 700; color: var(--ink); letter-spacing: 0.2px; }
.page-head .page-desc { margin-top: 3px; font-size: 13px; color: var(--muted); }
.page-head-actions { display: flex; align-items: center; gap: 10px; }
.breadcrumb { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 12.5px; color: var(--faint); }
.breadcrumb button { border: none; background: none; padding: 0; color: var(--muted); font-size: 12.5px; }
.breadcrumb button:hover { color: var(--brand); }
.page-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.page-grid-wide { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.sidebar { display: flex; flex-direction: column; gap: 16px; position: sticky; top: calc(var(--header-h) + 20px); }
.create-sidebar { display: flex; }

/* ---------------- 卡片 ---------------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); margin-bottom: 16px; overflow: hidden; }
.card:last-child { margin-bottom: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { font-size: 15px; font-weight: 655; color: var(--ink); }
.card-head .card-actions { display: flex; align-items: center; gap: 8px; }
.card-body { padding: 20px; }
.card-body-tight { padding: 12px 20px; }
.card-title { font-size: 15px; font-weight: 650; color: var(--ink); margin-bottom: 14px; }
.card-subtitle { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* ---------------- 徽标 ---------------- */
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--brand-50); color: var(--brand); white-space: nowrap; }
.badge-soft { background: #eef1f6; color: var(--muted); }
.badge-admin { background: #fff4e0; color: #96600c; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.pill { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--brand-50); color: var(--brand); }
.pill-cw { background: #e8f0ff; color: #1e50ae; }
.pill-ysf { background: #e9f7ef; color: #2f855a; }

.status-pill { display: inline-flex; align-items: center; height: 23px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 5px; opacity: 0.9; }
.status-0 { background: var(--warn-bg); color: var(--warn); }
.status-1 { background: var(--brand-50); color: var(--brand); }
.status-2, .status-3 { background: var(--ok-bg); color: var(--ok); }
.status-4 { background: #eef1f6; color: var(--muted); }
.status-5, .status-6, .status-7 { background: #eaf2fd; color: #2461b6; }
.status-100 { background: var(--danger-bg); color: var(--danger); }

/* ---------------- 提醒 ---------------- */
.alert { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; line-height: 1.5; margin-bottom: 12px; }
.alert:last-child { margin-bottom: 0; }
.alert-error { background: var(--danger-bg); color: var(--danger); }
.alert-warn { background: var(--warn-bg); color: var(--warn); }
.alert-ok { background: var(--ok-bg); color: var(--ok); }
.alert-info { background: var(--info-bg); color: var(--brand); }
.alert ul { margin: 6px 0 0; padding-left: 18px; }
.alert li { margin-bottom: 2px; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th { height: 40px; padding: 0 12px; text-align: left; white-space: nowrap; font-size: 12.5px; font-weight: 600; color: var(--muted); background: #f8fafd; border-bottom: 1px solid var(--line); }
.data-table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr:hover { background: #f9fbfe; }
.data-table tr:last-child td { border-bottom: none; }
.data-table .cell-idx { width: 44px; color: var(--faint); }
.data-table .cell-actions { text-align: right; white-space: nowrap; }
.data-table .cell-num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .cell-strong { font-weight: 600; color: var(--ink); }
.data-table .empty-row td { padding: 36px 12px; text-align: center; color: var(--muted); }

/* 货物明细表 */
.cargo-table th { padding: 0 8px; }
.cargo-table td { padding: 8px; }
.cargo-table .cell-idx { width: 40px; text-align: center; }
.cargo-table input, .cargo-table select {
  width: 100%; height: 34px; min-width: 0; padding: 0 8px;
  border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; outline: none;
}
.cargo-table input:focus, .cargo-table select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(30, 80, 174, 0.1); }
.cargo-table input.is-error, .cargo-table select.is-error { border-color: var(--danger); }
.cargo-table .col-name { min-width: 132px; }
.cargo-table .col-attr { width: 112px; min-width: 112px; }
.cargo-table .col-sku { min-width: 118px; }
.cargo-table .col-num { width: 70px; }
.cargo-table .col-sm { width: 60px; }
.cargo-table .col-price { width: 88px; }
.cargo-table .col-op { width: 44px; text-align: center; }
.cargo-table tfoot td { background: #f8fafd; font-weight: 600; color: var(--ink); border-top: 1px solid var(--line); white-space: nowrap; }
.cargo-table tfoot .totals-label { color: var(--muted); font-weight: 500; text-align: right; }
.cargo-table .sku-cell { display: flex; gap: 4px; }
.cargo-table .sku-cell input { flex: 1; }
.cargo-table .row-flash { animation: rowFlash 1.4s ease; }
@keyframes rowFlash { from { background: #fff7dd; } to { background: transparent; } }

/* ---------------- 统计卡 ---------------- */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: 16px 18px; }
.stat-label { font-size: 12.5px; color: var(--muted); }
.stat-value { margin-top: 6px; font-size: 24px; font-weight: 700; color: var(--ink); line-height: 1.2; }
.stat-value small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.stat-extra { margin-top: 4px; font-size: 12.5px; color: var(--faint); }

/* ---------------- 渠道账号 ---------------- */
.account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.account-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: #fbfcfe; display: flex; flex-direction: column; gap: 8px; }
.account-card.is-default { border-color: var(--brand); background: var(--brand-50); }
.account-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.account-login { font-size: 15px; font-weight: 650; color: var(--ink); }
.account-name { font-size: 12.5px; color: var(--muted); }
.account-meta { font-size: 12px; color: var(--faint); }
.account-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }

/* ---------------- 快捷入口 ---------------- */
.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.quick-tile { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; text-align: left; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.quick-tile:hover { border-color: var(--brand); box-shadow: var(--shadow-card); }
.quick-tile .quick-icon { font-size: 18px; }
.quick-tile .quick-title { font-size: 14px; font-weight: 600; color: var(--ink); }
.quick-tile .quick-sub { font-size: 12px; color: var(--faint); }

/* ---------------- 登录页 ---------------- */
.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: linear-gradient(135deg, #eef3fc 0%, #f7f9fc 55%, #e9effa 100%); }
.login-shell { display: grid; grid-template-columns: 460px 420px; width: min(920px, 100%); border-radius: 20px; overflow: hidden; box-shadow: 0 24px 80px rgba(16, 43, 80, 0.16); background: #fff; }
.login-brand { position: relative; padding: 44px 40px; color: #fff; overflow: hidden; background: radial-gradient(1200px 500px at -10% -10%, #3a74d6 0%, var(--brand) 45%, #14336e 100%); display: flex; flex-direction: column; }
.login-brand::after { content: ""; position: absolute; right: -80px; bottom: -120px; width: 340px; height: 340px; border-radius: 50%; background: rgba(255, 255, 255, 0.06); }
.login-brand-top { display: flex; align-items: center; gap: 12px; }
.login-brand .brand-logo { background: rgba(255, 255, 255, 0.16); border: 1px solid rgba(255, 255, 255, 0.28); }
.brand-en { font-size: 14px; letter-spacing: 3px; font-weight: 600; opacity: 0.9; }
.login-brand h1 { margin-top: 56px; font-size: 34px; line-height: 1.25; font-weight: 700; letter-spacing: 0.5px; }
.login-points { margin: 26px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.login-points li { display: flex; align-items: center; gap: 10px; font-size: 14px; opacity: 0.92; }
.login-points li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #9cc0ff; flex-shrink: 0; }
.login-brand-foot { margin-top: auto; padding-top: 40px; font-size: 11.5px; letter-spacing: 1px; opacity: 0.55; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 48px 40px; }
.login-card { width: 100%; max-width: 320px; }
.login-card h2 { font-size: 22px; font-weight: 700; color: var(--ink); margin-bottom: 26px; }
.login-card .field input { height: 42px; }

/* ---------------- 下单页 ---------------- */
.create-main { min-width: 0; }
.transport-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
/* 整行字段：用 1/-1 跨完当前所有显式列，避免 span 2 在单列断点生成隐式列 */
.transport-grid .field-wide { grid-column: 1 / -1; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-actions { display: flex; align-items: center; gap: 8px; }

/* 日期组件 */
.date-field { position: relative; display: flex; gap: 6px; }
.date-field input { flex: 1; }
.date-popover { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; width: 268px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop); }
.date-pop-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.date-pop-title { font-size: 13.5px; font-weight: 650; color: var(--ink); }
.date-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.date-grid .dow { height: 26px; display: flex; align-items: center; justify-content: center; font-size: 11.5px; color: var(--faint); }
.date-cell { height: 32px; border: none; background: none; border-radius: 7px; font-size: 12.5px; color: var(--text); font-variant-numeric: tabular-nums; }
.date-cell:hover:not(:disabled) { background: var(--brand-50); color: var(--brand); }
.date-cell.is-today { box-shadow: inset 0 0 0 1px var(--line-strong); }
.date-cell.is-selected { background: var(--brand); color: #fff; font-weight: 600; }
.date-cell:disabled { color: #c7d0dd; cursor: not-allowed; }
.date-cell.is-blank { visibility: hidden; }

/* 批量箱规 */
.batch-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 16px; }
.batch-actions { display: flex; align-items: center; gap: 10px; margin-top: 4px; }

/* 侧栏摘要 */
.summary-list { display: flex; flex-direction: column; }
.summary-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.summary-row:last-child { border-bottom: none; }
.summary-row .summary-label { color: var(--muted); }
.summary-row .summary-value { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; }
.summary-row .summary-value.big { font-size: 16px; }
.sidebar-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.sidebar-status { margin-top: 12px; }
.status-line { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex-shrink: 0; }
.status-dot.ok { background: var(--ok); }
.status-dot.warn { background: var(--warn); }
.status-dot.error { background: var(--danger); }

/* 移动端吸底操作栏 */
.mobile-actions { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; gap: 10px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, 0.97); border-top: 1px solid var(--line); backdrop-filter: blur(6px); }
.mobile-actions .btn { flex: 1; height: 42px; }

/* ---------------- 路由查询 ---------------- */
.route-query-bar { display: flex; gap: 12px; align-items: flex-end; }
.route-query-bar .route-field { flex: 1; margin-bottom: 0; }
.route-grid { display: grid; grid-template-columns: minmax(0, 1fr) 480px; gap: 20px; align-items: start; margin-top: 16px; }
.route-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.summary-tile { background: #f8fafd; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.summary-tile .tile-label { font-size: 12px; color: var(--muted); }
.summary-tile .tile-value { margin-top: 4px; font-size: 17px; font-weight: 650; color: var(--ink); word-break: break-all; }
.progress-track { height: 8px; border-radius: 999px; background: var(--brand-100); overflow: hidden; margin: 12px 0 10px; }
.progress-bar { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #3a74d6, var(--brand)); transition: width 0.4s ease; }
.stage-labels { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--faint); }
.stage-labels span.is-done { color: var(--brand); font-weight: 600; }
.route-map-wrap { min-height: 420px; }
.route-map { width: 100%; min-height: 380px; border-radius: var(--radius); overflow: hidden; background: #edf5fd; }
.route-map .ct-map { border-radius: var(--radius); }

/* 时间线 */
.timeline { position: relative; }
.timeline-item { position: relative; display: flex; gap: 14px; padding-bottom: 18px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item:not(:last-child)::before { content: ""; position: absolute; left: 5px; top: 22px; bottom: 0; width: 2px; background: var(--line); }
.timeline-dot { width: 12px; height: 12px; margin-top: 4px; border-radius: 50%; background: #fff; border: 3px solid var(--brand); box-shadow: 0 0 0 3px var(--brand-50); flex-shrink: 0; }
.timeline-item:last-child .timeline-dot { background: var(--brand); }
.timeline-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.timeline-head b { font-size: 14px; color: var(--ink); }
.timeline-head .muted { font-size: 12.5px; }
.timeline-sub { margin-top: 3px; font-size: 12.5px; color: var(--muted); word-break: break-all; }

/* ---------------- 结果页 ---------------- */
.result-card { max-width: 760px; margin: 8px auto 0; }
.result-head { text-align: center; padding: 30px 20px 22px; }
.result-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 26px; background: var(--ok-bg); color: var(--ok); }
.result-icon.is-cancelled { background: #eef1f6; color: var(--muted); }
.result-order-no { font-size: 22px; font-weight: 700; color: var(--ink); word-break: break-all; }
.result-sub { margin-top: 8px; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.result-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.result-actions .btn { flex: 1; min-width: 120px; }

/* ---------------- 详情页 ---------------- */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.kv-table { width: 100%; border-collapse: collapse; }
.kv-table td { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; vertical-align: top; }
.kv-table tr:last-child td { border-bottom: none; }
.kv-table td.kv-label { width: 120px; color: var(--muted); }
.kv-table td.kv-value { color: var(--ink); font-weight: 500; word-break: break-all; text-align: right; }
.table-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.mark-pdf-bar { display: flex; gap: 12px; align-items: flex-end; }
.mark-pdf-bar .field { flex: 0 1 240px; margin: 0; }
.mark-pdf-bar .btn { flex: 0 0 auto; min-width: 116px; }

/* ---------------- 管理页 ---------------- */
.role-admin { background: #fff4e0; color: #96600c; }
.role-partner { background: #eef1f6; color: var(--muted); }

/* ---------------- 弹层 ---------------- */
.modal-mask { position: fixed; inset: 0; z-index: 60; background: rgba(15, 27, 45, 0.5); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { width: min(520px, 100%); max-height: 88vh; overflow-y: auto; background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); padding: 22px; }
.modal-lg { width: min(680px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-head h2 { font-size: 17px; font-weight: 700; color: var(--ink); }
.modal-close { border: none; background: none; font-size: 22px; line-height: 1; color: var(--faint); padding: 2px 6px; border-radius: 6px; }
.modal-close:hover { background: #f2f5fa; color: var(--text); }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn { flex: 1; }
.search-row { display: flex; gap: 10px; margin-bottom: 12px; }
.search-row .input { flex: 1; }
.sku-list { max-height: 48vh; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.sku-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.sku-item:last-child { border-bottom: none; }
.sku-item:hover { background: #f9fbfe; }
.sku-item-main { min-width: 0; flex: 1; }
.sku-item-id { font-weight: 600; font-size: 13.5px; color: var(--ink); word-break: break-all; }
.sku-item-name { font-size: 12.5px; color: var(--muted); margin-top: 1px; word-break: break-all; }
.sku-item-right { font-size: 12.5px; color: var(--muted); flex-shrink: 0; }

/* ---------------- 空态 / 加载 / toast ---------------- */
.empty-state { padding: 40px 16px; text-align: center; color: var(--muted); }
.empty-state .empty-icon { font-size: 28px; opacity: 0.4; margin-bottom: 8px; }
.empty-state .empty-title { font-size: 14px; color: var(--text); font-weight: 500; }
.empty-state .empty-sub { font-size: 12.5px; margin-top: 4px; color: var(--faint); }
.skeleton { background: linear-gradient(90deg, #eef2f8 25%, #f6f8fc 37%, #eef2f8 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 8px; }
.skeleton-line { height: 14px; margin-bottom: 12px; }
.skeleton-block { height: 120px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.toast { position: fixed; left: 50%; bottom: 86px; transform: translateX(-50%); z-index: 100; max-width: min(560px, 88vw); padding: 10px 16px; border-radius: 9px; background: rgba(16, 43, 80, 0.94); color: #fff; font-size: 13.5px; text-align: center; box-shadow: var(--shadow-pop); }
.toast.error { background: rgba(192, 57, 43, 0.96); }
.toast.ok { background: rgba(31, 138, 91, 0.96); }
.loading { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; background: rgba(242, 245, 250, 0.6); }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid rgba(30, 80, 174, 0.16); border-top-color: var(--brand); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .page-grid, .page-grid-wide { grid-template-columns: minmax(0, 1fr) 320px; }
  .route-grid { grid-template-columns: minmax(0, 1fr) 400px; }
  .transport-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .batch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
  .app-header-inner { gap: 16px; padding: 0 16px; }
  .app-main { padding: 18px 16px 64px; }
  .page-grid, .page-grid-wide { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; }
  .route-grid { grid-template-columns: minmax(0, 1fr); }
  .login-shell { grid-template-columns: 1fr; width: min(520px, 100%); }
  .login-brand { padding: 30px 28px; }
  .login-brand h1 { margin-top: 24px; font-size: 26px; }
  .login-brand-foot { display: none; }
  .login-panel { padding: 30px 28px 36px; }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .account-grid { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .route-summary { grid-template-columns: repeat(2, 1fr); }
  .app-nav { gap: 2px; overflow-x: auto; scrollbar-width: none; }
  .app-nav::-webkit-scrollbar { display: none; }
  .nav-item { padding: 0 10px; white-space: nowrap; }
  .brand-text { display: none; }

  /* 货物表 → 卡片行 */
  .cargo-table, .cargo-table tbody, .cargo-table tfoot, .cargo-table tr, .cargo-table td { display: block; width: 100%; }
  .cargo-table thead { display: none; }
  .cargo-table tbody tr { position: relative; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 44px 10px 12px; margin-bottom: 10px; background: #fff; }
  .cargo-table tbody tr:hover { background: #fff; }
  .cargo-table tbody td { border: none; padding: 4px 0; display: flex; align-items: center; gap: 10px; }
  .cargo-table tbody td::before { content: attr(data-label); flex: 0 0 82px; font-size: 12px; color: var(--muted); }
  .cargo-table tbody td input, .cargo-table tbody td select { flex: 1; }
  /* 移动端卡片化后，桌面列宽类（.col-sm/.col-attr 等）不能压窄单元格 */
  .cargo-table tbody td.col-name,
  .cargo-table tbody td.col-attr,
  .cargo-table tbody td.col-sku,
  .cargo-table tbody td.col-sm,
  .cargo-table tbody td.col-num,
  .cargo-table tbody td.col-price { width: auto; min-width: 0; }
  .cargo-table tbody td.cell-idx { display: none; }
  .cargo-table tbody td.col-op { position: absolute; top: 8px; right: 8px; padding: 0; }
  .cargo-table tbody td.col-op::before { content: none; }
  .cargo-table tfoot tr { display: flex; flex-wrap: wrap; gap: 8px 18px; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; background: #f8fafd; }
  .cargo-table tfoot td { border: none; padding: 0; display: inline-flex; gap: 4px; font-size: 13px; }
  .cargo-table tfoot td.totals-label { display: none; }
  .cargo-table tfoot td::before { content: attr(data-label); color: var(--muted); font-weight: 500; }
  .cargo-table tfoot td[data-label=""]::before { content: none; }

  /* 订单表 → 卡片行 */
  .data-table.responsive-table, .data-table.responsive-table tbody, .data-table.responsive-table tr, .data-table.responsive-table td { display: block; width: 100%; }
  .data-table.responsive-table thead { display: none; }
  .data-table.responsive-table tbody tr { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 10px; background: #fff; }
  .data-table.responsive-table tbody td { border: none; padding: 4px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: right; }
  .data-table.responsive-table tbody td::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-align: left; flex-shrink: 0; }
  .data-table.responsive-table tbody td.cell-actions { justify-content: flex-end; padding-top: 8px; }
  .data-table.responsive-table tbody td.cell-actions::before { content: none; }
  .data-table.responsive-table tbody td.empty-row { display: block; }
  .data-table.responsive-table tbody td.empty-row::before { content: none; }

  .mobile-actions { display: flex; }
  .app-main { padding-bottom: 90px; }
  .create-sidebar { display: none; }
  .batch-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  body { font-size: 13.5px; }
  :root { --header-h: 54px; }
  .app-header-inner { gap: 10px; }
  .app-user .user-name { display: none; }
  .app-main { padding: 14px 12px 92px; }
  .page-head { flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
  .page-head h1 { font-size: 19px; }
  .page-head-actions { width: 100%; }
  .page-head-actions .btn { flex: 1; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 12px 14px; }
  .stat-value { font-size: 20px; }
  .card-head { padding: 12px 14px; }
  .card-body { padding: 14px; }
  .transport-grid, .form-grid, .form-grid-3, .field-row, .field-row-3 { grid-template-columns: 1fr; }
  .summary-grid, .route-summary { grid-template-columns: repeat(2, 1fr); }
  .quick-grid { grid-template-columns: 1fr; }
  .route-query-bar { flex-direction: column; align-items: stretch; }
  .result-actions { flex-direction: column; }
  .mark-pdf-bar { flex-direction: column; align-items: stretch; }
  .mark-pdf-bar .field { flex: 1 1 auto; }
  .mark-pdf-bar .btn { width: 100%; }
  .modal { padding: 18px 14px; }
  .login-shell { border-radius: 16px; }
  .login-brand { padding: 22px 20px; }
  .login-brand h1 { margin-top: 16px; font-size: 22px; }
  .login-points { display: none; }
  .login-panel { padding: 24px 20px 28px; }
  .timeline-item { gap: 10px; }
  .detail-grid { gap: 14px; }
}
