/* ==========================================================================
   仙聘 · 运营工作台 —— 全量样式
   说明：本文件承担全部版式与组件外观，不依赖任何外部 CSS 框架。
        即使 CDN 全部不可用，界面依然完整可用。
   ========================================================================== */

/* ---------- 1. 主题变量 ---------- */
:root {
  --brand: #2b5ce6;
  --brand-2: #4b7bff;
  --brand-dark: #1e47b8;
  --brand-soft: #eaf0ff;
  --brand-soft-2: #dbe6ff;

  --up: #e63946;          /* 涨 / 正增长 —— 国内习惯红涨 */
  --down: #16a34a;        /* 跌 / 负增长 —— 绿跌 */
  --warn: #f59e0b;
  --danger: #dc2626;
  --success: #16a34a;
  --info: #0ea5e9;
  --purple: #7c5cff;
  --teal: #0d9488;

  --bg: #f0f3f9;
  --card: #ffffff;
  --ink: #16202f;
  --ink-2: #364356;
  --muted: #5a6784;
  --muted-2: #6b7793;
  --border: #dde3ef;
  --border-2: #e7ecf5;

  /* v49：侧栏改浅色。原近黑 #141b2d 与白色主区亮度差过大，
     视线在导航与内容间来回切换时瞳孔反复调节，是盯屏疲劳的主因之一。 */
  --side-bg: #ffffff;
  --side-bg-2: #eef2f9;
  --side-border: #e2e8f2;
  --side-ink: #364356;
  --side-ink-active: #ffffff;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(23, 35, 61, .08);
  --shadow: 0 2px 12px rgba(23, 35, 61, .10);
  --shadow-lg: 0 12px 32px rgba(23, 35, 61, .16);
  --sidebar-w: 232px;
  --sidebar-w-mini: 64px;
  --topbar-h: 60px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
}

/* ---------- 2. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, p, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
table { border-collapse: collapse; width: 100%; }
img, svg { display: block; max-width: 100%; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #ccd4e4; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #b3bed4; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 3. 通用工具类 ---------- */
.flex { display: flex; }
.iflex { display: inline-flex; }
.grid { display: grid; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1 1 auto; min-width: 0; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.gap-4 { gap: 16px; } .gap-5 { gap: 20px; } .gap-6 { gap: 24px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; } .mt-5 { margin-top: 20px; } .mt-6 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; } .mb-5 { margin-bottom: 20px; }
.ml-auto { margin-left: auto; }
.p-0 { padding: 0; } .p-3 { padding: 12px; } .p-4 { padding: 16px; } .p-5 { padding: 20px; }
.w-full { width: 100%; }
.text-xs { font-size: 12px; } .text-sm { font-size: 13px; }
.text-base { font-size: 14px; } .text-lg { font-size: 16px; }
.text-xl { font-size: 18px; } .text-2xl { font-size: 21px; }
.text-3xl { font-size: 26px; }
.fw-5 { font-weight: 500; } .fw-6 { font-weight: 600; } .fw-7 { font-weight: 700; }
.muted { color: var(--muted); }
.muted-2 { color: var(--muted-2); }
.ink-2 { color: var(--ink-2); }
.c-brand { color: var(--brand); }
.c-up { color: var(--up); }
.c-down { color: var(--down); }
.c-warn { color: var(--warn); }
.c-danger { color: var(--danger); }
.c-success { color: var(--success); }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.center { text-align: center; }
.right { text-align: right; }
.hidden { display: none !important; }
.relative { position: relative; }
.pointer { cursor: pointer; }
.divider { height: 1px; background: var(--border); margin: 12px 0; }
.vdivider { width: 1px; align-self: stretch; background: var(--border); }

/* ---------- 4. 应用骨架 ---------- */
.app-shell { display: flex; min-height: 100vh; }

/* 侧边导航 */
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--side-bg);
  color: var(--side-ink);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  /* v49：改浅色后深色底自带的天然边界消失，补一条显式右边线 */
  border-right: 1px solid var(--side-border);
  transition: width .18s ease, flex-basis .18s ease;
}
.sidebar-brand {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  flex: 0 0 auto;
  border-bottom: 1px solid var(--side-border);
}
.brand-mark {
  width: 32px; height: 32px; flex: 0 0 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand-2), var(--brand-dark));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; color: #fff;
  box-shadow: 0 3px 10px rgba(43,92,230,.45);
}
.brand-text { min-width: 0; }
.brand-name { color: var(--ink); font-size: 15px; font-weight: 600; letter-spacing: .3px; }
.brand-sub { font-size: 12px; color: var(--muted); letter-spacing: 1.2px; }

.nav-scroll { flex: 1 1 auto; overflow-y: auto; padding: 10px 0 24px; }
.nav-scroll::-webkit-scrollbar-thumb { background: #ccd4e4; }
.nav-group-title {
  padding: 14px 18px 6px;
  font-size: 12px;
  letter-spacing: 1.4px;
  color: var(--muted);
  text-transform: uppercase;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 1px 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--side-ink);
  font-size: 14px;
  cursor: pointer;
  position: relative;
  transition: background .14s, color .14s;
}
.nav-item:hover { background: var(--side-bg-2); color: var(--ink); }
.nav-item.active { background: var(--brand); color: var(--side-ink-active); font-weight: 500; box-shadow: 0 4px 14px rgba(43,92,230,.28); }
.nav-item .ni-icon { width: 18px; height: 18px; flex: 0 0 18px; opacity: .95; }
.nav-item .ni-text { flex: 1 1 auto; }
.nav-item .ni-badge {
  font-size: 12px; padding: 1px 6px; border-radius: 9px;
  background: rgba(23,35,61,.07); color: var(--ink-2);
}
.nav-item.active .ni-badge { background: rgba(255,255,255,.24); color: #fff; }
.sidebar-foot {
  flex: 0 0 auto; padding: 10px 14px 14px;
  border-top: 1px solid var(--side-border);
  font-size: 12px; color: var(--muted);
}

/* 主区 */
.main {
  flex: 1 1 auto;
  min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  transition: margin-left .18s ease;
}

/* 顶栏 */
.topbar {
  height: var(--topbar-h);
  flex: 0 0 var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  position: sticky; top: 0; z-index: 30;
}
.icon-btn {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-2); position: relative;
  transition: background .14s, color .14s;
}
.icon-btn:hover { background: var(--bg); color: var(--brand); }
.crumb { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.crumb .sep { color: var(--muted-2); }
.crumb .cur { color: var(--ink); font-weight: 600; font-size: 15px; }
.topbar-search {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 20px; padding: 5px 14px; width: 240px;
  transition: border-color .14s, background .14s;
}
.topbar-search:focus-within { border-color: var(--brand-2); background: #fff; }
.topbar-search input { border: none; background: none; outline: none; width: 100%; font-size: 13px; }
.dot-badge {
  position: absolute; top: 3px; right: 3px;
  min-width: 15px; height: 15px; padding: 0 4px;
  background: var(--danger); color: #fff;
  border-radius: 8px; font-size: 11px; line-height: 15px; text-align: center;
  border: 2px solid #fff; box-sizing: content-box;
}
.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 20px; transition: background .14s; }
.user-chip:hover { background: var(--bg); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-2), var(--brand-dark));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; flex: 0 0 30px;
}
.user-meta { line-height: 1.25; }
.user-meta .un { font-size: 13px; font-weight: 600; }
.user-meta .ur { font-size: 12px; color: var(--muted); }

