/* ==========================================================
   影研教育 · 客户管理系统
   视觉基调：墨 / 纸 / 印
   - 墨（近黑）负责文字、主按钮、选中态
   - 纸（冷灰白）负责底，白色只留给数据本身
   - 印（印章红）只出现在品牌、逾期、危险操作上
   - 金额、日期、期数一律等宽数字，右对齐，像账本一样对得上
   ========================================================== */

:root {
  /* ---- 基础色 ---- */
  --ink:      #16181C;   /* 主文字 / 主按钮 */
  --ink-2:    #4A5058;   /* 次要文字 */
  --ink-3:    #868D95;   /* 说明文字 */
  --ink-4:    #B3B9BF;   /* 占位、禁用 */
  --paper:    #F4F5F6;   /* 页面底色 */
  --surface:  #FFFFFF;
  --surface-2:#F7F8F9;

  --rule:     #DFE2E5;   /* 主分隔线 */
  --rule-2:   #EBEDEF;   /* 行分隔线 */

  /* ---- 品牌色：跟着「配色」走，只有它会被换掉 ---- */
  --brand:        #A6261F;
  --brand-strong: #8E1F19;
  --brand-soft:   #FBF1F0;
  --brand-line:   #EED4D2;

  /* ---- 危险色：逾期 / 退款 / 删除。这个不跟着配色变，永远是红的 ---- */
  --seal:      #A6261F;
  --seal-ink:  #8E1F19;
  --seal-soft: #FBF1F0;
  --seal-line: #EED4D2;

  /* ---- 状态色：整体压灰，靠点区分 ---- */
  --ok:        #1F7A4D;
  --ok-soft:   #EDF5F0;
  --ok-line:   #CFE2D8;
  --wait:      #8A6516;
  --wait-soft: #FAF4E8;
  --wait-line: #E9DABB;
  --mute-soft: #F2F3F4;

  /* ---- 兼容旧变量名（JS 内联样式仍在用，别删） ---- */
  --accent:        var(--brand);
  --accent-strong: var(--brand-strong);
  --accent-soft:   var(--brand-soft);
  --accent-line:   var(--brand-line);
  --green:      var(--ok);
  --green-soft: var(--ok-soft);
  --amber:      var(--wait);
  --amber-soft: var(--wait-soft);
  --red:        var(--seal);
  --red-soft:   var(--seal-soft);
  --line:       var(--rule);
  --line-2:     var(--rule-2);
  --head-bg:    #FFFFFF;
  --bg:         var(--paper);
  --text:       var(--ink);
  --text-2:     var(--ink-2);
  --text-3:     var(--ink-3);
  --slate-soft: #F2F3F4;
  --r: 4px;
  --shadow-lg: 0 18px 44px -14px rgba(16, 20, 26, .28);

  /* ---- 字体 ---- */
  --sans: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "Cascadia Mono", "SF Mono", Consolas, "Liberation Mono", Menlo, ui-monospace, monospace;
}

/* ==========================================================
   六套配色：每个人自己选，存在账号上，换一台电脑登录也是这个颜色
   只换「品牌色 + 页面底色」两样；
   逾期/退款/删除永远是红的，已缴永远是绿的，不受配色影响。
   ========================================================== */
