/* 销售中台 · 数据观察台样式
 * 浅色主区 + 深色侧栏；涨红跌绿遵循国内习惯。
 * 设计取向：数字优先、留白充足、克制用色，避免任何装饰性渐变。
 */

:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --surface-3: #eef1f6;

  --ink: #10151d;
  --ink-2: #556070;
  --ink-3: #8b95a5;

  --line: #e5e9f0;
  --line-2: #d5dbe5;

  --brand: #1d4ed8;
  --brand-2: #3b6fe8;
  --brand-soft: #eaf0fe;
  --brand-line: #c9d9fb;

  --side: #131a26;
  --side-2: #1b2434;
  --side-ink: #e8edf6;
  --side-ink-2: #8b98ad;

  --up: #d13a2f;      /* 涨 / 收入 · 红 */
  --up-soft: #fdeeec;
  --down: #12805a;    /* 跌 / 支出 · 绿 */
  --down-soft: #e7f6ef;
  --warn: #a1660a;
  --warn-soft: #fdf3e2;
  --info: #0e7490;
  --info-soft: #e4f4f8;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;

  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;

  --side-w: 216px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.011em; }
h1 { font-size: 21px; }
h2 { font-size: 15px; }
h3 { font-size: 14px; }
p { margin: 0; }
a { color: var(--brand); text-decoration: none; }
button { font-family: inherit; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.dim { color: var(--ink-3); }
.up { color: var(--up); }
.down { color: var(--down); }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ==================================================================
   登录 / 注册
   ================================================================== */

.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}

/* 左侧品牌区 */
.auth-art {
  background: var(--side);
  color: var(--side-ink);
  padding: 56px 56px 48px;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}
/* 极淡的网格纹理，纯粹为避免大片死黑，不抢内容 */
.auth-art::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none;
}
.auth-art-inner { position: relative; max-width: 430px; }

.auth-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 52px;
  letter-spacing: 0.02em;
}
.auth-logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.auth-art h2 {
  font-size: 30px;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 14px;
}
.auth-art > .auth-art-inner > p {
  font-size: 14.5px;
  color: var(--side-ink-2);
  line-height: 1.85;
  margin-bottom: 40px;
}

.auth-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.auth-points li {
  font-size: 13px;
  color: var(--side-ink-2);
  line-height: 1.8;
  padding-left: 15px;
  position: relative;
}
.auth-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand-2);
}
.auth-points b {
  color: #fff;
  font-weight: 600;
  margin-right: 4px;
}

/* 右侧表单区 */
.auth-panel {
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
}
.auth-card { width: 100%; max-width: 360px; }

.auth-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.auth-tab {
  border: 0;
  background: none;
  padding: 0 2px 11px;
  margin-right: 20px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-3);
  cursor: pointer;
  position: relative;
  transition: color 0.15s;
}
.auth-tab:hover { color: var(--ink-2); }
.auth-tab.on { color: var(--ink); font-weight: 600; }
.auth-tab.on::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--brand);
  border-radius: 2px;
}

.field { margin-bottom: 15px; }
.field label {
  display: block;
  font-size: 12.5px;
  color: var(--ink-2);
  margin-bottom: 6px;
  font-weight: 500;
}
.field input {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: 14px;
  color: var(--ink);
  font-family: inherit;
  outline: none;
  transition: border-color 0.14s, box-shadow 0.14s;
}
.field input::placeholder { color: #b3bcc9; }
.field input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.09);
}

.btn {
  height: 42px;
  padding: 0 18px;
  border: 1px solid var(--brand);
  border-radius: var(--r-sm);
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.14s, transform 0.06s;
}
.btn:hover { opacity: 0.91; }
.btn:active { transform: translateY(0.5px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-block { width: 100%; }

/* 破坏性操作（解除下级）。
 * 直接用 --up 这个红，而不是另立一套 danger 色 —— 全站只有「不可逆」这一处
 * 需要红旗，多定义一个色值只会让人以为还有别的红要用。
 * 语义上这里不是「涨」，但用户读到的是同一个红，这已经够了。 */
.btn.danger {
  background: var(--up);
  border-color: var(--up);
}
.btn.danger:hover { opacity: 0.88; }

.btn-ghost {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.14s;
  white-space: nowrap;
}
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); border-color: var(--line-2); }
.btn-ghost.on { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand); }
.btn-ghost:disabled { opacity: 0.5; cursor: not-allowed; }

/* 表格行内的破坏性小按钮（客户行尾的「解除」）。
   常态是普通幽灵按钮，只把文字染红一点 —— 表格里每行都有一个，
   整排红块会把页面压得很重，而这里绝大多数时候并不是要点它。 */
.btn-ghost.danger-text { color: var(--up); border-color: #f0d2ce; }
.btn-ghost.danger-text:hover { background: var(--up-soft); color: var(--up); border-color: var(--up); }

.alert {
  display: none;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  font-size: 12.5px;
  line-height: 1.7;
  margin-bottom: 14px;
}
.alert.show { display: block; }
.alert.error { background: var(--up-soft); color: var(--up); border: 1px solid #f5cfcb; }
.alert.ok { background: var(--down-soft); color: var(--down); border: 1px solid #c9e8da; }
.alert.info { background: var(--brand-soft); color: var(--brand); border: 1px solid var(--brand-line); }
/* 提醒但可继续：数字合法、只是不太合理（例如某一级只到手 1%） */
.alert.warn { background: var(--warn-soft); color: var(--warn); border: 1px solid #f0dcb8; }

.auth-note {
  margin-top: 13px;
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.75;
  text-align: center;
}

.auth-demo {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.auth-demo-title {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-bottom: 10px;
  text-align: center;
  letter-spacing: 0.02em;
}
.auth-demo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.demo-chip {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: var(--r-sm);
  padding: 7px 9px;
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
  text-align: left;
  transition: all 0.13s;
  font-family: var(--mono);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}
.demo-chip span {
  font-family: var(--sans);
  font-size: 10.5px;
  color: var(--ink-3);
}
.demo-chip:hover {
  border-color: var(--brand-line);
  background: var(--brand-soft);
  color: var(--brand);
}
.demo-chip.demo-main {
  grid-column: span 2;
  border-color: var(--brand-line);
  background: var(--brand-soft);
  color: var(--brand);
}
.auth-demo-hint {
  margin-top: 9px;
  font-size: 11px;
  color: var(--ink-3);
  line-height: 1.7;
  text-align: center;
}

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-panel { padding: 32px 20px; }
}

/* ==================================================================
   应用外壳
   ================================================================== */

.shell { display: none; min-height: 100vh; }
.shell.show { display: flex; }

/* ---------------- 侧边栏 ---------------- */
.side {
  width: var(--side-w);
  flex: none;
  background: var(--side);
  color: var(--side-ink);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.side-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex: none;
}
.side-title { font-size: 13.5px; font-weight: 600; color: #fff; letter-spacing: 0.01em; }
.side-sub { font-size: 10.5px; color: var(--side-ink-2); letter-spacing: 0.06em; }

.side-nav {
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
}
.side-nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--side-ink-2);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: background 0.13s, color 0.13s;
}
.side-nav button:hover { background: var(--side-2); color: var(--side-ink); }
.side-nav button.on {
  background: var(--brand);
  color: #fff;
  font-weight: 500;
}
.side-nav .ni {
  width: 16px;
  text-align: center;
  font-size: 12px;
  opacity: 0.85;
  flex: none;
}
.side-nav .nt { flex: 1; }

/* ---------------- 分销管理 · 摘要条 ----------------
 *
 * 一行一个指标：左标签、中间数值、右侧补充说明。
 * 用 flex 让说明靠右，不要用 table —— 这里不需要列对齐，
 * 需要的是「标签弱、数字强、说明更弱」的层级。
 */
.dist-bar { display: flex; flex-direction: column; gap: 2px; }
.dist-bar-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.dist-bar-row:last-child { border-bottom: 0; }
.dist-bar-row .dl { color: var(--ink-2); font-size: 12.5px; min-width: 108px; }
.dist-bar-row b { font-size: 15px; font-variant-numeric: tabular-nums; }
.dist-bar-row .dim { margin-left: auto; font-size: 11.5px; }

/* 报表里的环比：涨用红、跌用绿 —— 和股票相反地区别开，
 * 这里沿用站内既有的 .up/.down（A 股习惯：红涨绿跌）。 */
td .up, td .down { font-variant-numeric: tabular-nums; font-size: 12.5px; }

/* ---------------- 组织管理 · 层级分布 ----------------
 *
 * .lv-tag  层级小标签（一级/二级/三级）
 * .bar-mini 表格内的占比条
 * .row-empty 空层级的那一行（要显眼但不能抢戏）
 * .row-me    表格里「我自己」那一行
 */

.lv-tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 4px;
  background: var(--surface-3);
  color: var(--ink-2);
  font-size: 11.5px;
  line-height: 1.6;
  white-space: nowrap;
}

/* 未归属的客户：标签在，但压暗。
 * 不隐藏、也不写「—」—— 他还是客户，只是暂时没有服务商，
 * 抹掉标签会让人以为这行数据不完整。 */
.lv-tag.dim-tag { opacity: 0.55; }

/* 客户表「归属上级」列的副行：上级是第几级。
 * 小一号、浅一档，明确它是主行的补充说明，而不是并列的第二条信息。 */
.up-lv {
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.4;
  margin-top: 1px;
}

/* 占比条：轨道 + 填充 + 右侧百分比数字。
 * 结构是 .bar-mini > .bm-track > i，不要试图用伪元素当轨道、
 * 再拿负 margin 把填充条拉回去 —— 那条路要求 padding 和宽度
 * 精确相消，改一次字号就全歪，而且没法解释为什么歪。
 * 数字放条形外面而不是里面：占比 3% 时数字塞进去会盖住条子本身。
 */
.bar-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 116px;
}
.bm-track {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--surface-3);
  overflow: hidden;
}
.bm-track i {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: var(--brand);
}
.bm-num {
  flex: none;
  width: 36px;
  text-align: right;
  font-size: 11.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* 空层级：整行压暗，但保留它 —— 「这一层 0 人」是结论，不是没数据 */
tr.row-empty td { background: var(--surface-2); }
tr.row-empty .lv-tag { opacity: 0.6; }

/* 合计行：上边框加粗，数字用正常色（不跟明细一样灰） */
tr.row-total td {
  border-top: 1px solid var(--line-2, var(--line));
  font-weight: 600;
  background: var(--surface-2);
}

/* 「我自己」那一行：左侧一道品牌色竖线，不整行染色 ——
 * 整行染色会和 hover 色撞在一起，鼠标移上去反而看不出哪行是高亮 */
tr.row-me td:first-child {
  box-shadow: inset 3px 0 0 var(--brand);
}

/* ============================================================================
 * 按月报表表（数据报表页）
 *
 * 这个表每一格都是「主数 + 副行」两层，所以行高比普通表格高一截。
 * 单独给一套类名而不是复用普通 table，是因为三处特殊：
 *   ① 副行（.rep-sub）要小一号、灰一档，且不能抢主数的视觉重量
 *   ② 数字列全部右对齐 + 等宽，否则 ¥1,368.00 和 ¥636.00 左对齐时
 *      位数对不齐，逐月比较时眼睛要在小数点上跳
 *   ③ 合计行的「—」占位要明显灰掉 —— 它是「不能加」，不是「是 0」
 * ========================================================================== */
.rep-table td {
  /* 副行是块级 div，需要给一点垂直余量，否则和下一行的分隔线贴住 */
  padding-top: 10px;
  padding-bottom: 10px;
  vertical-align: top;
}
.rep-table .rep-sub {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--ink-3);
  font-weight: 400;
  /* 副行是「补充信息」不是「第二个数」，不能等宽 —— 等宽会让它看起来
   * 像主数的一部分（比如把 "3 笔" 读成 "¥3"）。 */
  font-family: inherit;
  white-space: nowrap;
}
/* 合计行里的「—」：这是「不能相加」的占位，必须弱化到不会被人当成数据 */
.rep-table tr.row-total td.dim {
  font-weight: 400;
  color: var(--ink-3);
}

/* 「本月」小标签：标在最新那一行，说明这一行的客户数是当前值。
 *
 * 不加这个标签的话，用户看到第一行有客户数、下面几行是「+N」，
 * 会以为是「前面几个月的客户没了」—— 实际上只是口径不同。
 * 一个小标签能把整列的困惑消掉，成本几乎为零。
 */
.rep-table .rep-now {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  font-size: 10px;
  line-height: 1.5;
  font-family: var(--sans, inherit);
  color: var(--brand);
  background: var(--brand-soft, rgba(29, 78, 216, 0.08));
  border-radius: 3px;
  vertical-align: 1px;
}

/* ============================================================================
 * 月份行 vs 客户明细行
 *
 * 这张表现在是两层的：一个月一行汇总，下面挂 N 个客户行。
 * 层次必须一眼看出来，否则「¥5,300」和它下面的「¥2,000」会被读成
 * 同一批并列的数据 —— 用户会拿月合计和单客户去比，得出错误结论。
 *
 * 用三种手段叠加，而不是只靠一种：
 *   ① 汇总行字号略大 + 上方一道分隔线（视觉分组的最强信号）
 *   ② 明细行整体压暗一档（缩进 + 次要色）
 *   ③ 明细行的数字不加粗（加粗只留给汇总）
 * 只做缩进不够 —— 缩进在右对齐的数字列上看不出来。
 * ========================================================================== */

/* 汇总行：一道上边框把它和上个月的明细隔开，这是分组边界的唯一硬信号 */
.rep-table tr.row-month td {
  border-top: 1px solid var(--line-2, var(--line));
  background: var(--surface-2);
  font-size: 13.5px;
}
/* 第一行不要上边框（表格头部已经有一条了，两条叠在一起会很粗） */
.rep-table tbody tr.row-month:first-child td {
  border-top: 0;
}
.rep-table tr.row-month td:first-child {
  font-weight: 600;
}

/* 列宽固定，别让浏览器自己分。
 *
 * 这张表加了明细行之后，第一列要放下「客户名 + 我的客户标 + @账号」，
 * 自动分配时它会和其它列平分宽度，客户名一长就换行，
 * 而右边四个数字列宽度又各不相同 —— 逐月比较时小数点对不齐。
 *
 * 数字列给固定宽度（只够放 ¥12,150.00 这个量级），
 * 剩下的全给第一列。这样无论客户名多长，数字列都是齐的。
 */
.rep-table th:nth-child(1) { width: auto; }
.rep-table th:nth-child(2) { width: 96px; }
.rep-table th:nth-child(3) { width: 132px; }
.rep-table th:nth-child(4) { width: 156px; }
.rep-table th:nth-child(5) { width: 108px; }

