/* 设计系统：浅色默认，现代化排版与控件对齐 */
:root,
html[data-theme="light"] {
  --bg: #f4f6f9;
  --bg-elevated: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #0d9488;
  --accent-hover: #0f766e;
  --accent-soft: rgba(13, 148, 136, 0.1);
  --accent-2: #6366f1;
  --danger: #dc2626;
  --ok: #059669;
  --warn: #d97706;
  --border: #e8ecf1;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 6px 16px rgba(15, 23, 42, 0.05);
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 38px rgba(15, 23, 42, 0.08);
  --code-bg: #f1f5f9;
  --input-bg: #ffffff;
  --layout-max: 1320px;
  --layout-inline: 1.25rem;
  --card-gap: 1.35rem;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --control-h: 2rem;
}

html[data-theme="dark"] {
  --bg: #0c1222;
  --bg-elevated: #141b2d;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #2dd4bf;
  --accent-hover: #5eead4;
  --accent-soft: rgba(45, 212, 191, 0.13);
  --accent-2: #818cf8;
  --danger: #f87171;
  --ok: #34d399;
  --warn: #fbbf24;
  --border: #2d3a52;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.32);
  --code-bg: #1e293b;
  --input-bg: #1e293b;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "kern" 1;
}

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

a:hover {
  text-decoration: underline;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  padding: 0.15em 0.4em;
  border-radius: 6px;
  background: var(--code-bg);
  border: 1px solid var(--border);
}

/* —— 登录页（分栏 + 表单卡片） —— */
.auth-login-page {
  margin: 0;
  min-height: 100vh;
}

.auth-toolbar {
  position: fixed;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  pointer-events: none;
}

.auth-toolbar > * {
  pointer-events: auto;
}

.auth-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: var(--control-h);
  padding: 0 0.85rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elevated);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.auth-back-link:hover {
  color: var(--accent);
  border-color: var(--muted);
  text-decoration: none;
}

html[data-theme="dark"] .auth-back-link {
  box-shadow: none;
}

.auth-login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  background: var(--bg);
}

@media (min-width: 900px) {
  .auth-login {
    grid-template-columns: minmax(280px, 1fr) minmax(360px, 520px);
  }
}

/* 左侧品牌区 */
.auth-login-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3.25rem 1.75rem 2.5rem;
  min-height: 220px;
  overflow: hidden;
  color: #e0e7ff;
}

.auth-login-hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 70% at 20% 20%, rgba(129, 140, 248, 0.45), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 80%, rgba(14, 165, 233, 0.35), transparent 50%),
    linear-gradient(155deg, #3730a3 0%, #312e81 38%, #1e1b4b 100%);
}

html[data-theme="dark"] .auth-login-hero-bg {
  background:
    radial-gradient(ellipse 80% 60% at 15% 25%, rgba(99, 102, 241, 0.35), transparent 50%),
    linear-gradient(155deg, #1e1b4b 0%, #0f172a 50%, #020617 100%);
}

.auth-login-hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 20px 20px;
}

.auth-login-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 28rem;
}

.auth-login-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #c7d2fe;
  margin-bottom: 1rem;
}

.auth-login-title {
  margin: 0;
  font-size: clamp(1.65rem, 4vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #fff;
  line-height: 1.2;
}

.auth-login-lead {
  margin: 0.85rem 0 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(224, 231, 255, 0.88);
  max-width: 22rem;
}

.auth-login-features {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.auth-login-features li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.875rem;
  color: rgba(224, 231, 255, 0.92);
}

.auth-login-features svg {
  flex-shrink: 0;
  opacity: 0.9;
  color: #a5b4fc;
}

@media (max-width: 899px) {
  .auth-login-hero {
    min-height: auto;
    padding: 3.25rem 1.25rem 1.5rem;
  }

  .auth-login-lead {
    font-size: 0.875rem;
  }

  .auth-login-features {
    display: none;
  }
}

/* 右侧表单区 */
.auth-login-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem 2.5rem;
}

@media (min-width: 900px) {
  .auth-login-panel {
    padding: 2.5rem 2rem 3rem;
    background: var(--bg);
  }
}

.auth-login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem 2rem;
  box-shadow: var(--shadow-card);
}

.auth-login-card-head {
  margin-bottom: 1.5rem;
}

.auth-login-card-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

.auth-login-card-sub {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.auth-login-error {
  margin-bottom: 1rem;
}

.auth-login-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.auth-field {
  margin-bottom: 1.1rem;
}

.auth-field label {
  display: block;
  margin-top: 0;
  margin-bottom: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
}

.auth-field input[type="text"],
.auth-field input[type="password"] {
  margin-top: 0;
}

.auth-login-submit {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.72rem 1.25rem;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
}

.auth-oauth-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

a.btn.auth-oauth-login {
  width: 100%;
  margin-top: 0;
  box-sizing: border-box;
  text-align: center;
  text-decoration: none;
  padding: 0.72rem 1.25rem;
  font-size: 0.95rem;
  line-height: 1.35;
  color: #fff;
  box-shadow: 0 1px 2px rgba(79, 70, 229, 0.25);
}

a.btn.auth-oauth-login:hover {
  color: #fff;
  text-decoration: none;
}

.auth-login-foot {
  margin: 1.5rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  letter-spacing: 0.02em;
}

/* —— 后台布局 —— */
.layout {
  max-width: var(--layout-max);
  margin: 0 auto;
  padding: 0.5rem var(--layout-inline) 2.75rem;
}

body.admin-body {
  min-height: 100vh;
  margin: 0;
}

/* —— 后台：左侧边栏 + 主内容区 —— */
.admin-sidebar-toggle {
  position: fixed;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.admin-app {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
}

.admin-sidebar-scrim {
  display: none;
}

.admin-sidebar {
  width: var(--admin-sidebar-width, 268px);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--admin-sidebar-bg);
  border-right: 1px solid var(--admin-sidebar-border);
  z-index: 50;
}

.admin-sidebar-head {
  padding: 1.1rem 1rem 0.85rem;
  border-bottom: 1px solid var(--admin-sidebar-border);
}

.admin-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--admin-sidebar-heading);
  min-width: 0;
}

.admin-sidebar-brand:hover {
  color: var(--admin-sidebar-heading);
  text-decoration: none;
}

.admin-sidebar-brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--admin-accent-soft), var(--admin-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--admin-accent) 35%, transparent);
}

.admin-sidebar-brand-mark--img {
  padding: 3px;
  background: var(--admin-panel);
  border: 1px solid var(--admin-sidebar-border);
  box-shadow: none;
}

.admin-sidebar-brand-mark--img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

.admin-sidebar-brand-text {
  font-size: 1.02rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-sidebar-section-label {
  margin: 0 0 0.4rem;
  padding: 0 0.75rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--admin-sidebar-muted);
}

.admin-sidebar-nav {
  flex: 1 1 auto;
  padding: 1rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-height: 0;
  overflow-y: auto;
}

.admin-sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.62rem 0.75rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--admin-sidebar-fg);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.admin-sidebar-link:hover {
  background: var(--admin-sidebar-hover);
  color: var(--admin-sidebar-fg-strong);
  text-decoration: none;
}

.admin-sidebar-link.is-active {
  background: var(--admin-sidebar-active-bg);
  color: var(--admin-sidebar-active-fg);
  border-color: var(--admin-sidebar-active-border);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--admin-accent) 12%, transparent);
}

.admin-sidebar-link:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--admin-accent) 65%, #fff);
  outline-offset: 2px;
}

.admin-sidebar-settings-group {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.admin-sidebar-link--settings-root.is-active {
  margin-bottom: 0.05rem;
}

.admin-sidebar-subnav {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  padding: 0 0.35rem 0.35rem 0.5rem;
  margin: 0 0 0.15rem;
  border-left: 2px solid var(--admin-sidebar-border);
  margin-left: 1.1rem;
}

.admin-sidebar-sublink {
  display: block;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--admin-sidebar-muted);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.admin-sidebar-sublink:hover {
  background: var(--admin-sidebar-hover);
  color: var(--admin-sidebar-fg-strong);
  text-decoration: none;
}

.admin-sidebar-sublink.is-active {
  background: var(--admin-sidebar-active-bg);
  color: var(--admin-sidebar-active-fg);
  font-weight: 650;
}

.admin-sidebar-sublink:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--admin-accent) 55%, #fff);
  outline-offset: 2px;
}

