/* ==========================================================================
   众好物业 · 企业能力平台
   权限管理（管理员控制台）
   所有选择器均以 .admin- 前缀限定，避免影响共享样式。
   ========================================================================== */

/* --------------------------------------------------------------------------
   页面骨架
   -------------------------------------------------------------------------- */

.admin-page {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.admin-head-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.admin-head-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 1px solid var(--gold-200);
  border-radius: 999px;
  background: var(--gold-050);
  color: var(--gold-600);
  font-size: 9.5px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.admin-head-chip .icon {
  width: 12px;
  height: 12px;
}

.admin-skeleton {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-skeleton-stat {
  height: 78px;
  border-radius: var(--radius-md);
}

.admin-panel-skeleton {
  padding: 2px 0;
}

.admin-panel-error {
  padding: 8px 0;
}

/* --------------------------------------------------------------------------
   概览区
   -------------------------------------------------------------------------- */

.admin-overview {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.admin-stat {
  align-items: center;
  gap: 11px;
  padding: 14px;
  border-left: 2px solid var(--gold-200);
  transition:
    border-color var(--speed),
    box-shadow var(--speed),
    transform var(--speed);
}

.admin-stat:hover {
  border-left-color: var(--gold-500);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.admin-stat .mini-stat-copy {
  gap: 2px;
}

.admin-stat .mini-stat-copy strong {
  font-size: 22px;
  line-height: 1.15;
}

.admin-stat .mini-stat-copy span {
  color: var(--text-secondary);
  font-size: 9.5px;
}

.admin-stat .mini-stat-copy small {
  color: var(--text-faint);
  font-size: 8.5px;
  line-height: 1.5;
}

.admin-recent {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 11px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: var(--shadow-xs);
}

.admin-recent-head {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

.admin-recent-head .icon {
  width: 12px;
  height: 12px;
  color: var(--gold-600);
}

.admin-recent-head .link-btn {
  margin-left: auto;
  text-transform: none;
  letter-spacing: 0;
}

.admin-recent-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
}

.admin-recent-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 4px 18px 4px 0;
}

.admin-recent-row + .admin-recent-row {
  padding-left: 18px;
  border-left: 1px dashed var(--line-soft);
}

.admin-recent-mark {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  margin-top: 1px;
  border-radius: 6px;
  background: var(--gold-050);
  color: var(--gold-600);
}

.admin-recent-mark .icon {
  width: 11px;
  height: 11px;
}

.admin-recent-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.admin-recent-copy strong {
  overflow: hidden;
  color: var(--text);
  font-size: 10.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-recent-copy small {
  overflow: hidden;
  color: var(--text-faint);
  font-size: 8.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-recent-empty {
  padding: 12px 0;
  color: var(--text-faint);
  font-size: 9.5px;
}

/* --------------------------------------------------------------------------
   Tab
   -------------------------------------------------------------------------- */

.admin-tabs-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.admin-tabs {
  display: flex;
  align-items: center;
  gap: 26px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

.admin-tabs::-webkit-scrollbar {
  display: none;
}

.admin-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: -1px;
  padding: 0 1px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.3px;
  white-space: nowrap;
  transition:
    color var(--speed),
    border-color var(--speed);
}

.admin-tab .icon {
  width: 15px;
  height: 15px;
}

.admin-tab:hover {
  color: var(--ink-900);
}

.admin-tab.is-active {
  border-bottom-color: var(--gold-500);
  color: var(--ink-900);
  font-weight: 600;
}

.admin-tab.is-active .icon {
  color: var(--gold-600);
}

.admin-tab-count {
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  height: 16px;
  padding: 0 5px;
  border-radius: 999px;
  background: #eef2f4;
  color: var(--text-muted);
  font-family: var(--font-number);
  font-size: 8.5px;
  font-style: normal;
  line-height: 1;
}

.admin-tab.is-active .admin-tab-count {
  background: var(--gold-100);
  color: var(--gold-600);
}

.admin-panel {
  min-width: 0;
  min-height: 240px;
}

/* --------------------------------------------------------------------------
   说明条 / 工具栏
   -------------------------------------------------------------------------- */

.admin-note-band {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  padding: 13px 16px;
  border: 1px solid var(--gold-200);
  border-left: 3px solid var(--gold-500);
  border-radius: 10px;
  background: linear-gradient(100deg, var(--gold-050), #fff 68%);
}

.admin-note-band > .icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--gold-600);
}

.admin-note-band > div {
  flex: 1;
  min-width: 0;
}

.admin-note-band strong {
  display: block;
  color: var(--ink-900);
  font-size: 11.5px;
  font-weight: 600;
}

.admin-note-band p {
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 10px;
  line-height: 1.7;
}

.admin-note-band .btn {
  flex: 0 0 auto;
  align-self: center;
}

.admin-toolbar {
  row-gap: 10px;
}

.admin-toolbar .toolbar-left {
  flex: 1 1 auto;
}

.admin-toolbar .toolbar-right {
  flex: 0 0 auto;
}

.admin-search {
  flex: 1 1 260px;
  min-width: 0;
  max-width: 380px;
}

.admin-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.admin-filter-label {
  color: var(--text-muted);
  font-size: 9.5px;
  white-space: nowrap;
}

.admin-select {
  width: auto;
  min-width: 104px;
  height: 34px;
  font-size: 11px;
}

.admin-select-wide {
  min-width: 156px;
}

.admin-result-count {
  color: var(--text-muted);
  font-family: var(--font-number);
  font-size: 9.5px;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   表格通用
   -------------------------------------------------------------------------- */

.admin-table-note {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-faint);
  font-size: 9px;
  line-height: 1.6;
}

.admin-table-note .icon {
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
}

.admin-col-actions {
  text-align: right;
}

.admin-accounts-table {
  min-width: 1000px;
}

.admin-invites-table {
  min-width: 960px;
}

.admin-audit-table {
  min-width: 920px;
}

.admin-accounts-table tbody tr.is-disabled-row {
  background: #fbfbfb;
}

.admin-accounts-table tbody tr.is-disabled-row .admin-user-name,
.admin-accounts-table tbody tr.is-disabled-row .admin-user-id {
  color: var(--text-muted);
}

.admin-table-empty {
  padding: 10px 6px;
}

/* 用户单元格 */

.admin-user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 196px;
}

.admin-user-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.admin-user-name {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.admin-self-tag {
  padding: 1px 6px;
  border: 1px solid var(--gold-300);
  border-radius: 999px;
  background: var(--gold-050);
  color: var(--gold-600);
  font-size: 8.5px;
  font-style: normal;
  font-weight: 500;
  white-space: nowrap;
}

.admin-user-id {
  color: var(--text-muted);
  font-size: 9.5px;
  letter-spacing: 0.1px;
}

.admin-user-meta {
  overflow: hidden;
  color: var(--text-faint);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-perm-cell {
  display: block;
  max-width: 210px;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 10px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-time-cell {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 96px;
}

.admin-time-cell strong {
  color: var(--text-secondary);
  font-family: var(--font-number);
  font-size: 10.5px;
  font-weight: 500;
  white-space: nowrap;
}

.admin-time-cell small {
  color: var(--text-faint);
  font-size: 8.5px;
  white-space: nowrap;
}

/* 验证码 */

.admin-code {
  display: flex;
  align-items: center;
  gap: 4px;
}

.admin-code-value {
  display: inline-block;
  padding: 3px 8px;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  background: #fbfcfc;
  color: var(--ink-800);
  font-size: 11px;
  letter-spacing: 0.9px;
  white-space: nowrap;
}

.admin-code .icon-btn {
  width: 24px;
  height: 24px;
}

.admin-code .icon-btn .icon {
  width: 13px;
  height: 13px;
}

.admin-code-hint {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  max-width: 168px;
  color: var(--text-faint);
  font-size: 8.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-invite-role {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.admin-usage {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 92px;
}

.admin-usage-num {
  color: var(--text-muted);
  font-family: var(--font-number);
  font-size: 10px;
  white-space: nowrap;
}

.admin-usage-num strong {
  color: var(--ink-900);
  font-size: 12px;
}

.admin-usage-track {
  display: block;
  width: 100%;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line-soft);
}

.admin-usage-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold-400), var(--gold-600));
  transition: width var(--speed-slow) var(--ease);
}

.admin-usage-track i.is-full {
  background: var(--line-strong);
}

.admin-usage small {
  color: var(--text-faint);
  font-size: 8.5px;
  white-space: nowrap;
}

.admin-invite-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.admin-invite-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
}

.admin-invite-stat span {
  color: var(--text-muted);
  font-size: 9.5px;
}

.admin-invite-stat strong {
  color: var(--ink-900);
  font-family: var(--font-number);
  font-size: 16px;
  font-weight: 500;
}

.admin-invite-stat.is-gold strong {
  color: var(--gold-600);
}

/* 日志 */

.admin-actor {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.admin-actor .avatar {
  width: 24px;
  height: 24px;
  font-size: 10px;
}

.admin-actor strong {
  color: var(--text-secondary);
  font-size: 10.5px;
  font-weight: 500;
}

.admin-action-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.admin-action-cell code {
  color: var(--text-faint);
  font-size: 8.5px;
  letter-spacing: 0.1px;
}

.admin-object-cell {
  display: block;
  max-width: 190px;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-detail-cell {
  display: -webkit-box;
  overflow: hidden;
  max-width: 320px;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.admin-ip {
  color: var(--text-muted);
  font-size: 9.5px;
  white-space: nowrap;
}

.admin-pager {
  display: block;
}

/* --------------------------------------------------------------------------
   弹窗表单
   -------------------------------------------------------------------------- */

.admin-modal .modal-body {
  padding: 20px 22px;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.admin-form-alert {
  padding: 9px 12px;
  border: 1px solid var(--danger-line);
  border-radius: 8px;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 10.5px;
  line-height: 1.6;
}

.admin-form-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}

.admin-form-section:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.admin-form-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.admin-form-section-head h3 {
  color: var(--ink-900);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.admin-form-section-head p {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 9.5px;
  line-height: 1.6;
}

.admin-form-lock {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  padding: 3px 9px;
  border: 1px solid var(--gold-200);
  border-radius: 999px;
  background: var(--gold-050);
  color: var(--gold-600);
  font-size: 9px;
  white-space: nowrap;
}

.admin-form-lock .icon {
  width: 11px;
  height: 11px;
}

.admin-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfc;
}

.admin-identity-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.admin-identity-copy strong {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: var(--ink-900);
  font-size: 12px;
  font-weight: 600;
}

.admin-identity-copy strong .mono {
  color: var(--text-muted);
  font-size: 9.5px;
  font-weight: 400;
}

.admin-identity-copy small {
  overflow: hidden;
  color: var(--text-faint);
  font-size: 9px;
  line-height: 1.6;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 角色选择 */

.admin-choice-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.admin-choice {
  position: relative;
  display: block;
  cursor: pointer;
}

.admin-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.admin-choice-body {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  transition:
    border-color var(--speed),
    background var(--speed),
    box-shadow var(--speed);
}

.admin-choice:hover .admin-choice-body {
  border-color: var(--line-strong);
}

.admin-choice input:checked + .admin-choice-body {
  border-color: var(--gold-400);
  background: var(--gold-050);
  box-shadow: inset 0 0 0 1px rgba(184, 148, 88, 0.16);
}

.admin-choice input:focus-visible + .admin-choice-body {
  outline: 2px solid var(--gold-500);
  outline-offset: 2px;
}

.admin-choice.is-disabled {
  cursor: not-allowed;
}

.admin-choice.is-disabled .admin-choice-body {
  opacity: 0.62;
}

.admin-choice-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 7px;
  background: #f2f5f6;
  color: var(--ink-700);
  transition:
    background var(--speed),
    color var(--speed);
}

.admin-choice-icon .icon {
  width: 15px;
  height: 15px;
}

.admin-choice input:checked + .admin-choice-body .admin-choice-icon {
  background: var(--ink-900);
  color: var(--gold-200);
}

.admin-choice-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}

.admin-choice-copy strong {
  color: var(--text);
  font-size: 11.5px;
  font-weight: 600;
}

.admin-choice-copy small {
  color: var(--text-faint);
  font-size: 9px;
  line-height: 1.5;
}

.admin-choice-dot {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: #fff;
  transition: all var(--speed);
}

.admin-choice input:checked + .admin-choice-body .admin-choice-dot {
  border-color: var(--gold-500);
  background: radial-gradient(circle, var(--gold-500) 0 42%, transparent 46%);
}

.admin-status-line {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-inline-hint {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  color: var(--text-faint);
  font-size: 9px;
  line-height: 1.65;
}

.admin-inline-hint .icon {
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--gold-600);
}

/* --------------------------------------------------------------------------
   预设按钮
   -------------------------------------------------------------------------- */

.admin-presets {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-presets-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 9.5px;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.admin-presets-label .icon {
  width: 12px;
  height: 12px;
  color: var(--gold-600);
}

.admin-preset {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
  transition:
    border-color var(--speed),
    background var(--speed),
    box-shadow var(--speed);
}

.admin-preset b {
  color: var(--text);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.admin-preset small {
  color: var(--text-faint);
  font-size: 8.5px;
  line-height: 1.4;
}

.admin-preset:hover:not(:disabled) {
  border-color: var(--gold-300);
  background: var(--gold-050);
}

.admin-preset.is-active {
  border-color: var(--gold-500);
  background: var(--gold-050);
  box-shadow: inset 0 0 0 1px rgba(184, 148, 88, 0.2);
}

.admin-preset:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.admin-preset-clear b {
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   权限矩阵
   -------------------------------------------------------------------------- */

.admin-matrix {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-matrix.is-locked {
  opacity: 0.94;
}

.admin-lock-banner {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  border: 1px solid var(--gold-200);
  border-radius: 8px;
  background: var(--gold-050);
  color: var(--gold-600);
  font-size: 10px;
  line-height: 1.6;
}

.admin-lock-banner .icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.admin-matrix-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fcfdfd;
}

.admin-matrix-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: #fff;
}

.admin-matrix-head h4 {
  color: var(--ink-900);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.admin-matrix-head p {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 9px;
  line-height: 1.55;
}

.admin-matrix-tag {
  flex: 0 0 auto;
  color: var(--gold-600);
  font-family: var(--font-number);
  font-size: 10px;
  white-space: nowrap;
}

.admin-matrix-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  padding: 12px 14px;
}

.admin-matrix-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-field-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
}

/* 开关行 */

.admin-switch {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition:
    border-color var(--speed),
    background var(--speed);
}

.admin-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.admin-switch:hover {
  border-color: var(--line-strong);
}

.admin-switch.is-on {
  border-color: var(--gold-300);
  background: linear-gradient(180deg, #fff, var(--gold-050));
}

.admin-switch.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.admin-switch.is-danger {
  border-color: var(--danger-line);
  background: var(--danger-bg);
}

.admin-switch-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 7px;
  background: #f2f5f6;
  color: var(--ink-700);
  transition:
    background var(--speed),
    color var(--speed);
}

.admin-switch-icon .icon {
  width: 14px;
  height: 14px;
}

.admin-switch.is-on .admin-switch-icon {
  background: var(--ink-900);
  color: var(--gold-200);
}

.admin-switch-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}

.admin-switch-copy strong {
  color: var(--text);
  font-size: 10.5px;
  font-weight: 500;
}

.admin-switch-copy small {
  color: var(--text-faint);
  font-size: 8.5px;
  line-height: 1.5;
}

.admin-switch-copy em {
  color: var(--warning);
  font-size: 8.5px;
  font-style: normal;
  line-height: 1.5;
}

.admin-switch-track {
  position: relative;
  width: 34px;
  height: 19px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #d8e0e5;
  transition: background var(--speed);
}

.admin-switch-track span {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
  transition: transform var(--speed) var(--ease);
}

.admin-switch input:checked + .admin-switch-track {
  background: var(--ink-800);
}

.admin-switch input:checked + .admin-switch-track span {
  transform: translateX(15px);
}

.admin-switch input:focus-visible + .admin-switch-track {
  outline: 2px solid var(--gold-500);
  outline-offset: 2px;
}

.admin-switch-status {
  padding: 11px 12px;
}

/* 操作矩阵 */

.admin-action-table {
  min-width: 560px;
  padding: 12px 14px;
}

.admin-action-row {
  display: grid;
  grid-template-columns: minmax(128px, 1.3fr) repeat(4, minmax(66px, 1fr));
  align-items: center;
  gap: 6px;
  padding: 5px 3px;
  border-bottom: 1px solid var(--line-soft);
}

.admin-action-row:last-child {
  border-bottom: 0;
}

.admin-action-row.is-head {
  padding-top: 0;
  border-bottom: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 9px;
  letter-spacing: 0.3px;
}

.admin-action-row.is-head span:not(:first-child) {
  text-align: center;
}

.admin-action-name {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-secondary);
  font-size: 10.5px;
  white-space: nowrap;
}

.admin-action-name .icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  color: var(--gold-600);
}

.admin-action-name b {
  font-weight: 500;
}

.admin-tick {
  position: relative;
  display: grid;
  place-items: center;
  padding: 2px 0;
  cursor: pointer;
}

.admin-tick input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.admin-tick-box {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  color: transparent;
  transition:
    background var(--speed),
    border-color var(--speed),
    color var(--speed);
}

.admin-tick-box .icon {
  width: 12px;
  height: 12px;
  stroke-width: 2.6;
}

.admin-tick:hover .admin-tick-box {
  border-color: var(--gold-400);
}

.admin-tick input:checked + .admin-tick-box {
  border-color: var(--ink-900);
  background: var(--ink-900);
  color: #fff;
}

.admin-tick input:focus-visible + .admin-tick-box {
  outline: 2px solid var(--gold-500);
  outline-offset: 2px;
}

.admin-tick.is-disabled {
  cursor: not-allowed;
}

.admin-tick.is-disabled .admin-tick-box {
  border-style: dashed;
  background: #f2f4f5;
}

.admin-tick-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   结果弹窗（验证码 / 临时密码）
   -------------------------------------------------------------------------- */

.admin-result-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.admin-result-label .icon {
  width: 12px;
  height: 12px;
  color: var(--gold-600);
}

.admin-code-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 14px;
  border: 1px dashed var(--gold-300);
  border-radius: 12px;
  background: linear-gradient(160deg, var(--gold-050), #fff 76%);
  text-align: center;
}

.admin-code-hero .admin-code-value {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-900);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 3px;
  word-break: break-all;
}

.admin-code-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.admin-result-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin-top: 14px;
}

.admin-result-meta > div {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8fafb;
}

.admin-result-meta span {
  color: var(--text-muted);
  font-size: 9px;
}

.admin-result-meta strong {
  color: var(--ink-900);
  font-size: 11px;
  font-weight: 500;
}

.admin-perm-preview {
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: 8px;
  background: #f8fafb;
}

.admin-perm-preview span {
  color: var(--text-muted);
  font-size: 9px;
}

.admin-perm-preview p {
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: 10px;
  line-height: 1.65;
  word-break: break-word;
}

.admin-result-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 9.5px;
  line-height: 1.7;
}