/* 客户明细行：比汇总行浅，但**不能浅到看不清**
 *
 * 试过直接把整行 opacity 降到 0.6 —— 数字也跟着淡了，
 * 而这张表存在的意义就是让人看清每个客户给了多少。
 * 所以只压文字色，不动数字的对比度。
 */
/* ============================================================================
 * 中间层：带来人小组（row-group）
 *
 * 这张表现在是三层：月份 → 带来人 → 客户。
 * 中间这一层是 2026-11 加的：报表原本只有「月」和「客户」两层，
 * 客户平铺在月份下面，经销商一多就看不出「谁给我带来多少」。
 *
 * 层级靠三件事表达，缺一件就会认错层级：
 *   ① 字号：13.5（月）→ 13（组）→ 12.5（客户）
 *   ② 缩进：月 0 → 组 24px → 客户 44px（客户行另有竖线，见下）
 *   ③ 三角符号：只有可折叠的行才有 ▸ ▾，客户行没有
 *
 * 三角比「整行可点」更早被感知：不点也能看出这是个能展开的东西。
 * 用 "<" ">" 这种会被读成翻页，"▸" 在目录语义里最不容易误会。
 * ========================================================================== */
.rep-table tr.row-group td {
  padding-top: 6px;
  padding-bottom: 6px;
  font-size: 13px;
  background: var(--surface);
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}
/* hover 要有反馈：一行可点但鼠标移上去没反应，用户会怀疑是不是假的。
 * ⛔ 别用 transform/opacity 这类变化 —— 该表正在接受按月的数字比对，
 * 任何位移都会让上下两行的数字对不齐。 */
.rep-table tr.row-group:hover td {
  background: var(--surface-2);
}
.rep-table tr.row-group td:first-child {
  padding-left: 24px;
  font-weight: 600;
  color: var(--ink);
}
/* 小组的数字是小计，和客户行不是一回事 ⇒ 加粗，和月份行同级 */
.rep-table tr.row-group td.num {
  font-weight: 600;
}
.rep-grp-arrow {
  display: inline-block;
  width: 14px;
  color: var(--ink-3);
  font-size: 11px;
  vertical-align: 1px;
}
/* 折叠状态下隐藏客户行。
 *
 * 这里是纯 CSS 的行级隐藏，不重新渲染表格 ——
 * 重渲染会丢失 scroll 位置，经销商多的时候，每收起一组页面就跳回顶部。
 */
.rep-table tr.row-cust.is-hidden {
  display: none;
}

.rep-table tr.row-cust td {
  padding-top: 7px;
  padding-bottom: 7px;
  font-size: 12.5px;
  background: var(--surface);
}
.rep-table tr.row-cust:hover td {
  background: var(--surface-2);
}

/* 客户名：左列要能和月份列区分开，所以缩进一格 + 前面加一条细竖线，
 * 像目录里的子项。没有这条竖线时，客户名会和月份「2026-10」左对齐，
 * 看起来像同级数据。
 *
 * 缩进值从 22px 提到 44px：客户行现在的直接上级是「带来人小组」，
 * 它得比小组那行再退一格（月 0 → 组 24 → 客 44），否则三层会读成两层。 */
.rep-table td.rep-cust {
  padding-left: 44px;
  position: relative;
}
.rep-table td.rep-cust::before {
  content: "";
  position: absolute;
  left: 32px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  border-radius: 1px;
  background: var(--line-2, var(--line));
}
.rep-table td.rep-cust .rep-cust-n {
  color: var(--ink);
  font-weight: 500;
}

/* 「我的客户 / 某某的客户」标签
 *
 * 两个状态的对比要够明显，因为它回答的是「这钱算谁的」：
 *   - 我的客户 → 品牌色淡底（这是我的人，佣金归我）
 *   - 下级客户 → 中性灰（这是别人的客户，我只是能看到）
 * 用同一套颜色只换文字的话，扫一眼分不出来。
 */
.rep-chip {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 10px;
  line-height: 1.6;
  border-radius: 3px;
  vertical-align: 1px;
  white-space: nowrap;
}
.rep-chip.mine {
  color: var(--brand);
  background: var(--brand-soft, rgba(29, 78, 216, 0.08));
}
.rep-chip.sub {
  color: var(--ink-3);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

/* ---------------- 月份区间筛选条 ----------------
 *
 * 和 .filter-bar 是两套：那个是「填完点搜索」的受控表单，
 * 这个是「选完立刻生效」的即时控件（理由见 app.js 的 monthRangeBar 注释）。
 *
 * 排版：左边一排预设按钮，右边两个输入框。
 * 预设和输入框是同一件事的两种入口，所以放在**同一条水平线上** ——
 * 上下两行会让人以为是两个独立的筛选。
 */
.month-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 12px 16px;
}

.mb-presets {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

/* 预设按钮做成分段控件的样子（连成一条），不用单个圆角按钮 ——
 * 四个独立按钮看起来像四个动作，而它们其实是同一个选项的四种取值。 */
.mb-p {
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.14s, color 0.14s, border-color 0.14s;
}
.mb-p:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.mb-p:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.mb-p + .mb-p { margin-left: -1px; }
.mb-p:hover { background: var(--surface-2); }
/* 选中态用品牌色填充。
 * 只加粗边框是不够的 —— 在一条连着的分段控件里，
 * 边框变化几乎看不出来（挨着的两个按钮本来就共享一条线）。 */
.mb-p.on {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  position: relative;   /* 盖住相邻按钮的边框，避免选中项两侧露出灰线 */
  z-index: 1;
}

.mb-range {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.mb-f {
  display: flex;
  align-items: center;
  gap: 6px;
}
.mb-f > span {
  font-size: 11.5px;
  color: var(--ink-3);
  white-space: nowrap;
}
.mb-f input {
  width: 104px;
  height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: 12.5px;
  font-family: inherit;
  color: var(--ink);
  outline: none;
  transition: border-color 0.14s, box-shadow 0.14s;
  /* 月份是等宽数字，用等宽字体 + 字距，
   * 让「2026-07」和「2026-11」在切换时不会左右抖动。 */
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
}
.mb-f input::placeholder { color: var(--ink-3); letter-spacing: 0; }
.mb-f input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.09);
}

.mb-dash {
  color: var(--ink-3);
  font-size: 12px;
}

.mb-clear {
  height: 30px;
  padding: 0 10px;
  font-size: 12.5px;
}

/* ---- 单月下拉（报表页右上角） ----
 *
 * 和下面的区间筛选条是两套控件，但共用同一个状态。
 * 放在标题行右侧，位置对齐「分销数据概览」右上角那个下拉 ——
 * 用户说的「那样」指的就是那个位置和形态。
 */
.month-pick {
  display: flex;
  align-items: center;
  gap: 8px;
}

.month-pick .select {
  height: 30px;
  /* 月份是等宽数字。不加的话「2026-07」和「2026-11」切换时
   * 下拉宽度会跳一下（字宽不同），视线跟着抖。 */
  font-variant-numeric: tabular-nums;
}

/* 当前生效范围的提示。
 *
 * 只在「区间跨多月」时出现，说明「下拉写着全部月份，但下面正筛着 7~9 月」——
 * 没有这句的话，两个控件看起来在说两件相反的事。
 */
.mp-hint {
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---- 开号弹窗：账号类型（用户 / 销售） ----
 *
 * 两个并排的卡片式按钮，各自带一句说明。
 *
 * 为什么不用 <select>：两个选项都要解释一句「选它意味着什么」。
 * 下拉要把选项展开才看得到说明，而这个选择决定账号能做什么
 * （销售会建节点、能拿佣金），选错的代价不小 ——
 * 不该藏在一次点击后面。
 */
.nu-type {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.nu-t {
  display: block;
  text-align: left;
  padding: 9px 11px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.14s, background 0.14s;
}

.nu-t:hover { background: var(--surface-2); }

.nu-t b {
  display: block;
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 2px;
}

.nu-t span {
  display: block;
  font-size: 11px;
  line-height: 1.45;
  /* 说明文字用弱色 —— 它是「补充」，主体是上面那个词。
   * 两行都用正文色的话，两个按钮读起来像四行同等重要的内容。 */
  color: var(--ink-3);
}

/* 选中态：品牌色边框 + 浅底。
 *
 * 不用实心填充（像 .mb-p.on 那样）：
 * 那个是紧凑分段按钮，实心填充是为了在窄条里分辨选中项。
 * 这里是两块带说明的卡片，实心填充会让说明文字变成白字，
 * 11px 的小字在深底上反而更难读。
 */
.nu-t.on {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 1px var(--brand) inset;
}

.nu-t.on b { color: var(--brand); }
/* 选中时说明文字也跟着提一点亮度，否则在浅底上会更淡 */
.nu-t.on span { color: var(--ink-2); }

/* ---------------- 侧栏导航 ----------------
 *
 * 结构：
 *   button.nav-home            首页（工作台），不属于任何分组
 *   div.nav-sec[data-group]    一个分组
 *     button.nav-group         分组标题（点了只折叠，不切页）
 *     div.nav-sub              子项容器
 *       button[data-page]      真正的页面
 *
 * 分层靠三件事区分，不用边框线：
 *   ① 分组标题字号比子项小、颜色更灰（它是标签不是入口）
 *   ② 子项左侧留出缩进 + 一条竖线（视觉上「属于上面那一组」）
 *   ③ 展开时箭头旋转 90°，用 transform 而不是换字符，
 *      换字符会让整行宽度跳一下
 */
.nav-home { margin-bottom: 6px; }

.nav-sec { margin-bottom: 2px; }

.side-nav .nav-group {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 11px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--side-ink-2);
  font-size: 12px;
  /* 分组标题是「标签」，不是可点的入口，所以字号更小、
     颜色更灰、不加 hover 高亮底色 —— 只给一点亮度反馈 */
  letter-spacing: 0.03em;
  cursor: pointer;
  text-align: left;
  transition: color 0.13s;
}
.side-nav .nav-group:hover { color: var(--side-ink); }
.side-nav .nav-group .nt { flex: 1; }

/* 箭头：› 旋转 90° 就是向下的 ˅，不用换字符 */
.side-nav .nav-caret {
  font-size: 13px;
  opacity: 0.5;
  transition: transform 0.16s;
  transform: rotate(0deg);
  flex: none;
}
.nav-sec.open .nav-caret { transform: rotate(90deg); }

/* 子项容器默认收起。用 display 而不是 max-height 动画：
 * 子项数量不同、高度不同，max-height 要写死一个「够大」的值，
 * 状态多起来之后（12 项）那个值很容易不够，就会出现最后一两项被切掉。
 * 折叠是低频动作，不做动画也不影响手感。
 */
.nav-sub { display: none; }
.nav-sec.open .nav-sub { display: block; }

/* 子项：缩进 + 左侧竖线，表达「归属于上面那一组」。
 * margin-left 14px 对齐分组标题的文字起点（图标 16px + gap 10px 之后
 * 差不多就在这个位置），不要用 padding 撑 —— 那会把 hover 底色
 * 也一起往右推，看起来像没对齐。
 */
.nav-sub button {
  margin-left: 14px;
  width: calc(100% - 14px);
  padding-left: 12px;
  position: relative;
  font-size: 12.5px;
}
.nav-sub button::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 6px;
  height: 1px;
  background: rgba(255, 255, 255, 0.16);
}
/* 子项图标比一级项小一号，否则 12.5px 的字配 12px 的图标会显得图标过大 */
.nav-sub .ni { font-size: 11px; opacity: 0.7; }

.side-foot {
  padding: 12px 10px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.side-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px;
  margin-bottom: 8px;
  /* 这块从 <button> 退回了 <div>：它现在是纯展示，不再可点。
   *
   * 必须同时去掉 cursor:pointer 和 hover 高亮 —— 留着的话，
   * 鼠标移上去会变色、指针变成小手，点下去却没有反应，
   * 用户会以为是坏了。视觉上「能不能点」必须和实际行为一致。
   *
   * 用 width:100% 而不是按内容收缩：名字长一点短一点
   * 会让整块宽度跳来跳去。
   */
  width: 100%;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font: inherit;
  color: inherit;
  text-align: left;
}
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--side-2);
  color: var(--side-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 600;
  flex: none;
}
.side-user-info { min-width: 0; flex: 1; }
.side-user-name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--side-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.side-user-role { font-size: 10.5px; margin-top: 2px; }
.side-user-role .chip { background: rgba(255,255,255,0.08); color: var(--side-ink-2); border-color: rgba(255,255,255,0.1); }

.side-logout {
  width: 100%;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--r-sm);
  background: none;
  color: var(--side-ink-2);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.13s;
}
.side-logout:hover { background: var(--side-2); color: var(--side-ink); }

/* ---------------- 主内容区 ---------------- */
.content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.content-bar {
  height: 54px;
  padding: 0 26px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.crumb { font-size: 13px; font-weight: 500; color: var(--ink-2); }
/* 两级面包屑：「分组长 / 页面名」。
 * 分组长弱化成灰字，页面名保持正常色 —— 眼睛落在页面名上，
 * 分组只是用来区分同名页面的（组织管理/数据概览 vs 分销管理/数据概览）。
 */
.crumb .crumb-g { color: var(--ink-3); font-weight: 400; }
.crumb .crumb-sep { color: var(--ink-4, var(--ink-3)); margin: 0 6px; opacity: 0.6; }
.crumb .crumb-p { color: var(--ink); font-weight: 500; }
.bar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--ink-3);
}
.live i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--down);
  display: inline-block;
}
.live.warn i { background: var(--warn); }

/* 说完一句话就换色 —— 否则「已改名为某某」和常驻的「数据已就绪」
   长得一模一样，用户扫过去分不清哪句是刚才那次操作的结果。 */
.live.flash {
  color: var(--brand);
  font-weight: 500;
}

/* ---------------- 个人中心 ---------------- */

