:root {
    --bg: #f4f6f8;
    --surface: #ffffff;
    --surface-muted: #f8fafb;
    --border: #dde2e7;
    --border-strong: #cbd2d9;
    --text: #17212b;
    --text-muted: #66717d;
    --text-soft: #8b96a2;
    --sidebar: #172027;
    --sidebar-hover: #222d35;
    --sidebar-border: #2d3942;
    --green: #198754;
    --green-soft: #e8f5ee;
    --blue: #2878c8;
    --blue-soft: #eaf3fb;
    --amber: #b26a00;
    --amber-soft: #fff3db;
    --red: #c53b3b;
    --red-soft: #fbeaea;
    --purple: #7558a6;
    --topbar-height: 72px;
    --shadow: 0 1px 2px rgba(17, 24, 39, 0.04), 0 3px 12px rgba(17, 24, 39, 0.035);
    font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background: var(--bg);
    font-synthesis: none;
}

* {
    box-sizing: border-box;
    letter-spacing: 0;
}

html,
body {
    min-width: 320px;
    min-height: 100%;
    margin: 0;
}

body {
    min-height: 100vh;
    background: var(--bg);
    font-size: 14px;
    line-height: 1.5;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

button,
select {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(40, 120, 200, 0.28);
    outline-offset: 2px;
}

h1,
h2,
p {
    margin: 0;
}

h1 {
    font-size: 24px;
    line-height: 1.25;
    font-weight: 700;
}

h2 {
    font-size: 16px;
    line-height: 1.35;
    font-weight: 700;
}

small {
    font-size: 12px;
}

[data-lucide] {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    stroke-width: 1.8;
}

i[data-lucide] {
    display: inline-grid;
    place-items: center;
    font-style: normal;
}

i[data-lucide]::before {
    content: attr(data-fallback);
    font-size: 15px;
    line-height: 1;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 1000;
    padding: 8px 12px;
    color: #fff;
    background: var(--blue);
    border-radius: 6px;
    transform: translateY(-150%);
}

.skip-link:focus {
    transform: translateY(0);
}

.app-shell {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    display: flex;
    width: 248px;
    min-height: 100vh;
    flex-direction: column;
    color: #dce4e9;
    background: var(--sidebar);
    border-right: 1px solid #11181d;
}

.brand {
    display: flex;
    height: 72px;
    align-items: center;
    gap: 11px;
    padding: 0 20px;
    border-bottom: 1px solid var(--sidebar-border);
}

.brand-mark {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    color: #102118;
    background: #65c890;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 800;
}

.brand > span:last-child {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.brand strong {
    color: #fff;
    font-size: 15px;
}

.brand small {
    color: #8fa0ab;
}

.nav-list {
    flex: 1;
    padding: 14px 12px;
    overflow-y: auto;
}

.nav-label {
    margin: 18px 10px 7px;
    color: #788994;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.nav-label:first-child {
    margin-top: 4px;
}

.nav-item {
    display: flex;
    width: 100%;
    min-height: 42px;
    align-items: center;
    gap: 11px;
    padding: 9px 10px;
    color: #b8c4cc;
    background: transparent;
    border: 0;
    border-radius: 6px;
    text-align: left;
}

.nav-item:hover {
    color: #fff;
    background: var(--sidebar-hover);
}

.nav-item.is-active {
    color: #fff;
    background: #2a373f;
    box-shadow: inset 3px 0 #65c890;
}

.nav-item span:nth-child(2) {
    min-width: 0;
    flex: 1;
}

.nav-count {
    min-width: 22px;
    padding: 1px 6px;
    color: #dce4e9;
    background: #394750;
    border-radius: 10px;
    font-size: 11px;
    text-align: center;
}

.nav-dot,
.notification-dot {
    display: block;
    width: 7px;
    height: 7px;
    background: #ee6b62;
    border-radius: 50%;
}

.sidebar-foot {
    display: flex;
    min-height: 68px;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-top: 1px solid var(--sidebar-border);
}

.sidebar-foot > span:last-child {
    display: flex;
    flex-direction: column;
}

.sidebar-foot strong {
    color: #dce4e9;
    font-size: 12px;
}

.sidebar-foot small {
    color: #82939d;
}

.health-dot {
    width: 9px;
    height: 9px;
    background: #5ac98a;
    border: 2px solid #315c44;
    border-radius: 50%;
}

.workspace {
    min-width: 0;
    margin-left: 248px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    height: 72px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 28px;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(8px);
}

.topbar-left,
.topbar-actions,
.heading-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text-muted);
}

.breadcrumb [data-lucide] {
    width: 15px;
    height: 15px;
    color: var(--text-soft);
}

.breadcrumb strong {
    color: var(--text);
    font-weight: 600;
}

.environment-badge,
.demo-label {
    display: inline-flex;
    min-height: 25px;
    align-items: center;
    padding: 3px 8px;
    color: #8a5400;
    background: #fff2d5;
    border: 1px solid #efcf91;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
}

.demo-label {
    color: #4e5a65;
    background: #eef1f4;
    border-color: #d8dee3;
}

.global-search,
.filter-search {
    position: relative;
    display: flex;
    align-items: center;
}

.global-search [data-lucide],
.filter-search [data-lucide] {
    position: absolute;
    left: 11px;
    width: 16px;
    height: 16px;
    color: var(--text-soft);
    pointer-events: none;
}

.global-search input,
.filter-search input {
    width: 240px;
    height: 36px;
    padding: 7px 10px 7px 34px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.global-search input:focus,
.filter-search input:focus {
    background: #fff;
    border-color: #8eb7de;
}

.icon-button {
    position: relative;
    display: inline-grid;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    place-items: center;
    padding: 0;
    color: #5e6974;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.icon-button:hover {
    color: var(--text);
    background: var(--surface-muted);
    border-color: var(--border-strong);
}

.notification-dot {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 6px;
    height: 6px;
    box-shadow: 0 0 0 2px #fff;
}

.profile-button {
    display: flex;
    height: 44px;
    align-items: center;
    gap: 9px;
    padding: 4px 7px 4px 5px;
    background: transparent;
    border: 0;
    border-radius: 6px;
}

.profile-button:hover {
    background: var(--surface-muted);
}

.avatar {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    color: #17462e;
    background: #d8f0e3;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 800;
}

.profile-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
}

.profile-copy strong {
    font-size: 12px;
}

.profile-copy small {
    color: var(--text-muted);
    font-size: 11px;
}

.profile-button > [data-lucide] {
    width: 14px;
    height: 14px;
    color: var(--text-soft);
}

.profile-area {
    position: relative;
}

.profile-menu {
    position: absolute;
    top: calc(100% + 9px);
    right: 0;
    z-index: 40;
    width: 236px;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 7px;
    box-shadow: 0 12px 34px rgba(17, 24, 39, 0.15);
}

.profile-menu[hidden] {
    display: none;
}

.profile-menu-head {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 8px 11px;
    border-bottom: 1px solid var(--border);
}

.profile-menu-head > span:last-child {
    display: flex;
    flex-direction: column;
}

.profile-menu-head small,
.profile-menu-meta span {
    color: var(--text-muted);
    font-size: 11px;
}

.profile-menu-meta {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 10px;
    padding: 11px 8px;
    font-size: 11px;
}

.profile-menu-meta strong {
    font-size: 11px;
    font-weight: 600;
}

.session-live {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--green);
}

.session-live i {
    width: 6px;
    height: 6px;
    background: var(--green);
    border-radius: 50%;
}

.profile-menu > form {
    margin: 0;
}

.profile-menu-action {
    display: flex;
    width: 100%;
    min-height: 36px;
    align-items: center;
    gap: 8px;
    padding: 8px 9px;
    color: var(--text-muted);
    background: transparent;
    border: 0;
    border-radius: 5px;
    font-weight: 600;
    line-height: 1.25;
    text-decoration: none;
    text-align: left;
}

.profile-menu-action:hover {
    color: var(--text);
    background: var(--surface-muted);
}

.profile-menu-action-danger:hover {
    color: var(--red);
    background: var(--red-soft);
}

.profile-menu-action [data-lucide] {
    width: 16px;
    height: 16px;
}

.mobile-menu,
.mobile-scrim {
    display: none;
}

main {
    max-width: 1660px;
    min-height: calc(100vh - 72px);
    margin: 0 auto;
    padding: 28px;
}

.view {
    display: none;
}

.view.is-active {
    display: block;
    animation: view-in 160ms ease-out;
}

@keyframes view-in {
    from { opacity: 0; transform: translateY(3px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-heading {
    display: flex;
    min-height: 65px;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
}

.page-heading > div:first-child {
    min-width: 0;
}

.page-heading p:not(.eyebrow) {
    margin-top: 5px;
    color: var(--text-muted);
}

.eyebrow {
    margin-bottom: 4px;
    color: #66808d;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

select,
input[type="date"],
input[type="text"],
input[type="url"],
textarea {
    min-height: 36px;
    padding: 7px 10px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
}

textarea {
    width: 100%;
    resize: vertical;
}

.button {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 7px 12px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-weight: 600;
}

.button [data-lucide] {
    width: 16px;
    height: 16px;
}

.button-primary {
    color: #fff;
    background: #216a48;
    border-color: #216a48;
}

.button-primary:hover {
    background: #195a3c;
}

.button-secondary {
    color: #34404b;
    background: #fff;
    border-color: var(--border-strong);
}

.button-secondary:hover,
.button-quiet:hover {
    background: var(--surface-muted);
}

.button-quiet {
    color: #4e5a65;
    background: transparent;
    border-color: transparent;
}

.button-danger {
    color: #fff;
    background: var(--red);
    border-color: var(--red);
}

.button-danger:hover:not(:disabled) {
    background: #a92f2f;
    border-color: #a92f2f;
}

.full-width {
    width: 100%;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

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

.metric-card {
    min-height: 132px;
    padding: 18px;
}

.metric-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-muted);
    font-weight: 600;
}

.metric-head [data-lucide] {
    width: 19px;
    height: 19px;
    color: #79909e;
}

.metric-card > strong {
    display: block;
    margin-top: 12px;
    font-size: 26px;
    line-height: 1.15;
}

.metric-card > p {
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 12px;
}

.metric-alert {
    border-top: 3px solid #d14b4b;
    padding-top: 16px;
}

.metric-alert .metric-head [data-lucide] {
    color: var(--red);
}

.trend {
    margin-right: 4px;
    font-weight: 700;
}

.trend.positive { color: var(--green); }
.trend.negative { color: var(--red); }
.trend.neutral { color: var(--blue); }

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.75fr);
    gap: 18px;
    margin-bottom: 18px;
}

.lower-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(290px, 0.75fr);
    gap: 18px;
}

.dashboard-collapsible > summary {
    cursor: pointer;
    list-style: none;
}

.dashboard-collapsible > summary::-webkit-details-marker {
    display: none;
}

.dashboard-collapsible > summary::after {
    content: "+";
    margin-left: 8px;
    color: var(--text-muted);
    font-size: 18px;
}

.dashboard-collapsible[open] > summary::after {
    content: "−";
}

.dashboard-collapsible[open] > summary {
    border-bottom: 1px solid var(--border);
}

.panel {
    min-width: 0;
}

.panel-heading {
    display: flex;
    min-height: 66px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}

.panel-heading p {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 12px;
}

.panel-heading h2 small {
    display: block;
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
}

.workspace-section-heading {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 26px 2px 10px;
}

.workspace-section-heading h2 {
    font-size: 16px;
}

.workspace-section-heading p {
    color: var(--text-muted);
    font-size: 12px;
}

.text-button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px;
    color: var(--blue);
    background: transparent;
    border: 0;
    font-weight: 600;
}

.text-button [data-lucide] {
    width: 15px;
    height: 15px;
}

.game-status-list {
    padding: 2px 18px;
}

.game-status-row {
    display: grid;
    grid-template-columns: 42px minmax(180px, 1fr) 54px 54px minmax(110px, 0.58fr) 36px;
    min-height: 83px;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #edf0f2;
}

.game-status-row:last-child {
    border-bottom: 0;
}

.game-symbol {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    color: #fff;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 800;
}

.game-symbol.small {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    font-size: 11px;
}