.admin-sidebar-link--external {
  margin-top: 0.35rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--admin-sidebar-border);
  border-radius: 0;
  color: var(--admin-sidebar-muted);
  font-weight: 500;
}

.admin-sidebar-link--external:hover {
  color: var(--admin-sidebar-fg-strong);
}

.admin-sidebar-ico {
  flex-shrink: 0;
  opacity: 0.92;
}

.admin-sidebar-link.is-active .admin-sidebar-ico {
  opacity: 1;
}

.admin-sidebar-spacer {
  flex: 1 1 auto;
  min-height: 0.5rem;
}

.admin-sidebar-foot {
  padding: 0.85rem 0.75rem 1rem;
  border-top: 1px solid var(--admin-sidebar-border);
}

.admin-sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  width: 100%;
}

.admin-sidebar-theme {
  flex-shrink: 0;
  margin: 0 0 0 auto;
  align-self: center;
}

.admin-sidebar-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--admin-accent-soft), var(--admin-accent));
  color: #fff;
  font-weight: 800;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.admin-sidebar-user-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.admin-sidebar-email {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--admin-sidebar-fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-sidebar-logout {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--admin-sidebar-muted);
  text-decoration: none;
  width: fit-content;
}

.admin-sidebar-logout:hover {
  color: var(--admin-accent);
  text-decoration: underline;
}

.admin-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--admin-bg);
}

.admin-main-topbar {
  display: none;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  background: var(--admin-panel);
  border-bottom: 1px solid var(--admin-border);
  position: sticky;
  top: 0;
  z-index: 30;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.admin-sidebar-burger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  border: 1px solid var(--admin-border);
  background: #f8fafc;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}

.admin-sidebar-burger:hover {
  background: #eef2f7;
  border-color: #cbd5e1;
}

.admin-sidebar-burger-box {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 18px;
}

.admin-sidebar-burger-line {
  display: block;
  height: 2px;
  border-radius: 1px;
  background: #334155;
}

.admin-main-topbar-title {
  font-size: 0.95rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 959px) {
  .admin-sidebar-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(15, 23, 42, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    cursor: pointer;
  }

  .admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    height: 100vh;
    max-width: min(288px, 88vw);
    transform: translateX(-104%);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    box-shadow: none;
  }

  .admin-sidebar-toggle:checked + .admin-app .admin-sidebar {
    transform: translateX(0);
    box-shadow: 12px 0 40px rgba(15, 23, 42, 0.18);
  }

  .admin-sidebar-toggle:checked + .admin-app .admin-sidebar-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .admin-main-topbar {
    display: flex;
  }
}

@media (min-width: 960px) {
  .admin-sidebar {
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    overflow-y: auto;
  }
}

.admin-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.35rem 0 1rem;
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent-2) 8%, var(--bg-elevated)), color-mix(in srgb, var(--accent) 8%, var(--bg-elevated)));
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.admin-hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, #34d399, var(--accent), #60a5fa);
  opacity: 0.9;
}

.admin-hero-main h1 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.admin-hero-main p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.admin-hero-main .admin-page-subtitle {
  margin: 0.3rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.admin-hero-main .admin-page-lead {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
}

.admin-hero-stats {
  display: flex;
  align-items: stretch;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.admin-stat-pill {
  min-width: 90px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.5rem 0.7rem;
  background: var(--bg-elevated);
}

.admin-stat-pill span {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
}

.admin-stat-pill strong {
  display: block;
  margin-top: 0.15rem;
  font-size: 1.05rem;
  line-height: 1;
}

.admin-stat-pill-ok strong {
  color: var(--ok);
}

.admin-stat-pill-warn strong {
  color: var(--warn);
}

.admin-col-main {
  min-width: 0;
}

.admin-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
}

.admin-list-head h2 {
  margin: 0;
}

.admin-list-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.admin-list-tools {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.admin-add-btn {
  border-radius: 999px;
  padding: 0.36rem 0.85rem;
  font-size: 0.8rem;
  letter-spacing: 0.01em;
}

.admin-refresh {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.admin-refresh select {
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text);
  padding: 0.35rem 0.8rem;
  font-size: 0.82rem;
}

.admin-refresh select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.dashboard-page {
  padding-top: 1rem;
}

.admin-page-intro {
  margin-bottom: 0.95rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
}

.admin-page-intro h1 {
  margin: 0;
  font-size: 1.18rem;
  letter-spacing: -0.02em;
}

.admin-page-intro p {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.dash-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.dash-head h1 {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
}

.dash-head p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.dash-head .admin-page-subtitle {
  margin: 0.28rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
}

.dash-head .admin-page-lead {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--muted);
}

/* 后台页：主标题下的「后台标题」副标题（来自设置） */
.admin-page-subtitle {
  margin: 0.28rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--admin-muted, var(--muted));
  letter-spacing: -0.01em;
}

.admin-page-lead {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.admin-page-head {
  margin-bottom: 1rem;
}

.admin-page-head__title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

body.admin-body .admin-page-head__title {
  color: #0f172a;
}

body.admin-body .admin-page-subtitle {
  color: #64748b;
}

body.admin-body .admin-page-lead {
  color: #64748b;
}

.form-card .admin-page-subtitle,
.compact-card > .admin-page-subtitle,
.card > .admin-page-subtitle {
  margin: 0.35rem 0 0.65rem;
}

.dash-head-meta {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.45rem 0.75rem;
  background: var(--bg-elevated);
  text-align: right;
}

.dash-head-meta span {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
}

.dash-head-meta strong {
  font-size: 1.2rem;
}

.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  margin-bottom: 0.9rem;
}

.dash-kpi {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-elevated);
  padding: 0.95rem 1rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.dash-kpi::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: color-mix(in srgb, var(--accent-2) 60%, var(--accent));
  opacity: 0.55;
}

.dash-kpi-label {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
}

.dash-kpi-value {
  display: block;
  margin-top: 0.22rem;
  font-size: 1.55rem;
  line-height: 1.05;
}

.dash-kpi em {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-style: normal;
  font-size: 0.76rem;
}

.dash-kpi-ok .dash-kpi-value { color: var(--ok); }
.dash-kpi-bad .dash-kpi-value { color: var(--danger); }
.dash-kpi-warn .dash-kpi-value { color: var(--warn); }

.dash-main-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 0.8rem;
  margin-bottom: 0.9rem;
}

.dash-panel {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
  padding: 0.95rem 1rem;
}

.dash-panel-soft {
  background: color-mix(in srgb, var(--accent-soft) 30%, var(--bg-elevated));
}

.dash-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 0.75rem;
}

.dash-panel-head h2 {
  margin: 0;
  font-size: 1rem;
}

.dash-panel-head span {
  color: var(--muted);
  font-size: 0.76rem;
}

.dash-metric-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dash-metric-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.dash-metric-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.dash-metric-title span {
  color: var(--muted);
  font-size: 0.82rem;
}

.dash-metric-title strong {
  font-size: 0.95rem;
}

.dash-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--code-bg);
  overflow: hidden;
}

.dash-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #818cf8, #4f46e5);
}

.dash-action-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
}

.dash-action {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
  padding: 0.6rem 0.72rem;
  color: var(--text);
  font-size: 0.88rem;
  text-decoration: none;
}

.dash-action:hover {
  background: var(--code-bg);
  text-decoration: none;
}

.dash-action strong {
  display: block;
  font-size: 0.89rem;
  color: var(--text);
}

