/* ============================================================
   平台运营后台 · 外壳与专属组件
   依赖 apps/shared/base.css 的设计令牌；本文件只做「后台」这一形态的布局与组件深化。
   ============================================================ */

/* ---------------- 外壳 ---------------- */

.app-shell { display: flex; min-height: 100vh; background: var(--color-bg-page); }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.app-body { padding: 18px 22px 40px; flex: 1; min-width: 0; }

/* ---------------- 侧栏 ---------------- */

.app-side {
  width: var(--side-width); flex: 0 0 var(--side-width);
  background: var(--side-bg); color: var(--side-text);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow: hidden;
  transition: width .18s, flex-basis .18s;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 16px 16px 14px; }
.side-brand .logo {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px;
  background: linear-gradient(135deg, #FFD84D, var(--color-primary-dark));
  color: var(--color-primary-ink); font-weight: 800; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 10px rgba(255, 195, 0, .28);
}
.side-brand .txt { display: flex; flex-direction: column; min-width: 0; }
.side-brand .txt b { color: var(--side-text-strong); font-size: 15px; line-height: 1.2; }
.side-brand .txt small { color: #6B7385; font-size: 11px; }

.side-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 8px 12px; }
.side-nav::-webkit-scrollbar { width: 4px; }
.side-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); }

