* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: #f4f6fa; color: #23272f; font-size: 14px;
}
a { color: #3b6ef0; text-decoration: none; }
button { font-family: inherit; }

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1f2430 0%, #2d3547 100%);
}
.login-card {
  width: 340px; background: #fff; border-radius: 10px; padding: 32px 28px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .28);
}
.login-card h1 { font-size: 20px; margin-bottom: 6px; }
.login-card p.sub { color: #8a93a6; font-size: 12px; margin-bottom: 22px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: #6b7385; margin-bottom: 6px; }
.field input {
  width: 100%; height: 38px; border: 1px solid #dde2ec; border-radius: 6px;
  padding: 0 10px; font-size: 14px; outline: none;
}
.field input:focus { border-color: #3b6ef0; }
.btn {
  height: 38px; padding: 0 16px; border: none; border-radius: 6px; cursor: pointer;
  background: #3b6ef0; color: #fff; font-size: 14px;
}
.btn:hover { background: #2f5cd6; }
.btn.block { width: 100%; }
.btn.ghost { background: #eef1f7; color: #39404f; }
.btn.ghost:hover { background: #e3e8f2; }
.btn.danger { background: #e5533d; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 5px; }
.err { color: #e5533d; font-size: 12px; min-height: 18px; margin-top: 6px; }

/* ---------- 主框架 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 200px; background: #1f2430; color: #c9d1e0; flex: 0 0 200px;
  display: flex; flex-direction: column;
}
.brand { padding: 20px 18px 14px; font-size: 16px; color: #fff; font-weight: 600; }
.brand small { display: block; font-size: 11px; color: #7d879b; font-weight: 400; margin-top: 4px; }
.nav { flex: 1; padding: 6px 0; }
.nav a {
  display: block; padding: 11px 18px; color: #b6c0d2; font-size: 14px; cursor: pointer;
  border-left: 3px solid transparent;
}
.nav a:hover { background: #262d3d; color: #fff; }
.nav a.active { background: #262d3d; color: #fff; border-left-color: #3b6ef0; }
.sidebar-foot { padding: 12px 18px; border-top: 1px solid #2c3446; font-size: 12px; color: #7d879b; }
.sidebar-foot a { color: #9aa6bd; cursor: pointer; }

.main { flex: 1; min-width: 0; padding: 20px 24px 40px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.topbar h2 { font-size: 18px; }
.topbar .who { font-size: 12px; color: #8a93a6; }

.card {
  background: #fff; border-radius: 8px; border: 1px solid #e8ecf4;
  padding: 18px; margin-bottom: 16px;
}
.card h3 { font-size: 15px; margin-bottom: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.stat {
  background: #fff; border: 1px solid #e8ecf4; border-radius: 8px; padding: 16px;
}
.stat .k { font-size: 12px; color: #8a93a6; }
.stat .v { font-size: 26px; font-weight: 600; margin-top: 8px; color: #23272f; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid #eef1f7; vertical-align: top; }
th { color: #6b7385; font-weight: 500; background: #fafbfe; white-space: nowrap; }
tr:hover td { background: #fafbfe; }
td.wrap { max-width: 380px; word-break: break-all; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 11px; }
.tag.ok { background: #e8f6ee; color: #1f8a4c; }
.tag.off { background: #fdecea; color: #c0392b; }
.tag.warn { background: #fff5e6; color: #b9770e; }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar input, .toolbar select {
  height: 32px; border: 1px solid #dde2ec; border-radius: 6px; padding: 0 10px; font-size: 13px;
}
.toolbar .spacer { flex: 1; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; font-size: 12px; color: #6b7385; }
.empty { color: #9aa3b4; padding: 18px 4px; font-size: 13px; }

.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 20, 30, .45);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal {
  width: 420px; max-width: 92vw; background: #fff; border-radius: 10px; padding: 20px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, .25);
}
.modal h3 { margin-bottom: 16px; }
.modal .field textarea {
  width: 100%; min-height: 86px; border: 1px solid #dde2ec; border-radius: 6px;
  padding: 8px 10px; font-size: 14px; font-family: inherit; resize: vertical; outline: none;
}
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.toast {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  background: #23272f; color: #fff; padding: 9px 16px; border-radius: 6px; font-size: 13px;
  opacity: 0; transition: opacity .2s; z-index: 100; pointer-events: none;
}
.toast.show { opacity: 1; }