.admin-result-note .icon {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--gold-600);
}

.admin-warning-band {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
  padding: 9px 12px;
  border: 1px solid var(--warning-line);
  border-radius: 8px;
  background: var(--warning-bg);
  color: var(--warning);
  font-size: 10px;
  line-height: 1.6;
}

.admin-warning-band .icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.admin-password-result .admin-code-hero .admin-code-value {
  font-size: 20px;
  letter-spacing: 1.2px;
}

/* --------------------------------------------------------------------------
   无权限兜底
   -------------------------------------------------------------------------- */

.admin-denied {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 54px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at 50% 0, var(--gold-050), #fff 64%);
  text-align: center;
}

.admin-denied-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--ink-900);
  color: var(--gold-300);
  box-shadow: 0 12px 28px rgba(11, 31, 51, 0.18);
}

.admin-denied-mark .icon {
  width: 24px;
  height: 24px;
}

.admin-denied h2 {
  color: var(--ink-900);
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.4px;
}

.admin-denied p {
  max-width: 460px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.85;
}

.admin-denied-actions {
  margin-top: 6px;
}

/* --------------------------------------------------------------------------
   响应式
   -------------------------------------------------------------------------- */

@media (max-width: 1180px) {
  .admin-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-recent-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-recent-row:nth-child(odd) {
    padding-left: 0;
    border-left: 0;
  }

  .admin-recent-row:nth-child(n + 3) {
    padding-top: 6px;
    border-top: 1px dashed var(--line-soft);
  }
}

