/* ══════════════════════════════════════════════════════════════════════════
   v166 · 全站页签栏统一
   ──────────────────────────────────────────────────────────────────────────
   线上有 4 个生产者，但只有 2 套视觉：

     ① React 原生（主包）：我的/团队/部门/所有、新建/审批/…、模块/价格/…
     ② 公告（announcement-tabs.js）：政策/回款/考勤/…，逐字复刻①的类名
     ③ 督导看板（supervision-enhance.js）：.se-dash-tab，复用①的 Tailwind 类
        ⇒ ①②③ 本来就是同一套：12px / 500 / padding 2px 0 / 高 20px
     ④ 活动浮层（projects.js）：.se-pj-tabbar + .se-pj-tab
        ⇒ 独立一套：13px / 500 / padding 7px 8px / 高 32px / 灰底槽 + 边框

   **真正刺眼的不一致不是字号，是「选中态会随背景消失」**：
   ①②③ 的选中块是「白底 + 阴影」，只有落在灰底 sticky 栏（公告页）上才看得见；
   落到白色卡片上（我的/团队、新建/审批、看板/成交客户）几乎等于没有选中态。
   所以选中指示统一改成 **文字宽度的 2px 蓝线**（text-decoration）：
   · 白底、灰底、深色底上都成立，不再依赖容器底色；
   · 宽度跟着文字走，不会因为页签是 flex-1 等宽而被拉成一条「分隔线」；
   · 用 text-decoration 而不是 border/::after —— 完全不占布局，页面高度不变。

   选择器说明：
   · React/公告 的页签按钮靠「flex-1 + py-0.5 + text-xs + font-medium」四类锁定，
     全站只有页签用这组组合（已核过 6 处产物：主包 3 + 公告 1 + 督导 1 + 活动 1）。
   · 基础规则包在 :where() 里刻意降权到 (0,0,1)，
     让后文的选中/悬停规则用普通类名就能压过去，不必堆 !important。
   · ④ 的样式是本仓注入的 <style>，且晚于本文件插入 head，
     所以它的规则必须用 body / html.dark body 前缀提一级特异性才压得住。
   ══════════════════════════════════════════════════════════════════════════ */

/* ── 1. 基础：四套共用同一字号、字重、行高、内边距、配色 ───────────────── */
button:where(.flex-1.py-0\.5.text-xs.font-medium),
button:where(.se-dash-tab),
body .se-pj-tab {
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  padding: 2px 0;
  color: #6b7280;
  background: transparent;
  border: 0;
  box-shadow: none;
  text-decoration: none;
  white-space: nowrap;
}

/* ── 2. 选中态：文字宽度下划线（不再依赖白底块） ────────────────────────── */
/* ①② 的选中按钮带 Tailwind 的 bg-white；③ 带 .se-dash-tab-selected；④ 带 .se-pj-tab-on */
button.flex-1.py-0\.5.text-xs.bg-white,
button.se-dash-tab-selected,
body .se-pj-tab.se-pj-tab-on {
  color: #2563eb;
  font-weight: 600;
  background: transparent;
  box-shadow: none;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
  text-decoration-color: #2563eb;
  text-decoration-skip-ink: none;
}

/* 督导看板接管时，React 自己那个高亮页签会被加 .se-tab-muted 压灰
   （否则看起来像同时选中两个）。它不该有下划线 —— 与上面的选中规则同权重，
   靠书写顺序在后取胜。 */
button.flex-1.py-0\.5.text-xs.se-tab-muted {
  color: #6b7280;
  font-weight: 500;
  background: transparent;
  box-shadow: none;
  text-decoration: none;
}

/* ── 3. 悬停：只作用于未选中项，避免选中项被 hover 抢走颜色 ─────────────── */
button:where(.flex-1.py-0\.5.text-xs.font-medium):not(.bg-white):not(.se-tab-muted):hover,
button:where(.se-dash-tab):not(.se-dash-tab-selected):hover,
body .se-pj-tab:not(.se-pj-tab-on):hover {
  color: #374151;
}

