/* GP_CODE_MOBILE_TOP_SHEET: only card-generation overlays use this mobile layout. */
@media (max-width: 768px) {
  html:has(.GenerateCode),
  body:has(.GenerateCode),
  .GenerateCode {
    overflow-x: clip;
    overscroll-behavior-x: none;
    touch-action: pan-y pinch-zoom;
  }



  .code-generation-popup .t-select__dropdown-inner,
  .code-version-popup .t-select__dropdown-inner {
    max-height: min(360px, calc(100vh - 112px - env(safe-area-inset-bottom, 0px)));
    max-height: min(360px, calc(100dvh - 112px - env(safe-area-inset-bottom, 0px)));
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    touch-action: pan-y pinch-zoom;
  }

  .code-generation-popup .t-select-option,
  .code-version-popup .t-select-option {
    min-width: 0;
    max-width: 100%;
  }

  .t-dialog__wrap:has(.code-result-dialog) {
    overflow: hidden;
    overscroll-behavior: contain;
    touch-action: pan-y pinch-zoom;
  }

  .t-dialog__position:has(> .code-result-dialog) {
    align-items: flex-start !important;
    height: 100%;
    min-height: 0;
    padding: max(80px, calc(env(safe-area-inset-top, 0px) + 12px)) 12px max(12px, env(safe-area-inset-bottom, 0px)) !important;
    overflow: hidden;
  }

  .t-dialog.code-result-dialog {
    width: 100% !important;
    max-width: 640px;
    max-height: 100%;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    touch-action: pan-y pinch-zoom;
    animation: gp-code-sheet-enter 180ms ease-out;
  }

  .code-result-dialog .t-dialog__body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
  }

  .code-result-dialog .code-result-count { flex-shrink: 0; }
  .code-result-dialog .code-result-scroll {
    flex: 1 1 auto;
    height: auto;
    max-height: min(400px, calc(100vh - 200px));
    max-height: min(400px, calc(100dvh - 200px));
    min-height: 0;
    min-width: 0;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-gutter: auto;
  }
  .code-result-scroll .t-table__content {
    min-width: 0;
    overflow-x: hidden;
  }
  .code-result-scroll table { table-layout: fixed; width: 100%; }
  .code-result-scroll .t-table td { white-space: normal; overflow-wrap: anywhere; }
  .code-result-dialog .t-dialog__footer .t-button + .t-button { margin-left: 0; }

  .Vue-Toastification__toast.code-copy-success-toast {
    min-height: 0;
    max-width: calc(100vw - 24px);
    padding: 12px;
    margin-inline-end: 12px;
  }
  .code-copy-success-toast .Vue-Toastification__toast-body { font-size: 13px; line-height: 20px; }
}

@keyframes gp-code-sheet-enter {
  from { opacity: 0; translate: 0 -12px; }
  to { opacity: 1; translate: 0 0; }
}

/* GP_CODE_SINGLE_MOBILE_DETAILS: a single real record fits without horizontal scrolling. */
.code-records-table:has(tbody > tr:only-child > td:nth-child(9)) {
  --single-code-record: 1;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}
.code-records-table:has(tbody > tr:only-child > td:nth-child(9)) :is(.t-table__content, table, tbody, tbody > tr) {
  display: block;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100%;
  overflow: visible;
}
.code-records-table:has(tbody > tr:only-child > td:nth-child(9)) :is(colgroup, thead) { display: none; }
.code-records-table:has(tbody > tr:only-child > td:nth-child(9)) tbody > tr > td {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  width: 100% !important;
  max-width: 100%;
  min-width: 0;
  padding: 10px 14px !important;
  text-align: left !important;
  font-size: 13px !important;
  line-height: 22px;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}
