body {
  --admin-blue: #4f8df7;
  --admin-blue-strong: #2563eb;
  --admin-blue-soft: #edf6ff;
  --admin-ink: #122033;
  --admin-muted: #64748b;
  --admin-border: #d8e3f4;
  --admin-card: rgba(255, 255, 255, 0.94);
  background:
    radial-gradient(circle at 8% 0%, rgba(96, 165, 250, 0.15), transparent 30%),
    linear-gradient(180deg, #f7fbff 0%, #f1f7ff 42%, #fbfdff 100%);
  color: var(--admin-ink);
  min-height: 100vh;
}

.admin-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
  min-height: 100vh;
  padding: 24px;
}

.admin-sidebar {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  align-self: start;
  min-height: calc(100vh - 48px);
  padding: 18px;
  border: 1px solid var(--admin-border);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 20px 54px rgba(37, 99, 235, 0.1);
}

.admin-brand {
  color: #1e5cc8;
  font-size: 19px;
  font-weight: 850;
  text-decoration: none;
}

.admin-nav {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.admin-nav-group__title {
  margin-bottom: 8px;
  color: var(--admin-muted);
  font-size: 12px;
  font-weight: 850;
}

.admin-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
  padding: 9px 11px;
  border-radius: 12px;
  color: #42607f;
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
}

.admin-nav-link.active,
.admin-nav-link:hover {
  background: var(--admin-blue-soft);
  color: var(--admin-blue-strong);
}

.admin-sidebar__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 18px;
  color: var(--admin-muted);
  font-size: 13px;
}

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

.admin-navbar {
  background: linear-gradient(90deg, #dcecff 0%, #eff7ff 48%, #ffffff 100%);
  border-bottom: 1px solid rgba(147, 197, 253, 0.44);
  box-shadow: 0 12px 34px rgba(96, 165, 250, 0.14);
}

.navbar-brand {
  color: #1e5cc8;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.navbar-brand:hover {
  color: #174ea6;
}

.admin-navbar .nav-link {
  border-radius: 999px;
  color: #4b6f9f;
  padding-left: 12px;
  padding-right: 12px;
}

.admin-navbar .nav-link.active,
.admin-navbar .nav-link:hover {
  background: rgba(79, 141, 247, 0.13);
  color: #1d4ed8;
}

.admin-logout {
  border: 0;
  color: var(--admin-blue-strong);
  font-weight: 600;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.page-head h1 {
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 6px;
}

.page-head p {
  color: var(--admin-muted);
  margin: 0;
}

.module-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 118px;
  padding: 18px;
  border: 1px solid var(--admin-border);
  border-radius: 18px;
  background: var(--admin-card);
  box-shadow: 0 18px 48px rgba(37, 99, 235, 0.08);
  color: inherit;
  text-decoration: none;
}

.module-card:hover {
  border-color: #93b8ff;
  transform: translateY(-1px);
}

.module-card strong {
  font-size: 18px;
}

.module-card span {
  color: var(--admin-muted);
}

.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

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

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.active-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid #cfe0ff;
  border-radius: 999px;
  background: #f4f8ff;
  color: var(--admin-blue-strong);
  font-size: 12px;
  font-weight: 800;
}

.active-filter-chip button {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.1);
  color: inherit;
}

.table-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-weight: 850;
}

.table-badge--primary {
  background: var(--admin-blue-soft);
  color: var(--admin-blue-strong);
}

.table-badge--success {
  background: #dcfce7;
  color: #15803d;
}

.table-badge--warning {
  background: #fef3c7;
  color: #b45309;
}

.table-badge--danger {
  background: #fee2e2;
  color: #b91c1c;
}

.table-badge--neutral {
  background: #f1f5f9;
  color: #64748b;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.summary-item {
  padding: 18px;
  border: 1px solid var(--admin-border);
  border-radius: 18px;
  background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
  box-shadow: 0 18px 48px rgba(37, 99, 235, 0.08);
}