/* ── 4. 活动浮层的底槽去掉：只有 ④ 有，留着就永远不统一 ────────────────── */
body .se-pj-tabbar {
  background: transparent;
  border: 0;
  padding: 0;
}

/* ── 5. 深色模式 ──────────────────────────────────────────────────────── */
html.dark button:where(.flex-1.py-0\.5.text-xs.font-medium),
html.dark button:where(.se-dash-tab),
html.dark body .se-pj-tab {
  color: #9ca3af;
}

html.dark button.flex-1.py-0\.5.text-xs.bg-white,
html.dark button.se-dash-tab-selected,
html.dark body .se-pj-tab.se-pj-tab-on {
  color: #60a5fa;
  font-weight: 600;
  background: transparent;
  box-shadow: none;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
  text-decoration-color: #60a5fa;
  text-decoration-skip-ink: none;
}

html.dark button.flex-1.py-0\.5.text-xs.se-tab-muted {
  color: #9ca3af;
  font-weight: 500;
  box-shadow: none;
  text-decoration: none;
}

html.dark button:where(.flex-1.py-0\.5.text-xs.font-medium):not(.bg-white):not(.se-tab-muted):hover,
html.dark button:where(.se-dash-tab):not(.se-dash-tab-selected):hover,
html.dark body .se-pj-tab:not(.se-pj-tab-on):hover {
  color: #e5e7eb;
}

/* 底槽在深色下同样去掉（④ 有一条 html.dark .se-pj-tabbar 规则） */
html.dark body .se-pj-tabbar {
  background: transparent;
  border: 0;
}

/* ════════════════════════════════════════════════════════════════════
   v167：页签栏上下留白统一 —— 上方 12px / 下方 8px
   ────────────────────────────────────────────────────────────────────
   改前实测（6 处页签栏，页签栏自身 top/h 完全一致，差的全是周围容器）：
     上方 12 12 12 12 12 | 16（活动浮层）
     下方  4  4  4  8 12 |  8
   原因：
     · 主页面页签挂在 .sticky.top-10 上，条自身 py-1 ⇒ 下内距 4px；
       督导(/supervision)父层是 space-y-1、后台(/admin)是 space-y-2，
       又给紧跟的下一块加了 4px / 8px ⇒ 下方 4/8/12 三种。
     · 浮层 .se-pj-body 的 padding-top 是 8px，比主页面的 4px 多 4 ⇒ 上方 16。
   做法：粘性条下内距统一 8px，并清掉紧跟其后的 space-y 外边距；
        浮层只把 padding-top 收到 4px。页签栏自身不做任何改动。
   注：.space-y-* 在本构建里写作 :where(.space-y-N > :not(:last-child))，特异性为 0，
       普通类选择器即可压住，不需要 !important。
   ════════════════════════════════════════════════════════════════════ */
div.sticky.top-10 {
  padding-bottom: 8px; /* 原 py-1 = 4px；上方 4px 保持不动 */
  /* ⚠️ Tailwind v4 的 space-y-N 给「除最后一个之外的每个孩子」加的是
     margin-block-END（不是下一块的 margin-top）—— 所以必须清自己的下外边距。
     实测印证：督导 space-y-1 ⇒ 4+4=8、后台 space-y-2 ⇒ 4+8=12（改前正是 8 和 12）。 */
  margin-block-end: 0;
  margin-bottom: 0;
}

div.sticky.top-10 + * {
  margin-top: 0;
  margin-block-start: 0; /* 兜底：万一 future 的 space-y 方向变了 */
}

body .se-pj-body {
  /* 运行时注入的 .se-pj-body 是 padding:8px 12px 16px（晚于本文件），提一级特异性覆盖 */
  padding-top: 4px;
}