.dash-action span {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.dash-chart-panel {
  padding-bottom: 0.75rem;
}

.dash-chart-wrap {
  width: 100%;
  overflow-x: auto;
}

.dash-chart-wrap canvas {
  width: 100%;
  min-width: 760px;
  display: block;
}

/* —— 后台顶栏（参考用户中心：品牌行 + 胶囊导航） —— */
.admin-header-logo-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.admin-header-logo-link:hover {
  text-decoration: none;
}

.admin-header-logo-box {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.admin-header-logo-box--img {
  padding: 4px;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

html[data-theme="dark"] .admin-header-logo-box--img {
  background: #1e293b;
  border-color: #334155;
}

.admin-header-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

.admin-header-logo-icon {
  width: 26px;
  height: 26px;
}

.admin-header-brand-text {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  white-space: nowrap;
  color: var(--text);
}

html[data-theme="dark"] .admin-header-brand-text {
  color: #e2e8f0;
}

.admin-header-user {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
  margin-left: auto;
}

.admin-header-user-block {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.admin-header-avatar-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  border-radius: 50%;
  line-height: 0;
  flex-shrink: 0;
}

.admin-header-logout-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  background: none;
  padding: 0.2rem 0;
  border: none;
  border-radius: 0;
  white-space: nowrap;
  transition: color 0.15s;
}

.admin-header-logout-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.admin-header-logout-link:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 3px;
  border-radius: 4px;
}

html[data-theme="dark"] .admin-header-logout-link:focus-visible {
  outline-color: #93c5fd;
}

html[data-theme="dark"] .admin-header-logout-link {
  color: #94a3b8;
}

html[data-theme="dark"] .admin-header-logout-link:hover {
  color: #c7d2fe;
}

.admin-header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  border: 2px solid rgba(255, 255, 255, 0.85);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  pointer-events: none;
}

html[data-theme="dark"] .admin-header-avatar {
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.admin-header-theme {
  margin-top: 0.15rem;
  align-self: center;
}

@media (max-width: 640px) {
  :root,
  html[data-theme="light"],
  html[data-theme="dark"] {
    --layout-inline: 0.85rem;
  }
}

/* 主题切换 */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--control-h);
  height: var(--control-h);
  min-width: var(--control-h);
  min-height: var(--control-h);
  padding: 0;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--code-bg);
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  box-sizing: border-box;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
}

.theme-toggle:hover {
  color: var(--text);
  background: var(--bg-elevated);
  border-color: var(--muted);
}

.theme-toggle:active {
  transform: scale(0.96);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-toggle .theme-icon {
  width: 1rem;
  height: 1rem;
  display: block;
  flex-shrink: 0;
}

html[data-theme="light"] .theme-toggle .theme-icon-sun {
  display: none;
}

html[data-theme="dark"] .theme-toggle .theme-icon-moon {
  display: none;
}

.user-pill {
  font-size: 0.8125rem;
  color: var(--muted);
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: var(--code-bg);
  border: 1px solid var(--border);
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.45rem 1.55rem;
  margin-bottom: var(--card-gap);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.card.form-card {
  max-width: none;
  width: 100%;
}

.card.compact-card {
  max-width: none;
  width: 100%;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.admin-form-grid .form-row {
  margin-bottom: 0;
}

.field-note {
  margin-top: 0.35rem;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  opacity: 0.8;
}

.card h2 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text);
}

label {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
}

label:first-of-type,
.form-row:first-child label {
  margin-top: 0;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.62rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 0.9375rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

html[data-theme="dark"] input:focus {
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.2);
}

button,
.btn {
  display: inline-block;
  margin-top: 0.85rem;
  padding: 0.4rem 0.95rem;
  border-radius: 8px;
  border: none;
  background: #334155;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.875rem;
  line-height: 1.35;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  box-shadow: none;
}

button:hover,
.btn:hover {
  background: #1f2937;
  text-decoration: none;
}

button:active,
.btn:active {
  transform: translateY(1px);
}

button.secondary,
.btn.secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

button.secondary:hover,
.btn.secondary:hover {
  background: var(--code-bg);
  border-color: var(--muted);
}

button.ghost,
.btn.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
}

button.ghost:hover,
.btn.ghost:hover {
  background: var(--code-bg);
  color: var(--text);
}

.error {
  color: var(--danger);
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.2);
}

html[data-theme="dark"] .error {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.25);
}

.success-msg {
  color: var(--ok);
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(5, 150, 105, 0.1);
  border: 1px solid rgba(5, 150, 105, 0.25);
}

html[data-theme="dark"] .success-msg {
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.28);
}

.table-wrap {
  overflow-x: auto;
  margin: 0.4rem -0.1rem 0;
  padding: 0.15rem;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--code-bg) 82%, var(--bg-elevated));
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  overflow: hidden;
}

th,
td {
  text-align: left;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

thead th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: color-mix(in srgb, var(--code-bg) 88%, var(--bg-elevated));
  position: sticky;
  top: 0;
  z-index: 1;
}

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

tbody tr.server-meta-row td {
  border-top: none;
  padding: 0.65rem 0.85rem 0.9rem;
  background: var(--code-bg);
  vertical-align: top;
}

tbody tr.server-meta-row[hidden] {
  display: none;
}

.server-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 0.5rem 1rem;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.server-meta-bars {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 0.35rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.server-meta-bar-block {
  min-width: 0;
}

.server-meta-bar-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.admin-node-bar {
  height: 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 22%, transparent);
  overflow: hidden;
  max-width: 100%;
}

.admin-node-bar-fill {
  height: 100%;
  border-radius: inherit;
  min-width: 0;
  transition: width 0.35s ease, background 0.2s ease;
}

.admin-node-bar-fill--low {
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 85%, #fff), var(--accent));
}

