/* =============================================================
   前川集团人事工作系统 · 样式表
   浅色专业风，PC 与移动端自适应
   ============================================================= */
:root {
  --c-primary: #185FA5;
  --c-primary-d: #0C447C;
  --c-primary-l: #E6F1FB;
  --c-primary-m: #B5D4F4;
  --c-bg: #F4F6F9;
  --c-surface: #FFFFFF;
  --c-surface-2: #FAFBFC;
  --c-border: #E4E7EC;
  --c-border-2: #EEF1F5;
  --c-text: #1F2937;
  --c-text-2: #5B6B7F;
  --c-text-3: #94A3B8;
  --c-success: #1D9E75;
  --c-success-l: #E1F5EE;
  --c-warn: #BA7517;
  --c-warn-l: #FAEEDA;
  --c-danger: #D64545;
  --c-danger-l: #FCEBEB;
  --c-teal: #0F6E56;
  --c-purple: #534AB7;
  --c-purple-l: #EEEDFE;
  --radius: 10px;
  --radius-s: 6px;
  --radius-l: 14px;
  --shadow-s: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-m: 0 4px 14px rgba(16, 24, 40, .08);
  --shadow-l: 0 12px 40px rgba(16, 24, 40, .16);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--c-primary); text-decoration: none; }
h1, h2, h3, h4 { font-weight: 500; line-height: 1.35; }
input, select, textarea, button { font-family: inherit; font-size: inherit; color: inherit; }

/* ================= 登录页 ================= */
.login-wrap {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 12% 18%, #E6F1FB 0%, transparent 42%),
    radial-gradient(circle at 88% 82%, #E1F5EE 0%, transparent 45%),
    var(--c-bg);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-l);
  padding: 34px 32px 24px;
  box-shadow: var(--shadow-m);
}

.login-brand { text-align: center; margin-bottom: 26px; }

.login-logo {
  width: 52px; height: 52px; margin: 0 auto 14px;
  border-radius: 13px;
  background: var(--c-primary);
  color: #fff;
  font-size: 17px; font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: 1px;
}

.login-brand h1 { font-size: 20px; margin-bottom: 4px; }
.login-sub { font-size: 12.5px; color: var(--c-text-3); }

.field { display: block; margin-bottom: 16px; }
.field > span {
  display: block; font-size: 12.5px; color: var(--c-text-2);
  margin-bottom: 6px; font-weight: 500;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-s);
  background: var(--c-surface);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(24, 95, 165, .12);
}
.field textarea { resize: vertical; min-height: 72px; }
.field .hint { font-size: 11.5px; color: var(--c-text-3); margin-top: 4px; display: block; }

.login-err {
  min-height: 20px;
  font-size: 12.5px;
  color: var(--c-danger);
  margin-bottom: 10px;
}
.login-err:empty::before { content: ""; }

.login-foot {
  display: flex; justify-content: space-between;
  margin-top: 20px; padding-top: 14px;
  border-top: 1px solid var(--c-border-2);
  font-size: 11.5px; color: var(--c-text-3);
}

/* 备案信息公示位：国内公网部署的法定展示位，置于登录页（即网站首页）底部 */
.site-legal {
  margin-top: 16px; text-align: center;
  font-size: 12px; line-height: 2; color: var(--c-text-3);
}
.site-legal a { color: var(--c-text-3); text-decoration: none; }
.site-legal a:hover { color: var(--c-primary); text-decoration: underline; }
.site-legal .sep { margin: 0 7px; opacity: .5; }

@media (max-width: 560px) {
  .site-legal { font-size: 11px; line-height: 1.9; }
}

