:root {
  color-scheme: dark;
  --bg: #050706;
  --panel: #0b0e0d;
  --line: #222826;
  --text: #e8ece8;
  --muted: #89908c;
  --green: #6dffb0;
  --yellow: #e7ef72;
  --red: #ff6f93;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: ui-monospace, "Microsoft YaHei", SFMono-Regular, Menlo, Consolas, monospace;
}

.shell {
  width: min(940px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 18px 0 52px;
}

.hidden {
  display: none !important;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.login-card {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.018);
  padding: 22px;
}

.login-title,
.brand {
  color: var(--text);
  font-size: 22px;
  font-weight: 800;
  text-decoration: none;
}

.login-card p,
.hint,
.subtle {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.topbar,
.section-title,
.actions,
.bot-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.page-view,
.section {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
}

.section.small {
  color: var(--muted);
  font-size: 13px;
}

h1,
h2 {
  margin: 0;
  font-size: 18px;
}

.step-label {
  margin-bottom: 10px;
  color: var(--green);
  font-size: 12px;
}

.badge {
  color: var(--yellow);
  border: 1px solid rgba(231, 239, 114, 0.25);
  padding: 7px 10px;
  font-size: 12px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.wide {
  grid-column: 1 / -1;
}

input,
select,
button {
  border: 1px solid var(--line);
  background: #101312;
  color: var(--text);
  font: inherit;
  min-height: 44px;
}

input,
select {
  width: 100%;
  padding: 0 13px;
}

button {
  cursor: pointer;
  padding: 0 18px;
  font-weight: 700;
}

button.primary {
  background: var(--yellow);
  color: #080907;
}

button.ghost {
  background: transparent;
  color: var(--muted);
}

.wide-button {
  width: 100%;
}

.actions {
  justify-content: flex-start;
  margin-top: 16px;
}

.sticky-actions {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.bot-cards,
.pool-result {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.wallet-list {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.wallet-item,
.empty-inline {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.018);
  padding: 10px;
}

.wallet-item {
  display: grid;
  gap: 6px;
}

.wallet-item strong {
  color: var(--green);
  font-size: 13px;
}

.wallet-item code,
.empty-inline {
  color: var(--muted);
  font-size: 12px;
  word-break: break-all;
}

.bot-card,
.empty-card,
.token-row {
  padding: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.bot-card h3 {
  margin: 0;
  font-size: 15px;
}

.bot-meta {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.bot-meta strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 13px;
}

.token-row {
  display: grid;
  gap: 8px;
}

.candidate-head,
.candidate-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.018);
  padding: 12px;
}

.candidate-head {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.candidate-head strong {
  color: var(--green);
  font-size: 13px;
}

.candidate-card {
  width: 100%;
  min-height: auto;
  display: grid;
  gap: 7px;
  text-align: left;
  font-weight: 400;
}

.candidate-card:hover {
  border-color: rgba(109, 255, 176, 0.45);
}

.candidate-card span,
.candidate-card small {
  color: var(--muted);
  font-size: 12px;
}

.candidate-card strong {
  color: var(--text);
  font-size: 14px;
}

.candidate-card code {
  color: var(--green);
  word-break: break-all;
}

.token-row strong {
  color: var(--green);
}

.token-row code,
pre {
  white-space: pre-wrap;
  word-break: break-all;
}

.base-choice {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  color: var(--muted);
}

.base-choice button.active {
  border-color: var(--green);
  color: var(--green);
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.inline-check input {
  width: auto;
  min-height: auto;
}

.danger {
  color: var(--red);
  border-color: rgba(255, 111, 147, 0.35);
}

#statusBox,
#loginStatus {
  min-height: 70px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #090b0a;
  color: var(--muted);
}

@media (max-width: 720px) {
  .shell {
    width: min(100vw - 18px, 560px);
    padding-top: 10px;
  }

  .page-view,
  .section,
  .login-card {
    padding: 14px;
  }

  .grid,
  .bot-meta {
    grid-template-columns: 1fr;
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .actions .wide-button {
    grid-column: 1 / -1;
  }
}
