/* 后台样式（复用 /assets/app.css 的令牌）。 */
body.admin {
  background: var(--bg-canvas);
}

/* 登录 */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--sp-base);
}
.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--bg-surface);
  border: 1px solid var(--divider);
  border-radius: var(--r-lg);
  padding: var(--sp-xl);
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
  box-shadow: var(--shadow);
}
.login-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--text-secondary);
}
input,
select {
  font: inherit;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--divider);
  background: var(--bg-elevated);
  color: var(--text-primary);
  width: 100%;
}
.err {
  color: var(--danger-fg);
  font-size: 14px;
  margin: 4px 0 0;
}

/* 顶栏 */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid var(--divider);
  background: var(--bg-surface);
  position: sticky;
  top: 0;
  z-index: 5;
}
.topbar .brand img {
  width: 26px;
  height: 26px;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  font-size: 14px;
}

/* 通用按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: var(--r-sm);
  font-weight: 600;
  font-size: 14px;
  border: 1px solid var(--divider);
  background: var(--bg-elevated);
  color: var(--text-primary);
  cursor: pointer;
}
.btn.primary {
  background: var(--brand-work);
  color: var(--text-on-brand);
  border-color: transparent;
}
.btn.ghost {
  background: transparent;
}
.btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* 面板 */
.panel {
  background: var(--bg-surface);
  border: 1px solid var(--divider);
  border-radius: var(--r-lg);
  padding: var(--sp-xl);
  margin-top: var(--sp-lg);
}
.panel h3 {
  margin: 0 0 var(--sp-md);
  font-size: 18px;
}

/* 健康 */
.health {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--sp-md);
}
.hcard {
  border: 1px solid var(--divider);
  border-radius: var(--r-md);
  padding: var(--sp-md) var(--sp-base);
}
.hcard .k {
  font-size: 13px;
  color: var(--text-secondary);
}
.hcard .v {
  font-size: 16px;
  font-weight: 600;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.dot.up {
  background: var(--brand-work);
}
.dot.down {
  background: var(--danger-fg);
}

/* 统计网格 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--sp-md);
}
.stat-grid .cell {
  border: 1px solid var(--divider);
  border-radius: var(--r-md);
  padding: var(--sp-base);
}
.stat-grid .cell .num {
  font-size: 24px;
  font-weight: 700;
  color: var(--brand-work);
  font-variant-numeric: tabular-nums;
}
.stat-grid .cell .label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* 平台行 */
.prow {
  border: 1px solid var(--divider);
  border-radius: var(--r-md);
  padding: var(--sp-base);
  margin-bottom: var(--sp-md);
  display: grid;
  grid-template-columns: 1.4fr 1.4fr 1.2fr;
  gap: var(--sp-base);
  align-items: start;
}
.prow .pname {
  font-weight: 700;
  font-size: 16px;
}
.prow .pkind {
  font-size: 12px;
  color: var(--text-secondary);
}
.prow .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}
.prow .row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-primary);
}
.switch input {
  width: auto;
}
.fileinfo {
  font-size: 12px;
  color: var(--text-secondary);
  word-break: break-all;
}
.up-progress {
  height: 6px;
  background: var(--divider);
  border-radius: 999px;
  overflow: hidden;
  display: none;
}
.up-progress > i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--brand-work);
}

/* 表格 */
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th,
td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--divider);
  white-space: nowrap;
}
th {
  color: var(--text-secondary);
  font-weight: 600;
}
.st-success {
  color: var(--brand-work);
  font-weight: 600;
}
.st-failed {
  color: var(--danger-fg);
  font-weight: 600;
}

/* toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: var(--bg-surface);
  padding: 10px 18px;
  border-radius: var(--r-md);
  font-size: 14px;
  box-shadow: var(--shadow);
  z-index: 50;
}
@media (max-width: 720px) {
  .prow {
    grid-template-columns: 1fr;
  }
}
