* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 14px/1.6 -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #222; background: #f5f7fa;
}
.hide { display: none !important; }

/* ---------------- 登录 ---------------- */
.login {
  height: 100%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1f2937, #2f6fed);
}
.login-box {
  width: 340px; background: #fff; border-radius: 12px; padding: 30px 28px;
  box-shadow: 0 18px 50px rgba(0,0,0,.28);
}
.brand { font-size: 17px; font-weight: 700; letter-spacing: .5px; }
.brand span { font-size: 13px; font-weight: 400; color: #8b9099; margin-left: 4px; }
.login-box .brand { margin-bottom: 22px; text-align: center; }
.login-box label { display: block; font-size: 12px; color: #6b7078; margin: 12px 0 5px; }
.login-box input, .form input, .form select, .form textarea {
  width: 100%; height: 38px; padding: 0 10px; border: 1px solid #d7dde6;
  border-radius: 7px; font-size: 14px; background: #fff; color: #222;
  font-family: inherit;
}
.form textarea { height: auto; padding: 8px 10px; resize: vertical; }
.login-box input:focus, .form input:focus, .form select:focus, .form textarea:focus {
  outline: none; border-color: #2f6fed; box-shadow: 0 0 0 3px rgba(47,111,237,.12);
}
.login-box button { width: 100%; margin-top: 20px; }
.msg { margin-top: 12px; font-size: 13px; color: #c62828; text-align: center; min-height: 18px; }

button { font-family: inherit; cursor: pointer; }
button.primary {
  height: 38px; padding: 0 18px; border: none; border-radius: 7px;
  background: #2f6fed; color: #fff; font-size: 14px; font-weight: 600;
}
button.primary:active { transform: scale(.98); }
button.ghost {
  height: 38px; padding: 0 16px; border: 1px solid #d7dde6; border-radius: 7px;
  background: #fff; color: #444; font-size: 14px;
}
button.mini {
  height: 28px; padding: 0 10px; border: 1px solid #d7dde6; border-radius: 6px;
  background: #fff; color: #2f6fed; font-size: 12px;
}
button.mini.danger { color: #c62828; }
button.mini:hover { background: #f0f5ff; }

/* ---------------- 主体 ---------------- */
.app { height: 100%; display: flex; flex-direction: column; }
header {
  height: 52px; flex: none; display: flex; align-items: center; gap: 26px;
  padding: 0 20px; background: #1f2937; color: #fff;
}
header .brand { color: #fff; }
header .brand span { color: #9aa6b8; }
header nav { display: flex; gap: 4px; flex: 1; }
header nav a {
  padding: 6px 14px; border-radius: 7px; color: #b9c3d3; font-size: 14px;
  cursor: pointer; text-decoration: none;
}
header nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
header nav a.on { background: #2f6fed; color: #fff; font-weight: 600; }
header .right { display: flex; align-items: center; gap: 14px; font-size: 13px; color: #b9c3d3; }
header .link { color: #b9c3d3; cursor: pointer; text-decoration: underline; }
header .link:hover { color: #fff; }

main { flex: 1; overflow: auto; padding: 20px; }

/* ---------------- 卡片 / 表格 ---------------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.stat {
  background: #fff; border: 1px solid #e3e8ef; border-radius: 10px; padding: 16px 18px;
}
.stat .k { font-size: 12px; color: #8b9099; }
.stat .v { font-size: 26px; font-weight: 700; margin-top: 4px; color: #1f2937; }

.panel {
  background: #fff; border: 1px solid #e3e8ef; border-radius: 10px;
  overflow: hidden; margin-bottom: 16px;
}
.panel-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  border-bottom: 1px solid #eef2f7;
}
.panel-head h3 { margin: 0; font-size: 15px; }
.panel-head .sp { flex: 1; }
.panel-body { padding: 14px 16px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid #eef2f7; vertical-align: middle; }
th { background: #f8fafc; color: #6b7078; font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
td .ops { display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px;
  background: #eef2ff; color: #2f6fed; margin: 1px 3px 1px 0;
}
.tag.gray { background: #f1f3f6; color: #6b7078; }
.tag.green { background: #e8f5e9; color: #2e7d32; }
.tag.red { background: #fdecea; color: #c62828; }

.empty { padding: 40px; text-align: center; color: #9aa0a6; font-size: 13px; }
.pager { display: flex; align-items: center; gap: 10px; padding: 12px 16px; color: #6b7078; font-size: 13px; }
.pager .sp { flex: 1; }

input.search {
  height: 32px; padding: 0 10px; border: 1px solid #d7dde6; border-radius: 7px;
  font-size: 13px; width: 220px;
}

/* breadcrumb */
.crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #6b7078; margin-bottom: 12px; }
.crumb a { color: #2f6fed; cursor: pointer; }

/* ---------------- 弹窗 ---------------- */
.modal {
  position: fixed; inset: 0; background: rgba(15,23,42,.45);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal-box {
  width: 520px; max-width: 92vw; max-height: 86vh; background: #fff;
  border-radius: 12px; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.modal-head {
  display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid #eef2f7;
}
.modal-head b { flex: 1; font-size: 15px; }
.modal-head .x { cursor: pointer; font-size: 20px; color: #9aa0a6; line-height: 1; }
.modal-body { padding: 16px 18px; overflow: auto; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 12px 18px; border-top: 1px solid #eef2f7;
}

.form label { display: block; font-size: 12px; color: #6b7078; margin: 12px 0 5px; }
.form label:first-child { margin-top: 0; }
.form .row { display: flex; gap: 10px; }
.form .row > * { flex: 1; }
.form .chk { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.form .chk label {
  display: flex; align-items: center; gap: 5px; margin: 0;
  padding: 5px 10px; border: 1px solid #d7dde6; border-radius: 16px; font-size: 13px; color: #444;
  cursor: pointer;
}
.form .chk input { width: auto; height: auto; }
.hint { font-size: 12px; color: #9aa0a6; margin-top: 6px; }

.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%);
  background: rgba(20,22,26,.9); color: #fff; padding: 9px 18px; border-radius: 8px;
  font-size: 13px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 200;
}
.toast.show { opacity: 1; }
