:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #faf9f5;
  --line: #e4e2da;
  --line-strong: #d3d0c5;
  --text: #1f1f1e;
  --text-2: #5f5e5a;
  --text-3: #8f8d84;
  --blue: #185fa5;
  --blue-bg: #e6f1fb;
  --blue-line: #b5d4f4;
  --green: #3b6d11;
  --green-bg: #eaf3de;
  --green-line: #c0dd97;
  --amber: #854f0b;
  --amber-bg: #faeeda;
  --amber-line: #fac775;
  --red: #a32d2d;
  --red-bg: #fcebeb;
  --red-line: #f7c1c1;
  --gray-bg: #f1efe8;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(31, 31, 30, 0.04), 0 8px 24px rgba(31, 31, 30, 0.05);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; font-size: 14px; color: inherit; }
a { color: var(--blue); text-decoration: none; }

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: var(--shadow);
}
.login-card h1 { font-size: 20px; margin: 0 0 4px; font-weight: 600; letter-spacing: -0.2px; }
.login-card .sub { color: var(--text-2); font-size: 13px; margin-bottom: 24px; }
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 216px;
  flex: 0 0 216px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; letter-spacing: 0.5px;
}
.brand-text { font-size: 14px; font-weight: 600; letter-spacing: -0.2px; }
.brand-sub { font-size: 11px; color: var(--text-3); margin-top: -2px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px; border-radius: 8px;
  color: var(--text-2); cursor: pointer;
  font-size: 13.5px; border: none; background: none; text-align: left; width: 100%;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--blue-bg); color: var(--blue); font-weight: 500; }
.nav-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.5; }
.nav-item.active .nav-dot { opacity: 1; }
.nav-badge {
  margin-left: auto; font-size: 11px; background: var(--gray-bg);
  padding: 0 6px; border-radius: 8px; color: var(--text-2);
}
.nav-item.active .nav-badge { background: #fff; color: var(--blue); }

.sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.who { display: flex; align-items: center; gap: 9px; padding: 4px 8px; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--blue-bg);
  color: var(--blue); display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; flex: 0 0 28px;
}
.who-name { font-size: 13px; font-weight: 500; line-height: 1.2; }
.who-role { font-size: 11px; color: var(--text-3); }

.main { flex: 1; min-width: 0; padding: 26px 30px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-title { font-size: 21px; font-weight: 600; letter-spacing: -0.3px; margin: 0; }
.page-sub { color: var(--text-2); font-size: 13px; margin-top: 3px; }
.head-actions { display: flex; gap: 8px; align-items: center; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text); cursor: pointer;
  font-size: 13.5px; font-weight: 500; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: #134e88; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }
.btn-danger { color: var(--red); border-color: var(--red-line); }
.btn-danger:hover { background: var(--red-bg); }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 15px 16px;
}
.kpi-label { font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.kpi-value { font-size: 26px; font-weight: 600; letter-spacing: -0.5px; margin-top: 4px; line-height: 1.2; }
.kpi-value small { font-size: 12px; font-weight: 400; color: var(--text-3); margin-left: 4px; letter-spacing: 0; }
.kpi-foot { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

.grid-2 { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 16px; align-items: start; }
.grid-2-even { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.card-title { font-size: 13.5px; font-weight: 600; }
.card-sub { font-size: 11.5px; color: var(--text-3); font-weight: 400; margin-left: 6px; }
.card-body { padding: 16px; }
.card-body.tight { padding: 8px 16px 12px; }

.funnel-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.funnel-name { width: 46px; font-size: 12.5px; color: var(--text-2); flex: 0 0 46px; }
.funnel-track { flex: 1; height: 22px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.funnel-fill { height: 100%; border-radius: 5px; transition: width 0.4s ease; }
.funnel-num { width: 34px; text-align: right; font-size: 12.5px; font-variant-numeric: tabular-nums; flex: 0 0 34px; }
.funnel-rate { width: 52px; text-align: right; font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; flex: 0 0 52px; }

.task-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.task-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 16px; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s;
}
.task-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.task-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.task-title { font-size: 14.5px; font-weight: 600; letter-spacing: -0.2px; line-height: 1.4; }
.task-meta { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.task-nums { display: flex; gap: 14px; margin-top: 12px; font-size: 12px; color: var(--text-2); }
.task-nums b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.progress { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; margin-top: 10px; }
.progress > i { display: block; height: 100%; background: var(--blue); border-radius: 3px; }
.progress.done > i { background: var(--green); }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 500;
  border: 1px solid transparent; white-space: nowrap;
}
.badge-open { background: var(--gray-bg); color: var(--text-2); border-color: var(--line-strong); }
.badge-progress { background: var(--blue-bg); color: var(--blue); border-color: var(--blue-line); }
.badge-done { background: var(--green-bg); color: var(--green); border-color: var(--green-line); }
.badge-closed { background: var(--surface-2); color: var(--text-3); border-color: var(--line); }
.badge-red { background: var(--red-bg); color: var(--red); border-color: var(--red-line); }
.badge-amber { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-line); }

.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.input, .select, .textarea {
  width: 100%; padding: 8px 11px; border: 1px solid var(--line-strong);
  border-radius: 8px; background: var(--surface); outline: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-bg); }
.textarea { min-height: 76px; resize: vertical; line-height: 1.6; }
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 5px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }

.search { max-width: 260px; }
.seg { display: flex; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; padding: 2px; }
.seg button {
  border: none; background: none; padding: 5px 11px; border-radius: 6px;
  font-size: 12.5px; color: var(--text-2); cursor: pointer;
}
.seg button.on { background: var(--blue-bg); color: var(--blue); font-weight: 500; }

table.list { width: 100%; border-collapse: collapse; }
table.list th {
  text-align: left; font-size: 11.5px; color: var(--text-3); font-weight: 500;
  padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2);
  white-space: nowrap;
}
table.list td { padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
table.list tr:last-child td { border-bottom: none; }
table.list tbody tr { cursor: pointer; }
table.list tbody tr:hover { background: var(--surface-2); }
.cell-name { font-weight: 500; }
.cell-sub { font-size: 11.5px; color: var(--text-3); }
.mono { font-variant-numeric: tabular-nums; }

.empty {
  padding: 44px 20px; text-align: center; color: var(--text-3); font-size: 13px;
}
.empty b { display: block; color: var(--text-2); font-size: 14px; margin-bottom: 4px; font-weight: 500; }

.overlay {
  position: fixed; inset: 0; background: rgba(31, 31, 30, 0.28);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  /* 必须高于候选人/任务抽屉（60），否则从抽屉里打开的弹窗会被抽屉盖住 */
  z-index: 120;
}
.modal {
  width: 100%; max-width: 520px; background: var(--surface); border-radius: 14px;
  box-shadow: 0 20px 60px rgba(31, 31, 30, 0.2); max-height: 88vh; overflow: auto;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.modal-title { font-size: 15px; font-weight: 600; }
.modal-body { padding: 18px 20px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2);
}
.icon-btn {
  border: none; background: none; cursor: pointer; color: var(--text-3);
  font-size: 18px; line-height: 1; padding: 4px 6px; border-radius: 6px;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.drawer-wrap { position: fixed; inset: 0; z-index: 60; display: flex; justify-content: flex-end; }
.drawer-mask { position: absolute; inset: 0; background: rgba(31, 31, 30, 0.24); }
.drawer {
  position: relative; width: 620px; max-width: 94vw; background: var(--bg);
  height: 100%; box-shadow: -12px 0 40px rgba(31, 31, 30, 0.12);
  display: flex; flex-direction: column; animation: slideIn 0.2s ease;
}
@keyframes slideIn { from { transform: translateX(24px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.drawer-head {
  padding: 16px 22px; background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.drawer-body { flex: 1; overflow: auto; padding: 18px 22px 40px; }

.section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; }
.section-head {
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.section-title { font-size: 13px; font-weight: 600; }
.section-body { padding: 14px 16px; }

.kv { display: grid; grid-template-columns: 90px 1fr; gap: 8px 12px; font-size: 13px; }
.kv dt { color: var(--text-3); font-size: 12.5px; }
.kv dd { margin: 0; }

.stage-bar { display: flex; gap: 4px; margin: 4px 0 12px; }
.stage-step {
  flex: 1; text-align: center; font-size: 11px; padding: 6px 2px;
  border-radius: 6px; background: var(--surface-2); color: var(--text-3);
  border: 1px solid transparent;
}
.stage-step.done { background: var(--green-bg); color: var(--green); border-color: var(--green-line); }
.stage-step.current { background: var(--blue); color: #fff; font-weight: 500; }
.stage-step.rejected { background: var(--red-bg); color: var(--red); border-color: var(--red-line); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 18px; border-left: 1px solid var(--line); }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -3.5px; top: 6px; width: 6px; height: 6px;
  border-radius: 50%; background: var(--line-strong);
}
.timeline li.hot::before { background: var(--blue); }
.tl-time { font-size: 11px; color: var(--text-3); }
.tl-text { font-size: 12.5px; }

.interview-item { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.interview-item:last-child { border-bottom: none; }
.interview-top { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.interview-note { font-size: 12.5px; color: var(--text-2); margin-top: 4px; white-space: pre-wrap; }

.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%) translateY(12px);
  background: #26251f; color: #fff; padding: 9px 16px; border-radius: 8px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: all 0.2s; z-index: 200;
  max-width: 80vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--red); }

.member-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.member-row:last-child { border-bottom: none; }
.member-main { flex: 1; min-width: 0; }
.member-name { font-size: 13.5px; font-weight: 500; }
.member-sub { font-size: 11.5px; color: var(--text-3); }

.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-2); margin-top: 6px; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; }

@media (max-width: 1080px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-2-even { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; flex: none; height: auto; position: static; border-right: none; border-bottom: 1px solid var(--line); }
  .nav { flex-direction: row; overflow-x: auto; gap: 4px; }
  .nav-item { width: auto; white-space: nowrap; }
  .nav-badge { display: none; }
  .sidebar-foot { display: none; }
  .main { padding: 18px 16px 48px; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .task-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  table.list { font-size: 12px; }
}

.rank-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.rank-row:last-child { border-bottom: none; }
.rank-no { width: 20px; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.rank-main { flex: 1; min-width: 0; }
.rank-name { font-size: 13px; font-weight: 500; }
.rank-points { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--blue); }
.rank-points span { font-size: 11px; font-weight: 400; color: var(--text-3); margin-left: 2px; }

.reward-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.reward-card:last-child { margin-bottom: 0; }
.reward-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.reward-name { font-size: 13.5px; font-weight: 500; }
.reward-cost { font-size: 12.5px; color: var(--blue); font-weight: 600; white-space: nowrap; }
.reward-desc { font-size: 12px; color: var(--text-3); margin-top: 3px; min-height: 18px; }
.reward-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 9px; gap: 8px; }

.dropzone { display: block; border: 1px dashed var(--line-strong); border-radius: 10px; padding: 26px 16px; text-align: center; background: var(--surface-2); cursor: pointer; }
.dropzone:hover { border-color: var(--blue); background: var(--blue-bg); }

.imp-progress { margin: 10px 0; padding: 9px 12px; background: var(--blue-bg); border-radius: 8px; font-size: 12.5px; color: var(--blue); }

.cell-input { width: 100%; border: 1px solid transparent; background: transparent; border-radius: 5px; padding: 4px 6px; font-size: 12.5px; }
.cell-input:hover { border-color: var(--line-strong); background: #fff; }
.cell-input:focus { outline: none; border-color: var(--blue); background: #fff; box-shadow: 0 0 0 2px var(--blue-bg); }
.cell-input.warn { border-color: var(--amber-line); background: var(--amber-bg); }
.imp-table th, .imp-table td { padding: 7px 8px; }
.imp-table td { vertical-align: middle; }

.batch-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 12px; border: 1px solid var(--blue-line, var(--line)); border-radius: 10px; background: var(--blue-bg, var(--surface-2)); }
.batch-count { font-size: 13px; color: var(--text-2); margin-right: 4px; }
.batch-count b { color: var(--blue); font-size: 15px; }
.batch-bar .select { height: 32px; font-size: 12.5px; }
.list input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; accent-color: var(--blue); vertical-align: middle; }

/* ===== 简历原件预览 ===== */
.resume-frame { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); display: block; }
.resume-img { text-align: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.resume-img img { max-width: 100%; border-radius: 6px; }
.resume-doc {
  overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 18px 20px; font-size: 13.5px; line-height: 1.75; color: #1f1f1e;
}
.resume-doc p { margin: 0 0 9px; }
.resume-doc h1, .resume-doc h2, .resume-doc h3, .resume-doc h4 { margin: 14px 0 8px; line-height: 1.35; }
.resume-doc ul, .resume-doc ol { margin: 0 0 10px; padding-left: 22px; }
.resume-doc li { margin-bottom: 4px; }
.resume-doc table { border-collapse: collapse; margin: 10px 0; font-size: 13px; }
.resume-doc td, .resume-doc th { border: 1px solid #ddd; padding: 6px 9px; }
.resume-doc img { max-width: 100%; }
.resume-doc a { color: #185fa5; }
.resume-note {
  padding: 18px 14px; text-align: center; font-size: 13px; color: var(--text-3);
  background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: 8px;
}
