:root {
  --bg: #0f1216; --panel: #171c22; --line: #283039; --text: #e6e9ee;
  --muted: #8b97a5; --teal: #12b8a6; --teal-d: #0d8d80;
  /* 三档色 */
  --pass:      #4a9eff;   /* 及格 蓝 */
  --good:      #2ecc71;   /* 良好 绿 */
  --excellent: #ffd700;   /* 优秀 金 */
  --fail:      #6b7a8d;   /* 淘汰 灰 */
  /* 旧兼容（detail行等） */
  --hi: #2ecc71; --mid: #f1c40f; --lo: #95a5a6; --reject: #e74c3c;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.5 -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.err { color: var(--reject); min-height: 18px; }
code { color: #7fd6ff; word-break: break-all; }

/* 登录 */
.login { min-height: 100vh; display: grid; place-items: center; }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 32px; width: 320px; display: flex; flex-direction: column; gap: 12px; }
.login-card h1 { margin: 0; font-size: 20px; }
input, select { background: #0d1015; border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 8px 11px; font-size: 14px; }
.login-card input, .login-card button { width: 100%; }
button { background: var(--teal); color: #06231f; border: 0; border-radius: 8px; padding: 8px 16px; font-weight: 600; cursor: pointer; }
button:hover { background: var(--teal-d); color: #fff; }
button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
button.ghost:hover { color: var(--text); background: #1c232b; }

/* 布局 */
.app { max-width: 2500px; width: 100%; margin: 0 auto; padding: 16px; }

/* 顶部 topbar */
.topbar { display: flex; align-items: center; gap: 16px; padding: 8px 4px 12px;
  position: sticky; top: 0; z-index: 30;
  background: var(--bg); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; font-size: 16px; }
.stats { display: flex; gap: 10px; flex: 1; flex-wrap: wrap; }
.stats .pill { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; font-size: 12px; }
.stats .pill-pass b  { color: var(--pass); }
.stats .pill-good b  { color: var(--good); }
.stats .pill-excellent b { color: var(--excellent); }

/* 筛选工具栏 sticky，topbar 约 49px */
.toolbar { display: flex; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; align-items: center;
  position: sticky; top: 49px; z-index: 20;
  background: var(--bg); padding: 8px 0 8px; border-bottom: 1px solid var(--line); }
.toolbar #search { flex: 1; min-width: 200px; }

/* 分数档 chips */
.band-chips { display: flex; gap: 5px; flex-shrink: 0; }
.band-chip { background: var(--panel); color: var(--muted); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 14px; font-size: 12px; font-weight: 600; cursor: pointer; transition: all .15s; }
.band-chip:hover { color: var(--text); background: #1c232b; }
.band-chip.active { color: #0f1216; border-color: transparent; }
.band-chip[data-band=""].active  { background: var(--teal); color: #06231f; }
.band-chip.band-pass.active      { background: var(--pass); }
.band-chip.band-good.active      { background: var(--good); }
.band-chip.band-excellent.active { background: var(--excellent); color: #3a2a00; }

/* 日期区间控件 */
.date-range { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
.date-label { color: var(--muted); font-size: 13px; white-space: nowrap; }
.date-inputs { display: flex; align-items: center; gap: 6px; }
.date-sep { color: var(--muted); font-size: 13px; }
.date-field { position: relative; display: flex; align-items: center; }
.date-field input[type="date"] {
  background: #0d1015; border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 5px 10px 5px 10px; font-size: 13px;
  min-width: 130px; appearance: none; -webkit-appearance: none;
}
.date-field input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.85); cursor: pointer; opacity: 0.8;
}
.date-field input[type="date"]:hover { border-color: var(--teal); }
.date-field input[type="date"]:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 2px rgba(18,184,166,.2); }
.date-presets { display: flex; gap: 5px; }
button.mini { padding: 4px 10px; font-size: 12px; }

/* 表格 */
/* 不要给本表加 overflow:hidden —— 会让 table 成为 sticky 的滚动容器，使 sticky 表头被 top:98px 恒定下推、错位到第1/2行之间。圆角用 border-radius 即可。 */
.grid-table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
/* 条目6：紧凑行 padding 5-6px */
.grid-table th, .grid-table td { padding: 5px 11px; text-align: left; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: top; }

/* 表头 sticky，topbar+toolbar ≈ 49+49=98px */
.grid-table th { color: var(--muted); font-weight: 600; background: #131820;
  position: sticky; top: 98px; z-index: 10; }
.grid-table tr:hover td { background: #1a2129; }
.nowrap { white-space: nowrap; }
.name { font-weight: 600; }
.uid { font-size: 11px; color: var(--muted); font-weight: 400; }

/* 分数三档着色 */
.score { font-weight: 800; font-size: 17px; }
.score.sc-excellent { color: var(--excellent); text-shadow: 0 0 10px rgba(255,215,0,.4); }
.score.sc-good      { color: var(--good); }
.score.sc-pass      { color: var(--pass); }
.score.sc-fail      { color: var(--fail); }

/* 收藏星星 */
.star-fav      { font-size: 13px; }
.star-excellent { font-size: 14px; filter: drop-shadow(0 0 4px rgba(255,215,0,.8)); }

.verdict { max-width: 420px; color: #cdd4dc; }
.depth { padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.depth.detail { background: rgba(46,204,113,.15); color: var(--hi); border: 1px solid rgba(46,204,113,.4); }
.depth.list { background: rgba(241,196,64,.15); color: var(--mid); border: 1px solid rgba(241,196,64,.4); }

/* 操作列不换行 */
.row-actions { white-space: nowrap; min-width: 140px; }
.row-actions button { padding: 3px 8px; font-size: 12px; white-space: nowrap; }

/* 可排序表头 */
.sortable-th { cursor: pointer; user-select: none; }
.sortable-th:hover { color: var(--text); }
.sort-arrow { margin-left: 4px; font-size: 11px; opacity: 0.6; }
.sortable-th.sort-active .sort-arrow { opacity: 1; color: var(--teal); }
.sortable-th.sort-active { color: var(--text); }

/* 详情行 */
.detail td { background: #0d1117; }
.detail .meta { margin-bottom: 8px; color: #b9c2cc; }
.detail .tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.detail .tag { font-size: 12px; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--line); }
.detail .tag.good { color: var(--hi); } .detail .tag.bad { color: var(--reject); }
.detail .resume { margin: 10px 0; }
.detail .resume pre { white-space: pre-wrap; word-break: break-word; background: #11161d; border: 1px solid var(--line); border-radius: 8px; padding: 12px; max-height: 460px; overflow: auto; font: 13px/1.7 "Microsoft YaHei", monospace; color: #d6dde4; }
.ov-bar { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.ov-input { width: 90px; }
.resume-img { max-height: 560px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; margin-top: 4px; }
.resume-img img { display: block; width: 100%; height: auto; }

/* 简历 lightbox */
.resume-modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.82);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 20px; overflow-y: auto;
}
.resume-modal {
  position: relative; background: #fff; border-radius: 10px;
  max-width: 860px; width: 100%; margin: auto;
}
.resume-modal-close {
  position: absolute; top: 10px; right: 14px;
  background: rgba(0,0,0,.55); color: #fff; border: 0;
  border-radius: 6px; padding: 4px 10px; font-size: 18px;
  cursor: pointer; z-index: 2; line-height: 1;
}
.resume-modal-close:hover { background: rgba(0,0,0,.8); }
.resume-modal img { display: block; width: 100%; height: auto; border-radius: 10px; }
.resume-modal-noimg {
  padding: 40px; text-align: center; color: #555; font-size: 15px;
}

/* 视图切换 */
.viewtabs { display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.viewtabs .tab { background: transparent; color: var(--muted); border: 0; border-radius: 999px; padding: 5px 16px; font-size: 13px; font-weight: 600; }
.viewtabs .tab:hover { background: #1c232b; color: var(--text); }
.viewtabs .tab.active { background: var(--teal); color: #06231f; }

/* 无限滚动状态 */
.load-status { text-align: center; padding: 14px 0; font-size: 13px; }

/* 看板 */
.board-toolbar { align-items: center; }
.board-pos { font-weight: 700; font-size: 14px; color: var(--text); flex-shrink: 0; }

/* KPI 6个 */
.kpi-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 14px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.kpi .num { font-size: 30px; font-weight: 800; line-height: 1.1; }
.kpi .lbl { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* 看板卡 */
.panel-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 14px; }
.panel-card h3 { margin: 0 0 10px; font-size: 14px; }

/* 图例 */
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.legend-item { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.legend-dot { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }

/* 每日柱状图 */
.day-chart {
  display: flex; align-items: flex-end; gap: 6px;
  height: 180px; overflow-x: auto; padding-bottom: 2px;
}
.day-col {
  display: flex; flex-direction: column; align-items: center;
  min-width: 38px; flex: 1; height: 100%; gap: 4px;
}
.day-bars {
  display: flex; align-items: flex-end; gap: 2px;
  flex: 1; width: 100%; justify-content: center;
}
.day-bar-wrap {
  flex: 1; max-width: 10px; height: 100%;
  display: flex; align-items: flex-end; cursor: default;
}
.day-bar {
  width: 100%; border-radius: 3px 3px 0 0;
  min-height: 2px; transition: height .2s;
}
.day-date {
  font-size: 10px; color: var(--muted); white-space: nowrap;
  text-align: center; flex-shrink: 0;
}

@media (max-width: 1100px) {
  .kpi-row { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
}
