* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  color: #1f2933;
  background: #f4f6f8;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 190px;
  background: #263238;
  color: #fff;
  padding: 18px 12px;
}
.brand {
  padding: 8px 10px 18px;
  font-size: 18px;
  font-weight: 700;
}
.sidebar button {
  display: block;
  width: 100%;
  height: 38px;
  margin: 4px 0;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  color: #d9e1e8;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.sidebar button.active,
.sidebar button:hover {
  color: #fff;
  background: #3b4a52;
}
.main {
  min-height: 100vh;
  margin-left: 190px;
}
.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 22px;
  background: #fff;
  border-bottom: 1px solid #dfe4ea;
}
#title {
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
}
.login,
.toolbar,
.tabs,
.pager {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
input,
button,
select {
  height: 34px;
  border: 1px solid #cbd5df;
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
}
button {
  cursor: pointer;
}
.primary,
.login button {
  color: #fff;
  border-color: #1677ff;
  background: #1677ff;
}
.danger {
  color: #fff;
  border-color: #d92d20;
  background: #d92d20;
}
.content {
  padding: 22px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.metric,
.empty,
.loading,
.error,
.hint {
  background: #fff;
  border: 1px solid #dfe4ea;
  border-radius: 8px;
  padding: 14px;
}
.metric .label {
  color: #697783;
  font-size: 13px;
}
.metric .value {
  margin-top: 8px;
  font-size: 24px;
  font-weight: 700;
}
.toolbar {
  margin-bottom: 12px;
}
.tabs {
  margin-bottom: 12px;
}
.tabs button.active {
  color: #fff;
  border-color: #1677ff;
  background: #1677ff;
}
.hint {
  margin-bottom: 12px;
  color: #52606d;
}
.table-wrap {
  overflow: auto;
  background: #fff;
  border: 1px solid #dfe4ea;
  border-radius: 8px;
}
table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}
th,
td {
  padding: 10px;
  border-bottom: 1px solid #edf1f5;
  font-size: 13px;
  text-align: left;
  vertical-align: top;
}
th {
  color: #52606d;
  background: #f8fafc;
  font-weight: 700;
}
td button {
  margin: 0 4px 4px 0;
}
.pager {
  margin-top: 12px;
  color: #52606d;
}
.error {
  color: #b42318;
  white-space: pre-wrap;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.45);
}
.modal.hidden {
  display: none;
}
.modal-panel {
  width: min(1080px, 96vw);
  max-height: 88vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #dfe4ea;
}
.modal-body {
  overflow: auto;
  padding: 16px;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.detail-grid div {
  min-height: 58px;
  padding: 10px;
  border: 1px solid #edf1f5;
  border-radius: 6px;
  background: #f8fafc;
}
.detail-grid label {
  display: block;
  margin-bottom: 6px;
  color: #697783;
  font-size: 12px;
}
.detail-grid span {
  word-break: break-all;
}
.modal-body h3 {
  margin: 18px 0 10px;
  font-size: 15px;
}
@media (max-width: 820px) {
  .sidebar {
    position: static;
    width: 100%;
  }
  .main {
    margin-left: 0;
  }
  .topbar {
    height: auto;
    align-items: flex-start;
    flex-direction: column;
    padding: 14px;
  }
}
