/* ============================================================
   教师绩效评价 — 前台应用 + 管理后台 共用样式
   主题：朱红 #E63323 红白扁平（令牌见 design-tokens.css）
   ============================================================ */

.perf-app { display: flex; flex-direction: column; min-height: 100%; background: var(--page-bg); }

/* ---------- 应用头 ---------- */
.perf-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 24px; background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.perf-head h2 { font-size: 18px; font-weight: 700; color: var(--ink-strong); margin: 0; }
.perf-head .perf-sub { font-size: 12px; color: var(--ink-4); }
.perf-head-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.perf-badge {
  display: inline-flex; align-items: center; padding: 1px 8px; border-radius: var(--radius-pill);
  background: var(--brand-soft); color: var(--brand-hover); font-size: 12px; font-weight: 500;
}
.perf-badge-blue { background: #e8f0fe; color: #2f6fed; }
.perf-badge-orange { background: #fff4e5; color: #d97706; }
.perf-badge-green { background: #e9f7ee; color: #16a34a; }
.perf-badge-gray { background: #f1f2f4; color: var(--ink-3); }

/* ---------- 布局：内导航 + 内容 ---------- */
.perf-body { display: flex; flex: 1; min-height: 0; }
.perf-nav {
  width: 208px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--line);
  padding: 12px 10px; display: flex; flex-direction: column; gap: 2px;
}
.perf-nav-group { font-size: 12px; color: var(--ink-4); padding: 10px 10px 4px; }
.perf-nav-item {
  display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: var(--radius-sm);
  font-size: 14px; color: var(--ink-2); cursor: pointer; border: none; background: none; width: 100%; text-align: left;
  transition: background .15s, color .15s; position: relative;
}
.perf-nav-item:hover { background: var(--brand-50); color: var(--brand-hover); }
.perf-nav-item.active { background: var(--brand-soft); color: var(--brand-hover); font-weight: 600; }
.perf-nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--brand);
}
.perf-nav-item .cnt {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--danger); color: #fff; font-size: 11px; display: inline-flex; align-items: center; justify-content: center;
}
.perf-content { flex: 1; padding: 20px 24px; overflow-x: auto; min-width: 0; }

