:root {
  /* 相对平台 FIT-1（墨绿 #2f5d50 + 暖米底）：分销用冷灰蓝，一眼可辨即可 */
  --bg: #f0f3f8;
  --panel: #fff;
  --line: #dde3ec;
  --line-soft: #edf1f7;
  --text: #1e293b;
  --muted: #64748b;
  --brand: #2563a8;
  --brand-hover: #1f5390;
  --brand-soft: #e8f0f8;
  /* 行选择统一（2026-08-18 主人定：选中/未选清晰易区分、简单大方不突兀）：
     选中 = --row-sel-bg 浅蓝底 + 品牌色左条；选中态 hover 再深半档；未选 hover = --row-hover */
  --row-hover: #f6f9fd;
  --row-sel-bg: #c2d9ef;
  --row-sel-hover: #aecde8;
  --row-sel-bar: inset 3px 0 0 var(--brand);
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --ok: #047857;
  --sidebar: #f7f8fb;
  --sidebar-text: #1e293b;
  --sidebar-line: #e6e9f0;
  --nav-head: #1e4b8c;
  --nav-head-open-bg: #eef1f7;
  --radius: 10px; /* 卡片圆角 */
  --radius-sm: 6px; /* 按钮 / chip / 输入框圆角 */
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-pop: 0 16px 40px rgba(15, 23, 42, 0.16);
  /* 字台阶梯：页面标题 20 / 卡片题 16 / 正文 14 / 辅助 12 */
  --fs-page: 20px;
  --fs-card: 16px;
  --fs-body: 14px;
  --fs-aux: 12px;
  /* 间距基数 8：8 / 12 / 16 / 24 */
  --sp-1: 8px;
  --sp-2: 12px;
  --sp-3: 16px;
  --sp-4: 24px;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* === 主题换肤（2026-08-18 主人定：CSS 变量驱动，顶栏可选风格，localStorage 持久化） ===
   默认 = 冷灰蓝（:root 原值）；覆盖块只列主题相关令牌，其余沿用 :root */
:root[data-theme="green"] {
  /* FIT-1 平台墨绿系 */
  --brand: #2f5d50;
  --brand-hover: #254a40;
  --brand-soft: #e4efeb;
  --nav-head: #265142;
  --nav-head-open-bg: #e9f0ed;
  --row-hover: #f3f8f5;
  --row-sel-bg: #bcd8ca;
  --row-sel-hover: #a8cdbb;
}
:root[data-theme="pink"] {
  /* 消费端唯品粉系（与小程序/App 令牌 v1.1 同源） */
  --brand: #f10180;
  --brand-hover: #c40d6a;
  --brand-soft: #fde7f1;
  --nav-head: #b0106a;
  --nav-head-open-bg: #fbeef4;
  --row-hover: #fdf2f7;
  --row-sel-bg: #f6c4dd;
  --row-sel-hover: #f2aed1;
}
/* 顶栏风格选择器 */
.theme-select {
  height: 26px; padding: 0 6px; font-size: var(--fs-aux);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--panel); color: var(--muted); cursor: pointer;
}
.theme-select:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: var(--font); color: var(--text); background: var(--bg); }
body { font-size: var(--fs-body); line-height: 1.5; }
a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font: inherit; }

