:root {
  color-scheme: light;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    sans-serif;
  font-size: 14px;
  color: #263445;
  background: #f3f5f8;
  --bg: #f3f5f8;
  --surface: #ffffff;
  --border: #e4e8ef;
  --muted: #66758a;
  --accent: #2864ad;
  --sidebar: 232px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  border: 1px solid transparent;
  background: #2864ad;
  color: #fff;
  border-radius: 6px;
  padding: 9px 15px;
  cursor: pointer;
  transition: background 0.15s;
}
button:hover {
  background: #20538f;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
button:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 2px solid #2864ad;
  outline-offset: 3px;
}
.secondary {
  background: #edf4ff;
  border-color: var(--border);
  color: #263445;
}
.secondary:hover {
  background: #edf4ff;
}
.quiet {
  background: transparent;
  color: #2864ad;
  padding: 7px 9px;
}
.quiet:hover {
  background: #edf4ff;
}
.muted,
small {
  color: var(--muted);
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 19px;
  line-height: 1.4;
  margin: 1px 0 0;
  font-weight: 650;
}
h2 {
  font-size: 19px;
}
h3 {
  font-size: 16px;
  margin: 20px 0 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 76px;
  padding: 0 22px;
  white-space: nowrap;
}
.brand-mark {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #2864ad;
  color: white;
  font-weight: 800;
  font-size: 23px;
}
.brand-name {
  font-weight: 750;
  font-size: 16px;
  letter-spacing: 1.6px;
}
.brand-name small {
  display: block;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 2px;
  margin-top: 4px;
}
#sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  background: #f7f9fc;
  border-right: 1px solid #e4e8ef;
  z-index: 30;
  display: flex;
  flex-direction: column;
}
#nav {
  padding: 10px 12px;
  overflow-y: auto;
  flex: 1;
}
.nav-group {
  border: 0;
  border-radius: 0;
  margin: 0 0 12px;
  padding: 0;
}
.nav-group > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #66758a;
  font-size: 12px;
  padding: 9px 12px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.nav-group > summary::-webkit-details-marker {
  display: none;
}
.nav-group > summary:after {
  content: none;
  margin-left: auto;
}
.nav-group[open] > summary:after {
  transform: rotate(180deg);
}
.nav-group[open] > summary {
  margin-bottom: 4px;
}
.nav-group > summary:hover {
  background: #edf4ff;
  color: #263445;
}
.nav-icon {
  font-size: 18px;
  width: 18px;
  flex-shrink: 0;
  text-align: center;
}
.nav-items {
  display: grid;
  gap: 3px;
}
.nav-items button {
  text-align: left;
  background: transparent;
  color: #66758a;
  padding: 10px 12px 10px 43px;
  position: relative;
  font-size: 13px;
}
.nav-items button:hover {
  background: #edf4ff;
}
.nav-items button.active {
  background: #edf4ff;
  color: #2864ad;
}
.nav-items button.active:before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 3px;
  background: #2864ad;
}
.aside-bottom {
  border-top: 1px solid #e4e8ef;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 16px 22px;
  white-space: nowrap;
  color: #66758a;
  font-size: 11px;
}
.status-dot {
  height: 6px;
  width: 6px;
  border-radius: 50%;
  background: #6f97cf;
  flex-shrink: 0;
}
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar);
  right: 0;
  height: 64px;
  background: #f7f9fc;
  border-bottom: 1px solid #e4e8ef;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
}
.topbar-start,
.topbar-end {
  display: flex;
  align-items: center;
  gap: 18px;
}
.icon-button {
  background: transparent;
  font-size: 21px;
  color: #66758a;
  padding: 6px 10px;
}
#breadcrumb {
  font-size: 10px;
  letter-spacing: 0.4px;
}
#identity {
  font-size: 12px;
  cursor: pointer;
}
.topbar-end { gap: 16px; min-width: 0; }
#identity { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 4px; font-size: 14px; }
#identity .account-label { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#identity .account-icon, #identity .disclosure-icon { flex-shrink: 0; }
.account-menu {
  border: 0;
  margin: 0;
  padding: 0;
  position: relative;
}
.account-menu[open] summary {
  margin: 0;
}
.account-menu > div {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  display: grid;
  width: 150px;
  padding: 8px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 7px;
  box-shadow: 0 10px 30px #0006;
}
#workspace {
  margin-left: var(--sidebar);
  padding: 88px 28px 28px;
  min-width: 0;
}
#content[aria-busy="true"] {
  cursor: progress;
}
#content[aria-busy="true"] > .table-wrap {
  opacity: 0.7;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 22px;
  margin-bottom: 18px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.cards > .card {
  min-width: 0;
}
.metric {
  font-size: 27px;
  font-weight: 650;
  margin: 14px 0 0;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  background: #f7f9fc;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 16px;
}
.filters > input {
  max-width: 185px;
  flex: 1 1 130px;
  height: 38px;
}
.filters > input[type="date"] {
  min-width: 155px;
}
.filters > button {
  height: 38px;
  white-space: nowrap;
}
.filters > input::placeholder {
  color: #66758a;
  opacity: 1;
}
label {
  display: grid;
  gap: 8px;
  font-size: 12px;
  color: #66758a;
}
input,
textarea,
select {
  width: 100%;
  min-width: 0;
  border: 1px solid #d5dde7;
  border-radius: 5px;
  background: #f7f9fc;
  padding: 9px 11px;
  color: #263445;
}
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #5b8ff980;
  outline-offset: 1px;
  border-color: #2864ad;
}
input:disabled,
select:disabled {
  color: #66758a;
  opacity: 0.7;
}
textarea {
  min-height: 100px;
  resize: vertical;
}
.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  max-height: calc(100vh - 290px);
}
table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: 13px;
  white-space: nowrap;
}
td,
th {
  height: 44px;
  padding: 9px 15px;
  border-bottom: 1px solid #e4e8ef;
  text-align: left;
}
th {
  position: sticky;
  top: 0;
  background: #edf4ff;
  color: #66758a;
  font-weight: 500;
  z-index: 2;
  font-size: 12px;
}
td {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover td {
  background: #edf4ff;
}
.amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
tr > th:first-child:has(+ th),
td.row-actions {
  white-space: nowrap;
}
.row-actions {
  position: sticky;
  right: 0;
  background: #ffffff;
  z-index: 1;
  border-left: 1px solid #e4e8ef;
}
.row-actions button {
  font-size: 12px;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  font-size: 12px;
  color: var(--muted);
}
.error {
  color: #b42332;
}
.good {
  color: #147d55;
}
.badge {
  padding: 5px 9px;
  background: #edf4ff;
  color: #43536a;
  border-radius: 4px;
  font-size: 12px;
}
#notice {
  padding: 12px 16px;
  margin-bottom: 16px;
  border: 1px solid #b5dfcc;
  background: #eaf7f0;
  color: #147d55;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.7;
}
#notice.error {
  border-color: #efc3c6;
  background: #fff1f0;
  color: #b42332;
}
.empty,
.loading {
  padding: 64px 20px;
  text-align: center;
  color: var(--muted);
  background: #f7f9fc;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 20% 10%, #edf4ff, transparent 65%), #f3f5f8;
}
.login-card {
  width: min(440px, 90vw);
  padding: 40px;
  display: grid;
  gap: 20px;
  background: #f7f9fc;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 24px 80px #0004;
}
.login-card .brand {
  padding: 0;
  height: auto;
  color: #2864ad;
}
.login-card h1 {
  font-size: 24px;
}
.login-card p {
  margin: 0;
  color: var(--muted);
}
dialog {
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  width: min(900px, 96vw);
  height: 100dvh;
  max-height: 100dvh;
  max-width: 100vw;
  border: 0;
  border-left: 1px solid #d5dde7;
  border-radius: 0;
  padding: 24px;
  background: #f7f9fc;
  color: #263445;
  box-shadow: -20px 0 70px #0005;
  overflow: auto;
}
dialog::backdrop {
  background: #03081099;
}
.modal-head {
  position: sticky;
  top: -24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  background: #f7f9fc;
  z-index: 5;
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
}
.modal-head h2 {
  margin: 0;
}
#close-modal {
  flex-shrink: 0;
  white-space: nowrap;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.span {
  grid-column: 1/-1;
}
.actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 22px;
}
#modal-body form > .actions,
#modal-body form > button:last-child {
  position: sticky;
  bottom: -24px;
  z-index: 4;
  box-shadow: 0 -10px 20px #f7f9fc;
  margin-top: 20px;
}
#modal-body form > .actions {
  background: #f7f9fc;
  padding: 16px 0;
}
.detail {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 0;
  overflow-wrap: anywhere;
  margin-top: 24px;
}
.detail dt,
.detail dd {
  padding: 12px 0;
  border-bottom: 1px solid #edf4ff;
}
.detail dt {
  color: #66758a;
}
.detail dd {
  margin: 0;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #f7f9fc;
  border: 1px solid #edf4ff;
  padding: 16px;
  border-radius: 6px;
  max-height: 480px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.8;
}
.callout {
  padding: 14px 16px;
  background: #edf4ff;
  border-left: 3px solid #2864ad;
  border-radius: 5px;
  line-height: 1.8;
  margin: 16px 0;
  color: #43536a;
}
details {
  border: 1px solid var(--border);
  border-radius: 7px;
  margin: 16px 0;
  padding: 15px;
}
summary {
  cursor: pointer;
  font-weight: 550;
}
details[open] summary {
  margin-bottom: 16px;
}
meter {
  width: 100%;
  height: 20px;
}
input[type="range"] {
  padding: 0;
  accent-color: #2864ad;
}
.control-scale {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}
.room-switch {
  background: #e4e8ef;
  color: #263445;
  border-radius: 20px;
  min-width: 72px;
  padding: 5px 10px;
  font-size: 12px;
}
.room-switch:before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #66758a;
  margin-right: 8px;
}
.room-switch[aria-checked="true"] {
  background: #eaf7f0;
  color: #147d55;
}
.room-switch[aria-checked="true"]:before {
  background: #147d55;
}
.room-switch:hover {
  filter: brightness(1.15);
}
[hidden] {
  display: none !important;
}
.nav-collapsed {
  --sidebar: 64px;
}
.nav-collapsed .brand {
  padding: 0 15px;
}
.nav-collapsed .brand-name,
.nav-collapsed .sidebar-caption,
.nav-collapsed .nav-label,
.nav-collapsed .nav-group > summary:after {
  display: none;
}
.nav-collapsed #nav {
  overflow: visible;
  padding: 10px 6px;
}
.nav-collapsed .nav-group {
  position: relative;
}
.nav-collapsed .nav-group > summary {
  padding: 12px 16px;
}
.nav-collapsed .nav-items {
  display: none;
}
.nav-collapsed .nav-group[open]:focus-within .nav-items,
.nav-collapsed .nav-group[open]:hover .nav-items {
  display: grid;
  position: absolute;
  left: 54px;
  top: 0;
  min-width: 180px;
  background: #ffffff;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  box-shadow: 0 10px 30px #0005;
}
.nav-collapsed .nav-items button {
  padding: 10px 14px;
}
.nav-collapsed .aside-bottom {
  padding: 20px 29px;
}
@media (max-width: 1100px) {
  #workspace {
    padding: 84px 18px 22px;
  }
  .topbar {
    padding: 0 18px;
  }
  .cards {
    gap: 10px;
  }
  .metric {
    font-size: 22px;
  }
}
@media (max-width: 760px) {
  :root,
  .nav-collapsed {
    --sidebar: 0px;
  }
  #sidebar {
    width: 232px;
    transform: translateX(-100%);
  }
  .nav-open #sidebar {
    transform: none;
  }
  .topbar {
    left: 0;
    padding: 0 12px;
  }
  .topbar-start,
  .topbar-end {
    gap: 8px;
  }
  .topbar { height: 104px; flex-wrap: wrap; align-content: center; gap: 6px; }
  .topbar-start { width: 100%; }
  .topbar-end { width: 100%; justify-content: space-between; }
  #identity .account-label { max-width: 140px; }
  #workspace {
    margin: 0;
    padding: 122px 12px 20px;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .detail {
    grid-template-columns: 1fr;
  }
  .detail dt {
    padding-bottom: 0;
    border: 0;
  }
  .pagination {
    flex-wrap: wrap;
  }
  dialog {
    width: 100vw;
    padding: 18px;
  }
  .modal-head {
    top: -18px;
  }
  .metric {
    font-size: 23px;
  }
  #modal-body form > button:last-child {
    bottom: -18px;
  }
  #nav-backdrop {
    position: fixed;
    inset: 0;
    background: #03081099;
    border: 0;
    border-radius: 0;
    z-index: 25;
  }
  .nav-collapsed .brand {
    padding: 0 22px;
  }
  .nav-collapsed .brand-name,
  .nav-collapsed .sidebar-caption,
  .nav-collapsed .nav-label {
    display: block;
  }
  .nav-collapsed #nav {
    overflow: auto;
    padding: 10px 12px;
  }
  .nav-collapsed .nav-group > summary {
    padding: 9px 12px;
  }
  .nav-collapsed .nav-group[open] .nav-items {
    display: grid;
    position: static;
    box-shadow: none;
    border: 0;
    padding: 0;
    background: transparent;
  }
  .nav-collapsed .nav-items button {
    padding-left: 43px;
  }
  .table-wrap {
    max-height: 65vh;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

th.row-actions {
  z-index: 3;
  background: #edf4ff;
}

.nav-group:has([aria-current="page"]) > summary {
  color: #2864ad;
}

#modal-body form > button:last-child {
  width: 100%;
  padding: 12px 16px;
}

