*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px; color: #1f2328; background: #f5f7fa; line-height: 1.6;
}
a { color: #1a6fd4; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; align-items: center; gap: 24px; padding: 0 20px; height: 56px;
  background: #0d2b4e; color: #fff; position: sticky; top: 0; z-index: 50;
}
.brand a { color: #fff; font-weight: 600; font-size: 15px; letter-spacing: .5px; }
.topbar nav { display: flex; gap: 4px; flex: 1; }
.topbar nav a {
  color: #c8d6e5; padding: 6px 12px; border-radius: 5px; font-size: 13.5px;
}
.topbar nav a:hover { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.topbar nav a.btn-new { background: #1a6fd4; color: #fff; font-weight: 500; }
.topbar nav a.btn-new:hover { background: #2b84ea; }
.user { color: #c8d6e5; font-size: 13px; display: flex; gap: 8px; align-items: center; }
.user .role { background: rgba(255,255,255,.15); padding: 1px 7px; border-radius: 3px; font-size: 12px; }
.user .out { color: #8fa6bd; font-size: 12.5px; }

/* ---------- 布局 ---------- */
.wrap { max-width: 1200px; margin: 0 auto; padding: 22px 18px 60px; }
main.wide { padding: 0; }

h1.page { font-size: 19px; margin: 0 0 16px 0; font-weight: 600; color: #0d2b4e; }
h2.sec { font-size: 15px; margin: 22px 0 10px; color: #14406b; font-weight: 600; }

.card {
  background: #fff; border: 1px solid #e3e8ef; border-radius: 8px; padding: 18px;
  margin-bottom: 16px;
}

/* ---------- 统计卡 ---------- */
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat {
  background: #fff; border: 1px solid #e3e8ef; border-radius: 8px; padding: 16px 18px;
}
.stat .n { font-size: 26px; font-weight: 600; color: #0d2b4e; line-height: 1.2; }
.stat .l { font-size: 12.5px; color: #7a8694; margin-top: 3px; }
.stat.hl .n { color: #1a6fd4; }
.stat.alt .n { color: #0f766e; }

/* ---------- 表格 ---------- */
table { width: 100%; border-collapse: collapse; background: #fff; font-size: 13.5px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #eef1f5; }
th { background: #f8fafc; color: #5a6b7c; font-weight: 600; font-size: 12.5px; white-space: nowrap; }
tbody tr:hover { background: #fafcfe; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tablewrap { background: #fff; border: 1px solid #e3e8ef; border-radius: 8px; overflow: hidden; }

/* ---------- 徽标 ---------- */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px;
  font-weight: 500; white-space: nowrap;
}
.tag { display: inline-block; padding: 1px 7px; border-radius: 3px; background: #eef2f6; color: #5a6b7c; font-size: 12px; }

/* ---------- 表单 ---------- */
.formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px 18px; }
.field label { display: block; font-size: 12.5px; color: #5a6b7c; margin-bottom: 5px; font-weight: 500; }
.field label .req { color: #c0392b; }
input[type=text], input[type=password], input[type=number], input[type=tel],
input[type=date], select, textarea {
  width: 100%; padding: 8px 11px; border: 1px solid #d8dee6; border-radius: 6px;
  font-size: 13.5px; font-family: inherit; background: #fff; color: #1f2328;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: #1a6fd4; box-shadow: 0 0 0 3px rgba(26,111,212,.1);
}
textarea { resize: vertical; min-height: 70px; }
.full { grid-column: 1 / -1; }

.btn {
  display: inline-block; padding: 8px 18px; border: none; border-radius: 6px;
  background: #1a6fd4; color: #fff; font-size: 13.5px; font-weight: 500; cursor: pointer;
  font-family: inherit; transition: background .15s;
}
.btn:hover { background: #2b84ea; text-decoration: none; }
.btn.sec { background: #eef2f6; color: #41505f; }
.btn.sec:hover { background: #e2e8ef; }
.btn.danger { background: #c0392b; }
.btn.danger:hover { background: #d14534; }
.btn.ok { background: #1a7f37; }
.btn.ok:hover { background: #219a43; }
.btn.sm { padding: 5px 12px; font-size: 12.5px; }

/* ---------- 提示 ---------- */
.flash {
  background: #e8f4fd; border: 1px solid #b8ddfa; color: #0d5aa7;
  padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; font-size: 13.5px;
}
.flash > div + div { margin-top: 4px; }
.note {
  background: #f8fafc; border-left: 3px solid #1a6fd4; padding: 10px 14px;
  font-size: 13px; color: #41505f; border-radius: 0 5px 5px 0; margin: 12px 0;
}
.warn { background: #fff8e6; border-left: 3px solid #d99400; padding: 10px 14px;
  font-size: 13px; color: #6b4a00; border-radius: 0 5px 5px 0; margin: 12px 0; }

/* ---------- 登录页 ---------- */
.loginpage {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0d2b4e 0%, #14406b 60%, #1a6fd4 140%);
  padding: 20px; margin: -22px -18px;
}
.loginbox {
  background: #fff; border-radius: 12px; padding: 40px 38px; width: 100%; max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.loginbox h1 { font-size: 20px; margin: 0 0 6px; color: #0d2b4e; text-align: center; font-weight: 600; }
.loginbox .sub { text-align: center; color: #8a95a2; font-size: 13px; margin-bottom: 26px; }
.loginbox .field { margin-bottom: 15px; }
.loginbox .err { color: #c0392b; font-size: 13px; margin-bottom: 12px; text-align: center; }
.loginbox .btn { width: 100%; padding: 11px; font-size: 14.5px; }

/* ---------- 详情页 ---------- */
.detail-head {
  background: #fff; border: 1px solid #e3e8ef; border-radius: 8px; padding: 20px 22px; margin-bottom: 16px;
}
.detail-head .no { font-size: 12.5px; color: #8a95a2; font-family: ui-monospace, monospace; }
.detail-head h1 { font-size: 21px; margin: 4px 0 10px; color: #0d2b4e; font-weight: 600; }
.detail-head .meta { display: flex; flex-wrap: wrap; gap: 18px; font-size: 13px; color: #5a6b7c; }

.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px 20px; }
.kv .k { font-size: 12px; color: #8a95a2; margin-bottom: 2px; }
.kv .v { font-size: 14px; color: #1f2328; font-weight: 500; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li {
  position: relative; padding: 0 0 16px 22px; border-left: 2px solid #e3e8ef; margin-left: 6px;
}
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: ''; position: absolute; left: -6px; top: 5px; width: 10px; height: 10px;
  border-radius: 50%; background: #1a6fd4; border: 2px solid #fff; box-shadow: 0 0 0 1px #cfe0f5;
}
.timeline .t { font-size: 12px; color: #98a3b0; font-family: ui-monospace, monospace; }
.timeline .d { font-size: 13.5px; color: #1f2328; margin-top: 2px; }
.timeline .w { font-size: 12.5px; color: #7a8694; }

/* ---------- 工具栏 ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input[type=text] { max-width: 260px; }
.toolbar select { max-width: 140px; }

.pager { display: flex; gap: 6px; justify-content: center; margin-top: 18px; }
.pager a, .pager span {
  padding: 5px 11px; border: 1px solid #d8dee6; border-radius: 5px; font-size: 13px; background: #fff;
}
.pager .on { background: #1a6fd4; color: #fff; border-color: #1a6fd4; }

.empty { text-align: center; padding: 50px 20px; color: #98a3b0; font-size: 14px; }

@media (max-width: 720px) {
  .topbar { gap: 10px; padding: 0 12px; overflow-x: auto; }
  .brand a { font-size: 13.5px; white-space: nowrap; }
  .topbar nav a { padding: 5px 8px; font-size: 13px; }
  .user .role { display: none; }
  .wrap { padding: 14px 12px 50px; }
  table { font-size: 12.5px; }
  th, td { padding: 8px 9px; }
}

/* ---------- 同比环比 ---------- */
.up { color: #1a7f37; font-size: 11.5px; margin-left: 6px; }
.down { color: #c0392b; font-size: 11.5px; margin-left: 6px; }
.flat { color: #98a3b0; font-size: 11.5px; margin-left: 6px; }
.up::before { content: '▲'; font-size: 8px; margin-right: 1px; }
.down::before { content: '▼'; font-size: 8px; margin-right: 1px; }
.stat .l { line-height: 1.8; }

/* ---------- 顶栏当前页 ---------- */
.topbar nav a.on { background: rgba(255,255,255,.16); color: #fff; }

/* 无权限菜单 */
.navoff { color: #5b7692; padding: 6px 12px; font-size: 13.5px; cursor: not-allowed; opacity: .55; }