html[data-theme="seal"]   { --brand:#A6261F; --brand-strong:#8E1F19; --brand-soft:#FBF1F0; --brand-line:#EED4D2; --paper:#F5F4F3; }
html[data-theme="ink"]    { --brand:#16181C; --brand-strong:#000000; --brand-soft:#F2F3F4; --brand-line:#DFE2E5; --paper:#F4F5F6; }
html[data-theme="blue"]   { --brand:#2B5CD9; --brand-strong:#1E47AE; --brand-soft:#EEF2FE; --brand-line:#D6E0FA; --paper:#F3F5FA; }
html[data-theme="violet"] { --brand:#6A4BD6; --brand-strong:#5538B8; --brand-soft:#F3F0FE; --brand-line:#E2DBF9; --paper:#F6F4FB; }
html[data-theme="teal"]   { --brand:#0E7286; --brand-strong:#0A5B6C; --brand-soft:#EBF5F7; --brand-line:#CBE3E8; --paper:#F1F5F6; }
html[data-theme="orange"] { --brand:#C2560F; --brand-strong:#A24509; --brand-soft:#FDF2E9; --brand-line:#F6DEC8; --paper:#F8F4EF; }

/* 顶栏「配色」按钮上的小圆点 */
.dotmark { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); flex: none; display: inline-block; }

/* 配色下拉 */
.thememenu {
  position: fixed; z-index: 80; width: 168px; padding: 6px;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r);
  box-shadow: 0 18px 40px -16px rgba(16, 20, 26, .34);
}
.thememenu__t { padding: 5px 9px 8px; color: var(--ink-3); font-size: 11px; }
.thememenu button {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  padding: 7px 9px; border: 0; background: none; border-radius: 2px; cursor: pointer;
  color: var(--ink-2); font: inherit; font-size: 13px;
}
.thememenu button:hover { background: var(--surface-2); color: var(--ink); }
.thememenu button i { width: 14px; height: 14px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); }
.thememenu button em { margin-left: auto; font-style: normal; color: var(--brand); font-size: 12px; }

/* ---------------- 基础 ---------------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 13px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: 0; }
p { margin: 0; }
.is-hidden { display: none !important; }
.muted { color: var(--ink-3); }
.strong { font-weight: 600; }
.sub { color: var(--ink-3); font-size: 12px; }
.nowrap { white-space: nowrap; }
.stack { display: grid; gap: 2px; line-height: 1.5; }
/* 数字一律等宽对齐：用系统中文数字（不用带斜杠零的等宽字体，业务同事看着更习惯） */
.num { font-variant-numeric: tabular-nums; }
.c { text-align: center; }
.r { text-align: right; }
::selection { background: #16181C; color: #fff; }

/* ---------------- 按钮：三级，只有主按钮是实心 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 6px 13px; border: 1px solid var(--rule); border-radius: var(--r);
  background: var(--surface); color: var(--ink-2); font: inherit; font-size: 13px;
  cursor: pointer; white-space: nowrap; transition: background .12s, color .12s, border-color .12s;
}
.btn:hover { color: var(--ink); border-color: #C7CCD1; background: var(--surface-2); }
.btn:active { background: #F0F1F2; }
.btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 500; }
.btn--primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); color: #fff; }
.btn--ghost { background: var(--surface); }
.btn--sm { padding: 4px 10px; font-size: 12px; }
.btn--block { width: 100%; padding: 10px; font-size: 14px; }
.btn--text { border: 0; background: none; color: var(--ink); padding: 0 2px; cursor: pointer; font: inherit; border-bottom: 1px solid transparent; }
.btn--text:hover { border-bottom-color: var(--brand); }
.btn--danger { background: var(--seal); border-color: var(--seal); color: #fff; font-weight: 500; }
.btn--danger:hover { background: var(--seal-ink); border-color: var(--seal-ink); color: #fff; }
.btn--danger-text { border: 0; background: none; color: var(--seal); padding: 0 2px; cursor: pointer; font: inherit; border-bottom: 1px solid transparent; }
.btn--danger-text:hover { border-bottom-color: var(--seal); }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* ---------------- 输入控件 ---------------- */
.inp {
  width: 100%; padding: 6px 9px; border: 1px solid var(--rule); border-radius: var(--r);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.inp:hover { border-color: #C7CCD1; }
.inp:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.inp::placeholder { color: var(--ink-4); }
select.inp { cursor: pointer; appearance: none; padding-right: 24px;
  background-image: linear-gradient(45deg, transparent 50%, #868D95 50%),
                    linear-gradient(135deg, #868D95 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
textarea.inp { resize: vertical; line-height: 1.7; }
.inp--date { width: 140px; }
.inp--lg { padding: 9px 11px; font-size: 14px; }
.fld { display: block; margin-bottom: 14px; }
.fld > span { display: block; margin-bottom: 6px; color: var(--ink-2); font-size: 12px; }
.chk { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); cursor: pointer; margin-bottom: 16px; font-size: 13px; }
.chk input { accent-color: var(--ink); width: 14px; height: 14px; }
.hint { color: var(--ink-3); font-size: 12px; line-height: 1.8; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.form-grid .fld--full { grid-column: 1 / -1; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; min-width: 0; }

/* ---------------- 登录：左边一块墨，右边一张表单 ---------------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr); background: var(--surface); }
.login__box { display: flex; flex-direction: column; justify-content: center; padding: 8vh 9vw; background: var(--surface); }
.login__brand { display: flex; align-items: center; gap: 11px; margin-bottom: 30px; }
.login__brand strong { display: block; font-size: 15px; letter-spacing: .02em; }
.login__brand small { color: var(--ink-3); font-size: 12px; }
.login__box h1 { font-size: 20px; margin-bottom: 22px; }
.login__tip { margin-top: 18px; color: var(--ink-3); font-size: 12px; line-height: 1.7; }
.login__aside {
  order: -1; position: relative; overflow: hidden;
  background: var(--ink); color: #fff;
  padding: 8vh 6vw; display: flex; flex-direction: column; justify-content: center;
}
.login__aside::before { content: ""; width: 34px; height: 3px; background: var(--brand); margin-bottom: 22px; }
.login__aside h2 { font-size: 21px; line-height: 1.45; margin-bottom: 12px; letter-spacing: .01em; }
.login__aside > p { color: #9BA2AA; font-size: 13px; }
.login__aside ul { margin: 30px 0 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.login__aside li { padding-left: 18px; position: relative; color: #D6D9DD; font-size: 13px; }
.login__aside li::before { content: ""; position: absolute; left: 0; top: 7px; width: 6px; height: 6px; background: var(--brand); }
.login__note { margin-top: 34px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .16); color: #8A9199; font-size: 12px; }

/* 品牌方章 */
.logo {
  width: 28px; height: 28px; border-radius: 2px; flex: none;
  display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 14px;
  background: var(--brand);
}
.logo--lg { width: 38px; height: 38px; font-size: 17px; }

/* ---------------- 主框架 ---------------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.topnav {
  height: 48px; flex: none; display: flex; align-items: center; gap: 26px;
  background: var(--surface); border-bottom: 1px solid var(--rule); padding: 0 18px;
  position: sticky; top: 0; z-index: 30;
}
.topnav__brand { display: flex; align-items: center; gap: 9px; font-weight: 600; white-space: nowrap; font-size: 14px; letter-spacing: .01em; }
.topnav__menu { display: flex; align-items: stretch; gap: 0; height: 100%; overflow-x: auto; }
/* 一级模块：只有文字，选中就是墨色加粗 + 一条下划线 */
.topnav__menu button {
  display: flex; align-items: center; padding: 0 13px;
  border: 0; background: none; cursor: pointer;
  color: var(--ink-3); font: inherit; font-size: 13px; position: relative;
  transition: color .12s;
}
.topnav__menu button svg { display: none; }
.topnav__menu button:hover { color: var(--ink); }
.topnav__menu button.is-active { color: var(--ink); font-weight: 600; }
.topnav__menu button.is-active::after {
  content: ""; position: absolute; left: 13px; right: 13px; bottom: -1px; height: 2px; background: var(--brand);
}
.topnav__right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.roleswitch { display: flex; align-items: center; gap: 6px; color: var(--ink-3); white-space: nowrap; font-size: 12px; }
.roleswitch select {
  padding: 4px 22px 4px 8px; border: 1px solid var(--rule); border-radius: var(--r);
  background: #fff; color: var(--ink-2); font: inherit; font-size: 12px; cursor: pointer; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #868D95 50%),
                    linear-gradient(135deg, #868D95 50%, transparent 50%);
  background-position: calc(100% - 13px) 50%, calc(100% - 8px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
/* 右上角"我"：点一下打开我的资料（改头像、改昵称、改密码） */
.who {
  display: flex; align-items: center; gap: 7px; color: var(--ink-2); font-size: 13px;
  cursor: pointer; padding: 3px 7px 3px 4px; border-radius: 999px; transition: background .12s, color .12s;
}
.who:hover { background: var(--surface-2); color: var(--ink); }
.who::after { content: "▾"; font-size: 10px; color: var(--ink-3); margin-left: -1px; }
/* 头像：统一做成圆的（照片/默认卡通人像都用这个盒子） */
.avatar {
  width: 26px; height: 26px; border-radius: 50%; flex: none; overflow: hidden; padding: 0;
  display: grid; place-items: center; color: var(--ink-2); font-size: 11px; font-weight: 600;
  background: var(--mute-soft);
}
.avatar svg, .avatar img { width: 100%; height: 100%; display: block; }
.avatar img { object-fit: cover; }
.avatar--img { overflow: hidden; padding: 0; background: var(--mute-soft); }
.avatar--img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar--xl { width: 64px; height: 64px; font-size: 22px; }

/* 系统提示条 */
.sharebar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 9px 18px; background: var(--surface); border-bottom: 1px solid var(--rule);
  box-shadow: inset 3px 0 0 var(--ink);
  color: var(--ink-2); font-size: 12px;
}
.sharebar__text { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sharebar__text b { color: var(--ink); }
.sharebar__text code {
  background: var(--surface-2); border: 1px solid var(--rule); border-radius: 2px;
  padding: 2px 8px; font-family: var(--mono); font-size: 12px; color: var(--ink);
}
.sharebar__act { display: flex; gap: 8px; }
.demobar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 18px; background: var(--wait-soft); color: var(--wait); font-size: 12px;
  border-bottom: 1px solid var(--wait-line);
}
.demobar__tag { background: var(--wait); color: #fff; font-weight: 600; border-radius: 2px; padding: 1px 6px; font-size: 11px; }
.demobar b { color: var(--ink); }

/* ---------------- 框架：左侧二级导航 + 内容 ---------------- */
.shell { flex: 1; display: flex; align-items: stretch; min-height: 0; }
.subnav {
  width: 146px; flex: none; background: var(--surface); border-right: 1px solid var(--rule);
  padding: 10px 0; align-self: stretch;
}
.subnav button {
  display: block; width: 100%; text-align: left; padding: 8px 16px;
  border: 0; box-shadow: inset 2px 0 0 transparent; background: none; cursor: pointer;
  color: var(--ink-3); font: inherit; font-size: 13px; transition: color .12s, background .12s;
}
.subnav button:hover { color: var(--ink); background: var(--surface-2); }
.subnav button.is-active { color: var(--ink); font-weight: 600; box-shadow: inset 2px 0 0 var(--brand); }

.content { flex: 1; min-width: 0; padding: 18px 20px 30px; }
.page { display: grid; gap: 0; min-width: 0; }

/* ---------------- 页面头条：标题 + 计数 + 操作 ---------------- */
.page > div:first-child h2 { font-size: 16px; letter-spacing: 0; }
.page > div:first-child .sub { margin-top: 3px; font-size: 12px; }
.page > div:first-child { padding-bottom: 14px; }

/* ---------------- 面板：一张白纸，没有圆角、没有投影、没有描边 ---------------- */
.card {
  background: var(--surface); border-radius: 0; padding: 15px 18px;
  border-top: 1px solid var(--rule); min-width: 0;
}
.card--flush { padding: 0; overflow: hidden; }
.card__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: -15px -18px 14px; padding: 12px 18px; border-bottom: 1px solid var(--rule-2);
}
.card--flush .card__head { margin: 0; }
.card__head h3 { font-size: 14px; }
.card__body { padding: 0; }

/* ---------------- 筛选区 ---------------- */
.filters { display: grid; gap: 12px 22px; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; }
.filters .row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.filters .row > label { flex: none; color: var(--ink-3); width: 56px; text-align: right; font-size: 12px; }
.filters__wide { grid-column: span 2; }
.filters__actions { display: flex; gap: 8px; justify-content: flex-end; }
.range { display: flex; align-items: center; gap: 6px; }
.range .inp { width: 134px; }

/* 分段选择：像页签，不像彩色按钮 */
/* ---------------- 多选下拉（筛选用）：勾一个＝单选，勾多个＝多选 ---------------- */
.ms__btn { display: flex; align-items: center; justify-content: space-between; gap: 6px; text-align: left; cursor: pointer; min-width: 0; flex: 1; }
.ms__btn::after {
  content: ""; width: 0; height: 0; flex: none;
  border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid var(--ink-3);
}
.ms__btn.is-on { border-color: var(--brand-line); background: var(--brand-soft); color: var(--ink); font-weight: 500; }
.msmenu {
  position: fixed; z-index: 80; min-width: 178px; max-height: 320px; overflow: auto; padding: 6px;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r);
  box-shadow: 0 18px 40px -16px rgba(16, 20, 26, .34);
}
.msmenu__t { display: flex; justify-content: space-between; gap: 10px; padding: 5px 9px 8px; color: var(--ink-3); font-size: 11px; }
.msmenu__i { display: flex; align-items: center; gap: 8px; padding: 6px 9px; border-radius: 2px; cursor: pointer; font-size: 13px; color: var(--ink-2); }
.msmenu__i:hover { background: var(--surface-2); color: var(--ink); }
.msmenu__i input { accent-color: var(--brand); width: 14px; height: 14px; flex: none; }
.msmenu__f { display: flex; gap: 6px; padding: 8px 9px 3px; border-top: 1px solid var(--rule-2); margin-top: 5px; }
.msmenu__f .btn { flex: 1; }

.seg { display: inline-flex; gap: 0; }
.seg button {
  padding: 5px 12px; border: 0; background: none; cursor: pointer; position: relative;
  font: inherit; font-size: 13px; color: var(--ink-3); transition: color .12s;
}
.seg button::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; background: transparent;
}
.seg button:hover { color: var(--ink); }
.seg button.is-active { color: var(--ink); font-weight: 600; }
.seg button.is-active::after { background: var(--brand); }

/* ---------------- 指标行：一条账目线，不是四张卡 ---------------- */
.kpis {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  background: var(--surface); border-top: 1px solid var(--rule);
}
.kpi { padding: 13px 18px; border-right: 1px solid var(--rule-2); min-width: 0; }
.kpi:last-child { border-right: 0; }
.kpi__label { color: var(--ink-3); font-size: 12px; }
.kpi__val {
  font-variant-numeric: tabular-nums; letter-spacing: -.01em;
  font-size: 24px; font-weight: 600; margin-top: 5px; color: var(--ink);
  display: flex; align-items: baseline; gap: 6px; white-space: nowrap;
}
.kpi__sub { font-size: 12px; color: var(--ink-3); font-weight: 400; font-family: var(--sans); }

/* ---------------- 表格：账本 ---------------- */
.tb-wrap { overflow-x: auto; }
.tb { width: 100%; border-collapse: collapse; }
.tb th {
  background: var(--surface); color: var(--ink-3); font-weight: 600; text-align: left;
  padding: 9px 16px; border-bottom: 1px solid var(--brand); white-space: nowrap; font-size: 11px;
}
.tb td {
  padding: 11px 16px; border-bottom: 1px solid var(--rule-2); vertical-align: middle;
  font-size: 13px; color: var(--ink);
}
.tb tbody tr:last-child td { border-bottom: 1px solid var(--rule); }
.tb tbody tr:hover td { background: #FAFAFB; }
.tb .r { text-align: right; font-variant-numeric: tabular-nums; }
.tb .c { text-align: center; }
.tb .sub { white-space: nowrap; }
.tb__empty { text-align: center; color: var(--ink-3); padding: 44px 0 !important; font-size: 12px; }
.cell-user { display: flex; align-items: center; gap: 9px; }

/* ---------------- 拖拽排序 ---------------- */
.tb tr.tb-total td { border-top: 1px solid var(--rule); font-weight: 600; background: var(--surface-2); }
.tb tr.tb-grp td { background: #FAFAFB; font-weight: 600; }
.tb tr.tb-grp:hover td { background: var(--surface-2); }
.dragcol { width: 34px; padding-right: 0 !important; }
.dragh {
  display: inline-block; padding: 3px 5px; border-radius: 5px;
  color: var(--ink-3); font-size: 16px; line-height: 1; letter-spacing: 1px;
  cursor: grab; user-select: none; touch-action: none;
}
.dragh:hover { background: var(--brand-soft); color: var(--brand); }
.tb tr[data-sort-kind] { cursor: grab; }
.tb tr[data-sort-kind]:hover .dragh { color: var(--brand); }
.tb tr.is-dragging { opacity: .45; }
.tb tr.is-dragging > td { background: var(--surface-2); }
.tb tr.drop-above > td { box-shadow: inset 0 2px 0 0 var(--brand); }
.tb tr.drop-below > td { box-shadow: inset 0 -2px 0 0 var(--brand); }
body.is-sorting, body.is-sorting * { cursor: grabbing !important; user-select: none !important; }

/* 状态：一个点 + 一行字 */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; color: var(--ink-2); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-4); flex: none; }
.pill--ok::before { background: var(--ok); }
.pill--warn { color: var(--wait); font-weight: 500; }
.pill--warn::before { background: var(--wait); }
.pill--err { color: var(--seal); font-weight: 500; }
.pill--err::before { background: var(--seal); }
.pill--info { color: var(--ink); }
.pill--info::before { background: var(--ink); }
.pill--mute { color: var(--ink-3); }

/* 开关 */
.switch { position: relative; display: inline-block; width: 38px; height: 20px; flex: none; vertical-align: middle; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: #E2E4E7; transition: background .16s; }
.switch i::after {
  content: "否"; position: absolute; top: 0; right: 5px; color: var(--ink-3); font-size: 10px;
  line-height: 20px; transition: all .16s;
}
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { content: "是"; right: auto; left: 5px; color: #fff; }
.switch input:disabled + i { opacity: .5; cursor: not-allowed; }

/* ---------------- 分页 ---------------- */
.pager {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; flex-wrap: wrap;
  background: var(--surface); border-top: 1px solid var(--rule-2);
}
.pager__list { display: flex; gap: 4px; align-items: center; }
.pager button {
  min-width: 28px; height: 28px; padding: 0 8px; border: 1px solid transparent;
  background: none; border-radius: var(--r); color: var(--ink-2); cursor: pointer; font: inherit; font-size: 12px;
}
.pager button:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); border-color: var(--rule); }
.pager button.is-active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.pager button:disabled { opacity: .35; cursor: not-allowed; }
.pager select {
  padding: 5px 22px 5px 8px; border: 1px solid var(--rule); border-radius: var(--r); font: inherit;
  font-size: 12px; background: #fff; color: var(--ink-2); appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #868D95 50%), linear-gradient(135deg, #868D95 50%, transparent 50%);
  background-position: calc(100% - 13px) 50%, calc(100% - 8px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}

/* ---------------- 弹窗 ---------------- */
.modal-root:empty { display: none; }
.mask {
  position: fixed; inset: 0; background: rgba(20, 23, 27, .44); z-index: 50;
  display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow: auto;
}
.modal { background: var(--surface); border-radius: 4px; width: 100%; max-width: 620px; box-shadow: var(--shadow-lg); animation: pop .16s ease; }
.modal--sm { max-width: 450px; }
.modal--lg { max-width: 780px; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px); } }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 15px 20px; border-bottom: 1px solid var(--rule); }
.modal__head h3 { font-size: 15px; }
.modal__x { border: 0; background: none; font-size: 18px; color: var(--ink-3); cursor: pointer; line-height: 1; padding: 0 2px; }
.modal__x:hover { color: var(--ink); }
.modal__body { padding: 20px; }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--rule-2); }
.modal__note {
  background: var(--surface-2); color: var(--ink-2); border-left: 2px solid var(--brand);
  padding: 11px 14px; margin-bottom: 18px; line-height: 1.75; font-size: 12px;
}

/* ---------------- 提示 ---------------- */
.toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 8px; z-index: 60; justify-items: end; }
.toast {
  display: flex; align-items: center; gap: 8px; padding: 10px 15px;
  background: var(--ink); color: #fff; font-size: 13px;
  box-shadow: var(--shadow-lg); border-left: 3px solid #fff; animation: pop .16s ease;
}
.toast--err { background: var(--seal); }

/* ---------------- 页脚 ---------------- */
.foot { padding: 18px 18px 26px; text-align: center; color: var(--ink-4); font-size: 11px; display: flex; flex-direction: column; gap: 3px; }
.foot__cs { color: var(--ink-3); }

/* ---------------- 其它小块 ---------------- */
.placeholder__list { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.placeholder__list li { display: flex; gap: 10px; align-items: baseline; font-size: 13px; }
.placeholder__list b { color: var(--ink); font-weight: 600; min-width: 116px; }

/* 权限矩阵 / 角色表 */
.matrix { width: 100%; border-collapse: collapse; }
.matrix th, .matrix td { border-bottom: 1px solid var(--rule-2); padding: 9px 16px; font-size: 13px; }
.matrix th {
  background: var(--surface); font-weight: 600; text-align: center; color: var(--ink-3);
  font-size: 11px; border-bottom: 1px solid var(--brand);
}
.matrix th:first-child { text-align: left; }
.matrix td:first-child { color: var(--ink); }
.matrix tr:last-child td { border-bottom: 1px solid var(--rule); }
.matrix .yes { color: var(--ok); font-weight: 600; }
.matrix .no { color: var(--ink-4); }

/* 横向条 */
.bars { display: grid; gap: 12px; }
.bar__row { display: flex; justify-content: space-between; margin-bottom: 5px; font-size: 12px; color: var(--ink-2); }
.bar__track { display: block; height: 5px; background: #EEEFF1; overflow: hidden; }
.bar__fill { display: block; height: 100%; min-width: 2px; background: var(--ink-2); }

/* 流程说明 */
.flowchart { display: flex; gap: 0; flex-wrap: wrap; border-top: 1px solid var(--rule); }
.flow-step { flex: 1 1 160px; padding: 13px 16px; border-right: 1px solid var(--rule-2); color: var(--ink-2); font-size: 12px; }
.flow-step:last-child { border-right: 0; }
.flow-step b { display: block; color: var(--ink); margin-bottom: 4px; font-size: 13px; }

/* 签名缩略图 */
.sig { width: 44px; height: 26px; border-radius: 2px; background: var(--surface-2); display: grid; place-items: center; }
.sig svg { width: 26px; height: 14px; }
.sig path { fill: none; stroke: var(--ok); stroke-width: 2; stroke-linecap: round; }
.sig--none path { stroke: var(--ink-4); }

/* 配色选择块（名额申请表主题） */
.swatch { padding: 0; border: 0; background: none; cursor: pointer; }
.swatch i { display: block; width: 56px; height: 32px; border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); transition: box-shadow .12s; }
.swatch span { display: block; margin-top: 5px; font-size: 12px; color: var(--ink-3); }
.swatch:hover span { color: var(--ink-2); }
.swatch.is-active i { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08), 0 0 0 2px var(--brand); }
.swatch.is-active span { color: var(--ink); font-weight: 600; }

/* 行内下拉菜单（更多 ▾） */
.menu {
  position: fixed; z-index: 70; min-width: 148px; padding: 4px;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r);
  box-shadow: 0 16px 34px -14px rgba(16, 20, 26, .3);
}
.menu button {
  display: block; width: 100%; text-align: left; padding: 7px 11px;
  border: 0; background: none; border-radius: 2px; cursor: pointer;
  color: var(--ink-2); font: inherit; font-size: 13px; white-space: nowrap;
}
.menu button:hover { background: var(--surface-2); color: var(--ink); }
.menu button.is-danger { color: var(--seal); }
.menu button.is-danger:hover { background: var(--seal-soft); color: var(--seal); }

/* 页内页签 */
.tabs-line { display: flex; gap: 20px; border-bottom: 1px solid var(--rule); margin-bottom: 14px; }
.tabs-line button {
  border: 0; background: none; padding: 0 0 9px; cursor: pointer; font: inherit; font-size: 13px;
  color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs-line button:hover { color: var(--ink); }
.tabs-line button.is-active { color: var(--ink); border-bottom-color: var(--brand); font-weight: 600; }

/* ==========================================================
   推广端（推量专员 / 推广组长）
   ========================================================== */
.app.promo-mode .content { max-width: 1280px; margin: 0 auto; width: 100%; }

.promoBanner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: var(--surface); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  box-shadow: inset 3px 0 0 var(--brand); padding: 14px 18px;
}
.promoBanner__hi { font-size: 15px; font-weight: 600; }
.promoBanner__sub { color: var(--ink-3); font-size: 12px; margin-top: 4px; }
.promoBanner b { color: var(--ink); font-weight: 600; }

.promoTabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: none; gap: 2px; background: var(--surface); border-top: 1px solid var(--rule);
  padding: 5px 6px calc(5px + env(safe-area-inset-bottom, 0px));
}
.promoTabs button {
  flex: 1; min-width: 0; border: 0; background: none; cursor: pointer;
  display: grid; justify-items: center; gap: 2px; padding: 6px 2px; border-radius: 2px;
  color: var(--ink-3); font: inherit; font-size: 11px; transition: color .12s, background .12s;
}
.promoTabs button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.promoTabs button.is-active { color: var(--ink); background: var(--surface-2); font-weight: 600; }

.prow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--rule-2); }
.prow:last-child { border-bottom: 0; }
.prow__title { font-weight: 600; word-break: break-all; font-size: 13px; }
.prow__sub { color: var(--ink-3); font-size: 12px; margin-top: 2px; }
.prow__side { display: grid; gap: 4px; justify-items: end; text-align: right; }
.prow__owner { color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.pempty { padding: 26px 18px; text-align: center; color: var(--ink-3); font-size: 12px; }

.pnote { color: var(--ink-3); font-size: 12px; line-height: 1.7; }
.pwarn { background: var(--wait-soft); border-left: 2px solid var(--wait); color: var(--wait); padding: 11px 14px; font-size: 12px; line-height: 1.7; }
.pmore { border: 1px dashed var(--rule); border-radius: var(--r); padding: 10px 12px; margin: 0 0 14px; }
.pmore summary { cursor: pointer; color: var(--ink-2); font-size: 12px; }
.pmore[open] { padding-bottom: 2px; }

.pme { display: grid; justify-items: center; gap: 5px; text-align: center; }
.pme__avatar { display: grid; justify-items: center; cursor: pointer; }
.pme__cam { margin-top: 7px; font-size: 12px; color: var(--ink-3); }
.pme__name { font-size: 16px; font-weight: 600; }

.plist__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--rule-2); }
.plist__row:last-child { border-bottom: 0; }
.plist__row span { color: var(--ink-2); }
.plist__row b { font-weight: 600; }

