:root {
  --bg: #0f1115;
  --panel: #171a21;
  --border: #262b36;
  --text: #e6e8ee;
  --muted: #8b93a7;
  --accent: #7aa2f7;
  --accent-dim: #5b80c9;
  --danger: #f7768e;
}

* { box-sizing: border-box; }

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

code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.9em; }

/* ---- login ---- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; }
.login-card {
  width: 100%; max-width: 360px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
}
.brand { margin: 0 0 4px; font-size: 32px; letter-spacing: 4px; text-align: center; }
.subtitle { margin: 0 0 24px; color: var(--muted); font-size: 13px; text-align: center; }

label { display: block; margin-bottom: 16px; }
label > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }

input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
}
input:focus { outline: none; border-color: var(--accent); }

button {
  width: 100%;
  padding: 10px 12px;
  background: var(--accent);
  color: #0b0d13;
  border: 0;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
button:disabled { background: var(--accent-dim); cursor: progress; }
button:hover:not(:disabled) { background: var(--accent-dim); }
button.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  width: auto;
  padding: 6px 14px;
  font-weight: 400;
}
button.ghost:hover { color: var(--text); border-color: var(--accent); }

.error { color: var(--danger); font-size: 13px; margin-top: 12px; }
.error-text { color: var(--danger); }
.muted { color: var(--muted); }
.notice { color: var(--accent); font-size: 13px; margin-top: 12px; }

/* ---- console ---- */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 28px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.brand-sm { font-size: 18px; letter-spacing: 2px; }

.console { max-width: 900px; margin: 0 auto; padding: 24px 28px; }
.console section { margin-bottom: 40px; }
.console h2 { margin: 0 0 12px; font-size: 20px; }

table.data { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
table.data th, table.data td { padding: 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data th { background: #1c1f28; color: var(--muted); font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: 1px; }
table.data tr:last-child td { border-bottom: 0; }
.truncate { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#new-project-form { background: var(--panel); padding: 20px; border: 1px solid var(--border); border-radius: 8px; }

/* ---- switch ---- */
.switch { position: relative; display: inline-block; width: 36px; height: 20px; margin: 0; vertical-align: middle; cursor: pointer; }
/* 全局 input 规则给了内边距和边框；不归零会让隐藏的 checkbox 撑开 label，导致滑块与滑槽错位 */
.switch input { position: absolute; top: 0; left: 0; margin: 0; padding: 0; border: 0; width: 36px; height: 20px; opacity: 0; }
.switch span { position: absolute; top: 0; left: 0; right: 0; bottom: 0; margin: 0; background: var(--border); transition: .15s; border-radius: 20px; }
.switch span:before { content: ""; position: absolute; height: 16px; width: 16px; left: 2px; top: 2px; background: white; transition: .15s; border-radius: 50%; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span:before { transform: translateX(16px); }