.code-records-table:has(tbody > tr:only-child > td:nth-child(9)) tbody > tr > td::before {
  display: block;
  width: 4em !important;
  text-align: justify;
  text-align-last: justify;
  text-justify: inter-character;
  color: var(--admin-muted, #6b7280);
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
}
.code-records-table:has(tbody > tr:only-child > td:nth-child(9)) td:nth-child(1)::before { content: '兑换码'; }
.code-records-table:has(tbody > tr:only-child > td:nth-child(9)) td:nth-child(2)::before { content: '类别'; }
.code-records-table:has(tbody > tr:only-child > td:nth-child(9)) td:nth-child(3)::before { content: '所属游戏'; }
.code-records-table:has(tbody > tr:only-child > td:nth-child(9)) td:nth-child(4)::before { content: '状态'; }
.code-records-table:has(tbody > tr:only-child > td:nth-child(9)) td:nth-child(5)::before { content: '制卡人'; }
.code-records-table:has(tbody > tr:only-child > td:nth-child(9)) td:nth-child(6)::before { content: '制卡时间'; }
.code-records-table:has(tbody > tr:only-child > td:nth-child(9)) td:nth-child(7)::before { content: '使用时间'; }
.code-records-table:has(tbody > tr:only-child > td:nth-child(9)) td:nth-child(8)::before { content: '使用用户'; }
.code-records-table:has(tbody > tr:only-child > td:nth-child(9)) td:nth-child(9)::before { content: '操作'; }
.code-records-table:has(tbody > tr:only-child > td:nth-child(9)) :is(.copy-id, .copy-id__button, .copy-id__value, .creator-scroll, .creator-scroll__text, td > span) {
  min-width: 0 !important;
  max-width: 100% !important;
  width: auto !important;
  white-space: normal !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
  text-align: left !important;
  overflow: visible !important;
}
.code-records-table:has(tbody > tr:only-child > td:nth-child(9)) td:nth-child(9) { display: flex; flex-wrap: wrap; align-items: center; }
.code-records-table:has(tbody > tr:only-child > td:nth-child(9)) td:nth-child(9)::before { width: 64px; flex-shrink: 0; margin-inline-end: auto; }
.code-records-table:has(tbody > tr:only-child > td:nth-child(9)) td:nth-child(9) .t-button {
  min-width: 64px !important;
  height: 44px;
  min-height: 44px;
  padding: 0 16px !important;
  margin: 0 !important;
  font-size: 14px;
  line-height: 22px;
  border-radius: 6px;
}

/* GP_CODE_SINGLE_ALIGNMENT: identical text insets and vertical centers for all detail fields. */
.code-records-table:has(tbody > tr:only-child > td:nth-child(9)) tbody > tr > td {
  min-height: 48px;
  align-items: center;
}
.code-records-table:has(tbody > tr:only-child > td:nth-child(9)) :is(.copy-id, .creator-scroll, .creator-scroll__text) {
  line-height: 22px;
}
.code-records-table:has(tbody > tr:only-child > td:nth-child(9)) .copy-id {
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  justify-self: start;
}
.code-records-table:has(tbody > tr:only-child > td:nth-child(9)) .copy-id__button {
  display: inline-flex !important;
  align-items: center;
  min-height: 0;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 22px;
}
.code-records-table:has(tbody > tr:only-child > td:nth-child(9)) .copy-id__value {
  padding: 0 !important;
  line-height: 22px;
}

/* GP_CODE_MOBILE_LOADING: the shared page loader replaces the empty table while searching. */
.CodeRecords .code-records-table--loading { display: none !important; }

/* GP_CODE_SINGLE_PAGER: hide the redundant footer, but keep navigation on later pages. */
.code-records-table:has(tbody > tr:only-child > td:nth-child(9)) ~ .t-pagination:has(.t-pagination__btn-prev.t-is-disabled):has(.t-pagination__btn-next.t-is-disabled) {
  display: none !important;
}

/* GP_CODE_DESKTOP_DETAILS: one record becomes a wide, grouped detail card. */
@media (min-width: 769px) {
  .code-records-table:has(tbody > tr:only-child > td:nth-child(9)) tbody > tr {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .code-records-table:has(tbody > tr:only-child > td:nth-child(9)) tbody > tr > td {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 20px;
    min-height: 56px;
    padding: 14px 24px !important;
    font-size: 14px !important;
    line-height: 24px;
  }
  .code-records-table:has(tbody > tr:only-child > td:nth-child(9)) td:nth-child(1) {
    grid-column: 1 / -1;
    grid-row: 1;
    min-height: 72px;
    background: #fbfcfe;
  }
  .code-records-table:has(tbody > tr:only-child > td:nth-child(9)) td:nth-child(1) .copy-id__value {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.02em;
  }
  .code-records-table:has(tbody > tr:only-child > td:nth-child(9)) td:nth-child(3) {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .code-records-table:has(tbody > tr:only-child > td:nth-child(9)) td:nth-child(2) { grid-column: 1; grid-row: 3; }
  .code-records-table:has(tbody > tr:only-child > td:nth-child(9)) td:nth-child(4) { grid-column: 2; grid-row: 3; }
  .code-records-table:has(tbody > tr:only-child > td:nth-child(9)) td:nth-child(5) { grid-column: 1; grid-row: 4; }
  .code-records-table:has(tbody > tr:only-child > td:nth-child(9)) td:nth-child(8) { grid-column: 2; grid-row: 4; }
  .code-records-table:has(tbody > tr:only-child > td:nth-child(9)) td:nth-child(6) { grid-column: 1; grid-row: 5; }
  .code-records-table:has(tbody > tr:only-child > td:nth-child(9)) td:nth-child(7) { grid-column: 2; grid-row: 5; }
  .code-records-table:has(tbody > tr:only-child > td:nth-child(9)) :is(td:nth-child(4), td:nth-child(8), td:nth-child(7)) {
    border-inline-start: 1px solid var(--admin-border, #e7eaf0);
  }
  .code-records-table:has(tbody > tr:only-child > td:nth-child(9)) td:nth-child(9) {
    grid-column: 1 / -1;
    grid-row: 6;
    border-bottom: 0;
  }
  .code-records-table:has(tbody > tr:only-child > td:nth-child(9)) td:nth-child(9) .t-button {
    min-width: 72px !important;
    height: 36px;
    min-height: 36px;
    font-size: 14px;
  }
}

/* GP_GAME_LIST_RECORD_STANDARD: match record spacing and show a single game as details. */
.admin-content .GameList { padding: 0 !important; }
.GameList .page-content > .t-table {
  --game-list-min-width: 1080px;
}
.GameList .page-content > .t-table:has(th[data-colkey='operation']) {
  --game-list-min-width: 1406px;
}
.GameList .page-content > .t-table table {
  width: 100%;
  min-width: var(--game-list-min-width);
  table-layout: fixed;
}
.GameList .page-content > .t-table :is(th, td) {
  height: 48px;
  padding: 12px 14px;
  vertical-align: middle;
  text-align: left !important;
  font-size: 14px;
  line-height: 24px;
}
.GameList .page-content > .t-table .t-table__th-cell-inner {
  width: auto !important;
  max-width: 100%;
  text-align: left !important;
}
.GameList .page-content > .t-table .game-title-cell {
  min-width: 0;
  max-width: 100%;
}
.GameList .page-content > .t-table .game-title-cell > .copy-id {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}
.GameList .page-content > .t-table .operation-buttons {
  justify-content: flex-start;
  gap: 8px;
}
.GameList .page-content > .t-table:has(tbody > tr:only-child > td:nth-child(8)) {
  --single-game-detail: 1;
  overflow: hidden;
}
.GameList .page-content > .t-table:has(tbody > tr:only-child > td:nth-child(8)) :is(.t-table__content, table, tbody, tbody > tr) {
  display: block;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100%;
  overflow: visible;
}
.GameList .page-content > .t-table:has(tbody > tr:only-child > td:nth-child(8)) :is(colgroup, thead) { display: none; }
.GameList .page-content > .t-table:has(tbody > tr:only-child > td:nth-child(8)) tbody > tr > td {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100% !important;
  min-width: 0;
  max-width: 100%;
  height: auto;
  min-height: 48px;
  padding: 10px 14px;
  position: static !important;
  inset: auto !important;
  box-shadow: none !important;
  background: var(--admin-surface, #fff);
  text-align: left !important;
  font-size: 13px;
  line-height: 22px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.GameList .page-content > .t-table:has(tbody > tr:only-child > td:nth-child(8)) td::before {
  content: var(--game-detail-label);
  display: block;
  position: static !important;
  inset: auto !important;
  height: auto !important;
  transform: none !important;
  box-shadow: none !important;
  background: transparent !important;
  z-index: auto !important;
  width: 4em;
  color: var(--admin-muted, #6b7280);
  font-size: 13px;
  font-weight: 400;
  text-align: justify;
  text-align-last: justify;
  text-justify: inter-character;
  white-space: nowrap;
}
.GameList .page-content > .t-table:has(tbody > tr:only-child > td:nth-child(8)) .t-table__cell--fixed-right::after { display: none; }
.GameList .page-content > .t-table:has(tbody > tr:only-child > td:nth-child(8)) td:nth-child(1) { --game-detail-label: '游戏 ID'; --game-detail-column: 1; --game-detail-row: 2; }
.GameList .page-content > .t-table:has(tbody > tr:only-child > td:nth-child(8)) td:nth-child(2) { --game-detail-label: '游戏名称'; --game-detail-column: 1 / -1; --game-detail-row: 1; }
.GameList .page-content > .t-table:has(tbody > tr:only-child > td:nth-child(8)) td:nth-child(3) { --game-detail-label: '豪华版'; --game-detail-column: 1; --game-detail-row: 3; }
.GameList .page-content > .t-table:has(tbody > tr:only-child > td:nth-child(8)) td:nth-child(4) { --game-detail-label: '终极版'; --game-detail-column: 2; --game-detail-row: 3; }
.GameList .page-content > .t-table:has(tbody > tr:only-child > td:nth-child(8)) td:nth-child(5) { --game-detail-label: '状态'; --game-detail-column: 1 / -1; --game-detail-row: 5; }
.GameList .page-content > .t-table:has(tbody > tr:only-child > td:nth-child(8)) td:nth-child(6) { --game-detail-label: '分类'; --game-detail-column: 2; --game-detail-row: 2; }
.GameList .page-content > .t-table:has(tbody > tr:only-child > td:nth-child(8)) td:nth-child(7) { --game-detail-label: '联机状态'; --game-detail-column: 1; --game-detail-row: 4; }
.GameList .page-content > .t-table:has(tbody > tr:only-child > td:nth-child(8)) td:nth-child(8) { --game-detail-label: '赠送状态'; --game-detail-column: 2; --game-detail-row: 4; }
.GameList .page-content > .t-table:has(tbody > tr:only-child > td:nth-child(10)) td:nth-child(5) { --game-detail-label: '上架时间'; --game-detail-column: 2; --game-detail-row: 5; }
.GameList .page-content > .t-table:has(tbody > tr:only-child > td:nth-child(10)) td:nth-child(6) { --game-detail-label: '状态'; --game-detail-column: 1; --game-detail-row: 5; }
.GameList .page-content > .t-table:has(tbody > tr:only-child > td:nth-child(10)) td:nth-child(7) { --game-detail-label: '分类'; --game-detail-column: 2; --game-detail-row: 2; }
.GameList .page-content > .t-table:has(tbody > tr:only-child > td:nth-child(10)) td:nth-child(8) { --game-detail-label: '联机状态'; --game-detail-column: 1; --game-detail-row: 4; }
.GameList .page-content > .t-table:has(tbody > tr:only-child > td:nth-child(10)) td:nth-child(9) { --game-detail-label: '赠送状态'; --game-detail-column: 2; --game-detail-row: 4; }
.GameList .page-content > .t-table:has(tbody > tr:only-child > td:nth-child(10)) td:nth-child(10) { --game-detail-label: '操作'; --game-detail-column: 1 / -1; --game-detail-row: 6; }
.GameList .page-content > .t-table:has(tbody > tr:only-child > td:nth-child(8)) :is(.copy-id, .copy-id__button, .copy-id__value, .post-time-cell) {
  min-width: 0 !important;
  max-width: 100% !important;
  width: auto !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  text-align: left !important;
  line-height: 22px;
  overflow: visible !important;
}
.GameList .page-content > .t-table:has(tbody > tr:only-child > td:nth-child(8)) .copy-id {
  display: flex;
  align-items: center;
  justify-self: start;
}
.GameList .page-content > .t-table:has(tbody > tr:only-child > td:nth-child(8)) .copy-id__button {
  display: inline-flex !important;
  min-height: 0;
  margin: 0 !important;
  padding: 0 !important;
}
.GameList .page-content > .t-table:has(tbody > tr:only-child > td:nth-child(8)) .copy-id__value { padding: 0 !important; }
.GameList .page-content > .t-table:has(tbody > tr:only-child > td:nth-child(8)) .game-title-cell {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.GameList .page-content > .t-table:has(tbody > tr:only-child > td:nth-child(8)) td > :is(.t-tag, .stop-reason-trigger) { justify-self: start; }
.GameList .page-content > .t-table:has(tbody > tr:only-child > td:nth-child(8)) .stop-reason-trigger { justify-content: flex-start; }
.GameList .page-content > .t-table:has(tbody > tr:only-child > td:nth-child(8)) td:has(> .operation-buttons) {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 0;
}
.GameList .page-content > .t-table:has(tbody > tr:only-child > td:nth-child(8)) td:has(> .operation-buttons)::before { margin-inline-end: auto; }
.GameList .page-content > .t-table:has(tbody > tr:only-child > td:nth-child(8)) .operation-buttons {
  margin-inline-start: auto;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}
.GameList .page-content > .t-table:has(tbody > tr:only-child > td:nth-child(8)) .operation-buttons .t-button {
  min-width: 64px;
  min-height: 44px;
  height: 44px;
  padding-inline: 16px;
  margin: 0;
  font-size: 14px;
  border-radius: 6px;
}
.GameList .page-content > .t-table:has(tbody > tr:only-child > td:nth-child(8)) ~ .t-pagination:has(.t-pagination__btn-prev.t-is-disabled):has(.t-pagination__btn-next.t-is-disabled) { display: none !important; }
@media (min-width: 769px) {
  .GameList .page-content > .t-table:has(tbody > tr:only-child > td:nth-child(8)) tbody > tr {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .GameList .page-content > .t-table:has(tbody > tr:only-child > td:nth-child(8)) tbody > tr > td {
    grid-column: var(--game-detail-column);
    grid-row: var(--game-detail-row);
    grid-template-columns: 76px minmax(0, 1fr);
    min-height: 56px;
    gap: 20px;
    padding: 14px 24px;
    font-size: 14px;
    line-height: 24px;
  }
  .GameList .page-content > .t-table:has(tbody > tr:only-child > td:nth-child(8)) td:nth-child(2) { min-height: 72px; background: #fbfcfe; }
  .GameList .page-content > .t-table:has(tbody > tr:only-child > td:nth-child(8)) td:nth-child(2) .copy-id__value { font-size: 16px; font-weight: 600; }
  .GameList .page-content > .t-table:has(tbody > tr:only-child > td:nth-child(8)) :is(td:nth-child(4), td:nth-child(6), td:nth-child(8)) { border-inline-start: 1px solid var(--admin-border); }
  .GameList .page-content > .t-table:has(tbody > tr:only-child > td:nth-child(10)) :is(td:nth-child(6), td:nth-child(8)) { border-inline-start: 0; }
  .GameList .page-content > .t-table:has(tbody > tr:only-child > td:nth-child(10)) :is(td:nth-child(5), td:nth-child(7), td:nth-child(9)) { border-inline-start: 1px solid var(--admin-border); }
  .GameList .page-content > .t-table:has(tbody > tr:only-child > td:nth-child(8)) .operation-buttons .t-button { min-width: 72px; min-height: 36px; height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  .code-generation-popup .t-popup__content,
  .code-version-popup .t-popup__content,
  .t-dialog.code-result-dialog { animation: none; }
}

/* GP_DASHBOARD_RESPONSIVE_METRICS: use available content width for both roles. */
.dashboard-page { container-type: inline-size; container-name: dashboard-statistics; }
.dashboard-page .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.dashboard-page .metric-card { min-width: 0; }
.dashboard-page .metric-card .t-card__body { padding: 16px; }
.dashboard-page .metric-card__label { min-height: 36px; line-height: 18px; margin-bottom: 8px; overflow-wrap: anywhere; }
.dashboard-page .metric-card__value { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
@container dashboard-statistics (min-width: 840px) {
  .dashboard-page .dashboard-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@container dashboard-statistics (min-width: 1320px) {
  .dashboard-page .dashboard-grid:has(> .metric-card:nth-child(12):last-child) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
/* GP_GAME_DETAILS_RETURN: preserve role actions and reuse search reset. */
.GameList .page-content > .game-details-return {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 64px; padding: 10px 14px;
  margin-top: -1px; border: 1px solid var(--admin-border);
  border-radius: 0 0 8px 8px; background: #fff;
}
.GameList .game-details-return__label { width: 4em; color: var(--admin-muted); font-size: 13px; text-align: justify; text-align-last: justify; }
.GameList .game-details-return .t-button { min-width: 64px; min-height: 44px; height: 44px; border-radius: 6px; }
.GameList .page-content > .t-table:has(+ .game-details-return) { border-end-start-radius: 0; border-end-end-radius: 0; }
@media (max-width: 360px) {
  .GameList .page-content > .t-table:has(tbody > tr:only-child > td:nth-child(10)) .operation-buttons { gap: 8px; }
  .GameList .page-content > .t-table:has(tbody > tr:only-child > td:nth-child(10)) .operation-buttons .t-button[aria-label="返回游戏列表"] { min-width: 56px; padding-inline: 12px; }
}
@media (min-width: 769px) {
  .GameList .page-content > .game-details-return { min-height: 64px; padding: 14px 24px; }
  .GameList .game-details-return__label { width: 76px; font-size: 14px; }
  .GameList .game-details-return .t-button { min-width: 72px; min-height: 36px; height: 36px; }
}

/* GP_GLOBAL_LIST_PRESENTATION: spacing only for multi-row tables; keep column alignment. */
.admin-content .gp-list-table:not([data-gp-specialized='true']) :is(thead > tr > th, tbody > tr > td) {
  height: 48px;
  padding: 12px 14px !important;
  vertical-align: middle;
  font-size: 14px;
  line-height: 24px;
}
.admin-content .gp-list-table[data-gp-single='true'] {
  --gp-detail-label-width: 78px;
  width: 100%; min-width: 0; max-width: 100%; overflow: hidden;
}
.admin-content .gp-list-table[data-gp-single='true'] :is(.t-table__content, table, tbody) {
  display: block !important; width: 100% !important; min-width: 0 !important;
  max-width: 100%; height: auto !important; max-height: none !important; overflow: visible !important;
}
.admin-content .gp-list-table[data-gp-single='true'] .t-table__content { overflow-x: clip !important; touch-action: pan-y pinch-zoom; }
.admin-content .gp-list-table[data-gp-single='true'] table { table-layout: auto !important; }
.admin-content .gp-list-table[data-gp-single='true'] :is(colgroup, thead) { display: none !important; }
.admin-content .gp-list-table[data-gp-single='true'] tbody > tr {
  display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100% !important; min-width: 0 !important;
}
.admin-content .gp-list-table[data-gp-single='true'] tbody > tr > td {
  position: relative !important; inset: auto !important; display: block !important;
  width: auto !important; min-width: 0 !important; max-width: 100%; height: auto;
  min-height: 56px; padding: 14px 24px 14px calc(24px + var(--gp-detail-label-width) + 20px) !important;
  white-space: normal !important; overflow: visible !important; overflow-wrap: anywhere !important;
  word-break: break-word; border-color: var(--admin-border); box-shadow: none !important;
}
.admin-content .gp-list-table[data-gp-single='true'] td::before {
  content: attr(data-gp-label); position: absolute; inset-inline-start: 24px;
  top: 50%; transform: translateY(-50%); width: var(--gp-detail-label-width);
  color: var(--admin-muted); font-size: 14px; line-height: 22px; font-weight: 400;
  text-align: justify; text-align-last: justify; white-space: normal; overflow-wrap: anywhere;
}
.admin-content .gp-list-table[data-gp-single='true'] td::after { display: none !important; }
.admin-content .gp-list-table[data-gp-single='true'] td[data-gp-wide='true'],
.admin-content .gp-list-table[data-gp-single='true'] td:last-child:nth-child(odd) { grid-column: 1 / -1; }
.admin-content .gp-list-table[data-gp-single='true'] td > * { min-width: 0; max-width: 100%; }
.admin-content .gp-list-table[data-gp-single='true'] :is(.t-table__cell-ellipsis, .copy-id, .copy-id__value, .copy-id__button) {
  white-space: normal !important; overflow-wrap: anywhere !important; word-break: break-word;
  max-width: 100%; height: auto; overflow: visible !important;
}
.admin-content .gp-list-table[data-gp-single='true'] :is(.copy-id, .copy-id__button) {
  display: inline-block; width: auto; min-width: 0; margin: 0;
}
.admin-content .gp-list-table[data-gp-single='true'] .copy-id__value { padding: 0; }
.admin-content .gp-list-table[data-gp-single='true'] td[data-gp-operation='true'] { text-align: right; }
.admin-content .gp-list-table[data-gp-single='true'] td[data-gp-operation='true'] > :is(div, .t-space) { justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.admin-content .gp-list-table[data-gp-single='true'] td[data-gp-operation='true'] .t-button {
  min-width: 72px; min-height: 36px; height: 36px; padding-inline: 14px;
  margin: 4px 0 4px 8px; border-radius: 6px;
}
.admin-content .gp-list-return {
  display: flex; justify-content: flex-end; align-items: center;
  padding: 12px 24px; margin-top: -1px; border: 1px solid var(--admin-border);
  border-radius: 0 0 8px 8px; background: var(--admin-surface, #fff);
}
.admin-content .gp-list-return .t-button { min-width: 72px; min-height: 36px; border-radius: 6px; cursor: pointer; }
.admin-content .gp-list-table:has(+ .gp-list-return) { border-end-start-radius: 0; border-end-end-radius: 0; }
.admin-content .t-pagination[data-gp-single-page='true'] { display: none !important; }
/* The shared loader stays mounted; hide only the empty table underneath it. */
.admin-content:has(> .admin-page-load-overlay) .gp-list-table:has(.t-table__empty-row) {
  border-color: transparent; box-shadow: none; background: transparent;
}
.admin-content:has(> .admin-page-load-overlay) .gp-list-table:has(.t-table__empty-row) :is(thead, .t-table__empty-row) { visibility: hidden; }
@media (max-width: 768px) {
  .admin-content .gp-list-table[data-gp-single='true'] { --gp-detail-label-width: 64px; }
  .admin-content .gp-list-table[data-gp-single='true'] tbody > tr { grid-template-columns: minmax(0, 1fr); }
  .admin-content .gp-list-table[data-gp-single='true'] tbody > tr > td {
    grid-column: 1; min-height: 48px; padding: 10px 14px 10px calc(14px + var(--gp-detail-label-width) + 12px) !important;
    font-size: 13px; line-height: 22px;
  }
  .admin-content .gp-list-table[data-gp-single='true'] td::before { inset-inline-start: 14px; width: 4em; font-size: 13px; }
  .admin-content .gp-list-table[data-gp-single='true'] td[data-gp-long-label='true']::before { width: 64px; font-size: 12px; line-height: 20px; }
  .admin-content .gp-list-table[data-gp-single='true'] td[data-gp-operation='true'] .t-button { min-width: 64px; min-height: 44px; height: 44px; }
  .admin-content .gp-list-return { padding: 10px 14px; }
  .admin-content .gp-list-return .t-button { min-width: 64px; min-height: 44px; }
}

/* GP_FIXED_DIALOG_FRAME: freeze the outside; scroll only long dialog content. */
html:has(.t-dialog__ctx--fixed.t-is-visible),
body:has(.t-dialog__ctx--fixed.t-is-visible) { overflow: hidden !important; overscroll-behavior: none; }
.t-dialog__ctx--fixed .t-dialog__wrap { overflow: hidden !important; overscroll-behavior: none; }
.t-dialog__ctx--fixed .t-dialog__position {
  --gp-dialog-gutter: clamp(14px, 6vh, 64px);
  height: 100%; min-height: 0; overflow: hidden;
  padding-block: var(--gp-dialog-gutter) !important;
}
.t-dialog__ctx--fixed .t-dialog__position > .t-dialog {
  display: flex; flex-direction: column; min-height: 0;
  max-height: calc(100vh - 2 * var(--gp-dialog-gutter));
  max-height: calc(100dvh - 2 * var(--gp-dialog-gutter));
  margin-block: 0 !important; overflow: hidden;
}
.t-dialog__ctx--fixed .t-dialog > :is(.t-dialog__header, .t-dialog__footer) { flex: 0 0 auto; }
.t-dialog__ctx--fixed .t-dialog > .t-dialog__body {
  flex: 1 1 auto; min-height: 0; height: auto !important; max-height: none !important;
  overflow-x: hidden !important; overflow-y: auto !important;
  overscroll-behavior-y: contain; touch-action: pan-y pinch-zoom;
}
.t-dialog__ctx--fixed .t-dialog__position_fullscreen { height: 100%; min-height: 0; overflow: hidden; }
.t-dialog__ctx--fixed .t-dialog__fullscreen {
  display: flex; flex-direction: column; height: 100vh !important; height: 100dvh !important;
  max-height: 100vh !important; max-height: 100dvh !important;
  min-height: 0; margin: 0 !important; overflow: hidden;
}
.t-dialog__ctx--fixed .code-result-dialog > .t-dialog__body { overflow: hidden !important; }
.t-dialog .auth-rule-panel, .t-dialog .rule-card { min-width: 0; max-width: 100%; }
.t-dialog .rule-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)) !important; }
.t-dialog .delete-warning { white-space: nowrap; font-size: 14px; }
@media (max-width: 360px) { .t-dialog .delete-warning { font-size: 12px; } }
/* Existing role-specific metrics fill complete rows, including the 8-card distributor view. */
.dashboard-page .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
@container dashboard-statistics (min-width: 840px) {
  .dashboard-page .dashboard-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
}
@container dashboard-statistics (min-width: 1320px) {
  .dashboard-page .dashboard-grid:has(> .metric-card:nth-child(12):last-child) { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; }
}
@supports not (container-type: inline-size) {
  @media (min-width: 1200px) { .dashboard-page .dashboard-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; } }
  @media (min-width: 1600px) { .dashboard-page .dashboard-grid:has(> .metric-card:nth-child(12):last-child) { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; } }
}

/* GP_SINGLE_CARD_ALIGNMENT: original multi-row alignment is intentionally untouched. */
.admin-content .gp-list-table[data-gp-single='true'] { --gp-detail-label-width: 76px; }
.admin-content .gp-list-table[data-gp-single='true'] tbody > tr > td {
  display: flex !important; flex-direction: column;
  justify-content: center; align-items: flex-start; text-align: left !important;
}
.admin-content .gp-list-table[data-gp-single='true'] td :is(.copy-id, .copy-id__button, .copy-id__value) {
  text-align: left !important; justify-content: flex-start;
}
.admin-content .gp-list-table[data-gp-single='true'] td > .ticket-copy { width: 100%; }
.admin-content .gp-list-table[data-gp-single='true'] .ticket-value { height: auto; max-height: none; overflow: visible; }
.admin-content .gp-list-table[data-gp-single='true'] td[data-gp-operation='true'] {
  flex-direction: row; align-items: center; justify-content: flex-end; flex-wrap: wrap;
}
.admin-content .gp-list-table[data-gp-card='true'] td[data-gp-operation='true'] { gap: 8px !important; }
.admin-content .gp-list-table[data-gp-card='true'] td[data-gp-operation='true'] > :is(.t-space, .operation-buttons, .action-buttons, .distributor-actions) {
  display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px;
}
.admin-content .gp-list-table[data-gp-card='true'] .gp-list-return-button {
  flex-shrink: 0; order: 99; min-width: 72px; height: 36px; min-height: 36px;
  padding-inline: 14px; border-radius: 6px; cursor: pointer;
}
.GameList .operation-buttons > [aria-label='返回游戏列表'] { order: 99; }
.admin-content .gp-list-return { align-items: center; gap: 20px; }
.admin-content .gp-list-return-label {
  width: 76px; flex: 0 0 76px; margin-inline-end: auto; color: var(--admin-muted);
  font-size: 14px; text-align: justify; text-align-last: justify;
}
@media (max-width: 768px) {
  .admin-content .gp-list-table[data-gp-single='true'] { --gp-detail-label-width: 64px; }
  .admin-content .gp-list-table[data-gp-card='true'] .gp-list-return-button { min-width: 64px; height: 44px; min-height: 44px; }
  .admin-content .gp-list-return-label { width: 4em; flex-basis: 4em; font-size: 13px; }
}
@media (max-width: 360px) {
  .admin-content .gp-list-table[data-gp-card='true'] td[data-gp-operation='true'] .gp-list-return-button { min-width: 56px !important; padding-inline: 12px !important; }
}

/* GP_STEAM_HINT_INSET: match the form's existing 100px label column for both roles. */
.t-dialog .steam-binding-hint {
  margin-inline-start: 100px !important;
  margin-inline-end: 0 !important;
  text-align: left !important;
}
@media (max-width: 768px) {
  .t-dialog .steam-binding-hint { margin-inline-start: 0 !important; }
}
/* GP_GAME_LIST_NAMED_CENTERS: multi-row tables only; preserve single-card geometry. */
.GameList .page-content > .t-table:has(tbody > tr:nth-child(2)) th:is([data-colkey='gameid'], [data-colkey='types'], [data-colkey='category'], [data-colkey='djiami'], [data-colkey='operation']),
.GameList .page-content > .t-table:has(tbody > tr:nth-child(2)) th:is([data-colkey='gameid'], [data-colkey='types'], [data-colkey='category'], [data-colkey='djiami'], [data-colkey='operation']) .t-table__th-cell-inner {
  text-align: center !important;
  vertical-align: middle;
}
.GameList .page-content > .t-table:has(tbody > tr:nth-child(2)) th:is([data-colkey='gameid'], [data-colkey='types'], [data-colkey='category'], [data-colkey='djiami'], [data-colkey='operation']) .t-table__th-cell-inner { display: flex; align-items: center; justify-content: center; width: 100% !important; }
.GameList .page-content > .t-table:has(tbody > tr:nth-child(2)) tbody > tr > td:first-child,
.GameList .page-content > .t-table:has(tbody > tr:nth-child(2)):has(th[data-colkey='postTime']) tbody > tr > td:is(:nth-child(6), :nth-child(7), :nth-child(8), :nth-child(10)),
.GameList .page-content > .t-table:has(tbody > tr:nth-child(2)):not(:has(th[data-colkey='postTime'])) tbody > tr > td:is(:nth-child(5), :nth-child(6), :nth-child(7)) {
  text-align: center !important;
  vertical-align: middle;
}
.GameList .page-content > .t-table:has(tbody > tr:nth-child(2)) .operation-buttons { justify-content: center; }

/* GP_TICKET_PAGE_FRAME: keep toolbar/search/pagination in the viewport. */
.admin-content:has(> .game-tickets-page) {
  height: calc(100vh - var(--admin-header-height));
  height: calc(100dvh - var(--admin-header-height));
  min-height: 0; overflow: hidden;
}
.admin-content > .game-tickets-page {
  height: 100%; min-height: 0; max-height: 100%; padding: 0 !important;
}
.admin-content .game-tickets-page > .el-container {
  display: flex; flex-direction: column; height: 100%; min-height: 0;
}
.admin-content .game-tickets-page > .el-container > .el-header { flex: 0 0 auto; }
.admin-content .game-tickets-page > .el-container > .el-main {
  display: flex; flex-direction: column; flex: 1 1 0%; min-height: 0; overflow: hidden;
}
.admin-content .game-tickets-page .el-main > :is(.t-input__wrap, .t-pagination, .gp-list-return) { flex: 0 0 auto; }
.admin-content .game-tickets-page .game-ticket-table {
  display: flex; flex-direction: column; flex: 1 1 0%; min-height: 0 !important;
}
.admin-content .game-tickets-page .game-ticket-table > .t-table__content {
  flex: 1 1 0%; min-height: 0 !important; max-height: 100% !important;
  overflow-x: auto !important; overflow-y: auto !important;
  overscroll-behavior: contain;
}
.admin-content .game-tickets-page .game-ticket-table[data-gp-single='true'] > .t-table__content { overflow-x: hidden !important; }
.admin-content .game-tickets-page .game-ticket-table thead > tr > th {
  position: sticky; top: 0; z-index: 2; background: var(--td-table-header-bg-color, #f8fafc);
}
.admin-content .game-tickets-page .game-ticket-table > :not(.t-table__content) { flex: 0 0 auto; }

/* GP_CENTERED_DIALOGS_MOBILE_BANNER: centered frames, bounded bodies, mobile copy feedback. */
.t-dialog__ctx--fixed .t-dialog__position {
  box-sizing: border-box;
  align-items: center !important;
  justify-content: center !important;
}
.t-dialog__ctx--fixed .t-dialog__position:has(> .code-result-dialog) {
  padding-block: var(--gp-dialog-gutter) !important;
}
@media (max-width: 768px) {
  .t-dialog__ctx--fixed .t-dialog__position:has(> .code-result-dialog) {
    --gp-dialog-gutter: calc(60px + env(safe-area-inset-top, 0px));
  }
  .Vue-Toastification__container.top-right:has(.code-copy-success-toast) {
    inset: 0 0 auto;
    width: 100%; max-width: 100%; min-height: 0;
    margin: 0; padding: 0;
  }
  .Vue-Toastification__toast.code-copy-success-toast {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) 24px;
    align-items: center; gap: 12px;
    width: 100%; min-width: 0; max-width: 100%; min-height: 56px;
    margin: 0 0 8px;
    padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 14px;
    border-radius: 0; background: #4caf50; color: #fff;
    touch-action: pan-y pinch-zoom;
  }
  .code-copy-success-toast .Vue-Toastification__toast-body {
    grid-column: 2; text-align: center;
    font-size: 14px; line-height: 24px;
  }
  .code-copy-success-toast .Vue-Toastification__icon {
    grid-column: 1; width: 24px; height: 24px; margin: 0;
  }
  .code-copy-success-toast .Vue-Toastification__close-button {
    grid-column: 3; width: 24px; height: 24px; margin: 0; padding: 0;
    opacity: .8;
  }
  .code-copy-success-toast .Vue-Toastification__progress-bar { display: none; }
  .code-copy-success-toast.Vue-Toastification__bounce-enter-active {
    animation: gp-code-banner-in 300ms cubic-bezier(.22, 1, .36, 1) both !important;
  }
  .code-copy-success-toast.Vue-Toastification__bounce-leave-active:not(.disable-transition) {
    animation: gp-code-banner-out 220ms ease-in both !important;
  }
}
@keyframes gp-code-banner-in {
  from { opacity: 0; transform: translateY(-100%); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes gp-code-banner-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-100%); }
}
@media (prefers-reduced-motion: reduce) {
  .code-copy-success-toast.Vue-Toastification__bounce-enter-active,
  .code-copy-success-toast.Vue-Toastification__bounce-leave-active:not(.disable-transition) { animation-duration: 1ms !important; }
}
/* GP_TICKET_THREE_LINE_PREVIEW: preserve full content and copy handlers. */
.game-tickets-page .game-ticket-table:not([data-gp-single='true']) .ticket-value {
  line-height: 20px; height: 60px; max-height: 60px; overflow: auto;
}
/* Ordinary game lists retain their original edit/delete order; single cards retain delete/edit/return. */
.GameList .page-content > .t-table:has(tbody > tr:nth-child(2)) .operation-buttons > .t-button--theme-danger { order: 1; }

/* GP_DEPOTS_COLUMN_ALIGNMENT: only named multi-row depot columns share a center line. */
.DepotsManagement .gp-list-table:not([data-gp-single='true']) th:is([data-colkey='manifasetid'], [data-colkey='storage'], :last-child),
.DepotsManagement .gp-list-table:not([data-gp-single='true']) tbody > tr > td:is(:nth-child(5), :nth-child(7), :nth-child(8)) {
  text-align: center !important;
  vertical-align: middle;
}

/* GP_MOBILE_COPY_BANNER_LIFETIME: invisible progress still drives the toast's timeout. */
.code-copy-success-toast .Vue-Toastification__close-button { display: none; }
@media (max-width: 768px) {
  .code-copy-success-toast .Vue-Toastification__progress-bar {
    display: block !important;
    opacity: 0 !important;
    pointer-events: none;
  }
}
/* GP_CODE_RECORDS_LEADING_GUTTER: inset only the ordinary multi-record code column. */
.code-records-table:has(tbody > tr:nth-child(2)) :is(thead > tr > th:first-child, tbody > tr > td:first-child) {
  padding-inline-start: 14px !important;
}

/* GP_CODE_USER_PHONE_ALIGNMENT: reserve the country-code slot without changing account data. */
.code-records-table:has(tbody > tr:nth-child(2)) .code-record-user--local-phone .copy-id__value::before {
  content: '+86';
  visibility: hidden;
}