.pf-id {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.pf-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  border: 1px solid var(--brand-line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  flex: none;
}
.pf-idinfo { min-width: 0; flex: 1; }
.pf-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pf-account {
  font-size: 11.5px;
  color: var(--ink-3);
  font-family: var(--mono);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pf-role { flex: none; }

.pf-note {
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--surface-3);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.75;
}
.pf-note b { font-family: var(--mono); color: var(--ink); }

.main {
  padding: 22px 26px 64px;
  max-width: 1320px;
  width: 100%;
}

/* 页面标题 */
.page-head {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.page-head h1 { font-size: 21px; letter-spacing: -0.02em; }
.page-head .sub { font-size: 12.5px; color: var(--ink-2); padding-bottom: 2px; }
.page-head .grow { flex: 1; }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  margin-bottom: 14px;
  overflow: hidden;
}
.card-head {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-head h2 { font-size: 13.5px; }
.card-head .hint { font-size: 11.5px; color: var(--ink-3); margin-left: auto; }
.card-body { padding: 16px; }
.card-body.flush { padding: 0; }
/* 无标题卡片：标题条没了，16px 上下边距会显得头顶空一块。
 * 只用在「还没归属」那张填码卡片上 —— 它没有 card-head，
 * 内容第一行是说明文字，紧贴一点反而更像正文而不是弹窗。
 * 不做全局 .card-body 改动，避免影响其他有标题的卡片。 */
.card-body.no-head { padding: 14px 16px; }

/* ---------------- 指标卡 ---------------- */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}
@media (max-width: 1080px) { .metrics { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .metrics { grid-template-columns: 1fr; } }

.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 15px 16px 14px;
  position: relative;
  overflow: hidden;
}
.metric .k {
  font-size: 12px;
  color: var(--ink-2);
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.metric .k .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--line-2);
  flex: none;
}
.metric .v {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.026em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.metric .v .unit { font-size: 13px; font-weight: 500; color: var(--ink-3); margin-right: 3px; }
.metric .x { font-size: 11.5px; color: var(--ink-3); margin-top: 7px; line-height: 1.5; }
.metric.hl {
  border-color: var(--brand-line);
  background: var(--brand-soft);
}
.metric.hl .v { color: var(--brand); }
.metric.hl .k .dot { background: var(--brand); }
.metric.up-card .v { color: var(--up); }
.metric.down-card .v { color: var(--down); }

/* ---------------- 徽标 ---------------- */
.chip {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 4px;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1;
}
.chip.brand { background: var(--brand-soft); color: var(--brand); border-color: var(--brand-line); }
.chip.up { background: var(--up-soft); color: var(--up); border-color: #f5cfcb; }
.chip.down { background: var(--down-soft); color: var(--down); border-color: #c9e8da; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: #f0e0c2; }
.chip.info { background: var(--info-soft); color: var(--info); border-color: #c9e6ee; }
.chip.l1 { background: #eef3fe; color: #2c5498; border-color: #d2dff6; }
.chip.l2 { background: #f4effc; color: #5f4593; border-color: #e0d6f2; }
.chip.l3 { background: #fdf3e9; color: #8a5620; border-color: #f2ddc5; }

/* 无归属：客户掉出销售体系后的状态。
 * 刻意用灰底虚线，不用红也不用黄 —— 它不是一个「错误」，也不是「待办」，
 * 只是一个中间态。用户在客户列表里扫到它，应该读到「这人暂时没归谁」，
 * 而不是「出问题了赶紧处理」。 */
.chip.unbound {
  background: transparent;
  border-style: dashed;
  border-color: var(--line-2);
  color: var(--ink-3);
  font-weight: 400;
}

/* 已归属（出现在选人列表里，表示「这个人你绑不了」）
 * 和 .unbound 刻意区分：unbound 是「没归谁」（可以绑），
 * 这个是「已归别人」（要先去解除）。两者在视觉上不能长得一样，
 * 否则用户会以为处理方式也一样。 */
.chip.lock {
  background: transparent;
  border-color: var(--line-2);
  color: var(--ink-3);
  font-weight: 400;
}

/* 无归属整行压暗一档：表格里一眼就能分出「在编的」和「掉出来的」。
   只降不透明度、不改字色 —— 改字色会让金额那一栏也失焦，
   而金额恰恰是判断该不该认领的依据。 */
tr.row-unbound td { background: var(--surface-2); }
tr.row-unbound:hover td { background: var(--surface-3); }

/* ---------------- 表格 ---------------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left;
  font-weight: 500;
  font-size: 11.5px;
  color: var(--ink-3);
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  white-space: nowrap;
  letter-spacing: 0.01em;
}
td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ------------------ 人名 + 账号（三处界面统一） ------------------
 *
 * 销售树、客户表、佣金表都用人名认人，用 @账号 区分同名。
 * 之前三处各写各的，同一个人在不同页面长得不一样，而且窄屏下佣金表的
 * 客户名会被压成「一 行 一 个 字」的竖排 —— 根因是那一列没设 nowrap，
 * 浏览器表格自动布局把宽度全让给了带 nowrap 的数字列，客户列只剩 54px。
 *
 * 这里的对策是两层：
 *   1. 结构上：主名和 @账号 分成两块，主名 nowrap + 省略号，
 *      再怎么挤也是「名字被截断」，而不是逐字竖排。
 *   2. 布局上：给这些单元格一个 min-width（见下方 .col-person），
 *      让表格自动布局知道「这列不能再压了」，优先压缩可以折行的列。
 */
.person {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  line-height: 1.35;
}
.person .p-main {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  color: var(--ink);
}
.person .p-sub {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 表格里放 .person 的列：给一个下限宽度。
 * 不设这个下限时，浏览器会把「能折行的列」一路压到底 ——
 * 实测 900px 视口下客户列压到 54px，一个字一行，行高从 44px 崩到 127px。
 *
 * 用显式的 .col-person 而不是 :has()：:has() 在部分内嵌浏览器/旧版内核上
 * 不支持，静默失效后又会退回竖排，而且失效时没有任何提示，很难发现。
 * 类名是显式写出来的，改没改一眼看得见。 */
td.col-person { min-width: 132px; }

/* 销售树的姓名列是 flex 子项，宽度由 .tree-name 控制（见下方），
   这里只把两行的高度和省略号接上即可。 */
.tree-name .person { max-width: 100%; }

.empty {
  padding: 44px 16px;
  text-align: center;
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1.8;
}

/* ---------------- 销售树 ---------------- */

/* 层级分布：阶梯条形图
 *
 * 用缩进 + 条长两个维度同时表达信息：
 *   缩进（--lv）→ 第几级，视觉上形成阶梯，金字塔结构直接可读
 *   条长       → 该级人数，跨级对比靠长度不靠数字
 * 比原来那排胶囊标签更省眼力，也不会和下方的表格卡片混淆。
 */
.depth-strip {
  padding: 12px 14px 13px;
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.depth-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-3);
  margin-bottom: 9px;
}
.depth-total { color: var(--ink-2); font-variant-numeric: tabular-nums; }

.depth-bars { display: flex; flex-direction: column; gap: 5px; }

.depth-row {
  display: flex;
  align-items: center;
  gap: 9px;
  /* 逐级右移，做出阶梯感。12px 一档，比表格里 22px 的树形缩进更紧凑，
     因为这里只是示意层级，不需要与树的连线对齐 */
  padding-left: calc(var(--lv) * 12px);
}
.depth-row.zero { opacity: 0.42; }

.depth-name {
  flex: none;
  width: 34px;
  font-size: 11.5px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.depth-track {
  flex: 1;
  height: 7px;
  border-radius: 4px;
  background: var(--surface-3);
  overflow: hidden;
}
.depth-track i {
  display: block;
  height: 100%;
  border-radius: 4px;
  /* 层级越深颜色越浅，和树里的一级/二级/三级角标形成呼应 */
  background: var(--brand);
  transition: width 0.3s ease;
}
.depth-row:nth-child(2) .depth-track i { background: #5b86e5; }
.depth-row:nth-child(3) .depth-track i { background: #a8c0f2; }
.depth-row:nth-child(4) .depth-track i { background: #c9d9fb; }

.depth-num {
  flex: none;
  min-width: 22px;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.depth-row.zero .depth-num { color: var(--ink-3); font-weight: 400; }

/* 占比：把条形右侧的空白利用起来，同时给出「这一级占全队多少」的判断依据 */
.depth-share {
  flex: none;
  width: 40px;
  font-size: 11px;
  color: var(--ink-3);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.tree { padding: 4px 0; }

.tree-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 16px 8px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  transition: background 0.1s;
}
.tree-row:last-child { border-bottom: 0; }
.tree-row:hover { background: var(--surface-2); }

/* 一级节点视觉上更重，作为分支的起点 */
.tree-row.root { background: #fcfdff; }
.tree-row.root:hover { background: var(--surface-2); }
.tree-row.root .tree-name { font-weight: 600; }

/* 自己这一行给一条左侧色条，扫一眼就能定位 */
.tree-row.self {
  background: var(--brand-soft);
  box-shadow: inset 3px 0 0 var(--brand);
}
.tree-row.self:hover { background: #e3ecfe; }

/* 树形连线区（纯 CSS 绘制，不用 │├└ 字符）
 *
 * 为什么不用字符：这些符号的形状完全取决于字体，实测「└」会被渲染成类似「L」
 * 的直角，高度也和行对不齐，看起来根本不像树。线条交给 CSS，位置才稳定可靠。
 *
 * 每层一个 .tl 格子，宽度固定 22px：
 *   .tl-pass  该层上级还有后续兄弟 → 竖线从上方贯穿到下方
 *   .tl-join  当前节点的转角 → 竖线上半段 + 向右的横线
 *   .tl-end   最后一个兄弟 → 竖线只到转角处，不再往下延伸
 */
.tree-lead {
  display: flex;
  align-items: stretch;
  flex: none;
  align-self: stretch;
  /* 编号列移除后，一级节点前面只剩这段留白。
     给一个最小宽度，否则一级节点的人名会紧贴卡片左边、看起来像缺了一列。 */
  min-width: 6px;
}
.tree-lead .tl {
  position: relative;
  width: 22px;
  flex: none;
}

/* 贯穿的竖线 */
.tree-lead .tl-pass::before {
  content: "";
  position: absolute;
  left: 10px;
  top: -1px;
  bottom: -1px;
  width: 1.5px;
  background: var(--line-2);
}

/* 转角：竖线 + 横线。
   竖线默认贯穿整行（top 到 bottom）：因为每一行是独立的 DOM 元素，
   线只能各自画自己那一段、靠上下两行首尾相接才连成一条。
   原来只画了上半段（bottom: 50%），于是每个「还有后续兄弟」的 ├ 下方
   都空出半行，下一行的线看着像凭空长出来 —— 实测 3 处断线就是这么来的。
   最后一个孩子才把下半段砍掉（见下面的 .tl-end）。 */
.tree-lead .tl-join::before {
  content: "";
  position: absolute;
  left: 10px;
  top: -1px;
  bottom: 0;
  width: 1.5px;
  background: var(--line-2);
}
.tree-lead .tl-join::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  width: 15px;
  height: 1.5px;
  background: var(--line-2);
}

/* 最后一个孩子：竖线到转角就停，下半段不画，免得连到下一个分支去 */
.tree-lead .tl-end::before { bottom: 50%; }

/* 根节点之间留出间隔，明确「这是两个互不从属的分支」 */
.tree-row.root + .tree-row.root { border-top: 1px solid var(--line-2); }
.tree-row.root { border-bottom: 0; }
.tree-row.root:not(:last-child) { border-bottom: 1px solid var(--line); }

/* ---------------------------- 节点编号（已不在主视图显示） ----------------------------
 *
 * 编号形如 B1 / B1B1 / B1B1B1，规则是「有几个 B 就有几个数字」，一个字都不改。
 * 四处主视图（销售树、客户、佣金、结算）都**不再显示**编号：
 * 树形缩进与连线已表达层级，「上级 XX」与节点名已表达归属和核对对象，
 * 编号对一线使用只是多余的字母带。
 *
 * 编号本身仍然保留 —— 存在库里，并出现在下表的悬停提示与选人控件里：
 *   销售树行 / 客户归属列 / 佣金归属列 / 结算节点列  → title 悬停可见
 *   改绑下拉 / 发展下级提示 / 检索标签                → codeText() 纯文本
 *
 * 原来那套「按级拆段、祖先段中灰、自己那段加粗」的分段样式（.code / .code > i /
 * .code-sm / .code-tree / .code-root）已随主视图一起删除：既然不再有地方需要
 * 好读地展示整串编号，留着这些样式只会诱使别人把这列字母带回来。 */

/* 名字与上级两列固定宽度。
   这是对齐的关键：缩进会让每行的左边界不同，如果名字/上级列用 min-width 自适应，
   右侧的客户数、充值额、条形图就会随层级左右摇摆，整张表看起来是散的。
   固定宽度后，无论多深，右侧数字都落在同一条竖线上。

   姓名列从 108px 放宽到 132px：现在姓名下面还有一行 @账号，
   108px 装不下「@bxbb01」这种 8 字符的账号，会被截成「@bxbb…」。
   放宽后与客户表/佣金表的姓名列下限一致，三处看起来是同一套排版。 */
.tree-name {
  font-weight: 500;
  width: 132px;
  flex: none;
  min-width: 0;
}

/* 上级关系：比层级标签更直接地回答「这个人归谁」 */
.tree-up {
  font-size: 11.5px;
  color: var(--ink-3);
  flex: none;
  width: 104px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tree-up b { color: var(--ink-2); font-weight: 500; }

.tree-branch {
  flex: 1;
  height: 1px;
  /* 不用可见的分隔线：树形视图里已经有连线了，
     再加一条贯穿整行的浅线会让人分不清哪条是树形连线 */
  background: transparent;
  margin: 0 4px;
  min-width: 10px;
}

.tree-stat { display: flex; gap: 16px; font-size: 12px; color: var(--ink-2); flex: none; }
.tree-stat b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* 行尾的「看客户 3」按钮。
 *
 * 原来把「客户 3 ▸」这个数字本身做成开关，想法是少一列按钮，
 * 但它混在「充值 ¥4,600」中间，一排全是数字，没人看得出可以点 ——
 * 实际反馈就是「客户归属怎么看不到客户」。
 * 现在做成一个边框胶囊按钮，长得就像能点的东西，不靠用户猜。 */
.cust-toggle {
  flex: none;
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--brand-line);
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11.5px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.cust-toggle:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.cust-toggle.on { background: var(--brand); color: #fff; border-color: var(--brand); }

/* 行尾「解除」：默认不占位置，鼠标移到这一行才浮出。
 *
 * 为什么不常驻：一行里已经有层级、上级、客户数、充值额、条形图、状态，
 * 再加一个常驻按钮会把这一行撑得很长，而它是个低频且有破坏性的操作 ——
 * 天天摆在眼前，容易误点。
 *
 * 为什么用 visibility 而不是 display:none：
 * display 切换会让整行宽度抖动（列宽按内容算），鼠标扫过时数字会左右跳。
 * visibility 保留占位，只是看不见，布局稳定。 */
.tree-release {
  flex: none;
  height: 22px;
  margin-left: 8px;
  padding: 0 8px;
  border: 1px solid var(--line-2);
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 11.5px;
  font-family: inherit;
  cursor: pointer;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.12s, color 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.tree-row:hover .tree-release { visibility: visible; opacity: 1; }
.tree-release:hover { color: var(--up); border-color: var(--up); }

/* 触屏没有 hover，永远浮不出来 —— 这类设备上直接常驻显示 */
@media (hover: none) {
  .tree-release { visibility: visible; opacity: 1; }
}

/* 客户行（叶子） */
.tree-row.leaf-cust {
  /* 比销售行浅一档、字小一号：一眼看出这是叶子而不是同级的人 */
  background: #fcfdff;
  font-size: 12.5px;
}
.tree-row.leaf-cust:hover { background: var(--surface-2); }
.tree-row.leaf-cust .tree-name { font-weight: 400; }
.tree-row.leaf-cust .tree-name .p-main { color: var(--ink-2); font-weight: 400; }
/* 叶子行的条形用浅色：它不是销售业绩，只是这个客户自己的充值，
   和销售的条形同样深会让人误以为客户也在参与分佣对比 */
.tree-row.leaf-cust .tree-bar i { background: var(--line-2); }
.tree-row.leaf-cust .tree-bar { width: 60px; }

/* 客户行的「归属 XX」要能一眼看清是谁的客户。
 *
 * 为什么需要强调：客户丙挂在李二级下，它和客户甲（挂王三级）缩进完全相同 ——
 * 两者都是「某一层的孩子」。光看缩进分不出谁挂谁，只能读文字。
 * 所以把归属人做成带底色的胶囊，扫一眼就知道这一行属于哪个人，
 * 不用顺着线往上找。 */
.tree-row.leaf-cust .tree-up {
  color: var(--ink-3);
  white-space: nowrap;
}
.tree-row.leaf-cust .tree-up b {
  color: var(--ink-2);
  font-weight: 500;
  background: var(--surface-3);
  border-radius: 4px;
  padding: 0 4px;
}

.tree-bar {
  width: 74px;
  height: 5px;
  border-radius: 3px;
  background: var(--surface-3);
  overflow: hidden;
  flex: none;
}
.tree-bar i {
  display: block;
  height: 100%;
  background: var(--brand);
  border-radius: 3px;
}

.tree-flag {
  font-size: 11.5px;
  min-width: 52px;
  text-align: right;
  flex: none;
}

/* 窄屏：收起次要列，保住树形与关键数字 */
@media (max-width: 900px) {
  .tree-up, .tree-bar { display: none; }
}
@media (max-width: 640px) {
  .tree-lead .tg { display: none; }
  .tree-stat { gap: 10px; }
}

/* ---------------- 双栏 ---------------- */
.cols { display: grid; grid-template-columns: 1.42fr 1fr; gap: 14px; }
/* 只剩一张卡片时铺满整行。网格只有单个子元素时只占左列（58%），
 * 右边会空出一大片，所以用 `one` 明确改成单列。
 * 佣金结构卡片恢复后，把 app.js 里的 `cols one` 改回 `cols` 即可。 */
.cols.one { grid-template-columns: 1fr; }
@media (max-width: 1000px) { .cols { grid-template-columns: 1fr; } }

/* ---------------- 佣金结构条 ---------------- */
.bar-wrap {
  display: flex;
  height: 9px;
  border-radius: 5px;
  overflow: hidden;
  background: var(--surface-3);
}
.bar-seg { height: 100%; }
.legend { display: flex; gap: 16px; margin-top: 11px; flex-wrap: wrap; font-size: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; flex: none; }

/* ---------------- 趋势柱 ---------------- */
.trend {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 132px;
  padding: 6px 2px 0;
}
.trend-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 6px;
  min-width: 0;
}
.trend-bar {
  width: 100%;
  max-width: 42px;
  border-radius: 3px 3px 0 0;
  background: var(--brand);
  min-height: 3px;
  transition: height 0.4s cubic-bezier(0.2, 0.7, 0.3, 1), opacity 0.15s;
  position: relative;
}
.trend-col:hover .trend-bar { opacity: 0.82; }
.trend-bar.mute { background: var(--line-2); }
.trend-lab {
  font-size: 10.5px;
  color: var(--ink-3);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.trend-val {
  font-size: 10.5px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------------- 加载 / 提示 ---------------- */
.loading { padding: 44px; text-align: center; color: var(--ink-3); font-size: 13px; }

.tip {
  padding: 11px 14px;
  background: var(--warn-soft);
  border: 1px solid #f0e0c2;
  border-radius: var(--r-sm);
  font-size: 12.5px;
  color: #7a5209;
  line-height: 1.75;
  margin-bottom: 14px;
}
.tip b { font-weight: 600; }
.tip.info { background: var(--brand-soft); border-color: var(--brand-line); color: #1e3f7a; }

.select {
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: 12.5px;
  color: var(--ink);
  font-family: inherit;
  cursor: pointer;
  outline: none;
}
.select:focus { border-color: var(--brand); }

/* ---------------- 弹窗 ---------------- */
.mask {
  position: fixed;
  inset: 0;
  background: rgba(16, 21, 29, 0.44);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  animation: maskIn 0.14s ease-out;
}
@keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--surface);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 18px 52px rgba(16, 21, 29, 0.2);
  animation: modalIn 0.17s ease-out;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(9px) scale(0.99); }
  to { opacity: 1; transform: none; }
}

/* ==================== 右侧抽屉（客户详情） ====================
 *
 * 和居中弹窗的区别不是造型偏好：
 * 抽屉不遮住列表主体，用户能一边看详情一边保留列表位置，
 * 关掉继续点下一个。居中弹窗每次都要「关掉 → 重新找到那一行」。
 *
 * 遮罩还是那层遮罩，只是把对齐方式从居中改成靠右贴满 ——
 * 这样点遮罩关闭、Esc 关闭这些行为完全复用，不用另写一套。
 */
.mask-side {
  align-items: stretch;
  justify-content: flex-end;
  padding: 0;
}
.modal-side {
  max-width: 420px;
  height: 100%;
  max-height: 100vh;
  border-radius: 0;
  box-shadow: -14px 0 40px rgba(16, 21, 29, 0.18);
  animation: drawerIn 0.2s cubic-bezier(0.22, 0.61, 0.36, 1);
}
@keyframes drawerIn {
  from { transform: translateX(28px); opacity: 0.6; }
  to { transform: none; opacity: 1; }
}

/* 抽屉内部：信息分块，块与块之间留白，不做分割线 ——
 * 一块一条线会让人以为它们是完全独立的东西，
 * 实际上它们都是「同一个人」的不同侧面。 */
.drawer-id { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.drawer-name { font-size: 17px; font-weight: 600; margin-bottom: 2px; }
.drawer-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0 4px;
}
.dm {
  background: var(--surface-2);
  border-radius: var(--r-md);
  padding: 10px 12px;
}
.dm-k { font-size: 11.5px; color: var(--ink-3); margin-bottom: 4px; }
.dm-v { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
/* 积分那格的副标题（套餐 X · 充值 Y）。
 * 比 dm-k 更小、更淡 —— 它解释的是上面那个总数怎么构成的，
 * 属于「想细看才看」的信息，不该和「累计充值」这种主指标抢注意力。
 */
.dm-sub {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.drawer-sec { margin-top: 18px; }
.drawer-sec-h {
  font-size: 12px;
  color: var(--ink-3);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
}
.drawer-owner { display: flex; align-items: center; flex-wrap: wrap; }
/* 归属链路：张一级 → 李二级 → 王三级
 * 用箭头而不是「/」或「>」—— 箭头本身表达了方向（越往后越深），
 * 而斜杠只是分隔符，读不出层级关系。 */
.drawer-chain {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: var(--r-md);
}
.drawer-chain-item { display: inline-flex; align-items: baseline; gap: 5px; font-size: 13px; }
.drawer-chain-item .dim { font-size: 11px; }
.drawer-arrow { font-style: normal; color: var(--ink-3); font-size: 12px; }
.drawer-note {
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
  background: var(--warn-soft);
  border-radius: var(--r-md);
  padding: 10px 12px;
  color: var(--ink-2);
}
.drawer-unbound { display: flex; flex-direction: column; align-items: flex-start; }

/* 抽屉里的充值流水：一笔一块，两行式。
 *
 * 不做成表格 —— 抽屉只有约 300px 可用宽，三列会把长订单号挤到贴着金额
 * （实测截图里显示成「¥2,000.00SEED26d7eb9a...」，读起来像一个数值）。
 * 拆成两行后，金额在右上角固定位置，可以纵向扫读；
 * 订单号独占一行，再长也挤不到金额。
 */
.dr-orders { display: flex; flex-direction: column; }
.dr-o {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.dr-o:last-child { border-bottom: none; }
.dr-o-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.dr-o-time {
  font-size: 12px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  flex: none;
}
.dr-o-amt {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  flex: none;
}
/* 订单号：小字、灰、允许断开。
 * word-break: break-all 是必需的 —— 订单号是没有空格的长串，
 * 默认只在空格处折行，结果就是整串溢出容器或把父元素撑宽。
 */
.dr-o-no {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 2px;
  word-break: break-all;
  line-height: 1.4;
}

.modal-head {
  display: flex;
  align-items: center;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { font-size: 14.5px; font-weight: 600; }
.modal-x {
  margin-left: auto;
  border: 0;
  background: none;
  font-size: 20px;
  line-height: 1;
  color: var(--ink-3);
  cursor: pointer;
  padding: 0 2px;
  font-family: inherit;
}
.modal-x:hover { color: var(--ink); }

.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot {
  padding: 13px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}

.fhint { font-size: 11.5px; color: var(--ink-3); margin-top: 5px; line-height: 1.65; }
.modal .field:last-child { margin-bottom: 0; }
.modal .alert { margin-bottom: 0; margin-top: 4px; }

/* ================= 解除下级 · 影响面清单 ================= */

/* 标题行：谁要被解除。放最上面，避免用户核对错了人。
   名字用正文色加粗，层级和编号退成灰色 —— 扫一眼先看到人，再确认是不是他。 */
.rel-target {
  font-size: 13.5px;
  line-height: 1.6;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 11px;
}
.rel-target b { font-weight: 600; }

/* 影响面：左标签右说明的短表格。
 * 用 grid 而不是 table —— 这里只有两列、行数不定，grid 的 88px 标签列足够，
 * 而且说明文字换行时不会把标签列撑宽。 */
.rel-list { display: grid; gap: 9px; }
.rel-item {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 10px;
  font-size: 12.5px;
  line-height: 1.7;
  align-items: start;
}
.rel-k {
  color: var(--ink-3);
  font-size: 12px;
  padding-top: 1px;
  white-space: nowrap;
}
/* 数值加粗但不上色：这一屏里红绿都另有含义（红=解除），
   数字如果再染色，会和确认按钮抢注意力。 */
.rel-v { color: var(--ink-2); }
.rel-v b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.rel-v.dim { color: var(--ink-3); }

/* 窄屏：标签列换到上方，说明占满整行。
   76px 的标签列在 320px 宽下只剩 200 多像素放说明，读起来断得太碎。 */
@media (max-width: 420px) {
  .rel-item { grid-template-columns: 1fr; gap: 2px; }
  .rel-k { padding-top: 0; }
}

/* ---------------- 账号检索选择器 ---------------- */
.picker { position: relative; }
.picker-input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--ink);
  font-family: inherit;
  background: var(--surface);
  outline: none;
  transition: border-color 0.13s, box-shadow 0.13s;
}
.picker-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.09);
}

.picker-list {
  margin-top: 7px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  max-height: 210px;
  overflow-y: auto;
  background: var(--surface);
}
/* picker 提示态：去掉外框。
   提示语（「输入关键字开始搜索」）本身不是输入区，
   带框会被误认成第二个输入框。有结果时才恢复边框。 */
.picker-list.bare {
  border-color: transparent;
  background: transparent;
  max-height: none;
}

.picker-hint {
  padding: 15px 12px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-3);
}
.picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  transition: background 0.1s;
}
.picker-row:last-child { border-bottom: 0; }
.picker-row:hover { background: var(--surface-2); }
.picker-row.on { background: var(--brand-soft); }

/* 不可选的行（已归属别人 / 已停用）
 *
 * 为什么不用 disabled 属性：这行是 div 不是 button，disabled 不生效。
 * 所以既要视觉上灰掉（让人一眼知道不能点），又要 cursor: not-allowed
 * 覆盖掉父级的 pointer，否则鼠标还是手型，看起来仍像能点的。
 * 光灰不给 cursor，用户会以为是渲染慢，照样去点。 */
.picker-row.locked {
  opacity: 0.55;
  cursor: not-allowed;
  background: var(--surface-2);
}
.picker-row.locked:hover { background: var(--surface-2); }
.picker-row.locked .picker-main b { font-weight: 400; }
/* 灰行里的「已归属 X」标签也要跟着降饱和，否则一行里就它还亮着 */
.picker-row.locked .chip { opacity: 0.9; }
.picker-main { flex: 1; min-width: 0; }
.picker-main b { font-weight: 500; }
.picker-tags { flex: none; }
.picker-picked {
  padding: 10px 12px;
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--ink);
  line-height: 1.7;
}
.picker-picked b { font-weight: 600; }

td .btn-ghost { height: 26px; padding: 0 9px; font-size: 12px; }

/* ---------------- 同步页 ---------------- */
.sync-flow {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 0 2px;
  flex-wrap: wrap;
}
.sync-node {
  flex: 1;
  min-width: 160px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 15px 16px;
  background: var(--surface-2);
}
.sync-node.hi { border-color: var(--brand-line); background: var(--brand-soft); }
.sync-node .sn-k { font-size: 11.5px; color: var(--ink-3); margin-bottom: 7px; }
.sync-node .sn-v {
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.sync-node.hi .sn-v { color: var(--brand); }
.sync-node .sn-x { font-size: 11.5px; color: var(--ink-3); margin-top: 5px; }
.sync-arrow {
  font-size: 15px;
  color: var(--ink-3);
  flex: none;
  text-align: center;
  line-height: 1.4;
}
.sync-arrow small { display: block; font-size: 10px; }

.log-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}
.log-row:last-child { border-bottom: 0; }
.log-row:hover { background: var(--surface-2); }
.log-ico {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  background: var(--surface-3);
  color: var(--ink-3);
  margin-top: 1px;
}
.log-ico.in { background: var(--brand-soft); color: var(--brand); }
.log-ico.out { background: var(--down-soft); color: var(--down); }
.log-main { flex: 1; min-width: 0; }
.log-main b { font-weight: 500; }
.log-main .log-d { color: var(--ink-3); font-size: 11.5px; margin-top: 2px; }

/* 内部备注那一块：正文要能读，不能和「同步记录」的副标题一个颜色。
 *
 * 同步记录的 .log-d 是灰色小字，因为它写的是「管理员代开账号（张三）」
 * 这类补充说明，扫一眼就够。而备注是管理员自己写下的判断
 * （「这家是老赖」「抖音渠道，别报高价」），它是这一行的**主体**，
 * 灰成 11.5px 就等于把它藏起来。
 * 所以这里恢复正文色、放大到 12.5px，并用 pre-wrap 保留换行 ——
 * 备注常常是分几行写的，压成一行会把「① ② ③」挤成一段。
 */
.log-main .log-d.note-d {
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.65;
  margin-top: 4px;
  white-space: pre-wrap;
  word-break: break-word;
}
.log-time { font-size: 11.5px; color: var(--ink-3); flex: none; font-variant-numeric: tabular-nums; }

/* 小屏：侧栏收成顶部横条 */
@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .side {
    width: 100%;
    height: auto;
    position: static;
    flex-direction: row;
    align-items: center;
    padding: 0 10px;
    gap: 8px;
    overflow-x: auto;
  }
  .side-brand { border-bottom: 0; padding: 10px 6px; }
  .side-nav { flex-direction: row; padding: 8px 0; gap: 2px; flex: none; }
  .side-nav .ni { display: none; }
  .side-foot {
    border-top: 0;
    margin-left: auto;
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .side-user { margin-bottom: 0; padding: 0; }
  .side-user-info, .side-sub { display: none; }
  .side-logout { width: auto; padding: 6px 10px; }
  .main { padding: 16px 14px 48px; }
  .content-bar { padding: 0 14px; }
  .live { display: none; }
}
/* ---------------------------- 返点设置弹窗 ----------------------------
 *
 * 为什么每一行都要跟着显示「实际到手」：
 * 这套是级差补足模型，填的是「本级累计应得」，实际到手 = 本级 − 下一级。
 * 填 12/9/6 时三级只拿 6%、二级拿 3%、一级拿 3% —— 只看百分比会算错，
 * 所以每个输入框旁边直接给出到手比例，下面再给一笔 1000 元订单的金额分配。
 */
.rule-grid {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.rule-row {
  display: grid;
  grid-template-columns: 44px 96px 1fr;
  align-items: center;
  gap: 10px;
}
.rule-lv {
  font-size: 12.5px;
  color: var(--ink-2);
  font-weight: 500;
}
.rule-input {
  position: relative;
  display: flex;
  align-items: center;
}
.rule-input input {
  width: 100%;
  height: 36px;
  /* 右侧留出百分号的位置。26px 是按「12.00 %」最宽的情况留的，
     少了百分号会压到数字上；多了数字又显得偏左。 */
  padding: 0 28px 0 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: 13.5px;
  color: var(--ink);
  font-family: var(--mono);
  outline: none;
  text-align: right;
  transition: border-color 0.14s, box-shadow 0.14s;
}
.rule-input input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.09);
}
/* 去掉数字框的上下小箭头：占地方，而且这里希望人直接输入 */
.rule-input input::-webkit-outer-spin-button,
.rule-input input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.rule-input input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.rule-unit {
  position: absolute;
  /* 绝对定位 + 定宽 + 右对齐：数字位数变化（12 / 11 / 6.5）时，
     百分号始终停在同一位置，不会跟着数字宽度左右游走 */
  right: 9px;
  width: 12px;
  text-align: left;
  font-size: 12px;
  color: var(--ink-3);
  pointer-events: none;
}
.rule-real {
  font-size: 12px;
  color: var(--ink-3);
  white-space: nowrap;
}
.rule-real b { color: var(--ink); font-family: var(--mono); font-weight: 600; }
.rule-real.bad { color: var(--up); }

/* 预览区：把百分比翻译成钱 */
.rule-preview {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.rule-pv-head {
  font-size: 12px;
  color: var(--ink-3);
  margin-bottom: 8px;
}
.rule-pv-head b { color: var(--ink-2); }
.rule-pv-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rule-pv-row {
  display: grid;
  grid-template-columns: 44px 1fr 74px;
  align-items: center;
  gap: 10px;
}
/* 第一列 44px 是按「一级 / 二级」这种两字标签定的。
 *
 * 但返点设置页要放「返点池（给 B 体系）」这种长标签 —— 44px 装不下，
 * 文字会溢出压到后面的横条上（实测就是「返点池（给 B 体…）」被横条盖住一半）。
 * 试过在标签上加内联 width:auto，没用：网格列宽由 grid-template-columns 决定，
 * 里面元素写 width 只是溢出，不会撑开列。
 *
 * 所以给这类行一个修饰类，把第一列改成 auto —— 谁宽听谁的，
 * 三行的横条起点会因此不完全对齐，但换来看得清标签，值。
 * 若以后要两者兼得，得给整个 .rule-pv-body 用一个共享的列宽变量。
 */
.rule-pv-row.pv-wide {
  grid-template-columns: auto 1fr 74px;
}
.rule-pv-row.pv-wide .rule-pv-lv {
  white-space: nowrap;
}
.rule-pv-lv { font-size: 12px; color: var(--ink-3); }
.rule-pv-track {
  height: 6px;
  border-radius: 3px;
  background: var(--surface-3);
  overflow: hidden;
}
.rule-pv-track i {
  display: block;
  height: 100%;
  background: var(--brand);
  border-radius: 3px;
  transition: width 0.16s ease-out;
}
.rule-pv-amt {
  font-size: 12.5px;
  color: var(--ink);
  text-align: right;
  font-weight: 500;
}
.rule-pv-sum {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line-2);
  font-size: 12.5px;
  color: var(--ink-2);
  display: flex;
  align-items: baseline;
  gap: 7px;
}
.rule-pv-sum b { color: var(--brand); font-size: 14px; }

/* 折算明细按根节点分块。
 * 块之间必须有可见的间隔 —— 否则 B1 那块和 B2 那块看起来还是一张表，
 * 而「一张表就该有一个合计」的直觉正是上一版出错的根源。
 * 用一条实线 + 一点留白把它切开，视觉上明确「这是两笔独立的账」。 */
.sh-pv-block + .sh-pv-block {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line-2);
}

/* 销售视角：我自己那几个下级是谁。
 * 目的是说清「这个 30% 是每人各拿 30%，不是五个人平分」——
 * 光看一个输入框很容易误解成「分五份」。 */
.mine-kids {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line-2);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.mine-kids-k {
  font-size: 11.5px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}
.mine-kid {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--ink-2);
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
}
.mine-kid em {
  font-style: normal;
  font-size: 11px;
  color: var(--ink-3);
}
/* 销售视角那个输入框要窄一些：它在一张三等分的卡片里，
 * 用 .rule-input 的默认宽度会把右侧文字挤掉。 */
.mine-in { width: 108px; }
.mine-in input { text-align: right; }

/* ---------------- 返点设置页 ---------------- */

/* 当前生效的三个比例。
 * 用三等分的卡片而不是一行文字：这三个人是要横向比较的
 * （12 / 9 / 6 一眼看出递减），排成一行读起来更快。
 */
.rb-cur {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.rb-cur-item {
  background: var(--surface-2);
  border-radius: var(--r-md);
  padding: 12px 14px;
}
/* 未设的层级（比例 0）压暗：0% 和「没这一级」在业务上是两件事，
 * 但都不该和正常的数字抢注意力。
 */
.rb-cur-item.off { opacity: 0.55; }
.rb-cur-k { font-size: 11.5px; color: var(--ink-3); margin-bottom: 5px; }
.rb-cur-v {
  font-size: 21px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--brand);
}
.rb-cur-item.off .rb-cur-v { color: var(--ink-3); font-weight: 500; }
/* 卡片底部那行「实得 · 累计 12%」。
 * 和上面的大数字（实得）必须区分得开：
 * 大数字是「这一级真正拿到多少」，小字是「他在链条上的目标位置」。
 * 第一版这里只有大数字且写的是「累计应得」，与下方表单的「实际到手 3%」
 * 直接矛盾 —— 同一级两个数，读起来像系统算错了。
 */
.rb-cur-sub {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

/* 表单里「实得 3.00%」后面的「累计 12%」小字 */
.rule-real-sub {
  color: var(--ink-3);
  font-size: 11px;
  margin-left: 6px;
}

/* 保存按钮那一行。
 * 「历史佣金不动」那句提示跟在按钮右边而不是下方 ——
 * 它解释的正是「点下去会发生什么」，紧贴着按钮才读得懂；
 * 放到下面隔一行，就成了另一段孤立说明。
 */
.rb-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* ---------------- 返点设置 · 分成比例清单 ----------------
 *
 * 一人一行，左侧是树形缩进的名字，中间是输入框，右侧是折算结果。
 *
 * 为什么用固定的三列网格而不是流式布局：
 * 这一列输入框必须上下对齐成一条竖线。人对齐之后才能一眼扫出
 * 「B1 是 30、B1B1 是 50、B1B1B1 是空」，流式布局会让它们左右错开，
 * 扫视时得来回找。第三列定宽同理 —— 「留 13.1250%」和「不分给下级」
 * 长度差很多，不定宽就会推着中间那列左右晃。
 */
.sh-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sh-row {
  display: grid;
  /* 名字列吃掉剩余空间，输入框 110px 固定，折算列 150px 固定 */
  grid-template-columns: 1fr 110px 150px;
  align-items: center;
  gap: 12px;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  transition: background 0.12s;
}
/* 悬停高亮整行：这一行有三个可关注的元素（名字、输入框、折算），
 * 高亮整行才能让人确认「我改的是这一行」而不是「这一格」。 */
.sh-row:hover { background: var(--surface-2); }

.sh-name {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
/* .sh-code 是原来放编号的那一格（B1 / B1B1）。编号退出界面后这枚样式
 * 没人用了，但保留一条最低限度的定义以防别的页面还在引用 ——
 * 真的删掉后若还有残留引用，那边会退化成系统默认的等宽字体，
 * 看起来像样式丢了而不是「编号没了」。 */
.sh-code {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
/* 名字现在是行首主字段（原来编号在主位） */
.sh-dn {
  font-size: 13px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 层级跟在名字后面当注脚：缩进表达层级只在同屏对比时有效，
 * 单独看一行还是需要有字。 */
.sh-lv {
  font-size: 11px;
  color: var(--ink-3);
  flex: none;
}
/* 叶子节点（没有下级）的提示。
 * 这个标记不是装饰：给叶子节点填分成比例不会有任何效果，
 * 不标出来的话管理员会填一个数、等下级拿钱、然后来问为什么没到账。
 */
.sh-leaf {
  font-size: 11px;
  color: var(--ink-3);
  background: var(--surface-3);
  border-radius: 3px;
  padding: 1px 5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.sh-in input { text-align: right; }

.sh-real {
  font-size: 12px;
  color: var(--ink-3);
  white-space: nowrap;
  text-align: right;
}
.sh-real b {
  color: var(--ink);
  font-family: var(--mono);
  font-weight: 600;
}
.sh-real .dim { color: var(--ink-3); }

@media (max-width: 720px) {
  .rb-cur { grid-template-columns: 1fr; }
  /* 窄屏时把折算列折到下一行。
   * 硬塞三列会让输入框窄到只能看见两位数，
   * 比换行更难用。 */
  .sh-row {
    grid-template-columns: 1fr 96px;
    row-gap: 6px;
  }
  .sh-real {
    grid-column: 1 / -1;
    text-align: left;
    padding-left: 4px;
  }
}

/* 佣金结构卡片底部的「默认 / 自定」标识 */
.rule-src {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

/* ================= 邀请码 ================= */

/* 「我的邀请码」：整页最上面那块，要一眼看到码本身。
   用品牌浅色底 + 左侧粗边，和下面的白卡片区分开，
   不用卡片因为它不是「一块内容」，而是「一个待复制的值」。 */
.inv-mine {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 20px;
  margin-bottom: 14px;
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  border-left: 4px solid var(--brand);
  border-radius: var(--r-md);
}
.inv-mine.off {
  background: var(--surface-2);
  border-color: var(--line);
  border-left-color: var(--ink-3);
}
.inv-mine-l { flex: 1; min-width: 0; }
/* 右侧操作区：复制 + 换码两个按钮上下叠。
 * 必须给统一宽度 —— 两个按钮文字长短不同，各自撑开会一宽一窄，
 * 右边这一整块看着参差不齐。
 * 148px 是「发给对方，他注册后填一下即可」在 11.5px 下刚好一行放下的宽度；
 * 132px 时它会被挤成两行，「一下即可」孤零零挂在第二行，很难看。
 */
.inv-mine-r { flex: none; text-align: center; width: 148px; }
.inv-mine-r .btn,
.inv-mine-r .btn-ghost { width: 100%; }
/* 换码按钮别和主按钮一样抢眼：它是低频操作，而且点了会让旧码失效。 */
.inv-mine-r #btnNewInvite {
  margin-top: 8px;
  background: transparent;
  border: 1px solid var(--brand-line);
  color: var(--brand);
}

.inv-label {
  display: flex;
  align-items: center;
  font-size: 12px;
  color: var(--ink-2);
  margin-bottom: 6px;
}

/* 邀请码本体：等宽 + 大字 + 字距拉开。
   这不是装饰 —— 码要被念出来、抄下来、手打进手机，
   字距不够时 4-4 的分组看不出边界，抄错概率明显变高。 */
.inv-code {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--brand);
  line-height: 1.25;
  word-break: break-all;
}
.inv-none {
  font-size: 15px;
  color: var(--ink-3);
  line-height: 1.6;
}

.inv-meta {
  margin-top: 7px;
  font-size: 12px;
  color: var(--ink-2);
}
.inv-meta b { color: var(--ink); font-weight: 600; }

/* 「不限次数」原本只是一段同色小字，扫一眼分不出它和「已用 2 次」的区别。
 * 这两种情况的运营后果完全不同（一个要盯着余量、一个随便发），所以要区分开。
 *
 * 一开始试过浅蓝胶囊，但卡片本身就是浅蓝底（--brand-soft），胶囊几乎看不见，
 * 只剩蓝字，白白多了 8px 内边距。既然文字上色已经足够区分，就不要再套胶囊，
 * 只留颜色 + 字重，保持和「已用 2 次」同一行基线。
 */
.inv-free {
  color: var(--brand);
  font-weight: 600;
}

/* 列表里的码：小一号，等宽，便于竖向对齐比对 */
.inv-mini {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: var(--ink);
  white-space: nowrap;
}

/* 状态点。用带点的胶囊而不是纯文字，
   因为一眼扫一列时要能快速分出「可用/不可用」两堆。 */
.inv-st {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  white-space: nowrap;
}
.inv-st::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.inv-st.on { color: var(--down); }
.inv-st.warn { color: var(--warn); }
.inv-st.off { color: var(--ink-3); }

/* 兑换框：输入框和按钮同一行，按钮不换行 */
.redeem-box {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.redeem-input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0.1em;
  color: var(--ink);
  outline: none;
  text-transform: uppercase;
}
.redeem-input::placeholder {
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-3);
}
.redeem-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.redeem-box .btn {
  flex: none;
  height: 40px;
  padding: 0 20px;
}

/* 复制成功后按钮变绿，给一个明确的完成信号 */
.btn.done {
  background: var(--down);
  border-color: var(--down);
}

/* ================= 人员备注 ================= */

/* 备注正文列：限宽 + 自动折行。
   不设 max-width 的话，一句长备注会把「最后修改」那列挤到看不见，
   而那一列恰恰是判断「这条还准不准」的关键。 */
.note-cell {
  max-width: 420px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.65;
  font-size: 12.5px;
  color: var(--ink);
}

/* ==================== 客户页（合并模块） ==================== */

/* 整行可点 → 打开右侧详情抽屉。
 *
 * 只改 hover 背景和 cursor，不加下划线也不给整行加边框 ——
 * 表格里每一行都加装饰会让整张表变成一堆框，
 * 反而看不出「这行可以点」。cursor 是这里最有效的信号。 */
.cust-table tr.clickable { cursor: pointer; }
.cust-table tr.clickable:hover td { background: var(--surface-2); }
/* 无归属行本来就是灰底，hover 要再深一档，否则看不出鼠标停在哪 */
.cust-table tr.row-unbound { cursor: pointer; }
.cust-table tr.row-unbound:hover td { background: var(--surface-3); }

/* 备注列：列表里只给缩略，全文在抽屉里看。
 * 这一列对销售完全不画（不是画成空），销售也就不知道有备注这回事。 */
.cust-table .note-cell {
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
}
/* 有备注时前面一个小圆点：让人一眼扫出「这个人被记过什么」，
 * 不用逐行读文字。颜色用 warn（内部信息），不用 brand ——
 * 它不是「重要」，而是「有留痕」。 */
.note-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--warn);
  margin-right: 6px;
  vertical-align: middle;
}

/* 归属总览：内容已在卡片里，这里只补一行汇总和左侧缩进 */
.cust-overview .card-head { border-bottom: 0; }
.ov-sum {
  font-size: 12.5px;
  color: var(--ink-3);
  padding: 0 18px 12px;
  margin-top: -4px;
}
/* 概览展开后树是嵌在卡片里的，去掉它自带的圆角和外边距，
 * 否则会出现「卡片里套一张卡片」的双层边框。 */
.cust-overview .tree { border-radius: 0; }

/* 备注弹窗里的「这是谁」——放在最上面，防止备注打错人 */
.note-who {
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 13px;
  line-height: 1.6;
}

.note-area {
  width: 100%;
  min-height: 108px;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink);
  outline: none;
  resize: vertical;
}
.note-area:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

/* 字数计数靠右，和「清空即删除」的说明同一行 */
.note-count {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--ink-3);
}

/* 窄屏：邀请码那块从横排改竖排，否则码和按钮会互相挤 */
@media (max-width: 760px) {
  .inv-mine { flex-direction: column; align-items: flex-start; gap: 14px; }
  .inv-mine-r { text-align: left; }
  .inv-code { font-size: 22px; }
  .redeem-box { flex-direction: column; }
  .redeem-box .btn { width: 100%; }
  .note-cell { max-width: none; }
}

/* ==================== 佣金页：算法说明 ====================
 *
 * 这一块回答「佣金明细是什么」—— 用户看着一屏数字不知道它们从哪来。
 * 做成可折叠：第一次会想看，第十次看是负担。
 */
.explain-card .card-head { border-bottom: 0; }
.explain { padding: 0 18px 18px; font-size: 13px; line-height: 1.75; color: var(--ink-2); }
.explain p { margin: 0 0 10px; }
.explain p b { color: var(--ink); font-weight: 600; }

/* 算式区：左侧层级名、中间实得比例、右侧公式。
 * 三列对齐，让「越往下比例越低」这件事一眼能看出来 ——
 * 只写文字的话读者得自己在脑子里排序。 */
.explain-calc {
  background: var(--surface-2);
  border-radius: var(--r-md);
  padding: 4px 0;
  margin: 12px 0;
  overflow: hidden;
}
.explain-row {
  display: grid;
  grid-template-columns: 150px 68px 1fr;
  align-items: baseline;
  gap: 10px;
  padding: 8px 14px;
  font-size: 12.5px;
}
.explain-row.zero { opacity: 0.5; }
.ex-lv { color: var(--ink); }
.ex-rate {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--up);
  font-variant-numeric: tabular-nums;
}
.ex-formula { font-size: 11.5px; }
/* 合计单独一行、加深底色：它是这张小表的结论，
 * 和上面三行「各自拿多少」不是同一层级的信息。 */
.explain-sum {
  padding: 9px 14px;
  background: var(--surface-3);
  font-size: 12.5px;
  color: var(--ink);
  border-top: 1px solid var(--line);
}
.explain-sum .dim { font-size: 11.5px; }

/* 「本单 N 人分」角标：一单分给多个人时挂在订单号后面。
 * 用它而不是在表里加一列，是因为它不是每行都有的属性 ——
 * 为一列偶尔出现的标记新加一整列，大部分格子会是空的。 */
.split-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  font-size: 10px;
  border-radius: 3px;
  background: var(--brand-soft);
  color: var(--brand);
  border: 1px solid var(--brand-line);
  vertical-align: middle;
}

@media (max-width: 720px) {
  /* 窄屏把三列压成两行：层级+比例一行，公式换到下面。
   * 强行保留三列会让公式那一列只剩几个字宽，读起来全是省略号。 */
  .explain-row {
    grid-template-columns: 1fr auto;
    row-gap: 2px;
  }
  .ex-formula { grid-column: 1 / -1; }
}

/* ---------------------------- 折扣管理（分销管理 · 折扣管理） ----------------------------
 *
 * 表单排一行、标签在左、控件在右：相比竖排表单，横向排布让三个字段
 * 一次看全，填完一眼能确认「节点、比例、备注」都对 —— 竖排时
 * 备注框会把比例框挤出视野，改完折扣看不到自己改的是哪个节点。
 * 窄屏自动折行（见文件末尾 media query）。
 */
.disc-form {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}
.disc-form .field { margin-bottom: 0; }
/* 节点选择器权限不同宽度差异很大（平台可能有几十个节点），
 * 给一个下限而不是固定宽度，避免长名字被截成「B1 / B1...」 */
.disc-node { flex: 1 1 260px; min-width: 200px; }
.disc-node .select { width: 100%; }

/* 折扣比例框：宽度固定。
 * 这里最多四位数（100），宽度不跟着内容变，右边的 % 才不会游走。 */
.disc-bp { flex: 0 0 128px; }
.dc-bp-wrap { position: relative; }
.dc-bp-wrap input { padding-right: 30px; text-align: right; font-family: var(--mono); }
.dc-bp-unit {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12.5px;
  color: var(--ink-3);
  pointer-events: none;
}

.disc-note { flex: 2 1 260px; min-width: 200px; }

/* 保存按钮和输入框底边对齐 —— 用 flex-end 对齐，不能加 padding-top 硬凑，
 * 一旦标签字重或行高变了，按钮就会浮起来或沉下去。 */
.disc-save { flex: none; }
.disc-save .btn { min-width: 96px; }

/* 常用折扣快捷键。
 * 存在的理由：折扣基本只在 95/90/85/80 这几个数上，每次手打容易打错位数
 * （80 打成 8 是这条业务线最容易犯的错，而它 100% 会算错佣金）。 */
.disc-quick {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
}
.disc-chip {
  padding: 3px 9px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: border-color 0.14s, color 0.14s, background 0.14s;
}
.disc-chip:hover {
  border-color: var(--brand-line);
  color: var(--brand);
  background: var(--brand-soft);
}

/* ---- 试算预览 ----
 * 填了比例才出现。空着时整块不占位（display:none），
 * 否则表单下面永远悬着一片空白，看着像还没加载完。
 */
.disc-prev { display: none; margin-top: 14px; }
.disc-prev.show {
  display: block;
  border: 1px solid var(--brand-line);
  border-radius: var(--r-md);
  background: var(--brand-soft);
  padding: 12px 14px;
}
.dp-head { font-size: 12.5px; color: var(--ink-2); margin-bottom: 9px; }
.dp-head b { color: var(--ink); font-variant-numeric: tabular-nums; }
.dp-row {
  display: grid;
  grid-template-columns: 62px 1fr auto auto;
  gap: 10px;
  align-items: baseline;
  padding: 5px 0;
  font-size: 12.5px;
  border-top: 1px solid rgba(29, 78, 216, 0.12);
}
.dp-row:first-of-type { border-top: 0; }
.dp-lv { color: var(--ink-2); font-weight: 500; }
.dp-base, .dp-rate { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.dp-amt {
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--up);
  font-weight: 600;
  text-align: right;
  min-width: 78px;
}
.dp-foot {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px dashed rgba(29, 78, 216, 0.2);
  font-size: 11.5px;
  color: var(--ink-3);
}

/* ---- 行内操作按钮 ----
 * 用文字链接而不是按钮：一行里可能同时有「改 / 停用 / 删除」三个，
 * 三个边框按钮挤在一起会让表格看起来比内容更重，
 * 满屏按钮也让人分不清哪个是这一行的主要动作。
 */
.row-acts { display: flex; gap: 10px; align-items: center; }
.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand);
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
}
.link-btn:hover { text-decoration: underline; }
.link-btn:disabled { color: var(--ink-3); cursor: not-allowed; text-decoration: none; }
.link-btn.danger { color: var(--up); }

@media (max-width: 860px) {
  /* 窄屏：比例和备注各占半行，保存按钮独占一行靠右。
   * 硬挤成一行会让备注框只剩几十像素，等于不能填。 */
  .disc-bp { flex: 1 1 120px; }
  .disc-note { flex: 1 1 100%; }
  .disc-save { flex: 1 1 100%; }
  .disc-save .btn { width: 100%; }
  .dp-row { grid-template-columns: 54px 1fr auto; }
  .dp-base { display: none; }
}

/* ---- 个人设置页（个人中心 / 个人设置） ----
 *
 * 弹窗里那套 .pf-id / .pf-avatar 是 40px 小头像、横向排一行，
 * 因为它只占弹窗顶部一条。页面版空间大得多，头像放到 52px，
 * 但仍然横向 —— 竖着堆会让人以为这是两行内容而不是「一个人的身份」。
 *
 * 上一轮加这个页面时漏了这几个类，页面上头像和名字挤成上下两行、
 * 表单输入框也没有宽度约束。这里补齐，并保持与弹窗版同一套视觉语言。
 */
.pf-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  margin-bottom: 16px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.pf-avatar.lg {
  width: 52px;
  height: 52px;
  font-size: 20px;
}

/* 改名表单：输入框和按钮同一行，底边对齐。
 * 用 align-items:center 而不是 flex-end —— 输入框和按钮等高（42px），
 * 居中就是底边对齐，而 flex-end 在字号变化时会先坏。 */
.pf-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.pf-form input {
  flex: 1 1 240px;
  min-width: 180px;
  height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: 14px;
  color: var(--ink);
  font-family: inherit;
  outline: none;
  transition: border-color 0.14s, box-shadow 0.14s;
}
.pf-form input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.09);
}
.pf-form .btn { flex: none; min-width: 88px; }

@media (max-width: 640px) {
  .pf-form .btn { flex: 1 1 100%; }
  .pf-card { flex-wrap: wrap; }
}

/* ============================================================================
 * 修改密码表单
 *
 * 和上面的「改名」刻意用两套版式：改名是「一个值换一个值」，横排一排就够；
 * 改密码是「旧 → 新 → 再确认」，是三步有先后的动作，竖排才能让人
 * 顺着往下填。三个框横着并排时，第二个和第三个填反是极常见的错误 ——
 * 填反了提交上去只会得到「两次不一致」，白跑一次。
 *
 * 标签用固定左栏（110px）而不是顶部：三项的标签长度差得多
 * （「当前密码」4 字 /「确认新密码」5 字），顶对齐会让输入框左边缘参差。
 * 固定栏宽 + 输入框 flex 撑满，三行左边缘齐得像一张表。
 * ========================================================================== */
.pf-pw {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 460px;
}
.pf-pw-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.pf-pw-row > label {
  flex: none;
  width: 84px;
  font-size: 13px;
  color: var(--ink-2);
  text-align: right;
}
.pf-pw-row > input {
  flex: 1 1 auto;
  min-width: 0;
  height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: 14px;
  color: var(--ink);
  font-family: inherit;
  outline: none;
  transition: border-color 0.14s, box-shadow 0.14s;
}
.pf-pw-row > input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.09);
}
/* 按钮右对齐到输入框左边缘，跟上面的输入框对齐，不跟着标签栏跑 */
.pf-pw-act {
  display: flex;
  margin-top: 14px;
  padding-left: 96px; /* 84 标签 + 12 间距 */
}
.pf-pw-act .btn { min-width: 112px; }

