:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #1f2328;
  --muted: #656d76;
  --line: #d8dee4;
  --accent: #2463eb;
  --accent-dark: #1b4fc4;
  --ok: #1a7f37;
  --warn: #9a6700;
  --bad: #cf222e;
  --radius: 8px;
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.boot {
  margin: 30vh auto;
  text-align: center;
  color: var(--muted);
}

/* 顶栏 */
header.top {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0 1.5rem;
  height: 56px;
  background: #1f2328;
  color: #fff;
}

header.top .brand {
  font-weight: 600;
  font-size: 1.05rem;
  color: #fff;
}

header.top nav {
  display: flex;
  gap: 1rem;
  flex: 1;
}

header.top nav a {
  color: #c9d1d9;
}

header.top nav a.current {
  color: #fff;
  font-weight: 600;
}

header.top .who {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #c9d1d9;
  font-size: 0.9rem;
}

main {
  max-width: 1080px;
  margin: 1.5rem auto;
  padding: 0 1rem 3rem;
}

h1 {
  font-size: 1.4rem;
  margin: 0 0 1rem;
}

h2 {
  font-size: 1.1rem;
  margin: 0 0 0.75rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.spread {
  justify-content: space-between;
}

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

.small {
  font-size: 0.85rem;
}

/* 表单 */
label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

label > span {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--muted);
}

input[type="text"],
input[type="password"],
input[type="url"],
select {
  width: 100%;
  max-width: 420px;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}

input:focus,
select:focus,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

button {
  font: inherit;
  padding: 0.45rem 0.95rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
}

button:hover {
  background: #f3f4f6;
}

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

button.primary:hover {
  background: var(--accent-dark);
}

button.danger {
  color: var(--bad);
  border-color: #f1aeb5;
}

button.link {
  border: none;
  background: none;
  color: inherit;
  padding: 0;
  text-decoration: underline;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.login {
  max-width: 380px;
  margin: 12vh auto;
}

/* 表格 */
table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 0.92rem;
}

th {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.85rem;
}

tr:last-child td {
  border-bottom: none;
}

.empty {
  color: var(--muted);
  padding: 2rem 0;
  text-align: center;
}

/* 状态标记 */
.badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.8rem;
  background: #eaeef2;
  color: var(--muted);
  white-space: nowrap;
}

.badge.ok {
  background: #dafbe1;
  color: var(--ok);
}

.badge.warn {
  background: #fff8c5;
  color: var(--warn);
}

.badge.bad {
  background: #ffebe9;
  color: var(--bad);
}

.badge.info {
  background: #ddf4ff;
  color: #0969da;
}

/* 提示 */
.notice {
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin: 0.75rem 0;
  font-size: 0.92rem;
  line-height: 1.6;
}

.notice.info {
  background: #ddf4ff;
}

.notice.warn {
  background: #fff8c5;
}

.notice.bad {
  background: #ffebe9;
  color: #82071e;
}

.notice.ok {
  background: #dafbe1;
}

.secret {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 1.05rem;
  background: #fff;
  border: 1px dashed var(--line);
  padding: 0.3rem 0.6rem;
  user-select: all;
}

dl.info {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 0.5rem 1rem;
  margin: 0;
}

dl.info dt {
  color: var(--muted);
}

dl.info dd {
  margin: 0;
  word-break: break-all;
}

/* 日志 */
pre.logs {
  background: #0d1117;
  color: #e6edf3;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  max-height: 360px;
  overflow: auto;
  font-size: 0.82rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0.5rem 0 0;
}

pre.logs .warn {
  color: #e3b341;
}

pre.logs .error {
  color: #ff7b72;
}

.progress {
  height: 6px;
  background: #eaeef2;
  border-radius: 3px;
  overflow: hidden;
  max-width: 420px;
}

.progress > div {
  height: 100%;
  background: var(--accent);
  width: 0;
  transition: width 0.2s;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tabs button.current {
  background: #1f2328;
  color: #fff;
  border-color: #1f2328;
}

@media (max-width: 640px) {
  header.top {
    flex-wrap: wrap;
    height: auto;
    padding: 0.6rem 1rem;
    gap: 0.5rem 1rem;
  }
  dl.info {
    grid-template-columns: 1fr;
  }
  th:nth-child(n + 4),
  td:nth-child(n + 4) {
    display: none;
  }
}

/* 一键部署弹窗 */
main.import {
  max-width: 720px;
}

.choices {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

label.choice {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  margin: 0;
}

label.choice:has(input:checked) {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

label.choice > span {
  flex: 1;
}

label.choice input[type="text"],
label.choice select {
  margin-top: 0.4rem;
  width: 100%;
}

main.import .account {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.9rem;
  color: var(--muted);
  margin: -0.25rem 0 0.75rem;
}

main.import .account:empty {
  display: none;
}

h2.spaced {
  margin-top: 1.5rem;
}
