﻿/* =====================================================================
   同事会 · 多企业版后台管理 UI — 设计系统
   品牌色板沿用小程序前端规范（橙色主色系）
   布局：深色侧边栏 + 浅色内容区（经典后台框架）
   作者：像素君 (UI Designer)
   ===================================================================== */

/* ---------- 1. 设计令牌 (Design Tokens) ---------- */
:root {
  /* 品牌主色（天空蓝基调） */
  --sky-50:  #EFF6FF;
  --sky-100: #DBEAFE;
  --sky-200: #BFDBFE;
  --sky-300: #60A5FA;
  --sky-500: #3B82F6;
  --sky-600: #2563EB;
  --sky-700: #1D4ED8;
  --brand-primary: #2563EB;   /* 全局品牌色：供 .bf-seg-item.active 等引用，根治变量未定义回退透明（V2.3.376 教训） */

  /* 兼容别名（保留旧变量名指向蓝色，避免遗漏） */
  --orange-50:  var(--sky-50);
  --orange-100: var(--sky-100);
  --orange-300: var(--sky-300);
  --orange-500: var(--sky-500);
  --orange-600: var(--sky-600);
  --orange-700: var(--sky-700);

  /* 语义色 */
  --success:    #10B981;   /* 简写别名（供强度条、toast等引用） */
  --success-500: #16A34A;
  --success-50:  #E7F6EC;
  --info:       #3B82F6;   /* 简写别名 */
  --info-500:    #2563EB;
  --info-50:     #E6EEFD;
  --warning:     #F59E0B;   /* 简写别名 */
  --warning-500: #F59E0B;
  --warning-50:  #FDF3E0;
  --error:       #EF4444;   /* 简写别名 */
  --error-500:   #DC2626;
  --error-50:    #FCE8E8;

  /* sky 补全 */
  --sky-400:     #60A5FA;   /* 介于 sky-300 与 sky-500 */

  /* 中性色 */
  --gray-900: #1C1A16;
  --gray-800: #2A2823;
  --gray-700: #4A463F;
  --gray-500: #78746B;
  --gray-400: #9C978E;
  --gray-300: #D6D3CC;
  --gray-200: #E7E4DD;
  --gray-100: #F2F0EB;
  --gray-50:  #F8F7F4;

  /* 表面 */
  --surface-base:  #FAFAF8;
  --surface-card:  #FFFFFF;
  --surface-hover: #FBF6F0;

  /* 侧边栏（深蓝灰，呼应天空蓝基调） */
  --sidebar-bg:    #0F172A;
  --sidebar-bg-2:  #1E293B;
  --sidebar-text:  #CBD5E1;
  --sidebar-text-dim: #64748B;
  --sidebar-active-bg: rgba(59, 130, 246, 0.18);
  --sidebar-active-text: #FFFFFF;
  --sidebar-border: rgba(255,255,255,0.07);
  --sidebar-icon: #94A3B8;   /* 侧边栏未选中图标（灰） */

  /* 圆角 */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* 阴影 */
  --shadow-xs: 0 1px 2px rgba(28,26,22,0.06);
  --shadow-sm: 0 2px 8px rgba(28,26,22,0.06);
  --shadow-md: 0 6px 20px rgba(28,26,22,0.08);
  --shadow-lg: 0 12px 32px rgba(28,26,22,0.12);

  /* 按钮尺寸变量（统一所有按钮/下拉框高度体系） */
  --btn-h-sm: 32px;
  --btn-h-md: 40px;
  --btn-h-lg: 46px;
  --btn-fz-sm: 12.5px;
  --btn-fz-md: 13.5px;
  --btn-fz-lg: 15px;
  --btn-px-sm: 12px;
  --btn-px-md: 16px;
  --btn-px-lg: 24px;
  --btn-radius: 8px;

  /* 间距 (4px 基准) */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;

  /* 字体 */
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
               "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", Consolas, "Courier New", monospace;
}

/* ---------- 2. Reset ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--surface-base);
  color: var(--gray-800);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ---------- 3. 应用骨架布局 ---------- */
.app {
  display: grid;
  grid-template-columns: minmax(0, auto) 1fr;  /* 第 1 列跟随 sidebar width：248px / 64px */
  grid-template-rows: 64px 1fr;
  grid-template-areas:
    "sidebar topbar"
    "sidebar content";
  height: 100vh;
  overflow: hidden;
}

/* ---------- 4. 侧边栏 ---------- */
.sidebar {
  grid-area: sidebar;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: 248px; /* 显式宽度，支持过渡动画 */
  min-width: 248px; /* 防止 grid 压缩 */
  transition: width .28s cubic-bezier(.4,0,.2,1), min-width .28s cubic-bezier(.4,0,.2,1);
  position: relative;
}
.sidebar__brand {
  display: flex;
  align-items: center;     /* 垂直居中 */
  justify-content: flex-start;
  gap: 12px;
  padding: 0 20px;
  min-height: 64px;
  height: 64px;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
  box-sizing: border-box;
  line-height: 0;          /* 关键：消除 brand 容器行高对垂直居中的干扰 */
}
.sidebar__logo {
  width: 34px; height: 34px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--sky-500), var(--sky-600));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 16px;
  box-shadow: 0 4px 12px rgba(59,130,246,0.4);
  line-height: 1;          /* 兜底：「同」字字体内边距 */
}
.sidebar__title { color: #fff; font-size: 15px; font-weight: 700; letter-spacing: .5px; line-height: 1.3; }
.sidebar__subtitle { color: var(--sidebar-text-dim); font-size: 11px; line-height: 1.3; margin-top: 2px; }
.sidebar__brand > div { display: flex; flex-direction: column; justify-content: center; line-height: normal; }

.sidebar__nav { flex: 1; overflow-y: auto; padding: 14px 12px; }
/* 安全：用户角色/权限确认前隐藏侧边栏菜单，防止未授权菜单在刷新时闪烁 */
.sidebar__nav.is-loading .nav-group { display: none; }
.nav-group { margin-bottom: 6px; }
.colleague-action-btns { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.nav-group__label {
  color: var(--sidebar-text-dim);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 12px 12px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  transition: background .15s, color .15s;
  cursor: pointer;
  margin-bottom: 2px;
}
.nav-item:hover { background: var(--sidebar-bg-2); color: #fff; }
.nav-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  font-weight: 600;
}
.nav-item.active .nav-item__icon { color: var(--sky-300); }
.nav-item__icon { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; color: var(--sidebar-icon); }
.nav-item__badge {
  margin-left: auto;
  background: var(--orange-500);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--radius-full);
}

.sidebar__footer {
  border-top: 1px solid var(--sidebar-border);
  padding: 12px;
  flex-shrink: 0;
}
.sidebar--collapsed .sidebar__footer {
  padding: 12px 0;          /* 缩进态：去掉左右内边距，tenant-card 居中无干扰 */
}
.tenant-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
  border-radius: var(--radius-md);
  background: var(--sidebar-bg-2);
  cursor: pointer;
}
.tenant-card__avatar {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  background: var(--orange-500); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.tenant-card__name { color: #fff; font-size: 13px; font-weight: 600; }
.tenant-card__meta { color: var(--sidebar-text-dim); font-size: 11px; }

/* 服务台底部入口 */
.service-desk-entry {
  display: flex; align-items: center; gap: 10px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--sky-500), var(--sky-600));
  cursor: pointer;
  margin-bottom: 10px;
  transition: all .2s;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.28);
}
.service-desk-entry:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}
.service-desk-entry.active {
  box-shadow: 0 0 0 2px rgba(255,255,255,0.4), 0 6px 20px rgba(59, 130, 246, 0.45);
}
.service-desk-entry__icon {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.18);
  display: flex; align-items: center; justify-content: center;
  color: #fff; flex-shrink: 0;
}
.service-desk-entry__icon .icon { width: 20px; height: 20px; }
.service-desk-entry__info { flex: 1; min-width: 0; }
.service-desk-entry__title { color: #fff; font-size: 14px; font-weight: 700; }
.service-desk-entry__meta { color: rgba(255,255,255,0.78); font-size: 11px; }
.service-desk-entry__arrow { width: 16px; height: 16px; color: rgba(255,255,255,0.8); flex-shrink: 0; }

/* 缩进态 */
.sidebar--collapsed .service-desk-entry {
  justify-content: center;
  padding: 12px 0;
  margin-bottom: 8px;
}
.sidebar--collapsed .service-desk-entry__info,
.sidebar--collapsed .service-desk-entry__arrow { display: none; }
.sidebar--collapsed .service-desk-entry__icon { margin: 0 auto; }

/* 租户卡片紧凑模式 */
.tenant-card--compact { padding: 8px 10px; }

/* ---------- 4b. 侧边栏折叠按钮 ---------- */
.sidebar__toggle {
  position: absolute;
  top: 50%;
  right: -13px;
  transform: translateY(-50%);
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--surface-card);
  border: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-500);
  z-index: 30;
  box-shadow: var(--shadow-sm);
  transition: color .18s, transform .28s cubic-bezier(.4,0,.2,1), background .15s;
}
.sidebar__toggle:hover {
  color: var(--sky-500);
  background: #fff;
  box-shadow: var(--shadow-md);
}
.sidebar__toggle .icon { width: 14px; height: 14px; stroke-width: 2.6; }
/* 折叠状态：箭头旋转 180° */
.sidebar--collapsed .sidebar__toggle .icon {
  transform: rotate(180deg);
}
/* 缩进态：折叠按钮移到侧边栏内部居中 */
.sidebar--collapsed .sidebar__toggle {
  right: auto;
  left: 50%;
  transform: translateY(-50%) translateX(-50%);
}

/* ---------- 4c. 侧边栏缩进状态（仅图标模式） ---------- */
.sidebar--collapsed {
  width: 64px;
  min-width: 64px;
}
.sidebar--collapsed .sidebar__brand {
  justify-content: center;
  padding: 0;
}
/* 缩进态 logo 绝对居中 */
.sidebar--collapsed .sidebar__logo {
  margin: 0 auto;
}
.sidebar--collapsed .sidebar__title,
.sidebar--collapsed .sidebar__subtitle {
  display: none;
}
.sidebar--collapsed .nav-item {
  justify-content: center;
  padding: 10px 0;
  position: relative;
}
.sidebar--collapsed .nav-item__label {
  display: none;
}
.sidebar--collapsed .nav-group__label {
  text-align: center;
  font-size: 0;   /* 隐藏文字但保留占位 */
  padding: 12px 0 4px;
}
.sidebar--collapsed .nav-item__badge {
  /* 缩进态：保留角标，改为右上角小红点（绝对定位在图标上） */
  position: absolute;
  top: 4px;
  right: 14px;
  min-width: 16px;
  height: 16px;
  padding: 0 5px;
  font-size: 10px;
  line-height: 16px;
  border-radius: 9999px;
  box-shadow: 0 0 0 2px var(--sidebar-bg);
}
.sidebar--collapsed .tenant-card {
  justify-content: center;
  align-items: center;
  padding: 10px 0;
  margin: 0 auto;          /* 兜底：在 sidebar 居中 */
  width: auto;
  background: transparent; /* 缩进态：去掉浅色方块底，与 sidebar 同色融合 */
  border-radius: 0;
}
.sidebar--collapsed .tenant-card__avatar {
  margin: 0 auto;          /* 兜底：头像本身居中 */
}
.sidebar--collapsed .tenant-card__name,
.sidebar--collapsed .tenant-card__meta {
  display: none;
}

/* ---------- 4d. 缩进态：hover 单项弹浮动面板（popover） ---------- */
.sidebar__popover {
  position: fixed;
  z-index: 50;
  min-width: 220px;
  max-width: 280px;
  padding: 14px 16px;
  background: #FFFFFF;
  color: var(--gray-900);
  border: 1px solid var(--gray-100);
  border-radius: 12px;
  box-shadow:
    0 4px 6px -1px rgba(15, 23, 42, 0.06),
    0 16px 32px -4px rgba(15, 23, 42, 0.12);
  font-size: 13.5px;
  line-height: 1.5;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity .18s ease, transform .18s ease;
}
.sidebar__popover.is-visible {
  opacity: 1;
  transform: translateX(0);
}
/* 左侧小三角指示器 */
.sidebar__popover::before {
  content: "";
  position: absolute;
  top: 18px;
  left: -6px;
  width: 12px;
  height: 12px;
  background: #FFFFFF;
  border-left: 1px solid var(--gray-100);
  border-bottom: 1px solid var(--gray-100);
  transform: rotate(45deg);
}
.sidebar__popover__group {
  color: var(--sky-500);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--gray-200);
}
.sidebar__popover__main {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar__popover__icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  padding: 5px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--sky-50), #FFFFFF);
  border: 1px solid var(--sky-100);
  color: var(--sky-500);
  stroke-width: 2.2;
}
.sidebar__popover__label {
  color: var(--gray-900);
  font-size: 14.5px;
  font-weight: 700;
  flex: 1;
  min-width: 0;
}
.sidebar__popover__badge {
  flex-shrink: 0;
  background: var(--orange-500);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  min-width: 20px;
  text-align: center;
}
.sidebar__popover__desc {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--gray-100);
  color: var(--gray-500);
  font-size: 12px;
  line-height: 1.55;
}

/* ---------- 5. 顶栏 ---------- */
.topbar {
  grid-area: topbar;
  background: var(--surface-card);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  width: 100%;        /* grid 1fr 单元内强制铺满 */
  min-width: 0;
  z-index: 20;
}
.topbar__crumbs { display: flex; align-items: center; gap: 8px; color: var(--gray-500); font-size: 13px; }
.topbar__crumbs b { color: var(--gray-800); font-weight: 600; }
.topbar__spacer { flex: 1; }

.role-switch {
  display: flex;
  background: var(--gray-100);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 2px;
}
.role-switch__btn {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gray-500);
  transition: all .18s;
  white-space: nowrap;
}
.role-switch__btn.active {
  background: var(--surface-card);
  color: var(--orange-600);
  box-shadow: var(--shadow-xs);
}

.topbar__search {
  display: flex; align-items: center; gap: 8px;
  background: var(--gray-100);
  border-radius: var(--radius-full);
  padding: 8px 14px;
  width: 240px;
  color: var(--gray-500);
}
.topbar__search input { border: none; background: none; outline: none; font-size: 13px; width: 100%; color: var(--gray-800); }
.icon-btn {
  width: var(--btn-h-md); height: var(--btn-h-md);
  border-radius: var(--btn-radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-500); font-size: 17px;
  position: relative;
  transition: background .15s;
}
.icon-btn:hover { background: var(--gray-100); }
.icon-btn__dot {
  position: absolute; top: 6px; right: 6px;
  min-width: 16px; height: 16px; padding: 0 4px;
  box-sizing: border-box;
  border-radius: 999px;
  background: var(--error-500); border: 1.5px solid #fff;
  color: #fff; font-size: 10px; font-weight: 600; line-height: 13px;
  display: none; align-items: center; justify-content: center;
  pointer-events: none;
}
.icon-btn__dot:not([hidden]) { display: flex; }

