/* ==========================================================================
   货单管理平台 —— 全局样式
   ========================================================================== */
:root {
  --sider-bg: #0f1729;
  --sider-bg-2: #162033;
  --sider-text: #97a3b8;
  --sider-active: #ffffff;
  --brand: #2f6fed;
  --brand-soft: #eaf1ff;
  --bg: #f4f6fa;
  --card: #ffffff;
  --border: #e8edf5;
  --text: #16202f;
  --text-2: #5b6474;
  --text-3: #98a2b3;
  --pos: #d92d20;
  --neg: #0f9d58;
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

#root { height: 100%; }

/* ------------------------------- 侧边栏 ---------------------------------- */
.sider {
  background: linear-gradient(180deg, var(--sider-bg) 0%, var(--sider-bg-2) 100%) !important;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative !important;
  top: auto;
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 18px;
  flex-shrink: 0;
}
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: block;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(15, 23, 41, 0.28);
}
.brand-text { overflow: hidden; white-space: nowrap; }
.brand-name {
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  line-height: 1.25;
}
.brand-sub {
  color: #64748b;
  font-size: 10.5px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-top: 2px;
}

.side-menu {
  background: transparent !important;
  border-inline-end: none !important;
  padding: 6px 10px;
  flex: 1;
  overflow-y: auto;
}
.side-menu .ant-menu-item,
.side-menu .ant-menu-submenu-title {
  height: 42px !important;
  line-height: 42px !important;
  border-radius: 8px !important;
  color: var(--sider-text) !important;
  font-size: 13.5px;
  margin: 3px 0 !important;
  width: auto !important;
}
.side-menu .ant-menu-item:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #e2e8f0 !important;
}
.side-menu .ant-menu-item-selected {
  background: var(--brand) !important;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(47, 111, 237, 0.4);
}
.side-menu .ant-menu-item-selected .anticon { color: #fff !important; }
.side-menu .ant-menu-item .anticon { font-size: 15px; }

.side-group {
  color: #4a5568;
  font-size: 10.5px;
  letter-spacing: 1px;
  padding: 14px 20px 6px;
  font-weight: 600;
}

/* 侧边栏底部数据库状态 */
.db-card {
  margin: 10px 12px 14px;
  padding: 11px 12px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
  transition: background 0.2s;
}
.db-card:hover { background: rgba(255, 255, 255, 0.07); }
.db-card-top {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #cbd5e1;
  font-size: 11.5px;
  font-weight: 500;
}
.db-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16);
  flex-shrink: 0;
}
.db-card-meta {
  color: #64748b;
  font-size: 10.5px;
  margin-top: 5px;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
}

/* -------------------------------- 顶栏 ----------------------------------- */
/* 顶栏浮在内容之上，内容从它底下穿过（沉浸式）；手机上是半透明毛玻璃 */
:root { --topbar-h: 60px; }
.topbar {
  background: #fff !important;
  border-bottom: 1px solid var(--border);
  height: var(--topbar-h) !important;
  line-height: normal !important;
  padding: 0 24px !important;
  display: flex;
  align-items: center;
  gap: 14px;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
}
.topbar-title { font-size: 16px; font-weight: 650; color: var(--text); }
.topbar-desc { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* ------------------------------- 内容区 ---------------------------------- */
/* 整个应用固定一屏高：顶栏 + 内容，内容自己滚动（弹层打开时锁的就是它） */
.main {
  position: relative;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.content {
  position: absolute;
  top: var(--topbar-h);
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  flex: 1;
  min-height: 0;
}

/* 页面保活容器：每个页面一个独立滚动区，切走时藏起来（滚动位置原地保留） */
.page-view {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding: 20px 24px 28px;
}
.page-view:not(.is-active):not(.is-leaving) {
  visibility: hidden;
  pointer-events: none;
}
/* 换页过渡：新页淡入上移、旧页淡出，避免「瞬间刷新」的白屏感 */
@keyframes pv-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes pv-out {
  from { opacity: 1; }
  to { opacity: 0; }
}
.page-view.is-active { z-index: 2; animation: pv-in 0.24s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
.page-view.is-leaving { z-index: 1; pointer-events: none; animation: pv-out 0.2s ease-in both; }
@media (prefers-reduced-motion: reduce) {
  .page-view.is-active, .page-view.is-leaving { animation: none; }
}

/* 浮层打开时锁滚动（见 overlay.js：html/body 加 ovl-lock） */
html.ovl-lock, html.ovl-lock body { overflow: hidden !important; }
html.ovl-lock .page-view { overflow: hidden !important; touch-action: none; overscroll-behavior: none; }

.section { margin-bottom: 16px; }

/* KPI 卡 */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px 15px;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}
.kpi:hover { box-shadow: 0 6px 20px rgba(22, 32, 47, 0.07); transform: translateY(-1px); }
.kpi::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--kpi-accent, transparent);
}
.kpi-label {
  font-size: 12.5px;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 9px;
}
.kpi-label .anticon { font-size: 13px; color: var(--kpi-accent, var(--text-3)); }
.kpi-value {
  font-size: 24px;
  font-weight: 680;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  color: var(--text);
}
.kpi-sub {
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.kpi-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 16px;
}
.kpi-tag.pos { background: #fef3f2; color: var(--pos); }
.kpi-tag.neg { background: #ecfdf3; color: var(--neg); }
.kpi-tag.mute { background: #f2f4f7; color: var(--text-2); }
.kpi-tag.warn { background: #fffaeb; color: #b54708; }

/* 卡片 */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px 12px;
}
.card-title { font-size: 13.5px; font-weight: 650; color: var(--text); }
.card-sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.card-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 0 12px 14px; }

.grid-2 { display: grid; grid-template-columns: 1.55fr 1fr; gap: 14px; align-items: start; }
.grid-2b { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }

.legend { display: flex; gap: 14px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-2); }
.legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

/* 图表容器 */
.chart-wrap { width: 100%; }
svg.chart { display: block; overflow: visible; }
.chart-empty {
  height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 12px;
  gap: 6px;
}

/* 环形图 */
.donut { display: flex; align-items: center; gap: 14px; padding: 4px 6px 0; }
.donut-info { flex: 1; min-width: 0; }
.di-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-2);
  padding: 4px 0;
}
.di-row b { margin-left: auto; color: var(--text); font-variant-numeric: tabular-nums; }
.di-row .dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.di-cap {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  line-height: 1.55;
}

