:root {
  --pku-red: #990000;
  --ink: #172033;
  --muted: #6b7280;
  --line: #dfe4ec;
  --bg: #f4f6f9;
  --panel: #ffffff;
  --blue: #1f4e79;
  --cyan: #008c95;
  --green: #168a4a;
  --yellow: #b7791f;
  --red: #c53030;
  --shadow: 0 8px 22px rgba(23, 32, 51, .08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
}

button, input, select, textarea { font: inherit; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 264px;
  flex: 0 0 264px;
  background: #172033;
  color: #e8edf5;
  min-height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  z-index: 10;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.brand-logos {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.brand-logos img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
  padding: 3px;
}
.brand strong { display: block; font-size: 16px; }
.brand span { display: block; color: #adb8c8; margin-top: 4px; font-size: 12px; line-height: 1.35; }
.nav { padding: 10px; }
.nav-section {
  color: #8fa0b8;
  font-size: 12px;
  padding: 12px 10px 6px;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #dbe3ee;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 6px;
  margin: 2px 0;
  min-height: 38px;
}
.nav a:hover, .nav a.active { background: rgba(255,255,255,.1); color: #fff; }
.nav .ico { width: 18px; text-align: center; color: #9fd3dc; }
.main { flex: 1; min-width: 0; }
.topbar {
  height: 64px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 22px;
  position: sticky;
  top: 0;
  z-index: 5;
}
.top-title { min-width: 0; }
.top-title strong { display: block; font-size: 17px; }
.top-title span { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.operator {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #344054;
  white-space: nowrap;
}
.content { padding: 18px 22px 28px; }
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.page-head h1 { margin: 0; font-size: 22px; line-height: 1.25; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.grid { display: grid; gap: 14px; }
.kpi-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.two-col { grid-template-columns: 1.1fr .9fr; }
.three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.card-header strong { font-size: 15px; }
.card-body { padding: 16px; }
.kpi-card { padding: 16px; position: relative; overflow: hidden; min-height: 116px; }
.kpi-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--accent, var(--blue));
}
.kpi-card .label { color: var(--muted); }
.kpi-card .value { font-size: 27px; font-weight: 800; margin: 10px 0 8px; }
.kpi-card .trend { font-size: 12px; color: var(--muted); }
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.toolbar input, .toolbar select, .form-grid input, .form-grid select, .form-grid textarea {
  border: 1px solid #cad2df;
  border-radius: 6px;
  min-height: 36px;
  padding: 7px 10px;
  background: #fff;
  color: var(--ink);
}
.toolbar input { min-width: 220px; }
.btn {
  border: 1px solid #c9d3df;
  background: #fff;
  color: #24324a;
  border-radius: 6px;
  min-height: 36px;
  padding: 7px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.btn:hover { border-color: #94a3b8; }
.btn.primary { background: var(--pku-red); border-color: var(--pku-red); color: #fff; }
.btn.blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.ghost { background: #f7f9fc; }
.icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}
.menu-toggle { display: none; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td {
  padding: 11px 12px;
  border-bottom: 1px solid #e7ebf1;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}
th { color: #475569; background: #f8fafc; font-weight: 700; }
td .sub { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  border: 1px solid transparent;
}
.badge.ok { background: #e8f7ee; color: #126c3a; border-color: #b9e6c8; }
.badge.info { background: #e8f3fb; color: #1f4e79; border-color: #bad7ea; }
.badge.warn { background: #fff7df; color: #8a5b11; border-color: #f4df9c; }
.badge.danger { background: #fdecec; color: #a02121; border-color: #f5b7b7; }
.badge.gray { background: #edf1f6; color: #526173; border-color: #d7dee8; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.online { background: #22c55e; }
.dot.warn { background: #f59e0b; }
.dot.offline { background: #ef4444; }
.muted { color: var(--muted); }
.chart-box { height: 260px; position: relative; }
.chart-box canvas { width: 100%; height: 100%; display: block; }
.mini-list { display: grid; gap: 10px; }
.list-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid #edf0f5;
}
.list-item:last-child { border-bottom: 0; }
.list-item strong { display: block; margin-bottom: 4px; }
.quick-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.quick {
  min-height: 72px;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  font-weight: 700;
}
.steps { display: flex; gap: 8px; flex-wrap: wrap; }
.step {
  flex: 1 1 130px;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 10px;
}
.step b { display: block; color: var(--blue); margin-bottom: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field label { display: block; color: #475569; margin-bottom: 6px; font-weight: 700; }
.field.full { grid-column: 1 / -1; }
.upload-box {
  border: 1px dashed #8aa0b8;
  border-radius: 8px;
  background: #f8fbff;
  padding: 22px;
  text-align: center;
}
.pagination {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 12px 16px;
  color: var(--muted);
}
.modal-mask {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, .45);
  z-index: 30;
  padding: 20px;
}
.modal-mask[hidden] {
  display: none !important;
}
.app-dialog {
  width: min(760px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0,0,0,.25);
}
.app-dialog-header, .app-dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.app-dialog-footer { border-top: 1px solid var(--line); border-bottom: 0; justify-content: flex-end; }
.app-dialog-body { padding: 16px; }

@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .quick-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    left: -270px;
    transition: left .2s ease;
    box-shadow: 8px 0 24px rgba(0,0,0,.18);
  }
  .sidebar.open { left: 0; }
  .menu-toggle { display: inline-block; }
  .topbar { padding: 0 12px; }
  .operator { display: none; }
  .content { padding: 14px; }
  .page-head { flex-direction: column; }
  .actions { justify-content: flex-start; }
  .two-col, .three-col, .kpi-grid, .quick-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .toolbar input, .toolbar select { min-width: 0; width: 100%; }
  .btn { justify-content: center; }
}
