/* ------------------------------------------------------------------
   游戏管理（区服 / 角色）
   说明：
   1. 外观与「用户管理 / 订单管理」保持同一套视觉，工具栏、表格、分页条都复用
      同样的尺寸与配色变量；
   2. 分页条铺满表格底部、圆角交给外层 table-shell 裁切，避免出现白色方角；
   3. 全部选择器都以 #game-center 开头，不会影响应用分类下的其他页面。
   ------------------------------------------------------------------ */

/* 「fit」状态：与 style-03.css 里 #member-users/#packages 的 member-management-table-fit 同构，
   高度由 app-defs-routing 的 setSectionViewportHeight 写进变量，表格 10 行按它均分 */
#game-center.section.active.game-center-table-fit {
  /* 和用户管理 / 订单管理一样：由 app-defs-routing 算出可用高度写进变量，
     表格 10 行按这个高度均分，分页条自然贴在底部 */
  display: flex !important;
  flex-direction: column;
  height: var(--game-center-table-viewport-height, var(--admin-first-paint-table-viewport-height));
  min-height: var(--game-center-table-viewport-height, var(--admin-first-paint-table-viewport-height));
  overflow: hidden;
  animation: none !important;
  opacity: 1;
  transform: none !important;
}

#game-center.section.active > #gameCenterMount {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

#game-center .game-center-view {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  background-image: none !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

#game-center .game-center-view > .game-center-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  gap: 0;
  padding: 0 !important;
  background: transparent !important;
}

/* 应用分类下不出现「游戏管理」入口（分类切换由 html[data-admin-app-type] 驱动） */
html[data-admin-app-type="application"] .nav-item[data-section="game-center"] {
  display: none !important;
}

#game-center .game-center-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  padding: 0 !important;
  background: transparent !important;
}

/* ---------- 顶部工具栏（含 区服/角色 切换） ---------- */
#game-center .filters.game-center-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  box-sizing: border-box;
  flex: 0 0 auto;
  min-height: 62px;
  padding: 8px 12px !important;
  margin-bottom: 8px !important;
  border: 1px solid var(--admin-panel-border-soft) !important;
  border-radius: 18px !important;
  background: var(--admin-panel-header-surface, #dbeaf9) !important;
  background-image: var(--admin-panel-header-image, linear-gradient(180deg, #dbeaf9 0%, #c9dff5 100%)) !important;
  background-clip: padding-box !important;
  overflow: visible;
}

#game-center .filters.game-center-toolbar > input {
  box-sizing: border-box;
  height: 44px;
  min-height: 44px;
  flex: 1 1 160px;
  min-width: 130px;
}

#game-center .filters.game-center-toolbar > .form-select,
#game-center .filters.game-center-toolbar > .wb-select {
  box-sizing: border-box;
  flex: 0 0 140px;
}

#game-center .game-center-summary {
  display: inline-flex;
  align-items: center;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
  line-height: 1.4;
  color: var(--admin-panel-text-muted);
  white-space: nowrap;
}

#game-center .game-center-create-btn {
  flex: 0 0 auto;
  margin-left: auto;
  height: 36px;
  white-space: nowrap;
}

/* ---------- 区服 / 角色 切换 ---------- */
#game-center .game-center-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  padding: 3px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

#game-center .game-center-tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--admin-panel-text-muted, #5b6472);
  font-size: 13px;
  line-height: 1;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

#game-center .game-center-tab:hover {
  color: var(--admin-panel-text-strong, #1a1b1c);
}

#game-center .game-center-tab.active {
  background: #ffffff;
  color: var(--wb-theme-accent-text, #1f6fd0);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(15, 45, 80, 0.14);
}

/* ---------- 视图容器 ---------- */
#game-center .game-center-pane {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

/* ---------- 表格外壳 ---------- */
#game-center .game-center-table-shell {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: hidden !important;
  margin-bottom: 0;
  border: 1px solid var(--admin-panel-border-soft);
  /* 底部保持直角：分页条要直接铺到最下面，避免圆角处露出一块白色弧 */
  border-radius: 16px !important;
  background: var(--admin-panel-surface);
  background-image: none;
  box-shadow: none;
}

#game-center .game-center-table-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

#game-center .game-center-table-scroll > table.data-table {
  width: 100%;
  margin: 0;
}

/* 最后一列右侧留出内边距，避免操作按钮贴到表格圆角裁切边缘 */
#game-center .game-center-table-scroll > table.data-table > thead > tr > th:last-child,
#game-center .game-center-table-scroll > table.data-table > tbody > tr > td:last-child {
  padding-right: 18px;
}