/* ---------- 卡片 / 筛选栏 ---------- */
.perf-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs); padding: 16px 18px; margin-bottom: 16px;
}
.perf-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.perf-card-title { font-size: 15px; font-weight: 600; color: var(--ink-strong); }
.perf-card-head .right { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.perf-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.perf-note { font-size: 12px; color: var(--ink-4); line-height: 1.6; }
.perf-empty { text-align: center; color: var(--ink-4); padding: 48px 0; font-size: 13px; }

/* ---------- 按钮 ---------- */
.pbtn {
  display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-2); font-size: 13px; cursor: pointer; transition: all .15s; white-space: nowrap;
}
.pbtn:hover { border-color: var(--brand-border); color: var(--brand-hover); }
.pbtn:disabled { opacity: .45; cursor: not-allowed; }
.pbtn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.pbtn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; box-shadow: var(--shadow-brand); }
.pbtn-danger { color: var(--danger); border-color: #f3c1c1; }
.pbtn-danger:hover { background: #fef2f2; border-color: var(--danger); color: var(--danger); }
.pbtn-sm { height: 26px; padding: 0 10px; font-size: 12px; }
.pbtn-link { border: none; background: none; color: var(--brand); padding: 0 6px; height: auto; }
.pbtn-link:hover { color: var(--brand-hover); text-decoration: underline; }

/* ---------- 表单 ---------- */
.pinput, .pselect, .ptextarea {
  height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 13px; color: var(--ink); background: var(--surface); outline: none; transition: border .15s, box-shadow .15s;
}
.ptextarea { height: auto; padding: 8px 10px; resize: vertical; }
.pinput:focus, .pselect:focus, .ptextarea:focus { border-color: var(--brand); box-shadow: var(--ring-brand); }
.pinput:disabled, .pselect:disabled, .ptextarea:disabled { background: #f5f6f8; color: var(--ink-4); cursor: not-allowed; }
.pfield { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.pfield > label { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.pfield > label .req { color: var(--danger); margin-right: 2px; }
.pfield-row { display: flex; gap: 16px; flex-wrap: wrap; }
.pfield-row .pfield { flex: 1; min-width: 160px; }
.pradio-group, .pcheck-group { display: flex; gap: 8px; flex-wrap: wrap; }
.pradio, .pcheck {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); font-size: 13px; color: var(--ink-2); cursor: pointer; background: var(--surface);
}
.pradio.on, .pcheck.on { border-color: var(--brand); color: var(--brand-hover); background: var(--brand-soft); }
.pradio input, .pcheck input { accent-color: var(--brand); margin: 0; }

/* ---------- 表格 ---------- */
.ptable-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-md); }
.ptable { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--surface); }
.ptable th {
  text-align: left; padding: 10px 12px; background: #fafbfc; color: var(--ink-2); font-weight: 600;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.ptable td { padding: 10px 12px; border-bottom: 1px solid #f3f4f6; color: var(--ink); vertical-align: middle; }
.ptable tr:last-child td { border-bottom: none; }
.ptable tbody tr:hover { background: var(--brand-50); }
.ptable tr.row-invalid td { background: #fff1f0 !important; }
.ptable .num { font-weight: 600; }
.score-pos { color: var(--brand-hover); font-weight: 600; }
.score-neg { color: var(--danger); font-weight: 600; }
.ellipsis { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }
/* 作用在表格单元格上时保持 table-cell，避免拆成匿名单元格导致整行与表头错位 */
.ptable td.ellipsis { display: table-cell; vertical-align: middle; }
/* 长文本悬浮全文浮层 */
.ptip { cursor: default; border-bottom: 1px dashed transparent; }
.ptip:hover { border-bottom-color: var(--brand-border); }
.ptip-pop {
  display: none; position: absolute; z-index: 3000; padding: 8px 12px;
  background: #1f2933; color: #fff; font-size: 12px; line-height: 1.6;
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
  white-space: pre-wrap; word-break: break-all; pointer-events: none;
}
.ptable-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 4px 0; font-size: 12px; color: var(--ink-3); }

/* ---------- 方案编辑：指标设置区（表格状） ---------- */
.iset-sec-head { display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-size: 13px; margin: 4px 0 8px; }
.iset-sec-head .perf-note { margin-left: 8px; }
/* 任务编辑：左侧固定高指标树 */
.se-tree-col { width: 300px; flex-shrink: 0; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); display: flex; flex-direction: column; }
.se-tree-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 8px; font-weight: 600; font-size: 13px; color: var(--ink-strong); }
.pbtn-link { border: none; background: none; color: var(--brand); font-size: 13px; font-weight: 600; cursor: pointer; padding: 2px 0; }
.pbtn-link:hover { text-decoration: underline; }
.se-tree-body { height: calc(100vh - 300px); min-height: 280px; overflow-y: auto; padding: 8px 10px 12px; border: none; }
.se-tree-body .ptree-row, .se-tree-body .ptree-project { padding: 5px 8px; }
.se-tree-body .ptree-children { margin-left: 18px; padding-left: 6px; }
/* 方案编辑 v2：右侧设置区（无嵌套卡片壳，内容直接铺开） */
.se-panel { width: 100%; min-width: 0; }
.se-panel .iset-sec-head { margin: 2px 0 10px; }
/* 评分项表格：紧凑单元格与控件，8 列在面板宽度内放得下 */
.se-proj-table th, .se-proj-table td { padding: 7px 8px; }
.se-proj-table .pinput, .se-proj-table .pselect { padding: 4px 8px; height: 30px; font-size: 12.5px; }
.se-proj-table .pbtn-sm { height: 26px; padding: 0 8px; font-size: 12px; }
.se-proj-table td:last-child { white-space: nowrap; }
/* 树行尾「⋯」操作按钮与弹出小菜单 */
.pdots { border: none; background: none; color: var(--ink-4); cursor: pointer; font-size: 15px; line-height: 1; padding: 2px 5px; border-radius: 4px; flex-shrink: 0; }
.pdots:hover { background: var(--brand-soft); color: var(--brand-hover); }
.pmenu { position: fixed; z-index: 1500; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 28px rgba(15,23,42,.14); padding: 4px; min-width: 108px; }
.pmenu-item { padding: 7px 12px; font-size: 13px; border-radius: 6px; cursor: pointer; color: var(--ink-2); }
.pmenu-item:hover { background: var(--brand-soft); color: var(--brand-hover); }
.pmenu-item.danger { color: var(--danger); }
.pmenu-item.danger:hover { background: #fef2f2; }
.pmenu-item.disabled { color: var(--ink-4); cursor: not-allowed; }
.pmenu-item.disabled:hover { background: none; }
/* 表格内下划线链接（审核人/预置标准） */
.plink { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; font-size: 13px; white-space: nowrap; }
.plink:hover { color: var(--brand-hover); }
/* 分值设置：右侧滑出抽屉 */
.pdrawer-mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 1100; }
.pdrawer { position: fixed; top: 0; bottom: 0; right: 0; width: 480px; max-width: 92vw; background: var(--surface); box-shadow: -8px 0 28px rgba(15,23,42,.16); display: flex; flex-direction: column; animation: pdrawerIn .18s ease; }
@keyframes pdrawerIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
.pdrawer-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.pdrawer-x { margin-left: auto; border: none; background: none; font-size: 20px; color: var(--ink-4); cursor: pointer; line-height: 1; }
.pdrawer-x:hover { color: var(--ink-strong); }
.pdrawer-body { flex: 1; overflow-y: auto; padding: 14px 16px; }
.pdrawer-foot { padding: 12px 16px; border-top: 1px solid var(--line); text-align: right; }