@media (max-width: 640px) {
  /* 手机上标签右对齐会挤掉输入框宽度，改成顶对齐更省地方 */
  .pf-pw-row { flex-direction: column; align-items: stretch; gap: 6px; }
  .pf-pw-row > label { width: auto; text-align: left; }
  .pf-pw-act { padding-left: 0; }
  .pf-pw-act .btn { width: 100%; }
}

/* ============================================================================
 * 列表版式：统计卡 / 标签页 / 筛选条 / 头像 / 分页
 *
 * 这一套是「会员列表」和「分销成员」两页共用的版式语言。
 * 单独成段而不是散落到各个页面下面，是因为这五个组件的间距是一套的：
 * 统计卡下 16px、标签页下 0、筛选条内嵌在表格卡片顶部 ——
 * 拆开写最容易出现「这页 14px 那页 16px」，整站看起来像两个人做的。
 * ========================================================================== */

/* ---------------- 统计卡 ----------------
 * 效果图是无边框浅灰底。不用白底带边框（.metric）是因为这几张卡
 * 只是下面那张表格的摘要，抢了边框就会和表格抢视觉重量。
 */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.stat-row.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1000px) { .stat-row, .stat-row.three { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .stat-row, .stat-row.three { grid-template-columns: 1fr; } }

.stat-card {
  background: var(--surface-2);
  border-radius: var(--r-md);
  padding: 15px 16px 14px;
  min-width: 0;
}
.stat-card.hl { background: var(--brand-soft); }
.stat-card .sc-k {
  font-size: 12px;
  color: var(--ink-2);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-card .sc-v {
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.026em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-card.hl .sc-v { color: var(--brand); }
.stat-card .sc-x {
  margin-top: 7px;
  font-size: 11.5px;
  color: var(--ink-3);
  min-height: 17px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.stat-card .sc-delta { font-weight: 500; font-variant-numeric: tabular-nums; flex: none; }
.stat-card .sc-delta.up { color: var(--up); }
.stat-card .sc-delta.down { color: var(--down); }
.stat-card .sc-delta.flat { color: var(--ink-3); }
/* hint 必须写 min-width:0 —— flex 子项的默认最小宽度是内容宽度，
 * 光有 overflow:hidden + text-overflow 不会生效，文本照样把卡片撑开
 * 或者被硬切掉（第一版「全部有归属」就被切成了「全部有归」）。
 */
.stat-card .sc-hint {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* ---------------- 标签页 ----------------
 * 下边框贯穿整条，当前项用 2px 蓝线压住它 —— 这是「页签」而不是「按钮组」：
 * 按钮组是各自独立的块，页签是同一张卡片的几个切面。
 */
.tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  padding: 11px 14px 10px;
  border: 0;
  background: none;
  color: var(--ink-2);
  font-size: 13.5px;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.14s, border-color 0.14s;
}
.tab:hover { color: var(--ink); }
.tab.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 500; }
.tab .tab-n {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 9px;
  background: var(--surface-3);
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 500;
  line-height: 17px;
  vertical-align: 1px;
}
.tab.on .tab-n { background: var(--brand-soft); color: var(--brand); }

/* ---------------- 筛选条 ----------------
 * 直接内嵌在表格卡片里（顶部），所以自己不画边框、不加圆角 ——
 * 外面那层 card 已经有了，再套一层会变成「卡片里的卡片」。
 */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.fb-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.fb-l {
  font-size: 11.5px;
  color: var(--ink-3);
  white-space: nowrap;
}
.fb-item input,
.fb-item select {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: 13px;
  color: var(--ink);
  font-family: inherit;
  outline: none;
  transition: border-color 0.14s, box-shadow 0.14s;
  min-width: 132px;
}
.fb-item input::placeholder { color: var(--ink-3); }
.fb-item input:focus,
.fb-item select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.09);
}
.fb-acts {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding-bottom: 1px;
}
.btn-main {
  height: 32px;
  padding: 0 16px;
  border: 1px solid var(--brand);
  border-radius: var(--r-sm);
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  transition: opacity 0.14s;
}
.btn-main:hover { opacity: 0.9; }

/* ---------------- 头像 ---------------- */
.ava {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 600;
  flex: none;
  user-select: none;
  letter-spacing: 0;
  line-height: 1;
}
.ava.sm { width: 24px; height: 24px; font-size: 11px; }

/* 头像 + 名字的组合列。
 * 头像必须 flex:none —— 否则窄屏下它会被压成椭圆。
 */
.pcell {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.pcell .pcell-txt {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.35;
}
.pcell .pcell-n {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pcell .pcell-s {
  font-size: 11.5px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------------- 分页 ---------------- */
.pager {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-2);
  flex-wrap: wrap;
}
.pager .pg-total { font-variant-numeric: tabular-nums; }
.pager .pg-pos { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.pg-btns {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.pg-btn {
  min-width: 28px;
  height: 28px;
  padding: 0 7px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12.5px;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.pg-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
.pg-btn.on {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.pg-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pg-btn.pg-arrow { font-size: 14px; line-height: 1; }
.pg-gap { color: var(--ink-3); padding: 0 2px; user-select: none; }

/* ---------------- 表格里的行内文字动作 ---------------- */
.row-acts {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--brand);
  font-size: 12.5px;
  cursor: pointer;
  font-family: inherit;
}
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--up); }

/* 表格空态：占满一行、居中、不画 hover */
tr.row-empty td {
  text-align: center;
  color: var(--ink-3);
  font-size: 12.5px;
  padding: 34px 16px;
}
tr.row-empty:hover { background: none; }

/* 序号列：窄、灰、不参与排序的视觉暗示 */
th.col-idx, td.col-idx {
  width: 46px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* ---------------- 会员体系：分档面板 ----------------
 * 行式布局（标签 / 条形 / 人数 / 金额 / 占比），不是卡片网格。
 * 用行是因为五个字段要横向对齐才比得出来「哪档重哪档轻」；
 * 拆成卡片后每张卡各占一块，眼睛得来回跳着看。
 */
.lv-panel { padding: 6px 16px 4px; }
.lv-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.lv-row:last-child { border-bottom: 0; }
.lv-row.unbound { opacity: 0.85; }
.lv-name { width: 76px; flex: none; }
.lv-bar {
  flex: 1 1 auto;
  min-width: 60px;
  height: 6px;
  border-radius: 3px;
  background: var(--surface-3);
  overflow: hidden;
}
.lv-fill {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--brand);
  transition: width 0.3s ease;
}
.lv-row.unbound .lv-fill { background: var(--line-2); }
.lv-n {
  width: 56px;
  flex: none;
  text-align: right;
  font-size: 12.5px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.lv-paid {
  width: 108px;
  flex: none;
  text-align: right;
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.lv-pct {
  width: 52px;
  flex: none;
  text-align: right;
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 720px) {
  .lv-paid { width: 84px; }
  .lv-row { gap: 9px; }
}

/* ---------------- 邀请卡片 ----------------
 * 左：码 + 链接 + 复制；中：二维码；右：四段漏斗。
 * 三段横排而不是上下堆，是因为这三样东西是「同一个邀请动作」的三种表达，
 * 竖排会让人以为要先做上面的再做下面的。
 */
.invite-card {
  display: flex;
  align-items: stretch;
  gap: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px 18px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.ic-left { flex: 1 1 260px; min-width: 0; }
.ic-t {
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 9px;
}
.ic-code {
  font-size: 12.5px;
  color: var(--ink-2);
  margin-bottom: 9px;
}
.ic-code b {
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.06em;
  color: var(--ink);
}
.ic-new {
  margin-left: 8px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 11px;
}
.ic-link {
  display: flex;
  gap: 8px;
  align-items: center;
}
.ic-link input {
  flex: 1 1 auto;
  min-width: 0;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: 12px;
  color: var(--ink-2);
  font-family: var(--mono);
  outline: none;
}
.ic-none {
  font-size: 12.5px;
  color: var(--ink-3);
  padding: 8px 0;
}
.ic-mid {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}
.qr {
  width: 92px;
  height: 92px;
  display: block;
  border-radius: 4px;
}
.qr-none {
  width: 92px;
  font-size: 11px;
  color: var(--ink-3);
  text-align: center;
  line-height: 1.5;
}
.ic-right {
  flex: 1 1 300px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  align-content: center;
  min-width: 0;
}
.inv-step { min-width: 0; }
.inv-step .is-n {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.inv-step .is-l {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 1px;
  white-space: nowrap;
}
.inv-step .is-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--surface-3);
  margin-top: 7px;
  overflow: hidden;
}
.inv-step .is-bar span {
  display: block;
  height: 100%;
  background: var(--brand);
  border-radius: 2px;
}
@media (max-width: 860px) {
  .ic-mid { border: 0; padding: 0; }
  .ic-right { flex-basis: 100%; }
}

/* ---------------- 表格小结条 ---------------- */
.mini-sum {
  font-size: 12.5px;
  color: var(--ink-2);
  padding: 2px 0 12px;
}
.mini-sum b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------------- 弹窗小提示（替代 toast） ----------------
 * 原先打算用 toast，全站没有这个组件；这里做一个最轻的：
 * 底部中间浮一条，2 秒后自己消失，不阻塞任何操作。
 */
.toast-line {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%) translateY(8px);
  background: rgba(20, 26, 38, 0.93);
  color: #fff;
  font-size: 12.5px;
  padding: 8px 16px;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 9999;
  max-width: 80vw;
}
.toast-line.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ================================================================
 * 下级成员页（sub-*）
 *
 * 这一页的版式和别处不同：顶部是「概览卡 + 邀请卡」两栏，
 * 下面才是页签、批量条、宽表。所以类名统一加 sub- / ov- / iv- 前缀，
 * 避免和已有 .card / .tabs 的默认间距互相打架。
 *
 * 全站唯一的装饰性渐变就在 .ov-card 上 —— 它是这一页的落款，
 * 用一次是强调，用两次就是噪音。
 * ================================================================ */

.sub-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.sub-head h1 {
  font-size: 19px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.2px;
}
.sub-head .sub {
  font-size: 12.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.sub-head .grow { flex: 1; }

/* ---- ① 顶部两栏：左概览、右邀请 ----
 * 左宽右窄（1.45 : 1）。概览卡里有一个名字，需要横向空间；
 * 邀请卡里是一行链接，太宽反而显得空。
 */
.sub-top {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
  align-items: stretch;
}
@media (max-width: 1080px) {
  .sub-top { grid-template-columns: 1fr; }
}

/* ---- 概览卡（深色暖调渐变） ---- */
.ov-card {
  position: relative;
  border-radius: var(--r-lg);
  padding: 20px 22px 18px;
  color: #fff;
  background: linear-gradient(135deg, #8f4425 0%, #6d2f16 52%, #4f2110 100%);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 168px;
}
/* 右上角一圈极淡的径向光，让纯色渐变不至于像一块塑料板。
 * 用伪元素而不是再加一个 div：它纯装饰，不该进 DOM。 */
.ov-card::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -80px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.13), transparent 68%);
  pointer-events: none;
}
.ov-card-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  position: relative;
  z-index: 1;
}
.ov-title {
  font-size: 14.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.1px;
}
.ov-chip {
  font-size: 10.5px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  letter-spacing: 0.2px;
}
.ov-ico {
  margin-left: auto;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex: none;
}
.ov-desc {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.72);
  max-width: 34em;
  position: relative;
  z-index: 1;
}
.ov-label {
  margin-top: auto;
  padding-top: 18px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.6);
  position: relative;
  z-index: 1;
}
.ov-name {
  margin-top: 3px;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.3px;
  position: relative;
  z-index: 1;
  word-break: break-all;
}
/* 概览卡底部：左边数字、右边动作。
 *
 * 原来叫 .ov-foot，只有三个数字。现在右下角多了一个「+ 发展下级」
 * 按钮，这行的职责从「罗列」变成「罗列 + 动作」，名字跟着改。
 *
 * 按钮贴右边用的是 margin-left:auto 而不是 justify-content:space-between：
 * 后者在只有两个数字时会把它们挤到卡片两端，中间空出一大片。
 * auto 只推最后一个元素，前面几个照常左对齐挨着排。
 */
.ov-acts {
  margin-top: 16px;
  padding-top: 13px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  display: flex;
  /* gap 从 22 收到 14：原来只有三个数字，松一点好看；
   * 现在末尾多了一个按钮，22 的间距会把按钮挤到下一行 ——
   * 截图确认过，两个数字 + 按钮在 512px 宽的卡里差十几像素放不下，
   * 按钮于是掉到第二行，看着像两个不相干的东西。
   */
  gap: 14px;
  align-items: center;
  /* 不换行：这一行现在是「数字 + 动作」的组合，
   * 拆成两行就读不出「这 4 个人，再发展一个」的关系了。
   * 真放不下的窄屏由下面 @media 兜底（按钮独占一行、左对齐）。
   */
  flex-wrap: nowrap;
  position: relative;
  z-index: 1;
}
/* 动作按钮。卡片是深色渐变底，所以用「半透明白底 + 白字」而不是
 * 全站的品牌蓝 —— 蓝底压在橙棕渐变上会脏，也抢掉这张卡的落款感。
 * 描边式（只给 border）在深底上又太弱，看不清那是个按钮。
 */
.ov-add {
  margin-left: auto;
  flex: none;
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s;
}
.ov-add:hover {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.5);
}
.ov-add:active { transform: translateY(0.5px); }
/* 卡片窄到真的放不下时（<720px）才允许换行，按钮独占一行、左对齐。
 * 换行在这个宽度下是「本来就该换」，不是「差几像素被挤下去」。
 */
