/* ============================================================
   闪收虾回收数字管理中心 - 全局样式（纯 CSS，电脑端后台布局）
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px; color: #0f172a; background: #f1f5f9; min-width: 1180px;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
input, select, textarea, button { font-family: inherit; font-size: 14px; outline: none; }

:root {
  --primary: #2563eb; --primary-dark: #1d4ed8; --primary-light: #dbeafe;
  --success: #16a34a; --success-light: #dcfce7;
  --warning: #d97706; --warning-light: #fef3c7;
  --danger: #dc2626;  --danger-light: #fee2e2;
  --gray: #64748b;    --gray-light: #f8fafc;
  --border: #e2e8f0;  --bg: #f1f5f9; --card: #ffffff;
  --sidebar-bg: #001341; --sidebar-text: #cbd5e1;
  /* 滚动条统一色：淡蓝，悬停略深 */
  --sb-thumb: rgba(37,99,235,.22);
  --sb-thumb-hover: rgba(37,99,235,.42);
}

/* ============ 整体布局 ============ */
.layout { display: flex; min-height: 100vh; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ============ 侧边栏 ============ */
.sidebar {
  width: 224px; flex-shrink: 0; background: var(--sidebar-bg); color: var(--sidebar-text);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.logo {
  display: flex; align-items: center; gap: 10px; padding: 18px 16px; border-bottom: 1px solid #1e293b;
}
.logo-img {
  width: 38px; height: 38px; object-fit: contain; border-radius: 6px; flex-shrink: 0; display: block;
}
.logo-text { color: #fff; font-size: 17px; font-weight: 700; line-height: 1.2; }
.logo-text small { display: block; font-size: 11px; font-weight: 400; color: var(--sidebar-text); margin-top: 2px; }
.menu { flex: 1; overflow-y: auto; padding: 10px 0 20px; }
.menu-group {
  display: flex; align-items: center; gap: 10px;
  font-size: 11px; color: #94a3b8; padding: 14px 20px 6px; letter-spacing: 1px;
  text-align: center; opacity: .55; white-space: nowrap;
}
.menu-group::before, .menu-group::after {
  content: ''; flex: 1; height: 1px; background: currentColor;
}
.menu-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 20px; color: var(--sidebar-text);
  font-size: 14px; transition: all .15s; border-left: 3px solid transparent;
}
.menu-item svg { flex-shrink: 0; opacity: .85; }
.menu-item:hover { background: #1e293b; color: #e2e8f0; }
.menu-item.active { background: rgba(37,99,235,.40); color: #fff; border-left-color: var(--primary); }
.menu-item.active svg { color: #60a5fa; }
.sidebar-foot { padding: 12px 20px; font-size: 11px; color: #475569; border-top: 1px solid #1e293b; }

/* ============ 顶栏 ============ */
.topbar {
  background: var(--card); border-bottom: 1px solid var(--border); padding: 0 24px; height: 60px;
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.page-title { font-size: 18px; font-weight: 700; color: #0f172a; }
/* 顶栏右侧整体不参与压缩；账号名称过长时截断省略，把空间留给操作按钮 */
.topbar-right { display: flex; align-items: center; gap: 16px; flex: 0 0 auto; }
.tb-user { color: var(--gray); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tb-scope { color: var(--primary); font-size: 12px; background: rgba(24,144,255,.08); padding: 4px 10px; border-radius: 20px; white-space: nowrap; }
.tb-logout {
  display: inline-flex; align-items: center; gap: 6px; color: var(--danger); font-size: 13px;
  padding: 6px 12px; border: 1px solid var(--danger-light); border-radius: 8px; background: #fff;
  transition: all .15s;
  flex: 0 0 auto; white-space: nowrap; /* 窄屏下「退出登录」始终单行显示 */
}
.tb-logout:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.tb-chpwd { color: var(--primary); border-color: var(--primary-light); }
.tb-chpwd:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ============ 内容区 ============ */
.content { padding: 20px 24px 40px; flex: 1; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.page-head .ph-title { font-size: 16px; font-weight: 700; }
.page-head .ph-desc { font-size: 12px; color: var(--gray); margin-top: 4px; }
.page-actions { display: flex; gap: 10px; }

/* ============ 卡片 ============ */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04); margin-bottom: 16px;
  overflow: hidden; /* 裁剪卡片内贴边元素（如表尾行 hover 背景、表头底色）到圆角内 */
}
.card-head { padding: 14px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: 15px; font-weight: 700; }
/* 卡片标题左侧竖线强调（全站统一：所有 .card-title 前都有该竖线） */
.card-title::before {
  content: ''; display: inline-block; flex: none;
  width: 3px; height: 15px; border-radius: 2px;
  background: var(--primary); margin-right: 8px; vertical-align: -2px;
}
/* 卡片标题层级分隔符：如「上门回收 > 上门信息」 */
.card-title .title-sep { margin: 0 7px; color: var(--gray); font-weight: 500; }
.card-body { padding: 20px; }
/* 城市切换 */
.city-switch { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; max-width: 70%; }
.city-switch-btn {
  padding: 4px 12px; border-radius: 999px; border: 1px solid var(--border);
  background: #fff; color: var(--gray); font-size: 12px; cursor: pointer; line-height: 1.5;
  transition: all .15s;
}
.city-switch-btn:hover { border-color: var(--primary); color: var(--primary); }
.city-switch-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ============ 统计卡片 ============ */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.stat-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 16px; }
/* 只有 4 张统计卡的页面（客户档案）：四列均分铺满整行，左右与筛选区 / 下方卡片对齐；
   窄屏（≤1199px）降为 2×2，避免 3 列时出现「3+1」落单 */
.stat-cards.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1199px) {
  .stat-cards.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* 首页卡片：合并卡占 2 列 + 在库预警 + 累计回收金额各 1 列 = 4 列满行 */
.stat-grid.cols-5 { grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat-grid.cols-5 .stat-card { padding: 16px; gap: 12px; }
.stat-grid.cols-5 .stat-card > div { min-width: 0; }
.stat-grid.cols-5 .stat-value, .stat-grid.cols-5 .stat-num { font-size: 22px; }
/* 说明：首页「在库超期预警 / 累计回收金额」两张单卡的图标，在电脑端与平板竖屏（≥768px）
   保持常规排版（图标在文字左侧）；左上角圆形露头仅用于窄屏，见下方手机端与 iPad 横屏规则 */
/* 合并卡：今日订单 / 今日回收设备 / 今日回收金额 三合一，占 2 个卡片宽度，格间用细线分隔 */
.stat-grid.cols-5 > .stat-card-merged { grid-column: span 2; padding: 0; gap: 0; align-items: stretch; }
.merged-cell { flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 14px 16px; position: relative; }
/* 格间竖线用伪元素绘制，上下各留 12px 不抵拢卡片边框 */
.merged-cell + .merged-cell::before {
  content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 1px;
  background: var(--border); pointer-events: none;
}
.merged-cell .stat-ico { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.merged-cell .stat-value { font-size: 19px; }
.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px;
  display: flex; align-items: center; gap: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.stat-ico { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-ico.green  { background: var(--success-light); color: var(--success); }
.stat-ico.blue   { background: var(--primary-light); color: var(--primary); }
.stat-ico.orange { background: var(--warning-light); color: var(--warning); }
.stat-ico.red    { background: var(--danger-light); color: var(--danger); }
.stat-label { font-size: 12px; color: var(--gray); margin-bottom: 4px; }
.stat-value { font-size: 22px; font-weight: 700; line-height: 1.2; }
.stat-num { font-size: 22px; font-weight: 700; line-height: 1.2; }
.stat-info { flex: 1; min-width: 0; }
.stat-sub { font-size: 11px; color: var(--gray); margin-top: 2px; }
/* 金额类统计值：内容较长（如「¥1,234.00 / ¥5,678.00」），桌面端比常规数值小一档；
   无毛利权限时展示占位文案，再小一档。手机端统一跟随 18px（见移动端规则） */
.stat-value.is-wide { font-size: 17px; }
.stat-value.is-narrow { font-size: 15px; }
/* 统计数值后的单位（单 / 台 / 元）：小于数值字号、弱化为灰色，不抢主数值视觉 */
.stat-unit { font-size: 13px; font-weight: 500; color: var(--gray); margin-left: 3px; }

/* ============ 筛选区 ============ */
.filter-bar { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px; margin-bottom: 16px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filter-item { display: flex; flex-direction: column; gap: 5px; }
.filter-item label { font-size: 12px; color: var(--gray); }
.filter-actions { display: flex; gap: 8px; padding-top: 19px; }

/* 筛选区折叠（订单列表页）：各终端默认只显示前 2 行，其余隐藏，点击展开 */
.filter-collapsible .filter-actions { padding-top: 0; margin-top: 12px; }
.f-hidden { display: none !important; }
.filter-toggle {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 12px; padding: 6px 14px;
  font-size: 13px; font-weight: 600; color: var(--primary); background: var(--primary-light);
  border: 1px dashed var(--primary); border-radius: 8px; cursor: pointer; user-select: none;
}
.filter-toggle:hover { opacity: .85; }
.filter-toggle .ft-arrow { transition: transform .28s ease; }
.filter-collapsible:not(.filter-collapsed) .filter-toggle .ft-arrow { transform: rotate(180deg); }

/* ============ 表单 ============ */
input[type="text"], input[type="password"], input[type="number"], input[type="date"],
input[type="datetime-local"], textarea {
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; background: #fff;
  color: #0f172a; transition: border-color .15s, box-shadow .15s; width: 100%;
}
input:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
textarea { resize: vertical; min-height: 72px; }
/* 新增/编辑回收订单：备注信息文本框保持单行高度（可手动向下拖动拉高） */
#remark { min-height: 0; height: 38px; }
input:disabled, textarea:disabled { background: var(--gray-light); color: var(--gray); cursor: not-allowed; }

/* 下拉菜单：统一圆角/边框，自定义箭头，悬停聚焦反馈 */
select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px 8px 12px;
  padding-right: 32px; width: 100%; color: #0f172a; background: #fff;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 14px;
  cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
select:hover { border-color: var(--primary); }
select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
select:disabled { background: var(--gray-light); color: var(--gray); cursor: not-allowed; }
select option { color: #0f172a; background: #fff; font-size: 13px; padding: 6px 10px; }
select option:checked { background: var(--primary-light); color: var(--primary-dark); }

/* 明细表格内紧凑下拉：保留原生箭头，避免窄列挤压 */
.items-table select { appearance: auto; -webkit-appearance: auto; -moz-appearance: auto; background-image: none; padding: 6px 8px; }

/* ============ 自定义下拉（替换原生 select 外框） ============ */
.ui-select { position: relative; display: block; width: 100%; font-size: 14px; color: #0f172a; }
.ui-select__native { position: absolute; left: -9999px; top: 0; opacity: 0; pointer-events: none; height: 0; width: 100%; }
.ui-select__trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 40px; padding: 8px 12px; box-sizing: border-box;
  border: 1px solid var(--border); border-radius: 8px; background: #fff;
  cursor: pointer; user-select: none;
  transition: border-color .15s, box-shadow .15s;
}
.ui-select__trigger:hover { border-color: var(--primary); }
.ui-select.open .ui-select__trigger { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.ui-select__value { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui-select__value.placeholder { color: #94a3b8; }
.ui-select__arrow { flex: none; width: 16px; height: 16px; color: #64748b; transition: transform .2s, color .2s; }
.ui-select.open .ui-select__arrow { transform: rotate(180deg); color: var(--primary); }
.ui-select__menu {
  position: fixed; top: 0; left: 0; z-index: 1200;
  display: none; white-space: nowrap;
  max-width: 320px; max-height: 264px; overflow: auto;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(15,23,42,.14); padding: 4px;
}
.ui-select.open .ui-select__menu { display: block; animation: uiSelectIn .16s ease; }
@keyframes uiSelectIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.ui-select__group-title { padding: 7px 10px 4px; font-size: 12px; font-weight: 700; color: var(--gray); }
.ui-select__option {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-radius: 6px; font-size: 13px; color: #0f172a;
  cursor: pointer; transition: background .12s;
}
.ui-select__option:hover { background: var(--gray-light); }
.ui-select__option.sel { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }
.ui-select__option .ck { flex: none; width: 16px; height: 16px; color: var(--primary); opacity: 0; transition: opacity .12s; }
.ui-select__option.sel .ck { opacity: 1; }
.ui-select.disabled .ui-select__trigger { background: var(--gray-light); color: var(--gray); cursor: not-allowed; }
/* 滚动条样式统一由文件末尾「全局滚动条」规则控制 */
.ui-select.disabled .ui-select__trigger:hover { border-color: var(--border); }
/* 兼容既有宽度工具类与批量操作条 */
.ui-select.w-110 { width: 110px; }
.ui-select.w-120 { width: 120px; }
.ui-select.w-140 { width: 140px; }
.ui-select.w-160 { width: 160px; }
.ui-select.w-200 { width: 200px; }
.ui-select.w-240 { width: 240px; }
.batch-bar .ui-select { width: 160px; }
/* 明细表格（订单明细行）内下拉紧凑适配：窄列不挤压，菜单 fixed 定位不被表格裁剪 */
.items-table .ui-select__trigger { min-height: 30px; padding: 5px 8px; font-size: 13px; }
.items-table .ui-select__value { font-size: 13px; }
.items-table .ui-select__option { padding: 6px 8px; font-size: 12px; }
.items-table .ui-select__menu { max-width: 280px; max-height: 220px; }
.f-inline { width: auto; }
.form-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 20px; }
.form-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.form-grid.cols-5 { grid-template-columns: repeat(5, 1fr); }
.form-item { display: flex; flex-direction: column; gap: 6px; }
.form-item label { font-size: 13px; color: var(--gray); font-weight: 600; }
.form-item label .req { color: var(--danger); margin-left: 2px; }
.form-item.full { grid-column: 1 / -1; }
.form-hint { font-size: 12px; color: var(--gray); }

/* 提示图标：鼠标悬停显示完整说明（表格内空间有限，避免长文本撑开列宽） */
.tip-icon {
  display: inline-flex; align-items: center; vertical-align: middle;
  margin-left: 4px; color: var(--gray); cursor: help;
}
.tip-icon:hover { color: var(--primary); }
/* 气泡挂到 body 并以 fixed 定位，避免被 .table-wrap 等滚动容器裁切 */
.tip-box {
  position: fixed; z-index: 2000; display: none;
  max-width: 260px; padding: 6px 8px; border-radius: 4px;
  background: #1e293b; color: #fff;
  font-size: 12px; line-height: 1.5; text-align: left; white-space: normal;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
  pointer-events: none;
}

/* ============ 系统配置卡片 ============ */
.setting-row {
  display: flex; flex-direction: column; align-items: stretch; gap: 12px;
  padding: 16px 0;
}
.setting-row + .setting-row { border-top: 1px dashed var(--border); }
.setting-name { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: #0f172a; }
.setting-name svg { color: var(--primary); flex: none; }
.setting-desc { font-size: 12px; color: var(--gray); margin-top: 5px; line-height: 1.65; }
.setting-control { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.number-unit { display: flex; align-items: stretch; }
.number-unit input { width: 240px; border-radius: 8px 0 0 8px; }
.number-unit input:focus { z-index: 1; }
.number-unit .unit {
  display: inline-flex; align-items: center; padding: 0 14px;
  border: 1px solid var(--border); border-left: none; border-radius: 0 8px 8px 0;
  background: var(--gray-light); color: var(--gray); font-size: 13px; white-space: nowrap;
}
.setting-tip { font-size: 11px; color: var(--gray); }
.setting-tip.error { color: var(--danger); font-weight: 600; }
.setting-foot {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding-top: 16px; margin-top: 4px; border-top: 1px solid var(--border);
}
.setting-foot .btn { flex: none; }
/* 配置项名称不再单独加竖线（已统一移到卡片标题前），此处保留类名样式 */
/* 数字输入框 + 单位：聚焦整体联动高亮 */
.number-unit:focus-within input,
.number-unit:focus-within .unit { border-color: var(--primary); }
.number-unit:focus-within input { box-shadow: 0 0 0 3px rgba(37,99,235,.1); z-index: 1; }
.number-unit:focus-within .unit { background: var(--primary-light); color: var(--primary-dark); }
/* 输入非法提示 */
.number-unit input.invalid { border-color: var(--danger); }
.number-unit input.invalid:focus { box-shadow: 0 0 0 3px rgba(220,38,38,.12); }
/* 保存按钮 loading 动画 */
.btn .spinner {
  display: inline-block; width: 13px; height: 13px; flex: none;
  border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%;
  animation: btnSpin .6s linear infinite;
}
@keyframes btnSpin { to { transform: rotate(360deg); } }

/* 单选组 */
.radio-group { display: flex; gap: 18px; padding-top: 6px; }
.radio-group label { display: flex; align-items: center; gap: 6px; font-size: 14px; color: #0f172a; font-weight: 400; cursor: pointer; }

/* 权限勾选 */
.perm-section { margin-bottom: 18px; }
.perm-group-title { font-size: 13px; font-weight: 700; margin-bottom: 10px; padding-left: 10px; border-left: 3px solid var(--primary); }
.perm-group-menu { margin-left: 8px; font-size: 12px; font-weight: 400; color: var(--gray); }
.perm-checks { display: flex; flex-wrap: wrap; gap: 10px; }
.perm-check {
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; display: flex; align-items: center; gap: 7px;
  cursor: pointer; user-select: none; transition: all .15s; background: var(--gray-light);
}
.perm-check input { width: 15px; height: 15px; accent-color: var(--primary); }
.perm-check.checked { background: var(--primary-light); border-color: var(--primary); color: var(--primary-dark); }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 8px; padding: 8px 16px; cursor: pointer;
  font-size: 14px; transition: all .15s; white-space: nowrap;
}
.btn svg { flex-shrink: 0; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: #fff; color: var(--danger); border-color: var(--danger-light); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #b45309; }
.btn-plain { background: #fff; color: var(--gray); border-color: var(--border); }
.btn-plain:hover { color: var(--primary); border-color: var(--primary); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-lg { padding: 10px 24px; font-size: 15px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* 行内图标按钮 */
.ibtn { display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; font-size: 12px; border-radius: 6px; cursor: pointer; border: 1px solid transparent; transition: all .15s; }
.ibtn-view  { color: var(--primary); background: var(--primary-light); }
.ibtn-view:hover { background: #bfdbfe; }
.ibtn-edit  { color: var(--warning); background: var(--warning-light); }
.ibtn-edit:hover { background: #fde68a; }
.ibtn-del   { color: var(--danger); background: var(--danger-light); }
.ibtn-del:hover { background: #fecaca; }
.ibtn-status { color: var(--success); background: var(--success-light); }
.ibtn-status:hover { background: #bbf7d0; }
.ibtn-unsold  { color: var(--danger); background: var(--danger-light); }
.ibtn-unsold:hover { background: #fecaca; }
.ibtn + .ibtn { margin-left: 4px; }

/* ============ 表格 ============ */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}
/* 滚动条样式统一由文件末尾「全局滚动条」规则控制 */
.table { width: 100%; border-collapse: collapse; }
/* 订单详情弹窗：物品明细单元格不换行，总宽超出容器时横向滚动 */
.detail-items-wrap .table td { white-space: nowrap; }
.detail-items-wrap .table { min-width: 760px; }
/* 通用：表格单元格一律不换行，列宽按内容撑开；总宽超出容器时由 .table-wrap 横向滚动
   （不受断点限制，iPad 横屏等窄容器同样生效） */
.table-nowrap .table { width: auto; min-width: 100%; }
.table-nowrap .table th,
.table-nowrap .table td { white-space: nowrap; }
/* 在库数量下方的「（共 N · 已售 N）」：换行显示，字号比表格正文小两号 */
.qty-sub { display: block; font-size: 11px; color: var(--gray); font-weight: 400; margin-top: 2px; }
.cell-ellipsis { display: inline-block; max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
/* 操作日志「操作内容」列：内容较长，改为换行完整显示（其余列仍不换行），
   并缩小字号 / 加大行高，长文本也能在有限宽度内读完；超长无空格串（如型号）强制断行 */
.table-nowrap .table th.log-content { white-space: nowrap; }
.table-nowrap .table td.log-content {
  white-space: normal;
  max-width: 520px;
  min-width: 240px;
  font-size: 12px;
  line-height: 1.6;
  color: #475569;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.table th, .table td { padding: 10px 12px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--border); font-size: 13px; }
.table thead th {
  background: var(--gray-light); font-weight: 700; color: #475569; font-size: 13px; white-space: nowrap;
}
.table tbody tr[data-id] { cursor: pointer; }
.table tbody tr:hover { background: #f8fafc; }
.table tbody tr:last-child td { border-bottom: none; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .center { text-align: center; }
.table .ops { white-space: nowrap; }
.sort-link { color: var(--primary); cursor: pointer; user-select: none; }
.sort-link:hover { text-decoration: underline; }
.table-empty { padding: 40px !important; text-align: center; color: var(--gray); }

/* 状态徽章 */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; white-space: nowrap; }
.badge-green  { background: var(--success-light); color: var(--success); }
.badge-orange { background: var(--warning-light); color: var(--warning); }
.badge-gray   { background: #f1f5f9; color: var(--gray); }
.badge-red    { background: var(--danger-light); color: var(--danger); }
.badge-blue   { background: var(--primary-light); color: var(--primary); }

/* ============ 分页 ============ */
.pagination { display: flex; align-items: center; gap: 6px; margin-top: 16px; justify-content: flex-end; flex-wrap: wrap; }
.pagination .pg-info { font-size: 12px; color: var(--gray); margin-right: 8px; }
.pagination a, .pagination span.pg-cur {
  min-width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 6px; font-size: 13px; background: #fff; color: #0f172a; padding: 0 8px;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination span.pg-cur { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }
.pagination input { width: 52px; height: 30px; text-align: center; padding: 0 4px; }
.pagination .pg-nums { display: flex; align-items: center; gap: 6px; }
.pagination .pg-nums-3 { display: none; } /* 手机端才显示 3 个页码 */

/* ============ 加载更多 ============ */
.load-more { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 0 24px; }
.load-more .btn { min-width: 170px; }
.load-more-info { font-size: 12px; color: var(--gray); }
.load-more.done { padding: 8px 0 14px; }

/* ============ 弹窗 ============ */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.55); z-index: 1000;
  display: none; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 60px 20px;
}
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 14px; width: 100%; box-shadow: 0 20px 50px rgba(0,0,0,.2); animation: modalIn .18s ease; }
.modal-head { padding: 16px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close { cursor: pointer; color: var(--gray); font-size: 22px; line-height: 1; background: none; border: none; }
.modal-close:hover { color: #0f172a; }
.modal-body { padding: 22px; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }

/* ============ 轻提示 ============ */
.toast-wrap { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 2000; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  padding: 10px 22px; border-radius: 10px; color: #fff; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.15);
  animation: toastIn .2s ease; min-width: 180px; text-align: center;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* ============ 确认弹窗 ============ */
.confirm-box { text-align: center; padding: 10px 0 4px; }
.confirm-ico { width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 14px; display: flex; align-items: center; justify-content: center; }
.confirm-ico.danger { background: var(--danger-light); color: var(--danger); }
/* 会话超时提醒弹窗：橙色警示图标，区别于删除类操作的红色 */
.confirm-ico.warn { background: var(--warning-light); color: var(--warning); }
.confirm-msg { font-size: 15px; color: #0f172a; line-height: 1.6; }

/* 登记出售弹窗：表单项之间留白、提示文字行距优化（避免堆挤，长说明更易读） */
.sell-form { display: flex; flex-direction: column; gap: 16px; }
.sell-form .form-item { gap: 7px; }
.sell-form .form-hint { line-height: 1.75; }
.sell-form .form-item input + .form-hint { margin-top: 1px; }
.sell-form .form-hint + .form-hint { margin-top: -3px; }
/* 登记出售弹窗「备注」：默认两行高度（可手动向下拖动拉高） */
.sell-form textarea.sell-remark { min-height: 0; height: 58px; line-height: 1.5; resize: vertical; }
/* 「成交时间」控件默认内在宽度偏大，锁定宽度并清零最小宽度，与其它控件完全一致 */
.sell-form .form-item input[type="datetime-local"] { width: 100%; max-width: 100%; min-width: 0; }

/* ============ 柱状图 ============ */
/* 可横向拖动/滑动浏览，最小步进 1 天：窗口固定显示 --trend-days 天（电脑 14 天），
   柱宽 = 100% / --trend-days，滑动一天即窗口起始日期前移一天 */
.bar-chart { --trend-days: 14; position: relative; display: flex; align-items: flex-end; gap: 0; height: 190px; padding: 10px 4px 0; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scroll-snap-type: x proximity; scroll-padding-left: 4px; overscroll-behavior-x: contain; cursor: grab; user-select: none; -webkit-user-select: none; }
.bar-chart.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.bar-col { flex: 0 0 calc(100% / var(--trend-days)); display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; scroll-snap-align: start; }
.chart-tip { font-size: 11px; color: var(--gray); font-weight: 400; }
/* 平板（触屏 ≥600px）：柱底与横向滚动条之间留白，滚动条不紧贴柱状图 */
@media (min-width: 600px) and (pointer: coarse) {
  .bar-chart { height: 200px; padding-bottom: 12px; }
}
/* 滚动条样式统一由文件末尾「全局滚动条」规则控制 */
.bar-val { font-size: 11px; color: var(--gray); }
.bar {
  width: 70%; max-width: 34px; border-radius: 4px 4px 0 0; background: linear-gradient(180deg,#3b82f6,#2563eb);
  min-height: 2px; transition: height .3s;
}
.bar-col:nth-child(even) .bar { background: linear-gradient(180deg,#34d399,#10b981); }
.bar-label { font-size: 11px; color: var(--gray); white-space: nowrap; }
/* 趋势双曲线（订单数 / 回收台数）：SVG 铺满整个可滚动内容宽度，与下方日期列逐天对齐。
   viewBox 横向用「天数」为单位、preserveAspectRatio=none 拉伸，故线宽必须 non-scaling-stroke，
   否则横向缩放会把描边压扁 */
/* 折线层与节点层共用同一套定位。
   宽度必须先扣除 .bar-chart 的左右内边距（各 4px，共 8px）再乘「总天数 / 可见天数」：
   绝对定位元素的百分比宽度相对「padding box」，而日期列的 flex-basis 相对「content box」，
   两者基准不同，不扣内边距会让节点层比日期列整体宽出一截，且越往右偏得越多 */
.trend-svg,
.trend-layer {
  position: absolute; left: 4px; top: 10px;
  width: calc((100% - 8px) * var(--trend-total, 60) / var(--trend-days));
  height: calc(100% - 42px);
  pointer-events: none;
}
.trend-svg { overflow: visible; }
.trend-svg .tg { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.trend-svg .tl-cnt,
.trend-svg .tl-qty,
.trend-svg .tl-sold {
  fill: none; stroke-width: 2; vector-effect: non-scaling-stroke;
  stroke-linejoin: round; stroke-linecap: round;
}
.trend-svg .tl-cnt { stroke: #2563eb; }
.trend-svg .tl-qty { stroke: #10b981; }
.trend-svg .tl-sold { stroke: #f59e0b; }
/* 节点数值标签层：定位与折线层完全一致（见上方共用规则），纵向 1% 对应 viewBox 1 单位 */
.tnode {
  position: absolute; font-size: 10px; font-weight: 600; line-height: 1;
  padding: 1px 3px; border-radius: 4px; background: rgba(255,255,255,.86);
  white-space: nowrap;
}
/* 两条线的数值分别置于节点上方/下方，避免同日两个数字互相压盖 */
.tnode-cnt { color: #2563eb; transform: translate(-50%, -150%); }
.tnode-qty { color: #10b981; transform: translate(-50%, 45%); }
.tnode-sold { color: #f59e0b; transform: translate(-50%, -95%); }
/* 图例 */
.chart-legend { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--gray); }
.chart-legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.lg-cnt { background: #2563eb; }
.lg-qty { background: #10b981; }
.lg-sold { background: #f59e0b; }

/* 横向排名条 */
/* 行高与右侧订单表格行保持一致：上下 padding 10px（同 .table td），不再用 margin 制造行距 */
.rank-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.rank-name { width: 110px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-shrink: 0; }
.rank-bar { flex: 1; height: 18px; background: var(--gray-light); border-radius: 9px; overflow: hidden; }
.rank-bar i { display: block; height: 100%; border-radius: 9px; background: linear-gradient(90deg,#60a5fa,#2563eb); }
.rank-val { width: 110px; font-size: 12px; color: var(--gray); text-align: right; flex-shrink: 0; font-variant-numeric: tabular-nums; }

/* ============ 详情 ============ */
.detail-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 18px; }
.detail-item { background: var(--gray-light); border-radius: 8px; padding: 12px 14px; }
.detail-item .dl { font-size: 12px; color: var(--gray); margin-bottom: 4px; }
.detail-item .dv { font-size: 15px; font-weight: 400; word-break: break-all; }
.detail-item .dv-sub { display: block; font-size: 12px; color: var(--gray); margin-top: 3px; font-weight: 400; }
/* 物品明细表中出售时间：比默认略小 */
.dv-sub.item-sell-time { font-size: 11px; color: var(--gray); margin-top: 2px; }
/* 出售状态格：状态+操作分段控件左对齐，下方出售时间相对控件左右居中 */
.sold-td { text-align: left; }
.sold-cell { display: inline-block; }
.sold-cell .item-sell-time { text-align: center; }
/* 出售状态格：状态标签与「记录 / 继续出售」等操作合并为一个分段控件 */
.sold-group {
  display: inline-flex; align-items: stretch; vertical-align: middle;
  border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: #fff;
}
.sold-group > * {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 3px 13px; font-size: 12px; line-height: 1.5; white-space: nowrap;
  border: 0; border-radius: 0;
}
/* 段与段之间用一条倾斜的细线分割（角度与下面的斜切一致：8px / 约17°） */
.sold-group .sg-sep {
  position: relative; width: 6px; padding: 0; z-index: 2; pointer-events: none;
}
.sold-group .sg-sep::before {
  content: ''; position: absolute; top: -6px; bottom: -6px; left: -4px;
  width: 1px; background: var(--border); transform: rotate(17deg);
}
/* 各段背景按斜线裁切；操作段向左多盖一段（间隔 6px + 斜切 8px），
   使悬停背景铺满斜线处、不露白底；左右内边距由 JS 按字数自适应 */
.sold-group .sg-status { clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%); }
.sold-group .ibtn {
  margin-left: -14px;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}
.sold-group .ibtn:last-child { clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%); }
.sold-group .sg-status { font-weight: 500; }
.sold-group .sg-status.st-green  { background: var(--success-light); color: var(--success); }
.sold-group .sg-status.st-orange { background: var(--warning-light); color: var(--warning); }
.sold-group .sg-status.st-gray   { background: #f1f5f9; color: var(--gray); }
.sold-group .ibtn { background: #fff; color: var(--success); }
.sold-group .ibtn:hover { background: #bbf7d0; }
.sold-group .ibtn + .ibtn { margin-left: -14px; }
.sold-group .ibtn-unsold { color: var(--danger); }
.sold-group .ibtn-unsold:hover { background: #fecaca; }
.detail-item.full { grid-column: 1 / -1; }
/* 详情主信息「展开/收起」按钮：仅手机端（≤767px）显示，桌面端不出现 */
.detail-toggle { display: none; }
/* pad 横屏及以上（≥992px）：订单详情「订单类型」格内，合作伙伴名称另起一行并可折行完整显示 */
@media (min-width: 992px) {
  .detail-item .partner-name { display: block; margin-top: 5px; font-weight: 500; word-break: break-all; line-height: 1.35; }
}

/* ============ 登录页 ============ */
.login-body {
  /* column：卡片与其下方版权信息纵向排列并整体居中 */
  min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh;
  padding: 24px;
  /* 主题图已移至左侧 .login-side，此处保留同色系底色衬托白色卡片（与侧边栏主色呼应） */
  background: linear-gradient(135deg, #001341 0%, #1e3a8a 52%, #2563eb 100%);
}
/* 左右分栏卡片：左图 + 右登录 */
.login-wrap {
  display: flex; width: 960px; max-width: 100%; min-height: 560px;
  background: #fff; border-radius: 18px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
/* 左侧主题图区 */
.login-side {
  position: relative; flex: 0 0 50%; overflow: hidden;
  display: flex; align-items: flex-end;
  background: linear-gradient(160deg, #001341 0%, #163a8f 55%, #2563eb 100%);
}
.login-side-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.login-side-mask {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,19,65,.92) 0%, rgba(0,19,65,.0) 55%, rgba(0,19,65,.10) 100%);
}
.login-side-text { position: relative; padding: 34px 32px; color: #fff; }
.login-side-badge {
  display: inline-block; font-size: 12px; letter-spacing: .5px; margin-bottom: 18px;
  padding: 5px 12px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.12);
}
/* 文字用 85% 白而非纯白：降低与深蓝底的对比，视觉上更柔和、不抢主题图 */
.login-side-title { font-size: 20px; font-weight: 400; line-height: 1.4; margin-bottom: 12px; letter-spacing: .5px; color: rgba(255,255,255,.85); }
.login-side-desc { font-size: 13px; line-height: 1.7; color: rgba(255,255,255,.78); }
/* 右侧登录区 */
.login-panel { flex: 1; display: flex; align-items: center; justify-content: center; padding: 36px 34px; background: #fff; }
/* 表单容器：白底/圆角/阴影已由外层 .login-wrap 统一提供，此处只约束宽度；
   表单内部元素（logo、输入框、按钮、验证码、提示）样式全部保持原样 */
.login-box { width: 100%; max-width: 340px; background: transparent; border-radius: 0; padding: 0; box-shadow: none; }
.login-logo { text-align: center; margin-bottom: 8px; }
.login-logo-img { width: auto; height: 65px; object-fit: contain; }
.login-title {
  display: flex; align-items: center; gap: 12px;
  font-size: 18px; font-weight: 400; color: var(--gray); margin-bottom: 28px;
}
.login-title::before,
.login-title::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.login-sub { text-align: center; color: var(--gray); font-size: 13px; margin: 6px 0 26px; }
.login-item { margin-bottom: 18px; }
.login-item label { display: block; font-size: 13px; color: var(--gray); margin-bottom: 6px; font-weight: 600; }
.login-item input { height: 42px; font-size: 15px; }
.login-error { background: var(--danger-light); color: var(--danger); border-radius: 8px; padding: 9px 12px; font-size: 13px; margin-bottom: 16px; display: none; }
.login-error.show { display: block; }
.login-btn { width: 100%; height: 44px; font-size: 15px; }
.login-tip { text-align: center; color: var(--gray); font-size: 12px; margin-top: 18px; }
/* 品牌语 + 版权 / ICP 备案：置于左侧主题图区靠下位置，在该区域左右居中。
   position/z-index 用于压在图片与渐变遮罩之上；.login-side 为 align-items:flex-end，故自然贴底。
   移动端 .login-side 整块隐藏，这些信息随之不展示（另有 ≤900px 的 display:none 兜底） */
.login-copyright {
  position: relative; z-index: 1; width: 100%;
  padding: 0 32px 34px;
  text-align: center; font-size: 14px; line-height: 1.6;
  color: rgba(255,255,255,.72);
}
.login-copyright a { color: rgba(255,255,255,.72); }
.login-copyright a:hover { color: #fff; text-decoration: underline; }
/* 品牌语：与版权信息同块、位于版权文字上方。
   不单独设 color / font-size，直接继承 .login-copyright 的样式，两者永远保持一致 */
.login-slogan { line-height: 1.6; letter-spacing: .5px; margin-bottom: 5px; }
/* 手机端（<=900px）：统一采用「顶部主题图 + 占满宽度的白色登录区」。
   不再按 orientation 拆分竖屏/横屏两套布局——设备旋转时样式不会跳变成另一套（即不随方向"旋转"），
   横屏仅因视口变矮而自然出现滚动，布局结构保持一致。 */
@media (max-width: 900px) {
  /* 去掉页面左右/底部内边距：让白色登录区横向 100% 占满，并一路延伸到底部边缘。
     登录区用 margin-top:auto 顶到底部，而非 justify-content:flex-end——
     横屏等矮视口下内容超出时不会出现"顶部溢出且滚不到"的问题 */
  .login-body { padding: 0; }
  /* 顶部图片层：图片之上叠一层「自上而下」的渐变遮罩（顶部透明 → 底部不透明底色），
     使图片从上到下自然淡出融入页面底色，而非在中途生硬截断 */
  .login-body::before {
    content: ''; position: fixed; top: 0; left: 0; right: 0; height: 46vh;
    background:
      linear-gradient(180deg,
        rgba(0,19,65,0)    0%,
        rgba(0,19,65,.28) 32%,
        rgba(0,19,65,.62) 62%,
        rgba(0,19,65,.90) 85%,
        #001341          100%),
      url('../img/login-side.png') center top / cover no-repeat;
  }
  /* 图片层以下：与渐变末端同色起笔，保证衔接无缝且表单区背景干净 */
  .login-body::after {
    content: ''; position: fixed; left: 0; right: 0; top: 46vh; bottom: 0;
    background: linear-gradient(180deg, #001341 0%, rgba(0,19,65,.92) 45%, rgba(14,44,115,.75) 100%);
  }
  /* 卡片与版权提到背景层之上 */
  .login-wrap, .login-copyright { position: relative; z-index: 1; }
  .login-wrap {
    width: 100%; max-width: none; margin-top: auto;
    /* 版权已隐藏，改为由登录区自身撑满图片以下的剩余空间（100vh - 46vh），
       保证白色依然一路延伸到底部边缘；内容更多时可继续增高 */
    min-height: 54vh;
    border-radius: 22px 22px 0 0; /* 仅上方圆角 */
  }
  .login-side { display: none; } /* 图片已是整页背景，卡片内不再重复展示 */
  .login-panel { padding: 28px 22px 22px; }
  /* 手机端不展示版权 / 备案信息（品牌语在其内部，随之隐藏） */
  .login-copyright { display: none; }
}

/* 手机竖屏（≤480px portrait）：登录表单区域进一步紧凑，减少纵向占位，
   保证在较小屏幕上 Logo、标题、三个表单项与登录按钮一屏内可见、无需频繁滚动 */
@media (max-width: 480px) and (orientation: portrait) {
  .login-panel { padding: 20px 16px 16px; }
  .login-logo-img { height: 48px; }
  .login-title { font-size: 16px; margin-bottom: 16px; }
  .login-item { margin-bottom: 12px; }
  .login-item label { font-size: 12px; margin-bottom: 4px; }
  .login-item input { height: 40px; font-size: 14px; }
  .login-btn { height: 42px; font-size: 14px; }
  .login-error { padding: 8px 10px; font-size: 12px; margin-bottom: 12px; }
}

/* ============ 订单明细表 ============ */
.items-table { width: 100%; min-width: 1400px; border-collapse: collapse; table-layout: fixed; }
.items-table .photo-tools { display: flex; justify-content: center; align-items: center; margin-bottom: 0; }
.items-table .photo-thumbs { display: flex; justify-content: center; align-items: center; margin-top: 6px; }
.items-table .photo-thumbs:empty { margin-top: 0; }
.items-table tr { height: 50px; }
.items-table th { background: var(--gray-light); padding: 0 8px; font-size: 13px; color: #475569; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.items-table td { padding: 15px 8px; border-bottom: 1px solid var(--border); overflow: hidden; position: relative; vertical-align: middle; text-align: center; }
.items-table input, .items-table select { width: 100%; box-sizing: border-box; padding: 6px 8px; font-size: 13px; height: 34px; line-height: 20px; vertical-align: middle; text-align: center; text-align-last: center; }
.items-table td > * { display: inline-block; vertical-align: middle; }
.items-table .ibtn { display: inline-flex; white-space: nowrap; vertical-align: middle; }
.items-table input[type="number"]::-webkit-outer-spin-button, .items-table input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.items-table input[type="number"] { -moz-appearance: textfield; }
.items-table .f-price-ref {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 2px;
  margin: 0;
  min-height: 0;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.items-table .num { text-align: center; }
/* 已登记出售的行：数量锁定，灰框内展示「已售/总数」，字号与其他输入框一致 */
.items-table .qty-view { display: block; font-size: 13px; }
/* 明细表内的隐藏字段（如锁定的数量）不参与布局 */
.items-table input[type="hidden"] { display: none; }
/* 售出单价：多笔出售记录的提示图标贴在输入框内右侧，金额不被遮挡 */
.items-table .sprice-wrap { position: relative; display: block; }
.items-table .f-sprice.has-tip { padding-right: 26px; }
.items-table .tip-icon-in {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  margin: 0; cursor: help;
}
.items-table .center { text-align: center; }
.totals-bar {
  display: flex; gap: 30px; background: var(--gray-light); border-radius: 10px; padding: 14px 20px;
  margin-top: 16px; flex-wrap: wrap;
}
.totals-bar .t-item { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.totals-bar .t-label { font-size: 13px; color: var(--gray); white-space: nowrap; }
.totals-bar .t-value { font-size: 18px; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.totals-bar .t-value.green { color: var(--success); }
.totals-bar .t-value.red { color: var(--danger); }
/* 汇总数值后的费用说明（如「（燃油费）」）：与 t-label 小字同字号，避免跟随数值的大号加粗 */
.totals-bar .t-note { font-size: 13px; font-weight: 400; color: var(--gray); margin-left: 3px; }

/* ============ 工具类 ============ */
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.text-muted { color: var(--gray); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-primary { color: var(--primary); }
.font-bold { font-weight: 700; }
.w-120 { width: 120px; }
.w-140 { width: 140px; }
.w-160 { width: 160px; }
.w-200 { width: 200px; }
.w-240 { width: 240px; }
.empty { text-align: center; padding: 36px 0; color: var(--gray); font-size: 13px; }

/* ============ 批量操作条 ============ */
.batch-bar {
  display: none; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 20px; background: var(--primary-light); border-bottom: 1px solid var(--border);
}
.batch-bar.show { display: flex; }
.batch-bar .batch-info { font-size: 13px; color: var(--primary-dark); font-weight: 600; }
.batch-bar select { width: 160px; }

/* ============ 表格复选框 / 文本链接 ============ */
.table input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; vertical-align: middle; }
.link { color: var(--primary); }
.link:hover { text-decoration: underline; }

/* ============ 订单列表快捷筛选切换卡 ============ */
.ch-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; flex: 1; min-width: 0; }
/* 切换卡：蓝底；当前项白底蓝字，非当前项白字（无滑动指示器）
   min-width:0 —— flex 子项默认 min-width:auto 无法收缩，内容超宽时会撑破容器；
   设为 0 后才会真正触发横向滚动，窄屏下不截断 */
.quick-tabs { display: flex; background: var(--primary); border-radius: 10px; padding: 3px; gap: 2px; max-width: 100%; min-width: 0; overflow-x: auto; }
.quick-tabs .qt {
  padding: 6px 16px; border-radius: 8px; font-size: 13px; font-weight: 500;
  color: #fff; background: transparent;                 /* 非当前项：白色文字 */
  white-space: nowrap; flex: 0 0 auto;                  /* 胶囊不被压缩，保持完整 */
  transition: color .2s, background .2s;
}
.quick-tabs .qt:hover  { background: rgba(255,255,255,.18); }                       /* 悬停：底色微亮，文字仍为白 */
.quick-tabs .qt.active { color: var(--primary); background: #fff; font-weight: 600; } /* 当前项：白色背景 + 蓝色文字 */

/* ============ 待办提醒条（首页） ============ */
.alert-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.alert-item {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--warning-light); color: var(--warning);
  border: 1px solid #fde68a; border-radius: 10px; padding: 9px 16px; font-size: 13px;
  transition: all .15s;
}
.alert-item:hover { box-shadow: 0 2px 8px rgba(217,119,6,.2); }
.alert-item b { font-size: 16px; }

/* ============ 回收报价参考提示 ============ */
.f-price-ref { font-size: 11px; color: var(--gray); line-height: 1.35; margin-top: 2px; word-break: break-all; }

/* ============ 登录验证码 ============ */
.captcha-row { display: flex; gap: 10px; align-items: stretch; }
.captcha-row input { flex: 1; min-width: 0; }
.captcha-img { width: 120px; height: 42px; border-radius: 8px; cursor: pointer; border: 1px solid var(--border); background: #f3f6fa; object-fit: cover; flex: 0 0 auto; }

/* ============ 移动端侧边栏 ============ */
.menu-toggle { display: none; }
.sidebar-mask { display: none; }

/* ============ 验机照片 ============ */
.photo-cell { min-width: 130px; }
.photo-tools { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.photo-thumbs { display: flex; flex-wrap: wrap; gap: 6px; }
.photo-thumb { position: relative; width: 52px; height: 52px; border-radius: 6px; overflow: hidden; border: 1px solid var(--border); background: #f8fafc; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.photo-thumb .ph-del { position: absolute; top: -5px; right: -5px; width: 18px; height: 18px; border-radius: 50%; background: var(--danger, #dc2626); color: #fff; font-size: 11px; line-height: 18px; text-align: center; cursor: pointer; border: none; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.photo-view-mask { position: fixed; inset: 0; background: rgba(15,23,42,.85); z-index: 3000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.photo-view-mask .pv-close { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.15); color: #fff; font-size: 20px; line-height: 36px; text-align: center; cursor: pointer; border: none; }
.photo-view-mask img { max-width: 100%; max-height: 100%; border-radius: 6px; }

/* ============ 响应式：平板（横/竖屏） / 手机端 ============ */

/* 双列卡片工具类（首页/统计页并排卡片，小屏自动降单列） */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }

/* 平板/手机：表格列保持内容宽度不换行，总宽超出容器时横向滚动 */
@media (max-width: 1199px) {
  .table { min-width: 100%; }
  .table td { white-space: nowrap; }
}

/* iPad 横屏 / 窄桌面（992~1199px）：消除横向滚动，网格减列（清单详情 4 列） */
@media (min-width: 992px) and (max-width: 1199px) {
  body { min-width: 0; }
  .topbar { padding: 0 16px; }
  .content { padding: 16px; }
  /* 平板横屏：全站统计卡数值统一 20px —— 首页(cols-5)、数据统计(pad-compact)、在库库存/客户档案(.stat-card) 同一字号 */
  .stat-card .stat-value, .stat-card .stat-num { font-size: 20px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  /* iPad 横屏：合并卡 2 列 + 两张各 1 列共 4 列，单卡改为纵向紧凑排版以容纳金额文案 */
  .stat-grid.cols-5 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .stat-grid.cols-5 > .stat-card { position: relative; overflow: hidden; flex-direction: column; align-items: flex-start; padding: 12px 10px; gap: 8px; }
  .stat-grid.cols-5 > .stat-card > .stat-ico {
    position: absolute; top: -4px; left: -4px; z-index: 0;
    width: 36px; height: 36px; flex: none; aspect-ratio: 1 / 1; border-radius: 50%;
  }
  .stat-grid.cols-5 > .stat-card > .stat-ico svg { width: 17px; height: 17px; }
  .stat-grid.cols-5 > .stat-card > div:not(.stat-ico) { position: relative; z-index: 1; padding-left: 32px; } /* 文字避开左上露出的圆弧 */
  /* 合并卡在此尺寸仍保持横向三格，只压缩内边距与字号 */
  .stat-grid.cols-5 > .stat-card-merged { flex-direction: row; align-items: stretch; padding: 0; gap: 0; }
  .stat-grid.cols-5 > .stat-card-merged .merged-cell { padding: 10px 8px; gap: 8px; justify-content: center; text-align: left; }
  .stat-grid.cols-5 > .stat-card-merged .stat-ico { display: none; } /* iPad 横屏：三格隐藏图标，宽度留给文字 */
  .stat-grid.cols-5 > .stat-card-merged .stat-value { font-size: 15px; }
  .stat-grid.cols-5 .stat-label { font-size: 11px; margin-bottom: 2px; }
  .stat-grid.cols-5 .stat-value, .stat-grid.cols-5 .stat-num { font-size: 20px; }
  .stat-grid.cols-5 .stat-sub { font-size: 11px; }
  .stat-cards { grid-template-columns: repeat(3, 1fr); }
  .form-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid.cols-5 { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: repeat(4, 1fr); }
}

/* 首页「最近订单」：时间列与地区列之间留出更明显的间距 */
.table.recent-table th:nth-child(4),
.table.recent-table td:nth-child(4) { padding-left: 26px; }

/* 平板横屏 / 窄桌面（992~1366px，覆盖 iPad 横屏 1024/1180 与 iPad Pro 1366）：
   首页「最近订单」按内容重要度固定列宽并铺满整行，避免各列宽度参差 */
@media (min-width: 992px) and (max-width: 1366px) {
  .table-nowrap .table.recent-table { width: 100%; table-layout: fixed; }
  .table.recent-table th,
  .table.recent-table td { overflow: hidden; text-overflow: ellipsis; }
  .table.recent-table th:nth-child(1), .table.recent-table td:nth-child(1) { width: 18%; } /* 订单号 */
  .table.recent-table th:nth-child(2), .table.recent-table td:nth-child(2) { width: 19%; } /* 回收品类 */
  .table.recent-table th:nth-child(3), .table.recent-table td:nth-child(3) { width: 12%; } /* 回收时间（09-19） */
  .table.recent-table th:nth-child(4), .table.recent-table td:nth-child(4) { width: 21%; } /* 地区（含左侧加大间距） */
  .table.recent-table th:nth-child(5), .table.recent-table td:nth-child(5) { width: 12%; } /* 设备数 */
  .table.recent-table th:nth-child(6), .table.recent-table td:nth-child(6) { width: 18%; } /* 毛利 */
  /* 订单号 / 回收时间 / 设备数 / 毛利（含负数 ¥-7000.00）必须完整可见：不裁剪、不省略号 */
  .table.recent-table th:nth-child(1), .table.recent-table td:nth-child(1),
  .table.recent-table th:nth-child(3), .table.recent-table td:nth-child(3),
  .table.recent-table th:nth-child(5), .table.recent-table td:nth-child(5),
  .table.recent-table th:nth-child(6), .table.recent-table td:nth-child(6) {
    overflow: visible; text-overflow: clip;
  }
}

/* 平板横屏 / 窄桌面（992~1366px）：统计页并排两卡
   「合作伙伴 / 自营对比」与「合作伙伴维度统计」
   两表采用同一套单元格边距与列宽规则，视觉完全对齐；各列按内容宽度完整显示，不出现横向滚动条 */
@media (min-width: 992px) and (max-width: 1366px) {
  /* 列宽改为「按内容自适应」：表头与金额都以自身内容宽度为准，剩余空间再分摊，
     因此各列都能完整显示，不会被百分比固定列宽挤压或省略号截断 */
  .compare-table, .partner-table { width: 100%; min-width: 0; table-layout: auto; }
  /* 单元格留白适度收紧（左右 10px），兼顾完整显示与呼吸感 */
  .compare-table th, .compare-table td,
  .partner-table th, .partner-table td { padding: 9px 10px; font-size: 13px; white-space: nowrap; }
  /* 金额列：等宽数字 + 右对齐，便于纵向对齐比较 */
  .compare-table .num, .partner-table .num { font-variant-numeric: tabular-nums; }
  /* 第 1 列（订单类型 / 合作伙伴）为名称列：保证基本宽度，超长时换行完整展示，不被截断 */
  .compare-table th:nth-child(1), .compare-table td:nth-child(1),
  .partner-table th:nth-child(1), .partner-table td:nth-child(1) {
    min-width: 96px; white-space: normal; overflow-wrap: anywhere; word-break: break-word; line-height: 1.35;
  }
}

/* 平板横屏（触屏设备且宽 ≥992px，覆盖 iPad Pro 12.9 横屏 1366px 等大尺寸平板）：合并卡前三格隐藏图标 */
@media (min-width: 992px) and (pointer: coarse) {
  .stat-grid.cols-5 > .stat-card-merged .stat-ico { display: none; }
  .stat-grid.cols-5 > .stat-card-merged .merged-cell { justify-content: center; text-align: left; }
}

/* 平板（横屏 / 竖屏，触屏且宽 ≥768px）：「登记出售」弹窗各输入控件
   （数量 / 成交小计 / 成交时间 / 备注）统一收窄到 50%，不再顶满弹窗宽度 */
@media (min-width: 768px) and (pointer: coarse) {
  /* 兜底样式：日期时间控件自带内在最小宽度，会挣脱百分比宽度，故同时锁定
     width / max-width 并把 min-width 清零。实际宽度由 JS 按同一测量值写死（priority=important），
     此处不再使用 !important，避免覆盖 JS 写入的内联宽度 */
  .sell-form .form-item input,
  .sell-form .form-item textarea {
    width: 50%;
    max-width: 50%;
    min-width: 0;
    box-sizing: border-box;
    align-self: flex-start;
  }
}

/* 数据统计页卡片：仅在平板横屏时，图标改为左上角圆形露头（与首页卡片一致），其他尺寸保持原样 */
/* ① iPad 横屏 992~1199px：与首页同尺寸 —— 圆形 36px、图标 17px、文字左让 32px，纵向紧凑 */
@media (min-width: 992px) and (max-width: 1199px) {
  .stat-grid.pad-compact > .stat-card { position: relative; overflow: hidden; flex-direction: column; align-items: flex-start; padding: 12px 10px; gap: 8px; }
  .stat-grid.pad-compact > .stat-card > .stat-ico { position: absolute; top: -4px; left: -4px; z-index: 0; width: 36px; height: 36px; flex: none; aspect-ratio: 1 / 1; border-radius: 50%; }
  .stat-grid.pad-compact > .stat-card > .stat-ico svg { width: 17px; height: 17px; }
  .stat-grid.pad-compact > .stat-card > div:not(.stat-ico) { position: relative; z-index: 1; padding-left: 32px; }
  .stat-grid.pad-compact .stat-label { font-size: 11px; margin-bottom: 2px; }
  .stat-grid.pad-compact .stat-value { font-size: 20px; }
  .stat-grid.pad-compact .stat-sub { font-size: 11px; }
  /* 平板横屏：金额类(长文本)再缩小一档，与桌面端 .is-wide/.is-narrow 的用意一致 */
  .stat-value.is-wide { font-size: 15px; }
  .stat-value.is-narrow { font-size: 13px; }
}
/* ② 大尺寸平板横屏（触屏且 ≥1200px，如 iPad Pro 12.9 横屏 1366px）：与首页同尺寸 —— 圆形 48px、图标 22px、文字左让 42px */
@media (min-width: 1200px) and (pointer: coarse) {
  .stat-grid.pad-compact > .stat-card { position: relative; overflow: hidden; padding-left: 42px; }
  .stat-grid.pad-compact > .stat-card > .stat-ico { position: absolute; top: -6px; left: -6px; z-index: 0; width: 48px; height: 48px; flex: none; aspect-ratio: 1 / 1; border-radius: 50%; }
  .stat-grid.pad-compact > .stat-card > .stat-ico svg { width: 22px; height: 22px; }
  .stat-grid.pad-compact > .stat-card > div:not(.stat-ico) { position: relative; z-index: 1; }
}

/* 平板竖屏 / 手机（≤991px）：侧边栏变抽屉 */
@media (max-width: 991px) {
  body { min-width: 0; }
  .layout { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 1200; width: 240px; transform: translateX(-100%); transition: transform .25s ease; box-shadow: 4px 0 20px rgba(15,23,42,.18); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-mask { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 1190; opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; }
  .sidebar-mask.show { opacity: 1; visibility: visible; }
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 8px; background: #fff; font-size: 16px; cursor: pointer; color: #0f172a; flex: 0 0 auto; }
  .topbar { padding: 0 12px; }
  .topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
  /* 窄屏：标题过长自行省略，横向空间优先给右侧按钮，避免把「退出登录」挤到换行 */
  .topbar-left .page-title { font-size: 17px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-right { gap: 8px; }
  .content { padding: 12px 12px 30px; }
  .page-head { flex-wrap: wrap; gap: 8px; }
  .page-actions { flex-wrap: wrap; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-grid.cols-5 { grid-template-columns: repeat(2, 1fr); }
  /* 平板竖屏 / 手机：全站统计卡数值统一 20px —— 首页、数据统计、在库库存、客户档案同一字号 */
  .stat-card .stat-value, .stat-card .stat-num { font-size: 20px; }
  /* 数据统计页卡片图标仅在手机端改为左上角圆形露头（见 ≤767px 规则）；
     平板竖屏（768~991px）与桌面端保持一致：图标正常显示在文字左侧 */
  .stat-cards { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .form-grid, .form-grid.cols-2, .form-grid.cols-5 { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .detail-grid { grid-template-columns: repeat(3, 1fr); } /* iPad 竖屏：清单详情 3 列 */
  .grid-2 { grid-template-columns: 1fr; }
  .filter-bar { padding: 12px; }
  .filter-row { gap: 8px; }
  .filter-item { width: 100%; }
  .filter-actions { padding-top: 2px; }
  .totals-bar { flex-wrap: wrap; gap: 8px; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .modal-mask { padding: 10px; align-items: flex-end; }
  .modal { max-height: 92vh; max-width: 100%; overflow-y: auto; border-radius: 14px 14px 0 0; }
  .modal-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .tb-user .hide-m, .tb-user .real-name { display: none; }
  .dict-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
}

/* iPad 竖屏（768~991px）细分：筛选项两列排列，更紧凑 */
@media (min-width: 768px) and (max-width: 991px) {
  .filter-item { width: calc(50% - 6px); }
  .filter-actions { padding-top: 19px; }
}

/* iPad 竖屏（768~991px，触屏）：订单详情主信息 5 列（覆盖上面的 3 列，屏宽足够容纳） */
@media (min-width: 768px) and (max-width: 991px) and (pointer: coarse) {
  .detail-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
  .detail-item { padding: 10px 12px; }
  .detail-item .dv { font-size: 14px; }
}

/* 手机端（≤767px，含手机横屏） */
@media (max-width: 767px) {
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .form-grid, .form-grid.cols-2, .form-grid.cols-5 { grid-template-columns: 1fr; }
  /* 手机端筛选项两列排列（含订单列表等筛选区） */
  .filter-item { width: calc(50% - 4px); }
  /* 手机端：标记为 full 的筛选项（如在库库存的「型号」）独占一整行，输入框随屏宽铺满 */
  .filter-item.full { width: 100%; }
  .filter-item input:not([type="hidden"]), .filter-item select, .filter-item textarea,
  .filter-item .flex, .filter-item .ui-select { width: 100%; box-sizing: border-box; }
  .filter-item .flex { display: flex; align-items: center; gap: 4px; }
  .filter-item .flex > * { flex: 1 1 0; min-width: 0; }
  .filter-actions { width: 100%; }
  /* 手机端：与筛选项上下堆叠的按钮行（如客户档案的「手机号 → 查询/清空」）与上方输入框留出间距，
     与订单列表等页面按钮行的 12px 堆叠间距保持一致 */
  .filter-bar form > .filter-actions { margin-top: 12px; }
  .filter-actions .btn { flex: 1; }
  .filter-toggle { width: 100%; justify-content: center; margin-top: 10px; }
  .topbar-right .tb-scope { display: none; }
  /* 手机端：顶栏优先显示账号名称（名称 · 角色）与「退出登录」；「修改密码」为低频操作，手机端隐藏 */
  .tb-chpwd { display: none; }
  /* 手机端卡片头左右内边距收窄（原 20px），为内容让出横向空间 */
  .card-head { flex-wrap: wrap; gap: 8px; padding: 12px 14px; }
  /* 订单列表卡片头：手机端分两行 ——
     第 1 行「订单标题 + 新增回收订单」，第 2 行「快捷筛选胶囊组占满宽，超出可横滑」 */
  .ch-right { display: contents; }   /* 让胶囊组与按钮直接参与 card-head 布局，才能分到不同行 */
  .card-title { flex: 1 1 auto; min-width: 0; }
  .ch-right > .btn { order: 2; width: auto; margin-left: auto; }   /* 与标题同行、靠右 */
  .quick-tabs { order: 3; width: 100%; }                           /* 独占第 2 行 */
  /* 胶囊紧凑化：让 5 个筛选项在最窄 360px 手机上也能一行完整显示，无需横向滑动。
     实测宽度：44+56+56+68+56=280px 胶囊 + 8px 间距 + 6px 容器内边距 ≈ 294px，
     360px 屏扣除页面 24px 与卡片头 28px 后可用约 308px，可容纳 */
  .quick-tabs .qt { padding: 5px 10px; font-size: 12px; }
  .city-switch { max-width: 100%; justify-content: flex-start; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .table th, .table td { padding: 8px 10px; }
  /* 手机端：操作内容列收窄，避免长文本把整表撑得过宽 */
  .table-nowrap .table td.log-content { max-width: 240px; min-width: 160px; font-size: 11px; }
  /* 手机端：统计页两表进一步收紧，5 列完整显示，名称列保证基本宽度 */
  .compare-table th, .compare-table td,
  .partner-table th, .partner-table td { padding: 8px 6px; font-size: 11px; }
  .compare-table th:nth-child(1), .compare-table td:nth-child(1),
  .partner-table th:nth-child(1), .partner-table td:nth-child(1) { min-width: 68px; }
  .rank-row { padding: 8px 0; } /* 与表格行同步收窄（td 上下 padding 8px） */
  /* 手机端竖屏：整行水平居中，且强制单行不换行（超出则横向滚动）；间距略收窄以适配窄屏 */
  .pagination { justify-content: center; overflow-x: auto; flex-wrap: nowrap; gap: 4px; }
  .pagination .pg-info { margin-right: 4px; }
  /* 手机端：页码只显示 3 个（当前页 ±1），避免 5 个页码挤压/换行 */
  .pagination .pg-nums-5 { display: none; }
  .pagination .pg-nums-3 { display: flex; }
  .rank-name { width: 90px; }
  .rank-val { width: 84px; font-size: 11px; }
  .bar-chart { --trend-days: 7; } /* 手机端窗口收窄为 7 天，保证柱宽与日期可读 */
  /* 手机端：前三项（今日订单 / 今日回收设备 / 今日回收金额）仍占一行，只压缩内边距与字号；后两项各半行 */
  .stat-grid.cols-5 > .stat-card-merged { flex-direction: row; align-items: stretch; padding: 0; gap: 0; }
  .stat-grid.cols-5 > .stat-card-merged .merged-cell { padding: 10px 6px; gap: 6px; }
  .stat-grid.cols-5 > .stat-card-merged .merged-cell + .merged-cell { border-left: 0; border-top: 0; }
  .stat-grid.cols-5 > .stat-card-merged .merged-cell + .merged-cell::before { top: 8px; bottom: 8px; }
  .stat-grid.cols-5 > .stat-card-merged .stat-ico { width: 28px; height: 28px; border-radius: 8px; }
  /* 手机端：首页所有卡片数值统一 18px —— 合并卡（今日订单/今日回收设备/今日回收金额）
     与右侧的在库预警、累计回收金额数值字号保持一致 */
  .stat-grid.cols-5 .stat-value, .stat-grid.cols-5 .stat-num { font-size: 18px; }
  .stat-grid.cols-5 > .stat-card-merged .merged-cell .stat-value { font-size: 18px; }
  /* 手机端：全站统计卡数值统一 18px —— 首页、数据统计、在库库存、客户档案的卡片数值同一字号
     （含金额类的 .is-wide / .is-narrow，桌面端才单独缩小） */
  .stat-card .stat-value, .stat-card .stat-num { font-size: 18px; }
  /* 手机端：数据统计页卡片图标与其它页面统一 —— 左上角圆形露头（48px / 图标 22px / 文字左让 42px） */
  .stat-grid.pad-compact > .stat-card { position: relative; overflow: hidden; padding: 16px 16px 16px 42px; }
  .stat-grid.pad-compact > .stat-card > .stat-ico {
    position: absolute; top: -6px; left: -6px; z-index: 0;
    width: 48px; height: 48px; flex: none; aspect-ratio: 1 / 1; border-radius: 50%;
  }
  .stat-grid.pad-compact > .stat-card > .stat-ico svg { width: 22px; height: 22px; }
  .stat-grid.pad-compact > .stat-card > div:not(.stat-ico) { position: relative; z-index: 1; }
  /* 手机端：首页单卡（在库超期预警 / 累计回收金额）图标改为左上角圆形露头
     （48px / 图标 22px / 文字左让 42px），窄屏下横向空间留给文字 */
  .stat-grid.cols-5 > .stat-card { position: relative; overflow: hidden; padding: 16px 16px 16px 42px; }
  .stat-grid.cols-5 > .stat-card > .stat-ico {
    position: absolute; top: -6px; left: -6px; z-index: 0;
    width: 48px; height: 48px; flex: none; aspect-ratio: 1 / 1; border-radius: 50%;
  }
  .stat-grid.cols-5 > .stat-card > .stat-ico svg { width: 22px; height: 22px; }
  .stat-grid.cols-5 > .stat-card > div:not(.stat-ico) { position: relative; z-index: 1; }

  .stat-grid.cols-5 > .stat-card:last-child { grid-column: span 1; } /* 在库预警与累计回收金额并排一行 */
  /* 整单汇总：手机端每项独占一行（横排会挤成不对齐的两行，纵向列表更易读） */
  .totals-bar { flex-direction: column; flex-wrap: nowrap; align-items: flex-start; gap: 10px; overflow-x: auto; }
  /* 单项内部禁止折行：「整单总回收金额：¥8300.00+21.00（燃油费）」必须同行显示；
     宽度不足时由汇总条整体横向滚动，而不是把金额拆到下一行 */
  .totals-bar .t-item { flex: none; flex-wrap: nowrap; }
  .totals-bar .t-label,
  .totals-bar .t-value,
  .totals-bar .t-note { white-space: nowrap; }
  .totals-bar .t-value { font-size: 16px; }
  .content { padding-bottom: calc(30px + env(safe-area-inset-bottom)); }
}

/* 手机竖屏（≤480px） */
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  /* 手机端：首页最后一张卡（累计回收金额）与在库预警并排，只占半行 */
  .stat-grid.cols-5 > .stat-card:last-child { grid-column: span 1; }
  /* 手机端卡片窄：圆弧与留白同步缩小，保证文字仍有足够宽度 */
  .stat-grid.cols-5 > .stat-card { padding: 12px 12px 12px 34px; }
  .stat-grid.cols-5 > .stat-card > .stat-ico { top: -4px; left: -4px; width: 38px; height: 38px; }
  .stat-grid.cols-5 > .stat-card > .stat-ico svg { width: 19px; height: 19px; }
  /* 手机竖屏：三格更窄，图标与字号再缩一档，保证金额不折行 */
  .stat-grid.cols-5 > .stat-card-merged { padding: 0; }
  .stat-grid.cols-5 > .stat-card-merged .merged-cell { padding: 10px 4px; gap: 4px; justify-content: center; text-align: left; }
  .stat-grid.cols-5 > .stat-card-merged .stat-ico { display: none; } /* 手机竖屏：三格隐藏图标 */
  /* 与其它卡片同位置保持一致：标题 12px、副行 11px（手机端不再单独缩小合并卡文字） */
  .stat-grid.cols-5 > .stat-card-merged .stat-label { font-size: 12px; }
  .stat-grid.cols-5 > .stat-card-merged .merged-cell .stat-value { font-size: 18px; } /* 与其他卡片数值同字号 */
  .stat-grid.cols-5 > .stat-card-merged .stat-sub { font-size: 11px; }
  /* 手机竖屏：数据统计页卡片圆弧同步缩小（38px / 图标 19px / 文字左让 34px），与其它页面一致 */
  .stat-grid.pad-compact > .stat-card { padding: 12px 12px 12px 34px; }
  .stat-grid.pad-compact > .stat-card > .stat-ico { top: -4px; left: -4px; width: 38px; height: 38px; }
  .stat-grid.pad-compact > .stat-card > .stat-ico svg { width: 19px; height: 19px; }
  .stat-card { padding: 12px; }
  .stat-ico { width: 38px; height: 38px; }
  .stat-value, .stat-num { font-size: 18px; }
  .detail-grid { grid-template-columns: repeat(2, 1fr); } /* 手机端：订单详情 2 列 */
  /* 整单汇总：窄屏收字号留宽，「整单总回收金额：¥8300.00+21.00（燃油费）」不折行也不必滚动 */
  .totals-bar { padding: 12px 14px; }
  .totals-bar .t-item { gap: 4px; }
  .totals-bar .t-label { font-size: 12px; }
  .totals-bar .t-value { font-size: 15px; }
  .totals-bar .t-note { font-size: 12px; margin-left: 2px; }
  /* 手机端：主信息默认折叠，仅显示约 4 行（≈50% 高度），底部渐隐提示可展开 */
  .detail-grid.is-collapsed { position: relative; max-height: 292px; overflow: hidden; margin-bottom: 8px; }
  .detail-grid.is-collapsed::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 36px;
    background: linear-gradient(to bottom, rgba(255,255,255,0), #fff); pointer-events: none;
  }
  .detail-toggle {
    display: block; width: 100%; margin: 0 0 18px; padding: 9px 0;
    font-size: 13px; font-weight: 600; color: var(--primary);
    background: var(--primary-light); border: 1px dashed var(--primary); border-radius: 8px;
    cursor: pointer; user-select: none;
  }
  .detail-toggle:hover { opacity: .85; }
  .detail-item { padding: 10px 12px; }
  .topbar-left .page-title { font-size: 15px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* 手机竖屏：顶栏保留账号名称（闪收虾（超级管理员）），字号收窄一档并强制单行，避免挤压/换行 */
  .tb-user { font-size: 12px; white-space: nowrap; }
  .modal-head { padding: 12px 16px; }
  .modal-body { padding: 14px; }
  .login-box { width: 92%; padding: 30px 20px 26px; }
  .brand-name { word-break: break-all; }
}

/* 小平板 / 手机横屏（600~767px）：首页卡片排成 2 行（合并卡整行 + 预警/累计回收金额各半行）
   注：768~991px（iPad 竖屏）已与 iPad 横屏统一，见下方独立规则 */
@media (min-width: 600px) and (max-width: 767px) {
  /* iPad 竖屏：分 2 行 —— 第 1 行合并卡占满整行，第 2 行在库预警 + 累计回收金额各占半行 */
  .stat-grid.cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-grid.cols-5 > .stat-card-merged { grid-column: span 2; }
  .stat-grid.cols-5 > .stat-card:last-child { grid-column: span 1; }
  /* 整行宽度充足，合并卡恢复横向三格（覆盖手机端的纵向堆叠与横向分隔线） */
  .stat-grid.cols-5 > .stat-card-merged { flex-direction: row; align-items: stretch; padding: 0; gap: 0; }
  .stat-grid.cols-5 > .stat-card-merged .merged-cell { padding: 12px 16px; }
  .stat-grid.cols-5 > .stat-card-merged .merged-cell + .merged-cell { border-left: 0; border-top: 0; }
  .stat-grid.cols-5 > .stat-card-merged .merged-cell + .merged-cell::before { top: 12px; bottom: 12px; }
}

/* iPad 竖屏（768~991px）：首页统计卡与 iPad 横屏（992~1199px）完全一致 ——
   4 列栅格（合并卡占 2 列 + 在库预警 + 累计回收金额），单卡纵向紧凑排版 + 左上角圆形露头图标（36px），
   标题 12px / 数值 22px / 副行 11px，合并卡横向三格并隐藏图标 */
@media (min-width: 768px) and (max-width: 991px) {
  .stat-grid.cols-5 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .stat-grid.cols-5 > .stat-card { position: relative; overflow: hidden; flex-direction: column; align-items: flex-start; padding: 12px 10px; gap: 8px; }
  .stat-grid.cols-5 > .stat-card > .stat-ico {
    position: absolute; top: -4px; left: -4px; z-index: 0;
    width: 36px; height: 36px; flex: none; aspect-ratio: 1 / 1; border-radius: 50%;
  }
  .stat-grid.cols-5 > .stat-card > .stat-ico svg { width: 17px; height: 17px; }
  .stat-grid.cols-5 > .stat-card > div:not(.stat-ico) { position: relative; z-index: 1; padding-left: 32px; }
  .stat-grid.cols-5 > .stat-card-merged { grid-column: span 2; flex-direction: row; align-items: stretch; padding: 0; gap: 0; }
  .stat-grid.cols-5 > .stat-card-merged .merged-cell { padding: 10px 8px; gap: 8px; justify-content: center; text-align: left; }
  .stat-grid.cols-5 > .stat-card-merged .stat-ico { display: none; }
  .stat-grid.cols-5 > .stat-card-merged .stat-value { font-size: 20px; }
  .stat-grid.cols-5 > .stat-card:last-child { grid-column: span 1; }
  /* iPad 竖屏单卡：首页(cols-5) 与 数据统计(pad-compact)/在库库存/客户档案 统一 20px，标题 12px / 副行 11px */
  .stat-grid.cols-5 .stat-label { font-size: 12px; margin-bottom: 2px; }
  .stat-grid.cols-5 .stat-value, .stat-grid.cols-5 .stat-num { font-size: 20px; }
  .stat-grid.cols-5 .stat-sub { font-size: 11px; }
  /* 平板竖屏：金额类(长文本)再缩小一档 */
  .stat-value.is-wide { font-size: 15px; }
  .stat-value.is-narrow { font-size: 13px; }
}

/* ============ 日期选择器（内置日历，点击文本框弹出） ============ */
input.datepicker {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2398a2b3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 15px;
  padding-right: 34px;
}
.dp-panel {
  position: absolute; z-index: 1200; width: 264px; background: #fff;
  border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(15,23,42,.15); padding: 12px; font-size: 13px;
}
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dp-title { font-weight: 600; font-size: 14px; }
.dp-nav { border: 1px solid var(--border); background: #fff; border-radius: 8px; width: 26px; height: 26px; cursor: pointer; font-size: 16px; line-height: 1; color: var(--gray); padding: 0; }
.dp-nav:hover { background: var(--primary-light); color: var(--primary); }
.dp-foot { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 8px; text-align: center; }
.dp-clear { border: none; background: none; color: var(--gray); font-size: 12px; cursor: pointer; padding: 4px 10px; border-radius: 6px; }
.dp-clear:hover { background: var(--gray-light); color: var(--danger); }
.dp-week, .dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-week span { text-align: center; color: var(--gray); font-size: 11px; padding: 4px 0; }
.dp-cell { text-align: center; padding: 6px 0; border-radius: 8px; cursor: pointer; line-height: 1; }
.dp-cell:hover { background: var(--primary-light); color: var(--primary); }
.dp-cell.other { color: #c5c9d4; }
.dp-cell.today { color: var(--primary); font-weight: 700; }
.dp-cell.sel { background: var(--primary); color: #fff; font-weight: 700; }

/* ============================================================
   全局滚动条统一：细条 + 淡灰，悬停略深（表格 / 趋势图 / 弹窗 /
   下拉菜单 / 标签页 / 分页等所有滚动容器一致）
   ============================================================ */
:is(.table-wrap, .bar-chart, .modal, .ui-select__menu, .dict-tabs, .pagination) {
  scrollbar-width: thin;                        /* Firefox */
  scrollbar-color: var(--sb-thumb) transparent;
}
:is(.table-wrap, .bar-chart, .modal, .ui-select__menu, .dict-tabs, .pagination)::-webkit-scrollbar {
  width: 8px; height: 6px;                     /* 纵向 8px，横向 6px */
}
:is(.table-wrap, .bar-chart, .modal, .ui-select__menu, .dict-tabs, .pagination)::-webkit-scrollbar-track {
  background: transparent;
}
:is(.table-wrap, .bar-chart, .modal, .ui-select__menu, .dict-tabs, .pagination)::-webkit-scrollbar-thumb {
  background: var(--sb-thumb); border-radius: 3px;
}
:is(.table-wrap, .bar-chart, .modal, .ui-select__menu, .dict-tabs, .pagination)::-webkit-scrollbar-thumb:hover {
  background: var(--sb-thumb-hover);
}
/* 触屏/移动端：滚动条更淡更细，避免抢视觉 */
@media (max-width: 767px), (pointer: coarse) {
  :is(.table-wrap, .bar-chart, .modal, .ui-select__menu, .dict-tabs, .pagination)::-webkit-scrollbar { width: 6px; height: 4px; }
  :is(.table-wrap, .bar-chart, .modal, .ui-select__menu, .dict-tabs, .pagination)::-webkit-scrollbar-thumb { background: rgba(37,99,235,.16); }
}