/* ===== 消息中心（2026-08-09）===== */
.ntf-tabs { display: flex; gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--gray-200); overflow-x: auto; flex-shrink: 0; }
.ntf-tab {
  flex: 0 0 auto; padding: 6px 12px; border: none; background: transparent;
  border-radius: 999px; font-size: 12.5px; color: var(--gray-600); cursor: pointer;
  font-family: inherit; white-space: nowrap; transition: background .15s, color .15s;
}
.ntf-tab:hover { background: var(--gray-100); }
.ntf-tab.is-active { background: rgba(37,99,235,.10); color: #2563EB; font-weight: 600; }
.ntf-list { display: flex; flex-direction: column; }
.ntf-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 14px 18px;
  border-bottom: 1px solid var(--gray-100); cursor: pointer; position: relative; transition: background .12s;
}
.ntf-item:hover { background: var(--gray-50); }
.ntf-item.is-read { opacity: .6; }
.ntf-item__dot { flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--error-500); margin-top: 6px; }
.ntf-item__main { flex: 1; min-width: 0; }
.ntf-item__head { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.ntf-item__title { font-size: 13.5px; font-weight: 600; color: var(--gray-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ntf-item__cat { flex-shrink: 0; font-size: 11px; }
.ntf-item__body { font-size: 12.5px; color: var(--gray-600); line-height: 1.5; word-break: break-word; }
.ntf-item__time { font-size: 11px; color: var(--gray-400); margin-top: 4px; }
.ntf-item__del {
  flex-shrink: 0; width: 24px; height: 24px; border: none; background: transparent;
  color: var(--gray-400); cursor: pointer; border-radius: var(--radius-sm); font-size: 16px; line-height: 1;
  display: flex; align-items: center; justify-content: center; transition: background .15s, color .15s;
}
.ntf-item__del:hover { background: var(--gray-100); color: var(--error-500); }
.topbar__user {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px 6px 12px;
  border-left: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  transition: background .15s;
  position: relative;
}
.topbar__user:hover,
.topbar__user.is-open {
  background: var(--gray-100);
}
.topbar__user-caret {
  width: 14px; height: 14px;
  color: var(--gray-500);
  transition: transform .25s cubic-bezier(.16,1,.3,1);
}
.topbar__user.is-open .topbar__user-caret {
  transform: rotate(180deg);
}

/* ---------- 4e. 用户下拉菜单 ---------- */
.user-menu {
  position: fixed;          /* 绕过 .app { overflow: hidden } 裁切 */
  top: 60px;                /* 顶栏下方 60+8=68 像素 */
  right: 20px;
  min-width: 260px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px -8px rgba(15, 23, 42, 0.18);
  z-index: 100;
  opacity: 0;
  transform: translateY(-6px) scale(.98);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s cubic-bezier(.16,1,.3,1);
  overflow: hidden;
}
.user-menu.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.user-menu__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--sky-50) 0%, #FFFFFF 100%);
}
.user-menu__avatar-wrap {
  position: relative;
  width: 40px; height: 40px;
  flex-shrink: 0;
}
.user-menu__avatar-wrap .avatar-img,
.user-menu__avatar-wrap .avatar-fallback {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
}
.user-menu__avatar {
  width: 40px; height: 40px;
  font-size: 15px;
  flex-shrink: 0;
}
.user-menu__info { min-width: 0; flex: 1; }
.user-menu__name {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-menu__email {
  font-size: 12px;
  color: var(--gray-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-menu__divider {
  height: 1px;
  background: var(--gray-200);
  margin: 4px 0;
}
.user-menu__item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: transparent;
  text-align: left;
  font-size: 13.5px;
  color: var(--gray-800);
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background .12s, color .12s;
}
.user-menu__item .icon {
  width: 16px; height: 16px;
  color: var(--gray-500);
  flex-shrink: 0;
  transition: color .12s;
}
.user-menu__item:hover {
  background: var(--gray-50);
  color: var(--sky-600);
}
.user-menu__item:hover .icon {
  color: var(--sky-500);
}
.user-menu__item--danger {
  color: var(--error);
}
.user-menu__item--danger .icon {
  color: var(--error);
}
.user-menu__item--danger:hover {
  background: rgba(239, 68, 68, 0.06);
  color: var(--error);
}
.user-menu__shortcut {
  margin-left: auto;
  font-size: 11px;
  line-height: 1;
  color: var(--gray-400);
  font-family: var(--font-mono);
  padding: 3px 6px;
  background: var(--gray-100);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

/* ---------- 4f. 账户安全设置 Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal.is-open,
.modal.active {
  display: flex;
  animation: modalFadeIn .25s ease;
}
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal__dialog {
  position: relative;
  width: 100%;
  max-width: 760px;
  max-height: calc(100vh - 48px);
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalScaleIn .3s cubic-bezier(.16, 1, .3, 1);
}
/* A4 基准文档弹框：210mm x 297mm 按 96dpi 约 794x1123px；宽 820px 接近 A4 宽度，高度随视口尽量舒展 */
.modal__dialog--a4 {
  max-width: 820px;
  max-height: calc(100vh - 64px);
}
.modal__dialog--a4 .modal__body { max-height: none; }
@media (max-width: 900px) {
  .modal__dialog--a4 { max-width: calc(100vw - 32px); }
}
@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes modalScaleIn {
  from { opacity: 0; transform: scale(.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-200);
}
.modal__title {
  font-size: 17px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.3px;
}
.modal__sub {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 2px;
}
.modal__close {
  background: transparent;
  border: none;
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.modal__close:hover {
  background: var(--gray-100);
  color: var(--gray-700);
}
/* 账户安全弹框 - 右上角账号胶囊（头像+姓名+手机） */
.account-capsule {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 4px 4px;
  background: linear-gradient(135deg, var(--sky-50), #fff);
  border: 1px solid var(--sky-200);
  border-radius: 999px;
  font-size: 12px;
  color: var(--gray-800);
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
  margin-right: 10px;
}
.account-capsule__avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--sky-500), var(--sky-600));
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.account-capsule__phone {
  color: var(--gray-500);
  font-weight: 400;
}
  color: var(--gray-900);
}
.modal__close .icon { width: 16px; height: 16px; }

.modal__body {
  display: grid;
  grid-template-columns: 240px 1fr;
  flex: 1;
  min-height: 0;
}
.modal__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--gray-200);
  flex-wrap: wrap;
}
@media (max-width: 560px) {
  .modal__footer {
    flex-direction: column;
    align-items: stretch;
  }
  .modal__footer > .btn,
  .modal__footer > div { width: 100%; }
  .modal__footer > div { display: flex; flex-direction: column; gap: 10px; }
}

/* ===================== 消息中心右侧半屏抽屉（V2.3.542，复用业务研发中心 .brd-drawer 视觉，仍受 ModalManager 治理） ===================== */
.modal--drawer-right {
  align-items: stretch;
  justify-content: flex-end;
  padding: 0;
}
.modal--drawer-right .modal__backdrop {
  background: rgba(15, 23, 42, 0.35);
}
.modal--drawer-right .modal__dialog {
  width: 600px;
  max-width: 92vw;
  max-height: 100%;
  height: 100%;
  border-radius: 0;
  box-shadow: -4px 0 24px rgba(15, 23, 42, 0.12);
  animation: ntfDrawerIn .25s ease-out;
}
@keyframes ntfDrawerIn {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
@media (max-width: 560px) {
  .modal--drawer-right .modal__dialog { width: 100%; max-width: 100vw; }
}

/* ===================== M3 Agent 密钥管理 ===================== */
/* 弹框独立显隐：避开简报锁定 CSS 的 .bf-modal-mask 默认可见性依赖（bf-modal-mask 基样式为 display:flex） */
#agent-keys-modal { display: none; }
#agent-keys-modal.active { display: flex; }
#agent-keys-modal.active .bf-modal { display: flex; }
/* V2.3.663：公司管理 3 弹框（form/member/policy）显隐——.bf-modal-mask 默认 display:flex 需 id 级显隐 */
#cmp-form-modal,
#cmp-member-modal,
#cmp-policy-modal { display: none; }
#cmp-form-modal.active,
#cmp-member-modal.active,
#cmp-policy-modal.active { display: flex; }
.bf-modal--agent-key { max-width: 560px; }

/* 凭证列表项 */
.ak-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  background: var(--surface-card);
}
.ak-item__main { min-width: 0; flex: 1; }
.ak-item__name { font-size: 14px; font-weight: 700; color: var(--gray-900); display: flex; align-items: center; gap: 8px; }
.ak-item__meta { font-size: 12px; color: var(--gray-500); margin-top: 4px; word-break: break-all; }
.ak-item__meta code { background: var(--gray-100); padding: 1px 5px; border-radius: 4px; font-size: 11px; color: var(--gray-700); }
.ak-item__actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.ak-badge { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; }
.ak-badge--active { background: rgba(16, 185, 129, 0.12); color: #059669; }
.ak-badge--revoked { background: var(--gray-100); color: var(--gray-500); }

/* ── 智能体管理中心：增强布局 ── */
.grid-2-1 { grid-template-columns: 1.6fr 1fr; }

/* 凭证卡片增强 */
.ak-item { padding: 16px 18px; margin-bottom: 10px; border: 1px solid var(--gray-200); border-radius: var(--radius-md); background: var(--surface-card); transition: border-color .15s; }
.ak-item:hover { border-color: var(--sky-300); }
.ak-item__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ak-item__name { font-size: 14px; font-weight: 700; color: var(--gray-900); display: flex; align-items: center; gap: 8px; }
.ak-item__actions { display: flex; gap: 6px; flex-shrink: 0; }
.ak-item__body { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.ak-item__field { font-size: 12px; color: var(--gray-500); }
.ak-item__field strong { color: var(--gray-700); font-weight: 600; }
.ak-item__field code { background: var(--gray-100); padding: 1px 5px; border-radius: 4px; font-size: 11px; color: var(--gray-700); }

/* 调用监控面板 */
.usage-agent { padding: 12px 0; border-bottom: 1px solid var(--gray-100); }
.usage-agent:last-child { border-bottom: none; }
.usage-agent__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.usage-agent__name { font-size: 13px; font-weight: 600; color: var(--gray-900); }
.usage-agent__calls { font-size: 13px; font-weight: 700; color: var(--sky-600); }
.usage-agent__bars { display: flex; flex-direction: column; gap: 4px; }
.usage-bar { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--gray-500); }
.usage-bar__label { min-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usage-bar__track { flex: 1; height: 6px; background: var(--gray-100); border-radius: 3px; overflow: hidden; }
.usage-bar__fill { height: 100%; border-radius: 3px; background: var(--sky-500); transition: width .3s; }
.usage-bar__val { min-width: 36px; text-align: right; font-weight: 600; color: var(--gray-700); }
.usage-empty { text-align: center; padding: 32px 0; color: var(--gray-400); font-size: 13px; }

/* 左侧 Tab 列表 */
.modal__nav {
  border-right: 1px solid var(--gray-200);
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--gray-50);
  overflow-y: auto;
}
.modal-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  text-align: left;
  cursor: pointer;
  transition: background .15s;
  font-family: inherit;
  width: 100%;
}
.modal-tab:hover {
  background: var(--gray-100);
}
.modal-tab.is-active {
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.modal-tab__icon {
  width: 32px; height: 32px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.modal-tab__icon .icon { width: 16px; height: 16px; }
.modal-tab__info { flex: 1; min-width: 0; }
.modal-tab__title { font-size: 13.5px; font-weight: 600; color: var(--gray-900); }
.modal-tab__desc { font-size: 11px; color: var(--gray-500); margin-top: 1px; }
.modal-tab__arrow {
  width: 14px; height: 14px;
  color: var(--gray-400);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity .15s;
}
.modal-tab.is-active .modal-tab__arrow { opacity: 1; color: var(--sky-500); }

/* 右侧内容 */
.modal__content {
  padding: 24px 28px;
  overflow-y: auto;
}
.modal-panel {
  display: none;
  flex-direction: column;
  gap: 14px;
}
.modal-panel.is-visible { display: flex; }
/* 微信换绑面板：qr-section 内的 img 单独居中 */
.modal-panel.is-visible#panel-wechat .qr-section { display: block; }
.modal-panel.is-visible#panel-wechat .qr-section img { display: block; margin: 0 auto; }
.modal-panel.is-visible#panel-wechat .qr-section .qr-frame { margin: 0 auto; }
.modal-panel.is-visible#panel-wechat .qr-hint,
.modal-panel.is-visible#panel-wechat .qr-status { text-align: center; }
.modal-panel__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 2px;
}
.modal-panel__desc {
  font-size: 12.5px;
  color: var(--gray-500);
  margin-bottom: 8px;
  line-height: 1.5;
}
.modal-panel__desc b { color: var(--gray-800); font-weight: 600; }

/* 表单 */
.modal-panel .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.modal-panel .form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
}
.modal-panel .form-input {
  width: 100%;
  padding: 11px 14px;
  background: #fff;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  color: var(--gray-900);
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.modal-panel .form-input:focus {
  border-color: var(--sky-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.08);
}
.modal-panel .form-input::placeholder { color: var(--gray-400); }
.modal-panel .btn--primary {
  margin-top: 8px;
}

/* 强度条 */
.strength {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}
.strength__bar {
  flex: 1; height: 3px;
  background: var(--gray-200);
  border-radius: 2px;
  transition: background .25s;
}
.strength[data-level="1"] .strength__bar:nth-child(1) { background: var(--error); }
.strength[data-level="2"] .strength__bar:nth-child(-n+2) { background: var(--warning); }
.strength[data-level="3"] .strength__bar:nth-child(-n+3) { background: var(--sky-400); }
.strength[data-level="4"] .strength__bar:nth-child(-n+4) { background: var(--success); }
.strength__label { font-size: 11px; color: var(--gray-500); margin-top: 4px; }
.strength__label b { font-weight: 600; color: var(--gray-700); }
.strength[data-level="1"] ~ .strength__label b { color: var(--error); }
.strength[data-level="2"] ~ .strength__label b { color: var(--warning); }
.strength[data-level="3"] ~ .strength__label b { color: var(--sky-500); }
.strength[data-level="4"] ~ .strength__label b { color: var(--success); }

/* 已绑定状态卡 */
.bind-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--sky-50) 0%, #fff 100%);
  border: 1px solid var(--sky-100);
  border-radius: var(--radius-md);
}
.bind-status__avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.bind-status__info { flex: 1; }
.bind-status__name { font-size: 14px; font-weight: 600; color: var(--gray-900); }
.bind-status__meta { font-size: 11px; color: var(--gray-500); margin-top: 2px; }
.btn-text {
  display: inline-flex; align-items: center;
  background: none; border: none;
  color: var(--gray-600);
  font-size: var(--btn-fz-sm); font-weight: 500;
  cursor: pointer; font-family: inherit;
  height: var(--btn-h-sm); padding: 0 10px;
  border-radius: calc(var(--btn-radius) - 1px);
  transition: color .15s, background .15s; line-height: 1;
  box-sizing: border-box;
}
.btn-text:hover { color: var(--gray-900); background: var(--gray-100); }
.btn-text--danger { color: var(--error-500); }
.btn-text--danger:hover { color: var(--error-500); background: rgba(239, 68, 68, 0.06); }

.form-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 4px;
  font-size: 11px;
  color: var(--gray-500);
  letter-spacing: 1px;
}
.form-divider::before,
.form-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}
.form-divider span { text-transform: uppercase; }

/* 空状态 */
.empty-state {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--gray-50);
  border: 1px dashed var(--gray-300);
  border-radius: var(--radius-md);
  color: var(--gray-500);
  font-size: 13px;
}
.empty-state .icon { width: 18px; height: 18px; color: var(--gray-400); }