@media (max-width: 720px) {
  .ov-add { margin-left: 0; }
  .ov-acts { flex-wrap: wrap; }
}
.ov-meta {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.72);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
/* 段前小圆点：ios 用 i 标签做纯装饰，语义上没有意义 */
.ov-meta i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  flex: none;
}
.ov-meta b {
  color: #fff;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---- 邀请卡（白底） ---- */
.inv-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  min-height: 168px;
}
.iv-head {
  display: flex;
  gap: 11px;
  align-items: flex-start;
}
.iv-ico {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--brand-soft);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex: none;
}
.iv-t {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
}
.iv-d {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 2px;
  line-height: 1.5;
}
.iv-acts {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.iv-pill {
  border: 1px solid var(--brand-line);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.14s;
}
.iv-pill:hover { background: #dde8fd; }
.iv-code {
  font-size: 12px;
  color: var(--ink-3);
}
.iv-code b {
  color: var(--ink);
  font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-weight: 600;
  letter-spacing: 0.4px;
}
.iv-d2 {
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.5;
}
.iv-link { margin-top: 7px; }
.iv-link input {
  width: 100%;
  box-sizing: border-box;
  font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 11.5px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--ink-2);
  text-overflow: ellipsis;
}
.iv-link input:focus {
  outline: none;
  border-color: var(--brand-line);
  background: var(--surface);
}
/* 拿不到邀请码时：说明「为什么没有」，不是空白一块 */
.iv-none {
  margin-top: 14px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-3);
  background: var(--surface-2);
  border-radius: var(--r-sm);
  padding: 12px 14px;
}