/* ================= 按钮 ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 15px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-s);
  background: var(--c-surface);
  color: var(--c-text);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  font-size: 13px;
}
.btn:hover { border-color: var(--c-primary-m); background: var(--c-surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-d); border-color: var(--c-primary-d); }
.btn-danger { color: var(--c-danger); border-color: #F0C4C4; background: #fff; }
.btn-danger:hover { background: var(--c-danger-l); border-color: var(--c-danger); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--c-text-2); }
.btn-ghost:hover { background: var(--c-border-2); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-block { width: 100%; padding: 11px; font-size: 14.5px; }

.icon-btn {
  width: 30px; height: 30px;
  border: none; background: transparent; border-radius: var(--radius-s);
  font-size: 20px; line-height: 1; color: var(--c-text-2);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--c-border-2); }

.link-btn {
  border: none; background: none; color: var(--c-primary);
  cursor: pointer; font-size: 12.5px; padding: 0;
}
.link-btn:hover { text-decoration: underline; }

/* ================= 主框架 ================= */
.app { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: 224px; flex-shrink: 0;
  background: var(--c-surface);
  border-right: 1px solid var(--c-border);
  display: flex; flex-direction: column;
  z-index: 30;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 17px 18px;
  border-bottom: 1px solid var(--c-border-2);
}
.brand-logo {
  width: 34px; height: 34px; flex-shrink: 0;
  border-radius: 9px; background: var(--c-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 500; letter-spacing: .5px;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: 14px; font-weight: 500; }
.brand-text small { font-size: 11px; color: var(--c-text-3); }

.nav { flex: 1; overflow-y: auto; padding: 10px 10px 20px; }
.nav-group { margin-bottom: 14px; }
.nav-group-title {
  font-size: 11px; color: var(--c-text-3); letter-spacing: .6px;
  padding: 6px 10px 5px; font-weight: 500;
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: var(--radius-s);
  cursor: pointer; color: var(--c-text-2);
  font-size: 13.5px; margin-bottom: 1px;
  transition: background .13s, color .13s;
}
.nav-item:hover { background: var(--c-border-2); color: var(--c-text); }
.nav-item.active { background: var(--c-primary-l); color: var(--c-primary-d); font-weight: 500; }
.nav-item .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; opacity: .45; flex-shrink: 0;
}
.nav-item .nav-badge {
  margin-left: auto; font-size: 10.5px; padding: 1px 6px;
  border-radius: 8px; background: var(--c-border-2); color: var(--c-text-3);
}
.nav-item.active .nav-badge { background: var(--c-primary-m); color: var(--c-primary-d); }
.nav-item .stage-tag {
  margin-left: auto; font-size: 10px; color: var(--c-text-3);
  border: 1px solid var(--c-border); border-radius: 4px; padding: 0 4px;
}

.sidebar-foot {
  padding: 12px 18px; border-top: 1px solid var(--c-border-2);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11.5px; color: var(--c-text-3);
}

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 56px; flex-shrink: 0;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; gap: 14px;
  padding: 0 20px;
  position: relative; z-index: 20;
}
.crumb { font-size: 15px; font-weight: 500; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.scope-badge {
  font-size: 11.5px; color: var(--c-primary-d);
  background: var(--c-primary-l); border: 1px solid var(--c-primary-m);
  padding: 3px 9px; border-radius: 20px; white-space: nowrap;
}
.scope-badge:empty { display: none; }

.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 8px 4px 4px; border-radius: 20px;
  cursor: pointer; transition: background .15s;
}
.user-chip:hover { background: var(--c-border-2); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--c-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; flex-shrink: 0;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.25; }
.user-meta strong { font-size: 13px; font-weight: 500; }
.user-meta small { font-size: 10.5px; color: var(--c-text-3); }

.user-menu {
  position: absolute; right: 18px; top: 52px;
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius); box-shadow: var(--shadow-m);
  padding: 5px; min-width: 152px; z-index: 50;
}
.user-menu a {
  display: block; padding: 8px 12px; border-radius: var(--radius-s);
  font-size: 13px; color: var(--c-text); cursor: pointer;
}
.user-menu a:hover { background: var(--c-border-2); }
.user-menu a.danger { color: var(--c-danger); }

