:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --sidebar: #1e293b;
  --sidebar-hover: #334155;
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --green: #16a34a;
  --green-bg: #dcfce7;
  --amber: #d97706;
  --amber-bg: #fef3c7;
  --red: #dc2626;
  --red-bg: #fee2e2;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 1px 2px rgba(15, 23, 42, .06);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }

/* 布局 */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; background: var(--sidebar); color: #cbd5e1;
  display: flex; flex-direction: column; flex-shrink: 0; overflow-y: auto;
}
.sidebar .brand {
  padding: 18px 20px; font-size: 17px; font-weight: 700; color: #fff;
  border-bottom: 1px solid #334155; display: flex; align-items: center; gap: 8px;
}
.sidebar .brand .logo { width: 28px; height: 28px; background: var(--primary); border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.sidebar nav { padding: 10px 0; flex: 1; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px; padding: 11px 20px;
  color: #cbd5e1; cursor: pointer; border-left: 3px solid transparent; font-size: 14px;
}
.sidebar nav a:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar nav a.active { background: var(--sidebar-hover); color: #fff; border-left-color: var(--primary); }
.side-group-title { padding: 16px 20px 4px; font-size: 11px; letter-spacing: .08em; color: #64748b; text-transform: uppercase; }
.side-group { padding: 0 0 4px; }
.side-group-label { padding: 8px 20px 2px; font-size: 12px; color: #94a3b8; font-weight: 600; }
.sidebar .side-group a {
  display: flex; align-items: center; gap: 10px; padding: 8px 20px 8px 28px;
  color: #cbd5e1; cursor: pointer; border-left: 3px solid transparent; font-size: 13px;
}
.sidebar .side-group a:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar .side-group a.active { background: var(--sidebar-hover); color: #fff; border-left-color: var(--primary); }
.sidebar .side-foot { padding: 14px 20px; border-top: 1px solid #334155; font-size: 12px; color: #94a3b8; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 56px; background: var(--card); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
}
.topbar .title { font-size: 16px; font-weight: 600; }
.topbar .user { display: flex; align-items: center; gap: 12px; }
.topbar .user .name { font-weight: 600; }
.topbar .user .role { font-size: 12px; color: var(--muted); background: var(--bg); padding: 2px 8px; border-radius: 10px; }
.content { padding: 24px; overflow-y: auto; }

/* 卡片 */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.card h2 { font-size: 16px; margin-bottom: 14px; }
.card h3 { font-size: 14px; margin: 6px 0 10px; color: var(--muted); }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.stat { flex: 1; min-width: 140px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 18px; box-shadow: var(--shadow); }
.stat .num { font-size: 26px; font-weight: 700; color: var(--primary); }
.stat .label { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* 表格 */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
th { color: var(--muted); font-weight: 600; background: #f8fafc; }
tbody tr:hover { background: #f8fafc; }

/* 候选人库表格：防止姓名/年限/操作被挤成竖排 */
.cand-table { min-width: 880px; table-layout: fixed; }
.cand-table th, .cand-table td { vertical-align: middle; }
.cand-table th:nth-child(1), .cand-table td:nth-child(1) { width: 90px; white-space: nowrap; }
.cand-table th:nth-child(2), .cand-table td:nth-child(2) { width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cand-table th:nth-child(3), .cand-table td:nth-child(3) { width: auto; }
.cand-table th:nth-child(4), .cand-table td:nth-child(4) { width: 70px; text-align: center; white-space: nowrap; }
.cand-table th:nth-child(5), .cand-table td:nth-child(5) { width: 90px; text-align: center; white-space: nowrap; }
.cand-table .tag { margin: 2px 4px 2px 0; }
.cand-table td:nth-child(3) .tag-wrap { display: flex; flex-wrap: wrap; gap: 4px 6px; max-height: 68px; overflow-y: auto; }

/* 表单 */
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
input, select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--text);
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }
.field-row { display: flex; gap: 12px; }
.field-row > div { flex: 1; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border: none;
  border-radius: 8px; background: var(--primary); color: #fff; font-size: 14px;
  cursor: pointer; font-family: inherit; transition: background .15s;
}
.btn:hover { background: var(--primary-dark); }
.btn.secondary { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn.secondary:hover { background: #f8fafc; }
.btn.danger { background: var(--red); }
.btn.danger:hover { background: #b91c1c; }
.btn.warning { background: #f59e0b; color: #fff; }
.btn.warning:hover { background: #d97706; }
.btn.warning:disabled { background: #fbbf24; cursor: not-allowed; }
.btn.small { padding: 5px 11px; font-size: 12px; }
.btn.link { background: #eff6ff; color: var(--primary); border: 1px solid #bfdbfe; }
.btn.link:hover { background: #dbeafe; }
.btn.ghost { background: #fff; color: var(--muted); border: 1px solid var(--border); }
.btn.ghost:hover { background: #f8fafc; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.actions { display: flex; gap: 8px; margin-top: 14px; align-items: center; }
.toolbar { display: flex; gap: 10px; align-items: flex-end; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .field { min-width: 200px; }

/* 徽章 */
.badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.amber { background: var(--amber-bg); color: var(--amber); }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.gray { background: #e2e8f0; color: #475569; }
.tag { display: inline-block; background: #eff6ff; color: var(--primary); border-radius: 6px; padding: 1px 8px; font-size: 12px; margin: 2px 4px 2px 0; }
.tag.gray { background: #f1f5f9; color: #475569; }

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1e293b 0%, #2563eb 100%); }
.login-card { background: #fff; border-radius: 14px; padding: 36px; width: 360px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.login-card .brand { font-size: 20px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.login-card .brand .logo { width: 34px; height: 34px; background: var(--primary); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #fff; }
.login-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.login-card .btn { width: 100%; justify-content: center; margin-top: 18px; }
.wecom-box { margin-top: 18px; }
.wecom-divider { display: flex; align-items: center; color: var(--muted); font-size: 12px; margin: 16px 0 10px; }
.wecom-divider::before, .wecom-divider::after { content: ''; flex: 1; height: 1px; background: #e5e7eb; }
.wecom-divider span { padding: 0 10px; }
.wecom-btn { width: 100%; justify-content: center; background: #07c160; border-color: #07c160; color: #fff; }
.wecom-btn:hover { background: #06ad56; }
.wecom-dev { display: flex; gap: 8px; }
.wecom-dev input { flex: 1; }
.login-note { background: var(--amber-bg); color: var(--amber); padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }

/* 杂项 */
.toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); background: #0f172a; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 14px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 999; }
.toast.show { opacity: 1; }
.toast.err { background: var(--red); }
.toast.ok { background: #16a34a; }
.toast.warn { background: #d97706; }
.muted { color: var(--muted); }
.empty { color: var(--muted); text-align: center; padding: 30px; }
.result-box { background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; padding: 16px; margin-top: 12px; }
.score-num { font-size: 30px; font-weight: 700; }
.q-item { border: 1px solid var(--border); border-radius: 8px; padding: 14px; margin-bottom: 12px; }
.q-item .q-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.q-item .q-title { font-weight: 600; }
.q-meta { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 6px; }
.q-scenario { margin-top: 8px; padding: 8px 10px; background: #f5f3ff; border-left: 3px solid #7c3aed; border-radius: 6px; font-size: 13px; color: #3b2f63; line-height: 1.6; }
.dim { display: flex; gap: 16px; flex-wrap: wrap; margin: 8px 0; }
.dim .d { font-size: 13px; }
.dim .d b { color: var(--primary); }
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: flex; align-items: center; justify-content: center; z-index: 500; }
.modal { background: #fff; border-radius: 12px; padding: 24px; width: 600px; max-width: 94vw; max-height: 88vh; overflow-y: auto; }
.modal h2 { margin-bottom: 8px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.tbl { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 13px; }
.tbl th, .tbl td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: middle; }
.tbl th { background: #f8fafc; color: var(--muted); font-weight: 600; }
.tbl tr:hover td { background: #fcfdff; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.pill { font-size: 12px; padding: 2px 9px; border-radius: 12px; background: #eef2ff; color: #4338ca; }
.pill.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.pill { cursor: default; }

/* ===== V3.0 对齐原型补充样式 ===== */
.tag.blue { background: #eff6ff; color: #2563eb; }
.tag.green { background: #dcfce7; color: #16a34a; }
.tag.orange { background: #ffedd5; color: #ea580c; }
.tag.red { background: #fee2e2; color: #dc2626; }
.tag.purple { background: #ede9fe; color: #7c3aed; }
.tag.teal { background: #ccfbf1; color: #0d9488; }
.up { color: var(--green); } .down { color: var(--red); }
.small { font-size: 12px; } .mt { margin-top: 12px; } .mb { margin-bottom: 10px; }
.flex { display: flex; gap: 10px; align-items: center; } .flex.wrap { flex-wrap: wrap; }
/* 顶栏角色切换 + 模型状态 */
.topbar .title { flex: 1; }
.role-switch { display: flex; background: #eef2f7; border-radius: 18px; padding: 3px; gap: 2px; }
.role-switch button { border: 0; background: transparent; color: var(--muted); padding: 5px 12px; border-radius: 16px; font-size: 12.5px; cursor: pointer; font-family: inherit; }
.role-switch button.on { background: #fff; color: var(--text); font-weight: 700; box-shadow: var(--shadow); }
.ds-status { display: flex; align-items: center; gap: 7px; font-size: 12.5px; background: #ecfdf5; padding: 5px 11px; border-radius: 20px; color: #047857; }
.ds-status .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: pulse 1.6s infinite; }
.ds-status.off { background: #f1f5f9; color: var(--muted); }
.ds-status.off .pulse { background: #94a3b8; animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(22,163,74,.6); } 70% { box-shadow: 0 0 0 7px rgba(22,163,74,0); } 100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); } }
/* KPI 卡（匹配 / 机试） */
.kpi { background: linear-gradient(135deg,#f7f9ff,#eef1ff); border: 1px solid #e3e8ff; border-radius: 12px; padding: 14px 16px; }
.kpi .n { font-size: 22px; font-weight: 800; color: var(--primary); }
.kpi .l { color: var(--muted); font-size: 12px; margin-top: 3px; }
.kpi .t { font-size: 11px; margin-top: 5px; }
.r2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.r3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.r4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
/* 对话气泡 */
.chat { background: #f7f9ff; border: 1px solid var(--border); border-radius: 12px; padding: 14px; max-height: 340px; overflow: auto; }
.msg { padding: 9px 12px; border-radius: 10px; margin-bottom: 9px; font-size: 13px; max-width: 88%; white-space: pre-wrap; }
.msg.ai { background: #eef1ff; color: #28324f; align-self: flex-start; }
.msg.me { background: var(--primary); color: #fff; margin-left: auto; }
/* 沙箱 / 代码区 */
.sandbox { background: #0e1726; color: #7fe7c4; font-family: Consolas, monospace; font-size: 12.5px; padding: 14px; border-radius: 12px; min-height: 200px; max-height: 320px; overflow: auto; white-space: pre-wrap; }
.code-area { width: 100%; min-height: 220px; background: #0e1726; color: #7fe7c4; font-family: Consolas, monospace; font-size: 13px; padding: 14px; border-radius: 12px; border: 1px solid #1d2a3a; resize: vertical; line-height: 1.6; }
.code-in, .code-out { font-family: Consolas, monospace; font-size: 12px; padding: 8px 10px; border-radius: 8px; margin-bottom: 4px; }
.code-in { background: #eef2ff; color: #243b6b; } .code-out { background: #e9fbf0; color: #176d3b; }
/* 上传拖拽区 */
.drop { border: 2px dashed #c7d0e6; border-radius: 14px; padding: 30px; text-align: center; color: var(--muted); background: #fafbff; cursor: pointer; transition: .2s; }
.drop.hover { border-color: var(--primary); background: #f3f5ff; color: var(--primary); }
/* 字段高亮 + 置信度 */
.field-hi { background: #fff7d6; padding: 0 2px; border-radius: 3px; border-bottom: 2px solid #ffce3a; }
.conf { font-size: 11px; padding: 1px 7px; border-radius: 10px; font-weight: 700; }
.conf.hi { background: #dcfce7; color: #16a34a; } .conf.mid { background: #ffedd5; color: #ea580c; } .conf.lo { background: #fee2e2; color: #dc2626; }
/* 机试说明 banner */
.banner { background: #fff7e6; border: 1px solid #ffe0a3; color: #a76a00; padding: 11px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 14px; }
/* 从 JD 提取面板 */
.jd-panel { background: #f6f8ff; border: 1px solid #e0e6f5; border-radius: 12px; padding: 14px; margin-bottom: 18px; }
.jd-panel .panel-head { font-weight: 700; margin-bottom: 10px; color: #2b3a67; }
.jd-panel textarea { width: 100%; min-height: 90px; resize: vertical; border: 1px solid var(--border); border-radius: 8px; padding: 9px; font-size: 13px; font-family: inherit; }
.jd-panel .small { margin: 8px 0 0; }
.jd-panel .ok { color: #16a34a; }
.jd-panel .err { color: #dc2626; }
.jd-panel input[type=file] { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 6px; background: #fff; font-size: 12px; }
/* 大模型返回的 Markdown 渲染 */
.md { line-height: 1.7; word-break: break-word; }
.md h1, .md h2, .md h3, .md h4 { margin: 10px 0 6px; line-height: 1.35; font-weight: 700; color: #1f2d3d; }
.md h1 { font-size: 19px; } .md h2 { font-size: 17px; } .md h3 { font-size: 15px; } .md h4 { font-size: 13.5px; color: #46556b; }
.md p { margin: 6px 0; }
.md ul, .md ol { margin: 6px 0; padding-left: 22px; }
.md li { margin: 3px 0; }
.md code { background: #eef1f8; border: 1px solid #e2e7f2; border-radius: 5px; padding: 1px 5px; font-family: Consolas, monospace; font-size: 12.5px; color: #c0392b; }
.md pre { background: #0e1726; color: #d6f5e6; border-radius: 10px; padding: 12px 14px; overflow: auto; margin: 8px 0; }
.md pre code { background: none; border: none; color: inherit; padding: 0; }
.md blockquote { border-left: 3px solid var(--primary); background: #f3f5ff; margin: 8px 0; padding: 6px 12px; color: #46556b; border-radius: 0 8px 8px 0; }
.md hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.md a { color: var(--primary); text-decoration: underline; }

/* 冰山胜任力编辑 */
.comp-list { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; max-height: 340px; overflow-y: auto; padding: 2px 4px 2px 0; }
.comp-list::-webkit-scrollbar { width: 8px; }
.comp-list::-webkit-scrollbar-thumb { background: #d6dbe6; border-radius: 8px; }
/* ===== 新增/编辑岗位弹窗（三段式分区重构） ===== */
.modal.pos-modal { width: 760px; max-width: 96vw; max-height: 92vh; padding: 0; display: flex; flex-direction: column; }
.modal.pos-modal .pm-head { padding: 22px 28px 16px; border-bottom: 1px solid var(--border); }
.modal.pos-modal .pm-head h2 { margin: 0; font-size: 18px; }
.modal.pos-modal .pm-sub { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.modal.pos-modal .pm-body { padding: 18px 28px 8px; overflow-y: auto; flex: 1; min-height: 0; }
.modal.pos-modal .pm-foot { padding: 14px 28px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; background: #fff; }

.pm-sec { background: #fafbfc; border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; margin-top: 18px; }
.pm-sec:first-child { margin-top: 0; }
.pm-sec-jd { background: #f0f6ff; border-color: #d6e4ff; }
.pm-sec-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 700; font-size: 15px; color: #1f2a44; }
.pm-sec-tip { font-weight: 400; font-size: 12px; color: var(--muted); }
.pm-sec-note { margin: 0 0 12px; font-size: 12px; color: var(--muted); line-height: 1.6; }

.pf { display: flex; flex-direction: column; margin-top: 14px; }
.pf:first-child { margin-top: 0; }
.pf > label { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.pm-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 14px; }
.pm-grid3 .pf { margin-top: 0; }
.pm-inline { display: flex; gap: 12px; align-items: flex-end; }
.pm-inline > .pf { margin-top: 0; flex: 1; }
.pm-inline > button { flex: none; white-space: nowrap; }
.pm-jdhint { margin: 12px 0 0; font-size: 12px; color: var(--muted); }
.pm-jdhint.ok { color: #16a34a; }
.pm-jdhint.err { color: #dc2626; }

/* 弹窗内统一输入控件 */
.modal.pos-modal input, .modal.pos-modal textarea, .modal.pos-modal select { width: 100%; box-sizing: border-box; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-family: inherit; background: #fff; transition: border-color .15s, box-shadow .15s; }
.modal.pos-modal input:focus, .modal.pos-modal textarea:focus, .modal.pos-modal select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47,111,237,.12); }
.modal.pos-modal textarea { resize: vertical; line-height: 1.5; }

/* 胜任力卡片 */
.comp-list .comp-card { margin-top: 12px; }
.comp-list .comp-card:first-child { margin-top: 0; }
.comp-card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.cc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.cc-idx { font-size: 12px; font-weight: 700; color: var(--muted); background: #eef2f7; border-radius: 6px; padding: 4px 9px; flex: none; }
.cc-head .c-name { flex: 1; min-width: 0; }
.cc-badge { font-size: 11px; padding: 4px 10px; border-radius: 12px; flex: none; font-weight: 600; }
.cc-badge.above_water { background: #e0f2fe; color: #0369a1; }
.cc-badge.under_water { background: #ede9fe; color: #6d28d9; }
.comp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.comp-grid .f { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.comp-grid .f label { font-size: 12px; color: var(--muted); margin: 0; }
.comp-grid .span2 { grid-column: 1 / -1; }
.pm-comp-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.pm-comp-summary { margin-top: 10px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.comp-list .muted { font-size: 12px; color: var(--muted); }

/* HR 首面 */
.hr-item { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin: 12px 0; }
.hr-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.hr-head b { font-size: 15px; }
.star-row { display: flex; gap: 4px; font-size: 22px; color: #d1d5db; cursor: pointer; user-select: none; }
.star-row .star.on { color: #f59e0b; }
.hr-item textarea { width: 100%; margin-top: 8px; }
.hr-item .panel { margin-top: 10px; background: #f7f9ff; border: 1px solid #e0e6f5; }

/* 系统参数 */
.param-row { display: grid; grid-template-columns: 1fr 220px; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.param-row:last-child { border-bottom: none; }
.param-row input { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }

/* 开关（大模型开关等） */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; cursor: pointer; inset: 0; background: #cbd5e1; border-radius: 24px; transition: .2s; }
.switch .slider:before { content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider:before { transform: translateX(20px); }

/* 系统设置 - 功能模块入口 */
.mod-group { margin: 14px 0; }
.mod-title { font-size: 13px; color: var(--muted); margin: 0 0 8px; font-weight: 600; }
.mod-links { display: flex; flex-wrap: wrap; gap: 10px; }
.mod-link { display: inline-flex; align-items: center; gap: 4px; padding: 8px 14px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; color: var(--text); text-decoration: none; font-size: 14px; transition: .15s; }
.mod-link:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 通知中心与面试官选择 */
.icon-btn { background: transparent; border: none; cursor: pointer; font-size: 18px; position: relative; padding: 6px; border-radius: 8px; }
.icon-btn:hover { background: var(--bg); }
.bell { line-height: 1; }
.red-dot { position: absolute; top: 2px; right: 2px; width: 8px; height: 8px; border-radius: 50%; background: #ef4444; border: 2px solid var(--card); display: none; }
.iv-select { padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; min-width: 140px; }
.notif-item { padding: 14px; border-bottom: 1px solid var(--border); cursor: pointer; transition: .1s; }
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: #eff6ff; border-left: 3px solid var(--primary); }
.notif-item.read { opacity: .75; }
.notif-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.notif-title { font-weight: 600; }
.notif-body { margin-bottom: 6px; color: var(--text); }
.notif-meta { margin-bottom: 4px; }
.notif-actions { margin-top: 8px; }
.lnk { color: var(--primary); cursor: pointer; font-weight: 600; text-decoration: none; }
.lnk:hover { text-decoration: underline; }

/* 面试流程编辑器 */
.btn.tiny { padding: 2px 8px; font-size: 12px; }
.plan-rounds { display: flex; flex-direction: column; gap: 12px; }
.plan-round { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--bg); }
.pr-head { display: flex; align-items: center; gap: 10px; }
.pr-seq { font-weight: 700; color: var(--primary); font-size: 14px; white-space: nowrap; }
.pr-name { flex: 1; font-weight: 600; }
.pr-tools { margin-left: auto; display: flex; gap: 4px; }
.pr-body { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.pr-field { display: flex; flex-direction: column; gap: 4px; }
.pr-field > label { font-size: 12px; color: var(--muted); }
.iv-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.iv-tag { display: inline-flex; align-items: center; gap: 4px; background: #eef2ff; color: #4338ca; border-radius: 6px; padding: 2px 8px; font-size: 12px; }
.iv-x { color: #6b7280; cursor: pointer; font-weight: 700; }
.iv-x:hover { color: var(--red); }
.iv-add { width: 180px; padding: 3px 8px; font-size: 12px; }
.chk { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.badge.final { background: #fef3c7; color: #b45309; }

/* 候选人详情 - 流转步骤条 */
.stepper { display: flex; align-items: center; flex-wrap: wrap; gap: 0; padding: 6px 0 2px; }
.step { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.step .dot { width: 16px; height: 16px; border-radius: 50%; background: #e2e8f0; border: 2px solid #cbd5e1; flex: 0 0 auto; }
.step .lbl { white-space: nowrap; }
.step.done .dot { background: var(--green); border-color: var(--green); }
.step.done .lbl { color: var(--text); }
.step.active .dot { background: var(--primary); border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47,111,237,.18); }
.step.active .lbl { color: var(--primary); font-weight: 700; }
.step.dim .dot { background: #f1f5f9; border-color: #e2e8f0; }
.step.dim .lbl { color: #cbd5e1; }
.sep { flex: 0 0 22px; height: 2px; background: #e2e8f0; margin: 0 2px; }
.step.done + .sep { background: var(--green); }

/* 候选人详情 - 流转动作按钮 */
.btn.red { background: var(--red); color: #fff; border: 1px solid var(--red); }
.btn.red:hover { filter: brightness(.94); }
.btn.green { background: var(--green); color: #fff; border: 1px solid var(--green); }
.btn.green:hover { filter: brightness(.94); }
.flow-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }

/* 候选人详情 - 流转时间线 */
.timeline { margin-top: 6px; border-left: 2px solid var(--border); padding-left: 14px; }
.tl-item { position: relative; padding: 8px 0; }
.tl-item:before { content: ""; position: absolute; left: -19px; top: 14px; width: 9px; height: 9px; border-radius: 50%; background: var(--primary); }
.tl-head { font-size: 14px; }
.tl-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.tl-reason { font-size: 13px; margin-top: 4px; }
.tl-note { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* 候选人详情 - 简历信息 */
.proj { margin: 4px 0 0 18px; padding: 0; }
.proj li { margin: 2px 0; }
.raw { max-height: 220px; overflow: auto; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px; font-size: 12px; white-space: pre-wrap; word-break: break-word; }
.small { font-size: 12px; }

/* 机试与评分 - 浮动「面试结束评分」按钮 */
.fab {
  position: fixed; right: 28px; bottom: 28px; z-index: 60;
  display: none; align-items: center; gap: 6px;
  background: var(--primary); color: #fff; border: none; border-radius: 28px;
  padding: 14px 22px; font-size: 15px; font-weight: 700;
  box-shadow: 0 8px 24px rgba(47,111,237,.35); cursor: pointer;
}
.fab:hover { filter: brightness(.94); }
.fab:active { transform: translateY(1px); }

/* 机试与评分 - 新加题高亮 */
.q-item.flash { animation: qflash 1.3s ease; }
@keyframes qflash {
  0% { box-shadow: 0 0 0 3px rgba(47,111,237,.55); border-radius: 12px; }
  100% { box-shadow: 0 0 0 3px rgba(47,111,237,0); border-radius: 12px; }
}

/* 报表中心 */
.funnel { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.funnel-row { display: flex; align-items: center; gap: 12px; }
.funnel-label { width: 72px; flex: none; font-size: 13px; color: var(--text); text-align: right; }
.funnel-track { flex: 1; background: #f1f5f9; border-radius: 6px; overflow: hidden; height: 22px; }
.funnel-bar { height: 100%; background: linear-gradient(90deg,#3b82f6,#2563eb); border-radius: 6px; min-width: 2px; transition: width .3s; }
.funnel-bar.alt { background: linear-gradient(90deg,#94a3b8,#64748b); }
.funnel-count { width: 36px; flex: none; text-align: left; font-weight: 700; font-size: 14px; }
.funnel-row.terminal .funnel-label { color: var(--muted); }
.tag { display: inline-block; padding: 2px 7px; border-radius: 4px; font-size: 12px; margin: 1px 2px 1px 0; white-space: nowrap; }
.tag.gray { background: #f1f5f9; color: #475569; }
td.dist { line-height: 1.9; }

/* 面试小结页 */
.summary-meta { display: flex; align-items: center; gap: 14px; margin: 10px 0 14px; flex-wrap: wrap; }
.summary-meta .score-num { font-size: 20px; }
.summary-box { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 18px 22px; margin-top: 6px; line-height: 1.75; }
.summary-box h1, .summary-box h2, .summary-box h3 { margin: 14px 0 6px; }
.summary-box h1:first-child, .summary-box h2:first-child, .summary-box h3:first-child { margin-top: 0; }
.summary-box ul { margin: 6px 0; padding-left: 22px; }
.summary-box li { margin: 3px 0; }
.summary-actions { display: flex; gap: 12px; margin-top: 18px; }
.summary-actions .btn.primary { background: var(--primary); color: #fff; border: none; }
.summary-actions .btn.primary:hover { filter: brightness(.95); }

/* 机试页：已结束面试只读横幅 */
.read-only-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412;
  border-radius: 10px; padding: 10px 14px; margin: 10px 0;
  font-size: 14px;
}
.read-only-banner strong { color: #c2410c; }
.read-only-banner .btn.small { margin-left: auto; }

/* ============ 初筛结果报告 ============ */
.rep-card { max-width: 960px; margin: 0 auto; }
.rep-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.rep-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }

.rep-hero { display: flex; gap: 28px; align-items: center; background: linear-gradient(135deg, #f8fafc, #f1f5f9); border: 1px solid var(--border); border-radius: 14px; padding: 22px; margin-bottom: 22px; }
.rep-gauge { text-align: center; flex-shrink: 0; }
.rep-gauge-cap { font-size: 12px; color: var(--muted); margin-top: 2px; }
.rep-hero-main { flex: 1; min-width: 0; }
.rep-decision { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.rep-decision.green { color: var(--green); }
.rep-decision.amber { color: var(--amber); }
.rep-decision.red { color: var(--red); }
.rep-hero-desc { font-size: 14px; line-height: 1.7; color: #334155; }
.rep-override { margin-top: 12px; background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; border-radius: 8px; padding: 8px 12px; font-size: 13px; }

.rep-section-title { font-size: 15px; font-weight: 700; margin: 26px 0 14px; padding-left: 10px; border-left: 4px solid var(--primary); }

.rep-grid { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
.rep-panel { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; }
.radar-panel { display: flex; align-items: center; justify-content: center; }

.rep-dim { margin-bottom: 16px; }
.rep-dim:last-child { margin-bottom: 0; }
.rep-dim-head { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.rep-dim-val { color: var(--text); }
.rep-dim-val .muted { font-weight: 400; font-size: 12px; }
.rep-bar { height: 10px; background: #f1f5f9; border-radius: 6px; overflow: hidden; }
.rep-bar-fill { height: 100%; border-radius: 6px; transition: width .4s ease; }
.rep-bar-fill.g { background: linear-gradient(90deg, #4ade80, #16a34a); }
.rep-bar-fill.a { background: linear-gradient(90deg, #fbbf24, #d97706); }
.rep-bar-fill.r { background: linear-gradient(90deg, #f87171, #dc2626); }
.rep-dim-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 5px; font-size: 12px; }
.rep-w { color: var(--primary); font-weight: 600; white-space: nowrap; }

.rep-skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.rep-skill { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border); font-size: 13px; }
.rep-skill.hit { background: var(--green-bg); border-color: #bbf7d0; }
.rep-skill.miss { background: var(--red-bg); border-color: #fecaca; }
.rep-skill-ic { width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0; }
.rep-skill.hit .rep-skill-ic { background: var(--green); }
.rep-skill.miss .rep-skill-ic { background: var(--red); }
.rep-skill-name { font-weight: 600; flex: 1; }
.rep-skill-tag { font-size: 11px; color: var(--muted); background: #fff; border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; }
.rep-skill-note { flex-basis: 100%; font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.45; }

.rep-comps { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.rep-comp { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; background: #fff; border-top: 3px solid var(--primary); }
.rep-comp.uw { border-top-color: #8b5cf6; }
.rep-comp.aw { border-top-color: #0ea5e9; }
.rep-comp-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.rep-comp-name { font-weight: 700; font-size: 14px; flex: 1; }
.rep-comp-type { font-size: 11px; padding: 1px 7px; border-radius: 4px; background: #ede9fe; color: #6d28d9; }
.rep-comp.uw .rep-comp-type { background: #ede9fe; color: #6d28d9; }
.rep-comp.aw .rep-comp-type { background: #e0f2fe; color: #0369a1; }
.rep-comp-score { font-weight: 700; color: var(--text); }
.rep-comp-score .muted { font-weight: 400; font-size: 12px; }
.rep-comp-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 7px; font-size: 12px; }

.rep-llm { background: #f8fafc; border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: 10px; padding: 14px 16px; }
.rep-llm.local { border-left-color: #94a3b8; background: #f8fafc; }
.rep-llm-head { font-weight: 600; margin-bottom: 8px; font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rep-model { font-size: 11px; font-weight: 400; color: #0369a1; background: #e0f2fe; border: 1px solid #bae6fd; border-radius: 4px; padding: 1px 7px; }
.rep-sub-title { font-weight: 600; margin: 12px 0 6px; font-size: 13px; }
.rep-sub-title.good { color: var(--green); }
.rep-sub-title.warn { color: #d97706; }
.rep-list { margin: 0; padding-left: 20px; }
.rep-list li { margin: 4px 0; line-height: 1.55; font-size: 13px; }
.rep-list.good li::marker { color: var(--green); }
.rep-list.warn li::marker { color: #d97706; }
.rep-foot { margin-top: 24px; padding-top: 14px; border-top: 1px dashed var(--border); line-height: 1.6; }

.rep-qs { display: flex; flex-direction: column; gap: 14px; }
.rep-q { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; background: #fff; }
.rep-q-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.rep-q-idx { background: var(--primary); color: #fff; border-radius: 6px; padding: 1px 8px; font-size: 12px; font-weight: 700; }
.rep-q-title { flex: 1; min-width: 200px; }
.rep-q-val { color: var(--text); font-weight: 700; white-space: nowrap; }
.rep-q-comment { margin-top: 6px; font-size: 13px; line-height: 1.6; }

@media (max-width: 720px) {
  .rep-hero { flex-direction: column; align-items: center; text-align: center; }
  .rep-grid { grid-template-columns: 1fr; }
  .radar-panel { order: -1; }
}

/* 导出 PDF（浏览器打印）：只保留报告本体，隐藏侧栏/导航/按钮等。 */
@media print {
  body * { visibility: hidden; }
  #report-print, #report-print * { visibility: visible; }
  #report-print {
    position: absolute; left: 0; top: 0; width: 100%; max-width: 100%;
    margin: 0; padding: 0; box-shadow: none; border: none; background: #fff;
  }
  .no-print { display: none !important; }
  .rep-card { max-width: 100%; }
  .rep-hero { background: #f8fafc !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rep-bar-fill { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ==================== CFA 基座：Offer 管理 ==================== */

.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; background: #e0e7ff; color: #3730a3; white-space: nowrap; }
.badge.up { background: var(--green-bg); color: var(--green); }
.badge.down { background: var(--red-bg); color: var(--red); }
.badge.pending { background: var(--amber-bg); color: var(--amber); }

.btn.green { background: var(--green); color: #fff; border: none; }
.btn.green:hover { background: #15803d; }
.btn.red { background: var(--red); color: #fff; border: none; }
.btn.red:hover { background: #b91c1c; }
.btn.tiny { padding: 3px 8px; font-size: 12px; }

.flow-actions { display: flex; gap: 8px; margin-top: 10px; }

/* Offer 审批链表单输入 */
#of_chain .field { display: flex; gap: 8px; align-items: center; }
#of_chain .field input { flex: 1; }
#of_chain .field label { flex-shrink: 0; width: 60px; font-size: 13px; color: var(--muted); }

/* ==================== CFA 基座：候选人门户（token 免登录） ==================== */

.portal-app {
  min-height: 100vh; background: var(--bg);
  padding: 0;
}

.portal-header {
  background: var(--sidebar); color: #fff;
  padding: 20px 32px;
}
.portal-header h2 { color: #fff; font-size: 20px; margin-bottom: 8px; }
.portal-meta { display: flex; gap: 20px; flex-wrap: wrap; font-size: 13px; color: #94a3b8; }
.portal-meta span { display: inline-flex; align-items: center; gap: 4px; }

.portal-body {
  max-width: 880px; margin: 24px auto; padding: 0 20px;
}

.portal-question {
  padding: 24px; margin-bottom: 16px;
}
.portal-question .q-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.portal-question .q-tags .badge { background: #e0e7ff; color: #3730a3; }
.portal-question h3 { font-size: 17px; margin-bottom: 12px; }
.portal-question .q-desc { white-space: pre-wrap; line-height: 1.8; color: #334155; margin-bottom: 12px; }
.portal-question .q-constraint { font-size: 13px; color: var(--amber); background: var(--amber-bg); padding: 8px 12px; border-radius: 6px; margin-bottom: 12px; }
.portal-question .q-fn { font-size: 13px; margin-bottom: 8px; }
.portal-question .q-fn code, .portal-question .q-io code { background: #f1f5f9; padding: 2px 6px; border-radius: 3px; font-family: "Fira Code", "Consolas", monospace; font-size: 13px; }
.portal-question .q-io { margin-top: 8px; }
.portal-question .q-io .io-case { margin-bottom: 6px; font-size: 13px; }

.portal-nav {
  display: flex; gap: 12px; justify-content: flex-end; margin-bottom: 24px;
}

.portal-result {
  text-align: center; padding: 40px;
}
.portal-result h2 { font-size: 22px; margin-bottom: 16px; }

.portal-error {
  text-align: center; padding: 60px 20px; max-width: 500px; margin: 40px auto;
}
.portal-error h2 { color: var(--red); margin-bottom: 12px; }
.portal-error p { color: var(--muted); }

/* ==================== 招聘计划 ==================== */

.plan-rounds { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.plan-round { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; min-width: 160px; }

/* ==================== CFA 触达管理 ==================== */

.kv-table { width: 100%; border-collapse: collapse; }
.kv-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); font-size: 13px; }
.kv-table td:first-child { color: var(--muted); white-space: nowrap; width: 100px; }

.audit-timeline { margin-top: 8px; }
.audit-item { transition: background 0.15s; }
.audit-item:hover { background: var(--bg); }

.badge.small { font-size: 11px; padding: 1px 6px; border-radius: 4px; background: var(--bg); color: var(--muted); margin-right: 4px; }

