/* ============================================================
   三人行 OA · 设计系统 v6
   风格：全浅色 · 清爽 SaaS 风 · 蓝金双色点缀
   浅色侧边栏（白底，原版白底 LOGO 自然融入）/ 电光蓝主色 / 浅色内容区
   图标保留彩色渐变实底风格；金色仅作品牌点缀（LOGO / 标题条 / 登录按钮）
   兼容：保留全部历史类名与 JS 钩子，app.js 内联 var(--bg)/var(--border)/var(--text-2) 可用
   ============================================================ */

:root {
  /* ---- 品牌色：科技蓝为主 + 金色点缀（呼应 LOGO） ---- */
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-strong: #1E40AF;
  --primary-soft: #EFF4FF;
  --primary-ring: rgba(37, 99, 235, .18);
  --accent: #06B6D4;
  --accent-soft: #E0F7FA;
  --gold: #E8A82A;
  --gold-soft: #FCF3DC;
  --gold-deep: #B07A14;
  --success: #059669;
  --success-soft: #E7F8F1;
  --warning: #D97706;
  --warning-soft: #FEF4E6;
  --danger: #DC2626;
  --danger-soft: #FDEBEB;

  /* 侧边栏：浅色（白底，原版白底 LOGO 自然融入） */
  --sidebar-bg: #FFFFFF;
  --sidebar-bg-2: #F6F8FC;
  --sidebar-text: #5A6B85;
  --sidebar-text-hover: #0F172A;
  --sidebar-active: #EFF4FF;
  --sidebar-active-text: #1D4ED8;

  /* 内容区：清爽浅色（带一丝蓝调） */
  --bg: #F4F6FB;
  --card: #FFFFFF;
  --border: #E6EAF3;
  --border-strong: #D5DBE8;
  --text: #0F172A;
  --text-2: #475569;
  --muted: #94A3B8;

  /* ---- 字体（中文企业级栈） ---- */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro SC", "PingFang SC",
          "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", sans-serif;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 14px;
  --fs-lg: 16px;
  --fs-xl: 20px;
  --fs-2xl: 28px;

  /* ---- 间距 ---- */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;

  /* ---- 圆角 / 阴影（SaaS 轻量级） ---- */
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .05);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, .07), 0 2px 4px rgba(15, 23, 42, .04);
  --shadow-lg: 0 18px 44px rgba(15, 23, 42, .16), 0 4px 12px rgba(15, 23, 42, .08);
  --shadow-blue: 0 8px 20px rgba(37, 99, 235, .30);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  font-size: var(--fs-md);
  color: var(--text);
  background:
    radial-gradient(1000px 500px at 100% -10%, rgba(37, 99, 235, .045), transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
::selection { background: rgba(37, 99, 235, .20); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #C7D2E5; border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #A8B8D4; background-clip: content-box; border: 2px solid transparent; }
::-webkit-scrollbar-track { background: transparent; }
button { font-family: var(--font); }

/* ============ 布局骨架 ============ */
.layout { display: flex; min-height: 100vh; }
/* 启动前隐藏主页面，避免「先显示 OA 再跳登录页」的闪烁 */
body.preboot .layout { display: none !important; }

/* ============ 侧边栏（深海军蓝 + 顶部金色光晕承接 LOGO） ============ */
.sidebar {
  width: 236px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  border-right: 1px solid var(--border);
}
.sidebar-logo {
  display: flex;
  align-items: center;
  padding: var(--sp-5) var(--sp-5) var(--sp-4);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-3);
  position: relative;
  z-index: 1;
}
.sidebar-brand {
  width: 100%;
  max-width: 196px;
  height: auto;
  display: block;
  border-radius: 6px;
  /* 透明底 LOGO：静态无阴影，完全融入背景 */
}

.sidebar-nav { flex: 1; padding: var(--sp-2) var(--sp-3) var(--sp-4); position: relative; z-index: 1; }
.nav-group-title {
  font-size: var(--fs-xs);
  color: #94A3B8;
  font-weight: 600;
  letter-spacing: 1.5px;
  padding: var(--sp-4) var(--sp-3) var(--sp-2);
}
.nav-group-title:first-child { color: var(--gold-deep); }
.nav-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 10px var(--sp-3);
  margin-bottom: 3px;
  border-radius: var(--r-md);
  color: var(--sidebar-text);
  font-size: var(--fs-md);
  cursor: pointer;
  position: relative;
  transition: background .18s, color .18s, transform .12s;
}
.nav-item:hover { background: #F1F4F9; color: var(--sidebar-text-hover); }
.nav-item:active { transform: scale(.985); }
.nav-item.active {
  background: var(--sidebar-active);
  color: var(--sidebar-active-text);
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -12px; top: 50%;
  transform: translateY(-50%);
  width: 4px; height: 22px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, #3B82F6, #2563EB 55%, #1D4ED8);
  box-shadow: 0 0 8px rgba(37, 99, 235, .4);
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; stroke: currentColor; }
.nav-item .nav-badge {
  margin-left: auto;
  background: linear-gradient(135deg, #60A5FA, #2563EB);
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 600;
  min-width: 19px; height: 19px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 6px;
  box-shadow: 0 2px 6px rgba(37, 99, 235, .4);
}
.nav-item.active .nav-badge { background: #fff; color: var(--primary); box-shadow: 0 1px 3px rgba(37, 99, 235, .25); }

.sidebar-footer {
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--border);
  font-size: var(--fs-xs);
  color: #94A3B8;
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  z-index: 1;
}
/* 侧边栏底部「退出登录」——图标/文字颜色与其余导航项保持一致 */
.nav-logout {
  margin-top: auto;
  border-top: 1px solid var(--border);
  border-radius: 0;
}
.nav-logout svg { stroke: currentColor; }
.nav-logout:hover { background: #F1F4F9; color: var(--sidebar-text-hover); }
.sidebar-footer::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #60A5FA;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, .22);
}

/* ============ 主区域 ============ */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* 顶栏（玻璃拟态） */
.topbar {
  height: 62px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--sp-6);
  gap: var(--sp-4);
  position: sticky;
  top: 0;
  z-index: 50;
}
.breadcrumb { font-size: var(--fs-md); color: var(--muted); }
.breadcrumb b { color: var(--text); font-weight: 600; }
.breadcrumb .crumb-user { color: var(--text); font-weight: 600; }
.breadcrumb .crumb-sep { color: var(--muted); margin: 0 8px; }
.topbar-search {
  display: flex; align-items: center;
  background: #F0F3F9;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 7px var(--sp-4);
  width: 264px;
  gap: var(--sp-2);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.topbar-search:focus-within {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
.topbar-search svg { width: 15px; height: 15px; stroke: var(--muted); flex-shrink: 0; }
.topbar-search input { border: none; outline: none; background: none; flex: 1; font-size: var(--fs-sm); color: var(--text); }
.topbar-search input::placeholder { color: var(--muted); }
.topbar-user {
  display: flex; align-items: center; gap: var(--sp-2);
  cursor: pointer; position: relative;
  padding: 5px 10px 5px 6px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s;
}
.topbar-user:hover { background: #F0F3F9; border-color: var(--border); }
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #60A5FA, #2563EB 55%, #1D4ED8);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-sm); font-weight: 700;
  box-shadow: 0 2px 8px rgba(37, 99, 235, .36);
}
.topbar-user .name { font-size: var(--fs-sm); color: var(--text-2); font-weight: 500; }
.topbar-user svg { width: 14px; height: 14px; stroke: var(--muted); }

/* 内容区 */
.content { padding: var(--sp-6); flex: 1; }
#viewRoot > * { animation: viewIn .28s ease; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: var(--sp-5); gap: var(--sp-3); flex-wrap: wrap; }
.page-head h2 {
  font-size: 22px; font-weight: 700;
  letter-spacing: .3px;
  display: flex; align-items: center; gap: 10px;
  line-height: 1.3;
}
.page-head h2::before {
  content: '';
  width: 4px; height: 20px;
  border-radius: 3px;
  background: linear-gradient(180deg, #F4C24F, #E8A82A 55%, #C8871A);
  box-shadow: 0 2px 6px rgba(232, 168, 42, .45);
}
.page-head .desc { font-size: var(--fs-sm); color: var(--muted); margin-top: 4px; }

/* ============ 卡片 ============ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--sp-5);
  transition: box-shadow .2s ease, border-color .2s ease;
}
.card:hover { border-color: #DCE3F2; }
.card-head {
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3);
}
.card-head h3 { font-size: var(--fs-lg); font-weight: 600; letter-spacing: .2px; }
.card-head h3::before {
  content: '';
  display: inline-block;
  width: 3px; height: 14px;
  border-radius: 2px;
  background: var(--primary);
  margin-right: 8px;
  vertical-align: -1px;
}
.card-body { padding: var(--sp-5); }
.card-body.flush { padding: 0; }
.card-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px dashed var(--border);
}

/* 统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); margin-bottom: var(--sp-5); }
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: var(--sp-4);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #CBD5EF; }
.stat-demo .stat-card { position: relative; overflow: hidden; }
.stat-demo .stat-card::after {
  content: '示意数据';
  position: absolute;
  top: 8px; right: -14px;
  background: rgba(15, 23, 42, .05);
  color: var(--muted);
  font-size: 10px;
  padding: 2px 18px;
  transform: rotate(38deg);
  letter-spacing: 1px;
}
.stat-icon {
  width: 48px; height: 48px;
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: #fff;
}
.stat-icon svg { width: 22px; height: 22px; stroke: currentColor; }
/* 经典彩色渐变实底图标（v3 风格回归） */
.stat-icon.blue { background: linear-gradient(135deg, #60A5FA, #2563EB 55%, #1D4ED8); box-shadow: 0 6px 14px rgba(37, 99, 235, .32); }
.stat-icon.green { background: linear-gradient(135deg, #34D399, #059669); box-shadow: 0 6px 14px rgba(5, 150, 105, .26); }
.stat-icon.amber { background: linear-gradient(135deg, #FBBF24, #D97706); box-shadow: 0 6px 14px rgba(217, 119, 6, .26); }
.stat-icon.red { background: linear-gradient(135deg, #F87171, #DC2626); box-shadow: 0 6px 14px rgba(220, 38, 38, .24); }
.stat-value { font-size: var(--fs-2xl); font-weight: 700; line-height: 1.15; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.stat-label { font-size: var(--fs-sm); color: var(--muted); margin-top: 3px; }
.stat-trend { font-size: var(--fs-xs); margin-top: 5px; font-weight: 500; }
.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); }

/* ============ 表格 ============ */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
.table th {
  text-align: left;
  padding: 12px var(--sp-4);
  background: #F5F8FE;
  color: #8A97AD;
  font-weight: 600;
  font-size: var(--fs-xs);
  letter-spacing: .6px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 13px var(--sp-4);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #F4F7FE; }
.table tbody tr:last-child td { border-bottom: none; }
.table .cell-name { font-weight: 500; color: var(--text); }
.table .cell-muted { color: var(--muted); font-size: var(--fs-sm); }

/* ============ 徽章 ============ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: .2px;
}
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; margin-right: 6px; background: currentColor; opacity: .75; }
.badge-blue { background: var(--primary-soft); color: var(--primary-strong); }
.badge-green { background: var(--success-soft); color: var(--success); }
.badge-amber { background: var(--warning-soft); color: var(--warning); }
.badge-red { background: var(--danger-soft); color: var(--danger); }
.badge-gray { background: #F1F4F9; color: var(--text-2); }
.badge-gray::before { background: var(--muted); }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--text-2);
  font-size: var(--fs-md);
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: all .16s ease;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.btn svg { width: 15px; height: 15px; stroke: currentColor; }
.btn:hover { border-color: var(--primary); color: var(--primary-strong); background: var(--primary-soft); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary {
  background: linear-gradient(135deg, #3B82F6 0%, #2563EB 55%, #1D4ED8 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--shadow-blue);
}
.btn.primary:hover { background: linear-gradient(135deg, #2563EB, #1D4ED8); color: #fff; box-shadow: 0 6px 18px rgba(37, 99, 235, .44); }
.btn.danger { color: var(--danger); border-color: #F5C6C6; }
.btn.danger:hover { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.btn.sm { padding: 5px 12px; font-size: var(--fs-sm); border-radius: var(--r-sm); }
.btn.ghost { border-color: transparent; background: none; box-shadow: none; }
.btn.ghost:hover { background: var(--bg); color: var(--text); border-color: transparent; }

/* ============ 表单 ============ */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.form-grid .full { grid-column: 1 / -1; }
.field { margin-bottom: var(--sp-4); }
.field label { display: block; font-size: var(--fs-sm); color: var(--text-2); margin-bottom: 7px; font-weight: 500; }
.field input[type=text], .field input[type=password], .field input[type=number],
.field input[type=date], .field input[type=month], .field select, .field textarea {
  width: 100%;
  padding: 10px var(--sp-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  font-size: var(--fs-md);
  font-family: var(--font);
  color: var(--text);
  background-color: var(--card);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
.field input:disabled { background: var(--bg); color: var(--muted); }
.field textarea { min-height: 92px; resize: vertical; }
.field .hint { font-size: var(--fs-xs); color: var(--muted); margin-top: 5px; }

/* ============ 筛选栏 ============ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--sp-5);
  flex-wrap: wrap;
}
.filter-bar input, .filter-bar select {
  padding: 8px var(--sp-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  font-family: var(--font);
  color: var(--text);
  background-color: var(--card);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.filter-bar input:focus, .filter-bar select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }

/* ---- 原生 select 统一美化（自定义箭头，蓝色调） ---- */
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px !important;
  cursor: pointer;
}
select:hover { border-color: var(--border-strong); }
/* 日期/月份输入控件：统一圆角与边框 */
input[type=date], input[type=month] {
  font-family: var(--font);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 8px var(--sp-3);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  color: var(--text);
  background: var(--card);
  cursor: pointer;
}
input[type=date]:focus, input[type=month]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

/* ============ 分页 ============ */
.pagination { display: flex; align-items: center; gap: 4px; padding: var(--sp-4) var(--sp-5); justify-content: flex-end; }
.pagination .page {
  min-width: 31px; height: 31px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  font-size: var(--fs-sm);
  color: var(--text-2);
  cursor: pointer;
  background: var(--card);
  transition: all .14s;
}
.pagination .page.active { background: linear-gradient(135deg, #3B82F6, #2563EB); border-color: var(--primary); color: #fff; box-shadow: 0 3px 8px rgba(37, 99, 235, .32); }
.pagination .page:hover:not(.active) { border-color: var(--primary); color: var(--primary-strong); }

/* ============ 树（组织架构） ============ */
.tree { font-size: var(--fs-md); }
.tree .tree-item {
  display: flex; align-items: center;
  padding: 10px var(--sp-3);
  border-radius: var(--r-md);
  cursor: pointer;
  gap: var(--sp-2);
  transition: background .14s, color .14s;
}
.tree .tree-item:hover { background: var(--bg); }
.tree .tree-item.active { background: var(--primary-soft); color: var(--primary-strong); font-weight: 600; }
.tree .tree-item svg { width: 15px; height: 15px; stroke: currentColor; flex-shrink: 0; }
.tree .tree-children { padding-left: 22px; }
.tree .tree-count { margin-left: auto; font-size: var(--fs-xs); color: var(--muted); background: #F1F4F9; border-radius: 999px; padding: 1px 8px; }
.tree .tree-item.active .tree-count { background: rgba(37, 99, 235, .12); color: var(--primary-strong); }

/* ============ 弹窗（app.js 生成的 .modal-overlay / .modal-card） ============ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .28);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn .18s ease;
}
.modal-card {
  width: 100%; max-width: 560px;
  background: #fff;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalIn .22s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }

/* ============ Toast（app.js 生成的 .toast） ============ */
.toast {
  position: fixed; top: 24px; left: 50%;
  transform: translateX(-50%);
  background: #FFFFFF;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 11px 22px;
  border-radius: 999px;
  font-size: var(--fs-md);
  font-weight: 500;
  z-index: 999;
  box-shadow: var(--shadow-md);
  display: flex; align-items: center; gap: 8px;
  animation: toastIn .25s ease;
}
.toast::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(232, 168, 42, .18);
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ============ 登录页（全浅色 · 清爽背景，衬托白底金 LOGO） ============ */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: var(--sp-5);
  background:
    radial-gradient(900px 520px at 14% -10%, rgba(37, 99, 235, .08), transparent 60%),
    radial-gradient(800px 600px at 112% 112%, rgba(6, 182, 212, .05), transparent 55%),
    linear-gradient(160deg, #F5F8FD 0%, #EEF2F9 55%, #E7ECF6 100%);
}
.login-card {
  position: relative;
  z-index: 1;
  width: 440px;
  background: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, .14), 0 4px 12px rgba(15, 23, 42, .06);
  padding: var(--sp-8);
  animation: modalIn .4s ease;
}
.login-brand {
  display: block;
  width: 100%;
  max-width: 340px;
  height: auto;
  margin: 0 auto var(--sp-5);
  /* 静态无阴影，完全融入背景 */
}
.login-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
  margin: 0 0 var(--sp-4);
}
.login-h1 { font-size: 20px; font-weight: 700; letter-spacing: .3px; color: #0F172A; text-align: center; }
.login-card .sub { font-size: var(--fs-sm); color: var(--muted); margin-top: 6px; text-align: center; }
.login-card .login-btn {
  width: 100%; justify-content: center;
  padding: 12px; font-size: var(--fs-lg);
  margin-top: var(--sp-2);
  letter-spacing: 6px; text-indent: 6px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, #F4C24F 0%, #E8A82A 55%, #C8871A 100%);
  box-shadow: 0 8px 20px rgba(232, 168, 42, .35);
}
.login-card .login-btn:hover { background: linear-gradient(135deg, #E8A82A, #B07A14); box-shadow: 0 6px 18px rgba(232, 168, 42, .5); }
.login-msg { font-size: var(--fs-sm); color: var(--danger); min-height: 22px; margin-top: var(--sp-3); }
.login-remember { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--text-2); cursor: pointer; user-select: none; }
.login-remember input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.login-footer {
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--muted);
  margin-top: var(--sp-5);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border);
}

/* ============ 杂项 ============ */
.empty {
  text-align: center;
  padding: 48px var(--sp-5);
  color: var(--muted);
  font-size: var(--fs-sm);
}
.empty svg { width: 40px; height: 40px; stroke: var(--border-strong); margin-bottom: var(--sp-3); }
/* 加载状态：直接子级的 .empty.loading 显示转圈 */
#viewRoot > .empty.loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 72px var(--sp-5); color: var(--muted); }
#viewRoot > .empty.loading::before {
  content: '';
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 3px solid var(--primary-soft);
  border-top-color: var(--primary);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }
.mt-1 { margin-top: var(--sp-1); } .mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); } .mt-4 { margin-top: var(--sp-4); }
.mb-2 { margin-bottom: var(--sp-2); } .mb-3 { margin-bottom: var(--sp-3); }
.text-muted { color: var(--muted); }
.text-sm { font-size: var(--fs-sm); }
.flex { display: flex; align-items: center; gap: var(--sp-3); }
.flex-between { display: flex; align-items: center; justify-content: space-between; }

/* ============ 权限分配 ============ */
.perm-layout { display: grid; grid-template-columns: 240px 1fr; gap: var(--sp-5); }
.perm-people { border: 1px solid var(--border); border-radius: var(--r-md); max-height: 420px; overflow: auto; background: #fff; }
.perm-people-title { padding: 10px 14px; font-size: var(--fs-xs); color: var(--muted); border-bottom: 1px solid var(--border); background: #F7F9FC; position: sticky; top: 0; }
.perm-person { padding: 10px 14px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .15s; }
.perm-person:hover { background: #F2F5F9; }
.perm-person.active { background: #EAF1FB; }
.perm-person .pp-name { font-weight: 600; font-size: var(--fs-md); }
.perm-person .pp-sub { font-size: var(--fs-xs); color: var(--muted); margin-top: 2px; }
.perm-matrix { border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--sp-4); max-height: 420px; overflow: auto; background: #fff; }
.perm-matrix-title { font-weight: 600; margin-bottom: var(--sp-3); }
.perm-row { display: flex; align-items: center; gap: 16px; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.perm-row:last-child { border-bottom: none; }
.perm-mod { width: 120px; font-weight: 500; flex-shrink: 0; }
.perm-cols { display: flex; flex-wrap: wrap; gap: 14px; }
.perm-cell { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-sm); cursor: pointer; }
@media (max-width: 900px) { .perm-layout { grid-template-columns: 1fr; } }

/* 身份特色徽章：董事长（金色）/ 管理员（蓝色） */
.role-badge { display: inline-flex; align-items: center; font-size: 11px; line-height: 1; padding: 3px 7px; border-radius: 999px; font-weight: 600; vertical-align: middle; margin-left: 6px; letter-spacing: .5px; }
.role-badge.chairman { color: #7A4E00; background: linear-gradient(135deg, #FFE08A, #F5C24B); box-shadow: 0 1px 4px rgba(200,150,0,.35); }
.role-badge.admin { color: #fff; background: linear-gradient(135deg, #60A5FA, #2563EB); }
/* 权限分配：管理员开关与提示 */
.perm-admin-toggle { margin: 4px 0 10px; padding: 10px 12px; background: #F2F7FF; border: 1px solid #CFE0FF; border-radius: var(--r-sm); font-size: var(--fs-sm); }
.perm-admin-toggle label { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-weight: 500; }
.perm-admin-toggle input { width: 15px; height: 15px; }
.perm-hint { font-size: var(--fs-xs); color: #B7791F; background: #FFF7E6; border: 1px solid #FBE3B3; border-radius: var(--r-sm); padding: 7px 10px; margin-bottom: 10px; }

/* ============ 响应式 ============ */
@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar-search { width: 200px; }
}
@media (max-width: 900px) {
  .sidebar { width: 68px; }
  .sidebar-logo { justify-content: center; padding: var(--sp-4) var(--sp-3); }
  .sidebar-brand { display: none; }
  .nav-group-title, .sidebar-footer { display: none; }
  .nav-item { justify-content: center; padding: 12px 0; }
  .nav-item .nav-badge { position: absolute; top: 6px; right: 10px; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
  .nav-item.active::before { left: 0; width: 3px; }
  .topbar { padding: 0 var(--sp-4); }
  .topbar-search { display: none; }
  .content { padding: var(--sp-4); }
}
@media (max-width: 640px) {
  .stat-grid { grid-template-columns: 1fr; }
  .page-head h2 { font-size: 19px; }
  .topbar-user .name, .topbar-user > svg { display: none; }
  .form-grid { grid-template-columns: 1fr; }
}

/* ============ 外包项目子菜单 ============ */
.nav-arrow {
  width: 14px !important;
  height: 14px !important;
  margin-left: auto;
  transition: transform .18s ease;
  opacity: .7;
}
.nav-item.open .nav-arrow { transform: rotate(180deg); }
.nav-sub {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 2px 0 6px;
}
.nav-item.sub {
  padding: 8px 12px 8px 52px;
  font-size: 13px;
  color: #A3B0C6;
  border-radius: 8px;
  margin: 0 8px;
}
.nav-item.sub:hover { background: rgba(255,255,255,.05); color: #E2E8F0; }
.nav-item.sub.active {
  background: rgba(37,99,235,.15);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--blue);
}

/* ============ 页面内标签页（外包项目子模块） ============ */
.page-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  padding: 0 4px;
}
.ptab {
  padding: 10px 18px;
  font-size: 14px;
  color: var(--text-2);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.ptab:hover { color: var(--blue); }
.ptab.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }

/* ============ OA 平台更新通告 ============ */
.upd-badge {
  display: inline-block;
  background: var(--blue-soft, #EEF4FF);
  color: var(--blue, #1E40AF);
  border: 1px solid rgba(30, 64, 175, .25);
  border-radius: 6px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .3px;
}
.upd-features { margin-top: 8px; }
.upd-feature {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-2, #3F4756);
}
.upd-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

/* ============ 通讯录人员门户（contact-portal） ============ */
.portal-body { background: var(--bg, #F4F6FB); min-height: 100vh; }
.portal-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px; background: #fff; border-bottom: 1px solid var(--border, #E5EAF2);
}
.portal-brand { display: flex; align-items: center; gap: 12px; }
.portal-logo { height: 38px; width: auto; }
.portal-title { font-size: 17px; font-weight: 700; letter-spacing: .3px; }
.portal-sub { font-size: 12px; color: var(--muted, #8A93A6); margin-top: 2px; }
.portal-tabs { display: flex; gap: 8px; padding: 14px 28px 0; }
.portal-tab {
  border: 1px solid var(--border, #E5EAF2); background: #fff; color: var(--text-2, #3F4756);
  padding: 9px 18px; border-radius: 10px 10px 0 0; font-size: 14px; font-weight: 600; cursor: pointer;
  position: relative;
}
.portal-tab.active { color: var(--primary, #2563EB); border-bottom-color: #fff; box-shadow: 0 -2px 8px rgba(37,99,235,.06); }
.portal-main { padding: 24px 28px; }
.portal-section { animation: fadeIn .18s ease; }
.portal-section .page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.portal-section .page-head h2 { font-size: 22px; font-weight: 700; margin: 0; }
.portal-section .page-head .desc { font-size: 13px; color: var(--muted, #8A93A6); margin-top: 4px; }

/* ============ 站内消息 ============ */
.msg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.msg-item {
  padding: 13px 16px; border: 1px solid var(--border, #E5EAF2); border-radius: 12px; margin-bottom: 12px;
  background: #fff; transition: border-color .15s ease, box-shadow .15s ease;
}
.msg-item:hover { border-color: #D5DEF2; box-shadow: 0 2px 10px rgba(37,99,235,.06); }
.msg-item.unread { border-color: #BFD0FB; background: #F5F9FF; }
.msg-line { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.msg-peer { font-weight: 600; font-size: 14px; color: var(--text, #1F2733); }
.msg-time { font-size: 12px; color: var(--muted, #8A93A6); }
.msg-content { font-size: 14px; line-height: 1.6; color: var(--text-2, #3F4756); white-space: pre-wrap; word-break: break-word; }

/* ============ 审批类型彩色标签 ============ */
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.6; white-space: nowrap; vertical-align: middle; }
.tag-leave     { background: rgba(59,130,246,.12);  color: #2563eb; }
.tag-overtime  { background: rgba(168,85,247,.12);  color: #9333ea; }
.tag-makeup    { background: rgba(245,158,11,.14);  color: #b45309; }
.tag-general   { background: rgba(16,185,129,.12);  color: #059669; }
@media (max-width: 760px) { .msg-grid { grid-template-columns: 1fr; } }
.upd-item:last-child { border-bottom: none; }
