/* =============================================================
   傲网OA系统 - 样式系统 (亮色/暗色双主题)
   ============================================================= */
:root {
  --primary: #4f6ef7;
  --primary-deep: #7c5cfc;
  --primary-light: rgba(79, 110, 247, 0.12);
  --success: #16b364;
  --warning: #f79009;
  --danger: #f04438;
  --info: #2e90fa;
  --purple: #8b5cf6;
  --pink: #ec4899;
  --brown: #a2845e;
  --gray: #8b98ad;

  --bg: #eef1f6;
  --surface: #ffffff;
  --surface2: #f6f8fb;
  --surface3: #eef2f7;
  --border: #e3e8f0;
  --border-light: #edf1f6;
  --text: #1c2434;
  --text2: #5c6b84;
  --text3: #93a1b5;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 16px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, 0.14);
  --radius: 12px;
  --radius-sm: 8px;
  --header-bg: rgba(255, 255, 255, 0.82);
  --header-bg-solid: rgba(255, 255, 255, 0.97);
  --sidebar-bg: #ffffff;
  --input-bg: #ffffff;
  --hover: rgba(79, 110, 247, 0.07);
  --skeleton: linear-gradient(90deg, #edf1f7 25%, #f6f9fc 50%, #edf1f7 75%);
  --scrollbar: #c9d2e0;
}
[data-theme="dark"] {
  --bg: #0b1120;
  --surface: #131b2c;
  --surface2: #182136;
  --surface3: #1e2a43;
  --border: #26324c;
  --border-light: #202b42;
  --text: #e6ebf4;
  --text2: #93a1b8;
  --text3: #66748f;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 4px 16px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
  --header-bg: rgba(19, 27, 44, 0.85);
  --header-bg-solid: rgba(19, 27, 44, 0.97);
  --sidebar-bg: #131b2c;
  --input-bg: #182136;
  --hover: rgba(79, 110, 247, 0.16);
  --skeleton: linear-gradient(90deg, #1a2438 25%, #223049 50%, #1a2438 75%);
  --scrollbar: #2c3a57;
  --primary-light: rgba(79, 110, 247, 0.2);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  transition: background .25s, color .25s;
  overflow: hidden;
}
a { color: var(--primary); text-decoration: none; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ================= 登录页 ================= */
.login-wrap {
  height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1a2b6d 0%, #3b4fc4 45%, #7c5cfc 100%);
  position: relative; overflow: hidden;
}
.login-wrap .blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .45; animation: float 12s ease-in-out infinite; }
.login-wrap .blob.b1 { width: 480px; height: 480px; background: #4f6ef7; top: -120px; left: -100px; }
.login-wrap .blob.b2 { width: 420px; height: 420px; background: #a855f7; bottom: -140px; right: -80px; animation-delay: -4s; }
.login-wrap .blob.b3 { width: 300px; height: 300px; background: #38bdf8; top: 40%; left: 60%; animation-delay: -8s; }
@keyframes float { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(30px,-40px) scale(1.08); } }
.login-box {
  width: 400px; padding: 42px 44px 36px; border-radius: 20px; position: relative; z-index: 2;
  background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(20px);
  box-shadow: 0 24px 80px rgba(10, 20, 60, 0.35);
}
[data-theme="dark"] .login-box { background: rgba(19, 27, 44, 0.95); }
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.login-logo .logo-icon {
  width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep)); color: #fff;
  box-shadow: 0 8px 20px rgba(79, 110, 247, 0.4);
}
.login-logo h1 { font-size: 22px; font-weight: 700; letter-spacing: 1px; }
.login-sub { color: var(--text2); font-size: 13px; margin-bottom: 26px; }
.login-box .field { margin-bottom: 16px; }
.login-tip { text-align: center; color: var(--text3); font-size: 12px; margin-top: 18px; }
.login-theme { position: absolute; top: 20px; right: 24px; z-index: 3; }

/* ================= 应用框架 ================= */
.app { display: flex; height: 100vh; }
.sidebar {
  width: 216px; background: var(--sidebar-bg); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; transition: width .22s; flex-shrink: 0; z-index: 20;
}
.sidebar.collapsed { width: 60px; }
.sidebar .brand {
  height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 16px;
  border-bottom: 1px solid var(--border); overflow: hidden; flex-shrink: 0;
}
.sidebar .brand .logo-icon {
  width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep)); color: #fff;
}
.sidebar .brand .brand-name { font-size: 16px; font-weight: 700; white-space: nowrap; }
.sidebar.collapsed .brand .brand-name, .sidebar.collapsed .menu-text,
.sidebar.collapsed .menu-group-title span, .sidebar.collapsed .menu-badge { display: none; }
.sidebar.collapsed .menu-item { justify-content: center; padding: 10px 0; }
.menu-box { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 8px; }
.menu-group { margin-bottom: 2px; }
.menu-group-title {
  display: flex; align-items: center; gap: 8px; padding: 9px 10px 5px; cursor: pointer;
  color: var(--text3); font-size: 12px; user-select: none; white-space: nowrap;
}
.menu-group-title svg { flex-shrink: 0; opacity: .8; }
.menu-group-title .arrow { margin-left: auto; transition: transform .2s; }
.menu-group.closed .menu-group-title .arrow { transform: rotate(-90deg); }
.menu-group.closed .menu-children { display: none; }
.menu-children { overflow: hidden; }
.menu-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: var(--radius-sm);
  color: var(--text2); cursor: pointer; white-space: nowrap; margin: 1px 0; position: relative;
  transition: background .15s, color .15s;
}
.menu-item:hover { background: var(--hover); color: var(--primary); }
.menu-item.active { background: linear-gradient(90deg, var(--primary-light), transparent); color: var(--primary); font-weight: 700; }
.menu-item.active .menu-text { font-weight: 700; }
/* 当前菜单所属分组: 高亮加粗 */
.menu-group-title.parent-on {
  background: var(--primary-light); color: var(--primary); font-weight: 700;
  border-left: 3px solid var(--primary); padding-left: 7px;
}
.menu-item.active::before {
  content: ''; position: absolute; left: 0; top: 20%; height: 60%; width: 3px;
  border-radius: 2px; background: linear-gradient(180deg, var(--primary), var(--primary-deep));
}
.menu-item svg { flex-shrink: 0; }
.menu-badge {
  margin-left: auto; background: var(--danger); color: #fff; font-size: 11px;
  min-width: 18px; height: 18px; border-radius: 9px; display: flex; align-items: center;
  justify-content: center; padding: 0 5px; font-weight: 600;
}
.sidebar .foot {
  border-top: 1px solid var(--border); padding: 8px; display: flex; gap: 6px; flex-shrink: 0;
}
.sidebar .foot .icon-btn { flex: 1; justify-content: center; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
/* 性能: 顶栏去掉 backdrop-filter(滚动时每帧模糊), 使用近不透明背景 */
.topbar {
  height: 56px; background: var(--header-bg-solid);
  border-bottom: 1px solid var(--border); display: flex; align-items: center;
  padding: 0 16px; gap: 10px; flex-shrink: 0; z-index: 15;
}
.topbar .page-title { font-size: 15px; font-weight: 600; margin-right: 8px; white-space: nowrap; }
.icon-btn {
  width: 34px; height: 34px; border: none; background: transparent; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text2);
  transition: all .15s; position: relative;
}
.icon-btn:hover { background: var(--hover); color: var(--primary); }
.icon-btn.has-dot::after {
  content: ''; position: absolute; top: 6px; right: 6px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--danger); border: 2px solid var(--surface);
}
.top-search {
  flex: 1; max-width: 420px; margin: 0 auto; position: relative;
}
.top-search input {
  width: 100%; height: 36px; border-radius: 18px; border: 1px solid var(--border);
  background: var(--surface2); padding: 0 16px 0 38px; color: var(--text); font-size: 13px;
  outline: none; transition: all .2s;
}
.top-search input:focus { border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 3px var(--primary-light); }
.top-search .search-ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text3); }
.search-dropdown {
  position: absolute; top: 42px; left: 0; right: 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  max-height: 420px; overflow-y: auto; display: none; z-index: 100;
}
.search-dropdown.show { display: block; }
.search-group { padding: 6px 0; }
.search-group-title { padding: 6px 14px; font-size: 12px; color: var(--text3); }
.search-item { padding: 8px 14px; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.search-item:hover { background: var(--hover); }
.search-item .t { font-size: 13px; }
.search-item .d { font-size: 12px; color: var(--text3); margin-left: auto; }

.user-chip {
  display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 5px; border-radius: 18px;
  cursor: pointer; transition: background .15s;
}
.user-chip:hover { background: var(--hover); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep)); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 64px; height: 64px; font-size: 24px; }
.user-chip .un { font-size: 13px; font-weight: 500; }
.dropdown {
  position: absolute; top: 48px; right: 0; min-width: 180px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 6px; display: none; z-index: 100;
}
.dropdown.show { display: block; }
.dropdown .dd-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 13px; color: var(--text2); white-space: nowrap;
}
.dropdown .dd-item:hover { background: var(--hover); color: var(--primary); }
.dropdown .dd-item.danger:hover { color: var(--danger); }
.dropdown .dd-sep { height: 1px; background: var(--border); margin: 5px 0; }

/* ================= TAB 标签 ================= */
.tabbar {
  display: flex; align-items: flex-end; height: 40px; background: var(--surface);
  border-bottom: 1px solid var(--border); padding: 0 8px; gap: 4px; overflow-x: auto;
  overflow-y: hidden; flex-shrink: 0; scrollbar-width: none;
}
.tabbar::-webkit-scrollbar { display: none; }
.tab-item {
  display: flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px 0 12px;
  border-radius: 8px 8px 0 0; background: var(--surface2); color: var(--text2);
  font-size: 13px; cursor: pointer; white-space: nowrap; position: relative;
  border: 1px solid transparent; border-bottom: none; transition: all .15s; flex-shrink: 0;
  max-width: 200px; user-select: none;
}
.tab-item:hover { color: var(--primary); }
.tab-item.active {
  background: var(--surface); color: var(--primary); font-weight: 600;
  border-color: var(--border);
}
.tab-item.active::after {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--primary-deep)); border-radius: 2px;
}
.tab-item .tab-title { overflow: hidden; text-overflow: ellipsis; }
.tab-item .tab-close {
  width: 16px; height: 16px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 14px; line-height: 1; color: var(--text3); flex-shrink: 0;
}
.tab-item .tab-close:hover { background: var(--danger); color: #fff; }
.tab-more { margin-left: auto; align-self: center; }
.tab-ctxmenu {
  position: fixed; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 5px; display: none; z-index: 999;
  min-width: 130px;
}
.tab-ctxmenu.show { display: block; }
.tab-ctxmenu .ci { padding: 7px 12px; font-size: 13px; color: var(--text2); border-radius: 6px; cursor: pointer; white-space: nowrap; }
.tab-ctxmenu .ci:hover { background: var(--hover); color: var(--primary); }

.content { flex: 1; overflow: hidden; position: relative; }
.page-view { position: absolute; inset: 0; overflow-y: auto; padding: 16px; display: none; animation: pageIn .22s ease; }
.page-view.show { display: block; }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ================= 卡片与统计 ================= */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.card-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
}
.card-head .ct { font-size: 15px; font-weight: 600; }
.card-head .cs { font-size: 12px; color: var(--text3); }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 16px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 14px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow);
  position: relative; overflow: hidden; transition: transform .18s, box-shadow .18s; cursor: default;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-card::after {
  content: ''; position: absolute; right: -20px; top: -20px; width: 90px; height: 90px;
  border-radius: 50%; background: var(--sc, var(--primary-light)); opacity: .5;
}
.stat-card .sicon {
  width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center;
  justify-content: center; color: #fff; flex-shrink: 0;
  background: linear-gradient(135deg, var(--sc1, var(--primary)), var(--sc2, var(--primary-deep)));
  box-shadow: 0 6px 16px var(--sc, var(--primary-light));
}
.stat-card .sinfo { min-width: 0; }
.stat-card .sval { font-size: 24px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-card .slabel { font-size: 13px; color: var(--text2); }
.stat-card .strend { font-size: 12px; color: var(--text3); margin-top: 2px; }
.stat-card .strend .up { color: var(--success); }
.stat-card .strend .down { color: var(--danger); }
/* 工作台统计卡片: 右上角红色数字角标 */
.sc-badge {
  position: absolute; top: 12px; right: 14px; z-index: 2; display: none;
  align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 10px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700;
  font-variant-numeric: tabular-nums; box-shadow: 0 2px 8px rgba(240, 68, 56, .38);
  animation: scBadgePop .24s cubic-bezier(.2, .9, .3, 1.3);
}
.sc-badge.show { display: flex; }
@keyframes scBadgePop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
/* 卡片标题栏内的小角标 */
.hd-badge {
  display: none; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700;
  font-variant-numeric: tabular-nums; margin-right: 2px;
}
.hd-badge.show { display: inline-flex; }

.dash-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
.dash-grid .chart-card { min-height: 300px; }
.dash-grid .panel { display: flex; flex-direction: column; }
.dash-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
/* 仪表盘: 所有区块等距对齐(统一 14px 间距) */
.dash-wrap { display: flex; flex-direction: column; gap: 14px; }
.dash-wrap > .stat-grid { margin-bottom: 0; }
.dash-wrap > .dash-grid, .dash-wrap > .dash-row2 { margin-top: 0; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } .dash-row2 { grid-template-columns: 1fr; } }

