:root {
  --bg: #0f1419;
  --panel: #1a222c;
  --text: #e7eef7;
  --muted: #9fb0c3;
  --accent: #3d9cf0;
  --line: #2a3644;
  --danger: #f07178;
  --ok: #7ddea3;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: radial-gradient(1200px 600px at 10% -10%, #1d2a3a, var(--bg));
  color: var(--text);
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 8px;
  gap: 16px;
}

.top h1 {
  margin: 0 0 4px;
  font-size: 24px;
}

.top p {
  margin: 0;
}

.shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  padding: 8px 24px 32px;
  min-height: calc(100vh - 88px);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: color-mix(in srgb, var(--panel) 92%, black);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  height: fit-content;
  position: sticky;
  top: 12px;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
}

.nav a:hover,
.nav a.active {
  background: #243041;
  color: var(--text);
}

.view {
  min-width: 0;
}

.panel {
  background: color-mix(in srgb, var(--panel) 92%, black);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}

input,
select,
textarea {
  background: #0c1117;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  min-width: 160px;
  font: inherit;
}

textarea {
  min-height: 100px;
  width: 100%;
  resize: vertical;
}

button {
  background: var(--accent);
  color: #061018;
  border: 0;
  border-radius: 8px;
  padding: 9px 14px;
  font-weight: 600;
  cursor: pointer;
}

button.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

button.danger {
  background: var(--danger);
  color: #1a0808;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 8px 6px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 600;
}

.code {
  margin: 0;
  background: #0c1117;
  border-radius: 8px;
  padding: 12px;
  overflow: auto;
  max-height: 360px;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.msg {
  min-height: 1.2em;
  color: var(--ok);
}

.msg.err {
  color: var(--danger);
}

.check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.captcha-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.captcha-input {
  flex: 1;
}

.captcha-img-btn {
  padding: 0;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  line-height: 0;
}

.captcha-img-btn img {
  display: block;
  width: 140px;
  height: 48px;
}

.check-row {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--muted);
}

.check-row input[type="checkbox"] {
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  flex: none;
}

.login-card {
  width: min(420px, 100%);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: 420px;
  background: #243041;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  z-index: 40;
}

.toast.err {
  border-color: var(--danger);
  color: #ffd0d3;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field-hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  font-weight: 400;
}

.subhead {
  margin: 22px 0 8px;
  font-size: 18px;
}

.cap-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 12px 0 18px;
}

.cap-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: #121920;
}

.cap-card-head {
  margin-bottom: 8px;
}

.cap-enable {
  margin-bottom: 0;
  font-size: 15px;
  color: var(--text);
}

.cap-desc {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}

.cap-tips {
  margin: 0 0 12px;
  font-size: 12px;
  color: #b7d4ef;
  line-height: 1.55;
  background: #0c1520;
  border-radius: 8px;
  padding: 10px;
}

.tag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: #2a5f8f;
  color: #e7f3ff;
}

.muted-tag {
  background: #2a3644;
  color: var(--muted);
}

.auth-actions {
  margin-top: 8px;
}

@media (max-width: 960px) {
  .shell,
  .grid-2,
  .cap-grid {
    grid-template-columns: 1fr;
  }

  .nav {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }
}