.hamburger {
  display: none; width: 34px; height: 34px;
  border: 1px solid var(--c-border); background: var(--c-surface);
  border-radius: var(--radius-s); cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.hamburger span { width: 15px; height: 1.5px; background: var(--c-text-2); display: block; }

.mobile-mask {
  display: none; position: fixed; inset: 0;
  background: rgba(16, 24, 40, .35); z-index: 29;
}

.view { flex: 1; overflow-y: auto; padding: 20px; }

/* ================= 卡片 ================= */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}
.card-head {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--c-border-2);
}
.card-head h3 { font-size: 14px; }
.card-head .sub { font-size: 11.5px; color: var(--c-text-3); }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 16px; }
.card-body.tight { padding: 0; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* ================= KPI ================= */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.kpi {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 14px 15px;
  position: relative; overflow: hidden;
}
.kpi::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--c-primary);
}
.kpi.tone-success::after { background: var(--c-success); }
.kpi.tone-warn::after { background: var(--c-warn); }
.kpi.tone-danger::after { background: var(--c-danger); }
.kpi.tone-purple::after { background: var(--c-purple); }
.kpi-label { font-size: 12px; color: var(--c-text-2); margin-bottom: 6px; }
.kpi-value {
  font-size: 25px; font-weight: 500; line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.kpi-value small { font-size: 12.5px; font-weight: 400; color: var(--c-text-3); margin-left: 3px; }
.kpi-foot { font-size: 11.5px; color: var(--c-text-3); margin-top: 5px; }

/* ================= 表格 ================= */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  text-align: left; font-weight: 500; font-size: 12px;
  color: var(--c-text-2); background: var(--c-surface-2);
  padding: 10px 12px; border-bottom: 1px solid var(--c-border);
  white-space: nowrap; position: sticky; top: 0; z-index: 2;
}
table.tbl td {
  padding: 10px 12px; border-bottom: 1px solid var(--c-border-2);
  vertical-align: middle;
}
table.tbl tbody tr:hover { background: #FAFCFF; }
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl td.center, table.tbl th.center { text-align: center; }
table.tbl .row-actions { display: flex; gap: 6px; white-space: nowrap; }
.cell-strong { font-weight: 500; }
.cell-sub { font-size: 11.5px; color: var(--c-text-3); }

/* ================= 标签 ================= */
.tag {
  display: inline-flex; align-items: center;
  font-size: 11.5px; padding: 2px 8px; border-radius: 4px;
  background: var(--c-border-2); color: var(--c-text-2);
  white-space: nowrap; line-height: 1.7;
}
.tag-primary { background: var(--c-primary-l); color: var(--c-primary-d); }
.tag-success { background: var(--c-success-l); color: var(--c-teal); }
.tag-warn { background: var(--c-warn-l); color: var(--c-warn); }
.tag-danger { background: var(--c-danger-l); color: var(--c-danger); }
.tag-purple { background: var(--c-purple-l); color: var(--c-purple); }
.tag-plain { background: transparent; border: 1px solid var(--c-border); }

/* ================= 筛选栏 ================= */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 9px; align-items: center;
  padding: 13px 16px; border-bottom: 1px solid var(--c-border-2);
  background: var(--c-surface-2);
}
.filter-bar input[type=text], .filter-bar input[type=date],
.filter-bar input[type=month], .filter-bar select {
  padding: 6px 10px; border: 1px solid var(--c-border);
  border-radius: var(--radius-s); background: #fff; outline: none;
  font-size: 13px; min-width: 110px;
}
.filter-bar input[type=text] { min-width: 180px; }
.filter-bar input:focus, .filter-bar select:focus {
  border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(24, 95, 165, .1);
}
.filter-bar .spacer { margin-left: auto; }

/* ================= 分页 ================= */
.pager {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-top: 1px solid var(--c-border-2);
  font-size: 12.5px; color: var(--c-text-2);
}
.pager .pages { display: flex; gap: 4px; margin-left: auto; }
.pager .pg {
  min-width: 30px; height: 30px; padding: 0 8px;
  border: 1px solid var(--c-border); background: #fff;
  border-radius: var(--radius-s); cursor: pointer; font-size: 12.5px;
  display: flex; align-items: center; justify-content: center;
}
.pager .pg:hover:not(:disabled) { border-color: var(--c-primary-m); }
.pager .pg.active { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.pager .pg:disabled { opacity: .4; cursor: not-allowed; }

/* ================= 空态 / 加载 ================= */
.empty { text-align: center; padding: 52px 20px; color: var(--c-text-3); }
.empty .icon {
  width: 42px; height: 42px; margin: 0 auto 12px;
  border: 1.5px dashed var(--c-border); border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; color: var(--c-text-3);
}
.empty p { font-size: 13px; }
.empty .hint { font-size: 12px; margin-top: 4px; }

.skeleton {
  height: 14px; border-radius: 4px;
  background: linear-gradient(90deg, #EEF1F5 25%, #F7F9FC 50%, #EEF1F5 75%);
  background-size: 200% 100%;
  animation: sk 1.3s ease-in-out infinite;
}
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.loading-pad { padding: 40px; display: flex; flex-direction: column; gap: 10px; }

/* ================= 弹窗 / 抽屉 ================= */
/* hidden 属性优先于一切 display 规则：.modal/.drawer/.modal-foot 等类选择器
   与 UA 样式表 [hidden]{display:none} 优先级相同，作者样式会覆盖 UA 样式，
   导致带 hidden 的弹窗永远显示。必须显式抬高 [hidden] 的优先级。 */
[hidden] { display: none !important; }
.modal, .drawer { position: fixed; inset: 0; z-index: 100; display: flex; }
.modal-mask, .drawer-mask { position: absolute; inset: 0; background: rgba(16, 24, 40, .4); }

.modal { align-items: center; justify-content: center; padding: 20px; }
.modal-panel {
  position: relative; background: var(--c-surface);
  border-radius: var(--radius-l); box-shadow: var(--shadow-l);
  width: 100%; max-width: 560px; max-height: 88vh;
  display: flex; flex-direction: column;
}
.modal-panel.wide { max-width: 840px; }
.modal-head {
  display: flex; align-items: center; padding: 16px 18px;
  border-bottom: 1px solid var(--c-border-2);
}
.modal-head h3 { font-size: 15px; flex: 1; }
.modal-body { padding: 18px; overflow-y: auto; flex: 1; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 9px;
  padding: 13px 18px; border-top: 1px solid var(--c-border-2);
}

.drawer { justify-content: flex-end; }
.drawer-panel {
  position: relative; background: var(--c-surface);
  width: 100%; max-width: 620px; height: 100%;
  box-shadow: var(--shadow-l); display: flex; flex-direction: column;
}
.drawer-head {
  display: flex; align-items: center; padding: 16px 20px;
  border-bottom: 1px solid var(--c-border-2);
}
.drawer-head h3 { font-size: 15px; flex: 1; }
.drawer-body { padding: 20px; overflow-y: auto; flex: 1; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .span-2 { grid-column: span 2; }
.section-title {
  font-size: 12px; color: var(--c-text-3); font-weight: 500;
  letter-spacing: .5px; margin: 18px 0 10px; padding-bottom: 6px;
  border-bottom: 1px solid var(--c-border-2);
}
.section-title:first-child { margin-top: 0; }

/* 描述列表 */
.desc-list { display: grid; grid-template-columns: 96px 1fr; gap: 9px 14px; font-size: 13px; }
.desc-list dt { color: var(--c-text-3); font-size: 12.5px; }
.desc-list dd { color: var(--c-text); word-break: break-all; }

/* ================= 提示条 ================= */
.toast-box {
  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 {
  background: #2C3E50; color: #fff;
  padding: 9px 18px; border-radius: 22px;
  font-size: 13px; box-shadow: var(--shadow-m);
  animation: tin .22s ease-out;
  max-width: 78vw; text-align: center;
}
.toast.ok { background: #14674F; }
.toast.err { background: #A32D2D; }
.toast.warn { background: #8A5A10; }
@keyframes tin { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.alert {
  padding: 11px 14px; border-radius: var(--radius-s);
  font-size: 12.5px; margin-bottom: 14px; line-height: 1.6;
}
.alert-info { background: var(--c-primary-l); color: var(--c-primary-d); border: 1px solid var(--c-primary-m); }
.alert-warn { background: var(--c-warn-l); color: #7A4E0C; border: 1px solid #EDD9A8; }
.alert-danger { background: var(--c-danger-l); color: var(--c-danger); border: 1px solid #F3C7C7; }
.alert-success { background: var(--c-success-l); color: var(--c-teal); border: 1px solid #A9DCC9; }

/* ================= 图表 ================= */
.chart-row { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 10px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; }
.chart-col .bars { flex: 1; display: flex; align-items: flex-end; gap: 2px; width: 100%; justify-content: center; }
.chart-col .bar { width: 46%; border-radius: 3px 3px 0 0; min-height: 2px; transition: height .3s; }
.chart-col .bar.in { background: var(--c-primary); }
.chart-col .bar.out { background: #E8B4B4; }
.chart-col .lab { font-size: 10.5px; color: var(--c-text-3); white-space: nowrap; }

.legend { display: flex; gap: 14px; font-size: 12px; color: var(--c-text-2); flex-wrap: wrap; }
.legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; margin-right: 5px; }

.bar-list { display: flex; flex-direction: column; gap: 9px; }
.bar-item { display: grid; grid-template-columns: 120px 1fr 62px; gap: 10px; align-items: center; font-size: 12.5px; }
.bar-item .name { color: var(--c-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-item .track { height: 8px; background: var(--c-border-2); border-radius: 4px; overflow: hidden; }
.bar-item .fill { height: 100%; background: var(--c-primary); border-radius: 4px; transition: width .35s; }
.bar-item .val { text-align: right; font-variant-numeric: tabular-nums; color: var(--c-text-2); }

/* ================= 部门树 ================= */
.tree { font-size: 13.5px; }
.tree-node { border-bottom: 1px solid var(--c-border-2); }
.tree-node:last-child { border-bottom: none; }
.tree-row {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; cursor: pointer; transition: background .13s;
}
.tree-row:hover { background: #FAFCFF; }
.tree-toggle {
  width: 17px; height: 17px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: var(--c-text-3);
  transition: transform .16s;
}
.tree-toggle.open { transform: rotate(90deg); }
.tree-toggle.leaf { visibility: hidden; }
.tree-name { font-weight: 500; }
.tree-meta { font-size: 11.5px; color: var(--c-text-3); }
.tree-actions { margin-left: auto; display: flex; gap: 5px; opacity: 0; transition: opacity .13s; }
.tree-row:hover .tree-actions { opacity: 1; }
.tree-children { padding-left: 20px; }

/* ================= 九宫格 ================= */
.grid9 { display: grid; grid-template-columns: 68px repeat(3, 1fr); gap: 8px; }
.grid9 .axis {
  display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; color: var(--c-text-3); text-align: center;
}
.grid9 .cell {
  border-radius: var(--radius-s); padding: 11px 12px; min-height: 92px;
  border: 1px solid var(--c-border); background: var(--c-surface);
  display: flex; flex-direction: column; gap: 3px;
}
.grid9 .cell .cell-label { font-size: 12.5px; font-weight: 500; }
.grid9 .cell .cell-count { font-size: 21px; font-weight: 500; font-variant-numeric: tabular-nums; }
.grid9 .cell .cell-act { font-size: 10.5px; color: var(--c-text-3); line-height: 1.4; margin-top: auto; }
.grid9 .cell.lv-3 { background: var(--c-success-l); border-color: #A9DCC9; }
.grid9 .cell.lv-2 { background: var(--c-primary-l); border-color: var(--c-primary-m); }
.grid9 .cell.lv-1 { background: var(--c-warn-l); border-color: #EDD9A8; }
.grid9 .cell.clickable { cursor: pointer; }
.grid9 .cell.clickable:hover { box-shadow: var(--shadow-s); border-color: var(--c-primary); }

/* ================= 选项卡 ================= */
.tabs {
  display: flex; gap: 3px; border-bottom: 1px solid var(--c-border);
  padding: 0 16px; background: var(--c-surface); overflow-x: auto;
}
.tab {
  padding: 11px 15px; cursor: pointer; font-size: 13.5px;
  color: var(--c-text-2); border-bottom: 2px solid transparent;
  white-space: nowrap; transition: color .13s, border-color .13s;
}
.tab:hover { color: var(--c-text); }
.tab.active { color: var(--c-primary-d); border-bottom-color: var(--c-primary); font-weight: 500; }

/* ================= 权限矩阵 ================= */
.perm-group { border: 1px solid var(--c-border); border-radius: var(--radius-s); margin-bottom: 11px; }
.perm-group-head {
  padding: 8px 12px; background: var(--c-surface-2);
  border-bottom: 1px solid var(--c-border-2);
  font-size: 12.5px; font-weight: 500;
  display: flex; align-items: center; gap: 9px;
}
.perm-items { padding: 10px 12px; display: flex; flex-wrap: wrap; gap: 9px 18px; }
.perm-items label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; cursor: pointer; }
.checkbox { width: 15px; height: 15px; accent-color: var(--c-primary); cursor: pointer; }

/* ================= 其他 ================= */
.row-flex { display: flex; align-items: center; gap: 9px; }
.row-flex.wrap { flex-wrap: wrap; }
.muted { color: var(--c-text-3); font-size: 12.5px; }
.mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 12px; }
.mt-8 { margin-top: 8px; } .mt-14 { margin-top: 14px; } .mt-20 { margin-top: 20px; }
.mb-8 { margin-bottom: 8px; } .mb-14 { margin-bottom: 14px; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.stat-line { display: flex; justify-content: space-between; padding: 7px 0; font-size: 13px; border-bottom: 1px dashed var(--c-border-2); }
.stat-line:last-child { border-bottom: none; }
.stat-line .k { color: var(--c-text-2); }
.stat-line .v { font-weight: 500; font-variant-numeric: tabular-nums; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ================= 响应式 ================= */
@media (max-width: 1000px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: var(--shadow-l);
  }
  .sidebar.open { transform: none; }
  .mobile-mask.show { display: block; }
  .hamburger { display: flex; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .view { padding: 13px; }
  .topbar { padding: 0 13px; height: 52px; }
  .user-meta { display: none; }
  .scope-badge { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
  .drawer-panel { max-width: 100%; }
  .modal-panel { max-width: 100%; }
  .bar-item { grid-template-columns: 84px 1fr 52px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi-value { font-size: 21px; }
  .grid9 { grid-template-columns: 46px repeat(3, 1fr); gap: 5px; }
  .grid9 .cell { padding: 8px; min-height: 74px; }
  .grid9 .cell .cell-count { font-size: 17px; }
  .grid9 .cell .cell-act { display: none; }
  .filter-bar input[type=text] { min-width: 130px; }
  .desc-list { grid-template-columns: 82px 1fr; }
}
