@charset "UTF-8";
/* ==========================================================================
   cdk.bar Admin Console — Partner API Keys Panel (/elllat?panel=partner-keys)
   Uses cdk.bar's native CSS tokens (--surface, --ink, --primary, --brd, etc.)
   so it adapts seamlessly across all skins, light/dark modes, and layouts.
   ========================================================================== */

/* Visually hidden live region & screen-reader labels */
.pk-sr-only:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

/* Native sidebar / rail / topnav menu entry */
.pk-nav-side {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-md, 10px);
  font-size: 14px;
  color: var(--ink-2);
  text-decoration: none;
  cursor: pointer;
  background: transparent;
  border: 0;
  width: 100%;
  text-align: left;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.pk-nav-side:hover {
  background: var(--primary-soft);
  color: var(--ink);
}

.pk-nav-side.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.pk-nav-side svg,
.pk-nav-pill svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.layout-rail .pk-nav-side {
  justify-content: center;
  padding: 9px;
}

.layout-rail .pk-nav-side .pk-nav-label {
  display: none;
}

.pk-nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: var(--radius-pill, 999px);
  font-size: 14px;
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  background: transparent;
  border: 0;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.pk-nav-pill:hover {
  background: var(--primary-soft);
  color: var(--ink);
}

.pk-nav-pill.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

@media (max-width: 900px) {
  .layout-sidebar .pk-nav-side .pk-nav-label {
    display: none;
  }
  .layout-sidebar .pk-nav-side {
    justify-content: center;
    padding: 9px;
  }
}

/* Main Partner Keys Admin Page Container */
.pk-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 72px;
  color: var(--ink);
}

.pk-panel[hidden],
.pk-route-hidden {
  display: none !important;
}

.pk-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
  min-height: 56px;
}

.pk-header-text {
  min-width: 0;
}

.pk-title {
  margin: 0;
  font-family: var(--font-display, var(--font-serif, inherit));
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
}

.pk-subtitle {
  margin: 6px 0 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-3);
}

.pk-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.pk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-md, 10px);
  border: 1px solid var(--brd-2, var(--brd));
  background: var(--surface-2, var(--surface));
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, opacity 0.15s ease;
}

.pk-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--ink);
}

.pk-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.pk-btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-ink, #ffffff);
}

