.admin-shell:has(.admin-audit-log.active) .topbar-tools .search-box { display: none; }

.admin-audit-log {
  --login-log-ink: #142b48;
  --login-log-muted: #526b87;
  --login-log-line: #d8e4f2;
  --login-log-blue: #2357d7;
  --login-log-tint: #edf4ff;
  max-width: 1520px;
  margin-inline: auto;
  color: var(--login-log-ink);
}
.admin-audit-log :is(h1, h2, h3, p) { margin: 0; }
.admin-audit-log :is(h1, h2, h3) { color: var(--login-log-ink); }
.audit-log-heading { margin: 4px 0 16px; }
.audit-log-heading h1 { font-size: clamp(22px, 2.2vw, 32px); line-height: 1.23; }
.admin-audit-log .audit-log-heading p { margin-top: 5px; color: var(--login-log-muted); }
.audit-log-filters,
.audit-log-card {
  min-width: 0;
  border: 1px solid var(--login-log-line);
  border-radius: 11px;
  background: #fff;
}
.audit-log-filters {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
  gap: 11px;
  align-items: end;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.audit-log-filters label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  min-width: 0;
  gap: 9px;
  align-items: center;
  font-size: 13px;
  font-weight: 650;
}
.admin-audit-log :is(button, input, select) {
  min-width: 0;
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid #c9d9ef;
  border-radius: 8px;
  background: #fff;
  color: var(--login-log-ink);
  font: inherit;
}
.admin-audit-log button { color: #194ba9; cursor: pointer; font-weight: 650; }
.admin-audit-log button:hover:not(:disabled) { background: var(--login-log-tint); }
.admin-audit-log button:disabled { opacity: .55; cursor: default; }
.admin-audit-log :focus-visible { outline: 2px solid var(--login-log-blue); outline-offset: 2px; }
.admin-audit-log .audit-log-primary {
  border-color: var(--login-log-blue);
  background: var(--login-log-blue);
  color: #fff;
}
.admin-audit-log .audit-log-primary:hover { background: #1748c1; }
.audit-log-filter-actions { display: flex; gap: 8px; }
.audit-log-filter-actions button { min-width: 68px; }
.audit-log-filters :is(input, select) { width: 100%; }
.audit-log-filters .audit-log-search { position: relative; margin: 0; }
.audit-log-search input { padding-inline-start: 35px; }
.audit-log-search svg {
  position: absolute;
  left: 11px;
  top: 50%;
  width: 17px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--login-log-muted);
  stroke-width: 1.8;
  stroke-linecap: round;
  pointer-events: none;
}
.audit-log-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 13px; align-items: start; }
[data-log-has-detail] .audit-log-layout { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.audit-log-card h2 { font-size: 19px; }
.audit-log-card > header,
.audit-log-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 12px 14px;
}
.audit-log-card [data-log-total],
.audit-log-footer { color: var(--login-log-muted); font-size: 13px; }
.audit-log-table { min-width: 0; table-layout: fixed; }
.audit-log-table :is(th, td) { padding: 8px; font-size: 13px; overflow-wrap: anywhere; }
.audit-log-table :is(th, td):first-child { padding-inline-start: 12px; }
.audit-log-table th { color: #385577; background: #edf4fc; }
.audit-log-table th:first-child { width: 27%; }
.audit-log-table th:nth-child(2) { width: 15%; }
.audit-log-table th:nth-child(4) { width: 22%; }
.audit-log-table th:last-child { width: 76px; }
.audit-log-table tr[data-selected] { background: #e9f2ff; }
.audit-log-table button { min-height: 34px; padding: 4px; border-color: transparent; background: transparent; white-space: nowrap; }
.audit-log-table td small { font-size: 12px; color: var(--login-log-muted); }
.audit-log-table time > span { display: block; font-variant-numeric: tabular-nums; }
.login-log-result {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.login-log-result[data-result="success"] { color: #12634a; background: #e1f6ec; }
.login-log-result[data-result="failure"] { color: #9c2a46; background: #fae8ee; }
.audit-log-table .audit-log-row-actions > small { display: none; }
.audit-log-footer nav { display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.audit-log-footer nav button { min-height: 34px; padding-block: 5px; }
.audit-log-feedback { padding: 20px 10px; color: var(--login-log-muted); text-align: center; }
.audit-log-feedback button { margin-top: 8px; }
.audit-log-detail { padding: 13px 14px; }
.audit-log-detail > header { padding: 0 0 8px; margin: 0 0 10px; border-bottom: 1px solid var(--login-log-line); }
.audit-log-detail .audit-log-back { display: none; }
.audit-log-detail .audit-log-close { min-height: 34px; min-width: 34px; padding: 3px; border-color: transparent; font-size: 18px; }
.audit-log-facts { margin: 7px 0 13px; font-size: 13px; }
.audit-log-facts > div {
  display: grid;
  grid-template-columns: 75px minmax(0, 1fr);
  gap: 7px;
  padding: 8px 0;
  border-bottom: 1px solid var(--login-log-line);
}
.audit-log-facts dt { color: var(--login-log-muted); }
.audit-log-facts dd { margin: 0; overflow-wrap: anywhere; }
.audit-log-client h3 { font-size: 14px; }
.audit-log-client pre {
  margin: 5px 0 0;
  padding: 9px;
  border: 1px solid var(--login-log-line);
  border-radius: 7px;
  background: #f1f5fa;
  color: #374f69;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 860px) {
  .admin-shell:has(.admin-audit-log.active) .admin-topbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 58px;
    padding: 8px 12px;
  }
  .admin-shell:has(.admin-audit-log.active) .admin-topbar strong { font-size: clamp(14px, 4.25vw, 18px); }
  .admin-shell:has(.admin-audit-log.active) .admin-topbar small,
  .admin-shell:has(.admin-audit-log.active) .topbar-tools > :not(.avatar-button) { display: none; }
  .admin-shell:has(.admin-audit-log.active) .topbar-tools { width: auto; margin: 0; }
  .admin-shell:has(.admin-audit-log.active[data-log-mobile-detail]) .admin-topbar { display: none; }
  .audit-log-heading { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .audit-log-filters { grid-template-columns: minmax(0, 1fr); padding: 11px 12px; }
  .audit-log-filters label { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .audit-log-filter-actions button { flex: 1; min-height: 44px; }
  [data-log-has-detail] .audit-log-layout { grid-template-columns: minmax(0, 1fr); }
  .audit-log-detail { display: none; }
  [data-log-mobile-detail] :is(.audit-log-filters, .audit-log-list) { display: none; }
  [data-log-mobile-detail] .audit-log-detail { display: block; }
  .audit-log-detail > header { justify-content: start; }
  .admin-audit-log .audit-log-back { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 5px; border-color: transparent; }
  .admin-audit-log .audit-log-close { display: none; }
  .audit-log-list { border: 0; background: transparent; }
  .audit-log-list > header { padding: 0 2px 9px; }
  .audit-log-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .audit-log-table, .audit-log-table tbody { display: block; }
  .audit-log-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3px 7px;
    padding: 10px 12px 3px;
    margin-bottom: 8px;
    border: 1px solid var(--login-log-line);
    border-radius: 8px;
    background: #fff;
  }
  .audit-log-table tr td { padding: 0; border: 0; }
  .audit-log-table tr td:first-child { padding-inline-start: 0; grid-row: 1; grid-column: 1; }
  .login-log-account strong { font-size: 16px; }
  .login-log-account small::before { content: "IP　"; }
  .login-log-role::before { content: "角色　"; color: var(--login-log-muted); }
  .audit-log-time::before { content: "时间　"; color: var(--login-log-muted); }
  .audit-log-row-actions small::before { content: "失败原因　"; }
  .audit-log-time, .audit-log-row-actions { grid-column: 1 / -1; }
  .audit-log-table .audit-log-time time > span { display: inline; }
  .login-log-state { grid-column: 2; grid-row: 1; align-self: start; }
  .login-log-state > small { display: none; }
  .audit-log-table .audit-log-row-actions > small { display: block; margin: 0; }
  .audit-log-row-actions button { min-height: 44px; margin-top: 3px; padding-inline: 0; }
  .audit-log-footer nav button { min-height: 44px; }
}
