/* =========================================================
   浙江华移 · 4A赋权系统
   主色 #1BA6FF / 浅色企业后台
   ========================================================= */
:root {
  --primary: #1ba6ff;
  --primary-600: #0e93ec;
  --primary-700: #0b78c4;
  --primary-050: #eff8ff;
  --primary-100: #dceeff;
  --primary-200: #bfe3ff;

  --ink: #0e1f35;
  --text: #33475f;
  --muted: #7c8fa8;
  --faint: #a5b4c6;

  --bg: #f4f8fd;
  --card: #ffffff;
  --line: #e6edf6;
  --line-strong: #d6e1ee;

  --green: #12b76a;
  --green-bg: #e8f9f1;
  --amber: #e79a1b;
  --amber-bg: #fff6e6;
  --red: #ef4a3d;
  --red-bg: #fef0ee;
  --purple: #7a5af8;
  --purple-bg: #f1eefe;
  --teal: #0ea5a5;
  --teal-bg: #e6f7f7;

  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(16, 40, 73, 0.05);
  --shadow-md: 0 10px 30px rgba(16, 40, 73, 0.09);
  --shadow-lg: 0 24px 60px rgba(14, 31, 53, 0.16);
  --font: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
h1, h2, h3, h4, p { margin: 0; }
::selection { background: var(--primary-100); }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cbd8e7; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b3c4d8; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 布局 ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 236px;
  flex: 0 0 236px;
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 30;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 16px;
}
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(145deg, #38b6ff, #1ba6ff 55%, #0b8ee0);
  display: grid; place-items: center;
  box-shadow: 0 6px 14px rgba(27, 166, 255, 0.32);
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-name { font-size: 16px; font-weight: 700; color: var(--ink); letter-spacing: 0.3px; line-height: 1.15; }
.brand-sub { font-size: 11px; color: var(--muted); margin-top: 2px; letter-spacing: 0.5px; }

.nav { flex: 1; overflow-y: auto; padding: 6px 0 16px; }
.nav-group { padding: 14px 20px 6px; font-size: 11px; color: var(--faint); letter-spacing: 1.2px; font-weight: 600; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  height: 40px; margin: 2px 10px; padding: 0 12px;
  border-radius: 9px; color: var(--text); font-size: 13.5px;
  position: relative; transition: background 0.15s, color 0.15s;
}
.nav-item svg { width: 18px; height: 18px; color: var(--muted); transition: color 0.15s; flex: 0 0 18px; }
.nav-item:hover { background: #f5f9ff; color: var(--ink); }
.nav-item:hover svg { color: var(--primary-600); }
.nav-item.active { background: linear-gradient(90deg, #e9f6ff, #f7fcff); color: var(--primary-700); font-weight: 600; }
.nav-item.active svg { color: var(--primary); }
.nav-item.active::before {
  content: ""; position: absolute; left: -10px; top: 9px; bottom: 9px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--primary);
}
.nav-badge {
  margin-left: auto; min-width: 20px; height: 18px; padding: 0 6px;
  border-radius: 9px; background: var(--primary-050); color: var(--primary-700);
  font-size: 11px; font-weight: 600; display: grid; place-items: center;
}
.nav-badge.warn { background: var(--amber-bg); color: #a96b00; }

.sidebar-foot { padding: 12px; border-top: 1px solid var(--line); }
.sync-pill {
  display: flex; align-items: center; gap: 7px; padding: 9px 10px; margin-bottom: 8px;
  border-radius: 9px; background: #f7fbff; border: 1px solid #e8f3ff;
  font-size: 11.5px; color: var(--muted);
}
.sync-pill .pulse {
  width: 7px; height: 7px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 3px rgba(18, 183, 106, 0.16);
}
.user-mini {
  display: flex; align-items: center; gap: 9px; padding: 8px 8px;
  border-radius: 10px; transition: background 0.15s;
}
.user-mini:hover { background: #f6faff; }
.user-mini .info { min-width: 0; flex: 1; }
.user-mini .name { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-mini .role { font-size: 11px; color: var(--muted); margin-top: 1px; }
.logout-btn { width: 28px; height: 28px; border-radius: 7px; border: none; background: transparent; color: var(--faint); display: grid; place-items: center; }
.logout-btn:hover { background: var(--red-bg); color: var(--red); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 62px; flex: 0 0 62px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.crumb b { color: var(--ink); font-weight: 600; }
.crumb .sep { color: #cbd8e7; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.top-user { display: flex; align-items: center; gap: 9px; padding-left: 12px; margin-left: 4px; border-left: 1px solid var(--line); }

/* 内容区跟随窗口自适应：不再固定上限，避免大屏下内容全部挤在左侧 */
.view { padding: 24px clamp(20px, 1.8vw, 40px) 48px; width: 100%; animation: fadeUp 0.28s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- 页头 ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.page-head h1 { font-size: 22px; font-weight: 700; color: var(--ink); letter-spacing: 0.2px; }
.page-head .sub { margin-top: 6px; font-size: 13px; color: var(--muted); }
.page-head .actions { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }

/* ---------- 卡片 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-head { padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 15px; font-weight: 650; color: var(--ink); }
.card-head .desc { font-size: 12px; color: var(--muted); margin-top: 3px; }
.card-body { padding: 20px; }
.card-body.tight { padding: 0; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-dash { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-12 { margin-top: 12px; }
.mt-8 { margin-top: 8px; }

/* ---------- 统计卡 ---------- */
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 18px 16px; position: relative; overflow: hidden; transition: box-shadow 0.2s, transform 0.2s;
}
.stat:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat .top { display: flex; align-items: center; justify-content: space-between; }
.stat .label { font-size: 12.5px; color: var(--muted); }
.stat .ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-050); color: var(--primary-600); }
.stat .ico svg { width: 19px; height: 19px; }
.stat .value { font-size: 28px; font-weight: 700; color: var(--ink); margin-top: 10px; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat .value small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.stat .foot { margin-top: 8px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat .foot .up { color: var(--green); font-weight: 600; }
.stat .foot .down { color: var(--red); font-weight: 600; }
.stat.accent { background: linear-gradient(150deg, #ffffff 0%, #f5fbff 100%); }
.stat.purple .ico { background: var(--purple-bg); color: var(--purple); }
.stat.green .ico { background: var(--green-bg); color: var(--green); }
.stat.amber .ico { background: var(--amber-bg); color: var(--amber); }

/* ---------- 徽章 / 标签 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px;
  border-radius: 6px; font-size: 12px; font-weight: 500; white-space: nowrap; line-height: 1;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.blue { background: var(--primary-050); color: var(--primary-700); }
.badge.green { background: var(--green-bg); color: #0b7f4d; }
.badge.amber { background: var(--amber-bg); color: #a36900; }
.badge.red { background: var(--red-bg); color: #c0392b; }
.badge.gray { background: #f1f5fa; color: #6b7f97; }
.badge.purple { background: var(--purple-bg); color: #5b3fd4; }
.badge.teal { background: var(--teal-bg); color: #0b7d7d; }
.badge.outline { background: #fff; border: 1px solid var(--line-strong); color: var(--text); }

.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px;
  border-radius: 7px; background: #f4f8fd; border: 1px solid #e8eff8; color: var(--text); font-size: 12px;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; }
.chip.plain { background: #fff; }

/* ---------- 按钮 ---------- */
.btn {
  height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 13px; font-weight: 500; transition: 0.16s ease; white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: linear-gradient(180deg, #34b4ff, #1ba6ff); color: #fff; box-shadow: 0 5px 14px rgba(27, 166, 255, 0.28); }
.btn-primary:hover { filter: brightness(1.04); transform: translateY(-1px); box-shadow: 0 7px 18px rgba(27, 166, 255, 0.34); }
.btn-primary:active { transform: none; }
.btn-ghost { background: #fff; border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--primary-200); color: var(--primary-700); background: #fbfdff; }
.btn-danger { background: #fff; border-color: #f8d3cf; color: var(--red); }
.btn-danger:hover { background: var(--red-bg); border-color: #f3bcb6; }
.btn-solid-danger { background: linear-gradient(180deg, #f5655a, #ef4a3d); color: #fff; box-shadow: 0 5px 14px rgba(239, 74, 61, 0.24); }
.btn-solid-danger:hover { filter: brightness(1.04); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 6px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-lg { height: 44px; font-size: 14px; padding: 0 20px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none !important; box-shadow: none; }
.btn-link { border: none; background: none; color: var(--primary-600); font-size: 12.5px; padding: 2px 4px; }
.btn-link:hover { color: var(--primary-700); text-decoration: underline; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 8px; background: #fff; border: 1px solid var(--line);
  color: var(--muted); display: inline-grid; place-items: center; transition: 0.15s;
}
.icon-btn:hover { color: var(--primary-600); border-color: var(--primary-200); background: #fbfdff; }
.icon-btn svg { width: 16px; height: 16px; }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; min-width: 0; }
.field label { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; display: flex; align-items: center; gap: 3px; }
.field label .req { color: var(--red); }
.field .hint { font-size: 11.5px; color: var(--faint); margin-top: 5px; }
.input, .select, textarea.input {
  height: 36px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 11px;
  font-size: 13px; color: var(--ink); background: #fff; outline: none; transition: 0.15s; width: 100%;
}
.input::placeholder { color: #b3c1d2; }
.input:focus, .select:focus, textarea.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(27, 166, 255, 0.13); }
.input:disabled { background: #f6f9fd; color: var(--muted); }
textarea.input { height: auto; min-height: 76px; padding: 9px 11px; resize: vertical; line-height: 1.6; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237c8fa8' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .span-2 { grid-column: span 2; }
.form-section { margin-bottom: 22px; }
.form-section:last-child { margin-bottom: 0; }
.form-section-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 650; color: var(--ink); margin-bottom: 12px; }
.form-section-title::before { content: ""; width: 3px; height: 13px; border-radius: 2px; background: var(--primary); }
.search-box { position: relative; }
.search-box svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--faint); pointer-events: none; }
.search-box .input { padding-left: 33px; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text); cursor: pointer; }
.check input { width: 15px; height: 15px; accent-color: var(--primary); }

/* ---------- 工具栏 / 筛选 ---------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; flex-wrap: wrap; }
.toolbar .left, .toolbar .right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .search-box { width: 248px; }
.filter-pills { display: inline-flex; gap: 4px; padding: 3px; background: #f2f7fd; border-radius: 9px; }
.filter-pills button {
  height: 28px; padding: 0 12px; border: none; background: transparent; border-radius: 7px;
  font-size: 12.5px; color: var(--muted); transition: 0.15s;
}
.filter-pills button:hover { color: var(--ink); }
.filter-pills button.active { background: #fff; color: var(--primary-700); font-weight: 600; box-shadow: var(--shadow-sm); }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--muted);
  background: #f8fbfe; padding: 11px 16px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table th:first-child { padding-left: 20px; }
.table td { padding: 13px 16px; border-bottom: 1px solid #eef3f9; font-size: 13px; color: var(--text); vertical-align: middle; }
.table td:first-child { padding-left: 20px; }
.table tbody tr { transition: background 0.12s; cursor: default; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr:hover td { background: #f9fcff; }
.table tbody tr:last-child td { border-bottom: none; }
.table .num { font-variant-numeric: tabular-nums; }
.table .muted { color: var(--muted); font-size: 12.5px; }
.table .strong { color: var(--ink); font-weight: 600; }
.cell-user { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.cell-user .name-line { display: flex; align-items: center; gap: 7px; }
.cell-user .name { font-weight: 600; color: var(--ink); font-size: 13.5px; }
.cell-user .sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.row-actions { display: flex; align-items: center; gap: 2px; justify-content: flex-end; opacity: 0.65; transition: opacity 0.15s; }
tr:hover .row-actions { opacity: 1; }
.avatar {
  width: 34px; height: 34px; border-radius: 10px; flex: 0 0 34px;
  display: grid; place-items: center; font-size: 13px; font-weight: 650;
  background: var(--primary-050); color: var(--primary-700);
}
.avatar.lg { width: 52px; height: 52px; border-radius: 14px; font-size: 18px; }
.avatar.sm { width: 28px; height: 28px; border-radius: 8px; font-size: 11.5px; flex-basis: 28px; }
.avatar.c1 { background: #eaf4ff; color: #1274c4; }
.avatar.c2 { background: #f1eefe; color: #5b3fd4; }
.avatar.c3 { background: #e8f8f2; color: #0b7f4d; }
.avatar.c4 { background: #fff4e5; color: #a36900; }
.avatar.c5 { background: #fdeff7; color: #b0337a; }

/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-top: 1px solid var(--line); }
.pager .info { font-size: 12.5px; color: var(--muted); }
.pager .pages { display: flex; gap: 4px; align-items: center; }
.pager button {
  min-width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--line);
  background: #fff; color: var(--text); font-size: 12.5px; padding: 0 8px;
}
.pager button:hover:not(:disabled) { border-color: var(--primary-200); color: var(--primary-700); }
.pager button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager button:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- 空状态 / 加载 ---------- */
.empty { padding: 56px 20px; text-align: center; color: var(--muted); }
.empty .art { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 18px; background: var(--primary-050); display: grid; place-items: center; color: var(--primary); }
.empty .art svg { width: 30px; height: 30px; }
.empty h4 { font-size: 14px; color: var(--ink); margin-bottom: 5px; font-weight: 600; }
.empty p { font-size: 12.5px; }
.skeleton { background: linear-gradient(90deg, #f1f5fa 25%, #f8fbfe 37%, #f1f5fa 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.loading-page { display: grid; gap: 16px; }
.loading-page .skeleton { height: 96px; }

/* ---------- 标签页 ---------- */
.tabs { display: flex; gap: 2px; padding: 0 8px; border-bottom: 1px solid var(--line); }
.tab { padding: 13px 14px; font-size: 13.5px; color: var(--muted); border: none; background: none; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 6px; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--primary-700); border-bottom-color: var(--primary); font-weight: 600; }
.tab .count { font-size: 11px; background: #eef4fb; color: var(--muted); border-radius: 8px; padding: 1px 6px; }
.tab.active .count { background: var(--primary-050); color: var(--primary-700); }

/* ---------- 抽屉 / 弹窗 ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(14, 31, 53, 0.42); z-index: 90;
  display: flex; animation: fade 0.18s ease both;
}
.overlay.drawer-overlay { justify-content: flex-end; }
.overlay.modal-overlay { align-items: center; justify-content: center; padding: 24px; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.drawer {
  /* 随窗口自适应：窄屏保底 720，宽屏最多 1200，避免大屏下表单被压成细长条 */
  width: clamp(720px, 58vw, 1200px); max-width: 96vw;
  height: 100%; background: #fff; display: flex; flex-direction: column;
  box-shadow: -20px 0 60px rgba(14, 31, 53, 0.18); animation: slideIn 0.26s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes slideIn { from { transform: translateX(30px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.drawer-head { padding: 20px 24px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.drawer-head h2 { font-size: 17px; font-weight: 700; color: var(--ink); }
.drawer-head .sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 22px 24px 30px; }
.drawer-foot { padding: 14px 24px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; background: #fbfdff; }
.close-x { width: 30px; height: 30px; border-radius: 8px; border: none; background: #f4f8fd; color: var(--muted); display: grid; place-items: center; }
.close-x:hover { background: #eaf3fb; color: var(--ink); }
.modal {
  width: min(720px, 94vw); max-height: 88vh; background: #fff; border-radius: 16px;
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: pop 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
.modal.narrow { width: min(480px, 94vw); }
.modal.wide { width: min(920px, 96vw); }
@keyframes pop { from { transform: scale(0.96) translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { padding: 20px 24px 16px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.modal-head h3 { font-size: 16.5px; font-weight: 700; color: var(--ink); }
.modal-head .sub { margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.modal-body { padding: 4px 24px 20px; overflow-y: auto; flex: 1; }
.modal-foot { padding: 14px 24px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; background: #fbfdff; border-radius: 0 0 16px 16px; }

/* ---------- Toast ---------- */
.toast-root { position: fixed; top: 20px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  min-width: 260px; max-width: 380px; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow-md); padding: 12px 14px;
  display: flex; align-items: flex-start; gap: 10px; animation: toastIn 0.24s ease both;
  font-size: 13px; color: var(--text);
}
@keyframes toastIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
.toast .ico { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 20px; margin-top: 1px; }
.toast .ico svg { width: 12px; height: 12px; }
.toast.success .ico { background: var(--green-bg); color: var(--green); }
.toast.error .ico { background: var(--red-bg); color: var(--red); }
.toast.info .ico { background: var(--primary-050); color: var(--primary); }
.toast .msg { line-height: 1.5; }
.toast .msg b { display: block; color: var(--ink); font-weight: 600; margin-bottom: 2px; }

/* ---------- 登录页 ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.08fr 0.92fr; background: #fff; }
.login-brand {
  position: relative; overflow: hidden; padding: 56px 64px; color: #fff;
  background: linear-gradient(140deg, #0a72bd 0%, #1ba6ff 52%, #55c7ff 100%);
  display: flex; flex-direction: column;
}
.login-brand::before {
  content: ""; position: absolute; width: 560px; height: 560px; border-radius: 50%;
  right: -190px; top: -190px; background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.28), rgba(255,255,255,0) 62%);
}
.login-brand::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 46px 46px; mask-image: radial-gradient(circle at 70% 20%, #000 0%, transparent 72%);
}
.login-brand .logo { display: flex; align-items: center; gap: 12px; position: relative; z-index: 2; }
.login-brand .logo-mark { width: 42px; height: 42px; border-radius: 12px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28); display: grid; place-items: center; backdrop-filter: blur(6px); }
.login-brand .logo-mark svg { width: 24px; height: 24px; }
.login-brand .logo-name { font-size: 18px; font-weight: 700; letter-spacing: 0.4px; }
.login-brand .logo-sub { font-size: 11.5px; opacity: 0.78; margin-top: 2px; letter-spacing: 1px; }
.login-hero { position: relative; z-index: 2; margin: auto 0; max-width: 480px; }
.login-hero .eyebrow { display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 11px; border-radius: 13px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.24); font-size: 11.5px; letter-spacing: .6px; }
.login-hero h1 { font-size: clamp(26px, 2.6vw, 38px); line-height: 1.28; font-weight: 700; margin: 0 0 18px; letter-spacing: 0.5px; white-space: nowrap; }
.login-hero p { font-size: 14px; line-height: 1.9; color: rgba(255,255,255,.82); max-width: 400px; }
.login-feats { margin-top: 32px; display: grid; gap: 14px; }
.login-feat { display: flex; gap: 12px; align-items: flex-start; }
.login-feat .fi { width: 32px; height: 32px; border-radius: 9px; background: rgba(255,255,255,.15); display: grid; place-items: center; flex: 0 0 32px; }
.login-feat .fi svg { width: 16px; height: 16px; }
.login-feat b { font-size: 13.5px; font-weight: 600; }
.login-feat span { display: block; font-size: 12px; color: rgba(255,255,255,.72); margin-top: 3px; line-height: 1.6; }
.login-foot { position: relative; z-index: 2; font-size: 11.5px; color: rgba(255,255,255,.6); letter-spacing: 0.4px; }

.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px; }
.login-card { width: min(392px, 100%); }
.login-card h2 { font-size: 24px; font-weight: 700; color: var(--ink); letter-spacing: 0.2px; }
.login-card .lead { color: var(--muted); font-size: 13px; margin: 8px 0 28px; }
.login-card .field { margin-bottom: 16px; }
.login-card .input { height: 44px; font-size: 14px; border-radius: 9px; }
.login-submit { margin-top: 8px; }
.login-err { background: var(--red-bg); color: #c0392b; border-radius: 8px; padding: 9px 12px; font-size: 12.5px; margin-bottom: 14px; display: none; }
.login-err.show { display: block; }
.demo-box { margin-top: 26px; border: 1px dashed var(--line-strong); border-radius: 10px; padding: 13px 14px; background: #fbfdff; }
.demo-box .t { font-size: 11.5px; color: var(--muted); margin-bottom: 9px; display: flex; align-items: center; gap: 5px; }
.demo-accounts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.demo-accounts button {
  border: 1px solid var(--line); background: #fff; border-radius: 7px; padding: 7px 9px; text-align: left;
  font-size: 11.5px; color: var(--text); transition: 0.15s;
}
.demo-accounts button:hover { border-color: var(--primary-200); background: var(--primary-050); }
.demo-accounts b { display: block; color: var(--ink); font-size: 12px; }
.demo-accounts span { color: var(--faint); }

.login-assist { display: flex; justify-content: flex-end; margin: -6px 0 14px; }
.login-assist a { font-size: 12.5px; color: var(--primary-700); }
.login-assist a:hover { text-decoration: underline; }

/* ---------- 员工自助找回密码 ---------- */
.auth-page {
  min-height: 100vh; padding: 40px 20px; display: grid; place-items: center;
  background:
    radial-gradient(900px 480px at 12% -10%, #e4f4ff 0%, rgba(228, 244, 255, 0) 62%),
    radial-gradient(760px 420px at 92% 8%, #eef7ff 0%, rgba(238, 247, 255, 0) 58%),
    #f5f9fe;
}
.auth-card {
  width: min(520px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow-lg); padding: 28px 30px 26px;
}
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.auth-card h1 { font-size: 21px; font-weight: 700; color: var(--ink); letter-spacing: 0.2px; }
.auth-card .lead { margin-top: 8px; font-size: 12.5px; line-height: 1.75; color: var(--muted); }
.auth-card .field { margin-bottom: 14px; }
.auth-card .field label { font-size: 12.5px; }
.auth-card .input { height: 42px; border-radius: 9px; }
.auth-card .code-input {
  height: 54px; font-size: 24px; font-weight: 700; letter-spacing: 10px;
  text-align: center; padding-left: 12px;
}
.link-btn {
  background: none; border: none; padding: 0; font-family: inherit; cursor: pointer;
  color: var(--primary-700); font-size: 11.5px;
}
.link-btn:hover { text-decoration: underline; }
.link-btn:disabled { color: var(--faint); cursor: default; text-decoration: none; }
.auth-card form { margin-top: 4px; }

.auth-steps { display: flex; align-items: center; gap: 8px; margin: 18px 0; }
.auth-step { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--faint); white-space: nowrap; }
.auth-step .n {
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 20px;
  background: #eff5fb; color: var(--muted); font-size: 11px; font-weight: 700;
}
.auth-step.on { color: var(--primary-700); font-weight: 600; }
.auth-step.on .n { background: var(--primary); color: #fff; box-shadow: 0 0 0 3px rgba(27, 166, 255, 0.14); }
.auth-step.done .n { background: var(--green); color: #fff; }
.auth-sep { flex: 1; height: 1px; background: var(--line); min-width: 10px; }

.auth-identity {
  display: flex; align-items: center; gap: 11px; padding: 11px 13px; margin-bottom: 16px;
  border-radius: 11px; background: #f6fbff; border: 1px solid #e3f1ff;
}
.auth-identity .ai-ico {
  width: 30px; height: 30px; border-radius: 9px; flex: 0 0 30px;
  background: var(--primary-050); color: var(--primary-700); display: grid; place-items: center;
}
.auth-identity .ai-name { font-size: 13.5px; font-weight: 650; color: var(--ink); }
.auth-identity .ai-name span { font-size: 11.5px; font-weight: 500; color: var(--muted); margin-left: 6px; }
.auth-identity .ai-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; word-break: break-all; }

.auth-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; font-size: 11.5px; color: var(--faint); }
.auth-foot a { display: inline-flex; align-items: center; gap: 3px; color: var(--primary-700); }
.auth-foot a:hover { text-decoration: underline; }

.auth-success { text-align: center; padding: 6px 0 4px; }
.auth-success .as-ico {
  width: 54px; height: 54px; border-radius: 50%; margin: 0 auto 14px; display: grid; place-items: center;
  color: #fff; background: linear-gradient(140deg, #34c98a, #12b76a); box-shadow: 0 10px 22px rgba(18, 183, 106, 0.28);
}
.auth-success h1 { font-size: 20px; }
.auth-success .lead { margin-top: 8px; }
.as-systems { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 16px 0 4px; }
.as-chip {
  display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: 13px;
  background: var(--primary-050); color: var(--primary-700); font-size: 11.5px; font-weight: 600;
}

@media (max-width: 520px) {
  .auth-card { padding: 22px 18px; }
  .auth-foot { flex-direction: column; align-items: flex-start; }
}

/* ---------- 图表 ---------- */
.donut-wrap { display: flex; align-items: center; gap: 22px; }
.donut { position: relative; flex: 0 0 auto; }
.donut .center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.donut .center .v { font-size: 24px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.1; }
.donut .center .l { font-size: 11px; color: var(--muted); margin-top: 2px; }
.legend { display: grid; gap: 10px; flex: 1; }
.legend-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.legend-row .sq { width: 8px; height: 8px; border-radius: 3px; flex: 0 0 8px; }
.legend-row .n { margin-left: auto; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.legend-row .pct { width: 38px; text-align: right; font-size: 11.5px; color: var(--muted); }

.bar-list { display: grid; gap: 14px; }
.bar-row .top { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 6px; }
.bar-row .top .n { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.bar-track { height: 7px; border-radius: 4px; background: #f0f5fb; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, #8bd3ff, #1ba6ff); transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.bar-row:nth-child(2) .bar-fill { background: linear-gradient(90deg, #b9b0ff, #7a5af8); }
.bar-row:nth-child(3) .bar-fill { background: linear-gradient(90deg, #7fe3c4, #12b76a); }
.bar-row:nth-child(4) .bar-fill { background: linear-gradient(90deg, #ffd28a, #f5a623); }
.bar-row:nth-child(5) .bar-fill { background: linear-gradient(90deg, #8fe0e0, #0ea5a5); }
.bar-row:nth-child(6) .bar-fill { background: linear-gradient(90deg, #ffb9b2, #ef4a3d); }

.chart-svg { width: 100%; height: auto; overflow: visible; }
.chart-legend { display: flex; gap: 16px; font-size: 11.5px; color: var(--muted); }
.chart-legend .k { display: flex; align-items: center; gap: 6px; }
.chart-legend .k i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

/* ---------- 列表 / 时间线 ---------- */
.list { display: grid; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 13px 20px; border-bottom: 1px solid #eef3f9; }
.list-row:last-child { border-bottom: none; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .t { font-size: 13px; color: var(--ink); font-weight: 550; }
.list-row .s { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 1px; background: #e2ebf5; }
.tl-item { position: relative; padding: 0 0 18px 4px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: -18px; top: 5px; width: 7px; height: 7px; border-radius: 50%; background: #fff; border: 2px solid var(--primary); }
.tl-item.gray::before { border-color: var(--faint); }
.tl-item.red::before { border-color: var(--red); }
.tl-item.green::before { border-color: var(--green); }
.tl-item .t { font-size: 13px; color: var(--ink); font-weight: 560; }
.tl-item .d { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.6; }
.tl-item .m { font-size: 11px; color: var(--faint); margin-top: 4px; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- 详情 / 系统卡 ---------- */
.detail-hero { display: flex; gap: 14px; align-items: center; padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.detail-hero .meta { flex: 1; min-width: 0; }
.detail-hero h2 { font-size: 19px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.detail-hero .sub { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; }
.info-item .k { font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.info-item .v { font-size: 13px; color: var(--ink); font-weight: 500; word-break: break-all; }
.info-section { margin-bottom: 22px; }
.info-section:last-child { margin-bottom: 0; }
.info-section h4 { font-size: 12px; color: var(--faint); letter-spacing: 0.8px; font-weight: 600; margin-bottom: 12px; }

.system-card { padding: 18px 18px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; transition: 0.2s; }
.system-card:hover { border-color: var(--primary-200); box-shadow: var(--shadow-md); }
.system-card .head { display: flex; align-items: center; gap: 11px; }
.system-card .ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: #fff; }
.system-card .ico svg { width: 20px; height: 20px; }
.system-card .name { font-size: 14px; font-weight: 650; color: var(--ink); }
.system-card .desc { font-size: 11.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; }
.system-card .nums { display: flex; gap: 18px; margin: 16px 0 12px; }
.system-card .nums .n { font-size: 18px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.system-card .nums .l { font-size: 11px; color: var(--muted); margin-top: 2px; }
.progress { height: 6px; border-radius: 4px; background: #f0f5fb; overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 4px; background: var(--primary); transition: width 0.5s; }
.system-card .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; font-size: 11.5px; color: var(--muted); }

.account-card { border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: flex; gap: 12px; align-items: flex-start; }
.account-card .ico { width: 32px; height: 32px; border-radius: 9px; background: var(--primary-050); color: var(--primary-700); display: grid; place-items: center; flex: 0 0 32px; }
.account-card .ico svg { width: 16px; height: 16px; }
.account-card .name { font-size: 13px; font-weight: 600; color: var(--ink); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.account-card .login { font-size: 11.5px; color: var(--muted); margin-top: 3px; word-break: break-all; }
.account-card .roles { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- 选择卡（角色） ---------- */
.option-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.option-card { border: 1.5px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; cursor: pointer; transition: 0.15s; background: #fff; }
.option-card:hover { border-color: var(--primary-200); background: #fbfdff; }
.option-card.checked { border-color: var(--primary); background: var(--primary-050); box-shadow: 0 0 0 3px rgba(27, 166, 255, 0.08); }
.option-card input { margin-top: 2px; accent-color: var(--primary); width: 15px; height: 15px; flex: 0 0 auto; }
.option-card .oc-name { font-size: 13px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.option-card .oc-desc { font-size: 11.5px; color: var(--muted); margin-top: 4px; line-height: 1.5; }

.perm-groups { display: grid; gap: 8px; }
.perm-group { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.perm-group .pg-head { display: flex; align-items: center; gap: 8px; padding: 10px 13px; background: #f9fbfe; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.perm-group .pg-body { padding: 11px 13px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 14px; }
.perm-group .pg-body.hidden { display: none; }
.perm-item { display: flex; align-items: flex-start; gap: 7px; font-size: 12.5px; color: var(--text); cursor: pointer; }
.perm-item input { margin-top: 2px; accent-color: var(--primary); }
.perm-item .code { display: block; font-size: 10.5px; color: var(--faint); font-family: ui-monospace, Menlo, monospace; margin-top: 2px; }

/* ---------- 提示条 ---------- */
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; font-size: 12.5px; line-height: 1.65; }
.notice svg { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 1px; }
.notice.info { background: var(--primary-050); color: #14628f; border: 1px solid #d6eeff; }
.notice.warn { background: var(--amber-bg); color: #8a5a00; border: 1px solid #ffe6bd; }
.notice.danger { background: var(--red-bg); color: #a92f24; border: 1px solid #fad7d3; }
.notice.success { background: var(--green-bg); color: #0b6b43; border: 1px solid #c9f0dd; }
.notice b { color: inherit; }

/* ---------- 系统切换 ---------- */
.segmented { display: inline-flex; padding: 4px; background: #edf4fc; border-radius: 10px; gap: 3px; }
.segmented button { height: 32px; padding: 0 14px; border: none; background: transparent; border-radius: 7px; font-size: 13px; color: var(--text); display: inline-flex; align-items: center; gap: 7px; transition: 0.15s; }
.segmented button .dot { width: 7px; height: 7px; border-radius: 50%; }
.segmented button.active { background: #fff; color: var(--primary-700); font-weight: 600; box-shadow: var(--shadow-sm); }

.kv-strip { display: flex; gap: 26px; flex-wrap: wrap; }
.kv-strip .item .k { font-size: 11.5px; color: var(--muted); }
.kv-strip .item .v { font-size: 14px; color: var(--ink); font-weight: 600; margin-top: 3px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1240px) {
  .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-dash { grid-template-columns: 1fr; }
}
@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login { grid-template-columns: 1fr; }
  .login-brand { display: none; }
}
@media (max-width: 860px) {
  .sidebar { display: none; }
  .view { padding: 18px 16px 40px; }
  .topbar { padding: 0 16px; }
  .grid-5, .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr 1fr; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .info-grid, .form-grid, .option-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
}

/* 宽屏：抽屉变宽后表单改三列，避免输入框被拉成长条 */
@media (min-width: 1500px) {
  .drawer .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .drawer .form-grid .span-2 { grid-column: span 3; }
  .drawer .info-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- 授权选择器 ---------- */
.grant-block { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; transition: 0.15s; background: #fff; }
.grant-block.on { border-color: var(--primary-200); background: #fcfeff; box-shadow: 0 0 0 3px rgba(27, 166, 255, 0.05); }
.grant-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grant-head .sys { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.grant-head .sys .ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: #fff; }
.grant-head .sys .ico svg { width: 15px; height: 15px; }
.grant-body { margin-top: 14px; display: grid; gap: 12px; transition: 0.15s; }
.grant-body.off { opacity: 0.42; pointer-events: none; filter: grayscale(0.4); }
.grant-block details summary { cursor: pointer; font-size: 12.5px; color: var(--primary-700); outline: none; list-style: none; display: flex; align-items: center; gap: 6px; }
.grant-block details summary::-webkit-details-marker { display: none; }
.grant-block details[open] summary { margin-bottom: 10px; }
.summary-card { position: sticky; top: 78px; }
.summary-card .srow { display: flex; justify-content: space-between; padding: 9px 0; font-size: 12.5px; border-bottom: 1px dashed var(--line); }
.summary-card .srow:last-child { border-bottom: none; }
.summary-card .srow .k { color: var(--muted); }
.summary-card .srow .v { color: var(--ink); font-weight: 600; text-align: right; max-width: 60%; }
.step-row { display: flex; gap: 10px; }
.step-row .step { flex: 1; height: 3px; border-radius: 2px; background: #e9f1fa; overflow: hidden; }
.step-row .step.done { background: var(--primary); }

/* ---------- 员工选择器 ---------- */
.pick-list { max-height: 190px; overflow-y: auto; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.pick-row { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-bottom: 1px solid #f1f6fb; cursor: pointer; font-size: 12.5px; }
.pick-row:last-child { border-bottom: none; }
.pick-row:hover { background: #f9fcff; }
.pick-row input { accent-color: var(--primary); }
.pick-row .meta { margin-left: auto; font-size: 11px; color: var(--faint); }
.chosen-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chosen-chips .chip { background: var(--primary-050); border-color: #d9efff; color: var(--primary-700); }
.chip .rm { cursor: pointer; color: var(--primary-600); display: inline-flex; }
.chip .rm:hover { color: var(--red); }

/* ---------- 权限矩阵 ---------- */
.matrix-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; max-height: 60vh; }
.matrix { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.matrix th, .matrix td { padding: 9px 12px; border-bottom: 1px solid #eef3f9; text-align: center; white-space: nowrap; }
.matrix thead th { position: sticky; top: 0; background: #f8fbfe; z-index: 2; font-weight: 600; color: var(--ink); border-bottom: 1px solid var(--line); }
.matrix thead th:first-child { left: 0; z-index: 3; text-align: left; }
.matrix td:first-child { position: sticky; left: 0; background: #fff; text-align: left; z-index: 1; border-right: 1px solid #f1f6fb; }
.matrix tr.module-row td { background: #f5f9fd; font-weight: 600; color: var(--muted); text-align: left; font-size: 11.5px; letter-spacing: .5px; }
.matrix tbody tr:hover td { background: #fbfdff; }
.matrix tbody tr:hover td:first-child { background: #fbfdff; }
.matrix input { accent-color: var(--primary); width: 14px; height: 14px; }
.matrix .pname { display: block; font-weight: 500; color: var(--ink); }
.matrix .pcode { display: block; font-size: 10.5px; color: var(--faint); font-family: ui-monospace, Menlo, monospace; margin-top: 2px; }
