* { box-sizing: border-box; }
body {
  min-height: 100vh;
  margin: 0;
  color: #1b2930;
  background: #eef3f6;
  font-family: "Microsoft YaHei", Arial, sans-serif;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 248px;
  display: flex;
  flex-direction: column;
  background: #102932;
  color: #d8e5e8;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #1f7a8c;
  color: #fff;
  font-weight: 700;
}
.brand strong, .brand span { display: block; }
.brand span { margin-top: 3px; color: #94aeb5; font-size: 12px; }
.nav { padding: 12px; }
.nav-group {
  margin: 14px 10px 7px;
  color: #7fa0a8;
  font-size: 12px;
}
.nav-item {
  width: 100%;
  min-height: 48px;
  margin-bottom: 6px;
  border: 0;
  border-radius: 7px;
  padding: 0 14px;
  text-align: left;
  color: #c6d7dc;
  background: transparent;
  cursor: pointer;
}
.nav-item span, .nav-item small { display: block; }
.nav-item small { margin-top: 3px; color: #8facb3; font-size: 11px; }
.nav-item:hover, .nav-item.active {
  color: #fff;
  background: #1f7a8c;
}
.nav-item:hover small, .nav-item.active small { color: #d9f0f4; }
.nav-item.strong { border: 1px solid rgba(82,167,187,.45); }
.sidebar-foot {
  margin-top: auto;
  padding: 14px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-foot a, .link-list a {
  display: block;
  margin-bottom: 8px;
  color: #52a7bb;
  text-decoration: none;
}
.main { margin-left: 248px; min-height: 100vh; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid #d8e2e7;
}
.topbar h1 { margin: 0 0 4px; font-size: 22px; }
.topbar p { margin: 0; color: #667980; }
.top-actions, .toolbar, .section-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.section-head { justify-content: space-between; margin-bottom: 12px; }
.toolbar.small button { height: 32px; }
button {
  min-height: 36px;
  border: 0;
  border-radius: 7px;
  padding: 0 14px;
  color: #fff;
  background: #1f7a8c;
  cursor: pointer;
  font: inherit;
}
button:hover { filter: brightness(.94); }
button.ghost { color: #1f5d6a; background: #e7f1f4; }
button.warn { background: #b4533a; }
.view { display: none; padding: 18px; }
.view.active { display: block; }
.panel {
  margin-bottom: 16px;
  padding: 18px;
  background: #fff;
  border: 1px solid #d6e1e6;
  border-radius: 8px;
}
.panel h2, .panel h3 { margin: 0 0 12px; }
.panel p { color: #607278; line-height: 1.6; }
.metrics, .grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.db-header {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.db-card {
  padding: 14px;
  background: #fff;
  border: 1px solid #d6e1e6;
  border-radius: 8px;
}
.db-card span { display: block; color: #63777e; font-size: 13px; }
.db-card strong { display: block; margin-top: 8px; font-size: 24px; }
.db-tools .section-head p { margin: 4px 0 0; }
.filterbar {
  padding: 12px;
  background: #f6fafb;
  border: 1px solid #e0eaee;
  border-radius: 8px;
}
.action-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 12px 0;
  padding: 10px;
  background: #eef6f8;
  border-radius: 8px;
}
.action-strip > span {
  margin-right: 8px;
  color: #42575f;
  font-weight: 600;
}
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.metric {
  min-height: 96px;
  padding: 16px;
  background: #fff;
  border: 1px solid #d6e1e6;
  border-left: 5px solid #1f7a8c;
  border-radius: 8px;
}
.metric span { display: block; color: #63777e; }
.metric strong { display: block; margin-top: 10px; font-size: 30px; }
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}
.status-list {
  display: grid;
  gap: 10px;
}
.status-list span {
  padding: 10px 12px;
  background: #f1f6f8;
  border-radius: 7px;
}
input, textarea, select {
  width: 100%;
  min-height: 38px;
  border: 1px solid #cbd9df;
  border-radius: 7px;
  padding: 8px 10px;
  color: #1b2930;
  background: #fff;
  font: inherit;
}
input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: auto;
  padding: 0;
}
.toolbar input { width: 260px; }
.toolbar select { width: 150px; }
textarea { resize: vertical; }
.import-box { min-height: 190px; font-family: Consolas, monospace; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
}
.form-grid h2, .form-grid textarea, .form-grid button { grid-column: 1 / -1; }
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
}
th, td {
  padding: 10px;
  border-bottom: 1px solid #e4ecef;
  text-align: left;
  vertical-align: middle;
}
th { color: #597078; background: #f6fafb; }
.db-table {
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid #d8e5ea;
  border-radius: 10px;
  overflow: hidden;
}
.db-table th,
.db-table td {
  font-size: 14px;
  padding: 12px 10px;
  border-right: 1px solid #edf2f5;
}
.db-table th:last-child,
.db-table td:last-child { border-right: 0; }
.db-table th {
  position: relative;
  user-select: none;
  background: #f3f8fa;
  color: #39535b;
  font-weight: 600;
}
.db-table td {
  background: #ffffff;
}
.db-table tbody tr:nth-child(even) td {
  background: #fbfdfe;
}
.db-table tbody tr:hover td {
  background: #eef7fb;
}
.db-table td button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}
.db-table td:last-child {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.db-table th:first-child,
.db-table td:first-child {
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  text-align: center;
}
.db-table th:nth-child(2) { min-width: 240px; }
.db-table th:nth-child(3) { min-width: 180px; }
.db-table th:nth-child(4) { min-width: 180px; }
.db-table th:nth-child(5) { min-width: 110px; }
.db-table th:nth-child(6),
.db-table th:nth-child(7),
.db-table th:nth-child(8) { min-width: 170px; }
.db-table th:nth-child(9) { min-width: 160px; }
.cell-clip {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.db-table .col-resizer {
  position: absolute;
  top: 0;
  right: 0;
  width: 8px;
  height: 100%;
  cursor: col-resize;
}
.db-table .col-resizer:hover {
  background: rgba(31, 122, 140, 0.15);
}
.mono { font-family: Consolas, monospace; font-size: 12px; }
.pill {
  display: inline-flex;
  min-width: 72px;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 9px;
  color: #17613b;
  background: #dff3e8;
}
.pill.disabled { color: #8b3f2e; background: #fde7df; }
.pager { display: flex; gap: 10px; justify-content: flex-end; align-items: center; margin-top: 12px; }
.switch-card.important { border-color: #8dc8d4; box-shadow: inset 0 0 0 1px #b9e0e7; }
.switch {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.switch input { display: none; }
.switch span {
  width: 58px;
  height: 30px;
  position: relative;
  border-radius: 999px;
  background: #bccbd0;
  transition: .2s;
}
.switch span:after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  transition: .2s;
}
.switch input:checked + span { background: #1f7a8c; }
.switch input:checked + span:after { transform: translateX(28px); }
.line { display: flex; gap: 8px; align-items: center; margin: 12px 0; }
.line.compact { margin: 0 8px; color: #42575f; }
.line input { width: auto; min-height: auto; }
pre, .mini-log {
  overflow: auto;
  max-height: 360px;
  margin: 0;
  padding: 12px;
  color: #dce8ea;
  background: #102027;
  border-radius: 7px;
  white-space: pre-wrap;
}
.log-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.result { color: #1f7a8c; font-weight: 600; }
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-overlay.active { display: flex; }
.modal {
  background: white;
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}
.modal-header {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
}
@media (max-width: 900px) {
  .sidebar { position: static; width: auto; }
  .main { margin-left: 0; }
  .metrics, .grid-3, .split, .log-grid, .form-grid { grid-template-columns: 1fr; }
  .db-header { grid-template-columns: 1fr 1fr; }
  .topbar { align-items: stretch; flex-direction: column; }
  .toolbar input, .toolbar select { width: 100%; }
}