/* QR 区 */
.modal-panel .qr-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}
.modal-panel .qr-frame {
  width: 160px; height: 160px;
  border-radius: var(--radius-md);
  background: #fff;
  padding: 8px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.1);
  border: 2px solid var(--gray-100);
}
.modal-panel .qr-frame__inner {
  width: 100%; height: 100%;
  border-radius: calc(var(--radius-md) - 4px);
  background: #f8fafc;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.modal-panel .qr-placeholder {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 1.5px;
  width: 85%; height: 85%;
}
.modal-panel .qr-frame__inner img,
.modal-panel .qr-placeholder img {
  display: block;
  width: 100%; height: 100%;
  object-fit: contain;
}
.modal-panel .qr-cell {
  border-radius: 1px;
  background: var(--gray-800);
  opacity: 0;
}
.modal-panel .qr-cell.on { opacity: 1; }
.modal-panel .qr-hint {
  font-size: 12px;
  color: var(--gray-500);
  text-align: center;
  line-height: 1.6;
}
.modal-panel .qr-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--gray-500);
}
.modal-panel .qr-status__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: dotBlink 2s ease-in-out infinite;
}
@keyframes dotBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ---------- 4g. Modal 扩展（隐私设置 / 注销） ---------- */
.modal-nav__divider {
  height: 1px;
  background: var(--gray-200);
  margin: 8px 4px;
}
.modal-tab--danger .modal-tab__title { color: var(--error); }
.modal-tab--danger.is-active .modal-tab__arrow { color: var(--error); }

/* ===================== 切换用户弹框（V2.3.489，复用 .modal 框架）===================== */
.sw-body { padding: 22px 24px; overflow-y: auto; flex: 1; min-height: 0; }
.sw-current { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: linear-gradient(135deg, var(--sky-50) 0%, #fff 100%); border: 1px solid var(--sky-100); border-radius: var(--radius-md); margin-bottom: 18px; }
.sw-current__avatar { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, var(--sky-500), var(--sky-600)); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; flex-shrink: 0; overflow: hidden; position: relative; }
.sw-current__avatar img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; display: none; }
.sw-current__avatar span { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.sw-current__info { flex: 1; min-width: 0; }
.sw-current__name { font-size: 15px; font-weight: 700; color: var(--gray-900); }
.sw-current__meta { font-size: 12px; color: var(--gray-500); margin-top: 2px; }
.sw-current__badge { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: rgba(16,185,129,.12); color: #16a34a; }

.sw-section-title { font-size: 13px; font-weight: 700; color: var(--gray-900); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.sw-section-hint { font-size: 11.5px; color: var(--gray-400); font-weight: 400; }

.sw-accounts { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.sw-chip { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-md); cursor: pointer; transition: all .15s; min-width: 0; }
.sw-chip:hover { border-color: var(--sky-500); box-shadow: 0 2px 8px rgba(59,130,246,.08); }
.sw-chip--active { border-color: var(--sky-500); background: var(--sky-50); }
.sw-chip__avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--gray-200); display: flex; align-items: center; justify-content: center; font-weight: 600; color: var(--gray-700); font-size: 13px; flex-shrink: 0; overflow: hidden; position: relative; }
.sw-chip__avatar img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; display: none; }
.sw-chip__avatar span { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.sw-chip__info { min-width: 0; }
.sw-chip__name { font-size: 13px; font-weight: 600; color: var(--gray-900); }
.sw-chip__meta { font-size: 11px; color: var(--gray-500); }
.sw-chip__check { width: 18px; height: 18px; color: var(--sky-500); flex-shrink: 0; }
.sw-add { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px dashed var(--gray-300); border-radius: var(--radius-md); color: var(--gray-500); font-size: 13px; cursor: pointer; transition: all .15s; background: var(--gray-50); }
.sw-add:hover { border-color: var(--sky-500); color: var(--sky-600); background: var(--sky-50); }

/* ===== 切换用户弹框 · 扫码区重新设计（V2.3.494）===== */
.sw-scan { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius-md); padding: 16px; }
.sw-tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.sw-tab { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--radius-sm); border: 1px solid var(--gray-200); background: #fff; color: var(--gray-700); font-size: 12px; font-weight: 600; cursor: pointer; transition: all .15s; }
.sw-tab:hover { border-color: var(--sky-300); }
.sw-tab.is-active { border-color: var(--sky-500); background: var(--sky-50); color: var(--sky-600); }
.sw-tab__dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.sw-tab__dot.wechat { background: #07C160; }
.sw-tab__dot.alipay { background: #1677FF; }
.sw-tab__dot.douyin { background: #1C1A16; }
.sw-tab__dot.huawei { background: #CF0A2C; }

.sw-panels { position: relative; }
.sw-panel { display: none; }
.sw-panel.is-visible { display: grid; grid-template-columns: 1fr 180px; gap: 20px; align-items: center; }
.sw-panel__info { min-width: 0; }
.sw-panel__title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--gray-900); margin-bottom: 6px; }
.sw-panel__icon { width: 22px; height: 22px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.sw-panel__icon.wechat { background: #07C160; }
.sw-panel__icon.alipay { background: #1677FF; }
.sw-panel__icon.douyin { background: #1C1A16; }
.sw-panel__icon.huawei { background: #CF0A2C; }
.sw-panel__desc { font-size: 12px; color: var(--gray-500); margin-bottom: 14px; }
.sw-panel__steps { list-style: none; font-size: 12px; color: var(--gray-600); line-height: 1.8; margin-bottom: 16px; padding: 0; }
.sw-panel__steps li { display: flex; align-items: flex-start; gap: 8px; }
.sw-panel__steps .num { width: 18px; height: 18px; border-radius: 50%; background: var(--sky-100); color: var(--sky-600); font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 2px; }
.sw-panel__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sw-panel__btn { padding: 7px 14px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600; cursor: pointer; border: none; transition: all .15s; }
.sw-panel__btn--primary { background: var(--sky-500); color: #fff; }
.sw-panel__btn--primary:hover { background: var(--sky-600); }
.sw-panel__btn--ghost { background: #fff; border: 1px solid var(--gray-200); color: var(--gray-700); }
.sw-panel__btn--ghost:hover { border-color: var(--sky-300); }
.sw-panel__qr { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.sw-panel__qr-label { font-size: 11px; color: var(--gray-500); text-align: center; }

/* 二维码（切换用户弹框内独立作用域；原 .qr-* 为 .modal-panel 作用域，此处需显式定义） */
.sw-panel .qr-frame { width: 150px; height: 150px; border-radius: var(--radius-md); background: #fff; padding: 8px; box-shadow: 0 2px 8px rgba(15,23,42,.06); border: 1px solid var(--gray-200); }
.sw-panel .qr-frame__inner { width: 100%; height: 100%; border-radius: calc(var(--radius-md) - 4px); background: #f8fafc; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.sw-panel .qr-placeholder { display: grid; grid-template-columns: repeat(11, 1fr); gap: 1.5px; width: 85%; height: 85%; }
.sw-panel .qr-cell { border-radius: 1px; background: var(--gray-900); opacity: 0; }
.sw-panel .qr-cell.on { opacity: 1; }
/* 真实小程序码（与登录页 /system/scan-ticket 同源） */
.sw-qr-real { width: 100%; height: 100%; border-radius: calc(var(--radius-md) - 4px); background-color: #fff; background-position: center; background-size: 100% 100%; background-repeat: no-repeat; }
.sw-qr-loading { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 11px; color: var(--gray-500); text-align: center; padding: 12px; }
.sw-qr-error { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; font-size: 11px; color: var(--gray-600); text-align: center; gap: 6px; padding: 12px; }
.sw-qr-error__icon { width: 26px; height: 26px; border-radius: 50%; background: rgba(239,68,68,.1); color: #ef4444; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }

/* 已关联平台：绿色状态卡片替代二维码 */
.sw-panel__linked-status { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--success-500); font-weight: 600; margin-bottom: 4px; }
.sw-panel__linked-status .qr-status__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success-500); animation: dotBlink 2s ease-in-out infinite; }
.sw-panel__linked-sub { font-size: 11px; color: var(--gray-500); margin-bottom: 12px; }
.sw-linked { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; width: 150px; padding: 20px 16px; background: var(--success-50); border: 1px solid rgba(34,197,94,.25); border-radius: var(--radius-md); text-align: center; }
.sw-linked__badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--success-500); }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success-500); animation: dotBlink 2s ease-in-out infinite; }
.sw-linked__name { font-size: 13px; font-weight: 700; color: var(--gray-900); }
.sw-linked__meta { font-size: 11px; color: var(--gray-500); }

@media (max-width: 720px) {
  .sw-panel.is-visible { grid-template-columns: 1fr; text-align: center; }
  .sw-panel__steps { display: inline-block; text-align: left; }
  .sw-panel__qr { order: -1; }
}

/* 设置行 */
.settings-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
}
.settings-row__info { flex: 1; min-width: 0; }
.settings-row__title { font-size: 13.5px; font-weight: 600; color: var(--gray-900); margin-bottom: 2px; }
.settings-row__desc { font-size: 11.5px; color: var(--gray-500); line-height: 1.5; }

/* iOS 风开关 */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch__slider {
  position: absolute; inset: 0;
  background: var(--gray-300);
  border-radius: 22px;
  transition: background .2s;
}
.switch__slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 2px; top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform .25s cubic-bezier(.4, 0, .2, 1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.switch input:checked + .switch__slider { background: var(--sky-500); }
.switch input:checked + .switch__slider::before { transform: translateX(18px); }

/* 危险区（注销） */
.danger-zone {
  background: rgba(239, 68, 68, 0.04);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.danger-zone__title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--error);
  margin-bottom: 8px;
}
.danger-zone__title .icon { width: 14px; height: 14px; }
.danger-zone__list {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  color: var(--gray-700);
  line-height: 1.8;
}
.danger-zone__list li::marker { color: var(--error); }

/* =============================================
   4h. 系统页面统一显示规范
   - 字段定义（label）/ 字段值（value）
   - 数字：等宽字体 + 颜色梯度
   - 时间：统一 YYYY-MM-DD HH:mm 格式
   - 数据单元格：左对齐 + 微高亮
   ============================================= */

/* 字段：label（小灰） + value（深色等宽） */
.field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px dashed var(--gray-100);
}
.field:last-child { border-bottom: none; }
.field__label {
  font-size: 12.5px;
  color: var(--gray-500);
  font-weight: 500;
  letter-spacing: .2px;
}
.field__value {
  font-size: 13px;
  color: var(--gray-900);
  font-weight: 600;
  font-variant-numeric: tabular-nums;  /* 等宽数字对齐 */
}
.field__value--muted {
  color: var(--gray-400);
  font-weight: 500;
}
.field__value--mono {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 12px;
  letter-spacing: -.2px;
}

/* field 右侧操作链接（管理/修改/申请注销 等） */
.field__action {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--info-500);
  text-decoration: none;
  cursor: pointer;
  transition: color .15s, opacity .15s;
}
.field__action:hover {
  color: var(--info-500);
  opacity: .8;
  text-decoration: underline;
}
.field__action--danger {
  color: var(--error-500);
}
.field__action--danger:hover {
  color: var(--error-500);
  opacity: .8;
  text-decoration: underline;
}

/* chip 内部小圆点（已绑定状态指示） */
.chip__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success-500);
  display: inline-block;
}

/* 数字徽标：用于 KPI 数字 */
.metric {
  font-size: 22px;
  font-weight: 800;
  color: var(--gray-900);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.5px;
  line-height: 1.1;
}
.metric--sm { font-size: 16px; }
.metric--lg { font-size: 28px; }

/* 状态 chip：统一形态 */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  font-size: 11.5px;
  font-weight: 500;
  border-radius: var(--radius-full);
  background: var(--gray-100);
  color: var(--gray-600);
  font-variant-numeric: tabular-nums;
}
.chip--primary { background: var(--info-50); color: var(--info-500); }
.chip--success { background: var(--success-50); color: var(--success-500); }
.chip--warning { background: var(--warning-50); color: #B7791F; }
.chip--danger  { background: var(--error-50); color: var(--error-500); }
.chip--neutral { background: var(--gray-100); color: var(--gray-500); }

/* 时间字符串统一格式 */
.time {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--gray-700);
  font-variant-numeric: tabular-nums;
}
.time--dim { color: var(--gray-500); }
.time--full { font-size: 11.5px; }

/* 表格：列右对齐的数字列 + 鼠标悬停高亮 */
.data-table tbody tr {
  transition: background .12s;
}
.data-table tbody tr:hover {
  background: var(--gray-50);
}
.data-table td.num,
.data-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.data-table td.mono,
.data-table th.mono {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--gray-600);
}

/* 用户信息卡片：弱化次要文字 */
.profile-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.3px;
  margin-bottom: 2px;
}
.profile-openid {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 11.5px;
  color: var(--gray-500);
  margin-bottom: 6px;
  letter-spacing: -.2px;
}
.profile-avatar-wrap {
  position: relative;
  width: 60px; height: 60px;
  flex-shrink: 0;
}
.profile-avatar-wrap img,
.profile-avatar-wrap .avatar-fallback {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  border-radius: var(--radius-full);
  object-fit: cover;
}
.profile-meta {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.profile-meta__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px dashed var(--gray-100);
}
.profile-meta__row:last-child { border-bottom: none; }
.profile-meta__row .field__label { font-size: 12.5px; }
.profile-meta__row .field__value { font-size: 13px; }

/* KPI 网格中数字 + 标签对齐 */
.kpi-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0;
}
.kpi-stack__label {
  font-size: 11.5px;
  color: var(--gray-500);
  font-weight: 500;
}
.kpi-stack__value {
  font-size: 22px;
  font-weight: 800;
  color: var(--gray-900);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.5px;
}