@media (max-width: 960px) {
  .admin-matrix-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-search {
    flex: 1 1 100%;
    max-width: none;
  }

  .admin-toolbar {
    align-items: stretch;
  }

  .admin-toolbar .toolbar-left,
  .admin-toolbar .toolbar-right {
    width: 100%;
  }

  .admin-toolbar .toolbar-right {
    justify-content: space-between;
  }

  .admin-invite-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-choice-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .admin-stat-grid {
    gap: 9px;
  }

  .admin-stat {
    gap: 9px;
    padding: 11px;
  }

  .admin-stat .mini-stat-icon {
    width: 30px;
    height: 30px;
  }

  .admin-stat .mini-stat-copy strong {
    font-size: 18px;
  }

  .admin-stat .mini-stat-copy small {
    display: none;
  }

  .admin-tabs {
    gap: 18px;
  }

  .admin-recent-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-recent-row + .admin-recent-row {
    padding-left: 0;
    border-left: 0;
    border-top: 1px dashed var(--line-soft);
    padding-top: 6px;
  }

  .admin-tab {
    gap: 5px;
    font-size: 11.5px;
  }

  .admin-tab .icon {
    width: 14px;
    height: 14px;
  }

  .admin-note-band {
    flex-direction: column;
    gap: 8px;
    padding: 12px 13px;
  }

  .admin-note-band .btn {
    align-self: stretch;
  }

  .admin-invite-stats {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .admin-result-meta {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-code-hero {
    padding: 15px 10px;
  }

  .admin-code-hero .admin-code-value {
    font-size: 20px;
    letter-spacing: 2px;
  }

  .admin-identity {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .admin-modal .modal-body {
    padding: 16px;
  }

  .admin-form-section-head {
    flex-direction: column;
    gap: 6px;
  }

  .admin-preset {
    flex: 1 1 auto;
  }

  .admin-denied {
    padding: 40px 18px;
  }
}

@media (max-width: 420px) {
  .admin-stat {
    padding: 10px;
  }

  .admin-tab-count {
    display: none;
  }
}
