:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --panel-2: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --green: #34d399;
  --red: #f87171;
  --border: #334155;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: #0b1220;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  color: white;
  font-weight: 800;
}

.brand h1 {
  margin: 0;
  font-size: 18px;
}

.brand small {
  color: var(--muted);
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.status i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
}

.status i.online {
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

.status i.offline {
  background: var(--red);
}

main {
  max-width: 1180px;
  margin: 24px auto;
  padding: 0 20px 60px;
  display: grid;
  gap: 18px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head h2 {
  margin: 0;
  font-size: 16px;
}

.quiet {
  color: var(--muted);
  font-size: 12px;
}

.row,
.actions,
.head-actions,
.grid {
  display: flex;
  gap: 10px;
  align-items: center;
}

input,
select,
textarea {
  width: 100%;
  background: #0b1220;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
}

textarea {
  min-height: 140px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--accent);
  border-color: transparent;
}

button {
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}

button:hover {
  filter: brightness(1.15);
}

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #062033;
  font-weight: 700;
}

button.danger {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.4);
  color: var(--red);
}

.check {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.check input {
  width: auto;
}

.hint {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.result {
  min-height: 60px;
  max-height: 320px;
  overflow: auto;
  margin: 14px 0 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0b1220;
  color: #a5f3fc;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  white-space: pre-wrap;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

td {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

td.key-cell {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.ops {
  display: flex;
  gap: 6px;
}

.ops button {
  padding: 5px 8px;
  font-size: 12px;
}

.empty {
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 100px auto;
}

@media (max-width: 760px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .panel-head,
  .row,
  .actions {
    flex-direction: column;
    align-items: stretch;
  }
}

.pool-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}
.pool-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #000;
  border: 1px solid #1e293b;
  border-radius: 6px;
}
.pool-item code {
  font-size: 13px;
  color: #fff;
}
.pool-state {
  font-size: 12px;
  color: #94a3b8;
  margin-left: auto;
}
