:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #1f2329;
  --text-2: #646a73;
  --text-3: #8f959e;
  --line: #e5e6eb;
  --blue: #3370ff;
  --blue-weak: #eef3ff;
  --green: #00b42a;
  --green-weak: #e8ffea;
  --orange: #ff7d00;
  --orange-weak: #fff7e8;
  --red: #f53f3f;
  --red-weak: #ffece8;
  --purple: #722ed1;
  --radius: 10px;
  --radius-lg: 14px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}
.hidden { display: none !important; }
button { font-family: inherit; }

/* ===== 通用 ===== */
.btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: all .15s;
}
.btn:hover { border-color: var(--blue); color: var(--blue); }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: #245bdb; border-color: #245bdb; color: #fff; }
.btn-ghost { background: #f7f8fa; }
.btn-danger { color: var(--red); border-color: #ffccc7; }
.btn-danger:hover { background: var(--red-weak); border-color: var(--red); color: var(--red); }
.btn-block { display: block; width: 100%; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn {
  background: none; border: none; font-size: 20px; cursor: pointer;
  color: var(--text); width: 36px; height: 36px; border-radius: 8px; line-height: 1;
}
.icon-btn:hover { background: rgba(0,0,0,.05); }
.inp {
  width: 100%; border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 12px; font-size: 14px; font-family: inherit; background: #fff; color: var(--text);
}
.inp:focus { outline: none; border-color: var(--blue); }
.inp-sm { width: 100px; }
.sel {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  font-size: 14px; background: #fff; color: var(--text); font-family: inherit; max-width: 100%;
}
.card {
  background: var(--card); border-radius: var(--radius-lg);
  padding: 18px; margin-bottom: 14px; border: 1px solid var(--line);
}
.card h3 { margin: 0 0 14px; font-size: 15px; font-weight: 600; }
.form-row { margin-bottom: 14px; }
.form-row > label {
  display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px;
}
.inline-label { display: inline-block !important; margin-left: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tag {
  display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: 12px; background: #f2f3f5; color: var(--text-2);
}
.tag-blue { background: var(--blue-weak); color: var(--blue); }
.tag-green { background: var(--green-weak); color: var(--green); }
.tag-orange { background: var(--orange-weak); color: var(--orange); }
.tag-red { background: var(--red-weak); color: var(--red); }
.tag-purple { background: #f5e8ff; color: var(--purple); }
.muted { color: var(--text-3); font-size: 12px; }
.empty { text-align: center; color: var(--text-3); padding: 40px 20px; font-size: 13px; }

/* ===== 登录 ===== */
.login-screen {
  position: fixed; inset: 0; background: linear-gradient(160deg, #3370ff 0%, #1c4fd8 100%);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.login-card {
  background: #fff; border-radius: 18px; padding: 36px 28px;
  max-width: 380px; width: 100%; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
}
.login-logo {
  width: 60px; height: 60px; border-radius: 16px; background: var(--blue);
  color: #fff; font-size: 20px; font-weight: 700; display: flex;
  align-items: center; justify-content: center; margin: 0 auto 16px;
}
.login-card h1 { font-size: 19px; margin: 0 0 8px; }
.login-tip { color: var(--text-3); font-size: 13px; margin: 0 0 22px; }
.login-error {
  margin-top: 14px; padding: 9px; border-radius: 8px;
  background: var(--red-weak); color: var(--red); font-size: 13px;
}

/* ===== 顶栏（Tita 结构：品牌 + 主导航 + 右侧工具） ===== */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 52px; z-index: 60;
  background: var(--blue); color: #fff; display: flex;
  align-items: center; justify-content: space-between; padding: 0 14px;
}
.topbar-left { display: flex; align-items: center; gap: 6px; min-width: 0; }
.brand { font-size: 17px; font-weight: 700; letter-spacing: .5px; margin-right: 14px; }
.brand-sub { font-size: 12px; font-weight: 500; opacity: .9; margin-left: 2px; }
.topnav { display: flex; align-items: center; gap: 2px; overflow-x: auto; }
.topnav-item {
  padding: 6px 13px; border-radius: 6px; font-size: 14px; color: rgba(255,255,255,.92);
  cursor: pointer; white-space: nowrap;
}
.topnav-item:hover { background: rgba(255,255,255,.14); }
.topnav-item.active { background: rgba(255,255,255,.22); font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar-tip { font-size: 12px; background: rgba(255,255,255,.2); padding: 2px 9px; border-radius: 10px; }
.topbar-bell { cursor: pointer; font-size: 15px; }
.topbar-user { position: relative; display: flex; align-items: center; gap: 5px; cursor: pointer; font-size: 13px; }
.tb-avatar {
  width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.28);
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px;
}
.tb-caret { font-size: 10px; opacity: .8; }
/* 身份标签：让不同角色一眼看出区别 */
.tb-role {
  font-size: 11px; padding: 2px 7px; border-radius: 9px; white-space: nowrap;
  background: rgba(255,255,255,.22); color: #fff; border: 1px solid rgba(255,255,255,.3);
}
.tb-role[data-role="hr"]     { background: #c0392b; border-color: #c0392b; }
.tb-role[data-role="vp"]     { background: #8e44ad; border-color: #8e44ad; }
.tb-role[data-role="dept_leader"] { background: #d68910; border-color: #d68910; }
.tb-dropdown {
  position: absolute; right: 0; top: 34px; width: 190px; background: #fff;
  border-radius: 8px; box-shadow: 0 6px 22px rgba(0,0,0,.16); padding: 6px 0;
  display: none; z-index: 90;
}
.tb-dropdown.open { display: block; }
.tb-dropdown a, .tb-dd-lang {
  display: block; padding: 9px 16px; font-size: 13px; color: var(--text); cursor: pointer;
}
.tb-dropdown a:hover { background: #f7f8fa; }
.tb-dropdown .tb-strong { font-weight: 600; color: var(--blue); }
.tb-dd-head {
  padding: 8px 16px; font-size: 12px; color: var(--text-3);
  border-bottom: 1px solid var(--line); margin-bottom: 4px;
}
.tb-dd-lang { color: var(--text-2); }
.tb-dd-lang b { color: var(--blue); }

/* ===== 左侧白栏（Tita 结构） ===== */
.side-nav { padding: 10px 8px; }
.side-group {
  font-size: 11px; color: var(--text-3); padding: 12px 10px 5px; letter-spacing: .5px;
}
.side-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 10px;
  border-radius: 8px; font-size: 13.5px; color: var(--text); cursor: pointer; margin-bottom: 2px;
}
.side-item:hover { background: #f7f8fa; }
.side-item.active { background: var(--blue-weak); color: var(--blue); font-weight: 500; }
.side-icon { width: 16px; text-align: center; font-size: 13px; }
.side-badge {
  margin-left: auto; background: var(--red); color: #fff;
  font-size: 11px; padding: 0 6px; border-radius: 9px; min-width: 18px; text-align: center;
}

/* ===== Tab 行 ===== */
.tab-row { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.tab {
  background: none; border: none; padding: 9px 15px; font-size: 14px; color: var(--text-2);
  cursor: pointer; font-family: inherit; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 500; }

/* ===== 组织绩效布局 ===== */
.org-layout { display: flex; gap: 14px; align-items: flex-start; }
.org-left {
  width: 180px; flex-shrink: 0; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 8px;
}
.org-right { flex: 1; min-width: 0; }
.org-right > .card { margin-bottom: 0; }

/* ===== 流程设置步骤条（Tita 三步骤） ===== */
.steps-bar { display: flex; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.step { display: flex; align-items: center; font-size: 13px; color: var(--text-3); }
.step-num {
  width: 21px; height: 21px; border-radius: 50%; background: #e5e6eb; color: var(--text-2);
  display: flex; align-items: center; justify-content: center; font-size: 12px; margin-right: 7px;
}
.step.on { color: var(--blue); font-weight: 500; }
.step.on .step-num { background: var(--blue); color: #fff; }
.step.done { color: var(--text-2); }
.step.done .step-num { background: var(--green); color: #fff; }
.step-sep { width: 46px; height: 1px; background: var(--line); margin: 0 12px; }

/* ===== 考核详情页 ===== */
.detail-head {
  display: flex; align-items: center; gap: 16px; margin-bottom: 14px;
}
.link-btn {
  background: none; border: none; color: var(--blue); cursor: pointer; font-size: 13px; font-family: inherit;
}
.detail-title { display: flex; align-items: center; gap: 11px; flex: 1; }
.detail-avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0;
}
.detail-score { text-align: right; }
.detail-grade {
  display: inline-block; min-width: 34px; height: 34px; line-height: 34px; text-align: center;
  background: var(--orange); color: #fff; border-radius: 8px; font-size: 17px; font-weight: 700;
}

/* 流程步骤条 */
.tstep-bar { display: flex; align-items: stretch; flex-wrap: wrap; }
.tstep {
  flex: 1 1 0; min-width: 92px; display: flex; align-items: center; justify-content: center; gap: 5px;
  padding: 9px 6px; font-size: 12.5px; color: var(--text-3);
  background: #f7f8fa; border-right: 2px solid #fff;
}
.tstep:first-child { border-radius: 6px 0 0 6px; }
.tstep:last-child { border-radius: 0 6px 6px 0; border-right: none; }
.tstep.done { background: var(--green-weak); color: #0a7a1e; }
.tstep.on { background: var(--blue-weak); color: var(--blue); font-weight: 600; }
.tstep-icon { font-size: 12px; }

/* 变更记录 */
.change-list { position: relative; padding-left: 14px; }
.change-item {
  position: relative; padding: 7px 0 7px 14px; font-size: 13px;
  border-left: 2px solid var(--line);
}
.change-dot {
  position: absolute; left: -5px; top: 14px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--blue);
}



/* ===== 侧边菜单 ===== */
.sidemenu {
  position: fixed; top: 52px; bottom: 0; left: 0; width: 186px; z-index: 80;
  background: #fff; border-right: 1px solid var(--line);
  overflow-y: auto; padding: 10px 8px;
  transform: translateX(-100%); transition: transform .25s;
}
.sidemenu.open { transform: translateX(0); }


.menu-user {
  padding: 12px; background: var(--blue-weak); border-radius: var(--radius);
  margin-bottom: 14px; font-size: 13px;
}
.menu-user b { display: block; font-size: 15px; margin-bottom: 3px; }
.menu-group-title {
  font-size: 11px; color: var(--text-3); padding: 12px 12px 5px;
  letter-spacing: .5px; font-weight: 500;
}
.menu-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: 8px;
  color: var(--text); text-decoration: none; font-size: 14px; margin-bottom: 1px;
  cursor: pointer;
}
.menu-item:hover { background: #f7f8fa; }
.menu-item.active { background: var(--blue-weak); color: var(--blue); font-weight: 500; }
.menu-icon { width: 18px; text-align: center; font-size: 14px; flex-shrink: 0; }
.menu-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item.locked { opacity: .45; }
.menu-item.locked .menu-text { text-decoration: none; }
.menu-lock { font-size: 11px; flex-shrink: 0; }
.menu-badge {
  margin-left: auto; background: var(--red); color: #fff;
  font-size: 11px; padding: 0 6px; border-radius: 9px; min-width: 18px; text-align: center;
}
.menu-logout { margin-top: auto; }

/* ===== 流程条（首页可视化） ===== */
.flow-strip { display: flex; align-items: stretch; gap: 0; margin-top: 14px; flex-wrap: wrap; }
.flow-step {
  flex: 1 1 0; min-width: 120px; padding: 10px 8px; text-align: center;
  border-right: 2px solid var(--line); position: relative;
  overflow: hidden;
}
.flow-step:last-child { border-right: none; }
.flow-step-icon { font-size: 17px; line-height: 1.4; }
.flow-step-name {
  font-size: 12px; color: var(--text-2); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.flow-step-exec {
  font-size: 11px; color: var(--text-3); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.flow-step.on { background: var(--blue-weak); border-radius: 8px; }
.flow-step.on .flow-step-name { color: var(--blue); font-weight: 600; }
.flow-step.done .flow-step-icon { opacity: .45; }
.flow-step.off { opacity: .45; }

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th, table.tbl td {
  padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap;
}
table.tbl th { background: #fafbfc; color: var(--text-2); font-weight: 500; font-size: 12px; }
table.tbl tr:hover td { background: #fafbfc; }
table.tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ===== 条形图 ===== */
.bar-list { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.bar-name { width: 108px; flex-shrink: 0; color: var(--text-2); }
.bar-track { flex: 1; height: 20px; background: #f2f3f5; border-radius: 5px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--blue); border-radius: 5px; transition: width .3s; }
.bar-fill.green { background: var(--green); }
.bar-fill.orange { background: var(--orange); }
.bar-fill.red { background: var(--red); }
.bar-val { width: 64px; text-align: right; flex-shrink: 0; font-variant-numeric: tabular-nums; }

/* ===== 告警 ===== */
.alert-item {
  padding: 9px 12px; border-radius: 8px; margin-bottom: 8px; font-size: 13px;
  background: var(--orange-weak); color: #a85000; border: 1px solid #ffe0b8;
}
.alert-item.info { background: var(--blue-weak); color: #1d4ed8; border-color: #c7dbff; }
.alert-item b { font-weight: 600; }

/* ===== 权限提示条 ===== */
.perm-note {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 8px 11px; background: #fafbfc; border: 1px solid var(--line);
  border-radius: 8px; font-size: 12px; color: var(--text-2); margin-bottom: 12px;
}
.perm-note .tag { font-size: 11px; }
.perm-note .none { color: var(--red); }


.mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 70;
}

/* ===== 主体 ===== */
.main { padding: 62px 14px 24px; max-width: 1200px; margin: 0 auto; }
.page { display: none; }
.page.active { display: block; }
.page-title { font-size: 17px; font-weight: 600; margin: 0 0 4px; }
.page-sub { font-size: 12px; color: var(--text-3); margin: 0 0 14px; }


.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; text-align: center;
}
.stat-num { font-size: 22px; font-weight: 600; color: var(--blue); line-height: 1.3; }
.stat-label { font-size: 12px; color: var(--text-3); }

.task-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 14px 16px; margin-bottom: 10px; cursor: pointer;
}
.task-card:hover { border-color: var(--blue); }
.task-card .row-between { align-items: flex-start; }
.task-name { font-size: 15px; font-weight: 500; }
.task-meta { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.task-right { text-align: right; flex-shrink: 0; }
.task-score { font-size: 20px; font-weight: 600; color: var(--blue); }

.filter-bar { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.quick-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.quick-row .sel { min-width: 180px; }

/* ===== 抽屉 ===== */
.drawer { position: fixed; inset: 0; z-index: 90; }
.drawer-mask { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.drawer-body {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 100%);
  background: var(--bg); display: flex; flex-direction: column;
  box-shadow: -4px 0 24px rgba(0,0,0,.15);
}
.drawer-head {
  padding: 14px 18px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; font-weight: 500;
}
.drawer-content { flex: 1; overflow-y: auto; padding: 14px; }

/* ===== 指标行 ===== */
.metric-row {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; margin-bottom: 10px;
}
.metric-row input, .metric-row select { margin-bottom: 6px; }
.metric-title { font-weight: 500; margin-bottom: 6px; font-size: 14px; }
.weight-line { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); }

/* ===== 签名板 ===== */
.modal {
  position: fixed; inset: 0; z-index: 120; background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-card {
  background: #fff; border-radius: var(--radius-lg); padding: 20px;
  width: min(520px, 100%); max-height: 92vh; overflow-y: auto;
}
.modal-card h3 { margin: 0 0 6px; font-size: 16px; }
.sign-statement { font-size: 13px; color: var(--text-2); margin: 0 0 12px; }
.sign-wrap {
  position: relative; border: 1px dashed #c9cdd4; border-radius: var(--radius);
  background: #fff; overflow: hidden;
}
#sign-canvas { display: block; width: 100%; height: auto; touch-action: none; cursor: crosshair; }
.sign-line {
  position: absolute; left: 8%; right: 8%; bottom: 46px;
  border-bottom: 1px solid #dcdfe6; pointer-events: none;
}
.sign-hint {
  position: absolute; left: 8%; bottom: 16px; font-size: 12px;
  color: #c9cdd4; pointer-events: none;
}
.sign-toolbar {
  display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap;
}
.sign-color { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.sign-color input { width: 34px; height: 24px; border: 1px solid var(--line); border-radius: 5px; padding: 0; background: none; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

/* ===== 流程配置（核心） ===== */
.admin-layout { display: flex; gap: 14px; align-items: flex-start; }
.admin-left {
  width: 190px; flex-shrink: 0; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 12px;
  position: sticky; top: 66px;
}
.admin-left-title {
  font-size: 14px; font-weight: 600; margin-bottom: 12px;
  display: flex; align-items: center; gap: 6px;
}
.lock-hint {
  font-size: 11px; font-weight: 400; background: #f2f3f5;
  color: var(--text-3); padding: 1px 7px; border-radius: 10px;
}
.flow-tree { position: relative; padding-left: 6px; }
.flow-tree::before {
  content: ''; position: absolute; left: 15px; top: 12px; bottom: 12px;
  width: 2px; background: var(--line);
}
.flow-node {
  position: relative; display: flex; align-items: center; gap: 8px;
  padding: 8px 8px 8px 6px; border-radius: 8px; cursor: pointer;
  font-size: 13px; color: var(--text-2); margin-bottom: 2px;
}
.flow-node:hover { background: #f7f8fa; }
.flow-node.active { background: var(--blue-weak); color: var(--blue); font-weight: 500; }
.flow-node.disabled { color: var(--text-3); }
.flow-dot {
  width: 20px; height: 20px; border-radius: 50%; background: #fff;
  border: 2px solid var(--line); flex-shrink: 0; z-index: 1;
  display: flex; align-items: center; justify-content: center; font-size: 10px;
}
.flow-node.active .flow-dot { border-color: var(--blue); background: var(--blue); color: #fff; }
.flow-node.disabled .flow-dot { background: #f2f3f5; }
.admin-left-tip { font-size: 11px; color: var(--text-3); margin-top: 12px; line-height: 1.5; }
.admin-right { flex: 1; min-width: 0; }

.cfg-section {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 18px; margin-bottom: 14px;
}
.cfg-section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 4px;
}
.cfg-section-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.cfg-desc { font-size: 12px; color: var(--text-3); margin: 0 0 16px; }
.cfg-field { margin-bottom: 16px; }
.cfg-field > label {
  display: block; font-size: 13px; color: var(--text-2); margin-bottom: 7px;
}
.cfg-hint { font-size: 11px; color: var(--text-3); margin-top: 5px; }
.check-grid { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.check-item { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.check-item input { width: 15px; height: 15px; accent-color: var(--blue); }
.radio-row { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.switch-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.switch {
  position: relative; width: 40px; height: 22px; background: #dcdfe6;
  border-radius: 12px; cursor: pointer; transition: background .2s; flex-shrink: 0;
}
.switch.on { background: var(--blue); }
.switch::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  background: #fff; border-radius: 50%; transition: left .2s;
}
.switch.on::after { left: 20px; }
.executor-picker { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.executor-picker .sel { flex: 1; min-width: 150px; }
.leader-preview {
  margin-top: 8px; padding: 9px 12px; background: var(--blue-weak);
  border-radius: 8px; font-size: 12px; color: #1d4ed8;
}
.leader-preview b { font-weight: 600; }
.picker-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px;
  background: #f2f3f5; border-radius: 6px; font-size: 12px;
}
.chip button { background: none; border: none; cursor: pointer; color: var(--text-3); padding: 0; font-size: 13px; }
.cfg-footer {
  display: flex; gap: 10px; justify-content: flex-end;
  position: sticky; bottom: 0; background: var(--bg); padding: 10px 0;
}

/* ===== Toast ===== */
.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%);
  background: rgba(0,0,0,.82); color: #fff; padding: 10px 20px;
  border-radius: 8px; font-size: 13px; z-index: 200; max-width: 80%;
  text-align: center;
}

@media (max-width: 760px) {
  .admin-layout { flex-direction: column; }
  .admin-left { width: 100%; position: static; }
  .flow-tree { display: flex; overflow-x: auto; gap: 6px; padding-bottom: 6px; }
  .flow-tree::before { display: none; }
  .flow-node { flex-shrink: 0; border: 1px solid var(--line); }
  .main { padding-left: 12px; padding-right: 12px; }
}

/* =========================================================
   桌面端：左侧菜单常驻展开（放在文件末尾以覆盖基础规则）
   ========================================================= */
@media (min-width: 861px) {
  .sidemenu {
    transform: translateX(0) !important;
    box-shadow: none;
  }
  .main {
    margin-left: 186px !important;
    margin-right: 0 !important;
    max-width: none !important;
    padding: 66px 22px 28px !important;
  }
  #btn-menu { display: none; }
  #mask { display: none !important; }
}

/* =========================================================
   考核指标库：Tita 卡片式（部门分组 + 彩色模板卡片）
   ========================================================= */
.lib-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 18px;
}
.lib-head h3 { margin: 0; font-size: 16px; }

.tpl-group { margin-bottom: 22px; }
.tpl-group-title {
  font-size: 13px; color: var(--text-2); margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.tpl-group-title::before {
  content: ''; width: 3px; height: 13px; border-radius: 2px; background: var(--blue);
}
.tpl-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}
.tpl-card {
  border-radius: 8px; overflow: hidden; cursor: pointer;
  border: 1px solid var(--line); background: #fff;
  transition: transform .15s ease, box-shadow .15s ease;
}
.tpl-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(31, 35, 41, .12);
}
.tpl-card-head {
  padding: 10px 12px; font-size: 13px; font-weight: 600;
  text-align: center; color: #fff; letter-spacing: .5px;
}
.tpl-card-body {
  padding: 10px 12px 6px; min-height: 92px;
  background: repeating-linear-gradient(180deg, #fff 0 21px, #fafbfc 21px 22px);
}
.tpl-card-group { margin-bottom: 8px; }
.tpl-card-group-name {
  font-size: 11px; color: var(--text-3); margin-bottom: 5px;
}
.tpl-card-line { display: flex; gap: 4px; align-items: center; margin-bottom: 4px; }
.tpl-card-l1 { display: block; height: 5px; border-radius: 3px; width: 46%; }
.tpl-card-l2 { display: block; height: 5px; border-radius: 3px; width: 28%; opacity: .55; }
.tpl-card-foot {
  padding: 7px 12px; font-size: 11px; text-align: center;
  color: var(--text-2); border-top: 1px solid var(--line);
}

/* 各卡片配色（按部门轮转） */
.tpl-card.c-green .tpl-card-head { background: #7bc7a4; }
.tpl-card.c-green .tpl-card-l1 { background: #b7e3cd; }
.tpl-card.c-green .tpl-card-l2 { background: #d3eee1; }
.tpl-card.c-yellow .tpl-card-head { background: #f0c674; }
.tpl-card.c-yellow .tpl-card-l1 { background: #f7dfae; }
.tpl-card.c-yellow .tpl-card-l2 { background: #fbedd5; }
.tpl-card.c-blue .tpl-card-head { background: #8fb6e8; }
.tpl-card.c-blue .tpl-card-l1 { background: #c3d9f3; }
.tpl-card.c-blue .tpl-card-l2 { background: #dce9f8; }
.tpl-card.c-pink .tpl-card-head { background: #f0a3b4; }
.tpl-card.c-pink .tpl-card-l1 { background: #f7ccd5; }
.tpl-card.c-pink .tpl-card-l2 { background: #fae1e7; }
.tpl-card.c-purple .tpl-card-head { background: #b6a4e0; }
.tpl-card.c-purple .tpl-card-l1 { background: #d9d0f0; }
.tpl-card.c-purple .tpl-card-l2 { background: #e9e3f7; }
.tpl-card.c-cyan .tpl-card-head { background: #7ecad4; }
.tpl-card.c-cyan .tpl-card-l1 { background: #bde4e9; }
.tpl-card.c-cyan .tpl-card-l2 { background: #d8eef1; }

/* =========================================================
   考核模板编辑器（Tita 三步骤）
   ========================================================= */
.page-tpl-editor { padding: 0 !important; }
.tpl-editor-bar {
  display: flex; align-items: center; gap: 16px;
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 12px 18px; position: sticky; top: 66px; z-index: 40;
  flex-wrap: wrap;
}
.tpl-editor-name { font-weight: 600; font-size: 15px; }
.tpl-editor-steps { display: flex; align-items: center; gap: 10px; margin-left: 12px; }
.tpl-editor-actions { margin-left: auto; display: flex; gap: 8px; }
.tpl-editor-body { padding: 20px 18px 40px; max-width: 1180px; }

.tpl-form { max-width: 640px; }
.tpl-form-row {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 13px 0; border-bottom: 1px solid var(--line);
}
.tpl-label {
  width: 120px; flex-shrink: 0; text-align: right;
  padding-top: 7px; color: var(--text-2); font-size: 13px;
}
.tpl-label.req::before { content: '*'; color: var(--red); margin-right: 3px; }
.tpl-ctrl { flex: 1; display: flex; flex-direction: column; gap: 6px; padding-top: 2px; }
.tpl-ctrl .inp, .tpl-ctrl .sel { max-width: 460px; width: 100%; }

.tpl-editor-foot {
  margin-top: 22px; display: flex; gap: 10px; justify-content: flex-end;
}

.tpl-metric-bar {
  display: flex; gap: 20px; align-items: center;
  padding: 10px 14px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); margin-bottom: 14px; font-size: 13px;
}
.tpl-metric-groups { display: flex; flex-direction: column; gap: 14px; }
.tpl-metric-group {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px;
}
.tpl-metric-group-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.tpl-metric-group-head .inp { width: 200px; }
.tpl-metric-group-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 8px; font-size: 12px;
}
.tpl-metric-actions { margin-top: 14px; display: flex; gap: 10px; }
.tpl-flow-layout { margin-top: 0; }

/* 演示模式：身份切换器 */
.demo-switch {
  position: fixed; right: 18px; bottom: 18px; z-index: 300;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 8px 28px rgba(31, 35, 41, .18); overflow: hidden;
  max-width: 320px;
}
.demo-switch-head {
  padding: 9px 13px; background: var(--blue); color: #fff;
  font-size: 13px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
}
.demo-switch-list { display: none; }
.demo-switch.open .demo-switch-list { display: block; }
.demo-switch-item {
  padding: 9px 13px; border-bottom: 1px solid var(--line); cursor: pointer;
  display: flex; align-items: center; gap: 9px;
}
.demo-switch-item:last-child { border-bottom: none; }
.demo-switch-item:hover { background: var(--blue-weak); }
.demo-switch-item.active { background: var(--blue-weak); }
.demo-switch-item .dsi-avatar {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: var(--blue); color: #fff; display: flex;
  align-items: center; justify-content: center; font-size: 13px;
}
.demo-switch-item .dsi-main { min-width: 0; flex: 1; }
.demo-switch-item .dsi-name { font-size: 13px; font-weight: 600; }
.demo-switch-item .dsi-role { font-size: 11px; color: var(--text-3); }
.demo-switch-item .dsi-desc {
  font-size: 11px; color: var(--text-3); line-height: 1.4; margin-top: 1px;
}

/* 指标库部门切换 tab */
.lib-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.lib-tab {
  padding: 6px 14px; border-radius: 16px; font-size: 13px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--text-2);
}
.lib-tab.active { background: var(--blue); color: #fff; border-color: var(--blue); }

/* 模板编辑器打开时：隐藏左侧菜单与顶部导航，整屏编辑（对齐 Tita） */
body.tpl-editor-open .sidemenu { display: none !important; }
body.tpl-editor-open .main {
  margin-left: 0 !important;
  padding: 0 !important;
  max-width: none !important;
}
body.tpl-editor-open .topbar { display: none !important; }
body.tpl-editor-open .page-tpl-editor { padding: 0 !important; }
body.tpl-editor-open .tpl-editor-bar { top: 0; }

/* 模板编辑器：表单区加宽，贴近 Tita 排版 */
body.tpl-editor-open .tpl-editor-body { padding: 26px 34px 50px; max-width: none; }
body.tpl-editor-open .tpl-form { max-width: 760px; }
body.tpl-editor-open .tpl-label { width: 140px; }
body.tpl-editor-open .tpl-editor-foot { max-width: 760px; }

/* 模板编辑器：指标表格输入框加宽 */
body.tpl-editor-open .tpl-metric-group .inp { width: 100%; }
body.tpl-editor-open .tpl-metric-group-head .inp { width: 190px; }
body.tpl-editor-open .tpl-metric-group .tbl td .inp { min-width: 90px; }

/* ============ 弹窗（发起考核 / 确认框） ============ */
/* 注意：签名板已占用 .modal（遮罩层），此处用 .dlg 独立命名避免冲突 */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
  padding: 20px;
}
.modal-mask .dlg {
  position: static;
  inset: auto;
  background: var(--card);
  border-radius: 12px;
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.28);
  overflow: hidden;
}
.dlg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
.dlg-head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.dlg-close {
  cursor: pointer;
  color: var(--text-2);
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 4px;
}
.dlg-close:hover { background: var(--line); color: var(--text); }
.dlg-body { padding: 18px 20px; overflow: auto; }
.dlg-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: var(--card);
}
.cfg-field .req { color: var(--red); margin-left: 3px; }
.cfg-field .sel { width: 100%; }

/* 模板编辑器里的流程配置块 */
.tpl-flow-layout .cfg-section + .cfg-section { margin-top: 14px; }
.tpl-flow-layout .check-grid { margin-top: 6px; }
.tpl-flow-layout .sel { width: 100%; margin-top: 8px; }

/* 流程树固定节点（开始 / 结束）：只展示不可点 */
.flow-node-fixed {
  cursor: default;
  color: var(--text-3);
}
.flow-node-fixed:hover { background: transparent; }
.flow-node-fixed .flow-dot {
  border-style: dashed;
}

/* 卡片头部的操作区 */
.row-gap { display: flex; align-items: center; gap: 8px; }

/* 空状态：说明为什么空、去哪找，避免误以为功能坏了 */
.empty-hint {
  padding: 36px 20px; text-align: center; color: var(--text-2);
  line-height: 1.9; font-size: 13px;
}
.empty-hint strong { color: var(--text); }
.empty-hint .empty-icon { font-size: 34px; margin-bottom: 8px; opacity: .65; }
