CareerNexus 职联:岗位能力图谱构建与动态演化分析平台(挑战杯 XH-202621)

- 全链路:多源JD接入/清洗交叉验证/结构化抽取(星火+离线双通道)/时序知识图谱/新岗位发现/演化分析/人岗匹配/学习路径
- WebUI 五视图:驾驶舱/图谱工作台/岗位演化/匹配(单人+批量)/学习路径
- 设置中心(config.json)/Token鉴权/SQLite状态库/语义向量通道(BGE-M3本地或联网API)
- 71 个 pytest 用例;数据目录仅保留结构(.gitkeep),数据由 scripts/generate_dataset.py 复现
This commit is contained in:
RoyirinRosmontis
2026-08-03 13:15:35 +08:00
commit a10442d78c
78 changed files with 12860 additions and 0 deletions
+1731
View File
File diff suppressed because it is too large Load Diff
+887
View File
@@ -0,0 +1,887 @@
/* CareerNexus 职联 · 全景图谱工作台(graph.js)
* canvas 力导向 + 缩放平移 + 小地图 + 详情面板 + 节点编辑/备注/审核。
* 依赖 app.js 暴露的 CN 命名空间。 */
"use strict";
(function () {
const { $, $$, api, post, esc, toast, openModal, closeModal, TYPE_META } = CN;
/* ================= 状态 ================= */
const G = {
nodes: [], edges: [], events: [], idx: {},
cam: { x: 0, y: 0, k: 1 }, // 相机:世界 -> 屏幕 screen = (world - cam.pan) * k ... 使用 cam.x/y 为平移(屏幕像素)
showLabels: true,
filters: { types: { Job: true, Skill: true, Industry: true, Scenario: true }, category: "", level: "",
edges: { required: true, preferred: true, applies: true, belongs: true } },
selected: null, // 选中节点 id
hover: null,
navStack: [], // 详情面板导航栈
drag: null, // {mode:'pan'|'node', ...}
pending: [], // 待审核候选
raf: null,
};
const canvas = () => $("#graph-canvas");
const NOTES_KEY = "cn_notes";
const VIEW_KEY = "cn_graph_view";
/* ================= 数据装载 ================= */
async function load() {
$("#graph-loading").classList.remove("hidden");
const [data, pending] = await Promise.all([
api("/api/graph"),
api("/api/review/pending").catch(() => []),
]);
CN.graphData = data;
G.events = data.events || [];
G.pending = pending;
G.nodes = data.nodes.map((n) => ({ ...n, x: 0, y: 0, vx: 0, vy: 0 }));
G.idx = Object.fromEntries(G.nodes.map((n, i) => [n.id, i]));
G.edges = data.edges.filter((e) => e.source in G.idx && e.target in G.idx);
/* 合并待审核候选为虚线节点 */
pending.forEach((c) => {
if (!(c.job_id in G.idx)) {
G.idx[c.job_id] = G.nodes.push({
id: c.job_id, type: "Job", title: c.title, category: c.category,
status: "pending", pending: true, expected_years: c.expected_years,
source_count: c.source_count, company_count: c.company_count,
x: 0, y: 0, vx: 0, vy: 0,
}) - 1;
}
[...c.required_skills.map((s) => [s, "required"]), ...c.preferred_skills.map((s) => [s, "preferred"])].forEach(([s, imp]) => {
if (!(s in G.idx)) {
G.idx[s] = G.nodes.push({ id: s, type: "Skill", category: "", x: 0, y: 0, vx: 0, vy: 0 }) - 1;
}
G.edges.push({ source: c.job_id, target: s, rel: "REQUIRES", importance: imp, weight: 1, intervals: [], sources: [], pending: true });
});
});
buildFilterOptions();
layout();
restoreView() || fitView();
renderSuggest();
renderChain(null);
$("#graph-loading").classList.add("hidden");
requestDraw();
drawMinimap();
if (G.pendingLocate) { const t = G.pendingLocate; G.pendingLocate = null; locateNode(t); }
}
function buildFilterOptions() {
const cats = [...new Set(G.nodes.filter((n) => n.type === "Job" && n.category).map((n) => n.category))].sort();
$("#fp-category").innerHTML = `<option value="">全部类别</option>` +
cats.map((c) => `<option value="${esc(c)}">${esc(c)}</option>`).join("");
}
/* ================= 力导向布局 ================= */
function layout() {
const N = G.nodes.length;
G.nodes.forEach((n, i) => {
const a = (i / N) * Math.PI * 2;
n.x = Math.cos(a) * 400 + (Math.random() - 0.5) * 60;
n.y = Math.sin(a) * 400 + (Math.random() - 0.5) * 60;
n.vx = 0; n.vy = 0;
});
for (let iter = 0; iter < 320; iter++) {
for (let i = 0; i < N; i++) {
const a = G.nodes[i];
for (let j = i + 1; j < N; j++) {
const b = G.nodes[j];
let dx = a.x - b.x, dy = a.y - b.y;
let d2 = dx * dx + dy * dy || 1;
if (d2 > 640000) continue;
const d = Math.sqrt(d2);
const f = 2600 / d2;
dx = (dx / d) * f; dy = (dy / d) * f;
a.vx += dx; a.vy += dy; b.vx -= dx; b.vy -= dy;
}
}
G.edges.forEach((e) => {
const a = G.nodes[G.idx[e.source]], b = G.nodes[G.idx[e.target]];
let dx = b.x - a.x, dy = b.y - a.y;
const d = Math.sqrt(dx * dx + dy * dy) || 1;
const rest = (a.type === "Job" && b.type === "Job") ? 260 : 130;
const f = (d - rest) * 0.015;
dx = (dx / d) * f; dy = (dy / d) * f;
a.vx += dx; a.vy += dy; b.vx -= dx; b.vy -= dy;
});
G.nodes.forEach((n) => {
n.vx *= 0.55; n.vy *= 0.55;
n.x += Math.max(-24, Math.min(24, n.vx));
n.y += Math.max(-24, Math.min(24, n.vy));
});
}
}
function worldBounds() {
let minX = 1e9, minY = 1e9, maxX = -1e9, maxY = -1e9;
G.nodes.forEach((n) => {
minX = Math.min(minX, n.x); maxX = Math.max(maxX, n.x);
minY = Math.min(minY, n.y); maxY = Math.max(maxY, n.y);
});
return { minX, minY, maxX, maxY, w: maxX - minX || 1, h: maxY - minY || 1 };
}
/* ================= 相机 ================= */
function fitView() {
const c = canvas(), b = worldBounds();
const W = c.clientWidth, H = c.clientHeight;
G.cam.k = Math.min(W / (b.w + 120), H / (b.h + 120), 1.6);
G.cam.x = (W - b.w * G.cam.k) / 2 - b.minX * G.cam.k;
G.cam.y = (H - b.h * G.cam.k) / 2 - b.minY * G.cam.k;
requestDraw(); drawMinimap();
}
const toScreen = (n) => ({ x: n.x * G.cam.k + G.cam.x, y: n.y * G.cam.k + G.cam.y });
const toWorld = (sx, sy) => ({ x: (sx - G.cam.x) / G.cam.k, y: (sy - G.cam.y) / G.cam.k });
function zoomAt(factor, cx, cy) {
const c = canvas();
cx = cx ?? c.clientWidth / 2; cy = cy ?? c.clientHeight / 2;
const w = toWorld(cx, cy);
G.cam.k = Math.max(0.15, Math.min(4, G.cam.k * factor));
G.cam.x = cx - w.x * G.cam.k;
G.cam.y = cy - w.y * G.cam.k;
requestDraw(); drawMinimap();
}
function centerOn(node, k) {
const c = canvas();
if (k) G.cam.k = k;
G.cam.x = c.clientWidth / 2 - node.x * G.cam.k;
G.cam.y = c.clientHeight / 2 - node.y * G.cam.k;
requestDraw(); drawMinimap();
}
/* ================= 可见性(筛选) ================= */
function jobLevel(n) {
const y = n.expected_years;
if (y == null) return "";
return y <= 2 ? "初级" : y <= 5 ? "中级" : "高级";
}
function visible(n) {
if (!G.filters.types[n.type]) return false;
if (n.type === "Job") {
if (G.filters.category && n.category !== G.filters.category) return false;
if (G.filters.level && jobLevel(n) !== G.filters.level) return false;
}
return true;
}
function edgeVisible(e) {
const ef = G.filters.edges || {};
if (e.rel === "REQUIRES") return ef[e.importance === "required" ? "required" : "preferred"] !== false;
if (e.rel === "APPLIES_TO") return ef.applies !== false;
if (e.rel === "BELONGS_TO") return ef.belongs !== false;
return true;
}
function neighborsOf(id) {
const set = new Set();
G.edges.forEach((e) => {
if (!edgeVisible(e)) return;
if (e.source === id) set.add(e.target);
if (e.target === id) set.add(e.source);
});
return set;
}
/* ================= 渲染 ================= */
function requestDraw() {
if (G.raf) return;
G.raf = requestAnimationFrame(() => { G.raf = null; draw(); });
}
function nodeRadius(n) {
return n.type === "Job" ? 13 : n.type === "Scenario" ? 8 : n.type === "Industry" ? 10 : 6.5;
}
function draw() {
const c = canvas();
if (!c.clientWidth) return;
const dpr = window.devicePixelRatio || 1;
c.width = c.clientWidth * dpr; c.height = c.clientHeight * dpr;
const ctx = c.getContext("2d");
ctx.scale(dpr, dpr);
ctx.clearRect(0, 0, c.clientWidth, c.clientHeight);
const sel = G.selected;
const hop = sel ? neighborsOf(sel) : null;
/* ---- 边 ---- */
G.edges.forEach((e) => {
const a = G.nodes[G.idx[e.source]], b = G.nodes[G.idx[e.target]];
if (!visible(a) || !visible(b)) return;
if (!edgeVisible(e)) return;
const pa = toScreen(a), pb = toScreen(b);
const isHot = sel && (e.source === sel || e.target === sel);
const dim = sel && !isHot;
const isReq = e.importance === "required";
ctx.save();
if (e.rel === "APPLIES_TO") {
ctx.strokeStyle = dim ? "rgba(114,46,209,0.05)" : isHot ? "rgba(114,46,209,0.7)" : "rgba(114,46,209,0.22)";
ctx.setLineDash([]);
ctx.lineWidth = isHot ? 1.4 : 0.8;
} else if (isReq) {
ctx.strokeStyle = dim ? "rgba(78,89,105,0.05)" : isHot ? "rgba(47,84,235,0.75)" : "rgba(78,89,105,0.28)";
ctx.setLineDash([]);
ctx.lineWidth = isHot ? 1.8 : 1;
} else {
ctx.strokeStyle = dim ? "rgba(19,194,194,0.05)" : isHot ? "rgba(19,194,194,0.8)" : "rgba(19,194,194,0.4)";
ctx.setLineDash([5, 4]);
ctx.lineWidth = isHot ? 1.6 : 1;
}
if (e.pending) ctx.setLineDash([3, 4]);
ctx.beginPath(); ctx.moveTo(pa.x, pa.y); ctx.lineTo(pb.x, pb.y); ctx.stroke();
ctx.setLineDash([]);
/* 箭头(指向 target 节点边缘) */
const dx = pb.x - pa.x, dy = pb.y - pa.y;
const d = Math.sqrt(dx * dx + dy * dy) || 1;
const rB = nodeRadius(b) * G.cam.k + 2;
const ax = pb.x - (dx / d) * rB, ay = pb.y - (dy / d) * rB;
const ang = Math.atan2(dy, dx);
const ah = isHot ? 7 : 5.5;
ctx.fillStyle = ctx.strokeStyle;
ctx.beginPath();
ctx.moveTo(ax, ay);
ctx.lineTo(ax - ah * Math.cos(ang - 0.45), ay - ah * Math.sin(ang - 0.45));
ctx.lineTo(ax - ah * Math.cos(ang + 0.45), ay - ah * Math.sin(ang + 0.45));
ctx.closePath(); ctx.fill();
/* 关系标签(颜色 + 文字双重编码) */
if (G.showLabels && e.rel === "REQUIRES" && G.cam.k > 0.55 && !dim) {
ctx.font = "10px sans-serif"; ctx.textAlign = "center";
ctx.fillStyle = isReq ? "rgba(47,84,235,0.85)" : "rgba(9,151,156,0.9)";
ctx.fillText(isReq ? "必备" : "加分", (pa.x + pb.x) / 2, (pa.y + pb.y) / 2 - 3);
}
ctx.restore();
});
/* ---- 节点 ---- */
G.nodes.forEach((n) => {
if (!visible(n)) return;
const p = toScreen(n);
const r = Math.max(2.5, nodeRadius(n) * Math.sqrt(G.cam.k));
const isSel = n.id === sel;
const isHop = hop && hop.has(n.id);
const dim = sel && !isSel && !isHop;
const meta = TYPE_META[n.type] || { color: "#86909c" };
ctx.save();
ctx.globalAlpha = dim ? 0.15 : 1;
ctx.fillStyle = meta.color;
if (n.type === "Skill") {
const s = r * 1.7;
ctx.beginPath(); ctx.roundRect(p.x - s / 2, p.y - s / 2, s, s, 2.5); ctx.fill();
} else {
ctx.beginPath(); ctx.arc(p.x, p.y, r, 0, 7); ctx.fill();
}
if (n.pending || n.status === "pending") {
ctx.setLineDash([3, 3]);
ctx.strokeStyle = "#ff7d00"; ctx.lineWidth = 1.6;
ctx.beginPath(); ctx.arc(p.x, p.y, r + 3.5, 0, 7); ctx.stroke();
ctx.setLineDash([]);
}
if (isSel) {
ctx.strokeStyle = "#1d2129"; ctx.lineWidth = 2;
ctx.beginPath(); ctx.arc(p.x, p.y, r + 4, 0, 7); ctx.stroke();
} else if (isHop) {
ctx.strokeStyle = "rgba(47,84,235,0.55)"; ctx.lineWidth = 1.5;
ctx.beginPath(); ctx.arc(p.x, p.y, r + 2.5, 0, 7); ctx.stroke();
}
/* 标签:岗位常显,其余放大或选中/悬停时显示 */
if (n.type === "Job" || G.cam.k > 1.05 || isSel || isHop || n.id === G.hover) {
ctx.font = `${n.type === "Job" ? 11 : 10}px sans-serif`;
ctx.textAlign = "center";
ctx.fillStyle = "rgba(255,255,255,0.85)";
const label = n.title || n.id;
const tw = ctx.measureText(label).width;
ctx.fillRect(p.x - tw / 2 - 3, p.y - r - 17, tw + 6, 13);
ctx.fillStyle = n.type === "Job" ? "#1d2129" : "#4e5969";
ctx.fillText(label, p.x, p.y - r - 7);
}
ctx.restore();
});
}
/* ================= 小地图 ================= */
function drawMinimap() {
const mm = $("#minimap-canvas");
const ctx = mm.getContext("2d");
const W = mm.width, H = mm.height;
ctx.clearRect(0, 0, W, H);
if (!G.nodes.length) return;
const b = worldBounds();
const k = Math.min((W - 10) / b.w, (H - 10) / b.h);
const ox = (W - b.w * k) / 2 - b.minX * k;
const oy = (H - b.h * k) / 2 - b.minY * k;
G.edges.forEach((e) => {
const a = G.nodes[G.idx[e.source]], bb = G.nodes[G.idx[e.target]];
if (!visible(a) || !visible(bb)) return;
ctx.strokeStyle = "rgba(120,130,150,0.25)";
ctx.beginPath();
ctx.moveTo(a.x * k + ox, a.y * k + oy);
ctx.lineTo(bb.x * k + ox, bb.y * k + oy);
ctx.stroke();
});
G.nodes.forEach((n) => {
if (!visible(n)) return;
const meta = TYPE_META[n.type] || { color: "#86909c" };
ctx.fillStyle = n.pending ? "#ff7d00" : meta.color;
ctx.beginPath();
ctx.arc(n.x * k + ox, n.y * k + oy, n.type === "Job" ? 2.6 : 1.6, 0, 7);
ctx.fill();
});
/* 视口框 */
const c = canvas();
const tl = toWorld(0, 0), br = toWorld(c.clientWidth, c.clientHeight);
ctx.strokeStyle = "#2f54eb"; ctx.lineWidth = 1.4;
ctx.strokeRect(tl.x * k + ox, tl.y * k + oy, (br.x - tl.x) * k, (br.y - tl.y) * k);
mm._proj = { k, ox, oy };
}
$("#minimap-canvas").addEventListener("click", (e) => {
const mm = e.currentTarget, p = mm._proj;
if (!p) return;
const rect = mm.getBoundingClientRect();
const wx = (e.clientX - rect.left - p.ox) / p.k;
const wy = (e.clientY - rect.top - p.oy) / p.k;
centerOn({ x: wx, y: wy });
});
/* ================= 交互:平移 / 缩放 / 点选 / 拖拽节点 ================= */
function pickNode(sx, sy) {
let best = null, bd = 1e9;
G.nodes.forEach((n) => {
if (!visible(n)) return;
const p = toScreen(n);
const r = Math.max(8, nodeRadius(n) * Math.sqrt(G.cam.k) + 4);
const d = (p.x - sx) ** 2 + (p.y - sy) ** 2;
if (d < r * r && d < bd) { bd = d; best = n; }
});
return best;
}
function bindCanvas() {
const c = canvas();
c.addEventListener("mousedown", (e) => {
const rect = c.getBoundingClientRect();
const sx = e.clientX - rect.left, sy = e.clientY - rect.top;
const node = pickNode(sx, sy);
G.drag = node
? { mode: "node", node, moved: false }
: { mode: "pan", sx, sy, camX: G.cam.x, camY: G.cam.y, moved: false };
c.classList.add("dragging");
});
window.addEventListener("mousemove", (e) => {
const rect = c.getBoundingClientRect();
const sx = e.clientX - rect.left, sy = e.clientY - rect.top;
if (!G.drag) {
const h = pickNode(sx, sy);
const id = h ? h.id : null;
if (id !== G.hover) { G.hover = id; requestDraw(); }
c.classList.toggle("hovering", !!h);
return;
}
G.drag.moved = true;
if (G.drag.mode === "pan") {
G.cam.x = G.drag.camX + (sx - G.drag.sx);
G.cam.y = G.drag.camY + (sy - G.drag.sy);
} else {
const w = toWorld(sx, sy);
G.drag.node.x = w.x; G.drag.node.y = w.y;
}
requestDraw();
});
window.addEventListener("mouseup", () => {
if (G.drag && G.drag.mode === "node" && G.drag.moved) drawMinimap();
if (G.drag && G.drag.mode === "pan" && G.drag.moved) drawMinimap();
G.drag = null;
c.classList.remove("dragging");
});
c.addEventListener("click", (e) => {
if (G.drag && G.drag.moved) return;
const rect = c.getBoundingClientRect();
const node = pickNode(e.clientX - rect.left, e.clientY - rect.top);
selectNode(node ? node.id : null);
});
c.addEventListener("wheel", (e) => {
e.preventDefault();
const rect = c.getBoundingClientRect();
zoomAt(e.deltaY < 0 ? 1.12 : 0.89, e.clientX - rect.left, e.clientY - rect.top);
}, { passive: false });
window.addEventListener("resize", () => { requestDraw(); drawMinimap(); });
}
/* ================= 工具条 / 筛选 ================= */
function bindToolbar() {
$("#tool-zoom-in").onclick = () => zoomAt(1.25);
$("#tool-zoom-out").onclick = () => zoomAt(0.8);
$("#tool-fit").onclick = fitView;
$("#tool-relayout").onclick = () => {
$("#graph-loading").classList.remove("hidden");
setTimeout(() => { layout(); fitView(); $("#graph-loading").classList.add("hidden"); toast("布局已整理", "success"); }, 30);
};
$("#tool-labels").onclick = (e) => {
G.showLabels = !G.showLabels;
e.currentTarget.classList.toggle("active", G.showLabels);
requestDraw();
};
$("#tool-filter").onclick = () => $("#graph-filter-panel").classList.toggle("hidden");
document.addEventListener("click", (e) => {
if (!e.target.closest("#graph-filter-panel") && !e.target.closest("#tool-filter")) {
$("#graph-filter-panel").classList.add("hidden");
}
});
$$("#graph-filter-panel input[data-ftype]").forEach((cb) => {
cb.onchange = () => { G.filters.types[cb.dataset.ftype] = cb.checked; requestDraw(); drawMinimap(); };
});
$$("#graph-filter-panel input[data-etype]").forEach((cb) => {
cb.onchange = () => { G.filters.edges[cb.dataset.etype] = cb.checked; requestDraw(); drawMinimap(); };
});
$("#fp-category").onchange = (e) => { G.filters.category = e.target.value; requestDraw(); drawMinimap(); };
$("#fp-level").onchange = (e) => { G.filters.level = e.target.value; requestDraw(); drawMinimap(); };
$("#fp-reset").onclick = () => {
G.filters = { types: { Job: true, Skill: true, Industry: true, Scenario: true }, category: "", level: "",
edges: { required: true, preferred: true, applies: true, belongs: true } };
$$("#graph-filter-panel input[data-ftype]").forEach((cb) => { cb.checked = true; });
$$("#graph-filter-panel input[data-etype]").forEach((cb) => { cb.checked = true; });
$("#fp-category").value = ""; $("#fp-level").value = "";
requestDraw(); drawMinimap();
};
/* 头部按钮 */
$("#btn-save-view").onclick = () => {
localStorage.setItem(VIEW_KEY, JSON.stringify({ cam: G.cam, filters: G.filters, labels: G.showLabels }));
toast("当前视图(位置/缩放/筛选)已保存", "success");
};
$("#btn-share-graph").onclick = async () => {
const url = `${location.origin}/#view=graph${G.selected ? `&node=${encodeURIComponent(G.selected)}` : ""}`;
try { await navigator.clipboard.writeText(url); toast("分享链接已复制到剪贴板", "success"); }
catch { CN.sysCopy({ title: "分享链接(请复制)", text: url }); }
};
$("#btn-export-graph").onclick = () => {
const c = canvas();
const tmp = document.createElement("canvas");
tmp.width = c.width; tmp.height = c.height;
const tctx = tmp.getContext("2d");
tctx.fillStyle = "#ffffff";
tctx.fillRect(0, 0, tmp.width, tmp.height);
tctx.drawImage(c, 0, 0);
tmp.toBlob((blob) => {
const a = document.createElement("a");
a.href = URL.createObjectURL(blob);
a.download = `CareerNexus_岗位能力图谱_${new Date().toISOString().slice(0, 10)}.png`;
a.click();
URL.revokeObjectURL(a.href);
toast("图谱 PNG 已导出", "success");
});
};
$("#gs-toggle").onclick = () => $("#graph-suggest").classList.toggle("collapsed");
}
function restoreView() {
try {
const v = JSON.parse(localStorage.getItem(VIEW_KEY) || "null");
if (!v) return false;
G.cam = v.cam;
G.filters = Object.assign(
{ types: { Job: true, Skill: true, Industry: true, Scenario: true }, category: "", level: "",
edges: { required: true, preferred: true, applies: true, belongs: true } },
v.filters);
G.filters.edges = Object.assign({ required: true, preferred: true, applies: true, belongs: true },
(v.filters && v.filters.edges) || {});
G.showLabels = v.labels !== false;
$("#tool-labels").classList.toggle("active", G.showLabels);
$$("#graph-filter-panel input[data-ftype]").forEach((cb) => { cb.checked = !!G.filters.types[cb.dataset.ftype]; });
$$("#graph-filter-panel input[data-etype]").forEach((cb) => { cb.checked = G.filters.edges[cb.dataset.etype] !== false; });
$("#fp-category").value = G.filters.category || "";
$("#fp-level").value = G.filters.level || "";
return true;
} catch { return false; }
}
/* ================= 智能建议 ================= */
function renderSuggest() {
const items = [];
G.pending.forEach((c) => items.push({
color: "#ff7d00", kind: "pending", id: c.job_id,
text: `新岗位候选「${esc(c.title)}」待审核`,
sub: `${c.source_count} 条 JD · ${c.company_count} 家企业支撑`,
}));
G.events.slice(-4).reverse().forEach((e) => items.push({
color: "#2f54eb", kind: "event", id: e.job_id,
text: `「${esc(e.job_id.replace(/^job_/, ""))}」${esc(e.change_type)}技能 ${esc(e.skill)}`,
sub: `窗口 ${esc(e.window)} · 权重 ${e.prev_weight.toFixed(2)}→${e.curr_weight.toFixed(2)}`,
}));
$("#gs-list").innerHTML = items.length ? items.map((it, i) => `
<div class="gs-item" data-i="${i}">
<span class="gs-dot" style="background:${it.color}"></span>
<div><div class="gs-text">${it.text}</div><div class="gs-sub">${it.sub}</div>
${it.kind === "pending" ? `<a class="link-btn" data-review="${esc(it.id)}">去审核 →</a>` : ""}</div>
</div>`).join("") : `<div class="empty small">暂无建议</div>`;
$$("#gs-list .gs-item").forEach((el) => {
el.onclick = (ev) => {
if (ev.target.dataset.review) return;
const it = items[+el.dataset.i];
locateNode(it.id);
};
});
$$("#gs-list [data-review]").forEach((a) => {
a.onclick = () => locateNode(a.dataset.review);
});
}
/* ================= 演化逻辑链 ================= */
function renderChain(jobId) {
const chips = $("#gc-chips");
if (!jobId) {
$("#gc-job-name").textContent = "选择岗位节点后展示能力演化路径";
chips.innerHTML = `<span class="text-weak text-aux">—</span>`;
return;
}
const job = G.nodes[G.idx[jobId]];
$("#gc-job-name").textContent = job ? `「${job.title || jobId}」能力演化路径` : "";
const evs = G.events.filter((e) => e.job_id === jobId)
.sort((a, b) => (a.window < b.window ? -1 : 1));
const seq = [];
const seen = new Set();
evs.forEach((e) => {
if (seen.has(e.skill)) return;
seen.add(e.skill);
if (e.change_type === "新增") seq.push({ skill: e.skill, exit: false, window: e.window });
if (e.change_type === "退出") {
const found = seq.find((s) => s.skill === e.skill);
if (found) found.exit = true;
}
});
let html = seq.map((s) =>
`<span class="chain-chip${s.exit ? " exit" : ""}" data-skill="${esc(s.skill)}" title="${esc(s.window)}${s.exit ? " · 已退出" : ""}">${esc(s.skill)}${s.exit ? " ✕" : ""}</span>`
).join(`<span class="chain-arrow">→</span>`);
/* 旁列待审核关系 */
const pendRels = G.edges.filter((e) => e.pending && e.source === jobId);
if (pendRels.length) {
html += `<span class="chain-arrow">|待审核:</span>` + pendRels.map((e) =>
`<span class="chain-chip review" data-skill="${esc(e.target)}">⏳ ${esc(e.target)}</span>`).join("");
}
chips.innerHTML = html || `<span class="text-weak text-aux">该岗位暂无演化记录</span>`;
chips.querySelectorAll("[data-skill]").forEach((el) => {
el.onclick = () => locateNode(el.dataset.skill);
});
}
/* ================= 选中 / 定位 ================= */
function selectNode(id, pushNav = true) {
if (pushNav && G.selected && id && id !== G.selected) G.navStack.push(G.selected);
G.selected = id;
if (id) {
renderDetail(id);
const n = G.nodes[G.idx[id]];
renderChain(n && n.type === "Job" ? id : null);
} else {
$("#detail-body").classList.add("hidden");
$("#detail-empty").classList.remove("hidden");
renderChain(null);
}
requestDraw();
}
function locateNode(id) {
/* 定位也记入 URL,刷新/分享后回到同一节点 */
const hash = new URLSearchParams(location.hash.slice(1));
hash.set("view", "graph");
hash.set("node", id);
history.replaceState(null, "", "#" + hash.toString());
const n = G.nodes[G.idx[id]];
if (!n) { G.pendingLocate = id; return; } // 数据未就绪:加载完成后补定位
G.pendingLocate = null;
selectNode(id);
centerOn(n, Math.max(G.cam.k, 0.9));
}
CN.gotoNode = locateNode;
/* ================= 备注(localStorage) ================= */
const getNotes = () => JSON.parse(localStorage.getItem(NOTES_KEY) || "{}");
function nodeNotes(id) { return getNotes()[id] || []; }
function addNote(id, text) {
const all = getNotes();
(all[id] = all[id] || []).push({ text, time: new Date().toLocaleString("zh-CN") });
localStorage.setItem(NOTES_KEY, JSON.stringify(all));
}
function delNote(id, i) {
const all = getNotes();
(all[id] || []).splice(i, 1);
localStorage.setItem(NOTES_KEY, JSON.stringify(all));
}
/* ================= 详情面板 ================= */
const NODE_ICONS = {
Job: '<svg viewBox="0 0 24 24"><rect x="3" y="7" width="18" height="13" rx="2"/><path d="M8 7V5a2 2 0 012-2h4a2 2 0 012 2v2"/></svg>',
Skill: '<svg viewBox="0 0 24 24"><path d="M12 2l2.4 4.9 5.4.8-3.9 3.8.9 5.4-4.8-2.5-4.8 2.5.9-5.4L4.2 7.7l5.4-.8L12 2z"/></svg>',
Industry: '<svg viewBox="0 0 24 24"><path d="M3 21h18M5 21V8l6-4 6 4v13M9 12h2M13 12h2M9 16h2M13 16h2"/></svg>',
Scenario: '<svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><path d="M3 12h18M12 3c2.5 2.6 3.8 5.7 3.8 9S14.5 18.4 12 21c-2.5-2.6-3.8-5.7-3.8-9S9.5 5.6 12 3z"/></svg>',
};
async function renderDetail(id) {
const n = G.nodes[G.idx[id]];
if (!n) return;
const meta = TYPE_META[n.type] || { name: n.type, tag: "tag-gray", color: "#86909c" };
const isPending = n.pending || n.status === "pending";
/* 关联 */
const rels = { Job: [], Skill: [], Scenario: [], Industry: [] };
const sources = new Set();
G.edges.forEach((e) => {
let other = null, imp = "";
if (e.source === id) { other = e.target; imp = e.importance; }
else if (e.target === id) { other = e.source; imp = e.importance; }
else return;
(e.sources || []).forEach((s) => sources.add(s));
const on = G.nodes[G.idx[other]];
if (on && rels[on.type]) rels[on.type].push({ id: other, title: on.title || other, imp, pending: e.pending });
});
/* 基础信息 */
const kv = [];
if (n.type === "Job") {
kv.push(["类别", n.category || "—"], ["期望年限", n.expected_years != null ? `${n.expected_years} 年` : "—"]);
if (n.source_count != null) kv.push(["支撑 JD", `${n.source_count} 条 / ${n.company_count} 家企业`]);
}
if (n.type === "Skill") kv.push(["类别", n.category || "通用技能"]);
kv.push(["级别", n.level || (n.type === "Job" ? jobLevel(n) || "—" : "—")]);
if (n.weight != null) kv.push(["权重", Number(n.weight).toFixed(2)]);
if (n.importance) kv.push(["重要性", n.importance === "required" ? "必备" : n.importance]);
const latestWin = G.edges.filter((e) => (e.source === id || e.target === id) && e.intervals?.length)
.flatMap((e) => e.intervals.map((i) => i[0])).sort().at(-1);
if (latestWin) kv.push(["更新时间", latestWin]);
const relHtml = Object.entries(rels).filter(([, l]) => l.length).map(([t, l]) => `
<div class="kv"><span class="k">关联${TYPE_META[t].name}</span></div>
<div class="rel-list">${l.slice(0, 12).map((r) => `
<div class="rel-item" data-id="${esc(r.id)}">
<span class="ri-kind tag ${TYPE_META[t].tag}">${TYPE_META[t].name}</span>
<span class="ri-name">${esc(r.title)}</span>
${r.imp ? `<span class="ri-extra">${r.imp === "required" ? "必备" : "加分"}${r.pending ? "·待审核" : ""}</span>` : ""}
</div>`).join("")}
${l.length > 12 ? `<div class="text-weak text-aux" style="padding:2px 8px">…共 ${l.length} 项</div>` : ""}
</div>`).join("");
const srcList = [...sources];
const notes = nodeNotes(id);
const audit = await api(`/api/audit?node_id=${encodeURIComponent(id)}&limit=6`).catch(() => []);
const skillEvents = n.type === "Skill"
? G.events.filter((e) => e.skill === id).sort((a, b) => (a.window < b.window ? 1 : -1)).slice(0, 3) : [];
$("#detail-empty").classList.add("hidden");
const body = $("#detail-body");
body.classList.remove("hidden");
body.innerHTML = `
<div class="dt-head">
<div class="dt-title-row">
<span class="dt-node-icon" style="background:${meta.color}">${NODE_ICONS[n.type] || NODE_ICONS.Job}</span>
<div>
<div class="dt-name">${esc(n.title || n.id)}</div>
<div class="dt-tags">
<span class="tag ${meta.tag}">${meta.name}</span>
${isPending ? `<span class="tag tag-orange">待审核</span>` : `<span class="tag tag-green">正式入库</span>`}
</div>
</div>
</div>
<button class="icon-btn sm dt-close" id="dt-close" title="关闭"><svg viewBox="0 0 24 24"><path d="M18 6L6 18M6 6l12 12"/></svg></button>
</div>
${G.navStack.length ? `<button class="btn btn-text btn-sm dt-back" id="dt-back">← 返回上一个节点</button>` : ""}
<div class="dt-sec"><div class="dt-sec-title">基础信息</div>
${kv.map(([k, v]) => `<div class="kv"><span class="k">${k}</span><span class="v">${esc(v)}</span></div>`).join("") || `<div class="text-weak text-aux">暂无属性</div>`}
</div>
${relHtml ? `<div class="dt-sec"><div class="dt-sec-title">关联信息(点击跳转)</div>${relHtml}</div>` : ""}
${n.type === "Skill" ? `
<div class="dt-sec"><div class="dt-sec-title">演化信息</div>
<div class="sparkline-box"><canvas id="dt-spark" width="264" height="52"></canvas>
<div class="text-weak text-aux" style="margin-top:4px">近 12 个季度热度(活跃岗位关系数)</div></div>
${skillEvents.map((e) => `<div class="audit-item"><div class="au-head">
<span class="tag ${({ "新增": "tag-green", "增强": "tag-blue", "减弱": "tag-orange", "退出": "tag-red" })[e.change_type] || "tag-gray"}">${e.change_type}</span>
<b>${esc(e.job_id.replace(/^job_/, ""))}</b><span class="text-weak">${esc(e.window)}</span></div></div>`).join("")}
</div>` : ""}
<div class="dt-sec"><div class="dt-sec-title">证据来源(支撑 JD,点击查看原文)</div>
${srcList.length ? srcList.slice(0, 10).map((s) => `
<div class="src-item" data-sid="${esc(s)}">
<svg viewBox="0 0 24 24"><path d="M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"/><path d="M14 2v6h6"/></svg>${esc(s)}</div>`).join("")
+ (srcList.length > 10 ? `<div class="text-weak text-aux" style="padding:2px 8px">…共 ${srcList.length} 条</div>` : "")
: `<div class="text-weak text-aux">暂无来源记录</div>`}
</div>
<div class="dt-sec"><div class="dt-sec-title">操作</div>
<div class="dt-actions">
${isPending ? `
<button class="btn btn-primary btn-sm" id="dt-accept">确认入库</button>
<button class="btn btn-danger btn-sm" id="dt-reject">驳回</button>` : `
<button class="btn btn-secondary btn-sm" id="dt-edit">编辑节点</button>
<button class="btn btn-secondary btn-sm" id="dt-sources">查看来源</button>`}
<button class="btn btn-secondary btn-sm" id="dt-note">添加备注</button>
${n.type === "Job" && !isPending ? `<button class="btn btn-secondary btn-sm" id="dt-evo">查看演化</button>
<button class="btn btn-primary btn-sm full" id="dt-learn">生成学习路径</button>` : ""}
</div>
</div>
<div class="dt-sec"><div class="dt-sec-title">备注(本地保存)</div>
<div id="dt-notes">${notes.map((t, i) => `
<div class="note-item"><div class="nt-head"><span>${esc(t.time)}</span>
<button class="nt-del" data-i="${i}">删除</button></div>${esc(t.text)}</div>`).join("") ||
`<div class="text-weak text-aux">暂无备注</div>`}</div>
</div>
<div class="dt-sec"><div class="dt-sec-title">审核留痕</div>
${audit.length ? audit.map((r) => `
<div class="audit-item">
<div class="au-head"><b>${esc(r.operator || "—")}</b><span class="text-weak">${esc(r.time || "")}</span></div>
<div class="au-diff">${auditDiff(r)}${r.reason ? `<br>原因:${esc(r.reason)}` : ""}</div>
</div>`).join("") : `<div class="text-weak text-aux">暂无留痕记录</div>`}
</div>`;
/* 绑定 */
$("#dt-close").onclick = () => selectNode(null, false);
const back = $("#dt-back");
if (back) back.onclick = () => { const prev = G.navStack.pop(); if (prev) selectNode(prev, false); };
body.querySelectorAll(".rel-item").forEach((el) => { el.onclick = () => locateNode(el.dataset.id); });
body.querySelectorAll(".src-item").forEach((el) => { el.onclick = () => CN.showJdEvidence(el.dataset.sid); });
body.querySelectorAll(".nt-del").forEach((el) => {
el.onclick = () => { delNote(id, +el.dataset.i); renderDetail(id); };
});
$("#dt-note").onclick = async () => {
const text = await CN.sysPrompt({ title: `为「${n.title || n.id}」添加备注`, label: "备注内容:", placeholder: "如:评审时重点关注的技能" });
if (text && text.trim()) { addNote(id, text.trim()); renderDetail(id); toast("备注已保存", "success"); }
};
const srcBtn = $("#dt-sources");
if (srcBtn) srcBtn.onclick = () => {
const first = srcList[0];
if (first) CN.showJdEvidence(first); else toast("暂无来源记录", "info");
};
const editBtn = $("#dt-edit");
if (editBtn) editBtn.onclick = () => openEditModal(n);
const evoBtn = $("#dt-evo");
if (evoBtn) evoBtn.onclick = () => {
CN.switchView("evolution");
$("#evo-job-select").value = id;
$("#evo-job-select").dispatchEvent(new Event("change"));
};
const learnBtn = $("#dt-learn");
if (learnBtn) learnBtn.onclick = () => {
CN.switchView("path");
$("#path-job-select").value = id;
$("#btn-path").click();
};
const accBtn = $("#dt-accept"), rejBtn = $("#dt-reject");
if (accBtn) accBtn.onclick = () => reviewCandidate(id, "accept");
if (rejBtn) rejBtn.onclick = () => reviewCandidate(id, "reject");
/* 技能 sparkline */
if (n.type === "Skill") drawSkillSpark(id);
}
function auditDiff(r) {
const parts = [];
const before = r.before || {}, after = r.after || {};
Object.keys(after).forEach((k) => {
if (["job_id", "responsibilities", "scenarios", "required_skills", "preferred_skills"].includes(k)) return;
parts.push(`${esc(k)}: ${esc(JSON.stringify(before[k]) ?? "—")} → ${esc(JSON.stringify(after[k]))}`);
});
if (!parts.length && r.action) parts.push(`动作:${esc(r.action)}`);
return parts.join("<br>") || "—";
}
function drawSkillSpark(skillId) {
const c = $("#dt-spark");
if (!c) return;
/* 各季度活跃关系数:intervals 覆盖窗口即活跃 */
const wins = [...new Set(G.edges.flatMap((e) => (e.intervals || []).map((i) => i[0])))].sort();
const last12 = wins.slice(-12);
const values = last12.map((w) => G.edges.filter((e) =>
(e.source === skillId || e.target === skillId) &&
(e.intervals || []).some(([f, t]) => f <= w && (t === null || w < t))).length);
const ctx = c.getContext("2d");
ctx.clearRect(0, 0, c.width, c.height);
const max = Math.max(1, ...values);
values.forEach((v, i) => {
const bw = c.width / values.length;
const h = (v / max) * (c.height - 16);
ctx.fillStyle = "#2f54eb";
ctx.fillRect(i * bw + 2, c.height - h - 12, bw - 4, h);
if (i % 3 === 0) {
ctx.fillStyle = "#86909c"; ctx.font = "9px sans-serif"; ctx.textAlign = "center";
ctx.fillText(last12[i].slice(2), i * bw + bw / 2, c.height - 2);
}
});
}
/* ================= 节点编辑弹窗 ================= */
function openEditModal(n) {
openModal(`编辑节点 · ${esc(n.title || n.id)}`, `
<div class="form-row"><label class="form-label">名称</label>
<input id="ef-title" class="input" style="width:100%" value="${esc(n.title || "")}"></div>
<div class="form-row"><label class="form-label">级别</label>
<select id="ef-level" class="select" style="width:100%">
<option value="">未设置</option>
${["初级", "中级", "高级"].map((l) => `<option ${n.level === l ? "selected" : ""}>${l}</option>`).join("")}
</select></div>
<div class="form-row"><label class="form-label">重要性</label>
<select id="ef-importance" class="select" style="width:100%">
<option value="">未设置</option>
<option value="required" ${n.importance === "required" ? "selected" : ""}>必备</option>
<option value="preferred" ${n.importance === "preferred" ? "selected" : ""}>加分</option>
</select></div>
<div class="form-row"><label class="form-label">权重(0-1)</label>
<input id="ef-weight" type="number" min="0" max="1" step="0.05" class="input" style="width:100%" value="${n.weight ?? ""}"></div>
<div class="form-row"><label class="form-label">操作人</label>
<input id="ef-operator" class="input" style="width:100%" value="评审专家"></div>
<div class="form-row"><label class="form-label">修改原因</label>
<input id="ef-reason" class="input" style="width:100%" placeholder="选填,将写入审核留痕"></div>`,
`<button class="btn btn-secondary" id="ef-cancel">取消</button>
<button class="btn btn-primary" id="ef-submit">提交修改</button>`);
$("#ef-cancel").onclick = closeModal;
$("#ef-submit").onclick = async () => {
const updates = {};
const title = $("#ef-title").value.trim();
if (title && title !== (n.title || "")) updates.title = title;
if ($("#ef-level").value) updates.level = $("#ef-level").value;
if ($("#ef-importance").value) updates.importance = $("#ef-importance").value;
if ($("#ef-weight").value !== "") updates.weight = +$("#ef-weight").value;
if (!Object.keys(updates).length) return toast("没有需要提交的修改", "info");
try {
await post("/api/graph/node/update", {
node_id: n.id, updates,
operator: $("#ef-operator").value.trim() || "评审专家",
reason: $("#ef-reason").value.trim(),
});
Object.assign(n, updates);
closeModal();
toast("节点已更新并留痕", "success");
renderDetail(n.id);
requestDraw();
} catch (e) { toast(e.message, "error"); }
};
}
/* ================= 候选审核 ================= */
async function reviewCandidate(id, action) {
await CN.doReview(id, action);
}
/* ================= 对外接口 ================= */
CN.graph = {
inited: false,
async init() {
if (this.inited) return;
this.inited = true;
bindCanvas();
bindToolbar();
await load();
},
onShow() { requestDraw(); drawMinimap(); },
async reload() {
await load();
if (G.selected && !(G.selected in G.idx)) selectNode(null, false);
else if (G.selected) renderDetail(G.selected);
},
};
})();
+511
View File
@@ -0,0 +1,511 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CareerNexus 职联 · 岗位与能力图谱平台</title>
<link rel="stylesheet" href="/static/style.css?v=20260803">
</head>
<body>
<!-- ============ 顶部栏 56px ============ -->
<header class="topbar">
<div class="brand">
<span class="brand-logo">
<svg viewBox="0 0 24 24" fill="none"><circle cx="6" cy="6" r="3"/><circle cx="18" cy="7" r="3"/><circle cx="12" cy="18" r="3"/><path d="M8.5 7.5l7-1M7.5 8.8l3 6.4M16.5 9.6l-3 5.6"/></svg>
</span>
<span class="brand-name">CareerNexus <b>职联</b></span>
</div>
<div class="page-title" id="page-title">数据驾驶舱</div>
<div class="topbar-right">
<div class="global-search">
<svg viewBox="0 0 24 24"><circle cx="11" cy="11" r="7"/><path d="M21 21l-4.35-4.35"/></svg>
<input id="global-search-input" type="text" placeholder="搜索岗位 / 技能 / 场景…" autocomplete="off">
<div id="global-search-drop" class="search-drop hidden"></div>
</div>
<span class="badge badge-version" id="data-version" title="图谱数据版本">数据版本 —</span>
<button class="icon-btn" id="btn-config" title="系统设置" aria-label="系统设置">
<svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 11-2.83 2.83l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 11-4 0v-.09a1.65 1.65 0 00-1-1.51 1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 11-2.83-2.83l.06-.06a1.65 1.65 0 00.33-1.82 1.65 1.65 0 00-1.51-1H3a2 2 0 110-4h.09a1.65 1.65 0 001.51-1 1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 112.83-2.83l.06.06a1.65 1.65 0 001.82.33h.01a1.65 1.65 0 001-1.51V3a2 2 0 114 0v.09a1.65 1.65 0 001 1.51h.01a1.65 1.65 0 001.82-.33l.06-.06a2 2 0 112.83 2.83l-.06.06a1.65 1.65 0 00-.33 1.82v.01a1.65 1.65 0 001.51 1H21a2 2 0 110 4h-.09a1.65 1.65 0 00-1.51 1z"/></svg>
</button>
<span class="avatar" title="演示账号">演</span>
</div>
</header>
<!-- ============ 横向导航(顶栏下方) ============ -->
<nav class="topnav" id="topnav">
<button class="nav-item active" data-view="dashboard">
<svg viewBox="0 0 24 24"><rect x="3" y="3" width="7" height="9" rx="1.5"/><rect x="14" y="3" width="7" height="5" rx="1.5"/><rect x="14" y="12" width="7" height="9" rx="1.5"/><rect x="3" y="16" width="7" height="5" rx="1.5"/></svg>
<span>数据驾驶舱</span>
</button>
<button class="nav-item" data-view="graph">
<svg viewBox="0 0 24 24"><circle cx="5" cy="6" r="2.5"/><circle cx="19" cy="6" r="2.5"/><circle cx="12" cy="18" r="2.5"/><path d="M7.3 7.2l9.4-1M6.2 8.3l4.2 7.4M17.8 8.3l-4.2 7.4"/></svg>
<span>全景图谱</span>
</button>
<button class="nav-item" data-view="evolution">
<svg viewBox="0 0 24 24"><path d="M3 17l5.5-5.5 3.5 3.5L20 7"/><path d="M15 7h5v5"/></svg>
<span>岗位演化</span>
</button>
<button class="nav-item" data-view="match">
<svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="8"/><circle cx="12" cy="12" r="4"/><circle cx="12" cy="12" r="1" fill="currentColor"/></svg>
<span>人岗匹配</span>
</button>
<button class="nav-item" data-view="path">
<svg viewBox="0 0 24 24"><circle cx="6" cy="19" r="2.5"/><circle cx="18" cy="5" r="2.5"/><path d="M8 17.5C12 14 8 10 12 7.5c1.5-1 3-1.2 4-1.3"/></svg>
<span>学习路径</span>
</button>
</nav>
<!-- 离线回退模式横幅 -->
<div class="offline-banner hidden" id="offline-banner">
<svg viewBox="0 0 24 24"><path d="M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"/><path d="M12 9v4M12 17h.01"/></svg>
<span>当前为<b>离线回退模式</b>:未配置 LLM 密钥,抽取与生成使用离线确定性方案。配置星火大模型密钥可启用联网能力。</span>
<button class="banner-btn" id="banner-config">去配置</button>
<button class="banner-close" id="banner-close" title="关闭">×</button>
</div>
<!-- 语义向量模型横幅 -->
<div class="offline-banner hidden" id="embed-banner">
<svg viewBox="0 0 24 24"><path d="M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"/><path d="M12 9v4M12 17h.01"/></svg>
<span>语义向量模型<b>未就绪</b>:当前使用词表归一化匹配。下载 BGE-M3 权重并在设置中配置,可启用语义相似匹配增强。</span>
<button class="banner-btn" id="embed-banner-config">去配置</button>
<button class="banner-close" id="embed-banner-close" title="关闭">×</button>
</div>
<div class="shell">
<!-- ============ 主内容区 ============ -->
<main class="content">
<!-- ======== 数据驾驶舱 ======== -->
<section id="view-dashboard" class="view active">
<div class="metric-grid" id="metric-cards"></div>
<div class="grid-2">
<div class="card">
<div class="card-head">
<h3>近 12 个季度演化事件趋势</h3>
<span class="text-weak text-aux">按事件窗口统计</span>
</div>
<div class="card-body"><canvas id="trend-canvas" height="220"></canvas></div>
</div>
<div class="card">
<div class="card-head">
<h3>任务与审核状态</h3>
<button class="btn btn-secondary btn-sm" id="btn-import-jd">导入 JD 数据</button>
</div>
<div class="card-body" id="task-table-wrap">
<table class="table" id="task-table">
<thead><tr><th>类型</th><th>对象</th><th>操作人</th><th>时间</th><th>结果</th></tr></thead>
<tbody></tbody>
</table>
<div class="empty small hidden" id="task-empty">暂无任务记录</div>
</div>
</div>
</div>
<div class="grid-2">
<div class="card">
<div class="card-head"><h3>动态消息流</h3><span class="text-weak text-aux">点击可跳转</span></div>
<div class="card-body feed" id="activity-feed"></div>
</div>
<div class="card">
<div class="card-head"><h3>待审核新岗位候选</h3><span class="badge badge-warning" id="pending-count">0 待办</span></div>
<div class="card-body" id="pending-list"></div>
</div>
</div>
</section>
<!-- ======== 全景图谱工作台 ======== -->
<section id="view-graph" class="view">
<div class="graph-header card">
<div class="graph-title">
<h2>岗位能力图谱工作台</h2>
<span class="tag tag-blue">演示模式</span>
<span class="tag tag-cyan">技能点级</span>
<span class="tag tag-green">审核已开启</span>
</div>
<div class="graph-actions">
<button class="btn btn-secondary" id="btn-save-view">
<svg viewBox="0 0 24 24"><path d="M19 21H5a2 2 0 01-2-2V5a2 2 0 012-2h11l5 5v11a2 2 0 01-2 2z"/><path d="M17 21v-8H7v8M7 3v5h8"/></svg>
保存视图</button>
<button class="btn btn-secondary" id="btn-share-graph">
<svg viewBox="0 0 24 24"><circle cx="18" cy="5" r="3"/><circle cx="6" cy="12" r="3"/><circle cx="18" cy="19" r="3"/><path d="M8.6 13.5l6.8 4M15.4 6.5l-6.8 4"/></svg>
分享</button>
<button class="btn btn-primary" id="btn-export-graph">
<svg viewBox="0 0 24 24"><path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4M7 10l5 5 5-5M12 15V3"/></svg>
导出图谱</button>
</div>
</div>
<div class="graph-body">
<div class="graph-canvas-wrap card" id="graph-canvas-wrap">
<canvas id="graph-canvas"></canvas>
<!-- 左上浮动工具条 -->
<div class="graph-toolbar">
<button class="tool-btn" id="tool-zoom-in" title="放大"><svg viewBox="0 0 24 24"><circle cx="11" cy="11" r="7"/><path d="M21 21l-4.35-4.35M11 8v6M8 11h6"/></svg></button>
<button class="tool-btn" id="tool-zoom-out" title="缩小"><svg viewBox="0 0 24 24"><circle cx="11" cy="11" r="7"/><path d="M21 21l-4.35-4.35M8 11h6"/></svg></button>
<button class="tool-btn" id="tool-fit" title="适应画布"><svg viewBox="0 0 24 24"><path d="M8 3H5a2 2 0 00-2 2v3M16 3h3a2 2 0 012 2v3M8 21H5a2 2 0 01-2-2v-3M16 21h3a2 2 0 002-2v-3"/></svg></button>
<span class="tool-sep"></span>
<button class="tool-btn" id="tool-filter" title="筛选"><svg viewBox="0 0 24 24"><path d="M22 3H2l8 9.46V19l4 2v-8.54L22 3z"/></svg></button>
<button class="tool-btn active" id="tool-labels" title="关系标签开关"><svg viewBox="0 0 24 24"><path d="M20.59 13.41L11 3H4v7l9.59 9.59a2 2 0 002.82 0l4.18-4.18a2 2 0 000-2.82z"/><circle cx="7.5" cy="7.5" r="1" fill="currentColor"/></svg></button>
<button class="tool-btn" id="tool-relayout" title="一键整理布局"><svg viewBox="0 0 24 24"><path d="M12 3v3M12 18v3M3 12h3M18 12h3M5.6 5.6l2.2 2.2M16.2 16.2l2.2 2.2M5.6 18.4l2.2-2.2M16.2 7.8l2.2-2.2"/></svg></button>
</div>
<!-- 筛选面板 -->
<div class="graph-filter-panel hidden" id="graph-filter-panel">
<div class="fp-head">图谱筛选 <button class="link-btn" id="fp-reset">重置</button></div>
<div class="fp-block">
<div class="fp-label">节点类型</div>
<label class="check"><input type="checkbox" data-ftype="Job" checked><i class="lg-dot job"></i>岗位</label>
<label class="check"><input type="checkbox" data-ftype="Skill" checked><i class="lg-dot skill"></i>技能</label>
<label class="check"><input type="checkbox" data-ftype="Industry" checked><i class="lg-dot industry"></i>行业</label>
<label class="check"><input type="checkbox" data-ftype="Scenario" checked><i class="lg-dot scenario"></i>场景</label>
</div>
<div class="fp-block">
<div class="fp-label">连线类型</div>
<label class="check"><input type="checkbox" data-etype="required" checked><i class="lg-line solid"></i>必备技能(116)</label>
<label class="check"><input type="checkbox" data-etype="preferred" checked><i class="lg-line dashed"></i>加分技能(78)</label>
<label class="check"><input type="checkbox" data-etype="applies" checked><i class="lg-line purple"></i>应用场景(45)</label>
<label class="check"><input type="checkbox" data-etype="belongs" checked><i class="lg-line cyan"></i>所属行业(22)</label>
</div>
<div class="fp-block">
<div class="fp-label">岗位类别(技术栈)</div>
<select id="fp-category"><option value="">全部类别</option></select>
</div>
<div class="fp-block">
<div class="fp-label">岗位级别</div>
<select id="fp-level">
<option value="">全部级别</option>
<option value="初级">初级(≤2 年)</option>
<option value="中级">中级(3-5 年)</option>
<option value="高级">高级(&gt;5 年)</option>
</select>
</div>
</div>
<!-- 左下:小地图 + 图例 -->
<div class="graph-minimap">
<canvas id="minimap-canvas" width="180" height="120"></canvas>
<div class="graph-legend">
<span><i class="lg-dot job"></i>岗位</span>
<span><i class="lg-sq skill"></i>技能</span>
<span><i class="lg-dot scenario"></i>场景</span>
<span><i class="lg-dot pending"></i>待审核</span>
<span><i class="lg-line solid"></i>必备</span>
<span><i class="lg-line dashed"></i>加分</span>
</div>
</div>
<!-- 右下:智能建议 -->
<div class="graph-suggest card" id="graph-suggest">
<div class="gs-head">
<svg viewBox="0 0 24 24"><path d="M12 2a7 7 0 00-4 12.7V17a1 1 0 001 1h6a1 1 0 001-1v-2.3A7 7 0 0012 2z"/><path d="M9 21h6"/></svg>
智能建议
<button class="icon-btn sm" id="gs-toggle" title="收起/展开"><svg viewBox="0 0 24 24"><path d="M6 9l6 6 6-6"/></svg></button>
</div>
<div class="gs-list" id="gs-list"></div>
</div>
<!-- 底部:演化逻辑链 -->
<div class="graph-chain" id="graph-chain">
<div class="gc-head">演化逻辑链 <span class="text-weak text-aux" id="gc-job-name">选择岗位节点后展示能力演化路径</span></div>
<div class="gc-chips" id="gc-chips"><span class="text-weak text-aux">—</span></div>
</div>
<div class="graph-loading" id="graph-loading">
<div class="skeleton-graph"></div>
<div class="text-weak">图谱布局计算中…</div>
</div>
</div>
<!-- 右侧详情面板 320px -->
<aside class="graph-detail card" id="graph-detail">
<div class="detail-empty" id="detail-empty">
<svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><path d="M12 8v5M12 16h.01"/></svg>
<p>点击画布中的节点<br>查看详情、证据与操作</p>
<p class="text-aux text-weak">支持拖拽平移 / 滚轮缩放 / 点击选中</p>
</div>
<div class="detail-body hidden" id="detail-body"></div>
</aside>
</div>
</section>
<!-- ======== 岗位演化 ======== -->
<section id="view-evolution" class="view">
<div class="card">
<div class="card-head">
<h3>岗位能力演化分析</h3>
<div class="evo-controls">
<select id="evo-job-select" class="select"></select>
<div class="seg" id="evo-gran">
<button data-gran="month">月</button>
<button data-gran="quarter" class="active">季</button>
<button data-gran="year">年</button>
</div>
</div>
</div>
<div class="card-body">
<!-- 全部岗位演化热力图 -->
<div class="evo-chart-title text-aux text-secondary">全部岗位演化热力图(每格 = 该季度演化事件数,点击行切换岗位)</div>
<div class="evo-heatmap" id="evo-heatmap"><div class="empty small">加载中…</div></div>
<!-- 统计条 -->
<div class="evo-stats" id="evo-stats"></div>
<!-- 时点对比器 -->
<div class="evo-compare">
<div class="evo-compare-head">
<span class="evo-chart-title">能力画像时点对比</span>
<div class="evo-dates">
<input type="date" id="evo-date-a" class="input">
<span class="text-weak">→</span>
<input type="date" id="evo-date-b" class="input">
<button class="btn btn-secondary btn-sm" id="evo-compare-btn">对比</button>
</div>
</div>
<div class="evo-diff" id="evo-diff"></div>
</div>
<!-- 变更类型构成(堆叠柱状) -->
<div class="evo-chart-title text-aux text-secondary">变更类型构成(每季度 新增/增强/减弱/退出)</div>
<div class="evo-heat-wrap"><canvas id="evo-stack-canvas"></canvas></div>
<div class="stack-legend" id="stack-legend"></div>
<!-- 技能生命周期甘特图 -->
<div class="evo-chart-title text-aux text-secondary">技能生命周期(横条 = 技能在画像中的生效区间,圆点 = 变更事件)</div>
<div class="evo-gantt" id="evo-gantt"></div>
<!-- 热度走势(限高) -->
<div class="evo-chart-title text-aux text-secondary">技能热度走势(活跃技能关系数)</div>
<div class="evo-heat-wrap"><canvas id="evo-heat-canvas"></canvas></div>
<!-- 事件时间轴 -->
<div class="evo-chart-title text-aux text-secondary">演化事件时间轴(点击查看证据 JD)</div>
<div class="timeline" id="evo-timeline"></div>
</div>
</div>
</section>
<!-- ======== 人岗匹配(三步向导 + 批量匹配) ======== -->
<section id="view-match" class="view">
<div class="card">
<div class="card-body">
<div class="match-tabs">
<button class="match-tab active" data-mtab="single">单人诊断</button>
<button class="match-tab" data-mtab="batch">批量匹配</button>
</div>
<div id="match-single">
<div class="steps" id="match-steps">
<div class="step active" data-step="1"><i>1</i><span>简历录入</span></div>
<div class="step" data-step="2"><i>2</i><span>解析确认</span></div>
<div class="step" data-step="3"><i>3</i><span>诊断结果</span></div>
</div>
<!-- 第 1 步 -->
<div class="match-pane" id="match-pane-1">
<div class="form-row">
<label class="form-label">目标岗位</label>
<select id="match-job-select" class="select w-320"></select>
</div>
<div class="form-row">
<label class="form-label">简历文本</label>
<textarea id="resume-text" class="textarea" rows="10" placeholder="粘贴简历全文(将自动脱敏与技能抽取),或点击下方按钮上传 / 载入示例简历"></textarea>
</div>
<div class="form-actions">
<button class="btn btn-secondary" id="btn-load-sample">载入示例简历</button>
<label class="btn btn-secondary" for="resume-file">上传简历文件</label>
<input type="file" id="resume-file" accept=".txt,.md,.docx,.pdf" class="hidden">
<span class="text-aux text-weak">支持 .txt / .docx / .pdf,≤5MB</span>
<button class="btn btn-primary" id="btn-parse-resume">解析简历</button>
</div>
</div>
<!-- 第 2 步 -->
<div class="match-pane hidden" id="match-pane-2">
<div class="parse-summary" id="parse-summary"></div>
<div class="form-row">
<label class="form-label">识别技能(可增删)</label>
<div class="chip-editor" id="skill-chip-editor"></div>
<div class="chip-add">
<input id="skill-add-input" class="input" placeholder="输入技能后回车添加,支持逗号分隔,如 Kubernetes, Docker">
<button class="btn btn-secondary btn-sm" id="btn-skill-add">添加</button>
</div>
</div>
<div class="form-row">
<label class="form-label">工作年限</label>
<input id="parse-years" type="number" min="0" max="40" step="0.5" class="input w-120">
</div>
<div class="form-actions">
<button class="btn btn-secondary" id="btn-back-1">上一步</button>
<button class="btn btn-primary" id="btn-run-match">开始诊断</button>
</div>
</div>
<!-- 第 3 步 -->
<div class="match-pane hidden" id="match-pane-3">
<div class="match-step3-grid">
<!-- 左:简历原文 + 技能高亮 -->
<div class="resume-viewer">
<div class="rv-head">
<span class="rv-title">结构化简历(已脱敏)</span>
<span class="rv-legend">
<span class="hl hl-req">必备</span>
<span class="hl hl-pref">加分</span>
<span class="hl hl-other">其他技能</span>
<button class="btn btn-secondary btn-sm" id="btn-export-resume">
<svg viewBox="0 0 24 24"><path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4M7 10l5 5 5-5M12 15V3"/></svg>
导出 DOCX</button>
</span>
</div>
<div class="rv-body" id="resume-highlight">
<div class="empty"><p>解析简历后此处显示规范简历模板</p></div>
</div>
</div>
<!-- 右:诊断结果 -->
<div class="match-step3-right">
<div class="match-result-grid">
<div class="mrg-left">
<div class="gauge-wrap"><canvas id="gauge-canvas" width="220" height="150"></canvas>
<div class="gauge-text"><b id="gauge-score">0</b><span>综合匹配分</span></div>
</div>
<div class="match-verdict" id="match-verdict"></div>
<canvas id="radar-canvas" width="340" height="280"></canvas>
</div>
<div class="mrg-right">
<div class="hit-miss">
<div class="hm-col">
<div class="hm-title ok"><svg viewBox="0 0 24 24"><path d="M20 6L9 17l-5-5"/></svg>已命中技能</div>
<div class="hm-chips" id="matched-chips"></div>
</div>
<div class="hm-col">
<div class="hm-title bad"><svg viewBox="0 0 24 24"><path d="M18 6L6 18M6 6l12 12"/></svg>缺失技能</div>
<div class="hm-chips" id="missing-chips"></div>
</div>
</div>
<div class="transfer-block">
<div class="hm-title info"><svg viewBox="0 0 24 24"><path d="M17 3l4 4-4 4M21 7H9a4 4 0 00-4 4v1M7 21l-4-4 4-4M3 17h12a4 4 0 004-4v-1"/></svg>可迁移技能</div>
<div class="hm-chips" id="transfer-chips"></div>
</div>
<div class="transfer-block hidden" id="irrelevant-block">
<div class="hm-title weak">与目标岗位无关的技能(不计入评分)</div>
<div class="hm-chips" id="irrelevant-chips"></div>
</div>
</div>
</div>
<div class="rec-jobs">
<div class="hm-title info">推荐岗位(按匹配分排序)</div>
<div class="rec-job-cards" id="rec-job-cards"></div>
</div>
<div class="form-actions">
<button class="btn btn-secondary" id="btn-back-2">重新录入</button>
<button class="btn btn-primary" id="btn-goto-path">生成学习路径</button>
</div>
</div>
</div>
</div>
</div><!-- /match-single -->
<!-- ======== 批量匹配 ======== -->
<div id="match-batch" class="hidden">
<div class="form-row">
<label class="form-label">目标岗位</label>
<select id="batch-job-select" class="select w-320"></select>
</div>
<div class="dropzone" id="batch-drop">
<svg viewBox="0 0 24 24"><path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4M17 8l-5-5-5 5M12 3v12"/></svg>
<p><b>拖拽简历文件或文件夹到此处</b>,或:</p>
<div class="dropzone-btns">
<label class="btn btn-secondary" for="batch-files">选择文件(可多选)</label>
<label class="btn btn-secondary" for="batch-dir">选择文件夹</label>
</div>
<input type="file" id="batch-files" accept=".txt,.md,.docx,.pdf" multiple class="hidden">
<input type="file" id="batch-dir" webkitdirectory class="hidden">
<p class="text-aux text-weak">支持 .txt/.docx/.pdf · 单批 ≤50 份 · 单份 ≤5MB · 解析自动脱敏</p>
</div>
<div class="batch-filelist" id="batch-filelist"></div>
<div class="form-actions">
<button class="btn btn-primary" id="btn-batch-run">
<svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="8"/><circle cx="12" cy="12" r="4"/><circle cx="12" cy="12" r="1" fill="currentColor"/></svg>
开始批量匹配</button>
<button class="btn btn-secondary hidden" id="btn-batch-export">
<svg viewBox="0 0 24 24"><path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4M7 10l5 5 5-5M12 15V3"/></svg>
导出结果 CSV</button>
</div>
<div id="batch-result"></div>
</div>
</div>
</div>
</section>
<!-- ======== 学习路径 ======== -->
<section id="view-path" class="view">
<div class="path-layout">
<!-- 左栏:路径配置 -->
<div class="card path-side">
<div class="card-head"><h3>路径配置</h3></div>
<div class="card-body">
<div class="form-item">
<label class="form-label">目标岗位</label>
<select id="path-job-select" class="select w-full"></select>
</div>
<div class="form-item">
<label class="form-label">岗位能力清单<span class="form-label-tip">点击标记为「已掌握」</span></label>
<div class="skill-pool" id="path-skill-pool">
<div class="pool-loading">选择岗位后加载技能清单…</div>
</div>
</div>
<div class="form-item">
<label class="form-label">学习周期</label>
<div class="seg" id="path-weeks">
<button class="seg-item" data-weeks="4">4 周</button>
<button class="seg-item active" data-weeks="8">8 周</button>
<button class="seg-item" data-weeks="12">12 周</button>
</div>
</div>
<div class="path-summary" id="path-summary">
<div class="path-summary-row"><span>已掌握</span><b id="ps-known">0 项</b></div>
<div class="path-summary-row"><span>待补齐</span><b id="ps-gap">—</b></div>
<div class="progress"><div class="progress-bar" id="ps-bar" style="width:0%"></div></div>
<div class="path-summary-tip" id="ps-tip">覆盖率 0%</div>
</div>
<button class="btn btn-primary btn-block" id="btn-path">
<svg viewBox="0 0 24 24"><circle cx="6" cy="19" r="2.5"/><circle cx="18" cy="5" r="2.5"/><path d="M8 17.5C12 14 8 10 12 7.5c1.5-1 3-1.2 4-1.3"/></svg>
生成学习路径</button>
</div>
</div>
<!-- 右栏:路径结果 -->
<div class="card path-main">
<div class="card-head">
<h3>分阶段学习路线</h3>
<button class="btn btn-secondary btn-sm hidden" id="btn-export-path">
<svg viewBox="0 0 24 24"><path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4M7 10l5 5 5-5M12 15V3"/></svg>
导出文本</button>
</div>
<div class="card-body">
<div class="path-overview hidden" id="path-overview"></div>
<div class="path-flow" id="path-result">
<div class="empty">
<svg viewBox="0 0 24 24"><circle cx="6" cy="19" r="2.5"/><circle cx="18" cy="5" r="2.5"/><path d="M8 17.5C12 14 8 10 12 7.5c1.5-1 3-1.2 4-1.3"/></svg>
<p>在左侧选择目标岗位并标记已掌握技能<br>点击「生成学习路径」查看分阶段路线</p>
</div>
</div>
</div>
</div>
</div>
</section>
<footer class="app-footer">如遇问题,请联系 support@rrrosmontis.icu</footer>
</main>
</div>
<!-- 通用弹窗容器 -->
<div class="modal-mask hidden" id="modal-mask">
<div class="modal" id="modal-box" role="dialog" aria-modal="true">
<div class="modal-head"><h3 id="modal-title"></h3>
<button class="icon-btn" id="modal-close" title="关闭"><svg viewBox="0 0 24 24"><path d="M18 6L6 18M6 6l12 12"/></svg></button>
</div>
<div class="modal-body" id="modal-body"></div>
<div class="modal-foot hidden" id="modal-foot"></div>
</div>
</div>
<div class="toast-wrap" id="toast-wrap"></div>
<script src="/static/app.js?v=20260803"></script>
<script src="/static/graph.js?v=20260803"></script>
</body>
</html>
+913
View File
@@ -0,0 +1,913 @@
/* ============================================================
CareerNexus 职联 · 设计系统(企业级 OA 风格,完全离线)
参考 Ant Design Pro / 飞书 / Arco Design
============================================================ */
:root {
/* 品牌色 */
--primary: #2f54eb;
--primary-hover: #1d39c4;
--primary-light: #f0f5ff;
--success: #00b42a;
--success-light: #e8ffea;
--warning: #ff7d00;
--warning-light: #fff7e8;
--danger: #f53f3f;
--danger-light: #ffece8;
--cyan: #13c2c2;
--cyan-light: #e6fffb;
--purple: #722ed1;
--purple-light: #f9f0ff;
/* 中性色 */
--text-1: #1d2129;
--text-2: #4e5969;
--text-3: #86909c;
--border: #e5e6eb;
--border-dark: #c9cdd4;
--bg-page: #f2f3f5;
--bg-card: #ffffff;
--bg-hover: #f7f8fa;
/* 尺寸 */
--radius: 8px;
--radius-sm: 4px;
--shadow-card: 0 1px 2px rgba(29, 33, 41, 0.04), 0 2px 8px rgba(29, 33, 41, 0.04);
--shadow-pop: 0 6px 16px rgba(29, 33, 41, 0.12);
--topbar-h: 56px;
--topnav-h: 46px;
--font: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
font-family: var(--font);
font-size: 14px;
color: var(--text-1);
background: var(--bg-page);
overflow: hidden;
-webkit-font-smoothing: antialiased;
}
button { font-family: var(--font); cursor: pointer; }
input, select, textarea { font-family: var(--font); font-size: 14px; color: var(--text-1); }
svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }
.text-weak { color: var(--text-3); }
.text-secondary { color: var(--text-2); }
.text-aux { font-size: 12px; }
.w-120 { width: 120px; }
.w-320 { width: 320px; }
/* ============ 顶部栏 ============ */
.topbar {
height: var(--topbar-h);
background: #fff;
box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
display: flex;
align-items: center;
gap: 16px;
padding: 0 20px 0 12px;
position: relative;
z-index: 100;
}
.icon-btn {
width: 32px; height: 32px;
display: inline-flex; align-items: center; justify-content: center;
border: none; background: transparent; border-radius: var(--radius-sm);
color: var(--text-2);
}
.icon-btn:hover { background: var(--bg-hover); color: var(--primary); }
.icon-btn.sm { width: 24px; height: 24px; }
.icon-btn.sm svg { width: 14px; height: 14px; }
.brand { display: flex; align-items: center; gap: 8px; }
.brand-logo {
width: 30px; height: 30px; border-radius: 7px;
background: linear-gradient(135deg, #2f54eb, #13c2c2);
display: inline-flex; align-items: center; justify-content: center;
}
.brand-logo svg { width: 19px; height: 19px; color: #fff; }
.brand-name { font-size: 16px; color: var(--text-1); letter-spacing: 0.2px; }
.brand-name b { font-weight: 600; }
.page-title {
position: absolute; left: 50%; transform: translateX(-50%);
font-size: 15px; font-weight: 600; color: var(--text-1);
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.global-search {
position: relative;
display: flex; align-items: center; gap: 6px;
background: var(--bg-page); border: 1px solid transparent; border-radius: 16px;
padding: 5px 12px; width: 240px;
color: var(--text-3);
transition: all 0.2s;
}
.global-search:focus-within { background: #fff; border-color: var(--primary); width: 280px; }
.global-search svg { width: 14px; height: 14px; flex: none; }
.global-search input { border: none; outline: none; background: transparent; width: 100%; font-size: 13px; }
.search-drop {
position: absolute; top: 36px; left: 0; right: -40px;
background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
box-shadow: var(--shadow-pop); max-height: 320px; overflow: auto; z-index: 200;
}
.search-drop .sd-item {
display: flex; align-items: center; gap: 8px;
padding: 8px 12px; cursor: pointer; font-size: 13px;
}
.search-drop .sd-item:hover { background: var(--primary-light); }
.search-drop .sd-item .tag { flex: none; }
.avatar {
width: 30px; height: 30px; border-radius: 50%;
background: var(--primary); color: #fff; font-size: 13px;
display: inline-flex; align-items: center; justify-content: center;
cursor: default;
}
/* ============ 徽章 / 标签 ============ */
.badge {
display: inline-flex; align-items: center; gap: 4px;
font-size: 12px; padding: 2px 8px; border-radius: 10px;
background: var(--bg-page); color: var(--text-2); white-space: nowrap;
}
.badge-version { background: var(--cyan-light); color: #08979c; border: 1px solid #87e8de; }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-success { background: var(--success-light); color: var(--success); }
.tag {
display: inline-flex; align-items: center;
font-size: 12px; line-height: 20px; padding: 0 8px;
border-radius: var(--radius-sm); border: 1px solid transparent; white-space: nowrap;
}
.tag-blue { color: var(--primary); background: var(--primary-light); border-color: #d6e4ff; }
.tag-green { color: var(--success); background: var(--success-light); border-color: #b7eb8f; }
.tag-orange { color: var(--warning); background: var(--warning-light); border-color: #ffd591; }
.tag-red { color: var(--danger); background: var(--danger-light); border-color: #ffa39e; }
.tag-cyan { color: #08979c; background: var(--cyan-light); border-color: #87e8de; }
.tag-purple { color: var(--purple); background: var(--purple-light); border-color: #d3adf7; }
.tag-gray { color: var(--text-2); background: var(--bg-page); border-color: var(--border); }
/* ============ 布局骨架 ============ */
.shell { display: flex; height: calc(100vh - var(--topbar-h) - var(--topnav-h)); }
/* ============ 横向导航(顶栏下方) ============ */
.topnav {
height: var(--topnav-h);
background: #fff;
border-bottom: 1px solid var(--border);
display: flex; align-items: stretch; justify-content: center; gap: 32px;
padding: 0 20px;
position: relative; z-index: 90;
}
.nav-item {
position: relative;
display: flex; align-items: center; gap: 8px;
padding: 0 16px; margin: 0;
background: transparent; border: none; border-radius: 0;
color: var(--text-2); font-size: 14px; white-space: nowrap;
cursor: pointer;
transition: color 0.15s, background 0.15s;
}
.nav-item svg { width: 16px; height: 16px; flex: none; }
.nav-item:hover { color: var(--primary); background: var(--bg-hover); }
/* 选中态特殊处理:主色加粗 + 底部指示条 + 浅底高亮 */
.nav-item.active {
color: var(--primary);
font-weight: 600;
background: var(--primary-light);
}
.nav-item.active::after {
content: "";
position: absolute; left: 10px; right: 10px; bottom: -1px;
height: 3px; border-radius: 2px 2px 0 0;
background: var(--primary);
}
.nav-item.active svg { stroke-width: 2.2; }
.content { flex: 1; overflow-y: auto; padding: 16px 20px 32px; }
.view { display: none; }
.view.active { display: block; }
/* ============ 卡片 ============ */
.card {
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: var(--radius);
box-shadow: var(--shadow-card);
}
.card-head {
display: flex; align-items: center; justify-content: space-between;
padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.card-head h3 { font-size: 15px; font-weight: 600; }
.card-body { padding: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
/* ============ 按钮 ============ */
.btn {
display: inline-flex; align-items: center; justify-content: center; gap: 6px;
height: 32px; padding: 0 15px;
border-radius: var(--radius-sm); border: 1px solid transparent;
font-size: 14px; transition: all 0.15s; white-space: nowrap;
}
.btn svg { width: 14px; height: 14px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: #fff; border-color: var(--border-dark); color: var(--text-1); }
.btn-secondary:hover { color: var(--primary); border-color: var(--primary); }
.btn-text { background: transparent; border: none; color: var(--primary); padding: 0 8px; }
.btn-text:hover { background: var(--primary-light); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #cb2634; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 13px; }
.link-btn { border: none; background: none; color: var(--primary); font-size: 12px; }
.link-btn:hover { text-decoration: underline; }
/* ============ 表单 ============ */
.input, .select, .textarea {
border: 1px solid var(--border-dark); border-radius: var(--radius-sm);
padding: 6px 10px; outline: none; background: #fff;
transition: border-color 0.15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(47, 84, 235, 0.1); }
.textarea { width: 100%; resize: vertical; line-height: 1.6; }
.select { height: 32px; }
.form-row { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
/* ============ 表格 ============ */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
text-align: left; color: var(--text-3); font-weight: 500;
padding: 8px 10px; border-bottom: 1px solid var(--border); background: var(--bg-hover);
}
.table td { padding: 9px 10px; border-bottom: 1px solid var(--border); color: var(--text-2); }
.table tr:hover td { background: var(--bg-hover); }
/* ============ 空状态 / 骨架 ============ */
.empty { text-align: center; padding: 48px 16px; color: var(--text-3); }
.empty svg { width: 44px; height: 44px; stroke-width: 1.2; margin-bottom: 10px; opacity: 0.5; }
.empty p { font-size: 13px; line-height: 1.8; }
.empty.small { padding: 20px; font-size: 13px; }
.skeleton-graph {
width: 240px; height: 240px; border-radius: 50%;
background: radial-gradient(circle, #e8ebf0 20%, transparent 21%),
conic-gradient(#e8ebf0, #f5f6f8, #e8ebf0);
animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.5; } }
/* ============ 数据驾驶舱 ============ */
.metric-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.metric-card {
background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
box-shadow: var(--shadow-card); padding: 16px; cursor: pointer;
transition: all 0.15s; position: relative; overflow: hidden;
}
.metric-card:hover { border-color: var(--primary); box-shadow: var(--shadow-pop); transform: translateY(-2px); }
.metric-card .mc-label { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.metric-card .mc-label svg { width: 15px; height: 15px; color: var(--primary); }
.metric-card .mc-num { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; margin: 6px 0 4px; }
.metric-card .mc-delta { font-size: 12px; display: inline-flex; align-items: center; gap: 3px; }
.metric-card .mc-delta.up { color: var(--success); }
.metric-card .mc-delta.down { color: var(--danger); }
.metric-card .mc-delta.flat { color: var(--text-3); }
.metric-card canvas { position: absolute; right: 10px; bottom: 10px; opacity: 0.9; }
.feed { max-height: 320px; overflow-y: auto; }
.feed-item {
display: flex; gap: 10px; padding: 10px 8px; border-radius: var(--radius-sm);
cursor: pointer; align-items: flex-start;
}
.feed-item:hover { background: var(--primary-light); }
.feed-item .fi-icon {
width: 26px; height: 26px; border-radius: 50%; flex: none;
display: inline-flex; align-items: center; justify-content: center;
}
.feed-item .fi-icon svg { width: 13px; height: 13px; }
.feed-item .fi-text { font-size: 13px; line-height: 1.5; color: var(--text-1); }
.feed-item .fi-time { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.review-item {
border: 1px solid var(--border); border-radius: var(--radius);
padding: 12px 14px; margin-bottom: 10px;
}
.review-item .ri-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.review-item .ri-head b { font-size: 14px; }
.review-item .ri-meta { font-size: 12px; color: var(--text-3); margin-bottom: 8px; }
.review-item .ri-skills { font-size: 12px; color: var(--text-2); margin-bottom: 10px; line-height: 1.7; }
.review-item .ri-actions { display: flex; gap: 8px; }
/* ============ 图谱工作台 ============ */
.graph-header {
display: flex; align-items: center; justify-content: space-between;
padding: 12px 16px; margin-bottom: 12px;
}
.graph-title { display: flex; align-items: center; gap: 10px; }
.graph-title h2 { font-size: 18px; font-weight: 600; }
.graph-actions { display: flex; gap: 8px; }
.graph-body { display: flex; gap: 12px; height: calc(100vh - var(--topbar-h) - 130px); min-height: 520px; }
.graph-canvas-wrap { flex: 1; position: relative; overflow: hidden; min-width: 0; }
#graph-canvas { width: 100%; height: 100%; display: block; cursor: grab; }
#graph-canvas.dragging { cursor: grabbing; }
#graph-canvas.hovering { cursor: pointer; }
.graph-toolbar {
position: absolute; top: 14px; left: 14px;
display: flex; flex-direction: column; gap: 2px;
background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
box-shadow: var(--shadow-pop); padding: 4px; z-index: 20;
}
.tool-btn {
width: 32px; height: 32px; border: none; background: transparent;
border-radius: var(--radius-sm); color: var(--text-2);
display: inline-flex; align-items: center; justify-content: center;
}
.tool-btn:hover { background: var(--primary-light); color: var(--primary); }
.tool-btn.active { background: var(--primary-light); color: var(--primary); }
.tool-sep { height: 1px; background: var(--border); margin: 3px 4px; }
.graph-filter-panel {
position: absolute; top: 14px; left: 58px; width: 220px;
background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
box-shadow: var(--shadow-pop); padding: 12px 14px; z-index: 21;
}
.fp-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 13px; margin-bottom: 10px; }
.fp-block { margin-bottom: 12px; }
.fp-label { font-size: 12px; color: var(--text-3); margin-bottom: 6px; }
.fp-block .select { width: 100%; }
.check { display: flex; align-items: center; gap: 7px; font-size: 13px; padding: 3px 0; cursor: pointer; color: var(--text-1); }
.check input { accent-color: var(--primary); }
.graph-minimap {
position: absolute; left: 14px; bottom: 64px;
background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
box-shadow: var(--shadow-pop); padding: 6px; z-index: 15;
}
#minimap-canvas { display: block; border-radius: var(--radius-sm); background: var(--bg-page); cursor: crosshair; }
.graph-legend {
display: flex; flex-wrap: wrap; gap: 4px 10px;
font-size: 12px; color: var(--text-2); padding: 6px 2px 2px; max-width: 190px;
}
.graph-legend span { display: inline-flex; align-items: center; gap: 5px; }
.lg-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.lg-dot.job { background: var(--primary); }
.lg-dot.industry { background: #13c2c2; }
.lg-dot.scenario { background: var(--purple); }
.lg-dot.pending { background: #fff; border: 2px dashed var(--warning); width: 8px; height: 8px; }
.lg-sq { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.lg-sq.skill { background: var(--success); }
.lg-line { width: 16px; height: 0; display: inline-block; border-top: 2px solid var(--text-2); }
.lg-line.dashed { border-top-style: dashed; }
.lg-line.solid { border-top-color: var(--primary); }
.lg-line.purple { border-top-color: var(--purple); }
.lg-line.cyan { border-top-color: var(--cyan); }
.graph-suggest {
position: absolute; right: 14px; bottom: 64px; width: 260px;
z-index: 15; overflow: hidden;
}
.gs-head {
display: flex; align-items: center; gap: 6px;
font-size: 13px; font-weight: 600; padding: 10px 12px;
border-bottom: 1px solid var(--border); color: var(--text-1);
}
.gs-head svg { color: var(--warning); width: 15px; height: 15px; }
.gs-head .icon-btn { margin-left: auto; }
.gs-list { max-height: 220px; overflow-y: auto; padding: 6px; }
.gs-item {
display: flex; gap: 8px; padding: 8px; border-radius: var(--radius-sm);
cursor: pointer; align-items: flex-start; font-size: 12px;
}
.gs-item:hover { background: var(--primary-light); }
.gs-item .gs-dot { width: 6px; height: 6px; border-radius: 50%; margin-top: 5px; flex: none; }
.gs-item .gs-text { color: var(--text-1); line-height: 1.5; }
.gs-item .gs-sub { color: var(--text-3); margin-top: 2px; }
.graph-suggest.collapsed .gs-list { display: none; }
.graph-chain {
position: absolute; left: 14px; right: 14px; bottom: 12px;
background: rgba(255, 255, 255, 0.96); border: 1px solid var(--border);
border-radius: var(--radius); box-shadow: var(--shadow-pop);
padding: 8px 14px; z-index: 14;
}
.gc-head { font-size: 12px; font-weight: 600; margin-bottom: 6px; display: flex; gap: 8px; align-items: center; }
.gc-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; max-height: 62px; overflow-y: auto; }
.chain-chip {
display: inline-flex; align-items: center; gap: 4px;
border: 1px solid #b7c6f5; background: var(--primary-light); color: var(--primary);
font-size: 12px; border-radius: 12px; padding: 2px 10px; cursor: pointer;
}
.chain-chip:hover { background: var(--primary); color: #fff; }
.chain-chip.exit { border-color: #ffa39e; background: var(--danger-light); color: var(--danger); }
.chain-arrow { color: var(--text-3); font-size: 12px; }
.chain-chip.review { border-style: dashed; border-color: var(--warning); background: var(--warning-light); color: var(--warning); }
.graph-loading {
position: absolute; inset: 0; z-index: 30;
background: rgba(255, 255, 255, 0.9);
display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
}
/* 右侧详情面板 */
.graph-detail { width: 320px; flex: none; overflow-y: auto; display: flex; flex-direction: column; }
.detail-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-3); gap: 10px; text-align: center; padding: 20px; }
.detail-empty svg { width: 46px; height: 46px; stroke-width: 1.2; opacity: 0.45; }
.detail-empty p { font-size: 13px; line-height: 1.8; }
.detail-body { padding: 0 0 16px; }
.dt-head { padding: 16px 16px 12px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: #fff; z-index: 2; }
.dt-head .dt-title-row { display: flex; align-items: flex-start; gap: 10px; }
.dt-node-icon {
width: 36px; height: 36px; border-radius: var(--radius); flex: none;
display: inline-flex; align-items: center; justify-content: center; color: #fff;
}
.dt-node-icon svg { width: 18px; height: 18px; }
.dt-name { font-size: 16px; font-weight: 600; line-height: 1.3; word-break: break-all; }
.dt-tags { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.dt-close { position: absolute; top: 10px; right: 10px; }
.dt-back { margin: 10px 16px 0; }
.dt-sec { padding: 12px 16px 0; }
.dt-sec-title {
font-size: 12px; color: var(--text-3); font-weight: 600;
margin-bottom: 8px; display: flex; align-items: center; gap: 6px;
}
.dt-sec-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.kv { display: flex; font-size: 13px; padding: 4px 0; }
.kv .k { width: 72px; flex: none; color: var(--text-3); }
.kv .v { color: var(--text-1); word-break: break-all; }
.rel-list { display: flex; flex-direction: column; gap: 4px; }
.rel-item {
display: flex; align-items: center; gap: 8px;
font-size: 13px; padding: 6px 8px; border-radius: var(--radius-sm);
cursor: pointer; border: 1px solid transparent;
}
.rel-item:hover { background: var(--primary-light); border-color: #d6e4ff; }
.rel-item .ri-kind { flex: none; }
.rel-item .ri-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rel-item .ri-extra { font-size: 12px; color: var(--text-3); flex: none; }
.src-item {
font-size: 12px; color: var(--primary); padding: 5px 8px;
border-radius: var(--radius-sm); cursor: pointer;
display: flex; align-items: center; gap: 6px;
}
.src-item:hover { background: var(--primary-light); text-decoration: underline; }
.src-item svg { width: 12px; height: 12px; flex: none; }
.dt-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dt-actions .btn { width: 100%; }
.dt-actions .full { grid-column: 1 / -1; }
.audit-item {
font-size: 12px; border-left: 2px solid var(--border-dark);
padding: 4px 0 4px 10px; margin-bottom: 8px; color: var(--text-2);
}
.audit-item .au-head { display: flex; gap: 6px; align-items: center; margin-bottom: 2px; }
.audit-item .au-diff { color: var(--text-3); line-height: 1.6; word-break: break-all; }
.note-item {
background: var(--warning-light); border: 1px solid #ffe7ba;
border-radius: var(--radius-sm); padding: 8px 10px; margin-bottom: 6px; font-size: 12px;
}
.note-item .nt-head { display: flex; justify-content: space-between; color: var(--text-3); margin-bottom: 3px; }
.note-item .nt-del { color: var(--danger); cursor: pointer; border: none; background: none; font-size: 12px; }
.sparkline-box { background: var(--bg-hover); border-radius: var(--radius-sm); padding: 8px; }
/* ============ 岗位演化 ============ */
.evo-controls { display: flex; gap: 10px; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--border-dark); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { border: none; background: #fff; padding: 5px 14px; font-size: 13px; color: var(--text-2); }
.seg button.active { background: var(--primary); color: #fff; }
.evo-chart-title { margin-bottom: 8px; }
.timeline { margin-top: 20px; position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.evo-event { position: relative; padding: 10px 14px; margin-bottom: 10px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; cursor: pointer; transition: all 0.15s; }
.evo-event:hover { border-color: var(--primary); box-shadow: var(--shadow-pop); }
.evo-event::before {
content: ""; position: absolute; left: -21px; top: 16px;
width: 10px; height: 10px; border-radius: 50%; border: 2px solid #fff;
}
.evo-event.t-新增::before { background: var(--success); }
.evo-event.t-增强::before { background: var(--primary); }
.evo-event.t-减弱::before { background: var(--warning); }
.evo-event.t-退出::before { background: var(--danger); }
.evo-event .ee-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.evo-event .ee-window { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.evo-event .ee-skill { font-weight: 600; }
.evo-event .ee-desc { font-size: 12px; color: var(--text-2); line-height: 1.6; }
.evo-event .ee-src { font-size: 12px; color: var(--text-3); margin-top: 4px; }
/* ============ 人岗匹配 ============ */
.steps { display: flex; justify-content: center; gap: 0; margin-bottom: 26px; }
.step { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 14px; position: relative; padding: 0 34px; }
.step i {
width: 26px; height: 26px; border-radius: 50%; font-style: normal;
border: 1px solid var(--border-dark); display: inline-flex; align-items: center; justify-content: center;
font-size: 13px; background: #fff;
}
.step.active { color: var(--primary); font-weight: 600; }
.step.active i { background: var(--primary); border-color: var(--primary); color: #fff; }
.step.done { color: var(--success); }
.step.done i { background: var(--success); border-color: var(--success); color: #fff; }
.step:not(:last-child)::after { content: ""; position: absolute; right: -4px; top: 13px; width: 40px; height: 1px; background: var(--border-dark); }
.match-pane { max-width: 960px; margin: 0 auto; }
#match-pane-3 { max-width: none; margin: 0; } /* 诊断结果页全宽:左简历原文 + 右结果 */
.parse-summary { background: var(--bg-hover); border-radius: var(--radius); padding: 12px 16px; font-size: 13px; color: var(--text-2); margin-bottom: 16px; line-height: 1.8; }
.chip-editor { display: flex; flex-wrap: wrap; gap: 8px; min-height: 40px; border: 1px dashed var(--border-dark); border-radius: var(--radius); padding: 10px; }
.skill-chip {
display: inline-flex; align-items: center; gap: 5px;
background: var(--primary-light); color: var(--primary); border: 1px solid #d6e4ff;
font-size: 13px; border-radius: var(--radius-sm); padding: 3px 6px 3px 10px;
}
.skill-chip button { border: none; background: none; color: inherit; font-size: 14px; line-height: 1; padding: 0 2px; }
.skill-chip button:hover { color: var(--danger); }
.chip-add { margin-top: 8px; }
.chip-add .input { width: 280px; }
.match-result-grid { display: grid; grid-template-columns: 340px 1fr; gap: 24px; }
.gauge-wrap { position: relative; width: 220px; margin: 0 auto; }
.gauge-text { position: absolute; left: 0; right: 0; top: 74px; text-align: center; }
.gauge-text b { display: block; font-size: 34px; font-variant-numeric: tabular-nums; color: var(--primary); }
.gauge-text span { font-size: 12px; color: var(--text-3); }
.match-verdict { text-align: center; margin: 6px 0 10px; font-size: 14px; }
.hit-miss { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hm-title { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.hm-title svg { width: 15px; height: 15px; }
.hm-title.ok { color: var(--success); }
.hm-title.bad { color: var(--danger); }
.hm-title.info { color: var(--cyan); }
.hm-title.weak { color: var(--text-3); font-weight: 500; }
.hm-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 32px; }
.hm-chips .tag { cursor: default; }
.transfer-block { margin-top: 18px; }
.rec-jobs { margin-top: 22px; border-top: 1px dashed var(--border); padding-top: 16px; }
.rec-job-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 4px; }
.rec-job-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; cursor: pointer; transition: all 0.15s; }
.rec-job-card:hover { border-color: var(--primary); box-shadow: var(--shadow-pop); }
.rec-job-card .rj-title { font-weight: 600; margin-bottom: 4px; }
.rec-job-card .rj-score { font-size: 22px; font-weight: 600; color: var(--primary); font-variant-numeric: tabular-nums; }
.rec-job-card .rj-miss { font-size: 12px; color: var(--text-3); margin-top: 4px; line-height: 1.6; }
/* 第 3 步:左简历原文高亮 + 右诊断结果 */
.match-step3-grid { display: grid; grid-template-columns: minmax(320px, 42%) 1fr; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .match-step3-grid { grid-template-columns: 1fr; } }
.resume-viewer { border: 1px solid var(--border); border-radius: var(--radius); background: #fff; overflow: hidden; }
.rv-head {
display: flex; justify-content: space-between; align-items: center;
padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--bg-hover);
}
.rv-title { font-size: 13px; font-weight: 600; color: var(--text-1); }
.rv-legend { display: flex; gap: 6px; font-size: 11px; }
.rv-body {
padding: 14px 16px; max-height: 560px; overflow-y: auto;
font-size: 13px; line-height: 2.0; color: var(--text-1);
text-align: left; white-space: pre-wrap; word-break: break-word;
}
.hl { border-radius: 3px; padding: 1px 4px; font-weight: 500; white-space: nowrap; }
.hl-req { background: var(--success-light); color: var(--success); box-shadow: inset 0 0 0 1px #b7eb8f; }
.hl-pref { background: var(--primary-light); color: var(--primary); box-shadow: inset 0 0 0 1px #d6e4ff; }
.hl-other { background: var(--bg-page); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--border); }
/* 结构化简历模板(docx 表格风) */
.rd-table {
width: 100%; border-collapse: collapse; table-layout: fixed;
font-size: 13px; background: #fff;
}
.rd-table td {
border: 1px solid var(--border-dark); padding: 8px 10px;
vertical-align: middle; line-height: 1.8; word-break: break-word;
}
.rd-photo-cell { width: 104px; text-align: center; background: var(--bg-hover); }
.rd-photo {
width: 84px; height: 112px; object-fit: cover;
border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff;
}
.rd-photo-empty {
display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
gap: 4px; color: var(--text-3); font-size: 11px; width: 84px; height: 112px;
}
.rd-photo-empty svg { width: 30px; height: 30px; stroke: currentColor; fill: none; stroke-width: 1.5; }
.rd-k { width: 62px; background: var(--bg-hover); color: var(--text-2); font-weight: 500; }
.rd-v { color: var(--text-1); font-weight: 500; }
.rd-sec-k {
width: 104px; background: var(--primary-light); color: var(--primary);
font-weight: 600; text-align: center; vertical-align: top; padding-top: 12px;
}
.rd-sec-v { text-align: left; white-space: pre-wrap; }
.rv-legend .btn { margin-left: 6px; }
/* ============ 学习路径 ============ */
.path-layout { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .path-layout { grid-template-columns: 1fr; } }
.path-side { position: sticky; top: 16px; }
.form-item { margin-bottom: 16px; }
.form-label { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 500; color: var(--text-1); margin-bottom: 8px; }
.form-label-tip { font-size: 12px; font-weight: 400; color: var(--text-3); }
.w-full { width: 100%; }
.skill-pool { max-height: 300px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; background: var(--bg-hover); }
.pool-group + .pool-group { margin-top: 10px; }
.pool-group-title { font-size: 12px; color: var(--text-3); margin-bottom: 6px; }
.pool-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pool-chip {
cursor: pointer; user-select: none; font-size: 12px; padding: 3px 10px;
border: 1px solid var(--border-dark); border-radius: 999px; background: #fff; color: var(--text-2);
transition: all .15s;
}
.pool-chip:hover { border-color: var(--primary); color: var(--primary); }
.pool-chip.known { background: var(--success-light); border-color: var(--success); color: var(--success); }
.pool-chip.known::before { content: "✓ "; }
.pool-loading { font-size: 12px; color: var(--text-3); padding: 8px 2px; }
.seg { display: flex; border: 1px solid var(--border-dark); border-radius: var(--radius-sm); overflow: hidden; }
.seg-item { flex: 1; padding: 7px 0; border: none; background: #fff; color: var(--text-2); font-size: 13px; cursor: pointer; }
.seg-item + .seg-item { border-left: 1px solid var(--border); }
.seg-item.active { background: var(--primary); color: #fff; }
.path-summary { background: var(--bg-hover); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 16px; }
.path-summary-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.path-summary-row b { color: var(--text-1); font-variant-numeric: tabular-nums; }
.progress { height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; margin: 8px 0 4px; }
.progress-bar { height: 100%; border-radius: 3px; background: var(--primary); transition: width .3s; }
.path-summary-tip { font-size: 12px; color: var(--text-3); }
.btn-block { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn-block svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.path-overview { display: flex; gap: 24px; flex-wrap: wrap; border: 1px solid var(--border); border-radius: var(--radius); background: var(--primary-light); padding: 14px 18px; margin-bottom: 16px; }
.po-item { font-size: 12px; color: var(--text-2); }
.po-item b { display: block; font-size: 20px; color: var(--text-1); font-variant-numeric: tabular-nums; margin-top: 2px; }
.po-item .po-primary { color: var(--primary); }
.po-progress { flex: 1; min-width: 160px; align-self: center; }
.po-progress .path-summary-tip { text-align: right; }
.path-flow { display: flex; flex-direction: column; gap: 0; }
.stage-card { position: relative; display: flex; gap: 14px; padding: 16px 16px 20px 0; }
.stage-card:not(:last-child)::before {
content: ""; position: absolute; left: 19px; top: 44px; bottom: -2px; width: 2px; background: var(--border);
}
.stage-card.done .stage-body { opacity: .55; }
.stage-no {
width: 40px; height: 40px; border-radius: 50%; flex: none; z-index: 1;
background: var(--primary); color: #fff; font-weight: 600;
display: inline-flex; align-items: center; justify-content: center; font-size: 16px;
}
.stage-card.done .stage-no { background: var(--success); }
.stage-body { flex: 1; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; padding: 14px 16px; }
.stage-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.stage-title { font-weight: 600; }
.stage-weeks { font-size: 12px; color: var(--primary); background: var(--primary-light); border-radius: 999px; padding: 2px 10px; }
.stage-prereq { font-size: 12px; color: var(--text-3); margin-bottom: 8px; }
.stage-skills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.stage-skills .tag { cursor: pointer; }
.stage-skills .tag:hover { background: var(--primary); color: #fff; }
.stage-meta { display: flex; gap: 18px; font-size: 12px; color: var(--text-2); flex-wrap: wrap; }
.stage-meta b { color: var(--text-1); font-weight: 500; }
.stage-task { margin-top: 8px; font-size: 12px; background: var(--bg-hover); border-radius: var(--radius-sm); padding: 8px 10px; color: var(--text-2); }
.stage-acc { margin-top: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-hover); }
.stage-acc > summary {
cursor: pointer; padding: 8px 12px; font-size: 12px; color: var(--primary);
user-select: none; list-style: none;
}
.stage-acc > summary::before { content: "▸ "; }
.stage-acc[open] > summary::before { content: "▾ "; }
.stage-acc > summary:hover { color: var(--primary-hover); }
.acc-block { padding: 0 12px 12px; }
.acc-title { font-size: 12px; font-weight: 600; color: var(--text-1); margin: 8px 0 4px; }
.acc-deliverable { font-size: 12px; color: var(--text-2); background: #fff; border-left: 3px solid var(--primary); border-radius: 2px; padding: 6px 10px; line-height: 1.6; }
.acc-list { margin: 0; padding: 0; list-style: none; }
.acc-list li { display: flex; gap: 8px; font-size: 12px; color: var(--text-2); line-height: 1.6; padding: 3px 0; }
.acc-no {
flex: none; min-width: 18px; height: 18px; border-radius: 50%; margin-top: 1px;
background: var(--primary-light); color: var(--primary); font-size: 11px;
display: inline-flex; align-items: center; justify-content: center; padding: 0 4px;
}
.acc-list.quiz .acc-no { background: var(--warning-light); color: var(--warning); }
.stage-foot { margin-top: 10px; display: flex; justify-content: flex-end; }
.stage-check { font-size: 12px; }
.path-done { text-align: center; padding: 40px; color: var(--success); font-size: 15px; }
/* ============ 弹窗 / Toast ============ */
.modal-mask {
position: fixed; inset: 0; background: rgba(29, 33, 41, 0.45);
display: flex; align-items: center; justify-content: center; z-index: 500;
}
.modal {
width: 560px; max-width: calc(100vw - 48px); max-height: 82vh;
background: #fff; border-radius: var(--radius);
box-shadow: var(--shadow-pop); display: flex; flex-direction: column;
}
.modal-head {
display: flex; align-items: center; justify-content: space-between;
padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 15px; }
.modal-body { padding: 18px; overflow-y: auto; font-size: 13px; line-height: 1.7; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.jd-evidence { background: var(--bg-hover); border-radius: var(--radius); padding: 12px 14px; white-space: pre-wrap; max-height: 300px; overflow-y: auto; font-size: 12.5px; color: var(--text-2); }
.jd-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); margin-bottom: 10px; }
.toast-wrap { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 600; display: flex; flex-direction: column; gap: 8px; }
.toast {
background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm);
box-shadow: var(--shadow-pop); padding: 9px 16px; font-size: 13px;
display: flex; align-items: center; gap: 8px; animation: toast-in 0.2s;
}
.toast.success { border-color: #b7eb8f; color: var(--success); }
.toast.error { border-color: #ffa39e; color: var(--danger); }
.toast.info { border-color: #d6e4ff; color: var(--primary); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #c9cdd4; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #a9aeb8; }
::-webkit-scrollbar-track { background: transparent; }
/* ============ 离线回退横幅 / 系统设置 ============ */
.offline-banner {
height: 40px; display: flex; align-items: center; gap: 10px;
padding: 0 20px; font-size: 13px;
background: var(--warning-light); color: #ad4e00;
border-bottom: 1px solid #ffd591;
}
.offline-banner svg { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.offline-banner b { font-weight: 600; }
.banner-btn {
margin-left: auto; flex: none; border: 1px solid #ad4e00; background: #fff;
color: #ad4e00; border-radius: var(--radius-sm); padding: 2px 12px; font-size: 12px; cursor: pointer;
}
.banner-btn:hover { background: #ad4e00; color: #fff; }
.banner-close { flex: none; border: none; background: transparent; font-size: 16px; color: #ad4e00; cursor: pointer; padding: 0 4px; }
.has-banner .shell { height: calc(100vh - var(--topbar-h) - var(--topnav-h) - 40px); }
.cfg-status { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); margin-bottom: 14px; }
.cfg-warn { background: var(--warning-light); color: #ad4e00; border-radius: var(--radius-sm); padding: 8px 12px; font-size: 13px; margin-bottom: 14px; }
.cfg-sec { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px 4px; margin-bottom: 14px; }
.cfg-sec-title { font-size: 13px; font-weight: 600; color: var(--text-1); margin-bottom: 12px; }
.cfg-token-row { display: flex; gap: 8px; }
.cfg-token-row .input { flex: 1; }
/* 双横幅堆叠与权重引导 */
.has-banner2 .shell { height: calc(100vh - var(--topbar-h) - var(--topnav-h) - 80px); }
#embed-banner { border-top: 1px solid #ffd591; }
.cfg-guide {
background: var(--bg-hover); border-radius: var(--radius-sm);
padding: 10px 14px; font-size: 12px; color: var(--text-2); margin-bottom: 14px;
}
.cfg-guide b { color: var(--text-1); }
.cfg-guide ol { margin: 6px 0 0; padding-left: 18px; }
.cfg-guide li { line-height: 1.9; }
.cfg-guide code {
background: #fff; border: 1px solid var(--border); border-radius: 3px;
padding: 0 5px; font-family: Consolas, monospace; font-size: 11px; color: var(--primary);
}
/* 设置弹窗加宽 */
.modal.wide { width: 780px; }
/* 卡片内图表画布默认占满宽度(防 300px 默认宽挤压) */
.card-body > canvas { display: block; width: 100%; height: 100%; min-height: 200px; }
.card-body:has(> canvas:only-child) { min-height: 260px; }
/* 岗位演化页:统计条 / 时点对比 / 限高 */
.evo-stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.evo-stat {
flex: 1; min-width: 120px; background: var(--bg-hover); border-radius: var(--radius);
padding: 10px 14px; display: flex; flex-direction: column; gap: 2px;
}
.evo-stat span { font-size: 12px; color: var(--text-3); }
.evo-stat b { font-size: 20px; color: var(--text-1); font-variant-numeric: tabular-nums; }
.evo-compare { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 16px; }
.evo-compare-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.evo-dates { display: flex; align-items: center; gap: 8px; }
.evo-dates .input { width: 150px; }
.diff-meta { font-size: 12px; color: var(--text-3); margin-bottom: 10px; }
.diff-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 1100px) { .diff-grid { grid-template-columns: 1fr; } }
.diff-col { background: var(--bg-hover); border-radius: var(--radius-sm); padding: 10px 12px; }
.diff-title { font-size: 12px; font-weight: 600; color: var(--text-1); margin-bottom: 8px; }
.diff-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.diff-chip { cursor: pointer; }
.diff-chip:hover { filter: brightness(0.92); }
.diff-chip i { font-style: normal; margin-left: 3px; color: var(--primary); font-weight: 700; }
.evo-heat-wrap { max-height: 260px; max-width: 920px; margin: 0 auto 16px; }
.evo-heat-wrap canvas { max-height: 260px; }
.timeline { max-height: 420px; overflow-y: auto; }
/* 批量匹配 */
.match-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.match-tab {
border: none; background: transparent; padding: 8px 18px; font-size: 14px;
color: var(--text-2); cursor: pointer; position: relative;
}
.match-tab:hover { color: var(--primary); }
.match-tab.active { color: var(--primary); font-weight: 600; }
.match-tab.active::after {
content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px;
height: 3px; border-radius: 2px 2px 0 0; background: var(--primary);
}
.dropzone {
border: 2px dashed var(--border-dark); border-radius: var(--radius);
padding: 28px 20px; text-align: center; color: var(--text-2);
transition: all .15s; margin-bottom: 12px;
}
.dropzone.over { border-color: var(--primary); background: var(--primary-light); }
.dropzone svg { width: 34px; height: 34px; stroke: var(--text-3); fill: none; stroke-width: 1.5; margin-bottom: 8px; }
.dropzone.over svg { stroke: var(--primary); }
.dropzone-btns { display: flex; gap: 10px; justify-content: center; margin: 10px 0; }
.batch-filelist { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.batch-file {
display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
border: 1px solid var(--border); border-radius: 999px; padding: 3px 6px 3px 12px; background: #fff;
}
.batch-file i { color: var(--text-3); font-style: normal; }
.batch-file button {
border: none; background: var(--bg-page); border-radius: 50%; width: 18px; height: 18px;
cursor: pointer; color: var(--text-3); line-height: 1;
}
.batch-file button:hover { background: var(--danger-light); color: var(--danger); }
.batch-summary { font-size: 13px; color: var(--text-2); margin: 8px 0 10px; }
.batch-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.batch-table th {
text-align: left; padding: 8px 10px; background: var(--bg-hover);
color: var(--text-2); font-weight: 500; border-bottom: 1px solid var(--border);
}
.batch-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.batch-table tr.batch-err td { color: var(--text-3); background: var(--bg-hover); }
.batch-score { display: flex; align-items: center; gap: 8px; min-width: 140px; }
.batch-score-bar { height: 6px; border-radius: 3px; background: var(--primary); max-width: 90px; }
.batch-score b { font-variant-numeric: tabular-nums; }
.text-ok { color: var(--success); }
.text-bad { color: var(--danger); }
/* 统一系统弹窗(sysDialog) */
.sysdlg-mask {
position: fixed; inset: 0; background: rgba(29, 33, 41, 0.45);
display: flex; align-items: center; justify-content: center; z-index: 700;
}
.sysdlg {
width: 420px; max-width: calc(100vw - 48px);
background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-pop);
padding: 18px 20px;
}
.sysdlg-title { font-size: 15px; font-weight: 600; color: var(--text-1); margin-bottom: 12px; }
.sysdlg-body { margin-bottom: 16px; }
.sysdlg-label { font-size: 13px; color: var(--text-2); margin-bottom: 8px; }
.sysdlg-text { font-size: 13px; color: var(--text-1); line-height: 1.7; }
.sysdlg-input { width: 100%; }
.sysdlg-foot { display: flex; justify-content: flex-end; gap: 10px; }
/* 首次引导欢迎块 */
.cfg-welcome {
background: var(--primary-light); border-left: 3px solid var(--primary);
border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13px;
color: var(--text-1); line-height: 1.9; margin-bottom: 14px;
}
/* 全部岗位演化热力图 */
.evo-heatmap { margin-bottom: 16px; overflow-x: auto; }
.hm-grid { display: grid; gap: 2px; min-width: 720px; align-items: center; }
.hm-corner { height: 18px; }
.hm-col-label { font-size: 10px; color: var(--text-3); text-align: center; height: 18px; line-height: 18px; white-space: nowrap; }
.hm-row-label {
font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden;
text-overflow: ellipsis; cursor: pointer; padding: 2px 6px 2px 0; text-align: right;
}
.hm-row-label:hover { color: var(--primary); font-weight: 600; }
.hm-row-label.active { color: var(--primary); font-weight: 600; }
.hm-row-label.active::before { content: "▸ "; }
.hm-cell { height: 16px; border-radius: 2px; }
.hm-cell:hover { outline: 1.5px solid var(--primary); }
.hm-legend { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-3); margin-top: 6px; }
.hm-legend .hm-l { width: 14px; height: 10px; border-radius: 2px; display: inline-block; }
.hm-legend .text-weak { margin-left: 10px; }
/* 热度走势图限宽居中(标题对齐) */
.evo-chart-title:has(+ .evo-heat-wrap) { max-width: 920px; margin-left: auto; margin-right: auto; }
/* 一键配置进度 */
.setup-progress { margin-top: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--bg-hover); }
.setup-stage { font-size: 13px; font-weight: 600; color: var(--primary); margin-bottom: 6px; }
.setup-log { font-size: 11px; color: var(--text-3); white-space: pre-wrap; font-family: Consolas, monospace; }
#cfg-embed-setup:disabled { opacity: .6; cursor: not-allowed; }
/* 一键配置主按钮区 */
.setup-hero {
border: 1px solid #d6e4ff; background: var(--primary-light);
border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px;
}
.setup-hero .btn { width: 100%; }
.setup-hero-desc { font-size: 12px; color: var(--text-2); line-height: 1.9; margin-top: 10px; }
.setup-hero-desc b { color: var(--primary); }
.setup-hero .setup-progress { margin-top: 10px; background: #fff; }
/* 变更类型堆叠柱状图例 */
.stack-legend { display: flex; gap: 14px; justify-content: center; font-size: 11px; color: var(--text-2); margin: 4px 0 14px; }
.stack-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin-right: 4px; }
/* 技能生命周期甘特图 */
.evo-gantt { margin-bottom: 16px; overflow-x: auto; }
.gt-grid { display: grid; gap: 2px; min-width: 760px; align-items: center; }
.gt-label {
font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden;
text-overflow: ellipsis; cursor: pointer; text-align: right; padding-right: 6px;
}
.gt-label:hover { color: var(--primary); font-weight: 600; }
.gt-cell { position: relative; height: 16px; display: flex; align-items: center; }
.gt-bar { position: absolute; left: 0; right: 0; height: 10px; border-radius: 2px; opacity: .75; }
.gt-dot {
position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
width: 8px; height: 8px; border-radius: 50%; border: 1px solid #fff; z-index: 1;
}
/* 页脚联系信息(文档流,位于所有内容之后) */
.app-footer {
margin-top: 24px; padding: 10px 0 4px; text-align: center;
font-size: 12px; color: var(--text-3);
border-top: 1px solid var(--border);
user-select: text;
}