/* 行高与其它表格统一：由 app-defs-routing 动态算好写进 --game-center-row-height */
#game-center .game-center-table-scroll > table.data-table > tbody > tr > td {
  height: var(--game-center-row-height, var(--admin-table-row-height));
  max-height: var(--game-center-row-height, var(--admin-table-row-height));
}

/* 时间列不换行 */
#game-center .game-center-table-scroll > table.data-table > tbody > tr > td {
  line-height: 1.5;
}

#game-center .game-center-time-cell {
  white-space: nowrap;
}

/* ---------- 分页条 ---------- */
#game-center .game-center-pagination {
  display: flex;
  flex: 0 0 auto;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  width: 100% !important;
  min-height: var(--admin-table-pagination-height);
  margin: 0 !important;
  padding: var(--admin-table-pagination-padding-y) 0 !important;
  border-top: 1px solid #b0b4bb;
  background: var(--admin-table-bar-surface);
  background-image: var(--admin-table-bar-image);
  border-radius: 0 !important;
  overflow: hidden;
}

#game-center .game-center-pagination-inner {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

/* ---------- 单元格 ---------- */
#game-center .game-center-cell-strong {
  font-weight: 600;
  color: var(--admin-panel-text-strong, #1a1b1c);
}

#game-center .game-center-cell-muted {
  font-size: 12px;
  color: var(--admin-panel-text-muted, #7b8494);
}

#game-center .game-center-ellipsis {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

#game-center .game-center-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  height: 22px;
  padding: 0 8px;
  border-radius: 11px;
  font-size: 12px;
  line-height: 1;
  font-weight: 500;
}

#game-center .game-center-status--normal {
  color: #0f7b34;
  background: rgba(16, 185, 89, 0.14);
}

#game-center .game-center-status--maintenance {
  color: #a35f00;
  background: rgba(245, 158, 11, 0.16);
}

#game-center .game-center-status--new {
  color: #1f6fd0;
  background: rgba(59, 130, 246, 0.16);
}

#game-center .game-center-status--merged {
  color: #5b6472;
  background: rgba(100, 116, 139, 0.14);
}

#game-center .game-center-status--closed {
  color: #b3261e;
  background: rgba(220, 38, 38, 0.13);
}

#game-center .game-center-status--banned {
  color: #b3261e;
  background: rgba(220, 38, 38, 0.13);
}

/* CDK 批次 / 码的状态色 */
#game-center .game-center-status--cdk-active,
#game-center .game-center-status--cdk-code-used {
  color: #0f7b34;
  background: rgba(16, 185, 89, 0.14);
}

#game-center .game-center-status--cdk-paused {
  color: #a35f00;
  background: rgba(245, 158, 11, 0.16);
}

#game-center .game-center-status--cdk-closed,
#game-center .game-center-status--cdk-code-disabled {
  color: #b3261e;
  background: rgba(220, 38, 38, 0.13);
}

#game-center .game-center-status--cdk-code-unused {
  color: #1f6fd0;
  background: rgba(59, 130, 246, 0.16);
}

/* 发货补单状态色 */
#game-center .game-center-status--delivery-pending {
  color: #a35f00;
  background: rgba(245, 158, 11, 0.16);
}

#game-center .game-center-status--delivery-sent {
  color: #0f7b34;
  background: rgba(16, 185, 89, 0.14);
}

#game-center .game-center-status--delivery-failed {
  color: #b3261e;
  background: rgba(220, 38, 38, 0.13);
}

#game-center .game-center-status--delivery-cancelled {
  color: #5b6472;
  background: rgba(100, 116, 139, 0.14);
}

/* 渠道 / 渠道包状态色 */
#game-center .game-center-status--channel-active,
#game-center .game-center-status--package-active {
  color: #0f7b34;
  background: rgba(16, 185, 89, 0.14);
}

#game-center .game-center-status--channel-paused {
  color: #a35f00;
  background: rgba(245, 158, 11, 0.16);
}

#game-center .game-center-status--channel-closed,
#game-center .game-center-status--package-offline {
  color: #5b6472;
  background: rgba(100, 116, 139, 0.14);
}

#game-center .game-center-link {
  color: #1f6fd0;
  text-decoration: none;
}

#game-center .game-center-link:hover {
  text-decoration: underline;
}

/* 道具状态色 */
#game-center .game-center-status--item-active {
  color: #0f7b34;
  background: rgba(16, 185, 89, 0.14);
}

#game-center .game-center-status--item-offline {
  color: #5b6472;
  background: rgba(100, 116, 139, 0.14);
}

/* 合服预览提示 */
#game-center .game-center-merge-preview {
  padding: 10px 12px;
  border: 1px dashed var(--admin-panel-border-soft);
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.06);
  font-size: 13px;
  line-height: 1.7;
  color: var(--admin-panel-text-muted, #5b6472);
}