/* Lucide 官方 SVG：统一尺寸、线宽，图标跟随文字颜色。 */
.lucide {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  vertical-align: middle;
  pointer-events: none;
}
button:has(> .lucide) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.nav-group > summary > .nav-icon {
  width: 18px;
  height: 18px;
}
summary {
  list-style: none;
}
summary::-webkit-details-marker {
  display: none;
}
summary > .disclosure-icon {
  float: right;
  margin-left: 12px;
  transition: transform 0.15s;
}
.nav-group > summary > .disclosure-icon {
  margin-left: auto;
}
details[open] > summary > .disclosure-icon {
  transform: rotate(180deg);
}
.nav-collapsed .nav-group > summary > .disclosure-icon {
  display: none;
}
#identity {
  display: flex;
  align-items: center;
  gap: 8px;
}
#toggle-nav .lucide {
  width: 20px;
  height: 20px;
}
@media (max-width: 760px) {
  .nav-collapsed .nav-group > summary > .disclosure-icon {
    display: block;
  }
}

/* 所有滚动区域共用深色轨道和圆角滑块，包括横向滚动条。 */
:root {
  --scrollbar-track: #f7f9fc;
  --scrollbar-thumb: #40516a;
  --scrollbar-hover: #5b7293;
  --scrollbar-active: #7a98c1;
}
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
/* Chromium / Safari 使用相同尺寸，并提供拖动反馈。 */
@supports selector(::-webkit-scrollbar) {
  * {
    scrollbar-width: auto;
    scrollbar-color: auto;
  }
  ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }
  ::-webkit-scrollbar-track,
  ::-webkit-scrollbar-corner {
    background: var(--scrollbar-track);
  }
  ::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border: 2px solid var(--scrollbar-track);
    border-radius: 10px;
    min-height: 32px;
    min-width: 32px;
  }
  ::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-hover);
  }
  ::-webkit-scrollbar-thumb:active {
    background: var(--scrollbar-active);
  }
}
@media (forced-colors: active) {
  * {
    scrollbar-color: auto;
  }
}

