body.admin {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

/* ---------------- 侧栏 ---------------- */
.ad-side {
  background: #0f1b30;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
}
.ad-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; }
.ad-brand b { display: block; color: #fff; font-size: 15px; letter-spacing: .3px; }
.ad-brand span { display: block; font-size: 11.5px; color: #7c8ba1; margin-top: 1px; }

.ad-nav { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.ad-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  color: #b3c0d3;
  font-size: 13.5px;
  text-decoration: none;
  cursor: pointer;
}
.ad-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.ad-nav a.active { background: linear-gradient(90deg, rgba(37, 99, 235, .95), rgba(59, 130, 246, .8)); color: #fff; font-weight: 500; }
.ad-nav .ico { font-size: 14px; opacity: .85; width: 16px; text-align: center; }

.ad-side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding: 12px 8px 0; border-top: 1px solid rgba(255, 255, 255, .08); }
.ad-side-foot a, .ad-side-foot button {
  color: #8fa1b8; font-size: 12.5px; text-decoration: none; background: none; border: none;
  text-align: left; padding: 6px 4px; cursor: pointer;
}
.ad-side-foot a:hover, .ad-side-foot button:hover { color: #fff; }

/* ---------------- 主区 ---------------- */
.ad-main { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.ad-top {
  height: 60px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.ad-top h1 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.2px; }
.ad-top-right { display: flex; align-items: center; gap: 12px; }

.ad-content { flex: 1; overflow-y: auto; padding: 22px 26px 48px; }

/* ---------------- 卡片 ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.stat .k { font-size: 12.5px; color: var(--text-3); margin-bottom: 8px; }
.stat .v { font-size: 24px; font-weight: 650; letter-spacing: -.5px; }
.stat .s { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.stat.accent { border-color: #c7d8fb; background: linear-gradient(180deg, #f5f9ff, #fff); }
.stat.accent .v { color: var(--primary-dark); }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
}
.panel-head h2 { margin: 0; font-size: 14px; font-weight: 600; }
.panel-body { padding: 16px 18px; }
.panel-body.flush { padding: 0; }

.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 1080px) { .grid-2 { grid-template-columns: 1fr; } }

.port-list { display: flex; flex-direction: column; }
.port-row {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13px;
}
.port-row:last-child { border-bottom: none; }
.port-row .pn { color: var(--text-2); }
.port-row .pp { font-family: var(--mono); font-size: 12.5px; color: var(--text); }

.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .grow { flex: 1; }

.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

.log-list { font-family: var(--mono); font-size: 12px; line-height: 1.7; max-height: 560px; overflow: auto; }
.log-line { display: grid; grid-template-columns: 78px 52px 84px 1fr; gap: 8px; padding: 2px 0; }
.log-line .lv-error { color: var(--danger); }
.log-line .lv-warn { color: var(--warning); }
.log-line .lv-info { color: var(--text-2); }
.log-line .lv-debug { color: var(--text-3); }
.log-line .sc { color: var(--primary); }

.kv { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.kv:last-child { border-bottom: none; }
.kv span { color: var(--text-2); }
.kv b { font-weight: 600; }

@media (max-width: 860px) {
  body.admin { grid-template-columns: 64px minmax(0, 1fr); }
  .ad-brand div, .ad-nav a span:not(.ico), .ad-side-foot { display: none; }
  .ad-nav a { justify-content: center; padding: 0; }
  .ad-content { padding: 16px; }
}