/* 渠道数据弹窗 */
#modal.app-modal--game-center .game-center-stats-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

#modal.app-modal--game-center .game-center-stats-range {
  appearance: none;
  height: 30px;
  padding: 0 14px;
  border: 1px solid var(--admin-panel-border-soft);
  border-radius: 15px;
  background: #fff;
  color: var(--admin-panel-text-muted, #5b6472);
  font-size: 13px;
  cursor: pointer;
}

#modal.app-modal--game-center .game-center-stats-range.active {
  border-color: transparent;
  background: var(--wb-theme-accent, #2f7cf6);
  color: #fff;
}

.game-center-stats-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.game-center-stats-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--admin-panel-border-soft);
  border-radius: 12px;
  background: var(--admin-panel-surface);
}

.game-center-stats-card > span {
  font-size: 12px;
  color: var(--admin-panel-text-muted, #7b8494);
}

.game-center-stats-card > strong {
  font-size: 18px;
  line-height: 1.2;
  color: var(--admin-panel-text-strong, #1a1b1c);
}

.game-center-stats-money {
  font-size: 16px;
  color: #0f7b34;
}

.game-center-stats-table-wrap {
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--admin-panel-border-soft);
  border-radius: 12px;
}

.game-center-stats-table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  table-layout: fixed;
}

.game-center-stats-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  color: var(--admin-panel-text-strong, #1a1b1c);
  background: var(--admin-panel-header-surface, #dbeaf9);
  border-bottom: 1px solid #b0b4bb;
}

.game-center-stats-table tbody td {
  padding: 9px 10px;
  font-size: 13px;
  text-align: center;
  white-space: nowrap;
  border-bottom: 1px solid var(--admin-panel-border-soft);
}

.game-center-stats-table thead th:first-child,
.game-center-stats-table tbody td:first-child {
  text-align: left;
}

.game-center-stats-table tbody tr:last-child td {
  border-bottom: none;
}

.game-center-stats-empty,
.game-center-stats-loading {
  padding: 28px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--admin-panel-text-muted, #7b8494);
}

/* 弹窗里「输入框 + 按钮」并排 */
#game-center .game-center-inline-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

#game-center .game-center-inline-field > .form-control {
  flex: 1 1 auto;
  min-width: 0;
}

#game-center .game-center-inline-field > .btn-sm {
  flex: 0 0 auto;
  height: 38px;
  white-space: nowrap;
}

#game-center .game-center-cdk-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.4px;
}

#game-center .game-center-cdk-sample {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
  padding: 10px 12px;
  border: 1px solid var(--admin-panel-border-soft);
  border-radius: 12px;
  background: var(--admin-panel-surface);
}

#game-center .game-center-cdk-sample-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#game-center .game-center-cdk-sample-row > code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  letter-spacing: 0.5px;
  color: var(--admin-panel-text-strong, #1a1b1c);
}

#game-center .game-center-back-btn,
#game-center .game-center-export-btn {
  flex: 0 0 auto;
  height: 36px;
  white-space: nowrap;
}

#game-center .game-center-export-btn {
  margin-left: auto;
}

#game-center .game-center-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  flex-wrap: nowrap;
}

#game-center .game-center-actions .btn-sm {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 12px;
  white-space: nowrap;
}

/* ---------- 空态 / 未开通提示 ---------- */
#game-center .game-center-blocked {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 240px;
  padding: 32px;
  border: 1px dashed var(--admin-panel-border-soft);
  border-radius: 16px;
  background: var(--admin-panel-surface);
  text-align: center;
}

#game-center .game-center-blocked-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--admin-panel-text-strong, #1a1b1c);
}

#game-center .game-center-blocked-desc {
  font-size: 13px;
  line-height: 1.6;
  color: var(--admin-panel-text-muted, #7b8494);
  max-width: 460px;
}

/* ---------- 弹窗表单 ---------- */
.game-center-modal-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.game-center-modal-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  margin: 0;
}

.game-center-modal-form .form-group > label {
  font-size: 13px;
  color: var(--admin-panel-text-muted, #5b6472);
}

.game-center-modal-form .form-group--full {
  grid-column: 1 / -1;
}

.game-center-modal-form .form-group .form-control {
  width: 100%;
  box-sizing: border-box;
  height: 38px;
}

.game-center-modal-form .form-group textarea.form-control {
  height: auto;
  min-height: 76px;
  padding: 8px 10px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.7;
}

.game-center-modal-hint {
  font-size: 12px;
  line-height: 1.6;
  color: var(--admin-panel-text-muted, #7b8494);
  margin: 0 0 4px;
}