.admin-node-bar-fill--mid {
  background: linear-gradient(90deg, #f59e0b, #ea580c);
}

.admin-node-bar-fill--high {
  background: linear-gradient(90deg, #ef4444, #b91c1c);
}

.server-meta-bar-detail {
  margin: 0.4rem 0 0;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--muted);
}

.server-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.server-meta-item span {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.server-meta-item em {
  font-style: normal;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}

.server-meta-item small {
  font-weight: 500;
  color: var(--muted);
}

.server-meta-ellipsis {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

tbody tr:hover {
  background: color-mix(in srgb, var(--accent-soft) 70%, transparent);
}

html[data-theme="dark"] tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.badge.ok {
  background: rgba(5, 150, 105, 0.14);
  color: var(--ok);
  border-color: rgba(5, 150, 105, 0.2);
}

.badge.warn {
  background: rgba(217, 119, 6, 0.14);
  color: var(--warn);
  border-color: rgba(217, 119, 6, 0.2);
}

.badge.bad {
  background: rgba(220, 38, 38, 0.12);
  color: var(--danger);
  border-color: rgba(220, 38, 38, 0.2);
}

html[data-theme="dark"] .badge.ok {
  background: rgba(52, 211, 153, 0.18);
}

html[data-theme="dark"] .badge.warn {
  background: rgba(251, 191, 36, 0.14);
}

html[data-theme="dark"] .badge.bad {
  background: rgba(248, 113, 113, 0.18);
}

.form-row {
  margin-bottom: 0.25rem;
}

.form-row label {
  margin-top: 0;
}

textarea.code.one-line {
  min-height: 3.5rem;
}

textarea.code {
  width: 100%;
  min-height: 200px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.5;
  padding: 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--code-bg);
  color: var(--text);
  resize: vertical;
}

.hint {
  color: var(--muted);
  font-size: 0.875rem;
  margin: 0.35rem 0 0;
  line-height: 1.55;
}

.actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.actions button,
.actions .btn {
  margin-top: 0.45rem;
}

td button,
td .btn {
  margin-top: 0;
}

.table-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.table-btn {
  margin-top: 0;
  border-radius: 999px;
  padding: 0.26rem 0.58rem;
  font-size: 0.72rem;
  line-height: 1.25;
  font-weight: 600;
}

.table-btn.table-btn-soft {
  background: #f8fafc;
  border: 1px solid var(--border);
  color: #334155;
}

.table-btn.table-btn-soft:hover {
  background: #eef2f7;
  border-color: #cbd5e1;
}

.table-btn.table-btn-primary {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
}

.table-btn.table-btn-primary:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.table-btn.table-btn-danger {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.table-btn.table-btn-danger:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

.server-meta-toggle {
  min-width: 5.4rem;
  text-align: center;
}

.table-wrap.table-wrap-nodes {
  max-height: min(68vh, 760px);
  overflow: auto;
}

.table-wrap.table-wrap-nodes .node-table {
  min-width: 1120px;
}

.table-wrap.table-wrap-nodes .node-table .server-ip-cell {
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}


.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  line-height: 1.45;
}

.checkbox-label input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0.15rem 0 0;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.section-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

/* 删除服务器页：卸载命令区与危险操作按钮 */
.delete-server-uninstall {
  margin-top: 1.15rem;
  padding: 1rem 1rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--code-bg);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.delete-server-uninstall-head {
  margin-bottom: 0.45rem;
}

.delete-server-uninstall-label {
  margin-bottom: 0;
}

.delete-server-uninstall-title {
  display: block;
  font-size: 0.875rem;
  font-weight: 650;
  color: var(--text);
  letter-spacing: -0.01em;
}

.delete-server-uninstall-sub {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.76rem;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.45;
}

.delete-server-code-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

textarea.code.delete-server-code {
  margin: 0;
  flex: 1;
  min-width: 0;
  min-height: 2.85rem;
  max-height: 10rem;
  padding: 0.65rem 0.75rem;
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre;
  overflow-x: auto;
  resize: vertical;
  tab-size: 4;
  -webkit-overflow-scrolling: touch;
}

.delete-server-uninstall-hint {
  margin: 0.55rem 0 0;
  font-size: 0.8125rem;
}

.delete-server-uninstall-hint code {
  font-size: 0.76rem;
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

/* 后台通用：代码块旁复制图标按钮（删除节点 / 安装向导等共用） */
body.admin-body button.admin-copy-ico {
  margin-top: 0;
  flex-shrink: 0;
  width: 2.65rem;
  height: 2.65rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  color: #64748b;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

body.admin-body button.admin-copy-ico:hover:not(:disabled) {
  background: var(--code-bg);
  color: #334155;
  border-color: #cbd5e1;
}

body.admin-body button.admin-copy-ico:focus {
  outline: none;
}

body.admin-body button.admin-copy-ico:focus-visible {
  box-shadow: 0 0 0 3px var(--accent-soft);
  border-color: var(--accent);
}

body.admin-body button.admin-copy-ico:disabled {
  cursor: default;
  opacity: 0.85;
}

body.admin-body button.admin-copy-ico.is-copied {
  color: var(--ok);
  border-color: rgba(5, 150, 105, 0.35);
  background: rgba(5, 150, 105, 0.08);
}

body.admin-body button.admin-copy-ico.is-error {
  color: var(--danger);
  border-color: rgba(220, 38, 38, 0.35);
  background: rgba(220, 38, 38, 0.06);
}

.admin-copy-ico__svg {
  display: block;
  pointer-events: none;
}

.admin-copy-ico__svg.admin-copy-ico__check {
  display: none;
}

body.admin-body button.admin-copy-ico.is-copied .admin-copy-ico__svg.admin-copy-ico__idle {
  display: none;
}

body.admin-body button.admin-copy-ico.is-copied .admin-copy-ico__svg.admin-copy-ico__check {
  display: block;
}

html[data-theme="dark"] body.admin-body button.admin-copy-ico {
  color: #94a3b8;
}

html[data-theme="dark"] body.admin-body button.admin-copy-ico:hover:not(:disabled) {
  color: #e2e8f0;
  border-color: #475569;
}

html[data-theme="dark"] body.admin-body button.admin-copy-ico.is-copied {
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.35);
}

html[data-theme="dark"] body.admin-body button.admin-copy-ico.is-error {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.35);
}

.delete-server-form {
  margin-top: 1.35rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--border);
}

.delete-server-form-actions {
  margin-top: 0.35rem;
}

.delete-server-form-actions .btn,
.delete-server-form-actions button {
  margin-top: 0.45rem;
}

body.admin-body button.delete-server-confirm,
body.admin-body .btn.delete-server-confirm {
  background: #dc2626;
  color: #fff;
  border-color: #b91c1c;
  box-shadow: none;
}

body.admin-body button.delete-server-confirm:hover,
body.admin-body .btn.delete-server-confirm:hover {
  background: #b91c1c;
  border-color: #991b1b;
  color: #fff;
}

html[data-theme="dark"] .delete-server-uninstall {
  box-shadow: none;
  background: rgba(15, 23, 42, 0.45);
}

html[data-theme="dark"] body.admin-body button.delete-server-confirm,
html[data-theme="dark"] body.admin-body .btn.delete-server-confirm {
  background: #dc2626;
  border-color: #f87171;
}

html[data-theme="dark"] body.admin-body button.delete-server-confirm:hover,
html[data-theme="dark"] body.admin-body .btn.delete-server-confirm:hover {
  background: #b91c1c;
  border-color: #fca5a5;
}

.install-highlight {
  border-left: 3px solid var(--accent);
  padding: 0.65rem 0 0.65rem 1rem;
  margin-bottom: 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--accent-soft);
}

/* 添加节点后 · 安装说明（极简层次：一段说明 + 分组命令） */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.install-wizard.card {
  padding: 0;
  overflow: visible;
}

.install-wizard--added::before {
  background: linear-gradient(90deg, #34d399, var(--accent), #60a5fa);
  opacity: 1;
  height: 3px;
}

.install-wizard-success {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 0;
  padding: 1rem 1.35rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(5, 150, 105, 0.07) 0%, rgba(5, 150, 105, 0.02) 100%);
}

html[data-theme="dark"] .install-wizard-success {
  background: linear-gradient(180deg, rgba(52, 211, 153, 0.1) 0%, rgba(52, 211, 153, 0.02) 100%);
}

.install-wizard-success-ico {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  color: var(--ok);
  background: rgba(5, 150, 105, 0.12);
  border: 1px solid rgba(5, 150, 105, 0.22);
}

html[data-theme="dark"] .install-wizard-success-ico {
  background: rgba(52, 211, 153, 0.14);
  border-color: rgba(52, 211, 153, 0.28);
}

.install-wizard-success-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.install-wizard-success-text strong {
  font-size: 0.9375rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--text);
}

.install-wizard-success-text span {
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--muted);
}

.install-wizard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.25rem;
  margin: 0;
  padding: 1.15rem 1.35rem 1rem;
  border-bottom: 1px solid var(--border);
}

.install-wizard-header-main {
  min-width: 0;
  flex: 1 1 auto;
}

.install-wizard-kicker {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.install-wizard-h {
  margin: 0 0 0.55rem;
  font-size: 1.125rem;
  font-weight: 650;
  letter-spacing: -0.025em;
  color: var(--text);
}

.install-wizard-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.45rem;
}

.install-wizard-node-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
  padding: 0.22rem 0.55rem 0.22rem 0.45rem;
  border-radius: 999px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  background: var(--code-bg);
  border: 1px solid var(--border);
  word-break: break-all;
}

.install-wizard-node-badge svg {
  flex-shrink: 0;
  opacity: 0.65;
}

.install-wizard-meta-sep {
  color: var(--border);
  user-select: none;
}

.install-wizard-meta-hint {
  font-size: 0.8125rem;
  color: var(--muted);
}

.install-wizard-meta-hint code {
  font-size: 0.76rem;
}

.install-wizard-steps {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
  flex-shrink: 0;
}

.install-wizard-step {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.76rem;
  color: var(--muted);
  white-space: nowrap;
}

.install-wizard-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--muted);
}

.install-wizard-step.is-done {
  color: var(--ok);
}

.install-wizard-step.is-done .install-wizard-step-num {
  color: var(--ok);
  border-color: rgba(5, 150, 105, 0.35);
  background: rgba(5, 150, 105, 0.1);
}

.install-wizard-step.is-current {
  color: var(--text);
  font-weight: 600;
}

.install-wizard-step.is-current .install-wizard-step-num {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

html[data-theme="dark"] .install-wizard-step.is-current .install-wizard-step-num {
  color: #0c1222;
}

.install-wizard-body {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 0;
}

.install-wizard-note {
  margin: 0;
  padding: 1.1rem 1.15rem 1.15rem 1.35rem;
  border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--code-bg) 55%, var(--bg-elevated));
}

.install-wizard-note-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.55rem;
}

.install-wizard-note-ico {
  flex-shrink: 0;
  color: var(--accent);
  opacity: 0.9;
}

.install-wizard-note-title {
  font-size: 0.8125rem;
  font-weight: 650;
  color: var(--text);
  letter-spacing: -0.01em;
}

.install-wizard-note-lead {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--muted);
}

