/* ============================================================================
   后台样式：与官网、客户端同一套设计令牌
   ========================================================================== */

.admin-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.admin-body main {
  flex: 1;
}

.admin {
  width: min(940px, calc(100% - 44px));
  margin: 0 auto;
  padding: 40px 0 60px;
}

/* ── 登录 / 无权限卡片 ────────────────────────────────────────────────── */

.admin__card {
  width: min(460px, 100%);
  margin: 40px auto 0;
  padding: 34px 34px 30px;
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.admin__card--narrow h1 {
  margin: 14px 0 6px;
  font-size: 22px;
  font-weight: 700;
}

.admin__logo {
  width: 54px;
  height: 54px;
  margin: 0 auto;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  background: var(--tint-brand);
  color: var(--brand);
}
.admin__logo--warn {
  background: var(--warn-tint);
  color: var(--warn);
}
.admin__logo .icon {
  width: 26px;
  height: 26px;
}

.admin__lead {
  margin: 0 0 16px;
  font-size: 13.5px;
  color: var(--text-dim);
  line-height: 1.75;
}
.admin__lead b {
  color: var(--text);
}

.admin__card-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 6px;
}

/* ── 表单构件 ─────────────────────────────────────────────────────────── */

.admin__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.admin__field--full {
  grid-column: 1 / -1;
}

.admin__label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
}
.admin__label b {
  color: var(--brand-600);
  font-weight: 600;
}
[data-theme="dark"] .admin__label b {
  color: var(--brand);
}

.admin__input {
  width: 100%;
  padding: 10px 13px;
  border: 0;
  border-radius: var(--radius);
  background: var(--sunken);
  box-shadow: var(--shadow-inset);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
}
.admin__input::placeholder {
  color: var(--text-mute);
}
.admin__input:focus {
  outline: none;
  box-shadow: var(--shadow-inset), 0 0 0 2px var(--brand);
}

.admin__textarea {
  resize: vertical;
  line-height: 1.7;
  font-family: inherit;
}

.admin__hint {
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-mute);
}

/* ── 开关 ─────────────────────────────────────────────────────────────── */

.admin__switch {
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  font-size: 13.5px;
  margin-top: 4px;
}
.admin__switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.admin__switch-track {
  flex: none;
  width: 44px;
  height: 26px;
  border-radius: var(--radius-pill);
  background: var(--sunken);
  box-shadow: var(--shadow-inset);
  padding: 3px;
  transition: background var(--dur) var(--ease-in-out);
}
.admin__switch-thumb {
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: transform var(--dur) var(--ease-spring);
}
.admin__switch input:checked + .admin__switch-track {
  background: var(--brand);
  box-shadow: none;
}
.admin__switch input:checked + .admin__switch-track .admin__switch-thumb {
  transform: translateX(18px);
}
.admin__switch input:focus-visible + .admin__switch-track {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ── 页面头 ───────────────────────────────────────────────────────────── */

.admin__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.admin__head h1 {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 700;
}
.admin__head .admin__lead {
  margin: 0;
}
.admin__head-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.admin__since {
  color: var(--text-mute);
}

.admin__form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.admin__group {
  padding: 22px 24px 24px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.admin__group h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 9px;
}
.admin__group h2 .icon {
  width: 18px;
  height: 18px;
  color: var(--brand);
}
.admin__group-lead {
  margin: -8px 0 0;
  font-size: 12.5px;
  color: var(--text-mute);
}

.admin__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

/* ── 状态条 ───────────────────────────────────────────────────────────── */

.admin__status-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.admin__alert,
.admin__status {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.7;
}
.admin__alert .icon,
.admin__status .icon {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 2px;
}
.admin__alert {
  margin-bottom: 18px;
}
.admin__alert--ok {
  background: var(--ok-tint);
}
.admin__alert--ok .icon {
  color: var(--ok);
}
.admin__alert--err {
  background: var(--danger-tint);
}
.admin__alert--err .icon {
  color: var(--danger);
}

.admin__status {
  background: var(--surface-2);
  box-shadow: var(--shadow-xs);
}
.admin__status.is-ok {
  background: var(--ok-tint);
}
.admin__status.is-ok .icon {
  color: var(--ok);
}
.admin__status.is-warn {
  background: var(--warn-tint);
}
.admin__status.is-warn .icon {
  color: var(--warn);
}

/* ── 底部操作条 ───────────────────────────────────────────────────────── */

.admin__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 4px;
}
.admin__stamp {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-mute);
}

/* ── 保存中 ───────────────────────────────────────────────────────────── */

.admin__form[data-saving="true"] {
  opacity: 0.7;
  pointer-events: none;
}

.admin__submit {
  width: 100%;
  margin-top: 8px;
}