/* 页面容器 */
.page { flex: 1 1 auto; padding: 18px 20px 40px; min-width: 0; }
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-title { font-size: 20px; font-weight: 700; letter-spacing: -.2px; }
.page-desc { font-size: 13px; color: var(--muted); margin-top: 3px; }
.page-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- 5. 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-2);
}
.card-head.no-border { border-bottom: none; }
.card-title { font-size: 14px; font-weight: 600; }
.card-sub { font-size: 12px; color: var(--muted); }
.card-body { padding: 16px; }
.card-body.tight { padding: 10px 12px; }
.card-body.flush { padding: 0; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 14px; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }

/* ---------- 6. KPI 卡片 ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 14px; }
.kpi-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform .16s, box-shadow .16s, border-color .16s;
}
.kpi-card.clickable { cursor: pointer; }
.kpi-card.clickable:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--brand-soft-2); }
.kpi-card::after {
  content: ''; position: absolute; right: -26px; top: -26px;
  width: 74px; height: 74px; border-radius: 50%;
  background: var(--brand-soft); opacity: .55;
}
.kpi-top { display: flex; align-items: center; gap: 9px; position: relative; z-index: 1; }
.kpi-ico {
  width: 30px; height: 30px; border-radius: 9px; flex: 0 0 30px;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-soft); color: var(--brand);
}
.kpi-label { font-size: 13px; color: var(--muted); }
.kpi-val { font-size: 24px; font-weight: 700; letter-spacing: -.5px; margin-top: 8px; position: relative; z-index: 1; line-height: 1.2; }
.kpi-val .u { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.kpi-foot { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; position: relative; z-index: 1; }
.kpi-delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; }
.kpi-delta.up { color: var(--up); }
.kpi-delta.down { color: var(--down); }
.kpi-delta.flat { color: var(--muted); }
.spark { position: absolute; right: 12px; bottom: 10px; opacity: .5; }

/* ---------- 7. 统计条 ---------- */
.stat-strip {
  display: flex; flex-wrap: wrap; gap: 0;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.stat-cell { flex: 1 1 0; min-width: 130px; padding: 13px 18px; border-right: 1px solid var(--border-2); }
.stat-cell:last-child { border-right: none; }
.stat-cell .sc-label { font-size: 12px; color: var(--muted); }
.stat-cell .sc-val { font-size: 20px; font-weight: 700; margin-top: 3px; letter-spacing: -.3px; }
.stat-cell .sc-val .u { font-size: 13px; color: var(--muted); font-weight: 500; }

/* ---------- 8. 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  height: 32px; padding: 0 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff; color: var(--ink-2);
  font-size: 14px; font-weight: 500;
  transition: all .14s; white-space: nowrap;
}
.btn:hover { border-color: var(--brand-soft-2); color: var(--brand); background: var(--brand-soft); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 2px 8px rgba(43,92,230,.28); }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-danger { background: #fff; border-color: #f6c9cc; color: var(--danger); }
.btn-danger:hover { background: #fef2f2; border-color: var(--danger); color: var(--danger); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--bg); color: var(--brand); border-color: transparent; }
.btn-sm { height: 26px; padding: 0 9px; font-size: 13px; border-radius: 6px; }
.btn-xs { height: 22px; padding: 0 7px; font-size: 12px; border-radius: 5px; }
.btn[disabled], .btn.is-disabled { opacity: .5; cursor: not-allowed; }
.btn[disabled]:hover, .btn.is-disabled:hover { background: #fff; color: var(--ink-2); border-color: var(--border); transform: none; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.btn-group .btn.active { background: var(--brand); border-color: var(--brand); color: #fff; z-index: 1; }

/* ---------- 9. 徽章 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1.5px 8px; border-radius: 10px;
  font-size: 12px; font-weight: 500; line-height: 18px; white-space: nowrap;
  background: #f0f2f7; color: var(--muted);
}
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.no-dot::before { display: none; }
.badge-success { background: #e8f8ee; color: #12833c; }
.badge-warn { background: #fff5e5; color: #b26a00; }
.badge-danger { background: #feecec; color: #c81e1e; }
.badge-info { background: #e7f5ff; color: #0872a8; }
.badge-brand { background: var(--brand-soft); color: var(--brand-dark); }
.badge-purple { background: #f1ecff; color: #6236d6; }
.badge-muted { background: #f0f2f7; color: #7a869e; }
.tag {
  display: inline-block; padding: 1px 7px; border-radius: 5px;
  background: var(--bg); border: 1px solid var(--border);
  font-size: 12px; color: var(--ink-2); margin: 0 4px 4px 0;
}

/* ---------- 10. 表格 ---------- */
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { font-size: 14px; min-width: 100%; }
.data-table thead th {
  background: #f5f8fd;
  color: var(--ink-2);
  font-weight: 600; font-size: 13px;
  /* v49：字号放大后同步放行距，14px 正文挤在 40px 行高里会串行 */
  text-align: left; padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap; position: sticky; top: 0; z-index: 2;
}
.data-table thead th.sortable { cursor: pointer; user-select: none; }
.data-table thead th.sortable:hover { color: var(--brand); }
.data-table thead th .sort-ind { margin-left: 3px; opacity: .4; font-size: 12px; }
.data-table thead th.sorted .sort-ind { opacity: 1; color: var(--brand); }
.data-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-2);
  color: var(--ink-2); vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #f0f5fe; }