.install-wizard-url-chip {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  margin-top: 0.55rem;
  padding: 0.45rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

html[data-theme="dark"] .install-wizard-url-chip {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.install-wizard-url-chip svg {
  flex-shrink: 0;
  margin-top: 0.12rem;
  color: var(--muted);
}

.install-wizard-url-chip code {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 0.72rem;
  line-height: 1.45;
  word-break: break-all;
  color: var(--text);
}

.install-wizard-note-foot {
  margin: 0.55rem 0 0;
  font-size: 0.74rem;
  line-height: 1.5;
  color: var(--muted);
}

.install-wizard-note-foot a {
  font-weight: 600;
  text-decoration: none;
}

.install-wizard-note-foot a:hover {
  text-decoration: underline;
}

.install-wizard-note-list {
  margin: 0.65rem 0 0;
  padding-left: 1rem;
  font-size: 0.74rem;
  line-height: 1.55;
  color: var(--muted);
}

.install-wizard-note-list li + li {
  margin-top: 0.4rem;
}

.install-wizard-note-list code {
  font-size: 0.7rem;
}

/* 分段控件 + 命令面板 */
.install-wizard-picker {
  min-width: 0;
  padding: 1.1rem 1.35rem 1.25rem;
}

.install-segment-wrap {
  margin-bottom: 0.95rem;
}

.install-segment-label {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.install-segment-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  padding: 0.28rem;
  border-radius: var(--radius-md);
  background: var(--code-bg);
  border: 1px solid var(--border);
}

html[data-theme="dark"] .install-segment-rail {
  background: rgba(15, 23, 42, 0.45);
}

.install-segment-btn {
  flex: 1 1 auto;
  min-width: min(7rem, 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.32rem;
  margin: 0;
  padding: 0.48rem 0.6rem;
  border: 1px solid transparent;
  border-radius: calc(var(--radius-md) - 4px);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}

.install-segment-btn:hover:not(.is-active) {
  color: var(--text);
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.06);
}

html[data-theme="dark"] .install-segment-btn:hover:not(.is-active) {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
}

.install-segment-btn.is-active {
  color: #047857;
  background: var(--bg-elevated);
  border-color: rgba(5, 150, 105, 0.28);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(5, 150, 105, 0.06);
}

html[data-theme="dark"] .install-segment-btn.is-active {
  color: #5eead4;
  background: rgba(20, 27, 45, 0.95);
  border-color: rgba(45, 212, 191, 0.35);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.install-segment-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.install-segment-btn .install-segment-ico {
  flex-shrink: 0;
  opacity: 0.82;
}

.install-segment-btn.is-active .install-segment-ico {
  opacity: 1;
  color: inherit;
}

.install-segment-text {
  white-space: nowrap;
}

.install-segment-hint {
  margin-left: 0.1rem;
  padding: 0.08rem 0.35rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ok);
  background: rgba(5, 150, 105, 0.12);
  border: 1px solid rgba(5, 150, 105, 0.2);
}

html[data-theme="dark"] .install-segment-hint {
  color: #6ee7b7;
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.22);
}

.install-panel-stack {
  min-height: 7rem;
}

.install-panel {
  animation: install-panel-in 0.22s ease-out;
}

@keyframes install-panel-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.install-panel[hidden] {
  display: none !important;
}

.install-wizard-snippet-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.65rem;
  margin-bottom: 0.55rem;
}

.install-wizard-snippet-title {
  font-size: 0.875rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--text);
}

.install-wizard-snippet-desc {
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted);
}

.install-wizard-snippet-desc code {
  font-size: 0.72rem;
}

.install-wizard-terminal {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #0f172a;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .install-wizard-terminal {
  border-color: #334155;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.install-wizard-terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.35rem;
  padding: 0.35rem 0.55rem 0.35rem 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.install-wizard-terminal-dots {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  flex-shrink: 0;
}

.install-wizard-terminal-dots i {
  display: block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.install-wizard-terminal-dots i:nth-child(1) {
  background: #ff5f57;
}

.install-wizard-terminal-dots i:nth-child(2) {
  background: #febc2e;
}

.install-wizard-terminal-dots i:nth-child(3) {
  background: #28c840;
}

.install-wizard-terminal-label {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(226, 232, 240, 0.72);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.install-wizard-terminal-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.install-wizard-terminal-bar .admin-copy-ico,
.install-wizard-terminal-actions .admin-copy-ico {
  width: 2rem;
  height: 2rem;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(226, 232, 240, 0.78);
}

.install-wizard-terminal-bar .admin-copy-ico:hover:not(:disabled),
.install-wizard-terminal-actions .admin-copy-ico:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
  color: #f8fafc;
}

.install-wizard-terminal-bar .admin-copy-ico.is-copied,
.install-wizard-terminal-actions .admin-copy-ico.is-copied {
  color: #6ee7b7;
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(52, 211, 153, 0.14);
}

.install-wizard-terminal-bar .admin-copy-ico.is-error,
.install-wizard-terminal-actions .admin-copy-ico.is-error {
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(248, 113, 113, 0.12);
}

.install-wizard-terminal .install-wizard-ta {
  display: block;
  width: 100%;
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #e2e8f0;
  box-shadow: none;
  resize: vertical;
}

.install-wizard-terminal .install-wizard-ta:focus {
  outline: none;
  box-shadow: none;
}

.install-wizard-ta {
  font-size: 0.76rem;
  line-height: 1.5;
}

.install-wizard-ta-one {
  min-height: 3.25rem;
  max-height: 11rem;
  padding: 0.75rem 0.85rem;
  white-space: pre;
  overflow-x: auto;
  tab-size: 4;
  -webkit-overflow-scrolling: touch;
}

.install-wizard-ta--full {
  min-height: 220px;
  max-height: min(52vh, 460px);
  padding: 0.75rem 0.85rem;
}

@media (max-width: 900px) {
  .install-wizard-body {
    grid-template-columns: 1fr;
  }

  .install-wizard-note {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.35rem;
  }

  .install-wizard-header {
    flex-direction: column;
  }

  .install-wizard-steps {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem 0.85rem;
  }
}

@media (max-width: 520px) {
  .install-wizard-success,
  .install-wizard-header,
  .install-wizard-note,
  .install-wizard-picker {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .install-segment-btn {
    min-width: calc(50% - 0.2rem);
  }

  .install-wizard-ta--full {
    max-height: min(42vh, 360px);
  }
}

/* —— 后台统一页面组件（与安装向导同系） —— */
.admin-kicker {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

body.admin-body .admin-kicker {
  color: var(--admin-primary);
}

.admin-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 0 0 var(--card-gap);
  padding: 0.85rem 1.1rem;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.admin-banner-ico {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
}

.admin-banner-text {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  min-width: 0;
}

.admin-banner-text strong {
  font-size: 0.9rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--text);
}

.admin-banner-text span {
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--muted);
}

.admin-banner--success {
  background: linear-gradient(180deg, rgba(5, 150, 105, 0.07) 0%, rgba(5, 150, 105, 0.02) 100%);
  border-color: rgba(5, 150, 105, 0.22);
}

.admin-banner--success .admin-banner-ico {
  color: var(--ok);
  background: rgba(5, 150, 105, 0.12);
  border: 1px solid rgba(5, 150, 105, 0.22);
}

.admin-banner--error {
  background: linear-gradient(180deg, rgba(220, 38, 38, 0.07) 0%, rgba(220, 38, 38, 0.02) 100%);
  border-color: rgba(220, 38, 38, 0.2);
}

.admin-banner--error .admin-banner-ico {
  color: var(--danger);
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.22);
}

.admin-banner--warn {
  background: linear-gradient(180deg, rgba(217, 119, 6, 0.08) 0%, rgba(217, 119, 6, 0.02) 100%);
  border-color: rgba(217, 119, 6, 0.22);
}

.admin-banner--warn .admin-banner-ico {
  color: var(--warn);
  background: rgba(217, 119, 6, 0.12);
  border: 1px solid rgba(217, 119, 6, 0.22);
}

html[data-theme="dark"] .admin-banner--success {
  background: linear-gradient(180deg, rgba(52, 211, 153, 0.1) 0%, rgba(52, 211, 153, 0.02) 100%);
}

html[data-theme="dark"] .admin-banner--error {
  background: linear-gradient(180deg, rgba(248, 113, 113, 0.1) 0%, rgba(248, 113, 113, 0.02) 100%);
}

.admin-page-card {
  padding: 0;
  overflow: hidden;
}

.admin-page-card__head {
  padding: 1.1rem 1.35rem 1rem;
  border-bottom: 1px solid var(--border);
}

.admin-page-card__head h2,
.admin-page-card__head .admin-page-card__title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text);
}