/* 系统盈亏和玩家金币变动的负值使用红色，保留原有数字显示。 */
.negative-amount {
  color: #b42332;
}

.positive-amount {
  color: #147d55;
  font-weight: 650;
}

.filters > select { flex: 1 1 155px; max-width: 240px; height: 38px; }
.ops-cards { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.ops-cards .card { margin-bottom: 0; padding: 16px; }
.ops-cards .metric { font-size: 23px; }
.ops-room-summary { display: flex; flex-wrap: wrap; gap: 24px; }
.ops-chart svg { width: 100%; height: auto; max-height: 300px; }
.ops-chart { margin-top: 16px; }
@media(max-width:1000px) { .ops-cards { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media(max-width:500px) { .ops-cards .metric { font-size: 19px; } }

.ops-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.ops-panel{margin:16px 0;min-width:0}.ops-panel h2{font-size:16px;margin:0 0 14px}.ops-echart{height:300px;width:100%}.ops-table-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.ops-cards small{display:block;margin-top:10px}.ops-notes{padding:16px;color:var(--muted,#66758a);font-size:13px}.ops-notes summary{cursor:pointer}.ops-panel th button{white-space:nowrap;padding:0}.ops-panel table{width:100%}@media(max-width:1050px){.ops-grid{grid-template-columns:1fr}}
.ops-compare-controls{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:12px}.ops-compare-controls select{max-width:100%;min-width:130px}.ops-comparison-chart{height:380px}.ops-comparison h2{margin-bottom:10px}
.ops-compare-controls select{width:auto;flex:0 1 190px}.ops-compare-controls select:last-child{flex-basis:260px}@media(max-width:600px){.ops-compare-controls select{flex:1 1 140px}.ops-compare-controls select:last-child{flex-basis:100%}}
.ops-comparison-chart{height:480px}@media(max-width:600px){.ops-comparison-chart{height:360px}}





/* 登录卡片内置本地拼图，图片同比缩放，触屏拖动不会触发页面滚动。 */
.admin-verification[hidden],#login-form[hidden]{display:none!important}
.admin-verification .captcha-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:13px}
.admin-verification .captcha-refresh{width:auto;padding:6px 10px;margin:0;background:transparent;color:#2563eb}
.admin-verification .captcha-picture{position:relative;width:100%;aspect-ratio:2;overflow:hidden;border-radius:8px;background:#d9e5ed}
.admin-verification .captcha-background{display:block;width:100%;height:100%}
.admin-verification .captcha-piece{position:absolute;width:15.625%;height:31.25%;filter:drop-shadow(0 0 2px #fff);pointer-events:none}
.admin-verification .captcha-slider{display:block;width:100%;height:40px;padding:0;margin:8px 0;cursor:ew-resize;accent-color:#2563eb;touch-action:none}
.admin-verification .captcha-status{font-size:12px;color:#64748b;min-height:18px}
.admin-verification .verify-back{width:100%}

/* 接入方式使用独立色系，不与审批成功/失败的状态颜色混用。 */
.mode-api{background:#edf3ff;color:#2859a5;border-color:#c9d8f1}
.mode-hosted{background:#f3edfc;color:#7043a3;border-color:#decef2}
.access-badge.mode-api{background:#edf3ff;color:#2859a5;border-color:#c9d8f1}
.access-badge.mode-hosted{background:#f3edfc;color:#7043a3;border-color:#decef2}

/* 游戏接入时间保持日期与时刻关联，避免增加时间列后主信息被挤出视口。 */
td.lifecycle-time{white-space:pre-line;min-width:108px;font-size:12px;line-height:1.6;}