/* ---- ② 页签 + 搜索 ---- */
.sub-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.sub-tabs {
  margin-bottom: 0;
  border-bottom: none;
}
.sub-search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sub-search input {
  width: 240px;
  font-size: 12.5px;
  padding: 7px 11px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
}
.sub-search input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
@media (max-width: 720px) {
  .sub-search { margin-left: 0; width: 100%; }
  .sub-search input { flex: 1; width: auto; }
}

.sub-card {
  border-radius: var(--r-lg);
  overflow: hidden;
}

/* ---- ③ 批量工具条 ---- */
.sub-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.sub-btn {
  font-size: 12px;
  padding: 5px 11px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.14s, border-color 0.14s;
}
.sub-btn:hover {
  background: var(--surface-3);
  border-color: var(--ink-3);
}
/* 主按钮变体：下级销售表头上那个「+ 发展下级」。
 *
 * 那一条里只有它一个按钮，其余都是文字（「下级销售 4 人」）。
 * 不做成主色的话，它和客户表上方那排灰色工具条按钮长得一模一样，
 * 用户会以为它是又一个筛选开关。主色是在说「这个是动作，不是状态」。
 */
.sub-btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 500;
}
.sub-btn.primary:hover {
  background: var(--brand-2, var(--brand));
  border-color: var(--brand-2, var(--brand));
  filter: brightness(1.06);
}
.sub-picked {
  margin-left: auto;
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* ---- ④ 宽表 ---- */
.sub-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.sub-table thead th {
  text-align: left;
  font-weight: 500;
  font-size: 11.5px;
  color: var(--ink-3);
  padding: 10px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.sub-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  color: var(--ink);
}
.sub-table tbody tr:last-child td { border-bottom: none; }
.sub-table tbody tr.clickable { cursor: pointer; }
.sub-table tbody tr.clickable:hover td { background: var(--surface-2); }
.sub-table th.num, .sub-table td.num { text-align: right; }
.sub-table .col-chk {
  width: 40px;
  padding-left: 16px;
  padding-right: 0;
}
.sub-table .col-chk input {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: var(--brand);
  margin: 0;
  vertical-align: middle;
}
.sub-table .col-person { min-width: 200px; }

/* ---- 分区（下级销售 / 客户） ----
 *
 * 这一页现在有两张表：人是人，客户是客户，各自一张表头。
 * 分区标题是**必须的**，不只是装饰 —— 两张表都没有「类型」列，
 * 没有这个小标题，销售节点行和客户行在视觉上是一模一样的两种东西
 * （都带头像、都有编号），扫一眼根本分不出哪行是谁。
 * 标题给了归属，就不必再往列里塞一个「类型」标签。
 */
.sub-sec + .sub-sec {
  border-top: 1px solid var(--line-2);
}
.sub-sec-h {
  display: flex;
  /* baseline 是为了让「下级销售」和「4 人」这两段字号不同的字对齐基线。
   * 但表头右侧多了一个按钮（+ 发展下级）之后，按钮也会跟着文字基线往下沉，
   * 看着像没对齐。所以按钮单独用 align-self:center 拉回来 ——
   * 改 align-items 会连带把两段文字的对齐也改掉，那是另一个坑。
   */
  align-items: baseline;
  gap: 6px;
  padding: 11px 16px 9px;
  font-size: 12px;
  color: var(--ink-2);
  letter-spacing: 0.02em;
  background: var(--surface);
}
.sub-sec-h .sub-btn { align-self: center; }
/* 表头里的撑开元素：把按钮推到最右。和 .grow 在全站的用法一致 */
.sub-sec-h .grow { flex: 1; }
.sub-sec-h b {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 13px;
  color: var(--ink);
  font-weight: 600;
}
.sub-sec-h .dim { font-size: 11.5px; }

/* 下级销售行：左侧一道极淡的品牌色竖标，和客户行区分开。
 * 只染色不换底色 —— 底色一换这张表就成了「重点区」，
 * 而它只是这页的另一半内容，不是更需要关注的东西。 */
.sub-node-table tbody tr.row-node td:first-child {
  box-shadow: inset 2px 0 0 var(--brand-line);
}
.sub-node-table tbody tr.row-node:hover td { background: var(--surface-2); }
.sub-node-table tbody tr.row-me td { background: var(--surface-2); }

/* 【.dbl / .dbl-a / .dbl-b 已删除】
 *
 * 它实现的是「充值 / 余额叠成一格上下两行」，用户要求改成两条独立的列，
 * 这三个类没有调用方了。
 *
 * 为什么不留着：留着它，下次有人觉得「两列太占宽度」时会拿起来复用，
 * 理由还是「以前就是这么写的」—— 于是刚刚修好的视读问题再犯一次。
 * 删掉比留注释更能表达「这条路走不通」。
 */

/* 非默认折扣：加粗 + 品牌色，让「这个人被单独设过价」一眼可见 */
.disc-on {
  color: var(--brand);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.sub-empty {
  padding: 56px 24px;
  text-align: center;
}
.se-t {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
}
.se-d {
  margin-top: 7px;
  font-size: 12px;
  line-height: 1.65;
  color: var(--ink-3);
  max-width: 46em;
  margin-left: auto;
  margin-right: auto;
}

/* ---- ⑤ 页脚 ---- */
.sub-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 16px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--ink-2);
}
.sf-total { font-variant-numeric: tabular-nums; }
.sf-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.sf-size {
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.sf-size select {
  font-size: 12px;
  padding: 3px 6px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink-2);
  font-family: inherit;
  cursor: pointer;
}

/* 页脚里的 pager 已经是 .sub-foot 的一部分，
 * 去掉它自带的上边框和内边距，避免两条分隔线叠在一起。
 */
.pager.bare {
  padding: 0;
  border-top: none;
}

/* 宽表列宽：让「成员」吃掉剩余空间，其余列按内容固定。
 * 不这么写的话，浏览器会把各列平均分，成员名被压成两行、
 * 而「已启用」这种三个字的一列却占了同样宽度。
 *
 * 【列数变过两次，这里的注释跟着改，别再当成 9 列数】
 * 当前是 9 列（勾选 / 成员 / 层级 / 状态 / 累计充值 / 账户余额 /
 * 剩余积分 / 归属上级 / 操作）——「充值 / 余额」拆成两列之后多了一列，
 * 所以第 5 列之后的下标全部往后挪了一位。
 * 拆列时最容易忘的就是这段：表格看着对，但列宽错位，
 * 金额那一列被压得换行，而「操作」却宽得能放下两行字。
 */
.sub-table col.c-chk,
.sub-table .col-chk { width: 40px; }
.sub-table th:nth-child(2) { width: 24%; }   /* 成员 */
.sub-table th:nth-child(3) { width: 72px; }  /* 层级 */
.sub-table th:nth-child(4) { width: 82px; }  /* 状态 */
.sub-table th:nth-child(5) { width: 118px; } /* 累计充值 */
.sub-table th:nth-child(6) { width: 116px; } /* 账户余额 */
.sub-table th:nth-child(7) { width: 92px; }  /* 剩余积分 */
.sub-table th:nth-child(8) { width: 132px; } /* 归属上级 */
.sub-table th:nth-child(9) { width: 112px; } /* 操作 */

/* 金额两列：等宽数字 + 不换行。
 *
 * 拆成两列之后，金额列比原来的合并格窄了不少，
 * 而「¥12,345.00」在比例字体 + 允许换行的情况下会被折成两行
 * （「¥12,345.0」/「0」），这是最难被发现的一种排版错 ——
 * 页面不报错、检查元素也对，只是数字少了一截。
 *
 * tabular-nums 是另一件事：这一列要能纵向比大小，
 * 等宽数字才能让小数点对齐成一列。
 */
.sub-table td.money {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.sub-table td.money b { font-weight: 600; }

/* 金额两列再往内收一点，把「充值 + 余额」攒成一组。
 *
 * 拆列之后这两列都是右对齐的，右对齐会在两列之间留下一段空白，
 * 而这段空白和「余额 → 积分」之间的空白几乎一样宽 ——
 * 于是三个数字等距排开，看起来像三个并列的指标，
 * 而实际上前两个是「充了多少 / 还剩多少」（同一件事的两面），
 * 第三个是积分（另一种量纲）。
 *
 * 只收右内边距（不是加 margin）：table-layout: fixed 下
 * margin 会把列撑宽、导致后面所有列错位；padding 不会。
 */
.sub-table th:nth-child(5),
.sub-table td:nth-child(5) { padding-right: 6px; }
.sub-table th:nth-child(6),
.sub-table td:nth-child(6) { padding-left: 6px; padding-right: 16px; }

/* 积分数字：等宽数字 + 稍重的字重。
 * 这一列要能纵向扫读比较大小，比例字体下「1」和「8」宽度不同，
 * 数字没法对齐成柱状，读起来要一行行重新找小数点。
 */
/* 积分数字：等宽数字 + **不加重**。
 *
 * 【这里原来是 font-weight: 500，改成 400 了】
 * 拆列之后「剩余积分」紧邻「账户余额」，而它原来和金额一样深、一样重，
 * 49,375 摆在 ¥1,777.50 右边，扫一眼就会被读成「余额 ¥49,375」——
 * 因为人眼会把同一行里视觉重量相同的数字归成一组。
 *
 * 积分是另一种量纲（不是钱），它必须在视觉上退一档，
 * 否则再多的表头文字也拦不住误读 —— 表头只在最上面出现一次，
 * 而数字是每一行都出现的。
 *
 * 但仍然保留 tabular-nums：这一列要能纵向比大小，
 * 等宽数字才能对齐成柱状，读起来不用一行行重新找数字开头。
 */
.sub-table .pts-v {
  font-variant-numeric: tabular-nums;
  font-weight: 400;
  color: var(--ink-2);
}

/* 窄屏下让表格横向滚动，而不是把每列都压到读不了 */
.sub-card { overflow-x: auto; }
@media (max-width: 900px) {
  .sub-table { min-width: 940px; }
}

/* 页脚里的分页：允许整块被挤压的是外框，不是按钮本身。
 * 不加这几条时，页码会被 flex 压成一个细长条（数字都看不见）。
 */
.sub-foot .sf-right { flex: none; }
.sub-foot .pager.bare { flex: none; padding: 0; }
.sub-foot .pager.bare .pg-btns { flex: none; margin-left: 0; }
.sub-foot .pg-btn { flex: none; }

/* 固定列宽布局：auto 布局下 width 只是「建议」，浏览器仍会按内容
 * 重新分配，结果就是上面 nth-child 设的宽度全被忽略。
 * fixed 之后列宽才真的按设定走，成员列也能稳定占住 30%。
 */
.sub-table { table-layout: fixed; }
.sub-table td { overflow: hidden; }

/* ---- 微调（按实际截图调整，不是猜的） ----
 * ① 成员列：30% 在 1120 宽下只够「客户丙（挂二级」这种半截名字，
 *    提到 33%，并把「归属上级」收窄 —— 上级名字一般比客户名短。
 * ② 操作列：「详情 / 解除」两个链接在 118px 里挤成「详情解除」，
 *    加 gap 并放宽到 132px（= 详情 26 + gap 12 + 解除 26 + 内边距）。
 *
 * 【下标全部往后挪了一位，因为「充值 / 余额」拆成了两列】
 * 拆列前：… 4 状态 / 5 充值余额 / 6 积分 / 7 归属 / 8 操作
 * 拆列后：… 4 状态 / 5 充值 / 6 余额 / 7 积分 / 8 归属 / 9 操作
 *
 * 这一段里的 td:nth-child(8) .row-acts 原本是给「操作」列加 gap 的，
 * 拆列后 nth-child(8) 指到了「归属上级」——那一列里没有 .row-acts，
 * 选择器落空、gap 静默失效，「详情解除」又贴在一起。
 * 这类错最容易漏：页面不报错、元素也在，只是看起来紧了点。
 * 所以凡是按列下标写样式的地方，加列时必须一起改。
 */
.sub-table th:nth-child(2) { width: 33%; }
.sub-table th:nth-child(5) { width: 122px; }
.sub-table th:nth-child(6) { width: 128px; }
.sub-table th:nth-child(7) { width: 96px; }
.sub-table th:nth-child(8) { width: 132px; }
.sub-table td:nth-child(9) .row-acts {
  gap: 14px;
  white-space: nowrap;
}

/* 概览卡说明文字：0.72 的白在深棕底上对比不足，
 * 提到 0.8 才到「看得清但不抢」的程度。 */
.ov-desc { color: rgba(255, 255, 255, 0.8); }

/* 表格里的成员名允许一行省略，不要折成两行把行高撑起来 */
.sub-table .pcell-n,
.sub-table .pcell-s {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ================================================================
 * 个人设置里的邀请码区块（pf-sub / pf-table）
 *
 * 邀请码页并进个人设置后，这一页从「两张卡」变成「三块内容」：
 * 改名、邀请码、账号信息。邀请码这一块内部还要再分
 * 「我的码 / 我填的码 / 谁用我的码进来的」三个小节。
 *
 * 不再用 <div class="card"> 一层层套 —— 那会让页面变成
 * 卡片里长卡片，边框越描越多。改成一个大卡里用 pf-sub 分小节，
 * 小节之间只用一条极淡的分隔线，靠标题字号区分层级。
 * ================================================================ */

.pf-sub {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.pf-sub:first-child {
  /* 紧挨着 card-body 顶部的第一个小节不需要分隔线，
   * 否则卡片上边框和这条线之间只有 20px，看起来像双线 */
  margin-top: 4px;
  padding-top: 0;
  border-top: none;
}
.pf-sub > h3 {
  display: flex;
  align-items: center;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  margin: 0 0 11px;
  letter-spacing: 0.1px;
}

/* 个人设置里的表格比全站默认表格更紧凑 ——
 * 它嵌在卡片里，行高沿用 40px 会显得松垮。
 */
.pf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.pf-table thead th {
  text-align: left;
  font-weight: 500;
  font-size: 11.5px;
  color: var(--ink-3);
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.pf-table tbody td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.pf-table tbody tr:last-child td { border-bottom: none; }
.pf-table th.num, .pf-table td.num { text-align: right; }
.pf-table .col-person { min-width: 150px; }

/* 邀请码这一块里，兑换框和上面的「我的码」之间本来就该有距离，
 * 但 .redeem-box 自带 margin-top，加上 pf-sub 的 padding 会太松。
 */
.pf-invite .redeem-box { margin-top: 2px; }

/* ---- 个人设置里的邀请码表格：列宽与空态 ----
 *
 * ① 平台那张「全部邀请码」表，之前没约束列宽，浏览器把「已用」
 *    和「状态」两列拉得很开，「停用」按钮被推到最右边孤零零一个。
 *    给码和操作列固定宽度，剩下的宽度留给「归属」——
 *    那是唯一可能很长的内容（节点名）。
 *
 * ② 「通过邀请码进来的人」为空时，.empty 自带很大的上下留白，
 *    在卡片里撑出一大片空白，看起来像没加载完。
 *    这一页是嵌在个人设置里的，空态压扁一点更合适。
 */
.pf-table th:nth-child(1) { width: 108px; }
.pf-table th:nth-child(3) { width: 96px; }
.pf-table th:nth-child(4) { width: 76px; }
.pf-table th:nth-child(5) { width: 92px; }
.pf-table th:nth-child(6) { width: 64px; }

.pf-sub .empty {
  padding: 18px 0;
  font-size: 12px;
  border: none;
  background: transparent;
}