.admin-page-card__head .hint,
.admin-page-card__head .admin-page-card__lead {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--muted);
}

.admin-page-card__body {
  padding: 1.15rem 1.35rem 1.35rem;
}

.admin-page-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.admin-meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.55rem 0.22rem 0.45rem;
  border-radius: 999px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text);
  background: var(--code-bg);
  border: 1px solid var(--border);
}

.admin-meta-badge--danger {
  color: var(--danger);
  background: rgba(220, 38, 38, 0.06);
  border-color: rgba(220, 38, 38, 0.2);
}

.admin-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.admin-form-actions button,
.admin-form-actions .btn {
  margin-top: 0;
}

.admin-snippet {
  margin-top: 0.85rem;
}

.admin-snippet-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.65rem;
  margin-bottom: 0.55rem;
}

.admin-snippet-title {
  font-size: 0.875rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--text);
}

.admin-snippet-desc {
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted);
}

.admin-terminal,
.install-wizard-terminal {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #0f172a;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .admin-terminal,
html[data-theme="dark"] .install-wizard-terminal {
  border-color: #334155;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.admin-terminal-bar,
.install-wizard-terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.35rem;
  padding: 0.35rem 0.55rem 0.35rem 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.admin-terminal-dots,
.install-wizard-terminal-dots {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  flex-shrink: 0;
}

.admin-terminal-dots i,
.install-wizard-terminal-dots i {
  display: block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.admin-terminal-dots i:nth-child(1),
.install-wizard-terminal-dots i:nth-child(1) { background: #ff5f57; }
.admin-terminal-dots i:nth-child(2),
.install-wizard-terminal-dots i:nth-child(2) { background: #febc2e; }
.admin-terminal-dots i:nth-child(3),
.install-wizard-terminal-dots i:nth-child(3) { background: #28c840; }

.admin-terminal-label,
.install-wizard-terminal-label {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(226, 232, 240, 0.72);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-terminal-actions,
.install-wizard-terminal-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.admin-terminal .admin-code-ta,
.admin-terminal .install-wizard-ta,
.install-wizard-terminal .admin-code-ta,
.install-wizard-terminal .install-wizard-ta {
  display: block;
  width: 100%;
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #e2e8f0;
  box-shadow: none;
  resize: vertical;
  font-size: 0.76rem;
  line-height: 1.5;
}

.admin-terminal .admin-code-ta:focus,
.admin-terminal .install-wizard-ta:focus,
.install-wizard-terminal .admin-code-ta:focus,
.install-wizard-terminal .install-wizard-ta:focus {
  outline: none;
  box-shadow: none;
}

.admin-code-ta {
  min-height: 3.25rem;
  max-height: 11rem;
  padding: 0.75rem 0.85rem;
  white-space: pre;
  overflow-x: auto;
  tab-size: 4;
  -webkit-overflow-scrolling: touch;
}

.admin-code-ta--tall {
  min-height: 220px;
  max-height: min(52vh, 460px);
}

.admin-terminal-bar .admin-copy-ico,
.admin-terminal-actions .admin-copy-ico,
.install-wizard-terminal-bar .admin-copy-ico,
.install-wizard-terminal-actions .admin-copy-ico {
  width: 2rem;
  height: 2rem;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(226, 232, 240, 0.78);
}

.admin-empty-state {
  margin: 0;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--code-bg) 40%, var(--bg-elevated));
}

body.admin-body .admin-page-card .admin-list-head {
  margin-bottom: 0;
  padding: 0;
}

body.admin-body .admin-page-card .admin-list-head h2 {
  font-size: 1.05rem;
  font-weight: 650;
}

body.admin-body .admin-page-card .table-wrap {
  margin-top: 0.85rem;
}

body.admin-body .settings-page .admin-banner {
  margin-bottom: 1rem;
}

body.admin-body .settings-card.settings-card--single {
  padding: 0;
  overflow: hidden;
}

body.admin-body .settings-card.settings-card--single .settings-panel {
  padding: 1.15rem 1.35rem 1.35rem;
}

body.admin-body .settings-card.settings-card--single .settings-panel > .settings-card__head {
  margin: -1.15rem -1.35rem 1rem;
  padding: 1.1rem 1.35rem 1rem;
  border-bottom: 1px solid var(--admin-border, var(--border));
}

body.admin-body .settings-divider {
  margin: 1.35rem 0;
  border: none;
  border-top: 1px solid var(--admin-border, var(--border));
}

body.admin-body .settings-subtitle {
  margin: 0 0 0.45rem;
  font-size: 0.9375rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

body.admin-body .settings-form__actions,
body.admin-body .settings-retention-actions {
  margin-top: 0.5rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--admin-border, var(--border));
}

body.admin-body .settings-retention-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

body.admin-body .admin-form-grid input[type="text"],
body.admin-body .admin-form-grid input[type="password"],
body.admin-body .admin-form-grid input[type="email"],
body.admin-body .admin-form-grid input[type="number"],
body.admin-body .admin-form-grid input[type="url"] {
  border-radius: 10px;
  padding: 0.65rem 0.9rem;
  border-color: var(--admin-border, var(--border));
  transition: border-color 0.15s, box-shadow 0.15s;
}

body.admin-body .admin-form-grid input:focus {
  border-color: var(--admin-primary, var(--accent));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--admin-primary, var(--accent)) 18%, transparent);
}

body.admin-body .dash-panel {
  padding: 0;
  overflow: hidden;
}

body.admin-body .dash-panel-head {
  margin-bottom: 0;
  padding: 1rem 1.15rem 0.85rem;
  border-bottom: 1px solid var(--admin-border, var(--border));
}

body.admin-body .dash-panel-head h2 {
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

body.admin-body .dash-metric-list,
body.admin-body .dash-action-grid,
body.admin-body .dash-chart-wrap,
body.admin-body .dash-panel > .hint {
  padding: 1rem 1.15rem 1.15rem;
}

body.admin-body .dash-chart-panel .dash-panel-head + .hint {
  padding-top: 1rem;
  padding-bottom: 0;
}

body.admin-body .dash-kpi {
  border-radius: 14px;
}

body.admin-body .dash-kpi::after {
  height: 3px;
  opacity: 0.85;
}

body.admin-body .dash-action {
  border-radius: 12px;
  padding: 0.72rem 0.85rem;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

body.admin-body .dash-action:hover {
  transform: translateY(-1px);
}

body.admin-body .admin-banner {
  border-color: var(--admin-border, var(--border));
}

body.admin-body .admin-page-card,
body.admin-body .install-wizard--added {
  border-radius: 14px;
}

@media (max-width: 640px) {
  .admin-hero {
    flex-direction: column;
    align-items: stretch;
  }

  th,
  td {
    padding: 0.5rem 0.45rem;
  }
}

@media (max-width: 980px) {
  .dash-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dash-main-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .dash-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .dash-kpi-grid {
    grid-template-columns: 1fr;
  }
}

/* —— 后台视觉：设计令牌与侧栏主题 —— */
body.admin-body {
  --admin-shell-max: 1200px;
  --admin-sidebar-width: 268px;
  --admin-primary: #2563eb;
  --admin-primary-strong: #1d4ed8;
  --admin-accent: #3b82f6;
  --admin-accent-soft: #60a5fa;
  --admin-bg: #f1f5f9;
  --admin-panel: #ffffff;
  --admin-border: #e2e8f0;
  --admin-muted: #64748b;
  --admin-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 36px rgba(15, 23, 42, 0.07);
  --admin-sidebar-bg: #ffffff;
  --admin-sidebar-border: #e8edf3;
  --admin-sidebar-fg: #475569;
  --admin-sidebar-fg-strong: #0f172a;
  --admin-sidebar-heading: #0f172a;
  --admin-sidebar-muted: #94a3b8;
  --admin-sidebar-hover: rgba(37, 99, 235, 0.08);
  --admin-sidebar-active-bg: rgba(37, 99, 235, 0.12);
  --admin-sidebar-active-fg: #1d4ed8;
  --admin-sidebar-active-border: rgba(37, 99, 235, 0.22);
  background: var(--admin-bg);
}

html[data-theme="dark"] body.admin-body {
  --admin-bg: #0b1220;
  --admin-panel: #111b2e;
  --admin-border: rgba(148, 163, 184, 0.14);
  --admin-muted: #94a3b8;
  --admin-shadow: 0 1px 0 rgba(0, 0, 0, 0.4), 0 18px 48px rgba(0, 0, 0, 0.35);
  --admin-sidebar-bg: #0f172a;
  --admin-sidebar-border: rgba(148, 163, 184, 0.12);
  --admin-sidebar-fg: #cbd5e1;
  --admin-sidebar-fg-strong: #f8fafc;
  --admin-sidebar-heading: #f1f5f9;
  --admin-sidebar-muted: #64748b;
  --admin-sidebar-hover: rgba(96, 165, 250, 0.12);
  --admin-sidebar-active-bg: rgba(59, 130, 246, 0.2);
  --admin-sidebar-active-fg: #e2e8f0;
  --admin-sidebar-active-border: rgba(96, 165, 250, 0.35);
}

body.admin-body .layout {
  width: 100%;
  max-width: var(--admin-shell-max);
  margin: 0 auto;
  padding: 1.35rem clamp(0.75rem, 3.5vw, 2rem) 2.75rem;
  box-sizing: border-box;
}

body.admin-body .layout.dashboard-page {
  max-width: min(1320px, 100%);
  padding-left: clamp(0.85rem, 4.5vw, 2.5rem);
  padding-right: clamp(0.85rem, 4.5vw, 2.5rem);
}

html[data-theme="dark"] .admin-main-topbar {
  background: var(--admin-panel);
  border-bottom-color: var(--admin-border);
}

html[data-theme="dark"] .admin-main-topbar-title {
  color: #f1f5f9;
}

html[data-theme="dark"] .admin-sidebar-burger {
  background: rgba(30, 41, 59, 0.65);
  border-color: var(--admin-border);
}

html[data-theme="dark"] .admin-sidebar-burger-line {
  background: #e2e8f0;
}

body.admin-body .admin-page-intro,
body.admin-body .admin-hero,
body.admin-body .dash-kpi,
body.admin-body .dash-panel,
body.admin-body .card {
  border-color: var(--admin-border);
  border-radius: 14px;
  background: var(--admin-panel);
  box-shadow: var(--admin-shadow);
}

body.admin-body .admin-hero {
  background: var(--admin-panel);
  margin-bottom: var(--card-gap);
}

body.admin-body .admin-hero::before {
  background: linear-gradient(90deg, #34d399, var(--admin-primary), #60a5fa);
}

body.admin-body .dash-kpi::after,
body.admin-body .card::before {
  background: linear-gradient(90deg, #60a5fa, var(--admin-primary));
}

body.admin-body .admin-stat-pill {
  background: #f8fafc;
  border-color: var(--admin-border);
}

body.admin-body .dash-bar {
  background: #e8edf5;
}

body.admin-body .dash-bar i {
  background: linear-gradient(90deg, #60a5fa, var(--admin-primary));
}

body.admin-body .dash-action {
  border-color: var(--admin-border);
  background: #fbfdff;
}

body.admin-body .dash-action:hover {
  background: #eef4ff;
}

body.admin-body button,
body.admin-body .btn {
  padding: 0.38rem 0.9rem;
  font-size: 0.8125rem;
  line-height: 1.35;
  font-weight: 600;
  border-radius: 8px;
  margin-top: 0.5rem;
  background: var(--admin-primary);
  color: #fff;
  border: 1px solid transparent;
  box-shadow: none;
}

body.admin-body button:hover,
body.admin-body .btn:hover {
  background: var(--admin-primary-strong);
  border-color: transparent;
}

body.admin-body button.secondary,
body.admin-body .btn.secondary {
  color: #334155;
  background: #fff;
  border: 1px solid var(--admin-border);
  font-weight: 600;
}

body.admin-body button.secondary:hover,
body.admin-body .btn.secondary:hover {
  color: #0f172a;
  background: #f8fafc;
  border-color: #cbd5e1;
}

html[data-theme="dark"] body.admin-body button.secondary,
html[data-theme="dark"] body.admin-body .btn.secondary {
  color: #e2e8f0;
  background: rgba(30, 41, 59, 0.45);
  border-color: var(--admin-border);
}

html[data-theme="dark"] body.admin-body button.secondary:hover,
html[data-theme="dark"] body.admin-body .btn.secondary:hover {
  color: #f8fafc;
  background: rgba(51, 65, 85, 0.55);
  border-color: rgba(148, 163, 184, 0.28);
}

/* 安装向导：避免被全局 button 渐变覆盖 */
body.admin-body .install-segment-rail .install-segment-btn {
  background: transparent;
  color: #64748b;
  border: 1px solid transparent;
  box-shadow: none;
}

body.admin-body .install-segment-rail .install-segment-btn:hover:not(.is-active) {
  background: rgba(15, 23, 42, 0.05);
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.06);
}

body.admin-body .install-segment-rail .install-segment-btn.is-active {
  background: #fff;
  color: #047857;
  border-color: rgba(5, 150, 105, 0.28);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(5, 150, 105, 0.06);
}

html[data-theme="dark"] body.admin-body .install-segment-rail .install-segment-btn {
  color: #94a3b8;
}

html[data-theme="dark"] body.admin-body .install-segment-rail .install-segment-btn:hover:not(.is-active) {
  background: rgba(255, 255, 255, 0.06);
  color: #f1f5f9;
  border-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] body.admin-body .install-segment-rail .install-segment-btn.is-active {
  background: rgba(20, 27, 45, 0.95);
  color: #5eead4;
  border-color: rgba(45, 212, 191, 0.35);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

body.admin-body .install-wizard--added::before {
  background: linear-gradient(90deg, #34d399, var(--admin-primary), #60a5fa);
}

body.admin-body .install-wizard-note {
  background: #f8fafc;
}

html[data-theme="dark"] body.admin-body .install-wizard-note {
  background: rgba(15, 23, 42, 0.35);
}

body.admin-body .install-wizard-terminal-bar .admin-copy-ico,
body.admin-body .install-wizard-terminal-actions .admin-copy-ico {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(226, 232, 240, 0.78);
}

body.admin-body .install-wizard-terminal-bar .admin-copy-ico:hover:not(:disabled),
body.admin-body .install-wizard-terminal-actions .admin-copy-ico:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
  color: #f8fafc;
}

body.admin-body .table-wrap {
  background: #f7f9fd;
  border-color: var(--admin-border);
  border-radius: 12px;
  overflow: hidden;
}

html[data-theme="dark"] body.admin-body .table-wrap {
  background: rgba(15, 23, 42, 0.45);
}

body.admin-body thead th {
  background: #f1f5fb;
  color: #64748b;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 650;
}

html[data-theme="dark"] body.admin-body thead th {
  background: rgba(30, 41, 59, 0.65);
  color: #94a3b8;
}

body.admin-body tbody tr.server-meta-row td {
  background: #f8fbff;
}

body.admin-body .theme-toggle {
  background: #f8fafc;
  border-color: var(--admin-border);
  color: #64748b;
}

body.admin-body .theme-toggle:hover {
  color: #0f172a;
  background: #edf2fb;
  border-color: #cdd8ea;
}

body.admin-body .theme-toggle {
  width: 1.85rem;
  height: 1.85rem;
  min-width: 1.85rem;
  min-height: 1.85rem;
}

html[data-theme="dark"] body.admin-body .theme-toggle {
  background: rgba(30, 41, 59, 0.55);
  border-color: var(--admin-border);
  color: #94a3b8;
}

html[data-theme="dark"] body.admin-body .theme-toggle:hover {
  color: #f1f5f9;
  background: rgba(51, 65, 85, 0.75);
  border-color: rgba(148, 163, 184, 0.25);
}

/* —— 后台 · 设置页 —— */
body.admin-body .settings-page {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding-bottom: 2rem;
}

body.admin-body .settings-page-head {
  padding: 0.2rem 0 0.35rem;
}

body.admin-body .settings-page-head__title {
  margin: 0;
  font-size: clamp(1.25rem, 1.15rem + 0.55vw, 1.7rem);
  font-weight: 760;
  letter-spacing: -0.03em;
}

body.admin-body .settings-page-head__lead {
  margin: 0.45rem 0 0;
  max-width: 760px;
  color: var(--muted);
  font-size: 0.92rem;
}

body.admin-body .settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

body.admin-body .settings-card--single {
  padding-top: 0.7rem;
}

body.admin-body .settings-tabs {
  display: flex;
  gap: 0.55rem;
  overflow-x: auto;
  padding: 0 0 0.65rem;
  margin-bottom: 0.55rem;
}

body.admin-body .settings-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border: 1px solid var(--admin-border, var(--border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-elevated) 88%, var(--code-bg));
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.48rem 0.78rem;
  cursor: pointer;
}

body.admin-body .settings-tab:hover {
  border-color: color-mix(in srgb, var(--primary) 40%, var(--admin-border, var(--border)));
  color: var(--primary);
}

body.admin-body .settings-tab.is-active {
  border-color: color-mix(in srgb, var(--primary) 52%, var(--admin-border, var(--border)));
  background: color-mix(in srgb, var(--primary) 10%, var(--bg-elevated));
  color: var(--primary);
}

body.admin-body .settings-panel {
  display: none;
}

body.admin-body .settings-panel.is-active {
  display: block;
}

body.admin-body .settings-card--single .settings-panel > .settings-card__head {
  margin-top: 0.2rem;
}

body.admin-body .settings-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

body.admin-body .settings-sidenav {
  display: flex;
  gap: 0.55rem;
  overflow-x: auto;
  padding: 0.2rem 0 0.1rem;
  scrollbar-width: thin;
}

body.admin-body .settings-sidenav__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  text-decoration: none;
  border: 1px solid var(--admin-border, var(--border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-elevated) 88%, var(--code-bg));
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.48rem 0.78rem;
}

body.admin-body .settings-sidenav__item:hover {
  border-color: color-mix(in srgb, var(--primary) 40%, var(--admin-border, var(--border)));
  color: var(--primary);
}

body.admin-body .settings-sidenav__item.is-active {
  border-color: color-mix(in srgb, var(--primary) 52%, var(--admin-border, var(--border)));
  background: color-mix(in srgb, var(--primary) 10%, var(--bg-elevated));
  color: var(--primary);
}

body.admin-body .settings-content {
  min-width: 0;
}

@media (min-width: 1080px) {
  body.admin-body .settings-shell {
    grid-template-columns: 228px minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
  }
  body.admin-body .settings-sidenav {
    position: sticky;
    top: 86px;
    flex-direction: column;
    overflow: visible;
    background: var(--admin-panel, var(--bg-elevated));
    border: 1px solid var(--admin-border, var(--border));
    border-radius: 16px;
    box-shadow: var(--admin-shadow, var(--shadow-card));
    padding: 0.7rem;
  }
  body.admin-body .settings-sidenav__item {
    justify-content: flex-start;
    border-radius: 10px;
    padding: 0.58rem 0.72rem;
    background: transparent;
  }
  body.admin-body .settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
  body.admin-body .settings-grid .settings-card:nth-child(2),
  body.admin-body .settings-grid .settings-card:nth-child(3) {
    height: 100%;
  }
}

@media (min-width: 1080px) {
  body.admin-body .settings-tabs {
    overflow: visible;
    flex-wrap: wrap;
  }
}

body.admin-body .flash-msg {
  margin: 0;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid transparent;
}

body.admin-body .flash-msg--success {
  background: rgba(5, 150, 105, 0.1);
  border-color: rgba(5, 150, 105, 0.25);
  color: #047857;
}

body.admin-body .flash-msg--error {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.2);
  color: #b91c1c;
}

body.admin-body .settings-card {
  scroll-margin-top: 92px;
  background: var(--admin-panel, var(--bg-elevated));
  border: 1px solid var(--admin-border, var(--border));
  border-radius: 18px;
  padding: 1.25rem 1.35rem 1.35rem;
  box-shadow: var(--admin-shadow, var(--shadow-card));
}

body.admin-body .settings-card--password {
  margin-top: 0.25rem;
}

body.admin-body .settings-card__head {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--admin-border, var(--border));
}

body.admin-body .settings-card__title {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 720;
  letter-spacing: -0.02em;
  color: var(--text);
}

body.admin-body .settings-card__lead {
  margin: 0.45rem 0 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--muted);
}

body.admin-body .settings-form .form-row label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #334155;
}

body.admin-body .settings-form input[type="text"],
body.admin-body .settings-form input[type="email"],
body.admin-body .settings-form input[type="password"],
body.admin-body .settings-form input[type="url"],
body.admin-body .settings-form input[type="number"] {
  border-radius: 10px;
  padding: 0.65rem 0.9rem;
}

body.admin-body #admin_email {
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--admin-border, var(--border)));
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg-elevated) 90%, #ffffff) 0%, color-mix(in srgb, var(--code-bg) 18%, var(--bg-elevated)) 100%);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 8%, transparent);
}