@media (max-width: 640px) {
  .modal__dialog { max-width: 100%; }
  .modal__body { grid-template-columns: 1fr; }
  .modal__nav {
    flex-direction: row;
    border-right: none;
    border-bottom: 1px solid var(--gray-200);
    overflow-x: auto;
  }
  .modal-tab { flex-shrink: 0; min-width: 120px; }
  .modal-tab__arrow { display: none; }
}
.topbar__user img, .avatar-img {
  width: 34px; height: 34px; border-radius: var(--radius-full);
  object-fit: cover; background: var(--gray-200);
}
.avatar-fallback {
  width: 34px; height: 34px; border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 13px;
}
.topbar__user-name { font-size: 13px; font-weight: 600; color: var(--gray-800); }
.topbar__user-role { font-size: 11px; color: var(--gray-500); }
.topbar__wb-badge { display: inline-flex; align-items: center; padding: 1px 7px; margin-left: 6px; border-radius: var(--radius-full); font-size: 10px; font-weight: 600; color: #fff; background: var(--sky-500, #0ea5e9); vertical-align: middle; line-height: 1.6; }

/* ---------- 6. 内容区 ---------- */
.content {
  grid-area: content;
  overflow-y: auto;
  padding: 24px;
  background: var(--surface-base);
  min-width: 0;        /* grid 子项允许收缩 */
  width: 100%;
}
.view { display: none; animation: fadeIn .25s ease; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-head { margin-bottom: 20px; }
.page-head__title { font-size: 22px; font-weight: 700; color: var(--gray-900); letter-spacing: .3px; }
.page-head__desc { color: var(--gray-500); font-size: 13.5px; margin-top: 4px; }
.page-head__actions { display: flex; gap: 10px; margin-top: 14px; }

/* ---------- 7. 卡片 ---------- */
.card {
  background: var(--surface-card);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.card--pad { padding: 20px; }
.card__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
}
.card__title { font-size: 15px; font-weight: 700; color: var(--gray-900); }
.card__sub { font-size: 12px; color: var(--gray-500); margin-top: 2px; }
.card__body { padding: 20px; }

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-row-2 { grid-row: span 2; }

/* ---------- 8. KPI 卡片 ---------- */
.kpi { display: flex; flex-direction: column; gap: 10px; }
.kpi__top { display: flex; align-items: center; justify-content: space-between; }
.kpi__label { color: var(--gray-500); font-size: 13px; font-weight: 500; }
.kpi__icon {
  width: 38px; height: 38px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  background: var(--gray-100); color: var(--gray-500);
}
.kpi__value { font-size: 28px; font-weight: 800; color: var(--gray-900); letter-spacing: -.5px; }
.kpi__value small { font-size: 15px; font-weight: 600; color: var(--gray-500); }
.kpi__foot { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.trend-up { color: var(--success-500); font-weight: 700; }
.trend-down { color: var(--error-500); font-weight: 700; }
.kpi__foot span { color: var(--gray-400); }

/* ---------- 9. 表格 ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data thead th {
  text-align: left; color: var(--gray-500); font-weight: 600;
  font-size: 12px; text-transform: uppercase; letter-spacing: .5px;
  padding: 12px 16px; border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
}
table.data tbody td { padding: 14px 16px; border-bottom: 1px solid var(--gray-100); color: var(--gray-800); }
table.data tbody tr { transition: background .12s; }
table.data tbody tr:hover { background: var(--surface-hover); }
table.data tbody tr:last-child td { border-bottom: none; }
.cell-strong { font-weight: 600; color: var(--gray-900); }
.cell-sub { color: var(--gray-500); font-size: 12px; }

/* 平台常量表格分类列：英文 key（小灰等宽）+ 中文名（主色加粗） */
.pc-cat { line-height: 1.35; }
.pc-cat__key { font-size: 11px; color: var(--gray-400); background: transparent; padding: 0; }
.pc-cat__label { display: block; font-size: 13px; font-weight: 600; color: var(--gray-900); margin-top: 2px; }
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell .avatar-fallback, .user-cell img { width: 32px; height: 32px; border-radius: var(--radius-full); }
.user-cell img { object-fit: cover; background: var(--gray-200); }
.user-cell__info { display: flex; flex-direction: column; gap: 2px; }

/* ---------- 10. 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--btn-h-md);
  padding: 0 var(--btn-px-md);
  border-radius: var(--btn-radius);
  font-size: var(--btn-fz-md); font-weight: 600;
  border: 1px solid transparent; white-space: nowrap;
  transition: all .18s; line-height: 1;
  box-sizing: border-box;
}
.btn--sm {
  height: var(--btn-h-sm);
  padding: 0 var(--btn-px-sm);
  font-size: var(--btn-fz-sm);
  border-radius: calc(var(--btn-radius) - 1px);
}
.btn--lg {
  height: var(--btn-h-lg);
  padding: 0 var(--btn-px-lg);
  font-size: var(--btn-fz-lg);
}
.btn--block { width: 100%; }
.btn--primary { background: linear-gradient(135deg, var(--sky-500), var(--sky-600)); color: #fff; box-shadow: 0 4px 12px rgba(59,130,246,0.28); }
.btn--primary:hover { filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(59,130,246,0.35); }
.btn--ghost { background: var(--surface-card); color: var(--gray-700); border-color: var(--gray-300); }
.btn--ghost:hover { background: var(--gray-100); }
.btn--soft { background: var(--orange-50); color: var(--orange-600); }
.btn--soft:hover { background: var(--orange-100); }
.btn--danger { background: var(--error-50); color: var(--error-500); }
.btn--danger:hover { background: #FBD9D9; }
.btn--danger-solid { background: var(--error-500); color: #fff; border-color: var(--error-500); }
.btn--danger-solid:hover { background: #DC2626; }
.btn:disabled, .btn.is-disabled { opacity: .55; cursor: not-allowed; transform: none !important; box-shadow: none !important; filter: none !important; }

/* ---------- 11. 标签 / 徽章 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: var(--radius-full);
  font-size: 12px; font-weight: 600; line-height: 1.6;
  white-space: nowrap;
}
.badge--success { background: var(--success-50); color: var(--success-500); }
.badge--info { background: var(--info-50); color: var(--info-500); }
.badge--warning { background: var(--warning-50); color: #B7791F; }
.badge--error { background: var(--error-50); color: var(--error-500); }
.badge--neutral { background: var(--gray-100); color: var(--gray-500); }
.badge--orange { background: var(--orange-50); color: var(--orange-600); }
.badge--sky { background: var(--sky-50); color: var(--sky-700); border: 1px solid var(--sky-200); }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot--on { background: var(--success-500); }
.dot--off { background: var(--gray-400); }

/* ---------- 平台库（组件/API/弹框）紧凑操作栏与胶囊统计 ---------- */
.card__head--compact {
  padding: 10px 20px;
}
.platform-stats-bar {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.platform-stats-bar__item {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-md);
  font-size: 12px; color: var(--gray-600);
  background: var(--gray-100);
  white-space: nowrap; line-height: 1.4;
}
.platform-stats-bar__item strong {
  font-size: 13px; font-weight: 700; color: var(--gray-900);
}
.platform-stats-bar__item--green { background: var(--success-50); color: var(--success-500); }
.platform-stats-bar__item--orange { background: var(--warning-50); color: #B7791F; }
.platform-stats-bar__item--blue { background: var(--info-50); color: var(--info-500); }
.platform-stats-bar__item--purple { background: rgba(168,85,247,.08); color: #A855F7; }
.platform-stats-bar__item--cyan { background: rgba(14,165,233,.08); color: #0EA5E9; }
.platform-stats-bar__item--red { background: rgba(234,88,12,.08); color: #EA580C; }

/* ---------- 12. 开关 Switch ---------- */
.switch { position: relative; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { display: none; }
.switch__track {
  position: absolute; inset: 0; border-radius: 9999px;
  background: var(--gray-300); transition: background .2s; cursor: pointer;
}
.switch__thumb {
  position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: var(--shadow-xs);
  transition: transform .2s;
}
.switch input:checked + .switch__track { background: var(--orange-500); }
.switch input:checked + .switch__track .switch__thumb { transform: translateX(18px); }

/* ---------- 13. 表单 ---------- */
.form-row { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--gray-800); margin-bottom: 7px; }
.form-label .req { color: var(--error-500); margin-left: 3px; }
.input, .select, .textarea {
  width: 100%; height: var(--btn-h-md); padding: 0 14px;
  border: 1px solid var(--gray-300); border-radius: var(--btn-radius);
  font-size: var(--btn-fz-md); color: var(--gray-800); background: var(--surface-card);
  outline: none; transition: border-color .15s, box-shadow .15s; font-family: inherit;
  box-sizing: border-box;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--sky-500); box-shadow: 0 0 0 3px var(--orange-50); }
.textarea { resize: vertical; min-height: 88px; height: auto; }
.input--sm,
.select--sm {
  height: var(--btn-h-sm);
  font-size: var(--btn-fz-sm);
  padding: 0 10px;
}

/* 智能填报：当前用户名胶囊（只读，防止浏览器自动填充手机号） */
.bf-author-chip {
  display: inline-flex;
  align-items: center;
  height: var(--btn-h-sm);
  padding: 0 12px;
  border-radius: 8px;
  background: var(--sky-50);
  border: 1px solid var(--sky-200);
  color: var(--sky-700);
  font-size: var(--btn-fz-sm);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
  cursor: default;
  box-sizing: border-box;
}

.form-hint { font-size: 12px; color: var(--gray-500); margin-top: 6px; }
.form-hint--warn { color: var(--amber-600, #d97706); }
.form-inline { display: flex; gap: 12px; flex-wrap: wrap; }
.form-inline .form-row { flex: 1; min-width: 200px; }

/* ---------- 14. 进度环 / 条形 ---------- */
.ring-wrap { position: relative; width: 120px; height: 120px; display: flex; align-items: center; justify-content: center; }
.ring { transform: rotate(-90deg); }
.ring-label { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; }
.ring-label__value { font-size: 26px; font-weight: 800; color: var(--gray-900); line-height: 1; }
.ring__track { stroke: var(--gray-200); }
.ring__val { stroke: var(--orange-500); stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
.bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.bar-row__label { width: 110px; font-size: 13px; color: var(--gray-700); flex-shrink: 0; }
.bar-track { flex: 1; height: 8px; background: var(--gray-100); border-radius: 9999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 9999px; background: linear-gradient(90deg, var(--orange-300), var(--orange-500)); transition: width 1s ease; }
.bar-row__num { width: 42px; text-align: right; font-size: 13px; font-weight: 700; color: var(--gray-800); }

/* ---------- 15. 图表容器 ---------- */
.chart-card { display: flex; flex-direction: column; }
.chart-box { width: 100%; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 12px; }
.legend__item { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--gray-600); }
.legend__swatch { width: 10px; height: 10px; border-radius: 3px; }

/* ---------- 16. 实时活动流 ---------- */
.feed { display: flex; flex-direction: column; }
.feed__item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--gray-100); }
.feed__item:last-child { border-bottom: none; }
.feed__dot {
  width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex-shrink: 0;
  background: var(--orange-500); box-shadow: 0 0 0 4px var(--orange-50);
}
.feed__dot--info { background: var(--info-500); box-shadow: 0 0 0 4px var(--info-50); }
.feed__dot--success { background: var(--success-500); box-shadow: 0 0 0 4px var(--success-50); }
.feed__main { flex: 1; }
.feed__text { font-size: 13px; color: var(--gray-800); }
.feed__text b { color: var(--gray-900); }
.feed__time { font-size: 11.5px; color: var(--gray-400); margin-top: 2px; }

/* ---------- 17. 排行列表 ---------- */
.rank-list { display: flex; flex-direction: column; gap: 4px; }
.rank-item { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: var(--radius-md); transition: background .12s; }
.rank-item:hover { background: var(--gray-50); }
.rank-no { width: 24px; height: 24px; border-radius: var(--radius-sm); background: var(--gray-100); color: var(--gray-600); font-weight: 700; font-size: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rank-no--1 { background: var(--sky-100); color: var(--sky-700); }
.rank-no--2 { background: var(--gray-200); color: var(--gray-700); }
.rank-no--3 { background: var(--sky-50); color: var(--sky-600); }
.rank-name { flex: 1; font-size: 13.5px; font-weight: 600; color: var(--gray-800); }
.rank-val { font-size: 13px; font-weight: 700; color: var(--orange-600); }

/* ---------- 18. 空状态 / 骨架 ---------- */
.empty { text-align: center; padding: 48px 20px; color: var(--gray-500); }
.empty__icon { font-size: 40px; opacity: .4; margin-bottom: 12px; }
.empty__text { font-size: 14px; }
.skeleton { background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 37%, var(--gray-100) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ---------- 19. 工具类 ---------- */
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-5 { margin-top: 20px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.text-dim { color: var(--gray-500); }
.text-sm { font-size: 12.5px; }
.divider { height: 1px; background: var(--gray-100); margin: 16px 0; }
.section-title { font-size: 14px; font-weight: 700; color: var(--gray-900); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.section-title::before { content: ""; width: 4px; height: 15px; background: var(--orange-500); border-radius: 2px; }

/* ---------- 通用线性图标（极简粗线条 · 不填充 · currentColor 着色） ---------- */
.icon {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor;
  stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0; display: block;
}
.icon--sm { width: 16px; height: 16px; }
.icon--lg { width: 24px; height: 24px; }
.icon--xs { width: 14px; height: 14px; stroke-width: 2.6; }
.role-banner__icon { width: 18px; height: 18px; flex-shrink: 0; }

/* 角色受限提示条 */
.role-banner {
  display: flex; align-items: center; gap: 10px;
  background: var(--info-50); border: 1px solid #C9DCFB;
  color: var(--info-500); padding: 10px 16px; border-radius: var(--radius-md);
  font-size: 13px; font-weight: 500; margin-bottom: 16px;
  position: relative;
}
.role-banner__text { flex: 1; }
.role-banner__close {
  flex-shrink: 0;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: 0; cursor: pointer;
  border-radius: 4px;
  color: var(--info-500);
  opacity: 0.6;
  transition: all 0.15s ease;
  margin-left: auto;
  padding: 0;
}
.role-banner__close:hover {
  opacity: 1;
  background: rgba(37, 99, 235, 0.12);
}
.role-banner__close svg { width: 14px; height: 14px; }
.role-banner.is-dismissing {
  opacity: 0;
  transform: translateY(-4px);
  transition: all 0.25s ease;
}
.role-banner--orange { background: var(--orange-50); border-color: var(--orange-100); color: var(--orange-600); }

/* 角色可见性：通过 body[data-role] 控制 */
[data-role] .only-platform,
[data-role] .only-enterprise,
[data-role] .only-user { display: none; }
[data-role="platform"]   .only-platform   { display: revert; }
[data-role="enterprise"] .only-enterprise { display: revert; }
[data-role="user"]       .only-user       { display: revert; }

/* ---------- 20. 响应式 ---------- */
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 64px 1fr; }
  .sidebar__title, .sidebar__subtitle, .nav-item__label, .nav-group__label, .tenant-card__name, .tenant-card__meta { display: none; }
  /* 角标保留为右上角红点（与桌面缩进态一致） */
  .nav-item__badge {
    position: absolute;
    top: 4px;
    right: 14px;
    min-width: 16px;
    height: 16px;
    padding: 0 5px;
    font-size: 10px;
    line-height: 16px;
    border-radius: 9999px;
    box-shadow: 0 0 0 2px var(--sidebar-bg);
  }
  .nav-item { justify-content: center; }
  .topbar__search { display: none; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .span-2, .span-3 { grid-column: span 1; }
  .span-row-2 { grid-row: span 1; }
}

/* ---------- 21. 综合工作台（多系统整合看板） ---------- */
.wb-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.wb-toolbar__hint { font-size: 12.5px; color: var(--gray-500); }
.wb-toolbar .wb-spacer { flex: 1; }

.wb-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }

.wb-card {
  background: var(--surface-card);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  display: flex; flex-direction: column;
  transition: box-shadow .18s, transform .18s, opacity .18s;
}
.wb-card:hover { box-shadow: var(--shadow-md); }
.wb-card--dragging { opacity: .45; }
.wb-card__head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--gray-100);
}
.wb-card__title { display: flex; align-items: center; gap: 9px; font-size: 14.5px; font-weight: 700; color: var(--gray-900); }
.wb-card__title .icon { color: var(--sky-600); }
.wb-card__meta { display: flex; align-items: center; gap: 12px; }
.wb-refresh { font-size: 11.5px; color: var(--gray-400); white-space: nowrap; }
.wb-refresh__time { color: var(--gray-500); font-weight: 600; font-variant-numeric: tabular-nums; }
.wb-jump { font-size: 12px; font-weight: 600; color: var(--sky-600); white-space: nowrap; cursor: pointer; }
.wb-jump:hover { text-decoration: underline; }
.wb-grip { color: var(--gray-300); cursor: grab; display: inline-flex; }
.wb-grip:active { cursor: grabbing; }
.icon--grip { width: 16px; height: 16px; fill: currentColor; stroke: none; }
.wb-card__body { padding: 16px 18px; }
.wb-card__body .section-title { margin-bottom: 10px; }

/* ERP 区域 */
.wb-erp-kpis { display: flex; gap: 10px; margin-bottom: 14px; }
.wb-erp-kpis .kpi { flex: 1; background: var(--gray-50); border-radius: var(--radius-md); padding: 10px 12px; }
.wb-erp-kpis .kpi__label { font-size: 11.5px; }
.wb-erp-kpis .kpi__value { font-size: 18px; }
.wb-stat-bars .bar-row__label { width: 84px; }
.wb-stock-warn { margin-top: 4px; }
.wb-warn-item { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--gray-100); font-size: 12.5px; }
.wb-warn-item:first-child { border-top: none; }
.wb-warn-name { flex: 1; color: var(--gray-800); font-weight: 600; }
.wb-warn-qty { color: var(--gray-500); font-variant-numeric: tabular-nums; }

/* sys-pane 显示控制（用 class 而非 inline style，避免 inline 优先级问题） */
.sys-pane { display: none !important; }
.sys-pane.active { display: block !important; }

/* OA 区域 */
.wb-todo-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--gray-100); }
.wb-todo-item:first-child { border-top: none; }
.wb-todo-main { flex: 1; min-width: 0; }
.wb-todo-title { font-size: 13px; color: var(--gray-900); font-weight: 600; }
.wb-todo-sub { font-size: 11.5px; color: var(--gray-400); margin-top: 1px; }
.wb-approve-item { padding: 9px 0; border-top: 1px solid var(--gray-100); }
.wb-approve-item:first-child { border-top: none; }
.wb-approve-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12.5px; margin-bottom: 6px; }
.wb-approve-top b { color: var(--gray-900); }

/* 新闻热点 */
.wb-news-item { padding: 10px 0; border-top: 1px solid var(--gray-100); }
.wb-news-item:first-child { border-top: none; }
.wb-news-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.wb-news-title { font-size: 13.5px; font-weight: 700; color: var(--gray-900); }
.wb-news-meta { font-size: 11px; color: var(--gray-400); white-space: nowrap; }
.wb-news-summary { font-size: 12px; color: var(--gray-500); margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.5; }

/* 会员区域 */
.wb-mem-kpis { display: flex; gap: 10px; margin-bottom: 12px; }
.wb-mem-kpis .kpi { flex: 1; text-align: center; background: var(--gray-50); border-radius: var(--radius-md); padding: 10px; }
.wb-mem-kpis .kpi__value { font-size: 20px; }
.wb-mini-chart { width: 100%; height: 72px; }
.wb-level-bars .bar-row__label { width: 64px; }

/* 上市公司 */
.wb-stock-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--gray-100); }
.wb-stock-item:first-child { border-top: none; }
.wb-stock-info { flex: 1; min-width: 0; }
.wb-stock-name { font-size: 13px; font-weight: 600; color: var(--gray-900); }
.wb-stock-code { font-size: 11px; color: var(--gray-400); font-family: var(--font-mono); }
.wb-stock-price { text-align: right; }
.wb-stock-price b { font-size: 14px; color: var(--gray-900); font-variant-numeric: tabular-nums; }
.wb-up { color: var(--error-500); font-weight: 700; font-size: 12px; }   /* A股：红涨 */
.wb-down { color: var(--success-500); font-weight: 700; font-size: 12px; } /* A股：绿跌 */
.wb-stock-detail { margin-top: 10px; padding-top: 12px; border-top: 1px dashed var(--gray-200); }
.wb-fin-row { display: flex; justify-content: space-between; font-size: 12px; padding: 3px 0; color: var(--gray-600); }
.wb-fin-row b { color: var(--gray-900); }