.data-table tbody tr.clickable { cursor: pointer; }
.data-table tbody tr.selected { background: var(--brand-soft); }
.data-table .col-act { white-space: nowrap; text-align: right; }
.data-table .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.data-table input[type=checkbox] { width: 14px; height: 14px; accent-color: var(--brand); cursor: pointer; }
.table-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; border-bottom: 1px solid var(--border-2);
  background: #fff;
}
.table-toolbar .sel-info { font-size: 13px; color: var(--brand); font-weight: 500; }
.table-foot {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px; border-top: 1px solid var(--border-2);
  font-size: 13px; color: var(--muted);
}

/* ---------- 11. 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 5px; }
.field-label { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.field-label .req { color: var(--danger); margin-left: 2px; }
.input, .select, .textarea {
  width: 100%;
  height: 32px; padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff; outline: none; font-size: 14px;
  transition: border-color .14s, box-shadow .14s;
}
.textarea { height: auto; padding: 7px 10px; resize: vertical; min-height: 66px; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(75,123,255,.12); }
.input.is-error, .select.is-error { border-color: var(--danger); }
.input[readonly] { background: var(--border-2); color: var(--muted); cursor: default; }
.input[readonly]:focus { border-color: var(--border); box-shadow: none; }
.input-sm { height: 28px; font-size: 13px; }
.select { appearance: none; padding-right: 26px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%236b7793' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
.field-err { font-size: 12px; color: var(--danger); }
.field-hint { font-size: 12px; color: var(--muted-2); }
/* v32 typeahead：手工输入 + 自动匹配的下拉候选 */
.ta-wrap { position: relative; }
.ta-panel { position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 4px);
  /* ⚠ 原来写的是 var(--panel) / var(--text) —— 这两个变量**根本没定义**，
     背景解析失败 → 面板变透明，底下的表单字段透上来糊成一片。修成真实变量。 */
  max-height: 232px; overflow-y: auto; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 4px; }
