/* ==========================================================================
   售后工作台 · 样式（2026-11 新增）
   --------------------------------------------------------------------------
   原则：**能不写就不写**。表格/卡片/KPI/分段/分页全部复用已有那一套
   （style.css + sycm-theme.css + market.css）：
     .page-head-row / .stat-time / .seg-tabs > .seg / .card / .card-head > h2
     .kpi-grid > .kpi-cell / .table-wrap / .table-note / .mk-pager / .dt-search / .dt-tag
   这里只补「售后特有、别处没有」的几块：筛选行、双栏小表、物流查询条、
   单据详情里的字段网格、登记表单的两列栅格。
   ========================================================================== */

/* ---------------- 二级菜单（三级页面切换） ----------------
   桌面端：隐藏 —— 由 sycm-theme.js 搬进左侧栏（点栏项 = 点这里）
   移动端（2026-10-31 晚改）：也隐藏 —— 改成「点底部导航『售后』→ 弹气泡」
     （见下面的 .af-pop）。原来那排 12 个竖排按钮太占屏，且进二级页后
      没有侧栏可换页，气泡既解决换页也省空间。这里保留 .af-menu 只作
      「三级页面的唯一数据源」：气泡列表就是从它里面读出来的，
      所以改名字/加页面只要改这一处，气泡和侧栏两边都不会走样。
   ⚠ 类名刻意不用 .settings-menu：app.js 里 `$$(".settings-menu .set-item")`
     有全局点击绑定，会误调 showSettingsPanel(undefined) 把设置页面板全关掉。 */
