/* 真实网站新增样式（在 style.css 之上） */
.loading { padding: 48px; text-align: center; color: #898781; }
.empty { padding: 32px; text-align: center; color: #898781; }
.link.danger { color: #d03b3b; }
.logout { margin-left: auto; cursor: pointer; color: #8ba1b8; font-size: 12px; white-space: nowrap; }
.logout:hover { color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.row-actions { white-space: nowrap; }
.row-actions .link { margin-right: 10px; }
.mt8 { margin-top: 8px; }

/* ===== 拜访打卡：现场照片 ===== */
.photo-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-thumb { position: relative; width: 72px; height: 72px; border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-del { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; line-height: 20px; text-align: center; background: rgba(11,11,11,0.6); color: #fff; border-radius: 50%; font-size: 12px; cursor: pointer; }
.photo-add { width: 72px; height: 72px; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--brand); border-radius: var(--r-sm); color: var(--brand); font-size: 22px; cursor: pointer; background: transparent; }
.photo-add:hover { background: var(--surface-2); }

/* ===== 拜访打卡：我的打卡记录（按日期） ===== */
.punch-day { margin-bottom: 14px; }
.punch-day-h { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 8px; color: var(--ink-2); }
.punch-item { border: 1px solid var(--border); border-radius: var(--r); padding: 12px 14px; background: var(--surface); box-shadow: var(--shadow); margin-bottom: 8px; }
.punch-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.punch-head b { font-size: 14px; }
.punch-meta { margin: 4px 0 0; font-size: 12px; color: var(--ink-2); }
.punch-note { margin-top: 4px; font-size: 12px; color: var(--ink-2); }
.punch-photos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.punch-photos img { width: 64px; height: 64px; object-fit: cover; border: 1px solid var(--border); border-radius: var(--r-sm); cursor: pointer; background: var(--surface-2); }

/* 表单里的 select / textarea 与 input 统一（拜访打卡等卡片内表单） */
.field select, .field textarea {
  width: 100%; min-height: 42px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  font-size: 14px; font-family: inherit; background: #fff; color: var(--ink);
}
.field select:focus, .field textarea:focus { border-color: var(--brand); outline: none; }

/* ===== 订单：产品名称搜索下拉 ===== */
.prod-search { position: relative; }
.o_suggest { position: absolute; top: 100%; left: 0; right: 0; max-height: 240px; overflow-y: auto; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.14); z-index: 40; display: none; margin-top: 4px; }
.o_suggest.on { display: block; }
.o-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; cursor: pointer; font-size: 14px; border-bottom: 1px solid var(--hairline); }
.o-opt:last-child { border-bottom: none; }
.o-opt:hover { background: var(--surface-2); }
.o-opt .muted { color: var(--muted); font-size: 12px; white-space: nowrap; }


/* ===== 订单/价格/对账/返利/售后/公告等页面补充 ===== */
.filters { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.filters input, .filters select { padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--r-sm); font-size: 13px; outline: none; background: #fff; }
.filters .spacer { flex: 1; }

.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; font-size: 13px; }
.kv .full { grid-column: 1 / -1; }
.kv > div { padding: 6px 0; border-bottom: 1px dashed var(--hairline); }

.hint { font-size: 12px; color: var(--muted); background: var(--surface-2); border-radius: 6px; padding: 8px 10px; margin-top: 8px; }

.voucher-img { max-width: 220px; max-height: 220px; border: 1px solid var(--border); border-radius: 8px; cursor: zoom-in; display: block; }

.inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.inline input { width: auto; }

.as-thumb { width: 80px; height: 80px; object-fit: cover; }

.btn.danger { color: #d03b3b; border-color: rgba(208, 59, 59, 0.35); }
.btn.danger:hover { background: #fbe5e5; }

/* =========================================================
   v2.1 视觉优化：页面骨架、客户信息卡、移动端通用细节
   ========================================================= */

/* 页面头（标题 + 副标题 + 主操作） */
.pg-hd { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:14px; }
.pg-hd .t { font-size:20px; font-weight:700; letter-spacing:-.2px; }
.pg-hd .s { font-size:12.5px; color:var(--muted); margin-top:3px; }

/* 统计条 */
.stat-strip { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin-bottom:14px; }
.stat { background:var(--surface); border:1px solid var(--border); border-radius:12px; padding:12px 14px; }
.stat b { display:block; font-size:19px; font-weight:700; letter-spacing:-.3px; font-variant-numeric:tabular-nums; white-space:nowrap; }
.stat span { font-size:12px; color:var(--muted); }

/* 搜索 + 筛选 chips */
.list-tools { position:sticky; top:-1px; z-index:20; background:var(--page); padding:6px 0 8px; }
.search-box { display:flex; align-items:center; gap:8px; height:44px; padding:0 12px; background:var(--surface); border:1px solid var(--border); border-radius:12px; }
.search-box .ic { flex:none; width:16px; height:16px; color:var(--muted); display:block; }
.search-box input { flex:1; min-width:0; border:none; outline:none; background:transparent; font-size:15px; color:var(--ink); }
.chips { display:flex; gap:8px; overflow-x:auto; padding:10px 0 2px; scrollbar-width:none; }
.chips::-webkit-scrollbar { display:none; }
.chip-f { flex:none; padding:7px 13px; border-radius:999px; border:1px solid var(--border); background:var(--surface); color:var(--ink-2); font-size:13px; }
.chip-f.on { background:var(--brand); border-color:var(--brand); color:#fff; font-weight:600; }

/* 客户信息卡（手机端） */
.c-list { display:flex; flex-direction:column; gap:10px; min-width:0; }
.c-card { min-width:0; max-width:100%; background:var(--surface); border:1px solid var(--border); border-radius:14px; padding:14px; box-shadow:0 1px 2px rgba(11,11,11,.04); }
.c-top { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; min-width:0; }
.c-name { min-width:0; font-size:16px; font-weight:700; line-height:1.35; overflow-wrap:anywhere; }
.c-tags { display:flex; flex-wrap:wrap; gap:5px; justify-content:flex-end; flex:none; }
.c-tags .tag { font-size:11px; padding:2px 7px; border-radius:999px; }
.c-sub { display:flex; flex-wrap:wrap; gap:4px 12px; margin-top:6px; font-size:13px; color:var(--ink-2); min-width:0; }
.c-sub a.c-tel { color:var(--brand); text-decoration:none; border-bottom:1px solid rgba(42,120,214,.28); }
.c-credit { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 10px; margin-top:10px; font-size:13px; color:var(--ink-2); }
.c-credit b { font-size:16px; color:var(--ink); font-variant-numeric:tabular-nums; }
.c-bar { height:5px; margin-top:8px; border-radius:999px; background:var(--surface-2); overflow:hidden; }
.c-bar i { display:block; height:100%; border-radius:999px; background:var(--brand); }
.c-bar.warn i { background:var(--warn); }
.c-bar.crit i { background:var(--crit); }
.c-foot { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; margin-top:12px; padding-top:10px; border-top:1px dashed var(--hairline); }
.c-state { display:flex; gap:6px; flex-wrap:wrap; }
.c-acts { display:flex; flex-wrap:wrap; gap:12px; font-size:13.5px; }

/* 表格 */
.tbl-wrap { overflow-x:auto; }
.tbl thead th { position:sticky; top:0; z-index:1; background:var(--surface); }
.tbl-cust { table-layout:fixed; width:100%; }
.tbl-cust th { word-break:keep-all; }
.tbl-cust td { word-break:keep-all; }
.tbl-cust td:first-child { word-break:normal; }
.tbl-cust td, .tbl-cust th { overflow-wrap:anywhere; }
.tbl-cust .sub { white-space:normal; }
.tbl-cust td:first-child .sub { display:-webkit-box; -webkit-line-clamp:1; -webkit-box-orient:vertical; overflow:hidden; }
.tbl-cust td:first-child > span.link { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.tbl-cust td { padding-top:10px; padding-bottom:10px; }
.tbl-cust .tag, .tbl-cust .row-actions span { white-space:nowrap; }
.row-actions { display:flex; flex-wrap:wrap; gap:2px 8px; justify-content:flex-end; }
.sub { font-size:12px; color:var(--muted); margin-top:2px; font-weight:400; }
.ta-r { text-align:right; }

/* 详情页头 + 快捷操作 */
.detail-hd { display:flex; align-items:center; gap:10px; margin-bottom:14px; }
.detail-hd .dh-main { flex:1; min-width:0; }
.dh-name { display:flex; align-items:center; gap:8px; flex-wrap:wrap; font-size:17px; font-weight:700; }
.dh-sub { margin-top:3px; font-size:12.5px; color:var(--muted); word-break:break-all; }
.dh-sub a { color:var(--brand); text-decoration:none; }
.qact { display:flex; gap:8px; flex-wrap:wrap; margin:14px 0; }
.qact .btn { flex:1; min-width:92px; }

/* 悬浮新建按钮（仅手机） */
.fab { display:none; }

@media (max-width:768px) {
  .content { padding-bottom:84px; overflow-x:hidden; }
  .pg-hd { align-items:center; margin-bottom:10px; }
  .pg-hd .t { display:none; }
  .pg-hd .s { margin-top:0; font-size:12.5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .pg-hd .btn { display:none; }
  .stat-strip { display:none; }
  .pg-hd .btn { padding:8px 12px; font-size:13px; min-height:38px; }
  .stat-strip { grid-template-columns:repeat(2,1fr); gap:8px; }
  .stat { padding:10px 12px; border-radius:10px; }
  .stat b { font-size:17px; }
  .list-tools { padding:4px 0 6px; }
  .c-card { padding:13px 14px; }
  .c-acts { gap:14px; }
  .c-acts .link { padding:4px 2px; }
  .fab { display:flex; position:fixed; right:16px; bottom:74px; z-index:40; width:52px; height:52px; align-items:center; justify-content:center; border:none; border-radius:50%; background:var(--brand); color:#fff; font-size:26px; line-height:1; box-shadow:0 6px 20px rgba(42,120,214,.38); }
  .tabs { overflow-x:auto; flex-wrap:nowrap; scrollbar-width:none; margin-bottom:10px; }
  .tabs::-webkit-scrollbar { display:none; }
  .tab { flex:none; padding:9px 14px; }
  table.as-cards td:empty { display:none; }
  .card .card-b { padding:14px; }
  .detail-hd .btn { min-height:36px; }
}

/* ---------- 移动端通用：表格 → 两列信息卡 ---------- */
@media (max-width:768px) {
  table.as-cards { display:block; }
  table.as-cards tbody { display:block; }
  table.as-cards tr { display:grid; grid-template-columns:1fr 1fr; column-gap:12px; row-gap:2px; padding:12px 14px; }
  table.as-cards td { display:flex; align-items:baseline; justify-content:space-between; gap:8px; min-width:0; padding:4px 0; border:0; font-size:13px; text-align:right; overflow-wrap:anywhere; }
  table.as-cards td > div { display:inline; }
  table.as-cards td::before { content:attr(data-label); flex:none; color:var(--muted); font-size:12px; font-weight:400; text-align:left; }
  table.as-cards td:first-child { grid-column:1 / -1; padding:0 0 8px; margin-bottom:4px; border-bottom:1px dashed var(--hairline); font-size:15px; font-weight:700; text-align:left; }
  table.as-cards td:first-child::before { display:none; }
  table.as-cards td:last-child:not(:first-child) { grid-column:1 / -1; justify-content:flex-end; gap:12px; padding-top:8px; }
  table.as-cards td:last-child:not(:first-child)::before { display:none; }
  table.as-cards td:empty { display:none; }

  .toolbar, .filters { flex-wrap:wrap; gap:8px; }
  .toolbar select, .filters select, .toolbar input, .filters input { min-width:0; max-width:100%; }
  .toolbar .btn, .filters .btn { flex:none; }
}

/* 移动端：工作台/图表卡改为单列，多标签单元格独占整行 */
@media (max-width:768px) {
  .grid.cols-2 { grid-template-columns:1fr; gap:12px; }
  .grid.cols-3 { grid-template-columns:repeat(3,1fr); gap:8px; }
  .grid.cols-3 .tile { padding:10px; }
  .grid.cols-3 .tile .value { font-size:18px; }
  .grid.cols-3 .tile .label { font-size:11px; }
  .grid.cols-4 { grid-template-columns:1fr 1fr; gap:10px; }
  .tile .value { font-size:22px; }
  table.as-cards td:has(.tag + .tag) { grid-column:1 / -1; justify-content:flex-start; flex-wrap:wrap; gap:6px; padding-top:6px; }
  table.as-cards td .tag { white-space:nowrap; flex:none; }
  table.as-cards td:has(.tag + .tag)::before { flex:0 0 100%; }
}

/* 详情页头部（手机） */
@media (max-width:768px) {
  .detail-hd { align-items:flex-start; gap:8px; }
  .detail-hd > .btn:first-child { flex:none; width:36px; min-height:36px; padding:0; font-size:16px; line-height:1; }
  .detail-hd .dh-main { min-width:0; }
  .dh-name { font-size:16px; line-height:1.35; }
  .detail-hd > .btn:last-child { flex:none; padding:7px 12px; font-size:13px; min-height:34px; }
  .dh-sub { font-size:12px; }
  .qact .btn { min-height:40px; font-size:13.5px; }
}

/* 订单表：固定列宽，避免长文本把每列挤成竖排 */
#ordTbl { table-layout:fixed; width:100%; }
#ordTbl th:nth-child(1) { width:17%; }
#ordTbl th:nth-child(2) { width:16%; }
#ordTbl th:nth-child(3) { width:9%; }
#ordTbl th:nth-child(4) { width:6%; }
#ordTbl th:nth-child(5) { width:7%; }
#ordTbl th:nth-child(6) { width:12%; }
#ordTbl th:nth-child(7) { width:7%; }
#ordTbl th:nth-child(8) { width:11%; }
#ordTbl th:nth-child(9) { width:15%; }
#ordTbl td, #ordTbl th { overflow-wrap:anywhere; }
#ordTbl td:nth-child(1), #ordTbl td:nth-child(3), #ordTbl td:nth-child(6), #ordTbl td:nth-child(7) { white-space:nowrap; }
#ordTbl td .tag { white-space:nowrap; }
#ordTbl .row-actions { display:flex; flex-wrap:wrap; gap:2px 8px; justify-content:flex-end; }

/* 桌面端宽表：内容宽度优先，超出时横向滚动而不是挤压成竖排 */
@media (min-width:769px) {
  .card > .tbl-wrap, .tbl-wrap { overflow-x:auto; }
  .card > .tbl-wrap > table:not(.tbl-cust):not(#ordTbl):not(#prodTbl), .tbl-wrap > table:not(.tbl-cust):not(#ordTbl):not(#prodTbl) { width:max-content; min-width:100%; }
  .card > .tbl-wrap > table:not(.tbl-cust) td .tag, .card > .tbl-wrap > table:not(.tbl-cust) td .status { white-space:nowrap; }
}

/* 产品表：固定列宽，10 列一屏放得下 */
#prodTbl { table-layout:fixed; width:100% !important; min-width:0 !important; }
#prodTbl th, #prodTbl td { padding:10px 8px; }
#prodTbl th:nth-child(1) { width:18%; }
#prodTbl th:nth-child(2) { width:13%; }
#prodTbl th:nth-child(3) { width:16%; }
#prodTbl th:nth-child(4) { width:10%; }
#prodTbl th:nth-child(5) { width:7%; }
#prodTbl th:nth-child(6) { width:11%; }
#prodTbl th:nth-child(7) { width:8%; }
#prodTbl th:nth-child(8) { width:5%; }
#prodTbl th:nth-child(9) { width:6%; }
#prodTbl th:nth-child(10) { width:8%; }
#prodTbl td { overflow-wrap:anywhere; }
#prodTbl td:nth-child(n+5) { white-space:nowrap; }
#prodTbl td .tag { white-space:nowrap; }
#prodTbl .row-actions, #prodTbl td:last-child { display:flex; flex-wrap:wrap; gap:2px 6px; justify-content:flex-end; }

/* =========================================================
   v2.2 表单控件统一 + 空状态
   ========================================================= */
body:not(.is-mall) select,
body:not(.is-mall) input[type=text],
body:not(.is-mall) input[type=date],
body:not(.is-mall) input[type=number],
body:not(.is-mall) input[type=password],
body:not(.is-mall) input[type=search],
body:not(.is-mall) input:not([type]),
body:not(.is-mall) textarea {
  min-height:36px;
  padding:7px 10px;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--surface);
  color:var(--ink);
  font-size:13.5px;
  font-family:inherit;
  box-sizing:border-box;
}
body:not(.is-mall) select:focus,
body:not(.is-mall) input:focus,
body:not(.is-mall) textarea:focus {
  border-color:var(--brand);
  outline:none;
  box-shadow:0 0 0 3px rgba(42,120,214,.15);
}
body:not(.is-mall) select { cursor:pointer; }

/* 搜索框内的输入不再叠加边框 */
.search-box input,
.search-box input:not([type]) {
  min-height:0 !important;
  padding:0 !important;
  border:none !important;
  box-shadow:none !important;
  background:transparent !important;
  font-size:15px !important;
}

/* 空状态 */
.empty {
  margin:8px 0;
  padding:36px 18px;
  text-align:center;
  color:var(--muted);
  font-size:13.5px;
  line-height:1.7;
  background:var(--surface-2);
  border:1px dashed var(--hairline);
  border-radius:12px;
}
.empty::before {
  content:"";
  display:block;
  width:36px;
  height:36px;
  margin:0 auto 10px;
  border-radius:50%;
  background:var(--surface) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23898781' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M4 7h16M4 12h16M4 17h10'/%3E%3C/svg%3E") center/18px no-repeat;
  border:1px solid var(--border);
}

/* 页面顶部说明文字（.kpi-note 在手机上更紧凑） */
@media (max-width:768px) {
  .kpi-note { font-size:12.5px; line-height:1.65; }
  body:not(.is-mall) select,
  body:not(.is-mall) input[type=text],
  body:not(.is-mall) input[type=date],
  body:not(.is-mall) input[type=number],
  body:not(.is-mall) input[type=password],
  body:not(.is-mall) input[type=search],
  body:not(.is-mall) input:not([type]),
  body:not(.is-mall) textarea {
    min-height:44px;
    padding:10px 12px;
    font-size:16px;
    border-radius:10px;
    width:100%;
  }
  body:not(.is-mall) .toolbar select,
  body:not(.is-mall) .filters select,
  body:not(.is-mall) .toolbar input,
  body:not(.is-mall) .filters input { width:100% !important; }
  body:not(.is-mall) .row-actions { gap:6px 12px; }
  body:not(.is-mall) .card-h { font-size:14px; }
}

/* 价格页 */
.price-filter { width:180px; }
.price-hd { align-items:center; }
.price-sum { margin:2px 0 10px; }
@media (max-width:768px) {
  .price-filter { width:100% !important; }
  .price-hd { gap:6px 8px; }
  .price-hd b { font-size:15px; }
  #priceCustTbl td:first-child { font-size:15px; }
}

/* =========================================================
   v2.3 订单手机卡片（每项单行，不折行）
   ========================================================= */
.o-card { padding:12px 14px; }
.o-top { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:6px; }
.o-no { font-weight:700; font-size:14px; color:var(--brand); }
.o-line { display:flex; align-items:baseline; gap:8px; min-width:0; font-size:13px; line-height:1.55; }
.o-k { flex:none; width:26px; color:var(--muted); font-size:12px; }
.o-v { flex:1 1 auto; min-width:0; text-align:right; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.o-cust { text-align:left; font-weight:600; font-size:14px; }
.o-sub { flex:none; color:var(--muted); font-size:12px; white-space:nowrap; }
.o-money { margin:2px 0; }
.o-amt { flex:none; font-weight:700; font-size:16px; color:var(--ink); }
.o-time { flex:none; margin-left:auto; color:var(--muted); font-size:12px; white-space:nowrap; }
.o-acts { display:flex; flex-wrap:wrap; gap:4px 14px; justify-content:flex-end; margin-top:8px; padding-top:8px; border-top:1px dashed var(--hairline); }
.o-acts .link { font-size:13px; }
.o-range-tip { display:flex; align-items:center; gap:10px; margin:4px 0 8px; font-size:12.5px; color:var(--muted); }
.o-range-tip:empty { display:none; }
.o-range { background:var(--surface-2); border-radius:20px; padding:3px 10px; white-space:nowrap; }

@media (max-width:768px) {
  body:not(.is-mall) .filters .ord-date { width:calc(50% - 5px) !important; }
  body:not(.is-mall) .filters #ord_q { width:100% !important; }
  .o-card { padding:12px 14px; }
  .o-cust { max-width:none; }
}

/* 订单日期快捷区间 */
.o-presets { display:flex; flex-wrap:wrap; gap:6px; width:100%; margin:2px 0 2px; }
.o-presets .chip-f { font-size:12.5px; padding:5px 12px; border-radius:20px; border:1px solid var(--border); background:var(--surface); color:var(--ink-2); cursor:pointer; }
.o-presets .chip-f.on { background:var(--brand); border-color:var(--brand); color:#fff; }

/* 表格内空状态：不要被单元格压成窄条 */
td > .empty { min-width:240px; margin:6px auto; }

/* 手机端隐藏（交给悬浮按钮） */
@media (max-width:768px) {
  .hide-m { display:none !important; }
}

/* =========================================================
   v2.4 Excel 导入弹窗
   ========================================================= */
.xl-entry { flex:none; padding:7px 12px; font-size:13px; }
.xl-res { margin-top:8px; }
.xl-res .kv { display:grid; grid-template-columns:1fr 1fr; gap:6px 14px; background:var(--surface-2); border-radius:10px; padding:10px 12px; }
.xl-res .kv-i { display:flex; justify-content:space-between; gap:8px; font-size:13.5px; }
.xl-res .kv-i span { color:var(--muted); }
.xl-err { margin-top:10px; background:#fdf3f2; border:1px solid #f3d6d2; border-radius:10px; padding:10px 12px; }
.xl-err b { font-size:13px; color:#b3352c; }
.xl-err ul { margin:6px 0 0; padding-left:18px; color:#7a3a34; font-size:12.5px; line-height:1.8; }
.err { color:#b3352c; }
@media (max-width:768px) {
  .xl-res .kv { grid-template-columns:1fr; }
  .xl-entry { min-height:36px; padding:0 10px; }
}

/* =========================================================
   v5 高级感升级（员工端）：信息层级 / 间距节奏 / 状态反馈 / 动效
   只做视觉与微交互，不改页面结构与业务逻辑
   ========================================================= */

body:not(.is-mall) {
  --brand: #A32F1B;
  --brand-deep: #8A2311;
  --brand-soft: #F3E2DA;
  --brand-gold: #C49A4F;
  --ink: #241611;
  --ink-2: #5B463A;
  --muted: #8C7A6B;
  --page: #FAF5EC;
  --surface: #FFFFFF;
  --surface-2: #F6EFE3;
  --hairline: #EADCCB;
  --border: rgba(70, 35, 18, .12);
  --r: 14px;
  --shadow-1: 0 1px 2px rgba(60, 30, 15, .05);
  --shadow-2: 0 2px 6px rgba(60, 30, 15, .06), 0 18px 40px -28px rgba(60, 30, 15, .35);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- 外壳：顶栏 ---------- */
body:not(.is-mall) .topbar {
  height: 62px;
  padding: 0 28px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--hairline);
  display: flex; align-items: center; gap: 14px;
}
body:not(.is-mall) .topbar .title {
  font-family: var(--font-serif);
  font-size: 19px; font-weight: 700; letter-spacing: .06em; color: var(--ink);
}
body:not(.is-mall) .topbar .crumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--muted); letter-spacing: .04em;
}
body:not(.is-mall) .topbar .crumb b { color: var(--ink-2); font-weight: 600; }
body:not(.is-mall) .topbar .crumb .sep { opacity: .5; }
body:not(.is-mall) .topbar .spacer { flex: 1; }
body:not(.is-mall) .topbar .clock {
  font-size: 12.5px; color: var(--muted); letter-spacing: .04em;
  padding-right: 14px; border-right: 1px solid var(--hairline);
}
body:not(.is-mall) .topbar .who {
  display: flex; align-items: center; gap: 9px; padding: 5px 10px 5px 5px;
  border-radius: 999px; border: 1px solid var(--hairline); background: #fff;
}
body:not(.is-mall) .topbar .who .av {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(145deg, var(--brand) 0%, var(--brand-deep) 100%);
  color: #FBEFD8; font-size: 13px; font-family: var(--font-serif);
  display: flex; align-items: center; justify-content: center;
}
body:not(.is-mall) .topbar .who .nm { font-size: 13px; color: var(--ink); line-height: 1.2; }
body:not(.is-mall) .topbar .who .rl { font-size: 11px; color: var(--muted); line-height: 1.2; }

/* ---------- 外壳：侧栏 ---------- */
body:not(.is-mall) .sidebar { padding: 22px 14px 16px; }
body:not(.is-mall) .sidebar .brand {
  padding: 0 10px 18px; margin-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .10);
}
body:not(.is-mall) .sidebar .brand-logo { width: 150px; }
body:not(.is-mall) .sidebar .brand small {
  display: block; margin-top: 8px; font-size: 10.5px; letter-spacing: .22em;
  color: rgba(227, 205, 183, .62); text-transform: uppercase;
}
body:not(.is-mall) .nav-sec {
  margin: 16px 10px 7px; font-size: 10.5px; letter-spacing: .22em;
  color: rgba(227, 205, 183, .45); text-transform: uppercase;
}
body:not(.is-mall) .nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; margin-bottom: 2px; border-radius: 9px;
  color: rgba(236, 219, 200, .80); font-size: 13.5px; letter-spacing: .02em;
  cursor: pointer; transition: background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
}
body:not(.is-mall) .nav-item .ic {
  width: 24px; height: 24px; flex: none; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; background: rgba(255, 255, 255, .06); color: rgba(236, 219, 200, .85);
  transition: background .18s var(--ease), color .18s var(--ease);
}
body:not(.is-mall) .nav-item:hover { background: rgba(255, 255, 255, .07); color: #FBEFD8; }
body:not(.is-mall) .nav-item.active {
  background: linear-gradient(90deg, rgba(196, 154, 79, .22), rgba(163, 47, 27, .30));
  color: #FFF6E6; font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(196, 154, 79, .35);
}
body:not(.is-mall) .nav-item.active .ic { background: var(--brand-gold); color: #3A1A10; }
body:not(.is-mall) .sidebar .user {
  margin-top: 12px; padding: 10px; border-radius: 10px;
  background: rgba(255, 255, 255, .05);
}

/* ---------- 内容区 ---------- */
body:not(.is-mall) .content { padding: 26px 28px 34px; }
body:not(.is-mall) .content > * { animation: riseIn .34s var(--ease) both; }
body:not(.is-mall) .content > *:nth-child(2) { animation-delay: .04s; }
body:not(.is-mall) .content > *:nth-child(3) { animation-delay: .08s; }
body:not(.is-mall) .content > *:nth-child(4) { animation-delay: .12s; }
@keyframes riseIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
body:not(.is-mall) .sk {
  border-radius: 12px;
  background: linear-gradient(100deg, #F4EDE2 20%, #FBF7F0 38%, #F4EDE2 56%);
  background-size: 220% 100%;
  animation: shimmer 1.15s linear infinite;
}
@keyframes shimmer { to { background-position: -120% 0; } }
body:not(.is-mall) .skeleton-wrap { display: grid; gap: 14px; padding: 4px 0; }
body:not(.is-mall) .skeleton-wrap .bar { height: 46px; }
body:not(.is-mall) .skeleton-wrap .big { height: 120px; }

/* ---------- 卡片 ---------- */
body:not(.is-mall) .card {
  background: var(--surface);
  border: 1px solid rgba(70, 35, 18, .09);
  border-radius: var(--r);
  box-shadow: var(--shadow-1);
  transition: box-shadow .22s var(--ease), transform .22s var(--ease), border-color .22s var(--ease);
}
body:not(.is-mall) .card:hover { box-shadow: var(--shadow-2); border-color: rgba(70, 35, 18, .14); }
body:not(.is-mall) .card-h {
  padding: 14px 18px; border-bottom: 1px solid var(--hairline);
  font-size: 13.5px; font-weight: 600; letter-spacing: .03em; color: var(--ink);
  display: flex; align-items: center; gap: 10px;
}
body:not(.is-mall) .card-h .kpi-note,
body:not(.is-mall) .card-h .muted { font-weight: 400; color: var(--muted); font-size: 12px; letter-spacing: 0; margin-left: auto; }
body:not(.is-mall) .card-b { padding: 16px 18px; }

/* ---------- KPI 数字块 ---------- */
body:not(.is-mall) .tile { padding: 18px 18px 16px; }
body:not(.is-mall) .tile .label {
  font-size: 12px; letter-spacing: .06em; color: var(--muted); text-transform: none;
}
body:not(.is-mall) .tile .value {
  margin-top: 10px; font-size: 29px; line-height: 1.1; font-weight: 600;
  color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.01em;
}
body:not(.is-mall) .tile .value small { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 4px; }
body:not(.is-mall) .tile .delta {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 10px;
  font-size: 12px; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2);
}
body:not(.is-mall) .tile .delta.up { background: #EAF3E6; color: #3E6B33; }
body:not(.is-mall) .tile .delta.down { background: #FBEAE4; color: #A33B22; }

/* ---------- 表格：从"表格"变成"数据面板" ---------- */
body:not(.is-mall) .tbl {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--surface); font-size: 13.5px;
}
body:not(.is-mall) .tbl thead th {
  position: sticky; top: 0; z-index: 2;
  padding: 11px 16px; text-align: left; white-space: nowrap;
  font-size: 11.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted); background: linear-gradient(#FBF7F0, #F7F0E4);
  border-bottom: 1px solid var(--hairline);
}
body:not(.is-mall) .tbl tbody td {
  padding: 13px 16px; border-bottom: 1px solid rgba(70, 35, 18, .07);
  color: var(--ink-2); vertical-align: middle;
}
body:not(.is-mall) .tbl tbody tr { transition: background .16s var(--ease); }
body:not(.is-mall) .tbl tbody tr:hover { background: #FCF7EE; }
body:not(.is-mall) .tbl tbody tr:last-child td { border-bottom: none; }
body:not(.is-mall) .tbl td:first-child { color: var(--ink); }
body:not(.is-mall) .tbl .link,
body:not(.is-mall) .tbl .row-actions .link {
  display: inline-block; padding: 3px 8px; border-radius: 6px;
  color: var(--brand); font-size: 12.5px;
  transition: background .16s var(--ease), color .16s var(--ease);
}
body:not(.is-mall) .tbl .link:hover { background: var(--brand-soft); text-decoration: none; }
body:not(.is-mall) .tbl .num,
body:not(.is-mall) .tbl .money { font-variant-numeric: tabular-nums; text-align: right; }
body:not(.is-mall) .tbl-wrap {
  border-radius: 12px; border: 1px solid rgba(70, 35, 18, .08); overflow: hidden; background: #fff;
}
body:not(.is-mall) .tbl-wrap .tbl thead th:first-child { border-top-left-radius: 12px; }

/* 标签：加一点形 */
body:not(.is-mall) .tag {
  font-size: 11.5px; padding: 2px 9px; border-radius: 999px;
  border: 1px solid transparent; font-weight: 500; letter-spacing: .01em;
}
body:not(.is-mall) .tag.blue { background: #EDF1F7; color: #3D5A80; }
body:not(.is-mall) .tag.good { background: #EAF3E6; color: #3E6B33; }
body:not(.is-mall) .tag.warn { background: #FBF0DC; color: #8A5A12; }
body:not(.is-mall) .tag.crit { background: #FBEAE4; color: #A33B22; }
body:not(.is-mall) .tag.gray, body:not(.is-mall) .tag:not([class*="blue"]):not([class*="good"]):not([class*="warn"]):not([class*="crit"]) {
  background: var(--surface-2); color: var(--ink-2);
}

/* ---------- 按钮 ---------- */
body:not(.is-mall) .btn {
  border-radius: 9px; border: 1px solid var(--border); background: #fff;
  color: var(--ink-2); font-size: 13px; font-weight: 500; letter-spacing: .01em;
  padding: 8px 14px; box-shadow: 0 1px 1px rgba(70, 35, 18, .04);
  transition: background .16s var(--ease), box-shadow .16s var(--ease), transform .12s var(--ease), border-color .16s var(--ease);
}
body:not(.is-mall) .btn:hover { background: #FCF7EF; border-color: rgba(70, 35, 18, .2); }
body:not(.is-mall) .btn:active { transform: translateY(1px) scale(.995); }
body:not(.is-mall) .btn.primary {
  background: linear-gradient(180deg, #B23A22 0%, var(--brand) 60%, var(--brand-deep) 100%);
  border-color: var(--brand-deep); color: #FFF6E8; font-weight: 600;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 6px 16px -10px rgba(140, 40, 18, .9);
}
body:not(.is-mall) .btn.primary:hover { filter: brightness(1.06); }
body:not(.is-mall) .btn.ghost { border-style: dashed; color: var(--brand); }

/* ---------- 页签：分段控件 ---------- */
body:not(.is-mall) .tabs {
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 10px;
}
body:not(.is-mall) .tab {
  padding: 6px 14px; border-radius: 7px; font-size: 13px; color: var(--ink-2);
  cursor: pointer; transition: background .16s var(--ease), color .16s var(--ease), box-shadow .16s var(--ease);
}
body:not(.is-mall) .tab.on, body:not(.is-mall) .tab.active {
  background: #fff; color: var(--brand-deep); font-weight: 600;
  box-shadow: 0 1px 2px rgba(70, 35, 18, .12);
}

/* ---------- 筛选条 ---------- */
body:not(.is-mall) .toolbar,
body:not(.is-mall) .filters {
  gap: 10px; padding: 12px 14px; margin-bottom: 14px;
  background: #fff; border: 1px solid rgba(70, 35, 18, .08); border-radius: 12px;
  box-shadow: var(--shadow-1);
}
body:not(.is-mall) .chip-f, body:not(.is-mall) .chip {
  border-radius: 999px; padding: 5px 13px; font-size: 12.5px;
  border: 1px solid var(--hairline); background: #fff; color: var(--ink-2);
  transition: all .16s var(--ease);
}
body:not(.is-mall) .chip-f:hover, body:not(.is-mall) .chip:hover { border-color: rgba(163, 47, 27, .35); color: var(--brand); }
body:not(.is-mall) .chip-f.on, body:not(.is-mall) .chip.on {
  background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600;
}

/* ---------- 弹窗 ---------- */
body:not(.is-mall) .modal { border-radius: 16px; box-shadow: 0 40px 90px -30px rgba(40, 18, 8, .55); }
body:not(.is-mall) .modal-wrap.on .modal { animation: modalIn .26s var(--ease) both; }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
body:not(.is-mall) .modal-h { padding: 16px 20px; border-bottom: 1px solid var(--hairline); font-size: 15px; }
body:not(.is-mall) .modal-b { padding: 18px 20px; }
body:not(.is-mall) .modal-f { padding: 14px 20px; border-top: 1px solid var(--hairline); }

/* ---------- 空状态 ---------- */
body:not(.is-mall) .empty { border-radius: 12px; }

/* ---------- 手机端微调 ---------- */
@media (max-width: 768px) {
  body:not(.is-mall) .topbar { height: 54px; padding: 0 14px; }
  body:not(.is-mall) .topbar .clock,
  body:not(.is-mall) .topbar .who .rl { display: none; }
  body:not(.is-mall) .topbar .who { padding: 4px; border: none; background: transparent; }
  body:not(.is-mall) .topbar .title { font-size: 17px; letter-spacing: .04em; }
  body:not(.is-mall) .content { padding: 14px 12px 90px; }
  body:not(.is-mall) .card-h { padding: 12px 14px; font-size: 13px; }
  body:not(.is-mall) .card-b { padding: 12px 14px; }
  body:not(.is-mall) .tile { padding: 14px; }
  body:not(.is-mall) .tile .value { font-size: 23px; margin-top: 8px; }
  body:not(.is-mall) .toolbar,
  body:not(.is-mall) .filters { padding: 10px 12px; }
  body:not(.is-mall) .tabs { width: 100%; overflow-x: auto; }
}

/* 工作台：待办 / 拜访 列表（v5） */
body:not(.is-mall) .ws-list { padding: 8px 10px; }
body:not(.is-mall) .ws-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 8px; border-radius: 10px;
  transition: background .16s var(--ease);
}
body:not(.is-mall) .ws-row:hover { background: #FCF7EE; }
body:not(.is-mall) .ws-row + .ws-row { border-top: 1px solid rgba(70, 35, 18, .06); }
body:not(.is-mall) .ws-ic {
  width: 30px; height: 30px; flex: none; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; font-size: 13px;
  background: var(--surface-2); color: var(--ink-2);
}
body:not(.is-mall) .ws-ic.t-warn { background: #FBF0DC; color: #8A5A12; }
body:not(.is-mall) .ws-ic.t-blue { background: #EDF1F7; color: #3D5A80; }
body:not(.is-mall) .ws-ic.t-crit { background: #FBEAE4; color: #A33B22; }
body:not(.is-mall) .ws-av {
  width: 30px; height: 30px; flex: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-family: var(--font-serif);
  background: linear-gradient(145deg, #B23A22, #8A2311); color: #FBEFD8;
}
body:not(.is-mall) .ws-txt {
  flex: 1; min-width: 0; font-size: 13.5px; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
body:not(.is-mall) .ws-txt b { font-weight: 600; margin-right: 6px; }
body:not(.is-mall) .ws-txt i { font-style: normal; color: var(--muted); }
body:not(.is-mall) .ws-side { flex: none; }
@media (max-width: 768px) {
  body:not(.is-mall) .ws-txt { white-space: normal; line-height: 1.5; font-size: 13px; }
  body:not(.is-mall) .ws-row { padding: 10px 6px; gap: 10px; }
}

/* v5 修正 */
body:not(.is-mall) .sidebar { display: flex; flex-direction: column; overflow: hidden; }
body:not(.is-mall) #nav { flex: 1; overflow-y: auto; scrollbar-width: none; padding-bottom: 6px; }
body:not(.is-mall) #nav::-webkit-scrollbar { width: 0; height: 0; }
body:not(.is-mall) .sidebar .brand { flex: none; }
body:not(.is-mall) .sidebar .user { flex: none; }
body:not(.is-mall) .topbar .who > span:last-child {
  display: flex; flex-direction: column; justify-content: center; line-height: 1.15;
}
body:not(.is-mall) .tbl tbody td { padding: 11px 12px; }
body:not(.is-mall) .tbl thead th { padding: 10px 12px; }
body:not(.is-mall) .tbl-cust { font-size: 13px; }
body:not(.is-mall) .tbl-cust td:first-child { font-weight: 500; }

/* v5 筛选条 */
body:not(.is-mall) .filters,
body:not(.is-mall) .toolbar { display: flex; flex-wrap: wrap; align-items: center; }
body:not(.is-mall) .filters select,
body:not(.is-mall) .toolbar select { flex: 0 0 auto; min-width: 140px; }
body:not(.is-mall) .filters input[type=date],
body:not(.is-mall) .toolbar input[type=date] { flex: 0 0 152px; width: 152px !important; padding: 7px 8px; }
body:not(.is-mall) .filters input[type=text],
body:not(.is-mall) .filters input:not([type]),
body:not(.is-mall) .toolbar input[type=text],
body:not(.is-mall) .toolbar input:not([type]) { flex: 1 1 220px; min-width: 180px; width: auto !important; }
body:not(.is-mall) .filters .o-presets { flex: 1 1 100%; margin: 2px 0 0; }
body:not(.is-mall) .filters .btn,
body:not(.is-mall) .toolbar .btn { flex: 0 0 auto; }
body:not(.is-mall) .filters .btn:last-child { margin-left: auto; }

/* 订单表：单号/客户加宽 */
#ordTbl th:nth-child(1) { width:18%; }
#ordTbl th:nth-child(2) { width:16%; }
#ordTbl th:nth-child(8) { width:11%; }
#ordTbl th:nth-child(9) { width:14%; }

body:not(.is-mall) .filters #ord_cust { flex: 1 1 220px; max-width: 240px; }
body:not(.is-mall) .tbl tbody td { line-height: 1.45; }

/* v5 手机端：筛选条压缩 */
@media (max-width: 768px) {
  body:not(.is-mall) .filters .o-presets {
    flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px;
  }
  body:not(.is-mall) .filters .o-presets::-webkit-scrollbar { height: 0; }
  body:not(.is-mall) .filters .o-presets > * { flex: 0 0 auto; }
  body:not(.is-mall) .filters .btn:last-child { margin-left: 0; }
  body:not(.is-mall) .brand-banner .bb-title { font-size: 19px; letter-spacing: 1.5px; line-height: 1.35; }
  body:not(.is-mall) .brand-banner .bb-inner { padding: 18px 16px; }
}

/* v5 手机端：筛选条两列网格 */
@media (max-width: 768px) {
  body:not(.is-mall) .filters,
  body:not(.is-mall) .toolbar {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: center;
  }
  body:not(.is-mall) .filters > *,
  body:not(.is-mall) .toolbar > * { width: 100% !important; min-width: 0; max-width: none; }
  body:not(.is-mall) .filters > .o-presets,
  body:not(.is-mall) .toolbar > .o-presets,
  body:not(.is-mall) .filters > input[type=text],
  body:not(.is-mall) .filters > input:not([type]),
  body:not(.is-mall) .toolbar > input[type=text],
  body:not(.is-mall) .toolbar > input:not([type]),
  body:not(.is-mall) .filters > .btn,
  body:not(.is-mall) .toolbar > .btn { grid-column: auto; }
  body:not(.is-mall) .filters > .btn.hide-m { display: none; }
  body:not(.is-mall) .filters > .spacer,
  body:not(.is-mall) .toolbar > .spacer { display: none; }
}

/* v5 手机端：筛选条元素铺满格子（覆盖前面的定宽规则） */
@media (max-width: 768px) {
  body:not(.is-mall) .filters select,
  body:not(.is-mall) .toolbar select,
  body:not(.is-mall) .filters input[type=date],
  body:not(.is-mall) .toolbar input[type=date],
  body:not(.is-mall) .filters input[type=text],
  body:not(.is-mall) .toolbar input[type=text],
  body:not(.is-mall) .filters input:not([type]),
  body:not(.is-mall) .toolbar input:not([type]) {
    width: 100% !important; flex: none !important; min-width: 0 !important; max-width: none !important;
  }
}

@media (max-width: 768px) {
  body:not(.is-mall) .filters > .o-presets,
  body:not(.is-mall) .toolbar > .o-presets { grid-column: 1 / -1 !important; width: 100% !important; }
  body:not(.is-mall) .filters > input[type=text],
  body:not(.is-mall) .filters > input:not([type]),
  body:not(.is-mall) .toolbar > input[type=text],
  body:not(.is-mall) .toolbar > input:not([type]) { grid-column: 1 / -1 !important; }
}

body:not(.is-mall) .tbl-wrap { overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }

/* 对账单主表：9 列固定宽，避免被裁 */
.tbl-stmt { table-layout: fixed; width: 100% !important; }
.tbl-stmt th:nth-child(1) { width: 25%; }
.tbl-stmt th:nth-child(2) { width: 10%; }
.tbl-stmt th:nth-child(3) { width: 9%; }
.tbl-stmt th:nth-child(4) { width: 10%; }
.tbl-stmt th:nth-child(5) { width: 10%; }
.tbl-stmt th:nth-child(6) { width: 9%; }
.tbl-stmt th:nth-child(7) { width: 10%; }
.tbl-stmt th:nth-child(8) { width: 9%; }
.tbl-stmt th:nth-child(9) { width: 9%; }
.tbl-stmt td { padding: 11px 12px; }
.tbl-stmt td:nth-child(n+3):nth-child(-n+7) { font-variant-numeric: tabular-nums; }

body:not(.is-mall) .tbl .tag { white-space: nowrap; }

/* v5 侧栏密度：一屏放下全部入口 */
body:not(.is-mall) .sidebar { padding: 18px 12px 12px; }
body:not(.is-mall) .sidebar .brand { padding: 0 8px 14px; margin-bottom: 10px; }
body:not(.is-mall) .sidebar .brand-logo { width: 138px; }
body:not(.is-mall) .nav-sec { margin: 12px 8px 5px; }
body:not(.is-mall) .nav-item { padding: 7px 9px; font-size: 13px; }
body:not(.is-mall) .nav-item .ic { width: 22px; height: 22px; font-size: 11px; border-radius: 6px; }

body:not(.is-mall) .tbl-cust th { word-break: normal; }

/* ===== v6 黑白金：员工端配色与留白 ===== */
body:not(.is-mall) {
  --brand: #A32F1B;
  --brand-deep: #8A2311;
  --brand-soft: #FBEAE4;
  --brand-gold: #C49A4F;
  --ink: #241611;
  --ink-2: #5B463A;
  --muted: #8C7A6B;
  --page: #FAF5EC;
  --surface: #FFFFFF;
  --surface-2: #F5EDE1;
  --hairline: #EADCCB;
  --border: rgba(70, 35, 18, .13);
  --shadow-1: 0 1px 2px rgba(22, 19, 15, .04);
  --shadow-2: 0 2px 8px rgba(22, 19, 15, .06), 0 24px 48px -34px rgba(22, 19, 15, .35);
}
body:not(.is-mall) .btn.primary {
  background: linear-gradient(180deg, #B23A22 0%, #A32F1B 55%, #8A2311 100%);
  border-color: #111009; color: #F7EFDC; font-weight: 600;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .12) inset, 0 8px 18px -12px rgba(22, 19, 15, .8);
}
body:not(.is-mall) .btn.primary:hover { filter: brightness(1.12); }
body:not(.is-mall) .nav-item.active {
  background: linear-gradient(90deg, rgba(176, 141, 87, .26), rgba(176, 141, 87, .10));
  color: #F6EDDC; box-shadow: inset 0 0 0 1px rgba(176, 141, 87, .42);
}
body:not(.is-mall) .nav-item.active .ic { background: var(--brand-gold); color: #1C1508; }
body:not(.is-mall) .chip-f.on, body:not(.is-mall) .chip.on,
body:not(.is-mall) .tag.blue, body:not(.is-mall) .tag.good {
  /* 语义色保留，但降低饱和度 */
}
body:not(.is-mall) .chip-f.on, body:not(.is-mall) .chip.on { background: var(--brand); border-color: var(--brand); }
body:not(.is-mall) .tab.on, body:not(.is-mall) .tab.active { color: var(--brand); box-shadow: 0 1px 2px rgba(70, 35, 18, .14); }
body:not(.is-mall) .tbl .link { color: var(--brand); }
body:not(.is-mall) .tbl .link:hover { background: var(--brand-soft); }
body:not(.is-mall) .tbl thead th { background: linear-gradient(#FDF6EC, #F6EDDF); }
body:not(.is-mall) .tbl tbody tr:hover { background: #FCFAF3; }
body:not(.is-mall) .tag.blue { background: #EEF0F3; color: #46505C; }
body:not(.is-mall) .tag.good { background: #ECF1E8; color: #48603C; }
body:not(.is-mall) .tag.warn { background: #F7F0DF; color: #7E5E23; }
body:not(.is-mall) .tag.crit { background: #F8EAE5; color: #94402F; }
body:not(.is-mall) .sidebar { background: #14120E; }
body:not(.is-mall) .topbar .who .av { background: linear-gradient(145deg, #2A2620, #111009); color: #EFDDBA; }
body:not(.is-mall) .ws-av { background: linear-gradient(145deg, #2A2620, #111009); color: #EFDDBA; }
body:not(.is-mall) .ws-ic.t-warn { background: #F7F0DF; color: #7E5E23; }
body:not(.is-mall) .ws-ic.t-crit { background: #F8EAE5; color: #94402F; }
body:not(.is-mall) .tile .delta.up { background: #ECF1E8; color: #48603C; }
body:not(.is-mall) .tile .delta.down { background: #F8EAE5; color: #94402F; }
body:not(.is-mall) .content { padding: 30px 32px 40px; }
body:not(.is-mall) .grid { gap: 16px; }
body:not(.is-mall) .tile { padding: 20px 20px 18px; }
body:not(.is-mall) .card-h { padding: 16px 20px; }
body:not(.is-mall) .card-b { padding: 18px 20px; }

/* v6 页头（四个薄页面共用） */
body:not(.is-mall) .pg-hd { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 2px 0 16px; }
body:not(.is-mall) .pg-hd .t { font-family: var(--font-serif); font-size: 22px; font-weight: 700; letter-spacing: .02em; color: var(--ink); }
body:not(.is-mall) .pg-hd .s { margin-top: 6px; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
body:not(.is-mall) .pg-kicker { font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--brand-gold); margin-bottom: 6px; }
body:not(.is-mall) .pg-acts { display: flex; gap: 8px; align-items: center; flex: none; }
body:not(.is-mall) .card.tbl-wrap { padding: 0; overflow: hidden; }
@media (max-width: 768px) {
  body:not(.is-mall) .pg-hd { flex-wrap: wrap; align-items: flex-start; margin-bottom: 12px; }
  body:not(.is-mall) .pg-hd .t { font-size: 19px; }
  body:not(.is-mall) .pg-acts { width: 100%; }
}

/* 弹窗右上角关闭：桌面端也常显，不再只靠 ESC */
body:not(.is-mall) .modal-close {
  display: flex; align-items: center; justify-content: center;
  position: absolute; top: 12px; right: 12px;
  width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--hairline); border-radius: 50%;
  background: var(--surface-2); color: var(--ink-2);
  font-size: 15px; line-height: 1; cursor: pointer; z-index: 2;
}
body:not(.is-mall) .modal-close:hover { background: var(--brand-soft); color: var(--brand); }
body:not(.is-mall) .voucher-view { text-align: center; padding: 6px 0 2px; }
body:not(.is-mall) .voucher-full { display: block; max-width: 100%; max-height: 68vh; margin: 0 auto; border: 1px solid var(--border); border-radius: 8px; background: #fff; }

/* =========================================================
   ERP 导入弹窗：数据接入 / 预检 / 写入
   ========================================================= */
.xl-modal {
  padding: 0;
  max-width: calc(100vw - 32px);
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--surface);
  box-shadow: 0 32px 90px rgba(36, 22, 17, 0.28);
  overflow: hidden;
}
.xl-modal .modal-close {
  top: 16px; right: 16px;
  width: 32px; height: 32px;
  border: 0; border-radius: 0;
  background: transparent; color: var(--muted);
  font-size: 19px; font-weight: 300;
}
.xl-modal .modal-close:hover { background: var(--surface-2); color: var(--brand); }

.xl-top {
  padding: 30px 34px 22px;
  border-bottom: 1px solid var(--hairline);
  background:
    radial-gradient(520px 180px at 100% 0%, rgba(196, 154, 79, 0.14), transparent 68%),
    linear-gradient(180deg, #FFFDF8 0%, var(--surface) 100%);
}
.xl-kicker {
  font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--brand-gold); margin-bottom: 9px;
}
.xl-top h3 {
  margin: 0; font-family: var(--font-serif); font-size: 29px; line-height: 1.2;
  font-weight: 700; letter-spacing: 0.02em; color: var(--ink);
}
.xl-sub { margin: 8px 0 0; max-width: 560px; font-size: 12.5px; line-height: 1.7; color: var(--muted); }
.xl-steps { display: flex; align-items: center; gap: 10px; margin-top: 20px; }
.xl-step { display: flex; align-items: baseline; gap: 6px; color: var(--muted); white-space: nowrap; }
.xl-step b { font-family: var(--font-serif); font-size: 12px; font-weight: 700; color: var(--muted); }
.xl-step span { font-size: 11.5px; letter-spacing: 0.04em; }
.xl-step.on b, .xl-step.on span { color: var(--brand); }
.xl-step.done b { color: var(--brand-gold); }
.xl-step.done span { color: var(--ink-2); }
.xl-steps > i { flex: 1; height: 1px; background: var(--hairline); }

.xl-body { padding: 22px 34px 26px; }
.xl-block { margin-bottom: 18px; }
.xl-label {
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 8px;
}
.xl-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--border); background: var(--surface); }
.xl-seg.xl-seg-3 { grid-template-columns: repeat(3, 1fr); }
.xl-seg button {
  min-height: 42px; padding: 8px 12px; border: 0; border-right: 1px solid var(--border);
  background: transparent; color: var(--ink-2); font-size: 12.5px; line-height: 1.35;
}
.xl-seg button:last-child { border-right: 0; }
.xl-seg button:hover { background: var(--surface-2); }
.xl-seg button.on { background: var(--ink); color: #fff; }
.xl-hint { margin: 7px 0 0; font-size: 11.5px; line-height: 1.65; color: var(--muted); }

.xl-pick {
  display: flex; align-items: center; gap: 14px;
  min-height: 84px; padding: 16px 18px;
  border: 1px dashed var(--border); background: var(--surface-2);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.xl-pick:hover, .xl-pick.drag { border-color: var(--brand); background: #FFF8F4; }
.xl-pick.ready { border-style: solid; border-color: var(--brand-gold); background: #FFFDF6; }
.xl-pick-ic {
  flex: none; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--brand); color: var(--brand); font-family: var(--font-serif); font-size: 18px;
}
.xl-pick-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.xl-pick-tx b { font-family: var(--font-serif); font-size: 15px; color: var(--ink); }
.xl-pick-tx span { font-size: 11.5px; color: var(--muted); }
.xl-pick-btn { flex: none; font-size: 12px; color: var(--brand); border-bottom: 1px solid var(--brand); padding-bottom: 2px; }

.xl-file { display: flex; align-items: center; gap: 10px; min-height: 34px; margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.xl-file.has { padding: 8px 12px; border: 1px solid var(--hairline); background: #FFFDF8; color: var(--ink-2); }
.xl-file b { max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.xl-file span { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.xl-cols { margin: 8px 0 0; font-size: 11px; line-height: 1.6; color: var(--muted); }
.xl-template { margin-top: 12px; }
.xl-text { padding: 0; border: 0; background: transparent; color: var(--brand); font-size: 12px; line-height: 1.6; }
.xl-text:hover { text-decoration: underline; }
.xl-text.danger { color: var(--crit); }

.xl-actions { display: flex; align-items: center; justify-content: flex-end; gap: 18px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--hairline); }
.xl-actions .btn { min-height: 40px; padding: 9px 18px; border-radius: 0; }
.xl-actions .xl-text { margin-right: auto; }

.xl-preview { margin-top: 22px; padding-top: 16px; border-top: 2px solid var(--ink); }
.xl-preview-hd { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.xl-badge {
  display: inline-flex; padding: 3px 8px; border: 1px solid var(--brand);
  color: var(--brand); font-size: 10px; letter-spacing: 0.08em;
}
.xl-badge.ok { border-color: var(--good); color: var(--good); }
.xl-preview-file { min-width: 0; margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--muted); }

.xl-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 24px; margin-top: 12px; }
.xl-metric { padding: 11px 0 10px; border-top: 1px solid var(--hairline); }
.xl-metric span { display: block; font-size: 10.5px; color: var(--muted); letter-spacing: 0.02em; }
.xl-metric b {
  display: block; margin-top: 4px; font-family: var(--font-serif);
  font-size: 21px; line-height: 1.2; font-weight: 700; color: var(--ink);
  font-variant-numeric: tabular-nums; word-break: break-all;
}

.xl-callout { margin-top: 14px; padding: 11px 14px; border-left: 3px solid var(--brand-gold); background: #FFF9EC; }
.xl-callout b { display: block; font-size: 11.5px; color: var(--ink); margin-bottom: 4px; }
.xl-callout ul { margin: 0; padding-left: 16px; }
.xl-callout li { font-size: 11.5px; line-height: 1.65; color: var(--ink-2); }
.xl-callout.error { border-left-color: var(--crit); background: #FDF2F1; }
.xl-callout.ok { border-left-color: var(--good); background: #F2F8F4; }
.xl-callout.ok span { font-size: 11.5px; color: var(--ink-2); }
.xl-callout.warn { border-left-color: var(--warn); }
.xl-more { margin: 7px 0 0; font-size: 11px; color: var(--muted); }
.xl-note { margin: 12px 0 0; font-size: 11px; line-height: 1.65; color: var(--muted); }

.xl-loading { display: flex; align-items: center; gap: 10px; padding: 24px 0 8px; }
.xl-loading i {
  width: 16px; height: 16px; border: 2px solid var(--hairline); border-top-color: var(--brand);
  border-radius: 50%; animation: xlspin .7s linear infinite;
}
.xl-loading p { font-size: 12px; color: var(--muted); }
@keyframes xlspin { to { transform: rotate(360deg); } }

@media (max-width: 760px) {
  .xl-modal { width: 100% !important; max-width: 100%; max-height: 96vh; border-radius: 0; }
  .xl-top { padding: 24px 20px 18px; }
  .xl-top h3 { font-size: 24px; }
  .xl-body { padding: 18px 20px 22px; }
  .xl-step span { display: none; }
  .xl-metrics { grid-template-columns: 1fr 1fr; gap: 0 16px; }
  .xl-metric b { font-size: 18px; }
  .xl-actions { gap: 12px; }
}

/* 覆盖桌面端通用 .modal 的圆角/关闭按钮（特异性高于 body:not(.is-mall)） */
body:not(.is-mall) .modal.xl-modal {
  padding: 0;
  border-radius: 2px;
  max-height: 90vh;
}
body:not(.is-mall) .modal.xl-modal .modal-close {
  top: 16px; right: 16px;
  width: 30px; height: 30px;
  border: 0; border-radius: 0;
  background: transparent; color: var(--muted);
  font-size: 18px; font-weight: 300;
}
body:not(.is-mall) .modal.xl-modal .modal-close:hover {
  background: var(--surface-2); color: var(--brand);
}
.xl-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 18px; }
@media (max-width: 760px) {
  .xl-metrics { grid-template-columns: 1fr 1fr; gap: 0 14px; }
}

/* 可读性：局部提高正文/标签对比度，功能性字号不低于 11px */
.xl-modal {
  --muted: #6B574A;
  --ink-2: #4A3428;
}
.xl-kicker { font-size: 11px; color: #8A5A1F; }
.xl-step span { font-size: 12px; }
.xl-label { font-size: 11px; }
.xl-badge { font-size: 11px; }
.xl-metric span { font-size: 11px; }
.xl-cols { font-size: 11.5px; }
.xl-note { font-size: 11.5px; }
.xl-more { font-size: 11.5px; }
.xl-preview-file { font-size: 11.5px; }

/* 预检内容较长时允许弹窗内部滚动，操作条保持可见 */
body:not(.is-mall) .modal.xl-modal {
  overflow-y: auto;
  overflow-x: hidden;
}
.xl-preview { margin-top: 16px; }
.xl-metric { padding: 8px 0 8px; }
.xl-callout { padding: 9px 13px; }
.xl-preview .xl-actions {
  position: sticky; bottom: -1px; z-index: 3;
  margin-top: 12px; padding: 12px 0 4px;
  background: linear-gradient(180deg, rgba(255,255,255,0), var(--surface) 35%);
}

/* 让预检内容在 1000px 高度内完整露出，减少“操作条压住说明” */
body:not(.is-mall) .modal.xl-modal { max-height: 92vh; }
.xl-top { padding: 26px 34px 18px; }
.xl-body { padding: 18px 34px 22px; }
.xl-metric { padding: 6px 0 7px; }
.xl-preview { margin-top: 12px; }
.xl-preview .xl-actions { padding-top: 10px; }