.chart-box { position: relative; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px; padding: 8px 4px 0; }
.chart-legend .lg { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text2); }
.chart-legend .dot { width: 9px; height: 9px; border-radius: 12px; }
.chart-tip {
  position: fixed; background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: var(--shadow-lg); padding: 8px 12px; font-size: 12px; pointer-events: none;
  display: none; z-index: 2000; white-space: nowrap;
}
.chart-tip .tt { font-weight: 600; margin-bottom: 2px; }
.chart-tip .tv { color: var(--primary); font-weight: 600; }

.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quick-item {
  display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 13px 6px;
  border-radius: var(--radius-sm); cursor: pointer; transition: all .15s; border: 1px solid transparent;
}
.quick-item:hover { background: var(--hover); border-color: var(--border); transform: translateY(-2px); }
.quick-item .qi {
  width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: var(--primary-light); color: var(--primary); position: relative;
}
.quick-item span { font-size: 12px; color: var(--text2); }
/* 快捷入口图标角标 */
.quick-item .qi-badge {
  position: absolute; top: -5px; right: -7px; z-index: 2; display: none;
  align-items: center; justify-content: center; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700;
  font-variant-numeric: tabular-nums; border: 2px solid var(--surface);
}
.quick-item .qi-badge.show { display: flex; }