.af-menu {
  display: none;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.af-menu .set-item { width: 100%; }

/* ---------------- 移动端三级页面气泡（2026-10-31 晚） ----------------
   点底部导航「售后」→ 从导航条上方升起，箭头对准「售后」按钮。
   桌面端不出现（JS 里靠 matchMedia 拦，这里再兜一层 display:none）。 */
.af-pop {
  display: none;
  position: fixed;
  z-index: 96;
  left: 10px;
  right: 10px;
  bottom: calc(62px + env(safe-area-inset-bottom) + 10px);
  padding: 12px 12px 10px;
  background: #fff;
  border: 1px solid var(--color-border, #e4e9f0);
  border-radius: 16px;
  box-shadow: 0 14px 36px rgba(16, 24, 40, .18), 0 2px 8px rgba(16, 24, 40, .06);
  max-height: min(62vh, 460px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.af-pop:not([hidden]) { display: block; animation: afPopIn .16s ease; }
@keyframes afPopIn {
  from { opacity: 0; transform: translateY(8px) scale(.99); }
  to   { opacity: 1; transform: none; }
}
/* 下方小三角：--af-pop-arrow-x 由 JS 按「售后」按钮中心算出来 */
.af-pop::after {
  content: "";
  position: absolute;
  left: var(--af-pop-arrow-x, 50%);
  bottom: -6px;
  width: 11px;
  height: 11px;
  background: #fff;
  border-right: 1px solid var(--color-border, #e4e9f0);
  border-bottom: 1px solid var(--color-border, #e4e9f0);
  border-radius: 0 0 3px 0;
  transform: translateX(-50%) rotate(45deg);
}
.af-pop-t {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 2px 9px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary, #6b7280);
}
.af-pop-x {
  flex: none;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: #f4f6f9;
  color: var(--color-text-secondary, #6b7280);
  font-size: 13px;
  line-height: 26px;
}
.af-pop-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.af-pop-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--color-border, #e4e9f0);
  border-radius: 11px;
  background: #fbfcfd;
  color: var(--color-text-title, #111);
  font-size: 13.5px;
  text-align: left;
}
.af-pop-item.on {
  border-color: var(--color-primary, #2062e6);
  background: #eff5ff;
  color: var(--color-primary, #2062e6);
  font-weight: 600;
}
.af-pop-lb { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.af-pop-ck { flex: none; font-size: 12px; }

/* 三级面板：切换时轻微淡入（和设置页 .settings-panel 同款） */
.af-panel { animation: fadeIn .14s ease; }

/* ---------------- 页头：物流查询条 ---------------- */
.af-quick-row { margin-top: 8px; gap: 10px; }
.af-logi-input {
  flex: 1 1 320px; min-width: 200px; max-width: 460px;
  padding: 8px 12px; font-size: 13px;
  border: 1px solid var(--color-border, #e4e9f0); border-radius: 9px;
  background: #fff; color: var(--color-text-title, #111);
}
.af-logi-input:focus { outline: none; border-color: var(--color-primary, #2062e6); }
.af-logi-out { font-size: 12.5px; color: var(--color-text-secondary, #6b7280); }

/* ---------------- 卡片内：三行单选筛选（照市场页 .mk-option 的做法） ---------------- */
.af-opts { display: flex; flex-direction: column; gap: 9px; padding: 0 0 12px; }
.af-opt { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.af-opt-title {
  flex: none; width: 60px; font-size: 12px;
  color: var(--color-text-title, #111);
}
.af-opt .seg-tabs { flex-wrap: wrap; border-bottom: none; }

/* ---------------- 双栏 / 三栏小表（理赔按快递、申诉按人、v2 板块三段分布） ---------- */
.af-split {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px; margin: 4px 0 16px;
}
.af-split.af-split-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) {
  .af-split, .af-split.af-split-3 { grid-template-columns: 1fr; }
}
.af-split-col { min-width: 0; }
.af-sub-title {
  font-size: 12.5px; font-weight: 600; margin: 0 0 8px;
  color: var(--color-text-secondary, #6b7280);
}
.af-mini-wrap { max-height: 300px; border-radius: 12px; }
.af-mini { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.af-mini th, .af-mini td {
  padding: 7px 10px; text-align: left; border-bottom: 1px solid #f2f4f7; white-space: nowrap;
}
.af-mini th {
  position: sticky; top: 0; z-index: 1; background: #fafbfc;
  font-weight: 600; color: var(--color-text-secondary, #6b7280);
}
.af-mini td.num, .af-mini th.num { text-align: right; font-variant-numeric: tabular-nums; }
.af-mini tbody tr:hover { background: #f7f9fc; }
.af-mini .af-empty { color: var(--color-text-secondary, #9aa3af); text-align: center; padding: 18px 0; }

/* ---------------- 单据中心表格：日期/单号两行、超期红字 ---------------- */
#afTkTable td, #afTodoTable td { vertical-align: top; }.af-cell-main { display: block; color: #1d1d1f; font-weight: 600; font-size: 12.5px; }
.af-cell-sub { display: block; color: #8a9099; font-size: 11px; margin-top: 1px; }
.af-clip { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.af-overdue { color: #c0392b; font-weight: 700; }
.af-overdue-0 { color: #c9cdd4; }

/* 类型小标签（沿用 .dt-tag 的形，只补几个配色） */
.dt-tag.af-k-main { background: #EEF4FF; border-color: #BFD3F5; color: #1D4ED8; }
.dt-tag.af-k-branch { background: #FDF3E3; border-color: #EFC98E; color: #8A5A00; }
.dt-tag.af-k-special { background: #F2EDFD; border-color: #CDBBF0; color: #5B3FA8; }
/* 状态标签 */
.dt-tag.af-s-open { background: #FFF4E5; border-color: #F0C88A; color: #8A5A00; }
.dt-tag.af-s-pending { background: #FFECEC; border-color: #F0B4B4; color: #A11414; }
.dt-tag.af-s-closed { background: #EAF7EE; border-color: #AADDB9; color: #1B6B34; }
.dt-tag.af-s-loss { background: #F3F4F6; border-color: #C9CDD4; color: #5B6470; }

/* ---------------- 单据详情弹窗 ---------------- */
.af-detail-head {
  display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center;
  padding: 0 0 12px; border-bottom: 1px solid #f0f2f5; margin-bottom: 14px;
}
.af-detail-head .af-dt-title { font-size: 15px; font-weight: 700; }
.af-field-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px 18px; margin-bottom: 16px;
}
.af-field { min-width: 0; }
.af-field > .k { display: block; font-size: 11.5px; color: #8a9099; margin-bottom: 2px; }
.af-field > .v { display: block; font-size: 13px; color: #1d1d1f; word-break: break-all; }
.af-field.wide { grid-column: 1 / -1; }
.af-block { margin-bottom: 16px; }
.af-block > h4 {
  font-size: 12.5px; font-weight: 600; color: var(--color-text-secondary, #6b7280);
  margin: 0 0 8px;
}
.af-track {
  max-height: 220px; overflow: auto; padding: 10px 12px; border-radius: 10px;
  background: #f7f9fc; border: 1px solid #eef1f5;
  font-size: 12px; line-height: 1.75; color: #374151; white-space: pre-wrap;
}
.af-rel-list { display: flex; flex-direction: column; gap: 6px; }
.af-rel-item {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 8px 10px; border: 1px solid #eef1f5; border-radius: 9px;
  font-size: 12.5px; background: #fff; cursor: pointer;
}
.af-rel-item:hover { border-color: var(--color-primary, #2062e6); background: #f7f9fc; }
.af-rel-item .t { color: #8a9099; font-size: 11.5px; }
.af-timeline { display: flex; flex-direction: column; gap: 0; }
.af-tl-item {
  position: relative; padding: 0 0 12px 18px;
  border-left: 2px solid #eef1f5; margin-left: 5px;
}
.af-tl-item:last-child { border-left-color: transparent; padding-bottom: 0; }
.af-tl-item::before {
  content: ""; position: absolute; left: -5px; top: 4px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--color-primary, #2062e6);
}
.af-tl-at { font-size: 11.5px; color: #8a9099; }
.af-tl-text { font-size: 13px; color: #1d1d1f; margin-top: 1px; white-space: pre-wrap; }
.af-follow-row { display: flex; gap: 8px; margin-top: 10px; }
.af-follow-row input {
  flex: 1; padding: 8px 12px; font-size: 13px; border-radius: 9px;
  border: 1px solid var(--color-border, #e4e9f0);
}
.af-follow-row input:focus { outline: none; border-color: var(--color-primary, #2062e6); }

/* ---------------- 登记表单 ---------------- */
.af-form-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}
@media (max-width: 700px) { .af-form-grid { grid-template-columns: 1fr; } }
.af-form-grid .field { margin: 0; }
.af-form-grid select, .af-form-grid input,
#afForm input, #afForm textarea {
  width: 100%; padding: 8px 11px; font-size: 13px; border-radius: 9px;
  border: 1px solid var(--color-border, #e4e9f0); background: #fff;
  color: var(--color-text-title, #111); font-family: inherit;
}
#afForm textarea { resize: vertical; line-height: 1.6; }
#afForm input:focus, #afForm select:focus, #afForm textarea:focus {
  outline: none; border-color: var(--color-primary, #2062e6);
}

/* ---------------- SOP 知识库（2026-10-31 重排：标题 + 正文，可前端维护） ----------------
   用户要求：「所有有关长文本的例如 sop 知识库，都要合理换行排版，好看容易看，标题+正文」。
   → 每条一张卡片：h4 问题类型做标题，下面每块是 h5 小标题 + p 正文；
     正文 white-space:pre-wrap 保留原文里的换行，长句自动折行，不横向溢出。 */
.af-sop-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin: 10px 0 4px;
}
.af-sop-hint { font-size: 12px; color: var(--color-text-secondary, #6b7280); }
.af-sop-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 12px; margin-top: 8px;
}
.af-sop-item {
  border: 1px solid var(--color-border, #e4e9f0); border-radius: 12px;
  background: #fff; padding: 0; overflow: hidden;
  display: flex; flex-direction: column;
}
.af-sop-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 11px 14px; background: #fafbfc;
  border-bottom: 1px solid var(--color-border, #e4e9f0);
}
.af-sop-title {
  flex: 1 1 auto; min-width: 0; margin: 0;
  font-size: 14px; font-weight: 700; color: #1d1d1f;
  overflow-wrap: anywhere; word-break: break-word;
}
.af-sop-kind {
  flex: none; font-size: 11px; padding: 1px 7px; border-radius: 999px;
  background: #eef4ff; color: #1d4ed8; font-weight: 600;
}
.af-sop-ops { flex: none; display: flex; gap: 4px; }
.af-sop-op {
  border: 1px solid var(--color-border, #e4e9f0); background: #fff;
  border-radius: 7px; padding: 3px 9px; font-size: 11.5px; cursor: pointer;
  color: #374151;
}
.af-sop-op:hover { border-color: #2062e6; color: #2062e6; }
.af-sop-op.danger:hover { border-color: #d93b3b; color: #d93b3b; }
.af-sop-body { padding: 12px 14px 13px; }
.af-sop-step { margin: 0 0 12px; }
.af-sop-step:last-child { margin-bottom: 0; }
.af-sop-st {
  margin: 0 0 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .03em;
  color: #1d4ed8;
}
.af-sop-tx {
  margin: 0; font-size: 12.5px; line-height: 1.85; color: #374151;
  white-space: pre-wrap;              /* 保留原文换行 */
  overflow-wrap: anywhere;            /* 超长链接/无空格长串也折行，不顶破卡片 */
  word-break: break-word;
}
.af-sop-note {
  font-size: 12px; color: #8a9099; margin-top: 8px;
  padding-top: 8px; border-top: 1px dashed #eef1f5;
}
@media (max-width: 720px) {
  .af-sop-grid { grid-template-columns: 1fr; }
}

/* ---------------- 物流轨迹：条数 + 折叠（2026-10-31） ----------------
   默认只显示「最新」一条，点「展开全部 N 条」后一行一条。 */
.af-track-block { margin-bottom: 14px; }
.af-track-one { margin-top: 6px; }
.af-track-more {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 8px;
  border: 1px solid var(--color-border, #e4e9f0); background: #fff;
  border-radius: 8px; padding: 5px 11px; font-size: 12px; cursor: pointer;
  color: var(--color-primary, #2062e6);
}
.af-track-more svg {
  width: 11px; height: 11px; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  transition: transform .16s;
}
.af-track-more.open svg { transform: rotate(180deg); }
.af-track-all { margin-top: 8px; }
.af-track-none { font-size: 12.5px; }
.af-tr {
  display: grid;
  grid-template-columns: 34px 132px minmax(80px, 120px) minmax(0, 1fr);
  align-items: start; gap: 8px;
  padding: 6px 8px; border-radius: 8px; font-size: 12.5px;
  line-height: 1.7; color: #374151;
}
.af-tr + .af-tr { border-top: 1px solid #f2f4f7; }
.af-tr.is-latest { background: #f4f8ff; }
.af-tr-tag {
  flex: none; text-align: center; font-size: 10.5px; font-weight: 700;
  color: #6b7280; padding-top: 1px;
}
.af-tr.is-latest .af-tr-tag { color: #2062e6; }
.af-tr-t { font-variant-numeric: tabular-nums; color: #111; }
.af-tr-n { font-weight: 600; color: #111; }
.af-tr-d { color: #4b5563; overflow-wrap: anywhere; }
@media (max-width: 720px) {
  .af-tr { grid-template-columns: 30px minmax(0, 1fr); }
  .af-tr-t, .af-tr-n, .af-tr-d { grid-column: 2; }
}

/* ---------------- 物流判定元信息 ---------------- */
.af-logi-meta {
  display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px; color: #6b7280;
}
.af-logi-meta b { color: #111; font-weight: 600; }
.af-logi-busy { color: var(--color-text-secondary, #6b7280); }
.af-logi-bsum {
  font-size: 12.5px; color: #374151; margin: 2px 0 10px;
  padding: 8px 12px; background: #f7f9fc; border-radius: 9px;
}
.af-lb-item {
  border: 1px solid var(--color-border, #e4e9f0); border-radius: 11px;
  padding: 10px 12px; margin-bottom: 10px; background: #fff;
}
.af-lb-item.is-none { background: #fafafa; }
.af-lb-head {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  font-size: 13px; margin-bottom: 4px;
}
.af-lb-head b { font-variant-numeric: tabular-nums; }
.af-lb-st { font-size: 11.5px; padding: 1px 7px; border-radius: 999px; background: #eef4ff; color: #1d4ed8; }
.af-lb-n { font-size: 11.5px; color: #6b7280; }
.af-lb-ex { font-size: 11.5px; color: #9aa3af; margin-left: auto; }
.af-lb-none { font-size: 12.5px; }
.af-lb-tk { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.af-lb-miss { font-size: 12px; color: #b45309; margin-top: 8px; }
.af-lb-sum { font-size: 12.5px; color: #374151; margin-bottom: 8px; }
.af-lb-back { margin-bottom: 10px; }
.af-row-link { cursor: pointer; }
.af-row-link:hover td { background: #f7f9fc; }

/* ---------------- 查询框的「笔」：批量粘贴查询（2026-10-31） ---------------- */
.af-pen {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0; margin-left: 2px;
  border: 1px solid var(--color-border, #e4e9f0); border-radius: 8px;
  background: #fff; color: #6b7280; cursor: pointer;
}
.af-pen:hover { border-color: #2062e6; color: #2062e6; background: #f4f8ff; }
.af-pen svg { width: 14px; height: 14px; }

/* ---------------- 通用气泡：表头筛选 / 批量查询 ---------------- */
.af-bub {
  position: fixed; z-index: 97;
  background: #fff; border: 1px solid var(--color-border, #e4e9f0);
  border-radius: 13px; box-shadow: 0 14px 36px rgba(16, 24, 40, .18);
  padding: 10px 12px 11px; max-width: min(420px, calc(100vw - 16px));
}
.af-bub-h {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 12.5px; font-weight: 700; color: #111; margin-bottom: 8px;
}
.af-bub-sub { font-size: 11px; font-weight: 400; color: #9aa3af; margin-left: auto; }
/* 2026-10-31（用户要求）：表头筛选气泡里加「搜索筛选项」的输入框。
   值一多（订单编号几百个）靠肉眼找不现实，输入即过滤。
   ⚠ sycm-theme.css 里给 input 设过 height:28px，这里必须显式覆盖，
     否则 12.5px 字号加 padding 会被裁字。 */
.af-bub-srch {
  display: flex; align-items: center; gap: 6px; margin-bottom: 7px;
}
.af-bub-srch .af-bub-q {
  flex: 1 1 auto; min-width: 0;
  height: auto; min-height: 32px; line-height: 18px;
  padding: 6px 9px; font-size: 12.5px; color: #111;
  border: 1px solid var(--color-border, #e4e9f0); border-radius: 9px;
  background: #fff; box-sizing: border-box;
}
.af-bub-srch .af-bub-q:focus {
  outline: none; border-color: #2062e6;
  box-shadow: 0 0 0 3px rgba(32, 98, 230, .12);
}
.af-bub-srch .link-btn { flex: none; white-space: nowrap; font-size: 12px; }
.af-bub-none {
  padding: 10px 4px 4px; font-size: 12px; color: #9aa3af; text-align: center;
}
.af-bub-ops { display: flex; gap: 12px; margin-bottom: 6px; }
.af-bub-list {
  max-height: 260px; overflow-y: auto;
  border: 1px solid #f2f4f7; border-radius: 9px; padding: 4px;
}
.af-bub-row {
  display: flex; align-items: center; gap: 8px; padding: 5px 7px;
  border-radius: 7px; font-size: 12.5px; color: #374151; cursor: pointer;
}
.af-bub-row:hover { background: #f7f9fc; }
.af-bub-row input { flex: none; }
.af-bub-row span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.af-bub-foot {
  display: flex; align-items: center; gap: 8px; margin-top: 10px;
}
.af-bub-foot .ios-btn { margin-left: auto; }
.af-bub-foot .ios-btn + .ios-btn { margin-left: 0; }
.af-bub-cnt { font-size: 11.5px; color: #9aa3af; }
.af-bub-ta {
  width: 100%; min-height: 132px; resize: vertical;
  border: 1px solid var(--color-border, #e4e9f0); border-radius: 9px;
  padding: 8px 10px; font-size: 12.5px; line-height: 1.6;
  font-family: inherit; color: #111;
}
.af-bub-ta:focus { outline: none; border-color: #2062e6; }
/* 表头可点筛选的提示 */
#view-after table thead th { cursor: pointer; }
#view-after table thead th:hover { color: #2062e6; }
#view-after table thead th.af-th-on {
  color: #2062e6;
  box-shadow: inset 0 -2px 0 #2062e6;
}
.af-filter-note {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: #1d4ed8; background: #eef4ff;
  border-radius: 8px; padding: 6px 11px; margin: 0 0 8px;
}
.af-rel-wb { font-variant-numeric: tabular-nums; color: #111; }
.af-rel-go { margin-left: auto; font-size: 11.5px; color: #2062e6; }
.af-rel-tk { cursor: pointer; }
.af-sop-modal { max-width: 760px; }
.af-sop-modal textarea {
  width: 100%; resize: vertical; min-height: 62px;
  border: 1px solid var(--color-border, #e4e9f0); border-radius: 9px;
  padding: 7px 10px; font-size: 13px; line-height: 1.6; font-family: inherit;
}

/* 移动端：单据中心表格允许横向滚动，别挤成一团 */
@media (max-width: 720px) {
  .af-opts { gap: 7px; }
  .af-opt-title { width: 52px; }
  .af-logi-out { flex-basis: 100%; }
}

/* ==========================================================================
   2026-11 v2：拦截件 / 退货件 / 退货入库台账 / 按单号查
   ========================================================================== */

/* --- 状态标签：5 态 + 异常 + 未知 --- */
.af-st {
  display: inline-block; padding: 1px 8px; border-radius: 10px;
  font-size: 11.5px; line-height: 18px; white-space: nowrap;
  border: 1px solid transparent; font-weight: 600;
}
.af-st-bad  { background: #FFECEC; border-color: #F0B4B4; color: #A11414; }  /* 未拦截成功 / 部分入库 */
.af-st-mid  { background: #EEF4FF; border-color: #BFD3F5; color: #1D4ED8; }  /* 拦截成功 / 运输中 */
.af-st-warn { background: #FFF4E5; border-color: #F0C88A; color: #8A5A00; }  /* 已退回未入库 / 需跟进 */
.af-st-ok   { background: #EAF7EE; border-color: #AADDB9; color: #1B6B34; }  /* 已入库 / 完结 */
.af-st-mut  { background: #F3F4F6; border-color: #C9CDD4; color: #5B6470; }  /* 未算 / 未知 */

/* 单号类型小标签（拦截件 / 退货件 / 寄出件…） */
.af-wbt {
  display: inline-block; padding: 1px 7px; border-radius: 9px;
  font-size: 11px; line-height: 17px; white-space: nowrap;
  background: #F2EDFD; border: 1px solid #CDBBF0; color: #5B3FA8;
}

/* 状态依据列：一行省略，hover 看全文 */
#afIcTable td.af-reason, #afRtTable td.af-reason { max-width: 300px; }

/* --- 分步条（按状态 / 仓库 / 快递） --- */
.af-bars { display: flex; flex-direction: column; gap: 5px; }
.af-bar-row {
  display: grid; grid-template-columns: minmax(56px, 96px) 1fr auto auto;
  align-items: center; gap: 8px; font-size: 12px;
}
.af-bar-label {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: #374151;
}
.af-bar-track {
  display: block; height: 7px; border-radius: 4px; background: #f0f2f5;
  overflow: hidden;
}
.af-bar-track > i {
  display: block; height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, #8FB7F5, #4A82E8);
}
.af-bar-row:nth-child(1) .af-bar-track > i {
  background: linear-gradient(90deg, #F5B26A, #E8892B);
}
.af-bar-n { font-variant-numeric: tabular-nums; color: #1d1d1f; font-weight: 600; }
.af-bar-pct { min-width: 42px; text-align: right; color: #9aa3af; }

/* KPI 卡着色（沿用全局 .kpi-cell，只补语义色） */
.kpi-cell.kpi-warn .kpi-value { color: #8A5A00; }
.kpi-cell.kpi-ok   .kpi-value { color: #1B6B34; }
.kpi-cell.kpi-bad  .kpi-value { color: #A11414; }

/* --- 按单号查 --- */
.af-lk-tags {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 0 0 14px; border-bottom: 1px solid #f0f2f5; margin-bottom: 14px;
}
.af-lk-tagtitle {
  font-size: 12.5px; color: var(--color-text-secondary, #6b7280); margin-right: 4px;
}
.af-lk-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 14px; font-size: 12.5px; font-weight: 600;
  background: #EEF4FF; border: 1px solid #BFD3F5; color: #1D4ED8;
}
.af-lk-tag > b {
  font-size: 11px; padding: 0 6px; border-radius: 8px;
  background: #fff; color: #1D4ED8; font-variant-numeric: tabular-nums;
}
.af-lk-grid {
  display: grid; gap: 10px; margin-bottom: 18px;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
}
.af-lk-card {
  display: flex; flex-direction: column; gap: 4px; text-align: left;
  padding: 12px 14px; border-radius: 12px; cursor: pointer;
  background: #fff; border: 1px solid #e8ebf0;
  transition: border-color .12s, box-shadow .12s, transform .12s;
  font: inherit; color: inherit;
}
.af-lk-card:hover {
  border-color: #BFD3F5; box-shadow: 0 4px 14px rgba(29, 78, 216, .08);
  transform: translateY(-1px);
}
.af-lk-cardtop { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.af-lk-kind { font-size: 12.5px; font-weight: 700; color: #1d1d1f; }
.af-lk-line { font-size: 12px; color: #6b7280; }
.af-lk-note {
  font-size: 12px; color: #8a9099; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.af-lk-meta { font-size: 12.5px; color: #374151; margin: 4px 0 10px; }

/* 移动端：v2 表格允许横向滚动 */
@media (max-width: 720px) {
  #afIcTable, #afRtTable, #afLgTable { min-width: 980px; }
  .af-lk-grid { grid-template-columns: 1fr; }
}


/* 必填星号 */
.af-req { color: #c0392b; font-weight: 700; margin-left: 2px; }

/* 可点击的表格行（理赔/申诉/罚单：点一行 = 打开修改弹窗） */
#afClaimTable tbody tr.af-clickable,
#afAppealTable tbody tr.af-clickable,
#afFineTable tbody tr.af-clickable { cursor: pointer; }
#afClaimTable tbody tr.af-clickable:hover,
#afAppealTable tbody tr.af-clickable:hover,
#afFineTable tbody tr.af-clickable:hover { background: #f2f7ff; }

/* ==========================================================================
   2026-11 修两个表单显示 bug
   --------------------------------------------------------------------------
   bug 1「文字只显示上半部分」根因：
     sycm-theme.css:531 有 `.field input, .field select { height: 28px; }`，
     而售后表单控件是 padding: 8px 11px + font-size: 13px —— 8+8+20+2 = 38px 才够，
     被压到 28px 后文字只剩一半（「退货退款（买家退货登记）」「跟进中」都中招）。
     这里显式 height:auto + min-height + 固定 line-height 覆盖掉。
   bug 2「行内不对齐」根因：
     长标签（如「备用单号（换单/转寄）」）在窄列里换行 → label 变两行高 →
     同一行右边那个 field 的输入框就被顶下去，看起来错位。
     这里给 label 一个统一的「两行高度 + 贴底对齐」，单行/双行标签的输入框都对齐。
   ========================================================================== */
#afForm select, #afForm input, #afForm textarea,
#afRecFields select, #afRecFields input, #afRecFields textarea {
  height: auto;
  min-height: 34px;
  line-height: 20px;
  padding: 6px 11px;
  box-sizing: border-box;
}
#afForm select, #afRecFields select { padding-right: 28px; }
#afForm textarea, #afRecFields textarea {
  min-height: 70px; line-height: 1.6; padding: 8px 11px;
}
/* 日期控件在 Chrome 里有内在高度（比普通 input 高 2px），显式定死，
   保证同一行的 select / input / date 顶端和底部都齐平 */
#afForm input[type="date"], #afRecFields input[type="date"],
#afForm input[type="number"], #afRecFields input[type="number"] {
  height: 34px; min-height: 34px; line-height: 20px;
}

/* 行内对齐：label 统一两行高度并贴底，input 顶部就自然齐平 */
.af-form-grid { gap: 8px 16px; align-items: start; }
.af-form-grid > .field { display: flex; flex-direction: column; }
.af-form-grid > .field > label {
  display: flex; align-items: flex-end;
  min-height: 32px; margin: 0 0 4px;
  line-height: 1.35; word-break: break-word;
}
/* 只占一行的短标签保持紧凑（视觉上别留太多白），但仍然占满同高容器 */
.af-form-grid > .field > label > span.lab {
  display: inline-flex; align-items: baseline; gap: 2px;
}

/* 弹窗里的纯 .field（如单据详情里的编辑块）也别被 28px 压扁 */
.modal .detail-body .field select,
.modal .detail-body .field input { height: auto; min-height: 34px; }

/* ==========================================================================
   截图区（2026-11）：点选 / Ctrl+V 粘贴 / 拖拽，自动压到 200KB 以内
   ========================================================================== */
.af-shot-field { grid-column: 1 / -1; }        /* 截图单独占一行，够大才好拖 */
.af-shot-zone {
  position: relative; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
  min-height: 96px; padding: 12px;
  border: 1.5px dashed #c9d3e0; border-radius: 10px;
  background: #fbfcfe; cursor: pointer;
  transition: border-color .14s, background .14s;
  outline: none;
}
.af-shot-zone:hover { border-color: #9fb6d4; background: #f6f9fe; }
.af-shot-zone:focus-visible { border-color: #4A82E8; box-shadow: 0 0 0 3px rgba(74, 130, 232, .14); }
.af-shot-zone.is-over { border-color: #4A82E8; background: #eef4ff; }
.af-shot-zone.is-busy { opacity: .6; cursor: progress; }
.af-shot-zone.has-img { border-style: solid; background: #fff; padding: 8px; }
.af-shot-hint {
  font-size: 12.5px; color: #8a9099; text-align: center; line-height: 1.7;
}
.af-shot-zone.has-img .af-shot-hint { display: none; }
.af-shot-limit { font-size: 11.5px; color: #a8b0ba; }
.af-shot-prev-wrap { position: relative; display: inline-block; max-width: 100%; }
.af-shot-prev {
  display: block; max-width: 100%; max-height: 220px;
  border-radius: 8px; border: 1px solid #eef1f5; background: #fff;
}
.af-shot-del {
  position: absolute; top: -8px; right: -8px; width: 22px; height: 22px;
  border: none; border-radius: 50%; background: rgba(17, 24, 39, .78);
  color: #fff; font-size: 12px; line-height: 22px; text-align: center;
  cursor: pointer; padding: 0;
}
.af-shot-del:hover { background: #c0392b; }
.af-shot-meta { font-size: 11.5px; color: #8a9099; margin-top: 4px; }

/* ==========================================================================
   批量登记（2026-11）：类 Excel 表格 + Excel 粘贴
   ========================================================================== */
.af-batch-modal { max-width: 1240px; width: calc(100vw - 48px); }
.af-batch-tip {
  background: #f6f9fe; border: 1px solid #e3ecfa; border-radius: 9px;
  padding: 9px 12px; line-height: 1.75; font-size: 12.5px;
}
.af-batch-tools {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 10px 0 8px;
}
.af-batch-stat { font-size: 12px; color: #8a9099; margin-left: auto; }
.af-batch-wrap {
  max-height: 52vh; overflow: auto; border: 1px solid #e8ebf0;
  border-radius: 10px; background: #fff;
}
#afBatchTable { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; }
#afBatchTable thead th {
  position: sticky; top: 0; z-index: 2;
  background: #fafbfc; font-size: 12px; font-weight: 600; color: #6b7280;
  padding: 7px 8px; text-align: left; white-space: nowrap;
  border-bottom: 1px solid #eef1f5; border-right: 1px solid #f4f6f9;
}
#afBatchTable thead th.af-batch-no,
#afBatchTable tbody td.af-batch-no {
  position: sticky; left: 0; z-index: 1;
  background: #fafbfc; width: 44px; min-width: 44px;
  text-align: center; color: #a8b0ba; font-size: 11px;
  border-right: 1px solid #eef1f5;
}
#afBatchTable tbody td { padding: 0; border-bottom: 1px solid #f4f6f9; border-right: 1px solid #f7f9fb; }
#afBatchTable tbody tr:hover td { background: #f9fbff; }
#afBatchTable tbody input {
  width: 100%; min-width: 96px; height: 32px; min-height: 32px;
  border: none; border-radius: 0; padding: 4px 8px;
  font-size: 12.5px; line-height: 20px; background: transparent;
  box-shadow: none;
}
#afBatchTable tbody input[type="date"] { min-width: 132px; }
#afBatchTable tbody input[type="number"] { min-width: 84px; }
#afBatchTable tbody input:focus {
  background: #fff; outline: 2px solid #4A82E8; outline-offset: -2px; border-radius: 3px;
}
@media (max-width: 720px) {
  .af-batch-modal { width: calc(100vw - 16px); max-width: none; }
  .af-batch-wrap { max-height: 46vh; }
}

/* ==========================================================================
   2026-10-30 修「表格竖线错位 / 表头和内容排乱」
   --------------------------------------------------------------------------
   根因不是 DOM 没对齐（实测表头与每一行的列 x 坐标偏移 = 0），而是三件事叠加：
     ① `table-layout: auto`（浏览器默认）→ 列宽由内容决定，
        「状态依据」被长文字撑到 300px、「备注」撑到 180px，其它列被压扁；
     ② 整表被撑到 1399px，外层容器只有 1192px → 横向滚动，
        用户看到的是一段一段的「错位」；
     ③ `td { white-space: nowrap; overflow: visible }` → 长文字**溢出单元格边框**，
        压在右边那一列上，把竖线盖住了 —— 这才是「竖线错位」的视觉来源。
   修法：定宽布局（table-layout: fixed）+ 明确列宽百分比 + 单元格统一 ellipsis 截断，
        全文靠 title 悬浮看。表格宽度锁在容器内，不再横向滚动。
   ========================================================================== */

/* --- 1. 所有售后列表表格：定宽 + 不溢出 + 截断 --- */
#afIcTable, #afRtTable, #afLgTable,
#afTkTable, #afTodoTable,
#afClaimTable, #afAppealTable, #afFineTable {
  table-layout: fixed;
  width: 100%;
  border-collapse: collapse;
}
#afIcTable th, #afIcTable td,
#afRtTable th, #afRtTable td,
#afLgTable th, #afLgTable td,
#afTkTable th, #afTkTable td,
#afTodoTable th, #afTodoTable td,
#afClaimTable th, #afClaimTable td,
#afAppealTable th, #afAppealTable td,
#afFineTable th, #afFineTable td {
  overflow: hidden;              /* 关键：不让文字溢出到隔壁列 */
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
/* 表头：单行不换行，保证表头行高一致 */
#afIcTable thead th, #afRtTable thead th, #afLgTable thead th,
#afTkTable thead th, #afTodoTable thead th,
#afClaimTable thead th, #afAppealTable thead th, #afFineTable thead th {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5;
}
/* 单元格里那两行（主/副）的 span 也要截断，否则 block 会各自溢出 */
#afIcTable td .af-cell-main, #afIcTable td .af-cell-sub,
#afRtTable td .af-cell-main, #afRtTable td .af-cell-sub,
#afLgTable td .af-cell-main, #afLgTable td .af-cell-sub,
#afTkTable td .af-cell-main, #afTkTable td .af-cell-sub,
#afTodoTable td .af-cell-main, #afTodoTable td .af-cell-sub,
#afClaimTable td .af-cell-main, #afClaimTable td .af-cell-sub,
#afAppealTable td .af-cell-main, #afAppealTable td .af-cell-sub,
#afFineTable td .af-cell-main, #afFineTable td .af-cell-sub {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* --- 2. 逐列宽度（百分比，合计 100）---
   比例是按「内容实际长度」定的：订单编号/状态依据/备注要宽，
   日期/仓库/超期/登记人窄。定宽后列宽不再被内容拖动。 */

/* 拦截件 / 退货件：日期 店铺 仓库 订单编号 快递公司 快递单号 单号类型 状态 状态依据 登记人 超期 备注 */
#afIcTable th:nth-child(1),  #afRtTable th:nth-child(1)  { width: 6.5%; }
#afIcTable th:nth-child(2),  #afRtTable th:nth-child(2)  { width: 7%; }
#afIcTable th:nth-child(3),  #afRtTable th:nth-child(3)  { width: 6%; }
#afIcTable th:nth-child(4),  #afRtTable th:nth-child(4)  { width: 14%; }
#afIcTable th:nth-child(5),  #afRtTable th:nth-child(5)  { width: 7.5%; }
#afIcTable th:nth-child(6),  #afRtTable th:nth-child(6)  { width: 11%; }
#afIcTable th:nth-child(7),  #afRtTable th:nth-child(7)  { width: 6.5%; }
#afIcTable th:nth-child(8),  #afRtTable th:nth-child(8)  { width: 8.5%; }
#afIcTable th:nth-child(9),  #afRtTable th:nth-child(9)  { width: 15%; }
#afIcTable th:nth-child(10), #afRtTable th:nth-child(10) { width: 5.5%; }
#afIcTable th:nth-child(11), #afRtTable th:nth-child(11) { width: 4.5%; }
#afIcTable th:nth-child(12), #afRtTable th:nth-child(12) { width: 8%; }

/* 退货入库台账：日期 店铺 仓库 订单编号 快递公司 快递单号 单号类型 状态 登记人 备注 */
#afLgTable th:nth-child(1) { width: 7%; }
#afLgTable th:nth-child(2) { width: 8%; }
#afLgTable th:nth-child(3) { width: 7%; }
#afLgTable th:nth-child(4) { width: 16%; }
#afLgTable th:nth-child(5) { width: 9%; }
#afLgTable th:nth-child(6) { width: 13%; }
#afLgTable th:nth-child(7) { width: 8%; }
#afLgTable th:nth-child(8) { width: 10%; }
#afLgTable th:nth-child(9) { width: 7%; }
#afLgTable th:nth-child(10) { width: 15%; }

/* 单据中心：日期 类型 店铺 订单号/单号 问题大类 状态 物流状态 处理人 超期 备注 */
#afTkTable th:nth-child(1) { width: 7.5%; }
#afTkTable th:nth-child(2) { width: 10%; }
#afTkTable th:nth-child(3) { width: 7.5%; }
#afTkTable th:nth-child(4) { width: 16%; }
#afTkTable th:nth-child(5) { width: 8%; }
#afTkTable th:nth-child(6) { width: 8%; }
#afTkTable th:nth-child(7) { width: 8%; }
#afTkTable th:nth-child(8) { width: 7%; }
#afTkTable th:nth-child(9) { width: 5%; }
#afTkTable th:nth-child(10) { width: 23%; }

/* 超期与待办：超期 日期 类型 店铺 订单号/单号 问题大类 状态 处理人 进度 */
#afTodoTable th:nth-child(1) { width: 5%; }
#afTodoTable th:nth-child(2) { width: 7.5%; }
#afTodoTable th:nth-child(3) { width: 9%; }
#afTodoTable th:nth-child(4) { width: 7.5%; }
#afTodoTable th:nth-child(5) { width: 15%; }
#afTodoTable th:nth-child(6) { width: 8%; }
#afTodoTable th:nth-child(7) { width: 8%; }
#afTodoTable th:nth-child(8) { width: 7%; }
#afTodoTable th:nth-child(9) { width: 33%; }

/* 理赔：日期 店铺 订单号 快递 快递单号 问题大类 金额 渠道 对接人 备注 */
#afClaimTable th:nth-child(1) { width: 8%; }
#afClaimTable th:nth-child(2) { width: 8%; }
#afClaimTable th:nth-child(3) { width: 16%; }
#afClaimTable th:nth-child(4) { width: 8%; }
#afClaimTable th:nth-child(5) { width: 12%; }
#afClaimTable th:nth-child(6) { width: 8%; }
#afClaimTable th:nth-child(7) { width: 7%; }
#afClaimTable th:nth-child(8) { width: 9%; }
#afClaimTable th:nth-child(9) { width: 7%; }
#afClaimTable th:nth-child(10) { width: 17%; }

/* 申诉：日期 店铺 订单号 金额 申诉结果 复核 经办人 备注 */
#afAppealTable th:nth-child(1) { width: 9%; }
#afAppealTable th:nth-child(2) { width: 9%; }
#afAppealTable th:nth-child(3) { width: 20%; }
#afAppealTable th:nth-child(4) { width: 7%; }
#afAppealTable th:nth-child(5) { width: 10%; }
#afAppealTable th:nth-child(6) { width: 10%; }
#afAppealTable th:nth-child(7) { width: 8%; }
#afAppealTable th:nth-child(8) { width: 27%; }

/* 平台罚单：处罚时间 违规类型 违规事件 处罚金额 主订单号 单号 来源 */
#afFineTable th:nth-child(1) { width: 11%; }
#afFineTable th:nth-child(2) { width: 13%; }
#afFineTable th:nth-child(3) { width: 26%; }
#afFineTable th:nth-child(4) { width: 9%; }
#afFineTable th:nth-child(5) { width: 17%; }
#afFineTable th:nth-child(6) { width: 16%; }
#afFineTable th:nth-child(7) { width: 8%; }

/* --- 3. 清掉和定宽布局冲突的旧规则 --- */
/* .af-clip 原来靠 max-width 裁，但在 table-layout:auto 下 max-width 对单元格无效，
   现在统一走上面的 ellipsis，这个类只当"需要裁"的标记用。 */
#afIcTable td.af-clip, #afRtTable td.af-clip, #afLgTable td.af-clip,
#afTkTable td.af-clip, #afTodoTable td.af-clip,
#afClaimTable td.af-clip, #afAppealTable td.af-clip, #afFineTable td.af-clip {
  max-width: none;
}
#afIcTable td.af-reason, #afRtTable td.af-reason { max-width: none; }

/* 日期/金额/超期这类短内容给点右侧留白，数字右对齐更好扫 */
#afIcTable td.num, #afRtTable td.num, #afLgTable td.num,
#afTkTable td.num, #afTodoTable td.num,
#afClaimTable td.num, #afAppealTable td.num, #afFineTable td.num {
  text-align: right;
}

/* 窄屏：允许横向滚动，但每列仍有确定宽度（不会因为内容而抖动） */
@media (max-width: 1180px) {
  #afIcTable, #afRtTable { min-width: 1080px; }
  #afLgTable, #afTkTable, #afTodoTable,
  #afClaimTable, #afAppealTable, #afFineTable { min-width: 940px; }
}

/* ==========================================================================
   表格列宽 · 第二轮（2026-10-30）
   --------------------------------------------------------------------------
   第一轮定了 table-layout:fixed 后对齐是好了，但实测量出来「可读性」不行：
     单元格 padding 是 10px 左 + 16px 右 = 26px 被吃掉，
     77px 宽的日期列只剩 51px，而「2026-10-29」要 66px → 完整日期都看不全。
   这一轮做两件事：
     ① 内边距收窄到 8px（右 16px 是给排序图标留的，表格里没排序所以不需要）；
     ② 按「实际内容像素宽」重排每一列的百分比，保证短字段完整显示，
        长字段（订单编号/状态依据/备注）截断但带 title 悬浮看全文。
   ========================================================================== */

/* ① 内边距：列宽寸土寸金，左右各 8px 就够 */
#afIcTable th, #afIcTable td,
#afRtTable th, #afRtTable td,
#afLgTable th, #afLgTable td,
#afTkTable th, #afTkTable td,
#afTodoTable th, #afTodoTable td,
#afClaimTable th, #afClaimTable td,
#afAppealTable th, #afAppealTable td,
#afFineTable th, #afFineTable td {
  padding-left: 8px;
  padding-right: 8px;
}

/* ② 重排列宽（1440 屏容器 1192px，百分比 × 1192 − 16px = 内容可用宽度） */

/* 拦截件 / 退货件（12 列）：
   日期需66 店铺48 仓库32 订单编号133 快递48 单号110 类型36 状态60 依据227 登记24 超期20 备注 */
#afIcTable th:nth-child(1),  #afRtTable th:nth-child(1)  { width: 8.5%; }  /* 日期   101-16=85  ✓ */
#afIcTable th:nth-child(2),  #afRtTable th:nth-child(2)  { width: 7%; }    /* 店铺    83-16=67  ✓ */
#afIcTable th:nth-child(3),  #afRtTable th:nth-child(3)  { width: 5.5%; }  /* 仓库    66-16=50  ✓ */
#afIcTable th:nth-child(4),  #afRtTable th:nth-child(4)  { width: 14%; }   /* 订单编号167-16=151 ✓ */
#afIcTable th:nth-child(5),  #afRtTable th:nth-child(5)  { width: 7%; }    /* 快递公司83-16=67  ✓ */
#afIcTable th:nth-child(6),  #afRtTable th:nth-child(6)  { width: 12%; }   /* 快递单号143-16=127 ✓ */
#afIcTable th:nth-child(7),  #afRtTable th:nth-child(7)  { width: 6%; }    /* 单号类型 72-16=56  ✓ */
#afIcTable th:nth-child(8),  #afRtTable th:nth-child(8)  { width: 8.5%; }  /* 状态   101-16=85  ✓ */
#afIcTable th:nth-child(9),  #afRtTable th:nth-child(9)  { width: 15.5%; } /* 状态依据185-16=169 截断 */
#afIcTable th:nth-child(10), #afRtTable th:nth-child(10) { width: 5%; }    /* 登记人   60-16=44  ✓ */
#afIcTable th:nth-child(11), #afRtTable th:nth-child(11) { width: 4.5%; }  /* 超期     54-16=38  ✓ */
#afIcTable th:nth-child(12), #afRtTable th:nth-child(12) { width: 6.5%; }  /* 备注     77-16=61  截断 */

/* 退货入库台账（10 列） */
#afLgTable th:nth-child(1) { width: 8.5%; }   /* 日期 */
#afLgTable th:nth-child(2) { width: 7.5%; }   /* 店铺 */
#afLgTable th:nth-child(3) { width: 6%; }     /* 仓库 */
#afLgTable th:nth-child(4) { width: 16%; }    /* 订单编号 */
#afLgTable th:nth-child(5) { width: 8%; }     /* 快递公司 */
#afLgTable th:nth-child(6) { width: 13%; }    /* 快递单号 */
#afLgTable th:nth-child(7) { width: 7%; }     /* 单号类型 */
#afLgTable th:nth-child(8) { width: 10%; }    /* 状态 */
#afLgTable th:nth-child(9) { width: 6%; }     /* 登记人 */
#afLgTable th:nth-child(10) { width: 18%; }   /* 备注 */

/* 单据中心（10 列）：日期 类型 店铺 订单号/单号 问题大类 状态 物流状态 处理人 超期 备注 */
#afTkTable th:nth-child(1) { width: 8.5%; }
#afTkTable th:nth-child(2) { width: 10%; }
#afTkTable th:nth-child(3) { width: 7.5%; }
#afTkTable th:nth-child(4) { width: 16%; }
#afTkTable th:nth-child(5) { width: 8%; }
#afTkTable th:nth-child(6) { width: 8%; }
#afTkTable th:nth-child(7) { width: 8%; }
#afTkTable th:nth-child(8) { width: 7%; }
#afTkTable th:nth-child(9) { width: 5%; }
#afTkTable th:nth-child(10) { width: 22%; }

/* 超期与待办（9 列）：超期 日期 类型 店铺 订单号/单号 问题大类 状态 处理人 进度 */
#afTodoTable th:nth-child(1) { width: 5%; }
#afTodoTable th:nth-child(2) { width: 8.5%; }
#afTodoTable th:nth-child(3) { width: 9%; }
#afTodoTable th:nth-child(4) { width: 7.5%; }
#afTodoTable th:nth-child(5) { width: 15%; }
#afTodoTable th:nth-child(6) { width: 8%; }
#afTodoTable th:nth-child(7) { width: 8%; }
#afTodoTable th:nth-child(8) { width: 7%; }
#afTodoTable th:nth-child(9) { width: 32%; }

/* 理赔（10 列）：日期 店铺 订单号 快递 快递单号 问题大类 金额 渠道 对接人 备注 */
#afClaimTable th:nth-child(1) { width: 8.5%; }
#afClaimTable th:nth-child(2) { width: 8%; }
#afClaimTable th:nth-child(3) { width: 16%; }
#afClaimTable th:nth-child(4) { width: 8%; }
#afClaimTable th:nth-child(5) { width: 12.5%; }
#afClaimTable th:nth-child(6) { width: 8%; }
#afClaimTable th:nth-child(7) { width: 6.5%; }
#afClaimTable th:nth-child(8) { width: 9%; }
#afClaimTable th:nth-child(9) { width: 7%; }
#afClaimTable th:nth-child(10) { width: 16.5%; }

/* 申诉（8 列）：日期 店铺 订单号 金额 申诉结果 复核 经办人 备注 */
#afAppealTable th:nth-child(1) { width: 9.5%; }
#afAppealTable th:nth-child(2) { width: 9%; }
#afAppealTable th:nth-child(3) { width: 20%; }
#afAppealTable th:nth-child(4) { width: 7%; }
#afAppealTable th:nth-child(5) { width: 10%; }
#afAppealTable th:nth-child(6) { width: 10%; }
#afAppealTable th:nth-child(7) { width: 8%; }
#afAppealTable th:nth-child(8) { width: 26.5%; }

/* 平台罚单（7 列）：处罚时间 违规类型 违规事件 处罚金额 主订单号 单号 来源 */
#afFineTable th:nth-child(1) { width: 11%; }
#afFineTable th:nth-child(2) { width: 13%; }
#afFineTable th:nth-child(3) { width: 26%; }
#afFineTable th:nth-child(4) { width: 9%; }
#afFineTable th:nth-child(5) { width: 17%; }
#afFineTable th:nth-child(6) { width: 16%; }
#afFineTable th:nth-child(7) { width: 8%; }

/* 金额、超期、账龄这类数字列：右对齐 + 等宽数字，竖着扫更整齐 */
#afClaimTable td.num, #afAppealTable td.num, #afFineTable td.num,
#afIcTable td.num, #afRtTable td.num, #afLgTable td.num,
#afTkTable td.num, #afTodoTable td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
/* 日期列也用等宽数字，避免每行宽度细微不同 */
#afIcTable td:nth-child(1), #afRtTable td:nth-child(1),
#afLgTable td:nth-child(1), #afTkTable td:nth-child(1),
#afTodoTable td:nth-child(2), #afClaimTable td:nth-child(1),
#afAppealTable td:nth-child(1), #afFineTable td:nth-child(1) {
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   2026-10-31（用户反馈三批）新增的几组样式
   ① 分布统计默认折叠  ② 物流查询独立面板（含本机记录）  ③ 每页条数下拉
   ========================================================================== */

/* ---------------- ① 分布统计：默认折叠，点按钮展开 ---------------- */
.af-dist { margin: 10px 0 2px; }
.af-dist-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--color-border, #e4e9f0); background: #fff;
  border-radius: 9px; padding: 6px 12px; font-size: 12.5px;
  color: #374151; cursor: pointer;
}
.af-dist-toggle:hover { border-color: #2062e6; color: #2062e6; }
.af-dist-toggle svg {
  width: 11px; height: 11px; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  transition: transform .16s ease;
}
.af-dist-toggle.open svg { transform: rotate(180deg); }
.af-dist-body { margin-top: 10px; }

/* 2026-11 用户要求（第 5 条）：把「分布统计 · 按状态 / 按快递 / 按店铺」改成
   「查看统计图」，并移到标题那一行的「共 N 条｜待跟进 …」右边居中。
   所以在 h2 里要能跟文字基线对齐，且比原来更紧凑。 */
h2 > .af-dist-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 10px;
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 500;
  line-height: 20px;
  border-radius: 7px;
  vertical-align: middle;
}
h2 > .af-dist-toggle svg { width: 10px; height: 10px; }

/* ==========================================================================
   表格多选 + 导出 / 复制（2026-11 用户要求 1、2、3、6）
   ========================================================================== */
.af-selth {
  width: 34px;
  min-width: 34px;
  padding-left: 6px !important;
  padding-right: 0 !important;
  text-align: center;
}
.af-selcell {
  width: 34px;
  min-width: 34px;
  padding-left: 6px !important;
  padding-right: 0 !important;
  text-align: center;
}
.af-ck, .af-ck-all {
  width: 16px;
  height: 16px;
  margin: 0;
  vertical-align: middle;
  cursor: pointer;
  accent-color: var(--color-primary, #2062e6);
}

/* 订单编号格：文字（点开弹窗）+ 右边复制按钮 */
.af-ordercell { white-space: nowrap; }
.af-ord-link {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 600;
  color: var(--color-primary, #2062e6);
  cursor: pointer;
  text-decoration: none;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
.af-ord-link:hover { text-decoration: underline; }
.af-copy-one {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-left: 4px;
  padding: 0;
  border: 1px solid var(--color-border, #e4e9f0);
  border-radius: 5px;
  background: #fff;
  color: #6b7280;
  cursor: pointer;
  vertical-align: middle;
  flex: none;
}
.af-copy-one:hover { border-color: #2062e6; color: #2062e6; }
.af-copy-one svg {
  width: 12px; height: 12px;
  fill: none; stroke: currentColor; stroke-width: 1.4;
}
/* 快递单号：点文字直接复制 */
.af-wbcell { white-space: nowrap; }
.af-copy-text {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
.af-copy-text:hover { color: #2062e6; text-decoration: underline dotted; }

/* 勾选后出现的工具条 */
.af-selbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 0;
  padding: 8px 12px;
  border: 1px solid #cfe0ff;
  border-radius: 10px;
  background: #f2f7ff;
}
.af-selbar[hidden] { display: none !important; }
.af-selbar-n { font-size: 12.5px; color: #374151; }
.af-selbar-n b { color: #2062e6; font-size: 14px; }
.af-selbar .link-btn { margin-left: auto; }

/* ---------------- ② 物流查询面板 ---------------- */
.af-logi-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 16px; margin-top: 12px; align-items: start;
}
@media (max-width: 1180px) {
  .af-logi-panel { grid-template-columns: 1fr; }
}
.af-logi-res { min-width: 0; }
.af-logi-hist {
  min-width: 0; background: #fafbfc; border: 1px solid var(--color-border, #e4e9f0);
  border-radius: 12px; padding: 10px 12px 12px;
}
.af-logi-histhead {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 8px;
}
.af-logi-histhead .af-sub-title { margin: 0; }
.af-logi-histhead b { color: #111; font-variant-numeric: tabular-nums; }
.af-logi-histlist { max-height: 520px; overflow-y: auto; }
.af-lh-row {
  display: grid;
  grid-template-columns: minmax(88px, 1fr) 62px 52px minmax(56px, 76px) 74px;
  gap: 8px; align-items: center;
  padding: 6px 8px; border-radius: 8px; font-size: 12px; cursor: pointer;
}
.af-lh-row:hover { background: #eef4ff; }
.af-lh-row + .af-lh-row { border-top: 1px solid #f2f4f7; }
.af-lh-wb {
  font-variant-numeric: tabular-nums; font-weight: 600; color: #111;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.af-lh-row.is-none .af-lh-wb { color: #9aa3af; }
.af-lh-st { color: #1d4ed8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.af-lh-row.is-none .af-lh-st { color: #9aa3af; }
.af-lh-n { color: #6b7280; font-variant-numeric: tabular-nums; }
.af-lh-ex { color: #9aa3af; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.af-lh-at { color: #9aa3af; text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) {
  .af-lh-row { grid-template-columns: minmax(0, 1fr) 52px 44px; }
  .af-lh-ex, .af-lh-at { display: none; }
}

/* ---------------- ③ 每页条数下拉（分页器左侧 / 数据页底部） ---------------- */
/* ⚠ sycm-theme.css 里有 `select{height:28px}` 这类全局规则，这里用更高优先级压住。
   2026-10-31：数据页也加了同一个下拉（#dtPageSize），所以选择器放宽到全局 select.pg-size。 */
.mk-pager .pg-size,
.mk-pager select.pg-size,
select.pg-size {
  display: inline-block;
  height: 24px; min-height: 24px; line-height: 22px;
  padding: 0 20px 0 6px; margin: 0 2px;
  border: 1px solid var(--color-border, #e4e9f0); border-radius: 7px;
  background: #fff; font-size: 12px; color: #374151;
  vertical-align: middle; cursor: pointer;
}
.mk-pager select.pg-size:focus,
select.pg-size:focus {
  outline: none; border-color: #2062e6;
}
/* 数据页「每页 N 条 · 显示更多」那一行 */
.dt-psz-wrap {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: #6b7280; margin-right: 10px;
}

/* 单据详情里「各单号的物流轨迹」逐条块（2026-11 第 7 条：换单号也要能看到自己的轨迹） */
.af-wbtrack {
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid #eef1f5;
  border-radius: 10px;
  background: #fbfcfe;
}
.af-wbtrack .af-track-block { margin-bottom: 0; }
.af-wbtrack-q { margin-top: 6px; }