body.admin-body #admin_email:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--primary) 60%, var(--admin-border, var(--border)));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent);
}

body.admin-body .input-readonly {
  background: #f1f5f9;
  color: var(--muted);
  cursor: not-allowed;
}

body.admin-body .settings-form__actions {
  margin-top: 0.35rem;
  padding-top: 0.5rem;
}

body.admin-body .settings-retention-actions {
  margin-top: 0.1rem;
  padding-top: 0.1rem;
}

body.admin-body .settings-btn-primary {
  width: 100%;
  max-width: 240px;
  border-radius: 8px;
  padding: 0.4rem 1rem;
  font-weight: 600;
  font-size: 0.8125rem;
}

@media (min-width: 640px) {
  body.admin-body .settings-btn-primary {
    width: auto;
  }
}

body.admin-body .settings-divider {
  border: none;
  border-top: 1px solid var(--admin-border, var(--border));
  margin: 1.25rem 0 1rem;
}

body.admin-body .settings-subtitle {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 650;
  color: var(--text);
}

body.admin-body .settings-nginx-block,
body.admin-body .settings-retention-stack {
  margin-top: 0.65rem;
  padding: 0.85rem 1rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--admin-border);
  background: color-mix(in srgb, var(--admin-panel) 92%, var(--code-bg));
}

