/* test58api 后台基础样式（Bootstrap-like 轻量）紧凑版 */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 13px; color: #333; background: #f0f2f5; }

/* 布局 */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 220px;
  background: linear-gradient(180deg, #0f172a 0%, #1e1b4b 60%, #312e81 100%);
  color: #fff;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  box-shadow: 2px 0 16px rgba(15, 23, 42, .35);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.2) transparent;
}
.admin-sidebar::-webkit-scrollbar { width: 4px; }
.admin-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 4px; }
.admin-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* 侧边栏 */
.sidebar-brand {
  padding: 18px 18px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .5px;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(180deg, rgba(255,255,255,.06), transparent);
}
.sidebar-brand::before {
  content: '';
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  box-shadow: 0 2px 10px rgba(99, 102, 241, .5);
  flex-shrink: 0;
}
.sidebar-brand .brand-text {
  background: linear-gradient(90deg, #e0e7ff, #c7d2fe);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.sidebar-nav { padding: 8px 10px 16px; flex: 1; }

/* ---- 一级分区：业务工作区 / 系统设置 ---- */
.nav-section { padding-bottom: 4px; }
.nav-section-title {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 8px 7px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.1px;
  color: rgba(199, 210, 254, .55);
  text-transform: uppercase;
}
.nav-section-title::before {
  content: '';
  width: 3px; height: 11px; border-radius: 2px;
  background: linear-gradient(180deg, #818cf8, #a78bfa);
  box-shadow: 0 0 6px rgba(129, 140, 248, .7);
  flex-shrink: 0;
}
.nav-section-title::after {
  content: '';
  flex: 1; height: 1px;
  background: linear-gradient(90deg, rgba(129,140,248,.35), transparent);
}
/* 低频分区：整体降权 + 顶部分隔线，视觉上明确"次级区" */
.nav-section-sub {
  margin-top: 10px;
  padding-top: 4px;
  border-top: 1px solid rgba(255,255,255,.09);
}
.nav-section-sub .nav-section-title { color: rgba(255,255,255,.34); }
.nav-section-sub .nav-section-title::before { background: rgba(255,255,255,.22); box-shadow: none; }
.nav-section-sub .nav-section-title::after { background: linear-gradient(90deg, rgba(255,255,255,.10), transparent); }
.nav-section-fold {
  flex: 0 0 auto; margin-left: 4px;
  padding: 1px 7px; border: 1px solid rgba(255,255,255,.14); border-radius: 10px;
  background: transparent; color: rgba(255,255,255,.42);
  font-size: 10px; line-height: 16px; letter-spacing: .5px;
  cursor: pointer; transition: all .15s;
}
.nav-section-fold:hover { color: #fff; border-color: rgba(255,255,255,.34); background: rgba(255,255,255,.08); }

/* ---- 二级分区：可折叠分组 ---- */
.nav-group { margin: 1px 0; }
.nav-group-btn,
.nav-sub-btn {
  display: flex; align-items: center; gap: 7px; width: 100%;
  padding: 7px 10px; margin: 2px 0;
  border: none; border-radius: 7px; background: transparent;
  color: rgba(255,255,255,.72);
  font-family: inherit; font-size: 12px; font-weight: 600; letter-spacing: .3px;
  text-align: left; cursor: pointer; transition: background .15s, color .15s;
}
.nav-group-btn:hover,
.nav-sub-btn:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav-group-name, .nav-sub-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-group-count {
  flex: 0 0 auto; min-width: 18px; padding: 0 5px;
  border-radius: 9px; background: rgba(255,255,255,.10);
  color: rgba(255,255,255,.55);
  font-size: 10px; font-weight: 500; line-height: 16px; text-align: center;
}
.nav-group-arrow {
  flex: 0 0 auto; width: 6px; height: 6px;
  margin-right: 2px; margin-top: -2px;
  border-right: 1.5px solid rgba(255,255,255,.45);
  border-bottom: 1.5px solid rgba(255,255,255,.45);
  transform: rotate(45deg);
  transition: transform .18s ease, border-color .15s;
}
.nav-group-btn[aria-expanded="false"] .nav-group-arrow,
.nav-sub-btn[aria-expanded="false"] .nav-group-arrow { transform: rotate(-45deg); }
.nav-group-btn:hover .nav-group-arrow,
.nav-sub-btn:hover .nav-group-arrow { border-color: #fff; }
/* 当前页所在分组：标题常亮，便于快速定位 */
.nav-group.is-current > .nav-group-btn { color: #fff; background: rgba(99,102,241,.16); }
.nav-group.is-current > .nav-group-btn .nav-group-count { background: rgba(129,140,248,.35); color: #e0e7ff; }
.nav-group.is-current > .nav-group-btn .nav-group-arrow { border-color: #c7d2fe; }

/* 三级：分组内条目（含订单"按状态筛选"子折叠） */
.nav-group-body { padding: 1px 0 3px; }
/* 默认收起由属性驱动，JS 未执行时也能保持正确形态 */
[data-nav-open="0"] > .nav-group-body { display: none; }
.nav-sub { margin: 0; }
.nav-sub-btn { padding-left: 22px; font-size: 11.5px; font-weight: 500; color: rgba(255,255,255,.55); }
.nav-sub-btn:hover { color: rgba(255,255,255,.9); }

/* 低频分区分组：更沉的文字与更弱的计数 */
.nav-group-muted .nav-group-btn { color: rgba(255,255,255,.52); font-size: 11.5px; }
.nav-group-muted .nav-group-btn:hover { color: #fff; }
.nav-group-muted .nav-group-count { background: rgba(255,255,255,.07); color: rgba(255,255,255,.4); }

.nav-divider { height: 1px; margin: 10px 8px; background: rgba(255,255,255,.07); }

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 14px;
  margin: 1px 0;
  border-radius: 7px;
  color: rgba(255,255,255,.6);
  text-decoration: none;
  font-size: 12.5px;
  transition: color .15s, background .15s, box-shadow .15s;
}
.nav-item .nav-ico { width: 17px; text-align: center; font-size: 13px; opacity: .78; flex-shrink: 0; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-item:hover .nav-ico { opacity: 1; }
.nav-item.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(99,102,241,.95), rgba(139,92,246,.6));
  box-shadow: 0 3px 12px rgba(99, 102, 241, .35), inset 2px 0 0 #c7d2fe;
  font-weight: 600;
}
.nav-item.active .nav-ico { opacity: 1; }
.nav-item.active::after {
  content: '';
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 7px #fff;
}
/* 仪表盘入口：始终置顶、比普通条目略突出 */
.nav-item-lead { font-size: 13px; font-weight: 600; color: rgba(255,255,255,.8); margin-bottom: 2px; }
/* 三级条目（订单状态）：缩进 + 更小字号，弱于主条目 */
.nav-item-sub { padding: 6px 12px 6px 24px; font-size: 12px; color: rgba(255,255,255,.52); }
.nav-item-sub .nav-ico { width: 15px; font-size: 12px; opacity: .6; }
.nav-item-sub:hover { color: #fff; }
.nav-item-sub.active { font-weight: 600; box-shadow: 0 3px 12px rgba(99,102,241,.3), inset 2px 0 0 #c7d2fe; }

/* 顶栏 */
.admin-header { height: 44px; background: #fff; border-bottom: 1px solid #e8e8e8; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; position: sticky; top: 0; z-index: 100; }
.header-title { font-size: 14px; font-weight: 600; margin-right: auto; }
.header-user { display: flex; align-items: center; gap: 10px; }
.btn-logout { color: #1677ff; text-decoration: none; font-size: 12px; }

/* 内容区 */
.admin-content { padding: 12px; flex: 1; }

/* 卡片 */
.card { background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.05); padding: 12px 14px; margin-bottom: 12px; }
.card-title { font-size: 14px; font-weight: 600; margin-bottom: 8px; }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.stat-card { background: #fff; border-radius: 8px; padding: 12px 14px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.stat-card .num { font-size: 26px; font-weight: 700; color: #1677ff; }
.stat-card .label { font-size: 12px; color: #888; margin-top: 2px; }

/* 表格 */
.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; min-width: 0; }
.table-scroll .table { min-width: 760px; }
.table th { background: #fafafa; text-align: left; padding: 7px 10px; font-size: 12px; color: #555; border-bottom: 1px solid #f0f0f0; white-space: nowrap; }
.table td { padding: 6px 10px; border-bottom: 1px solid #f5f5f5; font-size: 12px; white-space: nowrap; }
.table tr:hover td { background: #fafafa; }
.table .text-right { text-align: right; }

/* 按钮 */
.btn { display: inline-block; padding: 5px 12px; border-radius: 5px; font-size: 12px; border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: all .15s; background: #fff; line-height: 1.5; }
.btn-primary { background: #1677ff; color: #fff; } .btn-primary:hover { background: #0958d9; }
.btn-success { background: #52c41a; color: #fff; } .btn-success:hover { background: #389e0d; }
.btn-danger { background: #ff4d4f; color: #fff; } .btn-danger:hover { background: #cf1322; }
.btn-warning { background: #faad14; color: #fff; } .btn-warning:hover { background: #d48806; }
.btn-default { background: #fff; border-color: #d9d9d9; color: #333; } .btn-default:hover { border-color: #1677ff; color: #1677ff; }
.btn-sm { padding: 3px 8px; font-size: 11px; }
.btn-ghost { background: transparent; color: #1677ff; border-color: #1677ff; } .btn-ghost:hover { background: #e6f4ff; }
.btn-xs { padding: 2px 6px; font-size: 11px; }

/* 徽章 */
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; }
.badge-pending { background: #fff7e6; color: #d48806; }
.badge-warehoused { background: #e6f4ff; color: #0958d9; }
.badge-shipped { background: #f6ffed; color: #389e0d; }
.badge-returned { background: #fff2f0; color: #cf1322; }
.badge-completed { background: #f0f0f0; color: #595959; }
.badge-draft { background: #f5f5f5; color: #999; }

/* 表单 */
.form-group { margin-bottom: 8px; }
.form-group label { display: block; font-size: 12px; color: #555; margin-bottom: 3px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; height: 30px; border: 1px solid #d9d9d9; border-radius: 5px; padding: 0 8px; font-size: 13px; outline: none; }
.form-group textarea { height: auto; padding: 6px 8px; resize: vertical; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: #1677ff; box-shadow: 0 0 0 2px rgba(22,119,255,.1); }
.form-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 12px; }
.fee-row { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
/* 字段名:值 行内横排 */
.kv-inline { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.kv-item { display: inline-flex; align-items: baseline; gap: 4px; font-size: 13px; line-height: 1.8; }
.kv-label { color: #888; white-space: nowrap; }
.kv-value { color: #333; word-break: break-all; }

/* 编辑页：字段名在前、字段值在后（横排） */
.form-group-inline { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.form-group-inline label { flex-shrink: 0; font-size: 12px; color: #555; margin-bottom: 0; white-space: nowrap; min-width: 72px; text-align: right; }
.form-group-inline .form-control-wrap { flex: 1; min-width: 0; }
.form-group-inline input, .form-group-inline select, .form-group-inline textarea { width: 100%; height: 30px; border: 1px solid #d9d9d9; border-radius: 5px; padding: 0 8px; font-size: 13px; outline: none; }
.form-group-inline textarea { height: auto; padding: 6px 8px; resize: vertical; }
.form-group-inline input:focus, .form-group-inline select:focus, .form-group-inline textarea:focus { border-color: #1677ff; box-shadow: 0 0 0 2px rgba(22,119,255,.1); }
@media (max-width: 992px) { .form-row { grid-template-columns: repeat(2, 1fr); } }

/* 筛选区 */
.filter-bar { background: #fff; border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.05); display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; }
.filter-bar .form-group { margin-bottom: 0; min-width: 140px; }
.filter-bar .form-group label { font-size: 11px; }

/* ===== 可搜索下拉框（combo-box）：搜索框内嵌在下拉面板中 ===== */
/* 原生 select 透明覆盖在控件上：值照常提交，required 校验气泡正好落在控件位置 */
.combo-box .combo-native {
  position: absolute !important; top: 0 !important; left: 0 !important;
  width: 100% !important; height: 100% !important; min-height: 0 !important;
  opacity: 0 !important; pointer-events: none !important; border: 0 !important;
  padding: 0 !important; margin: 0 !important; z-index: 0 !important; -webkit-appearance: none; appearance: none;
}

.combo-box { position: relative; width: 100%; }
.combo-box .combo-control {
  position: relative; z-index: 1;
  width: 100%; height: 30px; display: flex; align-items: center; justify-content: space-between; gap: 6px;
  background: #fff; border: 1px solid #d9d9d9; border-radius: 5px; padding: 0 8px; font-size: 13px;
  color: #333; cursor: pointer; text-align: left; line-height: 1.4; outline: none; font-family: inherit;
}
.combo-box .combo-control:hover { border-color: #1677ff; }
.combo-box.is-open .combo-control { border-color: #1677ff; box-shadow: 0 0 0 2px rgba(22,119,255,.12); }
.combo-box .combo-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-box .combo-text.is-placeholder { color: #bbb; font-weight: 400; }
.combo-box .combo-arrow { flex-shrink: 0; font-size: 10px; color: #999; transition: transform .15s; }
.combo-box.is-open .combo-arrow { transform: rotate(180deg); }

.combo-box .combo-panel {
  position: absolute; left: 0; right: 0; z-index: 900; background: #fff; border: 1px solid #e3e8ef;
  border-radius: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.14); overflow: hidden;
}
.combo-box .combo-panel-up { box-shadow: 0 -6px 20px rgba(0,0,0,.14); }

.combo-box .combo-search { display: flex; align-items: center; gap: 6px; padding: 6px; border-bottom: 1px solid #f0f0f0; background: #fafbfc; }
.combo-box .combo-search-icon { font-size: 11px; font-style: normal; opacity: .55; flex-shrink: 0; }
.combo-box .combo-search-input {
  flex: 1; width: 100%; height: 26px; border: 1px solid #e3e8ef; border-radius: 4px; padding: 0 7px;
  font-size: 12px; outline: none; background: #fff; font-family: inherit;
}
.combo-box .combo-search-input:focus { border-color: #1677ff; box-shadow: 0 0 0 2px rgba(22,119,255,.1); }

.combo-box .combo-list { overflow-y: auto; padding: 4px 0; }
.combo-box .combo-item {
  display: flex; align-items: center; gap: 6px; padding: 5px 10px; font-size: 13px; color: #333;
  cursor: pointer; line-height: 1.5;
}
.combo-box .combo-item:hover, .combo-box .combo-item.is-active { background: #e6f4ff; }
.combo-box .combo-item.is-selected { color: #1677ff; font-weight: 600; background: #f0f7ff; }
.combo-box .combo-item.is-placeholder { color: #999; }
.combo-box .combo-item .combo-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-box .combo-item .combo-hl { color: #1677ff; background: #fff3cd; font-weight: 700; border-radius: 2px; }
.combo-box .combo-item .combo-tick { flex-shrink: 0; font-size: 11px; color: #1677ff; }
.combo-box .combo-item .combo-check { flex-shrink: 0; width: 14px; font-size: 11px; color: #1677ff; }

.combo-box .combo-empty { padding: 10px; text-align: center; color: #bbb; font-size: 12px; }
.combo-box .combo-foot {
  display: flex; align-items: center; gap: 10px; padding: 5px 10px; border-top: 1px solid #f0f0f0;
  background: #fafbfc; font-size: 12px;
}
.combo-box .combo-foot .combo-foot-btn { color: #1677ff; text-decoration: none; }
.combo-box .combo-foot .combo-foot-btn:hover { text-decoration: underline; }
.combo-box .combo-foot .combo-count { margin-left: auto; color: #888; }

/* 多选模式下控件高度自适应（标签多时换行） */
.combo-box.combo-multiple .combo-control { height: auto; min-height: 30px; padding: 4px 8px; align-items: flex-start; }
.combo-box.combo-multiple .combo-arrow { margin-top: 6px; }

/* 分页 */
.pagination { display: flex; gap: 4px; margin-top: 12px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 5px 10px; border-radius: 5px; border: 1px solid #d9d9d9; text-decoration: none; color: #333; font-size: 12px; background: #fff; }
.pagination a:hover { border-color: #1677ff; color: #1677ff; }
.pagination .current { background: #1677ff; color: #fff; border-color: #1677ff; font-weight: 600; }
.pagination .page-ellipsis { border: 0; background: transparent; color: #999; padding: 5px 2px; }
.pagination .page-nav { font-weight: 500; }
.pagination .page-info { border: 0; background: transparent; color: #888; margin-left: 6px; }

/* 页脚 */
.admin-footer { padding: 8px 16px; text-align: center; color: #bbb; font-size: 11px; border-top: 1px solid #e8e8e8; background: #fff; }

/* 提示 */
.alert { padding: 8px 12px; border-radius: 6px; margin-bottom: 10px; font-size: 12px; }
.alert-success { background: #f6ffed; border: 1px solid #b7eb8f; color: #389e0d; }
.alert-error { background: #fff2f0; border: 1px solid #ffccc7; color: #cf1322; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: none; align-items: center; justify-content: center; z-index: 1000; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 10px; width: 460px; max-width: 92vw; padding: 16px; }
.modal-title { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* ===== 轨迹弹窗：长文本换行 + 内容区滚动，避免撑破弹窗 ===== */
#modal-trace .modal { max-height: 80vh; display: flex; flex-direction: column; }
#modal-trace #trace-content { overflow-y: auto; min-height: 0; margin-top: 4px; word-break: break-word; }
#modal-trace #trace-content .table { min-width: 0; }
#modal-trace #trace-content .table th,
#modal-trace #trace-content .table td { white-space: normal; word-break: break-word; vertical-align: top; }
#modal-trace #trace-content .table td { min-width: 120px; }

/* 状态 Tab */
.status-tabs { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.status-tab { padding: 5px 14px; border-radius: 16px; background: #fff; border: 1px solid #d9d9d9; color: #555; text-decoration: none; font-size: 12px; transition: all .15s; }
.status-tab:hover { border-color: #1677ff; color: #1677ff; }
.status-tab.active { background: #1677ff; color: #fff; border-color: #1677ff; }

/* 工具类 */
.mb-16 { margin-bottom: 10px; }
.mt-16 { margin-top: 10px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.text-muted { color: #999; }
.text-danger { color: #cf1322; }
.text-success { color: #389e0d; }
.font-bold { font-weight: 600; }

/* 自适应：小屏单列 */
@media (max-width: 768px) {
  /* 侧边栏改为抽屉：默认收起，点顶栏按钮滑出，不再挤压内容区 */
  .admin-sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 232px;
    height: 100vh;
    height: 100dvh;
    z-index: 1200;
    transform: translateX(-100%);
    transition: transform .24s ease;
    box-shadow: 2px 0 22px rgba(0, 0, 0, .45);
  }
  .admin-sidebar.is-open { transform: translateX(0); }
  .admin-main { width: 100%; }
  .nav-backdrop {
    display: none;
    position: fixed; left: 0; top: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, .5);
    z-index: 1100;
  }
  .nav-backdrop.is-open { display: block; }
  .admin-header .nav-toggle { display: inline-flex; }
  .form-row { grid-template-columns: 1fr; }
  .admin-content { padding: 8px; }
  .card { padding: 10px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
/* 移动端汉堡按钮：桌面隐藏 */
.nav-toggle {
  display: none;
  align-items: center; justify-content: center;
  width: 30px; height: 30px; margin-right: 8px;
  border: 1px solid #dcdfe6; border-radius: 6px; background: #fff;
  color: #333; font-size: 15px; line-height: 1;
  cursor: pointer;
}
.nav-toggle:active { background: #f0f2f5; }
/* ===== 地理区域：搜索式下拉多选（国家 / 州省通用） ===== */
/* 面板 position:fixed，由 JS 计算坐标，避免被 .table-scroll 的 overflow 裁切 */
#area-table > tbody > tr > td { vertical-align: middle; }
.ms-slot { width: 100%; }
#area-table > tbody > tr > td .ms { max-width: 460px; }
#area-table > tbody > tr > td:first-child .ms { max-width: none; }

.ms { position: relative; display: block; width: 100%; vertical-align: middle; }
.ms-trigger {
  display: flex; align-items: center; gap: 6px; width: 100%; height: 32px; padding: 0 9px;
  border: 1px solid #d9d9d9; border-radius: 5px; background: #fff; color: #333;
  font-size: 13px; line-height: 30px; text-align: left; cursor: pointer;
}
.ms-trigger:hover { border-color: #4096ff; }
.ms.is-open .ms-trigger { border-color: #1677ff; box-shadow: 0 0 0 2px rgba(22,119,255,.1); }
.ms-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-label.is-placeholder { color: #9aa0a6; }
.ms-caret { flex: 0 0 auto; color: #999; font-size: 10px; transition: transform .15s; }
.ms.is-open .ms-caret { transform: rotate(180deg); }

.ms-panel {
  position: fixed; z-index: 9999; display: flex; flex-direction: column;
  background: #fff; border: 1px solid #dcdfe6; border-radius: 6px;
  box-shadow: 0 8px 28px rgba(0,0,0,.16); overflow: hidden;
}
.ms-panel[hidden] { display: none; }
.ms-tools { display: flex; align-items: center; gap: 6px; padding: 6px; border-bottom: 1px solid #f0f0f0; background: #fafbfc; }
.ms-tools .ms-search {
  flex: 1 1 auto; min-width: 0; width: auto; height: 28px; padding: 0 8px;
  border: 1px solid #dcdfe6; border-radius: 4px; font-size: 12px; line-height: normal;
}
.ms-tools .ms-search:focus { outline: none; border-color: #1677ff; box-shadow: 0 0 0 2px rgba(22,119,255,.1); }
.ms-tools button {
  flex: 0 0 auto; height: 28px; padding: 0 9px; border: 1px solid #d9d9d9; border-radius: 4px;
  background: #fff; color: #555; font-size: 12px; line-height: 26px; cursor: pointer;
}
.ms-tools button:hover { border-color: #4096ff; color: #1677ff; }

.ms-list { max-height: 260px; overflow-y: auto; padding: 4px 0; }
.ms-item {
  display: flex; align-items: center; gap: 8px; margin: 0; padding: 5px 12px;
  font-size: 13px; font-weight: 400; line-height: 18px; cursor: pointer; white-space: normal;
}
.ms-item:hover { background: #f2f7ff; }
.ms-item.is-disabled { opacity: .45; cursor: not-allowed; }
.ms-item.is-disabled:hover { background: transparent; }
/* 覆盖 .form-group input 的 width:100%/height:30px，否则复选框会被拉成整行宽 */
.form-group .ms-item input[type="checkbox"],
.form-group .ms-item input[type="radio"],
.ms-item input[type="checkbox"],
.ms-item input[type="radio"] {
  width: 14px; height: 14px; min-width: 14px; padding: 0; margin: 0;
  flex: 0 0 14px; accent-color: #1677ff; box-shadow: none; border-radius: 3px;
}
.ms-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-empty { padding: 14px; text-align: center; color: #999; font-size: 12px; }

.ms-foot { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-top: 1px solid #f0f0f0; background: #fafbfc; }
.ms-count { margin-left: auto; color: #888; font-size: 12px; white-space: nowrap; }
.ms-count:empty { display: none; }
.ms-foot .ms-done { height: 26px; padding: 0 12px; font-size: 12px; line-height: 24px; }

/* 单选模式：选项前的圆点更贴近老系统的打勾列表 */
.ms-single .ms-item input[type="radio"] { accent-color: #1677ff; }

/* 批量添加：国家下拉行 */
/* 批量添加：固定列宽，让选择器撑满国家列，删除按钮紧跟其右 */
#badd-table { table-layout: fixed; }
#badd-table > tbody > tr > td { vertical-align: top; }
#badd-table > tbody > tr > td:first-child { padding-top: 10px; }
.badd-country-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.badd-country-row .ms-slot { flex: 1 1 auto; min-width: 0; }
.badd-country-row .ms { max-width: none; }
.badd-country-row .btn-del { flex: 0 0 auto; width: 28px; height: 28px; padding: 0; font-size: 12px; line-height: 26px; }
.badd-toolbar { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.badd-toolbar input.qty { width: 62px; height: 28px; padding: 0 6px; border: 1px solid #d9d9d9; border-radius: 5px; font-size: 12px; text-align: center; }
.badd-toolbar .btn { height: 28px; padding: 0 9px; font-size: 12px; line-height: 26px; }
.badd-toolbar .hint { color: #999; font-size: 12px; }

/* 兼容旧浮层列表（订单表单 / 地址选择用的 .zone-panel）——仅保留通用项布局 */
.zone-list { padding: 4px 0; }
.zone-item { display: flex; align-items: center; gap: 8px; font-size: 13px; line-height: 20px; cursor: pointer; }
.zone-item:hover { background: #f5f8ff; }
.zone-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.form-hint { font-size: 12px; color: #999; margin-top: 4px; }

/* ===== 仪表盘：扫描入库 + 燃油附加费（原 dashboard.php 内联样式，已规范化） ===== */
.scan-card { background: #fff; border-radius: 8px; padding: 12px 14px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.scan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.scan-item { min-width: 0; }
.scan-item label { display: block; font-size: 12px; color: #555; margin-bottom: 4px; font-weight: 600; }
.scan-input-row { display: flex; gap: 0; }
.scan-input-row input { flex: 1; min-width: 0; height: 34px; border: 1px solid #d9d9d9; border-right: 0; border-radius: 5px 0 0 5px; padding: 0 10px; font-size: 13px; outline: none; font-family: inherit; }
.scan-input-row input:focus { border-color: #1677ff; box-shadow: 0 0 0 2px rgba(22,119,255,.1); }
.scan-input-row button { flex: 0 0 auto; width: 44px; height: 34px; border: 1px solid #1677ff; background: #1677ff; color: #fff; border-radius: 0 5px 5px 0; cursor: pointer; font-size: 14px; }
.scan-input-row button:hover { background: #0958d9; }
.scan-hint { font-size: 11px; color: #999; margin-top: 4px; }

.fuel-row td { padding: 5px 8px; }
.fuel-pct { font-weight: 600; font-size: 13px; }
.fuel-chg-up { color: #cf1322; font-size: 11px; }
.fuel-chg-down { color: #389e0d; font-size: 11px; }
.fuel-time { color: #999; font-size: 11px; }
.fuel-edit { display: flex; gap: 4px; align-items: center; }
.fuel-edit input { width: 74px; height: 24px; border: 1px solid #d9d9d9; border-radius: 4px; padding: 0 5px; font-size: 12px; }

@media (max-width: 768px) {
  /* 扫描入库两列在窄屏挤爆容器，改单列 */
  .scan-grid { grid-template-columns: 1fr; }
}

/* ===== 渠道账号 · 配送方式（左列表 + 右新增表单） ===== */
.cs-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.cs-pane { min-width: 0; }
.cs-pane-title {
  font-size: 12px; font-weight: 600; color: #333;
  padding: 0 0 8px; margin-bottom: 8px;
  border-bottom: 1px solid #f0f0f0;
}
.cs-pane-form { background: #fafbfc; border: 1px solid #eef0f3; border-radius: 8px; padding: 12px 14px; }
.cs-pane-form .form-group { margin-bottom: 10px; }
.cs-pane-form .form-group > label { display: block; font-size: 12px; color: #555; margin-bottom: 4px; font-weight: 600; }
.cs-pane-form input[type="text"], .cs-pane-form select { width: 100%; height: 32px; padding: 0 9px; border: 1px solid #d9d9d9; border-radius: 5px; font-size: 13px; font-family: inherit; }
.cs-pane-form input[type="text"]:focus, .cs-pane-form select:focus { outline: none; border-color: #1677ff; box-shadow: 0 0 0 2px rgba(22,119,255,.1); }
.cs-pane-form .form-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cs-pane-form .form-row .form-group { margin-bottom: 10px; }
.cs-table { font-size: 12px; }
.cs-table > thead > tr > th { padding: 6px 8px; font-size: 11px; }
.cs-table > tbody > tr > td { padding: 6px 8px; vertical-align: middle; }
.cs-empty { text-align: center; color: #999; padding: 26px 10px !important; font-size: 12px; }
.cs-recycled { margin-top: 12px; font-size: 12px; }
.cs-recycled > summary { cursor: pointer; color: #888; padding: 4px 0; }
.cs-switches { display: flex; flex-wrap: wrap; gap: 12px; margin: 4px 0 2px; }
.cs-switch { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: #444; font-weight: 400; cursor: pointer; }
.cs-switch input[type="checkbox"] { width: 14px; height: 14px; min-width: 14px; margin: 0; accent-color: #1677ff; }
.cs-pane-form .ms-trigger { height: 32px; }
@media (max-width: 1100px) {
  .cs-layout { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .cs-pane-form .form-row { grid-template-columns: 1fr 1fr; }
}

/* ===== 渠道编辑（原 channel_form.php 内联样式，已规范化） ===== */
/* 标签页：对齐老系统 extension/extension/shipping_form.twig 的 nav-tabs */
.ch-tabs { display: flex; gap: 2px; border-bottom: 1px solid #eee; margin-bottom: 16px; overflow-x: auto; }
.ch-tab {
  padding: 9px 16px; cursor: pointer; white-space: nowrap;
  border: 1px solid transparent; border-bottom: 0; border-radius: 6px 6px 0 0;
  color: #666; font-size: 13px; font-weight: 500; margin-bottom: -1px;
  user-select: none;
}
.ch-tab:hover { color: #1677ff; background: #f7f9fc; }
.ch-tab.active { color: #1677ff; background: #fff; border-color: #eee; font-weight: 600; }
.ch-tab.has-error::after { content: "•"; color: #d4380d; margin-left: 4px; font-size: 16px; line-height: 0; }
.ch-tab-pane { display: none; }
.ch-tab-pane.active { display: block; }

/* 表单网格：两列，整行的字段用 .ch-span2 */
.ch-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.ch-form .form-group { margin-bottom: 0; min-width: 0; }
.ch-form .ch-span2 { grid-column: 1 / -1; }
.ch-form .form-group > label { font-size: 12px; color: #555; font-weight: 600; }
.ch-form .form-group > label .req { color: #d4380d; margin-left: 2px; }
.ch-form input[type="text"], .ch-form input[type="password"], .ch-form select, .ch-form textarea {
  width: 100%; height: 32px; padding: 0 9px; border: 1px solid #d9d9d9; border-radius: 5px;
  font-size: 13px; font-family: inherit; outline: none;
}
.ch-form textarea { height: auto; padding: 7px 9px; resize: vertical; line-height: 1.5; }
.ch-form input:focus, .ch-form select:focus, .ch-form textarea:focus { border-color: #1677ff; box-shadow: 0 0 0 2px rgba(22,119,255,.1); }
.ch-form .ms-trigger { height: 32px; }

/* 分节标题 + 说明条 */
.ch-section { grid-column: 1 / -1; font-size: 12px; font-weight: 600; color: #333; padding-top: 2px; }
.ch-section:not(:first-child) { margin-top: 4px; padding-top: 12px; border-top: 1px dashed #eef0f3; }
.ch-notice {
  border-radius: 6px; padding: 8px 11px; font-size: 12px; line-height: 1.6;
  margin-bottom: 14px;
}
.ch-notice-info { background: #f0f7ff; border: 1px solid #d6e8ff; color: #1c4e8a; }
.ch-notice-warn { background: #fffbe6; border: 1px solid #ffe58f; color: #874d00; }
.ch-notice code { background: rgba(0,0,0,.05); padding: 1px 4px; border-radius: 3px; font-size: 11px; }

/* 开关行（老系统 bootstrap-switch 的等价物） */
.ch-switch-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; background: #fafbfc; border: 1px solid #eef0f3; border-radius: 6px;
}
.ch-switch-row .ch-switch-text { flex: 1; min-width: 0; }
.ch-switch-row .ch-switch-text b { display: block; font-size: 13px; color: #333; font-weight: 600; }
.ch-switch-row .ch-switch-text span { font-size: 12px; color: #999; }
.ch-switch {
  position: relative; flex: 0 0 auto; width: 42px; height: 22px;
  /* label 默认是 inline，在 <td> 这种非 flex 容器里宽高会被忽略（开关直接变 0×0），
     所以必须显式 blockify 一次 */
  display: inline-block; vertical-align: middle;
  background: #d9d9d9; border-radius: 11px; cursor: pointer; transition: background .18s;
}
.ch-switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: left .18s;
}
.ch-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.ch-switch input:checked + .ch-switch-track { background: #1677ff; }
.ch-switch.on { background: #1677ff; }
.ch-switch.on::after { left: 22px; }

/* 下单模式：两个单选卡片 */
.ch-radios { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ch-radio {
  display: flex; gap: 8px; align-items: flex-start; cursor: pointer;
  border: 1px solid #e6e8eb; border-radius: 6px; padding: 10px 12px; background: #fff;
}
.ch-radio:hover { border-color: #91caff; }
.ch-radio input[type="radio"] { flex: 0 0 auto; width: 15px; height: 15px; margin: 1px 0 0; accent-color: #1677ff; }
.ch-radio b { display: block; font-size: 13px; color: #333; font-weight: 600; }
.ch-radio span { font-size: 12px; color: #888; line-height: 1.5; }
.ch-radio.is-on { border-color: #1677ff; background: #f0f7ff; }

/* 寄件人地址：开关关闭时降权，但控件保持可编辑、可提交 */
#tab-sender.is-sender-off .ch-form > .form-group { opacity: .45; }
#tab-sender.is-sender-off .ch-form > .form-group:hover { opacity: 1; }

/* 申报字段表格 */
.ch-fieldtable { width: 100%; border-collapse: collapse; }
.ch-fieldtable th {
  text-align: left; font-size: 11px; color: #888; font-weight: 600;
  padding: 7px 10px; background: #fafbfc; border-bottom: 1px solid #eef0f3;
  white-space: nowrap;
}
.ch-fieldtable td { padding: 6px 10px; border-bottom: 1px solid #f5f6f7; vertical-align: middle; font-size: 13px; }
.ch-fieldtable tr:last-child td { border-bottom: 0; }
.ch-fieldtable tr:hover td { background: #fcfcfd; }
.ch-fieldtable .f-name { color: #333; }
.ch-fieldtable .f-code { color: #aaa; font-size: 11px; font-family: Consolas, Monaco, monospace; margin-left: 6px; }
.ch-fieldtable td input[type="text"] {
  width: 100%; height: 30px; padding: 0 8px; border: 1px solid #d9d9d9; border-radius: 5px;
  font-size: 13px; outline: none;
}
.ch-fieldtable td input[type="text"]:focus { border-color: #1677ff; box-shadow: 0 0 0 2px rgba(22,119,255,.1); }
.ch-fieldtable td select {
  width: 100%; height: 30px; padding: 0 8px; border: 1px solid #d9d9d9; border-radius: 5px;
  font-size: 13px; outline: none; background: #fff;
}
.ch-fieldtable td select:focus { border-color: #1677ff; box-shadow: 0 0 0 2px rgba(22,119,255,.1); }
.ch-fieldtable .f-scope { color: #999; font-size: 11px; white-space: nowrap; }

/* 申报字段默认值里的单选 / 复选组（老系统 input_field_content 的 radio / checkbox 同款） */
.ch-radio-group { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 4px 0; }
.ch-radio-group .ch-radio-inline {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; color: #333; cursor: pointer; white-space: nowrap;
}
.ch-radio-group .ch-radio-inline input[type="radio"],
.ch-radio-group .ch-radio-inline input[type="checkbox"] {
  width: 14px; height: 14px; margin: 0; accent-color: #1677ff;
}

/* 高级 JSON 模式 */
.ch-advanced-box { border: 1px dashed #d9d9d9; border-radius: 8px; padding: 12px 14px; background: #fafbfc; }
.ch-advanced-box label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.ch-advanced-box input[type="checkbox"] { width: 15px; height: 15px; margin: 0; accent-color: #1677ff; }
.ch-advanced-box textarea {
  width: 100%; margin-top: 10px; padding: 10px; border: 1px solid #d9d9d9; border-radius: 6px;
  font-family: Consolas, Monaco, monospace; font-size: 12.5px; line-height: 1.55; resize: vertical;
}

/* 底部操作条：内容长时保持可见 */
.ch-actions { margin-top: 18px; padding-top: 14px; border-top: 1px solid #f0f0f0; display: flex; gap: 10px; align-items: center; }
.ch-actions .ch-actions-hint { margin-left: auto; font-size: 12px; color: #999; }

@media (max-width: 768px) {
  .ch-form { grid-template-columns: 1fr; }
  .ch-radios { grid-template-columns: 1fr; }
  .ch-tab { padding: 8px 12px; font-size: 12px; }
  .ch-fieldtable .f-code { display: none; }
}

/* ===== 物流方式编辑（对齐老系统 localisation/shipping_form.twig） ===== */
.sh-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; }
.sh-grid .form-group { margin-bottom: 0; min-width: 0; }
.sh-grid .form-group > label { display: block; font-size: 12px; color: #555; font-weight: 600; margin-bottom: 4px; }
.sh-grid .form-group > label .req { color: #d4380d; margin-left: 2px; }
.sh-grid input[type="text"], .sh-grid select, .sh-grid textarea {
  width: 100%; height: 32px; padding: 0 9px; border: 1px solid #d9d9d9; border-radius: 5px;
  font-size: 13px; font-family: inherit; outline: none; background: #fff;
}
.sh-grid textarea { height: auto; padding: 7px 9px; resize: vertical; line-height: 1.5; }
.sh-grid input:focus, .sh-grid select:focus, .sh-grid textarea:focus { border-color: #1677ff; box-shadow: 0 0 0 2px rgba(22,119,255,.1); }
.sh-span2 { grid-column: 1 / -1; }
.sh-readonly { background: #f5f5f5 !important; color: #888; }
.sh-code { color: #bbb; font-size: 11px; font-family: Consolas, Monaco, monospace; margin-left: 6px; font-weight: 400; }
.sh-switch-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 12px; background: #fafbfc; border: 1px solid #eef0f3; border-radius: 6px;
}

/* 客户组 / 分段内表格 */
.sh-table { width: 100%; border-collapse: collapse; }
.sh-table th { text-align: left; font-size: 11px; color: #888; font-weight: 600; padding: 6px 8px; background: #fafbfc; border-bottom: 1px solid #eef0f3; white-space: nowrap; }
.sh-table td { padding: 5px 8px; border-bottom: 1px solid #f5f6f7; vertical-align: middle; font-size: 12px; }
.sh-table tr:last-child td { border-bottom: 0; }
.sh-table input[type="text"] { width: 100%; height: 28px; padding: 0 7px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 12px; outline: none; }
.sh-table input[type="text"]:focus { border-color: #1677ff; box-shadow: 0 0 0 2px rgba(22,119,255,.1); }
.sh-table select { width: 100%; height: 28px; padding: 0 6px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 12px; }
.sh-table input[type="checkbox"] { width: 14px; height: 14px; margin: 0; accent-color: #1677ff; }

/* 计费公式分段块 */
.ft-block { border: 1px solid #e9edf2; border-radius: 8px; margin-bottom: 12px; background: #fff; overflow: hidden; }
.ft-block > .ft-head {
  display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap;
  padding: 9px 12px; background: #f8fafc; border-bottom: 1px solid #eef0f3;
}
.ft-num { font-size: 12px; font-weight: 700; color: #1677ff; padding-bottom: 7px; white-space: nowrap; }
.ft-field { display: flex; align-items: center; gap: 6px; }
.ft-field label { font-size: 11px; color: #888; white-space: nowrap; }
.ft-w { width: 78px !important; height: 28px !important; padding: 0 7px !important; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 12px; }
.ft-dash, .ft-unit { color: #bbb; font-size: 11px; }
.ft-head select { height: 28px; padding: 0 6px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 12px; max-width: 300px; }
.ft-del { margin-left: auto; }
.ft-body-publish, .ft-body-cost { padding: 8px 12px 10px; }
.ft-block .ft-body-cost { display: block; }
.ft-block .ft-body-publish { display: none; }
.ft-block.is-publish .ft-body-cost { display: none; }
.ft-block.is-publish .ft-body-publish { display: block; }
.ft-tbl { border: 1px solid #eef0f3; border-radius: 6px; overflow: hidden; }
.ft-costrow td { background: #fffaf9; }
.ft-profit { margin-bottom: 10px; border: 1px dashed #e6e8eb; border-radius: 6px; padding: 7px 9px; }
.ft-profit:last-child { margin-bottom: 0; }
.ft-profit-head { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #555; margin-bottom: 6px; }
.ft-profit-head span { color: #aaa; }
.ft-profit-head .ft-profit-add { margin-left: auto; }

@media (max-width: 900px) {
  .sh-grid { grid-template-columns: 1fr; }
  .ft-head select { max-width: none; }
}
.sh-tag {
  display: inline-block; margin-left: 6px; padding: 0 5px;
  border-radius: 3px; background: #f0f0f0; color: #999;
  font-size: 10px; font-weight: 400; line-height: 15px; vertical-align: 1px;
}

/* ===== 订单列表：筛选栅格 + 紧凑列宽（1366 笔记本一屏放下，不横向拖动） ===== */
.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 8px 10px;
}
.filter-grid .form-group { margin-bottom: 0; }

.table-scroll .table-orders { table-layout: fixed; min-width: 860px; }
.table-orders th,
.table-orders td { padding: 5px 6px; overflow: hidden; text-overflow: ellipsis; }
.table-orders .col-check { width: 26px; }
.table-orders .col-id    { width: 56px; }
.table-orders .col-no    { width: 10%; }
.table-orders .col-cust  { width: 66px; }
.table-orders .col-rcv   { width: 9%; }
.table-orders .col-ctry  { width: 58px; }
.table-orders .col-track { width: 13%; }
.table-orders .col-status{ width: 112px; white-space: normal; }
.table-orders .col-money { width: 78px; }
.table-orders .col-date  { width: 96px; }
.table-orders .col-act   { width: 112px; }
.table-orders .col-act .btn + .btn { margin-left: 3px; }
.table-orders .col-status .badge { margin: 1px 0; }
/* 展开详情行不能被上面的省略规则裁掉 */
.table-orders tr.order-detail-row > td { padding: 0; overflow: visible; white-space: normal; background: #fafafa; }

@media (max-width: 768px) {
  .filter-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== 渠道列表：大类目 + 账号同表（对齐老系统 extension/extension/shipping） ===== */
.table-channels td { vertical-align: middle; }
.table-channels .cat-row > td { background: #f7f9fc; border-top: 1px solid #e5ebf3; padding-top: 7px; padding-bottom: 7px; }
.table-channels .cat-row .cat-name { font-weight: 600; font-size: 13px; color: #1f2a37; }
.table-channels .cat-row .cat-code { font-size: 11px; color: #94a3b8; margin-left: 6px; }
.table-channels .cat-row .cat-desc { font-size: 11px; color: #94a3b8; margin-top: 1px; }
.table-channels .cat-ico { margin-right: 6px; }
.table-channels .acct-row > td:first-child { padding-left: 32px; }
.table-channels .acct-row .acct-ico { color: #1677ff; margin-right: 6px; }
.table-channels .acct-row .acct-name { color: #1677ff; font-weight: 600; }
.table-channels .acct-row .acct-id { color: #b0b7c3; font-size: 11px; margin-left: 6px; }
.table-channels .acct-row .acct-empty { color: #b0b7c3; font-size: 12px; padding-left: 32px; }
.table-channels .acct-row .ch-switch { display: inline-block; vertical-align: middle; }
.ch-ops { display: flex; gap: 5px; justify-content: flex-end; align-items: center; }
.ch-ops form { display: inline; }
.ch-ops .btn { padding: 3px 8px; font-size: 12px; }
.ch-warn { color: #d46b08; font-size: 11px; }

/* 弹窗（渠道 · 配送方式）：比通用 .modal 宽，内容自己滚 */
.modal-lg { width: 1020px; max-width: 96vw; max-height: 88vh; display: flex; flex-direction: column; }
.modal-lg .modal-head { display: flex; align-items: center; gap: 10px; }
.modal-lg .modal-head .modal-title { margin: 0; flex: 1; min-width: 0; }
.modal-lg .modal-x { border: 0; background: transparent; color: #999; font-size: 20px; line-height: 1; cursor: pointer; padding: 0 2px; }
.modal-lg .modal-x:hover { color: #333; }
.modal-lg .modal-body { overflow-y: auto; margin-top: 10px; min-height: 0; }
.modal-mask .modal-lg .modal-body .cs-layout { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }

/* 配送方式弹窗内的左列表：紧凑两行 */
.cs-table th, .cs-table td { font-size: 12px; }
.cs-table .cs-sub { color: #94a3b8; font-size: 11px; }
.cs-table .cs-acts { display: flex; gap: 4px; justify-content: flex-end; }
.cs-table .cs-acts .btn { padding: 2px 7px; font-size: 11px; }
.cs-ok { background: #f6ffed; border: 1px solid #b7eb8f; color: #389e0d; border-radius: 6px; padding: 6px 10px; font-size: 12px; margin-bottom: 10px; }
.cs-empty { color: #b0b7c3; font-size: 12px; text-align: center; padding: 18px 8px; }
/* 弹窗里的紧凑表格不能再吃全局 760px 最小宽度，否则列被挤到滚动区外 */
.table-scroll .cs-table { min-width: 0; }
.cs-table { table-layout: auto; }

/* 偏远费弹窗内的重量段输入 */
.rf-table .rf-head td { background: #f7f9fc; font-size: 12px; padding: 5px 8px; }
.rf-table .rf-row td { padding: 4px 8px; }
.rf-seg { display: flex; align-items: center; gap: 5px; }
.rf-seg span { color: #b0b7c3; }
.rf-in { width: 100%; height: 26px; border: 1px solid #d9d9d9; border-radius: 4px; padding: 0 6px; font-size: 12px; font-family: inherit; }
.rf-in:focus { outline: none; border-color: #1677ff; box-shadow: 0 0 0 2px rgba(22,119,255,.1); }
.rf-seg .rf-in { width: 62px; }
.rf-table .rf-foot td { padding: 4px 8px; background: #fcfcfd; }
.rf-table .rf-del { width: 22px; padding: 0; line-height: 18px; text-align: center; }

/* 渠道编辑：渠道类型锁死展示 */
.ch-locked {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 12px; border: 1px solid #e5ebf3; border-radius: 6px;
  background: #f7f9fc; font-size: 13px; color: #1f2a37;
}
.ch-locked-ico { font-size: 12px; opacity: .7; }
.ch-locked code {
  font-size: 11px; color: #6b7280; background: #eef2f7;
  padding: 1px 6px; border-radius: 3px;
}

/* ===== 寄件人地址簿（渠道配置页弹窗） ===== */
.ch-addrbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ch-addrbar-hint { font-size: 11px; color: #94a3b8; }
.ch-addrbar-hint:not(:empty) { color: #389e0d; }

.ab-dialog { width: 820px; max-width: 96vw; max-height: 86vh; display: flex; flex-direction: column; padding: 16px; }
.ab-dialog .modal-head { display: flex; align-items: center; gap: 10px; }
.ab-dialog .modal-head .modal-title { margin: 0; flex: 1; min-width: 0; }
.ab-dialog .modal-x { border: 0; background: transparent; color: #999; font-size: 20px; line-height: 1; cursor: pointer; padding: 0 2px; }
.ab-dialog .modal-x:hover { color: #333; }
.ab-dialog .modal-body { overflow-y: auto; margin-top: 10px; min-height: 0; }

.ab-list { display: flex; flex-direction: column; gap: 8px; }
.ab-card {
  display: flex; align-items: flex-start; gap: 12px;
  border: 1px solid #e5ebf3; border-radius: 8px; padding: 10px 12px; background: #fff;
}
.ab-card:hover { border-color: #b7d4ff; background: #fbfdff; }
.ab-card-main { flex: 1; min-width: 0; }
.ab-card-name { font-size: 13px; font-weight: 600; color: #1f2a37; }
.ab-card-mobile { font-weight: 400; color: #6b7280; margin-left: 8px; font-size: 12px; }
.ab-tag {
  display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 3px;
  background: #eef4ff; color: #1677ff; font-size: 10px; font-weight: 400; line-height: 16px;
}
.ab-card-company { font-size: 11px; color: #94a3b8; margin-top: 2px; }
.ab-card-line { font-size: 12px; color: #475569; margin-top: 3px; line-height: 1.5; word-break: break-word; }
.ab-card-acts { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.ab-card-acts .btn { padding: 3px 9px; font-size: 12px; }
.ab-card-acts .ab-del { padding: 3px 7px; }
.ab-empty { text-align: center; color: #94a3b8; font-size: 12px; line-height: 1.8; padding: 26px 10px; }
.ab-foot { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid #f0f3f7; }
.ab-foot-hint { font-size: 11px; color: #b0b7c3; }

.ab-form-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.ab-form-head b { font-size: 13px; }
.ab-back { border: 0; background: transparent; color: #1677ff; font-size: 12px; cursor: pointer; padding: 0; }
.ab-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.ab-form .form-group { margin-bottom: 10px; }
.ab-form label { display: block; font-size: 12px; color: #475569; margin-bottom: 4px; }
.ab-form input[type=text], .ab-form select, .ab-form textarea {
  width: 100%; border: 1px solid #d9d9d9; border-radius: 5px; padding: 6px 9px;
  font-size: 13px; font-family: inherit; color: #1f2a37; background: #fff;
}
.ab-form textarea { resize: vertical; }
.ab-form input:focus, .ab-form select:focus, .ab-form textarea:focus {
  outline: none; border-color: #1677ff; box-shadow: 0 0 0 2px rgba(22,119,255,.12);
}
.ab-form-acts { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.ab-err { font-size: 12px; color: #94a3b8; }
.ab-err.is-err { color: #d4380d; }

@media (max-width: 640px) {
  .ab-grid { grid-template-columns: minmax(0, 1fr); }
  .ab-card { flex-direction: column; gap: 8px; }
  .ab-card-acts { align-self: flex-end; }
}

/* 申报字段：显示阶段勾选（老系统三阶段） */
.f-stage { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.cf-stage {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: #475569; cursor: pointer; white-space: nowrap;
}
.cf-stage input { margin: 0; cursor: pointer; }
.cf-fixed { font-size: 11px; color: #94a3b8; }
.ch-fieldtable .f-code { display: block; font-size: 11px; color: #b0b7c3; }

/* ===== 物流方式列表：紧凑横排（对齐老系统 localisation/shipping_list） ===== */
.sh-list-scroll { overflow-x: auto; }
.sh-list-scroll .sh-list-table { width: 100%; table-layout: auto; min-width: 0; }
.sh-list-table th { white-space: nowrap; }
.sh-list-table td { overflow: hidden; }
.sh-list-table td.sh-col-name { white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
.sh-list-table td:not(.sh-col-name) { white-space: nowrap; text-overflow: ellipsis; }
.sh-list-table .sh-col-id { width: 5%; min-width: 40px; }
.sh-list-table .sh-col-ch { width: 14%; min-width: 90px; }
.sh-list-table .sh-col-cfg { width: 9%; min-width: 60px; }
.sh-list-table .sh-col-bill { width: 7%; min-width: 48px; }
.sh-list-table .sh-col-status { width: 9%; min-width: 60px; }
.sh-list-table .sh-col-act { width: 17%; min-width: 120px; }
.sh-list-table .sh-col-act .btn { padding: 2px 6px; font-size: 12px; }
.sh-list-table .sh-col-act .btn + .btn { margin-left: 2px; }
.sh-list-table .sh-col-name { padding-top: 5px; padding-bottom: 5px; }
.sh-list-table .sh-name-line { display: block; line-height: 1.3; }
.sh-list-table .sh-name-line b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; display: inline-block; vertical-align: bottom; }
.sh-list-table .sh-name-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 3px 6px; margin-top: 2px; }
.sh-list-table .sh-name-sub { color: #888; font-size: 11px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-list-table .sh-code { background: #f0f5ff; color: #2f54eb; border-radius: 3px; padding: 0 4px; font-size: 11px; white-space: nowrap; }

/* ===== 发货弹窗：对齐老程序 post_order 弹窗宽度（Bootstrap modal 默认约 600px），内容紧凑 ===== */
.ship-modal { width: 720px; max-width: 94vw; max-height: 82vh; display: flex; flex-direction: column; }
.ship-modal .modal-head { flex: 0 0 auto; }
.ship-modal .modal-body { padding: 8px 4px; overflow-y: auto; min-height: 0; }
.ship-modal .modal-body .card-title { margin-top: 8px; }
.ship-modal .modal-body .card-title:first-child { margin-top: 0; }
/* 包裹确认表：内容紧凑，自适应宽度，不出现横向滚动条 */
.ship-modal .table-scroll { overflow: visible; }
.ship-modal .table-scroll .table { min-width: 0; width: 100%; table-layout: auto; }
.ship-modal .table-scroll .table th,
.ship-modal .table-scroll .table td { white-space: nowrap; padding: 4px 6px; }
.ship-modal .ship-p-weight, .ship-modal .ship-p-len, .ship-modal .ship-p-wid, .ship-modal .ship-p-hei { font-size: 12px; padding: 2px 4px; }
.ship-modal .modal-footer { flex: 0 0 auto; margin-top: 10px; }
.ship-modal input[type="text"], .ship-modal input[type="number"] { border: 1px solid #d9d9d9; border-radius: 3px; }

/* ===== 编辑货物申报弹窗：横排不滚动（8 列在弹窗内放下，无需左右移动） ===== */
#modal-cargo .modal { width: 1120px; max-width: 96vw; }
#modal-cargo .table-scroll { overflow: visible; }
#modal-cargo #cargo-edit-table { table-layout: fixed; width: 100%; min-width: 0; }
#modal-cargo #cargo-edit-table th,
#modal-cargo #cargo-edit-table td { padding: 4px 3px; font-size: 12px; }
#modal-cargo #cargo-edit-table input {
  width: 100%; min-width: 0; box-sizing: border-box;
  border: 1px solid #d9d9d9; border-radius: 3px; padding: 3px 5px; font-size: 12px;
}
@media (max-width: 1100px) {
  #modal-cargo .table-scroll { overflow-x: auto; }
  #modal-cargo #cargo-edit-table { min-width: 900px; }
}

/* ===== 充值凭证：缩略图 + 大图查看（最大 600*600） ===== */
.cert-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  cursor: pointer;
  vertical-align: middle;
  transition: box-shadow .15s;
}
.cert-thumb-link:hover .cert-thumb {
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.cert-view-img {
  max-width: 600px;
  max-height: 600px;
  width: auto;
  height: auto;
  display: inline-block;
}
#modal-cert-view .modal { padding: 12px 16px; }
#modal-cert-edit .modal { width: 480px; max-width: 94vw; }