/* 日志与备忘 */
.wb-log-item { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid var(--gray-100); }
.wb-log-item:first-child { border-top: none; }
.wb-log-date { font-size: 11px; color: var(--gray-400); width: 46px; flex-shrink: 0; padding-top: 2px; font-variant-numeric: tabular-nums; }
.wb-log-text { flex: 1; font-size: 12.5px; color: var(--gray-800); line-height: 1.5; }
.wb-memo-item { display: flex; align-items: center; gap: 9px; padding: 7px 0; }
.wb-memo-item input { width: 15px; height: 15px; accent-color: var(--sky-500); flex-shrink: 0; }
.wb-memo-item span { font-size: 12.5px; color: var(--gray-700); }
.wb-memo-item input:checked + span { text-decoration: line-through; color: var(--gray-400); }
.wb-card__foot { padding: 12px 18px; border-top: 1px solid var(--gray-100); }
.wb-card__foot .btn { width: 100%; }

/* 工作台响应式 */
@media (max-width: 1200px) {
  .wb-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .wb-grid { grid-template-columns: 1fr; }
  .wb-grip { display: none; }
  .wb-card { cursor: default; }
}

/* ===================== 服务台 ===================== */
.service-desk { display: flex; flex-direction: column; gap: 28px; }
.service-desk__section { display: flex; flex-direction: column; gap: 14px; }
.service-desk__title {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 700; color: var(--gray-900);
}
.service-desk__dot { width: 8px; height: 8px; border-radius: 50%; }

/* 服务台卡片 */
.sd-card {
  background: var(--surface-card);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex; flex-direction: column; gap: 12px;
  transition: all .2s; cursor: pointer;
}
.sd-card:hover {
  border-color: var(--sky-300);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}
