/*!
 * ui-unify.css —— 全站统一定标层（唯一数值层）
 * 建立：2026-11-08
 *
 * 分工（四层，不要混）：
 *   work-rail.css    → 轨道：内容有多宽（1080，唯一值）
 *   ui-workbench.css → 组件：卡、行、条、徽章长什么样
 *   ui-skeleton.css  → 骨架：这些块在一行里怎么排
 *   ui-unify.css     → 定标：同一个东西在任何页面必须同一尺寸（本文件）
 *
 * 为什么必须有这一层：
 *   会员端 23 个页面把样式写在各页内联 <style> 或专属 css（detail/service/profile-page/
 *   skills/legal/tool-style），公共层改不动它们。实测同一个 .m-stat 在不同页出现
 *   206 / 220 / 244 / 261 四种宽度，.ag-card 出现 454 / 612 / 1080 三种。
 *   只有「加载在最后 + .content 前缀 + !important」能一次压住 37 页。
 *
 * 定标（唯一值，不得新增）：
 *   间距 12px / 圆角 12px
 *   宽度 5 档：100%（满宽）· 1/2 · 1/3 · 1/4 · 560（空态）
 *   高度：KPI 92px；内容卡不设死高，同排由网格自动等高（设死高会裁内容）
 *   列数：由卡片数量决定，每行必须排满，不允许 4+2、4+1 这类残行
 *
 * 新增页面若发现尺寸对不上，先查这个文件里有没有对应的容器类；
 * 没有就加一条，不要在该页内联 <style> 里另写一个宽度。
 */

/* ============================================================
   一、间距与圆角：全站唯一值 12
   原来：gap 出现 8 / 10 / 12 / 14 / 16 / 18 六种；圆角出现
        9 / 10 / 11 / 12 / 13 / 14 / 16 七种。
   同一排两张卡差 3px 宽度，肉眼说不清哪里不对，但就是不齐。
   ============================================================ */
.content :is(.ag-quick,.ag-kpis,.m-stats,.m-scenes,.sv-plans,.sv-cards,.sv-row2,
  .plan-grid,.quota-grid,.ag-cols,.ag-wall,.nx-bento,.nx-docs,.xo-k4,.ag-amt,
  .ac-grid,.ag-form,.ag-form-grid,.ag-cards,.cards){
  gap:12px !important;
}

.content :is(.m-card,.ag-card,.m-stat,.ag-kpi,.nx-tile,.sv-plan,.sv-card,
  .plan-card,.qcard,.pk-card,.m-cap,.m-scene,.m-alert,.ac-banner,.ac-card,
  .ac-group,.m-empty,.sv-empty,.msg-empty,.ag-empty,.ag-mat,.ag-tablewrap,
  .chat-input,.drop,.ag-idbar,.quota-banner){
  border-radius:12px !important;
}
.content .xo-k4 > *, .content .ag-amt > *{border-radius:12px !important}

/* ============================================================
   二、KPI / 统计卡：一律 92 高，宽度按列数等分
   原来同一排 KPI 出现 74 / 87 / 94 / 96 / 112 五种高度。
   ============================================================ */
.content :is(.ag-kpi,.m-stat){height:92px !important;min-height:92px !important;
  box-sizing:border-box}

/* 四列节奏：4 张卡 = 261 宽。3 张卡也走 4 列（缺位留白），
   这样「任何页面的统计卡都是同一个尺寸」，而不是这页 261、那页 352。 */
.content .ag-kpis,
.content .ag-kpis.three,
.content .m-stats{grid-template-columns:repeat(4,minmax(0,1fr)) !important}

/* 5 张卡（/m/orders）：5 等分，不许第 5 张掉到第二行独自占 261。 */
.content .ag-kpis:has(> :nth-child(5)),
.content .m-stats:has(> :nth-child(5)){grid-template-columns:repeat(5,minmax(0,1fr)) !important}

/* 只有 1 张卡时不许拉成满宽 */
.content :is(.ag-kpis,.m-stats):has(> :only-child){
  grid-template-columns:minmax(0,261px) !important}

/* ============================================================
   三、卡片行：列数由卡数决定，每行排满
   ============================================================ */

/* 快捷入口：2/3/4/5 项各等分；6 项走 3 列两行（4+2 会留残行） */
.content .ag-quick{grid-template-columns:repeat(4,minmax(0,1fr)) !important}
.content .ag-quick:has(> :nth-child(2):last-child){grid-template-columns:repeat(2,minmax(0,1fr)) !important}
.content .ag-quick:has(> :nth-child(3):last-child){grid-template-columns:repeat(3,minmax(0,1fr)) !important}
.content .ag-quick:has(> :nth-child(5):last-child){grid-template-columns:repeat(5,minmax(0,1fr)) !important}
.content .ag-quick:has(> :nth-child(6):last-child){grid-template-columns:repeat(3,minmax(0,1fr)) !important}

/* 场景卡：4 张一行；6 张改 3 列两行 */
.content .m-scenes{grid-template-columns:repeat(4,minmax(0,1fr)) !important}
.content .m-scenes:has(> :nth-child(5):nth-last-child(2)){grid-template-columns:repeat(3,minmax(0,1fr)) !important}