/* 组织树选人（单选）：只选人，组织仅作层级呈现 */
.ppick { position: relative; width: 100%; }
.ppick-val { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 6px 10px; font-size: 13px; cursor: pointer; background: var(--surface); }
.ppick-val.ph { color: var(--ink-4); }
.ppick-val::after { content: '▾'; float: right; color: var(--ink-4); }
.ppick-panel { position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; min-width: 260px; max-height: 280px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: 0 8px 24px rgba(15, 23, 42, .12); padding: 8px; font-size: 13px; }
.ppick-org-name { font-weight: 600; color: var(--ink-2); padding: 4px 6px; }
.ppick-empty { color: var(--ink-4); font-size: 12px; font-weight: 400; margin-left: 8px; }
.ppick-children { margin-left: 14px; border-left: 1px dashed var(--line); padding-left: 8px; }
.ppick-members { margin-left: 14px; }
.ppick-person { padding: 4px 8px; border-radius: 4px; cursor: pointer; }
.ppick-person:hover { background: var(--brand-50); }
.ppick-person.on { background: var(--brand-soft); color: var(--brand-hover); font-weight: 600; }

/* ---------- 角色切换悬浮球 ---------- */
.perf-role-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 900;
  width: 52px; height: 52px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--brand); color: #fff; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  font-size: 11px; line-height: 1.2; transition: transform .15s ease;
}
.perf-role-fab:hover { transform: scale(1.06); background: var(--brand-hover); }
.perf-role-fab .fab-ico { font-size: 18px; }
.perf-role-pop {
  position: fixed; right: 24px; bottom: 86px; z-index: 900; width: 190px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); padding: 6px; display: none;
}
.perf-role-pop.on { display: block; }
.perf-role-pop .rp-title { font-size: 12px; color: var(--ink-4); padding: 6px 10px 4px; }
.perf-role-pop .rp-item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 8px 10px; border: none; background: none; cursor: pointer; border-radius: var(--radius-sm);
  font-size: 13px; color: var(--ink);
}
.perf-role-pop .rp-item:hover { background: var(--brand-50); }
.perf-role-pop .rp-item.on { background: var(--brand-soft); color: var(--brand-hover); font-weight: 600; }

/* ---------- 我的工作台 · 任务卡片 ---------- */
.wt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.wt-card { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 14px 16px; cursor: pointer; transition: box-shadow .15s ease, border-color .15s ease; background: var(--surface); }
.wt-card:hover { border-color: var(--brand-border); box-shadow: var(--shadow-md); }
.wt-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; margin-bottom: 6px; }
.wt-card-head b { font-weight: 600; }
.wt-card-meta { font-size: 12px; color: var(--ink-4); margin-bottom: 10px; }
.wt-card-todo { display: flex; flex-wrap: wrap; gap: 6px; min-height: 24px; }
.wt-chip { font-size: 12px; padding: 1px 8px; border-radius: 10px; background: var(--brand-50); color: var(--brand-hover); border: 1px solid var(--brand-border); }