html[data-theme="dark"] body.admin-body .settings-nginx-block,
html[data-theme="dark"] body.admin-body .settings-retention-stack {
  background: rgba(15, 23, 42, 0.35);
}

body.admin-body .settings-nginx-block .section-label,
body.admin-body .settings-retention-stack .section-label {
  margin-bottom: 0.45rem;
}

body.admin-body .settings-retention-snippet + .settings-retention-snippet {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--admin-border);
}

body.admin-body .settings-retention-snippet .hint.field-note {
  margin-top: 0;
  margin-bottom: 0.55rem;
}

body.admin-body textarea.code.settings-nginx-code {
  min-height: 0;
  max-height: 14rem;
  margin-top: 0;
  padding: 0.7rem 0.85rem;
  font-size: 0.78rem;
  line-height: 1.55;
  border-radius: 10px;
  border: 1px solid var(--admin-border);
  background: var(--code-bg);
  tab-size: 2;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

html[data-theme="dark"] body.admin-body textarea.code.settings-nginx-code {
  background: rgba(15, 23, 42, 0.55);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

body.admin-body .settings-nginx-block .settings-copy-actions,
body.admin-body .settings-retention-stack .settings-copy-actions {
  margin-top: 0.55rem;
  margin-bottom: 0;
}

body.admin-body textarea.code.settings-nginx-code.settings-code--short {
  min-height: 0;
  max-height: 10rem;
}

body.admin-body textarea.code.settings-nginx-code.settings-code--tall {
  min-height: 11rem;
  max-height: min(48vh, 400px);
}

body.admin-body .settings-card__lead--tight {
  margin-top: 0;
  margin-bottom: 0.85rem;
}

body.admin-body .settings-copy-actions {
  margin-top: 0.45rem;
  margin-bottom: 0.2rem;
}

body.admin-body .settings-copy-actions .settings-copy-btn {
  min-width: 130px;
}

body.admin-body .settings-email-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.6rem;
}

body.admin-body .settings-email-row input[type="email"] {
  flex: 1 1 200px;
  min-width: 0;
  margin-top: 0;
}

body.admin-body .settings-btn-email {
  flex: 0 0 auto;
  margin-top: 0;
  align-self: stretch;
}