/* === 登录页 === */
.login-wrap {
  min-height: 100%; display: grid; place-items: center;
  background: linear-gradient(160deg, #e4eef7 0%, #f0f3f8 48%, #e8eef4 100%);
}
.login-card {
  width: min(400px, 92vw); background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 32px 28px; box-shadow: var(--shadow-pop);
}
.login-card h1 { margin: 0 0 6px; font-size: var(--fs-page); font-weight: 700; }
.login-card p { margin: 0 0 18px; color: var(--muted); font-size: var(--fs-aux); }
.login-card .login-sub { margin: 12px 0 0; font-size: 13px; }
.login-card .login-sub a { color: var(--primary); }
.login-card label { display: block; font-size: var(--fs-aux); color: var(--muted); margin: 12px 0 4px; }
.login-card input { width: 100%; height: 36px; }
.login-card .btn { width: 100%; height: 36px; margin-top: 16px; }

/* === 布局：侧边栏 + 顶栏 === */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100%; }
.sidebar {
  background: var(--sidebar); color: var(--sidebar-text);
  border-right: 1px solid var(--sidebar-line);
  padding: 12px 10px 16px;
  display: flex; flex-direction: column; gap: 4px;
  overflow-y: auto;
}
.brand {
  font-weight: 700; font-size: 15px; padding: 10px 12px 14px;
  letter-spacing: .02em; color: var(--nav-head);
  border-bottom: 1px solid var(--sidebar-line); margin-bottom: 4px;
}
.mode-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  vertical-align: middle;
}
.mode-badge.shared {
  background: #e8f0fe;
  color: #1a56db;
}
.mode-badge.standalone {
  background: #fef3c7;
  color: #92400e;
}
.login-card .mode-badge { margin-left: 8px; }
.nav { display: flex; flex-direction: column; gap: 0; }
.nav-panel {
  border-bottom: 1px solid var(--sidebar-line);
}
.nav-panel:last-child { border-bottom: none; }
.nav-panel-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: none;
  background: transparent;
  color: var(--nav-head);
  font-size: 13px;
  font-weight: 600;
  padding: 10px;
  cursor: pointer;
  text-align: left;
  border-radius: var(--radius-sm);
}
.nav-panel-head:hover { background: #f0f2f7; }
.nav-panel.open .nav-panel-head {
  background: var(--nav-head-open-bg);
}
.nav-panel-head .chev {
  flex-shrink: 0;
  width: 16px;
  text-align: center;
  font-size: 11px;
  color: #8b95a8;
  transition: transform .15s ease;
  transform: rotate(180deg);
}
.nav-panel.open .nav-panel-head .chev { transform: rotate(0deg); color: var(--nav-head); }
.nav-panel-body {
  display: none;
  padding: 2px 4px 10px 4px;
  background: #fff;
}
.nav-panel.open .nav-panel-body { display: block; }
.nav a {
  display: block; color: #334155; padding: 7px 10px 7px 22px; border-radius: var(--radius-sm);
  font-size: 13px; margin: 1px 0; font-weight: 400;
}
.nav a:hover { background: #f3f5f9; color: var(--nav-head); }
/* 当前项：brand-soft 底 + 品牌色左条 */
.nav a.active {
  background: var(--brand-soft); color: var(--brand); font-weight: 600;
  box-shadow: inset 3px 0 0 var(--brand);
}
.nav a.soon { opacity: .45; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 56px; background: var(--panel); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 20px;
  gap: 10px;
}
.topbar .title { font-weight: 700; font-size: var(--fs-card); flex: 1; min-width: 0; }
.topbar .user { color: var(--muted); font-size: var(--fs-aux); display: flex; gap: 12px; align-items: center; }
.btn-menu {
  display: none;
  border: 1px solid var(--line); background: #fff; color: var(--text);
  border-radius: var(--radius-sm); padding: 6px 10px; cursor: pointer; font-size: 13px; flex-shrink: 0;
}
.content { padding: 20px 20px 40px; }
.nav-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 40;
}

/* === 卡片 / 工具条 / KPI === */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 20px; margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}
.card h2 { margin: 0 0 12px; font-size: var(--fs-card); font-weight: 600; }
.card h3 { margin: 0 0 12px; font-size: var(--fs-body); font-weight: 600; }
.toolbar { display: flex; flex-wrap: wrap; gap: var(--sp-1); align-items: center; margin-bottom: 12px; }
.toolbar .spacer { flex: 1; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--sp-2); }
.kpi {
  background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: 8px; padding: 12px 14px;
}
.kpi .label { font-size: var(--fs-aux); color: var(--muted); }
.kpi .value {
  font-size: 22px; font-weight: 700; margin-top: 4px;
  color: var(--nav-head); font-variant-numeric: tabular-nums;
}

