* { box-sizing: border-box; }
body { margin: 0; font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
       background: #f2f4f8; color: #24292f; font-size: 14px; }
.topbar { display: flex; align-items: center; gap: 8px; background: #1f3a5f; color: #fff;
          padding: 0 20px; height: 52px; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.brand { font-size: 17px; white-space: nowrap; letter-spacing: .5px; margin-right: 14px; }
.brand b { color: #ffd24d; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; flex: 1; overflow-x: auto; }
.nav-item { color: #cdd9e8; text-decoration: none; padding: 6px 13px; border-radius: 6px; font-size: 14px; white-space: nowrap; }
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: #fff; color: #1f3a5f; font-weight: 600; }
.userbox { display: flex; align-items: center; gap: 10px; white-space: nowrap; margin-left: 8px; }
.btn-mini { border: 1px solid rgba(255,255,255,.45); background: transparent; color: #fff;
            border-radius: 6px; padding: 3px 10px; cursor: pointer; font-size: 12px; }
.btn-mini:hover { background: rgba(255,255,255,.15); }
.page { max-width: 1460px; margin: 16px auto; padding: 0 16px; }
.panel { background: #fff; border-radius: 10px; padding: 16px; box-shadow: 0 1px 4px rgba(20,40,80,.06); margin-bottom: 16px; }
.panel-title { font-size: 16px; font-weight: 600; margin: 0 0 12px; color: #1f3a5f; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar .spacer { flex: 1; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card { background: #fff; border-radius: 10px; padding: 14px 16px; box-shadow: 0 1px 4px rgba(20,40,80,.06);
             border-left: 4px solid #1f3a5f; }
.stat-card .v { font-size: 26px; font-weight: 700; }
.stat-card .l { color: #6b7280; font-size: 13px; margin-top: 2px; }
.stat-card.warn { border-left-color: #e6a23c; }
.stat-card.danger { border-left-color: #f56c6c; }
.stat-card.green { border-left-color: #67c23a; }
.stat-card.blue { border-left-color: #409eff; }
.stat-card.orange { border-left-color: #e6a23c; }
.muted { color: #909399; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: 12px; }
.mono { font-family: Consolas, Menlo, monospace; }
.pager { margin-top: 10px; display: flex; justify-content: flex-end; }

/* 登录页 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center;
              background: linear-gradient(135deg, #1f3a5f 0%, #2f5b8f 60%, #3b7cb8 100%); }
.login-card { background: #fff; width: 380px; border-radius: 14px; padding: 30px 34px; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.login-title { font-size: 22px; font-weight: 700; text-align: center; color: #1f3a5f; margin-bottom: 4px; }
.login-sub { text-align: center; color: #909399; font-size: 13px; margin-bottom: 22px; }

/* ===== 移动端：导航折叠 + 页面自适应 ===== */
.nav-toggle { display: none; }

@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 6px 10px; row-gap: 4px; }
  .brand { font-size: 15px; margin-right: auto; }
  .nav-toggle {
    display: inline-block; order: 0;
    background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.35);
    color: #fff; font-size: 18px; line-height: 1; padding: 6px 11px 7px; border-radius: 8px;
    cursor: pointer; margin-left: auto; margin-right: 6px;
  }
  .nav-toggle:active { background: rgba(255,255,255,.28); }
  .userbox { margin-left: 0; gap: 6px; }
  .userbox .uname { max-width: 110px; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
  .nav {
    flex-basis: 100%; display: none; order: 9;
    flex-direction: column; align-items: stretch; gap: 2px;
    max-height: calc(100vh - 110px); overflow-y: auto;
    border-top: 1px solid rgba(255,255,255,.15); padding-top: 6px; margin-top: 2px;
  }
  .nav.open { display: flex; }
  .nav-item { padding: 11px 10px; border-radius: 8px; font-size: 15px; }
  .page { margin: 8px auto; padding: 0 8px; }
  .panel { padding: 12px; border-radius: 8px; }
  .panel-title { font-size: 15px; }
  .toolbar { gap: 6px; }
  .login-card { width: calc(100vw - 36px); padding: 22px 20px; }
}

@media print {
  .topbar, .no-print { display: none !important; }
}