.nav-item, .nav-group-title {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: none; background: transparent; color: var(--side-text);
  padding: 9px 10px; border-radius: var(--radius-md); cursor: pointer;
  font-size: 13.5px; text-align: left; margin-bottom: 2px;
  transition: background .14s, color .14s;
}
.nav-item:hover, .nav-group-title:hover { background: rgba(255,255,255,.06); color: var(--side-text-strong); }
.nav-item.on, .nav-group-title.active { background: var(--side-active); color: var(--side-text-strong); font-weight: 600; }
.nav-item.on { box-shadow: inset 3px 0 0 var(--color-primary); }
.nav-item .ic, .nav-group-title .ic { flex: 0 0 18px; opacity: .92; }
.nav-item .lbl, .nav-group-title .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .cnt, .nav-group-title .cnt {
  font-size: 11px; background: var(--color-danger); color: #fff; border-radius: var(--radius-pill);
  padding: 0 6px; line-height: 16px; font-weight: 600;
}
.nav-group { display: flex; flex-direction: column; }
.nav-group-title .caret { opacity: .6; transition: transform .18s; }
.nav-group.open .nav-group-title .caret { transform: rotate(90deg); }
.nav-sub { display: flex; flex-direction: column; padding: 2px 0 4px 0; }
.nav-sub .nav-item { padding-left: 38px; font-size: 13px; color: #8F98A8; }
.nav-sub .nav-item.on { color: var(--side-text-strong); box-shadow: inset 3px 0 0 var(--color-primary); }
.nav-divider { height: 1px; background: var(--side-line); margin: 8px 10px; }

/* 折叠态 */
.app-shell.folded .app-side { width: var(--side-width-mini); flex-basis: var(--side-width-mini); }
.app-shell.folded .side-brand .txt,
.app-shell.folded .nav-item .lbl,
.app-shell.folded .nav-group-title .lbl,
.app-shell.folded .nav-group-title .caret,
.app-shell.folded .nav-item .cnt,
.app-shell.folded .side-links { display: none; }
.app-shell.folded .side-brand { justify-content: center; padding: 16px 8px 14px; }
.app-shell.folded .nav-item, .app-shell.folded .nav-group-title { justify-content: center; padding: 10px 0; }
.app-shell.folded .nav-sub { display: none !important; }

.side-foot { border-top: 1px solid var(--side-line); padding: 10px 12px 14px; }
.side-user { display: flex; align-items: center; gap: 9px; padding: 4px 2px 8px; }
.side-user .av { background: rgba(255,195,0,.16); color: var(--color-primary); border-color: transparent; }
.side-user .u-txt { min-width: 0; flex: 1; }
.side-user .u-name { color: var(--side-text-strong); font-size: 13px; }
.side-user .u-role { color: #6B7385; font-size: 11px; }
.side-user .u-out { border: none; background: transparent; color: #6B7385; cursor: pointer; padding: 4px; border-radius: 6px; }
.side-user .u-out:hover { color: #fff; background: rgba(255,255,255,.08); }
.side-links { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #5A6273; }
.side-links a { color: #7B8494; }
.side-links a:hover { color: var(--color-primary); }

/* ---------------- 顶栏 ---------------- */

.app-top {
  height: var(--top-h); flex: 0 0 var(--top-h);
  display: flex; align-items: center; gap: 14px; padding: 0 22px;
  background: var(--color-bg-card); border-bottom: 1px solid var(--color-line);
  position: sticky; top: 0; z-index: 50;
}
.top-icon {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: var(--radius-md);
  border: 1px solid var(--color-line); background: var(--color-bg-card); color: var(--color-text-secondary);
  cursor: pointer; display: flex; align-items: center; justify-content: center; transition: .15s;
}
.top-icon:hover { border-color: var(--color-primary); color: var(--color-text-primary); background: #FFFDF6; }
.top-icon.dot::after {
  content: ''; position: absolute; margin: -14px 0 0 14px; width: 7px; height: 7px;
  background: var(--color-danger); border-radius: 50%; box-shadow: 0 0 0 2px #fff;
}
.top-icon { position: relative; }

.crumb { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--color-text-weak); min-width: 0; }
.crumb .sep { opacity: .5; }
.crumb .cur { color: var(--color-text-primary); font-weight: 600; }

.top-search { flex: 1; max-width: 380px; margin-left: auto; }
.top-search .wm-input { height: 34px; background: var(--color-bg-soft); border-color: transparent; }
.top-search .wm-input:focus { background: var(--color-bg-card); border-color: var(--color-primary); }

.top-actions { display: flex; align-items: center; gap: 10px; }
.top-user { display: flex; align-items: center; gap: 8px; padding-left: 4px; }
.top-user .u-name { font-size: 13px; font-weight: 600; }
.top-user .u-city { font-size: 11px; color: var(--color-text-weak); }

/* ---------------- 页头 ---------------- */

.page-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; gap: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 20px; letter-spacing: .2px; }
.page-head .sub { margin: 4px 0 0; color: var(--color-text-secondary); font-size: 12.5px; }
.ph-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-view { min-width: 0; }

/* ---------------- 指标卡（KPI） ---------------- */

.stat-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); }
.stat {
  background: var(--color-bg-card); border-radius: var(--radius-lg); padding: 16px 16px 14px;
  box-shadow: var(--shadow-card); position: relative; overflow: hidden; border: 1px solid transparent;
  transition: box-shadow .18s, transform .18s;
}
.stat:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.stat .k { color: var(--color-text-secondary); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.stat .k .ic { color: var(--color-text-weak); }
.stat .v { font-size: 25px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -.4px; }
.stat .v.small { font-size: 16px; letter-spacing: 0; }
.stat .h { font-size: 11.5px; color: var(--color-text-weak); margin-top: 5px; }
.stat.primary { background: linear-gradient(135deg, #FFD84D 0%, var(--color-primary-dark) 100%); border-color: transparent; }
.stat.primary .k, .stat.primary .h { color: rgba(61, 43, 0, .74); }
.stat.primary .v { color: var(--color-primary-ink); }
.stat.primary .k .ic { color: rgba(61,43,0,.6); }
.stat .corner { position: absolute; right: -14px; bottom: -16px; opacity: .07; }
.stat .corner .ic { width: 74px; height: 74px; }

/* ---------------- 数据条 ----------------
   运营反馈：除了工作台，其他页面顶上一排 KPI 大卡很占地方，把真正的功能挤到下面。
   同样的数字改成一行紧凑数据条——信息不丢，页面干净。
   用法：h('div', { class: 'sum-bar' }, stat(...), stat(...)) */
.sum-bar {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 9px 24px;
  background: var(--color-bg-card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card); padding: 12px 18px;
}
.sum-bar .stat {
  display: flex; align-items: baseline; gap: 7px; min-width: 0;
  background: none; border: 0; box-shadow: none; padding: 0; overflow: visible;
  position: static; transition: none;
}
.sum-bar .stat:hover { box-shadow: none; transform: none; }
.sum-bar .stat .k { color: var(--color-text-secondary); font-size: 12.5px; }
.sum-bar .stat .k .ic { width: 13px; height: 13px; color: var(--color-text-weak); }
.sum-bar .stat .v { font-size: 16px; font-weight: 700; margin-top: 0; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.sum-bar .stat .v.small { font-size: 14px; }
.sum-bar .stat .h { font-size: 11.5px; color: var(--color-text-weak); margin-top: 0; }
.sum-bar .stat .corner { display: none; }
.sum-bar .stat.primary { background: none; }
.sum-bar .stat.primary .k, .sum-bar .stat.primary .h { color: var(--color-text-secondary); }
.sum-bar .stat.primary .v { color: var(--color-primary-dark); }

/* 已迁移小节的指路行：一行放得下，不占卡片 */
.set-moved { display: flex; align-items: center; gap: 12px; padding: 2px 0 4px; }
.set-moved .hint-line { flex: 1 1 auto; margin: 0; }

/* ---------------- 通用工具类 ---------------- */
.nowrap { white-space: nowrap; }

/* 只读键值（用于档案类抽屉：字段值是纯文本，不是可编辑控件） */
.kv-v { font-size: 13px; color: var(--color-text-primary); line-height: 1.6; word-break: break-all; }
.wm-field > .kv-v { display: block; padding: 5px 0; }

/* ---------------- 资金三段拆分（用户支出 / 商户收入 / 平台收益） ----------------
   财务运营要一眼看清「这一单的钱从哪来、到哪去」，所以三栏并排，逐科目列示。
   数据一律来自 order_money_snapshot 资金快照，前端不做任何金额拼装。 */
.money-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1080px) { .money-cols { grid-template-columns: 1fr; } }
.money-blk { border: 1px solid var(--color-line); border-radius: var(--radius-md); overflow: hidden; }
.money-blk .mh {
  padding: 9px 13px; font-size: 13px; font-weight: 700; background: var(--color-bg-soft);
  display: flex; align-items: center; gap: 7px;
}
.money-blk .mh .ic { width: 14px; height: 14px; }
.money-blk .mb { padding: 5px 13px 9px; }
.money-blk.in .mh { color: var(--color-success, #17794a); }
.money-blk.out .mh { color: var(--color-primary-dark); }
.money-blk.net .mh { color: #1c5fa8; }
.mrow { display: flex; align-items: baseline; gap: 10px; padding: 4.5px 0; font-size: 12.5px; }
.mrow > .k { color: var(--color-text-secondary); flex: 1 1 auto; min-width: 0; }
.mrow > .v { font-variant-numeric: tabular-nums; font-weight: 600; flex: 0 0 auto; }
.mrow.sub > .k { padding-left: 12px; color: var(--color-text-weak); }
.mrow.sum { border-top: 1px dashed var(--color-line); margin-top: 4px; padding-top: 7px; }
.mrow.sum > .k { font-weight: 700; color: var(--color-text-primary); }
.mrow.sum > .v { font-size: 14.5px; }
.mrow .v.pos { color: #17794a; }
.mrow .v.neg { color: #c33b2c; }
.mrow .v.mute { color: var(--color-text-weak); font-weight: 500; }
.money-note { font-size: 11.5px; color: var(--color-text-weak); padding: 2px 0 6px; }
.money-blk .mh .sp { flex: 1; }
.money-tag { font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 999px; }
.money-tag.ok { color: #17794a; background: rgba(23,121,74,.09); }
.money-tag.bad { color: #c33b2c; background: rgba(195,59,44,.1); }

/* ---------------- 迷你图表（纯 CSS，不引图表库） ---------------- */

.chart-bars { display: flex; align-items: stretch; gap: 10px; height: 172px; padding-top: 6px; }
.chart-bars .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; height: 100%; }
.chart-bars .col .bar-out {
  flex: 1; width: 100%; min-height: 20px; position: relative;
  background-image: linear-gradient(180deg, var(--color-line) 1px, transparent 1px);
  background-size: 100% 25%;
}
.chart-bars .col .bar-in {
  position: absolute; left: 0; right: 0; bottom: 0; min-height: 3px;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, var(--color-primary) 0%, #FFE7A6 100%);
  transition: height .3s;
}
.chart-bars .col:hover .bar-in { background: linear-gradient(180deg, var(--color-primary-dark), var(--color-primary)); }
.chart-bars .col .cap { font-size: 10.5px; color: var(--color-text-weak); white-space: nowrap; }
.chart-bars .col .val { font-size: 10.5px; color: var(--color-text-secondary); font-variant-numeric: tabular-nums; }

.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--color-text-secondary); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

.rank-list { display: flex; flex-direction: column; gap: 2px; }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: var(--radius-md); }
.rank-row:hover { background: var(--color-bg-soft); }
.rank-row .no {
  width: 20px; height: 20px; flex: 0 0 20px; border-radius: 6px; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; background: var(--color-bg-soft); color: var(--color-text-weak);
}
.rank-row .no.top1 { background: #FFE9A8; color: #8A6100; }
.rank-row .no.top2 { background: #E8ECF2; color: #5A6273; }
.rank-row .no.top3 { background: #FFE3D2; color: #A0522D; }
.rank-row .nm { flex: 1; min-width: 0; font-size: 13px; }
.rank-row .vv { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; }

/* ---------------- 卡片头 / 工具条 ---------------- */

.grid-list { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.mini-card { background: var(--color-bg-card); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: 14px; }
.mini-card .hd { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-weight: 600; }
.mini-card .rule { font-size: 12px; color: var(--color-text-secondary); background: var(--color-bg-soft); border-radius: var(--radius-sm); padding: 6px 8px; margin-top: 8px; }

.cfg-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--color-line); }
.cfg-row:last-child { border-bottom: 0; }
.cfg-row .t { flex: 1; min-width: 0; }
.cfg-row .t .n { font-size: 14px; display: flex; align-items: center; gap: 6px; }
.cfg-row .t .d { font-size: 12px; color: var(--color-text-weak); margin-top: 3px; }
.cfg-row .ctl { width: 230px; flex: 0 0 230px; }
.cfg-row .t .progress { margin-top: 7px; }

/* 宽面板里的配置行排成两列：一行一个会把横向空间白白浪费掉 */
.cfg-2col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; }
.cfg-2col .cfg-row .ctl { width: 150px; flex: 0 0 150px; }
@media (max-width: 1240px) { .cfg-2col { grid-template-columns: minmax(0, 1fr); gap: 0; } .cfg-2col .cfg-row .ctl { width: 230px; flex: 0 0 230px; } }

/* ---------------- 装修令牌编辑 ---------------- */

.token-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); }
.token-item { display: flex; align-items: center; gap: 10px; background: var(--color-bg-card); border-radius: var(--radius-md); padding: 10px 12px; box-shadow: var(--shadow-card); }
.token-item .nm { flex: 1; min-width: 0; font-size: 12px; color: var(--color-text-secondary); word-break: break-all; }
.token-item input[type=color] { width: 38px; height: 28px; border: none; background: none; padding: 0; cursor: pointer; }
.token-item .wm-input { width: 96px; }
.swatch { width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--color-line); }

/* ---------------- 手机预览（装修画布） ---------------- */

.phone-preview {
  width: 300px; margin: 0 auto; border-radius: 26px; border: 8px solid #1F2430; overflow: hidden;
  background: #fff; box-shadow: 0 12px 40px rgba(0,0,0,.18);
}
.phone-preview .pp-top { background: var(--color-primary); color: var(--color-primary-ink); padding: 10px 12px; font-weight: 700; font-size: 14px; }
.phone-preview .pp-body { padding: 12px; background: var(--color-bg-page); min-height: 320px; }
.phone-preview .pp-block {
  background: #fff; border-radius: var(--radius-md); margin-bottom: 8px; padding: 10px 12px;
  font-size: 13px; box-shadow: var(--shadow-card); position: relative;
}
.phone-preview .pp-block .tag { position: absolute; right: 8px; top: 8px; font-size: 10px; }

/* ---------------- 小票 / 菜单树预览 ---------------- */

.receipt-preview { background: #fff; border: 1px dashed var(--color-line-strong); border-radius: var(--radius-md); padding: 14px; font-family: var(--font-num); font-size: 12px; white-space: pre-wrap; }
.menu-tree { display: flex; flex-direction: column; gap: 6px; }
.menu-cat-list { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------------- 旧链接式按钮 ---------------- */

.link-btn { border: none; background: transparent; color: var(--color-text-secondary); cursor: pointer; padding: 0; font-size: 12px; text-align: left; }
.link-btn:hover { color: var(--color-info); text-decoration: underline; }
.side-foot .link-btn { color: #7B8494; }
.side-foot .link-btn:hover { color: #fff; }

/* ---------------- 队列 / 看板 ---------------- */

.board { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); align-items: start; }
.board .col-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; padding: 0 2px 8px; }
.board .col-head .cnt { background: var(--color-bg-soft); border-radius: var(--radius-pill); padding: 0 7px; font-size: 11px; color: var(--color-text-secondary); }
.board .job {
  background: var(--color-bg-card); border-radius: var(--radius-md); padding: 10px 12px; margin-bottom: 8px;
  box-shadow: var(--shadow-card); border-left: 3px solid var(--color-line); font-size: 13px;
}
.board .job.warn { border-left-color: var(--color-warning); }
.board .job.danger { border-left-color: var(--color-danger); }
.board .job.ok { border-left-color: var(--color-success); }

/* ---------------- 响应式 ---------------- */

@media (max-width: 1080px) {
  .top-search { display: none; }
}
@media (max-width: 900px) {
  .app-side { position: fixed; z-index: 60; left: -100%; }
  .app-shell .app-side { left: 0; }
}
/* ============================================================
   设置中心：左分类 + 右分组卡片（apps/admin/admin.js viewSettings）
   ============================================================ */

.set-wrap { display: grid; grid-template-columns: 244px 1fr; gap: 16px; align-items: start; }
.set-side { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 10px; }
.set-side-head .wm-input { width: 100%; }
.set-rail { display: flex; flex-direction: column; gap: 3px; background: var(--color-bg-card); border-radius: var(--radius-lg); padding: 6px; box-shadow: var(--shadow-card); }
.set-nav {
  display: flex; align-items: flex-start; gap: 9px; border: none; background: transparent; cursor: pointer;
  text-align: left; padding: 9px 10px; border-radius: var(--radius-md); color: var(--color-text-secondary);
  font-family: inherit; font-size: 13.5px; width: 100%;
}
.set-nav:hover { background: var(--color-bg-hover); }
.set-nav.on { background: var(--color-primary-light); color: var(--color-text-primary); font-weight: 600; }
.set-nav .ic { color: var(--color-text-weak); display: flex; margin-top: 1px; }
.set-nav.on .ic { color: var(--color-primary-dark); }
.set-nav .tx { min-width: 0; }
.set-nav .tx b { display: block; font-size: 13.5px; }
.set-nav .tx small { display: block; font-size: 11.5px; color: var(--color-text-weak); margin-top: 3px; line-height: 1.45; }

.set-main { min-width: 0; display: flex; flex-direction: column; gap: 14px; padding-bottom: 64px; }
.set-section { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.set-sec-head h3 { font-size: 15px; font-weight: 700; margin: 0; }
.set-sec-head p { font-size: 12.5px; color: var(--color-text-weak); margin: 4px 0 0; }

.set-card { background: var(--color-bg-card); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); overflow: hidden; }
.set-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--color-line); background: linear-gradient(180deg, var(--color-bg-soft), var(--color-bg-card)); }
.set-card-head .t { font-size: 14px; font-weight: 700; }
.set-card-head .s { font-size: 12px; color: var(--color-text-weak); margin-top: 3px; }
.set-card-head .ops { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.set-card-head .cnt { font-size: 12px; color: var(--color-text-weak); }

.set-rows { display: flex; flex-direction: column; }
.set-row { display: flex; align-items: flex-start; gap: 18px; padding: 13px 16px; border-bottom: 1px solid var(--color-line); }
.set-row:last-child { border-bottom: 0; }
.set-row:hover { background: var(--color-bg-soft); }
.set-row.dirty { background: var(--color-primary-soft, #FFFDF6); box-shadow: inset 3px 0 0 var(--color-primary); }
.set-row .set-tx { flex: 1; min-width: 0; }
.set-row .set-tx .nm { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.set-row .set-tx .ds { font-size: 12.5px; color: var(--color-text-secondary); margin-top: 4px; line-height: 1.55; }
.set-row .set-tx .meta { font-size: 11.5px; color: var(--color-text-weak); margin-top: 5px; line-height: 1.6; }
.set-row .set-tx .meta code { background: var(--color-bg-soft); border-radius: 4px; padding: 1px 5px; font-size: 11px; }
.set-row .set-ctl { width: 260px; flex: 0 0 260px; }
.set-row .set-ctl .wm-input { width: 100%; }

.set-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--color-text-secondary); padding: 4px 2px; }

.set-savebar {
  position: fixed; left: var(--side-width); right: 0; bottom: 0; z-index: 60;
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 11px 22px; background: var(--color-bg-card); border-top: 1px solid var(--color-line);
  box-shadow: 0 -4px 14px rgba(0, 0, 0, .05);
}
.set-savebar .cnt { margin-right: auto; font-size: 12.5px; color: var(--color-text-secondary); }
.app-shell.folded .set-savebar { left: var(--side-width-mini); }

/* ============================================================
   接口与集成（apps/admin/admin.js viewIntegrations）
   ============================================================ */

.int-head { padding: 14px 16px 10px; border-bottom: 1px solid var(--color-line); }
.int-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.int-head p { margin: 5px 0 0; font-size: 12.5px; color: var(--color-text-weak); }

.int-cats { display: flex; gap: 6px; flex-wrap: wrap; padding: 12px 16px 2px; }
.int-cat {
  border: 1px solid var(--color-line); background: var(--color-bg-card); color: var(--color-text-secondary);
  font-size: 12.5px; padding: 6px 13px; border-radius: var(--radius-pill); cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: 6px;
}
.int-cat:hover { border-color: var(--color-primary); }
.int-cat.on { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-primary-ink); font-weight: 700; }
.int-cat .n { font-size: 11px; opacity: .72; }

.int-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); padding: 14px 16px 18px; }
.int-card { background: var(--color-bg-card); border: 1px solid var(--color-line); border-radius: var(--radius-lg); padding: 14px; display: flex; flex-direction: column; gap: 9px; box-shadow: var(--shadow-card); }
.int-card.on { border-color: var(--color-success); box-shadow: 0 0 0 1px var(--color-success-light), var(--shadow-card); }
.int-card .hd { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.int-card .hd .nm { font-size: 14.5px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.int-card .ds { font-size: 12.5px; color: var(--color-text-secondary); line-height: 1.55; min-height: 38px; }
.int-card .pg { display: flex; flex-direction: column; gap: 5px; }
.int-card .pg .bar { height: 5px; border-radius: 3px; background: var(--color-bg-soft); overflow: hidden; }
.int-card .pg .bar i { display: block; height: 100%; background: var(--color-primary); border-radius: 3px; }
.int-card .pg .tx { font-size: 11.5px; color: var(--color-text-weak); }
.int-card .miss { font-size: 12px; color: var(--color-warning); background: var(--color-warning-light); border-radius: var(--radius-sm); padding: 5px 9px; }
.int-card .miss.ok { color: var(--color-success); background: var(--color-success-light); }
.int-card .ops { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }

.int-tip { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--color-text-secondary); background: var(--color-bg-soft); border-radius: var(--radius-md); padding: 9px 12px; margin-bottom: 12px; }
.int-tip a { color: var(--color-info); }

.int-form { display: flex; flex-direction: column; }
.int-frow { display: grid; grid-template-columns: 168px 1fr; gap: 8px 14px; padding: 11px 0; border-bottom: 1px solid var(--color-line); }
.int-frow:last-child { border-bottom: 0; }
.int-frow .lbl { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-top: 8px; }
.int-frow .lbl .req { color: var(--color-danger); font-size: 11px; font-weight: 500; }
.int-frow .ctl .wm-input { width: 100%; }
.int-frow .hint { grid-column: 2; font-size: 11.5px; color: var(--color-text-weak); line-height: 1.6; }
.int-frow .hint code { background: var(--color-bg-soft); border-radius: 4px; padding: 1px 5px; }

.int-test { display: flex; flex-direction: column; gap: 2px; }
.int-test .sum { display: flex; align-items: center; justify-content: space-between; padding-bottom: 10px; }
.int-test .step { display: flex; align-items: flex-start; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--color-line); }
.int-test .step:last-child { border-bottom: 0; }
.int-test .step .ic { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: 0 0 24px; }
.int-test .step.ok .ic { background: var(--color-success-light); color: var(--color-success); }
.int-test .step.bad .ic { background: var(--color-danger-light); color: var(--color-danger); }
.int-test .step .bd { flex: 1; min-width: 0; }
.int-test .step .bd .t { font-size: 13.5px; font-weight: 600; }
.int-test .step .bd .s { font-size: 12px; color: var(--color-text-weak); margin-top: 3px; word-break: break-all; }
.int-test .step .ms { font-size: 11.5px; color: var(--color-text-weak); font-variant-numeric: tabular-nums; }

@media (max-width: 1080px) {
  .set-wrap { grid-template-columns: 1fr; }
  .set-side { position: static; }
}
/* ============================================================
   专业后台布局层（第十九轮新增）
   目标：把「一堆散卡片」升级成统一的后台页面骨架
   骨架：页面级 Tab → 工具条 → KPI → 面板（panel）→ 表格 / 表单
   只作用于运营后台（admin.css 仅被 admin/index.html 引入）
   ============================================================ */

:root {
  --panel-radius: 10px;
  --panel-line: #EBEDF0;
  --panel-head-bg: #FCFCFD;
  --table-head-bg: #F7F8FA;
  --focus-ring: 0 0 0 3px rgba(255, 195, 0, .18);
}

/* ---------------- 页面骨架 ---------------- */

.pg { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pg-tight { gap: 10px; }

/* 页面级 Tab：比 wm-tabs 更重，用于「一个菜单下多个业务面」 */
.pg-tabs {
  display: flex; align-items: center; gap: 2px; flex-wrap: wrap;
  background: var(--color-bg-card); border-radius: var(--panel-radius);
  padding: 4px; box-shadow: var(--shadow-card); border: 1px solid var(--panel-line);
  position: sticky; top: 0; z-index: 6;
}
.pg-tabs .pg-tab {
  border: 0; background: transparent; cursor: pointer; font-size: 13.5px; font-weight: 500;
  color: var(--color-text-secondary); padding: 8px 14px; border-radius: 7px;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  transition: background .14s, color .14s;
}
.pg-tabs .pg-tab:hover { background: var(--color-bg-hover); color: var(--color-text-primary); }
.pg-tabs .pg-tab.on { background: var(--color-primary-light); color: #7A5600; font-weight: 700; box-shadow: inset 0 0 0 1px #FFE9A8; }
.pg-tabs .pg-tab .n {
  font-size: 11px; background: var(--color-bg-soft); border-radius: 999px;
  padding: 1px 6px; color: var(--color-text-weak); font-variant-numeric: tabular-nums;
}
.pg-tabs .pg-tab.on .n { background: #FFE9A8; color: #7A5600; }
.pg-tabs .sp { flex: 1; }

/* ---------------- 工具条 ---------------- */

.pg-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--color-bg-card); border: 1px solid var(--panel-line);
  border-radius: var(--panel-radius); padding: 9px 12px; box-shadow: var(--shadow-card);
}
.pg-toolbar .grow { flex: 1; min-width: 140px; }
.pg-toolbar .wm-input { height: 32px; }
.pg-toolbar .lbl { font-size: 12.5px; color: var(--color-text-secondary); white-space: nowrap; }
.pg-toolbar .sp { flex: 1; }
.pg-seg { display: inline-flex; background: var(--color-bg-soft); border-radius: 7px; padding: 2px; }
.pg-seg button {
  border: 0; background: transparent; cursor: pointer; font-size: 12.5px; padding: 5px 11px;
  border-radius: 5px; color: var(--color-text-secondary); white-space: nowrap;
}
.pg-seg button.on { background: var(--color-bg-card); color: var(--color-text-primary); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* ---------------- 面板（替代裸 wm-card + h3） ---------------- */

.panel {
  background: var(--color-bg-card); border: 1px solid var(--panel-line);
  border-radius: var(--panel-radius); box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; min-width: 0; overflow: hidden;
}
.panel-hd {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--panel-line); background: var(--panel-head-bg);
}
.panel-hd.plain { background: var(--color-bg-card); }
.panel-hd .ttl { min-width: 0; }
.panel-hd .ttl .t { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.panel-hd .ttl .t .ic { color: var(--color-text-weak); }
.panel-hd .ttl .s { font-size: 12px; color: var(--color-text-weak); margin-top: 3px; line-height: 1.5; }
.panel-hd .ops { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.panel-bd { padding: 14px 16px; min-width: 0; }
.panel-bd.flush { padding: 0; }
.panel-bd.pad0 { padding: 0; }
.panel-ft {
  padding: 10px 16px; border-top: 1px solid var(--panel-line);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--color-bg-card);
}
.panel-ft .sp { flex: 1; }

/* 面板内的表格：贴边 + 表头更清晰 */
.panel-bd.flush .wm-table-wrap { border-radius: 0; }
.panel-bd.flush .wm-table th:first-child, .panel-bd.flush .wm-table td:first-child { padding-left: 16px; }
.panel-bd.flush .wm-table th:last-child, .panel-bd.flush .wm-table td:last-child { padding-right: 16px; }

/* flush 的本意是「让表格贴边」——表格自带单元格内边距。
   里面装的不是表格时（图表、开关行、权重条…）必须把内边距补回来，
   否则文字和图形会直接顶到卡片边缘，看着像没做完。 */
.panel-bd.flush > :not(.wm-table-wrap) { padding-left: 16px; padding-right: 16px; }
.panel-bd.flush > :not(.wm-table-wrap):first-child { padding-top: 14px; }
.panel-bd.flush > :not(.wm-table-wrap):last-child { padding-bottom: 14px; }

/* 面板内的裸 h3/h4（老代码兼容） */
.wm-card > h3 { display: flex; align-items: center; gap: 8px; }

/* ---------------- 分区标题 ---------------- */

.pg-sec { display: flex; align-items: center; gap: 8px; margin: 2px 0 -4px; }
.pg-sec::before { content: ''; width: 3px; height: 14px; border-radius: 2px; background: var(--color-primary); }
.pg-sec .t { font-size: 14px; font-weight: 700; }
.pg-sec .s { font-size: 12px; color: var(--color-text-weak); }
.pg-sec .sp { flex: 1; }

/* ---------------- 栅格 ---------------- */

.pg-stack { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pg-cols { display: grid; gap: 14px; min-width: 0; }
.pg-cols.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pg-cols.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pg-cols.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pg-cols.m21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.pg-cols.m12 { grid-template-columns: minmax(260px, 1fr) minmax(0, 2fr); }
.pg-cols.m31 { grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); }

@media (max-width: 1180px) {
  .pg-cols.c3, .pg-cols.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pg-cols.m21, .pg-cols.m12, .pg-cols.m31 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 780px) {
  .pg-cols.c2, .pg-cols.c3, .pg-cols.c4 { grid-template-columns: minmax(0, 1fr); }
}

/* ---------------- 表格升级 ---------------- */

.wm-table { font-size: 13px; }
.wm-table th, .wm-table td { padding: 9px 12px; }
.wm-table thead th {
  font-size: 12px; font-weight: 600; color: var(--color-text-secondary);
  background: var(--table-head-bg); letter-spacing: .2px;
  position: sticky; top: 0; z-index: 1;
}
.wm-table tbody tr:nth-child(even) { background: #FCFCFD; }
.wm-table tbody tr:hover { background: #FFFCF0; }
.wm-table tbody td .wm-row { gap: 6px; }
.wm-table td .small { font-size: 11.5px; }

/* ---------------- 表单区块 ---------------- */

.form-grid { display: grid; gap: 12px 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.form-sec { border: 1px solid var(--panel-line); border-radius: var(--radius-md); padding: 12px 14px 14px; }
.form-sec > .h { font-size: 13px; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 7px; }
.form-sec > .h .s { font-weight: 400; font-size: 11.5px; color: var(--color-text-weak); }

/* ---------------- 其它小件 ---------------- */

.hint-line {
  font-size: 12px; color: var(--color-text-secondary); background: var(--color-bg-soft);
  border-left: 3px solid var(--color-primary); border-radius: 6px; padding: 8px 11px; line-height: 1.6;
}
.hint-line.warn { border-left-color: var(--color-warning); background: var(--color-warning-light); }
.hint-line.danger { border-left-color: var(--color-danger); background: var(--color-danger-light); }
.kv-inline { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px; }
.kv-inline b { font-variant-numeric: tabular-nums; }
.progress { height: 6px; border-radius: 999px; background: var(--color-bg-soft); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--color-primary); border-radius: 999px; transition: width .3s; }
.progress.ok > i { background: var(--color-success); }

/* 表格里的紧凑操作列 */
.ops-cell { display: flex; gap: 5px; flex-wrap: wrap; }
/* ---------------- 设置中心补充 ---------------- */

.set-side-head { display: flex; flex-direction: column; gap: 8px; }
.set-side-act { display: flex; align-items: center; gap: 8px; }
.set-nav .tx b { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13.5px; }
.set-nav .tx b .n { font-size: 11px; color: var(--color-text-weak); font-weight: 500; font-variant-numeric: tabular-nums; }
.set-nav .chg {
  display: inline-block; font-style: normal; font-size: 11px; color: #8A6100;
  background: var(--color-primary-light); border-radius: 999px; padding: 1px 7px; margin-top: 5px;
}
.set-num { display: flex; align-items: center; gap: 8px; }
.set-num .wm-input { flex: 1; min-width: 0; }
.set-num .unit { font-size: 12px; color: var(--color-text-weak); white-space: nowrap; }
.set-row .set-ctl .wm-input.mono { font-family: var(--font-num); font-size: 12.5px; }
.set-wrap { align-items: start; }
.set-rail { max-height: calc(100vh - 180px); overflow-y: auto; }

/* 表格 / 面板内的图标按钮组 */
.panel-hd .ops .wm-btn { height: 30px; }
/* ============================================================
   卡片 → 面板 的自动升级
   老代码大量使用 card(h('h3', ...), 内容)：
   这里只用 CSS 把它变成「带页头的面板」，不用改一行业务代码。
   ============================================================ */

.wm-card:has(> h3:first-child) {
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--panel-line);
  box-shadow: var(--shadow-card);
}
.wm-card > h3:first-child {
  margin: 0;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 700;
  border-bottom: 1px solid var(--panel-line);
  background: var(--panel-head-bg);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.wm-card > h3:first-child .wm-badge { font-weight: 500; }
.wm-card > h3:first-child + h4 { margin-top: 12px; }
.wm-card:has(> h3:first-child) > *:not(h3) { padding-left: 16px; padding-right: 16px; }
.wm-card:has(> h3:first-child) > *:not(h3):first-of-type { margin-top: 14px; }
.wm-card:has(> h3:first-child) > *:not(h3):last-child { margin-bottom: 14px; }
.wm-card:has(> h3:first-child) > .wm-table-wrap,
.wm-card:has(> h3:first-child) > .wm-empty { padding-left: 0; padding-right: 0; }
.wm-card:has(> h3:first-child) > .wm-table-wrap { margin: 0; }
.wm-card:has(> h3:first-child) > .wm-table-wrap .wm-table th:first-child,
.wm-card:has(> h3:first-child) > .wm-table-wrap .wm-table td:first-child { padding-left: 16px; }
.wm-card:has(> h3:first-child) > .wm-table-wrap .wm-table th:last-child,
.wm-card:has(> h3:first-child) > .wm-table-wrap .wm-table td:last-child { padding-right: 16px; }
.wm-card:has(> h3:first-child) > .wm-row,
.wm-card:has(> h3:first-child) > .wm-col { margin-left: 16px; margin-right: 16px; }

/* 多列卡片网格：给带表格的卡片留出可读宽度 */
.grid-list { grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); }

/* 统计卡：更紧凑、更专业 */
.stat-grid { gap: 12px; grid-template-columns: repeat(auto-fill, minmax(184px, 1fr)); }
.stat { padding: 14px 16px; border: 1px solid var(--panel-line); box-shadow: var(--shadow-card); }
.stat .v { font-size: 23px; }
.stat.primary { border-color: transparent; }
/* ================= 装修中心：三栏装修台（本轮新增） ================= */

.dc-toolbar { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; background: var(--color-bg-card); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: 12px 14px; }
.dc-f { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.dc-f.grow { flex: 1; min-width: 200px; }
.dc-f > label { font-size: 12px; color: var(--color-text-weak); }
.dc-chk { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--color-text-secondary); height: 32px; }
.dc-chk input { width: 14px; height: 14px; }

.dc-grid { display: grid; grid-template-columns: 232px minmax(300px, 1fr) 372px; gap: 14px; align-items: start; }
@media (max-width: 1400px) { .dc-grid { grid-template-columns: 210px minmax(280px, 1fr); } }

.dc-col { background: var(--color-bg-card); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: 12px; min-width: 0; }
.dc-col-hd { display: flex; align-items: baseline; gap: 8px; font-weight: 600; font-size: 13px; margin-bottom: 10px; }
.dc-col-hd .sub { font-weight: 400; font-size: 11px; color: var(--color-text-weak); }
.dc-col-hd.mt { margin-top: 14px; }

.dc-pane { max-height: 520px; overflow-y: auto; }
.dc-lib-group + .dc-lib-group { margin-top: 10px; }
.dc-lib-ttl { font-size: 12px; color: var(--color-text-secondary); margin-bottom: 6px; }
.dc-lib-items { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.dc-lib-item { display: flex; align-items: center; justify-content: space-between; gap: 4px; border: 1px solid var(--color-line); background: var(--color-bg-soft); border-radius: var(--radius-sm); padding: 7px 8px; font-size: 12px; cursor: pointer; color: var(--color-text-primary); text-align: left; }
.dc-lib-item:hover { border-color: var(--color-primary); background: var(--color-primary-soft); }
.dc-lib-item .plus { color: var(--color-text-weak); }

.dc-phone { width: 320px; margin: 0 auto; border-radius: 26px; border: 8px solid var(--side-bg-2); background: var(--color-bg-card); overflow: hidden; box-shadow: 0 12px 40px rgba(0, 0, 0, .18); }
.dc-phone-screen { background: var(--color-bg-page); min-height: 420px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.dc-phone-empty { color: var(--color-text-weak); font-size: 12px; text-align: center; margin: auto; display: flex; flex-direction: column; gap: 4px; }
.dcv-blk { display: flex; flex-direction: column; gap: 6px; }
.dcv { background: var(--color-bg-card); border-radius: var(--radius-md); box-shadow: var(--shadow-card); padding: 8px 10px; cursor: pointer; border: 1px solid transparent; }
.dcv.on { border-color: var(--color-primary); }
.dcv-hd { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.dcv-nm { font-size: 13px; }
.dcv-tag { font-size: 10px; color: var(--color-text-weak); font-family: var(--font-num); }
.dcv-sub { font-size: 11px; color: var(--color-text-weak); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dcv-t-nav_bar { background: var(--color-primary); color: var(--color-primary-ink); }
.dcv-t-nav_bar .dcv-nm, .dcv-t-nav_bar .dcv-sub { color: inherit; }
.dcv-t-search_bar { border-radius: 999px; }
.dcv-t-image_banner, .dcv-t-video_player { min-height: 78px; }
.dcv-t-tab_bar { min-height: 42px; }
.dcv-t-divider, .dcv-t-spacer { min-height: 14px; padding: 0 10px; display: flex; align-items: center; }

.dc-blocks { display: flex; flex-direction: column; gap: 6px; }
.dc-blk { display: flex; align-items: center; gap: 8px; border: 1px solid var(--color-line); border-radius: var(--radius-md); padding: 8px 10px; cursor: pointer; background: var(--color-bg-card); }
.dc-blk.on { border-color: var(--color-primary); background: var(--color-bg-hover); }
.dc-blk-no { width: 20px; height: 20px; border-radius: 6px; background: var(--color-bg-soft); font-size: 11px; display: flex; align-items: center; justify-content: center; color: var(--color-text-secondary); flex: 0 0 20px; }
.dc-blk-t { flex: 1; min-width: 0; }
.dc-blk-t .nm { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-blk-t .sub { font-size: 11px; color: var(--color-text-weak); }
.dc-blk-ops { display: flex; gap: 4px; }
.dc-empty { font-size: 12px; color: var(--color-text-weak); padding: 14px; background: var(--color-bg-soft); border-radius: var(--radius-md); line-height: 1.6; }

.dc-props-hd { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.dc-props-desc { font-size: 12px; color: var(--color-text-weak); margin-bottom: 10px; line-height: 1.5; }
.dc-prop { margin-bottom: 12px; }
.dc-prop-lb { display: flex; align-items: baseline; gap: 6px; font-size: 12px; color: var(--color-text-secondary); margin-bottom: 5px; }
.dc-prop-lb .u, .dc-prop-lb .r { font-size: 11px; color: var(--color-text-weak); }
.dc-prop-hint { font-size: 11px; color: var(--color-text-weak); margin-top: 4px; line-height: 1.5; }
.dc-color { display: flex; gap: 8px; align-items: center; }
.dc-textarea { width: 100%; border: 1px solid var(--color-line); border-radius: var(--radius-sm); padding: 8px; font-size: 13px; font-family: inherit; resize: vertical; color: var(--color-text-primary); }

/* ---------------- 主题与配色 ---------------- */

.dt-layout { display: grid; grid-template-columns: 320px 1fr; gap: 14px; align-items: start; }
@media (max-width: 1180px) { .dt-layout { grid-template-columns: 1fr; } }
.dt-preview { border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow-card); }
.dt-pv-card { padding: 14px; }
.dt-pv-row { display: flex; align-items: center; justify-content: space-between; }
.dt-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.dt-group { background: var(--color-bg-card); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: 12px 14px; }
.dt-group-hd { font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.dt-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--color-line); }
.dt-row:last-child { border-bottom: 0; }
.dt-lb { flex: 1; min-width: 0; font-size: 13px; display: flex; flex-direction: column; gap: 2px; }
.dt-key { font-family: var(--font-num); font-size: 10px; color: var(--color-text-weak); }
.dt-ctl { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.dt-ctl input[type=color] { width: 34px; height: 28px; border: none; background: none; padding: 0; cursor: pointer; }
.dt-ctl .wm-input { width: 104px; }
.dt-ctl input[type=number].wm-input { width: 76px; }
.dt-unit { font-size: 11px; color: var(--color-text-weak); }

/* ---------------- 页面文字 ---------------- */

.dtx-list { background: var(--color-bg-card); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: 6px 14px; }
.dtx-row { display: flex; align-items: flex-start; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--color-line); }
.dtx-row:last-child { border-bottom: 0; }
.dtx-lb { flex: 0 0 260px; min-width: 0; }
.dtx-lb .n { font-size: 13px; display: flex; align-items: baseline; gap: 6px; }
.dtx-lb .h { font-size: 11px; color: var(--color-text-weak); margin-top: 3px; line-height: 1.5; }
.dtx-row .wm-input { flex: 1; }

/* ---------------- 装修进度 ---------------- */

.dc-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.dc-stat-card { background: var(--color-bg-card); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: 12px 14px; }
.dc-stat-card .hd { font-weight: 600; font-size: 13px; margin-bottom: 8px; }
.dc-stat-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 12px; }
.dc-stat-row .nm { flex: 0 0 108px; color: var(--color-text-secondary); }
.dc-stat-row .bar { flex: 1; height: 6px; border-radius: 3px; background: var(--color-bg-soft); overflow: hidden; }
.dc-stat-row .bar i { display: block; height: 100%; background: var(--color-primary); }
.dc-stat-row .num { font-family: var(--font-num); color: var(--color-text-weak); }.dc-toolbar .dc-act { margin-left: auto; }
.dc-toolbar .dc-act .wm-row { align-items: center; }
/* ---------------- 画像弹层内的小节 ---------------- */

.pf-sec { border-bottom: 1px solid var(--color-line); padding: 10px 0 12px; }
.pf-sec:last-of-type { border-bottom: 0; }
.pf-sec-hd { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.pf-sec-hd b { font-size: 13px; }
.pf-sec-hd .s { font-size: 11px; color: var(--color-text-weak); }
/* ---- 客服中心 · 会话窗口（第二十六轮） ---- */
.svc-msgs {
  max-height: 46vh;
  overflow: auto;
  padding: 10px 4px;
  margin: 8px 0;
  border-radius: 10px;
  background: var(--color-surface-2, rgba(255, 255, 255, 0.03));
}
.svc-msg { margin-bottom: 12px; }
.svc-msg.me { text-align: right; }
.svc-meta { font-size: 12px; opacity: 0.62; margin-bottom: 4px; }
.svc-bubble {
  display: inline-block;
  max-width: 76%;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--color-surface-3, rgba(255, 255, 255, 0.07));
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
  text-align: left;
}
.svc-msg.me .svc-bubble { background: var(--color-primary-soft, rgba(255, 195, 0, 0.16)); }
.svc-bubble.risk { outline: 1px solid var(--color-danger, #f5222d); }
.svc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
/* ============================================================
   第二轮 UI 统一（本轮新增）
   目标：所有页面的卡片 / 弹窗 / 表单 / 标签选择器用同一套骨架，
        不再出现「文字顶到卡片边」「元素互相重叠」「栅格留大洞」。
   ============================================================ */

/* ---------------- 1. 卡片内边距：一套规则，不叠加 ---------------- */

.wm-card { padding: 16px; border: 1px solid var(--panel-line); }
.wm-card.tight { padding: 12px; }

/* 带标题的卡片：标题独占一行贴边，内容统一 16px 内边距 */
.wm-card:has(> h3:first-child) { padding: 0; overflow: hidden; border-radius: var(--panel-radius); }
.wm-card:has(> h3:first-child) > h3:first-child {
  margin: 0; padding: 12px 16px; font-size: 14px; font-weight: 700;
  border-bottom: 1px solid var(--panel-line); background: var(--panel-head-bg);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
/* 内容区统一内边距（去掉以前 padding + margin 叠加造成的双倍缩进） */
.wm-card:has(> h3:first-child) > *:not(h3) { padding-left: 16px; padding-right: 16px; margin-left: 0; margin-right: 0; }
.wm-card:has(> h3:first-child) > *:not(h3):nth-child(2) { margin-top: 14px; }
.wm-card:has(> h3:first-child) > *:not(h3):last-child { margin-bottom: 14px; }
.wm-card:has(> h3:first-child) > .wm-table-wrap,
.wm-card:has(> h3:first-child) > .wm-empty { padding-left: 0; padding-right: 0; }

/* 卡片里的分隔线：统一留白，避免贴边 */
.wm-card > .hr { margin: 12px 0; }
.wm-card > .mt:first-child { margin-top: 0; }

/* ---------------- 2. 统计卡：整齐的 4 列，不再 3+1 掉队 ---------------- */

.stat-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
@media (min-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stat-grid.k2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-grid.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat-grid.k5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (min-width: 860px) and (max-width: 1179px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.stat { padding: 14px 16px; border: 1px solid var(--panel-line); box-shadow: var(--shadow-card); position: relative; overflow: hidden; }
.stat .v { font-size: 23px; }
.stat .h { line-height: 1.5; }

/* ---------------- 3. 表单：栅格整齐、区块有头 ---------------- */

.form-grid { display: grid; gap: 14px 16px; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); align-items: start; }
.form-grid > .full { grid-column: 1 / -1; }
.form-grid > .wm-field { min-width: 0; }
.wm-field .wm-input, .wm-field select.wm-input { width: 100%; }

.form-sec {
  border: 1px solid var(--panel-line); border-radius: var(--radius-md);
  padding: 0 14px 16px; margin-bottom: 14px; background: var(--color-bg-card);
}
.form-sec:last-child { margin-bottom: 0; }
.form-sec > .h {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  font-size: 13px; font-weight: 700; margin: 0 -14px 12px; padding: 10px 14px;
  border-bottom: 1px solid var(--panel-line); background: var(--panel-head-bg);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.form-sec > .h .s { font-weight: 400; font-size: 12px; color: var(--color-text-weak); line-height: 1.6; }
.form-sec .form-sec { padding: 0 12px 12px; }
.form-sec .form-sec > .h { margin: 0 -12px 10px; padding: 8px 12px; }

/* ---------------- 4. 标签选择器（以前完全没有样式，按钮裸奔） ---------------- */

.chip {
  border: 1px solid var(--color-line-strong); background: var(--color-bg-card);
  color: var(--color-text-secondary); border-radius: var(--radius-pill);
  padding: 5px 13px; font-size: 12.5px; line-height: 1.5; cursor: pointer;
  transition: all .14s; white-space: nowrap;
}
.chip:hover { border-color: var(--color-primary); color: var(--color-primary-dark); background: #FFFDF6; }
.chip.on {
  background: var(--color-primary); border-color: var(--color-primary-dark);
  color: var(--color-primary-ink); font-weight: 600;
}
.chip.lg { padding: 7px 16px; font-size: 13px; }
.chip-wrap { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; border: 1px dashed var(--color-line-strong); border-radius: var(--radius-md); background: var(--color-bg-soft); }

/* ---------------- 5. 面板里的表格：超出宽度就横向滚动，不再被裁掉 ---------------- */

.panel-bd.flush > .wm-table-wrap,
.panel-bd > .wm-table-wrap { overflow-x: auto; }
.wm-table-wrap { overflow-x: auto; }
/* 操作列固定在右侧，列多也不用先滚到底才能点按钮 */
.panel-bd.flush .wm-table th:last-child,
.panel-bd.flush .wm-table td:last-child { position: sticky; right: 0; background: var(--color-bg-card); box-shadow: -6px 0 8px -6px rgba(0,0,0,.08); }
.panel-bd.flush .wm-table thead th:last-child { background: var(--color-bg-soft); z-index: 3; }
.wm-table td { vertical-align: middle; }
.wm-table td .wm-col { gap: 2px; }

/* ---------------- 6. 弹窗：内容分区块、底部按钮不挤 ---------------- */

.wm-sheet { max-width: 620px; }
.wm-sheet-head { padding: 15px 20px; }
.wm-sheet-head b { font-size: 15.5px; }
.wm-sheet-body { padding: 18px 20px; }
.wm-sheet-foot { padding: 12px 20px; gap: 10px; }
.wm-sheet-body > .wm-card { box-shadow: none; }
.wm-sheet-body > .mt:first-child { margin-top: 0; }

/* ---------------- 7. 键值对：宽卡里按「行」排，不再一行拉到屏幕最右 ---------------- */

.wm-kv { gap: 10px 16px; }
.wm-kv .k { font-size: 12.5px; }
.wm-kv .v { text-align: right; }
/* 详情类卡片里用 rows 形态，读起来像一张账单 */
.wm-kv.rows { grid-template-columns: 1fr; gap: 0; }
.wm-kv.rows .row-line { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px dashed var(--color-line); }
.wm-kv.rows .row-line:last-child { border-bottom: 0; }

/* ---------------- 8. 页面级：标题与工具条留白更舒服 ---------------- */

.pg { display: flex; flex-direction: column; gap: 14px; }
.pg-toolbar { gap: 8px; flex-wrap: wrap; }
.pg-tabs { flex-wrap: wrap; }
.hint-line { border-radius: var(--radius-md); }
/* ==================== 围栏地图（圆心/半径可拖拽）· 第二十九轮 ==================== */
.fence-map {
  border: 1px solid var(--color-line-strong);
  border-radius: 14px;
  background: var(--color-bg-card);
  overflow: hidden;
}
.fence-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-line);
  background: var(--color-bg-soft);
  flex-wrap: wrap;
}
.fence-title { font-weight: 600; font-size: 13px; color: var(--color-text-primary); }
.fence-hint { margin-left: auto; font-size: 12px; color: var(--color-text-weak); }
.fence-btn {
  border: 1px solid var(--color-line-strong);
  background: var(--color-bg-card);
  color: var(--color-text-primary);
  border-radius: 8px;
  min-width: 32px;
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
  cursor: pointer;
  line-height: 1;
}
.fence-btn:hover { border-color: var(--color-primary); color: var(--color-primary-dark); }
.fence-svg { display: block; width: 100%; height: auto; touch-action: none; cursor: grab; }
.fence-svg.dragging { cursor: grabbing; }
.fence-bg { fill: var(--color-bg-page); }
.fence-grid { stroke: var(--color-line); stroke-width: 1; }
.fence-hex { fill: var(--color-primary-light); fill-opacity: 0.55; stroke: var(--color-primary-dark); stroke-width: 0.8; stroke-opacity: 0.5; }
.fence-ring { fill: var(--color-info); fill-opacity: 0.08; stroke: var(--color-info); stroke-width: 2; stroke-dasharray: 6 4; }
.fence-spoke { stroke: var(--color-info); stroke-width: 1; stroke-opacity: 0.6; }
.fence-pin, .fence-handle { fill: var(--color-bg-card); stroke: var(--color-info); stroke-width: 3; }
.fence-handle { stroke: var(--color-primary-dark); }
.fence-pin-hit, .fence-handle-hit { fill: transparent; }
.fence-pin-hit { cursor: move; }
.fence-handle-hit { cursor: ew-resize; }
.fence-marker { fill: var(--color-price); fill-opacity: 0.9; }
.fence-marker.rider { fill: #17794a; fill-opacity: 0.92; stroke: #fff; stroke-width: 1.4; }
.fence-marker.order { fill: var(--color-primary-dark); fill-opacity: 0.95; stroke: #fff; stroke-width: 1.2; }
.fence-marker.shop { fill: #1c5fa8; fill-opacity: 0.9; stroke: #fff; stroke-width: 1.2; }
.fence-marker-text { font-size: 11px; fill: var(--color-text-secondary); }
.fence-label { font-size: 12px; fill: var(--color-info); font-weight: 600; }
.fence-foot { padding: 8px 14px; border-top: 1px solid var(--color-line); }
.fence-readout { font-size: 12px; color: var(--color-text-secondary); }
/* =====================================================================
 * 调度台「派单引擎」页 · 第二十九轮
 * 这一页要回答四个问题：现在卡在哪、按什么标准挑人、参数怎么调、改完会怎样。
 * 所以样式只服务于「漏斗 + 权重条 + 参数格子 + 链路」，颜色一律走设计令牌，不硬编码。
 * ===================================================================== */
.dp-engine { display: flex; flex-direction: column; gap: var(--space-lg); }
.dp-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: var(--space-lg); align-items: start; }

/* ---- 派单漏斗 ---- */
.dp-funnel { display: flex; flex-direction: column; gap: 10px; }
.dp-funnel-row { display: grid; grid-template-columns: 96px 1fr 56px; align-items: center; gap: var(--space-md); }
.dp-funnel-row .lb { font-size: 13px; color: var(--color-text-secondary); }
.dp-funnel-row .bar { height: 12px; border-radius: var(--radius-pill); background: var(--color-bg-soft); overflow: hidden; }
.dp-funnel-row .fill { display: block; height: 100%; border-radius: var(--radius-pill); background: var(--color-primary); transition: width .25s ease; }
.dp-funnel-row .fill.warn { background: var(--color-warning); }
.dp-funnel-row .fill.info { background: var(--color-info); }
.dp-funnel-row .fill.success { background: var(--color-success); }
.dp-funnel-row .fill.danger { background: var(--color-danger); }
.dp-funnel-row .fill.gray { background: var(--color-text-disabled); }
.dp-funnel-row .vl { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- 权重可视化 ---- */
.dp-weight { display: grid; grid-template-columns: 104px 1fr 52px; align-items: center; gap: var(--space-md); padding: 5px 0; }
.dp-weight .nm { font-size: 13px; color: var(--color-text-secondary); }
.dp-weight .bar { height: 10px; border-radius: var(--radius-pill); background: var(--color-bg-soft); overflow: hidden; }
.dp-weight .bar i { display: block; height: 100%; border-radius: var(--radius-pill); background: linear-gradient(90deg, var(--color-primary), var(--color-primary-dark)); }
.dp-weight .vl { text-align: right; font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--color-text-primary); }
.dp-note { margin-top: var(--space-md); padding: 9px 12px; border-radius: var(--radius-md); font-size: 12.5px; line-height: 1.7; }
.dp-note.ok { background: var(--color-success-light); color: var(--color-success); }
.dp-note.warn { background: var(--color-warning-light); color: var(--color-warning); }

/* ---- 参数格子 ---- */
.dp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--space-md); }
.dp-field { padding: var(--space-md); border: 1px solid var(--color-line); border-radius: var(--radius-md); background: var(--color-bg-soft); }
.dp-field .dn { font-size: 12.5px; color: var(--color-text-secondary); }
.dp-field .dv { margin-top: 5px; font-size: 15px; font-weight: 600; color: var(--color-text-primary); }
.dp-field .dd { margin-top: 5px; font-size: 11.5px; line-height: 1.6; color: var(--color-text-weak); }

/* ---- 派单链路 ---- */
.dp-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dp-chain-node { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--radius-pill); background: var(--color-primary-light); color: var(--color-primary-ink); font-size: 12.5px; }
.dp-chain-node .idx { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: var(--color-primary); color: var(--color-primary-ink); font-size: 11px; font-weight: 700; }
.dp-chain-node .arrow { margin-left: 2px; color: var(--color-text-disabled); }

/* ---- 模拟派单结果 ---- */
.dp-sim { display: flex; flex-direction: column; gap: var(--space-sm); margin-top: var(--space-md); }
.dp-sim-row { display: grid; grid-template-columns: 44px 1fr 74px; align-items: center; gap: var(--space-md); padding: 10px var(--space-md); border: 1px solid var(--color-line); border-radius: var(--radius-md); background: var(--color-bg-card); }
.dp-sim-row .rk { font-weight: 700; color: var(--color-primary-ink); }
.dp-sim-row .sc { text-align: right; font-size: 15px; font-weight: 700; color: var(--color-price); font-variant-numeric: tabular-nums; }
.dp-sim-row .fc { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.dp-sim-row .fchip { padding: 2px 8px; border-radius: var(--radius-pill); background: var(--color-bg-soft); border: 1px solid var(--color-line); font-size: 11.5px; color: var(--color-text-secondary); }
/* =====================================================================
 * 卡片 / 弹窗排版统一 · 第三十轮
 * 用户反馈「有的文字顶到卡片最左边、被压成竖排」。根因是面板头与工具条里的
 * 说明文字和下拉框作为 flex 子项被压缩。这里统一给它们「不换行、不收缩」。
 * ===================================================================== */
.panel-hd .ops > span,
.panel-hd .ops .wm-row > span,
.pg-toolbar > span,
.pg-toolbar .wm-row > span { white-space: nowrap; flex: 0 0 auto; }
.panel-hd .ops select,
.pg-toolbar select { flex: 0 1 auto; width: auto; min-width: 120px; max-width: 240px; }
.panel-hd .wm-row { flex-wrap: wrap; justify-content: flex-end; }
.panel-hd .ops { max-width: 62%; }
.panel-hd .ttl .s { max-width: 720px; }

/* 统计卡：数字与说明之间留口气，不要贴边 */
.stat-grid > * { min-width: 0; }
.wm-card { line-height: 1.65; }
.wm-card > :first-child { margin-top: 0; }
.wm-card > :last-child { margin-bottom: 0; }

/* 键值对：值列允许换行，长文本不再撑破卡片 */
.wm-kv { row-gap: 8px; }
.wm-kv .k { white-space: nowrap; }
.wm-kv .v { min-width: 0; word-break: break-word; }

/* 表格里的操作列始终靠右且不换行 */
.wm-table td .ops, .wm-table td.ops { white-space: nowrap; }
/* ============================================================================
   第三十一轮 · 信息架构与卡片排版
   1) 菜单按「平台 / 商家 / 站点 / 调度 / 骑手 / 财务 / 营销 / 广告 / 系统 / 装修」重组：
      派单引擎与派单规则归调度中心，配送渠道 / 计价与天气 / 蜂窝网格归配送站点；
   2) 卡片统一留白与行高，修「文字顶到卡片最左边」「操作按钮挤出右边界」；
   3) 补齐本次页面用到的 .chips / .dp-* 等类。
   ========================================================================= */

/* ---- 卡片统一留白 ---- */
.panel-hd { padding: 14px 18px; }
.panel-bd { padding: 16px 18px; }
.panel-bd.flush, .panel-bd.pad0 { padding: 0; }
.panel-ft { padding: 12px 18px; }
.panel-bd.flush .wm-table th:first-child,
.panel-bd.flush .wm-table td:first-child { padding-left: 18px; }
.panel-bd.flush .wm-table th:last-child,
.panel-bd.flush .wm-table td:last-child { padding-right: 18px; }
.panel-hd .ttl { flex: 1 1 auto; }
.panel-hd .ops { flex: 0 0 auto; }
.panel-hd .ttl .s { margin-top: 4px; line-height: 1.6; }

/* ---- 表格：单元格留白与行高 ---- */
.wm-table th { padding-top: 10px; padding-bottom: 10px; }
.wm-table td { padding-top: 11px; padding-bottom: 11px; }

/* ---- 指标卡 ---- */
.stat-grid { gap: 16px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.stat { padding: 18px 18px 16px; }

/* ---- 标签组：能力 / 状态胶囊横排，不再一个个竖着掉下来 ---- */
.chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }

/* ---- 参数格子：留白更足，长中文不折行 ---- */
.dp-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.dp-field { padding: 14px 16px; }
.dp-field .dn { line-height: 1.5; }
.dp-field .dd { line-height: 1.65; }
/* ---- 第三十二轮：总开关关闭时，被管辖的配置项上锁 ---- */
.set-ctl.locked { position: relative; }
.set-ctl.locked .wm-input,
.set-ctl.locked select,
.set-ctl.locked input { background: var(--color-bg-soft); color: var(--color-text-weak); cursor: not-allowed; }
.set-ctl.locked .set-num { opacity: .7; }
.set-ctl .unlock { margin-top: 6px; }
.set-ctl.unlocked { box-shadow: inset 0 0 0 1px var(--color-warning); border-radius: var(--radius-md); padding: 4px; }
.set-row .set-tx .meta .lock { color: var(--color-warning); }

/* ==================== 第三十三轮：菜单图片库（素材中心） ==================== */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.media-card {
  position: relative; border: 1px solid var(--color-line); border-radius: 10px; overflow: hidden;
  background: var(--color-bg-card); display: flex; flex-direction: column; transition: box-shadow .15s, border-color .15s;
}
.media-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.media-card.picked { border-color: var(--color-primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-primary) 30%, transparent); }
.media-pick {
  position: absolute; top: 6px; left: 6px; z-index: 2; background: rgba(255,255,255,.92);
  border-radius: 6px; padding: 2px 5px; line-height: 1; cursor: pointer;
}
.media-pick input { margin: 0; cursor: pointer; }
.media-thumb { width: 100%; aspect-ratio: 4 / 3; background: var(--color-bg-soft); overflow: hidden; }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-thumb img.broken {
  object-fit: contain; padding: 14px; background: repeating-linear-gradient(45deg, #f6f7f9, #f6f7f9 8px, #eef0f3 8px, #eef0f3 16px);
}
.media-meta { padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.media-meta .nm { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-ops { margin-top: auto; display: flex; gap: 4px; padding: 0 10px 10px; flex-wrap: wrap; }
.media-ops .wm-btn { flex: 1 1 auto; }
.media-batch-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }/* ---------------- 聚合调度台（三段泳道 + 岗位运力） ----------------
   聚合站的一天就是「收餐 → 分拣 → 配送」三段在跑，调度要一眼看出卡在哪，
   所以三段并排，待处理量为 0 时是安静的白卡，有积压才亮起来。 */
.agg-lanes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 900px) { .agg-lanes { grid-template-columns: 1fr; } }
.agg-lane {
  background: var(--color-bg-card); border: 1px solid var(--color-line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: 14px 16px;
}
.agg-lane.hot { border-color: var(--color-warning); box-shadow: 0 0 0 2px var(--color-warning-light); }
.agg-lane .hd { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.agg-lane .hd b { font-size: 13.5px; }
.agg-lane .big { font-size: 26px; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.agg-lane.hot .big { color: var(--color-warning); }
.agg-lane .big + .small { margin: 2px 0 8px; }

.agg-roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.agg-role { border: 1px solid var(--color-line); border-radius: var(--radius-md); padding: 10px 12px; }
.agg-role .hd { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.agg-role .hd b { font-size: 13px; }
.agg-rider {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 6px 0; border-top: 1px dashed var(--color-line);
}
.agg-rider:first-child { border-top: 0; }
.agg-rider .nm { flex: 1 1 auto; min-width: 0; font-size: 13px; }
/* ---------------- 订单流时间轴 ----------------
   纠纷判责靠的就是「谁几点做了什么」，所以节点要密、时间要显眼、
   未发生的节点也要占位，一眼看出卡在哪一步。 */
.flow-wrap { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(240px, 1fr); gap: 16px; }
@media (max-width: 900px) { .flow-wrap { grid-template-columns: 1fr; } }
.flow { position: relative; padding-left: 4px; }
.flow-item { display: flex; gap: 10px; padding: 0 0 14px; position: relative; }
.flow-item:last-child { padding-bottom: 2px; }
.flow-item::before {
  content: ''; position: absolute; left: 5px; top: 14px; bottom: 0; width: 1.5px;
  background: var(--color-line-strong);
}
.flow-item:last-child::before { display: none; }
.flow-item .dot {
  width: 11px; height: 11px; border-radius: 50%; flex: 0 0 11px; margin-top: 4px;
  background: var(--color-line-strong); box-shadow: 0 0 0 3px var(--color-bg-card); z-index: 1;
}
.flow-item.done .dot { background: var(--color-success); }
.flow-item.bad .dot { background: var(--color-danger); }
.flow-item.next .dot { background: var(--color-primary); box-shadow: 0 0 0 3px var(--color-bg-card), 0 0 0 5px var(--color-primary-light); }
.flow-item.wait .dot { background: var(--color-line-strong); }
.flow-item .bd { min-width: 0; flex: 1; }
.flow-item .tt { display: flex; align-items: baseline; gap: 10px; }
.flow-item .tt b { font-size: 13px; }
.flow-item.wait .tt b { color: var(--color-text-weak); font-weight: 500; }
.flow-item .tm { font-size: 11.5px; color: var(--color-text-secondary); }
.flow-item .nt { font-size: 12px; color: var(--color-text-weak); margin-top: 2px; line-height: 1.6; word-break: break-all; }
.flow-side {
  border: 1px solid var(--color-line); border-radius: var(--radius-md);
  padding: 6px 12px 10px; align-self: start;
}
.flow-side .fl-hd { font-size: 12.5px; font-weight: 700; color: var(--color-text-secondary); padding: 6px 0 4px; }
.kv-inline.col { display: block; }
.kv-inline.col > span { display: flex; gap: 8px; padding: 5px 0; border-bottom: 1px dashed var(--color-line); font-size: 12.5px; }
.kv-inline.col > span:last-child { border-bottom: 0; }
.kv-inline.col > span > b { margin-left: auto; font-variant-numeric: tabular-nums; }
/* 画像弹层里的空态：抽屉空间宝贵，空态收成一行，不要 40px 内边距 + 大圆圈 */
.pf-sec .wm-empty { padding: 10px 0; text-align: left; }
.pf-sec .wm-empty .ico { display: none; }
.pf-sec .rule { font-size: 12.5px; color: var(--color-text-secondary); line-height: 1.7; }
.pf-sec .rule.mt { margin-top: 4px; }

/* 站点地址预设与上楼：两个开关固定宽度，避免下拉被拉满整行 */
.ap-switch { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; padding: 4px 0 2px; }
.ap-switch-item { flex: 0 0 300px; min-width: 0; }
.ap-switch-item.wide { flex: 0 0 430px; }

/* ---------------- 装修台：图片选择与列表项编辑（第四十轮） ----------------
   背景：装修台原来把轮播图 / 金刚区存成「每行一项、用 | 分隔」的文本框，
   既看不到图也没法排序。这里补齐可视化编辑：一条一张卡，可传图、可拖动排序、可删除。 */

.dci { display: flex; gap: 10px; align-items: flex-start; }
.dci-thumb {
  width: 62px; height: 62px; flex: 0 0 62px; border-radius: var(--radius-md);
  border: 1px solid var(--color-line); background: var(--color-bg-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--color-text-weak); overflow: hidden;
}
.dci-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dci-r { flex: 1 1 auto; min-width: 0; }
.dci-btns { display: flex; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.dcl .dci-thumb { width: 44px; height: 44px; flex: 0 0 44px; }
.dcl .dci-btns { margin-bottom: 4px; }
.dcl .dci-btns .wm-btn { padding: 3px 10px; font-size: 11px; }

.dcl { border: 1px solid var(--color-line); border-radius: var(--radius-md); padding: 10px; background: var(--color-bg-soft); }
.dcl-hd { display: flex; align-items: baseline; justify-content: space-between; font-size: 12px; margin-bottom: 8px; }
.dcl-hd .n { color: var(--color-text-weak); font-size: 11px; }
.dcl-row {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--color-bg-card); border: 1px solid var(--color-line);
  border-radius: var(--radius-md); padding: 10px; margin-bottom: 8px;
}
.dcl-no {
  flex: 0 0 22px; height: 22px; border-radius: 50%; background: var(--color-primary-light);
  color: var(--color-primary); font-size: 11px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.dcl-fields { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.dcl-f { flex: 1 1 100%; min-width: 0; }
/* 属性栏只有 370px 宽，半宽会把图标和名称挤成一团，这里统一整行排 */
.dcl-f.half { flex: 1 1 100%; }
.dcl-lb { font-size: 11px; color: var(--color-text-weak); margin-bottom: 4px; }
.dcl-hint { font-size: 11px; color: var(--color-text-weak); margin-top: 4px; }
.dcl-ops { flex: 0 0 auto; display: flex; flex-direction: column; gap: 4px; }
.dcl-ops .wm-btn { padding: 4px 8px; font-size: 11px; }
.dcl .dc-empty { margin-bottom: 8px; }

.dcip-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.dcip-bar .grow { flex: 1 1 auto; }
.dcip-url { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.dcip-url .lb { font-size: 12px; color: var(--color-text-weak); flex: 0 0 auto; }
.dcip-status { font-size: 12px; color: var(--color-text-weak); margin-bottom: 8px; min-height: 16px; }
.dcip-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px;
  max-height: 46vh; overflow: auto; padding: 2px;
}
.dcip-cell {
  border: 1px solid var(--color-line); border-radius: var(--radius-md); background: var(--color-bg-card);
  padding: 0; overflow: hidden; cursor: pointer; text-align: left;
}
.dcip-cell.on { border-color: var(--color-primary); box-shadow: 0 0 0 2px var(--color-primary-light); }
.dcip-cell img { width: 100%; height: 76px; object-fit: cover; display: block; background: var(--color-bg-soft); }
.dcip-cell .nm { display: block; font-size: 11px; color: var(--color-text-secondary); padding: 6px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* ---------------- 装修台手机预览：真实观感（第四十轮） ---------------- */

.dcv-nav { font-size: 13px; font-weight: 600; }
.dcv-search { background: var(--color-bg-soft); color: var(--color-text-weak); font-size: 12px; padding: 7px 12px; }
.dcv-notice { background: var(--color-warning-light); color: var(--color-warning); font-size: 11.5px; padding: 6px 10px; border-radius: var(--radius-sm); }
.dcv-meta { font-size: 10.5px; color: var(--color-text-weak); margin-top: 4px; }

.dcv-banner { position: relative; border-radius: var(--radius-md); overflow: hidden; background: var(--color-bg-soft); display: flex; align-items: center; justify-content: center; }
.dcv-banner .it { display: none; width: 100%; height: 100%; }
.dcv-banner .it.on { display: block; }
.dcv-banner .it img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dcv-banner .ph { font-size: 11px; color: var(--color-text-weak); padding: 0 8px; text-align: center; }

.dcv-grid { display: grid; gap: 8px 6px; padding: 8px 4px 2px; }
.dcv-grid .ph, .dcv-stats .ph, .dcv-tabbar .ph { grid-column: 1 / -1; font-size: 11px; color: var(--color-text-weak); text-align: center; }
.dcv-grid .it { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.dcv-grid .it img.gi { width: 30px; height: 30px; border-radius: var(--radius-md); object-fit: cover; display: block; }
.dcv-grid .it .dot { width: 30px; height: 30px; border-radius: var(--radius-md); background: var(--color-primary-light); display: block; }
.dcv-grid .it .tx { font-size: 10.5px; color: var(--color-text-secondary); }

.dcv-tabbar { display: flex; justify-content: space-around; align-items: flex-end; padding-top: 6px; border-top: 1px solid var(--color-line); }
.dcv-tabbar .it { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10px; color: var(--color-text-weak); }
.dcv-tabbar .it img.gi { width: 18px; height: 18px; border-radius: 4px; object-fit: cover; }

.dcv-stats { display: grid; gap: 6px; padding-top: 6px; }
.dcv-stats .it { text-align: center; }
.dcv-stats .it b { display: block; font-size: 14px; }
.dcv-stats .it span { font-size: 10.5px; color: var(--color-text-weak); }

.dcv-text { font-size: 11.5px; color: var(--color-text-secondary); line-height: 1.6; white-space: pre-wrap; }
.dcv-divider { height: 1px; background: var(--color-line); margin: 6px 0; }
/* 右侧属性栏在 300px 时放不下「列表项编辑器」，放宽到 360px */

/* 装修台「真实预览」：手机里内嵌端上真实页面（同源 iframe） */
.dc-phone.real { width: 402px; border-radius: 30px; }
.dc-col-hd select { max-width: 178px; font-size: 11px; padding: 3px 6px; }
.dc-phone.real .dc-col-hd select { font-size: 11px; }
.dc-live { height: 668px; background: #f6f6f6; }
.dc-live iframe.dc-frame { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.dc-phone { transition: width .18s ease; }

/* ============================ 小票模板设计师（实时预览） ============================ */
/* 左边改配置，右边立刻看到「打出来是什么样」。纸张观感是仿真预览，不参与任何金额计算。 */
.rp-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 336px; gap: 16px; align-items: start; }
.rp-left { min-width: 0; display: flex; flex-direction: column; gap: 10px; max-height: 66vh; overflow-y: auto; padding-right: 4px; }
.rp-sec { border: 1px solid var(--color-line); border-radius: 10px; padding: 10px 12px; background: var(--color-bg-card); }
.rp-sec-h { display: flex; align-items: baseline; gap: 8px; font-size: 13px; font-weight: 600; color: var(--color-text-primary); margin-bottom: 8px; }
.rp-tip { font-size: 11.5px; font-weight: 400; color: var(--color-text-weak); }
.rp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; }
.rp-f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rp-f.full { grid-column: 1 / -1; }
.rp-f > .lb { font-size: 11.5px; color: var(--color-text-secondary); }
.rp-f .wm-input { width: 100%; }
.rp-inline { display: flex; gap: 6px; align-items: center; }
.rp-inline .wm-input { flex: 1 1 auto; min-width: 0; }
.rp-inline .rp-var { flex: 0 0 140px; width: 140px; }
.rp-blocks { display: flex; flex-direction: column; gap: 8px; }
.rp-bk { border: 1px solid var(--color-line); border-radius: 10px; background: var(--color-bg-soft); padding: 8px 10px; }
.rp-bk-hd { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.rp-bk-hd .no { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 6px; background: var(--color-primary); color: var(--color-primary-ink); font-size: 11.5px; font-weight: 700; }
.rp-bk-hd .nm { font-size: 12.5px; font-weight: 600; color: var(--color-text-primary); }
.rp-bk-hd .sp { flex: 1 1 auto; }
.rp-check { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--color-text-secondary); }
.rp-ic { border: 1px solid var(--color-line-strong); background: var(--color-bg-card); color: var(--color-text-secondary); border-radius: 6px; font-size: 11.5px; padding: 2px 7px; cursor: pointer; }
.rp-ic:hover { color: var(--color-text-primary); border-color: var(--color-text-weak); }
.rp-ic.danger:hover { color: var(--color-danger); border-color: var(--color-danger); }
.rp-add { display: flex; flex-wrap: wrap; gap: 6px; }
.rp-empty { padding: 16px; text-align: center; color: var(--color-text-weak); font-size: 12.5px; border: 1px dashed var(--color-line-strong); border-radius: 10px; }
.rp-right { position: sticky; top: 0; display: flex; flex-direction: column; gap: 8px; }
.rp-stage-hd { display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; font-weight: 600; color: var(--color-text-primary); }
.rp-stage { background: var(--color-bg-page); border: 1px solid var(--color-line); border-radius: 12px; padding: 14px 10px; max-height: 64vh; overflow-y: auto; display: flex; justify-content: center; }
.rp-note { font-size: 11.5px; color: var(--color-text-weak); line-height: 1.6; }
.rp-paper { width: 262px; padding: 12px 11px 16px; border-radius: 2px; box-shadow: 0 3px 14px rgba(0, 0, 0, .14); color: var(--color-text-primary); align-self: flex-start; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace; }
.rp-l { white-space: pre; letter-spacing: 0; }
.rp-qr { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0; }
.rp-qr .bx { width: 96px; height: 96px; border: 1px dashed var(--color-text-weak); border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--color-text-weak); background: var(--color-bg-card); }
.rp-qr .cap, .rp-bar .cap { font-size: 10px; color: var(--color-text-weak); text-align: center; word-break: break-all; max-width: 232px; }
.rp-bar { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 0; }
.rp-bar i { display: block; width: 172px; height: 44px; background: repeating-linear-gradient(90deg, var(--color-text-primary) 0 2px, transparent 2px 4px, var(--color-text-primary) 4px 5px, transparent 5px 8px); }
.rp-fail { color: var(--color-text-weak); font-size: 12px; text-align: center; padding: 20px 0; white-space: normal; }