/* ------------------------------- 表格 ------------------------------------ */
.table-card { padding: 0; }
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 16px;
  border-bottom: 1px solid #f1f4f9;
  flex-wrap: wrap;
}
.toolbar-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.totalbar {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 9px 16px;
  background: #f8fafd;
  border-bottom: 1px solid #eff3f9;
  font-size: 12px;
  color: var(--text-3);
}
.tb-item { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.tb-item b { color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; font-weight: 600; }
.tb-label { font-weight: 600; color: var(--text-2); }
.tb-sep { width: 1px; height: 13px; background: #e3e9f2; display: inline-block; }
.tb-pending { margin-left: auto; }
.tb-pending b { color: #b54708; font-size: 12.5px; }

/* 数字与文字 */
.num-pos { color: var(--pos); font-variant-numeric: tabular-nums; font-weight: 600; }
.num-neg { color: var(--neg); font-variant-numeric: tabular-nums; font-weight: 600; }
.num-zero { color: var(--text-3); font-variant-numeric: tabular-nums; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; }
.muted { color: var(--text-3); }
.cell-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-sub { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* 平台标签 */
.pf {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  line-height: 18px;
}
.pf-jd { background: #fff1f0; color: #cf1322; }
.pf-tb { background: #fff7e6; color: #d46b08; }
.pf-pdd { background: #fff0f6; color: #c41d7f; }
.pf-tm { background: #fff2e8; color: #d4380d; }
.pf-other { background: #f2f4f7; color: #5b6474; }

/* 状态点 */
.st {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-2);
}
.st i { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.st-done i { background: #12b76a; }
.st-wait i { background: #f79009; }
.st-warn i { background: #f04438; }
.st-plain i { background: #cbd5e1; }
.st-none i { background: #e2e8f0; }

/* 可点击复制 */
.copyable { cursor: pointer; border-bottom: 1px dashed transparent; }
.copyable:hover { color: var(--brand); border-bottom-color: var(--brand); }

/* 内联到手价输入 */
.rev-cell { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.rev-empty {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border: 1px dashed #d5dded;
  border-radius: 5px;
  color: var(--text-3);
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.15s;
  background: #fbfcfe;
  white-space: nowrap;
}
.rev-empty:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.rev-value {
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 5px;
  font-variant-numeric: tabular-nums;
  border-bottom: 1px dashed transparent;
  white-space: nowrap;
}
.rev-value:hover { background: var(--brand-soft); border-bottom-color: var(--brand); color: var(--brand); }
.rev-input { width: 100%; }
.rev-input input { text-align: right; font-variant-numeric: tabular-nums; }

.profit-stack { display: inline-flex; flex-direction: column; align-items: flex-end; line-height: 1.35; }
.profit-stack small { font-size: 10.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }

.row-actions { display: flex; gap: 2px; }
.row-actions .ant-btn { color: var(--text-3); }
.row-actions .ant-btn:hover { color: var(--brand); }

/* 表单 */
.ff { margin-bottom: 13px; }
.ff-label {
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.ff-label .req { color: var(--pos); }
.ff-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.ff-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 11px; }
.form-err {
  background: #fef3f2;
  border: 1px solid #fee4e2;
  color: #b42318;
  border-radius: 7px;
  padding: 8px 11px;
  font-size: 12px;
  margin-bottom: 12px;
}

.preview-box {
  background: #f7f9fd;
  border: 1px solid #e8eef8;
  border-radius: 9px;
  padding: 12px 14px;
  margin-top: 4px;
}
.pv-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 3px 0;
  color: var(--text-2);
}
.pv-row b { font-variant-numeric: tabular-nums; color: var(--text); }
.pv-row.total {
  border-top: 1px dashed #dbe4f0;
  margin-top: 6px;
  padding-top: 8px;
  font-size: 13px;
}

.formula-note {
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.7;
  background: #fbfcfe;
  border-left: 2px solid #dbe4f0;
  padding: 6px 10px;
  margin-top: 8px;
}

/* 导入页 */
.dropzone {
  border: 1.5px dashed #cfdaea;
  border-radius: 11px;
  background: #fafcff;
  padding: 38px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.dropzone:hover, .dropzone.on {
  border-color: var(--brand);
  background: #f5f9ff;
}
.dz-icon { font-size: 30px; color: #b6c4da; margin-bottom: 10px; }
.dz-main { font-size: 13.5px; color: var(--text-2); font-weight: 500; }
.dz-sub { font-size: 11.5px; color: var(--text-3); margin-top: 6px; }

.field-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.fchip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #eef4ff;
  border: 1px solid #dce8ff;
  color: #2f5dbd;
  border-radius: 5px;
  padding: 2px 8px;
  font-size: 11px;
}
.fchip.miss { background: #f8f9fb; border-color: #e9edf4; color: var(--text-3); }

.preview-table-wrap {
  max-height: 290px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 9px;
}

/* 设置页 */
.set-block { padding: 16px 18px; border-bottom: 1px solid #f1f4f9; }
.set-block:last-child { border-bottom: none; }
.set-title { font-size: 13px; font-weight: 620; margin-bottom: 4px; }
.set-desc { font-size: 12px; color: var(--text-3); line-height: 1.7; margin-bottom: 12px; }

.info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 24px; }
.info-item { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; padding: 3px 0; }
.info-item span { color: var(--text-3); flex-shrink: 0; }
.info-item b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 0;
  border-bottom: 1px dashed #f1f4f9;
  font-size: 12px;
}
.log-row:last-child { border-bottom: none; }
.log-act {
  padding: 1px 7px;
  border-radius: 4px;
  background: #f2f4f7;
  color: var(--text-2);
  font-size: 11px;
  flex-shrink: 0;
}
.log-target { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.log-time { color: var(--text-3); font-size: 11px; flex-shrink: 0; }

/* 空状态 */
.empty-box {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 12.5px;
}

/* 顶部提示条 */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  background: #fffaeb;
  border: 1px solid #fedf89;
  border-radius: 9px;
  padding: 10px 14px;
  font-size: 12px;
  color: #93370d;
  line-height: 1.65;
  margin-bottom: 14px;
}
.notice .anticon { color: #f79009; margin-top: 2px; flex-shrink: 0; }
.notice b { font-weight: 600; }

/* 响应式 */
@media (max-width: 1200px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-2b { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .page-view { padding: 14px 12px 20px; }
  .topbar { padding: 0 14px !important; }
  .kpi-row { grid-template-columns: 1fr; }
  .kpi-value { font-size: 21px; }
  .info-grid { grid-template-columns: 1fr; }
  .ff-2, .ff-3 { grid-template-columns: 1fr; }
  .topbar-desc { display: none; }
}

/* 滚动条 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #d3dbe8; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #bcc7d9; }
::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------ 移动端侧边栏 ------------------------------ */
.sider-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 41, 0.45);
  z-index: 1000;
  backdrop-filter: blur(1px);
}
.sider.mobile-sider {
  position: fixed !important;
  left: 0;
  top: 0;
  z-index: 1001;
  height: 100vh;
  transition: transform 0.26s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 4px 0 24px rgba(15, 23, 41, 0.22);
}
.sider.mobile-sider.closed { transform: translateX(-100%); }
.sider.mobile-sider.open { transform: translateX(0); }

.hamburger {
  display: none !important;
  margin-right: 2px;
}
@media (max-width: 900px) {
  .hamburger { display: inline-flex !important; }
  :root { --topbar-h: 56px; }
  .topbar { height: var(--topbar-h) !important; padding: 0 12px !important; }
  .topbar-title { font-size: 15px; }
  .page-view { padding: 12px 10px 20px; }
  .toolbar { padding: 10px 12px; gap: 7px; }
  .toolbar .ant-select { flex: 1; min-width: 92px; }
  .toolbar > .ant-input-affix-wrapper { width: 100% !important; }
  .toolbar-right { width: 100%; margin-left: 0; }
  .toolbar-right .ant-btn { flex: 1; }
  .totalbar { gap: 12px; padding: 8px 12px; }
  .tb-pending { margin-left: 0; }
  .search-wrap { width: 100% !important; }
}

/* 货号：商家自己的编码，视觉上要比订单号更重 */
.sku-strong {
  font-weight: 600;
  color: #1b2130;
  letter-spacing: 0.2px;
}
/* SKU 码：系统生成的唯一标识，蓝色弱显示，扫它/复制它都用这里 */
.code-strong {
  font-weight: 600;
  color: var(--brand, #2f6fed);
  letter-spacing: 0.2px;
  font-size: 12.5px;
}
.cell-sub.code-mini {
  font-size: 10.5px;
  color: #93a0b5;
  letter-spacing: 0.3px;
  margin-top: 1px;
}
.oc-code {
  font-size: 11px;
  line-height: 16px;
  padding: 0 5px;
  border-radius: 4px;
  background: rgba(47, 111, 237, 0.09);
  color: var(--brand, #2f6fed);
  letter-spacing: 0.3px;
}
.sku-missing {
  color: #d97706;
  font-size: 11.5px;
  background: #fff8ec;
  border: 1px solid #ffe1b3;
  border-radius: 4px;
  padding: 0 5px;
  line-height: 17px;
  display: inline-block;
}
.cell-order {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

/* ==========================================================================
   手机版（< 768px）：底部标签栏，接近原生 app 的操作方式
   ========================================================================== */
:root {
  --tabbar-h: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  /* 状态栏玻璃晕影让位（iOS 独立应用才 >0，见下方 is-phone 顶栏注释） */
  --glass-guard: 0px;
}

/* iOS 独立应用（添加到主屏幕）下，避免橡皮筋与长按选中 */
html.is-standalone,
html.is-standalone body {
  overscroll-behavior-y: none;
  -webkit-touch-callout: none;
}
* { -webkit-tap-highlight-color: transparent; }

/* 用 dvh 处理 iOS 地址栏收放导致的高度跳动；应用整体固定一屏，内部滚动 */
html, body, #root { min-height: 100%; }
@supports (height: 100dvh) {
  html, body, #root { height: 100%; }
}
.app-shell { height: 100%; min-height: 0 !important; overflow: hidden; }
@supports (height: 100dvh) {
  .app-shell { height: 100dvh; }
}

.topbar-heading { min-width: 0; flex: 1 1 auto; }
.topbar-heading .topbar-title,
.topbar-heading .topbar-desc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 底部标签栏 */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 900;
  display: flex;
  align-items: stretch;
  /* 底部也改实色：原半透明 + blur 会让卡片内容从标签栏里透出来，同样是「遮挡感 + 耗 GPU」 */
  background: #fff;
  border-top: 1px solid #e8edf5;
  padding-bottom: var(--safe-b);
}
.tabbar .tab {
  flex: 1 1 0;
  border: 0;
  background: none;
  padding: 7px 0 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #8a93a3;
  font-size: 10.5px;
  line-height: 1.1;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.15s ease;
}
.tabbar .tab:active { background: rgba(47, 111, 237, 0.06); }
.tabbar .tab.on { color: var(--brand); font-weight: 600; }
.tabbar .tab-ico { font-size: 19px; line-height: 1; }
.tabbar .tab.on .tab-ico { transform: translateY(-1px); }

/* 手机：内容区让出标签栏高度；顶栏浮在内容上，所以滚动区从屏幕 0 开始 */
html.is-phone .content { top: 0; }
/* 首屏内容从顶栏下方开始（padding-top 用同一个 --topbar-h，不会出现被压住一条的情况） */
html.is-phone .page-view {
  padding: calc(var(--topbar-h) + 10px) 10px calc(var(--tabbar-h) + var(--safe-b) + 20px);
}

/* 手机顶栏：实色白浮层（不透明，不会透出下方滚过的内容）。
   尺寸按 iOS 原生规范：导航栏 44pt；状态栏交给 env() 安全区。

   --glass-guard 是「玻璃晕影让位」：iOS 独立应用的状态栏底部有一圈系统玻璃
   晕影（像素实测：从安全区下沿 62pt 起、到约 83pt 才渐隐成实色，模糊最重的
   是前 8pt）。内容必须从 86pt 之后开始才完全干净 → 让位 24px。14px 不够
   （内容顶 76pt，仍在晕影带里，标题上沿发虚）。非 iOS 独立应用时为 0。 */
html.is-phone { --topbar-h: calc(44px + var(--safe-t) + var(--glass-guard)); }
html.is-ios.is-standalone.is-phone { --glass-guard: 24px; }
html.is-phone .topbar {
  position: absolute;
  top: 0;
  z-index: 880;
  height: var(--topbar-h) !important;
  padding: calc(var(--safe-t) + var(--glass-guard)) 14px 0 !important;
  /* 手机端顶栏一律实色白：不透明才不会透出下方滚过的内容。质感靠发丝线 + 轻投影表达。 */
  background: #fff !important;
  border-bottom: 1px solid transparent;
  box-shadow: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
/* 滚动后出现发丝线 + 轻投影，停在顶部时完全通透 */
html.tb-scrolled .topbar {
  border-bottom-color: rgba(226, 232, 242, 0.9);
  box-shadow: 0 10px 24px -20px rgba(15, 23, 41, 0.55);
}
html.is-phone .topbar-title { font-size: 17px; font-weight: 600; }
html.is-phone .topbar-right { gap: 6px; }
html.is-phone .topbar-right .ant-btn { padding-inline: 9px; }

/* ------------------------- 版本更新胶囊 ------------------------- */
/* 浮在顶栏下方居中，不挡列表内容；点击整条即更新 */
.ver-pill {
  position: fixed;
  top: calc(var(--topbar-h) + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1200;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 7px 7px 14px;
  background: #101828;
  color: #fff;
  border-radius: 999px;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 12px 30px -12px rgba(15, 23, 41, 0.55);
  animation: verpill-in 0.25s ease;
}
.ver-pill-txt { font-weight: 600; letter-spacing: 0.2px; }
.ver-pill-act {
  background: #2f6fed;
  color: #fff;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
}
.ver-pill:active { transform: translateX(-50%) scale(0.96); }
@keyframes verpill-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* iOS 输入框字体小于 16px 会触发自动放大，这里统一兜住 */
html.is-phone input,
html.is-phone textarea,
html.is-phone .ant-select-selection-search-input {
  font-size: 16px !important;
}
html.is-phone .ant-input-affix-wrapper input { font-size: 16px !important; }

/* 手机：表格更紧凑，去掉多余留白 */
html.is-phone .ant-table-tbody > tr > td { padding: 8px 6px !important; }
html.is-phone .ant-table-thead > tr > th { padding: 8px 6px !important; }
html.is-phone .ant-pagination { justify-content: center; padding-bottom: 4px; }
html.is-phone .ant-table-cell-fix-right { background: #fff; }

/* 手机：弹窗接近全屏，避免键盘顶起后看不到内容 */
@media (max-width: 767px) {
  .ant-modal { max-width: calc(100vw - 24px); margin: 8px auto; }
  .ant-drawer-content-wrapper { max-width: 94vw; }
  .ant-message { top: calc(8px + var(--safe-t)); }
}

/* 手机表格：利润副行的颜色与不换行 */
html.is-phone .cell-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.is-phone .cell-sub.num-pos { color: var(--pos); }
html.is-phone .cell-sub.num-neg { color: var(--neg); }
html.is-phone .ant-table-thead > tr > th { font-size: 11.5px; }
html.is-phone .ant-table-tbody > tr > td { font-size: 12.5px; }

/* 「添加到主屏幕」引导条 */
.install-hint {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 10px);
  z-index: 890;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #e3e8f0;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(15, 23, 41, 0.16);
}
.install-hint .ih-ico {
  width: 26px; height: 26px; flex-shrink: 0;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700;
}
.install-hint .ih-txt { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.install-hint .ih-txt b { font-size: 12.5px; color: var(--text); font-weight: 600; }
.install-hint .ih-txt span { font-size: 11.5px; color: var(--text-3); }
.install-hint .ih-close {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border: 0; border-radius: 50%;
  background: #f1f4f9; color: #7a8496;
  font-size: 15px; line-height: 1;
  cursor: pointer;
}

/* 手机：卡片头部不要被右侧控件挤成竖排 */
html.is-phone .card-head { flex-wrap: wrap; padding: 12px 14px 10px; }
html.is-phone .card-head > div:first-child { flex: 1 1 100%; min-width: 0; }
html.is-phone .card-title,
html.is-phone .card-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.is-phone .card-tools { margin-left: 0; width: 100%; }
html.is-phone .card-tools .ant-segmented { max-width: 100%; overflow-x: auto; }
html.is-phone .card-tools .ant-segmented-group { flex-wrap: nowrap; }

/* ============================== 出货管理 ============================== */
.st-info i { background: #2f6fed; }

.ship-sec { margin-top: 14px; }
.ship-sec-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  font-size: 13px;
}
.ship-sec-head b { font-weight: 600; color: #16202f; }
.ship-stat { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #5b6474; }
.ship-stat b { font-variant-numeric: tabular-nums; }
.ship-over { color: #f04438; font-weight: 600; }

.ship-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}
.ship-addr { margin-top: 8px; }

.ship-row-blocked td { color: #b9c2d0 !important; }
.ship-row-blocked .sku-strong { color: #b9c2d0 !important; }

.ship-items { display: flex; flex-direction: column; gap: 6px; padding: 2px 4px; }
.ship-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #4a5468;
  padding: 5px 8px;
  background: #f8fafd;
  border-radius: 6px;
}
.ship-item .sku-strong { flex-shrink: 0; }
.ship-item-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 手机端已选货物卡片回显 */
.ship-pickcard { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.ship-pickcard-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #f8fafd;
  border: 1px solid #eef2f7;
  border-radius: 8px;
}
.ship-pickcard-item .sku-strong { font-size: 13px; }

/* 选货弹窗筛选栏 */
.pick-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 10px;
}
.pick-bar .ant-input-affix-wrapper { flex: 1 1 210px; min-width: 150px; }

html.is-phone .ship-grid { grid-template-columns: 1fr; }
html.is-mobile .pick-bar > .ant-select { width: 116px !important; }
html.is-phone .pick-bar .ant-input-affix-wrapper { flex: 1 1 100%; }
html.is-phone .pick-bar .ant-checkbox-wrapper { font-size: 12px; }
html.is-phone .ant-table-expanded-row .ant-table-cell { padding: 8px !important; }
html.is-phone .ship-item { flex-wrap: wrap; }

/* 表格里的单号不要折行（列宽收紧后 15 位单号会断成两行） */
.cell-order { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st { white-space: nowrap; }
.ship-state { color: #5b6474; }

/* 副行统一单行省略，避免单号在窄列里断行 */
.cell-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ==========================================================================
   App 模式（手机 < 768px）：卡片列表 + 胶囊筛选 + 悬浮主操作 + 底部弹层
   ========================================================================== */
html.is-phone {
  /* 状态栏那一条是 iOS 按页面背景色画的：这里给白，才能和下面的白色顶栏连成一片 */
  background: #fff;
}
html.is-phone body { background: #fff; }

/* ---------- 页头：大标题，像原生 App 的 Navigation Bar（沉浸式） ---------- */
html.is-phone .app-topbar {
  height: var(--topbar-h) !important;
  padding: calc(var(--safe-t) + var(--glass-guard)) 16px 0 !important;
  background: #fff !important;
  border-bottom: 1px solid transparent;
  box-shadow: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
/* 滚动后：只加发丝线 + 轻投影，保持实色白（不再开毛玻璃，避免透出下方卡片） */
html.tb-scrolled .app-topbar {
  background: #fff !important;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-bottom-color: rgba(226, 232, 242, 0.9);
  box-shadow: 0 10px 24px -20px rgba(15, 23, 41, 0.55);
}
html.is-phone .app-topbar .topbar-heading { display: flex; flex-direction: column; justify-content: center; }
html.is-phone .app-topbar .topbar-title {
  /* iOS 原生导航栏字号：17pt semibold（44pt 高的紧凑导航栏放不下大标题） */
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.2px;
  transition: font-size 0.2s ease;
}
/* 滚动后收紧一点 + 发丝线（iOS 导航栏折叠观感） */
html.tb-scrolled .app-topbar .topbar-title { font-size: 16px; }
html.is-phone .app-topbar .topbar-desc {
  /* 手机上不显示副标题：标题一行就够，少一层信息才不像网页 */
  display: none;
}
html.tb-scrolled .app-topbar .topbar-desc { opacity: 0; }
/* 顶栏动作按钮（手机）：扫码 / 新增，替代原来的悬浮按钮组 */
html.is-phone .topbar-right .tb-act {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #e3e8f0;
  border-radius: 11px;
  background: #fff;
  color: #3f4a5c;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, background 0.12s ease;
}
html.is-phone .topbar-right .tb-act:active { transform: scale(0.92); background: #f2f5fa; }
html.is-phone .topbar-right .tb-act.primary {
  border-color: transparent;
  background: var(--brand, #2f6fed);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px -4px rgba(47, 111, 237, 0.5);
}
html.is-phone .topbar-right .tb-act.primary:active { background: #2a63d4; }

html.is-phone .topbar-right .tb-icon {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: #f2f5fa;
  border: 0;
  color: #5b6474;
}

/* ---------- 悬浮主操作 ---------- */
.fab {
  position: fixed;
  right: 16px;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px);
  z-index: 890;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 46px;
  padding: 0 18px 0 14px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #3b82f6, #2f6fed);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  box-shadow: 0 10px 24px rgba(47, 111, 237, 0.34);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.fab:active { transform: scale(0.95); box-shadow: 0 6px 14px rgba(47, 111, 237, 0.3); }
.fab .fab-ico { font-size: 16px; display: inline-flex; }
/* 安装引导条出现时，FAB 上移，避免被盖住 */
html.has-install-hint .fab { bottom: calc(var(--tabbar-h) + var(--safe-b) + 84px); }

/* ---------- 搜索 + 筛选 ---------- */
.app-search {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 4px 0 10px;
}
.app-search .ant-input-affix-wrapper { border-radius: 11px; background: #fff; }
.app-filter-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 40px;
  padding: 0 13px;
  border-radius: 11px;
  border: 1px solid #e6ebf3;
  background: #fff;
  color: #5b6474;
  font-size: 13px;
  font-family: inherit;
}
.app-filter-btn.on { border-color: #bcd2ff; background: #eef4ff; color: #2f6fed; font-weight: 600; }

/* ---------- 胶囊筛选 ---------- */
.chrome-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 0 12px;
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.chrome-pills::-webkit-scrollbar { display: none; }
.pill {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid #e6ebf3;
  background: #fff;
  color: #5b6474;
  font-size: 12.5px;
  font-family: inherit;
  transition: all 0.15s ease;
}
.pill.on {
  background: #16202f;
  border-color: #16202f;
  color: #fff;
  font-weight: 600;
}

/* ---------- 汇总卡 ---------- */
.app-sum {
  background: linear-gradient(150deg, #ffffff 0%, #f7f9ff 100%);
  border: 1px solid #e9eef8;
  border-radius: 14px;
  padding: 13px 14px 11px;
  margin-bottom: 12px;
}
.as-main { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.as-label { font-size: 12px; color: #7a8496; }
.as-value { font-size: 22px; font-weight: 700; letter-spacing: -0.4px; font-variant-numeric: tabular-nums; }
.as-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.as-grid > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.as-grid span { font-size: 10.5px; color: #98a2b3; }
.as-grid b { font-size: 12px; font-weight: 600; color: #16202f; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.as-grid b.warn { color: #b54708; }

/* ---------- 列表与卡片 ---------- */
.app-list { display: flex; flex-direction: column; gap: 10px; }

.oc {
  background: #fff;
  border: 1px solid #e6ebf3;
  border-radius: 12px;
  padding: 12px 14px 10px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.oc:active { transform: scale(0.99); box-shadow: 0 2px 10px rgba(22, 32, 47, 0.07); }
.oc-top { display: flex; align-items: center; gap: 7px; }
.oc-sku { font-size: 14px; letter-spacing: 0.2px; }
.oc-status { margin-left: auto; font-size: 11.5px; }
.oc-title {
  font-size: 12.5px;
  color: #4a5468;
  line-height: 1.5;
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.oc-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
  font-size: 11px;
  color: #98a2b3;
}
.oc-meta span { max-width: 46%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oc-figs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 9px;
}
.oc-figs > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.oc-k { font-size: 10.5px; color: #98a2b3; }
.oc-figs b { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; align-self: flex-start; }
/* 「待录」小标签：只标记状态，不影响卡片底色 */
.oc-wait {
  flex-shrink: 0;
  font-size: 10.5px;
  line-height: 16px;
  color: #b54708;
  background: #fff7e6;
  border: 1px solid #ffe7bf;
  border-radius: 4px;
  padding: 0 5px;
  font-weight: 500;
}

.app-more {
  width: 100%;
  margin: 14px 0 4px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid #e6ebf3;
  background: #fff;
  color: #2f6fed;
  font-size: 13px;
  font-family: inherit;
}
.app-more:active { background: #f4f8ff; }
.app-list-end { text-align: center; font-size: 11.5px; color: #b6c0cf; padding: 16px 0 4px; }

.app-empty {
  background: #fff;
  border: 1px solid #edf1f7;
  border-radius: 14px;
  padding: 42px 20px;
  text-align: center;
  color: #7a8496;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.app-empty .ae-ico { font-size: 28px; opacity: 0.5; }
.app-empty .ae-sub { font-size: 11.5px; color: #98a2b3; }

/* ---------- 发货单 / 结算单卡片（共用） ---------- */
.sk-list-card {
  background: #fff;
  border: 1px solid #edf1f7;
  border-radius: 14px;
  overflow: hidden;
}
.sk-list-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 13px;
}
.sk-list-title { display: flex; align-items: baseline; gap: 8px; }
.sk-list-title .mono { font-size: 13.5px; }
.sk-list-time { font-size: 11px; color: #b6c0cf; }
.sk-list-name { font-size: 13px; color: #16202f; margin-top: 3px; font-weight: 500; }
.sk-list-figs { text-align: right; flex-shrink: 0; }
.sk-list-figs .mono { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sk-chev {
  flex-shrink: 0;
  color: #c3ccdb;
  font-size: 18px;
  line-height: 1;
  transition: transform 0.18s ease;
  transform: rotate(90deg);
}
.sk-chev.on { transform: rotate(-90deg); color: #2f6fed; }
.sk-list-body {
  border-top: 1px solid #f2f5fa;
  background: #fafbfe;
  padding: 10px 13px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  animation: body-in 0.18s ease-out both;
}
@keyframes body-in { from { opacity: 0; } to { opacity: 1; } }
.sk-tags { display: flex; gap: 4px; }
.sk-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid #eef2f8;
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 12px;
}
.sk-item-title { flex: 1; min-width: 0.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #5b6474; }
.sk-list-del { display: flex; justify-content: flex-end; margin-top: 2px; }

/* 结算单新建弹窗里的卡片 */
.sk-cardlist { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.sk-card {
  background: #f8fafd;
  border: 1px solid #eef2f7;
  border-radius: 10px;
  padding: 9px 11px;
}
.sk-row1 { display: flex; align-items: center; gap: 8px; }
.sk-row1 .sku-strong { font-size: 13px; }
.sk-sub { font-size: 11px; color: #98a2b3; margin-left: auto; }
.sk-row2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.sk-cost { font-size: 11.5px; color: #7a8496; font-variant-numeric: tabular-nums; }

.sk-total {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
  padding: 12px 13px;
  background: #f7f9fd;
  border: 1px solid #e8eef8;
  border-radius: 11px;
}
.sk-total-item { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sk-total-item span { font-size: 10.5px; color: #98a2b3; }
.sk-total-item b { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- 「我的」页 ---------- */
.more-page { padding-bottom: 8px; }
.more-profile {
  background: linear-gradient(150deg, #ffffff 0%, #f2f7ff 100%);
  border: 1px solid #e9eef8;
  border-radius: 16px;
  padding: 16px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 6px;
}
.mp-logo {
  width: 46px; height: 46px;
  border-radius: 13px;
  display: block; object-fit: cover;
  box-shadow: 0 6px 16px rgba(15, 23, 41, 0.16);
}
.mp-name { font-size: 16px; font-weight: 700; }
.mp-sub { font-size: 11.5px; color: #8a93a3; margin-top: 3px; line-height: 1.5; }
.mp-figures {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 12px;
  border-top: 1px dashed #e6ecf6;
}
.mp-figures > div { display: flex; flex-direction: column; gap: 2px; }
.mp-figures b { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mp-figures span { font-size: 10.5px; color: #98a2b3; }

.app-group-title { font-size: 11.5px; color: #98a2b3; margin: 16px 4px 7px; letter-spacing: 0.3px; }
.app-group {
  background: #fff;
  border: 1px solid #edf1f7;
  border-radius: 14px;
  overflow: hidden;
}
.app-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 0;
  border-bottom: 1px solid #f4f6fa;
  background: #fff;
  font-family: inherit;
  text-align: left;
}
.app-row:last-child { border-bottom: none; }
.app-row:active { background: #f7f9fd; }
.ar-ico {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: #f1f5fd;
  color: #2f6fed;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.ar-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ar-label { font-size: 13.5px; color: #16202f; font-weight: 500; }
.ar-desc { font-size: 11px; color: #98a2b3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ar-badge {
  font-size: 10px;
  color: #2f6fed;
  background: #eef4ff;
  border-radius: 4px;
  padding: 1px 6px;
  flex-shrink: 0;
}
.ar-chev { color: #c3ccdb; font-size: 17px; flex-shrink: 0; }
.more-foot {
  margin: 18px 6px 4px;
  font-size: 11px;
  color: #b6c0cf;
  line-height: 1.8;
  text-align: center;
}

/* ---------- 底部弹层：Modal / Drawer 在手机上从底部升起 ---------- */
@media (max-width: 767px) {
  .app-sheet {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    top: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    padding-bottom: var(--safe-b);
    max-height: 92vh;
    animation: sheet-up 0.24s cubic-bezier(0.32, 0.72, 0, 1) both;
  }
  @keyframes sheet-up {
    from { transform: translateY(16px); opacity: 0.6; }
    to { transform: translateY(0); opacity: 1; }
  }
  .app-sheet .ant-modal-content { border-radius: 16px 16px 0 0; padding: 16px 14px 14px; max-height: 92vh; display: flex; flex-direction: column; }
  .app-sheet .ant-modal-body { overflow-y: auto; -webkit-overflow-scrolling: touch; flex: 1; min-height: 0; padding-right: 2px; }
  .app-sheet .ant-modal-header { margin-bottom: 8px; }
  .app-sheet .ant-modal-footer { margin-top: 10px; display: flex; gap: 8px; }
  .app-sheet .ant-modal-footer .ant-btn { flex: 1; height: 44px; border-radius: 11px; font-size: 14.5px; }
  .app-sheet .ant-modal-footer .ant-btn + .ant-btn { margin-inline-start: 0; }

  .app-drawer .ant-drawer-content,
  .app-drawer.ant-drawer-content { border-radius: 16px 16px 0 0; position: relative; padding-top: 6px; }
  .app-drawer .ant-drawer-content::before,
  .app-drawer.ant-drawer-content::before {
    content: '';
    position: absolute;
    top: 7px; left: 50%;
    width: 38px; height: 4px;
    margin-left: -19px;
    border-radius: 99px;
    background: #dde3ee;
  }
  .app-drawer .ant-drawer-header { border-bottom: none; padding-bottom: 4px; }
  .app-drawer .ant-drawer-body { padding-top: 6px; }
  .app-drawer .ant-drawer-footer { border-top: none; padding: 8px 16px calc(12px + var(--safe-b)); }
}

.sheet-actions { display: flex; gap: 10px; }
.sheet-actions .ant-btn { flex: 1; height: 44px; border-radius: 11px; font-size: 14.5px; }

/* 手机：表单控件放大，便于点按 */
html.is-phone .ff-label { font-size: 12.5px; }
html.is-phone .ant-input,
html.is-phone .ant-input-number-input,
html.is-phone .ant-select-selection-item { font-size: 15px; }
html.is-phone .ant-input-number { width: 100%; }

/* 手机：卡片化后工具栏与汇总条改为紧凑样式 */
html.is-phone .table-card { background: transparent; border: 0; border-radius: 0; }
html.is-phone .toolbar {
  background: transparent;
  border-bottom: none;
  padding: 0 2px 10px;
}
html.is-phone .totalbar {
  background: #fff;
  border: 1px solid #edf1f7;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
  gap: 10px;
  font-size: 11.5px;
  overflow-x: auto;
  flex-wrap: nowrap;
  scrollbar-width: none;
}
html.is-phone .totalbar::-webkit-scrollbar { display: none; }

/* 手机：工具栏里的说明文字不占地方 */
html.is-phone .toolbar-hint { display: none; }
html.is-phone .toolbar { display: block; }
html.is-phone .toolbar > div:first-child { display: block; font-size: 12px; color: #7a8496; line-height: 1.6; }

/* 手机：概览 KPI 两列排布，更像 App 仪表盘 */
html.is-phone .kpi-row { grid-template-columns: 1fr 1fr; gap: 10px; }
html.is-phone .kpi { padding: 12px 12px 11px; border-radius: 14px; }
html.is-phone .kpi-value { font-size: 18px; letter-spacing: -0.4px; }
html.is-phone .kpi-label { font-size: 11.5px; margin-bottom: 7px; }
html.is-phone .kpi-sub { font-size: 10.5px; margin-top: 6px; gap: 4px; line-height: 1.5; }
html.is-phone .kpi::after { width: 3px; }
html.is-phone .notice { font-size: 11.5px; padding: 9px 12px; border-radius: 12px; line-height: 1.65; }
html.is-phone .card { border-radius: 14px; }
html.is-phone .chart-wrap svg { max-width: 100%; }

/* 手机：选货这类二级弹窗整屏推开（像 App 的下一页），避免叠在父弹层上 */
@media (max-width: 767px) {
  .app-sheet-full {
    top: 0 !important;
    bottom: 0 !important;
    height: 100vh;
    max-height: 100vh !important;
    border-radius: 0 !important;
    padding-top: var(--safe-t);
    animation: sheet-full-in 0.22s ease-out both;
  }
  @keyframes sheet-full-in {
    from { transform: translateX(24px); opacity: 0.7; }
    to { transform: translateX(0); opacity: 1; }
  }
  .app-sheet-full .ant-modal-content {
    border-radius: 0 !important;
    height: 100vh !important;
    min-height: 100vh !important;
    max-height: 100vh !important;
    display: flex;
    flex-direction: column;
  }
  .app-sheet-full .ant-modal-body { flex: 1 1 auto; min-height: 0; }
}

/* 工具栏说明与数字之间留白 */
.toolbar-hint { margin-left: 10px; color: #b6c0cf !important; }

/* ------------------------------ 扫码入库 ------------------------------ */
.scan-modal .ant-modal-content,
.scan-modal.app-sheet .ant-modal-content { padding: 0 !important; overflow: hidden; }
.scan-modal .ant-modal-body { padding: 0 !important; }

.scan-wrap {
  display: flex;
  flex-direction: column;
  max-height: 86vh;
  background: #f4f6fa;
}

/* 顶栏 */
.scan-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px 12px; background: #fff;
  border-bottom: 1px solid #eef1f6;
}
.scan-back { color: #5b6474 !important; height: 32px !important; padding: 0 6px !important; }
.scan-head-text { flex: 1; min-width: 0; }
.scan-title { font-size: 16px; font-weight: 700; color: #1f2937; line-height: 1.3; }
.scan-sub { font-size: 11.5px; color: #8a93a3; margin-top: 2px; }
.scan-count { display: flex; align-items: baseline; gap: 3px; }
.scan-count b { font-size: 21px; color: #2f6fed; line-height: 1; }
.scan-count span { font-size: 11.5px; color: #8a93a3; }
.scan-count i { font-size: 11.5px; color: #b6c0cf; font-style: normal; margin-left: 5px; }

/* 相机取景区 */
.scan-cam {
  position: relative; height: 250px; margin: 12px 16px 0;
  border-radius: 14px; overflow: hidden; background: #0d1522;
}
.scan-cam.on { height: 300px; }
.scan-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; inset: 15% 11%; }
.sf-corner { position: absolute; width: 22px; height: 22px; border: 2.5px solid #5ee39b; }
.sf-corner.tl { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 7px 0 0 0; }
.sf-corner.tr { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 7px 0 0; }
.sf-corner.bl { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 7px; }
.sf-corner.br { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 7px 0; }
.sf-line {
  position: absolute; left: 5%; right: 5%; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, #5ee39b, transparent);
  animation: sf-scan 2.2s ease-in-out infinite;
}
@keyframes sf-scan {
  0% { top: 8%; opacity: 0.25; }
  50% { top: 90%; opacity: 1; }
  100% { top: 8%; opacity: 0.25; }
}
.scan-hint {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 9px 12px 10px; font-size: 12px; line-height: 1.4; color: #d5e2f3;
  background: linear-gradient(180deg, rgba(6, 12, 22, 0), rgba(6, 12, 22, 0.82));
}
.scan-cam-fallback {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 7px;
  padding: 18px; text-align: center;
}
.scf-ico { font-size: 30px; color: #4d6a8f; }
.scf-main { font-size: 13px; color: #cfdaea; line-height: 1.5; }
.scf-tip { font-size: 11.5px; color: #7d8ea6; }
.scf-btn { margin-top: 5px; }

/* 扫码枪 / 手输 */
.scan-manual { display: flex; gap: 8px; padding: 12px 16px 10px; }
.scan-manual .ant-input-affix-wrapper { border-radius: 11px; }

/* 已扫清单 */
.scan-list { flex: 1 1 auto; min-height: 90px; overflow-y: auto; padding: 0 16px 8px; }
.scan-row {
  display: grid;
  grid-template-columns: 128px minmax(110px, 1fr) 58px 58px 88px 92px 128px 40px;
  gap: 8px; align-items: center;
  padding: 8px; margin-bottom: 8px;
  background: #fff; border: 1px solid #eef1f6; border-radius: 10px;
}
.scan-row-head {
  background: transparent; border: 0; padding: 2px 8px 4px;
  font-size: 11.5px; color: #8a93a3; margin-bottom: 0;
}
.scan-row-head > div { white-space: nowrap; }
.scan-row.unmatched { border-color: #ffd591; background: #fffaf0; }
.scan-row .sc-input { border-radius: 8px; }
.scan-row .sc-num { width: 100%; }
.scan-row .sc-num .ant-input-number-input { padding: 4px 8px; }
.scan-row .sc-select { width: 100%; }
.scan-row .sc-select .ant-select-selector { border-radius: 8px !important; }
.sc-ops { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }

.scan-empty {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 30px 0 34px; color: #8a93a3; font-size: 13px;
}
.se-ico { font-size: 28px; color: #c6cfdd; }
.se-sub { font-size: 11.5px; color: #b6c0cf; }

/* 底部合计 */
.scan-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 16px; background: #fff; border-top: 1px solid #eef1f6;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}
.scan-total { display: flex; align-items: baseline; gap: 5px; font-size: 12.5px; color: #8a93a3; }
.scan-total b { font-size: 17px; color: #1f2937; }
.scan-foot-ops { display: flex; gap: 8px; }
.scan-submit { height: 40px; border-radius: 11px; font-weight: 600; }

/* 未匹配：选商品浮层 */
.scan-picker-mask {
  position: fixed; inset: 0; z-index: 1600; padding: 16px;
  background: rgba(9, 15, 26, 0.45);
  display: flex; align-items: center; justify-content: center;
}
.scan-picker {
  width: 100%; max-width: 520px; max-height: 76vh;
  background: #fff; border-radius: 14px; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 60px rgba(9, 15, 26, 0.28);
}
.sp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 14px 16px 8px; }
.sp-title { font-size: 15px; font-weight: 700; color: #1f2937; }
.sp-sub { font-size: 11.5px; color: #8a93a3; margin-top: 3px; word-break: break-all; line-height: 1.5; }
.sp-search { margin: 0 16px 10px; width: auto; border-radius: 10px; }
.sp-list { flex: 1 1 auto; overflow-y: auto; padding: 0 10px 12px; }
.sp-item {
  display: block; width: 100%; text-align: left; cursor: pointer;
  padding: 9px 10px; margin-bottom: 7px; font-family: inherit;
  background: #fff; border: 1px solid #eef1f6; border-radius: 10px;
}
.sp-item:active { background: #f2f6ff; border-color: #d7e3ff; }
.sp-item-top { display: flex; align-items: center; gap: 6px; }
.sp-item-top b { font-size: 13px; color: #1f2937; }
.sp-cost { font-size: 11.5px; color: #8a93a3; margin-left: auto; }
.sp-item-title {
  font-size: 12px; color: #5b6474; margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sp-item-sub { font-size: 11px; color: #a3adbd; margin-top: 2px; }
.sp-empty { padding: 26px 0; text-align: center; color: #8a93a3; font-size: 12.5px; }

/* 手机：整屏二级页 + 卡片式行 */
html.is-phone .scan-wrap { height: 100%; max-height: 100%; }
html.is-phone .scan-head { padding: calc(10px + var(--safe-t)) 12px 10px; }
html.is-phone .scan-cam { height: 200px; margin: 10px 12px 0; }
html.is-phone .scan-cam.on { height: 232px; }
html.is-phone .scan-manual { padding: 10px 12px 8px; }
html.is-phone .scan-list { padding: 0 12px 6px; }
html.is-phone .scan-row {
  grid-template-columns: repeat(3, 1fr);
  gap: 6px 8px; padding: 10px; border-radius: 12px;
}
html.is-phone .scan-row .sc-label { display: block; font-size: 10.5px; color: #8a93a3; margin-bottom: 2px; }
html.is-phone .scan-row .sc-f-sku { grid-column: 1 / 3; }
html.is-phone .scan-row .sc-f-size { grid-column: 3 / 4; }
html.is-phone .scan-row .sc-f-title { grid-column: 1 / -1; }
html.is-phone .scan-row .sc-f-no { grid-column: 1 / 3; }
html.is-phone .sc-ops { grid-column: 3 / 4; justify-content: flex-end; align-self: end; }
html.is-phone .scan-foot { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
html.is-phone .scan-submit { flex: 1; }
html.is-phone .scan-picker { max-height: 82vh; border-radius: 16px; }

/* 手机：标题副文案单行，别让它换行把顶栏撑高 */
html.is-phone .scan-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ==================== 2026-10-28 批次：SKU 编码 / 退货 / 卡片主按钮 ==================== */

/* ---------- 底部标签栏放到 6 个：缩小一点字号，仍保持 5 宫格般的均衡 ---------- */
html.is-phone .tabbar .tab { font-size: 9.5px; padding: 6px 0 5px; gap: 2px; }
html.is-phone .tabbar .tab-ico { font-size: 18px; }

/* ---------- 悬浮按钮组：订单页「新增」+「扫码」 ---------- */
.fab-stack {
  position: fixed;
  right: 16px;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px);
  z-index: 890;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.fab-stack .fab { position: static; right: auto; bottom: auto; }
.fab-mini {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 40px;
  padding: 0 15px 0 12px;
  border: 1px solid #dbe6fa;
  border-radius: 999px;
  background: #fff;
  color: #2f6fed;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  box-shadow: 0 6px 16px rgba(22, 32, 47, 0.12);
}
.fab-mini:active { transform: scale(0.95); }
.fab-mini .fab-ico { font-size: 15px; display: inline-flex; }
html.has-install-hint .fab-stack { bottom: calc(var(--tabbar-h) + var(--safe-b) + 84px); }

/* ---------- 货单卡片：三点菜单 + 到手价主按钮 ---------- */
.oc-more {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  margin-left: 2px;
  border: 0;
  border-radius: 7px;
  background: #f4f6fa;
  color: #8a93a3;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  padding: 0;
}
.oc-more:active { background: #e8eef7; color: #5b6474; }
.oc-ret {
  color: #d46b08 !important;
  background: #fff7e6;
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 10.5px;
}

/* 卡片底部一行：左边状态提示，右边小按钮（不再整行大蓝块） */
.oc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid #f1f4f9;
}
.oc-hint {
  font-size: 11.5px;
  color: #98a2b3;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.oc-hint.warn { color: #b54708; }
.oc-hint b { font-weight: 600; }

.oc-rev-btn {
  flex-shrink: 0;
  height: 30px;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid #dbe3ef;
  background: #fff;
  color: #3d4757;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.oc-rev-btn.primary {
  border-color: #2f6fed;
  background: #2f6fed;
  color: #fff;
}
.oc-rev-btn:active { transform: scale(0.97); }

/* ---------- 扫码命中的筛选条 ---------- */
.sku-hit {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  margin-bottom: 10px;
  border-radius: 11px;
  background: #eef4ff;
  border: 1px solid #d9e6ff;
}
.table-card > .sku-hit { margin: 0 12px 10px; }
.sh-ico { color: #2f6fed; font-size: 15px; display: inline-flex; }
.sh-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.sh-txt b { font-size: 12.5px; color: #1f2937; }
.sh-txt span {
  font-size: 11px; color: #7c8798;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sh-x {
  border: 0; background: none; color: #8a93a3;
  font-size: 18px; line-height: 1; padding: 0 2px; font-family: inherit;
}

/* ---------- 手机「录入到手价」底部弹层 ---------- */
.rev-sheet { display: flex; flex-direction: column; gap: 9px; }
.rs-title { font-size: 14px; font-weight: 600; color: #1f2937; line-height: 1.45; }
.rs-meta { font-size: 12px; color: #8a93a3; }
.rs-cost { font-size: 12.5px; color: #5b6474; }
.rs-note { font-size: 11.5px; color: #98a2b3; line-height: 1.6; }

/* ---------- 货单详情（查看模式） ---------- */
.vt-title { font-size: 14px; line-height: 1.5; color: #1f2937; font-weight: 600; margin-bottom: 12px; }
.vt-money {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  padding: 12px; border-radius: 12px; background: #f7f9fd;
}
.vt-m { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vt-k { font-size: 11px; color: #98a2b3; }
.vt-m b { font-size: 14px; color: #16202f; font-variant-numeric: tabular-nums; }
.vt-m small { font-size: 10.5px; color: #b6c0cf; }
.vt-profit {
  display: flex; align-items: baseline; gap: 8px;
  padding: 12px; margin-top: 10px; border-radius: 12px; background: #f1f8f3;
}
.vt-profit span { font-size: 11.5px; color: #5b6474; }
.vt-profit b { font-size: 19px; color: var(--pos); font-variant-numeric: tabular-nums; }
.vt-profit small { font-size: 11.5px; color: #5b6474; }
.vt-profit.muted { background: #f7f9fd; }
.vt-profit.muted b { color: #98a2b3; font-size: 13px; font-weight: 500; }
.vt-grid { margin-top: 14px; border-radius: 12px; border: 1px solid #eef1f6; overflow: hidden; }
.vt-row {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; font-size: 12.5px;
  border-bottom: 1px solid #f2f5fa;
}
.vt-row:last-child { border-bottom: 0; }
.vt-row span { color: #8a93a3; width: 74px; flex-shrink: 0; }
.vt-row b { color: #1f2937; font-weight: 500; word-break: break-all; }

/* ---------- 表单里的扫码入口 ---------- */
.scan-fill-btn {
  width: 100%; height: 42px;
  border-radius: 10px;
  border: 1px dashed #b9d0ff;
  background: #f5f9ff;
  color: #2f6fed; font-weight: 600;
}
.scan-fill-btn:hover { background: #eef4ff; border-color: #9dbeff; color: #2f6fed; }
.scan-fill-hint { font-size: 11.5px; color: #98a2b3; margin: 6px 0 14px; line-height: 1.5; }

/* 已生成编码的展示条 */
.code-strip {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 9px 11px; margin: 4px 0 12px;
  border-radius: 9px; background: #f7f9fd; border: 1px solid #eef1f6;
  font-size: 11.5px; color: #7c8798;
}
.code-strip b { color: #1f2937; letter-spacing: 0.3px; }
.code-strip i { font-style: normal; color: #b6c0cf; margin-left: auto; }

/* 扫到商品后 SKU 码的小字 */
.sc-code { font-size: 10.5px; color: #98a2b3; margin-top: 3px; letter-spacing: 0.3px; }

/* ---------- 扫码查询结果卡 ---------- */
.scan-quick .scan-wrap { max-height: 88vh; }
.sq-hit {
  margin: 12px 16px 16px; padding: 13px 14px;
  border-radius: 13px; background: #f1f8f3; border: 1px solid #d6ecdc;
}
.sq-hit-top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.sq-hit-top b { font-size: 15px; color: #1f2937; }
.sq-code { font-size: 11px; color: #6b7a8e; background: #fff; padding: 1px 6px; border-radius: 5px; }
.sq-hit-title { font-size: 12.5px; color: #46536b; margin-top: 5px; line-height: 1.5; }
.sq-hit-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; font-size: 11px; color: #8a93a3; }
.sq-tip { margin: 12px 16px 18px; padding: 12px 14px; border-radius: 12px; background: #f7f9fd; }
.sq-tip-h { font-size: 12px; font-weight: 600; color: #5b6474; margin-bottom: 6px; }
.sq-tip > div { font-size: 11.5px; color: #98a2b3; line-height: 1.9; }
html.is-phone .sq-hit { margin: 10px 12px 14px; }
html.is-phone .sq-tip { margin: 10px 12px 16px; }

/* ---------- 退货管理 ---------- */
.ret-sec { margin-bottom: 16px; }
.ret-sec-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 12.5px; font-weight: 600; color: #46536b; margin-bottom: 8px;
}
.ret-echo { border: 1px solid #eef1f6; border-radius: 10px; overflow: hidden; }
.ret-echo-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 11px; font-size: 12.5px;
  border-bottom: 1px solid #f2f5fa;
}
.ret-echo-row:last-child { border-bottom: 0; }
.ret-size {
  font-size: 10.5px; color: #5b6474; background: #f4f6fa;
  border-radius: 4px; padding: 1px 5px;
}
.ret-title {
  flex: 1 1 auto; min-width: 0; color: #5b6474;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ret-sku-list { display: flex; gap: 4px; flex-wrap: wrap; }
.ret-sku-chip {
  font-size: 10.5px; color: #5b6474; background: #f4f6fa;
  border-radius: 5px; padding: 1px 5px;
}
.ret-sku-more { font-size: 10.5px; color: #98a2b3; }
.ret-sum {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  padding: 12px; border-radius: 11px; background: #f7f9fd; margin-bottom: 10px;
}
.ret-sum > div { display: flex; flex-direction: column; gap: 2px; }
.ret-sum span { font-size: 10.5px; color: #98a2b3; }
.ret-sum b { font-size: 14px; color: #16202f; font-variant-numeric: tabular-nums; }

/* 选货弹窗：图例 / 行 / 分页 */
.pick-legend {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 11.5px; color: #98a2b3; margin: 0 0 8px;
}
.pick-legend b { color: #16202f; }
.pick-all {
  border: 0; background: none; color: #2f6fed;
  font-size: 12px; font-weight: 600; font-family: inherit; padding: 2px 4px;
}
.pick-list { max-height: 52vh; overflow-y: auto; padding-right: 2px; }
.pick-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 11px; margin-bottom: 7px;
  border: 1px solid #eef1f6; border-radius: 10px; cursor: pointer;
  background: #fff;
}
.pick-row.on { border-color: #bcd2ff; background: #f7faff; }
.pick-row .ant-checkbox-wrapper { margin-top: 2px; }
.pr-main { flex: 1 1 auto; min-width: 0; }
.pr-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pr-top b { font-size: 13px; color: #1f2937; }
.pr-code { font-size: 10.5px; color: #98a2b3; }
.pr-cost { margin-left: auto; font-size: 11px; color: #8a93a3; }
.pr-title {
  font-size: 12px; color: #5b6474; margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pr-sub { font-size: 11px; color: #a3adbd; margin-top: 2px; }
.pick-pager {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 8px 0 2px; font-size: 12px; color: #8a93a3;
}
.pick-empty {
  padding: 30px 12px; text-align: center;
  font-size: 12.5px; color: #8a93a3;
  background: #fafbfd; border-radius: 10px;
}

/* 手机：退货小结两列 */
@media (max-width: 767px) {
  .ret-sum { grid-template-columns: repeat(2, 1fr); }
  .pick-list { max-height: 46vh; }
  .vt-row span { width: 64px; }
}

/* 退货单里已选货品的卡片（不复用结算页的 .sk-card，布局不同） */
.ret-cardlist { display: flex; flex-direction: column; gap: 8px; }
.ret-card {
  display: flex; align-items: flex-start; gap: 8px;
  background: #f8fafd; border: 1px solid #eef2f7;
  border-radius: 10px; padding: 9px 11px;
}
.rc-main { flex: 1 1 auto; min-width: 0; }
.rc-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rc-top b { font-size: 13px; color: #1f2937; }
.rc-qty { font-size: 11.5px; color: #8a93a3; margin-left: auto; }
.rc-title {
  font-size: 12px; color: #5b6474; margin-top: 3px; line-height: 1.45;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rc-sub { font-size: 11px; color: #98a2b3; margin-top: 2px; }
.rc-x {
  flex-shrink: 0; width: 24px; height: 24px;
  border: 1px solid #e8eef7; border-radius: 7px;
  background: #fff; color: #98a2b3;
  font-size: 14px; line-height: 1; font-family: inherit; padding: 0;
}
.rc-x:active { background: #fef2f2; color: #d4380d; border-color: #ffd8cc; }

/* =============================== 登录页 =============================== */
.login-wrap {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(1200px 600px at 15% -10%, #e4efff 0%, transparent 55%),
    radial-gradient(900px 500px at 110% 110%, #e6fbf1 0%, transparent 50%),
    #f4f6fa;
}
.login-card {
  width: 100%;
  max-width: 360px;
  background: #fff;
  border: 1px solid #e6ebf3;
  border-radius: 18px;
  box-shadow: 0 18px 50px -28px rgba(15, 23, 41, 0.25);
  padding: 34px 30px 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: center;
}
.lg-logo { width: 64px; height: 64px; border-radius: 16px; margin: 0 auto 2px; box-shadow: 0 8px 20px -10px rgba(47, 111, 237, 0.45); }
.lg-title { font-size: 21px; font-weight: 700; letter-spacing: -0.3px; color: #16202f; }
.lg-sub { font-size: 12px; color: #98a2b3; margin-top: -8px; }
.lg-hint {
  text-align: left;
  background: #fff7e6;
  border: 1px solid #ffe7bf;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 12px;
  color: #874d00;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lg-hint b { font-size: 12.5px; }
/* 连不上服务器：不只弹英文 toast，直接给可操作的提示 + 重连按钮 */
.lg-neterr {
  text-align: left;
  background: #fff2f2;
  border: 1px solid #ffd6d6;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  color: #b42318;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lg-neterr b { font-size: 12.5px; }
.lg-retry {
  align-self: flex-start;
  margin-top: 2px;
  padding: 0;
  border: 0;
  background: none;
  color: #2f6fed;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.lg-retry:active { opacity: 0.6; }
.lg-foot { font-size: 11px; color: #b7c0cf; margin-top: 2px; }
.login-card .ant-input-affix-wrapper { border-radius: 10px; }
.login-card .ant-btn { border-radius: 10px; font-weight: 600; margin-top: 2px; }

/* ============================ 顶栏用户徽章 ============================ */
.tb-user {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 10px 0 5px;
  border: 0;
  background: transparent;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease;
}
.tb-user:hover { background: #f2f5fa; }
.tb-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #2f6fed);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tb-user-name { font-size: 12.5px; font-weight: 600; color: #3d4757; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.is-phone .tb-user { padding: 0; }
html.is-phone .tb-user-avatar { width: 30px; height: 30px; font-size: 13.5px; }

/* 「我的」页头像 */
.more-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #2f6fed);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ============================ 账号管理（手机卡片） ============================ */
.acct-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.acct-list { display: flex; flex-direction: column; gap: 10px; }
.acct-card {
  background: #fff;
  border: 1px solid #e6ebf3;
  border-radius: 12px;
  padding: 12px 14px 10px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}
.ac-top {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.ac-name { font-size: 14px; font-weight: 600; color: #1b2130; }
.ac-nick { font-size: 12px; color: #98a2b3; margin-left: auto; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-role {
  flex-shrink: 0;
  font-size: 10.5px;
  line-height: 16px;
  padding: 0 6px;
  border-radius: 4px;
  background: #f2f4f8;
  border: 1px solid #e6ebf3;
  color: #5b6474;
  font-weight: 500;
}
.ac-role.admin { background: #eef4ff; border-color: #d6e4ff; color: #2f6fed; }
.ac-meta {
  display: flex;
  gap: 14px;
  margin-top: 7px;
  font-size: 11.5px;
  color: #98a2b3;
  font-variant-numeric: tabular-nums;
}
.ac-ops {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid #f1f4f9;
  flex-wrap: wrap;
}
.ac-ops .ant-btn { font-size: 12.5px; }