.sd-card__head { display: flex; justify-content: space-between; align-items: flex-start; }
.sd-card__icon {
  width: 38px; height: 38px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  color: var(--gray-700);
  transition: all .2s;
}
.sd-card__icon svg {
  width: 20px; height: 20px;
  stroke-width: 1.8;
}
.sd-card:hover .sd-card__icon {
  background: var(--sky-50);
  border-color: var(--sky-300);
  color: var(--sky-600);
}
.sd-card__badge-group { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.sd-card__title { font-size: 15px; font-weight: 700; color: var(--gray-900); }
.sd-card__desc { font-size: 12.5px; color: var(--gray-500); line-height: 1.5; flex: 1; }
.sd-card__foot { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.sd-card__stat { font-size: 13px; font-weight: 700; color: var(--gray-900); }
.sd-card__stat span { font-size: 11px; font-weight: 500; color: var(--gray-500); }
.sd-card .btn { align-self: flex-start; }

/* 服务台卡片主题色（hover 时高亮） */
.sd-card--fund:hover .sd-card__icon { background: var(--success-50, #ECFDF5); border-color: var(--success-500); color: var(--success-500); }
.sd-card--reconcile:hover .sd-card__icon { background: #FEF3C7; border-color: var(--warning-500); color: var(--warning-500); }
.sd-card--contract:hover .sd-card__icon { background: #DBEAFE; border-color: var(--info-500); color: var(--info-500); }
.sd-card--qualification:hover .sd-card__icon { background: #FEE2E2; border-color: var(--error-500); color: var(--error-500); }

/* 空状态（某角色无权限时） */
.sd-empty {
  background: var(--gray-50); border: 1px dashed var(--gray-300);
  border-radius: var(--radius-lg); padding: 32px; text-align: center; color: var(--gray-500); font-size: 13px;
}

/* 响应式：平板以下改为 2 列 */
@media (max-width: 1100px) {
  .service-desk .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .service-desk .grid-4 { grid-template-columns: 1fr; }
}

/* =====================================================================
   全局消息提示 Toast（规范：所有「弹框操作」反馈统一使用）
   - 位置：右上角固定，top:80px right:24px，z-index:11000，高于弹框(10000)，不打扰主内容
   - 样式：与工作简报信息块保存提示 bfToast 保持一致（参考图 2）
     纯色背景+白字、无图标、圆角 8px、轻微投影、从右侧滑入
   - 颜色：success=#10b981  / error=#ef4444  / info=#3b82f6
   - 行为：显示 2400ms 后从右侧滑出淡出消失
   - 调用：assets/app.js -> showToast(message, type)
   ===================================================================== */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 11000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  background: #10b981;
  color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  max-width: 360px;
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.25s ease;
  pointer-events: auto;
  border: none;
  min-width: auto;
}
.toast--show {
  opacity: 1;
  transform: translateX(0);
}
.toast__icon { display: none; }
.toast__msg { display: inline; }
.toast--error { background: #ef4444; }
.toast--info { background: #3b82f6; }

/* =====================================================================
   数据监控大屏 · 深色科技感主题（作用域限定 #view-dashboard）
   仅叠加视觉层，复用既有 --sky/--orange/语义色 设计令牌，不改动令牌体系
   ===================================================================== */
#view-dashboard, #view-parking-dashboard {
  --dash-bg: #070B16;
  --dash-bg-2: #0B1326;
  --dash-card: rgba(18, 28, 51, 0.66);
  --dash-card-brd: rgba(86, 142, 255, 0.20);
  --dash-line: rgba(120, 160, 240, 0.12);
  --dash-cyan: #38E1FF;
  --dash-blue: #4D8DFF;
  --dash-violet: #9A6BFF;
  --dash-amber: #FFB454;
  --dash-green: #2BE0A8;
  --dash-text: #E8F0FF;
  --dash-dim: #8A9BC8;
  --dash-dim-2: #5E6E92;

  background:
    radial-gradient(1200px 600px at 12% -8%, rgba(77,141,255,0.18), transparent 60%),
    radial-gradient(1000px 500px at 100% 0%, rgba(154,107,255,0.14), transparent 55%),
    linear-gradient(180deg, var(--dash-bg-2), var(--dash-bg) 60%);
  color: var(--dash-text);
  border-radius: 18px;
  margin: -8px -16px -24px;
  padding: 24px 24px 32px;
  min-height: calc(100vh - 64px);
  position: relative;
  overflow: hidden;
}
/* 扫描线（投屏动态氛围，纯装饰） */
#view-parking-dashboard::before, #view-dashboard::before {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, rgba(120,160,240,0.035) 0 1px, transparent 1px 3px);
  pointer-events: none; z-index: 0;
}
#view-dashboard > *, #view-parking-dashboard > * { position: relative; z-index: 1; }

/* 顶部标题区 */
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 22px; }
.dash-head__title {
  font-size: clamp(22px, 2.4vw, 34px); font-weight: 800; letter-spacing: .5px;
  background: linear-gradient(92deg, #fff 10%, var(--dash-cyan) 55%, var(--dash-violet) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.dash-head__sub { color: var(--dash-dim); font-size: 13px; margin-top: 6px; display: flex; align-items: center; gap: 10px; }
.dash-live {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600;
  color: var(--dash-green); padding: 4px 11px; border-radius: 9999px;
  background: rgba(43,224,168,0.10); border: 1px solid rgba(43,224,168,0.30);
}
.dash-live__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dash-green); box-shadow: 0 0 0 0 rgba(43,224,168,0.6); animation: dashPulse 1.8s infinite; }
.dash-clock { font-family: var(--font-mono); font-size: 13px; color: var(--dash-dim); letter-spacing: .5px; }
@keyframes dashPulse { 0%{box-shadow:0 0 0 0 rgba(43,224,168,0.55);} 70%{box-shadow:0 0 0 9px rgba(43,224,168,0);} 100%{box-shadow:0 0 0 0 rgba(43,224,168,0);} }

/* 玻璃发光卡片 */
.dash-card {
  background: var(--dash-card);
  border: 1px solid var(--dash-card-brd);
  border-radius: 16px;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 18px 50px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.04);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: transform .25s cubic-bezier(.16,1,.3,1), border-color .25s, box-shadow .25s;
  animation: dashRise .5s both;
}
.dash-card::after {
  content: ""; position: absolute; left: 0; top: 0; height: 3px; width: 100%;
  background: linear-gradient(90deg, var(--dash-cyan), var(--dash-violet));
  opacity: .8;
}
.dash-card:hover { transform: translateY(-4px); border-color: rgba(86,142,255,0.42); box-shadow: 0 26px 60px rgba(0,0,0,0.45), 0 0 24px rgba(77,141,255,0.18); }
.dash-card__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.dash-card__title { font-size: 14px; font-weight: 700; color: #fff; letter-spacing: .3px; }
.dash-card__sub { font-size: 11.5px; color: var(--dash-dim); }
@keyframes dashRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.dash-grid > .dash-card:nth-child(2) { animation-delay: .06s; }
.dash-grid > .dash-card:nth-child(3) { animation-delay: .12s; }
.dash-grid > .dash-card:nth-child(4) { animation-delay: .18s; }
.dash-grid > .dash-card:nth-child(5) { animation-delay: .24s; }
.dash-grid > .dash-card:nth-child(6) { animation-delay: .30s; }

/* KPI */
.dash-kpi__label { font-size: 12.5px; color: var(--dash-dim); display: flex; align-items: center; gap: 8px; }
.dash-kpi__icon { width: 26px; height: 26px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: rgba(77,141,255,0.14); color: var(--dash-cyan); }
.dash-kpi__value { font-family: var(--font-mono); font-size: clamp(26px, 2.6vw, 38px); font-weight: 800; line-height: 1.05; margin-top: 12px; color: #fff; text-shadow: 0 0 22px rgba(56,225,255,0.22); }
.dash-kpi__value small { font-size: .5em; font-weight: 600; color: var(--dash-dim); margin-left: 4px; }
.dash-kpi__foot { margin-top: 10px; font-size: 12px; color: var(--dash-dim); display: flex; align-items: center; gap: 8px; }
.dash-up { color: var(--dash-green); font-weight: 700; }
.dash-down { color: #FF6B81; font-weight: 700; }

/* 图表区 */
.dash-chart { width: 100%; height: 230px; display: block; }
.dash-chart .grid-line { stroke: var(--dash-line); stroke-width: 1; }
.dash-chart .axis-txt { fill: var(--dash-dim-2); font-size: 10px; font-family: var(--font-mono); }
.dash-legend { display: flex; gap: 18px; margin-top: 10px; font-size: 12px; color: var(--dash-dim); }
.dash-legend__item { display: inline-flex; align-items: center; gap: 7px; }
.dash-legend__sw { width: 12px; height: 4px; border-radius: 3px; }

/* 环形进度 */
.dash-ring-wrap { position: relative; width: 150px; height: 150px; margin: 4px auto 0; }
.dash-ring { transform: rotate(-90deg); }
.dash-ring__track { stroke: rgba(120,160,240,0.14); }
.dash-ring__val { stroke: url(#dashRingGrad); stroke-linecap: round; filter: drop-shadow(0 0 8px rgba(56,225,255,0.6)); transition: stroke-dashoffset 1s cubic-bezier(.16,1,.3,1); }
.dash-ring__label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.dash-ring__num { font-family: var(--font-mono); font-size: 30px; font-weight: 800; color: #fff; text-shadow: 0 0 18px rgba(56,225,255,0.35); }
.dash-ring__cap { font-size: 11px; color: var(--dash-dim); margin-top: 2px; }

/* 横向条形（功能使用率） */
.dash-bars { display: flex; flex-direction: column; gap: 13px; margin-top: 4px; }
.dash-bar { display: grid; grid-template-columns: 84px 1fr 42px; align-items: center; gap: 12px; }
.dash-bar__label { font-size: 12.5px; color: var(--dash-dim); }
.dash-bar__track { height: 9px; border-radius: 9999px; background: rgba(120,160,240,0.10); overflow: hidden; }
.dash-bar__fill { height: 100%; border-radius: 9999px; background: linear-gradient(90deg, var(--dash-blue), var(--dash-cyan)); box-shadow: 0 0 12px rgba(56,225,255,0.45); animation: dashGrow 1.1s cubic-bezier(.16,1,.3,1) both; }
@keyframes dashGrow { from { width: 0 !important; } }
.dash-bar__num { font-family: var(--font-mono); font-size: 12.5px; color: #fff; text-align: right; }

/* 拖拽手柄 + 拖拽态 */
.dash-drag-handle { cursor: grab; color: var(--dash-dim); font-size: 15px; line-height: 1; margin-left: 10px; opacity: .35; transition: opacity .2s, color .2s; user-select: none; flex: none; }
.dash-card__head:hover .dash-drag-handle { opacity: 1; color: var(--dash-cyan); }
.dash-drag-handle:active { cursor: grabbing; }
.dash-card--dragging { box-shadow: 0 30px 70px rgba(0,0,0,.6), 0 0 30px rgba(56,225,255,.4); transform: none !important; cursor: grabbing; }
.dash-card--placeholder { border: 1px dashed rgba(86,142,255,.55); background: rgba(86,142,255,.06); box-shadow: none; }
.dash-card--placeholder::after { opacity: 0; }
.dash-card--placeholder > * { visibility: hidden; }

/* 大屏 grid 恢复 grid 布局，用固定 resizer 轨道作为列间隔，保证各行边缘严格对齐 */
.dash-grid.grid,
.dash-grid.grid-1,
.dash-grid.grid-2,
.dash-grid.grid-3,
.dash-grid.grid-4 {
  display: grid;
  gap: 0;
  align-items: stretch;
  position: relative;
}
.dash-grid > .dash-card {
  min-width: 0;
  overflow: hidden;
  grid-column: span 1; /* 宽度比例完全由 JS 的 fr 轨道控制，避免 .span-2/span-3 与新 grid-template-columns 冲突导致换行 */
}
.dash-resizer {
  width: auto;
  min-width: 0;
  cursor: col-resize;
  position: relative;
  z-index: 100;
  background: transparent;
  transition: background .15s, box-shadow .15s;
  pointer-events: auto;
  /* 视觉条居中，占据 14px 轨道 */
}
.dash-resizer::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 4px;
  transform: translateX(-50%);
  background: rgba(56,225,255,.45);
  border-radius: 2px;
  opacity: 0;
  transition: opacity .15s, width .15s, box-shadow .15s;
}
.dash-resizer:hover::after,
.dash-resizer.dash-resizer--dragging::after {
  width: 6px;
  opacity: 1;
  box-shadow: 0 0 14px rgba(56,225,255,.35);
}

/* 纵向网格（嵌套大屏右侧两卡堆叠）：JS 控制 grid-template-rows，纵向分隔条调高度 */
.dash-grid--col {
  display: grid;
  gap: 0;
  align-items: stretch;
  position: relative;
  min-width: 0;
  min-height: 0;
}
.dash-resizer--v {
  cursor: row-resize;
  width: auto;
  min-width: 0;
  height: auto;
  min-height: 0;
}
.dash-resizer--v::after {
  left: 0;
  right: 0;
  top: 50%;
  bottom: auto;
  width: auto;
  height: 4px;
  transform: translateY(-50%);
}
.dash-resizer--v:hover::after,
.dash-resizer--v.dash-resizer--dragging::after {
  width: auto;
  height: 6px;
  opacity: 1;
  box-shadow: 0 0 14px rgba(56,225,255,.35);
}

/* 锁定网格（viewer/无操作权限）保留 resizer 占位轨道但不可交互，避免比例错位 */
.dash-resizer--locked {
  opacity: 0;
  pointer-events: none !important;
}

/* Top10 个人简报柱状图（用户名在下、数量在上、高度按比例） */
.dash-barchart { display: flex; align-items: flex-end; gap: 10px; height: 172px; margin-top: 4px; padding-top: 6px; }
.dash-bar-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.dash-bar-col__num { font-family: var(--font-mono); font-size: 12.5px; font-weight: 700; color: var(--dash-cyan); margin-bottom: 6px; white-space: nowrap; }
.dash-bar-col__pillar { width: 62%; max-width: 34px; flex: 1 1 auto; display: flex; align-items: flex-end; background: rgba(120,160,240,.08); border-radius: 8px 8px 4px 4px; overflow: hidden; }
.dash-bar-col__fill { width: 100%; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, var(--dash-cyan), var(--dash-violet)); box-shadow: 0 0 14px rgba(56,225,255,.45); animation: dashGrowCol .9s cubic-bezier(.16,1,.3,1) both; transition: height .35s cubic-bezier(.16,1,.3,1); }
@keyframes dashGrowCol { from { height: 0 !important; } }
.dash-bar-col__name { font-size: 11.5px; color: var(--dash-dim); margin-top: 7px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.dash-barchart__empty { width: 100%; text-align: center; color: var(--dash-dim); font-size: 13px; align-self: center; }

/* 排行榜 */
.dash-rank { display: flex; flex-direction: column; gap: 11px; }
.dash-rank__item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 11px; background: rgba(120,160,240,0.05); border: 1px solid rgba(120,160,240,0.08); transition: background .2s; }
.dash-rank__item:hover { background: rgba(77,141,255,0.12); }
.dash-rank__no { width: 24px; height: 24px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 13px; font-weight: 800; color: var(--dash-dim); background: rgba(120,160,240,0.10); }
.dash-rank__no--1 { color: #0B1326; background: linear-gradient(135deg, #FFE08A, #FFB454); box-shadow: 0 0 14px rgba(255,180,84,0.5); }
.dash-rank__no--2 { color: #0B1326; background: linear-gradient(135deg, #E4ECFF, #B9C8EE); }
.dash-rank__no--3 { color: #0B1326; background: linear-gradient(135deg, #FFC9A0, #E8A06A); }
.dash-rank__name { flex: 1; font-size: 13px; color: var(--dash-text); font-weight: 600; }
.dash-rank__val { font-family: var(--font-mono); font-size: 14px; font-weight: 700; color: var(--dash-cyan); }

/* 实时活动流 */
.dash-feed { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow: hidden; }
.dash-feed__item { display: flex; gap: 12px; padding: 11px 4px; border-bottom: 1px solid rgba(120,160,240,0.07); }
.dash-feed__item:last-child { border-bottom: none; }
.dash-feed__dot { flex: none; width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; background: var(--dash-dim-2); }
.dash-feed__dot--live { background: var(--dash-green); box-shadow: 0 0 0 0 rgba(43,224,168,0.55); animation: dashPulse 1.8s infinite; }
.dash-feed__dot--cyan { background: var(--dash-cyan); }
.dash-feed__dot--violet { background: var(--dash-violet); }
.dash-feed__text { font-size: 13px; color: var(--dash-text); line-height: 1.5; }
.dash-feed__text b { color: #fff; font-weight: 700; }
.dash-feed__time { font-size: 11.5px; color: var(--dash-dim-2); margin-top: 3px; font-family: var(--font-mono); }

/* 顶部实时胶囊条 */
.dash-realtime { display: flex; gap: 12px; flex-wrap: wrap; }
.dash-pill { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 13px; background: rgba(18,28,51,0.6); border: 1px solid var(--dash-card-brd); }
.dash-pill__ic { width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: rgba(56,225,255,0.12); color: var(--dash-cyan); }
.dash-pill__v { font-family: var(--font-mono); font-size: 19px; font-weight: 800; color: #fff; line-height: 1; }
.dash-pill__l { font-size: 11.5px; color: var(--dash-dim); margin-top: 3px; }

/* 预留扩展区占位（待补充项目新定义/管理要求） */
.dash-todo { display: flex; flex-direction: column; gap: 10px; }
.dash-todo__item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 11px; border: 1px dashed rgba(154,107,255,0.35); background: rgba(154,107,255,0.06); font-size: 12.5px; color: var(--dash-dim); }
.dash-todo__tag { font-size: 10.5px; font-weight: 700; color: var(--dash-violet); padding: 2px 8px; border-radius: 9999px; background: rgba(154,107,255,0.14); white-space: nowrap; }

/* 投屏大屏适配：超大屏放大字号与间距 */
@media (min-width: 1600px) {
  #view-dashboard { padding: 32px 40px 44px; }
  .dash-kpi__value { font-size: clamp(38px, 2.8vw, 52px); }
  .dash-card { padding: 22px 26px; }
  .dash-chart { height: 280px; }
  .dash-head__title { font-size: clamp(30px, 2.6vw, 42px); }
}
/* 系统更新日志 · 单行 6 列 KPI */
.dash-kpi-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }

/* 中小屏：KPI 降为 2 列 */
@media (max-width: 1100px) {
  .dash-kpi-row { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ===== 平台 API 库 · 接口详情弹框 ===== */
.api-method {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 54px; height: 22px; padding: 0 9px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .4px;
  border-radius: var(--radius-sm); color: #fff;
  font-family: var(--font-mono); line-height: 1;
}
.api-method--get    { background: #16A34A; }
.api-method--post   { background: var(--sky-600); }
.api-method--put    { background: #E8720C; }
.api-method--patch  { background: #7C3AED; }
.api-method--delete { background: #DC2626; }
.api-method--head,
.api-method--options { background: var(--gray-500); }

/* 平台 API 库 · 接口分类徽标（浅底深字，复用 --sky 设计令牌） */
.api-cat {
  display: inline-flex; align-items: center;
  padding: 2px 10px; font-size: 12px; font-weight: 600; line-height: 1.6;
  color: var(--sky-700); background: var(--sky-50);
  border: 1px solid var(--sky-200);
  border-radius: 999px; white-space: nowrap;
}

.api-detail__summary {
  font-size: 13.5px; line-height: 1.7; color: var(--gray-800);
  background: var(--gray-50); border: 1px solid var(--gray-200);
  border-left: 3px solid var(--sky-500);
  border-radius: var(--radius-md); padding: 14px 16px; margin-bottom: 18px;
  white-space: pre-wrap; word-break: break-word;
}
.api-detail__grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px 22px;
}
.api-detail__row { min-width: 0; }
.api-detail__label {
  font-size: 12px; color: var(--gray-500); font-weight: 500; margin-bottom: 5px;
}
.api-detail__value {
  font-size: 13.5px; color: var(--gray-900); font-weight: 600;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.api-detail__value--mono { font-family: var(--font-mono); font-weight: 500; }
.api-detail__value--break { word-break: break-all; }
.api-detail__copy {
  flex: none; border: 1px solid var(--gray-200); background: #fff;
  color: var(--sky-600); font-size: 11.5px; font-weight: 600;
  padding: 2px 9px; border-radius: var(--radius-sm); cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.api-detail__copy:hover { background: var(--sky-50); border-color: var(--sky-200); }
@media (max-width: 560px) {
  .api-detail__grid { grid-template-columns: 1fr; gap: 14px; }
}

/* ===== 建设中占位页（对非平台管理员遮罩硬编码待调试页）===== */
#view-placeholder {
  align-items: center; justify-content: center;
  min-height: 100%;
  background:
    radial-gradient(ellipse 800px 560px at 50% 45%, rgba(241,245,249,.7) 0%, transparent 65%),
    linear-gradient(180deg, var(--gray-50) 0%, var(--gray-100) 100%);
}
#view-placeholder.active {
  display: flex;
}
.ph-shell {
  max-width: 900px; margin: 0 auto; text-align: center; position: relative;
  padding: 64px 40px 72px; overflow-x: hidden;
}
.ph-shell::before, .ph-shell::after {
  content: ''; position: absolute; top: 52px; bottom: 52px; width: 2px; border-radius: 1px;
  background: linear-gradient(180deg, transparent 0%, rgba(148,163,184,.22) 15%, rgba(148,163,184,.32) 50%, rgba(148,163,184,.22) 85%, transparent 100%);
}
.ph-shell::before { left: 20px; }
.ph-shell::after { right: 20px; }
.ph-quote {
  margin: 0; font-size: 28px; line-height: 1.6; font-weight: 350;
  color: var(--gray-800); letter-spacing: .06em; white-space: normal;
  opacity: 0; transition: opacity .55s cubic-bezier(.4,0,.2,1); text-shadow: 0 1px 2px rgba(0,0,0,.02);
}
.ph-author {
  margin-top: 36px; font-size: 16px; color: var(--gray-400); letter-spacing: .08em; font-weight: 300;
  opacity: 0; transition: opacity .55s cubic-bezier(.4,0,.2,1) .1s;
}
.ph-author em { font-style: normal; color: var(--gray-500); font-weight: 400; }
@media (max-width: 720px) {
  .ph-shell { padding: 48px 24px 56px; }
  .ph-quote { font-size: 20px; }
  .ph-shell::before { left: 12px; top: 40px; bottom: 40px; }
  .ph-shell::after { right: 12px; top: 40px; bottom: 40px; }
}

/* ===================== 业务研发中心 / 合作方管理（V2.3.490，研发管理分组） ===================== */
.brd-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.brd-card { padding: 18px; display: flex; flex-direction: column; gap: 12px; cursor: pointer; transition: transform .12s, box-shadow .12s; }
.brd-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.brd-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.brd-card__title { font-size: 15px; font-weight: 700; color: var(--gray-900); }
.brd-card__meta { font-size: 12px; color: var(--gray-500); }
.brd-card__desc { font-size: 13px; color: var(--gray-600); line-height: 1.5; flex: 1; }
.brd-card__foot { display: flex; align-items: center; justify-content: space-between; }
.brd-filter-bar { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 16px; flex-wrap: wrap; gap: 8px; }
.brd-filter-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.brd-filter-actions { display: flex; gap: 8px; flex-shrink: 0; }
.brd-filter-chip { padding: 6px 14px; border-radius: var(--radius-full); font-size: 12.5px; font-weight: 500; color: var(--gray-600); background: #fff; border: 1px solid var(--gray-200); cursor: pointer; transition: all .15s; }
.brd-filter-chip:hover { border-color: var(--sky-300); }
.brd-filter-chip.active { background: var(--sky-50); color: var(--sky-600); border-color: var(--sky-100); }
.brd-empty { grid-column: 1 / -1; padding: 40px; text-align: center; color: var(--gray-400); font-size: 13px; }
.brd-section-title { font-size: 13px; font-weight: 700; color: var(--gray-900); margin: 18px 0 10px; }
.brd-stat-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.brd-stat { background: var(--gray-50); border-radius: var(--radius-md); padding: 6px 10px; }
.brd-stat__label { font-size: 11px; color: var(--gray-500); margin-bottom: 1px; }
.brd-stat__value { font-size: 13px; font-weight: 700; color: var(--gray-900); }
.brd-stat__value.mono, .mono { font-family: var(--font-mono); }
.brd-lifecycle { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; margin: 4px 0; }
.brd-lifecycle__step { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--gray-400); }
.brd-lifecycle__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gray-200); }
.brd-lifecycle__step.is-done { color: var(--gray-700); }
.brd-lifecycle__step.is-done .brd-lifecycle__dot { background: var(--success-500); }
.brd-lifecycle__step.is-current { color: var(--sky-600); font-weight: 600; }
.brd-lifecycle__step.is-current .brd-lifecycle__dot { background: var(--sky-500); box-shadow: 0 0 0 3px var(--sky-50); }
.brd-lifecycle__sep { color: var(--gray-300); font-size: 12px; margin: 0 1px; }
.brd-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.brd-dep { width: 100%; background: var(--gray-50); border: 1px solid var(--gray-100); border-radius: var(--radius-md); padding: 8px; overflow-x: auto; }
.brd-dep__svg { display: block; }
.brd-node__box { fill: #fff; stroke-width: 1.5; }
.brd-node.is-focus .brd-node__box { fill: var(--sky-50); }
.brd-node__name { font-size: 11px; font-weight: 600; fill: var(--gray-900); text-anchor: middle; }
.brd-node__ver { font-size: 9px; fill: var(--gray-500); text-anchor: middle; font-family: var(--font-mono); }
.brd-edge { fill: none; stroke: var(--gray-300); stroke-width: 1.5; }
.brd-drawer__overlay { position: fixed; inset: 0; background: rgba(15,23,42,.35); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 200; }
.brd-drawer__overlay.active { opacity: 1; pointer-events: auto; }
.brd-drawer { position: fixed; right: 0; top: 0; bottom: 0; width: 600px; max-width: 92vw; background: #fff; box-shadow: -4px 0 24px rgba(15,23,42,.12); transform: translateX(100%); transition: transform .25s ease-out; z-index: 201; display: flex; flex-direction: column; }
.brd-drawer.active { transform: translateX(0); }
.brd-drawer__head { padding: 18px 22px; border-bottom: 1px solid var(--gray-100); display: flex; align-items: center; justify-content: space-between; }
.brd-drawer__title { font-size: 16px; font-weight: 700; color: var(--gray-900); }
.brd-drawer__close { width: 28px; height: 28px; border-radius: 6px; border: none; background: var(--gray-100); cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--gray-600); }
.brd-drawer__body { padding: 22px; overflow: auto; flex: 1; }
.brd-drawer__foot { padding: 14px 22px; border-top: 1px solid var(--gray-100); display: flex; gap: 10px; justify-content: flex-end; }
.brd-toast { position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%) translateY(12px); background: var(--gray-900); color: #fff; padding: 10px 18px; border-radius: var(--radius-md); font-size: 13px; box-shadow: var(--shadow-md); opacity: 0; pointer-events: none; transition: all .2s; z-index: 999; max-width: 80vw; }
.brd-toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.ptn-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 1200px) { .brd-grid, .ptn-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) { .brd-grid, .ptn-grid { grid-template-columns: 1fr; } .brd-drawer { width: 100%; } }

/* ===================== 业务研发中心 · 文档服务模块管理抽屉（V2.3.650 同源设计稿） ===================== */
/* 仅放宽文档类管理抽屉宽度，避免 600px 内容局促；其余 token 全部复用既有 .brd-drawer */
.brd-drawer--doc { width: 680px; }
.brd-drawer--doc .brd-drawer__body { padding: 0; }

/* 抽屉头部：图标 + 标题 + 版本/负责人元信息 + 状态 */
.dsm-head { padding: 18px 22px 16px; border-bottom: 1px solid var(--gray-100); display: flex; align-items: flex-start; gap: 14px; }
.dsm-head__icon { width: 44px; height: 44px; border-radius: var(--radius-md); background: var(--sky-50); color: var(--sky-600); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dsm-head__icon svg { width: 24px; height: 24px; }
.dsm-head__main { flex: 1; min-width: 0; }
.dsm-head__title { font-size: 17px; font-weight: 700; color: var(--gray-900); display: flex; align-items: center; gap: 10px; }
.dsm-head__meta { font-size: 12px; color: var(--gray-500); margin-top: 4px; }

.dsm-body { padding: 18px 22px 22px; overflow: auto; flex: 1; }
.dsm-section { margin-bottom: 22px; }
.dsm-section:last-child { margin-bottom: 0; }
.dsm-section__title { font-size: 13.5px; font-weight: 700; color: var(--gray-900); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.dsm-section__title svg { width: 16px; height: 16px; color: var(--sky-600); }
.dsm-section__help { font-size: 12px; color: var(--gray-500); font-weight: 400; margin-left: auto; }

/* 文档板块卡片（一级分类），内嵌二级分类 */
.doc-plate { border: 1px solid var(--gray-200); border-radius: var(--radius-md); background: #fff; margin-bottom: 10px; }
.doc-plate__head { padding: 12px 14px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--gray-100); }
.doc-plate__head input { flex: 1; }
.doc-plate__drag { color: var(--gray-400); cursor: grab; display: flex; }
.doc-plate__drag svg { width: 16px; height: 16px; }
.doc-plate__body { padding: 12px 14px 14px; }
.doc-plate__subs { display: flex; flex-wrap: wrap; gap: 8px; }
.doc-sub { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: var(--radius-full); border: 1px solid var(--gray-200); background: var(--gray-50); font-size: 12.5px; color: var(--gray-700); }
.doc-sub input { border: none; background: transparent; padding: 0; font-size: 12.5px; color: var(--gray-700); width: 90px; outline: none; }
.doc-sub__del { color: var(--gray-400); cursor: pointer; display: flex; }
.doc-sub__del:hover { color: var(--error-500); }
.doc-plate__add { margin-top: 10px; }
.dsm-add-plate { width: 100%; justify-content: center; }

/* 文档模块设计方案 · Markdown 编辑区 */
.dsm-design__toolbar { display: flex; gap: 6px; padding: 6px 10px; border: 1px solid var(--gray-200); border-bottom: none; border-radius: var(--radius-md) var(--radius-md) 0 0; background: var(--gray-50); }
.dsm-design__toolbar button { border: none; background: transparent; color: var(--gray-600); font-size: 12px; padding: 3px 8px; border-radius: var(--radius-sm); cursor: pointer; }
.dsm-design__toolbar button:hover { background: var(--gray-200); color: var(--gray-900); }
.dsm-design__area { border-radius: 0 0 var(--radius-md) var(--radius-md); min-height: 140px; }

/* 负责人快捷选择标签 */
.owner-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.owner-tag { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: var(--radius-full); border: 1px solid var(--gray-200); background: #fff; font-size: 12px; color: var(--gray-700); cursor: pointer; }
.owner-tag.active { border-color: var(--sky-500); background: var(--sky-50); color: var(--sky-700); }

/* ===================== 业务研发中心 · 模块授权（按账号两档） ===================== */
.brd-drawer__sub { font-size: 12px; color: var(--gray-500); margin-top: 2px; }
.brd-card__actions { display: flex; gap: 8px; }
.brd-auth-kpis { display: flex; gap: 12px; margin-bottom: 14px; }
.brd-auth-kpi { flex: 1; border: 1px solid var(--gray-200); border-radius: var(--radius-md); padding: 12px 14px; }
.brd-auth-kpi__num { font-size: 20px; font-weight: 700; color: var(--gray-900); }
.brd-auth-kpi__label { font-size: 12px; color: var(--gray-500); margin-top: 2px; }
.brd-auth-toolbar { display: flex; gap: 10px; margin-bottom: 12px; }
.brd-auth-list { display: flex; flex-direction: column; gap: 8px; }
.brd-auth-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--gray-200); border-radius: var(--radius-md); }
.brd-auth-row__main { flex: 1; min-width: 0; }
.brd-auth-row__name { font-size: 14px; font-weight: 600; color: var(--gray-900); }
.brd-auth-row__meta { font-size: 12px; color: var(--gray-500); margin-top: 2px; }
.brd-auth-row__perms { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.brd-auth-row__del { color: var(--gray-400); cursor: pointer; flex-shrink: 0; }
.brd-auth-row__del:hover { color: var(--error-500); }
.brd-auth-candidates { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow: auto; }
.brd-auth-cand { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--gray-200); border-radius: var(--radius-md); cursor: pointer; }
.brd-auth-cand:hover { border-color: var(--sky-300); }
.brd-auth-cand.selected { border-color: var(--sky-500); background: var(--sky-50); }
.brd-auth-cand__main { flex: 1; min-width: 0; }
.brd-auth-cand__name { font-size: 14px; font-weight: 600; color: var(--gray-900); }
.brd-auth-cand__meta { font-size: 12px; color: var(--gray-500); margin-top: 2px; }
.brd-auth-scope { padding: 12px 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; border-top: 1px solid var(--gray-200); margin-top: 4px; }
.brd-auth-scope__label { font-size: 13px; font-weight: 600; color: var(--gray-700); white-space: nowrap; }
.brd-auth-scope__options { display: flex; flex: 1; flex-wrap: wrap; gap: 10px; min-width: 0; }
.brd-auth-radio { flex: 1; min-width: 160px; display: flex; align-items: flex-start; gap: 8px; cursor: pointer; margin: 0; }
.brd-auth-radio input { margin-top: 2px; flex-shrink: 0; }
.brd-auth-radio > span { display: block; min-width: 0; }
.brd-auth-radio b { font-size: 13px; color: var(--gray-900); }
.brd-auth-radio__desc { display: block; font-size: 11px; color: var(--gray-500); font-weight: 400; margin-top: 1px; line-height: 1.35; }
.brd-auth-add-body { display: block !important; grid-template-columns: none !important; overflow: auto; padding: 0; }
.brd-auth-empty { padding: 28px 0; text-align: center; color: var(--gray-400); font-size: 13px; }
.brd-auth-search-hint { font-size: 12px; color: var(--gray-400); padding: 6px 0; }
/* 添加授权账号弹框需浮在业务研发中心抽屉之上（抽屉 z-index 201） */
#brdAuthAddModal.active { z-index: 250; }

/* 已选授权账号：同事胶囊 */
.brd-auth-selected { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; min-height: 0; }
.brd-auth-selected:empty { display: none; }
.brd-auth-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 6px; background: var(--sky-50); border: 1px solid var(--sky-200); border-radius: 999px; font-size: 13px; color: var(--gray-800); cursor: default; }
.brd-auth-chip__avatar { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: #fff; flex-shrink: 0; }
.brd-auth-chip__del { width: 16px; height: 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--gray-400); margin-left: 2px; }
.brd-auth-chip__del:hover { background: var(--sky-100); color: var(--error-500); }

/* ===================== 平台标准 Markdown 渲染容器（.doc-md）=====================
 * 规范：平台内任何业务板块、任何口径展示 Markdown 文档，统一用 <div class="doc-md"> 包裹 renderMarkdown() 输出。
 * 已落地口径：① 文档中心详情弹框（renderDocDetail）；② 业务研发中心·接口文档弹框（loadModuleDoc）。
 * 注意：PDF 导出与简报报告预览各自在独立窗口/iframe 内联样式，不在此容器内，但视觉风格应与其保持一致。
 */
#docModal .modal__body { display: block; grid-template-columns: none; overflow: auto; padding: 0; }
.doc-md { padding: 18px 24px 28px; font-size: 13.5px; line-height: 1.7; color: var(--gray-800); }
.doc-md h1 { font-size: 19px; font-weight: 700; color: var(--gray-900); margin: 6px 0 14px; }
.doc-md h2 { font-size: 16px; font-weight: 700; color: var(--gray-900); margin: 22px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--gray-200); }
.doc-md h3 { font-size: 14px; font-weight: 700; color: var(--gray-900); margin: 16px 0 8px; }
.doc-md p { margin: 8px 0; }
.doc-md ul { margin: 8px 0; padding-left: 20px; }
.doc-md li { margin: 4px 0; }
.doc-md hr { border: none; border-top: 1px solid var(--gray-200); margin: 16px 0; }
.doc-md code { background: var(--gray-100); padding: 1px 6px; border-radius: 4px; font-size: 12.5px; font-family: monospace; color: var(--gray-800); }
.doc-md pre { background: var(--gray-900); color: #e2e8f0; padding: 14px 16px; border-radius: var(--radius-md); overflow: auto; font-size: 12.5px; line-height: 1.55; margin: 10px 0; }
.doc-md pre code { background: transparent; color: inherit; padding: 0; }
.doc-md table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 12.5px; }
.doc-md th, .doc-md td { border: 1px solid var(--gray-200); padding: 7px 10px; text-align: left; vertical-align: top; }
.doc-md th { background: var(--gray-100); font-weight: 600; color: var(--gray-900); white-space: nowrap; }
.doc-md strong { color: var(--gray-900); font-weight: 700; }
.doc-loading { padding: 40px; text-align: center; color: var(--gray-500); }

/* ===================== 综合工作台 · 顶部视图切换 + 快捷操作 + 通知滚动条（V2.3.656） ===================== */
/* 顶部操作条：左部视图切换胶囊 + 紧凑快捷操作；右部配置按钮。中等圆角，弱边框。 */
.wb-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.wb-topbar__left { display: flex; align-items: center; gap: 12px; flex-wrap: nowrap; min-width: 0; }

/* 视图切换：外壳胶囊 + 内部小胶囊高亮 */
.wb-view-tabs { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid var(--gray-200); border-radius: var(--radius-md); background: var(--surface-card); box-shadow: var(--shadow-xs); }
.wb-view-tab { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; border: 1px solid transparent; background: transparent; color: var(--gray-600); cursor: pointer; transition: all .15s; }
.wb-view-tab:hover { color: var(--gray-800); }
.wb-view-tab.active { background: var(--sky-50); border-color: var(--sky-200); color: var(--sky-700); }
.wb-view-tab.active .icon { color: var(--sky-600); }
.wb-view-tab .icon { width: 14px; height: 14px; color: var(--gray-500); }

/* 快捷操作：紧凑弱边框圆角容器 */
.wb-quick-actions { display: inline-flex; align-items: center; gap: 2px; padding: 2px 3px; border: 1px solid var(--gray-200); border-radius: var(--radius-md); background: var(--surface-card); flex-shrink: 1; min-width: 0; }
.wb-quick-actions__label { font-size: 10.5px; color: var(--gray-400); padding: 0 5px 0 7px; white-space: nowrap; }
.wb-quick-actions__list { display: inline-flex; align-items: center; gap: 1px; overflow: hidden; }
.wb-quick-actions__item { display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 8px; border-radius: var(--radius-sm); font-size: 11px; color: var(--gray-600); background: transparent; border: 1px solid transparent; cursor: pointer; white-space: nowrap; transition: all .12s; }
.wb-quick-actions__item:hover { background: var(--gray-50); border-color: var(--gray-200); color: var(--gray-800); }
.wb-quick-actions__item .icon { width: 10px; height: 10px; }

/* 配置按钮（原 page-head 内联样式，迁入样式表） */
.wb-config-btn { border-radius: var(--radius-md); padding: 0 18px; height: 34px; gap: 6px; flex-shrink: 0; }

/* 通知公告滚动条 */
.wb-notice-bar { display: flex; align-items: center; gap: 12px; background: var(--surface-card); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 10px 14px; margin-bottom: 18px; overflow: hidden; }
.wb-notice-bar__label { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; font-size: 12px; font-weight: 700; color: var(--sky-700); background: var(--sky-50); border: 1px solid var(--sky-200); border-radius: var(--radius-full); padding: 4px 10px; }
.wb-notice-bar__label .icon { width: 14px; height: 14px; color: var(--sky-600); }
.wb-notice-bar__track { flex: 1; min-width: 0; overflow: hidden; position: relative; }
.wb-notice-bar__list { display: inline-flex; align-items: center; gap: 28px; animation: wb-notice-scroll 24s linear infinite; white-space: nowrap; }
.wb-notice-bar__track:hover .wb-notice-bar__list { animation-play-state: paused; }
.wb-notice-bar__item { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--gray-700); cursor: pointer; transition: color .15s; }
.wb-notice-bar__item:hover { color: var(--sky-600); }
.wb-notice-bar__tag { font-size: 11px; font-weight: 700; color: var(--sky-700); background: var(--sky-50); border-radius: var(--radius-sm); padding: 2px 6px; }
.wb-notice-bar__tag.urgent { color: var(--error-600); background: var(--error-50); }
.wb-notice-bar__time { font-size: 11px; color: var(--gray-400); }
.wb-notice-bar__more { flex-shrink: 0; font-size: 12px; color: var(--gray-500); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.wb-notice-bar__more:hover { color: var(--sky-600); }
@keyframes wb-notice-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* 响应式：顶部操作条在窄屏适配 */
@media (max-width: 1200px) {
  .wb-layout { flex-direction: column; }
  .wb-sidebar { width: 100%; }
}
@media (max-width: 1100px) {
  .wb-quick-actions__item:nth-child(n+4) { display: none; }
}
@media (max-width: 860px) {
  .wb-quick-actions { display: none; }
  .wb-view-tabs { overflow-x: auto; flex-wrap: nowrap; }
}

/* ===================== API 通讯管理（云团 = 业务模块） ===================== */
#view-api-communication .api-layout {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 16px;
}
#view-api-communication .api-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 星云舞台 */
#view-api-communication .nebula-stage {
  position: relative;
  height: 420px;
  background: #070B16;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  overflow: hidden;
}
#view-api-communication #canvas-container {
  position: absolute; inset: 0;
}
#view-api-communication #canvas-container canvas {
  display: block; width: 100%; height: 100%;
}

/* 云团标签 */
#view-api-communication .canvas-label {
  position: absolute;
  display: flex; align-items: center; gap: 6px;
  padding: 5px 9px;
  background: rgba(11, 19, 38, 0.78);
  border: 1px solid rgba(120, 160, 240, 0.22);
  border-radius: 999px;
  font-size: 12px; color: #D8E3FF;
  cursor: pointer;
  pointer-events: auto;
  user-select: none;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  white-space: nowrap;
}
#view-api-communication .canvas-label:hover,
#view-api-communication .canvas-label.is-active {
  border-color: rgba(56, 225, 255, 0.65);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35), 0 6px 18px rgba(0, 0, 0, 0.4);
  transform: translate(-50%, -50%) scale(1.06);
}
#view-api-communication .canvas-label .cl-dot {
  width: 7px; height: 7px; border-radius: 50%; flex: none;
}
#view-api-communication .canvas-label .cl-eff {
  color: #8FB3FF; font-size: 11px;
}

/* 图例与提示 */
#view-api-communication .nebula-legend {
  position: absolute; left: 14px; bottom: 12px;
  display: flex; gap: 14px; flex-wrap: wrap;
  font-size: 11.5px; color: #9FB2D8; pointer-events: none;
}
#view-api-communication .nebula-legend span {
  display: inline-flex; align-items: center; gap: 6px;
}
#view-api-communication .nebula-legend i {
  width: 9px; height: 9px; border-radius: 50%; display: inline-block;
}
#view-api-communication .nebula-hint {
  position: absolute; right: 14px; top: 12px;
  font-size: 11.5px; color: #7E91BC; pointer-events: none;
  background: rgba(11, 19, 38, 0.5); padding: 4px 9px; border-radius: 999px;
  border: 1px solid rgba(120, 160, 240, 0.16);
}

/* 模块明细表 */
#view-api-communication .eff-bar {
  height: 6px; border-radius: 999px;
  background: var(--gray-200); overflow: hidden; min-width: 80px;
}
#view-api-communication .eff-bar__fill {
  height: 100%; border-radius: 999px;
}
#view-api-communication .mod-row.is-active {
  background: var(--sky-50) !important;
}
#view-api-communication .mod-row.is-active td:first-child {
  box-shadow: inset 3px 0 0 var(--sky-500);
}