/* 套餐 / 方案卡：一律 3 列（3 张 = 一行；6 张 = 两行整齐） */
.content :is(.sv-plans,.plan-grid,.sv-cards,.quota-grid){
  grid-template-columns:repeat(3,minmax(0,1fr)) !important}

/* 四列网格：技能磁贴、文书入口、素材墙、金额格 */
.content :is(.nx-bento,.nx-docs,.ag-wall,.xo-k4,.ag-amt,.ag-cards,.cards){
  grid-template-columns:repeat(4,minmax(0,1fr)) !important}

/* 磁贴行内等高：同一排磁贴高度必须一致（呼吸感靠内边距，不靠高度差） */
.content :is(.nx-bento,.nx-docs,.ag-wall,.ag-quick,.m-scenes,.sv-plans,.plan-grid,
  .sv-cards,.quota-grid,.ag-kpis,.m-stats){align-items:stretch !important}

/* 两栏内容行：一律对半（原来 .ag-cols 是 1.35:1，.ac-split 是 1fr 320px，
   于是同一站里出现 612/454 和 704/320 两种「左大右小」，看着就不齐） */
.content .ag-cols{grid-template-columns:repeat(2,minmax(0,1fr)) !important}
.content .ag-cols > *{min-width:0}
.content .ac-group-b.ac-split{grid-template-columns:repeat(2,minmax(0,1fr)) !important}

/* 单列（页内分段） */
.content .ac-grid{grid-template-columns:1fr !important}

/* ============================================================
   四、空态：一律 560 居中
   原来：/service 系列空态 1080 满宽横条，/m 系列 494 或 520，
        /messages 560。同一个「暂无记录」四种宽度。
   ============================================================ */
.content :is(.m-empty,.sv-empty,.ag-empty,.msg-empty){
  max-width:560px !important;
  margin-left:auto !important;
  margin-right:auto !important;
  box-sizing:border-box;
}

/* ============================================================
   五、卡片内部：文字不许被拉散
   卡片变宽后，说明文字若跟着拉满一行，读起来像「散架」。
   ============================================================ */
.content :is(.ag-kpi,.m-stat) .foot{max-width:220px}
.content :is(.ag-kpi,.m-stat) b{font-variant-numeric:tabular-nums}

/* ============================================================
   六、窄屏：只降列数，不改数值
   ============================================================ */
@media (max-width:1000px){
  .content :is(.ag-kpis,.ag-kpis.three,.m-stats){grid-template-columns:repeat(2,minmax(0,1fr)) !important}
  .content :is(.nx-bento,.nx-docs,.ag-wall,.xo-k4,.ag-amt,.ag-cards,.cards){
    grid-template-columns:repeat(2,minmax(0,1fr)) !important}
  .content :is(.sv-plans,.plan-grid,.sv-cards,.quota-grid,.m-scenes){
    grid-template-columns:repeat(2,minmax(0,1fr)) !important}
  .content .ag-cols,.content .ac-group-b.ac-split{grid-template-columns:1fr !important}
}

/* ============================================================
   七、统一分页条 .pg-bar（2026-11-09 全站列表分页统一）
   m 壳（会员/代理/推广/协作）页面用；律所端 desk.css 自带 --dk 版。
   只吃 token 变量，白天/夜间自动跟随。
   ============================================================ */
.pg-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;
  flex-wrap:wrap;padding:13px 16px 4px;margin-top:2px;border-top:1px solid var(--line-2)}
.pg-bar .pg-info{font-size:12.5px;color:var(--fg3);white-space:nowrap}
.pg-bar .pg-list{display:inline-flex;align-items:center;gap:6px;flex-wrap:wrap}
.pg-bar .pg{min-width:32px;height:32px;padding:0 11px;display:inline-flex;align-items:center;
  justify-content:center;border:1px solid var(--line-2);border-radius:8px;font-size:12.5px;
  color:var(--fg2);background:var(--card);text-decoration:none;white-space:nowrap;transition:.15s}
.pg-bar .pg:hover{border-color:var(--pri);color:var(--pri)}
.pg-bar .pg.on{background:var(--pri);border-color:var(--pri);color:var(--pri-fg);font-weight:600}
.pg-bar .pg.dis{opacity:.4;pointer-events:none}
.pg-bar .pg-ell{min-width:20px;text-align:center;color:var(--fg3)}
.pg-bar .pg-sep{width:1px;height:16px;background:var(--line-2);margin:0 4px}
.pg-bar .pg-per{display:inline-flex;align-items:center;gap:4px;font-size:12px;color:var(--fg3)}
.pg-bar .pg-per a{min-width:26px;height:26px;padding:0 6px;display:inline-flex;align-items:center;
  justify-content:center;border-radius:6px;color:var(--fg3);text-decoration:none}
.pg-bar .pg-per a:hover{color:var(--pri);background:var(--line-2)}
.pg-bar .pg-per a.on{background:var(--line-2);color:var(--fg);font-weight:600}