.pk-btn-primary:hover:not(:disabled) {
  opacity: 0.92;
  color: var(--primary-ink, #ffffff);
}

.pk-btn-danger {
  color: var(--err, #dc2626);
  border-color: color-mix(in oklab, var(--err, #dc2626) 35%, var(--brd));
  background: color-mix(in oklab, var(--err, #dc2626) 8%, var(--surface));
}

.pk-btn-danger:hover:not(:disabled) {
  border-color: var(--err, #dc2626);
  background: color-mix(in oklab, var(--err, #dc2626) 14%, var(--surface));
  color: var(--err, #dc2626);
}

.pk-btn-sm {
  min-height: 32px;
  padding: 0 11px;
  font-size: 12.5px;
  border-radius: 8px;
}

.pk-btn:focus-visible,
.pk-nav-side:focus-visible,
.pk-nav-pill:focus-visible,
.pk-input:focus-visible,
.pk-table-wrap:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Info & Stats Strip */
.pk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.pk-stat-card {
  background: var(--surface);
  border: 1px solid var(--brd);
  border-radius: var(--radius-lg, 14px);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pk-stat-label {
  font-size: 12px;
  color: var(--ink-3);
}

.pk-stat-val {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  line-height: 1.2;
}

.pk-stat-mono {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
  font-size: 12.5px;
  color: var(--ink-2);
  word-break: break-all;
}

.pk-inline-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

/* Card Sections */
.pk-card {
  background: var(--surface);
  border: 1px solid var(--brd);
  border-radius: var(--radius-lg, 14px);
  padding: 20px;
}

.pk-card-title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

/* Form Layout & Validation (follows forms + validate-input-after-interaction) */
.pk-create-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pk-field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
}

.pk-field label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

.pk-hint {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-3);
}

.pk-create-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
}

.pk-create-input-wrap {
  flex: 1 1 280px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pk-input {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-md, 10px);
  border: 1px solid var(--brd-2, var(--brd));
  background: var(--surface-solid, var(--surface));
  color: var(--ink);
  font: inherit;
  font-size: max(1rem, 14px);
  line-height: 1.4;
  box-sizing: border-box;
}

@media (pointer: coarse) {
  .pk-input,
  .pk-btn {
    min-height: 48px;
  }
}

.pk-input:is(:user-invalid, .user-invalid-fallback) {
  border-color: var(--err, #dc2626);
  background: color-mix(in oklab, var(--err, #dc2626) 7%, var(--surface-solid, var(--surface)));
}

.pk-field-err {
  display: none;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--err, #dc2626);
}

.pk-input:is(:user-invalid, .user-invalid-fallback) + .pk-field-err {
  display: block;
}

.pk-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md, 10px);
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid var(--brd);
  background: var(--surface-2, var(--surface));
  color: var(--ink);
}

.pk-notice[hidden] {
  display: none !important;
}

.pk-notice.is-err {
  border-color: color-mix(in oklab, var(--err, #dc2626) 40%, var(--brd));
  background: color-mix(in oklab, var(--err, #dc2626) 9%, var(--surface));
  color: var(--err, #dc2626);
}

.pk-notice.is-ok {
  border-color: color-mix(in oklab, var(--ok, #16a34a) 40%, var(--brd));
  background: color-mix(in oklab, var(--ok, #16a34a) 9%, var(--surface));
  color: var(--ok, #16a34a);
}

/* Responsive Data Table (follows responsive-table guide with @container) */
.pk-table-wrap {
  overflow: auto;
  max-inline-size: 100%;
  container-type: inline-size;
  border: 1px solid var(--brd);
  border-radius: var(--radius-md, 10px);
  background: var(--surface-solid, var(--surface));
}

.pk-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
  --label-2: "状态";
  --label-3: "创建时间";
  --label-4: "操作";
}

.pk-table caption {
  text-align: left;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--ink-3);
  border-bottom: 1px solid var(--brd);
  background: var(--surface-2, var(--surface));
}

.pk-table thead {
  position: sticky;
  inset-block-start: 0;
  z-index: 1;
}

.pk-table thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  background: var(--surface-2, var(--surface));
  border-bottom: 1px solid var(--brd);
  white-space: nowrap;
}

.pk-table tbody th,
.pk-table tbody td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--brd);
  color: var(--ink);
}

.pk-table tbody th {
  font-weight: 600;
  background: var(--surface-solid, var(--surface));
}

.pk-table tbody tr:last-child th,
.pk-table tbody tr:last-child td {
  border-bottom: 0;
}

.pk-key-name {
  display: block;
  font-weight: 600;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.pk-key-id {
  display: inline-block;
  margin-top: 3px;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
  font-size: 12px;
  color: var(--ink-3);
}

.pk-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid var(--brd);
  background: var(--surface-2, var(--surface));
  color: var(--ink-2);
}

.pk-badge.is-on {
  color: var(--ok, #16a34a);
  border-color: color-mix(in oklab, var(--ok, #16a34a) 35%, var(--brd));
  background: color-mix(in oklab, var(--ok, #16a34a) 11%, var(--surface));
}

.pk-badge.is-off {
  color: var(--err, #dc2626);
  border-color: color-mix(in oklab, var(--err, #dc2626) 35%, var(--brd));
  background: color-mix(in oklab, var(--err, #dc2626) 10%, var(--surface));
}

.pk-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.pk-empty {
  padding: 36px 16px;
  text-align: center;
  color: var(--ink-3);
  font-size: 13.5px;
}

@container (width < 680px) {
  .pk-table,
  .pk-table tbody,
  .pk-table tr,
  .pk-table th,
  .pk-table td {
    display: block;
  }

  .pk-table thead {
    display: none;
  }

  .pk-table tbody tr {
    padding: 10px 14px;
    border-bottom: 1px solid var(--brd);
  }

  .pk-table tbody th,
  .pk-table tbody td {
    padding: 6px 0;
    border-bottom: 0;
  }

  .pk-table tbody td:nth-child(2)::before {
    content: var(--label-2) "：";
    font-size: 12px;
    color: var(--ink-3);
    margin-inline-end: 6px;
  }

  .pk-table tbody td:nth-child(3)::before {
    content: var(--label-3) "：";
    font-size: 12px;
    color: var(--ink-3);
    margin-inline-end: 6px;
  }

  .pk-table tbody td:nth-child(4)::before {
    content: var(--label-4) "：";
    display: block;
    font-size: 12px;
    color: var(--ink-3);
    margin-bottom: 6px;
  }
}

/* Native Modal <dialog> Styling (follows dialog guide) */
dialog.pk-dialog {
  width: min(500px, calc(100vw - 32px));
  max-height: calc(100dvh - 40px);
  padding: 22px;
  border: 1px solid var(--brd-2, var(--brd));
  border-radius: var(--radius-lg, 16px);
  background: var(--surface-solid, var(--surface));
  color: var(--ink);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  overflow: auto;
  margin: auto;
}

dialog.pk-dialog[open] {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

dialog.pk-dialog:modal {
  overscroll-behavior: contain;
}

dialog.pk-dialog::backdrop {
  background: rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(4px);
  overflow: hidden;
  overscroll-behavior: contain;
}

.pk-dialog-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
}

.pk-dialog-desc {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-2);
}

.pk-secret-box {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border-radius: var(--radius-md, 10px);
  border: 1px solid var(--primary);
  background: var(--surface-2, var(--surface));
  color: var(--ink);
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
  font-size: 13px;
  box-sizing: border-box;
}

.pk-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

/* Forced colors support */
@media (forced-colors: active) {
  .pk-card,
  .pk-stat-card,
  .pk-table-wrap,
  dialog.pk-dialog,
  .pk-btn,
  .pk-badge {
    border: 1px solid CanvasText;
  }
}
