/* ===== HR 人事管理系统 · 界面样式 ===== */
:root {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --ink: #16202f;
  --ink-2: #3d4a5e;
  --muted: #7a8699;
  --line: #e7ebf3;
  --line-2: #f0f3f9;
  --brand: #4f46e5;
  --brand-2: #6d5efc;
  --brand-soft: #eef0ff;
  --ok: #12924f;
  --ok-soft: #e6f6ec;
  --warn: #b45309;
  --warn-soft: #fef4e6;
  --danger: #d92d20;
  --danger-soft: #fdeceb;
  --info: #175cd3;
  --info-soft: #eaf1ff;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 4px 16px rgba(16, 24, 40, .06);
  --shadow-lg: 0 18px 48px rgba(16, 24, 40, .16);
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar: 234px;
}

* { box-sizing: border-box; }

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

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand); text-decoration: none; }

/* ---------- 登录 ---------- */
.login-wrap {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 15% 10%, #e8eaff 0%, transparent 55%),
              radial-gradient(900px 500px at 85% 90%, #e6f2ff 0%, transparent 50%),
              #f4f6fb;
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 396px; background: var(--panel);
  border-radius: 20px; padding: 36px 34px 30px;
  box-shadow: 0 24px 60px rgba(30, 41, 80, .12);
  border: 1px solid rgba(255, 255, 255, .8);
}
.login-logo {
  width: 46px; height: 46px; border-radius: 13px;
  background: linear-gradient(135deg, var(--brand), #8b7bff);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; margin-bottom: 16px;
  box-shadow: 0 8px 18px rgba(79, 70, 229, .32);
}
.login-card h1 { font-size: 21px; margin: 0 0 4px; letter-spacing: -.2px; }
.login-card p.sub { color: var(--muted); margin: 0 0 24px; font-size: 13px; }
.login-hint {
  margin-top: 16px; padding: 10px 12px; border-radius: 10px;
  background: var(--line-2); color: var(--muted); font-size: 12px;
}

/* ---------- 布局 ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); flex: 0 0 var(--sidebar);
  background: #12172a; color: #c9d0e3;
  display: flex; flex-direction: column;
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 40;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 20px 18px;
}
.brand .mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #a78bfa);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 15px;
  box-shadow: 0 4px 12px rgba(99, 102, 241, .45);
}
.brand .name { color: #fff; font-weight: 600; font-size: 15px; line-height: 1.2; }
.brand .sub { font-size: 11px; color: #7d88a4; letter-spacing: .4px; }

.nav { padding: 6px 12px; flex: 1; overflow-y: auto; }
.nav-group { font-size: 11px; color: #5f6a86; padding: 16px 10px 6px; letter-spacing: .8px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: 9px; margin-bottom: 2px;
  color: #b8c1d9; font-size: 13.5px; cursor: pointer;
  border: none; background: none; width: 100%; text-align: left;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(99, 102, 241, .28), rgba(99, 102, 241, .08));
  color: #fff; font-weight: 500;
  box-shadow: inset 2px 0 0 #818cf8;
}
.nav-item .ico { width: 17px; text-align: center; opacity: .95; font-size: 15px; }
.nav-item .pill {
  margin-left: auto; background: #ef4444; color: #fff;
  border-radius: 20px; padding: 0 7px; font-size: 11px; line-height: 17px;
  min-width: 18px; text-align: center; font-weight: 600;
}
.sidebar-foot {
  padding: 14px 16px; border-top: 1px solid rgba(255, 255, 255, .07);
  font-size: 12px; color: #7d88a4; display: flex; align-items: center; gap: 9px;
}
.sidebar-foot .avatar { --size: 28px; }
.sidebar-foot .who { flex: 1; min-width: 0; }
.sidebar-foot .who b { display: block; color: #dfe4f2; font-weight: 500; font-size: 12.5px; }
.sidebar-foot .who span { font-size: 11px; color: #6b7899; }
.icon-btn {
  border: none; background: rgba(255, 255, 255, .07); color: #b8c1d9;
  width: 28px; height: 28px; border-radius: 8px; display: inline-flex;
  align-items: center; justify-content: center; font-size: 13px;
}
.icon-btn:hover { background: rgba(255, 255, 255, .16); color: #fff; }

.main { margin-left: var(--sidebar); flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 60px; display: flex; align-items: center; gap: 16px;
  padding: 0 26px; background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.topbar h2 { font-size: 16.5px; margin: 0; font-weight: 600; letter-spacing: -.2px; }
.topbar .today { color: var(--muted); font-size: 12.5px; }
.topbar .spacer { flex: 1; }
.conn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted); background: var(--line-2);
  padding: 5px 10px; border-radius: 20px;
}
.conn .dot { width: 7px; height: 7px; border-radius: 50%; background: #cbd5e1; flex: 0 0 auto; }
.conn .dot.live { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .16); }
.conn .dot.off { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, .16); }

.content { padding: 22px 26px 48px; max-width: 1500px; width: 100%; }

/* ---------- 通用组件 ---------- */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  min-width: 0;
}
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 15px 18px; border-bottom: 1px solid var(--line-2);
}
.card-head h3 { margin: 0; font-size: 14.5px; font-weight: 600; letter-spacing: -.1px; }
.card-head .sub { font-size: 12px; color: var(--muted); font-weight: 400; }
.card-head .spacer { flex: 1; }
.card-body { padding: 16px 18px; }
.card-body.tight { padding: 8px 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: 9px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: all .15s; box-shadow: var(--shadow-sm);
}
.btn:hover { border-color: #d3d9e6; background: #fbfcfe; }
.btn.primary {
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
  border-color: transparent; color: #fff;
  box-shadow: 0 2px 8px rgba(79, 70, 229, .3);
}
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; box-shadow: none; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--line-2); color: var(--ink); }
.btn.danger { color: var(--danger); border-color: #f7d4d1; background: #fff; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.input, .select, .textarea {
  height: 34px; padding: 0 11px; border-radius: 9px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  outline: none; transition: border .15s, box-shadow .15s; width: 100%;
}
.textarea { height: auto; padding: 8px 11px; resize: vertical; min-height: 64px; }
.input:focus, .select:focus, .textarea:focus {
  border-color: #b9b2fb; box-shadow: 0 0 0 3px rgba(99, 102, 241, .13);
}
.input::placeholder { color: #aab3c5; }
.select { appearance: none; background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a8699' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.field .hint { font-size: 11.5px; color: var(--muted); }
.field.span-2 { grid-column: span 2; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 11.5px; font-weight: 500; white-space: nowrap;
  background: var(--line-2); color: var(--muted);
  flex: 0 0 auto;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }
.badge.dot::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: currentColor; opacity: .85;
}

.avatar {
  --size: 34px; width: var(--size); height: var(--size); border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: calc(var(--size) * .38); font-weight: 600; color: #fff;
  flex: 0 0 auto; letter-spacing: .5px;
}
.avatar.lg { --size: 56px; }
.avatar.sm { --size: 26px; }

.person { display: flex; align-items: center; gap: 9px; min-width: 0; }
.person .meta { min-width: 0; }
.person .meta b { display: block; font-weight: 500; font-size: 13.5px; line-height: 1.35; }
.person .meta span { font-size: 11.5px; color: var(--muted); }

.muted { color: var(--muted); }
.tiny { font-size: 11.5px; }
.mono { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex.wrap { flex-wrap: wrap; }
.grow { flex: 1; }

/* ---------- 统计卡 ---------- */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.stat {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 15px 16px;
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.stat .label { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat .value { font-size: 27px; font-weight: 650; letter-spacing: -.6px; margin-top: 4px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat .foot { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.stat .glyph {
  position: absolute; right: 12px; top: 12px; font-size: 19px; opacity: .16;
}
.stat.accent { background: linear-gradient(155deg, #f7f6ff, #fff 60%); border-color: #e6e3ff; }
.stat.accent .value { color: var(--brand); }
.stat.alert .value { color: var(--danger); }
.stat.warn .value { color: var(--warn); }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; }
table.grid th {
  text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted);
  padding: 9px 12px; background: #fafbfe; border-bottom: 1px solid var(--line);
  white-space: nowrap; text-transform: none; letter-spacing: .2px;
}
table.grid td {
  padding: 11px 12px; border-bottom: 1px solid var(--line-2);
  font-size: 13px; vertical-align: middle;
}
table.grid tbody tr { transition: background .12s; }
table.grid tbody tr:hover { background: #fafbff; }
table.grid tbody tr:last-child td { border-bottom: none; }
table.grid tr.clickable { cursor: pointer; }
table.grid td .strong { font-weight: 500; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- 提醒条目 ---------- */
.todo-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-bottom: 1px solid var(--line-2);
}
.todo-item:last-child { border-bottom: none; }
.todo-item:hover { background: #fafbff; }
.todo-ico {
  width: 34px; height: 34px; border-radius: 10px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
  background: var(--line-2);
}
.todo-ico.probation { background: var(--brand-soft); }
.todo-ico.birthday { background: #fff0f6; }
.todo-ico.contract { background: var(--info-soft); }
.todo-ico.onboarding { background: var(--ok-soft); }
.todo-ico.anniversary { background: #fdf3e7; }
.todo-main { flex: 1; min-width: 0; }
.todo-main b { font-weight: 500; font-size: 13.5px; }
.todo-main p { margin: 1px 0 0; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-side { text-align: right; flex: 0 0 auto; }
.todo-side .days { font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.todo-side .days.overdue { color: var(--danger); }
.todo-side .days.today { color: var(--warn); }
.todo-side .days.soon { color: var(--info); }
.todo-side .days.normal { color: var(--muted); }

/* ---------- 进度条 ---------- */
.progress { height: 6px; border-radius: 4px; background: var(--line-2); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--brand-2), var(--brand)); transition: width .4s; }
.progress.warn > span { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.progress.danger > span { background: linear-gradient(90deg, #f87171, #ef4444); }

.bar-row { display: grid; grid-template-columns: 92px 1fr 38px; align-items: center; gap: 10px; margin-bottom: 9px; font-size: 12.5px; }
.bar-row .track { height: 8px; border-radius: 5px; background: var(--line-2); overflow: hidden; }
.bar-row .track > i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, #a5b4fc, #6366f1); }
.bar-row .val { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- 工具栏 / 标签页 ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .search { position: relative; width: 230px; }
.toolbar .search .input { padding-left: 32px; }
.toolbar .search::before {
  content: "🔍"; position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  font-size: 12px; opacity: .55;
}
.tabs { display: inline-flex; background: #eef1f8; padding: 3px; border-radius: 10px; gap: 2px; }
.tabs button {
  border: none; background: transparent; padding: 5px 12px; border-radius: 8px;
  font-size: 12.5px; color: var(--muted); font-weight: 500;
}
.tabs button.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------- 抽屉 ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(16, 24, 40, .38);
  z-index: 60; display: flex; opacity: 0; pointer-events: none;
  transition: opacity .2s; backdrop-filter: blur(1.5px);
}
.overlay.show { opacity: 1; pointer-events: auto; }
.drawer {
  margin-left: auto; width: min(560px, 94vw); background: var(--bg);
  height: 100%; display: flex; flex-direction: column;
  transform: translateX(28px); transition: transform .24s ease;
  box-shadow: var(--shadow-lg);
}
.overlay.show .drawer { transform: none; }
.drawer-head {
  padding: 18px 22px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: flex-start; gap: 12px;
}
.drawer-head h3 { margin: 0; font-size: 17px; }
.drawer-head .sub { font-size: 12.5px; color: var(--muted); }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 22px 30px; }
.drawer-foot {
  padding: 12px 22px; background: #fff; border-top: 1px solid var(--line);
  display: flex; gap: 8px; justify-content: flex-end;
}

.modal {
  margin: auto; width: min(680px, 94vw); background: #fff;
  border-radius: 18px; box-shadow: var(--shadow-lg);
  max-height: 90vh; display: flex; flex-direction: column;
  transform: translateY(10px) scale(.99); transition: transform .2s;
}
.overlay.show .modal { transform: none; }
.modal-head { padding: 20px 24px 6px; display: flex; align-items: center; }
.modal-head h3 { margin: 0; font-size: 16.5px; flex: 1; }
.modal-body { padding: 12px 24px 8px; overflow-y: auto; }
.modal-foot { padding: 14px 24px 20px; display: flex; gap: 8px; justify-content: flex-end; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid .section-title {
  grid-column: span 2; font-size: 12px; font-weight: 600; color: var(--brand);
  padding-top: 6px; letter-spacing: .3px; border-top: 1px dashed var(--line);
  margin-top: 2px;
}
.form-grid .section-title:first-child { border-top: none; margin-top: 0; padding-top: 0; }

/* ---------- 详情 ---------- */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
.info-grid .item { min-width: 0; }
.info-grid .item .k { font-size: 11.5px; color: var(--muted); }
.info-grid .item .v { font-size: 13px; margin-top: 1px; word-break: break-all; }

.task {
  display: flex; align-items: flex-start; gap: 9px; padding: 8px 0;
  border-bottom: 1px dashed var(--line); font-size: 13px;
}
.task:last-child { border-bottom: none; }
.task .check {
  width: 17px; height: 17px; border-radius: 5px; border: 1.5px solid #cfd6e4;
  flex: 0 0 auto; margin-top: 2px; display: flex; align-items: center;
  justify-content: center; font-size: 11px; color: transparent; background: #fff;
  cursor: pointer; transition: all .15s;
}
.task .check:hover { border-color: var(--brand); }
.task.done .check { background: var(--brand); border-color: var(--brand); color: #fff; }
.task.done .title { text-decoration: line-through; color: var(--muted); }
.task .title { flex: 1; }
.task .meta { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.task .meta.late { color: var(--danger); }

.section-label {
  font-size: 12px; font-weight: 600; color: var(--ink-2);
  margin: 18px 0 8px; display: flex; align-items: center; gap: 8px;
}
.section-label .line { flex: 1; height: 1px; background: var(--line); }
.section-label:first-child { margin-top: 0; }

.kv-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }

.empty { padding: 34px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.empty .ico { font-size: 26px; opacity: .35; display: block; margin-bottom: 6px; }

/* ---------- 提醒中心 ---------- */
.preview {
  background: #0f1424; color: #d6dcec; border-radius: 12px;
  padding: 16px 18px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; line-height: 1.75; white-space: pre-wrap; word-break: break-word;
  max-height: 380px; overflow-y: auto;
}
.preview .hl { color: #fbbf24; }
.preview .mut { color: #6b7899; }
.rule-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.switch input { display: none; }
.switch .track {
  width: 38px; height: 22px; border-radius: 20px; background: #d8dee9;
  position: relative; transition: background .2s; flex: 0 0 auto;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(16px); }

.log-row td { font-size: 12.5px; }

/* ---------- Toast ---------- */
.toasts { position: fixed; right: 22px; bottom: 22px; z-index: 120; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #101828; color: #fff; padding: 10px 15px; border-radius: 10px;
  font-size: 13px; box-shadow: var(--shadow-lg); display: flex; gap: 8px; align-items: center;
  animation: toast-in .22s ease; max-width: 380px;
}
.toast.ok { background: #0b7a43; }
.toast.err { background: #b42318; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- 空状态 / 加载 ---------- */
.loading { padding: 40px; text-align: center; color: var(--muted); font-size: 13px; }
.spinner {
  width: 18px; height: 18px; border: 2px solid var(--line);
  border-top-color: var(--brand); border-radius: 50%;
  display: inline-block; animation: spin .7s linear infinite; vertical-align: -3px; margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  :root { --sidebar: 76px; }
  .brand .name, .brand .sub, .nav-group, .nav-item span.txt, .sidebar-foot .who { display: none; }
  .nav-item { justify-content: center; padding: 11px 0; }
  .nav-item .pill { position: absolute; margin: 0; transform: translate(16px, -12px); }
  .nav-item { position: relative; }
  .brand { justify-content: center; padding: 18px 0; }
}
@media (max-width: 820px) {
  .content { padding: 16px 14px 40px; }
  .topbar { padding: 0 14px; gap: 10px; }
  .topbar .today { display: none; }
  .form-grid, .info-grid { grid-template-columns: 1fr; }
  .field.span-2, .form-grid .section-title { grid-column: span 1; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- 无障碍：尊重「减少动态效果」 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .001ms !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ==================================================================
   v1.2 视觉升级：图表 / 时间线 / 页面动效
   ================================================================== */

@keyframes page-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.content > * { animation: page-in .28s ease both; }

/* 卡片更细腻的层次 */
.card {
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px -12px rgba(16, 24, 40, .10);
}
.card-head { padding: 16px 20px; }
.card-body { padding: 18px 20px; }
table.grid th { position: sticky; top: 0; z-index: 1; backdrop-filter: blur(6px); }

/* 统计卡微调 */
.stat { border-radius: 16px; padding: 16px 18px; transition: transform .2s, box-shadow .2s; }
.stat:hover { transform: translateY(-2px); box-shadow: 0 10px 28px -14px rgba(16, 24, 40, .22); }
.stat .value { font-size: 29px; }
.stat .delta { font-size: 11.5px; margin-top: 6px; display: inline-flex; gap: 4px; align-items: center; }
.stat .delta.up { color: var(--ok); }
.stat .delta.down { color: var(--danger); }

/* ---------- 图表 ---------- */
.chart-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px; align-items: start;
}
.chart-card { min-width: 0; }

.donut-wrap { display: flex; align-items: center; gap: 18px; }
.donut { position: relative; flex: 0 0 auto; }
.donut svg { display: block; transform: rotate(0deg); }
.donut .center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; pointer-events: none;
}
.donut .center b { font-size: 19px; font-weight: 650; line-height: 1.1; }
.donut .center span { font-size: 10.5px; color: var(--muted); }
.donut-legend { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.donut-legend .row {
  display: flex; align-items: center; gap: 7px; font-size: 12.5px;
}
.donut-legend .row i {
  width: 8px; height: 8px; border-radius: 3px; flex: 0 0 auto;
}
.donut-legend .row .n { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }

/* 横向条形（复用于分布） */
.hbar { display: grid; grid-template-columns: 92px 1fr 76px; gap: 10px; align-items: center; margin-bottom: 10px; }
.hbar:last-child { margin-bottom: 0; }
.hbar .name { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .track { height: 9px; border-radius: 6px; background: #eef1f7; overflow: hidden; }
.hbar .track > i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #a5b4fc, #6366f1); }
.hbar .val { text-align: right; font-size: 12px; color: var(--muted);
  font-variant-numeric: tabular-nums; white-space: nowrap; }

/* 近 12 个月入离职趋势 */
.trend { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 8px; }
.trend .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; height: 100%; }
.trend .bars { display: flex; align-items: flex-end; gap: 2px; height: 100%; }
.trend .bars span { flex: 1; border-radius: 4px 4px 2px 2px; min-height: 2px; transition: height .4s; }
.trend .bars .in { background: linear-gradient(180deg, #818cf8, #6366f1); }
.trend .bars .out { background: linear-gradient(180deg, #fca5a5, #ef4444); }
.trend .label { text-align: center; font-size: 10px; color: var(--muted); margin-top: 6px; }
.trend-legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.trend-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 3px; margin-right: 4px; }

/* ---------- 时间线 ---------- */
.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px;
  width: 2px; background: linear-gradient(180deg, #e6e9f3, #f2f4f9);
}
.tl-item { position: relative; padding: 0 0 16px 0; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute; left: -24px; top: 4px; width: 10px; height: 10px;
  border-radius: 50%; background: #cbd5e1; box-shadow: 0 0 0 3px #fff;
}
.tl-item.ok .tl-dot { background: #10b981; }
.tl-item.brand .tl-dot { background: #6366f1; }
.tl-item.warn .tl-dot { background: #f59e0b; }
.tl-item.info .tl-dot { background: #3b82f6; }
.tl-body b { font-size: 13px; font-weight: 550; }
.tl-body p { margin: 1px 0 0; font-size: 12px; color: var(--muted); }
.tl-date { font-size: 11px; color: #9aa4b8; margin-left: 6px; font-variant-numeric: tabular-nums; }

/* ---------- 角色说明 ---------- */
.role-legend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.role-legend .item {
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
  background: linear-gradient(180deg, #fbfcff, #fff);
}
.role-legend .item b { font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.role-legend .item span { font-size: 11px; color: var(--muted); display: block; margin-top: 3px; line-height: 1.6; }
.role-legend .item.admin { border-color: #ded9ff; background: linear-gradient(180deg, #f7f5ff, #fff); }

/* ---------- 合同到期条 ---------- */
.contract-flag { display: inline-flex; align-items: center; gap: 5px; }
.contract-flag i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* 工具栏吸附 */
.toolbar.sticky { position: sticky; top: 60px; z-index: 20; background: var(--bg); padding: 8px 0; margin-top: -8px; }

/* 表格行操作按钮更紧凑 */
table.grid td .btn.sm + .btn.sm { margin-left: 4px; }

@media (max-width: 900px) {
  .chart-grid { grid-template-columns: 1fr; }
  .role-legend { grid-template-columns: 1fr; }
  .donut-wrap { flex-direction: column; align-items: flex-start; }
}

/* ---------- 全局搜索 ---------- */
.topbar-search { position: relative; width: 220px; }
.topbar-search .input { height: 32px; padding-right: 46px; background: #f7f8fc; }
.topbar-search .kbd {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-size: 10px; color: #98a2b3; background: #fff; border: 1px solid var(--line);
  border-radius: 5px; padding: 1px 5px; pointer-events: none;
}
.search-pop {
  position: absolute; top: 40px; right: 0; width: 340px; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg);
  z-index: 80; display: none; overflow: hidden;
}
.search-pop.show { display: block; }
.search-pop .hit {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer;
  border-bottom: 1px solid var(--line-2);
}
.search-pop .hit:last-child { border-bottom: none; }
.search-pop .hit:hover, .search-pop .hit.active { background: #f7f8ff; }
.search-pop .hit .meta { min-width: 0; flex: 1; }
.search-pop .hit b { font-size: 13px; font-weight: 500; display: block; }
.search-pop .hit span { font-size: 11.5px; color: var(--muted); }
.search-pop .none { padding: 16px; text-align: center; color: var(--muted); font-size: 12.5px; }

/* ---------- 数据体检 ---------- */
.health-strip {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: linear-gradient(180deg, #fbfcff, #fff);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 14px; margin-bottom: 14px; font-size: 12.5px;
}
.health-strip .score { font-weight: 650; font-size: 15px; }
.health-strip .chip {
  border: 1px solid var(--line); background: #fff; border-radius: 20px;
  padding: 3px 10px; cursor: pointer; color: var(--ink-2); font-size: 12px;
  transition: all .15s;
}
.health-strip .chip:hover { border-color: #c7c9f8; background: #f7f7ff; }
.health-strip .chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- 招聘看板 ---------- */
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: start; }
.board-col { background: #f7f8fc; border: 1px solid var(--line); border-radius: 14px; padding: 10px; min-height: 120px; }
.board-col .col-head {
  display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600;
  margin: 2px 4px 10px;
}
.board-col .col-head i { width: 7px; height: 7px; border-radius: 50%; }
.board-col .col-head .n { margin-left: auto; color: var(--muted); font-weight: 500; }
.cand-card {
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px;
  margin-bottom: 8px; cursor: pointer; transition: box-shadow .15s, transform .15s;
}
.cand-card:hover { box-shadow: 0 6px 18px -10px rgba(16,24,40,.28); transform: translateY(-1px); }
.cand-card b { font-size: 13px; font-weight: 550; display: block; }
.cand-card .sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.cand-card .tags { display: flex; gap: 5px; margin-top: 7px; flex-wrap: wrap; }
.board-empty { padding: 18px 6px; text-align: center; font-size: 12px; color: #a7b0c2; }

/* 职位卡 */
.job-card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px;
  min-width: 0; cursor: default;
}
.job-card .top { display: flex; align-items: flex-start; gap: 8px; }
.job-card .top b { font-size: 14px; font-weight: 600; }
.job-card .plan { margin-left: auto; text-align: right; }
.job-card .plan b { font-size: 17px; }
.job-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }

/* ---------- 可点击的统计卡 / 分布行 ---------- */
.stat.clickable { cursor: pointer; }
.stat.clickable::after {
  content: "›"; position: absolute; right: 14px; bottom: 10px;
  font-size: 15px; color: #c3cad8; transition: transform .15s, color .15s;
}
.stat.clickable:hover::after { transform: translateX(2px); color: var(--brand); }
.bar-row.clickable-row { cursor: pointer; border-radius: 8px; margin: 0 -6px; padding: 2px 6px; }
.bar-row.clickable-row:hover { background: #f7f8ff; }


/* 备案号 */
.icp {
  text-align: center;
  font-size: 11px;
  color: var(--muted, #94a3b8);
  padding: 14px 0 4px;
  letter-spacing: .2px;
}
.icp a { color: inherit; text-decoration: none; }
.icp a:hover { text-decoration: underline; }
.sidebar-icp {
  padding: 6px 0 10px;
  font-size: 10px;
  opacity: .55;
  border-top: 1px solid rgba(255,255,255,.06);
  margin: 0 12px;
}