/* === 数据表：独立滚动容器内表头 sticky；数字列右对齐（.num 由 DistUI.dataTable 按列 key / num 钩子判定） === */
.table-scroll {
  overflow: auto;
  max-height: calc(100vh - 11.5rem);
  min-width: 0;
}
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td { padding: 8px 10px; text-align: left; vertical-align: top; }
table.data th {
  color: var(--muted); font-weight: 600; font-size: var(--fs-aux);
  background: #f8fafc; border-bottom: 1px solid var(--line); white-space: nowrap;
  position: sticky; top: 0; z-index: 2;
  box-shadow: 0 1px 0 var(--line);
}
table.data td { border-bottom: 1px solid var(--line-soft); }
table.data tbody tr:hover td { background: var(--row-hover); }
table.data th.num, table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td.muted[colspan] { text-align: center; padding: 24px 10px; }
table.data tr.row-clickable { cursor: pointer; }
/* 行选择统一配方：浅蓝底 + 品牌色左条（令牌 --row-sel-*）；左条只落行首格，否则每格一条竖线 */
table.data tr.row-active td { background: var(--row-sel-bg); }
table.data tr.row-active td:first-child { box-shadow: var(--row-sel-bar); }
table.data tr.row-active:hover td { background: var(--row-sel-hover); }
/* checkbox 行：勾选即选中态（:has 纯 CSS，现代浏览器均支持） */
table.data tbody tr:has(td input:checked) td { background: var(--row-sel-bg); }
table.data tbody tr:has(td input:checked):hover td { background: var(--row-sel-hover); }

/* === 按钮：统一 32px 高；主按钮品牌色实心、次按钮描边、危险操作 --danger === */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 14px;
  border: 1px solid var(--line); background: #fff; color: var(--text);
  border-radius: var(--radius-sm); cursor: pointer; font-size: 13px;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: #f8fafc; border-color: #c9d2e0; }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.danger { color: var(--danger); border-color: #fecaca; }
.btn.danger:hover { background: var(--danger-soft); border-color: #fca5a5; }
.btn.sm { height: 26px; padding: 0 10px; font-size: var(--fs-aux); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* === 表单控件：统一 32px 高，focus 描边品牌色；:where 零优先级，页面内更具体的规则仍可覆盖 === */
:where(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]), select, textarea) {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 0 10px; height: 32px; background: #fff; color: var(--text); font-size: 13px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; padding: 8px 10px; }
:where(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]), select, textarea):focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 168, .14);
}
input[type="number"] { width: 100px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: var(--fs-aux); color: var(--muted); margin-bottom: 4px; }
.field input, .field select, .field textarea { width: 100%; }