.game-symbol.bswc,
.table-game-dot.bswc,
.bswc-fill { background: #2f7d65; }
.game-symbol.fqzs,
.table-game-dot.fqzs,
.fqzs-fill { background: #b56d20; }
.game-symbol.newgame,
.table-game-dot.newgame,
.newgame-fill { background: #6d65a8; }

.game-main {
    min-width: 0;
}

.game-main > div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.game-main small,
.game-stat small,
.load-column small {
    color: var(--text-muted);
}

.game-stat {
    display: flex;
    flex-direction: column;
}

.game-stat strong {
    font-size: 15px;
}

.load-column > span {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.load-column strong {
    font-size: 12px;
}

.progress,
.share-track {
    width: 100%;
    height: 5px;
    overflow: hidden;
    background: #e9edf0;
    border-radius: 3px;
}

.progress > span {
    display: block;
    height: 100%;
    background: #4ea47a;
    border-radius: 3px;
}

.progress.warning > span {
    background: #d79437;
}

.row-action {
    border-color: transparent;
}

.status {
    display: inline-flex;
    min-height: 22px;
    align-items: center;
    justify-content: center;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.status-online,
.status-success {
    color: #18633f;
    background: var(--green-soft);
}

.status-running {
    color: #1c5c94;
    background: var(--blue-soft);
}

.status-maintenance,
.status-warning {
    color: #8a5400;
    background: var(--amber-soft);
}

.status-danger {
    color: #9d2929;
    background: var(--red-soft);
}

.status-neutral {
    color: #58636e;
    background: #edf0f2;
}

/* 状态双语：英文用淡色小字补充 */
.status small {
    margin-left: 4px;
    padding-left: 4px;
    border-left: 1px solid currentColor;
    border-left-color: rgba(0, 0, 0, 0.15);
    font-size: 11px;
    font-weight: 500;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.count-badge {
    display: grid;
    min-width: 26px;
    height: 26px;
    place-items: center;
    color: #9d2929;
    background: var(--red-soft);
    border-radius: 13px;
    font-size: 12px;
    font-weight: 800;
}

.incident-list {
    padding: 4px 18px;
}

.incident-item {
    display: grid;
    width: 100%;
    grid-template-columns: 34px minmax(0, 1fr) 18px;
    min-height: 66px;
    align-items: center;
    gap: 11px;
    padding: 8px 0;
    background: transparent;
    border: 0;
    border-bottom: 1px solid #edf0f2;
    text-align: left;
}

.incident-item:hover strong {
    color: var(--blue);
}

.incident-item > span:nth-child(2) {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.incident-item strong,
.incident-item small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.incident-item small {
    margin-top: 3px;
    color: var(--text-muted);
}

.incident-item > [data-lucide] {
    width: 16px;
    height: 16px;
    color: var(--text-soft);
}

.severity {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 6px;
}

.severity [data-lucide] {
    width: 16px;
    height: 16px;
}

.severity-high { color: var(--red); background: var(--red-soft); }
.severity-medium { color: var(--amber); background: var(--amber-soft); }
.severity-low { color: var(--blue); background: var(--blue-soft); }

.incident-panel > .full-width {
    width: calc(100% - 36px);
    margin: 10px 18px 16px;
}

.segmented {
    display: flex;
    padding: 2px;
    background: #eef1f3;
    border-radius: 6px;
}

.segmented button {
    min-height: 28px;
    padding: 3px 9px;
    color: var(--text-muted);
    background: transparent;
    border: 0;
    border-radius: 4px;
    font-size: 12px;
}

.segmented button.is-active {
    color: var(--text);
    background: #fff;
    box-shadow: 0 1px 3px rgba(18, 28, 35, 0.12);
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

th,
td {
    height: 52px;
    padding: 10px 16px;
    border-bottom: 1px solid #edf0f2;
    text-align: left;
    vertical-align: middle;
}

th {
    height: 42px;
    color: #697580;
    background: #fafbfc;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

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

tbody tr:hover td {
    background: #fbfcfd;
}

.align-right {
    text-align: right;
}

.muted {
    color: var(--text-soft);
}

.mono {
    font-family: "Cascadia Mono", Consolas, monospace;
    font-size: 12px;
}

.table-game-dot,
.legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 7px;
    border-radius: 2px;
}

.resource-summary {
    padding: 4px 18px;
}

.resource-row {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    min-height: 60px;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #edf0f2;
}

.resource-row:last-child {
    border-bottom: 0;
}

.resource-row > span:nth-child(2) {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.resource-row small {
    color: var(--text-muted);
}

.resource-row strong,
.resource-row small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.host-performance-panel {
    margin-top: 18px;
}

.host-heading-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.host-heading-status small {
    color: var(--text-muted);
}

.host-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.host-metric {
    min-height: 142px;
    padding: 18px 20px;
    border-right: 1px solid var(--border);
}

.host-metric:last-child {
    border-right: 0;
}

.host-metric > div:first-child {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.host-metric > div:first-child > span {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
}

.host-metric > div:first-child > strong {
    font-size: 24px;
}

.metric-gauge {
    height: 8px;
    margin: 18px 0 9px;
    overflow: hidden;
    background: #e9edf0;
    border-radius: 4px;
}

.metric-gauge > i {
    display: block;
    height: 100%;
    background: var(--green);
    border-radius: 4px;
    transition: width 220ms ease;
}

.metric-gauge > i.is-warning {
    background: var(--amber);
}

.metric-gauge > i.is-danger {
    background: var(--red);
}

.host-metric > small {
    color: var(--text-muted);
    font-size: 12px;
}

.host-capacity-copy {
    display: flex;
    min-height: 53px;
    flex-direction: column;
    justify-content: flex-end;
    margin-top: 15px;
}

.host-capacity-copy strong {
    color: var(--text);
}

.host-capacity-copy small {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 12px;
}

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

.game-picker-item {
    display: grid;
    min-height: 68px;
    grid-template-columns: 38px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 100%;
    padding: 10px 12px 42px;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 7px;
    box-shadow: var(--shadow);
    text-align: left;
}

.game-picker-card {
    position: relative;
    min-width: 0;
}

.game-picker-direct {
    position: absolute;
    right: 9px;
    bottom: 8px;
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    gap: 5px;
    padding: 4px 7px;
    color: var(--blue);
    background: transparent;
    border: 0;
    font-size: 12px;
    font-weight: 600;
}

.game-picker-direct:hover {
    background: var(--blue-soft);
    border-radius: 5px;
}

.game-picker-direct [data-lucide] {
    width: 14px;
    height: 14px;
}

.game-picker-item:hover,
.game-picker-item.is-active {
    border-color: #75b897;
    box-shadow: 0 0 0 2px rgba(25, 135, 84, 0.1);
}

.game-picker-item > span:nth-child(2) {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.game-picker-item small {
    margin-top: 2px;
    color: var(--text-muted);
}

.game-picker-item > [data-lucide] {
    display: none;
    width: 16px;
    height: 16px;
    color: var(--green);
}

.game-picker-item.is-active > [data-lucide] {
    display: block;
}

.game-detail-shell {
    overflow: hidden;
}

.game-detail-head {
    display: flex;
    min-height: 82px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.game-detail-title {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
}

.game-detail-title > div {
    min-width: 0;
}

.game-detail-title h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
}

.game-detail-title p {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 12px;
}

.game-tabs {
    display: flex;
    min-height: 49px;
    gap: 22px;
    padding: 0 20px;
    overflow-x: auto;
    border-bottom: 1px solid var(--border);
}

.game-tabs button {
    position: relative;
    min-height: 49px;
    padding: 0;
    color: var(--text-muted);
    background: transparent;
    border: 0;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.game-tabs button:hover,
.game-tabs button.is-active {
    color: var(--green);
}

.game-tabs button.is-active::after {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 2px;
    background: var(--green);
    content: "";
}

.game-detail-content {
    min-height: 250px;
    padding: 18px 20px 22px;
}

.game-detail-content.is-hidden {
    display: none;
}

.game-port-overview { margin-bottom: 18px; }
.game-port-overview-toolbar { display: flex; align-items: center; gap: 14px; padding: 14px 18px 14px; }
.game-port-overview-toolbar .filter-select { width: 140px; flex: 0 0 140px; }
.game-port-overview-toolbar .filter-search { width: min(100%, 300px); min-width: 220px; flex: 0 1 300px; }
.game-port-overview .game-port-overview-pager { align-items: center; flex-direction: row; flex-wrap: wrap; justify-content: center; margin-top: 12px; padding: 0 18px 14px; }
.game-port-overview-pager > div { justify-content: center; }
.game-port-overview-table { min-width: 860px; }
.game-port-overview-table th,
.game-port-overview-table td { white-space: nowrap; }
.game-port-overview-table td:last-child { max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 720px) {
    .game-port-overview-toolbar { align-items: stretch; flex-direction: column; }
    .game-port-overview-toolbar .filter-select,
    .game-port-overview-toolbar .filter-search { width: 100%; min-width: 0; flex: 1 1 auto; }
}

.bswc-hall-filter.segmented {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2px;
    margin-bottom: 14px;
}

.bswc-hall-filter[hidden] {
    display: none;
}

.bswc-hall-filter button {
    min-width: 0;
    min-height: 54px;
}

.bswc-hall-filter button > span,
.bswc-hall-filter button > small {
    display: block;
}

.bswc-hall-filter button > small {
    margin-top: 2px;
    font-size: 11px;
}

.bswc-hall-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: -4px 0 14px;
    padding: 10px 12px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--surface-muted);
}

.bswc-hall-summary[hidden] {
    display: none;
}

.bswc-hall-summary strong,
.bswc-hall-summary small {
    display: block;
}

.bswc-hall-summary small {
    margin-top: 3px;
    color: var(--text-muted);
}

.room-parameter-copy {
    min-width: 190px;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.4;
}

@media (max-width: 720px) {
    .bswc-hall-filter.segmented {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    }

    .bswc-hall-summary {
        align-items: stretch;
        flex-direction: column;
    }
}

.detail-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 22px;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.detail-metrics > div {
    min-height: 92px;
    padding: 14px 16px;
    border-right: 1px solid var(--border);
}

.detail-metrics > div:last-child {
    border-right: 0;
}

.detail-metrics span,
.detail-metrics small {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
}

.detail-metrics strong {
    display: block;
    margin: 7px 0 3px;
    font-size: 21px;
}

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

.detail-card {
    min-width: 0;
    padding-top: 3px;
    border-top: 1px solid var(--border-strong);
}

.detail-card-head,
.asset-release-head {
    display: flex;
    min-height: 60px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.detail-card-head p,
.asset-release-head p {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 12px;
}

.mini-health {
    display: grid;
    gap: 13px;
}

.mini-health > div {
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr) 36px;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}

.mini-health strong {
    color: var(--text-muted);
    font-size: 12px;
    text-align: right;
}

.health-line {
    display: block;
    height: 6px;
    overflow: hidden;
    background: #e8edf0;
    border-radius: 4px;
}

.health-line i {
    display: block;
    height: 100%;
    background: #4ea47a;
    border-radius: 4px;
}

.detail-list {
    margin: 0;
}

.detail-list > div {
    display: flex;
    min-height: 31px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid #edf0f2;
    font-size: 12px;
}

.detail-list > div:last-child {
    border-bottom: 0;
}

.detail-list dt {
    color: var(--text-muted);
}

.detail-list dd {
    margin: 0;
    font-weight: 600;
}

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

.room-card {
    padding: 14px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.room-card > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.room-card p {
    margin: 14px 0 8px;
    color: var(--text-muted);
    font-size: 12px;
}

.room-card small {
    display: block;
    margin-top: 9px;
    overflow: hidden;
    color: var(--text-muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.version-list {
    display: grid;
    border-top: 1px solid var(--border);
}

.cos-current-panel {
    margin-bottom: 22px;
}

.cos-section-heading {
    display: flex;
    min-height: 38px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.cos-section-heading h4 {
    margin: 0;
    font-size: 14px;
}

.cos-section-heading small {
    color: var(--text-muted);
}

.cos-history-heading {
    margin-top: 4px;
}

.cos-current-list {
    border-top: 1px solid var(--border);
}

.cos-current-row {
    display: grid;
    min-height: 84px;
    grid-template-columns: 110px minmax(0, 1fr) 110px auto;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid #edf0f2;
}

.cos-current-detail,
.cos-current-meta {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
}

.cos-current-detail > * {
    overflow-wrap: anywhere;
}

.cos-current-detail small,
.cos-current-meta small {
    color: var(--text-muted);
}

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

@media (max-width: 720px) {
    .cos-section-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
        padding: 8px 0;
    }

    .cos-current-row {
        grid-template-columns: 92px minmax(0, 1fr);
        gap: 10px;
    }

    .cos-current-meta {
        grid-column: 2;
    }

    .cos-current-actions {
        grid-column: 1 / -1;
    }
}

.version-row {
    display: grid;
    min-height: 68px;
    grid-template-columns: 86px minmax(160px, 1fr) 100px 70px auto;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #edf0f2;
}

.version-row > span:nth-child(2) {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.version-row > span:nth-child(2) > * {
    overflow-wrap: anywhere;
}

.version-row small {
    margin-top: 2px;
    color: var(--text-muted);
}

.version-badge {
    display: inline-flex;
    width: fit-content;
    min-height: 25px;
    align-items: center;
    padding: 3px 7px;
    color: #245d91;
    background: var(--blue-soft);
    border-radius: 4px;
    font-family: "Cascadia Mono", Consolas, monospace;
    font-size: 11px;
}

.version-badge.draft {
    color: #8a5400;
    background: var(--amber-soft);
}

.asset-path {
    display: grid;
    min-height: 48px;
    grid-template-columns: 20px minmax(0, 1fr) 36px;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    padding: 6px 8px;
    color: var(--text-muted);
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.asset-path > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.asset-path .icon-button {
    width: 32px;
    height: 32px;
}

.toolbar {
    display: flex;
    min-height: 62px;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.filter-search {
    min-width: 260px;
    flex: 1;
}

.filter-search input {
    width: 100%;
}

.table-panel {
    overflow: hidden;
}

.audit-action-cell strong,
.audit-action-cell small {
    display: block;
}

.audit-action-cell small {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 11px;
}

.audit-toolbar {
    display: grid;
    min-height: 0;
    grid-template-columns: minmax(260px, 1fr) 150px 170px auto;
}

.audit-toolbar .filter-search {
    min-width: 0;
}

.audit-toolbar select,
.audit-toolbar input[type="date"] {
    width: 100%;
}

.audit-table-wrap {
    max-height: min(680px, calc(100vh - 260px));
    overflow: auto;
}

.audit-table {
    min-width: 1080px;
    table-layout: fixed;
    white-space: normal;
}

.audit-table .audit-time-col { width: 110px; }
.audit-table .audit-admin-col { width: 110px; }
.audit-table .audit-action-col { width: 210px; }
.audit-table .audit-resource-col { width: 220px; }
.audit-table .audit-result-col { width: 105px; }
.audit-table .audit-request-col { width: 150px; }

.audit-table th,
.audit-table td {
    height: auto;
    padding: 10px 12px;
}

.audit-table td:nth-child(4),
.audit-table td:nth-child(5),
.audit-action-cell strong,
.audit-action-cell small {
    overflow-wrap: anywhere;
    line-height: 1.45;
}

.audit-table td:nth-child(1),
.audit-table td:nth-child(6) {
    white-space: nowrap;
}

.audit-request-id {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .audit-toolbar {
        grid-template-columns: 1fr 1fr;
    }

    .audit-toolbar .filter-search {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .audit-toolbar {
        grid-template-columns: 1fr;
    }

    .audit-toolbar .filter-search {
        grid-column: auto;
    }
}

.game-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.game-cell > span:last-child {
    display: flex;
    flex-direction: column;
}

.game-cell small,
.block-copy {
    color: var(--text-muted);
}

.block-copy {
    display: block;
    margin-top: 2px;
}

.small-copy {
    font-size: 12px;
}

.truncate {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    padding: 13px 15px;
    border: 1px solid;
    border-radius: 8px;
}

.notice > [data-lucide] {
    margin-top: 1px;
}

.notice p {
    margin-top: 2px;
    font-size: 12px;
}

.warning-notice {
    color: #754800;
    background: #fff8e8;
    border-color: #ecd095;
}

.stub-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
    padding: 11px 14px;
    border-radius: 8px;
    border: 1px solid #ecd095;
    background: #fff8e8;
    color: #754800;
    font-size: 13px;
    line-height: 1.5;
}

.stub-banner > [data-lucide] {
    flex: 0 0 auto;
    margin-top: 1px;
}

.stub-banner strong {
    color: #5a3600;
}

.stub-banner .stub-phase {
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 999px;
    background: #754800;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.stub-banner a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.stub-data-flag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 4px;
    background: #f0e8c8;
    color: #754800;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    vertical-align: middle;
    text-transform: uppercase;
}

.metric-grid.compact .metric-card {
    min-height: 118px;
}

/* ===== Wallet page: platform ledger ===== */
.wallet-toolbar {
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.wallet-toolbar .segmented {
    flex: 0 0 auto;
}

.wallet-toolbar .filter-select {
    display: flex;
    align-items: center;
    gap: 6px;
}

.wallet-toolbar .filter-select select,
.wallet-toolbar .filter-select input {
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
}

.wallet-overview-panel,
.wallet-trend-panel,
.wallet-ledger-panel,
.wallet-exceptions-panel {
    margin-top: 18px;
}

.wallet-overview-note,
.wallet-ledger-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px 2px 2px;
    padding: 10px 12px;
    background: var(--surface-muted);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

.wallet-overview-note > [data-lucide],
.wallet-ledger-note > [data-lucide] {
    flex: 0 0 auto;
    margin-top: 1px;
}

.wallet-overview-note code,
.wallet-ledger-note code,
.wallet-overview-note a,
.wallet-ledger-note a {
    color: var(--text);
}

.metric-card.metric-positive {
    border-color: var(--green);
    background: linear-gradient(180deg, var(--green-soft) 0%, var(--surface) 60%);
}

.metric-card.metric-positive .metric-head span,
.metric-card.metric-positive strong {
    color: var(--green);
}

.wallet-trend-chart {
    min-height: 220px;
    padding: 16px 8px 4px;
}

.wallet-trend-chart .chart-column.is-current small {
    color: var(--green);
    font-weight: 600;
}

.wallet-ledger-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.wallet-ledger-table thead th {
    padding: 11px 12px;
    background: var(--surface-muted);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 12px;
    text-align: left;
    white-space: nowrap;
}

.wallet-ledger-table thead th.align-right {
    text-align: right;
}

.wallet-ledger-table tbody td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.wallet-ledger-table tbody td.align-right {
    text-align: right;
}

.wallet-ledger-table .ledger-row {
    cursor: pointer;
    transition: background 0.12s;
}

.wallet-ledger-table .ledger-row:hover {
    background: var(--surface-muted);
}

.wallet-ledger-table tbody tr:last-child td {
    border-bottom: none;
}

.wallet-ledger-table .text-button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
}

.wallet-ledger-table .ledger-row:hover .text-button {
    color: var(--green);
    border-color: var(--border);
}

/* 隐藏不匹配当前粒度的账目行(JS 控制) */
.wallet-ledger-table .ledger-row.is-hidden {
    display: none;
}

/* ===== Wallet page: 玩家流水查询区块 ===== */
.wallet-player-flow-panel {
    margin-top: 18px;
}

.wallet-flow-search {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    padding: 14px;
    background: var(--surface-muted);
    border-radius: 8px;
    margin-bottom: 14px;
}

.wallet-flow-search .flow-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wallet-flow-search .flow-field.flow-field-small {
    min-width: 140px;
}

.wallet-flow-search .flow-field.flow-field-wide {
    grid-column: span 2;
}

.wallet-flow-search .flow-field span {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.wallet-flow-search .flow-field input,
.wallet-flow-search .flow-field select {
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
}

.wallet-flow-search .flow-field input:focus,
.wallet-flow-search .flow-field select:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 2px var(--green-soft);
}

.wallet-flow-search .flow-actions {
    grid-column: span 1;
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

@media (max-width: 780px) {
    .wallet-flow-search .flow-field.flow-field-wide,
    .wallet-flow-search .flow-actions {
        grid-column: span 1;
    }
}

.wallet-flow-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--surface-muted);
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--text-muted);
}

.wallet-flow-summary strong {
    color: var(--text);
}

.wallet-flow-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.wallet-flow-table thead th {
    padding: 10px 12px;
    background: var(--surface-muted);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 12px;
    text-align: left;
    white-space: nowrap;
}

.wallet-flow-table thead th.align-right {
    text-align: right;
}

.wallet-flow-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    white-space: nowrap;
}

.wallet-flow-table tbody td.align-right {
    text-align: right;
}

.wallet-flow-table tbody tr:last-child td {
    border-bottom: none;
}

.wallet-flow-table tbody tr:hover {
    background: var(--surface-muted);
}

.wallet-flow-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px 2px 2px;
    padding: 10px 12px;
    background: var(--surface-muted);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ===== Players page: 玩家筛选、游戏对比与玩家表格 ===== */
.player-retention-panel,
.player-comparison-panel {
    margin-bottom: 14px;
    overflow: hidden;
}

.player-retention-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-bottom: 1px solid var(--border);
}

.player-retention-summary > div {
    display: grid;
    gap: 3px;
    padding: 14px 18px;
    border-right: 1px solid var(--border);
}

.player-retention-summary > div:last-child {
    border-right: 0;
}

.player-retention-summary span,
.player-retention-summary small {
    color: var(--text-muted);
    font-size: 11px;
}

.player-retention-summary strong {
    font-size: 22px;
}

.player-retention-table-wrap {
    max-height: 360px;
    overflow: auto;
}

.player-retention-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.player-retention-table th,
.player-retention-table td {
    padding: 9px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}

.player-retention-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    color: var(--text-muted);
    background: var(--surface-muted);
}

.player-retention-table .align-right {
    text-align: right;
}

.player-game-comparison {
    display: grid;
    gap: 12px;
    padding: 16px 18px 18px;
}

.player-comparison-row {
    display: grid;
    grid-template-columns: minmax(150px, 220px) minmax(120px, 1fr) 64px;
    align-items: center;
    gap: 14px;
}

.player-comparison-label {
    min-width: 0;
}

.player-comparison-label strong,
.player-comparison-label small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-comparison-label small {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 11px;
}

.player-comparison-track {
    height: 8px;
    overflow: hidden;
    background: #e8edf0;
    border-radius: 4px;
}

.player-comparison-track span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--green);
    border-radius: inherit;
}

.player-comparison-value {
    text-align: right;
    font-size: 14px;
}

.player-comparison-empty {
    padding: 8px 0;
    color: var(--text-muted);
    font-size: 13px;
}

.player-filter-toolbar {
    display: grid;
    grid-template-columns: minmax(210px, 1.35fr) repeat(3, minmax(145px, 0.85fr)) auto;
    align-items: end;
    gap: 10px;
    margin-bottom: 14px;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.player-filter-field {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.player-filter-field > span {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
}

.player-filter-field input,
.player-filter-field select {
    width: 100%;
    height: 36px;
    min-width: 0;
    padding: 7px 10px;
    color: var(--text);
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.player-filter-field input:focus,
.player-filter-field select:focus {
    background: var(--surface);
    border-color: #8eb7de;
}

.player-filter-search > div {
    position: relative;
}

.player-filter-search [data-lucide] {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 16px;
    height: 16px;
    color: var(--text-soft);
    pointer-events: none;
}

.player-filter-search input {
    padding-left: 34px;
}

.player-filter-actions {
    display: flex;
    gap: 8px;
}

.players-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed;
    white-space: normal;
}

.players-table th:nth-child(1) { width: 16%; }
.players-table th:nth-child(2) { width: 9%; }
.players-table th:nth-child(3) { width: 13%; }
.players-table th:nth-child(4) { width: 13%; }
.players-table th:nth-child(5) { width: 12%; }
.players-table th:nth-child(6) { width: 10%; }
.players-table th:nth-child(7) { width: 10%; }
.players-table th:nth-child(8) { width: 8%; }
.players-table th:nth-child(9) { width: 8%; }
.players-table th:nth-child(10) { width: 52px; }

.players-table thead th {
    padding: 11px 12px;
    background: var(--surface-muted);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 12px;
    text-align: left;
    white-space: nowrap;
}

.players-table thead th.align-right {
    text-align: right;
}

.players-table tbody td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.players-table .mono,
.players-table .block-copy {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.players-table tbody td:nth-child(1) > .mono,
.players-table tbody td:nth-child(1) > .block-copy,
.players-table tbody td:nth-child(4),
.players-table tbody td:nth-child(5) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.players-table tbody td.align-right {
    text-align: right;
}

.players-table tbody tr[data-player-status="banned"] {
    background: rgba(220, 90, 90, 0.04);
}

.players-table tbody tr[data-player-status="banned"] td:first-child strong {
    color: var(--text-muted);
    text-decoration: line-through;
    text-decoration-color: var(--red);
}

.players-table tbody tr:hover {
    background: var(--surface-muted);
}

.players-table tbody tr:last-child td {
    border-bottom: none;
}

.row-action-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.players-table .icon-button.player-action-ban:hover {
    color: var(--red);
    background: var(--red-soft);
}

.players-table .icon-button.player-action-unban:hover {
    color: var(--green);
    background: var(--green-soft);
}

.table-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 12px;
}

.table-pager > div {
    display: flex;
    gap: 8px;
}

.players-table-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px 2px 2px;
    padding: 10px 12px;
    background: var(--surface-muted);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

@media (max-width: 1100px) {
    .player-retention-summary {
        grid-template-columns: 1fr;
    }

    .player-retention-summary > div {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .player-retention-summary > div:last-child {
        border-bottom: 0;
    }

    .player-filter-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .player-filter-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 680px) {
    .player-filter-toolbar {
        grid-template-columns: 1fr;
    }

    .player-filter-actions {
        grid-column: auto;
    }

    .player-filter-actions .button {
        flex: 1;
    }

    .table-pager {
        align-items: stretch;
        flex-direction: column;
    }

    .table-pager .button {
        flex: 1;
    }

    .player-comparison-row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px 12px;
    }

    .player-comparison-track {
        grid-column: 1 / -1;
        grid-row: 2;
    }
}

/* 玩家风控对话框 */
.modal.player-action-dialog {
    width: min(760px, calc(100vw - 24px));
}

.player-action-dialog .modal-body {
    min-width: 0;
}

.player-action-warning {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    background: var(--amber-soft, #fff8e8);
    border: 1px solid var(--amber, #ecd095);
    color: #754800;
}

.player-action-warning > [data-lucide] {
    flex: 0 0 auto;
    margin-top: 1px;
    color: var(--amber, #b8860b);
}

.player-action-warning strong {
    color: #5a3600;
    display: block;
    margin-bottom: 4px;
}

.player-action-warning p {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
}

.player-action-meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) minmax(120px, .8fr);
    gap: 10px;
    margin: 0 0 16px;
    padding: 12px;
    background: var(--surface-muted);
    border-radius: 6px;
}

.player-action-meta > div {
    min-width: 0;
}

.player-action-meta dt {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
}

.player-action-meta dd {
    margin: 0;
    font-size: 13px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.player-action-dialog label {
    display: block;
    margin-bottom: 12px;
}

.player-action-dialog label > span {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}

.player-action-dialog textarea,
.player-action-dialog select,
.player-action-dialog input[type="number"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
}

.player-action-dialog textarea:focus,
.player-action-dialog select:focus,
.player-action-dialog input[type="number"]:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 2px var(--green-soft);
}

.player-action-dialog .player-action-custom-duration.is-hidden {
    display: none;
}

/* ===== Reports page: 粒度切换 + 汇总 + 明细表 ===== */
.reports-toolbar {
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.reports-toolbar .filter-select select {
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
}

.reports-overview-panel,
.reports-breakdown-panel {
    margin-top: 18px;
}

.reports-trend-chart {
    min-height: 220px;
    padding: 16px 8px 4px;
}

.reports-trend-chart .chart-column.is-current small {
    color: var(--green);
    font-weight: 600;
}

.reports-breakdown-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.reports-breakdown-table thead th {
    padding: 11px 12px;
    background: var(--surface-muted);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 12px;
    text-align: left;
    white-space: nowrap;
}

.reports-breakdown-table thead th.align-right {
    text-align: right;
}

.reports-breakdown-table tbody td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    white-space: nowrap;
}

.reports-breakdown-table tbody td.align-right {
    text-align: right;
}

.reports-breakdown-table tbody tr:hover {
    background: var(--surface-muted);
}

.reports-breakdown-table tbody tr:last-child td {
    border-bottom: none;
}

.reports-breakdown-table .text-button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
}

.reports-breakdown-table tr:hover .text-button {
    color: var(--green);
    border-color: var(--border);
}

.reports-breakdown-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px 2px 2px;
    padding: 10px 12px;
    background: var(--surface-muted);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ===== 玩家详情抽屉 ===== */
.player-drawer {
    position: fixed;
    inset: 0;
    z-index: 1000;
    visibility: hidden;
    pointer-events: none;
}

.player-drawer.is-open {
    visibility: visible;
    pointer-events: auto;
}

.player-drawer-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 22, 32, 0.45);
    opacity: 0;
    transition: opacity 0.18s;
}

.player-drawer.is-open .player-drawer-overlay {
    opacity: 1;
}

.player-drawer-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(820px, calc(100vw - 24px));
    background: var(--surface);
    box-shadow: -8px 0 24px rgba(15, 22, 32, 0.15);
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transform: translateX(100%);
    transition: transform 0.22s ease-out;
}

.player-drawer.is-open .player-drawer-panel {
    transform: translateX(0);
}

.player-drawer-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 18px 22px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    min-width: 0;
}

.player-drawer-head > div {
    min-width: 0;
}

.player-drawer-head h2 {
    margin: 0 0 4px;
    font-size: 18px;
}

.player-drawer-meta {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
    overflow-wrap: anywhere;
}

.player-drawer-meta .mono {
    color: var(--text);
}

.player-drawer-quick-actions {
    display: flex;
    gap: 8px;
    padding: 12px 22px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-muted);
    flex-wrap: wrap;
    min-width: 0;
}

.player-drawer-quick-actions .button.button-small {
    padding: 6px 10px;
    font-size: 12px;
    min-height: 0;
}

.player-drawer-quick-actions .button small {
    margin-left: 4px;
    opacity: 0.7;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
}

.player-drawer-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    padding: 0 14px;
    overflow-x: auto;
    min-width: 0;
}

.player-drawer-tabs button {
    flex: 0 0 auto;
    padding: 11px 12px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.12s, border-color 0.12s;
}

.player-drawer-tabs button small {
    margin-left: 3px;
    opacity: 0.6;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.player-drawer-tabs button:hover {
    color: var(--text);
}

.player-drawer-tabs button.is-active {
    color: var(--green);
    border-bottom-color: var(--green);
}

.player-drawer-body {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
    padding: 18px 22px 28px;
}

.player-tab-content {
    min-width: 0;
}

.player-tab-content.is-hidden {
    display: none;
}

.player-tab-empty-hint {
    margin-bottom: 14px;
    padding: 10px 12px;
    background: var(--amber-soft, #fff8e8);
    border: 1px solid var(--amber, #ecd095);
    border-radius: 6px;
    color: #754800;
    font-size: 12px;
    line-height: 1.5;
}

.player-tab-empty-hint code {
    color: #5a3600;
    background: rgba(255, 255, 255, 0.5);
    padding: 1px 4px;
    border-radius: 3px;
}

.player-rounds-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.player-rounds-toolbar .filter-select {
    min-width: 160px;
}

.player-rounds-toolbar #pd-rounds-total {
    margin-right: auto;
}

.player-info-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 18px;
    margin: 0;
}

.player-info-list > div {
    min-width: 0;
    padding: 8px 10px;
    background: var(--surface-muted);
    border-radius: 6px;
}

.player-info-list dt {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 3px;
}

.player-info-list dt small {
    margin-left: 3px;
    opacity: 0.6;
    font-size: 11px;
    text-transform: uppercase;
}

.player-info-list dd {
    margin: 0;
    font-size: 13px;
    color: var(--text);
    word-break: break-all;
}

@media (max-width: 540px) {
    .player-info-list {
        grid-template-columns: 1fr;
    }
}

.player-rounds-table,
.player-wallet-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    table-layout: fixed;
}

.player-rounds-table th:nth-child(1) { width: 15%; }
.player-rounds-table th:nth-child(2) { width: 11%; }
.player-rounds-table th:nth-child(3) { width: 22%; }
.player-rounds-table th:nth-child(4) { width: 16%; }
.player-rounds-table th:nth-child(5) { width: 12%; }
.player-rounds-table th:nth-child(6) { width: 12%; }
.player-rounds-table th:nth-child(7) { width: 12%; }

.player-wallet-table th:nth-child(1) { width: 17%; }
.player-wallet-table th:nth-child(2) { width: 13%; }
.player-wallet-table th:nth-child(3) { width: 15%; }
.player-wallet-table th:nth-child(4) { width: 12%; }
.player-wallet-table th:nth-child(5) { width: 17%; }
.player-wallet-table th:nth-child(6) { width: 17%; }
.player-wallet-table th:nth-child(7) { width: 9%; }

.player-rounds-table thead th,
.player-wallet-table thead th {
    padding: 8px 10px;
    background: var(--surface-muted);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 11px;
    text-align: left;
    white-space: nowrap;
}

.player-rounds-table tbody td,
.player-wallet-table tbody td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.player-rounds-table tbody td.align-right,
.player-wallet-table tbody td.align-right {
    text-align: right;
}

@media (max-width: 900px) {
    .players-table {
        min-width: 1080px;
    }
}

@media (max-width: 680px) {
    .player-action-meta {
        grid-template-columns: 1fr;
    }

    .player-drawer-panel {
        width: calc(100vw - 12px);
    }

    .player-drawer-head,
    .player-drawer-quick-actions,
    .player-drawer-body {
        padding-inline: 16px;
    }

    .player-rounds-table thead th,
    .player-wallet-table thead th,
    .player-rounds-table tbody td,
    .player-wallet-table tbody td {
        padding-inline: 6px;
    }
}

.player-section-title {
    margin: 18px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--text);
}

.player-section-title small {
    margin-left: 4px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 400;
    text-transform: uppercase;
}

.player-note-form {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

.player-note-form label {
    display: grid;
    gap: 6px;
    color: var(--text-muted);
    font-size: 12px;
}

.player-note-form textarea {
    width: 100%;
    resize: vertical;
    min-height: 72px;
}

.player-note-form .button {
    justify-self: end;
}

.player-notes-list,
.player-audit-list {
    list-style: none;
    margin: 0 0 14px;
    padding: 0;
}

.player-notes-list li,
.player-audit-list li {
    padding: 10px 12px;
    background: var(--surface-muted);
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 12px;
    line-height: 1.5;
}

.player-notes-list .note-meta {
    display: block;
    margin-bottom: 4px;
    color: var(--text-muted);
    font-size: 11px;
}

.player-notes-list .note-meta strong {
    color: var(--text);
}

.player-notes-list p {
    margin: 0;
    color: var(--text);
}

.player-audit-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.player-audit-list .audit-time {
    flex: 0 0 auto;
    font-size: 11px;
    color: var(--text-muted);
}

.player-audit-list .audit-action {
    flex: 0 0 auto;
}

.player-audit-list .audit-meta {
    flex: 1 1 200px;
    color: var(--text);
    font-size: 12px;
}

/* ===== Games 页 rooms tab：单房间调参 + 同步 ===== */
.rooms-toolbar-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.room-cryptocard {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
    padding: 6px 10px;
    background: var(--surface-muted);
    border-radius: 6px;
    font-size: 11px;
    color: var(--text);
}

.room-cryptocard > [data-lucide] {
    flex: 0 0 auto;
    color: var(--green);
}

.room-cryptocard small {
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.room-cryptocard .status {
    margin-left: auto;
}

.room-cryptocard-pending > [data-lucide] {
    color: var(--amber, #b8860b);
}

.room-card-pending {
    border-style: dashed;
    background: rgba(255, 248, 232, 0.4);
}

.room-card-pending .room-card-head strong {
    color: var(--text-muted);
}

.rooms-toolbar-info strong {
    display: block;
    font-size: 13px;
}

.rooms-toolbar-info small {
    color: var(--text-muted);
    font-size: 11px;
}

.room-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.room-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.room-card-overridden {
    border-color: var(--amber, #ecd095);
    box-shadow: 0 0 0 2px var(--amber-soft, #fff8e8);
}

.room-config-state {
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
}

.room-config-global {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--green);
    font-size: 12px;
    font-weight: 600;
}

.room-config-override {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--amber, #8a5400);
    font-size: 12px;
    font-weight: 600;
}

.room-config-state small {
    opacity: 0.6;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-left: 2px;
}

.room-config-detail {
    display: block;
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.5;
}

.room-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.room-actions .text-button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 12px;
    cursor: pointer;
}

.room-actions .text-button:hover {
    border-color: var(--green);
    color: var(--green);
}

.room-actions .text-button-danger:hover {
    border-color: var(--red);
    color: var(--red);
    background: var(--red-soft);
}

.rooms-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 2px 2px;
    padding: 10px 12px;
    background: var(--surface-muted);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* 房间调参对话框 */
.room-config-dialog .modal-body {
    min-width: 0;
}

.room-config-warn {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 16px;
    padding: 10px 12px;
    background: var(--blue-soft, #e6f0fa);
    border: 1px solid var(--blue, #b8d8ee);
    border-radius: 6px;
    color: #1c5c94;
    font-size: 12px;
    line-height: 1.5;
}

.room-config-warn > [data-lucide] {
    flex: 0 0 auto;
    margin-top: 1px;
}

.room-config-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 14px;
}

@media (max-width: 640px) {
    .room-config-grid {
        grid-template-columns: 1fr;
    }
}

.room-config-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.room-config-field-head,
.modal-body .room-config-field-head {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.room-config-field-head input[type="checkbox"] {
    margin: 0;
}

.room-config-field-head strong {
    font-size: 13px;
    font-weight: 600;
}

.room-config-field-head small {
    margin-left: 3px;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.room-config-range {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 12px;
}

.room-config-range input[type="number"],
.room-config-range input[type="text"] {
    width: 80px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    font-size: 12px;
}

.room-config-range input:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 2px var(--green-soft);
}

.room-config-range input:disabled {
    background: var(--surface-muted);
    color: var(--text-muted);
    cursor: not-allowed;
}

.room-config-range small {
    flex: 1 1 100%;
    color: var(--text-muted);
    font-size: 11px;
}

.room-config-range-disabled {
    opacity: 0.6;
}

.room-config-reason {
    display: block;
    margin-bottom: 8px;
}

.room-config-reason > span,
.sync-rooms-reason > span {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}

.room-config-reason textarea,
.sync-rooms-reason textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
}

.room-config-reason textarea:focus,
.sync-rooms-reason textarea:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 2px var(--green-soft);
}

/* 同步全部房间对话框 */
.sync-rooms-warn {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    background: var(--amber-soft, #fff8e8);
    border: 1px solid var(--amber, #ecd095);
    color: #754800;
}

.sync-rooms-warn > [data-lucide] {
    flex: 0 0 auto;
    margin-top: 1px;
    color: var(--amber, #b8860b);
}

.sync-rooms-warn strong {
    display: block;
    margin-bottom: 4px;
    color: #5a3600;
}

.sync-rooms-warn p {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
}

.sync-rooms-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 0 0 16px;
    padding: 12px;
    background: var(--surface-muted);
    border-radius: 6px;
}

.sync-rooms-summary dt {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
}

.sync-rooms-summary dd {
    margin: 0;
    font-size: 13px;
}

.sync-rooms-affected {
    margin-bottom: 16px;
    padding: 12px;
    background: var(--red-soft, #fde8e8);
    border: 1px solid var(--red, #f0c8c8);
    border-radius: 6px;
}

.sync-rooms-affected h3 {
    margin: 0 0 8px;
    font-size: 12px;
    color: #9d2929;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.sync-rooms-affected ul {
    margin: 0;
    padding-left: 16px;
    font-size: 12px;
    color: var(--text);
}

.sync-rooms-affected li {
    margin-bottom: 4px;
}

.sync-rooms-reason {
    display: block;
    margin-bottom: 14px;
}

.sync-rooms-confirm {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    background: var(--surface-muted);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text);
    line-height: 1.5;
    cursor: pointer;
}

.sync-rooms-confirm input[type="checkbox"] {
    margin-top: 2px;
    flex: 0 0 auto;
}

/* ===== 参数模板 ===== */
.config-templates-panel {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px dashed var(--border);
}

.config-templates-panel .panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.config-templates-panel .panel-heading h3 {
    margin: 0 0 2px;
    font-size: 14px;
}

.config-templates-panel .panel-heading h3 small {
    margin-left: 4px;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.config-templates-panel .panel-heading p {
    margin: 0;
    color: var(--text-muted);
    font-size: 11px;
}

.template-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.template-card {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.template-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.template-card-head strong {
    font-size: 13px;
}

.template-card-head small {
    margin-left: 3px;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.template-fields {
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
}

.template-fields dt {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
}

.template-fields dd {
    margin: 0;
    font-size: 12px;
}

.template-meta {
    color: var(--text-muted);
    font-size: 11px;
}

.template-actions {
    display: flex;
    gap: 4px;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
}

.template-actions .text-button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 5px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
}

.template-actions .text-button:hover {
    border-color: var(--green);
    color: var(--green);
}

.template-actions .text-button-danger:hover {
    border-color: var(--red);
    color: var(--red);
    background: var(--red-soft);
}

.config-templates-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px 2px 2px;
    padding: 10px 12px;
    background: var(--surface-muted);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* 房间调参对话框里的"从模板填充"下拉 */
.room-config-template-select {
    display: block;
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-muted);
}

.room-config-template-select > span {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    color: var(--text);
    font-weight: 600;
}

.room-config-template-select > span small {
    margin-left: 3px;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 400;
}

.room-config-template-hint {
    margin-left: 4px;
    color: var(--text-muted);
    font-style: italic;
    font-weight: 400;
    font-size: 11px;
}

.room-config-template-select select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
}

.room-config-template-select select:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 2px var(--green-soft);
}

/* 模板编辑对话框 */
.template-dialog .modal-body {
    min-width: 0;
}

.template-dialog-warn {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 16px;
    padding: 10px 12px;
    background: var(--blue-soft, #e6f0fa);
    border: 1px solid var(--blue, #b8d8ee);
    border-radius: 6px;
    color: #1c5c94;
    font-size: 12px;
    line-height: 1.5;
}

.template-field {
    display: block;
    margin-bottom: 12px;
}

.template-field > span {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}

.template-field > span small {
    margin-left: 3px;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 400;
}

.template-field em.required {
    margin-left: 4px;
    color: var(--red);
    font-size: 11px;
    font-style: normal;
    font-weight: 600;
}

.template-field input,
.template-field textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
}

.template-field input:focus,
.template-field textarea:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 2px var(--green-soft);
}

.template-params-section {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin: 18px 0 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.template-params-section strong {
    font-size: 13px;
}

.template-params-section strong small {
    margin-left: 3px;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 400;
}

.template-params-section .template-params-sub {
    color: var(--text-muted);
    font-size: 11px;
}

.report-grid,
.settings-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.7fr);
    gap: 18px;
}

.chart-legend {
    display: flex;
    gap: 14px;
    color: var(--text-muted);
    font-size: 12px;
}

.chart-legend span {
    display: flex;
    align-items: center;
}

.legend-dot.bet { background: #2878c8; }
.legend-dot.payout { background: #68aa87; }

/* ===== Auth / Standalone pages (Login / ChangePassword / Error) ===== */
.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(180deg, #1b2530 0%, #0f1620 100%);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px 28px 24px;
    box-shadow: var(--shadow);
}

.auth-card.wide {
    max-width: 520px;
}

.auth-card .auth-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.auth-card .auth-brand .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--green);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.5px;
}

.auth-card .auth-brand strong {
    display: block;
    font-size: 15px;
}

.auth-card .auth-brand small {
    color: var(--text-muted);
    font-size: 12px;
}

.auth-card h1 {
    margin: 0 0 6px;
    font-size: 22px;
}

.auth-card .auth-sub {
    margin: 0 0 20px;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.5;
}

.auth-card .form-field {
    display: block;
    margin-bottom: 14px;
}

.auth-card .form-field span {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.3px;
}

.auth-card input[type="password"],
.auth-card input[type="text"],
.auth-card input[type="email"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg);
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-card input:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px var(--green-soft);
}

.auth-card .auth-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.auth-card .auth-actions .button {
    flex: 1;
}

.auth-card .auth-back {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
    text-decoration: none;
}

.auth-card .auth-back:hover {
    color: var(--text);
}

.auth-card .password-strength {
    margin: -6px 0 14px;
    font-size: 11px;
    color: var(--text-muted);
}

.auth-card .password-strength.weak   { color: var(--red); }
.auth-card .password-strength.medium { color: var(--amber); }
.auth-card .password-strength.strong { color: var(--green); }

.auth-card .password-rules {
    margin: -4px 0 16px;
    padding: 10px 12px;
    background: var(--surface-muted);
    border-radius: 6px;
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.7;
}

.auth-card .password-rules code {
    color: var(--text);
}

/* Login 页专属 */
.login-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.5;
}

.login-alert > [data-lucide] {
    flex: 0 0 auto;
    margin-top: 1px;
}

.login-alert-danger {
    background: var(--red-soft, #fde8e8);
    border: 1px solid var(--red, #f0c8c8);
    color: #9d2929;
}

.login-alert-warning {
    background: var(--amber-soft, #fff8e8);
    border: 1px solid var(--amber, #ecd095);
    color: #754800;
}

.login-alert-success {
    background: var(--green-soft, #e6f4ee);
    border: 1px solid var(--green, #b8dcc8);
    color: #18633f;
}

.login-demo-hint {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    line-height: 1.5;
}

.login-demo-hint > [data-lucide] {
    flex: 0 0 auto;
    margin-top: 1px;
}

.login-demo-hint small {
    font-size: 11px;
}

/* ===== Infrastructure 页 ===== */
.infra-hosts-panel,
.infra-managed-services-panel,
.infra-health-panel {
    margin-top: 18px;
}

.infra-managed-services-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    font-size: 13px;
}

.infra-managed-services-table th,
.infra-managed-services-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

.infra-managed-services-table th {
    color: var(--text-muted);
    background: var(--surface-muted);
    font-size: 12px;
    white-space: nowrap;
}

.infra-managed-services-table tbody tr:last-child td {
    border-bottom: 0;
}

.managed-service-name {
    display: grid;
    gap: 2px;
}

.managed-service-name small,
.managed-service-detail {
    color: var(--text-muted);
    font-size: 11px;
}

.managed-service-actions {
    display: flex;
    gap: 6px;
    white-space: nowrap;
}

.managed-service-actions .icon-button {
    width: 32px;
    height: 32px;
}

.infra-managed-services-panel > .commands-note {
    margin: 0;
    border-top: 1px solid var(--border);
    border-radius: 0;
}

.infra-hosts-filter select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    font-size: 12px;
}

.infra-hosts-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.infra-hosts-table thead th {
    padding: 10px 12px;
    background: var(--surface-muted);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 12px;
    text-align: left;
    white-space: nowrap;
}

.infra-hosts-table thead th.align-right {
    text-align: right;
}

.infra-hosts-table tbody td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    white-space: nowrap;
}

.infra-hosts-table tbody td.align-right {
    text-align: right;
}

.infra-hosts-table tbody tr:last-child td {
    border-bottom: none;
}

.infra-hosts-table tbody tr.is-hidden {
    display: none;
}

/* 主机行可点击 + 合部署/独立机徽章 */
.infra-hosts-table .host-row {
    cursor: pointer;
    transition: background 0.12s;
}

.infra-hosts-table .host-row:hover {
    background: var(--surface-muted);
}

.infra-hosts-table .host-row.is-open .round-toggle-icon {
    transform: rotate(180deg);
    color: var(--green);
}

.infra-hosts-table .round-toggle-icon {
    transition: transform 0.15s;
    color: var(--text-muted);
}

.host-shared-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--amber-soft, #fff8e8);
    color: #8a5400;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid var(--amber, #ecd095);
}

.host-shared-badge small {
    text-transform: uppercase;
    font-size: 11px;
    margin-left: 2px;
    opacity: 0.7;
}

.host-isolated-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--blue-soft, #e6f0fa);
    color: #1c5c94;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid var(--blue, #b8d8ee);
}

.host-services-count {
    margin-left: 6px;
    color: var(--text-muted);
    font-size: 11px;
}

/* 主机详情展开行 */
.host-detail-row {
    background: var(--surface-muted);
}

.host-detail-row.is-hidden {
    display: none;
}

.host-detail-row > td {
    padding: 14px;
}

.host-services-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.host-service-item {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 8px 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
}

.host-service-item strong {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

.host-detail-note {
    display: block;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.5;
}

.infra-role-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.infra-role-badge.admin { background: var(--blue-soft, #e6f0fa); color: #1c5c94; }
.infra-role-badge.gameserver { background: var(--green-soft, #e6f4ee); color: #18633f; }
.infra-role-badge.platformservice { background: rgba(109, 101, 168, 0.12); color: #6d65a8; }
.infra-role-badge.cryptocard { background: var(--amber-soft, #fff8e8); color: #8a5400; }
.infra-role-badge.mongodb { background: rgba(83, 144, 91, 0.12); color: #53905b; }
.infra-role-badge.proxy { background: #edf0f2; color: #58636e; }

.infra-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px 2px 2px;
    padding: 10px 12px;
    background: var(--surface-muted);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* 加密卡管理页 */
.card-gateway-overview {
    margin-top: 18px;
    overflow: hidden;
}

.card-gateway-certificates {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
    overflow: hidden;
    border-radius: 12px;
}

/* Communication certificates are a low-frequency operation. Keep the main
   CardGateway workspace unobstructed and slide this panel in from the right
   only when the operator explicitly opens it. */
.card-gateway-cert-drawer {
    position: fixed;
    z-index: 1200;
    top: var(--topbar-height);
    right: 0;
    bottom: 0;
    width: min(600px, calc(100vw - 20px));
    max-width: 100vw;
    border: 1px solid var(--border);
    border-right: 0;
    border-radius: 16px 0 0 16px;
    background: var(--surface);
    box-shadow: -18px 0 42px rgba(24, 34, 44, 0.18);
    transform: translateX(105%);
    transition: transform 180ms ease;
}

.card-gateway-cert-drawer.is-open {
    transform: translateX(0);
}

.card-gateway-cert-drawer .panel-heading {
    flex: 0 0 auto;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}

.card-gateway-cert-drawer .panel-heading > div:first-child {
    min-width: 0;
}

.card-gateway-cert-drawer .panel-heading p {
    max-width: 420px;
}

.card-gateway-cert-scrim {
    position: fixed;
    z-index: 1190;
    inset: var(--topbar-height) 0 0;
    display: block;
    width: 100%;
    border: 0;
    padding: 0;
    background: rgba(18, 27, 35, 0.28);
    cursor: pointer;
    opacity: 0;
    transition: opacity 180ms ease;
}

.card-gateway-cert-scrim.is-visible {
    opacity: 1;
}

.card-gateway-cert-scrim[hidden] {
    display: none;
}

body.card-gateway-cert-drawer-open {
    overflow: hidden;
}

.card-gateway-cert-heading-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.card-gateway-cert-toggle {
    white-space: nowrap;
}

.card-gateway-cert-toggle [data-lucide] {
    transition: transform 160ms ease;
}

.card-gateway-cert-body {
    display: grid;
    flex: 1 1 auto;
    min-height: 0;
    gap: 18px;
    padding: 0 18px 18px;
    max-height: none;
    overflow-y: auto;
}

.card-gateway-cert-body > * {
    min-width: 0;
}

.card-gateway-cert-body[hidden] {
    display: none;
}

.card-gateway-cert-current {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.card-gateway-cert-current > div {
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    background: var(--surface-muted);
}

.card-gateway-cert-current small,
.card-gateway-cert-current strong {
    display: block;
}

.card-gateway-cert-current small {
    margin-bottom: 6px;
    color: var(--text-muted);
}

.card-gateway-cert-current strong {
    overflow-wrap: anywhere;
    color: var(--text-primary);
    line-height: 1.45;
    white-space: normal;
}

.card-gateway-cert-section {
    display: grid;
    gap: 10px;
}

.card-gateway-cert-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    flex-wrap: wrap;
}

.card-gateway-cert-section-heading > div {
    min-width: 0;
}

.card-gateway-cert-section-heading .eyebrow {
    margin: 0 0 2px;
}

.card-gateway-cert-section-heading small {
    color: var(--text-muted);
    line-height: 1.4;
}

.card-gateway-cert-current {
    gap: 10px 12px;
}

.card-gateway-cert-current > div {
    padding: 10px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: var(--surface-muted);
}

.card-gateway-cert-current dt,
.card-gateway-cert-current dd {
    display: block;
}

.card-gateway-cert-current dt {
    margin-bottom: 4px;
    color: var(--text-muted);
    font-size: 11px;
    letter-spacing: 0.2px;
    text-transform: uppercase;
}

.card-gateway-cert-current dt small {
    margin-left: 3px;
    opacity: 0.65;
    font-size: 10px;
    text-transform: uppercase;
}

.card-gateway-cert-current dd {
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--text-primary);
    font-size: 13px;
}

.card-gateway-cert-upload {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    background: var(--surface-muted);
}

.card-gateway-cert-upload-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.card-gateway-cert-upload-fields label {
    display: grid;
    gap: 6px;
    min-width: 0;
    overflow-wrap: anywhere;
}

.card-gateway-cert-upload-fields label > span {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.card-gateway-cert-upload-fields label > input,
.card-gateway-cert-upload-fields label > select,
.card-gateway-cert-upload-fields label > textarea {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.card-gateway-cert-upload-fields label > input[type="file"] {
    min-height: 36px;
    padding: 5px 6px;
    font-size: 12px;
    overflow: hidden;
}

.card-gateway-cert-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.card-gateway-cert-actions .button {
    min-width: 0;
    white-space: normal;
    text-align: center;
}

.card-gateway-cert-switch {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 10px;
    padding-top: 2px;
}

.card-gateway-cert-switch label {
    display: grid;
    min-width: 0;
    gap: 6px;
}

.card-gateway-cert-switch label > span {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
}

.card-gateway-cert-switch select {
    width: 100%;
    min-width: 0;
}

.card-gateway-cert-table-wrap {
    max-height: 360px;
    overflow: auto;
}

.card-gateway-cert-table {
    min-width: 760px;
    table-layout: fixed;
}

.card-gateway-cert-table th,
.card-gateway-cert-table td {
    vertical-align: middle;
}

.card-gateway-cert-table th:nth-child(1) { width: 18%; }
.card-gateway-cert-table th:nth-child(2) { width: 25%; }
.card-gateway-cert-table th:nth-child(3) { width: 27%; }
.card-gateway-cert-table th:nth-child(4) { width: 15%; }
.card-gateway-cert-table th:nth-child(5) { width: 15%; }

.card-gateway-cert-table .mono {
    overflow-wrap: anywhere;
}

.card-gateway-cert-table .cert-version-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.card-gateway-overview .infra-card-statusbar {
    border-bottom: 0;
}

.infra-card-statusbar {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto minmax(520px, 1.65fr);
    align-items: center;
    gap: 18px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-muted);
}

.infra-card-identity {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.infra-card-icon {
    display: inline-grid;
    width: 34px;
    height: 34px;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid rgba(24, 99, 63, 0.2);
    border-radius: 6px;
    background: var(--green-soft, #e6f4ee);
    color: #18633f;
}

.infra-card-icon svg {
    width: 18px;
    height: 18px;
}

.infra-card-identity strong,
.infra-card-workspace-head strong {
    display: block;
    font-size: 14px;
}

.infra-card-identity small,
.infra-card-workspace-head small {
    display: block;
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 11px;
}

.infra-card-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--border);
}

.infra-card-kpis > div {
    min-width: 0;
    padding: 8px 10px;
    background: var(--surface);
}

.infra-card-kpis dt {
    margin-bottom: 2px;
    color: var(--text-muted);
    font-size: 11px;
}

.infra-card-kpis dd {
    margin: 0;
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-gateway-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 18px;
    margin-top: 18px;
}

.infra-card-summary {
    min-width: 0;
    padding: 18px;
    background: var(--surface-muted);
}

.infra-card-workspace {
    min-width: 0;
    padding: 18px;
}

.card-gateway-workspace,
.card-gateway-diagnostics {
    min-width: 0;
}

.infra-card-workspace-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

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

.infra-card-game-field {
    display: grid;
    grid-template-columns: auto minmax(150px, 190px);
    align-items: center;
    gap: 7px;
    margin: 0;
}

.infra-card-game-field > span {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
}

.infra-card-game-field select {
    width: 100%;
    min-height: 36px;
    padding: 7px 30px 7px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background-color: var(--surface);
}

.infra-cc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

.infra-cc-head strong {
    font-size: 14px;
}

.infra-cc-fields {
    margin: 0 0 12px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

.infra-cc-fields > div {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
}

.infra-cc-fields dt {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.infra-cc-fields dt small {
    text-transform: none;
    margin-left: 2px;
}

.infra-cc-fields dd {
    margin: 0;
    font-size: 12px;
    overflow-wrap: anywhere;
}

.infra-card-command-field dd {
    line-height: 1.55;
}

.infra-card-endpoint {
    display: block;
    max-width: 100%;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-gateway-health {
    display: grid;
    gap: 6px;
    margin: 14px 0;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
}

.card-gateway-health .status {
    justify-self: start;
}

.card-gateway-health > small {
    color: var(--text-muted);
    line-height: 1.45;
}

.infra-card-error-block {
    margin: 12px 0;
    padding: 10px 12px;
    border-left: 3px solid var(--red, #c73b3b);
    background: var(--red-soft, #fde8e8);
}

.infra-card-error-block small {
    color: #9d2929;
    font-size: 11px;
    font-weight: 700;
}

.infra-card-error-block p {
    margin: 4px 0 0;
    color: var(--text);
    font-size: 11px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.infra-cc-fields .muted {
    color: var(--text-muted);
    font-size: 11px;
}

.infra-cc-rooms {
    margin: 10px 0;
    padding: 10px;
    background: var(--surface-muted);
    border-radius: 6px;
}

.card-gateway-workspace > .infra-cc-rooms {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid var(--border);
}

.card-room-parameter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--border);
}

.card-room-parameter-grid > div {
    display: block;
    padding: 10px 12px;
    border-bottom: 0;
    background: var(--surface);
}

.card-room-parameter-grid dd {
    margin-top: 5px;
    font-size: 13px;
}

.infra-card-detail-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin: 14px 0 9px;
}

.infra-card-detail-heading > div,
.infra-card-detail-heading strong,
.infra-card-detail-heading small {
    display: block;
}

.infra-card-detail-heading strong {
    font-size: 13px;
}

.infra-card-detail-heading small {
    margin-top: 3px;
}

.infra-card-account-section,
.infra-card-bank-current {
    margin-top: 16px;
    padding-top: 2px;
    border-top: 1px solid var(--border);
}

.infra-card-account-totals,
.infra-card-bank-current-values {
    display: grid;
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--border);
    gap: 1px;
}

.infra-card-account-totals {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.infra-card-bank-current-values {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.infra-card-account-totals > div,
.infra-card-bank-current-values > div {
    min-width: 0;
    padding: 10px 12px;
    background: var(--surface);
}

.infra-card-account-totals dt,
.infra-card-bank-current-values dt {
    color: var(--text-muted);
    font-size: 11px;
}

.infra-card-account-totals dd,
.infra-card-bank-current-values dd {
    margin: 5px 0 0;
    overflow-wrap: anywhere;
    font-size: 13px;
    font-weight: 700;
}

.infra-card-account-items {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.infra-card-account-items > div {
    display: grid;
    min-width: 0;
    gap: 4px;
    padding: 10px 12px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.infra-card-account-items > div:nth-child(4n) {
    border-right: 0;
}

.infra-card-account-items > div:nth-last-child(-n + 4) {
    border-bottom: 0;
}

.infra-card-account-items strong {
    font-size: 12px;
}

.infra-card-account-items span {
    color: var(--text-muted);
    font-size: 11px;
}

.infra-card-account-items > .muted {
    grid-column: 1 / -1;
    padding: 14px;
}

.infra-cc-rooms small {
    display: block;
    color: var(--text-muted);
    font-size: 11px;
    margin-bottom: 6px;
}

.infra-cc-room-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.infra-card-room-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(210px, 0.42fr);
    gap: 14px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.infra-card-bank-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(90px, 1fr)) auto;
    align-items: end;
    gap: 10px;
}

.infra-card-action-heading {
    grid-column: 1 / -1;
}

.infra-card-action-heading strong,
.infra-card-action-heading small {
    display: block;
}

.infra-card-action-heading small {
    margin: 3px 0 0;
}

.infra-card-bank-form label {
    display: grid;
    gap: 5px;
}

.infra-card-bank-form label > span {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
}

.infra-card-bank-form input,
.infra-card-bank-form select {
    width: 100%;
    min-height: 36px;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
}

.infra-card-reset-action {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    padding-left: 14px;
    border-left: 1px solid var(--border);
}

.infra-card-create-form {
    display: flex;
    align-items: center;
    margin: 0;
}

.infra-card-table-wrap {
    min-height: 220px;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.infra-card-filterbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.infra-card-filterbar .filter-search {
    width: min(320px, 100%);
}

.infra-card-table {
    table-layout: fixed;
}

.infra-card-table th,
.infra-card-table td {
    padding-inline: 10px;
}

.infra-card-table th:nth-child(1) { width: 18%; }
.infra-card-table th:nth-child(2) { width: 28%; }
.infra-card-table th:nth-child(3) { width: 14%; }
.infra-card-table th:nth-child(4) { width: 24%; }
.infra-card-table th:nth-child(5) { width: 16%; }

.infra-card-table td {
    white-space: normal;
    overflow-wrap: anywhere;
}

.infra-card-table tbody tr:only-child td[colspan] {
    height: 150px;
    text-align: center;
    vertical-align: middle;
}

.infra-card-table .infra-card-empty-state {
    background: var(--surface);
    color: var(--red, #b83232);
    font-size: 12px;
    font-weight: 600;
}

.infra-card-table .infra-card-actions-cell {
    white-space: nowrap;
}

.infra-card-table .infra-card-actions {
    justify-content: flex-start;
}

.infra-card-assignment-detail {
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.45;
}

.infra-card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.infra-card-actions .icon-button.is-loading [data-lucide] {
    animation: infra-card-spin 800ms linear infinite;
}

#infra-card-refresh.is-loading [data-lucide],
#view-card-gateway [data-action="refresh"].is-loading [data-lucide] {
    animation: infra-card-spin 800ms linear infinite;
}

@keyframes infra-card-spin {
    to { transform: rotate(360deg); }
}

.card-gateway-note {
    margin-top: 14px;
}

.card-gateway-audit {
    margin-top: 0;
}

#infra-card-list-summary {
    margin: 9px 0 0;
}

#room-details-body tr.is-highlighted td {
    background: var(--amber-soft);
    transition: background 300ms ease;
}

.card-batch-progress {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
}

.card-batch-progress progress {
    width: 100%;
}

@media (max-width: 1100px) {
    .card-gateway-cert-current,
    .card-gateway-cert-upload-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .infra-card-statusbar {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .infra-card-kpis {
        grid-column: 1 / -1;
    }

    .card-gateway-layout {
        grid-template-columns: 1fr;
    }

    .infra-card-summary {
        background: var(--surface);
    }

    .infra-card-room-actions {
        grid-template-columns: 1fr;
    }

    .infra-card-account-items,
    .infra-card-bank-current-values {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .infra-card-account-items > div:nth-child(4n) {
        border-right: 1px solid var(--border);
    }

    .infra-card-account-items > div:nth-child(2n) {
        border-right: 0;
    }

    .infra-card-account-items > div:nth-last-child(-n + 4) {
        border-bottom: 1px solid var(--border);
    }

    .infra-card-account-items > div:nth-last-child(-n + 2) {
        border-bottom: 0;
    }

    .infra-card-reset-action {
        padding-top: 12px;
        padding-left: 0;
        border-top: 1px solid var(--border);
        border-left: 0;
    }
}

@media (max-width: 680px) {
    .card-gateway-cert-current,
    .card-gateway-cert-upload-fields {
        grid-template-columns: 1fr;
    }

    .card-gateway-cert-upload {
        padding: 12px;
    }

    .card-gateway-cert-body {
        padding: 0 12px 12px;
    }

    .card-gateway-cert-switch {
        grid-template-columns: 1fr;
    }

    .infra-card-statusbar,
    .infra-card-workspace,
    .infra-card-summary {
        padding: 14px;
    }

    .infra-card-statusbar {
        grid-template-columns: 1fr;
    }

    .infra-card-statusbar > .status {
        justify-self: start;
    }

    .infra-card-kpis {
        grid-column: auto;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .infra-card-workspace-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .infra-card-workspace-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .infra-card-game-field {
        grid-template-columns: auto minmax(0, 1fr);
        width: 100%;
    }

    .infra-card-filterbar {
        align-items: stretch;
        flex-direction: column;
    }

    .infra-card-create-form {
        flex: 1;
    }

    .infra-card-create-form .button {
        width: 100%;
    }

    .infra-card-bank-form {
        grid-template-columns: 1fr;
    }

    .card-room-parameter-grid {
        grid-template-columns: 1fr;
    }

    .infra-card-account-totals,
    .infra-card-bank-current-values,
    .infra-card-account-items {
        grid-template-columns: 1fr;
    }

    .infra-card-account-items > div,
    .infra-card-account-items > div:nth-child(2n),
    .infra-card-account-items > div:nth-child(4n) {
        border-right: 0;
    }

    .infra-card-account-items > div:nth-last-child(-n + 2) {
        border-bottom: 1px solid var(--border);
    }

    .infra-card-account-items > div:last-child {
        border-bottom: 0;
    }

    .infra-card-reset-action {
        align-items: stretch;
        flex-direction: column;
    }

    .infra-card-reset-action .button {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .infra-card-table th:nth-child(2),
    .infra-card-table td:nth-child(2) {
        display: none;
    }

    .infra-card-table th:nth-child(1) { width: 30%; }
    .infra-card-table th:nth-child(3) { width: 22%; }
    .infra-card-table th:nth-child(4) { width: 28%; }
    .infra-card-table th:nth-child(5) { width: 20%; }
}

.room-tag {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--green-soft, #e6f4ee);
    color: #18633f;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 11px;
}

.infra-cc-warn {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin: 0;
    padding: 12px 18px;
    border-top: 1px dashed var(--border);
    color: var(--text-muted);
}

.infra-cc-warn > [data-lucide] {
    flex: 0 0 auto;
    margin-top: 1px;
    color: var(--amber, #b8860b);
}

.infra-cc-warn small {
    font-size: 11px;
    line-height: 1.5;
}

/* 依赖健康检查 */
.infra-health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.infra-health-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.infra-health-item.is-failed {
    border-color: var(--red);
    background: var(--red-soft);
}

.infra-health-name {
    font-size: 13px;
    font-weight: 600;
}

.infra-health-item small {
    color: var(--text-muted);
    font-size: 11px;
}

.infra-environment-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    margin: 0;
}

.infra-environment-grid > div {
    min-width: 0;
    padding: 14px 18px;
    border-right: 1px solid var(--border);
}

.infra-environment-grid > div:last-child {
    border-right: 0;
}

.infra-environment-grid dt {
    margin-bottom: 5px;
    color: var(--text-muted);
    font-size: 11px;
}

.infra-environment-grid dd {
    overflow-wrap: anywhere;
    margin: 0;
    font-weight: 600;
}

.environment-badge.is-test {
    color: #174c78;
    background: #e9f4ff;
    border-color: #a8cce9;
}

.environment-badge.is-production {
    color: #8b2020;
    background: var(--red-soft);
    border-color: #e5a4a4;
}

.table-wrap thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--surface-muted);
}

@media (max-width: 900px) {
    .infra-environment-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .infra-environment-grid > div:nth-child(2) {
        border-right: 0;
    }
}

@media (max-width: 640px) {
    .infra-environment-grid {
        grid-template-columns: 1fr;
    }

    .infra-environment-grid > div {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .infra-environment-grid > div:last-child {
        border-bottom: 0;
    }
}

/* Dashboard 待审批面板 */
.dashboard-approval-panel {
    margin-top: 18px;
}

.approval-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.approval-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 8px;
    background: var(--surface);
    transition: border-color 0.12s;
}

.approval-item:hover {
    border-color: var(--green);
}

.approval-item-icon {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--amber-soft, #fff8e8);
    color: var(--amber, #b8860b);
}

.approval-item-body {
    flex: 1 1 auto;
}

.approval-item-body strong {
    display: block;
    font-size: 13px;
}

.approval-item-body small {
    color: var(--text-muted);
    font-size: 11px;
}

.approval-item-actions {
    display: flex;
    gap: 6px;
}

.approval-item-actions .button {
    padding: 5px 10px;
    font-size: 12px;
    min-height: 0;
}

/* ===== Games 控制命令面板 ===== */
.servers-table,
.commands-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.servers-table thead th,
.commands-table thead th {
    padding: 9px 10px;
    background: var(--surface-muted);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 11px;
    text-align: left;
    white-space: nowrap;
}

.servers-table thead th small,
.commands-table thead th small {
    margin-left: 2px;
    opacity: 0.7;
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 400;
}

.servers-table tbody td,
.commands-table tbody td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    white-space: nowrap;
}

.servers-table tbody td.align-right,
.commands-table tbody td.align-right {
    text-align: right;
}

.servers-table tbody tr:hover,
.commands-table tbody tr:hover {
    background: var(--surface-muted);
}

.server-fleet-head,
.server-selection-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.server-fleet-head {
    margin-bottom: 12px;
}

.server-fleet-head h3 {
    font-size: 15px;
}

.server-fleet-head h3 small {
    margin-left: 4px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
}

.server-fleet-head p,
.server-selection-bar small {
    display: block;
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 11px;
}

.server-fleet-stats {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--text-muted);
    font-size: 11px;
}

.server-fleet-stats strong {
    color: var(--text);
}

.server-live-stat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.server-live-stat i {
    width: 7px;
    height: 7px;
    background: var(--green);
    border-radius: 50%;
    box-shadow: 0 0 0 4px var(--green-soft);
}

.server-selection-bar {
    min-height: 58px;
    margin-bottom: 10px;
    padding: 9px 10px 9px 14px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.server-selection-bar strong {
    font-size: 12px;
}

.server-control-table .server-select-cell {
    width: 42px;
    text-align: center;
}

.server-control-table input[type="checkbox"] {
    margin: 0;
    accent-color: var(--green);
}

.server-config-receipt {
    min-width: 180px;
}

.server-config-error {
    max-width: 280px;
    color: #9d2929;
    overflow-wrap: anywhere;
}

.server-control-table tr.is-draining,
.server-control-table tr.is-draining:hover {
    background: #fff8e8;
}

.server-control-table tr.is-hidden {
    display: none;
}

.server-heartbeat-note {
    margin-top: 12px;
}

.server-heartbeat-note > span {
    min-width: 0;
}

.commands-section {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.commands-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    align-items: end;
    margin-bottom: 12px;
}

.cmd-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cmd-field > span {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
}

.cmd-field > span small {
    margin-left: 3px;
    opacity: 0.6;
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 400;
}

.cmd-field select,
.cmd-field input {
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    font-size: 12px;
}

.cmd-field select:focus,
.cmd-field input:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 2px var(--green-soft);
}

.cmd-field-params.is-hidden {
    display: none;
}

.commands-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 2px 0;
    padding: 10px 12px;
    background: var(--surface-muted);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

.commands-note code {
    background: rgba(255,255,255,0.5);
    padding: 1px 4px;
    border-radius: 3px;
}

.game-connection-presets {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-muted);
}

.game-connection-presets div {
    display: grid;
    gap: 2px;
}

.game-connection-presets small {
    color: var(--text-muted);
}

@media (max-width: 640px) {
    .game-connection-presets {
        align-items: flex-start;
        flex-direction: column;
    }
}

.commands-history .panel-heading h3 small {
    margin-left: 4px;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 400;
}

.server-stop-dialog {
    width: min(680px, calc(100vw - 32px));
}

.managed-service-dialog {
    width: min(620px, calc(100vw - 32px));
}

.managed-service-warning {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
    color: #245d42;
    background: var(--green-soft);
    border: 1px solid #b8dcc8;
    border-radius: 6px;
}

.managed-service-warning.is-stop {
    color: #743030;
    background: var(--red-soft);
    border-color: #efcaca;
}

.managed-service-warning p {
    margin-top: 3px;
    font-size: 12px;
    line-height: 1.55;
}

.managed-service-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border: 1px solid var(--border);
    border-radius: 6px;
}

.managed-service-summary > div {
    min-width: 0;
    padding: 10px 12px;
    border-right: 1px solid var(--border);
}

.managed-service-summary > div:last-child {
    border-right: 0;
}

.managed-service-summary dt {
    color: var(--text-muted);
    font-size: 11px;
}

.managed-service-summary dd {
    margin-top: 3px;
    overflow-wrap: anywhere;
    font-weight: 700;
}

.server-stop-warning {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
    color: #743030;
    background: var(--red-soft);
    border: 1px solid #efcaca;
    border-radius: 6px;
}

.server-stop-warning > [data-lucide] {
    width: 20px;
    height: 20px;
    margin-top: 1px;
}

.server-stop-warning p {
    margin-top: 3px;
    font-size: 12px;
    line-height: 1.55;
}

.server-stop-impact {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border: 1px solid var(--border);
    border-radius: 6px;
}

.server-stop-impact > div {
    padding: 10px 12px;
    border-right: 1px solid var(--border);
}

.server-stop-impact > div:last-child {
    border-right: 0;
}

.server-stop-impact dt,
.server-stop-targets > span {
    color: var(--text-muted);
    font-size: 11px;
}

.server-stop-impact dd {
    margin-top: 3px;
    font-size: 17px;
    font-weight: 700;
}

.server-stop-targets {
    display: grid;
    gap: 7px;
}

.server-stop-targets ul {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0;
    list-style: none;
}

.server-stop-targets li {
    padding: 5px 8px;
    color: #34404b;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 11px;
}

.server-stop-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 0;
    list-style: none;
}

.server-stop-steps li {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 1px 7px;
    padding: 9px;
    background: var(--surface-muted);
    border-radius: 6px;
}

.server-stop-steps li > span {
    display: grid;
    width: 22px;
    height: 22px;
    grid-row: span 2;
    place-items: center;
    color: #fff;
    background: #596872;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
}

.server-stop-steps strong {
    font-size: 11px;
}

.server-stop-steps small {
    color: var(--text-muted);
    font-size: 11px;
}

.modal-body .server-stop-confirm {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-weight: 500;
}

.modal-body .server-stop-confirm input {
    flex: 0 0 auto;
    margin-top: 1px;
    accent-color: var(--red);
}

.modal-body .server-stop-confirm span {
    line-height: 1.45;
}

/* ===== Games 维护窗口 ===== */
.maintenance-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px;
}

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

.maintenance-status-current {
    border-color: var(--amber, #ecd095);
    background: linear-gradient(180deg, var(--amber-soft, #fff8e8) 0%, var(--surface) 50%);
}

.maintenance-status-planned {
    border-style: dashed;
}

.ms-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.ms-head > [data-lucide] {
    flex: 0 0 auto;
}

.ms-head strong {
    font-size: 13px;
    flex: 1 1 auto;
}

.ms-head strong small {
    margin-left: 3px;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 400;
    letter-spacing: 0.3px;
}

.ms-fields {
    margin: 0 0 10px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px 12px;
}

.ms-fields > div {
    padding: 6px 8px;
    background: var(--surface-muted);
    border-radius: 4px;
}

.ms-fields dt {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
}

.ms-fields dd {
    margin: 0;
    font-size: 12px;
}

.ms-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.maintenance-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.maintenance-table thead th {
    padding: 9px 10px;
    background: var(--surface-muted);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 11px;
    text-align: left;
}

.maintenance-table tbody td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.maintenance-table tbody tr:last-child td {
    border-bottom: none;
}

/* ===== Games 回合详情四分区 ===== */
.rounds-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.rounds-table thead th {
    padding: 9px 10px;
    background: var(--surface-muted);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 11px;
    text-align: left;
    white-space: nowrap;
}

.rounds-table thead th.align-right { text-align: right; }

.rounds-table .round-row {
    cursor: pointer;
    transition: background 0.12s;
}

.rounds-table .round-row:hover {
    background: var(--surface-muted);
}

.rounds-table .round-row td {
    padding: 10px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.rounds-table .round-row td.align-right {
    text-align: right;
}

.round-toggle-icon {
    transition: transform 0.15s;
    color: var(--text-muted);
}

.rounds-table .round-row.is-open .round-toggle-icon {
    transform: rotate(180deg);
    color: var(--green);
}

.round-detail-row {
    background: var(--surface-muted);
}

.round-detail-row.is-hidden {
    display: none;
}

.round-detail-row > td {
    padding: 14px;
}

.round-detail-quad {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (max-width: 760px) {
    .round-detail-quad {
        grid-template-columns: 1fr;
    }
}

.round-quad {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.round-quad-wide {
    grid-column: 1 / -1;
}

.round-quad h4 {
    margin: 0 0 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    color: var(--text);
}

.round-quad h4 small {
    margin-left: 3px;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 400;
    letter-spacing: 0.3px;
}

.rq-fields {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.rq-fields > div {
    padding: 4px 6px;
    background: var(--surface-muted);
    border-radius: 4px;
}

.rq-fields dt {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 1px;
}

.rq-fields dd {
    margin: 0;
    font-size: 11px;
    word-break: break-all;
}

.rq-empty {
    display: block;
    color: var(--text-muted);
    font-size: 11px;
    font-style: italic;
    padding: 8px 4px;
}

.rq-odds-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(110px, 1fr));
    gap: 6px;
}

.rq-odds-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface-muted);
    font-size: 11px;
}

.rq-odds-item strong {
    color: var(--text);
    font-size: 12px;
}

.rq-odds-item.is-winning {
    border-color: var(--green);
    background: var(--green-soft);
}

.rq-player-table {
    overflow-x: auto;
}

.rq-player-table table {
    min-width: 760px;
}

.rq-player-table td.rq-bet-lines {
    min-width: 260px;
    white-space: normal;
}

.rq-bet-lines > div + div {
    margin-top: 3px;
}

.rq-bet-lines .is-cancelled {
    color: var(--text-muted);
    text-decoration: line-through;
}

@media (max-width: 1100px) {
    .rq-odds-grid {
        grid-template-columns: repeat(3, minmax(110px, 1fr));
    }
}

@media (max-width: 560px) {
    .rq-odds-grid {
        grid-template-columns: repeat(2, minmax(105px, 1fr));
    }
}

.rq-mini-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.rq-mini-table th,
.rq-mini-table td {
    padding: 4px 6px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}

.rq-mini-table th.align-right,
.rq-mini-table td.align-right {
    text-align: right;
}

.rq-audit > div {
    font-size: 11px;
    padding: 4px 0;
    border-bottom: 1px dashed var(--border);
    color: var(--text);
}

.rq-audit > div:last-child {
    border-bottom: none;
}

.rq-audit .mono {
    color: var(--text-muted);
    margin-right: 6px;
}

.round-detail-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    font-style: italic;
}

/* ===== Settings 管理员 + 登录会话 ===== */
.settings-admins-table,
.settings-admins-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.settings-admins-table thead th {
    padding: 9px 10px;
    background: var(--surface-muted);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 11px;
    text-align: left;
    white-space: nowrap;
}

.settings-admins-table tbody td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.settings-admins-table tbody tr:last-child td {
    border-bottom: none;
}

.settings-admins-table .text-button {
    font-size: 11px;
    padding: 3px 6px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

.settings-admins-table .text-button-danger {
    color: var(--red);
}

.settings-admins-table th:last-child {
    width: 112px;
}

.settings-admins-table .admin-action-button {
    width: 30px;
    height: 30px;
    min-width: 30px;
}

.settings-admins-table .admin-action-button + .admin-action-button {
    margin-left: 5px;
}

.settings-admins-table .admin-action-button [data-lucide] {
    width: 15px;
    height: 15px;
}

.settings-sessions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 720px) {
    .settings-sessions-grid {
        grid-template-columns: 1fr;
    }
}

.sessions-sub-section h3 {
    margin: 0 0 8px;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.sessions-sub-section h3 small {
    text-transform: none;
    margin-left: 3px;
    font-size: 11px;
    opacity: 0.7;
}

.sessions-sub-section table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.sessions-sub-section th,
.sessions-sub-section td {
    padding: 7px 8px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}

/* ===== Wallet 平台适配器 + 对账任务 ===== */
.wallet-adapters-panel,
.wallet-reconciliation-panel {
    margin-top: 18px;
}

.wallet-adapters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

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

.adapter-card-internal {
    border-style: dashed;
    background: var(--surface-muted);
}

.adapter-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.adapter-head strong {
    font-size: 13px;
}

.adapter-fields {
    margin: 0;
    display: grid;
    gap: 6px;
}

.adapter-fields > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    background: var(--surface-muted);
    border-radius: 4px;
    font-size: 11px;
}

.adapter-fields dt {
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.adapter-fields dt small {
    text-transform: none;
    margin-left: 2px;
}

.adapter-fields dd {
    margin: 0;
    color: var(--text);
    text-align: right;
    word-break: break-all;
}

.adapter-secret {
    color: var(--text-muted) !important;
    letter-spacing: 1px;
}

/* 对账任务 */
.recon-tasks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

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

.recon-task-open {
    border-color: var(--amber, #ecd095);
}

.recon-task-resolved {
    opacity: 0.8;
}

.recon-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.recon-head strong {
    font-size: 13px;
}

.recon-fields {
    margin: 0 0 10px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px 12px;
}

.recon-fields > div {
    padding: 6px 8px;
    background: var(--surface-muted);
    border-radius: 4px;
}

.recon-fields dt {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
}

.recon-fields dd {
    margin: 0;
    font-size: 11px;
}

.recon-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* ===== 汇率与积分页 ===== */
.exchange-base-panel,
.exchange-rates-panel,
.exchange-points-panel {
    margin-top: 18px;
}

.exchange-base-list {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 10px;
}

.exchange-base-list > div {
    padding: 12px 14px;
    background: var(--surface-muted);
    border-radius: 8px;
}

.exchange-base-list dt {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}

.exchange-base-list dd {
    margin: 0;
    font-size: 13px;
}

.exchange-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.exchange-table thead th {
    padding: 9px 10px;
    background: var(--surface-muted);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 11px;
    text-align: left;
    white-space: nowrap;
}

.exchange-table thead th.align-right {
    text-align: right;
}

.exchange-table tbody td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.exchange-table tbody td.align-right {
    text-align: right;
}

.exchange-table tbody tr:last-child td {
    border-bottom: none;
}

.exchange-table tbody tr:hover {
    background: var(--surface-muted);
}

/* ===== Reports 合同版本/应收/入账/状态 ===== */
.reports-contract-panel,
.reports-status-panel {
    margin-top: 18px;
}

.reports-contract-table,
.reports-status-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.reports-contract-table thead th,
.reports-status-table thead th {
    padding: 9px 10px;
    background: var(--surface-muted);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 11px;
    text-align: left;
    white-space: nowrap;
}

.reports-contract-table thead th.align-right,
.reports-status-table thead th.align-right {
    text-align: right;
}

.reports-contract-table tbody td,
.reports-status-table tbody td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.reports-contract-table tbody td.align-right,
.reports-status-table tbody td.align-right {
    text-align: right;
}

.reports-contract-table tbody tr:hover,
.reports-status-table tbody tr:hover {
    background: var(--surface-muted);
}

/* ===== Settings 审批任务 ===== */
.settings-approvals-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.settings-approvals-table thead th {
    padding: 9px 10px;
    background: var(--surface-muted);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 11px;
    text-align: left;
    white-space: nowrap;
}

.settings-approvals-table tbody td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.settings-approvals-table tbody tr:hover {
    background: var(--surface-muted);
}

.settings-approvals-table .approval-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 112px;
}

/* ===== Games overview 元信息面板 ===== */
.overview-meta-panel {
    margin: 14px 0;
}

.overview-meta-list {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
}

.overview-meta-list > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    background: var(--surface-muted);
    border-radius: 6px;
}

.overview-meta-list dt {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.overview-meta-list dt small {
    text-transform: none;
    margin-left: 2px;
    opacity: 0.7;
}

.overview-meta-list dd {
    margin: 0;
    font-size: 12px;
    word-break: break-all;
}

/* ===== 角色切换器 + 角色控制 ===== */
.role-switcher {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
    padding: 12px 14px;
    background: var(--blue-soft, #e6f0fa);
    border: 1px solid var(--blue, #b8d8ee);
    border-radius: 8px;
}

.role-switcher-info {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.role-switcher-info > [data-lucide] {
    flex: 0 0 auto;
    margin-top: 1px;
    color: #1c5c94;
}

.role-switcher-info strong {
    display: block;
    font-size: 13px;
    color: #1c5c94;
}

.role-switcher-info small {
    display: block;
    color: #4a6a82;
    font-size: 11px;
    line-height: 1.4;
    margin-top: 2px;
}

.role-switcher-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.role-switcher-actions .button-small {
    padding: 5px 12px;
    font-size: 12px;
    min-height: 0;
}

.role-switcher-actions .button.is-active {
    background: var(--green);
    color: #fff;
    border-color: var(--green);
}

[data-requires-role].role-hidden {
    display: none !important;
}

.role-restricted-notice {
    margin-bottom: 18px;
    padding: 14px 18px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    background: var(--surface-muted);
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.6;
}

.role-restricted-notice strong {
    color: var(--text);
}

/* Error page variant */
.auth-card.error-card {
    text-align: center;
}

.auth-card.error-card .error-code {
    font-size: 56px;
    font-weight: 700;
    color: var(--red);
    line-height: 1;
    margin: 0 0 6px;
    letter-spacing: -2px;
}

.auth-card.error-card .error-code.code-403 { color: var(--amber); }
.auth-card.error-card .error-code.code-404 { color: var(--text-muted); }

.auth-card.error-card .trace-id {
    margin: 16px 0 0;
    padding: 8px 12px;
    background: var(--surface-muted);
    border-radius: 6px;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 11px;
    color: var(--text-muted);
    word-break: break-all;
}

.auth-card.error-card .error-detail {
    margin: 14px 0 0;
    padding: 12px;
    background: #2a1a1a;
    border: 1px solid #4a2a2a;
    border-radius: 6px;
    color: #ffb0b0;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 11px;
    text-align: left;
    white-space: pre-wrap;
    max-height: 200px;
    overflow: auto;
}

/* Permission matrix in Settings */
.permission-matrix {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.permission-matrix thead th {
    text-align: center;
    padding: 10px 8px;
    background: var(--surface-muted);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 12px;
}

.permission-matrix thead th:first-child {
    text-align: left;
}

.permission-matrix tbody th,
.permission-matrix tbody td {
    padding: 11px 8px;
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.permission-matrix tbody th {
    text-align: left;
    font-weight: 500;
    color: var(--text);
}

.permission-matrix tbody tr:last-child th,
.permission-matrix tbody tr:last-child td {
    border-bottom: none;
}

.permission-matrix .pm-yes {
    color: var(--green);
    font-weight: 700;
    font-size: 15px;
}

.permission-matrix .pm-no {
    color: var(--text-muted);
    opacity: 0.5;
}

.permission-matrix .pm-ro {
    color: var(--amber);
    font-weight: 700;
    font-size: 15px;
}

.permission-matrix-legend {
    margin: 12px 2px 2px;
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

.permission-matrix-legend .pm-yes,
.permission-matrix-legend .pm-no,
.permission-matrix-legend .pm-ro {
    font-size: 13px;
    margin-right: 4px;
}

.permission-matrix-legend small {
    color: var(--text-muted);
    opacity: 0.8;
    margin-left: 8px;
}

/* Production environment badge — 醒目红色 */
.environment-badge.is-production {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 0 0 3px var(--red-soft);
}

.environment-badge.is-staging {
    background: var(--amber);
    color: #fff;
    border-color: var(--amber);
}

/* Standalone toast for ChangePassword page (not using Index.cshtml #toast) */
.cp-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%) translateY(12px);
    padding: 10px 18px;
    border-radius: 8px;
    background: var(--green);
    color: #fff;
    font-size: 13px;
    box-shadow: var(--shadow);
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 1000;
    max-width: 90vw;
}

.cp-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.bar-chart {
    display: grid;
    height: 320px;
    grid-template-columns: repeat(7, minmax(38px, 1fr));
    align-items: stretch;
    gap: 14px;
    padding: 26px 24px 18px;
    background-image: linear-gradient(to bottom, transparent calc(25% - 1px), #edf0f2 25%, transparent calc(25% + 1px), transparent calc(50% - 1px), #edf0f2 50%, transparent calc(50% + 1px), transparent calc(75% - 1px), #edf0f2 75%, transparent calc(75% + 1px));
}

.chart-column {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.chart-column > div {
    display: flex;
    width: 100%;
    height: 244px;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
}

.bar {
    display: block;
    width: min(18px, 42%);
    min-height: 5px;
    border-radius: 3px 3px 0 0;
}

.bar.bet { background: #2878c8; }
.bar.payout { background: #68aa87; }

.chart-column small {
    color: var(--text-muted);
}

.share-list {
    padding: 22px 20px;
}

.share-list > div:nth-child(odd) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 18px 0 8px;
}

.share-list > div:first-child {
    margin-top: 0;
}

.share-track {
    height: 7px;
}

.share-track > span {
    display: block;
    height: 100%;
    border-radius: 4px;
}

.definition-list {
    margin: 0;
    padding: 4px 18px;
}

.definition-list > div {
    display: grid;
    min-height: 52px;
    grid-template-columns: 130px minmax(0, 1fr);
    align-items: center;
    border-bottom: 1px solid #edf0f2;
}

.definition-list > div:last-child {
    border-bottom: 0;
}

.definition-list dt {
    color: var(--text-muted);
}

.definition-list dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

.role-list {
    padding: 4px 18px;
}

.role-list > div {
    display: grid;
    min-height: 64px;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #edf0f2;
}

.role-list > div:last-child {
    border-bottom: 0;
}

.role-list > div > span:nth-child(2) {
    display: flex;
    flex-direction: column;
}

.role-list small {
    color: var(--text-muted);
}

.avatar.role {
    width: 32px;
    height: 32px;
    color: #3f5360;
    background: #e6ecef;
}

.modal {
    width: min(600px, calc(100vw - 32px));
    max-height: calc(100vh - 40px);
    padding: 0;
    overflow: hidden;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(18, 28, 35, 0.25);
}

.modal::backdrop {
    background: rgba(17, 26, 33, 0.56);
}

.role-management-dialog {
    width: min(780px, calc(100vw - 32px));
}

.role-management-note {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    color: var(--text-muted);
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.5;
}

.role-management-note [data-lucide] {
    flex: 0 0 auto;
    width: 16px;
    color: var(--green);
}

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

.role-definition-grid > div {
    display: grid;
    gap: 5px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.role-definition-grid strong {
    font-size: 13px;
}

.role-definition-grid small,
.role-definition-grid span {
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.45;
}

.section-kicker {
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
}

.role-admin-table {
    table-layout: fixed;
}

.role-admin-table th,
.role-admin-table td {
    padding-inline: 10px;
}

.role-admin-table th:nth-child(1) { width: 32%; }
.role-admin-table th:nth-child(2) { width: 30%; }
.role-admin-table th:nth-child(3) { width: 18%; }
.role-admin-table th:nth-child(4) { width: 20%; }

.role-admin-table select {
    min-width: 0;
}

.role-admin-table td:first-child small {
    display: block;
    margin-top: 3px;
    color: var(--text-muted);
}

.modal form {
    display: flex;
    max-height: calc(100vh - 42px);
    flex-direction: column;
}

.modal-head,
.modal-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
}

@media (max-width: 640px) {
    .role-definition-grid {
        grid-template-columns: 1fr;
    }

    .role-admin-table th,
    .role-admin-table td {
        padding-inline: 8px;
    }
}

.modal-head {
    border-bottom: 1px solid var(--border);
}

.modal-head h2 {
    font-size: 18px;
}

.modal-body {
    display: grid;
    gap: 15px;
    padding: 18px 20px;
    overflow-y: auto;
}

.modal-body label {
    display: grid;
    gap: 6px;
    font-weight: 600;
}

.modal-body label > span {
    font-size: 12px;
}

.modal-body input,
.modal-body select,
.modal-body textarea {
    width: 100%;
}

.room-card-assignment-field {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.room-card-assignment-field legend {
    margin-bottom: 6px;
    padding: 0;
    font-size: 12px;
    font-weight: 600;
}

.room-card-assignment-field legend small,
.room-card-assignment-field > small {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 400;
}

.room-card-assignment-field > small {
    display: block;
    margin-top: 6px;
    line-height: 1.45;
}

.room-card-assignment-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.room-card-assignment-control .button {
    min-height: 38px;
    white-space: nowrap;
}

@media (max-width: 680px) {
    .room-card-assignment-control {
        grid-template-columns: 1fr;
    }

    .room-card-assignment-control .button {
        width: 100%;
    }
}

.modal-body .outcome-mode-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-muted);
}

.modal-body .outcome-mode-option input {
    flex: 0 0 auto;
    margin-top: 1px;
    accent-color: var(--green);
}

.modal-body .outcome-mode-option span,
.modal-body .outcome-mode-option small {
    display: block;
}

.modal-body .outcome-mode-option small {
    margin-top: 4px;
    color: var(--text-muted);
    font-weight: 400;
    line-height: 1.45;
}

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

.two-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.path-preview {
    display: grid;
    min-height: 58px;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.path-preview > [data-lucide] {
    color: var(--text-muted);
}

.path-preview > span:nth-child(2) {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.path-preview small {
    overflow: hidden;
    color: var(--text-muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modal-foot {
    justify-content: flex-end;
    background: #fafbfc;
    border-top: 1px solid var(--border);
}

.toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 100;
    display: flex;
    min-height: 46px;
    align-items: center;
    gap: 9px;
    padding: 10px 14px;
    color: #fff;
    background: #1d3a2c;
    border: 1px solid #356d50;
    border-radius: 7px;
    box-shadow: 0 14px 35px rgba(17, 32, 24, 0.25);
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Lobby operations */
.lobby-config-stack {
    display: grid;
    gap: 14px;
}

.lobby-summary-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 7px;
}

.lobby-summary-item {
    display: flex;
    min-width: 0;
    min-height: 76px;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    border-right: 1px solid var(--border);
}

.lobby-summary-item:last-child {
    border-right: 0;
}

.lobby-summary-item > [data-lucide] {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    color: var(--green);
}

.lobby-summary-item > span {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.lobby-summary-item small,
.lobby-summary-item em {
    overflow: hidden;
    color: var(--text-muted);
    font-size: 11px;
    font-style: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lobby-summary-item strong {
    overflow: hidden;
    font-size: 17px;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#lobby-summary-content {
    font-size: 14px;
}

.lobby-workspace {
    overflow: hidden;
}

.lobby-workspace-tabs {
    display: flex;
    min-height: 52px;
    align-items: stretch;
    gap: 22px;
    padding: 0 18px;
    overflow-x: auto;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.lobby-workspace-tabs button {
    position: relative;
    display: inline-flex;
    min-width: max-content;
    min-height: 52px;
    align-items: center;
    gap: 7px;
    padding: 0;
    color: var(--text-muted);
    background: transparent;
    border: 0;
    font-weight: 600;
}

.lobby-workspace-tabs button > [data-lucide] {
    width: 16px;
    height: 16px;
}

.lobby-workspace-tabs button:hover,
.lobby-workspace-tabs button.is-active {
    color: var(--green);
}

.lobby-workspace-tabs button.is-active::after {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 2px;
    content: "";
    background: var(--green);
}

.lobby-revision {
    align-self: center;
    margin-left: auto;
    color: var(--text-muted);
    font-size: 11px;
    white-space: nowrap;
}

.lobby-workspace-panel[hidden] {
    display: none;
}

.lobby-section-heading,
.lobby-content-heading {
    display: flex;
    min-height: 72px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
}

.lobby-section-heading h2,
.lobby-content-heading h3,
.lobby-setting-band h3 {
    font-size: 15px;
}

.lobby-section-heading p,
.lobby-content-heading p,
.lobby-setting-band p {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 12px;
}

.lobby-content-section + .lobby-content-section {
    border-top: 1px solid var(--border);
}

.lobby-game-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    background: var(--surface-muted);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.lobby-game-search {
    width: min(360px, 100%);
}

.lobby-game-state-filter {
    margin-left: auto;
}

.lobby-game-bulk-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lobby-config-alert {
    padding: 10px 12px;
    color: var(--red);
    background: var(--red-soft);
    border: 1px solid #efb8b8;
    border-radius: 6px;
}

.lobby-config-alert.is-hidden {
    display: none;
}

.lobby-config-table {
    table-layout: fixed;
}

.lobby-category-table {
    min-width: 760px;
}

.lobby-game-table {
    min-width: 1370px;
}

.lobby-content-table {
    min-width: 680px;
}

.lobby-category-table th:nth-child(1) { width: 180px; }
.lobby-category-table th:nth-child(3) { width: 100px; }
.lobby-category-table th:nth-child(4) { width: 110px; }
.lobby-category-table th:nth-child(5) { width: 58px; }
.lobby-game-table th:nth-child(1) { width: 46px; }
.lobby-game-table th:nth-child(2) { width: 190px; }
.lobby-game-table th:nth-child(3) { width: 110px; }
.lobby-game-table th:nth-child(4) { width: 118px; }
.lobby-game-table th:nth-child(5),
.lobby-game-table th:nth-child(6),
.lobby-game-table th:nth-child(7),
.lobby-game-table th:nth-child(8) { width: 292px; }
.lobby-game-table th:nth-child(9) { width: 70px; }
.lobby-game-table th:nth-child(10) { width: 106px; }
.lobby-content-table th:nth-child(2) { width: 90px; }
.lobby-content-table th:nth-child(3) { width: 100px; }
.lobby-content-table th:nth-child(4) { width: 58px; }

.lobby-config-table td {
    height: 66px;
}

/* Image editors contain a preview, generated URL and upload feedback. Keep
   those pieces in a predictable two-column layout instead of squeezing them
   into a single horizontal line. */
.lobby-game-table td:nth-child(5),
.lobby-game-table td:nth-child(6),
.lobby-game-table td:nth-child(7),
.lobby-game-table td:nth-child(8) {
    height: auto;
    min-height: 112px;
    padding-block: 12px;
    vertical-align: top;
}

.lobby-select-column {
    text-align: center;
}

.lobby-select-column input {
    margin-inline: auto !important;
}

.lobby-config-table tr.is-direct-focus > td {
    background: var(--amber-soft);
    box-shadow: inset 0 1px 0 var(--amber), inset 0 -1px 0 var(--amber);
}

.resource-storage-status {
    padding: 10px 12px;
    color: var(--text-muted);
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
}

.resource-storage-status.is-ready {
    color: var(--green);
    background: var(--green-soft);
    border-color: var(--green);
}

.resource-storage-status.is-error {
    color: var(--red);
    background: var(--red-soft);
    border-color: var(--red);
}

.webgl-upload-field input[type="file"] {
    min-height: 44px;
    padding: 8px;
}

.webgl-upload-status {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.5;
}

.webgl-upload-status.is-active {
    color: var(--blue);
}

.webgl-upload-status.is-error {
    color: var(--red);
}

.game-server-upload {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(240px, 1fr) minmax(240px, 1fr) auto;
    gap: 12px;
    align-items: end;
    margin: 12px 0;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-muted);
}

.game-server-upload-copy { align-self: center; }
.game-server-upload-copy strong,
.game-server-upload-copy small { display: block; }
.game-server-upload-copy small { margin-top: 4px; color: var(--text-muted); line-height: 1.45; }
.game-server-upload input { width: 100%; min-height: 42px; }

@media (max-width: 1100px) {
    .game-server-upload { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
    .game-server-upload { grid-template-columns: 1fr; }
}

.lobby-config-table input[type="text"],
.lobby-config-table input[type="url"],
.lobby-config-table input[type="number"] {
    width: 100%;
    min-height: 34px;
    padding: 6px 9px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 5px;
}

.lobby-config-table select {
    width: 100%;
    min-height: 34px;
    padding: 6px 9px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 5px;
}

.lobby-config-table input[type="text"]:disabled,
.lobby-config-table input[type="url"]:disabled,
.lobby-config-table input[type="number"]:disabled {
    color: var(--text-muted);
    background: var(--surface-muted);
}

.lobby-game-cell {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
}

.lobby-game-cell > span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lobby-game-table .lobby-url-editor {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
}

.lobby-game-table .lobby-cover-preview {
    width: 76px;
    height: 50px;
    flex-basis: 76px;
}

.lobby-cover-preview {
    display: grid;
    width: 68px;
    height: 44px;
    flex: 0 0 68px;
    place-items: center;
    overflow: hidden;
    color: var(--text-soft);
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 11px;
}

.lobby-cover-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lobby-url-editor {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
}

.lobby-image-controls {
    display: grid;
    min-width: 0;
    flex: 1;
    align-content: start;
    gap: 8px;
}

.lobby-image-actions {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    min-width: 0;
    align-items: center;
    gap: 8px;
}

.lobby-image-upload-button {
    flex: 0 0 auto;
    min-width: 104px;
}

.lobby-image-upload-button.is-loading [data-lucide] {
    animation: lobby-image-spin 0.8s linear infinite;
}

@keyframes lobby-image-spin { to { transform: rotate(360deg); } }

.lobby-image-upload-status {
    grid-column: 1 / -1;
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.35;
}

.lobby-image-upload-status.is-active { color: var(--blue); }
.lobby-image-upload-status.is-success { color: var(--green); }
.lobby-image-upload-status.is-error { color: var(--red); }

.upload-task-center {
    position: fixed;
    right: 24px;
    top: auto;
    bottom: 24px;
    z-index: 80;
}

.upload-task-toggle {
    display: flex;
    min-height: 40px;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    box-shadow: 0 8px 24px rgba(15, 23, 42, .14);
    font-size: 13px;
    font-weight: 700;
}

.upload-task-toggle strong {
    display: grid;
    min-width: 20px;
    height: 20px;
    place-items: center;
    padding: 0 5px;
    color: #fff;
    border-radius: 10px;
    background: var(--blue);
    font-size: 11px;
}

.upload-task-toggle-chevron {
    width: 15px;
    transition: transform .16s ease;
}

.upload-task-toggle[aria-expanded="true"] .upload-task-toggle-chevron { transform: rotate(180deg); }
.upload-task-center.has-active .upload-task-toggle > [data-lucide]:first-child { animation: lobby-image-spin .9s linear infinite; }

.upload-task-panel {
    position: absolute;
    top: auto;
    bottom: calc(100% + 8px);
    right: 0;
    width: min(430px, calc(100vw - 32px));
    max-height: min(520px, calc(100vh - var(--topbar-height) - 80px));
    overflow: auto;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 14px 36px rgba(15, 23, 42, .18);
}

.upload-task-heading,
.upload-task,
.upload-task-meta {
    display: flex;
}

.upload-task-heading { align-items: center; justify-content: space-between; margin-bottom: 10px; }
.upload-task-heading > div,
.upload-task-meta { flex-direction: column; gap: 3px; min-width: 0; }
.upload-task-heading small,
.upload-task-meta small { color: var(--text-muted); }
.upload-task { align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.upload-task:first-child { border-top: 0; }
.upload-task-meta { flex: 1; }
.upload-task-meta strong,
.upload-task-meta small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-task-progress { display: grid; width: 104px; gap: 3px; }
.upload-task-progress progress { width: 100%; height: 8px; accent-color: var(--blue); }
.upload-task-progress-value { color: var(--text); font-size: 12px; text-align: center; }
.upload-task > span { width: 92px; font-size: 12px; color: var(--text-muted); text-align: right; }
.upload-task-success > span { color: var(--green); }
.upload-task-failed > span { color: var(--red); }

.upload-task-history-dialog { width: min(760px, calc(100vw - 32px)); }
.upload-task-history-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.upload-task-history-list { display: grid; gap: 0; border: 1px solid var(--border); border-radius: 6px; }
.upload-task-history-item { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(140px, .8fr) 150px; gap: 14px; align-items: center; padding: 12px; border-top: 1px solid var(--border); }
.upload-task-history-item:first-child { border-top: 0; }
.upload-task-history-item > div { display: grid; min-width: 0; gap: 3px; }
.upload-task-history-item small { overflow: hidden; color: var(--text-muted); text-overflow: ellipsis; white-space: nowrap; }
.upload-task-history-item time { color: var(--text-muted); font-size: 12px; text-align: right; }
.upload-task-history-success > div:nth-child(2) strong { color: var(--green); }
.upload-task-history-failed > div:nth-child(2) strong { color: var(--red); }
.upload-task-history-list > .empty-state { padding: 28px 16px; text-align: center; }

.lobby-apk-panel { margin-bottom: 18px; overflow: hidden; }
.lobby-apk-body {
    display: grid;
    width: min(100%, 1180px);
    gap: 18px;
    margin-inline: auto;
    padding: 22px clamp(18px, 3vw, 32px) 24px;
}
.lobby-apk-overview { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-muted); }
.lobby-apk-overview-icon { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; color: var(--blue); border: 1px solid #cfe1f2; border-radius: 6px; background: var(--blue-soft); }
.lobby-apk-overview-copy { display: grid; min-width: 0; flex: 1; gap: 2px; }
.lobby-apk-overview-copy small { color: var(--text-muted); }
.lobby-apk-current { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.lobby-apk-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.lobby-apk-form label { display: grid; min-width: 0; gap: 7px; }
.lobby-apk-form label > span { color: var(--text-muted); font-size: 12px; }
.lobby-apk-file-field { padding: 12px; border: 1px solid var(--border); border-radius: 6px; }
.lobby-apk-file-field > span { display: grid; grid-template-columns: 18px auto 1fr; align-items: center; gap: 7px; }
.lobby-apk-file-field > span b { color: var(--text); }
.lobby-apk-file-field > span small { justify-self: end; }
.lobby-apk-file-field input { width: 100%; min-height: 40px; padding: 6px; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.lobby-apk-reason { grid-column: 1 / -1; }
.lobby-apk-actions { display: flex; grid-column: 1 / -1; align-items: center; justify-content: space-between; gap: 12px; }
.lobby-apk-actions p { display: flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 12px; }
.lobby-apk-actions p [data-lucide] { width: 16px; color: var(--green); }

/* 低频大厅资源配置：默认收起图片列，避免高频状态操作被四个编辑器挤出视口。 */
.lobby-games-heading-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.lobby-game-assets-toggle {
    white-space: nowrap;
}

.lobby-game-table {
    min-width: 760px;
}

.lobby-game-table:not(.is-assets-expanded) th:nth-child(6),
.lobby-game-table:not(.is-assets-expanded) th:nth-child(7),
.lobby-game-table:not(.is-assets-expanded) th:nth-child(8),
.lobby-game-table:not(.is-assets-expanded) td:nth-child(6),
.lobby-game-table:not(.is-assets-expanded) td:nth-child(7),
.lobby-game-table:not(.is-assets-expanded) td:nth-child(8) {
    display: none;
}

.lobby-game-table.is-assets-expanded {
    min-width: 1370px;
}

.lobby-game-table.is-assets-expanded th:nth-child(5),
.lobby-game-table.is-assets-expanded th:nth-child(6),
.lobby-game-table.is-assets-expanded th:nth-child(7),
.lobby-game-table.is-assets-expanded th:nth-child(8),
.lobby-game-table.is-assets-expanded td:nth-child(5),
.lobby-game-table.is-assets-expanded td:nth-child(6),
.lobby-game-table.is-assets-expanded td:nth-child(7),
.lobby-game-table.is-assets-expanded td:nth-child(8) {
    display: table-cell;
}

.lobby-game-table:not(.is-assets-expanded) th:nth-child(2) { width: 220px; }
.lobby-game-table:not(.is-assets-expanded) th:nth-child(3) { width: 110px; }
.lobby-game-table:not(.is-assets-expanded) th:nth-child(4) { width: 128px; }
.lobby-game-table:not(.is-assets-expanded) th:nth-child(5) { width: 100px; }
.lobby-game-table:not(.is-assets-expanded) th:nth-child(9) { width: 78px; }
.lobby-game-table:not(.is-assets-expanded) th:nth-child(10) { width: 92px; }

.lobby-game-table:not(.is-assets-expanded) td:nth-child(5) {
    height: 66px;
    min-height: 0;
    padding-block: 8px;
    vertical-align: middle;
}

.lobby-game-table:not(.is-assets-expanded) td:nth-child(5) .lobby-url-editor {
    grid-template-columns: 1fr;
    place-items: center;
}

.lobby-game-table:not(.is-assets-expanded) td:nth-child(5) .lobby-image-controls {
    display: none;
}

/* The primary game table keeps only high-frequency fields.  Low-frequency
   loading/progress/development editors live in an expandable detail row. */
.lobby-game-table,
.lobby-game-table.is-assets-expanded {
    min-width: 770px !important;
}
.lobby-game-table:not(.is-assets-expanded) th:nth-child(6),
.lobby-game-table:not(.is-assets-expanded) th:nth-child(7),
.lobby-game-table:not(.is-assets-expanded) th:nth-child(8),
.lobby-game-table:not(.is-assets-expanded) td:nth-child(6),
.lobby-game-table:not(.is-assets-expanded) td:nth-child(7),
.lobby-game-table:not(.is-assets-expanded) td:nth-child(8),
.lobby-game-table.is-assets-expanded th:nth-child(6),
.lobby-game-table.is-assets-expanded th:nth-child(7),
.lobby-game-table.is-assets-expanded th:nth-child(8),
.lobby-game-table.is-assets-expanded td:nth-child(6),
.lobby-game-table.is-assets-expanded td:nth-child(7),
.lobby-game-table.is-assets-expanded td:nth-child(8) {
    display: table-cell !important;
}
.lobby-game-table th:nth-child(1) { width: 46px !important; }
.lobby-game-table th:nth-child(2) { width: 220px !important; }
.lobby-game-table th:nth-child(3) { width: 110px !important; }
.lobby-game-table th:nth-child(4) { width: 128px !important; }
.lobby-game-table th:nth-child(5) { width: 150px !important; }
.lobby-game-table th:nth-child(6) { width: 78px !important; }
.lobby-game-table th:nth-child(7) { width: 84px !important; }
.lobby-game-table th:nth-child(8) { width: 112px !important; }
.lobby-game-detail-row > td {
    height: auto;
    padding: 14px 16px;
    background: var(--surface-muted, #f8fafc);
    border-top: 0;
}
.lobby-game-detail-row[hidden] { display: none; }
.lobby-game-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 14px;
}
.lobby-game-asset-editor {
    display: grid;
    min-width: 0;
    gap: 7px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface, #fff);
}
.lobby-game-actions-cell { white-space: nowrap; }
.lobby-game-actions-cell .button { width: 100%; }

.panel-heading-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}
.player-identifier-copy {
    max-width: 100%;
    overflow: hidden;
    padding: 0;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lobby-game-cover-cell {
    text-align: center;
}

.lobby-cover-preview-compact {
    width: 76px;
    height: 50px;
    margin-inline: auto;
}

.lobby-game-toolbar {
    flex-wrap: wrap;
}

.lobby-game-search {
    flex: 0 0 300px;
    width: 300px;
}

.lobby-apk-body {
    grid-template-columns: minmax(250px, .4fr) minmax(0, 1fr);
    align-items: stretch;
}

.lobby-apk-overview {
    min-height: 100%;
    align-items: flex-start;
}

.lobby-apk-form {
    align-content: start;
}

.lobby-apk-file-field {
    position: relative;
    min-height: 94px;
    align-content: center;
    justify-items: start;
    cursor: pointer;
    border: 1px dashed var(--border);
    background: var(--surface-muted);
    transition: border-color 160ms ease, background 160ms ease;
}

.lobby-apk-file-field:hover,
.lobby-apk-file-field:focus-within,
.lobby-apk-file-field.is-selected {
    border-color: var(--blue);
    background: var(--blue-soft);
}

.lobby-apk-file-field input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.lobby-apk-file-field > span {
    width: 100%;
}

.lobby-apk-file-meta {
    display: block;
    max-width: 100%;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lobby-apk-file-meta.is-selected {
    color: var(--blue);
    font-weight: 700;
}

@media (max-width: 1100px) {
    .card-gateway-cert-body {
        max-height: none;
    }

    .lobby-apk-body {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .card-gateway-cert-drawer {
        top: 0;
        width: 100vw;
        border-right: 0;
        border-radius: 0;
    }

    .card-gateway-cert-scrim {
        inset: 0;
    }

    .card-gateway-cert-drawer .panel-heading {
        padding: 16px;
    }

    .card-gateway-cert-current,
    .card-gateway-cert-upload-fields {
        grid-template-columns: 1fr;
    }

    .card-gateway-cert-switch {
        grid-template-columns: 1fr;
    }

    .upload-task-center { right: 12px; top: auto; bottom: 12px; }
    .upload-task { align-items: flex-start; flex-wrap: wrap; }
    .upload-task-progress { width: 100%; }
    .upload-task-history-item { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
    .upload-task-history-item time { grid-column: 1 / -1; text-align: left; }
    .lobby-apk-body { gap: 14px; padding: 12px; }
    .lobby-apk-overview { align-items: flex-start; flex-wrap: wrap; }
    .lobby-apk-overview .status { margin-left: 50px; }
    .lobby-apk-form { grid-template-columns: 1fr; }
    .lobby-apk-reason,
    .lobby-apk-actions { grid-column: 1; }
    .lobby-apk-actions { align-items: stretch; flex-direction: column; }
    .lobby-apk-actions button { width: 100%; }
}

.lobby-url-input[readonly] {
    color: var(--text-muted);
    background: var(--surface-muted);
    cursor: default;
}

.lobby-state-select {
    width: 100%;
    min-width: 96px;
}

.game-registration-dialog {
    width: min(720px, calc(100vw - 24px));
}

.game-connection-mode-grid {
    display: grid;
    grid-template-columns: minmax(150px, .7fr) minmax(240px, 1.3fr);
    gap: 12px;
}

.game-assets-encrypted-option {
    margin: 0;
}

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

.lobby-state-editor {
    display: grid;
    gap: 6px;
    min-width: 116px;
}

.lobby-state-editor .status {
    justify-self: start;
}

.lobby-save-dialog {
    width: min(760px, calc(100vw - 24px));
}

.lobby-diff-list {
    display: grid;
    max-height: min(55vh, 520px);
    gap: 8px;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    list-style: none;
}

.lobby-diff-list li {
    padding: 9px 11px;
    color: var(--text);
    background: var(--surface-muted);
    border-left: 3px solid var(--amber);
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.55;
}

.field-hint {
    margin: -4px 0 0;
    color: var(--text-muted);
    font-size: 12px;
}

@media (max-width: 560px) {
    .game-port-grid,
    .game-connection-mode-grid {
        grid-template-columns: 1fr;
    }
}

.lobby-url-input {
    min-width: 210px;
}

.lobby-sort-input {
    width: 68px !important;
    min-width: 68px;
    max-width: 100%;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.lobby-toggle {
    position: relative;
    width: 42px;
    height: 24px;
    margin: 0;
    appearance: none;
    vertical-align: middle;
    background: #aab3bb;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
}

.lobby-toggle::after {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    content: "";
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.22);
    transition: transform 140ms ease;
}

.lobby-toggle:checked {
    background: var(--green);
}

.lobby-toggle:checked::after {
    transform: translateX(18px);
}

.lobby-toggle:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

input[type="checkbox"]:not(.lobby-toggle) {
    display: inline-grid;
    width: 20px;
    height: 20px;
    min-width: 20px;
    flex: 0 0 20px;
    place-content: center;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    background: #fff;
    border: 1px solid #9aa6b2;
    border-radius: 4px;
    cursor: pointer;
}

input[type="checkbox"]:not(.lobby-toggle)::before {
    width: 11px;
    height: 11px;
    content: "";
    background: #fff;
    clip-path: polygon(14% 44%, 0 59%, 39% 100%, 100% 17%, 85% 0%, 39% 68%);
    transform: scale(0);
    transition: transform 120ms ease-in-out;
}

input[type="checkbox"]:not(.lobby-toggle):checked {
    background: var(--green);
    border-color: var(--green);
}

input[type="checkbox"]:not(.lobby-toggle):checked::before {
    transform: scale(1);
}

input[type="checkbox"]:not(.lobby-toggle):disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.modal-body .server-stop-confirm input[type="checkbox"]:checked {
    background: var(--red);
    border-color: var(--red);
}

.lobby-delete-button {
    width: 34px;
    min-height: 34px;
    padding: 0;
}

.lobby-setting-row {
    display: flex;
    min-width: 280px;
    min-height: 58px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 0;
}

.lobby-category-actions,
.lobby-jackpot-controls,
.lobby-jackpot-amount {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lobby-category-actions select,
.lobby-jackpot-amount input {
    min-height: 36px;
}

.lobby-jackpot-amount span {
    color: var(--text-muted);
    font-size: 12px;
    white-space: nowrap;
}

.lobby-jackpot-amount input {
    width: 180px;
    padding: 6px 9px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 5px;
    font-variant-numeric: tabular-nums;
}

.lobby-setting-row > span {
    display: grid;
    gap: 2px;
}

.lobby-setting-row small {
    color: var(--text-muted);
}

.lobby-setting-band {
    display: flex;
    min-height: 78px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 10px 18px;
    background: var(--surface-muted);
    border-top: 1px solid var(--border);
}

/* Referral operations */
.referral-grid {
    display: grid;
    grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1.8fr);
    gap: 18px;
    margin-bottom: 18px;
}

.referral-source-table,
.referral-rule-table,
.referral-binding-table {
    font-size: 12px;
}

.referral-rule-table {
    min-width: 850px;
}

.referral-binding-table {
    min-width: 980px;
}

.referral-rule-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(110px, 1fr));
    align-items: end;
    gap: 10px;
    padding: 14px 18px;
    background: var(--surface-muted);
    border-bottom: 1px solid var(--border);
}

.referral-rule-form label {
    display: grid;
    min-width: 0;
    gap: 5px;
}

.referral-rule-form label > span:first-child {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
}

.referral-rule-form input:not([type="checkbox"]),
.referral-rule-form select {
    width: 100%;
    min-width: 0;
    height: 36px;
    padding: 7px 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.referral-rule-enabled > span:last-child {
    display: flex;
    min-height: 36px;
    align-items: center;
    gap: 8px;
}

.referral-filter-toolbar {
    grid-template-columns: repeat(4, minmax(145px, 1fr)) auto;
}

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

    .referral-rule-form,
    .referral-filter-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .referral-rule-form .button,
    .referral-filter-toolbar .player-filter-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 680px) {
    .referral-rule-form,
    .referral-filter-toolbar {
        grid-template-columns: 1fr;
        padding-inline: 14px;
    }

    .referral-rule-form .button,
    .referral-filter-toolbar .player-filter-actions {
        grid-column: auto;
    }
}

@media (max-width: 1180px) {
    .dashboard-grid,
    .lower-grid,
    .report-grid,
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .resource-panel,
    .incident-panel {
        max-width: none;
    }

    .global-search input {
        width: 190px;
    }

    .game-status-row {
        grid-template-columns: 42px minmax(160px, 1fr) 52px 52px minmax(100px, 0.5fr) 36px;
    }

    .host-metrics-grid {
        grid-template-columns: 1fr;
    }

    .host-metric {
        min-height: 118px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .host-metric:last-child {
        border-bottom: 0;
    }

    .version-row {
        grid-template-columns: 86px minmax(140px, 1fr) 95px 60px auto;
    }

    .lobby-summary-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .lobby-summary-item:nth-child(2) {
        border-right: 0;
    }

    .lobby-summary-item:nth-child(-n + 2) {
        border-bottom: 1px solid var(--border);
    }
}

@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 180ms ease;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .mobile-scrim {
        position: fixed;
        inset: 0;
        z-index: 25;
        background: rgba(17, 26, 33, 0.48);
    }

    body.sidebar-open .mobile-scrim {
        display: block;
    }

    .workspace {
        margin-left: 0;
    }

    .mobile-menu {
        display: inline-grid;
    }

    .topbar {
        padding: 0 18px;
    }

    .profile-copy,
    .profile-button > [data-lucide],
    .global-search {
        display: none;
    }

    main {
        padding: 22px 18px;
    }

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

@media (max-width: 680px) {
    :root {
        --topbar-height: 62px;
    }

    .topbar {
        height: 62px;
    }

    .breadcrumb > span:first-child,
    .environment-badge {
        display: none;
    }

    main {
        min-height: calc(100vh - 62px);
        padding: 18px 12px 28px;
    }

    .page-heading {
        min-height: 0;
        flex-direction: column;
        gap: 14px;
    }

    .heading-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .heading-actions .button,
    .heading-actions select,
    .heading-actions input {
        flex: 1;
    }

    .lobby-heading-actions #lobby-config-status {
        flex: 1 0 100%;
    }

    .lobby-config-stack {
        gap: 12px;
    }

    .lobby-section-heading,
    .lobby-content-heading {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 10px;
    }

    .lobby-workspace-tabs {
        gap: 18px;
        padding-inline: 14px;
    }

    .lobby-revision {
        display: none;
    }

    .lobby-game-toolbar {
        flex-wrap: wrap;
        padding-inline: 14px;
    }

    .lobby-game-search {
        flex: 1 0 100%;
        width: 100%;
    }

    .lobby-game-state-filter {
        margin-left: 0;
    }

    .lobby-game-bulk-actions {
        width: 100%;
    }

    .lobby-config-table th,
    .lobby-config-table td {
        padding-inline: 12px;
    }

    .lobby-setting-row {
        min-width: 0;
    }

    .lobby-setting-band {
        align-items: stretch;
        flex-direction: column;
        gap: 4px;
        padding-inline: 14px;
    }

    .lobby-category-actions,
    .lobby-jackpot-controls {
        width: 100%;
        flex-wrap: wrap;
    }

    .lobby-category-actions select,
    .lobby-jackpot-amount {
        flex: 1;
    }

    .metric-grid {
        grid-template-columns: 1fr;
    }

    .metric-card {
        min-height: 112px;
    }

    .game-status-list {
        padding: 0 14px;
    }

    .game-status-row {
        grid-template-columns: 38px minmax(0, 1fr) 44px 32px;
        min-height: 76px;
        gap: 9px;
    }

    .game-symbol {
        width: 36px;
        height: 36px;
    }

    .game-status-row .game-stat:nth-of-type(2),
    .game-status-row .load-column {
        display: none;
    }

    .game-picker {
        display: flex;
        overflow-x: auto;
        padding-bottom: 3px;
    }

    .game-picker-item {
        min-width: 210px;
    }

    .game-detail-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .game-detail-head .heading-actions {
        width: 100%;
    }

    .game-detail-head .heading-actions .button {
        flex: 1;
    }

    .game-detail-content {
        padding: 14px;
    }

    .server-fleet-head,
    .server-selection-bar {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }

    .server-fleet-stats {
        flex-wrap: wrap;
        gap: 8px 12px;
    }

    .server-selection-bar .button {
        width: 100%;
    }

    .server-stop-impact,
    .server-stop-steps,
    .managed-service-summary {
        grid-template-columns: 1fr;
    }

    .managed-service-summary > div {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .managed-service-summary > div:last-child {
        border-bottom: 0;
    }

    .server-stop-impact > div {
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .server-stop-impact > div:last-child {
        border-bottom: 0;
    }

    .server-stop-impact dd {
        margin-top: 0;
        font-size: 14px;
    }

    .detail-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .detail-metrics > div:nth-child(2) {
        border-right: 0;
    }

    .detail-metrics > div:nth-child(-n + 2) {
        border-bottom: 1px solid var(--border);
    }

    .detail-columns,
    .room-grid {
        grid-template-columns: 1fr;
    }

    .version-row {
        grid-template-columns: 82px minmax(0, 1fr) auto;
        gap: 8px;
        padding: 9px 0;
    }

    .version-row > .status,
    .version-row > .mono {
        display: none;
    }

    .panel-heading {
        padding: 13px 14px;
    }

    .segmented {
        display: none;
    }

    .toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .filter-search {
        min-width: 0;
    }

    .toolbar select,
    .toolbar input[type="date"] {
        width: 100%;
    }

    .bar-chart {
        gap: 6px;
        padding-inline: 12px;
    }

    .chart-column > div {
        gap: 2px;
    }

    .two-column {
        grid-template-columns: 1fr;
    }

    .modal-foot {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .modal-foot .button {
        width: 100%;
    }

    .toast {
        right: 12px;
        bottom: 12px;
        left: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==== 测试服体验包:通用表头吸顶(F2)与会话过期横幅(F1) ==== */
.table-wrap thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--surface);
    box-shadow: 0 1px 0 var(--border);
}

.infra-card-table-wrap thead th {
    position: static;
}

/* This wrapper owns its own vertical scrollport, so its header is relative to
   the wrapper rather than the page-level topbar. */
.player-retention-table-wrap thead th {
    top: 0;
}

/* Lobby tables scroll horizontally only. Keep the header in normal table flow
   so direct navigation cannot move it over the first data row. */
.lobby-workspace .table-wrap {
    overflow-y: clip;
}

.lobby-workspace .table-wrap thead th {
    position: static;
}

.session-banner {
    position: sticky;
    top: 0;
    z-index: 60;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: var(--amber-soft);
    border-bottom: 1px solid var(--amber);
    color: var(--amber);
    font-size: 13px;
}

.session-banner[hidden] {
    display: none;
}

.session-banner a {
    color: inherit;
    font-weight: 600;
}

.session-banner button {
    margin-left: auto;
}

.lobby-server-status-panel {
    display: grid;
    grid-template-columns: minmax(210px, auto) 1fr 36px;
    align-items: center;
    gap: 18px;
    padding: 14px 18px;
    margin-bottom: 16px;
}

.lobby-server-status-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lobby-server-status-main > div {
    display: grid;
    gap: 2px;
}

.lobby-server-status-main small,
.lobby-server-status-details dt {
    color: var(--text-muted);
    font-size: 12px;
}

.lobby-server-status-icon {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    color: var(--blue);
    background: var(--blue-soft);
    border-radius: 6px;
}

.lobby-server-status-icon svg {
    width: 18px;
}

.lobby-server-status-details {
    display: grid;
    grid-template-columns: repeat(4, minmax(100px, 1fr));
    gap: 12px;
    margin: 0;
}

.lobby-server-status-details div {
    min-width: 0;
}

.lobby-server-status-details dt,
.lobby-server-status-details dd {
    margin: 0;
}

.lobby-server-status-details dd {
    margin-top: 3px;
    overflow: hidden;
    font-size: 13px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .lobby-server-status-panel {
        grid-template-columns: 1fr 36px;
    }

    .lobby-server-status-details {
        grid-column: 1 / -1;
        grid-template-columns: repeat(2, minmax(110px, 1fr));
    }
}