.summary-item span {
  display: block;
  color: var(--admin-muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.summary-item strong {
  color: var(--admin-blue-strong);
  font-size: 28px;
}

.filter-bar,
.config-panel,
.pager,
.storage-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.config-panel {
  padding: 22px;
  border: 1px solid var(--admin-border);
  border-radius: 20px;
  background: var(--admin-card);
  box-shadow: 0 18px 48px rgba(37, 99, 235, 0.08);
}

.form-field {
  min-width: 240px;
  flex: 1 1 240px;
}

.form-field span {
  display: block;
  color: var(--admin-muted);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 5px;
}

.form-field .secret-toggle {
  margin-top: 8px;
}

.config-actions {
  display: flex;
  flex: 1 1 100%;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
}

.form-control,
.form-select {
  border-color: var(--admin-border);
  border-radius: 12px;
}

.form-control:focus,
.form-select:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.14);
}

.upload-rule-panel {
  display: grid;
  gap: 18px;
  align-items: stretch;
}

.upload-rule-panel__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 18px;
  align-items: stretch;
}

.upload-rule-panel__head--single {
  grid-template-columns: 1fr;
}

.upload-rule-panel__head > div:first-child,
.upload-rule-section,
.upload-rule-card {
  border: 1px solid #dbe7f7;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.upload-rule-panel__head > div:first-child {
  padding: 20px;
}

.upload-rule-panel__head strong,
.upload-rule-section__title strong,
.upload-rule-card strong {
  color: var(--admin-ink);
  font-weight: 850;
}

.upload-rule-panel__head p,
.upload-rule-section__title span,
.upload-rule-card p {
  margin: 6px 0 0;
  color: var(--admin-muted);
  font-size: 13px;
  line-height: 1.5;
}

.upload-rule-switch {
  min-width: 0;
  height: 100%;
  padding: 18px;
  background: #f4f8ff;
}

.upload-rule-section {
  padding: 18px;
}

.upload-rule-section__title {
  margin-bottom: 14px;
}

.upload-rule-section__title strong,
.upload-rule-section__title span {
  display: block;
}

.upload-rule-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.upload-rule-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.upload-rule-card {
  display: flex;
  flex-direction: column;
  min-height: 168px;
  padding: 16px;
}

.upload-rule-card .form-field {
  min-width: 0;
  flex: 0 0 auto;
  margin-top: auto;
}

.upload-rule-card .form-field span {
  display: none;
}

.upload-rule-card .quota-unit {
  max-width: 92px;
  margin-top: 8px;
}

.upload-rule-card .secret-toggle {
  width: fit-content;
  margin-top: 8px;
}

.upload-rule-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 2px;
}

.storage-config-panel .upload-rule-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.storage-config-panel .upload-rule-card,
.media-quota-panel .upload-rule-card,
.wechat-config-panel .upload-rule-card {
  min-height: 142px;
}

.storage-config-actions {
  justify-content: flex-start;
}

.storage-active-switch,
.quota-enable-switch {
  min-width: 0;
  height: 100%;
  padding: 18px;
  background: #f4f8ff;
}