/* ================= 列表与表格 ================= */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar .spacer { flex: 1; }
.toolbar .filter-item { display: flex; align-items: center; gap: 6px; }
.toolbar .filter-item label { font-size: 13px; color: var(--text2); white-space: nowrap; }
.input, .select, .textarea {
  height: 34px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--input-bg); color: var(--text); padding: 0 11px; font-size: 13px;
  outline: none; transition: all .18s; min-width: 0;
}
.textarea { height: auto; padding: 8px 11px; resize: vertical; line-height: 1.5; width: 100%; box-sizing: border-box; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.input::placeholder { color: var(--text3); }
.select { cursor: pointer; appearance: none; padding-right: 28px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2393a1b5' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.btn {
  height: 34px; padding: 0 15px; border: none; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 13px; display: inline-flex; align-items: center; gap: 6px; transition: all .15s;
  background: var(--surface2); color: var(--text2); border: 1px solid var(--border); white-space: nowrap;
}
.btn:hover { color: var(--primary); border-color: var(--primary); }
.btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-deep)); color: #fff; border: none;
  box-shadow: 0 4px 12px rgba(79, 110, 247, 0.3);
}
.btn.primary:hover { filter: brightness(1.08); color: #fff; box-shadow: 0 6px 16px rgba(79, 110, 247, 0.4); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.success { color: var(--success); }
.btn.success:hover { background: var(--success); border-color: var(--success); color: #fff; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn.link { border: none; background: none; padding: 0 6px; height: auto; color: var(--primary); }
.btn.link:hover { text-decoration: underline; }
.btn.link.danger { color: var(--danger); }
/* 彩色悬停态一律白字(修复红底红字看不见的问题) */
.btn.link.danger:hover { background: var(--danger); color: #fff; text-decoration: none; }
.btn.link.success:hover { background: var(--success); color: #fff; text-decoration: none; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; box-shadow: var(--shadow); }
table.dt { width: 100%; border-collapse: collapse; font-size: 13px; }
table.dt thead th {
  background: var(--surface2); color: var(--text2); font-weight: 600; text-align: left;
  padding: 10px 12px; white-space: nowrap; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 2;
}
table.dt tbody td { padding: 10px 12px; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
table.dt tbody tr { transition: background .12s; }
table.dt tbody tr:hover { background: var(--hover); }
table.dt tbody tr:last-child td { border-bottom: none; }
table.dt .strong { font-weight: 600; color: var(--text); }
table.dt .num { font-variant-numeric: tabular-nums; }
.row-actions { display: flex; gap: 2px; flex-wrap: nowrap; }
.cell-user { display: flex; align-items: center; gap: 8px; }
.cell-user .avatar { width: 26px; height: 26px; font-size: 11px; }

.tag {
  display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 10px;
  font-size: 12px; font-weight: 500; line-height: 1.5; white-space: nowrap;
}
.tag.green { background: rgba(22,179,100,.12); color: var(--success); }
.tag.red { background: rgba(240,68,56,.12); color: var(--danger); }
.tag.orange { background: rgba(247,144,9,.14); color: var(--warning); }
.tag.blue { background: rgba(46,144,250,.12); color: var(--info); }
.tag.gray { background: rgba(139,152,173,.16); color: var(--gray); }
.tag.purple { background: rgba(139,92,246,.13); color: var(--purple); }
.tag.pink { background: rgba(236,72,153,.13); color: var(--pink); }
.tag.brown { background: rgba(162,132,94,.16); color: var(--brown); }
/* 系统维护项(只读)标记 */
.input.ro { background: var(--hover); color: var(--text2); cursor: not-allowed; }
/* 只读归属人(跟进人固定为当前登录人) */
.ro-self { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--hover); }
.ro-self .rs-avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }
.ro-self .rs-name { font-size: 13px; color: var(--text); }
.ro-self .rs-tip { font-size: 12px; color: var(--text3); margin-left: auto; }
.tag.ro { margin-left: 6px; background: rgba(247,144,9,.14); color: var(--warning); }
[data-theme="dark"] .tag.ro { background: rgba(247,144,9,.22); }
table.dt tbody tr.ro-row td { background: rgba(139,152,173,.06); }
table.dt tbody tr.ro-row:hover td { background: rgba(139,152,173,.1); }
.row-actions .ro-tip { color: var(--text3); font-size: 12px; padding: 0 2px; white-space: nowrap; }
[data-theme="dark"] .tag.green { background: rgba(22,179,100,.2); }
[data-theme="dark"] .tag.red { background: rgba(240,68,56,.2); }
[data-theme="dark"] .tag.orange { background: rgba(247,144,9,.22); }
[data-theme="dark"] .tag.blue { background: rgba(46,144,250,.2); }
[data-theme="dark"] .tag.gray { background: rgba(139,152,173,.22); }
[data-theme="dark"] .tag.purple { background: rgba(139,92,246,.22); }
[data-theme="dark"] .tag.pink { background: rgba(236,72,153,.22); }

.progress { display: flex; align-items: center; gap: 8px; }
.progress .pbar { flex: 1; height: 6px; border-radius: 10px; background: var(--surface3); overflow: hidden; min-width: 60px; }
.progress .pbar i { display: block; height: 100%; border-radius: 10px; background: linear-gradient(90deg, var(--primary), var(--primary-deep)); transition: width .5s; }
.progress .pval { font-size: 12px; color: var(--text2); font-variant-numeric: tabular-nums; }

.pager { display: flex; align-items: center; gap: 6px; padding: 10px 12px; flex-wrap: wrap; }
.pager .pi {
  min-width: 30px; height: 30px; padding: 0 6px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text2); font-size: 13px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.pager .pi:hover:not([disabled]):not(.on) { color: var(--primary); border-color: var(--primary); }
.pager .pi.on { background: linear-gradient(135deg, var(--primary), var(--primary-deep)); color: #fff; border-color: transparent; }
.pager .pi[disabled] { opacity: .45; cursor: not-allowed; }
.pager .pinfo { margin-left: auto; font-size: 12px; color: var(--text3); }

.empty { padding: 46px 0; text-align: center; color: var(--text3); }
.empty .eico { opacity: .5; margin-bottom: 10px; }
.empty .etxt { font-size: 13px; }
.skeleton { background: var(--skeleton); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 6px; height: 14px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ================= 弹层 ================= */
/* 性能: 去掉全屏 backdrop-filter(每帧模糊整页, 低端机明显卡顿), 用更实的遮罩色替代 */
.mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.52);
  z-index: 1000; display: flex; align-items: center; justify-content: center; animation: fadeIn .18s;
}
[data-theme="dark"] .mask { background: rgba(2, 6, 16, 0.62); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg);
  width: 92%; max-width: 560px; max-height: 90vh; display: flex; flex-direction: column;
  animation: modalIn .22s cubic-bezier(.2,.9,.3,1.2); border: 1px solid var(--border);
}
.modal.lg { max-width: 860px; }
.modal.md { max-width: 680px; }
.modal.sm { max-width: 420px; }
/* 超宽弹层(打印模板/表单/流程设计器): 宽屏固定1600px, 小屏不超过视口 */
.modal.xl { width: min(1600px, calc(100vw - 40px)); max-width: none; }
@keyframes modalIn { from { opacity: 0; transform: scale(.94) translateY(10px); } to { opacity: 1; transform: none; } }
.modal-head {
  display: flex; align-items: center; padding: 15px 18px; border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}
.modal-head .mt { font-size: 15px; font-weight: 600; }
.modal-head .ms { font-size: 12px; color: var(--text3); margin-left: 10px; }
.modal-head .mclose { margin-left: auto; }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot { padding: 13px 18px; border-top: 1px solid var(--border-light); display: flex; gap: 8px; justify-content: flex-end; flex-shrink: 0; }
.modal-foot.center { justify-content: center; }

/* 表单 */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid .fg.full { grid-column: 1 / -1; }
.form-grid .fg label { display: block; font-size: 13px; color: var(--text2); margin-bottom: 6px; }
.form-grid .fg label .req { color: var(--danger); margin-right: 3px; }
.form-grid .fg .input, .form-grid .fg .select, .form-grid .fg .textarea { width: 100%; }
.form-grid .fg .ftip { font-size: 12px; color: var(--text3); margin-top: 4px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.switch { position: relative; width: 42px; height: 22px; display: inline-block; cursor: pointer; }
.switch input { display: none; }
.switch .track {
  position: absolute; inset: 0; border-radius: 22px; background: var(--surface3); transition: background .2s;
}
.switch .track::after {
  content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.switch input:checked + .track { background: linear-gradient(135deg, var(--primary), var(--primary-deep)); }
.switch input:checked + .track::after { transform: translateX(20px); }
.radio-row { display: flex; gap: 14px; align-items: center; height: 34px; }
.radio-row label { display: flex; align-items: center; gap: 5px; cursor: pointer; font-size: 13px; color: var(--text); margin: 0 !important; }

/* 省市区三级联动 */
.rg-row { display: flex; gap: 8px; width: 100%; }
.rg-row .select { flex: 1; min-width: 0; }
.filter-item .rg-row { width: 330px; }
.filter-item .rg-row .select { font-size: 13px; }

/* 详情展示 */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.detail-grid .ditem { display: flex; padding: 9px 0; border-bottom: 1px dashed var(--border-light); }
.detail-grid .ditem .dk { width: 96px; flex-shrink: 0; color: var(--text3); font-size: 13px; }
.detail-grid .ditem .dv { flex: 1; font-size: 13px; word-break: break-all; }
.detail-grid .ditem.full { grid-column: 1 / -1; }
.detail-grid .ditem.full .dv { white-space: pre-wrap; }
.detail-section { font-size: 13px; font-weight: 600; color: var(--text2); margin: 16px 0 8px; display: flex; align-items: center; gap: 8px; }
.detail-section::before { content: ''; width: 3px; height: 13px; border-radius: 2px; background: linear-gradient(180deg, var(--primary), var(--primary-deep)); }

/* 客户详情: 跟进记录区 */
.fd-follow { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 14px; }
.fd-follow .ff-head { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.fd-follow .ff-list { display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow: auto; padding-right: 2px; }
.fd-follow .ff-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.fd-follow .ff-item .tag { flex-shrink: 0; }
.fd-follow .ff-content { flex: 1; font-size: 13px; color: var(--text); word-break: break-all; }
.fd-follow .ff-user { font-size: 12px; color: var(--text2); flex-shrink: 0; }
.fd-follow .ff-time { font-size: 12px; color: var(--text3); flex-shrink: 0; }
.fd-follow .ff-add { display: flex; gap: 8px; margin-top: 12px; }
.fd-follow .ff-add .ff-type { width: 128px; flex-shrink: 0; }
.fd-follow .ff-add .ff-txt { flex: 1; }
.fd-follow .ff-tip { font-size: 12px; color: var(--text3); padding: 14px 0; text-align: center; }

/* 审批时间线 */
.flow-steps { position: relative; padding-left: 22px; }
.flow-steps::before { content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.flow-step { position: relative; padding-bottom: 18px; }
.flow-step:last-child { padding-bottom: 0; }
.flow-step .fsdot {
  position: absolute; left: -22px; top: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--border);
}
.flow-step.pass .fsdot { border-color: var(--success); background: var(--success); }
.flow-step.reject .fsdot { border-color: var(--danger); background: var(--danger); }
.flow-step.current .fsdot { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-light); }
.flow-step .fsname { font-weight: 600; font-size: 13px; }
.flow-step .fsmeta { font-size: 12px; color: var(--text3); margin-top: 2px; }
.flow-step .fsopinion { font-size: 12px; color: var(--text2); margin-top: 3px; background: var(--surface2); padding: 6px 10px; border-radius: 6px; }

/* Toast */
.toast-box { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 3000; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  display: flex; align-items: center; gap: 9px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow-lg); padding: 10px 16px; font-size: 13px;
  animation: toastIn .25s cubic-bezier(.2,.9,.3,1.2);
}
.toast.hide { animation: toastOut .25s forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-14px); } }
.toast .tico { display: flex; }
.toast.success .tico { color: var(--success); }
.toast.error .tico { color: var(--danger); }
.toast.warning .tico { color: var(--warning); }
.toast.info .tico { color: var(--info); }

/* 加载 */
.loading-mask { position: fixed; inset: 0; z-index: 2500; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.spinner {
  width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--primary-light);
  border-top-color: var(--primary); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 通知下拉 */
.notify-panel { width: 320px; max-height: 420px; overflow-y: auto; }
.notify-panel .np-head { display: flex; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border-light); font-weight: 600; }
.notify-panel .np-head .link { margin-left: auto; font-size: 12px; font-weight: 400; cursor: pointer; color: var(--primary); }
.notify-item { display: flex; gap: 10px; padding: 11px 14px; cursor: pointer; border-bottom: 1px solid var(--border-light); }
.notify-item:hover { background: var(--hover); }
.notify-item .nico { width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.notify-item .nico.flow { background: rgba(247,144,9,.14); color: var(--warning); }
.notify-item .nico.task { background: rgba(46,144,250,.12); color: var(--info); }
.notify-item .nico.mail { background: rgba(139,92,246,.13); color: var(--purple); }
.notify-item .nico.inform { background: rgba(22,179,100,.12); color: var(--success); }
.notify-item .nt { font-size: 13px; line-height: 1.4; }
.notify-item .nd { font-size: 11px; color: var(--text3); margin-top: 2px; }

/* 通讯录 */
.contact-wrap { display: grid; grid-template-columns: 240px 1fr; gap: 14px; height: 100%; }
.dept-tree { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; overflow-y: auto; }
.dept-tree .dt-node { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; color: var(--text2); }
.dept-tree .dt-node:hover { background: var(--hover); }
.dept-tree .dt-node.on { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.dept-tree .dt-child { padding-left: 18px; }
/* 层级缩进(子部门容器) */
.dept-tree .dt-children { margin-left: 17px; border-left: 1px dashed var(--border); padding-left: 7px; }
.dept-tree .dt-children .dt-node { font-size: 12.5px; }
/* 目录树: 文件夹设置按钮 */
.dept-tree .dt-gear {
  margin-left: auto; width: 22px; height: 22px; display: none; align-items: center; justify-content: center;
  border: 0; background: transparent; color: var(--text3); cursor: pointer; border-radius: 6px; flex-shrink: 0;
}
.dept-tree .dt-node:hover .dt-gear { display: inline-flex; }
.dept-tree .dt-gear:hover { background: var(--surface3); color: var(--primary); }
/* 访问权限设置 */
.acl-box { font-size: 13px; }
.acl-tip { font-size: 12px; color: var(--text3); background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; line-height: 1.6; margin-bottom: 10px; }
.acl-sec { margin-bottom: 12px; }
.acl-sec-t { font-weight: 600; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.acl-sec-t .acl-search { width: 200px; height: 28px; font-size: 12px; margin-left: auto; }
.acl-list { max-height: 220px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px; }
.acl-row { display: flex; align-items: center; gap: 10px; padding: 5px 8px; border-radius: 6px; }
.acl-row:hover { background: var(--hover); }
.acl-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acl-ops { display: inline-flex; align-items: center; gap: 12px; flex-shrink: 0; }
.acl-chk { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text2); cursor: pointer; }
.acl-chk input { accent-color: var(--primary); }
.acl-empty { padding: 10px; text-align: center; font-size: 12px; color: var(--text3); }
/* 访问权限: 部门目录树(按组织架构层级) */
.acl-hint { margin-left: auto; font-size: 11.5px; color: var(--text3); font-weight: 400; }
.acl-dtree { max-height: 260px; padding: 4px; }
.acl-dnode { user-select: none; }
.acl-dnode.closed > .acl-dchildren { display: none; }
.acl-drow { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; }
.acl-drow:hover { background: var(--hover); }
.acl-drow > svg { flex-shrink: 0; color: var(--text3); }
.acl-drow .acl-name { font-weight: 500; }
.acl-dtoggle {
  width: 18px; height: 18px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--text3); cursor: pointer; border-radius: 4px;
  transition: transform .16s, background .15s;
}
.acl-dtoggle:hover { background: var(--surface3); color: var(--primary); }
.acl-dnode.closed > .acl-drow .acl-dtoggle { transform: rotate(-90deg); }
.acl-dspacer { width: 18px; flex-shrink: 0; }
.acl-dchildren { margin-left: 15px; border-left: 1px dashed var(--border); padding-left: 8px; }

/* ================= 申请权限(表单白名单) ================= */
.fa-wrap { display: flex; gap: 14px; align-items: flex-start; }
.fa-left { width: 330px; flex-shrink: 0; padding: 12px; max-height: 74vh; overflow: auto; }
.fa-right { flex: 1; padding: 16px; min-height: 380px; }
.fa-ltitle { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.fa-ltabs { margin-bottom: 10px; }
.fa-search { width: 100%; margin-bottom: 10px; height: 32px; }
.fa-list { display: flex; flex-direction: column; gap: 8px; }
/* 左侧条目卡片 */
.fa-item {
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; cursor: pointer;
  background: var(--surface); transition: border-color .15s, background .15s, box-shadow .15s;
}
.fa-item:hover { border-color: var(--primary); background: var(--hover); }
.fa-item.on { border-color: var(--primary); background: var(--primary-light); box-shadow: inset 0 0 0 1px var(--primary); }
.fa-itop { display: flex; align-items: center; gap: 8px; }
.fa-in { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--text); }
.fa-item.on .fa-in { font-weight: 600; color: var(--primary); }
.fa-isub { margin-top: 3px; font-size: 11.5px; color: var(--text3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 右侧头部 */
.fa-rhead { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.fa-rhl { flex: 1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fa-rt { font-size: 15px; font-weight: 600; color: var(--text); }
.fa-rs { font-size: 12px; color: var(--text3); }
/* 卡片 */
.fa-card { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; background: var(--surface); }
.fa-card-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--surface2); border-bottom: 1px solid var(--border); }
.fa-card-head .ct { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text); }
.fa-card-head .ct svg { color: var(--primary); }
.fa-card-head .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.fa-card-head .right .input { height: 30px; }
.fa-cnt { font-size: 11.5px; color: var(--text3); background: var(--surface3); border-radius: 20px; padding: 2px 9px; white-space: nowrap; }
.fa-cnt.on { color: var(--primary); background: var(--primary-light); font-weight: 600; }
.fa-card-body { padding: 10px 12px; max-height: 300px; overflow: auto; }
/* 部门目录树 */
.fa-tree { user-select: none; }
.fa-tnode.closed > .fa-tchildren { display: none; }
.fa-trow { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: var(--radius-sm); transition: background .15s; }
.fa-trow:hover { background: var(--hover); }
.fa-trow-pick { cursor: pointer; }
.fa-trow-pick.on { background: var(--primary-light); }
.fa-ttoggle {
  width: 18px; height: 18px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--text3); cursor: pointer; border-radius: 4px; padding: 0;
  transition: transform .16s, background .15s, color .15s;
}
.fa-ttoggle:hover { background: var(--surface3); color: var(--primary); }
.fa-tnode.closed > .fa-trow .fa-ttoggle { transform: rotate(-90deg); }
.fa-tspace { width: 18px; flex-shrink: 0; }
.fa-ticon { display: inline-flex; flex-shrink: 0; color: var(--text3); }
.fa-tname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--text); }
.fa-trow-pick.on .fa-tname { color: var(--primary); font-weight: 600; }
.fa-tchk { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text3); cursor: pointer; flex-shrink: 0; }
.fa-tchk input { accent-color: var(--primary); width: 15px; height: 15px; cursor: pointer; margin: 0; }
.fa-tchildren { margin-left: 16px; border-left: 1px dashed var(--border); padding-left: 4px; }
/* 人员卡片 */
.fa-plist { display: flex; flex-direction: column; gap: 12px; }
.fa-pgroup { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.fa-pgt { font-size: 12.5px; font-weight: 600; color: var(--text); }
.fa-pgn { font-size: 11px; color: var(--text3); background: var(--surface3); border-radius: 20px; padding: 1px 8px; }
.fa-pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.fa-pcard {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.fa-pcard:hover { border-color: var(--primary); background: var(--hover); }
.fa-pcard.on { border-color: var(--primary); background: var(--primary-light); box-shadow: inset 0 0 0 1px var(--primary); }
.fa-pav {
  width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--primary-light); color: var(--primary); font-size: 13px; font-weight: 600;
}
.fa-pinfo { flex: 1; min-width: 0; }
.fa-pn { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fa-pcard.on .fa-pn { color: var(--primary); font-weight: 600; }
.fa-pp { font-size: 11.5px; color: var(--text3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fa-pchk { display: inline-flex; flex-shrink: 0; }
.fa-pchk input { accent-color: var(--primary); width: 15px; height: 15px; cursor: pointer; margin: 0; }
.fa-empty { padding: 14px; text-align: center; font-size: 12px; color: var(--text3); }
/* 按部门·人员配置: 可申请表单卡片 */
.fa-flowlist { display: flex; flex-direction: column; gap: 8px; max-height: 62vh; overflow: auto; }
.fa-flowitem {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.fa-flowitem:hover { border-color: var(--primary); background: var(--hover); }
.fa-flowitem.on { border-color: var(--primary); background: var(--primary-light); box-shadow: inset 0 0 0 1px var(--primary); }
.fa-fchk { display: inline-flex; flex-shrink: 0; }
.fa-fchk input { accent-color: var(--primary); width: 15px; height: 15px; cursor: pointer; margin: 0; }
.fa-fn { flex: 1; min-width: 0; font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fa-flowitem.on .fa-fn { color: var(--primary); font-weight: 600; }
.fa-fs { font-size: 11.5px; color: var(--text3); }
.user-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; align-content: start; }
.user-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  transition: all .16s; cursor: default;
}
.user-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--primary); }
.user-card .un { font-weight: 600; font-size: 14px; }
.user-card .up { font-size: 12px; color: var(--text3); }
.user-card .ut { font-size: 12px; color: var(--text2); display: flex; align-items: center; gap: 5px; }

/* 考勤打卡 */
.attend-clock { text-align: center; padding: 20px 0 8px; }
.attend-clock .ac-time { font-size: 44px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 2px; }
.attend-clock .ac-date { color: var(--text2); margin-top: 4px; }
.attend-clock .ac-btns { display: flex; gap: 14px; justify-content: center; margin-top: 20px; }
.attend-clock .ac-btn {
  width: 110px; height: 110px; border-radius: 50%; border: none; cursor: pointer; color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 14px; transition: all .18s; box-shadow: 0 10px 26px rgba(79,110,247,.35);
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
}
.attend-clock .ac-btn.out { background: linear-gradient(135deg, #f79009, #f04438); box-shadow: 0 10px 26px rgba(247,144,9,.3); }
.attend-clock .ac-btn:hover:not([disabled]) { transform: scale(1.05); }
.attend-clock .ac-btn[disabled] { background: var(--surface3); color: var(--text3); box-shadow: none; cursor: not-allowed; }
.attend-clock .ac-btn small { font-size: 11px; opacity: .85; }

/* 流程卡片 */
.flow-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.flow-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 14px; display: flex; flex-direction: column; align-items: center; gap: 10px;
  cursor: pointer; transition: all .18s;
}
.flow-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--primary); }
.flow-card .fc-ico {
  width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary-light), transparent); color: var(--primary);
  border: 1px solid var(--border);
}
.flow-card .fc-name { font-weight: 600; font-size: 14px; }
.flow-card .fc-desc { font-size: 12px; color: var(--text3); text-align: center; }
.flow-card-link { border-style: dashed; }
.flow-card-link .fc-ico { background: linear-gradient(135deg, rgba(46,144,250,.18), transparent); color: var(--info); }