/* ==========================================================
   月费跟进：一格一期，一眼看出欠到第几期
   已缴=绿格 / 未到期=空心格显示倒计时 / 今天到期=琥珀 / 逾期=红实心
   ========================================================== */
.instcell {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; padding: 4px 7px; cursor: pointer;
  border: 1px solid var(--rule); border-radius: 3px; background: var(--surface);
  color: var(--ink-2); font: inherit; font-size: 12px;
  font-variant-numeric: tabular-nums; white-space: nowrap; line-height: 1.35;
  transition: border-color .12s, background .12s;
}
.instcell:hover { border-color: var(--ink-4); background: var(--surface-2); }
/* 未到期的格子压淡一点：整条看过去，只有"已缴 / 逾期"跳出来 */
.instcell { border-color: var(--rule-2); color: var(--ink-3); }

.follow { display: grid; gap: 5px; min-width: 170px; }
.follow__note {
  border: 0; border-bottom: 1px dashed var(--rule); border-radius: 0;
  padding: 2px 0; font: inherit; font-size: 12px; background: transparent; color: var(--ink); width: 100%;
}
.follow__note::placeholder { color: var(--ink-4); }
.follow__note:hover { border-bottom-color: var(--ink-4); }
.follow__note:focus { border-bottom-color: var(--ink); outline: none; background: var(--surface); }
.follow__note:disabled { opacity: .55; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1180px) {
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis { grid-auto-flow: row; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .two-col { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .topnav { height: auto; flex-wrap: wrap; padding: 9px 12px; gap: 10px; }
  .topnav__menu { order: 3; width: 100%; height: 38px; }
  .topnav__menu button { padding: 0 10px; font-size: 12px; }
  .who { display: none; }
  .shell { flex-direction: column; }
  .subnav {
    position: static; width: 100%; display: flex; gap: 2px; overflow-x: auto;
    padding: 6px 10px; border-right: 0; border-bottom: 1px solid var(--rule);
  }
  .subnav button { width: auto; white-space: nowrap; padding: 6px 11px; box-shadow: none; border-bottom: 2px solid transparent; }
  .subnav button.is-active { box-shadow: none; border-bottom-color: var(--brand); }
  .filters { grid-template-columns: minmax(0, 1fr); }
  .filters__wide { grid-column: auto; }
  .filters .row > label { text-align: left; width: 48px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .content { padding: 14px 12px 26px; }
  .kpi__val { font-size: 20px; }
}
@media (max-width: 820px) {
  .login { grid-template-columns: 1fr; }
  .login__aside { display: none; }
  .login__box { padding: 10vh 7vw; }
}
@media (max-width: 400px) {
  .prow { align-items: flex-start; }
}

/* 窄屏：推广端收进底部页签 */
@media (max-width: 900px) {
  .app.promo-mode .topnav__menu { display: none; }
  .app.promo-mode .content { padding: 12px 12px 86px; }
  .promoTabs:not(.is-hidden) { display: flex; }
  .promoBanner { padding: 12px 14px; }
  .promoBanner .btn { width: 100%; }
}

/* 尊重系统的「减少动效」设置 */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
