* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: system-ui, -apple-system, "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 14px; color: #1f2329; background: #f5f6f8;
}
a { color: #2f6bd8; text-decoration: none; }
button {
  font: inherit; cursor: pointer; border: 1px solid #d5d9e0; background: #fff;
  border-radius: 6px; padding: 6px 14px; color: #1f2329;
}
button:hover { border-color: #b6bcc6; }
button.primary { background: #2f6bd8; border-color: #2f6bd8; color: #fff; }
button.primary:hover { background: #245cb8; }
button.link { border: none; background: none; color: #2f6bd8; padding: 2px 4px; }
input, select {
  font: inherit; padding: 6px 10px; border: 1px solid #d5d9e0; border-radius: 6px;
  background: #fff; color: #1f2329; outline: none;
}
input:focus, select:focus { border-color: #2f6bd8; }

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card {
  width: 340px; background: #fff; border: 1px solid #e6e8ec; border-radius: 12px;
  padding: 28px 28px 22px;
}
.login-card h1 { font-size: 17px; font-weight: 500; margin: 0 0 4px; text-align: center; }
.login-card .sub { color: #8a9099; font-size: 12px; margin-bottom: 18px; text-align: center; }
.msg { color: #d93025; font-size: 12px; min-height: 18px; margin-top: 8px; }

/* 扫码登录 */
.login-card.qr { width: 384px; }
.qrbox {
  width: 300px; height: 400px; margin: 0 auto 12px; display: flex;
  align-items: center; justify-content: center; background: #fff;
  border: 1px solid #eceef2; border-radius: 8px; overflow: hidden;
}
.qrbox iframe { width: 300px; height: 400px; border: 0; display: block; }
.qrbox canvas, .qrbox img { max-width: 280px; }
.qrload { color: #8a9099; font-size: 12px; text-align: center; padding: 0 12px; line-height: 1.7; }
.btn-qr {
  display: block; text-align: center; background: #2f6bd8; color: #fff;
  border-radius: 6px; padding: 9px 0; font-size: 13px;
}
.btn-qr:hover { background: #245cb8; }
.login-card .tip { color: #a8aeb8; font-size: 11px; text-align: center; margin-top: 14px; }

/* 主体布局 */
.app { display: none; height: 100vh; }
.app.on { display: flex; }
.side {
  width: 218px; background: #fff; border-right: 1px solid #e6e8ec;
  display: flex; flex-direction: column; flex-shrink: 0;
}
.brand { padding: 16px 18px 12px; border-bottom: 1px solid #f0f1f4; }
.brand .n { font-size: 14px; font-weight: 500; }
.brand .v { font-size: 11px; color: #9aa0a8; margin-top: 2px; }
.nav { flex: 1; overflow-y: auto; padding: 8px 0 16px; }
.nav .grp { font-size: 11px; color: #9aa0a8; padding: 12px 18px 4px; letter-spacing: .5px; }
.nav a {
  display: block; padding: 7px 18px; color: #3b4250; font-size: 13px;
  border-left: 2px solid transparent;
}
.nav a:hover { background: #f7f8fa; }
.nav a.on { background: #eef3fd; color: #2f6bd8; border-left-color: #2f6bd8; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.top {
  height: 52px; background: #fff; border-bottom: 1px solid #e6e8ec;
  display: flex; align-items: center; justify-content: space-between; padding: 0 22px;
  flex-shrink: 0;
}
.top .crumb { font-size: 13px; color: #5c6370; }
.top .who { font-size: 13px; color: #3b4250; display: flex; align-items: center; gap: 12px; }
.top .who .role { color: #9aa0a8; font-size: 12px; }
.view { flex: 1; overflow: auto; padding: 20px 22px; }

/* 内容块 */
.card { background: #fff; border: 1px solid #e6e8ec; border-radius: 10px; padding: 18px 20px; }
.card + .card { margin-top: 14px; }
.card h2 { font-size: 14px; font-weight: 500; margin: 0 0 12px; }
.card .hint { font-size: 12px; color: #8a9099; margin: -6px 0 12px; }
.empty {
  background: #fff; border: 1px dashed #dfe3e9; border-radius: 10px;
  padding: 46px 20px; text-align: center; color: #9aa0a8; font-size: 13px;
}
.empty b { display: block; color: #5c6370; font-weight: 500; margin-bottom: 6px; font-size: 14px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #f0f1f4; font-size: 13px; }
th { color: #8a9099; font-weight: 400; font-size: 12px; background: #fafbfc; }
td .tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 10px; }
.tag.warn { background: #fff5e6; color: #b26a00; }
.tag.ok { background: #eaf6ee; color: #1e7a3c; }
.tag.off { background: #f2f3f5; color: #8a9099; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mx { text-align: center; font-size: 13px; }
.mx.yes { color: #1e7a3c; }
.mx.no { color: #cfd3d9; }
.pill { font-size: 11px; color: #5c6370; background: #f2f3f5; border-radius: 10px; padding: 2px 8px; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.small { font-size: 12px; color: #8a9099; }
.matrix th:first-child, .matrix td:first-child { min-width: 150px; }
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child { text-align: left; }