/* 花色 HEX：色相 + 饱和度×明度二维取色 */
.color-picker { max-width: 260px; }
.color-sv-wrap {
  position: relative; width: 220px; height: 140px;
  border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
  cursor: crosshair; touch-action: none; user-select: none;
}
.color-sv { display: block; width: 100%; height: 100%; }
.color-sv-cursor {
  position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px;
  border: 2px solid #fff; border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0,0,0,.45); pointer-events: none;
}
.color-hue {
  width: 220px; margin: 10px 0 8px; padding: 0; height: 14px;
  appearance: none; -webkit-appearance: none; border: none; border-radius: 6px;
  background: linear-gradient(
    to right,
    #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%
  );
}
.color-hue::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 1px solid #64748b; cursor: pointer;
}
.color-hue::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 1px solid #64748b; cursor: pointer;
}
.color-hex-row { display: flex; align-items: center; gap: 8px; }
.color-swatch {
  width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--line);
  flex-shrink: 0;
}
.color-hex-input { flex: 1; min-width: 0; font-family: ui-monospace, monospace; }
.color-native {
  width: 36px; height: 28px; padding: 0; border: 1px solid var(--line);
  border-radius: 6px; background: transparent; cursor: pointer;
}
.color-swatch-inline {
  display: inline-block; width: 14px; height: 14px; border-radius: 3px;
  border: 1px solid var(--line); vertical-align: middle;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.muted { color: var(--muted); font-size: 13px; }
.err { color: var(--danger); font-size: 13px; margin-top: 8px; }
.ok { color: var(--ok); }
.pager { display: flex; gap: 8px; align-items: center; margin-top: 12px; font-size: 13px; color: var(--muted); }
.pager span { font-variant-numeric: tabular-nums; }

/* 弹层须高于 Leaflet（约 400–1000）与 geo 绘图层（500/510）；勿用过小 z-index */
.modal-mask {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0; /* 兼容旧浏览器无 inset */
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: -ms-grid;
  display: grid;
  place-items: center;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  z-index: 100000;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}
.modal {
  position: relative;
  z-index: 100001;
  width: min(640px, 94vw);
  max-height: 86vh;
  overflow: auto;
  background: var(--panel);
  border-radius: 12px;
  padding: 20px 22px;
  box-shadow: var(--shadow-pop);
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}
.modal.wide { width: min(960px, 96vw); }
.modal h3 { margin: 0 0 12px; font-size: var(--fs-card); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

.toast {
  position: fixed; right: 16px; top: 16px; z-index: 100010;
  background: #111827; color: #fff; padding: 10px 14px; border-radius: 8px;
  font-size: 13px; opacity: 0; transform: translateY(-8px); transition: .2s;
}
.toast.show { opacity: 1; transform: none; }
.toast.err { background: var(--danger); }

.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--nav-head); font-size: var(--fs-aux); }
.tag.warn { background: #fef3c7; color: #92400e; }
.tag.ok { background: #d1fae5; color: #065f46; }

/* 页签：胶囊样式，当前项品牌色实心 */
.tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.tabs .tab {
  border: 1px solid var(--line); background: #fff; border-radius: var(--radius-sm);
  padding: 6px 12px; font-size: 13px; cursor: pointer; color: var(--text);
}
.tabs .tab:hover { border-color: #c9d2e0; }
.tabs .tab.active { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 600; }
.line-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; align-items: center; }
.line-row input { width: 110px; }
label.inline { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
label.inline select { min-width: 220px; }
.soon-card { max-width: 560px; }
h4 { margin: 14px 0 8px; font-size: 13px; color: var(--muted); }
img.thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); background: #f8fafc; }
img.thumb-lg { max-width: 220px; max-height: 220px; object-fit: contain; border-radius: 6px; border: 1px solid var(--line); background: #f8fafc; display: block; margin: 6px 0 12px; }
.thumb-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.thumb-item { width: 100px; font-size: 11px; text-align: center; }
.img-preview { margin: 8px 0 4px; }
.check-list { max-height: 360px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.check-row {
  display: flex; align-items: center; gap: 8px; padding: 6px 4px;
  font-size: 13px; border-bottom: 1px solid #f1f5f9; cursor: pointer;
}
.check-row:hover { background: var(--row-hover); }
.check-row:has(input:checked) { background: var(--row-sel-bg); }
.check-row:has(input:checked):hover { background: var(--row-sel-hover); }
.check-row:last-of-type { border-bottom: none; }
.check-row input { width: auto; }

/* 页面 JS 已用但原样式表缺失的纯视觉钩子 */
.tree { font-size: 13px; line-height: 1.6; margin: 4px 0; }
.tree li { margin: 2px 0; }
.form-row { display: grid; grid-template-columns: minmax(140px, auto) 1fr; gap: 8px; align-items: center; }
.form-row label { font-size: 13px; color: var(--muted); }

.matrix-wrap {
  max-height: 420px; overflow: auto; border: 1px solid var(--line);
  border-radius: 8px; margin-top: 8px;
}
table.matrix {
  border-collapse: collapse; font-size: 12px; min-width: 100%;
}
table.matrix th, table.matrix td {
  border: 1px solid var(--line); padding: 6px 8px; text-align: center;
  white-space: nowrap;
}
table.matrix th { background: #f8fafc; color: var(--muted); font-weight: 600; position: sticky; top: 0; z-index: 1; }
table.matrix th.sticky-col, table.matrix td.sticky-col {
  position: sticky; left: 0; background: #fff; z-index: 2; text-align: left; min-width: 120px;
}
table.matrix th.sticky-col { z-index: 3; background: #f8fafc; }
table.matrix td.checked { background: var(--row-sel-bg); }
table.matrix td.checked:hover { background: var(--row-sel-hover); }
table.matrix input[type="checkbox"] { width: auto; margin: 0; cursor: pointer; }
table.matrix th.col-toggle, table.matrix td.row-toggle { cursor: pointer; }
table.matrix th.col-toggle:hover, table.matrix td.row-toggle:hover { color: var(--brand); }
.matrix-summary { margin-top: 8px; font-size: 13px; color: var(--muted); }
.matrix-summary strong { color: var(--text); }
table.matrix input.dim-val {
  width: 78px; padding: 2px 4px; font-size: 12px; text-align: center;
}
.import-catalog { max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.import-catalog .cat-row {
  display: flex; gap: 10px; align-items: center; padding: 8px 10px;
  border-bottom: 1px solid #f1f5f9; cursor: pointer; font-size: 13px;
}
.import-catalog .cat-row:hover { background: var(--row-hover); }
.import-catalog .cat-row.selected {
  background: var(--row-sel-bg); box-shadow: var(--row-sel-bar);
}
.import-catalog .cat-row.selected:hover { background: var(--row-sel-hover); }
.import-catalog .cat-row:last-child { border-bottom: none; }
.spec-meta { display: grid; grid-template-columns: repeat(3, minmax(140px, 1fr)); gap: 10px; margin: 8px 0 12px; }
@media (max-width: 900px) {
  .spec-meta { grid-template-columns: 1fr 1fr; }
}
.pair-cols {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px;
}
@media (max-width: 640px) {
  .pair-cols { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .btn-menu { display: inline-flex; align-items: center; }
  .sidebar {
    display: none;
    position: fixed; left: 0; top: 0; bottom: 0; width: min(280px, 86vw);
    z-index: 50; box-shadow: 8px 0 24px rgba(0,0,0,.2);
  }
  body.nav-open .sidebar { display: flex; }
  body.nav-open .nav-backdrop { display: block; }
  .grid-2 { grid-template-columns: 1fr; }
}

/* === geo-cover · channel territory === */
/* 锁死视口：右侧地图区不出现页面级上下滚动；左侧列表内部滚动 */
.app:has(.geo-cover) {
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}
.main:has(.geo-cover) {
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.content:has(.geo-cover) {
  padding: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: auto;
  overflow: hidden;
}
.geo-cover {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(300px, 360px) 1fr;
  gap: 0;
  background: var(--panel);
  border-top: 1px solid var(--line);
  overflow: hidden;
}
.geo-side {
  display: flex; flex-direction: column; gap: 8px; padding: 10px 12px;
  border-right: 1px solid var(--line); min-height: 0; overflow: hidden;
}
.geo-org-block {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  max-height: 38%;
  overflow: hidden;
}
.geo-region-block {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 42%;
  overflow: hidden;
}
@media (max-width: 900px) {
  .geo-cover {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(48vh, 52vh) 1fr;
  }
  .geo-side {
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
  }
  .geo-org-block {
    max-height: 38%;
    min-height: 0;
    flex-shrink: 0;
  }
  .geo-region-block {
    min-height: 42%;
  }
}
@media (min-width: 901px) and (max-width: 1366px) {
  .geo-cover { grid-template-columns: minmax(280px, 32vw) 1fr; }
}
.geo-side h3 { margin: 2px 0 0; font-size: 13px; }
.geo-meta { font-size: 12px; color: var(--muted); line-height: 1.35; }
.geo-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.geo-row select, .geo-row input[type=search], .geo-row input[type=text] {
  flex: 1; min-width: 0; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px;
}
.geo-pick-org-btn {
  width: 100%;
  min-height: 44px;
  font-size: 14px;
  touch-action: manipulation;
}
.geo-org-tree {
  flex: 1 1 auto;
  min-height: 4.5rem;
  max-height: none;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 6px;
  font-size: 12px;
  line-height: 1.3;
  background: #fafbfc;
  -webkit-overflow-scrolling: touch;
}
.geo-org-tree .org-node { margin: 0; }
.geo-org-tree .org-row {
  display: flex;
  align-items: stretch;
  gap: 2px;
  min-height: 44px;
}
.geo-org-tree .org-expand {
  flex: 0 0 44px;
  width: 44px;
  min-height: 44px;
  border: 0;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}
.geo-org-tree .org-expand:hover { background: var(--row-hover); }
.geo-org-tree .org-expand-icon {
  display: inline-block;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid var(--muted);
  transition: transform .12s;
}
.geo-org-tree .org-node.is-open > .org-row > .org-expand .org-expand-icon {
  transform: rotate(90deg);
}
.geo-org-tree .org-kids { padding-left: 8px; }
.geo-org-tree .org-pick,
.org-pick-list .org-pick {
  display: flex; align-items: center; gap: 8px; width: 100%;
  border: 0; background: transparent; padding: 10px 12px; border-radius: 8px;
  cursor: pointer; font: inherit; text-align: left; color: inherit;
  touch-action: manipulation; min-height: 44px; box-sizing: border-box;
}
.geo-org-tree .org-row > .org-pick {
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 10px;
}
.geo-org-tree .org-pick:focus-visible,
.org-pick-list .org-pick:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 1px;
}
.geo-org-tree .org-pick:hover,
.org-pick-list .org-pick:hover { background: var(--row-hover); }
.geo-org-tree .org-pick.active,
.org-pick-list .org-pick.active {
  background: var(--row-sel-bg); box-shadow: var(--row-sel-bar);
  color: var(--nav-head); font-weight: 600;
}
.geo-org-tree .org-pick.active:hover,
.org-pick-list .org-pick.active:hover { background: var(--row-sel-hover); }
.geo-org-tree .org-badge,
.org-pick-list .org-badge {
  flex-shrink: 0; font-size: 11px; line-height: 1; padding: 3px 6px;
  border-radius: 4px; background: #e8eef5; color: #3a5a7a;
}
.geo-org-tree .org-pick[data-org-type="STORE"] .org-badge,
.org-pick-list .org-pick[data-org-type="STORE"] .org-badge {
  background: #f3ebe4; color: #8a5a32;
}
.geo-org-tree .org-name,
.org-pick-list .org-name {
  flex: 1 1 auto;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.geo-org-tree .org-pick code,
.org-pick-list .org-pick code { font-size: 11px; color: var(--muted); background: transparent; flex-shrink: 0; }
.geo-org-tree .org-empty { padding: 4px 4px 6px 52px; font-size: 11px; }
.geo-org-tree .org-search-label,
.org-pick-list .org-search-label {
  font-size: 11px; color: var(--muted); padding: 6px 4px 4px; font-weight: 600;
}
.org-pick-list .org-search-group { margin-bottom: 4px; }
.geo-current-tap {
  cursor: pointer;
  touch-action: manipulation;
}
.geo-current-tap:hover { border-color: var(--brand); }
.geo-org-sheet-mask {
  position: fixed;
  inset: 0;
  z-index: 12000;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
.geo-org-sheet {
  width: 100%;
  max-width: 520px;
  max-height: 82vh;
  background: #fff;
  border-radius: 14px 14px 0 0;
  padding: 12px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
}
@media (min-width: 600px) {
  .geo-org-sheet-mask { align-items: center; padding: 16px; }
  .geo-org-sheet { border-radius: 12px; max-height: 78vh; }
}
.geo-org-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.geo-org-sheet-head h3 { margin: 0; font-size: 16px; }
.geo-org-sheet > input[type=search] {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 16px;
  box-sizing: border-box;
}
.geo-org-sheet-list {
  flex: 1 1 auto;
  min-height: 12rem;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px;
  background: #fafbfc;
}
.geo-current {
  font-size: 12px; padding: 6px 8px; border-radius: 6px;
  border: 1px dashed var(--line); color: var(--muted); line-height: 1.35;
}
.geo-current.has-owner {
  border-style: solid; background: #f6f8fa; color: inherit;
}
.geo-current.dirty { border-color: #c45c26; background: #fff8f3; }
.geo-current .badge {
  display: inline-block; font-size: 10px; padding: 1px 5px; border-radius: 3px;
  background: #e8eef5; color: #3a5a7a; margin-right: 2px;
}
.geo-tree {
  flex: 1 1 auto;
  min-height: 8rem;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.35;
  background: #fafbfc;
  -webkit-overflow-scrolling: touch;
}
.geo-tree .node-row.region-node {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 2px 0;
  min-height: 40px;
}
.geo-tree .node-row > input[type="checkbox"] {
  margin: 10px 0 0;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  touch-action: manipulation;
}
.geo-tree .region-body {
  flex: 1 1 auto;
  min-width: 0;
}
.geo-tree .region-row {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
}
.geo-tree .region-expand {
  flex: 0 0 36px;
  width: 36px;
  min-height: 36px;
  border: 0;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}
.geo-tree .region-expand:hover { background: var(--row-hover); }
.geo-tree .region-expand-icon {
  display: inline-block;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid var(--muted);
  transition: transform .12s;
}
.geo-tree .region-node.is-open > .region-body > .region-row > .region-expand .region-expand-icon {
  transform: rotate(90deg);
}
.geo-tree .region-label,
.geo-tree .region-meta {
  flex: 1 1 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
}
.geo-tree .kids { padding-left: 8px; }
.geo-tree .node-row.zone-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-left: 12px;
  min-height: 36px;
}
.geo-tree .node-row.zone-row > input[type="checkbox"] { margin-top: 8px; }
.geo-tree .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  max-width: 9rem;
}
.geo-tree .name:hover { color: var(--brand); }
.geo-tree code { font-size: 11px; color: var(--muted); background: transparent; padding: 0; flex-shrink: 0; }
.geo-tree .lv { color: var(--muted); font-size: 10px; flex-shrink: 0; }
.geo-tree .leaf-row { margin-left: 4px; }
.geo-tree .zone-row { margin-left: 8px; }
.geo-tree .zone-row .lv { color: var(--brand); }
.geo-tree .btn-zone {
  margin-left: 2px;
  padding: 4px 8px;
  min-height: 32px;
  font-size: 11px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  color: var(--brand);
  flex-shrink: 0;
  touch-action: manipulation;
}
.geo-hit { display: flex; align-items: center; gap: 4px; padding: 2px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.geo-hits { max-height: 5.5rem; overflow: auto; }
.geo-map-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}
.geo-map-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #e8ece9;
  overflow: hidden;
}
#geo-map { position: absolute; inset: 0; }
.geo-map-status {
  position: absolute; z-index: 500; left: 10px; bottom: 10px;
  background: rgba(255,255,255,.92); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 10px; font-size: 12px; color: var(--muted);
  max-width: min(420px, 70vw); pointer-events: none;
}
.geo-draw-bar {
  display: none; position: absolute; z-index: 510; left: 10px; top: 10px; right: 10px;
  flex-wrap: wrap; gap: 6px; align-items: center;
  background: rgba(255,255,255,.96); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; font-size: 12px;
}
.geo-draw-bar.active { display: flex; }
.geo-draw-bar .hint { flex: 1; min-width: 10rem; color: var(--muted); }
.geo-map-wrap.draw-cursor #geo-map { cursor: crosshair; }

.field-hint { margin: 4px 0 0; font-size: 12px; }
.lock-banner {
  margin: 0 0 12px; padding: 8px 10px; border: 1px solid var(--line);
  background: #f8fafc; color: var(--text); font-size: 13px; border-radius: 8px;
}
.badge.lock {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  background: #e8eef5; color: #334155; font-size: 12px;
}
.code-rule-editor { display: flex; flex-direction: column; gap: 4px; }
.code-rule-editor > p { margin: 4px 0; }
.code-parts { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.code-part-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.code-part-row select, .code-part-row input { width: auto; min-width: 7rem; }
.code-preview {
  margin: 10px 0 0; font-family: ui-monospace, Consolas, monospace;
  font-size: 13px; color: var(--text);
}
.form-row-wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
input:disabled, select:disabled { background: #f1f5f9; color: #64748b; }

/* —— 网销 · 平台对接配置（#/ol/integration）—— */
.ol-platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--sp-3);
  margin-top: var(--sp-2);
}
.ol-platform-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--sp-3);
  background: var(--panel);
  box-shadow: var(--shadow-card);
}
.ol-platform-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}
.ol-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: var(--fs-aux);
  font-weight: 600;
  line-height: 1.4;
}
.ol-badge.live { background: #d1fae5; color: var(--ok); }
.ol-badge.mock { background: var(--line-soft); color: var(--muted); }
.ol-badge.warn { background: #fef3c7; color: #b45309; }
.ol-dl { margin: 0; display: grid; grid-template-columns: 88px 1fr; gap: 4px 8px; font-size: var(--fs-aux); }
.ol-dl dt { margin: 0; color: var(--muted); }
.ol-dl dd { margin: 0; word-break: break-all; }
.ol-subtitle { font-size: var(--fs-aux); font-weight: 600; margin: var(--sp-2) 0 6px; }
.ol-oauth-block { margin-top: var(--sp-2); padding-top: var(--sp-2); border-top: 1px dashed var(--line); }
.ol-copy-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ol-copy-row code {
  flex: 1 1 180px;
  font-size: 11px;
  background: var(--line-soft);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  word-break: break-all;
}
.ol-oms-flag { margin: var(--sp-2) 0 0; font-size: var(--fs-aux); }
.ol-auth-detail .ol-kv {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: var(--fs-aux);
}
.ol-auth-detail .ol-kv .k { color: var(--muted); }
.ol-auth-detail .ol-kv .v { word-break: break-all; }
p.small { font-size: 11px; margin: 4px 0; }

/* —— 实体选择（下拉 / 弹窗）—— */
.entity-filter { min-width: 9rem; max-width: 16rem; }
.entity-pick-wrap { display: flex; flex-direction: column; gap: 4px; }
.entity-pick-row { display: flex; gap: 6px; align-items: center; }
.entity-pick-display {
  flex: 1; min-width: 0; background: #f8fafc; cursor: default;
}
.entity-pick-search { width: 100%; margin-bottom: 8px; }
.entity-pick-list {
  max-height: 320px; overflow: auto; display: flex; flex-direction: column; gap: 4px;
}
.entity-pick-item { text-align: left; justify-content: flex-start; }
.line-row .entity-pick-wrap { flex: 1 1 180px; min-width: 140px; }
.line-row .entity-pick-row { width: 100%; }
.entity-chip-x {
  border: none; background: transparent; cursor: pointer; padding: 0 2px;
  color: inherit; font-size: 14px; line-height: 1;
}
.entity-multi-wrap { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.entity-multi-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; }
.entity-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px; font-size: 12px;
  background: var(--line-soft); border: 1px solid var(--line);
}
