:root {
  --red: #c8102e;
  --red-d: #9e0c24;
  --bg: #f4f5f7;
  --card: #ffffff;
  --line: #e6e8eb;
  --text: #1f2329;
  --sub: #6b7280;
  --ok: #1a8f4c;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; }
a { color: var(--red); text-decoration: none; }

.topbar { background: var(--red); color: #fff; padding: 7px 20px; min-height: 54px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; row-gap: 6px; gap: 10px; }
.topbar .brand { font-size: 17px; font-weight: 700; letter-spacing: 1px;
  display: flex; align-items: center; gap: 9px; white-space: nowrap; flex: 0 0 auto; }
.brand-logo { width: 32px; height: 32px; background: #fff; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; flex: 0 0 32px;
  box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.brand-logo img { width: 24px; height: 24px; display: block; }
.topbar nav { display: flex; flex-wrap: wrap; align-items: center; row-gap: 6px;
  margin-left: auto; }
.topbar nav a { color: #fff; margin-left: 18px; font-size: 14px; opacity: .9; white-space: nowrap; }
.topbar nav a:hover { opacity: 1; }
.topbar nav a.active { opacity: 1; font-weight: 700; border-bottom: 2px solid #fff; padding-bottom: 2px; }
.topbar .user { font-size: 13px; opacity: .85; white-space: nowrap; }

@media (max-width: 720px) {
  .topbar { padding: 7px 12px; }
  .topbar .brand { font-size: 15px; gap: 7px; }
  .brand-logo { width: 28px; height: 28px; flex: 0 0 28px; }
  .brand-logo img { width: 21px; height: 21px; }
  .topbar nav a { margin-left: 12px; font-size: 13px; }
}

.wrap { max-width: 1200px; margin: 18px auto; padding: 0 16px; }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.card .k { color: var(--sub); font-size: 13px; }
.card .v { font-size: 26px; font-weight: 700; margin-top: 6px; color: var(--red-d); }
.card .v small { font-size: 13px; color: var(--sub); font-weight: 400; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 18px; }
.panel h3 { font-size: 15px; margin-bottom: 12px; border-left: 4px solid var(--red); padding-left: 8px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--sub); font-weight: 600; background: #fafafa; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 14px; }
.filters label { display: flex; flex-direction: column; font-size: 12px; color: var(--sub); gap: 4px; }
.filters input, .filters select { padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; min-width: 130px; }

.btn { background: var(--red); color: #fff; border: none; padding: 9px 16px; border-radius: 6px;
  font-size: 14px; cursor: pointer; }
.btn:hover { background: var(--red-d); }
.btn.ghost { background: #fff; color: var(--red); border: 1px solid var(--red); }
.btn.sm { padding: 5px 10px; font-size: 12px; }

.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; color: var(--sub); }
.field input, .field select, .field textarea { padding: 9px 10px; border: 1px solid var(--line);
  border-radius: 6px; font-size: 14px; }
.field textarea { resize: vertical; min-height: 60px; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px;
  background: #fdecef; color: var(--red-d); }
.badge.g { background: #e6f6ec; color: var(--ok); }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--red), var(--red-d)); }
.login-box { background: #fff; border-radius: 12px; padding: 34px 30px; width: 340px; text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,.2); }
.login-logo { width: 92px; height: auto; display: block; margin: 0 auto 12px; }
.login-box h1 { color: var(--red); font-size: 20px; margin-bottom: 4px; letter-spacing: 2px; }
.login-box p { color: var(--sub); font-size: 12px; margin-bottom: 20px; }
.login-box input { width: 100%; padding: 11px; border: 1px solid var(--line); border-radius: 8px;
  margin-bottom: 14px; font-size: 14px; }
.login-box button { width: 100%; }

.toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); background: #222;
  color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 14px; opacity: 0; transition: .25s; z-index: 99; }
.toast.show { opacity: .95; }

.muted { color: var(--sub); font-size: 12px; }
.hint { background: #fff8e6; border: 1px solid #ffe2a8; color: #8a5b00; padding: 10px 12px;
  border-radius: 8px; font-size: 13px; margin-bottom: 14px; }

/* 导航当前页高亮 */
.topbar nav a.active { opacity: 1; font-weight: 700; border-bottom: 2px solid #fff; padding-bottom: 2px; }

/* 密码框 显示/隐藏 切换 */
.pw-wrap { position: relative; }
.pw-wrap input { width: 100%; padding-right: 50px; }
.login-box .pw-wrap input { margin-bottom: 0; }
.login-box .pw-wrap { margin-bottom: 14px; }
.eye { position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  cursor: pointer; color: #2b6cb0; font-size: 12px; user-select: none; }
.eye:hover { text-decoration: underline; }

/* 在线人员徽标（顶栏） */
.online-chip{ display:inline-flex; align-items:center; gap:6px; font-size:13px; color:#1a8a3a;
  background:#e6f6ec; border:1px solid #bfe6cd; border-radius:14px; padding:3px 12px;
  white-space:nowrap; flex:none; cursor:default; }
.online-chip::before{ content:""; width:8px; height:8px; border-radius:50%; background:#1a8a3a;
  box-shadow:0 0 0 3px rgba(26,138,58,.15); }
#online-panel{ list-style:none; margin:8px 0 0; padding:0; font-size:13px; }
#online-panel li{ padding:5px 0; border-bottom:1px dashed #eef2f8; }

/* 在线名单：chip 内直接显示名字 + 点击展开详情面板 */
.online-chip{ gap:7px; }
.online-chip.clickable{ cursor:pointer; }
.online-chip .oc-t{ font-weight:600; }
.online-chip .oc-n{ color:#2e7d4f; max-width:46vw; overflow:hidden; text-overflow:ellipsis;
  white-space:nowrap; border-left:1px solid #bfe6cd; padding-left:8px; }
@media (max-width:760px){ .online-chip .oc-n{ max-width:34vw; } }
.online-pop{ position:absolute; z-index:9999; width:238px; background:#fff; border:1px solid #e2e8f0;
  border-radius:10px; box-shadow:0 10px 28px rgba(26,58,92,.16); padding:10px 12px; font-size:13px; }
.online-pop-h{ font-weight:600; color:#1a3a5c; margin-bottom:6px; }
.online-pop ul{ list-style:none; margin:0; padding:0; max-height:240px; overflow:auto; }
.online-pop li{ display:flex; align-items:center; gap:7px; padding:6px 0; border-bottom:1px dashed #eef2f8; }
.online-pop li:last-child{ border-bottom:0; }
.online-pop .dot{ width:7px; height:7px; border-radius:50%; background:#1a8a3a; flex:none; }
.online-pop .om{ color:#8a94a6; font-size:12px; margin-left:auto; }

/* 记录页标题旁的来源明细 */
.cnt-break{ font-size:12px; font-weight:400; color:#8a94a6; margin-left:6px; }

/* ============ 顶栏菜单：分组胶囊 + 当前页立体高亮 ============ */
.topbar nav{
  gap:2px; row-gap:4px; padding:4px; border-radius:12px;
  background:rgba(0,0,0,.15);
  box-shadow: inset 0 1px 3px rgba(0,0,0,.28), 0 1px 0 rgba(255,255,255,.14);
}
.topbar nav a{
  position:relative; margin-left:0; padding:6px 11px; border-radius:9px;
  border-bottom:0 !important; font-size:13.5px; line-height:1.25; opacity:.9;
  transition:background .15s, box-shadow .15s, transform .15s, color .15s;
}
.topbar nav a:hover{ opacity:1; background:rgba(255,255,255,.17);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3); }
.topbar nav a.active{
  opacity:1; font-weight:700; color:var(--red);
  background:linear-gradient(#ffffff,#eef2f8);
  box-shadow: 0 3px 9px rgba(0,0,0,.3), inset 0 1px 0 #fff, inset 0 -2px 0 rgba(0,0,0,.05);
  transform: translateY(-1px);
}
.topbar nav a.active::after{
  content:""; position:absolute; left:50%; bottom:-6px; transform:translateX(-50%);
  border-left:5px solid transparent; border-right:5px solid transparent;
  border-top:5px solid #fff; filter: drop-shadow(0 1px 1px rgba(0,0,0,.2));
}
/* 站内信未读角标 */
.topbar nav a .nav-badge{
  display:inline-block; min-width:17px; height:17px; line-height:17px; padding:0 5px;
  margin-left:6px; border-radius:9px; background:#ffd166; color:#7a2e00;
  font-size:11px; font-weight:700; text-align:center; vertical-align:1px;
  box-shadow:0 1px 2px rgba(0,0,0,.25);
}
/* 强制阅读遮罩 */
.force-mask{ position:fixed; inset:0; z-index:99999; background:rgba(16,28,44,.62);
  display:flex; align-items:flex-start; justify-content:center; padding:60px 16px; overflow:auto; }
.force-box{ width:min(680px,100%); background:#fff; border-radius:14px; overflow:hidden;
  box-shadow:0 24px 60px rgba(0,0,0,.35); }
.force-title{ background:var(--red); color:#fff; padding:14px 18px; font-weight:700; font-size:15px; }
.force-title span{ display:block; font-weight:400; font-size:12px; opacity:.85; margin-top:3px; }
.force-list{ max-height:60vh; overflow:auto; padding:6px 18px 18px; }
.force-item{ border-bottom:1px dashed #e6ebf2; padding:14px 0 16px; }
.force-item:last-child{ border-bottom:0; }
.force-head{ display:flex; align-items:center; gap:8px; }
.force-head b{ font-size:15px; color:#1a3a5c; }
.force-pri{ background:#fdecea; color:#c0392b; border:1px solid #f5c6c0; border-radius:10px;
  font-size:11px; padding:1px 8px; }
.force-meta{ color:#8a94a6; font-size:12px; margin:4px 0 8px; }
.force-body{ background:#f7f9fc; border:1px solid #e8eef6; border-radius:8px; padding:10px 12px;
  font-size:13.5px; line-height:1.75; color:#26364a; }
.force-ack{ margin-top:10px; background:var(--red); color:#fff; border:0; padding:8px 20px;
  border-radius:8px; font-size:14px; cursor:pointer; box-shadow:0 2px 6px rgba(193,18,31,.3); }
.force-ack:disabled{ opacity:.6; cursor:default; }

/* ============ 当前登录人（顶栏右上，导航注入） ============ */
.whoami{
  display:inline-flex; align-items:center; gap:8px; flex:none; cursor:pointer;
  background:rgba(255,255,255,.16); border:1px solid rgba(255,255,255,.38);
  border-radius:20px; padding:3px 12px 3px 4px; color:#fff;
  transition:background .15s, box-shadow .15s; white-space:nowrap;
}
.whoami:hover{ background:rgba(255,255,255,.3); box-shadow:0 2px 8px rgba(0,0,0,.2); }
.whoami .wa-avatar{
  width:24px; height:24px; border-radius:50%; flex:none;
  background:#fff; color:var(--red); font-weight:700; font-size:13px;
  display:flex; align-items:center; justify-content:center;
}
.whoami .wa-txt{ display:flex; align-items:baseline; gap:6px; line-height:1.1; }
.whoami .wa-txt b{ font-size:13.5px; font-weight:700; }
.whoami .wa-txt i{ font-style:normal; font-size:11.5px; opacity:.82;
  border-left:1px solid rgba(255,255,255,.5); padding-left:6px; }
@media (max-width:900px){ .whoami .wa-txt i{ display:none; } }

/* 在线名单（仪表盘面板） */
.online-list{ list-style:none; margin:6px 0 0; padding:0; display:flex; flex-wrap:wrap; gap:8px; }
.online-list li{
  display:inline-flex; align-items:center; gap:7px; font-size:13px;
  background:#f4f8fd; border:1px solid #e0eaf6; border-radius:18px; padding:6px 13px;
}
.online-list li .dot{ width:8px; height:8px; border-radius:50%; background:#1a8a3a; flex:none;
  box-shadow:0 0 0 3px rgba(26,138,58,.13); }
.online-list li b{ color:#1a3a5c; }
.me-tag{ font-size:11px; background:var(--red); color:#fff; border-radius:8px;
  padding:1px 6px; margin-left:2px; }
.online-pop-t{ margin-top:8px; padding-top:7px; border-top:1px dashed #eef2f8;
  color:#9aa5b6; font-size:11.5px; line-height:1.5; }

/* 点击菜单瞬间：被点的菜单给个"正在加载"的暗态 */
.topbar nav a.nav-going{ opacity:.55; }

/* 页面标题条（让"这页是干什么的"一眼看懂） */
.page-head{ margin:4px 0 14px; }
.page-head h2{ margin:0 0 6px; font-size:18px; color:#1a3a5c; display:flex; align-items:baseline; gap:10px; }
.page-head .ph-sub{ font-size:13px; font-weight:400; color:#7d8a9c; }
.page-head .ph-desc{ font-size:13px; color:#5a6b80; background:#f4f8fd; border-left:3px solid var(--red);
  padding:8px 12px; border-radius:0 6px 6px 0; line-height:1.6; }