/* 选中模块详情 */
#view-api-communication .detail-empty {
  text-align: center; color: var(--gray-400); padding: 48px 16px;
}
#view-api-communication .detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 4px 0 16px;
}
#view-api-communication .detail-cell {
  background: var(--gray-50); border-radius: var(--radius-md); padding: 12px 14px;
}
#view-api-communication .detail-cell__label {
  font-size: 12px; color: var(--gray-500);
}
#view-api-communication .detail-cell__value {
  font-size: 20px; font-weight: 800; color: var(--gray-900); margin-top: 2px;
}
#view-api-communication .detail-cell__value small {
  font-size: 12px; color: var(--gray-400); font-weight: 600;
}
#view-api-communication .trend-bars {
  display: flex; align-items: flex-end; gap: 6px;
  height: 56px; margin-top: 6px;
}
#view-api-communication .trend-bars > div {
  flex: 1; border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--sky-400, #60A5FA), var(--sky-600));
  min-height: 4px;
}
#view-api-communication .endpoint-list {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px;
}
#view-api-communication .endpoint-list code {
  font-family: 'JetBrains Mono', monospace; font-size: 11.5px;
  background: var(--gray-100); border: 1px solid var(--gray-200);
  color: var(--gray-700); padding: 2px 8px; border-radius: 6px;
}