/* ---------- 申报：加分项行式 + 附件缩略图 ---------- */
.ad-item-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.ad-item-row { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fafbfc; }
.ad-item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.ad-item-x { color: var(--ink-4); }
.ad-item-count { width: 64px; }
.ad-file { position: relative; display: inline-block; }
.ad-file-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); cursor: zoom-in; display: block; }
.ad-file-del {
  position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--ink); color: #fff; font-size: 11px; line-height: 18px; text-align: center; text-decoration: none;
}
.ad-file-del:hover { background: #dc2626; }

/* ---------- 标签 ---------- */
.ptag { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 4px; font-size: 12px; line-height: 20px; white-space: nowrap; }
.ptag-blue { background: #e8f0fe; color: #2f6fed; }
.ptag-purple { background: #f3ecfd; color: #7c3aed; }
.ptag-cyan { background: #e5f8fa; color: #0891b2; }
.ptag-orange { background: #fff4e5; color: #d97706; }
.ptag-green { background: #e9f7ee; color: #16a34a; }
.ptag-red { background: var(--brand-soft); color: var(--brand-hover); }
.ptag-gray { background: #f1f2f4; color: var(--ink-3); }

/* ---------- 弹窗 ---------- */
.pmodal-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 1000;
  display: flex; align-items: flex-start; justify-content: center; padding: 48px 16px; overflow-y: auto;
}
.pmodal {
  background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-md);
  width: 640px; max-width: 96vw; max-height: calc(100vh - 96px); display: flex; flex-direction: column;
}
.pmodal-head { display: flex; align-items: center; padding: 16px 20px 12px; border-bottom: 1px solid var(--line); }
.pmodal-title { font-size: 16px; font-weight: 600; color: var(--ink-strong); }
.pmodal-close { margin-left: auto; border: none; background: none; font-size: 18px; color: var(--ink-4); cursor: pointer; }
.pmodal-body { padding: 16px 20px; overflow-y: auto; }
.pmodal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 20px 16px; border-top: 1px solid var(--line); }

/* ---------- Toast ---------- */
.ptoast-box { position: fixed; top: 72px; left: 50%; transform: translateX(-50%); z-index: 2000; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.ptoast {
  padding: 9px 18px; border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-md);
  border: 1px solid var(--line); font-size: 13px; color: var(--ink); animation: ptoast-in .2s ease;
}
.ptoast-success { border-color: #b7e4c7; color: #16a34a; }
.ptoast-error { border-color: #f3c1c1; color: var(--danger); }
.ptoast-info { border-color: var(--brand-border); color: var(--brand-hover); }
@keyframes ptoast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- 步骤条（任务三步向导） ---------- */
.psteps { display: flex; align-items: center; gap: 0; max-width: 640px; margin: 6px auto 22px; }
.pstep { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-4); cursor: pointer; user-select: none; }
.pstep .dot {
  width: 26px; height: 26px; border-radius: 50%; background: #f1f2f4; color: var(--ink-3);
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600;
}
.pstep.on { color: var(--brand-hover); font-weight: 600; }
.pstep.on .dot { background: var(--brand); color: #fff; }
.pstep.done { color: var(--brand-hover); }
.pstep.done .dot { background: var(--brand-soft); color: var(--brand-hover); }
.pstep-line { flex: 1; height: 1px; background: var(--line); margin: 0 12px; min-width: 40px; }
.te-stepnav { display: flex; align-items: center; justify-content: space-between; margin-top: 22px; padding-top: 14px; border-top: 1px solid #f3f4f6; }
.te-stepnav-right { display: flex; align-items: center; gap: 8px; }

/* ---------- 考核对象与分组（左人员池 + 右分组 + 底部分配条） ---------- */
.gap-layout { display: flex; gap: 16px; align-items: flex-start; }
.gap-pool { width: 380px; flex-shrink: 0; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); display: flex; flex-direction: column; }
.gap-pool-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 8px; font-size: 13px; color: var(--ink-strong); }
.gap-pool-tools { display: flex; gap: 8px; align-items: center; padding: 0 12px 8px; }
.gap-pool-tools .pinput { flex: 1; min-width: 0; }
.gap-pool-tree { height: calc(100vh - 400px); min-height: 260px; overflow-y: auto; border: none; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius-md) var(--radius-md); padding: 6px 8px 10px; }
.gap-pool-tree .ptree-row { display: flex; align-items: center; gap: 6px; }
.gap-groups { flex: 1; min-width: 0; }
.gap-bar { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 10px 14px; border: 1px solid var(--brand-border); background: var(--brand-50); border-radius: var(--radius-md); font-size: 13px; color: var(--ink-2); }
.gap-bar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; white-space: nowrap; }

/* ---------- 方案结构树 ---------- */
.ptree { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 12px; min-height: 320px; background: var(--surface); }
.ptree-node { margin: 2px 0; }
.ptree-row {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 13px; color: var(--ink); border: 1px solid transparent; flex-wrap: nowrap;
}
.ptree-row:hover { background: var(--brand-50); }
.ptree-row.on { background: var(--brand-soft); border-color: var(--brand-border); }
.ptree-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 40px; flex: 1; }
.ptree-row .meta {
  font-size: 11px; color: var(--ink-4); margin-left: auto; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 90px; flex-shrink: 0;
}
.ptree-children { margin-left: 22px; border-left: 1px dashed var(--line); padding-left: 8px; }
.ptree-ico { width: 16px; height: 16px; flex-shrink: 0; }
/* 树中项目行 */
.ptree-project {
  display: flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: var(--radius-sm);
  cursor: grab; font-size: 13px; color: var(--ink); border: 1px solid transparent;
}
.ptree-project:hover { background: #f0fdf4; }
.ptree-project .pbtn { padding: 1px 6px; font-size: 11px; line-height: 1.6; border-radius: 3px; }
.ptree-project .pbtn-danger { color: #ef4444; }
.ptree-row.dragging, .ptree-project.dragging { opacity: 0.4; }
.ptree-row.drag-over, .ptree-project.drag-over { border-color: var(--brand); background: var(--brand-50); }
/* 状态标签（树内嵌） */
.ptree-kind-tag {
  display: inline-block; font-size: 10px; padding: 0 5px; line-height: 1.6; border-radius: 3px;
  color: #fff; background: #16a34a; flex-shrink: 0;
}
.ptree-kind-tag.declare { background: #f59e0b; }
.ptree-kind-tag.peer { background: #6366f1; }

/* ---------- 进度条（待互评聚合行） ---------- */
.pprogress {
  display: inline-block; width: 90px; height: 6px; background: #f1f2f4;
  border-radius: 3px; overflow: hidden; vertical-align: middle;
}
.pprogress-bar { display: block; height: 100%; background: var(--brand); border-radius: 3px; transition: width .2s; }

/* ---------- 组内互评进度概览条 ---------- */
.ppeer-progress {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
  padding: 8px 12px; background: #fafbfc; border: 1px solid var(--line); border-radius: var(--radius-md);
}
.ppeer-bar {
  flex: 1; max-width: 320px; height: 8px; border-radius: 4px; overflow: hidden;
  background: #f1f2f4; display: flex;
}
.ppeer-bar-rated { display: block; height: 100%; background: var(--brand-soft); transition: width .2s; }
.ppeer-bar-sub { display: block; height: 100%; background: #16a34a; transition: width .2s; }
.ppeer-legend { font-size: 12px; color: var(--ink-3); }

/* ---------- 任务表单：考核对象与同行分组（成员标签 + 选人弹窗） ---------- */
.pgroup-card {
  border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 10px 14px; margin-bottom: 8px; background: var(--surface);
}
.pgroup-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.pgroup-head .pbtn { flex-shrink: 0; }
.pmember-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pmember-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border: 1px solid var(--brand); border-radius: var(--radius-sm);
  font-size: 12px; line-height: 18px; color: var(--brand-hover); background: var(--brand-soft);
}
.pmember-chip i { font-style: normal; cursor: pointer; color: var(--ink-4); font-size: 13px; line-height: 1; padding: 0 1px; }
.pmember-chip i:hover { color: var(--brand); }
.pmember-chip.readonly { border-color: var(--line); color: var(--ink-2); background: #fafbfc; }

/* ---------- 任务详情：层级树 + 评分区 ---------- */
.pscore-layout { display: flex; gap: 16px; align-items: flex-start; }
/* 树粘性吸附：右侧内容超一屏滚动时左侧不空出；树自身超高可独立滚动 */
.pscore-tree {
  width: 264px; flex-shrink: 0;
  position: sticky; top: 16px; align-self: flex-start;
  max-height: calc(100vh - 180px); overflow-y: auto;
}
.pscore-tree-bar { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; position: sticky; top: 0; background: var(--surface); padding: 2px 0; z-index: 2; }
.pscore-layout.tree-collapsed .pscore-tree { width: 40px; }
.pscore-layout.tree-collapsed .pscore-tree-bar { margin-bottom: 0; }
.pscore-tree .ptree-proj { display: flex; align-items: center; gap: 6px; }
/* 工作台树更紧凑：缩进收窄、标签缩小，深层级指标名也能完整显示 */
.pscore-tree .ptree-children { margin-left: 12px; padding-left: 6px; }
.pscore-tree .ptree-row { padding: 5px 8px; gap: 6px; }
.pscore-tree .ptag { font-size: 10px; padding: 0 5px; line-height: 16px; flex-shrink: 0; }
.pscore-main { flex: 1; min-width: 0; }
/* 预设勾选列：预设项多时不换行，单元格内横向滚动 */
.pscore-main .preset-items { display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.pscore-main .preset-item { flex-shrink: 0; white-space: nowrap; }
.pscore-info {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; margin-bottom: 12px;
  background: #fafbfc; border: 1px solid var(--line); border-radius: var(--radius-md); font-size: 13px;
}
.pscore-info .pname { font-weight: 700; font-size: 14px; color: var(--ink-strong); }
.ptree-toggle {
  width: 16px; height: 16px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; color: var(--ink-4); cursor: pointer; user-select: none;
}
.ptree-toggle.empty { visibility: hidden; }

/* ---------- 结果详情嵌套卡片 ---------- */
.pnode-children {
  margin: 0 16px 14px; padding: 12px 0 0 18px;
  border-left: 2px solid var(--brand-soft);
  display: flex; flex-direction: column; gap: 10px;
}
.pnode-children .pnode-card { margin-bottom: 0; }
.pnode-children .pnode-head { background: #fcfcfd; }

/* ---------- 工作台分区 ---------- */
.perf-section-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.perf-section-head h3 { font-size: 14px; font-weight: 600; color: var(--ink-strong); margin: 0; }
.perf-count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--danger);
  color: #fff; font-size: 12px; display: inline-flex; align-items: center; justify-content: center;
}

/* ---------- 互评五列格 ---------- */
.peer-grid { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.peer-cell {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px; min-height: 56px;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); font-size: 13px;
}
.peer-cell:nth-child(5n) { border-right: none; }
.peer-cell.blank { background: #fafbfc; }
.peer-cell .name { font-weight: 600; min-width: 44px; }
.peer-cell .val { color: var(--brand-hover); font-weight: 700; }
.peer-cell .pinput { width: 74px; height: 28px; }

/* ---------- 结果详情节点块 ---------- */
.pnode-card { border: 1px solid var(--line); border-radius: var(--radius-md); margin-bottom: 14px; background: var(--surface); }
.pnode-head {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line);
  font-weight: 600; background: #fafbfc; border-radius: var(--radius-md) var(--radius-md) 0 0;
  flex-wrap: wrap; row-gap: 4px;
}
.pnode-body { padding: 12px 16px; }

/* ---------- 描述列表 ---------- */
.pdesc { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; margin-bottom: 16px; }
.pdesc-item { padding: 10px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 13px; }
.pdesc-item .k { color: var(--ink-4); font-size: 12px; margin-bottom: 2px; }
.pdesc-item .v { color: var(--ink); font-weight: 500; }

/* ---------- 管理后台 ---------- */
.admin-shell { display: flex; flex-direction: column; min-height: 100%; background: var(--page-bg); }
.admin-tip {
  margin: 0 24px; padding: 8px 14px; background: #fff8e6; border: 1px solid #ffe1a8; color: #92610a;
  border-radius: var(--radius-sm); font-size: 12px;
}

/* ---------- 页内 tab ---------- */
.ptabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.ptab {
  padding: 8px 16px; font-size: 14px; color: var(--ink-2); cursor: pointer; border: none; background: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.ptab.on { color: var(--brand-hover); font-weight: 600; border-bottom-color: var(--brand); }

/* ---------- 结果详情（头部信息卡/节点字母标/计算公式） ---------- */
.prf-head-card {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 18px 22px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); margin-bottom: 16px; box-shadow: var(--shadow-xs);
}
.prf-avatar {
  width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand-coral), var(--brand));
  color: #fff; font-size: 22px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.prf-name { font-size: 18px; font-weight: 700; color: var(--ink-strong); }
.prf-metrics { margin-left: auto; display: flex; gap: 26px; flex-wrap: wrap; }
.prf-metric { text-align: center; }
.prf-metric .k { font-size: 12px; color: var(--ink-4); margin-bottom: 2px; }
.prf-metric .v { font-size: 18px; font-weight: 700; color: var(--ink-strong); }
.prf-metric .v.brand { color: var(--brand-hover); }
.pnode-letter {
  width: 26px; height: 26px; border-radius: 7px; color: #fff; font-weight: 700; font-size: 14px;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  display: inline-flex; align-items: center; justify-content: center;
}
.prf-formula { color: #d97706; font-size: 13px; margin: 8px 0; font-weight: 500; }
.prf-rank-cur > td { background: var(--brand-soft) !important; }

/* ---------- 预设评分项 ---------- */
.preset-box { border: 1px dashed var(--brand-border); border-radius: var(--radius-sm); padding: 12px; background: #fffcfb; }
.preset-items { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.preset-item {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); font-size: 13px; cursor: pointer; background: var(--surface);
}
.preset-item.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-hover); }
.preset-item:has(input:disabled) { opacity: .55; cursor: not-allowed; background: #fafafa; }
.preset-item .pv { font-weight: 700; }
.preset-item .pv.pos { color: var(--brand-hover); }
.preset-item .pv.neg { color: var(--danger); }

/* ---------- 前台顶部 Tab（替代应用内侧栏菜单） ---------- */
.perf-tabbar {
  display: flex; gap: 4px; flex-wrap: wrap; padding: 0 24px;
  background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 59px; z-index: 19;
}
.perf-tabitem {
  display: inline-flex; align-items: center; gap: 6px; padding: 12px 16px;
  border: none; background: none; font-size: 14px; color: var(--ink-2); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s;
}
.perf-tabitem:hover { color: var(--brand-hover); }
.perf-tabitem.active { color: var(--brand-hover); font-weight: 600; border-bottom-color: var(--brand); }
.perf-tabitem .cnt {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--danger); color: #fff; font-size: 11px; display: inline-flex; align-items: center; justify-content: center;
}
.perf-tabbar-sep { width: 1px; height: 20px; background: var(--line); align-self: center; margin: 0 6px; }
/* ---------- 方案编辑：弹窗分组区块 ---------- */
.pj-sec {
  border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 14px 16px 2px; margin-bottom: 12px; background: var(--surface);
}
.pj-sec-title {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
  font-size: 13px; font-weight: 600; color: var(--ink-strong);
}
.pj-sec-title::before { content: ''; width: 3px; height: 12px; border-radius: 2px; background: var(--brand); }
.pj-sec-sub { font-size: 12px; color: var(--ink-4); font-weight: 400; }
/* 多选下拉美化（考核人） */
.pselect[multiple] { height: auto; min-height: 72px; padding: 4px; }
.pselect[multiple] option { padding: 6px 10px; border-radius: 4px; margin-bottom: 2px; }
.pselect[multiple] option:checked { background: var(--brand-soft); color: var(--brand-hover); }

/* ---------- 方案编辑：节点属性面板 ---------- */
.npanel {
  width: 320px; flex-shrink: 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs); overflow: hidden;
}
.npanel-head {
  display: flex; align-items: center; gap: 8px; padding: 12px 16px;
  border-bottom: 1px solid var(--line); background: #fafbfc;
  font-size: 14px; font-weight: 600; color: var(--ink-strong);
}
.npanel-body { padding: 14px 16px; }
.npanel-ops { display: flex; gap: 8px; flex-wrap: wrap; }
.npanel-sec { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px; }
.npanel-sec-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px;
  font-size: 13px; font-weight: 600; color: var(--ink-strong);
}
