/* 星图后台管理系统 — 橙白商务极简风 */
:root {
  --brand: #FF6A00;
  --brand-soft: #FFF7F0;
  --brand-light: #FFEFE6;
  --brand-hover: #E55F00;
  --surface: #FFFFFF;
  --surface-2: #F7F7F7;
  --bg: #F5F5F5;
  --ink: #1C1B19;
  --ink-2: #4A4A4A;
  --ink-3: #8A8A8A;
  --line: #EEEEEE;
  --line-strong: #DEDEDE;
  --danger: #FF4D4F;
  --ok: #52C41A;
  --warn: #FAAD14;
  --shadow-sm: 0 2px 8px rgba(28, 27, 25, 0.04);
  --shadow-md: 0 4px 16px rgba(28, 27, 25, 0.08);
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-w: 220px;
  --topbar-h: 56px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Login */
.login-wrap {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  /* 登录背景：星途橙白商务风插画（渐变作加载兜底） */
  background-color: #FFF3EB;
  background-image: linear-gradient(135deg, var(--brand-soft) 0%, #fff 50%, var(--brand-light) 100%);
  background-image: url('./login-bg.svg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: 40px 32px;
}
.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.login-logo .dot {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--brand); display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 18px;
}
.login-logo .t { font-size: 22px; font-weight: 800; color: var(--ink); }
.login-logo .s { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
/* 登录错误提示：居中展示在登录卡片内（账号禁用 / 密码错误等） */
.login-err {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: #fff1f0;
  border: 1px solid #ffccc7;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
  animation: loginErrIn .28s var(--ease);
}
.login-err.show { display: flex; }
.login-err svg { flex: none; }
@keyframes loginErrIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

/* Layout */
#app { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: #fff;
  border-right: 1px solid var(--line);
  z-index: 40;
  display: flex; flex-direction: column;
  transition: transform 0.25s var(--ease);
}
.sidebar-head {
  height: var(--topbar-h); display: flex; align-items: center; gap: 10px;
  padding: 0 18px; border-bottom: 1px solid var(--line);
}
.sidebar-head .dot { width: 30px; height: 30px; border-radius: 8px; background: var(--brand); display: grid; place-items: center; color: #fff; font-weight: 800; }
.sidebar-head .t { font-size: 16px; font-weight: 800; }
.sidebar-body { flex: 1; overflow-y: auto; padding: 10px 12px; }
.sidebar-foot { padding: 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); text-align: center; }

.menu-group { margin-bottom: 6px; }
.menu-label {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: var(--r-sm);
  color: var(--ink-2); font-size: 13px; font-weight: 700; cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.menu-label:hover { background: var(--surface-2); }
.menu-label .ic { color: var(--brand); display: flex; }
.menu-label .arrow { margin-left: auto; transition: transform 0.2s; }
.menu-group.open .arrow { transform: rotate(90deg); }
.menu-children { display: none; padding-left: 10px; }
.menu-group.open .menu-children { display: block; }
.menu-item {
  display: block; padding: 9px 12px 9px 34px;
  color: var(--ink-2); font-size: 13px; border-radius: var(--r-sm);
  text-decoration: none; cursor: pointer;
}
.menu-item:hover, .menu-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 700; }

.main {
  flex: 1; margin-left: var(--sidebar-w); min-width: 0;
  display: flex; flex-direction: column; min-height: 100vh;
}
.topbar {
  height: var(--topbar-h); background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; position: sticky; top: 0; z-index: 30;
}
.topbar .left { display: flex; align-items: center; gap: 12px; }
.menu-toggle {
  display: none; width: 34px; height: 34px; border-radius: var(--r-sm);
  align-items: center; justify-content: center; cursor: pointer; color: var(--ink-2);
}
.menu-toggle:hover { background: var(--surface-2); }
.topbar-title { font-size: 16px; font-weight: 800; }
.topbar .right { display: flex; align-items: center; gap: 16px; }
.user-menu {
  display: flex; align-items: center; gap: 8px; cursor: pointer; position: relative;
  padding: 6px 10px; border-radius: var(--r-sm);
}
.user-menu:hover { background: var(--surface-2); }
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-weight: 800; font-size: 12px;
}
.user-dropdown {
  position: absolute; top: 110%; right: 0;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm);
  box-shadow: var(--shadow-md); min-width: 140px; display: none; overflow: hidden;
}
.user-menu.open .user-dropdown { display: block; }
.user-dropdown a {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; color: var(--ink-2); text-decoration: none; font-size: 13px;
}
.user-dropdown a:hover { background: var(--surface-2); color: var(--brand); }

