:root {
  --bg: #f4f6fb; --card: #fff; --line: #e8ecf3; --text: #1f2430; --muted: #8a93a5;
  --b1: #7c4dff; --b2: #22d3ee; --green: #12b76a; --red: #e5484d; --orange: #f79009;
  --radius: 14px; --shadow: 0 8px 30px rgba(31,36,48,.06);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.6 "Microsoft YaHei", system-ui, sans-serif; }
a { color: var(--b1); text-decoration: none; }
button, input, select, textarea { font: inherit; }
input, select, textarea { border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; outline: none; background: #fff; color: var(--text); }
input:focus, select:focus, textarea:focus { border-color: var(--b1); box-shadow: 0 0 0 3px rgba(124,77,255,.12); }

.shell { display: grid; grid-template-columns: 208px 1fr; min-height: 100vh; }
.side { background: linear-gradient(180deg,#191d2a,#10131c); color: #cfd6e4; padding: 18px 12px; height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 18px; }
.brand img { width: 34px; height: 34px; border-radius: 10px; }
.brand strong { display: block; color: #fff; font-size: 14px; }
.brand span { font-size: 11px; color: #737d92; }
nav { display: grid; gap: 4px; }
nav a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 9px; color: #aab3c7; font-size: 13px; }
nav a i { font-style: normal; width: 16px; text-align: center; opacity: .85; }
nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
nav a.active { background: linear-gradient(90deg, rgba(124,77,255,.95), rgba(34,211,238,.85)); color: #fff; box-shadow: 0 6px 18px rgba(124,77,255,.35); }
.side-foot { margin-top: 10px; padding: 10px 6px 0; border-top: 1px solid rgba(255,255,255,.06); color: #6b7488; font-size: 11.5px; flex: none; }

.main { min-width: 0; }
.top { height: 62px; display: flex; align-items: center; gap: 14px; padding: 0 24px; background: rgba(255,255,255,.8); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top h1 { margin: 0; font-size: 17px; }
.top .right { margin-left: auto; color: var(--muted); font-size: 12.5px; }
.view { padding: 20px 24px 40px; display: grid; gap: 16px; }

.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat .l { color: var(--muted); font-size: 12.5px; }
.stat .v { font-size: 26px; font-weight: 700; margin: 4px 0 2px; background: linear-gradient(90deg,var(--b1),var(--b2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat .s { color: var(--muted); font-size: 12px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-h { padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 600; display: flex; align-items: center; justify-content: space-between; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 10px 14px; background: #fafbfe; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid #f1f4f9; white-space: nowrap; }
.tbl tr:hover td { background: #fbfcff; }
.empty { text-align: center; color: var(--muted); padding: 26px; }
.sub { color: var(--muted); font-size: 12px; }
.mono { font-family: Consolas, monospace; font-size: 12.5px; }
.money { font-weight: 600; }
.green { color: var(--green); } .red { color: var(--red); } .orange { color: var(--orange); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; }
.badge.g { background: #e7f8ef; color: #087443; }
.badge.o { background: #fef0c7; color: #b54708; }
.badge.r { background: #fee4e2; color: #b42318; }
.badge.b { background: #eff4ff; color: #175cd3; }
.badge.n { background: #eef1f6; color: #667085; }

.btn { border: 1px solid var(--line); background: #fff; color: #384152; border-radius: 10px; padding: 8px 14px; cursor: pointer; }
.btn:hover { background: #fbfcff; }
.btn.primary { border: 0; color: #fff; background: linear-gradient(135deg,var(--b1),var(--b2)); box-shadow: 0 8px 20px rgba(124,77,255,.25); }
.btn:disabled { opacity: .6; }
.toolbar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.link { background: none; border: 0; color: var(--b1); cursor: pointer; padding: 2px 5px; font-size: 12.5px; }
.link.danger { color: var(--red); }

.chart { display: grid; gap: 10px; padding: 16px 18px; }
.bar { display: grid; grid-template-columns: 110px 1fr 90px; gap: 10px; align-items: center; font-size: 12.5px; }
.bar .track { height: 8px; background: #eef1f7; border-radius: 6px; overflow: hidden; }
.bar .fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg,var(--b1),var(--b2)); }
.grid2 { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; align-items: start; }

.mask { position: fixed; inset: 0; background: rgba(15,20,30,.38); display: grid; place-items: center; z-index: 50; }
.modal { background: #fff; border-radius: 16px; width: 460px; max-width: 92vw; box-shadow: 0 30px 80px rgba(15,20,30,.28); }
.modal .h { padding: 15px 18px; border-bottom: 1px solid var(--line); font-weight: 600; display: flex; justify-content: space-between; }
.modal .h button { background: none; border: 0; font-size: 20px; color: var(--muted); cursor: pointer; }
.modal form { display: grid; gap: 12px; padding: 18px; }
.modal label { display: grid; gap: 6px; font-size: 13px; color: #4a5263; }
.modal .f { display: flex; justify-content: flex-end; gap: 10px; padding-top: 6px; }
.toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); background: #1f2430; color: #fff; padding: 9px 16px; border-radius: 10px; font-size: 13px; z-index: 100; }
.toast.err { background: #b42318; }

@media (max-width: 1100px) { .cards { grid-template-columns: repeat(2,1fr); } .grid2 { grid-template-columns: 1fr; } }

/* 统一后台补充 */
.side nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding-right: 4px; }
.side nav::-webkit-scrollbar { width: 6px; }
.side nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 3px; }
.nav-group { color: #5f6a7f; font-size: 11px; letter-spacing: 1px; padding: 12px 12px 4px; }
.view { display: block; }
.view > * + * { margin-top: 16px; }
.modal textarea { min-height: 90px; resize: vertical; }
.login-body { display: grid; place-items: center; background: radial-gradient(1200px 600px at 20% 10%, #eef2ff 0%, #f4f6fb 45%, #eefbfd 100%); }
.login-wrap { width: 100%; display: grid; place-items: center; }
.login-card { width: 380px; max-width: 92vw; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 24px 70px rgba(31,36,48,.12); padding: 28px 26px; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.login-brand img { width: 44px; height: 44px; border-radius: 12px; }
.login-brand strong { display: block; font-size: 16px; }
.login-brand span { color: var(--muted); font-size: 12px; }
.login-card form { display: grid; gap: 14px; }
.login-card label { display: grid; gap: 6px; font-size: 13px; color: #4a5263; }
.login-card input { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; outline: none; }
.login-card input:focus { border-color: var(--b1); box-shadow: 0 0 0 3px rgba(124,77,255,.12); }
.btn.wide { width: 100%; padding: 11px; }
.err { color: var(--red); font-size: 12.5px; min-height: 16px; }
.login-foot { margin-top: 16px; text-align: center; color: var(--muted); font-size: 11.5px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.chk-list { display: grid; gap: 4px; max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: #fbfcff; }
.chk { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 3px 4px; border-radius: 6px; }
.chk:hover { background: #eef3ff; }
.chk small { color: var(--muted); }


/* 左侧菜单：分组多色 + 悬停/选中反馈 */
#nav a { position: relative; border-left: 3px solid transparent; transition: background .15s, color .15s, transform .12s; }
#nav a::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #6b7488; flex: none; box-shadow: 0 0 0 3px rgba(255,255,255,.04); }
#nav a.g-work::before { background: #a78bfa; }
#nav a.g-biz::before { background: #60a5fa; }
#nav a.g-rev::before { background: #34d399; }
#nav a.g-desk::before { background: #fbbf24; }
#nav a.g-sys::before { background: #22d3ee; }
#nav a:hover { background: rgba(255,255,255,.07); color: #fff; transform: translateX(2px); }
#nav a.active { border-left-color: #fff; }
#nav a.g-work.active { background: linear-gradient(90deg, rgba(124,77,255,.92), rgba(34,211,238,.45)); }
#nav a.g-biz.active { background: linear-gradient(90deg, rgba(79,140,255,.92), rgba(34,211,238,.45)); }
#nav a.g-rev.active { background: linear-gradient(90deg, rgba(16,185,129,.9), rgba(34,211,238,.45)); }
#nav a.g-desk.active { background: linear-gradient(90deg, rgba(245,158,11,.9), rgba(239,68,68,.45)); }
#nav a.g-sys.active { background: linear-gradient(90deg, rgba(6,182,212,.9), rgba(124,77,255,.45)); }

/* 运营数据抽屉 */
.drawer-mask { position: fixed; inset: 0; background: rgba(15,20,30,.35); z-index: 60; }
.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: min(1000px, 94vw); background: #fff; z-index: 61; display: flex; flex-direction: column; box-shadow: -20px 0 60px rgba(0,0,0,.18); }
.drawer header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.drawer header button { border: 0; background: none; font-size: 22px; color: var(--muted); cursor: pointer; }
.drawer .tabs { display: flex; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.drawer .tabs button { border: 0; background: none; padding: 8px 14px; border-radius: 8px; cursor: pointer; color: #4a5263; }
.drawer .tabs button.active { background: #eef3ff; color: #1d4ed8; font-weight: 600; }
.drawer-body { padding: 16px; overflow: auto; flex: 1; }

