/* 自 game1-admin.html 抽出的樣式（後台 Blazor 化批次 2026-08-24）：類名沿用，Blazor 頁零改版直接套 */

    :root {
      color-scheme: light;
      --page: #f4f6f8;
      --surface: #ffffff;
      --surface-2: #f9fafb;
      --ink: #1f2933;
      --muted: #667085;
      --line: #d8dee6;
      --brand: #2563eb;
      --brand-2: #0f766e;
      --warning: #a15c07;
      --warning-bg: #fff7e8;
      --danger: #b42318;
      --danger-bg: #fff0ed;
      --ok: #087443;
      --ok-bg: #eaf8f1;
      --shadow: 0 18px 50px rgba(31, 41, 51, .08);
      font-family: "Segoe UI", "Noto Sans TC", system-ui, sans-serif;
    }

    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      min-height: 100vh;
      background: var(--page);
      color: var(--ink);
    }

    button,
    input,
    select {
      font: inherit;
    }

    a {
      color: inherit;
    }

    .app {
      display: grid;
      grid-template-columns: 256px minmax(0, 1fr);
      min-height: 100vh;
    }

    .sidebar {
      background: #111827;
      color: #f8fafc;
      padding: 20px 14px;
      display: flex;
      flex-direction: column;
      gap: 18px;
      position: sticky;
      top: 0;
      height: 100vh;
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 8px 10px 14px;
      border-bottom: 1px solid rgba(255, 255, 255, .12);
    }

    .brand-mark {
      width: 36px;
      height: 36px;
      border-radius: 8px;
      background: #2563eb;
      display: grid;
      place-items: center;
      font-weight: 800;
      letter-spacing: 0;
      flex: 0 0 auto;
    }

    .brand-title {
      font-weight: 800;
      line-height: 1.15;
    }

    .brand-subtitle {
      margin-top: 2px;
      color: #bac4d0;
      font-size: 12px;
    }

    .nav {
      display: grid;
      gap: 4px;
    }

    .nav-button {
      border: 0;
      width: 100%;
      border-radius: 7px;
      min-height: 42px;
      padding: 0 10px;
      background: transparent;
      color: #d8dee8;
      display: grid;
      grid-template-columns: 20px 1fr auto;
      gap: 10px;
      align-items: center;
      text-align: left;
      cursor: pointer;
      text-decoration: none;
    }

    .nav-button:hover,
    .nav-button.active {
      background: rgba(255, 255, 255, .1);
      color: #ffffff;
    }

    .nav-badge {
      min-width: 26px;
      height: 20px;
      padding: 0 6px;
      border-radius: 999px;
      display: inline-grid;
      place-items: center;
      background: rgba(255, 255, 255, .14);
      color: #ffffff;
      font-size: 12px;
      font-weight: 750;
    }

    .sidebar-foot {
      margin-top: auto;
      display: grid;
      gap: 8px;
      padding: 12px 10px 0;
      color: #bac4d0;
      font-size: 12px;
      line-height: 1.5;
      border-top: 1px solid rgba(255, 255, 255, .12);
    }

    .content {
      min-width: 0;
      display: grid;
      grid-template-rows: auto 1fr;
    }

    .topbar {
      min-height: 70px;
      background: rgba(255, 255, 255, .92);
      border-bottom: 1px solid var(--line);
      backdrop-filter: blur(10px);
      position: sticky;
      top: 0;
      z-index: 5;
      padding: 12px 26px;
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 18px;
      align-items: center;
    }

    .topbar h1 {
      margin: 0;
      font-size: 23px;
      line-height: 1.25;
      letter-spacing: 0;
    }

    .topbar-meta {
      color: var(--muted);
      font-size: 13px;
      margin-top: 4px;
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
    }

    .topbar-actions {
      display: flex;
      gap: 8px;
      justify-content: flex-end;
      align-items: center;
      flex-wrap: wrap;
    }

    .main {
      padding: 24px 26px 36px;
      display: grid;
      gap: 22px;
      align-content: start;
    }

    .section {
      display: none;
      gap: 22px;
    }

    .section.active {
      display: grid;
    }

    .section-head {
      display: flex;
      align-items: flex-end;
      justify-content: space-between;
      gap: 14px;
      flex-wrap: wrap;
    }

    .section-title {
      margin: 0;
      font-size: 20px;
      line-height: 1.25;
      letter-spacing: 0;
    }

    .section-meta {
      margin-top: 5px;
      color: var(--muted);
      font-size: 13px;
      line-height: 1.5;
    }

    .button {
      min-height: 38px;
      border: 1px solid var(--line);
      border-radius: 7px;
      background: var(--surface);
      color: var(--ink);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      padding: 0 12px;
      cursor: pointer;
      text-decoration: none;
      white-space: nowrap;
      font-weight: 650;
    }

    .button:hover {
      border-color: #a9b4c1;
      background: var(--surface-2);
    }

    .button.primary {
      background: var(--brand);
      border-color: var(--brand);
      color: #ffffff;
    }

    .button.primary:hover {
      background: #1d4ed8;
      border-color: #1d4ed8;
    }

    .button.danger {
      background: var(--danger-bg);
      border-color: #f3b4ab;
      color: var(--danger);
    }

    .button.icon-only {
      width: 38px;
      padding: 0;
    }

    .button:disabled {
      opacity: .55;
      cursor: wait;
    }

    .icon {
      width: 17px;
      height: 17px;
      flex: 0 0 auto;
      display: inline-block;
    }

    .metric-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(150px, 1fr));
      gap: 12px;
    }

    .metric-card,
    .module-card,
    .panel,
    .link-card {
      background: var(--surface);
      border: 1px solid var(--line);
      border-radius: 8px;
      box-shadow: var(--shadow);
    }

    .metric-card {
      min-height: 112px;
      padding: 16px;
      display: grid;
      align-content: space-between;
      gap: 12px;
    }

    .metric-label {
      color: var(--muted);
      font-size: 13px;
      line-height: 1.35;
    }

    .metric-value {
      font-size: 28px;
      line-height: 1;
      font-weight: 800;
      letter-spacing: 0;
    }

    .metric-foot {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.35;
      overflow-wrap: anywhere;
    }

    .module-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(190px, 1fr));
      gap: 12px;
    }

    .module-card {
      min-height: 124px;
      padding: 16px;
      display: grid;
      grid-template-rows: auto 1fr auto;
      gap: 12px;
      text-decoration: none;
      color: inherit;
    }

    button.module-card {
      width: 100%;
      text-align: left;
      cursor: pointer;
    }

    .module-card:hover {
      border-color: #a9b4c1;
    }

    .module-top {
      display: flex;
      justify-content: space-between;
      gap: 10px;
      align-items: flex-start;
    }

    .module-title {
      font-weight: 800;
      line-height: 1.3;
    }

    .module-path {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.5;
      overflow-wrap: anywhere;
    }

    .chip {
      min-height: 24px;
      padding: 3px 8px;
      border-radius: 999px;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      background: #eef2ff;
      color: #3730a3;
      font-size: 12px;
      font-weight: 750;
      white-space: nowrap;
    }

    .chip.ok {
      background: var(--ok-bg);
      color: var(--ok);
    }

    .chip.warn {
      background: var(--warning-bg);
      color: var(--warning);
    }

    .chip.danger {
      background: var(--danger-bg);
      color: var(--danger);
    }

    .panel {
      overflow: hidden;
    }

    .panel-head {
      min-height: 58px;
      padding: 12px 16px;
      border-bottom: 1px solid var(--line);
      display: flex;
      justify-content: space-between;
      gap: 12px;
      align-items: center;
      flex-wrap: wrap;
    }

    .panel-title {
      margin: 0;
      font-size: 16px;
      line-height: 1.35;
      font-weight: 800;
    }

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

    .panel-body {
      padding: 16px;
    }

    .status-line {
      min-height: 40px;
      border: 1px solid var(--line);
      border-radius: 7px;
      background: var(--surface);
      padding: 9px 12px;
      color: var(--muted);
      display: flex;
      justify-content: space-between;
      gap: 12px;
      align-items: center;
      flex-wrap: wrap;
      font-size: 13px;
      line-height: 1.4;
    }

    .status-line strong {
      color: var(--ink);
    }

    .status-line.error {
      color: var(--danger);
      background: var(--danger-bg);
      border-color: #f3b4ab;
    }

    .toolbar {
      display: grid;
      grid-template-columns: minmax(220px, 1fr) auto auto;
      gap: 8px;
      align-items: center;
      margin-bottom: 12px;
    }

    .search-box {
      position: relative;
    }

    .search-box svg {
      position: absolute;
      left: 12px;
      top: 50%;
      transform: translateY(-50%);
      color: var(--muted);
      pointer-events: none;
    }

    .search-box input {
      width: 100%;
      min-height: 38px;
      padding: 0 12px 0 38px;
      border: 1px solid var(--line);
      border-radius: 7px;
      color: var(--ink);
      background: var(--surface);
    }

    select {
      min-height: 38px;
      padding: 0 34px 0 10px;
      border: 1px solid var(--line);
      border-radius: 7px;
      color: var(--ink);
      background: var(--surface);
    }

    textarea {
      width: 100%;
      min-height: 110px;
      resize: vertical;
      padding: 10px 12px;
      border: 1px solid var(--line);
      border-radius: 7px;
      color: var(--ink);
      background: var(--surface);
      line-height: 1.5;
      font: inherit;
    }

    .form-grid {
      display: grid;
      gap: 14px;
    }

    .field {
      display: grid;
      gap: 6px;
    }

    .field input {
      width: 100%;
      min-height: 38px;
      padding: 0 10px;
      border: 1px solid var(--line);
      border-radius: 7px;
      color: var(--ink);
      background: var(--surface);
    }

    .field-hint {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.45;
    }

    .segmented {
      display: inline-grid;
      grid-template-columns: repeat(2, minmax(120px, 1fr));
      gap: 6px;
      padding: 4px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--surface-2);
    }

    .segmented button {
      min-height: 34px;
      border: 0;
      border-radius: 6px;
      background: transparent;
      color: var(--muted);
      cursor: pointer;
      font-weight: 750;
    }

    .segmented button.active {
      background: var(--surface);
      color: var(--ink);
      box-shadow: 0 2px 8px rgba(31, 41, 51, .08);
    }

    /* 玩家詳情四頁籤（Players.razor）：沿用 segmented 外觀，欄數放到 4 */
    .segmented.tabs {
      grid-template-columns: repeat(4, minmax(96px, 1fr));
    }

    .reward-list {
      display: grid;
      gap: 8px;
    }

    .reward-row {
      display: grid;
      grid-template-columns: minmax(120px, 1fr) minmax(100px, 140px) 38px;
      gap: 8px;
      align-items: center;
    }

    .reward-row input {
      min-height: 38px;
      padding: 0 10px;
      border: 1px solid var(--line);
      border-radius: 7px;
    }

    .result-box {
      min-height: 44px;
      border: 1px solid var(--line);
      border-radius: 7px;
      background: var(--surface-2);
      color: var(--muted);
      padding: 10px 12px;
      line-height: 1.5;
      overflow-wrap: anywhere;
    }

    .result-box.ok {
      color: var(--ok);
      background: var(--ok-bg);
      border-color: #a4d9bd;
    }

    .result-box.error {
      color: var(--danger);
      background: var(--danger-bg);
      border-color: #f3b4ab;
    }

    .table-wrap {
      overflow-x: auto;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--surface);
    }

    table {
      width: 100%;
      border-collapse: collapse;
      table-layout: fixed;
    }

    th,
    td {
      padding: 12px 14px;
      text-align: left;
      border-bottom: 1px solid var(--line);
      vertical-align: top;
      font-size: 14px;
      line-height: 1.5;
    }

    th {
      color: #364152;
      background: #eef2f6;
      font-size: 12px;
      text-transform: uppercase;
      font-weight: 800;
      letter-spacing: 0;
    }

    tr:last-child td {
      border-bottom: 0;
    }

    .col-time {
      width: 176px;
    }

    .col-email {
      width: 230px;
    }

    .col-playfab {
      width: 190px;
    }

    .col-action {
      width: 170px;
    }

    .col-name {
      width: 150px;
    }

    .col-del {
      width: 90px;
    }

    .col-sort {
      width: 64px;
    }

    .col-state {
      width: 96px;
    }

    .col-window {
      width: 240px;
    }

    .notice-title {
      font-weight: 750;
      overflow-wrap: anywhere;
    }

    .notice-body {
      color: var(--muted);
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
      white-space: pre-wrap;
      overflow-wrap: anywhere;
      font-size: 13px;
      margin-top: 4px;
    }

    .window-time {
      font-size: 13px;
      color: var(--muted);
    }

    .field-row {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px;
    }

    .switch-row {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .switch-row input {
      width: 18px;
      height: 18px;
      min-height: 0;
      accent-color: var(--brand);
    }

    .preview-card {
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--surface-2);
      padding: 14px;
    }

    .preview-card + .preview-card {
      margin-top: 10px;
    }

    .preview-title {
      font-weight: 800;
      margin-bottom: 6px;
    }

    .preview-body {
      white-space: pre-wrap;
      overflow-wrap: anywhere;
      line-height: 1.6;
      font-size: 14px;
    }

    .email,
    .playfab,
    .code {
      overflow-wrap: anywhere;
      color: #1d4f91;
      font-weight: 700;
    }

    .problem {
      display: -webkit-box;
      -webkit-line-clamp: 3;
      -webkit-box-orient: vertical;
      overflow: hidden;
      white-space: pre-wrap;
      overflow-wrap: anywhere;
    }

    .row-actions {
      display: flex;
      gap: 6px;
      justify-content: flex-end;
    }

    .empty {
      min-height: 158px;
      display: grid;
      place-items: center;
      color: var(--muted);
      text-align: center;
      padding: 28px;
    }

    .empty[hidden] {
      display: none;
    }

    .list {
      display: grid;
      gap: 10px;
    }

    .link-card {
      padding: 14px;
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 10px;
      align-items: center;
      text-decoration: none;
    }

    .link-card:hover {
      border-color: #a9b4c1;
    }

    .link-title {
      font-weight: 800;
      line-height: 1.3;
    }

    .link-url {
      margin-top: 4px;
      color: var(--muted);
      font-size: 12px;
      overflow-wrap: anywhere;
    }

    .kv-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
    }

    .kv {
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--surface-2);
      padding: 12px;
      min-height: 74px;
    }

    .kv-label {
      color: var(--muted);
      font-size: 12px;
      font-weight: 750;
      margin-bottom: 6px;
    }

    .kv-value {
      overflow-wrap: anywhere;
      font-weight: 750;
      line-height: 1.45;
    }

    /* 活動配置（event）分頁樣式，搬自 event-admin.html */
    .chip.mod {
      background: #f0f9ff;
      color: #075985;
    }

    .col-mods {
      width: 190px;
    }

    .evt-title {
      font-weight: 750;
      overflow-wrap: anywhere;
    }

    .evt-id {
      color: var(--muted);
      font-size: 12px;
      overflow-wrap: anywhere;
      font-family: Consolas, monospace;
    }

    textarea.json {
      font-family: Consolas, "Cascadia Mono", monospace;
      font-size: 13px;
      min-height: 120px;
    }

    .field-row-3 {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 12px;
    }

    .warn-box {
      border: 1px solid #f0d5a8;
      background: var(--warning-bg);
      color: var(--warning);
      border-radius: 7px;
      padding: 10px 12px;
      font-size: 13px;
      line-height: 1.6;
    }

    .section-label {
      font-size: 13px;
      font-weight: 800;
      color: var(--brand);
      border-top: 1px dashed var(--line);
      padding-top: 12px;
    }

    /* 玩家（客服工具）分頁樣式 */
    .detail-stack {
      display: grid;
      gap: 22px;
    }

    .detail-stack[hidden] {
      display: none;
    }

    .row-click {
      cursor: pointer;
    }

    .row-click:hover td {
      background: var(--surface-2);
    }

    .row-click.selected td {
      background: #eaf1ff;
    }

    .ban-box {
      border: 1px solid #f3b4ab;
      background: var(--danger-bg);
      color: var(--danger);
      border-radius: 7px;
      padding: 10px 12px;
      font-size: 13px;
      line-height: 1.6;
      font-weight: 800;
    }

    .ban-box[hidden] {
      display: none;
    }

    .col-player {
      width: 190px;
    }

    .col-key {
      width: 150px;
    }

    .col-num {
      width: 110px;
    }

    /* IAP 驗證分頁樣式 */
    .iap-platform-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 14px;
    }

    .iap-card {
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--surface-2);
      padding: 14px;
      display: grid;
      gap: 12px;
      align-content: start;
    }

    .iap-card-head {
      display: flex;
      justify-content: space-between;
      gap: 10px;
      align-items: center;
      flex-wrap: wrap;
    }

    .iap-card-title {
      margin: 0;
      font-size: 15px;
      line-height: 1.35;
      font-weight: 800;
    }

    .iap-badges {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
    }

    .iap-card .warn-box {
      white-space: pre-wrap;
      overflow-wrap: anywhere;
    }

    .iap-help {
      border: 1px solid var(--line);
      border-radius: 7px;
      background: var(--surface);
      padding: 8px 12px;
      font-size: 13px;
      line-height: 1.6;
    }

    .iap-help summary {
      cursor: pointer;
      font-weight: 750;
      color: var(--brand);
    }

    .iap-help ol {
      margin: 8px 0 0;
      padding-left: 20px;
    }

    .iap-help pre {
      margin: 8px 0 0;
      white-space: pre-wrap;
      overflow-wrap: anywhere;
      font-family: Consolas, "Cascadia Mono", monospace;
      font-size: 12px;
    }

    .iap-toolbar {
      grid-template-columns: minmax(220px, 1fr) auto auto auto auto;
    }

    .iap-summary-grid {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .chip.muted {
      background: #eef2f6;
      color: var(--muted);
    }

    .chip.hold {
      background: #fff1e6;
      color: #b54708;
    }

    .button.small {
      min-height: 28px;
      padding: 0 8px;
      font-size: 12px;
    }

    tr.iap-refunded td {
      background: var(--danger-bg);
    }

    /* table-layout: fixed 下固定欄寬總和若超過表寬，最後一欄會被擠成 0——min-width 必須大於各表固定欄總和 */
    table.iap-wide {
      min-width: 1660px;
    }

    table.iap-mid {
      min-width: 1240px;
    }

    .col-sku {
      width: 190px;
    }

    .col-chip {
      width: 130px;
    }

    dialog {
      border: 1px solid var(--line);
      border-radius: 8px;
      box-shadow: 0 28px 90px rgba(17, 24, 39, .3);
      width: min(760px, calc(100vw - 28px));
      padding: 0;
      color: var(--ink);
    }

    #eventDialog {
      width: min(860px, calc(100vw - 28px));
    }

    #eventDialog .dialog-body {
      max-height: 70vh;
      overflow-y: auto;
    }

    dialog::backdrop {
      background: rgba(17, 24, 39, .5);
    }

    .dialog-head {
      padding: 16px 18px;
      border-bottom: 1px solid var(--line);
      display: flex;
      justify-content: space-between;
      gap: 12px;
      align-items: center;
    }

    .dialog-title {
      margin: 0;
      font-size: 18px;
      line-height: 1.25;
      font-weight: 800;
    }

    .dialog-body {
      padding: 18px;
      display: grid;
      gap: 14px;
    }

    .field-label {
      font-size: 12px;
      font-weight: 800;
      color: var(--muted);
      text-transform: uppercase;
      margin-bottom: 4px;
    }

    .field-value {
      margin: 0;
      white-space: pre-wrap;
      overflow-wrap: anywhere;
      line-height: 1.6;
    }

    .dialog-foot {
      padding: 14px 18px;
      border-top: 1px solid var(--line);
      display: flex;
      justify-content: space-between;
      gap: 8px;
      flex-wrap: wrap;
    }

    .mobile-nav {
      display: none;
    }

    @media (max-width: 1020px) {
      .app {
        grid-template-columns: 1fr;
      }

      .sidebar {
        display: none;
      }

      .mobile-nav {
        display: block;
      }

      .topbar {
        grid-template-columns: 1fr;
        align-items: stretch;
      }

      .topbar-actions {
        justify-content: flex-start;
      }

      .metric-grid,
      .module-grid {
        grid-template-columns: repeat(2, minmax(160px, 1fr));
      }

      .iap-platform-grid {
        grid-template-columns: 1fr;
      }
    }

    @media (max-width: 720px) {
      .topbar,
      .main {
        padding-left: 16px;
        padding-right: 16px;
      }

      .metric-grid,
      .module-grid,
      .kv-grid,
      .field-row,
      .field-row-3,
      .toolbar,
      .iap-toolbar,
      .iap-summary-grid {
        grid-template-columns: 1fr;
      }

      .panel-head,
      .section-head {
        align-items: stretch;
      }

      .panel-actions,
      .topbar-actions {
        width: 100%;
      }

      .button {
        flex: 1 1 auto;
      }

      table {
        min-width: 840px;
      }

      .link-card {
        grid-template-columns: 1fr;
      }
    }
  
/* === Blazor 版追加（後台 Blazor 化批次）=== */
/* NavLink 渲染成 <a>：沿用 .nav-button 的按鈕樣式 */
.nav a.nav-button { text-decoration: none; color: inherit; }
/* 登入畫面 */
.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: min(420px, 92vw); }
.result-box.err { border-color: rgba(248, 113, 113, 0.6); color: #fca5a5; }
/* Blazor 錯誤列（模板預設樣式的深色版） */
#blazor-error-ui { color-scheme: light only; background: #b91c1c; color: #fff; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2); display: none; left: 0; padding: .6rem 1.25rem .7rem 1.25rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }
