/* wb_top_user.css —— PC（erp.hcs168.cn）「用户 / 修改密码 / 安全退出」搬到页面右上角
 * @@ top-user @@ 20260924  v2（20260924c：横向单行美化版）
 * ----------------------------------------------------------------------------
 * 位置：/opt/wugan_project1/pc_web/wb_top_user.css，由 pc_web/index.html <head> 引入
 *       （配合 wb_top_user.js。样式只管外观，搬移与交互在 js 里）。
 * 回滚：删掉 index.html 里的 <link> 这一行即可（本文件留着不生效）。
 *
 * v2 版式（横向一行，不再两行堆叠）：
 *   (首字圆头像·右下角在线点) 姓名  [角色胶囊] │ (改密) (退出)
 *   32px 高、全圆角玻璃底，跟页头按钮同一排；按钮常态透明、悬停才显底，避免"三个灰方块"的拥挤感。
 *
 * 与 wb_sidebar_compact.css 的关系：
 *   侧边栏紧凑化里那套「底部用户区 127px→66px」的规则在本文件生效期间基本看不到效果 ——
 *   胶囊挂上右上角之后，侧边栏底部那块会被 .wb-tu-on 收起（菜单区顺势变高）。
 *   但找不到页头的页面（系统设置 / 税负看板等）不收起，仍然显示紧凑版底部用户区，
 *   所以两套规则互不冲突、只是先后关系。
 */

/* ========== 1) 右上角「用户胶囊」本体 ========== */
.wb-tu {
  display: inline-flex;
  align-items: center;
  gap: 0;
  flex: 0 0 auto;
  height: 32px;                 /* 与页头内的按钮同高，不会把页头撑高 */
  margin: 0;
  padding: 0 5px 0 4px;
  box-sizing: border-box;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(51, 65, 85, 0.78) 0%, rgba(30, 41, 59, 0.82) 100%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  font-weight: 400;
  line-height: 1;
  user-select: none;
  vertical-align: middle;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.wb-tu:hover {
  border-color: rgba(148, 163, 184, 0.4);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.wb-tu * { box-sizing: border-box; }

/* 头像：姓名首字 + 青绿渐变；在线绿点叠在它右下角（省一行，也比单独一个点好看） */
.wb-tu .wb-tu-avatar {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5eead4 0%, #2dd4bf 55%, #14b8a6 100%);
  box-shadow: 0 1px 3px rgba(20, 184, 166, 0.35);
  color: #03312e;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  overflow: visible;
}
.wb-tu .wb-tu-ini {
  display: block;
  line-height: 1;
  letter-spacing: 0;
  pointer-events: none;
}
.wb-tu .wb-tu-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 8px;
  height: 8px;
  padding: 0;
  border: 2px solid #1e293b;
  border-radius: 50%;
  background: #22c55e;
}
.wb-tu .wb-tu-name {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 116px;
  margin: 0 0 0 8px;
  overflow: hidden;
  color: var(--text-primary, #f1f5f9);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.wb-tu .wb-tu-role {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 108px;
  margin: 0 0 0 7px;
  padding: 2px 8px;
  overflow: hidden;
  border: 1px solid rgba(45, 212, 191, 0.22);
  border-radius: 999px;
  background: rgba(45, 212, 191, 0.13);
  color: #7fd8cd;
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.35;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.wb-tu .wb-tu-sep {
  flex: 0 0 auto;
  width: 1px;
  height: 18px;
  margin: 0 3px 0 8px;
  background: linear-gradient(180deg, rgba(148, 163, 184, 0) 0%, rgba(148, 163, 184, 0.42) 50%, rgba(148, 163, 184, 0) 100%);
}
.wb-tu .wb-tu-btn {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  margin: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: #94a3b8;
  font-size: 12.5px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, transform 0.12s ease;
}
.wb-tu .wb-tu-btn + .wb-tu-btn { margin-left: 2px; }
.wb-tu .wb-tu-btn:hover {
  background: rgba(45, 212, 191, 0.16);
  color: #5eead4;
}
.wb-tu .wb-tu-btn:active { transform: scale(0.94); }
.wb-tu .wb-tu-btn:focus-visible {
  outline: 2px solid rgba(45, 212, 191, 0.6);
  outline-offset: 1px;
}
.wb-tu .wb-tu-btn.wb-tu-logout:hover {
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
}

/* 整页就是一条页签条的（卡板管理 /event-reminders）：贴在页签行最右 */
.wb-tu.wb-tu-right { margin-left: auto; }

/* ========== 2) 找不到页头时的兜底：固定在视口右上角 ========== */
.wb-tu.wb-tu-fixed {
  position: fixed;
  top: 12px;
  right: 16px;
  z-index: 900;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.96) 0%, rgba(15, 23, 42, 0.96) 100%);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.wb-tu.wb-tu-fixed .wb-tu-dot { border-color: #0f172a; }

/* ========== 3) 胶囊已上右上角 → 收起侧边栏底部那块（三个功能不重复出现） ========== */
.wb-tu-on .sidebar .sidebar-user { display: none; }

/* ========== 4) 页面自带的「退出登录」按钮：功能已由胶囊承担，避免重复 ========== */
.wb-tu-on .page-content .logout-btn { display: none; }
