[hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f4f6fa; color: #1f2937; font-size: 13px; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 340px; background: #fff; border-radius: 12px; padding: 28px 26px; box-shadow: 0 10px 34px rgba(20, 32, 60, .1); }
.login-card .brand { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.brand-mark { width: 18px; height: 18px; border-radius: 5px; background: linear-gradient(135deg, #2f6fed, #4c8bff); display: inline-block; }
.brand-text { font-size: 15px; font-weight: 600; letter-spacing: .5px; }
.login-sub { color: #8792a8; font-size: 12px; margin-bottom: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 13px; }
.field > span { font-size: 12px; color: #6b7688; }
.field input { border: 1px solid #dbe1ec; border-radius: 8px; padding: 9px 11px; font-size: 13px; outline: none; background: #fff; }
.field input:focus { border-color: #2f6fed; }
.login-err { color: #d64545; font-size: 12px; min-height: 16px; margin-bottom: 6px; }
.btn { border: 1px solid #dbe1ec; background: #fff; color: #38445c; border-radius: 8px; padding: 8px 16px; font-size: 13px; cursor: pointer; }
.btn:hover { border-color: #c3ccdd; }
.btn-primary { background: #2f6fed; border-color: #2f6fed; color: #fff; }
.btn-primary:hover { background: #2a63d4; }
.btn-block { width: 100%; padding: 10px; }
.btn.ghost { background: #f7f9fc; }
.btn:disabled { opacity: .6; cursor: default; }
.btn.sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.btn.danger { color: #d64545; border-color: #f2c8c8; }
.btn.primary-sm { background: #2f6fed; border-color: #2f6fed; color: #fff; }

/* 外壳 */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 190px; background: #fff; border-right: 1px solid #eaeef5; padding: 18px 14px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.who { background: #f6f8fc; border-radius: 9px; padding: 10px 11px; font-size: 12px; color: #4a5568; line-height: 1.6; margin-bottom: 14px; }
.who b { display: block; font-size: 13px; color: #1f2937; font-weight: 600; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { padding: 9px 11px; border-radius: 8px; font-size: 13px; color: #4a5568; }
.nav a:hover { background: #f4f7fd; }
.nav a.on { background: #eef3fe; color: #2f6fed; font-weight: 600; }
.side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid #eef1f7; }
.link { background: none; border: none; color: #8792a8; font-size: 12.5px; cursor: pointer; padding: 4px 2px; }
.link:hover { color: #d64545; }

.main { flex: 1; min-width: 0; padding: 20px 22px 40px; }
.page-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.page-head h1 { font-size: 17px; margin: 0; font-weight: 600; }
.page-head .sub { color: #8792a8; font-size: 12px; }

/* 卡片 */
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.card { background: #fff; border: 1px solid #eaeef5; border-radius: 10px; padding: 13px 15px; }
.card .k { color: #8792a8; font-size: 12px; margin-bottom: 7px; }
.card .v { font-size: 19px; font-weight: 600; letter-spacing: .3px; }
.card .v small { font-size: 12px; color: #8792a8; font-weight: 400; margin-left: 3px; }
.card .x { font-size: 11.5px; color: #9aa4b6; margin-top: 4px; }

.panel { background: #fff; border: 1px solid #eaeef5; border-radius: 10px; overflow: hidden; margin-bottom: 16px; }
.panel-hd { padding: 12px 15px; border-bottom: 1px solid #eef1f7; font-size: 13px; font-weight: 600; color: #38445c; display: flex; justify-content: space-between; align-items: center; }
.panel-bd { padding: 14px 15px; }
.kv { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 18px; }
.kv > div { font-size: 12.5px; color: #4a5568; }
.kv > div span { color: #8792a8; margin-right: 6px; }

/* 工具栏 */
.toolbar { display: flex; gap: 9px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar input, .toolbar select { border: 1px solid #dbe1ec; border-radius: 8px; padding: 8px 10px; font-size: 12.5px; background: #fff; outline: none; }
.toolbar input { width: 260px; }
.toolbar input:focus, .toolbar select:focus { border-color: #2f6fed; }
.hint { color: #8792a8; font-size: 12px; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table.tb { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 12px; }
table.tb th, table.tb td { padding: 8px 8px; border-bottom: 1px solid #f1f4f9; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.tb th { background: #f8fafd; color: #6b7688; font-weight: 500; font-size: 11.5px; }
table.tb tr:hover td { background: #fafcff; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px; }
.tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 10px; background: #eef3fe; color: #2f6fed; }
.tag.ok { background: #e9f8ee; color: #1f9254; }
.tag.no { background: #f4f5f7; color: #8792a8; }
.tag.bad { background: #fdeaea; color: #d64545; }
.tag.warn { background: #fff5e6; color: #b5761a; }
.row-act { display: flex; gap: 6px; }
.empty { padding: 34px; text-align: center; color: #8792a8; font-size: 12.5px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 11px 15px; color: #5a6478; font-size: 12px; border-top: 1px solid #eef1f7; }
.pager button { border: 1px solid #dbe1ec; background: #fff; border-radius: 6px; padding: 5px 12px; font-size: 12px; cursor: pointer; }
.pager button:disabled { opacity: .45; cursor: default; }

/* 弹窗 */
.modal-wrap { position: fixed; inset: 0; z-index: 9000; display: flex; align-items: center; justify-content: center; padding: 18px; }
.modal-mask { position: absolute; inset: 0; background: rgba(17, 24, 39, .42); }
.modal { position: relative; background: #fff; border-radius: 12px; width: 900px; max-width: 100%; max-height: 92vh; display: flex; flex-direction: column; box-shadow: 0 18px 50px rgba(15, 23, 42, .25); }
.modal.narrow { width: 460px; }
.modal-hd { display: flex; align-items: center; justify-content: space-between; padding: 13px 18px; border-bottom: 1px solid #eef1f7; font-size: 14px; font-weight: 600; }
.modal-hd .x { border: none; background: none; color: #8b93a5; font-size: 15px; cursor: pointer; }
.modal-bd { padding: 14px 18px; overflow: auto; }
.modal-ft { padding: 11px 18px; border-top: 1px solid #eef1f7; display: flex; justify-content: flex-end; gap: 9px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid #eef1f7; margin: 2px 0 12px; flex-wrap: wrap; }
.tabs button { border: none; background: none; padding: 8px 11px; font-size: 12.5px; color: #6b7688; cursor: pointer; border-bottom: 2px solid transparent; }
.tabs button.on { color: #2f6fed; border-bottom-color: #2f6fed; font-weight: 600; }
.tab-pane { min-height: 120px; }
.form-row { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.form-row > span { font-size: 12px; color: #6b7688; }
.form-row input, .form-row select { border: 1px solid #dbe1ec; border-radius: 7px; padding: 8px 10px; font-size: 12.5px; outline: none; }
.form-row input:focus, .form-row select:focus { border-color: #2f6fed; }
.form-2 { display: flex; gap: 12px; }
.form-2 > * { flex: 1; min-width: 0; }
.note { font-size: 11.5px; color: #8792a8; line-height: 1.6; }

/* toast */
.toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #1f2937; color: #fff; font-size: 12.5px; padding: 9px 16px; border-radius: 8px; opacity: .96; transition: opacity .3s; }
.toast.err { background: #c23b3b; }

@media (max-width: 900px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar { width: 150px; }
  .toolbar input { width: 100%; }
}
@media (max-width: 640px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px; }
  .sidebar .brand, .who { margin: 0; }
  .who { display: none; }
  .nav { flex-direction: row; }
  .side-foot { margin: 0 0 0 auto; padding: 0; border: none; }
  .main { padding: 14px; }
}