/* 合规监管告警 */
#view-api-communication .alert-item {
  display: flex; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--gray-200); border-radius: var(--radius-md);
  background: var(--surface-card); margin-bottom: 10px;
}
#view-api-communication .alert-item__ic {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  display: flex; align-items: center; justify-content: center;
}
#view-api-communication .alert-item__body { flex: 1; min-width: 0; }
#view-api-communication .alert-item__title {
  font-weight: 700; color: var(--gray-900); font-size: 13.5px;
}
#view-api-communication .alert-item__desc {
  font-size: 12.5px; color: var(--gray-500); margin-top: 3px;
}
#view-api-communication .alert-item__meta {
  font-size: 11.5px; color: var(--gray-400); margin-top: 5px;
}
#view-api-communication .audit-line {
  display: flex; gap: 10px; padding: 7px 0;
  border-bottom: 1px dashed var(--gray-100); font-size: 12.5px;
}
#view-api-communication .audit-line:last-child { border-bottom: none; }
#view-api-communication .audit-line__time {
  color: var(--gray-400); font-family: 'JetBrains Mono', monospace; flex: none;
}
#view-api-communication .audit-line__act { color: var(--gray-700); }
#view-api-communication .audit-line__lv {
  margin-left: auto; font-size: 11px; font-weight: 700;
}

/* V2.3.757 loading spinner — 增强可见性 */
@keyframes api-tabs-spin { to { transform: rotate(360deg); } }
@keyframes api-tab-pulse { 0%,100%{opacity:0.65} 50%{opacity:0.45} }
#view-api-communication .api-view-tab.is-loading {
  cursor: wait; pointer-events: none; opacity: 0.7;
  animation: api-tab-pulse 1.2s ease-in-out infinite;
}
#view-api-communication .api-view-tab .api-view-tab__spinner {
  display: none; width: 14px; height: 14px;
  border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%; animation: api-tabs-spin 0.75s linear infinite;
  margin-right: 5px; vertical-align: -2px;
}
#view-api-communication .api-view-tab.is-loading .api-view-tab__spinner { display: inline-block; }
/* API 视图 tab 图标（Feather SVG 风格） */
.api-tab-icon { width: 15px; height: 15px; vertical-align: -2px; margin-right: 4px; flex-shrink: 0; }
/* API 通讯管理 · 视图切换（数据视图 / 监控视图 / 监控策略） */
#view-api-communication .api-view-tabs {
  display: flex; gap: 8px; flex-wrap: wrap;
}
#view-api-communication .api-view-tab.is-active {
  background: var(--primary-50);
  color: var(--primary-600);
  border-color: var(--primary-200);
}
#view-api-communication .api-view-panel {
  display: none;
}
#view-api-communication .api-view-panel.is-active {
  display: block;
}
#view-api-communication #apiMonitorFrameWrap {
  display: none;
  flex-direction: column;
  height: calc(100vh - 180px);
  min-height: 560px;
  background: #070B16;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
#view-api-communication #apiMonitorFrame {
  flex: 1; min-height: 0; width: 100%; border: 0;
}

/* 监控视图 · 全内容区展开模式（占满主内容区红框范围） */
#view-api-communication #apiMonitorFrameWrap.is-expanded {
  position: fixed;
  top: 64px;                 /* 顶栏高度 */
  left: 248px;               /* 侧边栏展开宽度，JS 会按实际 sidebar.offsetWidth 更新 */
  right: 0;
  bottom: 0;
  height: auto;
  min-height: auto;
  border-radius: 0;
  border: 0;
  /* V2.3.704 · 主动让位顶栏整组（z=20 + user-menu z=100 在 fixed SC 内 root 层 100）
     改前 z=90 时虽仍低于 user-menu(100)，但压过 topbar(20) 是隐患；
     改后 z=10 < topbar(20) < user-menu(100)，顶栏/user-menu/未来 topbar 子元素始终在上 */
  z-index: 10;
}
#view-api-communication #apiMonitorFrameWrap.is-expanded #apiMonitorFrame {
  flex: 1 1 auto;
  min-height: 0;
}

/* 响应式 */
@media (max-width: 1200px) {
  #view-api-communication .api-layout { grid-template-columns: 1fr; }
}

/* ===================== P1 外部接入应用（OAuth Clients，业务研发中心子面板） ===================== */
.brd-subtabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--gray-100); border-radius: var(--radius-full); margin: 16px 0 18px; }
.page-head__actions .brd-subtabs { margin: 0; }
.brd-subtab { padding: 7px 18px; border-radius: var(--radius-full); font-size: 13px; font-weight: 500; color: var(--gray-600); background: transparent; border: none; cursor: pointer; transition: all .15s; }
.brd-subtab:hover { color: var(--sky-600); }
.brd-subtab.active { background: #fff; color: var(--sky-600); box-shadow: var(--shadow-sm); }
.oauth-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.oauth-hint { font-size: 12px; color: var(--gray-500); max-width: 72%; line-height: 1.5; }
.oauth-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.oauth-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.oauth-card__name { font-size: 15px; font-weight: 700; color: var(--gray-900); }
.oauth-card__cid { font-size: 12px; color: var(--gray-500); font-family: var(--font-mono); }
.oauth-card__desc { font-size: 13px; color: var(--gray-600); line-height: 1.5; }
.oauth-card__meta { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 12px; color: var(--gray-500); }
.oauth-card__meta b { color: var(--gray-700); font-weight: 600; }
.oauth-card__actions { display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--gray-100); padding-top: 10px; }
.oauth-secret-box { background: var(--gray-900); color: #fff; border-radius: var(--radius-md); padding: 14px 16px; font-family: var(--font-mono); font-size: 13px; word-break: break-all; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.oauth-warn { display: flex; gap: 8px; align-items: flex-start; background: var(--warning-50); border: 1px solid var(--warning-200); color: #B7791F; border-radius: var(--radius-md); padding: 10px 12px; font-size: 12.5px; line-height: 1.5; margin: 12px 0; }
.oauth-warn code { font-family: var(--font-mono); background: rgba(0,0,0,.05); padding: 1px 5px; border-radius: 4px; }
.modal__dialog--sm { max-width: 540px; }
.scope-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }

/* ── 外部接入应用弹框：表单布局优化（复用 docEditorModal 边距模式：body padding:0，分区自带 24px 左右边距） ── */
.modal__dialog--oauth { max-width: 680px; }
.modal__dialog--oauth .modal__body { display: block !important; padding: 0; overflow-y: auto; }
.oauth-form-body { display: flex; flex-direction: column; gap: 4px; }
.oauth-form-section { padding: 14px 24px; border-bottom: 1px solid var(--gray-100); }
.oauth-form-section--last { border-bottom: none; padding-bottom: 4px; }
.oauth-form-row { margin-bottom: 10px; }
.oauth-form-row > label { display: block; font-size: 13px; font-weight: 600; color: var(--gray-700); margin-bottom: 4px; }
.oauth-label-hint { font-weight: 400; color: var(--gray-400); font-size: 12px; font-family: var(--font-mono, monospace); }
.oauth-field-required { color: var(--error-500, #ef4444); }
.oauth-field-tip { font-size: 11.5px; color: var(--gray-400); margin-top: 3px; line-height: 1.4; }

/* 双列布局 */
.oauth-form-row--2col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.oauth-form-col { display: flex; flex-direction: column; }
.oauth-form-col .oauth-field-tip { margin-bottom: 0; }

/* scope 勾选美化 */
.oauth-form-section .scope-grid { margin-top: 6px; }
.scope-item { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border: 1px solid var(--gray-200); border-radius: var(--radius-md); cursor: pointer; transition: all .15s; background: #fff; font-size: 13px; user-select: none; }
.scope-item:hover { border-color: var(--sky-300, #7dd3fc); background: var(--sky-50, #f0f9ff); }
.scope-item input[type="checkbox"] { accent-color: var(--sky-500, #0ea5e9); width: 15px; height: 15px; flex-shrink: 0; }
.scope-item input:checked + ::after { /* handled by browser */ }
.scope-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--gray-200); border-radius: var(--radius-md); font-size: 13px; cursor: pointer; }
.scope-item input { width: auto; }

/* 扫码方式 radio 组 */
.oauth-qrtype-group { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.oauth-qrtype-item { display: flex; align-items: flex-start; gap: 8px; padding: 9px 12px; border: 1px solid var(--gray-200); border-radius: var(--radius-md); cursor: pointer; transition: all .15s; background: #fff; font-size: 13px; user-select: none; }
.oauth-qrtype-item:hover { border-color: var(--sky-300, #7dd3fc); background: var(--sky-50, #f0f9ff); }
.oauth-qrtype-item:has(input:checked) { border-color: var(--sky-500, #0ea5e9); background: var(--sky-50, #f0f9ff); }
.oauth-qrtype-item input[type="radio"] { accent-color: var(--sky-500, #0ea5e9); width: 16px; height: 16px; margin-top: 1px; flex-shrink: 0; }
.oauth-qrtype-item .oauth-field-tip { margin-top: 2px; }

/* 小程序卡片选择器（太阳码网格） */
.oauth-mp-grid { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.oauth-mp-card { position: relative; width: 148px; border: 2px solid var(--gray-200); border-radius: var(--radius-lg, 10px); padding: 12px 8px 10px; cursor: pointer; transition: all .18s ease; background: #fff; text-align: center; user-select: none; }
.oauth-mp-card:hover { border-color: var(--sky-300, #7dd3fc); box-shadow: 0 2px 8px rgba(14,165,233,.12); transform: translateY(-1px); }
.oauth-mp-card--selected { border-color: var(--sky-500, #0ea5e9); background: var(--sky-50, #f0f9ff); box-shadow: 0 0 0 3px rgba(14,165,233,.15); }
.oauth-mp-card--selected::after { content:''; position: absolute; top: -1px; right: -1px; width: 20px; height: 20px; border-radius: 0 var(--radius-lg) 0 8px; background: var(--sky-500, #0ea5e9); clip-path: polygon(100% 0, 0 0, 100% 100%); }
.oauth-mp-card--selected::before { content:'✓'; position: absolute; top: 1px; right: 2px; color: #fff; font-size: 11px; font-weight: 700; z-index: 1; line-height: 1; }
.oauth-mp-card__qr { width: 116px; height: 116px; margin: 0 auto 8px; border-radius: 6px; overflow: hidden; background: #f8fafc; display: flex; align-items: center; justify-content: center; }
.oauth-mp-card__qr img { width: 100%; height: 100%; object-fit: contain; }
.oauth-mp-card__name { font-size: 12px; color: var(--gray-700); line-height: 1.3; word-break: break-all; max-height: 32px; overflow: hidden; }
.oauth-mp-loading { color: var(--gray-400); font-size: 13px; padding: 12px 0; }

/* ===================== M3 智能体管理中心（V2.3.744 标准后台风格） ===================== */
.agent-key-item { border: 1px solid var(--gray-200); border-radius: var(--radius-md); padding: 16px; margin-bottom: 12px; background: var(--white); transition: box-shadow .15s; }
.agent-key-item:last-child { margin-bottom: 0; }
.agent-key-item:hover { box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.agent-key-item--disabled { opacity: 0.55; }
.agent-key-item--muted { color: var(--gray-500); }

@media (max-width: 1100px) {
  #agentKpis { grid-template-columns: repeat(2, 1fr); }
}