@media (max-width: 1100px) {
  .upload-rule-panel__head,
  .upload-rule-grid,
  .upload-rule-grid--three,
  .storage-config-panel .upload-rule-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .admin-shell {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .admin-sidebar {
    position: static;
    min-height: auto;
  }

  .admin-nav {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .admin-sidebar__foot {
    margin-top: 12px;
  }

}

.table-shell {
  border: 1px solid var(--admin-border);
  border-radius: 20px;
  background: var(--admin-card);
  box-shadow: 0 18px 48px rgba(37, 99, 235, 0.08);
  overflow: auto;
}

.chart-panel {
  padding: 22px;
  border: 1px solid var(--admin-border);
  border-radius: 20px;
  background: var(--admin-card);
  box-shadow: 0 18px 48px rgba(37, 99, 235, 0.08);
}

.overview-panel {
  padding: 20px;
  border: 1px solid var(--admin-border);
  border-radius: 20px;
  background: var(--admin-card);
  box-shadow: 0 18px 48px rgba(37, 99, 235, 0.08);
}

.overview-panel__title {
  margin: 0 0 14px;
  color: var(--admin-ink);
  font-size: 17px;
  font-weight: 850;
}

.overview-card-grid,
.overview-shortcut-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.overview-status-card,
.overview-shortcut {
  display: grid;
  gap: 9px;
  min-height: 116px;
  padding: 14px;
  border: 1px solid #e5edf8;
  border-radius: 16px;
  background: #ffffff;
}

.overview-status-card__head,
.overview-shortcut strong {
  color: var(--admin-ink);
  font-size: 14px;
  font-weight: 850;
}

.overview-status-card__hint,
.overview-shortcut span {
  margin: 0;
  color: var(--admin-muted);
  font-size: 13px;
}

.overview-shortcut {
  color: inherit;
  text-decoration: none;
}

.overview-shortcut:hover {
  border-color: #93b8ff;
  transform: translateY(-1px);
}

.chart-title {
  color: var(--admin-muted);
  font-size: 14px;
  margin-bottom: 10px;
}

.chart-panel svg {
  width: 100%;
  min-height: 260px;
}

.chart-panel circle {
  fill: var(--admin-blue);
}

.config-hint {
  flex: 1 1 100%;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--admin-blue-soft);
  color: var(--admin-blue-strong);
  font-size: 13px;
}

.range-tabs {
  display: inline-flex;
  gap: 8px;
  width: max-content;
  padding: 6px;
  border: 1px solid var(--admin-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
}

.storage-tabs .btn {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-radius: 14px;
  padding: 12px 14px;
}

.storage-tabs--compact {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  padding: 5px;
  border: 1px solid var(--admin-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
}

.storage-tabs--compact .btn {
  min-width: 86px;
  justify-content: center;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 13px;
}

.active-storage-badge {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  font-size: 12px;
}

.switch-field {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;
  min-height: 54px;
  padding: 12px 16px;
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  background: #f8fbff;
}

.switch-field span {
  grid-column: 2;
  line-height: 1.35;
  margin: 0;
}

.switch-field .form-check-input {
  grid-column: 1;
  grid-row: 1;
  float: none;
  width: 2.4em;
  height: 1.25em;
  margin: 0;
}

#add-publish-limit {
  width: auto;
  min-width: 74px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
}

.page-action-primary {
  min-width: 72px;
  border-radius: 999px;
}

.quota-unit {
  max-width: 92px;
}

.filter-drawer {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: none;
  justify-content: flex-end;
  background: rgba(15, 23, 42, 0.34);
}

.filter-drawer.open {
  display: flex;
}

.filter-drawer__panel {
  width: min(420px, 100vw);
  height: 100vh;
  padding: 20px;
  background: linear-gradient(180deg, #fff 0%, #f6f9ff 100%);
  box-shadow: -12px 0 42px rgba(29, 78, 216, 0.18);
  overflow: auto;
}

.filter-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.filter-drawer__body {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.table-shell th,
.table-shell td {
  white-space: nowrap;
}

.table-shell td.col-error-message {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-shell td.col-api-path {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table thead th {
  color: var(--admin-muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.table-shell td:nth-child(5) {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-avatar,
.admin-avatar__image,
.admin-avatar__fallback {
  width: 42px;
  height: 42px;
}

.admin-avatar {
  overflow: hidden;
  border-radius: 50%;
  background: linear-gradient(135deg, #eef6ff, #fff7ed);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.22);
}

.admin-avatar__image {
  display: block;
  object-fit: cover;
}

.admin-avatar__fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--admin-blue-strong);
  font-weight: 850;
}

.admin-avatar-block {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--admin-muted);
  font-size: 13px;
}

.admin-avatar-block .admin-avatar,
.admin-avatar-block .admin-avatar__image,
.admin-avatar-block .admin-avatar__fallback {
  width: 72px;
  height: 72px;
}

.admin-media-strip {
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-media-thumb {
  position: relative;
  width: 44px;
  height: 44px;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: #eef2ff;
}

.admin-media-thumb__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-media-thumb__video {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--admin-blue-strong);
  font-weight: 900;
}

.admin-media-strip__more {
  color: var(--admin-muted);
  font-size: 12px;
  font-weight: 800;
}

.table-shell td .btn + .btn {
  margin-left: 6px;
}

.empty-state {
  padding: 44px 16px;
  color: var(--admin-muted);
  text-align: center;
}

.pager {
  justify-content: flex-end;
  color: var(--admin-muted);
}

.json-view {
  min-height: 420px;
  padding: 16px;
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  background: #f8fbff;
  overflow: auto;
}

.json-view.compact {
  min-height: 300px;
  margin: 0;
  font-size: 13px;
}

.detail-view {
  min-height: 240px;
}

.detail-layout {
  display: grid;
  gap: 16px;
}

.detail-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(147, 197, 253, 0.48);
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0%, rgba(96, 165, 250, 0.18), transparent 34%),
    linear-gradient(135deg, #f8fbff 0%, #ffffff 100%);
}

.detail-hero__copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.detail-hero__kicker {
  color: var(--admin-blue-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.detail-hero__title {
  overflow: hidden;
  color: var(--admin-ink);
  font-size: 24px;
  font-weight: 850;
  line-height: 1.25;
  text-overflow: ellipsis;
}

.detail-hero__badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.detail-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--admin-muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-tag--primary {
  background: var(--admin-blue-soft);
  color: var(--admin-blue-strong);
}

.detail-tag--success {
  background: #dcfce7;
  color: #15803d;
}

.detail-tag--danger {
  background: #fee2e2;
  color: #b91c1c;
}

.detail-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.detail-stat {
  padding: 14px;
  border: 1px solid var(--admin-border);
  border-radius: 16px;
  background: #ffffff;
}

.detail-stat span {
  display: block;
  color: var(--admin-muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.detail-stat strong {
  color: var(--admin-blue-strong);
  font-size: 20px;
}

.detail-section {
  padding: 16px;
  border: 1px solid var(--admin-border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
}

.detail-section__title {
  margin: 0 0 12px;
  color: var(--admin-ink);
  font-size: 15px;
  font-weight: 850;
}

.detail-description {
  display: grid;
  grid-template-columns: minmax(100px, 160px) minmax(0, 1fr);
  gap: 10px 14px;
  margin: 0;
}

.detail-description dt {
  color: var(--admin-muted);
  font-weight: 700;
}

.detail-description dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--admin-ink);
}

.detail-mini-table {
  overflow: auto;
  border: 1px solid var(--admin-border);
  border-radius: 14px;
}

.detail-mini-table th {
  color: var(--admin-muted);
  font-size: 12px;
  font-weight: 800;
  background: #f8fbff;
}

.detail-mini-table td,
.detail-mini-table th {
  white-space: nowrap;
}

.detail-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.detail-muted {
  color: var(--admin-muted);
  font-size: 13px;
}

.detail-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--admin-blue-strong);
  font: inherit;
  font-weight: 800;
  text-align: left;
}

.detail-link:hover {
  text-decoration: underline;
}

.detail-empty {
  padding: 18px;
  border-radius: 14px;
  background: #f8fbff;
  color: var(--admin-muted);
  text-align: center;
}

.detail-json-panel + .detail-json-panel {
  margin-top: 12px;
}

.detail-json-panel__title {
  margin-bottom: 8px;
  color: var(--admin-muted);
  font-size: 13px;
  font-weight: 800;
}

.detail-json-panel .json-view.compact {
  min-height: 120px;
}

.toast-stack {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1100;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
}

.toast-card {
  padding: 12px 14px;
  border: 1px solid var(--admin-border);
  border-left: 4px solid var(--admin-blue-strong);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.14);
  color: var(--admin-ink);
  font-size: 14px;
}

.toast-card--danger {
  border-left-color: #dc2626;
}

.toast-card--warning {
  border-left-color: #d97706;
}

.confirm-modal .modal-content {
  border: 1px solid var(--admin-border);
  border-radius: 18px;
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #eaf2ff 0%, #f8fbff 100%);
}

.login-panel {
  width: min(420px, calc(100vw - 32px));
  padding: 28px;
  background: #fff;
  border: 1px solid var(--admin-border);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(29, 78, 216, 0.14);
}

.login-panel h1 {
  font-size: 24px;
  margin-bottom: 22px;
}
