/* ===== 全局样式 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  background: #f3f5f9;
  color: #2b3445;
  font-size: 14px;
}
a { color: #3b6fe0; text-decoration: none; }
.hidden { display: none !important; }
.op-col { width: 120px; text-align: center; }

/* ===== 顶部导航 ===== */
.topbar {
  background: #1f2a44;
  color: #fff;
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar .logo { font-size: 17px; font-weight: 700; margin-right: 36px; letter-spacing: 1px; }
.topbar nav a {
  color: #c3cbdc;
  padding: 8px 16px;
  border-radius: 6px;
  margin-right: 6px;
  font-size: 14px;
}
.topbar nav a.active, .topbar nav a:hover { background: #33456e; color: #fff; }
.topbar .spacer { flex: 1; }
.topbar .user-box { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.topbar .role-tag {
  background: #33456e; color: #9fc1ff; padding: 3px 10px; border-radius: 12px; font-size: 12px;
}
.topbar .logout-btn {
  background: none; border: 1px solid #5b6b8f; color: #c3cbdc; padding: 5px 14px;
  border-radius: 6px; cursor: pointer; font-size: 13px;
}
.topbar .logout-btn:hover { background: #3a4a70; color: #fff; }

/* ===== 主体容器 ===== */
.container { max-width: 1280px; margin: 20px auto; padding: 0 20px; }
.page-title { font-size: 20px; font-weight: 700; margin-bottom: 16px; }
.card {
  background: #fff; border-radius: 10px; box-shadow: 0 1px 4px rgba(31, 42, 68, .08);
  padding: 18px 20px; margin-bottom: 18px;
}
.card h3 { font-size: 15px; margin-bottom: 14px; color: #1f2a44; }

/* ===== 统计卡片 ===== */
.stats-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card {
  background: #fff; border-radius: 10px; padding: 16px 14px; box-shadow: 0 1px 4px rgba(31, 42, 68, .08);
  text-align: center; border-left: 4px solid #3b6fe0;
}
.stat-card .num { font-size: 26px; font-weight: 700; color: #1f2a44; }
.stat-card .label { font-size: 12px; color: #7a8498; margin-top: 4px; }

/* ===== 筛选工具条 ===== */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 14px; }
.toolbar label { font-size: 13px; color: #5c6678; }
.toolbar select, .toolbar input[type="text"], .toolbar input[type="number"] {
  height: 34px; border: 1px solid #d7dce6; border-radius: 6px; padding: 0 10px; font-size: 13px; background: #fff; outline: none;
}
.toolbar select:focus, .toolbar input:focus { border-color: #3b6fe0; }
.btn {
  height: 34px; padding: 0 16px; border: none; border-radius: 6px; background: #3b6fe0; color: #fff;
  font-size: 13px; cursor: pointer;
}
.btn:hover { background: #2f5cc7; }
.btn.ghost { background: #fff; border: 1px solid #d7dce6; color: #3b6fe0; }
.btn.ghost:hover { background: #f0f4fd; }
.btn.mini { height: 28px; padding: 0 10px; font-size: 12px; }
.btn.danger, .btn.ghost.danger { color: #d93026; border-color: #f3c1be; }
.btn.ghost.danger:hover { background: #fdf0ef; }

/* ===== 表格 ===== */
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  background: #f0f3f9; color: #44506a; text-align: left; padding: 10px 12px; font-weight: 600;
  border-bottom: 1px solid #dfe4ee; white-space: nowrap;
}
table.data td { padding: 10px 12px; border-bottom: 1px solid #eef1f7; }
table.data tr:hover td { background: #f7f9fd; }
.link-btn { color: #3b6fe0; cursor: pointer; font-size: 13px; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger-link { color: #d93026; }
.link-btn.danger-link:hover { text-decoration: underline; }
.empty-tip { text-align: center; color: #98a2b6; padding: 28px 0; }

/* ===== 详情弹窗 ===== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(20, 26, 40, .45); display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal {
  background: #fff; border-radius: 12px; width: 680px; max-width: 92vw; max-height: 88vh; overflow: auto; padding: 22px 24px;
}
.modal h3 { font-size: 18px; margin-bottom: 16px; }
.modal .close-x { float: right; cursor: pointer; color: #98a2b6; font-size: 20px; }

/* ===== 弹窗窗口化：可拖拽移动 / 最小化 / 关闭 ===== */
.modal-titlebar {
  display: flex; align-items: center; justify-content: space-between;
  margin: -22px -24px 14px; padding: 9px 8px 9px 16px;
  background: #1f2a44; color: #fff; border-radius: 12px 12px 0 0;
  cursor: move; user-select: none; font-size: 14px; font-weight: 600; white-space: nowrap;
}
.modal-titlebar .mt-title { overflow: hidden; text-overflow: ellipsis; max-width: 70%; }
.modal-titlebar .mt-btns { display: flex; gap: 6px; flex-shrink: 0; }
.modal-titlebar .mt-btns span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 24px; border-radius: 5px; cursor: pointer; font-size: 13px; color: #c3cbdc; line-height: 1;
}
.modal-titlebar .mt-btns span:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.modal-titlebar .mt-btns .mt-close:hover { background: #d93026; color: #fff; }
.modal.modal-min {
  position: fixed !important; left: auto !important; right: 16px; bottom: 0; top: auto !important;
  width: 300px !important; max-width: 300px !important; height: 40px; overflow: hidden;
  padding: 0 !important; border-radius: 8px 8px 0 0; box-shadow: 0 -2px 12px rgba(31, 42, 68, .25);
}
.modal.modal-min .modal-titlebar { margin: 0; border-radius: 8px 8px 0 0; height: 40px; }
.modal.modal-min > *:not(.modal-titlebar) { display: none !important; }
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 16px; margin-bottom: 16px; }
.detail-grid .item { font-size: 13px; }
.detail-grid .item .k { color: #7a8498; }
.detail-grid .item .v { font-weight: 600; color: #1f2a44; }
.form-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.form-row label { width: 110px; flex-shrink: 0; font-size: 13px; color: #5c6678; }
.form-row input[type="text"], .form-row select {
  flex: 1; height: 34px; border: 1px solid #d7dce6; border-radius: 6px; padding: 0 10px; font-size: 13px;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.sub-table { margin-bottom: 14px; }
.sub-table h4 { font-size: 14px; margin-bottom: 8px; color: #33456e; }
.sub-table table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.sub-table th { background: #f6f8fc; padding: 7px 10px; text-align: left; border: 1px solid #e4e9f2; }
.sub-table td { padding: 7px 10px; border: 1px solid #eef1f7; }

/* ===== 登录页 ===== */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1f2a44 0%, #2c4270 60%, #3b6fe0 100%); }
.login-box { background: #fff; border-radius: 14px; padding: 40px 44px; width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.login-box h1 { font-size: 22px; text-align: center; margin-bottom: 6px; }
.login-box .sub { text-align: center; color: #7a8498; font-size: 13px; margin-bottom: 26px; }
.login-box .field { margin-bottom: 16px; }
.login-box .field label { display: block; font-size: 13px; color: #5c6678; margin-bottom: 6px; }
.login-box .field input { width: 100%; height: 42px; border: 1px solid #d7dce6; border-radius: 8px; padding: 0 14px; font-size: 14px; outline: none; }
.login-box .field input:focus { border-color: #3b6fe0; }
.login-box .btn { width: 100%; height: 44px; font-size: 15px; }
.login-err { color: #d94343; font-size: 13px; margin-bottom: 10px; min-height: 18px; text-align: center; }
.login-tip { margin-top: 14px; background: #f5f7fb; border-radius: 8px; padding: 12px 14px; font-size: 12px; color: #66708a; line-height: 1.8; }

/* ===== 权限管理 ===== */
.perm-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.perm-role { border: 1px solid #e2e7f1; border-radius: 10px; padding: 14px 16px; }
.perm-role h4 { margin-bottom: 10px; font-size: 14px; color: #33456e; }
.perm-role label { display: block; font-size: 13px; margin: 6px 0; cursor: pointer; }
.perm-role input { margin-right: 6px; }
.save-bar { margin-top: 16px; text-align: right; }
.tip-msg { color: #2e8b57; font-size: 13px; margin-top: 8px; text-align: right; }