.content { flex: 1; padding: 20px; overflow-x: hidden; }

/* Cards */
.card {
  background: #fff; border-radius: var(--r-md);
  box-shadow: var(--shadow-sm); border: 1px solid var(--line);
}
.card-head {
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.card-title { font-size: 16px; font-weight: 800; }
.card-body { padding: 20px; }

/* Stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card { padding: 18px; }
.stat-card .label { font-size: 13px; color: var(--ink-3); }
.stat-card .num { font-size: 28px; font-weight: 800; margin-top: 6px; color: var(--ink); }
.stat-card .num.brand { color: var(--brand); }

/* 三列布局（分佣总览的三张维度卡） */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }

/* Forms */
.form-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.form-row.col2 { grid-template-columns: repeat(2, 1fr); }
.form-row.col4 { grid-template-columns: repeat(4, 1fr); }
.field label { display: block; font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.field label .req { color: var(--danger); margin-left: 2px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line-strong);
  border-radius: var(--r-sm); font-size: 14px; background: #fff; color: var(--ink); font-family: inherit;
  outline: none; transition: border-color 0.2s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); }
.field input:disabled, .field select:disabled { background: var(--surface-2); color: var(--ink-3); }
.field textarea { min-height: 80px; resize: vertical; }
.field .hint { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
/* 切换开关组件（奖励设置等奖的大型 toggle） */
.switch-row { display: flex; align-items: center; gap: 12px; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; cursor: pointer; inset: 0; background: #D5D7DB; border-radius: 24px; transition: background 0.2s; }
.switch .slider::before { content: ''; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); }
.switch input:checked + .slider { background: var(--brand); }
.switch input:checked + .slider::before { transform: translateX(20px); }
.switch-state { font-size: 14px; font-weight: 700; }
.switch-state.on { color: var(--brand); }
.switch-state.off { color: var(--ink-3); }
/* 奖励设置：按产品奖励（产品选择界面 + 逐产品固定金额配置） */
.reward-picker { border: 1px solid var(--line, #eee); border-radius: var(--r-sm, 8px); background: #fffdfb; padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; max-height: 220px; overflow: auto; margin-bottom: 10px; font-size: 14px; }
/* 勾选项（产品 / 分公司选择器）：🔴 必须**显式**把复选框从 `.field input { width:100% }`（本文件 §207 区）
   的 100% 宽里救出来 —— 不加这两条会渲染成「复选框被拉宽、文字被顶到最右」的假右对齐。
   实测（CDP 量 getBoundingClientRect）：`.reward-picker` 是 column flex 容器、子项默认 `stretch`
   ⇒ 标签撑满 570px，其中的 `input[type=checkbox]` 命中 100% 宽被拉成 **350.578px**、文字落在 left=799。
   修法两根柱子：①`align-self:flex-start` 让标签收缩到内容宽；②`width:auto` 让百分比宽度不再解析。
   验收：复选框回到原生宽、文字紧贴其右（间隙 = gap 8px）。 */
.reward-pick-item { display: flex; align-items: center; gap: 8px; white-space: nowrap; align-self: flex-start; cursor: pointer; }
.reward-pick-item input[type="checkbox"] { width: auto; height: auto; flex: none; padding: 0; margin: 0; }
.reward-prod-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 7px 0; border-bottom: 1px dashed var(--line, #eee); font-size: 14px; }
.reward-prod-row:last-child { border-bottom: none; }
.reward-prod-row .f_amount { width: 150px; padding: 6px 10px; border: 1px solid var(--line, #ddd); border-radius: var(--r-sm, 8px); font-size: 14px; }
/* 奖励设置 v1.26：按「订单产品 × 直推上级级别」配置（全局矩阵 + 分公司覆盖组） */
.reward-toolbar { margin: 6px 0 8px; }
.reward-lv-row { padding: 10px 0; border-bottom: 1px dashed var(--line, #eee); }
.reward-lv-row:last-child { border-bottom: none; }
.reward-lv-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.reward-lv-name { font-size: 14px; font-weight: 700; color: var(--ink, #333); }
/* ⚠️ 列宽下限 160px（原 180px）：格子内容 = 档位标签「上级为A9」+ 输入框，180 时三档合计
   会顶到行宽上限，配合 body 的内边距在 640px 弹窗里产生横向溢出（实测 37px）。
   改后必须用 CDP 复测 `.modal-body` 的 scrollWidth−clientWidth 为 0。 */
.reward-lv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px 14px; }
.reward-lv-cell { display: flex; align-items: center; gap: 8px; font-size: 13px; white-space: nowrap; }
.reward-lv-k { color: var(--ink-3, #999); flex-shrink: 0; }
.reward-lv-cell input { width: 100%; min-width: 90px; padding: 6px 10px; border: 1px solid var(--line, #ddd); border-radius: var(--r-sm, 8px); font-size: 14px; }
.reward-co-group { margin: 10px 0; padding: 12px 14px; border: 1px solid var(--line, #eee); border-radius: var(--r-sm, 8px); background: #fcfcfc; }
.reward-co-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.reward-co-title { font-size: 14px; font-weight: 700; color: var(--ink, #333); }
.reward-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 8px; }
.reward-chip { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--brand-soft, #fff1e6); color: var(--brand, #FF6A00); font-size: 12px; }
/* 直推服务奖励明细：更新时间表头 tooltip */
.th-tip { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; margin-left: 5px; border-radius: 50%; background: var(--surface-2, #f2f2f2); color: var(--ink-3, #999); font-size: 11px; font-weight: 600; cursor: help; vertical-align: middle; }
.th-tip:hover { background: var(--brand-soft, #fff1e6); color: var(--brand, #FF6A00); }
.th-tip-pop { display: none; position: absolute; top: calc(100% + 8px); right: -8px; width: max-content; max-width: 220px; padding: 8px 12px; border-radius: 8px; background: rgba(0,0,0,.78); color: #fff; font-size: 12px; font-weight: 400; line-height: 1.5; text-align: left; z-index: 30; pointer-events: none; }
.th-tip-pop::after { content: ''; position: absolute; bottom: 100%; right: 14px; border: 5px solid transparent; border-bottom-color: rgba(0,0,0,.78); }
.th-tip:hover .th-tip-pop { display: block; }
/* 弹窗字段 label 旁的 ? 提示（2026-10-17）：复用 .th-tip 的圆形徽标，只改展开方向与宽度 ——
   表头那套 right:-8px 是「往左展开」的右对齐写法，挪到左对齐的字段标签上会溢出弹窗左边；
   max-width 220px 也容不下「奖励贡献池」那段长文案（会折成十几行、被 .modal 的 overflow-y 裁掉）。 */
.th-tip-pop.f-tip-left { left: -8px; right: auto; max-width: 340px; }
.th-tip-pop.f-tip-left::after { left: 14px; right: auto; }
/* 直推服务奖励明细：订单时间三行小字 */
.order-time-cell { min-width: 150px; }
.order-time-line { display: flex; gap: 6px; font-size: 12px; line-height: 1.7; color: var(--ink-2, #555); white-space: nowrap; }
.order-time-line .l { color: var(--ink-3, #999); flex-shrink: 0; }
/* 奖励详情弹窗：奖励说明 */
.reward-desc { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; margin-bottom: 16px; border-radius: var(--r-sm, 8px); background: var(--brand-soft, #fff7f0); border: 1px solid #ffe0c7; font-size: 14px; line-height: 1.6; color: var(--ink, #333); }
.reward-desc-label { flex-shrink: 0; font-weight: 700; color: var(--brand, #FF6A00); }
/* 输入框后缀（如分佣比例的 % 符号） */
.input-addon { display: flex; align-items: stretch; }
.input-addon input { border-radius: var(--r-sm) 0 0 var(--r-sm); flex: 1; min-width: 0; }
.input-addon .addon {
  display: flex; align-items: center; justify-content: center; min-width: 36px;
  padding: 0 10px; border: 1px solid var(--line-strong); border-left: none;
  border-radius: 0 var(--r-sm) var(--r-sm) 0; background: var(--surface-2);
  color: var(--ink-2); font-size: 14px; font-weight: 600; user-select: none;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--r-sm); border: none;
  background: var(--brand); color: #fff; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background 0.2s, transform 0.1s; line-height: 1.4;
}
.btn:hover { background: var(--brand-hover); }
.btn:active { transform: scale(0.98); }
.btn:disabled { background: var(--line-strong); color: var(--ink-3); cursor: not-allowed; }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.ghost { background: transparent; color: var(--ink-2); border: 1px solid var(--line-strong); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #d9363e; }
.btn.ok { background: var(--ok); }
.btn.warn { background: var(--warn); color: var(--ink); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.search-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search-form input, .search-form select { padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); font-size: 13px; min-width: 140px; }
.search-form .sf-range { display: inline-flex; align-items: center; gap: 6px; }
.search-form .sf-label { color: var(--ink-3); font-size: 13px; white-space: nowrap; }
.search-form .sf-range input[type=date] { min-width: 130px; }

/* Tables */
.table-wrap { overflow-x: auto; border-radius: var(--r-sm); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; background: #fff; min-width: 700px; }
th, td { padding: 12px 14px; text-align: left; font-size: 13px; border-bottom: 1px solid var(--line); }
th { background: var(--surface-2); font-weight: 700; color: var(--ink-2); white-space: nowrap; }
tr:hover td { background: var(--brand-soft); }
tr:last-child td { border-bottom: none; }
.actions { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.actions .btn.sm { padding: 4px 8px; }
/* 操作栏按钮禁止换行、禁止被压缩（2026-10-08，HTv1.161）。
   由来：商户审核页操作栏由 3 个按钮增到 4 个（详情/编辑/通过/驳回）后，「编辑/通过/驳回」
   被拆成竖排两行。根因**不是** `flex-wrap`（它本来就是 nowrap），而是 flex 项默认可收缩：
   容器（td.actions，实测 283px）不够时，每个按钮被压到约 48px，文字只能折成两行。
   实测（1440 视口，CDP）：加这两条前按钮高 44px、单元格高 69px；加后按钮高 27px、单元格高 52px，
   操作列 283→290px，`table` 总宽不变（1136px）、`.table-wrap` 无横向溢出（scrollWidth=1136）。
   ⚠️ 真放不下时的退路是**表格横向滚动**（`.table-wrap { overflow-x: auto }`），
     而不是把按钮压扁 —— 服务商列表另有 `.stick-last` 钉住操作列。 */
.actions .btn { white-space: nowrap; flex-shrink: 0; }

/* 提现申请列表的「操作」列（2026-10-13，HTv1.176）：按钮文案由「标记打款」改为「标记为已打款」
   （多 2 个汉字）后，操作列 276 → 296px，把**本来就已经撑满容器**的表格顶出 10px 横向溢出
   （CDP 实测：改前 scrollWidth − clientWidth = 0，改后 = 10；红线 11 要求恒为 0，且这张 8 列
   + 3 按钮的表是本仓最宽的一张）。
   处置：只收这一列的左右内边距与按钮间距 —— **三个按钮本身的尺寸与文案一律不动**
   （对比"缩按钮 padding"的方案：那个会改到所有列表页的观感，还会缩小按钮的可点区域）。
   ⚠️ 用专属修饰类 `.wd-actions` 与基类叠加，不动 `.actions` / `.actions .btn.sm`（同 3.28 的做法）。
   列宽账：内容 256 + 左右内边距 14 + 按钮间距 8 = 278px ⇒ 表格总宽 1146 → 1128（余 8px）。 */
.actions.wd-actions { gap: 4px; padding-left: 8px; padding-right: 6px; }

/* 「操作」列固定在右侧（仅服务商列表，v1.3.0 归属公司加了「组织类型/归属公司」两列后
   总宽超出可视区 95px）。钉住后横向滚动时操作按钮始终可达，且不需要删列/改列名。
   注意：sticky 单元格必须自带背景色，否则滚动内容会从它下面透出来；
   tr:hover 的背景要显式补一条，否则会被这里的 #fff 盖掉。 */
.table-wrap.stick-last table th:last-child,
.table-wrap.stick-last table td:last-child {
  position: sticky; right: 0; z-index: 1;
  border-left: 1px solid var(--line);
}
.table-wrap.stick-last table th:last-child { z-index: 2; background: var(--surface-2); }
.table-wrap.stick-last table td:last-child { background: #fff; }
.table-wrap.stick-last table tr:hover td:last-child { background: var(--brand-soft); }

/* 短信息列不折行：否则「星图基础服务商·A7」会被拆成单字一行、
   「华东分公司」断成「华东分公/司」。配合上面的固定操作列，表格横向滚动即可。 */
table td.nowrap { white-space: nowrap; }

/* 窄表（2026-10-08，HTv1.160）：解除 `table { min-width: 700px }`。
   由来：`.modal { max-width: 640px }` − `.modal-body` 左右各 20px ⇒ 内容区只有 600px，
   而弹窗里放表格时 700px 的最小宽会把**最后一列挤出可视区**——
   服务商详情「可绑定商户明细」加第 4 列「可绑定商户数」后，±数值正好被裁掉半个，
   看上去像「数字没渲染出来」，实际是横向滚动条在右边（用户不会去拖）。
   用法：`table(head, rows, empty, 'auto')`（第 4 个参数拼到 `.table-wrap` 的 class 上）。
   `.table-wrap` 自带的 overflow-x 保留 ⇒ 真放不下时仍可横向滚动兜底，不会破版。 */
.table-wrap.auto table { min-width: 0; }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.tag.ok { background: #f6ffed; color: var(--ok); }
.tag.warn { background: #fffbe6; color: var(--warn); }
.tag.danger { background: #fff1f0; color: var(--danger); }
.tag.brand { background: var(--brand-soft); color: var(--brand); }
.tag.gray { background: var(--surface-2); color: var(--ink-3); }

/* Modal */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  z-index: 100; display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal {
  background: #fff; border-radius: var(--r-md); width: 100%; max-width: 640px;
  max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-md);
}
.modal-head {
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-body { padding: 20px; }
.modal-foot {
  padding: 14px 20px; border-top: 1px solid var(--line);
  display: flex; justify-content: flex-end; gap: 10px;
}
.modal-close { cursor: pointer; color: var(--ink-3); display: flex; }
.modal-close:hover { color: var(--ink); }

/* Toast */
.toast-wrap {
  position: fixed; top: calc(var(--topbar-h) + 10px); left: 0; right: 0;
  z-index: 120; display: flex; flex-direction: column; align-items: center; pointer-events: none;
}
.toast {
  background: rgba(0,0,0,0.78); color: #fff; padding: 10px 18px;
  border-radius: 999px; margin-top: 8px; font-size: 13px; text-align: center;
}
.toast.err { background: var(--danger); }
.toast.ok { background: var(--ok); }

/* Empty */
.empty { text-align: center; padding: 40px 20px; color: var(--ink-3); }
.empty .ic { font-size: 32px; margin-bottom: 8px; }

/* Detail view */
.detail-section-title { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 24px; }
.detail-item .l { font-size: 12px; color: var(--ink-3); margin-bottom: 4px; }
.detail-item .v { font-size: 14px; font-weight: 600; color: var(--ink); }
/* 「免费提交额度」值右侧的行内提醒（2026-10-16 收口）：浅色小字，不抢主值的视觉重量。
   需求＝把原独立字段「剩余免费提交额度」并入本项，故用 12px/400/灰，与 .field .hint 同口径。
   选择器三段 (0,3,0) 才能压过 .detail-item .v 的 600 字重与 14px 字号。 */
.detail-item .v .quota-left { font-size: 12px; font-weight: 400; color: var(--ink-3); margin-left: 8px; }

/* Permission tree */
.perm-tree { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; }
.perm-group { margin-bottom: 10px; }
.perm-group label { display: flex; align-items: center; gap: 8px; font-weight: 700; cursor: pointer; }
.perm-children { padding-left: 24px; margin-top: 6px; display: flex; flex-wrap: wrap; gap: 10px 20px; }
.perm-children label { display: flex; align-items: center; gap: 6px; font-weight: 400; cursor: pointer; font-size: 13px; }

/* Org tree */
.org-node { margin-left: 18px; border-left: 1px dashed var(--line); padding-left: 12px; }
.org-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); margin-bottom: 8px;
}

/* Image uploader */
.img-uploader { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.img-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.img-thumb { position: relative; width: 80px; height: 80px; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.img-thumb img { width: 100%; height: 100%; object-fit: cover; }
.img-remove { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; background: rgba(0,0,0,0.6); color: #fff; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.img-add {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  width: 96px; height: 80px; border: 1px dashed var(--line-strong); border-radius: var(--r-sm);
  color: var(--ink-3); font-size: 12px; cursor: pointer; transition: border-color 0.2s, color 0.2s;
  white-space: nowrap;
}
.img-add:hover { border-color: var(--brand); color: var(--brand); }

/* Toolbar actions */
.toolbar .actions { display: flex; align-items: center; gap: 8px; }

/* Logs detail cell */
.log-detail { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1024px) {
  .log-detail { max-width: 180px; }
}

/* Responsive */
@media (max-width: 1024px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row, .form-row.col4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-toggle { display: flex; }
  .stat-grid { grid-template-columns: 1fr; }
  .form-row, .form-row.col2, .form-row.col4 { grid-template-columns: 1fr; }
  .search-form { width: 100%; }
  .search-form input, .search-form select { flex: 1; min-width: 120px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar .actions { justify-content: flex-start; }
  .content { padding: 14px; }
  .card-head, .card-body { padding: 14px; }
  .dash-row { flex-direction: column; }
}

/* ---------- 首页看板增强 ---------- */
.dash-row { display: flex; gap: 14px; margin-bottom: 14px; align-items: stretch; }
.dash-row .card { margin-bottom: 0; }
.trend { display: flex; align-items: stretch; gap: 10px; height: 150px; }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; }
.trend-bar { width: 62%; max-width: 46px; background: linear-gradient(180deg, var(--brand) 0%, #FF9A4D 100%); border-radius: 6px 6px 2px 2px; transition: height .3s; }
.trend-bar.teal { background: linear-gradient(180deg, #00A8A8 0%, #4DCDC0 100%); }
.trend-amount { font-size: 12px; font-weight: 600; color: var(--brand); white-space: nowrap; }
.trend-amount.teal { color: #00A8A8; }
.channel-list { display: flex; flex-direction: column; gap: 12px; }
.channel-row { display: flex; align-items: center; gap: 10px; }
.channel-name { flex: 0 0 64px; font-size: 13px; color: var(--text-1, #333); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel-bar-wrap { flex: 1; height: 14px; border-radius: 7px; background: var(--bg, #F5F5F5); overflow: hidden; }
.channel-bar { height: 100%; border-radius: 7px; background: linear-gradient(90deg, var(--brand) 0%, #FF9A4D 100%); }
.channel-meta { flex: 0 0 auto; font-size: 12px; color: var(--text-2, #888); white-space: nowrap; }
.trend-month { font-size: 12px; color: var(--text-2, #888); }
.status-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.status-chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px; background: var(--bg, #F5F5F5); font-size: 13px; color: var(--text-1, #333); }
.status-chip b { color: var(--brand); font-size: 16px; }

/* 订单管理：产品订单 / 入驻申请 标签切换 */
.order-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.order-tabs .otab { padding: 8px 20px; border-radius: 8px; border: 1px solid var(--line, #E5E5E5); background: #fff; color: var(--text-2, #666); font-size: 14px; cursor: pointer; }
.order-tabs .otab.active { background: var(--brand, #FF6A00); border-color: var(--brand, #FF6A00); color: #fff; font-weight: 600; }

/* 入驻申请详情：身份证正反面预览 */
.idcard-imgs { display: flex; gap: 14px; flex-wrap: wrap; }
.idcard-item { text-align: center; }
.idcard-item img { width: 180px; aspect-ratio: 16/10; object-fit: cover; border-radius: 8px; border: 1px solid var(--line, #E5E5E5); cursor: zoom-in; background: #F7F7F7; }
.idcard-item .l { font-size: 12px; color: var(--text-3, #999); margin-top: 6px; }

/* 身份证图片全屏灯箱 */
.lightbox { position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,0.8); display: grid; place-items: center; cursor: zoom-out; }
.lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 8px; }

/* ===== 列表分页 ===== */
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.pager-total { color: var(--ink-3); font-size: 13px; }
.pager-size { padding: 5px 8px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); font-size: 13px; background: var(--surface); color: var(--ink-2); cursor: pointer; outline: none; }
.pager-size:focus { border-color: var(--brand); }
.pager .pg { min-width: 32px; height: 30px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink-2); font-size: 13px; cursor: pointer; transition: border-color .15s var(--ease), color .15s var(--ease), background .15s var(--ease); }
.pager .pg:hover:not(:disabled):not(.active) { border-color: var(--brand); color: var(--brand); }
.pager .pg.active { background: var(--brand); border-color: var(--brand); color: #fff; cursor: default; }
.pager .pg:disabled { opacity: .45; cursor: not-allowed; }
.pager .pg-ellipsis { color: var(--ink-3); padding: 0 2px; user-select: none; }

/* ===== 商户分佣：导入过程 spinner ===== */
.import-spinner { width: 34px; height: 34px; margin: 0 auto; border-radius: 50%; border: 3px solid var(--brand-soft, #FFF1E6); border-top-color: var(--brand, #FF6A00); animation: import-spin .8s linear infinite; }
@keyframes import-spin { to { transform: rotate(360deg); } }

/* ===== 服务商名称「输入匹配」查询框（HTv1.85）===== */
.nm-wrap { position: relative; }
.nm-suggest { position: absolute; top: calc(100% + 4px); left: 0; right: 0; max-height: 220px; overflow: auto; background: var(--surface, #fff); border: 1px solid var(--line-strong, #eee); border-radius: var(--r-sm, 8px); box-shadow: var(--shadow-md, 0 8px 24px rgba(0,0,0,.08)); z-index: 30; }
.nm-item { padding: 9px 12px; font-size: 13px; font-weight: 600; color: var(--ink, #222); cursor: pointer; border-bottom: 1px solid var(--line, #f0f0f0); }
.nm-item:last-child { border-bottom: none; }
.nm-item.hover { background: var(--brand-soft, #FFF1E6); }
.nm-empty { padding: 10px 12px; font-size: 13px; color: var(--ink-3, #999); }

/* ===== 服务商头像（系统头像库，2026-09-14）=====
   头像素材为 512×512 白底 PNG，圆形裁切展示；无头像时回落「—」占位 */
.tbl-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; display: block; flex-shrink: 0; background: var(--surface-2); }
.tbl-avatar.ph { display: grid; place-items: center; color: var(--ink-3); font-size: 11px; font-weight: 700; }
.cell-user { display: flex; align-items: center; gap: 8px; min-width: 0; }
.detail-avatar-row { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.detail-avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; display: block; flex-shrink: 0; background: var(--surface-2); border: 3px solid #fff; box-shadow: var(--shadow-sm); }
.detail-avatar.ph { display: grid; place-items: center; color: var(--ink-3); font-size: 24px; font-weight: 800; }

/* ===== 可点击链接（提现申请明细弹窗的「服务商 名称（手机号）」，2026-10-13）=====
   刻意用**蓝色**、而不是主题橙：橙色在本后台 = 主操作/选中态/金额，
   蓝色才承载「这里可以点」的语义，与弹窗里其余黑色信息区分得开。
   只匹配 a.link（当前全站仅这一处使用），不影响任何既有元素。 */
a.link { color: #1677FF; text-decoration: none; cursor: pointer; }
a.link:hover { color: #0958D9; text-decoration: underline; }
