/* ==========================================================================
   铭望云 HR · 应用样式（重建设计体系 2026）
   目标：对标北森一体化 HCM 视觉 —— 深色导航侧栏 + 浅色工作区
   ========================================================================== */

:root {
  --brand: #2563eb;
  --brand-2: #4f46e5;
  --accent: #0ea5e9;
  --nav-bg: #0e1729;
  --nav-bg-2: #131d33;
  --nav-ink: #aab6cc;
  --nav-ink-dim: #6b7a94;
  --nav-active: #2563eb;
  --bg: #f3f5fa;
  --panel: #ffffff;
  --ink: #1c2534;
  --ink-2: #46536b;
  --sub: #6b7892;
  --line: #e6eaf3;
  --line-2: #eef1f7;
  --ok: #16a34a;
  --ok-bg: #e9f8ef;
  --warn: #d97706;
  --warn-bg: #fff5e8;
  --bad: #dc2626;
  --bad-bg: #fdecec;
  --info-bg: #eaf2ff;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 20px rgba(16, 24, 40, .06);
  --shadow-hover: 0 4px 12px rgba(16, 24, 40, .08), 0 16px 34px rgba(16, 24, 40, .10);
  --sidebar-w: 236px;
  --topbar-h: 62px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #c9d2e2; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #aeb9cc; }
::-webkit-scrollbar-track { background: transparent; }

/* ------------- 顶部进度条 ------------- */
#progress { position: fixed; top: 0; left: 0; right: 0; height: 2.5px; z-index: 9999; pointer-events: none; }
#progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--accent)); transition: width .25s ease; opacity: 0; }
#progress.on i { width: 72%; opacity: 1; animation: pg 1.6s ease-in-out infinite; }
@keyframes pg { 0% { width: 8%; } 60% { width: 78%; } 100% { width: 94%; } }

/* ------------- 启动页 ------------- */
.boot-splash { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 30% 20%, #16233f 0%, #0b1120 70%); z-index: 9000; }
.boot-card { text-align: center; color: #cbd6ea; }
.boot-logo { width: 62px; height: 62px; border-radius: 18px; margin: 0 auto 18px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); display: flex; align-items: center; justify-content: center;
  font-size: 30px; color: #fff; box-shadow: 0 14px 40px rgba(37, 99, 235, .45); }
.boot-card h1 { font-size: 19px; color: #fff; margin: 0 0 6px; letter-spacing: .5px; }
.boot-tip { font-size: 12.5px; color: #8494AD; margin-bottom: 16px; }
.boot-bar { width: 190px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .12); margin: 0 auto; overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 40%; border-radius: 4px; background: linear-gradient(90deg, var(--brand), var(--accent)); animation: boot 1.2s ease-in-out infinite; }
@keyframes boot { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }

/* ==========================================================================
   登录页
   ========================================================================== */
.login-wrap { position: fixed; inset: 0; display: flex; z-index: 8000;
  background: radial-gradient(1200px 700px at 15% 15%, #182848 0%, #0a1020 65%); }
.login-left { flex: 1.15; position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: 0 8%; color: #fff; }
.login-left::after { content: ""; position: absolute; right: -140px; top: -120px; width: 460px; height: 460px; border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, .40), transparent 68%); }
.login-left::before { content: ""; position: absolute; left: -160px; bottom: -180px; width: 480px; height: 480px; border-radius: 50%;
  background: radial-gradient(circle, rgba(14, 165, 233, .28), transparent 68%); }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 34px; position: relative; z-index: 1; }
.login-brand .mark { width: 52px; height: 52px; border-radius: 15px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); font-size: 25px; box-shadow: 0 12px 30px rgba(37, 99, 235, .45); }
.login-brand b { font-size: 21px; letter-spacing: .5px; }
.login-brand span { display: block; font-size: 11.5px; letter-spacing: 3px; color: #7f8fb0; margin-top: 3px; }
.login-left h2 { font-size: 34px; line-height: 1.35; margin: 0 0 16px; position: relative; z-index: 1; font-weight: 700; }
.login-left p.lead { font-size: 14.5px; color: #9fb0cc; max-width: 460px; position: relative; z-index: 1; }
.login-feats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 22px; margin-top: 34px; position: relative; z-index: 1; max-width: 480px; }
.login-feats div { font-size: 13px; color: #b9c6de; display: flex; align-items: center; gap: 8px; }
.login-feats div::before { content: "✓"; color: #34d399; font-weight: 700; }
.login-right { width: 470px; background: #fff; display: flex; align-items: center; justify-content: center; padding: 40px; }
.login-box { width: 100%; max-width: 350px; }
.login-box h3 { font-size: 22px; margin: 0 0 6px; }
.login-box .sub { color: var(--sub); font-size: 13px; margin-bottom: 26px; }
.field { display: block; margin-bottom: 15px; }
.field > span { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); background: #fbfcfe; border-radius: var(--radius-sm);
  padding: 11px 13px; font-size: 14px; color: var(--ink); transition: .16s; font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.login-btn { width: 100%; border: 0; border-radius: var(--radius-sm); padding: 12px; font-size: 15px; font-weight: 600;
  color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); cursor: pointer; margin-top: 6px; transition: .16s;
  box-shadow: 0 8px 22px rgba(37, 99, 235, .30); }
.login-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(37, 99, 235, .38); }
.login-btn:disabled { opacity: .7; cursor: default; transform: none; }
.login-hint { margin-top: 18px; font-size: 12px; color: var(--sub); text-align: center; }
.quick-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.quick-chips button { border: 1px dashed var(--line); background: #fafbfe; color: var(--ink-2); font-size: 12px;
  padding: 5px 11px; border-radius: 20px; cursor: pointer; }
.quick-chips button:hover { border-color: var(--brand); color: var(--brand); }

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

/* ---- 侧栏 ---- */
.sidebar { width: var(--sidebar-w); flex: none; background: linear-gradient(180deg, var(--nav-bg) 0%, var(--nav-bg-2) 100%);
  display: flex; flex-direction: column; color: var(--nav-ink); overflow: hidden; }
.brand { display: flex; align-items: center; gap: 11px; padding: 17px 18px 15px; flex: none; }
.brand .slogo { width: 34px; height: 34px; border-radius: 10px; object-fit: contain; background: rgba(255, 255, 255, .06); padding: 3px; }
.brand .b-name { font-size: 16px; font-weight: 700; color: #fff; letter-spacing: .4px; line-height: 1.25; }
.brand .b-en { font-size: 9.5px; letter-spacing: 2.4px; color: var(--nav-ink-dim); margin-top: 2px; }
.nav-tools { padding: 0 14px 8px; flex: none; }
.nav-search { position: relative; }
.nav-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--nav-ink-dim); }
.nav-search input { width: 100%; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 9px; padding: 8px 10px 8px 32px; color: #dbe4f2; font-size: 12.5px; }
.nav-search input::placeholder { color: var(--nav-ink-dim); }
.nav-search input:focus { outline: none; border-color: rgba(37, 99, 235, .7); background: rgba(255, 255, 255, .09); }
#nav { flex: 1; overflow-y: auto; padding: 4px 10px 14px; }
#nav::-webkit-scrollbar { width: 6px; }
#nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); }
.nav-sec { font-size: 11px; letter-spacing: 1px; color: var(--nav-ink-dim); padding: 15px 9px 7px; font-weight: 600; }
.nav-sec:first-child { padding-top: 4px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 10px; cursor: pointer;
  color: var(--nav-ink); font-size: 13.5px; position: relative; transition: .14s; margin-bottom: 2px; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 600;
  box-shadow: 0 8px 20px rgba(37, 99, 235, .38); }
.nav-item .ico { width: 17px; height: 17px; flex: none; opacity: .92; }
.nav-item .nt { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .nbadge { font-size: 10.5px; padding: 1px 7px; border-radius: 9px; background: rgba(255, 255, 255, .14); color: #dbe4f2; flex: none; }
.nav-item.active .nbadge { background: rgba(255, 255, 255, .26); color: #fff; }
.nav-item .nbadge.hot { background: #ef4444; color: #fff; }
.nav-item .nbadge.new { background: #10b981; color: #fff; }
.nav-item .nbadge.tag { background: rgba(37, 99, 235, .26); color: #93c5fd; }
.nav-item.active .nbadge.tag { background: rgba(255, 255, 255, .26); color: #fff; }
.side-foot { flex: none; border-top: 1px solid rgba(255, 255, 255, .07); padding: 12px 16px 14px; font-size: 11.5px; color: var(--nav-ink-dim); }
.side-foot .ver { color: #8b9ab5; font-weight: 600; }
.side-foot .co { margin-top: 2px; }

/* ---- 主区 ---- */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: var(--topbar-h); flex: none; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px; padding: 0 22px; position: relative; z-index: 30; }
.tb-title { font-size: 16px; font-weight: 700; flex: none; }
.tb-bread { font-size: 12px; color: var(--sub); border-left: 1px solid var(--line); padding-left: 12px; }
.tb-search { flex: 1; max-width: 420px; position: relative; margin-left: 6px; }
.tb-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: #9aa7bd; }
.tb-search input { width: 100%; background: #f4f6fb; border: 1px solid transparent; border-radius: 10px; padding: 9px 12px 9px 35px; font-size: 13px; }
.tb-search input:focus { outline: none; background: #fff; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.tb-select { display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px;
  font-size: 13px; color: var(--ink); background: #fff; cursor: pointer; }
.tb-select .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.tb-select select { border: 0; background: transparent; font-size: 13px; color: inherit; font-family: inherit; cursor: pointer; outline: none; }
.tb-ico { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: #fff; display: flex;
  align-items: center; justify-content: center; cursor: pointer; position: relative; font-size: 16px; color: var(--ink-2); }
.tb-ico:hover { border-color: var(--brand); color: var(--brand); }
.tb-ico .badge { position: absolute; top: -6px; right: -6px; min-width: 17px; height: 17px; border-radius: 9px; background: #ef4444;
  color: #fff; font-size: 10.5px; line-height: 17px; text-align: center; padding: 0 4px; font-weight: 600; }
.tb-user { display: flex; align-items: center; gap: 9px; padding: 5px 10px 5px 5px; border-radius: 22px; cursor: pointer; border: 1px solid var(--line); }
.tb-user:hover { border-color: var(--brand); }
.tb-user .ava { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }
.tb-user .un { font-size: 13px; }
.content { flex: 1; overflow-y: auto; padding: 20px 22px 40px; scroll-behavior: smooth; }

/* ------------- 通用组件 ------------- */
.page-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; margin: 0; font-weight: 700; }
.page-head .psub { color: var(--sub); font-size: 12.5px; margin-top: 4px; }
.page-head .pact { margin-left: auto; display: flex; gap: 9px; flex-wrap: wrap; }
.btn { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 10px; padding: 8px 14px; font-size: 13px;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: .14s; white-space: nowrap; }
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn.pri { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border-color: transparent;
  box-shadow: 0 6px 16px rgba(37, 99, 235, .26); }
.btn.pri:hover { color: #fff; transform: translateY(-1px); }
.btn.sm { padding: 6px 11px; font-size: 12.5px; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); color: var(--bad); background: var(--bad-bg); }
.btn:disabled { opacity: .55; cursor: default; }

.card { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 9px; padding: 15px 18px 0; }
.card-h h3 { font-size: 15px; margin: 0; font-weight: 600; }
.card-h .more { margin-left: auto; font-size: 12px; color: var(--sub); cursor: pointer; }
.card-h .more:hover { color: var(--brand); }
.card-b { padding: 16px 18px 18px; }
.sec-bar { display: inline-block; width: 3px; height: 14px; border-radius: 2px; background: linear-gradient(var(--brand), var(--accent)); }

.grid { display: grid; gap: 15px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g6 { grid-template-columns: repeat(6, 1fr); }
.mt16 { margin-top: 16px; }
.mt20 { margin-top: 20px; }

/* KPI 卡片 */
.kpi { background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius); padding: 15px 16px 14px;
  box-shadow: var(--shadow); transition: .18s; position: relative; overflow: hidden; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.kpi .kt { font-size: 12.5px; color: var(--sub); display: flex; align-items: center; gap: 6px; }
.kpi .kv { font-size: 27px; font-weight: 700; margin: 7px 0 4px; letter-spacing: -.5px; line-height: 1.1; }
.kpi .kv small { font-size: 13px; font-weight: 500; color: var(--sub); margin-left: 3px; }
.kpi .kd { font-size: 11.5px; color: var(--sub); display: flex; align-items: center; gap: 5px; }
.kpi .kd .up { color: var(--ok); }
.kpi .kd .down { color: var(--bad); }
.kpi .kd .neutral { color: var(--sub); }
.kpi .spark { position: absolute; right: 12px; top: 40px; width: 74px; height: 28px; opacity: .85; }

/* 表格 */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line-2); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th { text-align: left; background: #f8fafd; color: var(--ink-2); font-weight: 600; padding: 11px 14px;
  border-bottom: 1px solid var(--line); white-space: nowrap; font-size: 12.5px; position: sticky; top: 0; z-index: 1; }
table.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tbody tr:hover { background: #f7f9fd; }
.tbl-empty { padding: 46px 0; text-align: center; color: var(--sub); font-size: 13px; }

.pill { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; line-height: 1.7; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.info { background: var(--info-bg); color: var(--brand); }
.pill.grey { background: #eef1f6; color: var(--sub); }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .sp { margin-left: auto; }
.toolbar input.q { border: 1px solid var(--line); border-radius: 10px; padding: 8px 13px; font-size: 13px; width: 230px; background: #fff; }
.toolbar input.q:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
.toolbar select { border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; font-size: 13px; background: #fff; color: var(--ink-2); }

.pager { display: flex; align-items: center; gap: 9px; justify-content: flex-end; padding: 13px 4px 0; font-size: 12.5px; color: var(--sub); }
.pager button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 5px 11px; cursor: pointer; font-size: 12.5px; }
.pager button:disabled { opacity: .45; cursor: default; }

.chart { width: 100%; height: 300px; }
.chart.h260 { height: 260px; }
.chart.h320 { height: 320px; }

/* 底层逻辑线 */
.logic-card { background: linear-gradient(135deg, #f7faff 0%, #eef4ff 100%); border: 1px solid #dfe9fb; border-radius: var(--radius);
  padding: 15px 18px; height: 100%; }
.logic-card .lh { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.logic-card .lh .sub { margin-left: auto; font-size: 11.5px; color: var(--sub); font-weight: 400; }
.logic-flow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.logic-node { background: #fff; border: 1px solid #dbe6f8; border-radius: 9px; padding: 7px 13px; font-size: 12.5px; color: #24477f;
  font-weight: 500; box-shadow: 0 1px 2px rgba(37, 99, 235, .07); }
.logic-arrow { color: #9db6e2; font-size: 13px; }

/* 通知抽屉 */
.nc-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .34); z-index: 9000; }
.nc-panel { position: absolute; top: 0; right: 0; bottom: 0; width: 420px; max-width: 92vw; background: #fff;
  box-shadow: -14px 0 40px rgba(15, 23, 42, .18); display: flex; flex-direction: column; animation: slideL .22s ease; }
@keyframes slideL { from { transform: translateX(30px); opacity: .6; } to { transform: translateX(0); opacity: 1; } }
.nc-head { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.nc-head h3 { margin: 0; font-size: 15px; }
.nc-head .x { margin-left: auto; cursor: pointer; color: var(--sub); border: 0; background: none; font-size: 20px; line-height: 1; }
.nc-list { flex: 1; overflow-y: auto; padding: 6px 0; }
.nc-item { padding: 12px 18px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.nc-item:hover { background: #f8fafd; }
.nc-item.unread { background: #f5f9ff; }
.nc-item .t { font-size: 13.5px; font-weight: 600; }
.nc-item .c { font-size: 12.5px; color: var(--sub); margin-top: 3px; }
.nc-item .m { font-size: 11.5px; color: #9aa7bd; margin-top: 5px; display: flex; gap: 12px; }
.nc-foot { padding: 12px 18px; border-top: 1px solid var(--line); text-align: center; }

/* 浮动 AI 按钮 */
.fab-ai { position: fixed; right: 26px; bottom: 26px; width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer;
  background: linear-gradient(135deg, #2563eb, #4f46e5); color: #fff; font-size: 17px; font-weight: 700; z-index: 700;
  box-shadow: 0 12px 30px rgba(37, 99, 235, .45); display: flex; align-items: center; justify-content: center; transition: .18s; }
.fab-ai:hover { transform: translateY(-3px) scale(1.04); }
.fab-ai small { position: absolute; bottom: 60px; right: 2px; background: #1c2534; color: #fff; font-size: 11.5px; padding: 5px 9px;
  border-radius: 7px; white-space: nowrap; opacity: 0; pointer-events: none; transition: .18s; font-weight: 400; }
.fab-ai:hover small { opacity: 1; }
.ai-panel { position: fixed; right: 26px; bottom: 96px; width: 400px; max-width: 92vw; height: 540px; max-height: 74vh; background: #fff;
  border-radius: 16px; box-shadow: 0 24px 60px rgba(15, 23, 42, .28); display: flex; flex-direction: column; z-index: 701; overflow: hidden; }
.ai-head { padding: 14px 16px; background: linear-gradient(135deg, #2563eb, #4f46e5); color: #fff; display: flex; align-items: center; gap: 9px; }
.ai-head b { font-size: 14.5px; }
.ai-head .x { margin-left: auto; cursor: pointer; background: none; border: 0; color: #fff; font-size: 19px; }
.ai-body { flex: 1; overflow-y: auto; padding: 14px; background: #f7f9fd; }
.ai-msg { margin-bottom: 12px; display: flex; }
.ai-msg.u { justify-content: flex-end; }
.ai-msg .b { max-width: 82%; padding: 9px 13px; border-radius: 12px; font-size: 13px; line-height: 1.65; white-space: pre-wrap; background: #fff; box-shadow: 0 1px 3px rgba(16, 24, 40, .07); }
.ai-msg.u .b { background: linear-gradient(135deg, #2563eb, #4f46e5); color: #fff; }
.ai-chips { display: flex; gap: 7px; flex-wrap: wrap; padding: 0 14px 10px; }
.ai-chips button { border: 1px solid var(--line); background: #fff; border-radius: 18px; padding: 5px 11px; font-size: 12px; cursor: pointer; color: var(--ink-2); }
.ai-chips button:hover { border-color: var(--brand); color: var(--brand); }
.ai-foot { display: flex; gap: 8px; padding: 11px 13px; border-top: 1px solid var(--line); background: #fff; }
.ai-foot input { flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font-size: 13px; }
.ai-foot input:focus { outline: none; border-color: var(--brand); }
.ai-foot button { border: 0; background: var(--brand); color: #fff; border-radius: 10px; padding: 0 16px; cursor: pointer; font-size: 13px; }

/* 模态框 */
.modal-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .40); z-index: 9500; display: flex; align-items: center; justify-content: center; padding: 26px; }
.modal { background: #fff; border-radius: 16px; width: 620px; max-width: 100%; max-height: 88vh; display: flex; flex-direction: column;
  box-shadow: 0 24px 64px rgba(15, 23, 42, .34); animation: pop .18s ease; }
.modal.wide { width: 880px; }
@keyframes pop { from { transform: scale(.96); opacity: .4; } to { transform: scale(1); opacity: 1; } }
.modal-h { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.modal-h h3 { margin: 0; font-size: 16px; }
.modal-h .x { margin-left: auto; cursor: pointer; color: var(--sub); border: 0; background: none; font-size: 21px; line-height: 1; }
.modal-b { padding: 20px; overflow-y: auto; }
.modal-f { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }
.modal-f .sp { margin-right: auto; }

/* Toast */
#toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 10000; display: flex; flex-direction: column; gap: 9px; align-items: center; }
.toast { padding: 10px 18px; border-radius: 10px; font-size: 13.5px; color: #fff; background: #1c2534; box-shadow: 0 10px 28px rgba(15, 23, 42, .3);
  animation: tin .2s ease; max-width: 460px; }
.toast.ok { background: linear-gradient(135deg, #16a34a, #059669); }
.toast.err { background: linear-gradient(135deg, #dc2626, #b91c1c); }
@keyframes tin { from { transform: translateY(-12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.spinner { display: inline-block; width: 13px; height: 13px; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff;
  border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-box { padding: 50px 0; text-align: center; color: var(--sub); font-size: 13px; }
.sk { background: linear-gradient(90deg, #eef1f6 25%, #f6f8fc 37%, #eef1f6 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: 8px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.empty { padding: 50px 0; text-align: center; color: var(--sub); font-size: 13px; }
.muted { color: var(--sub); }
.tag-list { display: flex; gap: 6px; flex-wrap: wrap; }
.filters { display: flex; gap: 7px; flex-wrap: wrap; }
.chipf { border: 1px solid var(--line); background: #fff; border-radius: 18px; padding: 6px 13px; font-size: 12.5px; cursor: pointer; color: var(--ink-2); }
.chipf.on { background: #eaf2ff; border-color: #c7dbff; color: var(--brand); font-weight: 600; }

.kv-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; }
.kv-list .kv-row { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.kv-list .kv-row .k { color: var(--sub); width: 108px; flex: none; }
.kv-list .kv-row .v { color: var(--ink); word-break: break-all; }

.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.timeline .ti { position: relative; padding: 0 0 16px; }
.timeline .ti::before { content: ""; position: absolute; left: -20px; top: 4px; width: 10px; height: 10px; border-radius: 50%;
  background: #fff; border: 2px solid var(--brand); }
.timeline .ti .tt { font-size: 13px; font-weight: 600; }
.timeline .ti .td { font-size: 11.5px; color: var(--sub); }

/* 组织树 */
.org-tree { font-size: 13px; }
.org-node { border-left: 2px solid var(--line); margin-left: 12px; padding-left: 14px; }
.org-node.root { border-left: 0; margin-left: 0; padding-left: 0; }
.org-row { display: flex; align-items: center; gap: 9px; padding: 8px 12px; border-radius: 10px; cursor: pointer; }
.org-row:hover { background: #f5f8fe; }
.org-row .on { font-weight: 600; }
.org-row .meta { margin-left: auto; display: flex; gap: 14px; color: var(--sub); font-size: 12px; }
.bar-mini { width: 84px; height: 6px; border-radius: 4px; background: #eef1f7; overflow: hidden; }
.bar-mini i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent)); }

/* 看板/驾驶舱 */
.hero-dark { background: linear-gradient(135deg, #16233f 0%, #1e2f54 55%, #243b6b 100%); border-radius: var(--radius);
  padding: 22px 24px; color: #fff; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.hero-dark::after { content: ""; position: absolute; right: -100px; top: -110px; width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, .38), transparent 68%); }
.hero-dark h2 { margin: 0 0 4px; font-size: 19px; }
.hero-dark .hs { color: #9db0d2; font-size: 12.5px; }
.hero-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-top: 18px; position: relative; z-index: 1; }
.hero-kpis .hk { background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1); border-radius: 11px; padding: 12px 14px; }
.hero-kpis .hk .l { font-size: 11.5px; color: #9db0d2; }
.hero-kpis .hk .v { font-size: 21px; font-weight: 700; margin-top: 3px; }
.hero-kpis .hk .v small { font-size: 11.5px; color: #9db0d2; font-weight: 400; }

.gauge { position: relative; width: 168px; height: 168px; margin: 0 auto; }
.gauge .gv { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.gauge .gv b { font-size: 34px; font-weight: 700; }
.gauge .gv span { font-size: 12px; color: var(--sub); }

.bars { display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: grid; grid-template-columns: 96px 1fr 74px; align-items: center; gap: 12px; font-size: 12.5px; }
.bar-row .bl { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .bt { height: 9px; border-radius: 5px; background: #eef1f7; overflow: hidden; }
.bar-row .bt i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--brand), var(--accent)); }
.bar-row .bv { text-align: right; color: var(--ink); font-weight: 600; }

.stack-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: #eef1f7; }
.stack-bar i { display: block; height: 100%; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 12px; color: var(--ink-2); }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

.note { background: #f8fafd; border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: 8px;
  padding: 11px 14px; font-size: 12.5px; color: var(--ink-2); line-height: 1.7; }
.note b { color: var(--ink); }

.sec-title { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 700; margin: 26px 0 13px; }
.sec-title .sub { font-size: 12px; color: var(--sub); font-weight: 400; }

/* 移动端 */
.drawer-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .42); z-index: 8500; display: none; }
@media (max-width: 1080px) {
  :root { --sidebar-w: 210px; }
  .g6, .g4 { grid-template-columns: repeat(2, 1fr); }
  .g3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .layout.dragging .sidebar { transform: translateX(0); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 8600; transform: translateX(-100%); transition: transform .24s ease; box-shadow: 6px 0 30px rgba(15, 23, 42, .3); }
  .layout.nav-open .sidebar { transform: translateX(0); }
  .layout.nav-open .drawer-mask { display: block; }
  .menu-btn { display: flex !important; }
  .g2, .g3, .g4, .g6 { grid-template-columns: 1fr; }
  .content { padding: 16px 14px 40px; }
  .tb-search { display: none; }
  .tb-user .un { display: none; }
  .kv-list { grid-template-columns: 1fr; }
}
.menu-btn { display: none; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: #fff;
  align-items: center; justify-content: center; cursor: pointer; font-size: 17px; }

/* 打印 */
@media print { .sidebar, .topbar, .fab-ai, .pact, .toolbar { display: none !important; } .content { padding: 0; } }