/* 内嵌TAB(页面内) */
.sub-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.sub-tabs .st {
  padding: 8px 16px; cursor: pointer; font-size: 13px; color: var(--text2); position: relative;
  border-radius: 8px 8px 0 0; display: flex; align-items: center; gap: 6px;
}
.sub-tabs .st:hover { color: var(--primary); }
.sub-tabs .st.on { color: var(--primary); font-weight: 700; }
.sub-tabs .st.on::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: linear-gradient(90deg, var(--primary), var(--primary-deep)); border-radius: 8px 8px 0 0; }

/* 邮件 */
.mail-layout { display: grid; grid-template-columns: 200px 1fr; gap: 14px; }
.mail-side { display: flex; flex-direction: column; gap: 4px; }
.mail-side .ms-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 13px; color: var(--text2);
}
.mail-side .ms-item:hover { background: var(--hover); }
.mail-side .ms-item.on { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.mail-side .ms-item .cnt { margin-left: auto; font-size: 12px; color: var(--danger); font-weight: 600; }
.mail-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border-light); cursor: pointer; }
.mail-item:hover { background: var(--hover); }
.mail-item.unread .ms-subject { font-weight: 700; }
.mail-item .ms-from { width: 110px; flex-shrink: 0; font-size: 13px; }
.mail-item .ms-main { flex: 1; min-width: 0; }
.mail-item .ms-subject { font-size: 13px; }
.mail-item .ms-preview { font-size: 12px; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-item .ms-time { font-size: 12px; color: var(--text3); flex-shrink: 0; }
.mail-detail .md-head { border-bottom: 1px solid var(--border-light); padding-bottom: 14px; margin-bottom: 14px; }
.mail-detail .md-subject { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.mail-detail .md-meta { font-size: 12px; color: var(--text3); display: flex; flex-wrap: wrap; gap: 14px; }
.mail-detail .md-content { font-size: 14px; line-height: 1.8; white-space: pre-wrap; }
.mail-detail .md-tip {
  font-size: 12px; color: var(--danger); background: var(--danger-light, #fef0f0);
  border: 1px solid #ffd2d2; padding: 6px 10px; border-radius: 6px; margin-bottom: 12px;
}
.mail-item .ms-clip { font-size: 11px; color: var(--text3); display: inline-flex; align-items: center; gap: 2px; }
.mail-item .ms-recall { flex-shrink: 0; }

/* 邮件列表搜索栏 */
.mail-search { padding: 10px 12px; background: var(--surface, #fff); border: 1px solid var(--border); border-radius: var(--radius); }
.mail-search .ms-tilde { color: var(--text3); font-size: 13px; }

/* 邮件附件 */
.att-box { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.att-row { display: flex; align-items: center; gap: 10px; }
.att-empty { font-size: 12px; color: var(--text3); }
.att-item {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text2);
  border: 1px solid var(--border); border-radius: 6px; padding: 4px 8px; background: var(--bg, #fff);
  text-decoration: none; max-width: 100%;
}
a.att-item:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.att-item .att-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.att-item .att-size { color: var(--text3); font-size: 11px; flex-shrink: 0; }
.att-item .mp-del { border: none; background: transparent; cursor: pointer; color: inherit; padding: 1px; display: flex; align-items: center; opacity: .7; }
.att-item .mp-del:hover { opacity: 1; }
.md-attach { margin-top: 16px; border-top: 1px solid var(--border-light); padding-top: 12px; }
.md-attach-t { font-size: 12px; color: var(--text3); margin-bottom: 8px; }
.md-attach .att-item { margin: 0 8px 8px 0; }

/* 详情弹层 - 可点击字段(文档名称等) */
.dv-link { color: var(--primary); text-decoration: none; border-bottom: 1px dashed var(--primary); cursor: pointer; }
.dv-link:hover { color: var(--primary-hover, #0d47c9); }
/* 详情弹层 - 单行截断(如原始文件名: 不换行, 最多约12个汉字, 溢出省略) */
.dv-ellipsis {
  display: inline-block; max-width: 12em; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; vertical-align: bottom;
}

/* 个人信息 */
.profile-head { display: flex; align-items: center; gap: 18px; }
.profile-head .pinfo .pn { font-size: 20px; font-weight: 700; }
.profile-head .pinfo .pp { color: var(--text2); font-size: 13px; margin-top: 2px; }
.profile-tags { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

/* 图表卡片通用 */
.chart-title { display: flex; align-items: baseline; gap: 8px; }
.chart-title .cv { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ================= 顶部分类菜单栏 ================= */
.catbar {
  height: 42px; background: var(--header-bg-solid); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 4px; padding: 0 12px; flex-shrink: 0;
  overflow-x: auto; overflow-y: visible; position: relative; z-index: 14;
}
.catbar::-webkit-scrollbar { display: none; }
.catbar .cb-label { font-size: 12px; color: var(--text3); flex-shrink: 0; margin-right: 4px; display: flex; align-items: center; gap: 5px; }
.cat-chip {
  display: flex; align-items: center; gap: 7px; padding: 6px 14px; border-radius: 0;
  font-size: 13px; color: var(--text2); cursor: pointer; white-space: nowrap; flex-shrink: 0;
  border: 1px solid transparent; transition: all .16s; user-select: none;
}
.cat-chip:hover { background: var(--hover); color: var(--primary); }
.cat-chip.on {
  background: linear-gradient(135deg, var(--primary), var(--primary-deep)); color: #fff;
  box-shadow: 0 4px 14px rgba(79,110,247,.32); font-weight: 700;
}
.cat-chip .cb-cnt { font-size: 11px; opacity: .75; }
.catbar .cb-spacer { flex: 1; }
.catbar .cb-quick { font-size: 12px; color: var(--text3); display: flex; align-items: center; gap: 5px; flex-shrink: 0; }

/* 分类下拉面板 */
.cat-panel-wrap { position: relative; flex-shrink: 0; z-index: 30; }
.cat-panel {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 420px; max-width: 640px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 14px; z-index: 40;
  animation: catPanelIn .16s ease;
}
@keyframes catPanelIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.cat-panel .cp-head {
  display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700;
  padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--border-light);
}
.cat-panel .cp-head .cph-ico { color: var(--primary); display: flex; }
.cat-panel .cp-head .cph-tip { margin-left: auto; font-size: 11px; color: var(--text3); font-weight: 400; }
.cat-panel .cp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.cp-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 13px; color: var(--text2); transition: all .14s; position: relative;
  border: 1px solid transparent;
}
.cp-item:hover { background: var(--primary-light); color: var(--primary); border-color: var(--border); }
.cp-item.on { background: var(--primary-light); color: var(--primary); font-weight: 700; }
.cp-item .cpi-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-item .fav-star {
  flex-shrink: 0; width: 24px; height: 24px; border: none; background: transparent; cursor: pointer;
  border-radius: 6px; display: flex; align-items: center; justify-content: center; color: var(--text3);
  opacity: 0; transition: all .14s;
}
.cp-item:hover .fav-star { opacity: 1; }
.cp-item .fav-star:hover { background: var(--surface2); color: #f5a623; }
.cp-item .fav-star.on { opacity: 1; color: #f5a623; }
.cp-item .menu-badge { margin-left: 0; }

/* ================= 左侧常用菜单 ================= */
.fav-tip { font-size: 11px; color: var(--text3); padding: 8px 10px 6px; line-height: 1.6; }
.fav-empty { padding: 18px 12px; text-align: center; color: var(--text3); font-size: 12px; line-height: 1.7; }
.fav-empty .fe-ico { opacity: .5; margin-bottom: 6px; }
.menu-item .fav-star { margin-left: auto; }
.menu-item .fav-star.on { color: #f5a623; }

/* ================= 角色权限配置(细粒度) ================= */
.rp-tree { max-height: 460px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; }
.rp-cat { margin-bottom: 12px; }
.rp-cat-head {
  display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700;
  padding: 4px 2px 8px; border-bottom: 1px solid var(--border-light); margin-bottom: 6px;
}
.rp-cat-head svg { color: var(--primary); display: flex; }
.rp-cat-sw { margin-left: auto; }
.rp-cat-off > .rp-row { opacity: .45; }
.rp-row {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-sm);
  flex-wrap: wrap; transition: background .14s;
}
.rp-row:hover { background: var(--hover); }
.rp-row.on { background: var(--primary-light); }
.rp-main { display: flex; align-items: center; gap: 9px; min-width: 220px; flex: 1; }
.rp-main .switch { flex-shrink: 0; }
.rp-name { font-size: 13px; font-weight: 600; }
.rp-row.on .rp-name { color: var(--primary); }
.rp-page { font-size: 11px; color: var(--text3); }
.rp-acts { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rp-acts label {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text2);
  cursor: pointer; white-space: nowrap;
}
.rp-acts .rp-scope { width: 130px; height: 30px; font-size: 12px; }

/* 列表异步刷新过渡(不清空旧内容, 半透明等待新数据) */
#lp_table.lp-loading { opacity: .55; pointer-events: none; transition: opacity .15s; }

/* 列表标题列可点击查看详情 */
.dt .strong.linkable { cursor: pointer; color: var(--primary); }
.dt .strong.linkable:hover { text-decoration: underline; }

/* ================= 菜单管理 ================= */
.mm-wrap { display: grid; grid-template-columns: 260px 1fr; gap: 14px; align-items: start; }
.mm-cats { display: flex; flex-direction: column; gap: 4px; }
.mm-cat {
  display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 13px; color: var(--text2); border: 1px solid transparent; transition: all .14s;
}
.mm-cat:hover { background: var(--hover); }
.mm-cat.on { background: var(--primary-light); color: var(--primary); font-weight: 600; border-color: var(--border); }
.mm-cat .mc-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-cat .mc-cnt { font-size: 11px; color: var(--text3); background: var(--surface2); border-radius: 8px; padding: 1px 7px; }
.mm-cat .mc-ops { display: flex; gap: 2px; visibility: hidden; }
.mm-cat:hover .mc-ops { visibility: visible; }
.mm-cat .mc-ops button {
  border: none; background: transparent; cursor: pointer; color: var(--text3); padding: 3px;
  border-radius: 5px; display: flex; align-items: center;
}
.mm-cat .mc-ops button:hover { background: var(--surface3); color: var(--primary); }
.mm-cat .mc-ops button.danger:hover { color: var(--danger); }

/* ================= 图标选择器 ================= */
.ipk { width: 100%; }
.ipk-head { display: flex; align-items: center; gap: 10px; }
.ipk-prev {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--input-bg);
}
.ipk-prev-ico { display: inline-flex; color: var(--primary); flex-shrink: 0; }
.ipk-prev.empty .ipk-prev-ico { color: var(--text3); }
.ipk-prev-name { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ipk-prev.empty .ipk-prev-name { color: var(--text3); }
.ipk-toggle { flex-shrink: 0; }
.ipk-panel {
  margin-top: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); padding: 10px;
}
.ipk-search { width: 100%; height: 32px; margin-bottom: 10px; }
.ipk-groups { max-height: 260px; overflow: auto; }
.ipk-sec { margin-bottom: 12px; }
.ipk-sec:last-child { margin-bottom: 0; }
.ipk-sec-t {
  font-size: 11.5px; color: var(--text3); margin-bottom: 6px; font-weight: 600;
  position: sticky; top: -10px; background: var(--surface); padding: 2px 0;
}
.ipk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; }
.ipk-item {
  width: 100%; aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--text2); cursor: pointer; padding: 0; transition: all .14s;
}
.ipk-item:hover { border-color: var(--primary); color: var(--primary); background: var(--hover); }
.ipk-item.on { border-color: var(--primary); background: var(--primary-light); color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.ipk-none { padding: 16px; text-align: center; font-size: 12px; color: var(--text3); }

/* ================= JSON可视化编辑器(流程表单/步骤) ================= */
.je-wrap {
  border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: 12px 14px;
  background: var(--surface2); display: flex; align-items: center; gap: 12px;
}
.je-wrap .je-ico {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0; display: flex;
  align-items: center; justify-content: center; color: var(--primary);
  background: linear-gradient(135deg, var(--primary-light), transparent); border: 1px solid var(--border);
}
.je-wrap .je-info { flex: 1; min-width: 0; }
.je-wrap .je-info .jt { font-size: 13px; font-weight: 600; }
.je-wrap .je-info .jd { font-size: 12px; color: var(--text3); margin-top: 2px; }
.je-wrap .je-empty { color: var(--danger); }

/* ================= 可视化表单设计器 ================= */
.fd-wrap { display: grid; grid-template-columns: 118px 1fr 220px; gap: 14px; min-height: 380px; }
.fd-col { display: flex; flex-direction: column; min-width: 0; }
.fd-col-title {
  font-size: 12px; color: var(--text3); font-weight: 600; padding: 4px 2px 10px;
  display: flex; align-items: center; gap: 6px;
}
.fd-ai-btn { margin-left: auto; font-weight: 400; }
/* 智能识别字段结果面板 */
.ai-tip {
  font-size: 12.5px; color: var(--text2); line-height: 1.7; padding: 9px 11px; margin-bottom: 10px;
  background: var(--primary-light); border-radius: var(--radius-sm); display: flex; align-items: flex-start; gap: 6px;
}
.ai-tip b { color: var(--primary); }
.ai-tip2 { font-size: 11.5px; color: var(--text3); margin-top: 10px; display: flex; align-items: center; gap: 5px; }
.ai-tbl { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.ai-tr { display: grid; grid-template-columns: 1.3fr 1.3fr 130px 60px; gap: 8px; padding: 6px 10px; align-items: center; border-bottom: 1px solid var(--border-light); }
.ai-tr:last-child { border-bottom: none; }
.ai-tr:nth-child(even) { background: var(--surface2); }
.ai-th { font-size: 11.5px; color: var(--text3); font-weight: 600; background: var(--surface2); }
.ai-tr .input, .ai-tr .select { height: 30px; font-size: 12.5px; }
.fd-palette { display: flex; flex-direction: column; gap: 6px; }
.fd-pal-item {
  display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: 12px;
  color: var(--text2); transition: all .14s; text-align: left;
}
.fd-pal-item:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.fd-pal-item .fpi-ico { color: var(--primary); display: flex; }
.fd-canvas {
  flex: 1; border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: 10px;
  overflow-y: auto; max-height: 420px; background: var(--surface2);
}
.fd-canvas.dragover { border-color: var(--primary); background: var(--primary-light); }
.fd-field {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; transition: all .14s; position: relative;
}
.fd-field:hover { border-color: var(--primary); }
.fd-field.sel { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.fd-field.dragging { opacity: .45; }
.fd-field .ff-drag { color: var(--text3); cursor: grab; display: flex; flex-shrink: 0; }
.fd-field .ff-idx {
  width: 20px; height: 20px; border-radius: 6px; background: var(--surface3); color: var(--text2);
  font-size: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-weight: 600;
}
.fd-field .ff-ico { color: var(--primary); display: flex; flex-shrink: 0; }
.fd-field .ff-main { flex: 1; min-width: 0; }
.fd-field .ff-label { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fd-field .ff-meta { font-size: 11px; color: var(--text3); margin-top: 1px; }
.fd-field .ff-ops { display: flex; gap: 2px; flex-shrink: 0; }
.fd-field .ff-ops button {
  border: none; background: transparent; cursor: pointer; color: var(--text3); padding: 4px;
  border-radius: 5px; display: flex; align-items: center;
}
.fd-field .ff-ops button:hover { background: var(--surface3); color: var(--primary); }
.fd-field .ff-ops button.danger:hover { color: var(--danger); }
.fd-empty { text-align: center; color: var(--text3); font-size: 12px; padding: 40px 10px; line-height: 1.8; }
.fd-props { display: flex; flex-direction: column; gap: 10px; }
.fd-props .fp-tip { font-size: 12px; color: var(--text3); line-height: 1.7; padding: 10px; background: var(--surface2); border-radius: var(--radius-sm); }
.fd-add-row { display: flex; gap: 6px; margin-top: 8px; }

/* ================= 可视化流程步骤设计器 ================= */
.sd-wrap { padding: 6px 4px; max-height: 460px; overflow-y: auto; }
.sd-node {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); position: relative;
}
.sd-node.start, .sd-node.end {
  background: var(--surface2); justify-content: center; color: var(--text2); font-size: 13px; font-weight: 600;
  border-style: dashed;
}
.sd-node .sn-ico {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center;
  justify-content: center; color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-deep));
}
.sd-node .sn-main { flex: 1; min-width: 0; }
.sd-node .sn-name { font-size: 13px; font-weight: 600; }
.sd-node .sn-handler { font-size: 12px; color: var(--text3); margin-top: 2px; display: flex; align-items: center; gap: 5px; }
.sd-node .sn-ops { display: flex; gap: 2px; flex-shrink: 0; }
.sd-node .sn-ops button {
  border: none; background: transparent; cursor: pointer; color: var(--text3); padding: 5px;
  border-radius: 6px; display: flex; align-items: center;
}
.sd-node .sn-ops button:hover { background: var(--surface3); color: var(--primary); }
.sd-node .sn-ops button.danger:hover { color: var(--danger); }
.sd-connector {
  height: 30px; display: flex; align-items: center; justify-content: center; position: relative;
}
.sd-connector::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px;
  background: linear-gradient(180deg, var(--primary), var(--primary-deep)); opacity: .4;
}
.sd-connector .sc-arrow { color: var(--primary); background: var(--surface); padding: 3px; border-radius: 50%; position: relative; z-index: 1; border: 1px solid var(--border); }
.sd-add { margin-top: 4px; }

/* ================= 流程定义预览 ================= */
.fp-flow { display: flex; align-items: center; gap: 0; flex-wrap: wrap; padding: 3px 0 8px; }
.fp-node {
  display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface);
  min-width: 110px; position: relative; margin: 5px 0;
}
.fp-node .fpn-name { font-size: 12px; font-weight: 600; text-align: center; }
.fp-node .fpn-meta { font-size: 11px; color: var(--text3); text-align: center; }
.fp-node.start { border-style: dashed; background: var(--surface2); }
.fp-arrow { color: var(--primary); padding: 0 6px; flex-shrink: 0; display: flex; }
.fp-fields { display: flex; flex-wrap: wrap; gap: 6px; }
.fp-field {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 14px;
  background: var(--surface2); border: 1px solid var(--border); font-size: 12px; color: var(--text2);
}
.fp-field .req { color: var(--danger); }

/* ================= 可搜索下拉 ================= */
.ss-wrap { position: relative; }
.ss-btn {
  width: 100%; min-height: 38px; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 7px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: 13px; cursor: pointer; text-align: left;
  transition: border-color .15s;
}
.ss-btn:hover { border-color: var(--primary); }
.ss-btn .ss-val { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text3); }
.ss-btn.has-val .ss-val { color: var(--text); }
.ss-btn svg { flex-shrink: 0; color: var(--text3); }
.ss-panel {
  position: fixed; z-index: 1200; min-width: 200px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); padding: 8px; display: none;
}
.ss-wrap.open .ss-panel { display: block; }
.ss-wrap.open .ss-btn { border-color: var(--primary); }
.ss-search { margin-bottom: 7px; }
.ss-list { max-height: 220px; overflow-y: auto; }
.ss-item {
  padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--text2);
  display: flex; align-items: center; gap: 8px;
}
.ss-item:hover { background: var(--primary-light); color: var(--primary); }
.ss-item.on { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.ss-item .ssi-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-empty { text-align: center; color: var(--text3); font-size: 12px; padding: 16px 0; }

/* ================= 多选采集器(抄送对象选择) ================= */
.mp-wrap { position: relative; }
.mp-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 34px; }
.mp-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px 4px 11px;
  background: var(--primary-light); color: var(--primary); border: 1px solid var(--border);
  border-radius: 14px; font-size: 12px; max-width: 100%;
}
.mp-chip > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.mp-chip > .mp-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.mp-chip .mp-move {
  border: none; background: transparent; cursor: pointer; color: inherit; padding: 1px;
  border-radius: 50%; display: flex; align-items: center; opacity: .7; flex-shrink: 0;
}
.mp-chip .mp-move:hover { opacity: 1; background: rgba(0,0,0,.08); }
.mp-chip .mp-move[disabled] { opacity: .25; cursor: not-allowed; }
.mp-chip .mp-del {
  border: none; background: transparent; cursor: pointer; color: inherit; padding: 1px;
  border-radius: 50%; display: flex; align-items: center; opacity: .7; flex-shrink: 0;
}
.mp-chip .mp-del:hover { opacity: 1; background: rgba(0,0,0,.08); }
.mp-empty { font-size: 12px; color: var(--text3); line-height: 26px; }
.mp-add {
  margin-top: 7px; display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px;
  border: 1px dashed var(--border); border-radius: 16px; background: transparent;
  color: var(--text2); font-size: 12px; cursor: pointer; transition: all .15s;
}
.mp-add:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.mp-wrap.open .mp-add { border-color: var(--primary); color: var(--primary); }
.mp-panel { display: none; }
.mp-wrap.open .mp-panel { display: block; }

/* ================= 流程设计器 抄送配置 ================= */
.sd-cc {
  margin-top: 10px; padding: 10px 12px; border: 1px dashed var(--border);
  border-radius: var(--radius-sm); background: var(--surface2);
}
.sd-cc-head { display: flex; align-items: center; gap: 8px; }
.sd-cc-title { font-size: 12px; font-weight: 600; color: var(--text2); }
.sd-cc-body { margin-top: 10px; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.sd-cc-body .fg label { display: block; font-size: 12px; color: var(--text2); margin-bottom: 5px; }
@media (max-width: 900px) { .sd-cc-body { grid-template-columns: 1fr; } }
.fpn-cc {
  display: block; font-size: 11px; color: var(--text3); margin-top: 3px; text-align: center;
  max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ================= 部门视图切换 ================= */
.seg-view { display: inline-flex; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.sv-btn {
  display: flex; align-items: center; gap: 6px; padding: 6px 14px; border: none; border-radius: 7px;
  background: transparent; color: var(--text2); font-size: 13px; cursor: pointer; transition: all .15s;
}
.sv-btn:hover { color: var(--primary); }
/* 数据视图TAB(列表工具栏) */
.dv-tabs { margin-left: 8px; flex-shrink: 0; }
.sv-btn.on { background: var(--surface); color: var(--primary); font-weight: 600; box-shadow: var(--shadow); }

/* ================= 文件柜: 批量上传 / 多选 ================= */
.bu-list { max-height: 220px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px; }
.bu-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 6px 8px; border-radius: 6px; font-size: 13px;
}
.bu-item:nth-child(odd) { background: var(--surface2); }
.bu-item .bu-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bu-item .bu-st { flex-shrink: 0; color: var(--text3); font-size: 12px; }
.bu-item.ok .bu-st { color: var(--success, #00b42a); }
.bu-item.err .bu-st { color: var(--danger, #f53f3f); }
/* 批量上传结果提示条 */
.bu-tip {
  font-size: 12px; line-height: 1.6; padding: 7px 10px; border-radius: var(--radius-sm);
  margin-bottom: 8px; border: 1px solid var(--border); background: var(--surface2); color: var(--text2);
}
.bu-tip.ok { border-color: rgba(0, 180, 42, .4); background: rgba(0, 180, 42, .09); color: var(--success, #00b42a); }
.bu-tip.warn { border-color: rgba(255, 125, 0, .4); background: rgba(255, 125, 0, .09); color: #ff7d00; }
.dt td .row-chk, .dt th input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; accent-color: var(--primary); }

/* ================= 文件柜: 浏览/下载记录弹窗 ================= */
.doc-logs .dlg-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.doc-logs .dlg-searchbox { display: flex; gap: 8px; margin-left: auto; }
.doc-logs .dlg-searchbox .input { width: 210px; }
.doc-logs .dlg-table-wrap { max-height: 46vh; overflow: auto; }
.doc-logs .dlg-table-wrap .dt { margin: 0; }
.doc-logs .pager { border-top: 1px solid var(--border); margin-top: 8px; padding: 8px 0 0; }
.doc-logs .t3 { color: var(--text3); font-size: 12px; }

/* ================= 资源占用: 日历 / 甘特视图(独立前缀 vcal- / vd- / vw-) ================= */
.v-tabs { margin-left: 8px; flex-shrink: 0; }

.vcal-nav {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap;
}
.vcal-nav .btn.sm svg { width: 13px; height: 13px; }
.vcal-title { font-size: 15px; font-weight: 700; }
.vcal-legend { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--text2); }
.vcal-legend .lg-item { display: inline-flex; align-items: center; gap: 5px; }
.vcal-legend .lg-item i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.vcal-nodata { padding: 22px; text-align: center; color: var(--text3); font-size: 13px; }

/* --- 月历 --- */
.vcal-month {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden;
}
.vcal-month .vm-head {
  padding: 8px 10px; text-align: center; font-size: 12px; font-weight: 600; color: var(--text2);
  background: var(--surface2); border-bottom: 1px solid var(--border-light);
}
.vcal-month .vm-cell {
  min-height: 106px; padding: 6px 7px; border-right: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light); background: var(--surface); overflow: hidden;
}
.vcal-month .vm-cell.out { background: var(--surface2); opacity: .6; }
.vcal-month .vm-cell.today { background: var(--primary-light); }
.vcal-month .vm-num { font-size: 13px; font-weight: 600; color: var(--text2); cursor: pointer; margin-bottom: 4px; }
.vcal-month .vm-num:hover { color: var(--primary); }
.vcal-month .vm-cell.today .vm-num { color: var(--primary); }
.vcal-month .vm-chip {
  display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text2);
  padding: 3px 5px; margin-bottom: 3px; background: var(--surface2); border-radius: 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
.vcal-month .vm-chip:hover { background: var(--hover); }
.vcal-month .vm-chip i { width: 6px; height: 6px; border-radius: 2px; flex-shrink: 0; }
.vcal-month .vm-more { font-size: 11px; color: var(--primary); cursor: pointer; padding-left: 2px; }

/* --- 周甘特: 行=资源 列=日期 --- */
.vcal-week { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.vw-row { display: grid; grid-template-columns: 130px repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--border-light); }
.vw-row:last-child { border-bottom: none; }
.vw-row.head { background: var(--surface2); font-size: 12px; }
.vw-rhead {
  padding: 9px 10px; border-right: 1px solid var(--border-light); font-size: 13px; color: var(--text2);
  display: flex; flex-direction: column; gap: 2px; justify-content: center;
}
.vw-rhead strong { font-weight: 600; color: var(--text); font-size: 13px; }
.vw-rhead em { font-style: normal; font-size: 11px; color: var(--text3); }
.vw-day { padding: 7px 6px; text-align: center; border-right: 1px solid var(--border-light); color: var(--text2); }
.vw-day span { display: block; font-weight: 600; }
.vw-day em { font-style: normal; font-size: 11px; color: var(--text3); }
.vw-day.today { color: var(--primary); background: var(--primary-light); }
.vw-cell { padding: 6px; min-height: 76px; border-right: 1px solid var(--border-light); vertical-align: top; }
.vw-cell.today { background: var(--primary-light); }
.vb-wrap { margin-bottom: 5px; }

/* --- 日甘特: 行=资源 横轴=小时 --- */
.vcal-day { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.vd-row { display: grid; grid-template-columns: 130px minmax(0, 1fr); border-bottom: 1px solid var(--border-light); }
.vd-row:last-child { border-bottom: none; }
.vd-row.head { background: var(--surface2); }
.vd-axis { position: relative; display: flex; height: 34px; align-items: center; }
.vd-hour {
  flex: 1; font-size: 11px; color: var(--text3); position: relative; padding-left: 3px;
  white-space: nowrap; overflow: visible;
}
.vd-hour i { position: absolute; left: 0; top: 100%; width: 1px; height: 200vh; background: var(--border-light); }
.vd-track { position: relative; min-height: 62px; background: var(--surface); }
.vd-line { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--border-light); }
.vd-blk { position: absolute; top: 7px; bottom: 7px; min-width: 6px; overflow: hidden; }

/* --- 占用色块 --- */
.vcal-blk {
  border-left: 3px solid var(--primary); border-radius: 5px; padding: 4px 7px; overflow: hidden; cursor: pointer;
}
.vcal-blk:hover { filter: brightness(.96); }
.vb-time { font-size: 11px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vb-title { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vb-meta { font-size: 11px; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ================= 申请表单: 资源空闲提示 ================= */
.cfk-tip {
  grid-column: 1 / -1; border-radius: var(--radius-sm); padding: 9px 12px; font-size: 12.5px; line-height: 1.7;
  border: 1px solid var(--border-light); background: var(--surface2); color: var(--text2);
}
.cfk-tip.none { border-style: dashed; }
.cfk-tip.loading { color: var(--text3); }
.cfk-tip.busy { background: rgba(240, 68, 56, .08); border-color: rgba(240, 68, 56, .3); color: var(--text); }
.cfk-tip.free { background: rgba(22, 179, 100, .08); border-color: rgba(22, 179, 100, .3); color: var(--text); }
.cfk-tip .cfk-title { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.cfk-tip.busy .cfk-title { color: var(--danger); }
.cfk-tip.free .cfk-title { color: var(--success); }
.cfk-tip .cfk-title svg { width: 14px; height: 14px; flex-shrink: 0; }
.cfk-list { margin: 5px 0 0; padding-left: 16px; }
.cfk-list li { margin-bottom: 2px; }
.cfk-free { margin-top: 6px; font-size: 12px; color: var(--text2); }
.cfk-sub { color: var(--text3); font-size: 12px; }
.cfk-spin {
  display: inline-block; width: 11px; height: 11px; margin-right: 6px; vertical-align: -1px;
  border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%;
  animation: cfk-spin .7s linear infinite;
}
@keyframes cfk-spin { to { transform: rotate(360deg); } }

/* ================= 插件管理 ================= */
.plugin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.plugin-card {
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  padding: 14px; display: flex; flex-direction: column; gap: 10px;
}
.plugin-card.on { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }
.pg-head { display: flex; align-items: flex-start; gap: 12px; }
.pg-ico {
  width: 42px; height: 42px; flex-shrink: 0; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: var(--surface2); color: var(--primary);
}
.plugin-card.on .pg-ico { background: var(--primary-light); }
.pg-txt { flex: 1; min-width: 0; }
.pg-name { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.pg-cat { font-size: 12px; color: var(--text3); margin-top: 2px; }
.pg-sum { font-size: 12.5px; color: var(--text2); line-height: 1.6; margin-top: 6px; }
.pg-sw { flex-shrink: 0; padding-top: 2px; }
.pg-foot { display: flex; gap: 8px; border-top: 1px dashed var(--border-light); padding-top: 10px; }
.pg-foot .btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.pg-foot .btn.sm svg { width: 13px; height: 13px; }

/* ================= 授权提示条 ================= */
.lic-bar { display: flex; align-items: center; gap: 8px; padding: 7px 14px; font-size: 12.5px; color: #92400e; background: rgba(247, 144, 9, .1); border-bottom: 1px solid rgba(247, 144, 9, .28); flex-shrink: 0; }
.lic-bar.ok { color: #027a48; background: rgba(22, 179, 100, .1); border-bottom-color: rgba(22, 179, 100, .28); }
.lic-bar .lb-ico { display: flex; align-items: center; flex-shrink: 0; }
.lic-bar b { font-weight: 700; }
.lic-bar a { margin-left: auto; color: var(--primary); text-decoration: none; font-weight: 600; white-space: nowrap; }
.lic-bar .lb-close { border: none; background: transparent; color: inherit; font-size: 17px; line-height: 1; cursor: pointer; opacity: .55; padding: 0 2px; }
.lic-bar .lb-close:hover { opacity: 1; }

/* ================= 个人资料: 账号绑定 ================= */
.bind-list { display: flex; flex-direction: column; gap: 10px; }
.bind-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid var(--border-light); border-radius: var(--radius-sm); background: var(--surface2);
}
.bind-ico { width: 32px; height: 32px; flex-shrink: 0; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: var(--surface); color: var(--primary); }
.bind-txt { flex: 1; min-width: 0; }
.bind-txt .bt-name { font-size: 13px; font-weight: 600; }
.bind-txt .bt-val { font-size: 12px; color: var(--text3); margin-top: 2px; }
.bind-ops { display: flex; gap: 6px; flex-shrink: 0; }
.bind-static { display: flex; align-items: center; background: var(--surface2); color: var(--text2); }

/* 扫码绑定弹层 */
.qr-wrap { display: flex; flex-direction: column; gap: 10px; }
.qr-lead { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text2); line-height: 1.6; }
.qr-ico { width: 26px; height: 26px; flex-shrink: 0; border-radius: 7px; display: flex; align-items: center; justify-content: center; background: var(--primary-light); color: var(--primary); }
.qr-box {
  width: 100%; min-height: 176px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-light); border-radius: var(--radius-sm); background: #fff; padding: 8px;
}
.qr-box svg { width: 100%; height: auto; max-width: 208px; display: block; }
.qr-loading, .qr-tip { font-size: 12.5px; color: var(--text3); text-align: center; padding: 20px 0; }
.qr-state { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text2); }
.qr-state .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warning); flex-shrink: 0; }
.qr-state.ok { color: var(--success); }
.qr-state.ok .dot { background: var(--success); }
.qr-state.err { color: var(--danger); }
.qr-state.err .dot { background: var(--danger); }
.qr-link { display: flex; gap: 6px; }
.qr-link .input { flex: 1; font-size: 12px; color: var(--text3); }
.qr-link .btn { white-space: nowrap; }
.qr-ops { display: flex; gap: 8px; }
.qr-ops .btn { flex: 1; }

/* 部门管理树(独立前缀 dmt-, 避免与通讯录/文件柜的 .dt-node 冲突) */
.dmt-tree { font-size: 13px; }
.dmt-node { user-select: none; }
.dmt-row {
  display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: var(--radius-sm);
  cursor: default; transition: background .14s; position: relative;
}
.dmt-row:hover { background: var(--hover); }
.dmt-row .dt-toggle {
  width: 20px; height: 20px; border: none; background: transparent; cursor: pointer; border-radius: 5px;
  display: flex; align-items: center; justify-content: center; color: var(--text3); flex-shrink: 0;
  transition: transform .16s;
}
.dmt-row .dt-toggle:hover { background: var(--surface3); color: var(--primary); }
.dmt-node.closed > .dmt-row .dt-toggle { transform: rotate(-90deg); }
.dmt-node.closed > .dmt-children { display: none; }
.dmt-row .dt-name { font-weight: 600; }
.dmt-row .dt-leader { color: var(--text3); font-size: 12px; }
.dmt-row .dt-cnt {
  font-size: 11px; color: var(--text3); background: var(--surface2); border-radius: 8px;
  padding: 1px 8px; flex-shrink: 0;
}
/* 操作按钮: 紧跟部门名称之后(不再靠行末), 常驻显示 */
/* 操作按钮: 置于部门人数之后, 默认隐藏, 悬停该行时淡入(保留占位, 悬停不跳动) */
.dmt-row .dt-ops { margin-left: 2px; display: flex; gap: 2px; flex-shrink: 0; opacity: 0; transition: opacity .15s; }
.dmt-row:hover .dt-ops, .dmt-row:focus-within .dt-ops { opacity: 1; }
.dmt-row .dt-ops button {
  border: none; background: transparent; cursor: pointer; color: var(--text3); padding: 4px;
  border-radius: 5px; display: flex; align-items: center; transition: background .15s, color .15s;
}
.dmt-row .dt-ops button:hover { background: var(--surface3); color: var(--primary); }
.dmt-row .dt-ops button.danger:hover { color: var(--danger); }
.dmt-children { margin-left: 21px; border-left: 1px dashed var(--border); padding-left: 8px; }
/* 二级及以后有子部门的部门组: 卡片框包裹, 视觉分隔 */
/* 负左外边距 + 同值左内边距: 卡片内部门行与外部同级部门左对齐 */
.dmt-card {
  background: var(--surface2); border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius); padding: 6px 8px 6px 5px; margin: 7px -8px;
  box-shadow: var(--shadow);
}
.dmt-card > .dmt-node > .dmt-row { border-radius: 7px; }
.dmt-row.root { background: linear-gradient(90deg, var(--primary-light), transparent); }
.dmt-badge-off { opacity: .45; }
/* 可点击的部门人数(跳转用户列表) */
.dt-cnt-link {
  border: none; cursor: pointer; font-size: 11px; color: var(--primary);
  background: var(--primary-light); border-radius: 8px; padding: 1px 8px; flex-shrink: 0;
  font-weight: 600; transition: all .14s;
}
.dt-cnt-link:hover { background: var(--primary); color: #fff; }
.link-btn {
  border: none; background: transparent; cursor: pointer; color: var(--primary);
  font-weight: 700; font-size: 13px; padding: 2px 6px; border-radius: 6px;
}
.link-btn:hover { background: var(--primary-light); text-decoration: underline; }
.dc-vlink {
  border: none; background: transparent; cursor: pointer; color: var(--text);
  font-size: 17px; font-weight: 700; padding: 0; line-height: 22px; text-align: left;
  display: inline-block; vertical-align: top;
}
.dc-vlink:hover { color: var(--primary); text-decoration: underline; }

/* 部门卡片 */
.dept-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.dept-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; transition: all .16s; position: relative;
}
.dept-card:hover { box-shadow: var(--shadow-lg); border-color: var(--primary); transform: translateY(-2px); }
.dept-card .dc-head { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }
.dept-card .dc-ico {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0; display: flex; align-items: center;
  justify-content: center; color: var(--primary);
  background: linear-gradient(135deg, var(--primary-light), transparent); border: 1px solid var(--border);
}
.dept-card .dc-name { font-weight: 700; font-size: 15px; }
.dept-card .dc-path { font-size: 12px; color: var(--text3); margin-top: 2px; }
.dept-card .dc-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
/* 底部：统计块与操作按钮底部对齐, 成员/子部门两列数字与文字各自对齐 */
.dept-card .dc-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; border-top: 1px solid var(--border-light); padding-top: 10px; }
.dept-card .dc-stats { display: flex; align-items: flex-start; gap: 16px; }
.dept-card .dc-stat { display: flex; flex-direction: column; align-items: flex-start; }
.dept-card .dc-stat .v { font-size: 17px; font-weight: 700; line-height: 22px; height: 22px; }
.dept-card .dc-stat .k { font-size: 11px; color: var(--text3); line-height: 16px; }
.dept-card .dc-ops { display: flex; gap: 2px; align-items: flex-end; }

/* 图标选择器 */
.icon-picker { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.icon-picker .ip-item {
  width: 32px; height: 32px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: var(--text2); background: var(--surface);
  transition: all .13s;
}
.icon-picker .ip-item:hover { border-color: var(--primary); color: var(--primary); }
.icon-picker .ip-item.on { border-color: var(--primary); color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-deep)); }
.icon-preview { display: flex; align-items: center; gap: 10px; }
.icon-preview .pv-box {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface2);
  display: flex; align-items: center; justify-content: center; color: var(--primary); flex-shrink: 0;
}

/* ================= 打印模板设计器 ================= */
/* 上传本地表单文件自动生成 */
.pt-import {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px;
  padding: 9px 12px; background: var(--primary-light); border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
}
.pt-import .pt-import-t { flex: 1; min-width: 200px; font-size: 12px; color: var(--text2); display: flex; align-items: center; gap: 6px; line-height: 1.5; }
.pt-import-tip { min-height: 16px; font-size: 12px; color: var(--primary); margin-bottom: 10px; }
/* 识别结果弹窗 */
.pt-imp-sum { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; margin-bottom: 12px; }
.pt-imp-sum > div { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.pt-imp-sum span { color: var(--text3); flex-shrink: 0; min-width: 62px; }
.pt-imp-sum b { font-weight: 600; word-break: break-all; }
.pt-imp-sum b.ok { color: var(--success, #00b42a); }
.pt-imp-sum b.warn { color: var(--warning, #ff7d00); }
.pt-imp-rows { max-height: 320px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px; }
.pt-imp-row { display: flex; align-items: flex-start; gap: 6px; padding: 5px 0; border-bottom: 1px dashed var(--border-light); }
.pt-imp-row:last-child { border-bottom: 0; }
.pt-imp-idx { width: 20px; flex-shrink: 0; font-size: 12px; color: var(--text3); text-align: right; padding-top: 3px; }
.pt-imp-cell {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 2px 9px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface2); color: var(--text2);
}
.pt-imp-cell.on { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.pt-imp-cell i { font-style: normal; font-size: 11px; opacity: .75; }
.pt-imp-un { margin-top: 10px; font-size: 12px; color: var(--text2); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pt-imp-un b { font-weight: 600; }
.pt-imp-un span { padding: 2px 8px; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; }
.pt-imp-un em { font-style: normal; color: var(--text3); }
.pt-imp-note { margin-top: 10px; font-size: 12px; color: var(--text3); line-height: 1.6; }
/* 左右严格各占一半: 左侧设计区, 右侧A4预览(minmax(0,1fr)防止纸张固定宽度撑开右列) */
.pt-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.pt-left { min-width: 0; }
.pt-preview-body { background: var(--surface3); padding: 14px; display: flex; justify-content: center; overflow: auto; }
.pt-hf-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.pt-hf-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.pt-hf-cols { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text2); flex-shrink: 0; }
.pt-hf {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border: 1px solid var(--border);
  border-radius: 14px; font-size: 12px; color: var(--text2); cursor: pointer; transition: all .14s;
}
.pt-hf:hover { border-color: var(--primary); }
.pt-hf.on { background: var(--primary-light); color: var(--primary); border-color: var(--primary); font-weight: 600; }
.pt-row {
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; margin-bottom: 10px;
  background: var(--surface2);
}
.pt-row-head {
  display: flex; align-items: center; justify-content: space-between; font-size: 12px;
  color: var(--text3); font-weight: 600; margin-bottom: 8px;
}
.pt-row-ops { display: flex; gap: 2px; }
.pt-row-ops button {
  border: none; background: transparent; cursor: pointer; color: var(--text3); padding: 4px;
  border-radius: 5px; display: flex; align-items: center;
}
.pt-row-ops button:hover { background: var(--surface3); color: var(--primary); }
.pt-row-ops button.danger:hover { color: var(--danger); }
.pt-row-cells { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pt-cell {
  position: relative; border: 1px dashed var(--border); border-radius: 7px; padding: 9px 10px;
  background: var(--surface);
}
.pt-cell-ops { position: absolute; top: 5px; right: 6px; display: flex; gap: 3px; }
.pt-cell-ops button {
  border: none; background: transparent; cursor: pointer; color: var(--text3); font-size: 11px;
  padding: 2px 5px; border-radius: 5px; display: flex; align-items: center;
}
.pt-cell-ops button:hover { background: var(--surface3); color: var(--primary); }
.pt-cell-ops button.danger:hover { color: var(--danger); }
.pt-sign-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pt-sign-item { display: flex; align-items: center; gap: 5px; }
.pt-sign-item .input { width: 150px; }
/* 签字区模式切换 */
.pt-sign-mode { display: inline-flex; gap: 4px; margin-right: 8px; }
.pt-sm {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; font-size: 12px;
  border: 1px solid var(--border); border-radius: 14px; color: var(--text2); cursor: pointer;
  transition: all .14s; user-select: none;
}
.pt-sm:hover { border-color: var(--primary); color: var(--primary); }
.pt-sm.on { background: var(--primary-light); color: var(--primary); border-color: var(--primary); font-weight: 600; }
.pt-sm input { display: none; }
/* 自动模式(调用审批流程) */
.pt-auto-tip {
  display: flex; align-items: flex-start; gap: 7px; font-size: 12px; color: var(--text2);
  background: var(--primary-light); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 9px 12px; margin-bottom: 10px; line-height: 1.6;
}
.pt-auto-tip svg { flex-shrink: 0; margin-top: 2px; color: var(--primary); }
.pt-sign-list { display: flex; flex-direction: column; gap: 7px; }
.pt-sign-item.auto {
  display: flex; align-items: center; gap: 9px; padding: 6px 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
}
.pt-sign-item.auto .input { width: 180px; }
.pt-sign-idx {
  width: 20px; height: 20px; border-radius: 6px; background: var(--surface3); color: var(--text2);
  font-size: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-weight: 600;
}
.pt-sign-handler {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text3);
  flex-shrink: 0; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pt-sign-item .pt-sign-op {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text2);
  padding: 4px 9px; border: 1px solid var(--border); border-radius: 14px; cursor: pointer;
  white-space: nowrap; transition: all .14s; user-select: none;
}
.pt-sign-item .pt-sign-op:hover { border-color: var(--primary); }
.pt-sign-item .pt-sign-op:has(input:checked) { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.pt-sign-item button {
  border: none; background: transparent; cursor: pointer; color: var(--text3); padding: 5px;
  border-radius: 5px; display: flex;
}
.pt-sign-item button:hover { color: var(--danger); }

/* ================= A4 打印纸张(预览+打印共用) ================= */
.print-sheet {
  width: 190mm; min-height: 260mm; background: #fff; color: #1a2233;
  padding: 12mm 10mm; box-sizing: border-box; font-size: 12px; line-height: 1.6;
  box-shadow: 0 4px 24px rgba(0,0,0,.18); border-radius: 2px;
}
.print-sheet.landscape { width: 260mm; min-height: 180mm; }
.ps-company { text-align: left; font-size: 13px; font-weight: 600; color: #333; }
.ps-title { text-align: center; font-size: 20px; font-weight: 700; letter-spacing: 4px; margin: 6px 0 10px; }
.ps-meta {
  display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 11px; color: #444;
  border-bottom: 2px solid #1a2233; padding-bottom: 8px; margin-bottom: 10px;
}
.ps-info {
  display: grid; grid-template-columns: repeat(2, 1fr);
  border: 1px solid #999; border-bottom: none;
}
.ps-info-item {
  display: flex; align-items: center; gap: 8px; box-sizing: border-box;
  border-bottom: 1px solid #ddd; padding: 7px 10px; font-size: 12px; min-width: 0;
}
.ps-info-item span { color: #666; flex-shrink: 0; }
.ps-info-item b { font-weight: 600; }
.ps-table { width: 100%; border-collapse: collapse; border: 1px solid #999; margin-bottom: 4px; }
.ps-table td {
  border: 1px solid #999; padding: 8px 10px; vertical-align: top; min-height: 44px;
}
.ps-cell-label { font-size: 11px; color: #666; margin-bottom: 3px; }
.ps-cell-value { font-size: 12px; font-weight: 600; min-height: 22px; word-break: break-all; }
.ps-cell-value.tall { min-height: 90px; }
.ps-signs { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 22px; }
.ps-sign { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #333; }
.ps-sign > span { display: flex; align-items: flex-end; gap: 6px; }
.ps-sign i {
  display: inline-block; width: 110px; border-bottom: 1px solid #333; height: 26px;
}
.ps-sign-op { font-size: 11px; color: #555; }
.ps-sign-op em {
  display: block; font-style: normal; min-height: 34px; border-bottom: 1px dotted #bbb;
  margin-top: 3px; min-width: 130px; font-size: 12px; color: #333;
}
.ps-foot { margin-top: 18px; text-align: center; font-size: 10px; color: #999; }

/* ================= 打印输出(仅打印时显示) ================= */
.print-area { display: none; }
@media print {
  @page { size: A4; margin: 0; }
  html, body { background: #fff !important; }
  body > *:not(.print-area) { display: none !important; }
  .print-area { display: block !important; }
  .print-area .print-sheet { box-shadow: none; border-radius: 0; width: 210mm; min-height: 297mm; }
  .print-area .print-sheet.landscape { width: 297mm; min-height: 210mm; }
  .print-area .ps-meta, .print-area .ps-table, .print-area .ps-info { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* 杂项 */
.flex { display: flex; }
.flex.aic { align-items: center; }
.gap8 { gap: 8px; } .gap12 { gap: 12px; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.text2 { color: var(--text2); } .text3 { color: var(--text3); }
.fs12 { font-size: 12px; } .fs13 { font-size: 13px; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wfull { width: 100%; }
.hint-box { background: var(--primary-light); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 12px; color: var(--text2); display: flex; gap: 8px; align-items: flex-start; }
.mini-stat { display: flex; gap: 16px; flex-wrap: wrap; }
.mini-stat .msi .v { font-size: 20px; font-weight: 700; }
.mini-stat .msi .k { font-size: 12px; color: var(--text3); }

/* 智能导入 */
.imp-wrap { display: flex; flex-direction: column; gap: 12px; }
.imp-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.imp-hint { font-size: 12px; color: var(--text3); }
.imp-stat { display: flex; gap: 10px; flex-wrap: wrap; }
.imp-stat .imp-sc { display: flex; align-items: baseline; gap: 6px; padding: 6px 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); }
.imp-stat .imp-sc b { font-size: 17px; font-weight: 700; }
.imp-stat .imp-sc span { font-size: 12px; color: var(--text3); }
.imp-stat .imp-sc.green b { color: var(--success); }
.imp-stat .imp-sc.orange b { color: var(--warning); }
.imp-stat .imp-sc.red b { color: var(--danger); }
.imp-body { max-height: 420px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.imp-tbl th { position: sticky; top: 0; background: var(--surface); z-index: 2; }
.imp-tbl td { vertical-align: middle; }
.imp-cell { width: 100%; border: 1px solid var(--border); border-radius: 6px; padding: 4px 6px; font-size: 12px;
  background: var(--input-bg); color: var(--text); }
.imp-cell:focus { outline: 2px solid var(--primary-light); border-color: var(--primary); }
.imp-ro { background: var(--hover); color: var(--text3); }
.imp-act { height: 28px; font-size: 12px; padding: 0 6px; }
.imp-msg-cell { font-size: 12px; color: var(--text2); }
.imp-muted { color: var(--text3); text-align: center; }
.imp-foot { display: flex; align-items: center; gap: 10px; }
.imp-msg { flex: 1; font-size: 12px; color: var(--text2); }
.imp-msg.err { color: var(--danger); }
.imp-msg.ok { color: var(--success); }
.imp-empty { padding: 40px 0; text-align: center; color: var(--text3); font-size: 13px; }
.imp-tip { padding: 8px 12px; font-size: 12px; color: var(--text3); border-top: 1px solid var(--border); }
.imp-fail { padding: 12px 14px; margin-bottom: 10px; border: 1px solid rgba(240,68,56,.3);
  border-radius: 10px; background: rgba(240,68,56,.06); }
.imp-fail-title { font-size: 13px; font-weight: 600; color: var(--danger); margin-bottom: 6px; }
.imp-fail ul { margin: 0; padding-left: 18px; max-height: 140px; overflow: auto; }
.imp-fail li { font-size: 12px; color: var(--text2); line-height: 1.8; }

/* ---------- 插件管理: 数据库备份 / 测试数据 ---------- */
.btn.xs { height: 24px; padding: 0 8px; font-size: 12px; margin-right: 4px; }
.btn.xs svg { width: 12px; height: 12px; }
.dbm-wrap, .tdm-wrap { display: flex; flex-direction: column; gap: 12px; }
.dbm-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dbm-lb { font-size: 13px; color: var(--text2); }
.dbm-num { width: 90px; height: 28px; }
.dbm-info { display: flex; gap: 18px; flex-wrap: wrap; padding: 10px 12px; font-size: 12px;
  color: var(--text2); background: var(--hover); border-radius: 8px; }
.dbm-info b { color: var(--text); font-weight: 600; }
.dbm-warn { color: var(--warning); }
.dbm-chk { display: inline-flex; align-items: center; gap: 4px; margin: 0 14px 6px 0; font-size: 12px;
  color: var(--text2); cursor: pointer; }
.dbm-body { max-height: 380px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.dbm-tbl th { position: sticky; top: 0; background: var(--surface); z-index: 2; }
.dbm-tbl td { vertical-align: middle; font-size: 12.5px; }

/* ---------- 支付配置: 微信/支付宝卡片 ---------- */
.pay-cards { display: flex; flex-direction: column; gap: 14px; }
.pay-card { border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; background: var(--surface); }
.pay-card.wx { border-left: 4px solid #1aad19; }
.pay-card.ali { border-left: 4px solid #1677ff; }
.pay-card-hd { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.pay-logo { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px; font-weight: 700; flex-shrink: 0; }
.pay-logo.wx { background: linear-gradient(135deg,#2dc100,#1aad19); }
.pay-logo.ali { background: linear-gradient(135deg,#3b9bff,#1677ff); }
.pay-card-t { font-size: 15px; font-weight: 700; color: var(--text); }
.pay-card-s { font-size: 11.5px; color: var(--text3); margin-top: 2px; }
.pay-card-sw { margin-left: auto; }
.pay-card-sw .pay-f > label { display: none; }
.pay-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px 16px; }
.pay-f { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pay-f.full { grid-column: 1 / -1; }
.pay-f > label { font-size: 12.5px; color: var(--text2); }
.pay-f .input, .pay-f .textarea { width: 100%; box-sizing: border-box; }
.pay-f .textarea { resize: vertical; min-height: 66px; }
.pay-tip { font-size: 11px; color: var(--text3); line-height: 1.5; }
@media (max-width: 640px) { .pay-grid { grid-template-columns: 1fr; } }
