/* ================================================================
   NOVACORE NOVACORE OA · Design System
   ================================================================ */
:root {
  --brand: #4f46e5;
  --brand-2: #6366f1;
  --brand-soft: #eef2ff;
  --ink: #0f172a;
  --ink-2: #1e293b;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: #e9edf5;
  --bg: #f4f6fb;
  --card: #ffffff;
  --green: #059669;
  --amber: #d97706;
  --red: #dc2626;
  --blue: #2563eb;
  --sidebar: 236px;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; }
h1, h2, h3, h4 { margin: 0; }
p { margin: 0; }
svg { flex-shrink: 0; }
::selection { background: #c7d2fe; }

.muted { color: var(--muted); }
.small { font-size: 11.5px; }
.fw500 { font-weight: 500; }
.mt8 { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; }
.mb12 { margin-bottom: 12px; }
.hidden { display: none !important; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; max-width: 100%; }

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

.sidebar {
  width: var(--sidebar);
  flex-shrink: 0;
  background: linear-gradient(180deg, #0f172a 0%, #111c34 55%, #0b1226 100%);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 50;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 20px 14px; }
.brand-logo {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 17px;
  box-shadow: 0 4px 14px rgba(99, 102, 241, .45);
}
.brand-text b { display: block; color: #fff; font-size: 14px; letter-spacing: .5px; }
.brand-text i { font-style: normal; font-size: 9.5px; color: #64748b; letter-spacing: 1.4px; }
.nav { flex: 1; overflow-y: auto; padding: 2px 12px 12px; }
.nav::-webkit-scrollbar { width: 0; }
.nav-group-label { font-size: 10px; color: #475569; padding: 16px 10px 6px; letter-spacing: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: 9px;
  color: #94a3b8; font-size: 13.5px; text-decoration: none;
  margin-bottom: 2px; transition: .15s; position: relative;
}
.nav-item:hover { background: rgba(148, 163, 184, .1); color: #e2e8f0; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(99, 102, 241, .3), rgba(99, 102, 241, .08));
  color: #fff; font-weight: 500;
}
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 3px 3px 0; background: #818cf8;
}
.nav-badge {
  margin-left: auto; background: #ef4444; color: #fff;
  font-size: 9.5px; font-weight: 600; padding: 0 5px;
  border-radius: 999px; min-width: 16px; line-height: 16px; text-align: center;
}
.sidebar-foot { padding: 14px; border-top: 1px solid rgba(148, 163, 184, .1); }
.me-card { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.me-info b { display: block; color: #e2e8f0; font-size: 12.5px; }
.me-info span { font-size: 10.5px; color: #64748b; }
.me-role {
  margin-left: auto; font-size: 9.5px; color: var(--c, #a5b4fc);
  background: rgba(148, 163, 184, .12); padding: 1px 6px; border-radius: 999px;
}
.sidebar-note { font-size: 10px; color: #475569; margin-top: 10px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 64px; flex-shrink: 0;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px; position: sticky; top: 0; z-index: 40;
}
.topbar-left { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.page-title { font-size: 17px; font-weight: 600; }
.topbar-date { font-size: 11.5px; color: var(--muted-2); }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.view { padding: 22px 26px 44px; max-width: 1640px; width: 100%; margin: 0 auto; flex: 1; }

/* ---------------------------- 通用组件 ---------------------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .03);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.card-head h3 { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 16px 18px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h2 { font-size: 21px; }
.page-head .muted { margin-top: 4px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: 9px;
  font-size: 13.5px; font-weight: 500; border: 1px solid transparent;
  cursor: pointer; white-space: nowrap; transition: .15s; font-family: inherit;
}
.btn.primary {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #fff; box-shadow: 0 2px 8px rgba(79, 70, 229, .28);
}
.btn.primary:hover { filter: brightness(1.06); box-shadow: 0 4px 14px rgba(79, 70, 229, .34); }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--ink-2); }
.btn.ghost:hover { background: #f8fafc; border-color: #d9e0ea; }
.btn.danger { background: #dc2626; color: #fff; }
.btn.danger:hover { background: #b91c1c; }
.btn.ghost.danger { background: #fff; color: #dc2626; border-color: #fecaca; }
.btn.ghost.danger:hover { background: #fef2f2; }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn.lg { height: 44px; padding: 0 20px; font-size: 14px; border-radius: 11px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 500; line-height: 18px; white-space: nowrap;
}
.badge.green { background: #ecfdf5; color: #047857; }
.badge.blue { background: #eff6ff; color: #1d4ed8; }
.badge.amber { background: #fffbeb; color: #b45309; }
.badge.red { background: #fef2f2; color: #b91c1c; }
.badge.gray { background: #f1f5f9; color: #475569; }
.badge.violet { background: #f5f3ff; color: #6d28d9; }
.badge.teal { background: #f0fdfa; color: #0f766e; }
.badge.xs { font-size: 10px; padding: 0 6px; line-height: 16px; }
.count-pill {
  background: #eef2ff; color: var(--brand); font-size: 11px;
  padding: 1px 7px; border-radius: 999px; font-weight: 600;
}

.input, .field input, .field select, .field textarea {
  width: 100%; height: 38px;
  border: 1px solid var(--line); border-radius: 9px;
  padding: 0 12px; font-size: 13.5px; background: #fff; color: var(--ink);
  outline: none; transition: .15s;
}
.input:focus, .field input:focus, .field select:focus, .field textarea:focus {
  border-color: #a5b4fc; box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
}
.input.sm { height: 32px; font-size: 12.5px; }
.input.select { padding-right: 6px; }
.field textarea { height: auto; padding: 9px 12px; resize: vertical; line-height: 1.65; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field > span { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.field.checkbox-line { flex-direction: row; align-items: center; gap: 10px; }
.field.checkbox-line input { width: auto; height: auto; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.form-grid .span2 { grid-column: span 2; }

.search-inline {
  display: flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 9px;
  padding: 0 10px; height: 34px; background: #fff; color: var(--muted);
}
.search-inline:focus-within { border-color: #a5b4fc; box-shadow: 0 0 0 3px rgba(99, 102, 241, .1); }
.search-inline input {
  border: none; outline: none; background: transparent;
  font-size: 13px; width: 210px; height: 32px; color: var(--ink);
}

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-head .toolbar, .page-head .toolbar { flex-wrap: nowrap; justify-content: flex-end; }
.card-head .toolbar .input.select, .page-head .toolbar .input.select { width: 138px; flex: 0 0 auto; }
.card-head .toolbar input[type="month"], .page-head .toolbar input[type="date"] { width: 148px; flex: 0 0 auto; }
.card-head .toolbar .search-inline, .page-head .toolbar .search-inline { flex: 0 0 auto; }
.punch-stat .badge { width: fit-content; }
.toolbar-spacer { flex: 1; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.tab {
  border: none; background: transparent; padding: 10px 16px;
  font-size: 13.5px; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; font-weight: 500; font-family: inherit;
}
.tab:hover { color: var(--ink-2); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.segmented { display: inline-flex; background: #f1f5f9; border-radius: 9px; padding: 3px; gap: 2px; }
.segmented button {
  border: none; background: transparent; padding: 5px 12px;
  font-size: 12px; border-radius: 7px; color: var(--muted); cursor: pointer; font-family: inherit;
}
.segmented button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(15, 23, 42, .1); font-weight: 600; }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; padding: 10px 14px; color: var(--muted);
  font-weight: 500; font-size: 12px; background: #f8fafc;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data td { padding: 12px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: #fafbff; }
tr.clickable { cursor: pointer; }
.cell-user { display: flex; align-items: center; gap: 9px; }
.cell-user > div { display: flex; flex-direction: column; }
.cell-user b { font-weight: 500; font-size: 13px; }

.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; color: #fff; font-weight: 600;
  flex-shrink: 0; letter-spacing: .5px; user-select: none;
}
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: #f1f5f9; border-radius: 999px; padding: 4px 10px;
  font-size: 12px; color: var(--ink-2); border: none; cursor: pointer;
}
.link { color: var(--brand); font-size: 12.5px; display: inline-flex; align-items: center; gap: 2px; }
.pager { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding-top: 12px; }
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 34px 12px; color: var(--muted-2); gap: 8px; text-align: center;
}
.empty p { margin: 0; font-size: 12.5px; }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 40px; color: var(--muted); font-size: 13px; }
.spinner {
  width: 16px; height: 16px; border: 2px solid #e2e8f0;
  border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite;
}

/* ---------------------------- 登录页 ---------------------------- */
/* ---------------------------- 登录页 ---------------------------- */
.login-scene {
  position: relative; min-height: 100vh; overflow: hidden;
  background: radial-gradient(circle at 18% 12%, #1e1b4b 0%, #0b1020 42%, #05070f 100%);
  color: #e2e8f0; display: flex; flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
#login-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; opacity: .95; }
.aurora {
  position: absolute; border-radius: 50%; filter: blur(80px);
  opacity: .5; z-index: 0; animation: auroraFloat 20s ease-in-out infinite;
}
.aurora.a1 { width: 640px; height: 640px; background: radial-gradient(circle, rgba(99,102,241,.55), transparent 65%); top: -240px; left: -180px; }
.aurora.a2 { width: 560px; height: 560px; background: radial-gradient(circle, rgba(34,211,238,.32), transparent 65%); bottom: -220px; right: 2%; animation-delay: -7s; }
.aurora.a3 { width: 460px; height: 460px; background: radial-gradient(circle, rgba(217,70,239,.3), transparent 65%); top: 26%; left: 42%; animation-delay: -13s; }
.scene-grid {
  position: absolute; inset: 0; z-index: 0;
  background-image: linear-gradient(rgba(148,163,184,.07) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(148,163,184,.07) 1px, transparent 1px);
  background-size: 52px 52px;
  -webkit-mask-image: radial-gradient(circle at 50% 42%, #000 0%, transparent 72%);
  mask-image: radial-gradient(circle at 50% 42%, #000 0%, transparent 72%);
}
.login-topbar {
  position: relative; z-index: 3; display: flex; align-items: center;
  justify-content: space-between; padding: 26px 52px;
}
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand .brand-logo {
  width: 42px; height: 42px; border-radius: 13px; font-size: 20px;
  background: linear-gradient(135deg, #6366f1, #22d3ee);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; box-shadow: 0 8px 24px rgba(99,102,241,.5);
}
.login-brand b { display: block; font-size: 18px; letter-spacing: 3px; color: #f8fafc; }
.login-brand i { font-style: normal; font-size: 9px; letter-spacing: 3px; color: #64748b; }
.sys-status {
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; color: #94a3b8;
  border: 1px solid rgba(148,163,184,.16); background: rgba(15,23,42,.4);
  padding: 7px 13px; border-radius: 999px; backdrop-filter: blur(8px);
}
.pulse-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #34d399;
  box-shadow: 0 0 0 0 rgba(52,211,153,.6); animation: pulseRing 2s infinite;
}
.login-stage {
  position: relative; z-index: 3; flex: 1; width: 100%; max-width: 1520px; margin: 0 auto;
  display: grid; grid-template-columns: 1.06fr .94fr; gap: 48px;
  align-items: center; padding: 12px 72px 64px;
}
.login-hero { max-width: 640px; }
.login-hero .kicker {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 10.5px; letter-spacing: 2.4px; color: #818cf8;
  text-transform: uppercase; margin-bottom: 18px;
}
.login-hero h1 {
  font-size: 62px; line-height: 1.08; letter-spacing: -1px; font-weight: 700;
  color: #f8fafc; margin-bottom: 18px;
}
.login-hero h1 .grad {
  background: linear-gradient(100deg, #818cf8 0%, #22d3ee 48%, #f0abfc 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.login-hero .sub {
  font-size: 14px; line-height: 1.9; color: #94a3b8; max-width: 520px;
}
.terminal {
  margin-top: 28px; width: min(560px, 100%);
  border-radius: 14px; overflow: hidden;
  border: 1px solid rgba(148,163,184,.16);
  background: rgba(2,6,23,.72);
  box-shadow: 0 24px 60px rgba(0,0,0,.45);
  backdrop-filter: blur(10px);
}
.term-bar {
  display: flex; align-items: center; gap: 10px; padding: 9px 14px;
  border-bottom: 1px solid rgba(148,163,184,.12);
  background: rgba(15,23,42,.65);
}
.term-dots { display: flex; gap: 6px; }
.term-dots i { width: 9px; height: 9px; border-radius: 50%; background: #334155; }
.term-dots i:nth-child(1) { background: #f87171; }
.term-dots i:nth-child(2) { background: #fbbf24; }
.term-dots i:nth-child(3) { background: #34d399; }
.term-title { font-size: 10.5px; color: #64748b; letter-spacing: .4px; }
.term-tag {
  margin-left: auto; font-size: 8.5px; letter-spacing: 1.4px; text-transform: uppercase;
  color: #22d3ee; border: 1px solid rgba(34,211,238,.3);
  padding: 1px 7px; border-radius: 999px;
}
.term-body {
  margin: 0; padding: 14px 16px 18px; min-height: 118px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px; line-height: 1.95; color: #cbd5e1;
}
.term-line .prompt { color: #818cf8; }
.term-line.ok { color: #34d399; }
.cursor {
  display: inline-block; width: 7px; height: 13px; background: #22d3ee;
  margin-left: 3px; vertical-align: -2px; animation: blink 1s steps(1) infinite;
}
.hero-metrics {
  display: flex; gap: 38px; margin-top: 30px; padding-top: 24px;
  border-top: 1px solid rgba(148,163,184,.14);
}
.hero-metrics b {
  display: block; font-size: 26px; font-weight: 700;
  background: linear-gradient(120deg, #e2e8f0, #818cf8);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-variant-numeric: tabular-nums;
}
.hero-metrics span { font-size: 10px; letter-spacing: 1.4px; color: #64748b; text-transform: uppercase; }

.login-panel { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.login-card {
  position: relative; width: 100%; max-width: 432px;
  padding: 34px 34px 26px; border-radius: 22px;
  background: linear-gradient(160deg, rgba(30,41,59,.82), rgba(15,23,42,.9));
  border: 1px solid rgba(148,163,184,.18);
  box-shadow: 0 35px 90px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.06);
  backdrop-filter: blur(22px);
  transition: transform .25s cubic-bezier(.2,.8,.2,1);
  transform-style: preserve-3d;
}
.login-card::before {
  content: ""; position: absolute; inset: -1px; border-radius: 23px; pointer-events: none;
  background: linear-gradient(130deg, rgba(129,140,248,.55), transparent 32%, transparent 68%, rgba(34,211,238,.4));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; padding: 1px;
}
.card-beam {
  position: absolute; top: 0; left: 12%; right: 12%; height: 1px;
  background: linear-gradient(90deg, transparent, #818cf8, #22d3ee, transparent);
  opacity: .9;
}
.login-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.mini-logo {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, #4f46e5, #22d3ee);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px; color: #fff;
  box-shadow: 0 6px 18px rgba(79,70,229,.45);
}
.login-card h2 { font-size: 23px; color: #f8fafc; letter-spacing: .3px; }
.login-card-head .muted { color: #94a3b8 !important; font-size: 12px; margin-top: 2px; }
.login-field > span { color: #94a3b8; font-size: 12px; }
.input-shell {
  display: flex; align-items: center; gap: 9px; height: 46px; padding: 0 13px;
  border-radius: 11px; border: 1px solid rgba(148,163,184,.2);
  background: rgba(2,6,23,.55); color: #64748b; transition: .2s;
}
.input-shell:focus-within {
  border-color: #6366f1; background: rgba(2,6,23,.85);
  box-shadow: 0 0 0 3px rgba(99,102,241,.18);
}
.input-shell input {
  flex: 1; height: 44px; border: none; background: transparent; outline: none;
  color: #e2e8f0; font-size: 14px;
}
.input-shell input::placeholder { color: #475569; }
.pwd-eye {
  border: none; background: transparent; color: #64748b; cursor: pointer;
  padding: 4px; display: inline-flex; align-items: center; border-radius: 6px;
}
.pwd-eye:hover { color: #cbd5e1; background: rgba(148,163,184,.12); }
.login-options { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 10px; }
.remember { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #94a3b8; cursor: pointer; }
.remember input { accent-color: #6366f1; }
.login-options .small { color: #64748b !important; }
.login-error { min-height: 18px; color: #fb7185; font-size: 12px; margin-bottom: 8px; }
.login-submit {
  height: 46px; border-radius: 11px; font-size: 14px; letter-spacing: 1px;
  background: linear-gradient(120deg, #4f46e5, #7c3aed 55%, #0891b2);
  border: none; position: relative; overflow: hidden;
  box-shadow: 0 10px 30px rgba(79,70,229,.4);
}
.login-submit::after {
  content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent);
  transform: skewX(-20deg); animation: shine 3.6s ease-in-out infinite;
}
.login-submit:hover { filter: brightness(1.08); transform: translateY(-1px); }
.login-foot {
  margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(148,163,184,.12);
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 10.5px; color: #64748b; letter-spacing: .4px;
}
.login-copyright { font-size: 10.5px; color: #475569; letter-spacing: .3px; }

@keyframes auroraFloat {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  33% { transform: translate3d(40px, -30px, 0) scale(1.08); }
  66% { transform: translate3d(-30px, 25px, 0) scale(.96); }
}
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes shine { 0% { left: -60%; } 55%, 100% { left: 120%; } }
@keyframes pulseRing {
  0% { box-shadow: 0 0 0 0 rgba(52,211,153,.55); }
  70% { box-shadow: 0 0 0 7px rgba(52,211,153,0); }
  100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); }
}

@media (max-width: 1200px) {
  .login-stage { padding: 12px 40px 48px; gap: 28px; }
  .login-hero h1 { font-size: 48px; }
}
@media (max-width: 980px) {
  .login-stage { grid-template-columns: 1fr; justify-items: center; }
  .login-hero { display: none; }
  .login-panel { width: 100%; }
  .login-topbar { padding: 20px 24px; }
  .sys-status { display: none; }
}

/* ---------------------------- 工作台 ---------------------------- */
.wb-hero {
  position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(115deg, #101a33 0%, #1b2350 52%, #3b2b7a 100%);
  border-radius: 18px; padding: 26px 30px; margin-bottom: 16px;
  display: flex; justify-content: space-between; gap: 26px;
  box-shadow: 0 12px 34px rgba(15, 23, 42, .18);
}
.wb-hero::after {
  content: ""; position: absolute; right: -60px; top: -90px; width: 320px; height: 320px;
  border-radius: 50%; background: radial-gradient(circle, rgba(129, 140, 248, .35), transparent 65%);
}
.wb-hero h2 { font-size: 24px; margin: 6px 0 4px; letter-spacing: .5px; }
.wb-hero .muted { color: rgba(226, 232, 240, .68); }
.wb-hero .eyebrow { font-size: 11.5px; color: #a5b4fc; letter-spacing: 1px; margin: 0; }
.wb-hero .wave { display: inline-block; animation: wave 2.4s ease-in-out infinite; transform-origin: 70% 70%; }
.hero-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.hero-tags .badge { background: rgba(255, 255, 255, .12); color: #e2e8f0; }
.hero-tags .badge.green { background: rgba(16, 185, 129, .18); color: #6ee7b7; }
.hero-tags .badge.amber { background: rgba(245, 158, 11, .18); color: #fcd34d; }
.hero-tags .badge.blue { background: rgba(59, 130, 246, .18); color: #93c5fd; }
.hero-tags .badge.violet { background: rgba(139, 92, 246, .2); color: #c4b5fd; }
.wb-hero-right { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 28px; align-content: center; position: relative; z-index: 1; }
.hero-metric b { display: block; font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.hero-metric span { font-size: 11px; color: rgba(226, 232, 240, .6); }
.wb-hero > div:first-child { position: relative; z-index: 1; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.stat-grid.four { grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stat-card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 15px 18px; display: grid; grid-template-columns: auto 1fr;
  gap: 12px; align-items: center; color: inherit; position: relative;
  text-decoration: none; transition: .15s;
}
a.stat-card:hover { border-color: #c7d2fe; box-shadow: 0 8px 22px rgba(79, 70, 229, .08); transform: translateY(-1px); }
.stat-card.flat { padding: 12px 14px; }
.stat-card div b { font-size: 21px; display: block; line-height: 1.25; }
.stat-card div span { font-size: 11.5px; color: var(--muted); }
.stat-card em { position: absolute; right: 16px; bottom: 11px; font-style: normal; font-size: 11px; color: var(--muted-2); }
.stat-ic {
  width: 42px; height: 42px; border-radius: 12px;
  background: #eef2ff;
  background: color-mix(in srgb, var(--c) 13%, #fff);
  color: var(--c); display: flex; align-items: center; justify-content: center;
}
.wb-cols { display: grid; grid-template-columns: minmax(0, 1fr) 382px; gap: 16px; align-items: start; }
.wb-main, .wb-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.list-gap { display: flex; flex-direction: column; gap: 10px; }

.appr-card {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px;
  cursor: pointer; transition: .15s; background: #fff;
}
.appr-card:hover { border-color: #c7d2fe; box-shadow: 0 4px 14px rgba(79, 70, 229, .09); }
.appr-card.big { padding: 14px 16px; align-items: flex-start; }
.appr-ic {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  background: #eef2ff;
  background: color-mix(in srgb, var(--c) 13%, #fff);
  color: var(--c); display: flex; align-items: center; justify-content: center;
}
.appr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.appr-main b { font-size: 13.5px; font-weight: 500; }
.appr-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.appr-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.appr-actions { display: flex; gap: 6px; }
.appr-steps-mini { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: 2px; }
.step-dot {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; color: var(--muted); background: #f8fafc;
  border-radius: 999px; padding: 2px 8px;
}
.step-dot i { font-style: normal; }
.step-dot.approved { color: #047857; background: #ecfdf5; }
.step-dot.rejected { color: #b91c1c; background: #fef2f2; }
.step-dot.current { outline: 2px solid #c7d2fe; }
.step-line { width: 10px; height: 1px; background: var(--line); }

.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 12px 14px 16px; }
.quick {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 2px; border-radius: 10px; font-size: 11.5px;
  color: var(--ink-2); text-decoration: none; transition: .15s;
}
.quick:hover { background: #f8fafc; color: var(--brand); }
.quick span {
  width: 38px; height: 38px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  color: var(--c); background: #eef2ff;
  background: color-mix(in srgb, var(--c) 12%, #fff);
}
.task-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed #f1f5f9; }
.task-row:last-child { border-bottom: none; }
.task-type { font-size: 10.5px; padding: 2px 7px; border-radius: 6px; background: #eef2ff; color: #4338ca; flex-shrink: 0; }
.task-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.task-main b { font-size: 13px; font-weight: 500; }
.ann-row { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 6px 0; color: var(--ink-2); border-bottom: 1px dashed #f1f5f9; }
.ann-row:last-child { border-bottom: none; }
.ann-row .pin { color: #d97706; display: flex; }
.ann-cat { font-size: 10.5px; background: #eef2ff; color: #4338ca; padding: 1px 6px; border-radius: 5px; flex-shrink: 0; }
.ann-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.booking-row { display: flex; gap: 10px; align-items: center; padding: 6px 0; }
.booking-row > div { display: flex; flex-direction: column; min-width: 0; }
.booking-row b { font-size: 12.5px; font-weight: 500; }
.bk-time { display: flex; flex-direction: column; font-size: 12px; font-weight: 600; color: var(--brand); min-width: 42px; }
.bk-time i { font-style: normal; font-weight: 400; font-size: 10.5px; color: var(--muted); }

/* ---------------------------- 聊天 ---------------------------- */
.chat-layout {
  display: grid; grid-template-columns: 296px minmax(0, 1fr) 272px;
  gap: 14px; height: calc(100vh - 64px - 44px); min-height: 540px;
}
.chat-list, .chat-main, .chat-side { display: flex; flex-direction: column; overflow: hidden; }
.chat-list-head { display: flex; align-items: baseline; justify-content: space-between; padding: 15px 16px 8px; }
.chat-list-head h3 { font-size: 15px; }
.chat-groups { overflow-y: auto; padding: 4px 8px 12px; }
.group-item {
  display: flex; gap: 10px; width: 100%; padding: 10px;
  border-radius: 10px; border: none; background: transparent;
  text-align: left; cursor: pointer; transition: .12s; font-family: inherit;
}
.group-item:hover { background: #f8fafc; }
.group-item.active { background: #eef2ff; }
.group-avatar {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; background: var(--c);
}
.group-avatar.lg { width: 44px; height: 44px; border-radius: 12px; }
.group-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 1px; }
.gm-top { display: flex; justify-content: space-between; gap: 6px; }
.gm-top b { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gm-top em { font-style: normal; font-size: 10.5px; color: var(--muted-2); flex-shrink: 0; }
.gm-bottom { display: flex; align-items: center; gap: 4px; }
.gm-bottom i {
  font-style: normal; font-size: 11.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1;
}
.unread {
  background: #ef4444; color: #fff; border-radius: 999px;
  font-size: 9.5px; padding: 0 5px; line-height: 15px; flex-shrink: 0;
}
.gm-count { font-size: 10px; color: var(--muted-2); display: flex; align-items: center; gap: 3px; margin-top: 1px; }

.chat-head {
  padding: 12px 18px; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.ch-left { display: flex; align-items: center; gap: 11px; min-width: 0; }
.ch-left h2 { font-size: 15.5px; }
.ch-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.chat-body { flex: 1; overflow-y: auto; padding: 16px 20px 10px; background: #fafbff; scroll-behavior: smooth; }
.chat-date { text-align: center; margin: 12px 0; }
.chat-date span {
  font-size: 10.5px; color: var(--muted-2); background: #fff;
  padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line);
}
.msg { display: flex; gap: 9px; margin-bottom: 14px; max-width: 82%; }
.msg.mine { margin-left: auto; flex-direction: row-reverse; }
.msg-content { min-width: 0; }
.msg-meta { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font-size: 11px; color: var(--muted-2); flex-wrap: wrap; }
.msg.mine .msg-meta { justify-content: flex-end; }
.msg-meta b { color: var(--ink-2); font-size: 12px; font-weight: 500; }
.msg-meta time { font-size: 10px; color: var(--muted-2); }
.msg-bubble {
  background: #fff; border: 1px solid var(--line); padding: 9px 12px;
  border-radius: 4px 12px 12px 12px; font-size: 13.5px; line-height: 1.68;
  color: #1f2937; word-break: break-word;
}
.msg.mine .msg-bubble {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #fff; border: none; border-radius: 12px 4px 12px 12px;
  box-shadow: 0 3px 10px rgba(79, 70, 229, .22);
}
.mention { color: #4f46e5; font-weight: 600; }
.msg.mine .mention { color: #e0e7ff; text-decoration: underline; }

.composer { border-top: 1px solid var(--line); padding: 12px 16px 9px; background: #fff; }
.composer-inner { display: flex; gap: 10px; align-items: flex-end; }
.composer textarea {
  flex: 1; border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 12px; font-size: 13.5px; resize: none;
  max-height: 120px; min-height: 40px; outline: none; line-height: 1.6;
}
.composer textarea:focus { border-color: #a5b4fc; box-shadow: 0 0 0 3px rgba(99, 102, 241, .1); }
.composer-tip { font-size: 10px; color: var(--muted-2); margin-top: 6px; }
.chat-side { overflow-y: auto; }
.side-block { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.side-block:last-child { border-bottom: none; }
.side-title {
  font-size: 11.5px; font-weight: 600; color: var(--muted);
  margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center;
}
.side-notice {
  font-size: 12px; color: var(--ink-2); line-height: 1.7;
  background: #f8fafc; padding: 10px; border-radius: 8px; white-space: pre-wrap;
}
.member-stat { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; margin-bottom: 4px; }
.member-stat b { display: block; font-size: 17px; }
.member-stat span { font-size: 10.5px; color: var(--muted); }
.progress { height: 6px; border-radius: 999px; background: #eef2f7; overflow: hidden; margin: 6px 0; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, #6366f1, #4f46e5); border-radius: 999px; }
.member-preview { display: flex; flex-direction: column; max-height: 240px; overflow: auto; }
.member-row { display: flex; align-items: center; gap: 9px; padding: 6px 0; cursor: pointer; }
.member-row:hover b { color: var(--brand); }
.member-row .mr-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.member-row b { font-size: 12.5px; font-weight: 500; }
.member-row .small { font-size: 10px; }
.member-row + .member-row { border-top: 1px dashed #f1f5f9; }

/* ---------------------------- 通讯录 ---------------------------- */
.contacts-layout { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 14px; align-items: start; }
.dept-panel { min-height: calc(100vh - 150px); }
.dept-tree { padding: 8px; max-height: calc(100vh - 200px); overflow: auto; }
.dept-item {
  display: flex; align-items: center; gap: 6px; width: 100%;
  border: none; background: transparent; padding: 7px 8px;
  border-radius: 8px; font-size: 13px; color: var(--ink-2);
  cursor: pointer; text-align: left; font-family: inherit;
}
.dept-item:hover { background: #f8fafc; }
.dept-item.active { background: #eef2ff; color: var(--brand); font-weight: 600; }
.dept-item em {
  margin-left: auto; font-style: normal; font-size: 10.5px;
  color: var(--muted-2); background: #f1f5f9; padding: 0 6px; border-radius: 999px;
}
.dept-item.all { margin-bottom: 4px; }
.dept-children { padding-left: 14px; border-left: 1px dashed #e2e8f0; margin-left: 13px; }
.dept-node.collapsed > .dept-children { display: none; }
.dept-node.collapsed .dept-caret svg { transform: rotate(-90deg); }
.dept-caret { display: inline-flex; color: var(--muted-2); transition: .15s; }
.dept-dot { width: 4px; height: 4px; border-radius: 50%; background: #cbd5e1; margin: 0 4px; }
.dept-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contacts-toolbar { display: flex; gap: 10px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.row-actions { white-space: nowrap; }
.row-actions .btn + .btn { margin-left: 4px; }

/* ---------------------------- 审批 ---------------------------- */
.type-picker { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.type-chip {
  display: flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: #fff; border-radius: 9px;
  padding: 8px 12px; font-size: 13px; cursor: pointer;
  color: var(--ink-2); font-family: inherit;
}
.type-chip span { display: flex; color: var(--c); }
.type-chip.active { border-color: var(--brand); background: #eef2ff; color: var(--brand); font-weight: 600; }
.timeline { position: relative; padding-left: 4px; }
.tl-item { display: flex; gap: 10px; padding-bottom: 16px; position: relative; }
.tl-item::before {
  content: ""; position: absolute; left: 11px; top: 26px; bottom: 0;
  width: 1px; background: var(--line);
}
.tl-item:last-child::before { display: none; }
.tl-dot {
  width: 24px; height: 24px; border-radius: 50%; background: #f1f5f9;
  color: var(--muted); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; z-index: 1; border: 2px solid #fff;
}
.tl-item.done .tl-dot, .tl-item.approved .tl-dot { background: #ecfdf5; color: #059669; }
.tl-item.rejected .tl-dot { background: #fef2f2; color: #dc2626; }
.tl-item.current .tl-dot { background: #eef2ff; color: var(--brand); box-shadow: 0 0 0 4px rgba(99, 102, 241, .15); }
.tl-body b { font-size: 13px; font-weight: 500; }
.tl-body span { display: block; margin-top: 2px; }
.tl-comment {
  background: #f8fafc; padding: 8px 10px; border-radius: 8px;
  margin: 6px 0 0; font-size: 12.5px; color: var(--ink-2);
}
.detail-status { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.drawer-actions { display: flex; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }

/* ---------------------------- 考勤 ---------------------------- */
.att-layout { display: grid; gap: 14px; }
.clock-card {
  display: grid; grid-template-columns: 1.5fr .9fr; gap: 22px;
  padding: 26px 30px; border: none; color: #fff;
  background: linear-gradient(120deg, #0f172a, #1e293b 55%, #312e81);
  box-shadow: 0 12px 32px rgba(15, 23, 42, .18);
}
.clock-card .muted { color: rgba(226, 232, 240, .62); }
.clock-card .eyebrow { font-size: 11.5px; color: #a5b4fc; letter-spacing: 1px; }
.clock-time { font-size: 52px; font-weight: 600; letter-spacing: 3px; font-variant-numeric: tabular-nums; margin: 8px 0 2px; }
.punch-row { display: flex; gap: 10px; margin: 18px 0 10px; flex-wrap: wrap; }
.punch-row .btn.ghost { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .18); color: #e2e8f0; }
.punch-row .btn.ghost:hover { background: rgba(255, 255, 255, .16); }
.clock-right {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  align-content: center; background: rgba(255, 255, 255, .06);
  border-radius: 14px; padding: 16px;
}
.punch-stat span { display: block; font-size: 11px; color: rgba(226, 232, 240, .6); }
.punch-stat b { font-size: 15px; }
.punch-stat .badge { font-size: 11px; }

/* ---------------------------- 项目看板 ---------------------------- */
.project-strip { display: flex; gap: 12px; overflow-x: auto; padding: 2px 2px 8px; margin-bottom: 14px; }
.project-card {
  flex: 0 0 252px; text-align: left; background: #fff;
  border: 1px solid var(--line); border-radius: 13px; padding: 14px;
  cursor: pointer; display: flex; flex-direction: column; gap: 6px; font-family: inherit;
}
.project-card:hover { border-color: #c7d2fe; }
.project-card.active { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(99, 102, 241, .12); }
.pc-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.pc-top b { font-size: 13.5px; font-weight: 600; }
.pc-code { font-size: 11px; color: var(--muted); }
.pc-progress { height: 5px; background: #f1f5f9; border-radius: 999px; overflow: hidden; margin-top: 2px; }
.pc-progress i { display: block; height: 100%; background: var(--c); border-radius: 999px; }
.pc-meta { font-size: 10.5px; color: var(--muted-2); }
.project-head { padding: 18px 20px; display: flex; justify-content: space-between; gap: 22px; margin-bottom: 12px; }
.ph-left h3 { font-size: 17px; display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ph-left .muted { margin-bottom: 10px; line-height: 1.6; }
.ph-right { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; flex-shrink: 0; }
.mini-progress { min-width: 150px; text-align: right; }
.mini-progress b { font-size: 22px; }
.member-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.member-chip {
  display: flex; align-items: center; gap: 5px; background: #fff;
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px 3px 3px;
  font-size: 12px; cursor: pointer; font-family: inherit;
}
.member-chip:hover { border-color: #c7d2fe; }
.kanban { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: start; }
.kcol { background: #f1f5f9; border-radius: 13px; padding: 10px; min-height: 220px; }
.kcol-head { display: flex; align-items: center; gap: 7px; padding: 4px 6px 10px; font-size: 13px; }
.kcol-head em {
  margin-left: auto; font-style: normal; font-size: 10.5px;
  color: var(--muted); background: #fff; padding: 0 7px; border-radius: 999px;
}
.kdot { width: 7px; height: 7px; border-radius: 50%; }
.kdot.todo { background: #94a3b8; }
.kdot.doing { background: #3b82f6; }
.kdot.testing { background: #f59e0b; }
.kdot.done { background: #10b981; }
.kcol-body { display: flex; flex-direction: column; gap: 8px; min-height: 130px; border-radius: 10px; transition: .15s; }
.kcol-body.over { background: #e2e8f0; outline: 2px dashed #a5b4fc; }
.kempty { font-size: 11.5px; color: var(--muted-2); text-align: center; padding: 16px 0; }
.ktask {
  background: #fff; border-radius: 10px; padding: 11px 12px;
  border: 1px solid #e8edf5; cursor: grab;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.ktask:hover { border-color: #c7d2fe; }
.ktask.dragging { opacity: .45; }
.kt-top { display: flex; justify-content: space-between; margin-bottom: 6px; }
.kt-title { font-size: 13px; line-height: 1.55; margin: 0 0 8px; color: var(--ink-2); }
.kt-foot { display: flex; justify-content: space-between; align-items: center; }
.kt-assignee { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.kt-assignee i { font-style: normal; }
.kt-points { font-size: 10.5px; color: var(--muted-2); }
.kt-type { font-size: 10px; padding: 1px 6px; border-radius: 5px; background: #eef2ff; color: #4338ca; }
.kt-type.t-开发 { background: #eff6ff; color: #1d4ed8; }
.kt-type.t-测试 { background: #fffbeb; color: #b45309; }
.kt-type.t-缺陷 { background: #fef2f2; color: #b91c1c; }
.t-缺陷 { background: #fef2f2; color: #b91c1c; }
.t-测试 { background: #fffbeb; color: #b45309; }
.t-开发 { background: #eff6ff; color: #1d4ed8; }
.t-需求 { background: #eef2ff; color: #4338ca; }
.task-detail-title { font-size: 17px; margin: 4px 0 16px; line-height: 1.5; }

/* ---------------------------- 知识库 ---------------------------- */
.docs-layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 14px; align-items: start; }
.doc-cats { padding-bottom: 10px; }
.cat-list { padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.cat-item {
  display: flex; justify-content: space-between; align-items: center;
  border: none; background: transparent; padding: 8px 10px;
  border-radius: 8px; font-size: 13px; color: var(--ink-2);
  cursor: pointer; text-align: left; font-family: inherit;
}
.cat-item:hover { background: #f8fafc; }
.cat-item.active { background: #eef2ff; color: var(--brand); font-weight: 600; }
.cat-item em { font-style: normal; font-size: 10.5px; color: var(--muted-2); }
.doc-tip {
  margin: 8px 14px; padding: 12px; background: #f8fafc;
  border-radius: 10px; display: flex; gap: 8px; color: var(--muted);
  font-size: 11px; line-height: 1.65;
}
.doc-items { display: flex; flex-direction: column; gap: 2px; }
.doc-item {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  border: none; background: transparent; border-radius: 10px;
  cursor: pointer; text-align: left; width: 100%; font-family: inherit;
}
.doc-item:hover { background: #f8fafc; }
.doc-item > svg { color: var(--muted-2); }
.doc-ic {
  width: 36px; height: 36px; border-radius: 10px; background: #eef2ff;
  color: var(--brand); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.doc-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.doc-info b { font-size: 13.5px; font-weight: 500; }
.doc-info i { font-style: normal; font-size: 11px; color: var(--muted-2); }
.reader-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.reader-title { font-size: 24px; margin: 8px 0; line-height: 1.4; }
.reader-meta { color: var(--muted); font-size: 12px; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.prose { font-size: 14px; line-height: 1.9; color: #1f2937; }
.prose h2 { font-size: 18px; margin: 22px 0 10px; }
.prose h3 { font-size: 15.5px; margin: 20px 0 8px; }
.prose h4, .prose h5 { font-size: 14px; margin: 16px 0 6px; }
.prose p { margin: 8px 0; }
.prose ul, .prose ol { margin: 8px 0; padding-left: 22px; }
.prose li { margin: 4px 0; }
.prose strong { color: var(--ink); }
.prose code { background: #f1f5f9; padding: 1px 6px; border-radius: 5px; font-size: 12.5px; }
.prose pre { background: #0f172a; color: #e2e8f0; padding: 14px 16px; border-radius: 10px; overflow-x: auto; }
.prose pre code { background: transparent; color: inherit; padding: 0; }

/* ---------------------------- 公告 ---------------------------- */
.ann-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.ann-card { padding: 18px; cursor: pointer; transition: .15s; display: flex; flex-direction: column; gap: 10px; }
.ann-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(15, 23, 42, .08); border-color: #c7d2fe; }
.ann-card.pinned { border-top: 3px solid #f59e0b; }
.ann-top { display: flex; align-items: center; gap: 8px; }
.ann-card h3 { font-size: 15.5px; line-height: 1.45; }
.ann-excerpt { font-size: 12.5px; color: var(--muted); line-height: 1.7; margin: 0; flex: 1; }
.ann-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 10px; border-top: 1px dashed var(--line); }
.ann-author { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.ann-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }

/* ---------------------------- 会议室 ---------------------------- */
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; }
.room-card { padding: 16px 18px; }
.room-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.room-head h3 { font-size: 15px; }
.room-timeline { display: flex; flex-direction: column; gap: 8px; }
.bk-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  background: #f8fafc; border-radius: 9px; border-left: 3px solid #c7d2fe;
}
.bk-item.mine { background: #eef2ff; border-left-color: var(--brand); }
.bk-range { display: flex; flex-direction: column; font-size: 12px; font-weight: 600; color: var(--ink-2); min-width: 44px; }
.bk-range i { font-style: normal; font-weight: 400; font-size: 10.5px; color: var(--muted); }
.bk-info { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.bk-info b { font-size: 12.5px; font-weight: 500; }
.bk-info .small { font-size: 10.5px; }

/* ---------------------------- 客户 ---------------------------- */
.crm-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.group-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.group-chip {
  display: flex; align-items: center; gap: 6px; background: #fff;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px;
  font-size: 12.5px; cursor: pointer; color: var(--ink-2); font-family: inherit;
}
.group-chip:hover { border-color: #c7d2fe; }
.group-chip.active { border-color: var(--brand); background: #eef2ff; color: var(--brand); font-weight: 600; }
.group-chip em { font-style: normal; font-size: 10.5px; color: var(--muted-2); }
.gc-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.corp-logo {
  width: 34px; height: 34px; border-radius: 9px; background: #eef2ff;
  color: #4338ca; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; flex-shrink: 0;
}
.corp-logo.lg { width: 56px; height: 56px; border-radius: 14px; font-size: 23px; }

/* ---------------------------- 系统管理 ---------------------------- */
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); gap: 14px; }
.role-card { padding: 18px; }
.role-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; }
.role-head h3 { font-size: 15px; }
.role-head > .badge { margin-left: auto; }
.role-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); margin-top: 6px; flex-shrink: 0; }
.perm-wrap { display: grid; gap: 10px; margin-bottom: 14px; }
.perm-wrap.disabled { opacity: .75; }
.perm-block { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.perm-group { font-size: 11px; color: var(--muted); font-weight: 600; margin-bottom: 8px; letter-spacing: .4px; }
.perm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.perm-check { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); cursor: pointer; }
.perm-check input { accent-color: var(--brand); }
.perm-check input:disabled { cursor: not-allowed; }
.role-save { width: 100%; }
.org-tree { display: flex; flex-direction: column; gap: 5px; }
.org-node { padding-left: calc(var(--depth) * 22px); }
.org-row { display: flex; align-items: center; gap: 14px; padding: 9px 12px; border-radius: 9px; background: #f8fafc; font-size: 13px; }
.org-row:hover { background: #eef2ff; }
.org-name { display: flex; align-items: center; gap: 6px; min-width: 240px; font-weight: 500; }
.org-total { margin-left: auto; font-size: 11px; color: var(--muted-2); }
.group-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 14px; }
.group-admin { padding: 18px; }
.ga-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; }
.ga-head h3 { font-size: 15px; }
.ga-head .badge { margin-left: auto; }
.ga-stats { display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; background: #f8fafc; border-radius: 10px; padding: 10px; margin-bottom: 8px; }
.ga-stats b { display: block; font-size: 17px; }
.ga-stats span { font-size: 10px; color: var(--muted); }
.ga-actions { display: flex; gap: 8px; margin-top: 12px; }

.admin-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.bar-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.bar-label { width: 96px; font-size: 12px; color: var(--ink-2); flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { flex: 1; height: 8px; border-radius: 999px; background: #f1f5f9; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--c, #6366f1); border-radius: 999px; min-width: 3px; }
.bar-row b { width: 38px; text-align: right; font-size: 12px; font-weight: 600; }
.ops-row { display: flex; align-items: center; gap: 10px; padding: 3px 0; }
.ops-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ops-main b { font-size: 12.5px; font-weight: 500; }
.ops-ic { width: 26px; height: 26px; border-radius: 8px; background: #f1f5f9; color: var(--muted); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }



.avatar-img { overflow: hidden; background: #e2e8f0; }
.avatar-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-edit {
  display: flex; align-items: center; gap: 16px; padding: 14px 16px;
  background: #f8fafc; border-radius: 12px; border: 1px solid var(--line); margin-bottom: 16px;
}
.avatar-edit-info { display: flex; flex-direction: column; gap: 3px; }
.avatar-edit-info b { font-size: 13px; }
.avatar-edit-info .toolbar { margin-top: 6px; }
.capacity { margin-bottom: 6px; }
.capacity .progress { height: 8px; }

/* ---------------------------- 头像 / 私聊 / 密码查看 ---------------------------- */
.avatar-face { background: transparent !important; overflow: hidden; }
.avatar-face svg { display: block; width: 100%; height: 100%; }
.avatar-btn { border: none; background: none; padding: 0; cursor: pointer; display: inline-flex; border-radius: 50%; }
.avatar-btn:hover .avatar-face { box-shadow: 0 0 0 2px rgba(99,102,241,.45); }
.msg-avatar { border: none; background: none; padding: 0; cursor: pointer; display: inline-flex; border-radius: 50%; flex-shrink: 0; align-self: flex-start; }
.msg.mine .msg-avatar { cursor: default; }
.msg-avatar:hover .avatar-face { box-shadow: 0 0 0 2px rgba(99,102,241,.45); }
.chat-tabs { display: flex; gap: 6px; padding: 14px 14px 10px; }
.chat-tab {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; border: none; border-radius: 9px; cursor: pointer;
  background: #f1f5f9; color: var(--muted); font-size: 12.5px; font-weight: 500;
  transition: .15s; font-family: inherit;
}
.chat-tab:hover { color: var(--ink-2); }
.chat-tab.active { background: #eef2ff; color: var(--brand); }
.chat-tab em { font-style: normal; font-size: 10.5px; background: #fff; padding: 0 6px; border-radius: 999px; color: var(--muted); }
.chat-tab.active em { color: var(--brand); }
.tab-badge { background: #ef4444; color: #fff; font-size: 9.5px; border-radius: 999px; padding: 0 5px; line-height: 15px; }
.dm-avatar { display: flex; flex-shrink: 0; }
.dm-profile { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; }
.dm-profile h3 { font-size: 15px; margin-top: 6px; }
.dm-big-avatar { margin-bottom: 2px; }
.dm-info { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; padding: 6px 0; border-bottom: 1px dashed #f1f5f9; }
.dm-info:last-child { border-bottom: none; }
.dm-info span { color: var(--muted); flex-shrink: 0; }
.dm-info b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-tip { display: flex; gap: 6px; align-items: flex-start; line-height: 1.6; }
.invite-list { max-height: 330px; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.invite-row { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 9px; cursor: pointer; }
.invite-row:hover { background: #f8fafc; }
.invite-row input { accent-color: var(--brand); }
.invite-row .inv-name { display: flex; flex-direction: column; min-width: 0; }
.invite-row .inv-name b { font-size: 12.5px; font-weight: 500; }
.invite-row .inv-name i { font-style: normal; font-size: 10.5px; color: var(--muted-2); }
.pwd-view { position: relative; display: flex; align-items: center; }
.pwd-view input { padding-right: 38px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: #f8fafc; color: var(--ink-2); }
.pwd-view .pwd-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }

/* ---------------------------- 弹层 ---------------------------- */
.modal-mask, .drawer-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(2px); z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; animation: fade .15s;
}
.drawer-mask { justify-content: flex-end; padding: 0; align-items: stretch; background: rgba(15, 23, 42, .35); }
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-height: 88vh;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 80px rgba(15, 23, 42, .25); animation: pop .18s;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); gap: 10px; }
.modal-head h3 { font-size: 16px; }
.modal-body { padding: 20px 22px; overflow: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.drawer {
  background: #fff; height: 100vh; max-width: 100%;
  display: flex; flex-direction: column;
  box-shadow: -20px 0 60px rgba(15, 23, 42, .2); animation: slide .2s;
}
.drawer-head { padding: 20px 24px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.drawer-head h3 { font-size: 17px; }
.drawer-body { padding: 20px 24px 32px; overflow: auto; flex: 1; }
.drawer-foot { padding: 14px 24px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; background: #fff; }
.drawer-toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 9px; border: none; background: transparent;
  color: var(--muted); display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative; flex-shrink: 0;
}
.icon-btn:hover { background: #f1f5f9; color: var(--ink); }
.icon-btn.sm { width: 28px; height: 28px; border-radius: 7px; }
.dot {
  position: absolute; top: 7px; right: 7px; width: 7px; height: 7px;
  border-radius: 50%; background: #ef4444; border: 1.5px solid #fff;
}
.confirm-mask { z-index: 130; }
.confirm-text { font-size: 14px; line-height: 1.7; color: var(--ink-2); }

/* ---------------------------- 顶栏浮层 ---------------------------- */
.search-box {
  display: flex; align-items: center; gap: 7px;
  background: #f4f6fb; border: 1px solid transparent; border-radius: 9px;
  padding: 0 11px; height: 36px; color: var(--muted); position: relative; width: 250px;
}
.search-box:focus-within { background: #fff; border-color: #c7d2fe; box-shadow: 0 0 0 3px rgba(99, 102, 241, .1); }
.search-box input { border: none; background: transparent; outline: none; font-size: 12.5px; width: 100%; color: var(--ink); }
.search-panel {
  position: absolute; top: 44px; right: 0; width: 368px; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; padding: 8px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .15);
  max-height: 440px; overflow: auto; z-index: 60;
}
.sp-group { font-size: 10.5px; color: var(--muted-2); padding: 8px 8px 4px; letter-spacing: .6px; }
.sp-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 8px; border: none; background: transparent; border-radius: 8px;
  cursor: pointer; text-align: left; font-family: inherit;
}
.sp-item:hover { background: #f8fafc; }
.sp-item span { display: flex; flex-direction: column; min-width: 0; }
.sp-item b { font-size: 12.5px; color: var(--ink-2); }
.sp-item i { font-style: normal; font-size: 10.5px; color: var(--muted-2); }
.sp-ico { color: var(--muted); }
.user-chip {
  display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px;
  border-radius: 999px; cursor: pointer; position: relative;
}
.user-chip:hover { background: #f8fafc; }
.uc-text b { display: block; font-size: 12.5px; }
.uc-text i { font-style: normal; font-size: 10.5px; color: var(--muted-2); }
.popover {
  position: absolute; top: 52px; right: 0; background: #fff;
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .16); z-index: 70; overflow: hidden;
}
.user-menu { width: 232px; padding: 6px; }
.um-head { display: flex; gap: 10px; padding: 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.user-menu button {
  display: flex; align-items: center; gap: 8px; width: 100%;
  border: none; background: transparent; padding: 9px 10px; border-radius: 8px;
  font-size: 12.5px; color: var(--ink-2); cursor: pointer; font-family: inherit; text-align: left;
}
.user-menu button:hover { background: #f8fafc; }
.danger-text { color: #dc2626 !important; }
.bell-pop { width: 344px; max-height: 430px; overflow: auto; top: 52px; right: 46px; }
.pop-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.pop-item { display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px solid #f8fafc; text-decoration: none; color: inherit; align-items: flex-start; }
.pop-item:hover { background: #f8fafc; }
.pop-ic { width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: #eef2ff; color: #4338ca; }
.pop-ic.approval { background: #fffbeb; color: #b45309; }
.pop-ic.task { background: #ecfdf5; color: #047857; }
.pop-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pop-text b { font-size: 12.5px; }
.pop-text i { font-style: normal; font-size: 11px; color: var(--muted); }
.pop-time { font-size: 10px; color: var(--muted-2); white-space: nowrap; }

/* ---------------------------- 名片 ---------------------------- */
.profile-head { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; }
.profile-head h3 { font-size: 19px; display: flex; align-items: center; gap: 8px; }
.profile-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  background: #f8fafc; border-radius: 12px; padding: 14px 16px; margin-bottom: 16px;
}
.profile-grid span { display: block; font-size: 11px; color: var(--muted); }
.profile-grid b { font-size: 13px; font-weight: 500; }
.profile-bio { font-size: 13px; color: var(--ink-2); line-height: 1.75; margin: 0; }
.section-title {
  font-size: 11.5px; font-weight: 600; color: var(--muted);
  margin: 18px 0 10px; letter-spacing: .5px;
}
.mini-table { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; font-size: 12px; }
.mt-head, .mt-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr; padding: 8px 12px; gap: 6px; align-items: center; }
.mt-head { background: #f8fafc; color: var(--muted); font-size: 11px; }
.mt-row { border-top: 1px solid #f1f5f9; }
.kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; background: #f8fafc; border-radius: 10px; padding: 14px 16px; }
.kv-grid span { display: block; font-size: 11px; color: var(--muted); }
.kv-grid b { font-size: 13px; font-weight: 500; }

/* ---------------------------- Toast ---------------------------- */
.toast-root {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center;
}
.toast {
  display: flex; gap: 8px; align-items: center;
  background: #0f172a; color: #fff; padding: 10px 18px;
  border-radius: 10px; font-size: 13px; box-shadow: 0 12px 30px rgba(15, 23, 42, .25);
  animation: fade .2s;
}
.toast.ok svg { color: #34d399; }
.toast.err { background: #7f1d1d; }
.toast.err svg { color: #fca5a5; }
.toast.out { opacity: 0; transform: translateY(-8px); transition: .3s; }

/* ---------------------------- 动画 ---------------------------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes slide { from { transform: translateX(24px); opacity: .5; } to { transform: none; opacity: 1; } }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(14deg); } 20% { transform: rotate(-8deg); } }

/* ---------------------------- 响应式 ---------------------------- */
@media (max-width: 1400px) {
  .chat-layout { grid-template-columns: 268px minmax(0, 1fr) 250px; }
  .wb-cols { grid-template-columns: minmax(0, 1fr) 350px; }
}
@media (max-width: 1200px) {
  .chat-side { display: none; }
  .chat-layout { grid-template-columns: 268px minmax(0, 1fr); }
  .kanban { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wb-hero { flex-direction: column; }
  .wb-hero-right { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 1080px) {
  :root { --sidebar: 76px; }
  .brand-text, .nav-item span, .nav-group-label, .me-info, .me-role, .sidebar-note { display: none; }
  .nav-item { justify-content: center; }
  .brand { justify-content: center; padding: 18px 0 14px; }
  .me-card { justify-content: center; }
  .wb-cols { grid-template-columns: 1fr; }
  .stat-grid, .crm-stats { grid-template-columns: repeat(2, 1fr); }
  .contacts-layout, .docs-layout { grid-template-columns: 1fr; }
  .dept-panel { min-height: 0; }
  .dept-tree { max-height: 300px; }
  .clock-card { grid-template-columns: 1fr; }
  .search-box { width: 190px; }
}
@media (max-width: 820px) {
  .login { grid-template-columns: 1fr; }
  .login-left { display: none; }
  .view { padding: 16px 14px 40px; }
  .topbar { padding: 0 14px; }
  .page-title { font-size: 15px; }
  .topbar-date, .uc-text { display: none; }
  .chat-layout { grid-template-columns: 1fr; height: auto; }
  .chat-list { display: none; }
  .kanban { grid-template-columns: 1fr; }
  .form-grid, .form-row, .perm-grid { grid-template-columns: 1fr; }
  .form-grid .span2 { grid-column: span 1; }
}

/* ---------------------------- 移动端适配 ---------------------------- */
.mobile-only { display: none; }
.chat-back { display: none; }

@media (max-width: 768px) {
  html, body { overflow-x: hidden; }
  .app { display: block; }

  /* 侧边栏改为底部导航 */
  .sidebar {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    width: 100%; height: calc(58px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    flex-direction: row; background: #0b1226;
    border-top: 1px solid rgba(148,163,184,.15);
    z-index: 90;
  }
  .brand, .sidebar-foot { display: none !important; }
  .nav { display: flex; flex-direction: row; width: 100%; height: 58px; padding: 0; overflow-x: auto; overflow-y: hidden; }
  .nav::-webkit-scrollbar { display: none; }
  .nav-group-label { display: none; }
  .nav-item {
    flex: 1 0 66px; flex-direction: column; justify-content: center; gap: 3px;
    padding: 6px 4px; margin: 0; border-radius: 0; font-size: 10px; color: #94a3b8;
  }
  .nav-item span { display: block; font-size: 10px; line-height: 1; }
  .nav-item.active { background: rgba(99,102,241,.16); color: #fff; }
  .nav-item.active::before { display: none; }
  .nav-badge { position: absolute; top: 3px; right: 50%; margin-right: -22px; }

  .main { width: 100%; min-height: 100vh; }
  .topbar { height: 56px; padding: 0 12px; }
  .topbar-left { gap: 6px; min-width: 0; }
  .page-title { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
  .topbar-date { display: none; }
  .search-box { display: none; }
  .uc-text, .user-chip > svg { display: none; }
  .user-chip { padding: 3px; }
  .view { padding: 12px 12px calc(76px + env(safe-area-inset-bottom)); }

  .page-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .page-head h2 { font-size: 19px; }
  .wb-hero { padding: 18px; border-radius: 16px; gap: 14px; }
  .wb-hero h2 { font-size: 20px; }
  .wb-hero-right { grid-template-columns: repeat(2, 1fr); gap: 10px 18px; }
  .hero-metric b { font-size: 22px; }
  .stat-grid, .crm-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 12px 14px; }
  .stat-card div b { font-size: 18px; }
  .stat-card em { display: none; }
  .stat-ic { width: 36px; height: 36px; border-radius: 10px; }
  .quick-grid { grid-template-columns: repeat(4, 1fr); gap: 2px; padding: 10px; }
  .quick { font-size: 10.5px; padding: 8px 2px; }
  .quick span { width: 34px; height: 34px; }
  .card { border-radius: 12px; }
  .card-head { padding: 12px 14px; gap: 8px; }
  .card-head .toolbar, .page-head .toolbar { width: 100%; justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; }
  .card-body { padding: 12px 14px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; }
  .tab { white-space: nowrap; padding: 10px 12px; font-size: 13px; }
  .form-row, .form-grid, .perm-grid { grid-template-columns: 1fr; }
  .form-grid .span2 { grid-column: span 1; }

  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.data { min-width: 680px; }
  .data th, .data td { padding: 9px 10px; }

  .dept-panel { display: none; }
  .contacts-layout, .docs-layout { grid-template-columns: 1fr; }
  .contacts-toolbar { padding: 10px 12px; gap: 8px; }
  .search-inline { flex: 1; min-width: 0; }
  .search-inline input { width: 100%; }
  .mobile-only { display: block; }

  /* 聊天：单栏 + 返回 */
  .chat-layout {
    position: fixed; top: 56px; left: 0; right: 0;
    bottom: calc(58px + env(safe-area-inset-bottom));
    height: auto; grid-template-columns: 1fr; gap: 0; z-index: 35;
  }
  .chat-layout .chat-list, .chat-layout .chat-main { border-radius: 0; border: none; }
  .chat-layout .chat-side { display: none; }
  .chat-layout .chat-list { display: flex; }
  .chat-layout:not(.chat-open) .chat-main { display: none; }
  .chat-layout.chat-open .chat-list { display: none; }
  .chat-head { padding: 8px 12px; flex-wrap: wrap; row-gap: 8px; align-items: center; }
  .chat-head .ch-left { flex: 1 1 100%; min-width: 0; }
  .chat-head .ch-left h2 { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .chat-head .ch-left .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .chat-head .ch-right { width: 100%; justify-content: flex-end; gap: 6px; }
  .chat-head .ch-right > .badge { display: none; }
  .chat-body { padding: 12px; }
  .msg { max-width: 92%; }
  .msg-bubble { font-size: 13px; }
  .composer { padding: 8px 10px 6px; }
  .chat-back { display: inline-flex; }

  /* 通讯录移动端：成员 + 操作，行式卡片 */
  table.data.contacts-table { min-width: 0; width: 100%; }
  .contacts-table thead { display: none; }
  .contacts-table tbody { display: block; }
  .contacts-table tr { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid #f1f5f9; }
  .contacts-table tr:last-child { border-bottom: none; }
  .contacts-table td { display: none; border: none; padding: 0; }
  .contacts-table td:first-child { display: block; flex: 1; min-width: 0; }
  .contacts-table td:last-child { display: block; flex: 0 0 auto; }
  .contacts-table .row-actions { display: flex; gap: 4px; }
  .contacts-table .row-actions .btn { height: 28px; padding: 0 9px; font-size: 12px; }
  .contacts-table .cell-user b { font-size: 13px; }

  .kanban { grid-template-columns: 1fr; }
  .project-strip { gap: 8px; }
  .project-card { flex: 0 0 210px; padding: 12px; }
  .ann-grid, .room-grid, .role-grid, .group-admin-grid, .admin-two { grid-template-columns: 1fr; }
  .profile-grid, .kv-grid { grid-template-columns: 1fr; }
  .mt-head, .mt-row { padding: 7px 10px; }

  .modal-mask { padding: 0; align-items: flex-end; }
  .modal { max-width: 100% !important; max-height: 92vh; border-radius: 18px 18px 0 0; }
  .modal-head { padding: 14px 16px; }
  .modal-body { padding: 14px 16px; }
  .modal-foot { padding: 12px 16px; }
  .drawer { width: 100% !important; }
  .drawer-head { padding: 14px 16px; }
  .drawer-body { padding: 14px 16px 32px; }
  .avatar-edit { flex-direction: column; text-align: center; }

  .login-topbar { padding: 16px 18px; }
  .login-stage { grid-template-columns: 1fr; padding: 8px 16px 32px; }
  .login-hero { display: none; }
  .login-panel { width: 100%; }
  .login-card { padding: 24px 20px; border-radius: 18px; }
  .login-copyright { text-align: center; }
  .empty { padding: 26px 10px; }
}

@media (max-width: 380px) {
  .stat-grid, .crm-stats { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: repeat(3, 1fr); }
}