.ta-item { padding: 7px 9px; border-radius: 6px; cursor: pointer; }
.ta-item:hover, .ta-item.active { background: var(--brand-weak, rgba(43,92,230,.08)); }
.ta-item-main { font-size: 14px; color: var(--ink); }
.ta-item-sub { font-size: 12px; color: var(--muted-2); margin-top: 2px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.checkbox-row { display: flex; align-items: center; gap: 7px; font-size: 14px; cursor: pointer; }
.checkbox-row input { width: 14px; height: 14px; accent-color: var(--brand); }
.switch { width: 38px; height: 20px; border-radius: 10px; background: #d5dbe7; position: relative; transition: background .18s; flex: 0 0 38px; }
.switch.on { background: var(--brand); }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .18s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch.on::after { left: 20px; }

/* 筛选栏 */
.filter-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px; background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.filter-item { display: flex; flex-direction: column; gap: 3px; min-width: 120px; }
.filter-item > label { font-size: 12px; color: var(--muted-2); padding-left: 2px; }

/* ---------- 12. Tab ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab {
  padding: 9px 15px; font-size: 14px; color: var(--muted);
  border-bottom: 2px solid transparent; white-space: nowrap;
  transition: color .14s, border-color .14s;
}
.tab:hover { color: var(--brand); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.tab .tab-cnt { font-size: 12px; background: var(--bg); border-radius: 8px; padding: 0 5px; margin-left: 5px; color: var(--muted); }
.tab.active .tab-cnt { background: var(--brand-soft); color: var(--brand); }
.pill-tabs { display: inline-flex; gap: 4px; background: var(--bg); padding: 3px; border-radius: 9px; }
.pill-tab { padding: 4px 12px; border-radius: 6px; font-size: 13px; color: var(--muted); transition: all .14s; }
.pill-tab.active { background: #fff; color: var(--brand); font-weight: 600; box-shadow: var(--shadow-sm); }

/* ---------- 13. 抽屉 / 弹窗 ---------- */
.mask {
  position: fixed; inset: 0; background: rgba(19,27,45,.42);
  z-index: 100; opacity: 0; transition: opacity .2s;
  backdrop-filter: blur(1.5px);
}
.mask.show { opacity: 1; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 560px; max-width: 94vw;
  background: #fff; z-index: 101;
  display: flex; flex-direction: column;
  box-shadow: -12px 0 40px rgba(19,27,45,.18);
  transform: translateX(100%); transition: transform .24s cubic-bezier(.32,.72,0,1);
}
.drawer.show { transform: translateX(0); }
.drawer-head {
  flex: 0 0 auto; display: flex; align-items: center; gap: 10px;
  padding: 15px 18px; border-bottom: 1px solid var(--border);
}
.drawer-title { font-size: 16px; font-weight: 600; }
.drawer-body { flex: 1 1 auto; overflow-y: auto; padding: 18px; }
.drawer-foot {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: flex-end;
  gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); background: #fafbfe;
}
.modal {
  position: fixed; z-index: 101; top: 50%; left: 50%;
  transform: translate(-50%, -46%) scale(.97);
  width: 620px; max-width: 94vw; max-height: 88vh;
  background: #fff; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  opacity: 0; transition: opacity .2s, transform .2s;
}
.modal.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.modal.wide { width: 800px; }
.modal.narrow { width: 440px; }
.modal-head { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-title { font-size: 16px; font-weight: 600; }
.modal-body { flex: 1 1 auto; overflow-y: auto; padding: 18px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 20px; border-top: 1px solid var(--border); background: #fafbfe; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* 详情描述列表 */
.desc-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px 20px; }
.desc-list.one { grid-template-columns: 1fr; }
.desc-item { min-width: 0; }
.desc-item .dl { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.desc-item .dv { font-size: 14px; color: var(--ink); word-break: break-all; }
.section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; margin: 20px 0 10px;
}
.section-title::before { content: ''; width: 3px; height: 13px; border-radius: 2px; background: var(--brand); }
.section-title:first-child { margin-top: 0; }

/* ---------- 14. 时间轴 ---------- */
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding-bottom: 18px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute; left: -24px; top: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 2px solid var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--brand);
}
.tl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-title { font-size: 14px; font-weight: 600; }
.tl-time { font-size: 12px; color: var(--muted-2); }
.tl-body { font-size: 14px; color: var(--ink-2); margin-top: 4px; line-height: 1.65; }
.tl-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ---------- 15. 进度条 ---------- */
.progress { height: 6px; background: var(--border-2); border-radius: 4px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--brand-2), var(--brand)); border-radius: 4px; transition: width .5s ease; }
.progress-bar.warn { background: linear-gradient(90deg, #fbbf24, var(--warn)); }
.progress-bar.danger { background: linear-gradient(90deg, #f87171, var(--danger)); }
.progress-bar.success { background: linear-gradient(90deg, #34d399, var(--success)); }
.progress-lg { height: 10px; border-radius: 6px; }

/* 环形进度 */
.ring { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.ring svg { transform: rotate(-90deg); }
.ring .ring-txt { position: absolute; text-align: center; }
.ring .ring-txt .rv { font-size: 22px; font-weight: 700; letter-spacing: -.5px; }
.ring .ring-txt .rl { font-size: 12px; color: var(--muted); }

/* ---------- 16. 看板 ---------- */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: flex-start; }
.kanban-col {
  flex: 0 0 218px; background: #f7f9fd;
  border: 1px solid var(--border); border-radius: var(--radius);
  display: flex; flex-direction: column; max-height: 640px;
}
.kanban-col.drag-over { border-color: var(--brand-2); background: var(--brand-soft); }
.kanban-col-head { padding: 10px 12px; border-bottom: 1px solid var(--border-2); display: flex; align-items: center; gap: 7px; }
.kanban-col-head .kc-name { font-size: 14px; font-weight: 600; }
.kanban-col-head .kc-cnt { font-size: 12px; color: var(--muted); }
.kanban-col-head .kc-amt { margin-left: auto; font-size: 12px; color: var(--brand); font-weight: 600; }
.kanban-body { padding: 9px; overflow-y: auto; flex: 1 1 auto; display: flex; flex-direction: column; gap: 8px; }
.kanban-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 11px; cursor: grab; box-shadow: var(--shadow-sm);
  transition: transform .14s, box-shadow .14s;
}
.kanban-card:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: var(--brand-soft-2); }
.kanban-card:active { cursor: grabbing; }
.kanban-card.dragging { opacity: .45; }
.kanban-card .kct { font-size: 14px; font-weight: 600; line-height: 1.4; }
.kanban-card .kcs { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kanban-card .kcf { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.kanban-card .kcamt { font-size: 14px; font-weight: 700; color: var(--brand); }

/* ---------- 17. 日历 ---------- */
.calendar { background: #fff; }
.cal-head { display: flex; align-items: center; gap: 8px; padding: 0 0 10px; }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); background: #fafbfe; border: 1px solid var(--border); border-bottom: none; border-radius: 8px 8px 0 0; }
.cal-week div { padding: 7px 0; text-align: center; font-size: 13px; color: var(--muted); font-weight: 600; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--border); border-radius: 0 0 8px 8px; overflow: hidden; }
.cal-day { min-height: 92px; padding: 6px 7px; border-right: 1px solid var(--border-2); border-bottom: 1px solid var(--border-2); background: #fff; transition: background .14s; }
.cal-day:nth-child(7n) { border-right: none; }
.cal-day:hover { background: #fbfcff; }
.cal-day.drag-over { background: var(--brand-soft); }
.cal-day.other { background: #fbfcfe; }
.cal-day.other .cal-dn { color: var(--muted-2); }
.cal-day.today { background: #f6f9ff; }
.cal-dn { font-size: 13px; color: var(--ink-2); font-weight: 600; display: flex; align-items: center; justify-content: space-between; }
.cal-dn .dn-tag { font-size: 11px; color: var(--brand); background: var(--brand-soft); border-radius: 6px; padding: 0 4px; }
.cal-events { margin-top: 4px; display: flex; flex-direction: column; gap: 3px; }
.cal-event {
  font-size: 12px; padding: 2px 6px; border-radius: 4px;
  background: var(--brand-soft); color: var(--brand-dark);
  cursor: grab; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border-left: 2.5px solid var(--brand);
}
.cal-event.c-warn { background: #fff5e5; color: #b26a00; border-left-color: var(--warn); }
.cal-event.c-success { background: #e8f8ee; color: #12833c; border-left-color: var(--success); }
.cal-event.c-purple { background: #f1ecff; color: #6236d6; border-left-color: var(--purple); }
.cal-event.c-danger { background: #feecec; color: #c81e1e; border-left-color: var(--danger); }
.cal-event.c-muted { background: #f0f2f7; color: #6b7793; border-left-color: var(--muted); }
.cal-event:active { cursor: grabbing; }

/* ---------- 18. 分页 ---------- */
.pager { display: inline-flex; align-items: center; gap: 4px; }
.pager-btn {
  min-width: 28px; height: 28px; padding: 0 7px;
  border: 1px solid var(--border); border-radius: 6px;
  background: #fff; font-size: 13px; color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .14s;
}
.pager-btn:hover:not([disabled]) { border-color: var(--brand-2); color: var(--brand); }
.pager-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.pager-btn[disabled] { opacity: .45; cursor: not-allowed; }
.pager-ellipsis { color: var(--muted-2); padding: 0 2px; }

/* ---------- 19. Toast ---------- */
.toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 10px;
  background: #fff; box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  font-size: 14px; color: var(--ink);
  min-width: 200px; max-width: 460px;
  animation: toastIn .22s ease;
  pointer-events: auto;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
.toast.out { animation: toastOut .2s ease forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px); } }
.toast-icon { width: 16px; height: 16px; flex: 0 0 16px; }
.toast-success { border-left: 3px solid var(--success); }
.toast-success .toast-icon { color: var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-error .toast-icon { color: var(--danger); }
.toast-warn { border-left: 3px solid var(--warn); }
.toast-warn .toast-icon { color: var(--warn); }
.toast-info { border-left: 3px solid var(--info); }
.toast-info .toast-icon { color: var(--info); }

/* ---------- 20. 空态 ---------- */
.empty { padding: 46px 20px; text-align: center; }
.empty-ico { width: 64px; height: 64px; margin: 0 auto 12px; color: #ccd6e8; }
.empty-txt { font-size: 14px; color: var(--muted); }
.empty-sub { font-size: 13px; color: var(--muted-2); margin-top: 4px; }
.empty-act { margin-top: 14px; }
.loading { padding: 40px; text-align: center; color: var(--muted); font-size: 13px; }
.spinner {
  width: 22px; height: 22px; margin: 0 auto 10px;
  border: 2.5px solid var(--border); border-top-color: var(--brand);
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 21. 图表容器 & 降级渲染 ---------- */
.chart { width: 100%; min-height: 60px; }
.chart-box { position: relative; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: center; margin-top: 8px; font-size: 13px; color: var(--muted); }
.chart-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* CSS 柱条降级 */
.fb-bars { display: flex; flex-direction: column; gap: 9px; padding: 4px 0; }
.fb-bar-row { display: flex; align-items: center; gap: 10px; }
.fb-bar-label { flex: 0 0 92px; font-size: 13px; color: var(--muted); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-bar-track { flex: 1 1 auto; height: 16px; background: var(--border-2); border-radius: 4px; overflow: hidden; }
.fb-bar-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--brand-2), var(--brand)); transition: width .6s ease; }
.fb-bar-val { flex: 0 0 auto; min-width: 46px; font-size: 13px; font-weight: 600; font-family: var(--mono); }

/* CSS 柱状（垂直）降级 */
.fb-vbars { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding: 8px 4px 0; }
.fb-vbar-col { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 5px; }
.fb-vbar-fill { width: 100%; max-width: 34px; border-radius: 5px 5px 0 0; background: linear-gradient(180deg, var(--brand-2), var(--brand)); transition: height .6s ease; min-height: 2px; }
.fb-vbar-lb { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* 饼图降级（conic-gradient 圆环） */
.fb-pie { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; justify-content: center; padding: 8px 0; }
.fb-pie-ring { width: 148px; height: 148px; border-radius: 50%; position: relative; flex: 0 0 148px; }
.fb-pie-ring::after { content: ''; position: absolute; inset: 30px; background: #fff; border-radius: 50%; }
.fb-pie-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 1; }
.fb-pie-center .pv { font-size: 19px; font-weight: 700; }
.fb-pie-center .pl { font-size: 12px; color: var(--muted); }
.fb-pie-legend { display: flex; flex-direction: column; gap: 7px; min-width: 130px; }
.fb-pie-leg { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.fb-pie-leg i { width: 9px; height: 9px; border-radius: 3px; flex: 0 0 9px; }
.fb-pie-leg .plv { margin-left: auto; font-family: var(--mono); font-weight: 600; }

/* 漏斗降级 */
.fb-funnel { display: flex; flex-direction: column; gap: 7px; align-items: center; padding: 6px 0; }
.fb-funnel-row { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; font-weight: 600; border-radius: 6px; padding: 9px 10px; min-height: 36px; transition: width .5s ease; }
.fb-funnel-meta { font-size: 12px; color: var(--muted); display: flex; gap: 12px; }

/* ---------- 22. 其他 ---------- */
.alert {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  font-size: 14px; border: 1px solid;
}
.alert-info { background: #f0f7ff; border-color: #cfe4fb; color: #1a5fa8; }
.alert-warn { background: #fffaf0; border-color: #fbe2b5; color: #96601a; }
.alert-danger { background: #fef4f4; border-color: #f8d3d5; color: #a32020; }
.alert-success { background: #f2fbf5; border-color: #c8ecd6; color: #17703a; }

.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border-2); }
.list-row:last-child { border-bottom: none; }
.list-row .lr-ico { width: 32px; height: 32px; border-radius: 9px; flex: 0 0 32px; display: flex; align-items: center; justify-content: center; background: var(--brand-soft); color: var(--brand); }
.list-row .lr-main { flex: 1 1 auto; min-width: 0; }
.list-row .lr-title { font-size: 14px; font-weight: 500; }
.list-row .lr-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 14px;
  background: var(--bg); border: 1px solid var(--border);
  font-size: 13px; color: var(--ink-2);
}
.chip.active { background: var(--brand-soft); border-color: var(--brand-soft-2); color: var(--brand-dark); font-weight: 500; }
.chip .chip-n { font-size: 12px; color: var(--muted); }
.chip.active .chip-n { color: var(--brand); }

.hbar-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.hbar-rank { width: 20px; height: 20px; flex: 0 0 20px; border-radius: 6px; background: var(--bg); color: var(--muted); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.hbar-rank.top1 { background: linear-gradient(135deg,#ffd76e,#f5a524); color: #7a4d00; }
.hbar-rank.top2 { background: linear-gradient(135deg,#dfe6f2,#b9c4d8); color: #4a5568; }
.hbar-rank.top3 { background: linear-gradient(135deg,#f6d5bd,#dda074); color: #7a4a20; }

.sec-nav { display: flex; flex-direction: column; gap: 2px; }
.sec-nav-item { padding: 8px 12px; border-radius: 7px; font-size: 14px; color: var(--ink-2); cursor: pointer; display: flex; align-items: center; gap: 8px; }
.sec-nav-item:hover { background: var(--bg); }
.sec-nav-item.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.sec-nav-item .sn-n { margin-left: auto; font-size: 12px; color: var(--muted); }

.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.permission-table td.chk { text-align: center; }
.permission-table input { width: 15px; height: 15px; accent-color: var(--brand); }

/* 骨架屏 */
.skeleton { background: linear-gradient(90deg, #eef1f7 25%, #f6f8fc 37%, #eef1f7 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: 6px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* 启动遮罩 */
.boot-mask { position: fixed; inset: 0; background: var(--bg); z-index: 999; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.boot-logo { width: 54px; height: 54px; border-radius: 15px; background: linear-gradient(135deg, var(--brand-2), var(--brand-dark)); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 24px; font-weight: 700; box-shadow: 0 8px 24px rgba(43,92,230,.35); }
.boot-txt { font-size: 14px; color: var(--muted); }
.boot-warn { max-width: 400px; text-align: center; }

/* ---------- 22.b 系统设置 ---------- */
.settings-split { display: grid; grid-template-columns: 246px minmax(0,1fr); gap: 16px; align-items: start; }

.role-item { padding: 10px 12px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: 10px;
  background: #fff; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.role-item:last-child { margin-bottom: 0; }
.role-item:hover { border-color: var(--brand-soft-2); background: var(--brand-soft); }
.role-item.active { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px var(--brand-soft-2); }

.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.perm-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; font-size: 14px;
  border: 1px solid var(--border); border-radius: 8px; background: #fff; cursor: pointer; user-select: none;
  transition: border-color .12s, background .12s, color .12s; }
.perm-item:hover { border-color: var(--brand-soft-2); }
.perm-item.on { border-color: var(--brand-soft-2); background: var(--brand-soft); color: var(--brand-dark); font-weight: 500; }
.perm-item input { margin: 0; accent-color: var(--brand); flex: 0 0 auto; }
.perm-item input:disabled { cursor: not-allowed; }
.perm-item:has(input:disabled) { opacity: .72; cursor: not-allowed; }

.swatch { display: inline-block; width: 28px; height: 28px; border-radius: 8px; cursor: pointer;
  border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); transition: transform .12s, box-shadow .12s; }
.swatch:hover { transform: translateY(-1px); }
.swatch.active { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--brand); }

/* ---------- 22.c 服务器同步状态徽标 ---------- */
.sync-badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 24px; padding: 0 9px; border-radius: 999px;
  font-size: 13px; white-space: nowrap; flex: 0 0 auto;
  background: var(--bg); color: var(--muted); border: 1px solid var(--border);
}
.sync-badge svg { flex: 0 0 auto; }
.sync-badge.sync-saving { color: #1a5fa8; background: #f0f7ff; border-color: #cfe4fb; }
.sync-badge.sync-saving svg { animation: xp-spin 1.1s linear infinite; }
.sync-badge.sync-saved { color: #15803d; background: #f0fdf4; border-color: #cdeed9; }
.sync-badge.sync-error, .sync-badge.sync-conflict {
  color: #a32020; background: #fef4f4; border-color: #f8d3d5; cursor: pointer;
}
@keyframes xp-spin { to { transform: rotate(360deg); } }
@media (max-width: 1023px) { .sync-badge span { display: none; } }

/* ---------- 22.d 登录页 ---------- */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px 18px;
  background:
    radial-gradient(1100px 520px at 12% -8%, #dfe8ff 0%, rgba(223,232,255,0) 62%),
    radial-gradient(900px 460px at 100% 100%, #e6f0ff 0%, rgba(230,240,255,0) 58%),
    var(--bg);
}
.login-card {
  display: grid; grid-template-columns: 1.02fr .98fr;
  width: 100%; max-width: 880px; overflow: hidden;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 20px; box-shadow: var(--shadow-lg);
}
.login-brand {
  position: relative; display: flex; flex-direction: column;
  padding: 40px 34px 30px; color: #fff;
  background: linear-gradient(152deg, #16234a 0%, #24409c 42%, #2b5ce6 100%);
}
.login-brand::after {
  content: ''; position: absolute; right: -70px; bottom: -90px;
  width: 240px; height: 240px; border-radius: 50%;
  background: rgba(255,255,255,.07);
}
.lb-mark {
  width: 52px; height: 52px; border-radius: 15px; display: flex;
  align-items: center; justify-content: center;
  font-size: 25px; font-weight: 700; letter-spacing: 1px;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.22);
  margin-bottom: 20px;
}
.lb-name { font-size: 21px; font-weight: 700; letter-spacing: .4px; }
.lb-sub { font-size: 14px; opacity: .76; margin-top: 7px; }
.lb-points { margin-top: 28px; display: flex; flex-direction: column; gap: 11px; }
.lb-point { display: flex; align-items: center; gap: 9px; font-size: 14px; opacity: .92; }
.lb-point > span {
  width: 26px; height: 26px; flex: 0 0 26px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.14);
}
.lb-foot { margin-top: auto; padding-top: 26px; font-size: 13px; opacity: .6; }

.login-form { padding: 42px 38px 34px; display: flex; flex-direction: column; }
.lf-title { font-size: 22px; font-weight: 700; letter-spacing: .5px; }
.lf-desc { font-size: 14px; color: var(--muted); margin-top: 7px; }
.lf-alert {
  display: flex; align-items: flex-start; gap: 7px; margin-top: 18px;
  padding: 10px 12px; border-radius: 10px; font-size: 14px; line-height: 1.55;
  background: #fef4f4; border: 1px solid #f8d3d5; color: #a32020;
}
.lf-alert.is-ok { background: #f0fdf4; border-color: #cdeed9; color: #15803d; }
.lf-alert svg { flex: 0 0 auto; margin-top: 2px; }
.lf-field { margin-top: 18px; }
.lf-field label { display: block; font-size: 14px; color: var(--ink-2); margin-bottom: 7px; font-weight: 500; }
.lf-field .input { height: 42px; font-size: 15px; }
.lf-remember {
  display: flex; align-items: center; gap: 6px;
  margin-top: 14px; font-size: 14px; color: var(--muted); cursor: pointer; user-select: none;
}
.lf-submit { width: 100%; height: 42px; margin-top: 20px; font-size: 15px; letter-spacing: 3px; }
.lf-tip { margin-top: auto; padding-top: 24px; font-size: 13px; color: var(--muted-2); line-height: 1.75; }
.lf-ver { margin-top: 8px; font-family: var(--mono); font-size: 12px; color: #aab3c6; }
@media (max-width: 767px) {
  .login-card { grid-template-columns: 1fr; max-width: 420px; }
  .login-brand { padding: 26px 24px 22px; }
  .lb-points, .lb-foot { display: none; }
  .login-form { padding: 26px 22px 24px; }
}

@media (max-width: 1279px) {
  .settings-split { grid-template-columns: 1fr; }
}

/* ---------- 23. 响应式 ---------- */
@media (max-width: 1439px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 1279px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-5 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .span-3 { grid-column: span 2; }
}
@media (max-width: 1023px) {
  :root { --sidebar-w: var(--sidebar-w-mini); }
  .brand-text, .nav-item .ni-text, .nav-item .ni-badge, .nav-group-title, .sidebar-foot { display: none; }
  .sidebar-brand { justify-content: center; padding: 0; }
  .nav-item { justify-content: center; padding: 9px 0; margin: 2px 8px; }
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
  .span-2, .span-3 { grid-column: auto; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .topbar-search { width: 150px; }
  .user-meta { display: none; }
  .desc-list { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .drawer { width: 100%; max-width: 100vw; }
  .page { padding: 14px 12px 40px; }
}
@media (max-width: 767px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .stat-cell { min-width: 50%; flex: 1 1 50%; }
  .topbar-search { display: none; }
  .table-toolbar { padding: 8px 10px; }
  .cal-day { min-height: 68px; }
  .cal-event { font-size: 11px; }
}
@media print {
  .sidebar, .topbar, .page-actions, .table-toolbar { display: none !important; }
  .main { margin-left: 0; }
}

/* ==========================================================================
   现场照片（其它活动登记）
   ========================================================================== */
/* 列表里的缩略图组：最多露 3 张，右上角挂张数 */
.ph-thumbs {
  display: inline-flex; align-items: center; gap: 3px;
  cursor: pointer; position: relative; padding: 2px;
  border-radius: var(--radius-sm); transition: background .15s;
}
.ph-thumbs:hover { background: var(--brand-soft); }
.ph-thumb {
  width: 38px; height: 38px; object-fit: cover;
  border-radius: 6px; border: 1px solid var(--border);
  background: var(--border-2); display: block;
}
.ph-count {
  min-width: 18px; height: 18px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; line-height: 1; color: #fff; background: rgba(26, 34, 51, .62);
  border-radius: 9px; margin-left: 1px;
}

/* 照片管理弹窗里的网格 */
.ph-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px; max-height: 46vh; overflow-y: auto;
  padding: 2px 2px 4px;
}
.ph-item {
  position: relative; border: 1px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden; background: var(--card);
}
.ph-item img {
  width: 100%; height: 104px; object-fit: cover; display: block;
  cursor: zoom-in; background: var(--border-2);
}
.ph-item .ph-x {
  position: absolute; top: 5px; right: 5px;
  width: 22px; height: 22px; line-height: 20px; text-align: center;
  border: none; border-radius: 50%; cursor: pointer;
  background: rgba(26, 34, 51, .58); color: #fff; font-size: 16px; padding: 0;
}
.ph-item .ph-x:hover { background: var(--danger); }
.ph-meta {
  padding: 5px 7px; font-size: 12px; color: var(--muted);
  border-top: 1px solid var(--border-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ph-empty {
  padding: 32px 12px; text-align: center; color: var(--muted-2);
  background: var(--bg); border: 1px dashed var(--border); border-radius: var(--radius-sm);
}

/* ==========================================================================
   招聘会「会后材料」（现场照片 / 宣传推广 / 报名资料）
   ========================================================================== */
/* 详情页卡片与汇报弹窗里的三行摘要 */
.att-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 8px 10px; margin-bottom: 6px;
  border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  background: var(--bg);
}
.att-row:last-of-type { margin-bottom: 0; }
.att-label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }

/* 汇报弹窗里的自由插槽 */
.att-slot { border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: 10px; }
.att-slot-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border-2);
}
.form-slot.full { grid-column: 1 / -1; }

/* 上传抽屉：一类一块 */
.att-block {
  padding: 10px 0 14px; border-bottom: 1px solid var(--border-2);
}
.att-block:last-of-type { border-bottom: none; }
.att-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; margin-bottom: 8px;
}
/* 文档列表：一行一个，左边图标右到左依次是文件名 / 大小 / 上传人 / 删除 */
.att-files { display: flex; flex-direction: column; gap: 6px; max-height: 34vh; overflow-y: auto; }
.att-file {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 9px; border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  background: var(--card);
}
.att-fname {
  flex: 1; min-width: 0; color: var(--brand); text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px;
}
.att-fname:hover { text-decoration: underline; }
.att-fsize { font-size: 12px; color: var(--muted); white-space: nowrap; }
.att-fby { white-space: nowrap; }

/* v32 · 回款统计里的简易表格（按人拆分 / 未收款清单） */
.tbl { font-size: 14px; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted-2);
  padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 7px 8px; border-bottom: 1px solid var(--border); }
.tbl .right { text-align: right; }
.tbl .mono { font-variant-numeric: tabular-nums; }

/* v30 · 履约合同「结案报告」：一行一份，左边缩略图（图片）或格式角标（文档） */
.rpt-list { display: flex; flex-direction: column; gap: 8px; }
.rpt-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card);
}
.rpt-thumb {
  flex: 0 0 46px; width: 46px; height: 46px; border-radius: 6px;
  overflow: hidden; background: var(--border-2); display: block;
}
.rpt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rpt-ext {
  flex: 0 0 46px; width: 46px; height: 46px; border-radius: 6px;
  background: var(--brand-soft); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 500;
}
.rpt-main { flex: 1; min-width: 0; }
.rpt-name {
  display: block; font-size: 14px; color: var(--ink); text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rpt-name:hover { color: var(--brand); text-decoration: underline; }

/* ==========================================================================
   v13 · 筹备流程进度条 / 物料子项 / 履约配额看板
   ========================================================================== */
.prep-bar {
  display: flex; align-items: stretch; gap: 6px; flex-wrap: wrap;
}
.prep-step {
  flex: 1 1 96px; min-width: 96px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 6px; border-radius: var(--radius-sm);
  background: var(--bg); border: 1px solid var(--border-2); text-align: center;
}
.prep-step .prep-dot {
  width: 22px; height: 22px; line-height: 20px; border-radius: 50%;
  font-size: 13px; font-weight: 700;
  background: var(--border-2); color: var(--muted);
}
.prep-step .prep-label { font-size: 13px; font-weight: 500; }
.prep-step .prep-sub { font-size: 12px; color: var(--muted-2); }
.prep-step.done { background: rgba(22, 163, 74, .07); border-color: rgba(22, 163, 74, .35); }
.prep-step.done .prep-dot { background: var(--success, #16a34a); color: #fff; }
.prep-step.current { border-color: var(--brand); }
.prep-step.current .prep-dot { background: var(--brand); color: #fff; }
.prep-step.pointer { cursor: pointer; }
.prep-step.pointer:hover { border-color: var(--brand); }

.prep-sub-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px;
}
.prep-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  background: var(--bg); border: 1px solid var(--border-2);
}
.prep-item .prep-chk {
  width: 18px; height: 18px; line-height: 16px; text-align: center; flex: none;
  border-radius: 4px; font-size: 13px; font-weight: 700;
  background: var(--card); border: 1px solid var(--border); color: var(--success, #16a34a);
}
.prep-item.done { background: rgba(22, 163, 74, .07); border-color: rgba(22, 163, 74, .35); }
.prep-item.done .prep-chk { background: var(--success, #16a34a); border-color: var(--success, #16a34a); color: #fff; }
.prep-item.pointer { cursor: pointer; }
.prep-item.pointer:hover { border-color: var(--brand); }

.quota-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px;
}
.quota-cell {
  padding: 12px; border-radius: var(--radius-sm);
  background: var(--bg); border: 1px solid var(--border-2);
}

/* ==========================================================================
   v49 紧凑模式 —— 在 <html> 上挂 .compact 生效
   方案B把字号整体提了一档，一屏能装的行数变少。需要高密度时切这个模式，
   恢复到接近 v48 的密度。注意：紧凑模式只回退尺寸，不回退非整数 px，
   次像素发虚的问题不会跟着回来。
   ========================================================================== */
html.compact body { font-size: 13px; }
html.compact .data-table { font-size: 13px; }
html.compact .data-table thead th { padding: 8px 10px; font-size: 12px; }
html.compact .data-table tbody td { padding: 8px 10px; }
html.compact .kpi-val { font-size: 20px; }
html.compact .stat-cell .sc-val { font-size: 18px; }
html.compact .card-body { padding: 12px; }
html.compact .filter-bar,
html.compact .table-toolbar,
html.compact .table-foot { padding: 8px 12px; }
html.compact .text-xs,
html.compact .field-hint,
html.compact .field-err,
html.compact .card-sub,
html.compact .kpi-label,
html.compact .kpi-foot { font-size: 11px; }
html.compact .text-sm { font-size: 12px; }
html.compact .text-base { font-size: 13px; }

/* 密度切换按钮 */
.density-btn {
  display: inline-flex; align-items: center; gap: 5px;
  height: 30px; padding: 0 10px; border-radius: 7px;
  border: 1px solid var(--border); background: var(--card);
  color: var(--ink-2); font-size: 12px; font-weight: 500;
  transition: background .14s, color .14s, border-color .14s;
}
.density-btn:hover { background: var(--side-bg-2); color: var(--brand); border-color: var(--brand-soft-2); }


/* ==========================================================================
   v98 · 工资条票据（pages/salary-slips.js）
   --------------------------------------------------------------------------
   ⚠ 这棵 .slip-* 的节点树同时用于**屏幕**和**打印**两种介质，两边共用一套结构。
     打印相关的规则在下面另一个 @media print 里，别混进这边。
   ========================================================================== */
.slip-print { max-width: 720px; }
.slip-ticket {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  padding: 20px 22px 16px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
}
.slip-ticket + .slip-ticket { margin-top: 14px; }

.slip-hd {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-bottom: 10px; margin-bottom: 12px;
  border-bottom: 2px solid var(--text);
}
.slip-co { font-size: 16px; font-weight: 600; letter-spacing: .5px; }
.slip-mo { font-size: 13px; color: var(--text-3); }

.slip-meta {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px 18px; padding-bottom: 10px; margin-bottom: 4px;
  border-bottom: 1px dashed var(--border);
}
.slip-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 18px; padding: 4px 0;
}

.slip-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.slip-row .slip-k { color: var(--text-3); font-size: 12.5px; white-space: nowrap; }
.slip-row .slip-v { font-variant-numeric: tabular-nums; }
.slip-row.strong {
  border-top: 1px solid var(--border); margin-top: 6px; padding-top: 7px;
  font-weight: 600;
}
.slip-row.strong .slip-k { color: var(--text-2); font-size: 13px; font-weight: 500; }

.slip-sec {
  margin: 12px 0 2px; padding: 4px 0;
  font-size: 12px; font-weight: 600; color: var(--text-2);
  border-bottom: 1px solid var(--border);
}

.slip-net {
  display: grid; grid-template-columns: auto 1fr; align-items: baseline;
  gap: 4px 14px; margin-top: 12px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-2, #f7f8fa);
}
.slip-net-l { font-size: 13px; color: var(--text-2); }
.slip-net-v { font-size: 22px; font-weight: 600; text-align: right; }
.slip-net-cn { grid-column: 1 / -1; font-size: 12px; color: var(--text-3); }

.slip-foot { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); color: var(--text-3); font-size: 12px; }
.slip-sign { margin-top: 8px; }
.slip-sign.blank { padding-top: 14px; }
.slip-note { color: var(--text-3); font-size: 11.5px; font-weight: 400; }
.slip-warn { color: var(--warn, #d97706); font-size: 11.5px; }
.slip-pagebreak { height: 0; }

/* ==========================================================================
   打印：工资条是**唯一真正被打印**的东西
   --------------------------------------------------------------------------
   做法是「临时插入 #slip-print-area + 给 body 加 .slip-printing」，
   打印完立刻撤掉 —— 所以下面这些规则只在那一瞬间生效，
   绝对不能因为改了这里就把别的页面的打印搞坏（原来的 4 行规则保持不动）。
   ========================================================================== */
@media print {
  @page { size: A4; margin: 14mm; }
  body.slip-printing > *:not(#slip-print-area) { display: none !important; }
  #slip-print-area { display: block; }
  #slip-print-area .slip-print { max-width: none; }
  .slip-ticket { border-color: #999; break-inside: avoid; page-break-inside: avoid; }
  .slip-ticket + .slip-ticket { margin-top: 0; }
  .slip-pagebreak { break-after: page; page-break-after: always; }
  .slip-net { background: #fff; }
}
