/* 审计首页预览限五条，完整二十条分页放在弹窗内；滚动保持可用但不展示粗滚动条。 */
#audit-panel {
  padding: 0;
  border-radius: 12px;
  overflow: hidden;
}
.audit-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
}
.audit-heading h2 {
  font-size: 14px;
  margin: 0;
}
.audit-heading button {
  font-size: 12px;
  min-height: max(var(--touch-target), 30px);
  padding: 4px 10px;
}
.audit-preview-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.audit-preview-list > li {
  border-top: 1px solid var(--line);
}
.audit-preview-list > li[data-i18n] {
  padding: 24px 20px;
  color: var(--muted);
  font-size: 13px;
}
.audit-preview-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(100px, 0.35fr) 150px 12px;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 12px 20px;
  min-height: 54px;
  border: 0;
  border-radius: 0;
  color: var(--ink);
  background: var(--surface);
  text-align: left;
  font-size: 12px;
}
.audit-preview-row:hover {
  background: var(--hover);
}
.audit-preview-row:focus-visible {
  outline-offset: -3px;
}
.audit-preview-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.audit-preview-identity > [data-i18n] {
  flex-shrink: 0;
}
.audit-preview-target,
.audit-preview-actor,
.audit-preview-time {
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.audit-preview-time {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.audit-preview-arrow {
  font-size: 18px;
  text-align: right;
  color: var(--muted);
}
.audit-preview-error {
  margin: 0;
  padding: 12px 20px;
  font-size: 12px;
}
dialog.audit-history-dialog {
  width: min(940px, calc(100vw - 32px));
  max-height: min(720px, calc(100dvh - 32px));
}
.audit-history-dialog .dialog-body,
.audit-dialog .dialog-body {
  scrollbar-width: none;
}
.audit-history-dialog .dialog-body::-webkit-scrollbar,
.audit-dialog .dialog-body::-webkit-scrollbar {
  display: none;
}
.audit-tools,
.audit-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.audit-tools select {
  width: auto;
  max-width: 100%;
}
.audit-history-dialog .muted,
.audit-history-dialog .error {
  font-size: 12px;
}
.audit-history-dialog .table-wrap {
  overflow: visible;
}
.audit-table {
  table-layout: fixed;
  font-size: 12px;
}
.audit-table th,
.audit-table td {
  padding: 7px 10px;
}
.audit-table th:nth-child(1) {
  width: 21%;
}
.audit-table th:nth-child(2) {
  width: 19%;
}
.audit-table th:nth-child(3) {
  width: 21%;
}
.audit-table th:nth-child(4) {
  width: 25%;
}
.audit-table th:nth-child(5) {
  width: 14%;
}
.audit-table .cell-content {
  overflow-wrap: anywhere;
}
.audit-table button {
  font-size: 12px;
  padding: 4px 8px;
  min-height: max(var(--touch-target), 30px);
  margin: 0;
}
.sectioned-dialog .audit-footer {
  justify-content: space-between;
  font-size: 12px;
}
dialog.audit-dialog {
  width: min(580px, calc(100vw - 32px));
}
.audit-fields {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 14px 16px;
  font-size: 12px;
  margin: 4px 0;
}
.audit-fields dt {
  color: var(--muted);
}
.audit-fields dd {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.audit-close {
  font-size: 20px;
  line-height: 1;
}
@media (max-width: 640px) {
  .audit-heading {
    padding: 12px 16px;
  }
  .audit-preview-row {
    grid-template-columns: minmax(0, 1fr) auto 12px;
    gap: 6px 10px;
    padding: 12px 16px;
  }
  .audit-preview-identity {
    grid-column: 1 / 3;
    flex-wrap: wrap;
    gap: 4px 10px;
  }
  .audit-preview-actor,
  .audit-preview-time {
    font-size: 11px;
  }
  .audit-preview-arrow {
    grid-column: 3;
    grid-row: 1 / 3;
  }
  .audit-table {
    table-layout: auto;
  }
  .audit-table .cell-caption {
    display: none;
  }
  .audit-table tbody tr {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px 12px;
    padding: 12px 0;
    margin: 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
  }
  .audit-table td {
    padding: 0;
    font-size: 12px;
  }
  .audit-table td:nth-child(1) {
    grid-column: 1;
    grid-row: 3;
    color: var(--muted);
    font-size: 11px;
  }
  .audit-table td:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
    color: var(--muted);
    font-size: 11px;
  }
  .audit-table td:nth-child(3) {
    grid-column: 1;
    grid-row: 1;
  }
  .audit-table td:nth-child(4) {
    grid-column: 1;
    grid-row: 4;
  }
  .audit-table td:nth-child(5) {
    grid-column: 2;
    grid-row: 1 / 5;
    align-self: center;
  }
  .audit-table td:only-child {
    grid-column: 1 / -1;
  }
  .audit-table td .cell-content {
    overflow-wrap: anywhere;
  }
  .audit-fields {
    grid-template-columns: 80px minmax(0, 1fr);
    gap: 12px;
  }
}
