﻿: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: 2000px;
    min-height: calc(100vh - 72px);
    margin: 0 auto;
    padding: 32px 48px;
}

.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"],
#pd-money-amount,
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;
}

.archived-games-dialog { width: min(720px, calc(100vw - 32px)); }

.archived-games-list { display: grid; gap: 8px; }

.archived-game-row {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.archived-game-row > div { display: grid; min-width: 0; gap: 3px; }
.archived-game-row > .archived-game-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.archived-game-row small { overflow-wrap: anywhere; color: var(--text-muted); }
.archived-game-row .game-symbol { filter: grayscale(1); opacity: 0.72; }

.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 auto auto;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #edf0f2;
}

.version-select-cell {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.version-select-cell input {
    margin: 0;
}

.asset-history-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.asset-history-actions label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 12px;
}

.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: repeat(4, minmax(0, 1fr));
}

.audit-toolbar .filter-search {
    min-width: 0;
    grid-column: span 2;
}

.audit-toolbar select,
.audit-toolbar input[type="date"] {
    width: 100%;
    min-width: 0;
}

.audit-filter-actions { display: flex; gap: 8px; }
.audit-filter-actions .button { flex: 1; min-width: 0; }

.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;
}

/* ===== Wallet live operations view ===== */
.wallet-sessions-panel,
.wallet-reports-panel,
.wallet-alerts-panel {
    margin-top: 18px;
}

.wallet-session-grid {
    display: grid;
    gap: 16px;
}

.wallet-session-grid h3 {
    margin: 0 0 8px;
    font-size: 13px;
}

.wallet-session-grid table,
.wallet-reports-panel table,
.wallet-reconciliation-panel table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.wallet-money-buckets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.wallet-money-bucket {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-muted);
}

.wallet-money-bucket span,
.wallet-money-bucket small {
    color: var(--text-muted);
    font-size: 11px;
}

.wallet-two-column {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr);
    gap: 18px;
}

.wallet-alert-list {
    display: grid;
    gap: 10px;
}

.wallet-alert {
    padding: 12px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--amber);
    border-radius: 8px;
}

.wallet-alert-critical {
    border-left-color: var(--red);
}

.wallet-alert > div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.wallet-alert p {
    margin: 8px 0 0;
    color: var(--text-muted);
    font-size: 11px;
    overflow-wrap: anywhere;
}

.wallet-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 12px;
    color: var(--text-muted);
    font-size: 12px;
}

.wallet-transaction-dialog {
    width: min(900px, calc(100vw - 32px));
}

/* ===== Wallet page: operations console redesign ===== */
#view-wallet [hidden] {
    display: none !important;
}

#view-wallet {
    --wallet-ink: #16272d;
    --wallet-muted: #6b7d82;
    --wallet-line: #dce8e8;
    --wallet-soft: #f4f8f8;
    scroll-behavior: smooth;
}

#view-wallet .page-heading {
    align-items: flex-end;
    min-height: 0;
    margin-bottom: 12px;
    padding: 14px 18px;
    border: 1px solid #d6e6e5;
    border-radius: 14px;
    background: linear-gradient(120deg, #eff8f6 0%, #f8fbfb 55%, #eef5fa 100%);
}

#view-wallet .wallet-heading-copy h1 {
    margin: 3px 0 6px;
    color: var(--wallet-ink);
    letter-spacing: -0.02em;
}

#view-wallet .wallet-heading-copy > p:last-child {
    margin: 2px 0 0;
    color: var(--wallet-muted);
    font-size: 12px;
}

#view-wallet .wallet-heading-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

#view-wallet .wallet-heading-hint {
    color: var(--wallet-muted);
    font-size: 12px;
    white-space: nowrap;
}

#view-wallet .wallet-section-nav {
    position: static;
    display: flex;
    gap: 4px;
    width: fit-content;
    max-width: 100%;
    margin: 10px 0 2px;
    padding: 3px;
    overflow-x: auto;
    border: 1px solid var(--wallet-line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 5px 16px rgba(37, 65, 70, 0.08);
    backdrop-filter: blur(8px);
}

#view-wallet .wallet-section-nav a,
#view-wallet .wallet-section-nav button {
    display: block;
    padding: 6px 10px;
    border-radius: 7px;
    color: var(--wallet-muted);
    border: 0;
    background: transparent;
    font-size: 12px;
    font-weight: 700;
    font-family: inherit;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

#view-wallet .wallet-section-nav a:hover,
#view-wallet .wallet-section-nav a:focus-visible,
#view-wallet .wallet-section-nav button:hover,
#view-wallet .wallet-section-nav button:focus-visible {
    outline: none;
    color: #0d6f68;
    background: #e6f4f1;
}

#view-wallet .wallet-scope-panel {
    position: sticky;
    top: calc(var(--topbar-height) + 12px);
    z-index: 15;
    display: grid;
    grid-template-columns: minmax(220px, .7fr) minmax(0, 2fr) auto;
    align-items: center;
    gap: 10px;
    margin: 8px 0 12px;
    padding: 10px 12px;
    border: 1px solid var(--wallet-line);
    border-left: 4px solid #1a9489;
    border-radius: 12px;
    background: #f7fbfa;
}

#view-wallet .wallet-scope-copy h2 {
    margin: 0;
    color: var(--wallet-ink);
    font-size: 15px;
}

#view-wallet .wallet-scope-copy p {
    display: none;
    margin: 4px 0 0;
    color: var(--wallet-muted);
    font-size: 12px;
}

#view-wallet .wallet-scope-list {
    display: flex;
    min-width: 0;
    gap: 8px;
    overflow-x: auto;
    padding: 2px;
}

#view-wallet .wallet-scope-button {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    min-height: 34px;
    padding: 7px 11px;
    border: 1px solid #c9ddda;
    border-radius: 8px;
    color: #4e656a;
    background: #fff;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

#view-wallet .wallet-scope-button.is-active {
    border-color: #7fb8da;
    color: #204961;
    background: #eaf5fb;
    box-shadow: inset 3px 0 0 #2878c8;
}

#view-wallet .wallet-scope-badge {
    display: inline-grid;
    width: 24px;
    height: 24px;
    margin-right: 7px;
    place-items: center;
    border-radius: 6px;
    color: #fff;
    background: #6c7a82;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .02em;
}

#view-wallet .wallet-scope-button[data-wallet-scope^="A|"] .wallet-scope-badge {
    background: #2878c8;
}

#view-wallet .wallet-scope-button[data-wallet-scope^="HW|"] .wallet-scope-badge {
    background: #7558a6;
}

#view-wallet .wallet-scope-label {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
}

#view-wallet .wallet-scope-detail {
    color: var(--wallet-muted);
    font-size: 11px;
    white-space: nowrap;
}

#view-wallet [id$="-section"] {
    scroll-margin-top: calc(var(--topbar-height) + 96px);
}

#view-wallet .workspace-section-heading {
    margin: 12px 0 6px;
}

#view-wallet .workspace-section-heading h2 {
    color: var(--wallet-ink);
    font-size: 14px;
}

#view-wallet .workspace-section-heading p {
    font-size: 11px;
}

#view-wallet .panel {
    border-color: var(--wallet-line);
    box-shadow: 0 2px 10px rgba(36, 65, 70, 0.04);
}

#view-wallet .panel-heading {
    min-height: 52px;
    padding: 10px 14px;
}

#view-wallet .panel-heading p {
    font-size: 11px;
}

#view-wallet .wallet-overview-panel {
    margin-top: 6px;
    border-top: 3px solid #1a9489;
}

#view-wallet #wallet-overview-metrics {
    grid-template-columns: repeat(5, minmax(140px, 1fr));
    gap: 10px;
}

#view-wallet #wallet-overview-metrics.wallet-generic-metrics {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
}

#view-wallet #wallet-overview-metrics .metric-card {
    min-height: 88px;
    padding: 10px 12px;
    border-color: var(--wallet-line);
    background: #fff;
}

#view-wallet #wallet-overview-metrics .metric-card strong {
    margin-top: 8px;
    color: var(--wallet-ink);
    font-size: 24px;
    letter-spacing: -0.02em;
}

#view-wallet #wallet-overview-metrics .metric-card:nth-child(2) strong,
#view-wallet #wallet-overview-metrics .metric-card:nth-child(4) strong {
    color: #b46a18;
}

#view-wallet #wallet-overview-metrics .metric-card.metric-warn {
    background: #fff8e8;
    border-color: #ecd095;
}

#view-wallet #wallet-overview-metrics .metric-card.metric-warn strong {
    color: var(--amber, #b46a18);
}

#view-wallet #wallet-overview-metrics .metric-card.metric-danger {
    background: #fff1f1;
    border-color: #efcaca;
}

#view-wallet #wallet-overview-metrics .metric-card.metric-danger strong {
    color: var(--red, #b54848);
}

#view-wallet .wallet-money-buckets {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    margin-top: 10px;
}

#view-wallet .wallet-money-bucket {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    min-height: 44px;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-color: var(--wallet-line);
    border-radius: 0;
    background: var(--wallet-soft);
}

#view-wallet .wallet-money-bucket:nth-child(even) {
    background: #fff;
}

#view-wallet .wallet-money-bucket strong {
    color: var(--wallet-ink);
    font-family: Consolas, monospace;
    font-size: 18px;
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: normal;
    overflow-wrap: anywhere;
}

#view-wallet .wallet-money-identity {
    min-width: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 680px) {
    #view-wallet .wallet-money-bucket { grid-template-columns: minmax(0, 1fr); gap: 4px; }
    #view-wallet .wallet-money-bucket strong { text-align: left; }
}

#view-wallet .wallet-money-positive { color: var(--green, #278a54); }
#view-wallet .wallet-money-negative { color: var(--red, #b54848); }
#view-wallet .wallet-money-warning { color: var(--amber, #b46a18); }
#view-wallet .wallet-money-info { color: var(--blue, #2878c8); }
#view-wallet .wallet-money-neutral { color: var(--wallet-ink); }

#view-wallet .wallet-money-bucket:hover {
    background: #eaf5f7;
}

#view-wallet .wallet-adapters-panel,
#view-wallet .wallet-config-panel,
#view-wallet .wallet-sessions-panel {
    margin-top: 12px;
}

#view-wallet .wallet-adapters-panel .panel-heading,
#view-wallet .wallet-config-panel .panel-heading,
#view-wallet .wallet-sessions-panel .panel-heading {
    background: #fbfdfd;
}

#view-wallet .wallet-adapters-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}

#view-wallet .wallet-config-form {
    padding: 14px;
    border: 1px solid var(--wallet-line);
    border-radius: 10px;
    background: var(--wallet-soft);
}

#view-wallet .wallet-player-flow-panel {
    margin-top: 8px;
    border-top: 3px solid #3982a8;
}

#view-wallet #wallet-transaction-filter {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    padding: 12px;
    background: #f4f8fa;
}

#view-wallet .wallet-filter-advanced {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 10px;
    padding-top: 2px;
}

#view-wallet .wallet-filter-environment-field {
    display: none;
}

#view-wallet .wallet-filter-advanced[hidden] {
    display: none !important;
}

#view-wallet .wallet-filter-toolbar {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

#view-wallet .wallet-filter-toolbar .flow-actions {
    margin-left: auto;
}

#view-wallet #wallet-transaction-filter .flow-field-wide {
    grid-column: span 2;
}

#view-wallet .wallet-flow-summary {
    margin: 0 0 10px;
    border: 1px solid var(--wallet-line);
    background: #f8fbfb;
}

#view-wallet .wallet-flow-table thead th,
#view-wallet .wallet-reconciliation-panel thead th,
#view-wallet .wallet-approvals-panel thead th {
    background: #edf5f4;
    color: #4e656a;
}

#view-wallet .wallet-flow-table tbody tr:hover {
    background: #eaf5f7;
}

#view-wallet .status-dot {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 999px;
    background: transparent;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

#view-wallet .status-dot-success { color: var(--green, #278a54); background: #eaf6ee; }
#view-wallet .status-dot-info { color: var(--blue, #2878c8); background: #eaf3fb; }
#view-wallet .status-dot-warning { color: var(--amber, #b46a18); background: #fff4df; }
#view-wallet .status-dot-danger { color: var(--red, #b54848); background: #fff0f0; }
#view-wallet .status-dot-neutral { color: var(--text-muted); background: var(--surface-muted); }

#view-wallet .wallet-two-column {
    grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
    gap: 12px;
}

#view-wallet .wallet-two-column.wallet-single-column {
    grid-template-columns: 1fr;
}

#view-wallet .wallet-alerts-panel {
    border-top: 3px solid #d18b2b;
}

#view-wallet .wallet-reconciliation-panel {
    margin-top: 12px;
    border-top: 3px solid #7b66b1;
}

#view-wallet .wallet-approvals-panel {
    margin-top: 12px;
    border-top: 3px solid #4d85a5;
}

#view-wallet .wallet-sessions-panel .table-wrap,
#view-wallet .wallet-reports-panel .table-wrap,
#view-wallet .wallet-reconciliation-panel .table-wrap,
#view-wallet .wallet-approvals-panel .table-wrap {
    max-height: 360px;
    overflow: auto;
}

#view-wallet .wallet-session-grid > div,
#view-wallet .wallet-session-grid > .wallet-pipeline-card {
    min-width: 0;
}

#view-wallet .wallet-session-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

#view-wallet .wallet-session-grid > div,
#view-wallet .wallet-session-grid > .wallet-pipeline-card {
    padding: 10px;
    border: 1px solid var(--wallet-line);
    border-radius: 10px;
    background: #fbfdfd;
}

#view-wallet .wallet-pipeline-card {
    position: relative;
}

#view-wallet .wallet-pipeline-card + .wallet-pipeline-card::before {
    content: '→';
    position: absolute;
    top: 50%;
    left: -12px;
    color: #6b9caf;
    font-size: 18px;
    font-weight: 700;
}

#view-wallet .wallet-pipeline-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

#view-wallet .wallet-pipeline-card-head h3 {
    margin: 0;
    font-size: 13px;
}

#view-wallet .wallet-pipeline-list {
    max-height: 320px;
    overflow-y: auto;
}

#view-wallet .wallet-pipeline-row {
    display: grid;
    gap: 4px;
    padding: 7px 0;
    border-bottom: 1px solid #e4eeee;
}

#view-wallet .wallet-pipeline-row:last-child {
    border-bottom: 0;
}

#view-wallet .wallet-pipeline-fact {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

#view-wallet .wallet-pipeline-fact small {
    flex: 0 0 auto;
    color: var(--wallet-muted);
    font-size: 10px;
}

#view-wallet .wallet-pipeline-fact strong {
    overflow: hidden;
    color: var(--wallet-ink);
    font-size: 11px;
    font-weight: 600;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#view-wallet .wallet-session-expiring {
    background: #fff8e8;
}

#view-wallet .wallet-session-expired {
    background: #fff1f1;
}

#view-wallet .wallet-session-grid .table-wrap {
    max-height: 260px;
    overflow: auto;
}

@media (max-width: 1200px) {
    #view-wallet #wallet-overview-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1400px) {
    #view-wallet .wallet-session-grid {
        grid-template-columns: 1fr;
    }

    #view-wallet .wallet-pipeline-card + .wallet-pipeline-card::before {
        display: none;
    }
}

@media (max-width: 1100px) {
    #view-wallet .wallet-scope-panel {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    #view-wallet .wallet-scope-detail {
        white-space: normal;
    }

    #view-wallet #wallet-overview-metrics,
    #view-wallet #wallet-transaction-filter {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    #view-wallet .wallet-filter-advanced {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    #view-wallet #wallet-transaction-filter .flow-field-wide {
        grid-column: span 1;
    }

    #view-wallet .wallet-heading-hint {
        display: none;
    }
}

@media (max-width: 620px) {
    #view-wallet #wallet-overview-metrics.wallet-generic-metrics { grid-template-columns: minmax(0, 1fr); }
    #view-wallet .page-heading {
        align-items: flex-start;
        gap: 14px;
        padding: 12px 14px;
    }

    #view-wallet .wallet-heading-actions {
        width: 100%;
    }

    #view-wallet .wallet-heading-actions .button {
        width: 100%;
    }

    #view-wallet #wallet-overview-metrics,
    #view-wallet #wallet-transaction-filter {
        grid-template-columns: 1fr;
    }

    #view-wallet .wallet-filter-advanced {
        grid-template-columns: 1fr;
    }

    #view-wallet .wallet-two-column {
        grid-template-columns: 1fr;
    }

    #view-wallet .wallet-session-grid {
        grid-template-columns: 1fr;
    }

    #view-wallet .wallet-filter-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    #view-wallet .wallet-filter-toolbar .flow-actions {
        margin-left: 0;
    }

    #view-wallet .wallet-section-nav {
        width: 100%;
    }
}

.wallet-detail-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.wallet-detail-fields > div,
.wallet-detail-operations article {
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface-muted);
}

.wallet-detail-fields dt {
    color: var(--text-muted);
    font-size: 11px;
}

.wallet-detail-fields dd {
    margin: 4px 0 0;
    overflow-wrap: anywhere;
}

.wallet-detail-operations {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.wallet-detail-operations article > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.wallet-detail-operations p {
    margin: 7px 0 0;
    color: var(--text-muted);
    font-size: 11px;
    overflow-wrap: anywhere;
}

@media (max-width: 900px) {
    .wallet-two-column,
    .wallet-detail-fields {
        grid-template-columns: 1fr;
    }
}

/* ===== 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: 24%; }
.players-table th:nth-child(2) { width: 9%; }
.players-table th:nth-child(3) { width: 14%; }
.players-table th:nth-child(4), .players-table th:nth-child(5) { width: 14%; }
.players-table th:nth-child(6), .players-table th:nth-child(7) { width: 11%; }
.players-table th:nth-child(8) { width: 64px; }

.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-rounds-empty {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.player-rounds-empty .text-button {
    padding: 0;
}

.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;
}













.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, minmax(0, 1fr));
    gap: 12px;
}

[data-game-detail-content="rounds"] > .table-wrap { container-type: inline-size; }
[data-game-detail-content="rounds"] .round-detail-quad { width: calc(100cqw - 28px); max-width: 100%; }
.round-detail-quad .round-quad { min-width: 0; }
.round-detail-quad .rq-fields dd { overflow-wrap: anywhere; white-space: normal; }

@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(4, minmax(150px, 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-winner-table {
    max-width: 620px;
    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;
}

.wallet-config-panel { margin-top: 18px; }
.wallet-config-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(280px, 1fr));
    gap: 18px;
}
.wallet-config-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-muted);
}
.wallet-config-form h3,
.wallet-config-form button { grid-column: 1 / -1; }
.wallet-config-form label { display: grid; gap: 4px; font-size: 12px; color: var(--text-muted); }
.wallet-config-form input { width: 100%; min-width: 0; }
.wallet-readiness { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-top: 14px; }
.wallet-readiness-card { display: grid; gap: 5px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.wallet-readiness-card small { color: var(--text-muted); }
@media (max-width: 1080px) {
    .wallet-config-form { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
    .wallet-config-grid { grid-template-columns: 1fr; }
    .wallet-config-form { grid-template-columns: 1fr; }
}

.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;
}

/* ===== 币种与游戏分数页 ===== */
#view-exchange .exchange-field { display: grid; gap: 8px; min-width: 0; margin-bottom: 16px; }
#view-exchange select, #view-exchange input { width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
#view-exchange .exchange-preview-fields { display: grid; grid-template-columns: 1fr 1fr 1.5fr auto; align-items: end; gap: 16px; }
#view-exchange .exchange-preview-fields .exchange-field { margin-bottom: 0; }
#view-exchange .exchange-base-list { grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); }
#view-exchange .exchange-base-list > div { min-width: 0; overflow-wrap: anywhere; }
#view-exchange .exchange-base-panel > .exchange-field { margin: 16px 18px; }
#view-exchange .exchange-base-list { margin: 0 18px 18px; }
#exchange-preview-form { padding: 16px 18px 18px; }
#exchange-rate-form { padding: 16px 18px 0; }
#exchange-rate-load { margin-bottom: 16px; }
#exchange-rate-status { padding: 0 18px 18px; overflow-wrap: anywhere; }
#view-exchange .exchange-rates-panel > .infra-note { margin: 12px 18px 18px; }
#exchange-result { display: block; padding: 16px; border-radius: 8px; background: var(--surface-muted); overflow-wrap: anywhere; line-height: 1.8; }
#exchange-state { color: var(--text-muted); }
@media (max-width: 640px) {
    #view-exchange .exchange-preview-fields { grid-template-columns: 1fr; }
    #view-exchange .panel-heading { align-items: flex-start; flex-direction: column; gap: 12px; }
}
.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;
    pointer-events: auto;
    transform: translateY(0);
}

.toast[data-tone="error"] {
    background: #4b2024;
    border-color: #9b424a;
    box-shadow: 0 14px 35px rgba(76, 22, 28, 0.28);
}

.toast button {
    width: 26px;
    height: 26px;
    margin-left: 4px;
    padding: 0;
    color: inherit;
    font-size: 20px;
    line-height: 1;
    background: transparent;
    border: 0;
    border-radius: 4px;
    cursor: pointer;
}

.toast button:hover,
.toast button:focus-visible {
    background: rgba(255, 255, 255, 0.14);
    outline: none;
}

/* 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 {
    position: relative;
    z-index: 4;
    background: var(--surface);
}

.lobby-section-heading > div:first-child,
.lobby-content-heading > div:first-child {
    min-width: 0;
    flex: 1 1 auto;
}

.lobby-section-heading h2,
.lobby-section-heading p {
    overflow-wrap: anywhere;
}

.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-country-import {
    display: flex;
    flex: 0 1 auto;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px 8px;
    max-width: 760px;
}
.lobby-country-filter {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    font-size: 12px;
}
.lobby-country-search {
    width: 150px;
    min-height: 30px;
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--surface);
    color: var(--text);
    font-size: 12px;
}
.lobby-country-region {
    min-height: 30px;
    max-width: 110px;
    font-size: 12px;
}
.lobby-country-import .form-hint {
    flex-basis: 100%;
    text-align: right;
}

.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;
    width: 100%;
}

.lobby-category-table {
    width: 100%;
}

.lobby-game-table {
    min-width: 1370px;
}

.lobby-content-table {
    min-width: 680px;
}

.lobby-country-table {
    position: relative;
    min-width: 760px;
    table-layout: fixed;
}

.lobby-country-import-results {
    max-height: 320px;
    overflow: auto;
}
.lobby-country-import-results table {
    min-width: 560px;
}

.lobby-country-table th:nth-child(1) { width: 150px; }
.lobby-country-table th:nth-child(2) { width: 90px; }
.lobby-country-table th:nth-child(3) { width: 250px; }
.lobby-country-table th:nth-child(4) { width: 190px; }
.lobby-country-table th:nth-child(5) { width: 80px; }
.lobby-country-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.lobby-country-table td:nth-child(4) {
    vertical-align: middle;
}
.lobby-country-table td:nth-child(4) > * {
    margin: 0;
}
.lobby-country-table td:nth-child(4) {
    display: table-cell;
}
.lobby-country-table td:nth-child(4) .lobby-image-upload-status {
    display: block;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lobby-country-preview .lobby-cover-preview {
    flex: 0 0 68px;
}
.lobby-country-url {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-muted);
}
input[type="file"]::file-selector-button,
input[type="file"]::-webkit-file-upload-button {
    margin-right: 10px;
    padding: 7px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    background: #fff;
    color: #34404b;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

input[type="file"]::file-selector-button:hover,
input[type="file"]::-webkit-file-upload-button:hover {
    background: var(--surface-muted);
}

.lobby-category-table th:nth-child(1) { width: 16%; }
.lobby-category-table th:nth-child(2) { width: 21%; }
.lobby-category-table th:nth-child(3) { width: 37%; }
.lobby-category-table th:nth-child(4) { width: 9%; }
.lobby-category-table th:nth-child(5) { width: 11%; }
.lobby-category-table th:nth-child(6) { width: 6%; }
.lobby-category-table .block-copy { overflow-wrap: anywhere; }
#lobby-category-new-title { width: 160px; min-width: 100px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 5px; }
.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-identity {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
}

.lobby-game-identity > 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; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.upload-task-history-toolbar [hidden] { display: none !important; }
.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: 180px; flex: 1; gap: 5px; }
.lobby-apk-overview-copy small { color: var(--text-muted); }
.lobby-apk-version-line { display: flex; min-width: 0; align-items: center; gap: 8px; }
.lobby-apk-current { min-width: 0; overflow-wrap: anywhere; font-size: 16px; line-height: 1.3; }
.lobby-apk-current-meta { display: block; }
.lobby-apk-current-url-row { display: flex; min-width: 0; align-items: center; gap: 6px; }
.lobby-apk-current-url { min-width: 0; overflow: hidden; color: var(--blue); text-overflow: ellipsis; white-space: nowrap; }
.lobby-apk-current-url-row .icon-button { width: 30px; height: 30px; flex-basis: 30px; }
.lobby-apk-download-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 3px; }
.lobby-apk-download-actions .button { min-height: 32px; text-decoration: none; }
.lobby-apk-download-actions .button.is-disabled { opacity: .55; pointer-events: none; }
.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-apk-history { grid-column: 1 / -1; margin-top: 22px; border-top: 1px solid var(--border); padding-top: 18px; }
.lobby-apk-history-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.lobby-apk-history-heading h3 { margin: 0; font-size: 15px; }
.lobby-apk-history-heading p { margin: 4px 0 0; color: var(--text-muted); font-size: 12px; }
.lobby-apk-history-actions { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.lobby-apk-history-table { min-width: 720px; }
.lobby-apk-history-table th:first-child, .lobby-apk-history-table td:first-child { width: 38px; text-align: center; }
.lobby-apk-history-table .history-version { display: grid; gap: 2px; }
.lobby-apk-history-table .history-version small { color: var(--text-muted); }
.lobby-apk-history-table .history-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* 低频大厅资源配置：默认收起图片列，避免高频状态操作被四个编辑器挤出视口。 */
.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(280px, .5fr) 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: minmax(0, 1fr);
    }
}

@media (max-width: 640px) {



    .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); gap: 8px; }
    .upload-task-history-item strong { overflow-wrap: anywhere; }
    .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: 0; }
    .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-apk-history-heading { flex-direction: column; }
    .lobby-apk-history-actions { width: 100%; justify-content: space-between; }
}

.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-wallet-binding {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid #d7e5e8;
    border-radius: 8px;
    background: #f7fbfc;
}

.game-wallet-binding-head,
.game-wallet-binding-controls,
.game-wallet-binding-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.game-wallet-binding-head > div {
    display: grid;
    gap: 3px;
}

.game-wallet-binding-head small {
    color: var(--text-muted);
    font-size: 11px;
}

.game-wallet-binding-controls label {
    display: grid;
    flex: 1 1 auto;
    gap: 4px;
    color: var(--text-muted);
    font-size: 11px;
}

.game-wallet-binding-controls select {
    min-width: 0;
}

.game-wallet-binding-row {
    padding: 7px 8px;
    border-top: 1px solid #e1ecee;
    font-size: 12px;
}

.game-wallet-binding-row > span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.game-wallet-binding-list:empty {
    display: none;
}

.game-wallet-page {
    display: grid;
    gap: 14px;
}

.game-wallet-page-head,
.game-wallet-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.game-wallet-page-head h3 {
    margin: 2px 0 4px;
}

.game-wallet-page-head p,
.game-wallet-section-title small,
.game-wallet-page-add > p,
.game-wallet-page-row small {
    margin: 0;
    color: var(--text-muted);
    font-size: 11px;
}

.game-wallet-page-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr);
    gap: 12px;
}

.game-wallet-page-current,
.game-wallet-page-add {
    min-width: 0;
    padding: 14px;
    border: 1px solid #d7e5e8;
    border-radius: 10px;
    background: #f8fbfc;
}

.game-wallet-page-list {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.game-wallet-page-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid #dbe7e9;
    border-radius: 8px;
    background: #fff;
}

.game-wallet-page-row > div {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.game-wallet-page-row > div span {
    overflow: hidden;
    color: #52666b;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.game-wallet-page-badge {
    display: inline-grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 8px;
    color: #fff;
    background: #64767c;
    font-size: 10px;
    font-weight: 800;
}

.game-wallet-page-badge[data-provider="A"] { background: #2878c8; }
.game-wallet-page-badge[data-provider="HW"] { background: #7558a6; }
.game-wallet-page-badge[data-provider="C"] { background: #278a71; }

.game-wallet-page-add {
    display: grid;
    align-content: start;
    gap: 10px;
}

.game-wallet-page-add label {
    display: grid;
    gap: 5px;
    color: var(--text-muted);
    font-size: 11px;
}

.game-wallet-page-add select,
.game-wallet-page-add .button {
    width: 100%;
}

@media (max-width: 900px) {
    .game-wallet-page-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .game-wallet-page-row {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .game-wallet-page-row > .button {
        grid-column: 1 / -1;
        width: 100%;
    }

    .game-wallet-page-head,
    .game-wallet-section-title {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 520px) {
    .game-wallet-binding-controls {
        align-items: stretch;
        flex-direction: column;
    }

    .game-wallet-binding-controls .button {
        width: 100%;
        max-width: none;
    }
}

.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;
}

.game-outcome-presets {
    display: grid;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-muted);
}

.game-outcome-presets textarea {
    min-height: 76px;
    font-family: var(--font-mono, ui-monospace, monospace);
    line-height: 1.45;
}

.outcome-preset-section {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface, #fff);
}

.outcome-preset-section-showcard {
    border-color: #e3c48e;
    background: var(--amber-soft);
}

.outcome-preset-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.outcome-preset-section-head > div {
    display: grid;
    gap: 3px;
}

.outcome-preset-section-head small {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 400;
}

.outcome-preset-section-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.outcome-preset-toolbar {
    align-items: flex-end;
    flex-wrap: wrap;
}

.outcome-preset-library {
    margin-top: 14px;
}

#game-outcome-preset-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.outcome-preset-card {
    min-height: 168px;
}

.outcome-preset-card.is-active {
    border-color: var(--accent, #2563eb);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent, #2563eb) 16%, transparent);
}

.outcome-preset-card .template-meta {
    margin-top: auto;
}

.outcome-preset-card .template-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.outcome-preset-editor {
    margin-top: 14px;
    display: grid;
    gap: 12px;
}

.outcome-preset-editor.is-hidden {
    display: none;
}

.outcome-preset-editor-head,
.outcome-preset-identity,
.outcome-preset-editor-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.outcome-preset-identity {
    justify-content: flex-start;
}

.outcome-preset-identity label {
    min-width: 190px;
}

.outcome-preset-identity .compact-field {
    min-width: auto;
}

.preset-source-select {
    display: grid;
    gap: 4px;
    min-width: 210px;
}

.preset-source-select span {
    color: var(--text-muted);
    font-size: 12px;
}

.preset-source-select select {
    min-width: 210px;
}

.compact-field {
    display: flex;
    align-items: center;
    gap: 8px;
    width: auto;
    white-space: nowrap;
}

.compact-field input {
    width: 84px;
}

.preset-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    color: var(--green);
    background: var(--green-soft);
    font-size: 12px;
    font-weight: 700;
}

.preset-badge-showcard {
    color: var(--amber);
    background: #ffe8b5;
}

.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;
}

.field-validation-error {
    margin: -4px 0 0;
    color: var(--danger, #b4232c);
    font-size: 12px;
    line-height: 1.45;
}

.field-validation-error[hidden] {
    display: none;
}

input[aria-invalid="true"] {
    border-color: var(--danger, #b4232c);
    box-shadow: 0 0 0 2px rgba(180, 35, 44, 0.12);
}

@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 auto 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: 24px 48px;
    }

    .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;
    }

    .archived-game-row { grid-template-columns: 38px minmax(0, 1fr); }
    .archived-game-row > .archived-game-actions { grid-column: 1 / -1; }
    .archived-game-row .button { grid-column: 1 / -1; width: 100%; }

    .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 auto 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 use the page scrollport; keep their header in normal flow so it
   cannot overlap the first editable row while the workspace tabs switch. */
.lobby-workspace .table-wrap thead th {
    position: relative;
    top: auto;
}

.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: 1100px) {
    .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));
    }
    #lobby-server-refresh { grid-column: 2; grid-row: 1; }
}

/* 加密卡参数：窄屏换行，完整显示无符号64位代币比。 */
.card-parameter-batch-toolbar, .card-parameter-batch-actions, .card-parameter-template { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 12px 0; }
.card-parameter-batch-toolbar { padding: 0 18px; }
.card-parameter-batch-toolbar label, .card-parameter-row-select, .card-parameter-confirm { display: flex; align-items: center; gap: 8px; }
.card-parameter-batch-dialog { width: min(1000px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--border); border-radius: 12px; color: var(--text); background: #fff; }
.card-parameter-batch-dialog::backdrop { background: rgb(15 23 42 / 45%); }
.card-parameter-batch-dialog > .panel-heading { position: sticky; top: 0; background: #fff; z-index: 1; }
.card-parameter-batch-body { padding: 0 18px 18px; }
.card-parameter-template select { min-width: 0; max-width: 100%; padding: 8px; border: 1px solid var(--border); border-radius: 6px; }
.card-parameter-batch-dialog .warning-notice { padding: 12px; }
.card-parameter-batch-dialog .exchange-table td { white-space: normal; overflow-wrap: anywhere; }
#card-parameter-batch-dialog .card-params-reason { grid-column: 1 / -1; }
#card-parameter-batch-stop[hidden] { display: none; }
@media (max-width: 640px) {
    .card-parameter-batch-dialog .card-params-form fieldset { grid-template-columns: 1fr; }
    .card-parameter-batch-dialog > .panel-heading { align-items: flex-start; gap: 8px; }
    .card-parameter-batch-dialog .card-params-form { padding: 12px; }
}
.card-params-form { margin: 16px 0; padding: 16px; border: 1px solid var(--border, #dce3eb); border-radius: 10px; background: var(--surface, #fff); }
.card-params-form fieldset { display: grid; grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(120px, 1fr)); gap: 14px; min-width: 0; margin: 12px 0 0; padding: 0; border: 0; }
.card-params-form label { display: grid; gap: 7px; min-width: 0; font-size: 12px; }
.card-params-form input, .card-params-form select { box-sizing: border-box; width: 100%; min-width: 0; height: 36px; padding: 6px 9px; border: 1px solid #cbd5e1; border-radius: 5px; background: #fff; color: #243247; font: inherit; }
.card-params-form .card-params-reason { grid-column: 1 / -2; }
.card-params-form button { align-self: end; min-height: 36px; }
#bswc-room-dialog .room-dialog-layout { display: flex; flex-direction: column; max-height: calc(100dvh - 42px); }
#bswc-room-dialog form { max-height: none; margin: 0; }
#bswc-room-form { gap: 15px; }
#bswc-room-dialog .modal-body { min-height: 0; }
#room-card-params-host .card-params-form fieldset { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#room-card-params-host .card-params-reason { grid-column: 1 / -1; }
.room-card-params-notice { margin: 0 0 10px; color: var(--text-muted); font-size: 12px; }
@media (max-width: 640px) {
    #room-card-params-host .card-params-form fieldset { grid-template-columns: minmax(0, 1fr); }
}
.card-params-form fieldset:disabled { opacity: .65; }
@media (max-width: 1200px) { .card-params-form fieldset { grid-template-columns: repeat(2, minmax(0, 1fr)); } .card-params-form .card-params-reason { grid-column: 1; } }
@media (max-width: 640px) { .card-params-form fieldset { grid-template-columns: minmax(0, 1fr); } .card-params-form .card-params-reason { grid-column: auto; } }

/* 钱包配置可读化：表单上下分段，运营字段先展示当前生效配置，技术字段收进高级区。 */
#view-wallet .wallet-pane-tabs {
    position: static;
    display: flex;
    width: 100%;
    max-width: none;
    margin: 10px 0 8px;
    padding: 0;
    overflow-x: auto;
    border: 0;
    border-bottom: 1px solid var(--wallet-line);
    border-radius: 0;
    background: rgba(255, 255, 255, .94);
    box-shadow: none;
}

#view-wallet .wallet-pane-tabs button {
    position: relative;
    min-height: 38px;
    padding: 8px 14px 9px;
    border-radius: 0;
    color: var(--wallet-muted);
    font-size: 12px;
}

#view-wallet .wallet-pane-tabs button::after {
    position: absolute;
    right: 10px;
    bottom: -1px;
    left: 10px;
    height: 2px;
    background: transparent;
    content: '';
}

#view-wallet .wallet-pane-tabs button.is-active {
    color: #176e68;
}

#view-wallet .wallet-pane-tabs button.is-active::after {
    background: #1a9489;
}

#view-wallet .wallet-config-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--wallet-line);
    border-radius: 10px;
    background: var(--wallet-soft);
}

#view-wallet .wallet-config-form label {
    display: grid;
    align-content: start;
    gap: 5px;
    min-width: 0;
    color: var(--wallet-muted);
    font-size: 12px;
}

#view-wallet .wallet-config-form label > span {
    color: var(--wallet-ink);
    font-weight: 700;
}

#view-wallet .wallet-config-form label > span small,
#view-wallet .wallet-config-form label > small,
#view-wallet .wallet-form-intro p,
#view-wallet .wallet-effective-summary span {
    color: var(--wallet-muted);
    font-size: 11px;
    font-weight: 400;
    line-height: 1.45;
}

#view-wallet .wallet-config-form input {
    box-sizing: border-box;
    min-height: 36px;
    padding: 7px 9px;
    border-color: #c9ddda;
    background: #fff;
}

#view-wallet .wallet-id-cell,
#view-wallet .wallet-flow-table .text-button {
    display: block;
    max-width: 210px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#view-wallet .wallet-form-intro,
#view-wallet .wallet-effective-summary,
#view-wallet .wallet-readonly-field,
#view-wallet .wallet-form-field-wide,
#view-wallet .wallet-config-form > button {
    grid-column: 1 / -1;
}

#view-wallet .wallet-form-intro h3 {
    margin: 0;
    color: var(--wallet-ink);
    font-size: 14px;
}

#view-wallet .wallet-form-intro p {
    margin: 4px 0 0;
}

#view-wallet .wallet-effective-summary {
    display: grid;
    gap: 3px;
    padding: 10px 12px;
    border-left: 3px solid #1a9489;
    border-radius: 6px;
    background: #eaf5f2;
}

#view-wallet .wallet-effective-summary strong {
    color: #176e68;
    font-size: 12px;
}

#view-wallet .wallet-readonly-field {
    display: grid;
    gap: 3px;
    padding: 9px 11px;
    border: 1px dashed #c9ddda;
    border-radius: 6px;
    background: #fff;
}

#view-wallet .wallet-readonly-field > span {
    color: var(--wallet-muted);
    font-size: 11px;
    font-weight: 700;
}

#view-wallet .wallet-readonly-field > span small,
#view-wallet .wallet-readonly-field > small {
    color: var(--wallet-muted);
    font-size: 10px;
    font-weight: 400;
}

#view-wallet .wallet-readonly-field strong {
    overflow: hidden;
    color: var(--wallet-ink);
    font-family: Consolas, monospace;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#view-wallet .wallet-choice-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}

#view-wallet .wallet-choice-chip {
    min-height: 28px;
    padding: 4px 8px;
    border: 1px solid #c9ddda;
    border-radius: 999px;
    color: #4e656a;
    background: #fff;
    font: inherit;
    font-size: 11px;
    cursor: pointer;
}

#view-wallet .wallet-choice-chip:hover,
#view-wallet .wallet-choice-chip.is-selected {
    border-color: #7fb8da;
    color: #204961;
    background: #eaf5fb;
}

#view-wallet .wallet-choice-chip.is-selected::before {
    content: '✓ ';
}

#view-wallet .wallet-choice-empty {
    color: var(--wallet-muted);
    font-size: 11px;
}

@media (max-width: 1080px) {
    #view-wallet .wallet-config-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    #view-wallet .wallet-config-form {
        grid-template-columns: minmax(0, 1fr);
    }

    #view-wallet .wallet-pane-tabs button {
        flex: 0 0 auto;
    }
}

/* 钱包运营工作台：平台优先，技术配置只在对话框中出现。 */
#view-wallet .wallet-scope-panel {
    grid-template-columns: auto minmax(260px, 1fr) minmax(180px, 260px) auto;
}

#view-wallet .wallet-scope-button[data-wallet-scope="A"] .wallet-scope-badge {
    background: #2878c8;
}

#view-wallet .wallet-scope-button[data-wallet-scope="HW"] .wallet-scope-badge {
    background: #7558a6;
}

#view-wallet .wallet-account-select {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: var(--wallet-muted);
    font-size: 11px;
    font-weight: 700;
}

#view-wallet .wallet-account-select[hidden] {
    display: none !important;
}

#view-wallet .wallet-account-select select {
    width: 100%;
    min-width: 0;
    min-height: 34px;
    border-color: #c9ddda;
    background: #fff;
}

#view-wallet .wallet-settings-panel {
    margin-top: 6px;
    border-top: 3px solid #1a9489;
}

#view-wallet .wallet-current-account {
    margin: 8px 14px;
}

#view-wallet .wallet-current-account-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 12px;
    border: 1px solid #cfe3e1;
    border-radius: 10px;
    background: linear-gradient(100deg, #eef8f6, #f8fbfb);
}

#view-wallet .wallet-current-account-card > div:first-child {
    display: grid;
    gap: 2px;
    min-width: 0;
}

#view-wallet .wallet-current-account-card strong {
    overflow: hidden;
    color: var(--wallet-ink);
    font-size: 17px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#view-wallet .wallet-current-platform {
    color: #176e68;
    font-size: 11px;
    font-weight: 800;
}

#view-wallet .wallet-current-account-card small {
    color: var(--wallet-muted);
    overflow-wrap: anywhere;
}

#view-wallet .wallet-current-account-facts {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

#view-wallet .wallet-current-account-facts span {
    padding: 4px 8px;
    border: 1px solid #d4e4e3;
    border-radius: 999px;
    color: #506a6e;
    background: #fff;
    font-size: 11px;
    white-space: nowrap;
}

#view-wallet .wallet-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 0 14px 10px;
}

#view-wallet .wallet-settings-card {
    min-width: 0;
    padding: 11px;
    border: 1px solid var(--wallet-line);
    border-radius: 10px;
    background: #fbfdfd;
}

#view-wallet .wallet-settings-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

#view-wallet .wallet-settings-card-head h3 {
    margin: 2px 0 0;
    color: var(--wallet-ink);
    font-size: 14px;
}

#view-wallet .wallet-settings-kicker {
    color: #1a8178;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
}

#view-wallet .wallet-settings-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
    margin: 0;
}

#view-wallet .wallet-settings-facts div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

#view-wallet .wallet-settings-facts dt {
    color: var(--wallet-muted);
    font-size: 10px;
}

#view-wallet .wallet-settings-facts dd {
    margin: 0;
    overflow: hidden;
    color: var(--wallet-ink);
    font-family: Consolas, monospace;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#view-wallet .wallet-settings-card .wallet-effective-summary {
    margin-bottom: 8px;
}

#view-wallet .wallet-settings-card .wallet-readiness {
    grid-template-columns: 1fr;
    gap: 6px;
    max-height: 118px;
    margin-top: 0;
    overflow-y: auto;
}

#view-wallet .wallet-settings-card .wallet-readiness-card {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 4px 8px;
    padding: 7px 9px;
}

#view-wallet .wallet-settings-card .wallet-readiness-note {
    grid-column: 1 / -1;
}

#view-wallet .wallet-session-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

#view-wallet .wallet-session-summary > div {
    display: grid;
    gap: 3px;
    padding: 7px;
    border-radius: 8px;
    background: #eef6f6;
    text-align: center;
}

#view-wallet .wallet-session-summary strong {
    color: #176e68;
    font-size: 20px;
}

#view-wallet .wallet-session-summary span,
#view-wallet .wallet-settings-help {
    color: var(--wallet-muted);
    font-size: 10px;
}

#view-wallet .wallet-settings-help {
    margin: 10px 0 0;
}

#view-wallet .wallet-config-dialog,
#view-wallet .wallet-session-dialog {
    width: min(820px, calc(100vw - 28px));
    max-height: calc(100dvh - 28px);
    margin: auto;
    padding: 0;
    overflow: auto;
    border: 1px solid #cfdedd;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(21, 48, 53, .28);
}

#view-wallet .wallet-session-dialog {
    width: min(1120px, calc(100vw - 28px));
}

#view-wallet .wallet-config-dialog::backdrop,
#view-wallet .wallet-session-dialog::backdrop {
    background: rgba(15, 31, 35, .48);
}

#view-wallet .wallet-config-dialog .dialog-head,
#view-wallet .wallet-session-dialog .dialog-head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--wallet-line);
    background: rgba(255, 255, 255, .97);
}

#view-wallet .wallet-config-dialog .dialog-head h2,
#view-wallet .wallet-session-dialog .dialog-head h2 {
    margin: 2px 0 0;
    font-size: 18px;
}

#view-wallet .wallet-config-dialog .wallet-config-form {
    margin: 0;
    padding: 18px;
    border: 0;
    border-radius: 0;
}

#view-wallet .wallet-config-dialog .wallet-config-form input[readonly] {
    color: #617277;
    background: #edf3f3;
}

#view-wallet .wallet-dialog-actions {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 4px;
}

.infra-managed-service-groups {
    display: grid;
    padding: 0 16px 16px;
    min-width: 0;
}

.infra-managed-service-tabs { display:flex; gap:8px; padding:16px; flex-wrap:wrap; }
.infra-managed-service-tabs button { display:flex; align-items:center; gap:10px; min-height:38px; padding:8px 14px; border:1px solid var(--border); border-radius:6px; background:var(--surface); color:var(--text); cursor:pointer; }
.infra-managed-service-tabs button[aria-selected="true"] { border-color:var(--green); color:var(--green); background:var(--surface-muted); font-weight:600; }
.infra-managed-service-tabs button:focus-visible { outline:2px solid var(--green); outline-offset:2px; }
.infra-managed-service-tabs span { font-size:12px; }
.infra-managed-service-groups > .table-wrap { min-width:0; border:1px solid var(--border); border-radius:6px; }

.infra-managed-service-group {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.infra-managed-service-group > .panel-heading {
    background: var(--surface-muted);
    padding: 12px;
}

.infra-managed-service-group h3 {
    margin: 0;
    font-size: 14px;
}

.infra-managed-service-group > summary {
    cursor: pointer;
    list-style: none;
}

.infra-managed-service-group > summary::-webkit-details-marker { display: none; }
.infra-managed-service-group > summary h3::before { content: '▸'; margin-right: 8px; }
.infra-managed-service-group[open] > summary h3::before { content: '▾'; }
.infra-managed-service-group:not([open]) > .table-wrap { display: none; }

.wallet-binding-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px;
}

.wallet-binding-controls select { flex: 1; min-width: 0; max-width: 440px; padding: 10px; }
.wallet-binding-controls p { flex-basis: 100%; margin: 0; overflow-wrap: anywhere; }
.host-service-item.is-hidden { display: none; }

#view-wallet .wallet-dialog-actions .button {
    white-space: nowrap;
}

#view-wallet .empty-state::before {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 6px;
    vertical-align: -3px;
    background: currentColor;
    content: '';
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 12h-6l-2 3h-4l-2-3H2'/%3E%3Cpath d='M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 12h-6l-2 3h-4l-2-3H2'/%3E%3Cpath d='M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z'/%3E%3C/svg%3E") center / contain no-repeat;
}

#view-wallet .wallet-empty-action .button {
    margin-left: 10px;
}

#view-wallet .wallet-bind-overview {
    margin-bottom: 12px;
}

#view-wallet .wallet-bind-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}

#view-wallet .wallet-bind-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid #cfe1df;
    border-radius: 10px;
    background: #fff;
}

#view-wallet .wallet-bind-card.is-unbound {
    border-color: #dde4e5;
    background: #f5f7f7;
}

#view-wallet .wallet-bind-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 12px;
}

#view-wallet .wallet-bind-card-head > div:first-child {
    display: flex;
    min-width: 0;
    gap: 9px;
}

#view-wallet .wallet-bind-card-head > div:first-child > div {
    display: grid;
    min-width: 0;
    gap: 2px;
}

#view-wallet .wallet-bind-card-head strong,
#view-wallet .wallet-bind-card-head small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#view-wallet .wallet-bind-card-head small {
    color: var(--wallet-muted);
    font-size: 11px;
}

#view-wallet .wallet-bind-provider-badge {
    display: inline-grid;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 7px;
    color: #fff;
    background: #6c7a82;
    font-size: 10px;
    font-weight: 800;
}

#view-wallet .wallet-bind-provider-badge[data-provider="A"] { background: #2878c8; }
#view-wallet .wallet-bind-provider-badge[data-provider="HW"] { background: #7558a6; }
#view-wallet .wallet-bind-provider-badge[data-provider="C"] { background: #278a71; }

#view-wallet .wallet-bind-alert {
    margin: 0;
    padding: 7px 12px;
    color: #8a5a13;
    background: #fff4df;
    font-size: 11px;
}

#view-wallet .wallet-bind-alert.is-danger {
    color: #a63f3f;
    background: #fff0f0;
}

#view-wallet .wallet-bind-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
    margin: 0;
    padding: 0 12px 12px;
}

#view-wallet .wallet-bind-facts div {
    display: grid;
    min-width: 0;
    gap: 2px;
}

#view-wallet .wallet-bind-facts dt {
    color: var(--wallet-muted);
    font-size: 10px;
}

#view-wallet .wallet-bind-facts dd {
    margin: 0;
    overflow: hidden;
    color: var(--wallet-ink);
    font-family: Consolas, monospace;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#view-wallet .wallet-scope-choice {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    gap: 18px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--wallet-line);
    border-radius: 8px;
}

#view-wallet .wallet-scope-choice legend {
    padding: 0 5px;
    color: var(--wallet-ink);
    font-size: 12px;
    font-weight: 700;
}

#view-wallet .wallet-scope-choice label {
    display: inline-flex;
    grid-auto-flow: column;
    align-items: center;
    gap: 6px;
    color: var(--wallet-ink);
}

#view-wallet .wallet-scope-choice input {
    width: auto;
    min-height: 0;
}

#view-wallet .wallet-onboard-progress {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin: 0;
    padding: 12px 18px 0;
    list-style: none;
}

#view-wallet .wallet-onboard-progress li {
    padding: 7px 9px;
    border-radius: 7px;
    color: var(--wallet-muted);
    background: #eef3f3;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}

#view-wallet .wallet-onboard-progress li.is-active {
    color: #176e68;
    background: #dff1ed;
}

#view-wallet .wallet-onboard-dialog [data-wallet-onboard-step] {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

#view-wallet .wallet-onboard-dialog [data-wallet-onboard-step][hidden] {
    display: none !important;
}

#view-wallet .wallet-onboard-result {
    grid-column: 1 / -1;
    min-height: 20px;
    margin: 0;
    color: var(--wallet-muted);
    font-size: 11px;
}

#view-wallet .wallet-onboard-result.is-success { color: #278a54; }
#view-wallet .wallet-onboard-result.is-error { color: #b54848; }

#view-wallet .wallet-session-dialog .wallet-session-grid {
    padding: 16px;
}

@media (max-width: 1100px) {
    #view-wallet .wallet-scope-panel {
        grid-template-columns: 1fr;
    }

    #view-wallet .wallet-settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    #view-wallet .wallet-bind-grid,
    #view-wallet .wallet-bind-facts {
        grid-template-columns: minmax(0, 1fr);
    }

    #view-wallet .wallet-current-account-card,
    #view-wallet .wallet-settings-card-head {
        align-items: stretch;
        flex-direction: column;
    }

    #view-wallet .wallet-current-account-facts {
        justify-content: flex-start;
    }

    #view-wallet .wallet-settings-grid {
        padding: 0 10px 10px;
    }

    #view-wallet .wallet-settings-facts,
    #view-wallet .wallet-onboard-dialog [data-wallet-onboard-step] {
        grid-template-columns: 1fr;
    }

    #view-wallet .wallet-session-summary {
        grid-template-columns: repeat(3, minmax(76px, 1fr));
        overflow-x: auto;
    }

    #view-wallet .wallet-dialog-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    #view-wallet .wallet-dialog-actions .button {
        width: 100%;
    }

    #view-wallet .wallet-onboard-progress {
        padding-inline: 12px;
    }
}

/* 玩家查询优先展示，分析报表按需展开。 */
#view-players .metric-grid { margin-bottom: 16px; }
#view-players .table-panel { border-top: 3px solid #3982a8; }
#view-players .players-table { min-width: 850px; }
#view-players .player-search-panel { padding: 20px; margin-bottom: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
#view-players .player-section-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
#view-players .player-section-heading h2 { margin: 0 0 5px; font-size: 16px; }
#view-players .player-section-heading p, #view-players .player-section-heading > span { margin: 0; color: var(--text-muted); font-size: 12px; }
#view-players .player-filter-toolbar { padding: 0; margin: 0; border: 0; }
#view-players .player-filter-field > span { font-size: 12px; }
#view-players .player-filter-field input, #view-players .player-filter-field select { height: 40px; }
#view-players .player-metric-scope { margin: 0 0 8px; font-size: 12px; font-weight: 600; }
#view-players .player-metric-scope span { margin-left: 10px; color: var(--text-muted); font-weight: 400; }
#view-players #player-metrics { gap: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
#view-players #player-metrics .metric-card { padding: 14px 18px; border: 0; border-right: 1px solid var(--border); border-radius: 0; box-shadow: none; }
#view-players #player-metrics .metric-card:last-child { border-right: 0; }
#view-players #player-metrics .metric-card > strong { font-size: 24px; margin: 4px 0; }
#view-players #player-metrics .metric-head { font-size: 12px; }
#view-players .player-query-summary { padding: 10px 14px; margin: 0 0 14px; border-radius: 6px; background: var(--blue-soft); color: var(--text-muted); font-size: 12px; overflow-wrap: anywhere; }
#view-players .player-who-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
#view-players .player-who-copy { display: grid; min-width: 0; gap: 2px; }
#view-players .player-who-copy > strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#view-players .player-who-copy .player-identifier-copy { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
#view-players .player-who-copy .status { width: max-content; margin-top: 3px; }
.player-avatar-thumb, .player-drawer-avatar { display: grid; place-items: center; flex: 0 0 auto; overflow: hidden; background: linear-gradient(135deg, #e9eef3, #d8e1e9); color: #5e7487; font-weight: 700; }
.player-avatar-thumb { width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 50%; font-size: 15px; }
.player-avatar-thumb img, .player-drawer-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.player-avatar-thumb.has-image { background: var(--surface-muted); }
#player-drawer .player-drawer-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
#player-drawer .player-drawer-title { min-width: 0; }
#player-drawer .player-drawer-avatar { width: 52px; height: 52px; border: 1px solid var(--border); border-radius: 50%; font-size: 19px; }
#player-drawer .player-drawer-avatar-source { margin: 4px 0 0; color: var(--text-muted); font-size: 11px; overflow-wrap: anywhere; }
#view-players .players-table tbody td:first-child > strong { display: block; margin-bottom: 4px; font-family: inherit; }
#view-players .players-table tbody td:first-child .status { margin-top: 6px; font-size: 10px; }
#view-players .players-table tbody tr:focus-within { background: var(--blue-soft); }
#player-drawer .player-profile-heading { margin: 22px 0 10px; font-size: 14px; }
#player-drawer .player-profile-heading:first-child { margin-top: 0; }
#player-drawer .player-profile-heading span { display: block; margin-top: 4px; font-size: 12px; font-weight: 400; color: var(--text-muted); }
#player-drawer .player-info-list { padding: 16px; gap: 14px 20px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-muted); }
#player-drawer .player-info-list > div { min-width: 0; }
#player-drawer .player-info-list dt small, #player-drawer .player-drawer-tabs small, #player-drawer .player-drawer-quick-actions small { display: none; }
#player-drawer .player-drawer-head h2 { overflow-wrap: anywhere; }
#player-drawer .player-drawer-head, #player-drawer .player-drawer-quick-actions, #player-drawer .player-drawer-tabs { flex-shrink: 0; }
#player-drawer .player-drawer-body { min-height: 0; }
#player-drawer .player-wallet-filter { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-bottom: 14px; }
#player-drawer .player-wallet-filter > :first-child, #player-drawer .player-wallet-filter > .player-filter-actions { grid-column: 1 / -1; }
#player-drawer #pd-wallet-status, #player-drawer #pd-notes-status { font-size: 12px; color: var(--text-muted); overflow-wrap: anywhere; }
#player-drawer .player-wallet-table { min-width: 780px; }
#view-reports #reports-revenue-body td:nth-child(n+4) { font-variant-numeric: tabular-nums; text-align: right; }
@media (max-width: 680px) {
    #view-players .player-who-cell { gap: 8px; }
    #view-players .player-avatar-thumb { width: 34px; height: 34px; font-size: 13px; }
    #player-drawer .player-drawer-avatar { width: 46px; height: 46px; }
    #view-players .player-search-panel { padding: 16px; }
    #view-players .player-section-heading, #view-players .player-results > .panel-heading { flex-direction: column; align-items: stretch; }
    #view-players .player-metric-scope span { display: block; margin: 4px 0 0; }
    #view-players #player-metrics .metric-card { padding: 12px; border-bottom: 1px solid var(--border); }
    #view-players #player-metrics .metric-card:nth-child(even) { border-right: 0; }
    #player-drawer .player-info-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 620px) {
    #view-players .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

#view-reports .reports-entry-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
#view-reports .reports-entry-card { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 22px; }
#view-reports .reports-entry-card h2 { margin: 0; }
#view-reports .reports-entry-card p { color: var(--text-muted); line-height: 1.7; margin: 0 0 4px; }
#view-reports .reports-entry-card button { margin-top: auto; }
#view-reports .reports-availability table { min-width: 560px; width: 100%; }
@media (max-width: 620px) { #view-reports .reports-entry-grid { grid-template-columns: minmax(0, 1fr); } }

#view-reports #reports-query { grid-template-columns: repeat(3,minmax(0,1fr)); }
#view-reports .reports-rule { color: var(--text-muted); line-height: 1.8; margin: 14px 0; }
#view-reports .reports-result { margin-bottom: 18px; }
#view-reports .reports-result table { width: 100%; min-width: 850px; }
#view-reports .reports-result td { overflow-wrap: anywhere; max-width: 260px; }
#view-reports .panel-heading-actions { flex-wrap: wrap; }
@media(max-width:620px){ #view-reports #reports-query { grid-template-columns: minmax(0,1fr); } #view-reports .panel-heading { flex-direction: column; align-items: stretch; gap: 12px; } }

#view-reports .reports-result .table-wrap { max-height: 440px; overflow: auto; }
#view-reports .reports-result thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; }

#view-resources .resource-avatar-fields { display: flex; flex-wrap: wrap; align-items: end; gap: 16px; margin: 18px 0; }
#view-resources .resource-avatar-fields[hidden], #view-resources [role="tabpanel"][hidden] { display: none; }
#view-resources .resource-avatar-fields label { display: grid; gap: 6px; flex: 1 1 220px; min-width: 0; }
#view-resources .resource-avatar-fields input { width: 100%; min-width: 0; }
#view-resources #resource-avatar-preview { object-fit: contain; border-radius: 12px; }
#view-resources #resource-avatar-status { overflow-wrap: anywhere; }
#view-resources .panel { padding: 22px; }
#view-resources h1 { font-size: 24px; margin: 0 0 6px; }
#view-resources h2 { font-size: 18px; margin: 0 0 8px; }
#view-resources p { color: var(--text-muted); line-height: 1.7; margin: 6px 0 16px; }
#view-resources .resource-avatar-fields input { min-height: 38px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; }
.avatar-defaults { padding-bottom: 28px; margin-bottom: 28px; border-bottom: 1px solid var(--border); }
#view-exchange summary { cursor: pointer; font-weight: 600; font-size: 15px; padding: 4px 0; }
.avatar-default-toolbar, .avatar-default-actions { display: flex; align-items: end; flex-wrap: wrap; gap: 16px; margin: 16px 0; }
.avatar-default-toolbar label, .avatar-default-card label { display: grid; gap: 8px; min-width: 0; }
.avatar-default-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
.avatar-default-card { padding: 20px; background: #f8fafb; border: 1px solid var(--border); border-radius: 12px; display: grid; gap: 14px; min-width: 0; }
.avatar-default-card h3 { margin: 0; font-size: 16px; }
.avatar-default-card input, .avatar-default-toolbar select { min-width: 0; width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 7px; background: white; }
.avatar-default-picture { height: 110px; display: grid; place-items: center; color: var(--text-muted); background: white; border-radius: 8px; }
.avatar-default-picture img { width: 88px; height: 88px; object-fit: contain; border-radius: 50%; }
.avatar-default-actions span { color: var(--text-muted); font-size: 13px; }
#view-exchange.is-active { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 20px; align-items: start; }
#view-exchange > .page-heading, #exchange-state, #view-exchange > .exchange-base-panel { grid-column: 1 / -1; }
#view-exchange > .page-heading { order: 0; margin: 0; }
#exchange-state { order: 1; margin: 0; }
#view-exchange > .exchange-base-panel { order: 2; background: linear-gradient(120deg,#eff8f4,#fff); }
#view-exchange > .exchange-config-panel { order: 3; }
#view-exchange > .exchange-points-panel { order: 4; }
#view-exchange > .exchange-rates-panel { order: 5; grid-column: 1/-1; }
#view-exchange > section[aria-labelledby="exchange-demo-title"] { order: 6; grid-column: 1/-1; background: #f8fafb; }
#view-exchange > .panel { padding: 24px; margin: 0; min-width: 0; border-radius: 14px; }
#view-exchange #exchange-rate-form, #view-exchange .exchange-preview-fields { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 16px; align-items: end; }
#view-exchange #exchange-rate-form label:nth-of-type(4), #view-exchange #exchange-rate-save, #view-exchange #exchange-result { grid-column: 1/-1; }
#view-exchange #exchange-rate-form input, #view-exchange #exchange-rate-form select { width: 100%; min-width: 0; min-height: 42px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; }
#view-exchange #exchange-rate-load { margin-bottom: 0; min-height: 42px; }
#view-exchange #exchange-rate-form .exchange-field { margin-bottom: 0; }
#view-exchange #exchange-result { display: block; padding: 18px; margin-top: 18px; background: #edf6f1; border-radius: 10px; overflow-wrap: anywhere; }
#view-exchange .exchange-base-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
@media(max-width: 1000px) { .avatar-default-grid { grid-template-columns: 1fr; } #view-exchange.is-active { grid-template-columns: minmax(0,1fr); } }
@media(max-width: 620px) { #view-exchange #exchange-rate-form, #view-exchange .exchange-preview-fields, #view-exchange .exchange-base-list { grid-template-columns: minmax(0,1fr); } #view-exchange > .panel { padding: 16px; } .avatar-default-toolbar > * { width: 100%; } }

/* 机器人控制台：状态与命令必须保持可扫描，窄屏只让表格自身滚动。 */
#view-robots { min-width: 0; }
#view-robots .robot-category-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 0 20px 14px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
#view-robots .robot-category-heading-copy { min-width: 0; }
#view-robots .robot-category-title-line { display:flex; align-items:center; flex-wrap:wrap; gap:12px; }
#view-robots .robot-category-header h1 { margin: 0; }
#view-robots .robot-category-header p:not(.eyebrow) { margin-top: 5px; color: var(--text-muted); }
#view-robots .robot-demo-badge { white-space:nowrap; }
#view-robots .robot-category-tabs { flex: 0 0 auto; }
#view-robots .robot-category-tabs button { min-width: 112px; min-height: 36px; }
#view-robots .robot-category-tabs button.robot-category-danger { color: var(--red); }
#view-robots .robot-category-tabs button.robot-category-danger.is-active { background: var(--red-soft); border-color: var(--red); }
#view-robots [data-robot-category-panel][hidden] { display: none !important; }
#view-robots .robot-live-panel > summary { display: none; }
#view-robots .robot-live-panel > .page-heading { align-items: center; min-height: 0; padding: 4px 20px 14px; margin-bottom: 16px; }
#view-robots .robot-page-state { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; margin-bottom: 14px; }
#view-robots .robot-message { color: var(--text-muted); overflow-wrap: anywhere; }
#view-robots .robot-message.is-success { color: var(--green); }
#view-robots .robot-message.is-error { color: var(--red); }
#view-robots .robot-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
#view-robots .robot-metrics .metric-card { min-height: 116px; }
#view-robots .panel { min-width: 0; margin-bottom: 18px; }
#view-robots .panel > .panel-heading { padding: 18px 20px; border-bottom: 1px solid var(--border); }
#view-robots .panel-heading p { margin-top: 4px; color: var(--text-muted); font-size: 12px; line-height: 1.6; }
#view-robots #demo-robot-panel { display: block; }
#view-robots #demo-robot-form { display:block; padding: 16px 20px; }
#view-robots #demo-robot-form .demo-enable-row { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:14px 16px; margin-bottom:16px; border:1px solid var(--green); border-radius:8px; background:#edf8f2; }
#view-robots #demo-robot-form .demo-enable-row p { margin:0; color:var(--text-muted); font-size:12px; }
#view-robots #demo-robot-form .demo-master-toggle { display:flex !important; grid-template-columns:none; align-items:center; gap:10px; color:var(--text); font-size:14px; font-weight:700; white-space:nowrap; }
#view-robots .demo-master-toggle input { width:20px; height:20px; margin:0; accent-color:var(--green); }
#view-robots .demo-fieldset { display:grid; gap:12px; min-width:0; margin:0 0 16px; padding:14px 16px 16px; border:1px solid var(--border); border-radius:8px; }
#view-robots .demo-fieldset legend { padding:0 8px; color:var(--text); font-size:13px; font-weight:700; }
#view-robots .demo-scope-fieldset { grid-template-columns:repeat(3,minmax(0,1fr)); }
#view-robots .demo-count-fieldset { grid-template-columns:repeat(4,minmax(0,1fr)); }
#view-robots .demo-bet-fieldset { grid-template-columns:repeat(3,minmax(0,1fr)); }
#view-robots .demo-fieldset label { display:grid; min-width:0; gap:6px; color:var(--text-muted); font-size:12px; }
#view-robots .demo-fieldset label > span:first-child { min-height:16px; }
#view-robots .demo-fieldset input,#view-robots .demo-fieldset select { width:100%; min-width:0; height:40px; padding:8px 10px; border:1px solid var(--border-strong); border-radius:6px; background:#fff; }
#view-robots .demo-fieldset select[multiple] { height:auto; min-height:104px; padding:4px; }
#view-robots .demo-hall-field { position:relative; }
#view-robots .demo-inline-toggle { display:flex; align-items:center; gap:6px; min-height:22px; color:var(--text); font-size:12px; }
#view-robots .demo-inline-toggle input,#view-robots .demo-random-toggle input { width:17px; height:17px; margin:0; }
#view-robots .demo-random-toggle { grid-column:1 / -1; display:flex !important; align-items:center; gap:8px; min-height:32px; color:var(--text) !important; font-weight:600; }
#view-robots .demo-bet-fieldset.is-demo-disabled { opacity:.55; background:#f5f7f8; pointer-events:none; }
#view-robots .demo-form-footer { display:flex; align-items:center; justify-content:space-between; gap:16px; padding-top:2px; }
#view-robots .demo-form-status { min-width:0; margin:0; color:var(--text-muted); font-size:12px; overflow-wrap:anywhere; }
#view-robots #demo-robot-status.is-success { color:var(--green); }
#view-robots #demo-robot-status.is-error { color:var(--red); }
#view-robots .robot-config-editor { margin: 16px 20px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-muted); }
#view-robots .robot-config-editor > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; cursor: pointer; font-weight: 700; }
#view-robots .robot-config-editor > summary small { color: var(--text-muted); font-weight: 500; }
#view-robots .robot-config-editor > summary small.is-locked { color: var(--red); }
#view-robots #robots-form { border-top: 1px solid var(--border); }
#view-robots #robots-form fieldset { min-width: 0; margin: 0; padding: 16px; border: 0; }
#view-robots #robots-form fieldset:disabled { opacity: .72; }
#view-robots .robot-form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
#view-robots .robot-form-grid label { display: grid; min-width: 0; gap: 6px; color: var(--text-muted); font-size: 12px; }
#view-robots .robot-form-grid input,
#view-robots .robot-form-grid select,
#view-robots .robot-filter-toolbar select { width: 100%; min-width: 0; height: 40px; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 6px; background: #fff; }
#view-robots .robot-form-grid input[readonly] { color: var(--text-muted); background: #edf0f2; }
#view-robots .robot-form-grid .robot-enabled-field { display: flex; min-height: 40px; align-items: center; align-self: end; gap: 8px; color: var(--text); }
#view-robots .robot-enabled-field input { width: 18px; height: 18px; }
#view-robots .robot-strategy-card { grid-column: 1 / -1; min-width: 0; padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: linear-gradient(135deg, #f7fafc, #fff); }
#view-robots .robot-strategy-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
#view-robots .robot-strategy-head strong { display: block; color: var(--text); font-size: 14px; }
#view-robots .robot-strategy-head small { display: block; max-width: 680px; margin-top: 4px; color: var(--text-muted); line-height: 1.55; }
#view-robots .robot-strategy-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
#view-robots .robot-strategy-grid select[multiple] { height: auto; min-height: 104px; padding: 4px; }
#view-robots .robot-strategy-grid input:disabled,
#view-robots .robot-strategy-grid select:disabled { cursor: not-allowed; color: var(--text-muted); background: #edf0f2; }
#view-robots .robot-toggle-field { display: flex !important; align-items: center; align-self: center; gap: 8px; min-height: 40px; color: var(--text) !important; white-space: nowrap; }
#view-robots .robot-toggle-field input { width: 18px; height: 18px; margin: 0; }
#view-robots .robot-form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 14px; }
#view-robots .robot-form-actions > span { margin-right: auto; color: var(--text-muted); font-size: 12px; overflow-wrap: anywhere; }
#view-robots .robot-form-status-row { display:flex; align-items:center; min-width:0; margin-top:14px; color:var(--text-muted); font-size:12px; line-height:1.5; }
#view-robots #robots-form .robot-form-actions { margin-top:8px; }
#view-robots .robot-groups-table,
#view-robots .robot-runs-table { min-width: 1080px; }
#view-robots .robot-groups-table td:first-child strong,
#view-robots .robot-groups-table td:first-child small,
#view-robots .robot-groups-table td:nth-child(3) strong,
#view-robots .robot-groups-table td:nth-child(3) small,
#view-robots .robot-groups-table td:nth-child(5) small { display: block; }
#view-robots .robot-groups-table td:nth-child(3) .status { margin: 5px 0; }
#view-robots .robot-groups-table small { color: var(--text-muted); }
#view-robots .robot-row-actions { display: flex; min-width: 310px; gap: 6px; }
#view-robots .robot-row-actions .button { min-width: 54px; }
#view-robots .robot-filter-toolbar { display: grid; grid-template-columns: repeat(2, minmax(180px, 260px)); gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
#view-robots .robot-filter-toolbar label { display: grid; gap: 5px; color: var(--text-muted); font-size: 12px; }
#view-robots .robot-run-id { max-width: 220px; overflow-wrap: anywhere; white-space: normal; }
#view-robots .robot-desired-state { display: block; margin-bottom: 5px; color: var(--text-muted); font-size: 11px; }
#view-robots .robot-error-cell { max-width: 240px; color: var(--red); overflow-wrap: anywhere; white-space: normal; }
#view-robots .robot-run-dialog { width: min(1080px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); margin: auto; padding: 0; overflow: auto; border: 1px solid var(--border); border-radius: 8px; background: #fff; box-shadow: 0 24px 70px rgba(17, 24, 39, .28); }
#view-robots .robot-run-dialog::backdrop { background: rgba(15, 23, 42, .48); }
#view-robots .robot-run-dialog .dialog-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.97); }
#view-robots .robot-run-detail { padding: 18px; }
#view-robots .robot-run-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; padding: 1px; margin: 0 0 16px; background: var(--border); }
#view-robots .robot-run-facts > div { min-width: 0; padding: 12px; background: #fff; }
#view-robots .robot-run-facts dt { color: var(--text-muted); font-size: 11px; }
#view-robots .robot-run-facts dd { margin: 5px 0 0; font-weight: 700; overflow-wrap: anywhere; }
#view-robots .robot-run-error { padding: 10px 12px; margin-bottom: 14px; color: var(--red); background: var(--red-soft); border-radius: 6px; overflow-wrap: anywhere; }
#view-robots .robot-events-heading { padding: 10px 0; }
#view-robots .robot-events-heading h3 { margin: 0; font-size: 14px; }
#view-robots .robot-events-table { min-width: 760px; }
#view-robots .robot-event-message { max-width: 360px; overflow-wrap: anywhere; white-space: normal; }
#view-robots .robot-detail-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 14px; }
#view-robots .robot-live-warning { display:flex; align-items:center; gap:10px; padding:12px 20px; margin:0 0 16px; color:#8a3b12; background:#fff4e5; border:1px solid #f0c36d; border-radius:6px; }
#view-robots .robot-live-warning i { flex:0 0 auto; }
#view-robots .robot-live-warning span { color:#9b6a2b; font-size:12px; }

@media (max-width: 1100px) {
    #view-robots .robot-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #view-robots .robot-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #view-robots .robot-strategy-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #view-robots .demo-scope-fieldset,#view-robots .demo-bet-fieldset { grid-template-columns:repeat(2,minmax(0,1fr)); }
    #view-robots .demo-count-fieldset { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

@media (max-width: 620px) {
    #view-robots .robot-category-header { align-items: stretch; flex-direction: column; padding: 0 12px 12px; }
    #view-robots .robot-category-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
    #view-robots .robot-category-tabs button { min-width: 0; }
    #view-robots .page-heading,
    #view-robots .panel > .panel-heading,
    #view-robots .robot-page-state,
    #view-robots .robot-form-actions { align-items: stretch; flex-direction: column; }
    #view-robots .page-heading .button,
    #view-robots .panel-heading .button,
    #view-robots .robot-form-actions .button { width: 100%; }
    #view-robots .robot-metrics,
    #view-robots .robot-form-grid,
    #view-robots .robot-strategy-grid,
    #view-robots .robot-run-facts,
    #view-robots .robot-filter-toolbar { grid-template-columns: minmax(0, 1fr); }
    #view-robots .robot-metrics .metric-card { min-height: 100px; }
    #view-robots .robot-config-editor { margin: 12px; }
    #view-robots .robot-config-editor > summary { align-items: flex-start; flex-direction: column; }
    #view-robots .robot-form-actions > span { margin: 0 0 6px; }
    #view-robots .demo-enable-row,#view-robots .demo-form-footer { align-items:stretch; flex-direction:column; }
    #view-robots .demo-scope-fieldset,#view-robots .demo-count-fieldset,#view-robots .demo-bet-fieldset { grid-template-columns:minmax(0,1fr); }
    #view-robots .demo-form-footer .robot-form-actions { justify-content:stretch; }
    #view-robots .demo-form-footer .robot-form-actions .button { flex:1; }
    #view-robots .robot-live-warning { align-items:flex-start; flex-wrap:wrap; padding:12px; }
    #view-robots #demo-robot-status { padding: 12px; }
    #view-robots .robot-run-detail { padding: 12px; }
    #view-robots .robot-detail-actions { flex-direction: column; }
    #view-robots .robot-detail-actions .button { width: 100%; }
}

/* 卡服原始快照独立折叠，保留 JSON 缩进且限制展开高度。 */
.rq-raw-outcome { margin-top: 8px; min-width: 0; }
.rq-raw-outcome summary { cursor: pointer; font-size: 11px; }
.rq-raw-outcome pre { max-height: 320px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11px; }

/* 大厅卡片沿用服务器卡片18px内边距。 */
.lobby-storage-status-panel, .lobby-api-key-card { padding: 14px 18px; margin-bottom: 16px; }
.lobby-storage-status-panel .lobby-server-status-details { margin-top: 12px; }
#demo-robot-form .demo-picker-field { display:grid; gap:6px; min-width:0; font-size:12px; color:var(--text-muted); }
#view-robots .demo-animal-hint { display:block; margin-top:-2px; color:var(--text-muted); font-size:11px; line-height:1.4; }
.demo-picker { position:relative; min-width:0; color:var(--text); }
.demo-picker > summary { display:block; cursor:pointer; height:40px; padding:10px 30px 10px 10px; border:1px solid var(--border-strong); border-radius:6px; background:#fff; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; position:relative; }
.demo-picker > summary::after { content:'▾'; position:absolute; right:10px; }
.demo-picker > summary::-webkit-details-marker { display:none; }
.demo-picker > summary:focus-visible { outline:2px solid var(--blue); outline-offset:2px; }
.demo-picker-panel { position:absolute; top:calc(100% + 4px); left:0; right:0; z-index:50; padding:10px; border:1px solid var(--border-strong); border-radius:6px; background:#fff; box-shadow:0 6px 20px #0002; }
.demo-picker-options { max-height:220px; overflow-y:auto; margin-top:8px; }
#demo-robot-form .demo-picker-options label { display:flex; align-items:center; gap:8px; padding:7px 4px; cursor:pointer; color:var(--text); }
#demo-robot-form .demo-picker-options input { width:16px; height:16px; flex:0 0 16px; margin:0; padding:0; }
#demo-robot-form select[hidden] { display:none; }
.demo-group-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(360px,100%),1fr)); gap:10px; padding:12px 20px 20px; }
.demo-group-card { display:grid; gap:12px; width:100%; text-align:left; padding:14px; border:1px solid var(--border); border-radius:8px; background:white; color:var(--text); cursor:pointer; }
.demo-group-card[aria-pressed="true"] { border-color:var(--blue); box-shadow:0 0 0 1px var(--blue); }
.demo-group-card-title { font-size:14px; }
.demo-group-card-fields { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.demo-group-card-field { min-width:0; }
.demo-group-card-field > span { display:block; margin-bottom:3px; color:var(--text-muted); font-size:11px; }
.demo-group-card-field > strong { display:block; overflow-wrap:anywhere; font-size:12px; font-weight:600; }
.demo-history-query { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); align-items:end; gap:12px; padding:16px 20px; }
.demo-history-query label { display:grid; gap:4px; min-width:0; }
.demo-history-query input,.demo-history-query select { width:100%; min-width:0; }
.demo-history-query button { justify-self:start; width:auto; white-space:nowrap; }
.demo-history-summary { margin:0; padding:0 20px 12px; color:var(--text-muted); }
#view-robots .robot-category-tabs { display:flex; flex-wrap:wrap; }
#view-robots #demo-history-panel { min-width:0; }
#view-robots #demo-robot-records { margin:0 20px; overflow-x:auto; }
#view-robots .demo-history-table { --history-time-width:170px; --history-context-width:220px; --history-round-width:72px; width:100%; min-width:1240px; border-collapse:collapse; font-size:13px; }
#view-robots .demo-history-table th,#view-robots .demo-history-table td { padding:10px 12px; border-bottom:1px solid var(--border); text-align:left; vertical-align:middle; }
#view-robots .demo-history-table th { color:var(--text-muted); font-weight:600; white-space:nowrap; }
#view-robots .demo-history-table > thead > tr > th:nth-child(1),#view-robots .demo-history-table > tbody > tr:not(.demo-history-detail) > td:nth-child(1) { width:var(--history-time-width); min-width:var(--history-time-width); }
#view-robots .demo-history-table > thead > tr > th:nth-child(2),#view-robots .demo-history-table > tbody > tr:not(.demo-history-detail) > td:nth-child(2) { width:var(--history-context-width); min-width:var(--history-context-width); }
#view-robots .demo-history-table > thead > tr > th:nth-child(3),#view-robots .demo-history-table > tbody > tr:not(.demo-history-detail) > td:nth-child(3) { width:var(--history-round-width); min-width:var(--history-round-width); }
#view-robots .demo-history-table > thead > tr > th:nth-child(-n+3),#view-robots .demo-history-table > tbody > tr:not(.demo-history-detail) > td:nth-child(-n+3) { position:sticky; z-index:1; background:var(--surface); }
#view-robots .demo-history-table > thead > tr > th:nth-child(1),#view-robots .demo-history-table > tbody > tr:not(.demo-history-detail) > td:nth-child(1) { left:0; }
#view-robots .demo-history-table > thead > tr > th:nth-child(2),#view-robots .demo-history-table > tbody > tr:not(.demo-history-detail) > td:nth-child(2) { left:var(--history-time-width); }
#view-robots .demo-history-table > thead > tr > th:nth-child(3),#view-robots .demo-history-table > tbody > tr:not(.demo-history-detail) > td:nth-child(3) { left:calc(var(--history-time-width) + var(--history-context-width)); box-shadow:2px 0 0 var(--border); }
#view-robots .demo-history-table .demo-history-context { color:var(--text-muted); font-size:12px; }
#view-robots .demo-history-table .demo-history-detail td { background:var(--surface-muted); padding:14px 18px; }
#view-robots .demo-history-detail dl { display:flex; gap:12px 24px; flex-wrap:wrap; margin:0 0 12px; }
#view-robots .demo-history-detail dt { color:var(--text-muted); font-size:12px; }
#view-robots .demo-history-detail dd { margin:2px 0 0; overflow-wrap:anywhere; }
#view-robots .demo-history-detail table { width:100%; border-collapse:collapse; }
#view-robots .demo-history-detail th,#view-robots .demo-history-detail td { padding:7px 10px; }
#view-robots .demo-history-footer { display:flex; justify-content:flex-end; align-items:center; gap:14px; padding:16px 20px; }
#view-robots .demo-history-empty { padding:24px; text-align:center; color:var(--text-muted); }
@media (max-width:1100px) { .demo-history-query { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:720px) {
    #view-robots .robot-category-header { align-items:stretch; flex-direction:column; padding:0 12px 14px; }
    #view-robots .robot-category-tabs button { flex:1 1 auto; min-width:0; }
    #view-robots .demo-history-query { grid-template-columns:minmax(0,1fr); padding:12px; }
    #view-robots #demo-robot-records { margin:0 12px; }
    .demo-group-list { grid-template-columns:minmax(0,1fr); padding-left:12px; padding-right:12px; }
    #view-robots .demo-group-card-fields { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
.wallet-release-panel .table-wrap { overflow-x: auto; }
.wallet-release-panel table { width: 100%; border-collapse: collapse; }
.wallet-release-panel th, .wallet-release-panel td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border-color, #d9e0e4); }
.wallet-release-panel td:nth-child(4) { max-width: 280px; overflow-wrap: anywhere; font-family: ui-monospace, monospace; font-size: 12px; }
.wallet-release-actions { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.wallet-release-actions label { display: grid; gap: 6px; flex: 1 1 250px; }
.wallet-release-actions input { width: 100%; }
.wallet-release-approval { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-color, #d9e0e4); }

/* 机器人管理页布局收口（2026-09-23）：降低操作密度，保证窄屏可用。 */
#view-robots .robot-category-header {
    align-items: center;
    gap: clamp(12px, 3vw, 28px);
    padding-inline: 0;
}

#view-robots .robot-category-heading-copy,
#view-robots .panel-heading > div:first-child,
#view-robots .robot-strategy-head > div:first-child {
    min-width: 0;
}

#view-robots .robot-category-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-width: min(100%, 360px);
    overflow: hidden;
}

#view-robots .robot-category-tabs button {
    min-width: 0;
    white-space: nowrap;
}

#view-robots .panel > .panel-heading {
    align-items: flex-start;
}

#view-robots .panel-heading .button {
    flex: 0 0 auto;
    white-space: nowrap;
}

#view-robots .robot-form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

#view-robots .robot-strategy-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

#view-robots .robot-strategy-head {
    flex-wrap: wrap;
}

#view-robots .robot-toggle-field {
    margin-left: auto;
}

#view-robots .robot-groups-table-wrap,
#view-robots .robot-runs-table-wrap,
#view-robots #demo-robot-records {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
}

#view-robots .robot-groups-table,
#view-robots .robot-runs-table {
    min-width: 960px;
}

#view-robots .robot-row-actions {
    width: max-content;
    min-width: 0;
    max-width: 100%;
    flex-wrap: wrap;
    align-items: center;
    white-space: normal;
}

#view-robots .robot-row-actions .button {
    min-width: 0;
    white-space: nowrap;
}

#view-robots .robot-filter-toolbar {
    grid-template-columns: repeat(auto-fit, minmax(220px, 260px));
    align-items: end;
}

#view-robots .demo-picker-field,
#view-robots .demo-bet-picker {
    min-width: 0;
}

#view-robots .demo-picker-panel {
    max-height: min(300px, 45vh);
    overflow: auto;
}

#view-robots .demo-picker-options {
    max-height: 220px;
}

#view-robots .demo-inline-toggle {
    margin-top: 2px;
}

@media (max-width: 1100px) {
    #view-robots .robot-form-grid,
    #view-robots .robot-strategy-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    #view-robots .robot-category-header {
        padding-inline: 0;
    }

    #view-robots .robot-category-tabs {
        width: 100%;
        min-width: 0;
    }

    #view-robots .robot-category-tabs button {
        padding-inline: 8px;
        font-size: 12px;
    }

    #view-robots .robot-form-grid,
    #view-robots .robot-strategy-grid,
    #view-robots .robot-filter-toolbar {
        grid-template-columns: minmax(0, 1fr);
    }

    #view-robots .robot-toggle-field {
        width: 100%;
        margin-left: 0;
        justify-content: flex-start;
    }

    #view-robots .robot-groups-table,
    #view-robots .robot-runs-table {
        min-width: 900px;
    }
}

/* 模拟下注历史按回合展示，复用游戏回合记录的四分区结构。 */
#view-robots .demo-history-rounds-table {
    min-width: 900px;
}

#view-robots .demo-history-rounds-table .round-row td {
    vertical-align: middle;
}

#view-robots .demo-history-rounds-table .demo-history-context {
    color: var(--text-muted);
    font-size: 12px;
}

#view-robots .demo-history-rounds-table .round-detail-row > td {
    white-space: normal;
}

#view-robots .demo-history-rounds-table .round-detail-quad {
    width: 100%;
    max-width: 100%;
}

#view-robots .demo-history-rounds-table .rq-demo-robot-table {
    max-width: 100%;
    overflow-x: auto;
}

#view-robots .demo-history-rounds-table .rq-demo-robot-table table {
    min-width: 680px;
}

#view-robots .demo-history-rounds-table .round-detail-toggle {
    min-width: 52px;
}

/* 机器人页复选框选中态：input 是替换元素，使用伪元素时部分浏览器不会绘制勾号。 */
#view-robots input[type="checkbox"]:not(.lobby-toggle):checked {
    background-color: var(--green);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5 6.5 12 13 4.5' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 12px 12px;
    border-color: var(--green);
}

#view-robots input[type="checkbox"]:not(.lobby-toggle):checked::before {
    transform: scale(0);
}

#view-robots .demo-picker-options input[type="checkbox"]:not(.lobby-toggle) {
    width: 16px;
    height: 16px;
    min-width: 16px;
    flex-basis: 16px;
    background-size: 11px 11px;
}

/* 机器人页复选框尺寸微调（2026-09-23）：减小视觉占位，保留整行点击区域。 */
#view-robots input[type="checkbox"]:not(.lobby-toggle) {
    width: 16px;
    height: 16px;
    min-width: 16px;
    flex-basis: 16px;
    border-radius: 3px;
}

#view-robots input[type="checkbox"]:not(.lobby-toggle):checked {
    background-size: 10px 10px;
}

#view-robots .demo-master-toggle input,
#view-robots .demo-random-toggle input,
#view-robots .robot-enabled-field input,
#view-robots .robot-toggle-field input {
    width: 16px;
    height: 16px;
    min-width: 16px;
    flex-basis: 16px;
}

#view-robots .demo-picker-options input[type="checkbox"]:not(.lobby-toggle) {
    width: 14px;
    height: 14px;
    min-width: 14px;
    flex-basis: 14px;
    border-radius: 3px;
    background-size: 9px 9px;
}

/* 公共服务灰度发布控制面：版本登记和批量任务只提交服务端编排请求。 */
#view-gray-release .gray-release-version-form,
#view-gray-release .gray-release-rollout-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
    margin: 0 0 16px;
    padding: 14px 16px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 8px;
}

#view-gray-release .gray-release-version-form label,
#view-gray-release .gray-release-rollout-form label {
    display: grid;
    min-width: 0;
    gap: 6px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
}

#view-gray-release .gray-release-version-form input,
#view-gray-release .gray-release-rollout-form input,
#view-gray-release .gray-release-rollout-form select {
    min-width: 0;
    width: 100%;
}

#view-gray-release .gray-release-version-wide,
#view-gray-release .gray-release-rollout-wide {
    grid-column: span 2;
}

#view-gray-release .gray-release-version-actions,
#view-gray-release .gray-release-rollout-actions {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    grid-column: 1 / -1;
}

#view-gray-release .gray-release-version-table,
#view-gray-release .gray-rollout-room-table {
    min-width: 860px;
}

#view-gray-release .gray-release-version-table td,
#view-gray-release .gray-release-version-table th,
#view-gray-release .gray-rollout-room-table td,
#view-gray-release .gray-rollout-room-table th {
    vertical-align: middle;
}

#view-gray-release .gray-release-version-table td:first-child {
    min-width: 170px;
}

#view-gray-release .gray-release-version-table td:first-child strong,
#view-gray-release .gray-release-version-table td:first-child small {
    display: block;
    overflow-wrap: anywhere;
}

#view-gray-release .gray-release-version-table td:first-child small {
    margin-top: 3px;
    color: var(--text-muted);
}

#view-gray-release .gray-release-version-actions-cell {
    display: flex;
    min-width: 170px;
    flex-wrap: wrap;
    gap: 6px;
}

#view-gray-release .gray-rollout-progress {
    display: grid;
    gap: 9px;
    margin: 0 0 16px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
}

#view-gray-release .gray-rollout-progress-head {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

#view-gray-release .gray-rollout-progress-head span,
#view-gray-release .gray-rollout-progress .form-hint {
    color: var(--text-muted);
}

#view-gray-release .gray-rollout-progress-track {
    height: 8px;
    overflow: hidden;
    background: var(--surface-muted);
    border-radius: 999px;
}

#view-gray-release .gray-rollout-progress-track span {
    display: block;
    height: 100%;
    min-width: 0;
    background: var(--green);
    border-radius: inherit;
    transition: width 180ms ease;
}

@media (max-width: 900px) {
    #view-gray-release .gray-release-version-form,
    #view-gray-release .gray-release-rollout-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    #view-gray-release .gray-release-version-form,
    #view-gray-release .gray-release-rollout-form {
        grid-template-columns: minmax(0, 1fr);
    }

    #view-gray-release .gray-release-version-wide,
    #view-gray-release .gray-release-rollout-wide {
        grid-column: auto;
    }

    #view-gray-release .gray-release-version-actions,
    #view-gray-release .gray-release-rollout-actions {
        justify-content: flex-start;
    }
}


/* 2026-09-24 原型对齐：资源管理页面。只改变展示层，保留现有接口和选择器。 */
#view-resources { min-width: 0; }
#view-resources .resource-page-head { margin-bottom: 18px; }
#view-resources .resource-page-head > div:first-child { min-width: 0; flex: 1 1 auto; }
#view-resources .resource-page-head h1 { margin: 0; font-size: 22px; font-weight: 600; }
#view-resources .resource-page-tabs { display: flex; flex: 0 0 auto; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; padding: 0; align-self: flex-start; border: 0; background: transparent; }
#view-resources .resource-page-tabs [role="tab"] { display: inline-flex; align-items: center; justify-content: center; width: 130px; min-width: 0; min-height: 36px; padding: 7px 0; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #66717d; font-size: 14px; font-weight: 400; line-height: 1.5; cursor: pointer; }
#view-resources .resource-page-tabs [role="tab"][aria-selected="true"] { border-color: #e3e8ee; background: #fff; color: #17212b; font-weight: 600; box-shadow: 0 1px 2px rgba(23,33,43,.06); }
#view-resources .resource-page-tabs [role="tab"]:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
#view-resources .resource-panel { padding: 0; overflow: hidden; }
#view-resources .resource-country-coverage { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; margin-bottom: 14px; padding: 14px 18px; background: var(--surface); }
#view-resources .resource-coverage-number { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
#view-resources .resource-coverage-number strong { color: var(--green); font-size: 22px; line-height: 1; }
#view-resources .resource-coverage-number span { color: var(--text-muted); font-size: 12px; }
#view-resources .resource-coverage-track { flex: 1 1 240px; max-width: 420px; height: 8px; overflow: hidden; background: #edf0f2; border-radius: 999px; }
#view-resources .resource-coverage-track > span { display: block; width: 0; height: 100%; background: var(--green); border-radius: inherit; transition: width 160ms ease; }
#view-resources .resource-coverage-missing { padding: 3px 9px; color: var(--amber); background: var(--amber-soft); border-radius: 6px; font-size: 12px; white-space: nowrap; }
#view-resources .resource-country-actions { justify-content: flex-end; margin-left: auto; }
#view-resources .resource-switch { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 12px; white-space: nowrap; }
#view-resources .resource-switch input { width: 15px; height: 15px; accent-color: var(--green); }
#view-resources .resource-country-head { padding: 16px 18px 10px; }
#view-resources .resource-country-head h2, #view-resources .resource-avatar-heading h2 { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.5; }
#view-resources .resource-country-head p, #view-resources .resource-avatar-heading p { margin: 4px 0 0; color: var(--text-muted); font-size: 12px; }
#view-resources .resource-country-tools { align-items: center; }
#view-resources .resource-country-tools .lobby-country-search { width: min(220px, 32vw); min-height: 34px; }
#view-resources .resource-country-region-bar { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; padding: 8px 18px 13px; border-bottom: 1px solid var(--border); }
#view-resources .resource-filter-label { color: var(--text-muted); font-size: 12px; }
#view-resources .resource-region-pill { min-height: 28px; padding: 3px 11px; color: var(--text-muted); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 999px; font-size: 12px; }
#view-resources .resource-region-pill.is-active, #view-resources .resource-region-pill:hover { color: #fff; background: #233040; border-color: #233040; }
#view-resources .resource-country-region-select { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#view-resources .resource-country-import-status { display: block; margin: 0; padding: 9px 18px 0; }
#view-resources .resource-table-wrap { margin-top: 8px; }
#view-resources .lobby-country-table { min-width: 860px; table-layout: fixed; }
#view-resources .lobby-country-table th:nth-child(1) { width: 16%; }
#view-resources .lobby-country-table th:nth-child(2) { width: 9%; }
#view-resources .lobby-country-table th:nth-child(3) { width: 19%; }
#view-resources .lobby-country-table th:nth-child(4) { width: 25%; }
#view-resources .lobby-country-table th:nth-child(5) { width: 12%; }
#view-resources .lobby-country-table th:nth-child(6) { width: 19%; }
#view-resources .lobby-country-table td { height: 62px; }
#view-resources .lobby-country-preview { display: flex; align-items: center; min-height: 34px; }
#view-resources .lobby-country-preview img { width: 68px; height: 42px; object-fit: contain; border: 1px solid var(--border); border-radius: 4px; background: var(--surface-muted); }
#view-resources .lobby-country-preview > span { color: var(--text-soft); font-size: 12px; }
#view-resources .resource-country-file { min-width: 0; }
#view-resources .resource-country-file > .resource-file-name { display: inline-block; max-width: min(220px, 100%); overflow: hidden; color: var(--text-muted); font-family: "Cascadia Mono", Consolas, monospace; font-size: 11px; text-overflow: ellipsis; vertical-align: middle; white-space: nowrap; }
#view-resources .resource-file-empty { color: var(--text-soft); font-size: 12px; }
#view-resources .resource-copy-button { margin-left: 7px; padding: 0; font-size: 11px; }
#view-resources .resource-country-state .status { min-width: 56px; }
#view-resources .resource-country-action { min-width: 0; }
#view-resources .resource-country-action .lobby-image-upload-status { display: block; max-width: 180px; margin-top: 3px; overflow: hidden; color: var(--text-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
#view-resources .resource-country-action .lobby-image-upload-status.is-success { color: var(--green); }
#view-resources .resource-country-action .lobby-image-upload-status.is-error { color: var(--red); }
#view-resources .resource-table-note { margin: 0; padding: 10px 18px 16px; }
#view-resources .resource-country-pager { flex-wrap: wrap; margin: 0; padding: 12px 18px; border-top: 1px solid #eef1f4; gap: 10px; }
#view-resources #lobby-country-page-summary { margin-right: auto; min-width: 0; color: #6b7885; font-size: 12.5px; overflow-wrap: anywhere; }
#view-resources .resource-page-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
#view-resources .resource-page-button { min-width: 30px; height: 30px; padding: 0 9px; border: 1px solid #d6dde4; border-radius: 6px; background: #fff; color: #34404b; font-size: 13px; cursor: pointer; white-space: nowrap; }
#view-resources .resource-page-button:hover:not(:disabled) { border-color: #b9c6d2; }
#view-resources .resource-page-button[aria-current=page] { background: #216a48; border-color: #216a48; color: #fff; font-weight: 600; }
#view-resources .resource-page-button:disabled { opacity: .45; cursor: default; }
#view-resources .resource-page-button:focus-visible { outline: 2px solid #216a48; outline-offset: 2px; }
#view-resources .resource-page-gap { color: var(--text-muted); padding: 0 2px; }
#view-resources .resource-avatar-panel { padding-bottom: 18px; }
#view-resources .resource-avatar-panel .avatar-defaults { margin: 0 0 14px; padding: 0 0 20px; }
#view-resources .resource-avatar-heading { min-height: 0; padding: 14px 18px 10px; border-bottom: 0; }
#view-resources .resource-heading-hint { margin-left: 8px; color: #8a95a1; font-size: 12.5px; font-weight: 400; }
#view-resources .resource-scope-bar { align-items: center; margin: 0 0 14px; padding: 13px 18px; background: var(--surface); }
#view-resources .resource-scope-bar label { display: grid; gap: 5px; color: var(--text-muted); font-size: 12px; }
#view-resources .resource-scope-bar label:first-child { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; width: auto; max-width: 100%; }
#view-resources .resource-scope-bar select { width: 280px; max-width: 100%; height: 34px; min-height: 34px; padding: 0 10px; }
#view-resources .resource-scope-bar .button { height: 34px; min-height: 34px; padding: 6px 14px; }
#view-resources .resource-scope-bar #avatar-default-inherit-label { display: inline-flex; align-items: center; gap: 6px; color: var(--text); }
#view-resources .resource-scope-bar #avatar-default-inherit-label[hidden] { display: none; }
#view-resources .resource-scope-bar #avatar-default-inherit { width: 16px; height: 16px; margin: 0; accent-color: var(--green); }
#view-resources .resource-inline-status { margin: 0; padding: 10px 18px; color: var(--text-muted); font-size: 12px; overflow-wrap: anywhere; }
#view-resources #avatar-default-form { padding: 0 18px; }
#view-resources .avatar-default-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
#view-resources .avatar-default-card { padding: 14px; gap: 10px; border-radius: 10px; background: var(--surface); }
#view-resources .avatar-default-card h3 { font-size: 14px; }
#view-resources .avatar-default-card p { margin: 2px 0 0; color: var(--text-muted); font-size: 11px; }
#view-resources .avatar-default-picture { height: 112px; background: var(--surface-muted); }
#view-resources .avatar-default-picture img { width: 88px; height: 88px; }
#view-resources .avatar-default-card input[type="url"] { min-height: 34px; padding: 7px 9px; }
#view-resources .avatar-default-card-actions { display: flex; align-items: center; gap: 8px; }
#view-resources .resource-file-button { position: relative; overflow: hidden; }
#view-resources .resource-file-button input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; opacity: 0; }
#view-resources .avatar-default-actions { align-items: center; margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--border); }
#view-resources .avatar-default-actions span { margin-right: auto; font-size: 12px; }
#view-resources .resource-avatar-personal { padding-bottom: 18px; }
#view-resources .resource-avatar-query-bar { align-items: center; gap: 10px; margin: 0; padding: 14px 18px; background: var(--surface); border: 0; }
#view-resources .resource-avatar-query-bar label { flex: 0 1 200px; width: 200px; max-width: 100%; gap: 0; color: var(--text-muted); font-size: 12px; }
#view-resources .resource-avatar-query-bar input, #view-resources .resource-avatar-query-bar select { width: 100%; min-width: 0; height: 34px; min-height: 34px; padding: 0 10px; border: 1px solid #d6dde4; border-radius: 8px; background: #fff; color: #17212b; font-size: 13.5px; }
#view-resources .resource-avatar-query-bar .button { min-height: 34px; padding: 7px 16px; font-size: 13.5px; }
#view-resources #resource-avatar-status:empty { display: none; }
#view-resources .resource-avatar-result-card { display: grid; grid-template-columns: 96px minmax(160px, .7fr) minmax(220px, 1fr) minmax(180px, .8fr) auto; align-items: center; gap: 12px; margin: 0 18px; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
#view-resources .resource-avatar-empty-state { margin: 0 18px 14px; padding: 12px 14px; border: 1px dashed var(--border-strong); border-radius: 8px; color: var(--text-muted); font-size: 12.5px; text-align: center; }
#view-resources .resource-avatar-empty-state[hidden] { display: none; }
#view-resources .resource-avatar-picture { display: grid; width: 96px; height: 96px; place-items: center; overflow: hidden; background: var(--surface-muted); border-radius: 8px; }
#view-resources .resource-avatar-picture img { width: 88px; height: 88px; object-fit: cover; border-radius: 50%; }
#view-resources .resource-avatar-picture span { color: var(--text-soft); font-size: 11px; }
#view-resources .resource-avatar-result-meta { display: grid; gap: 3px; }
#view-resources .resource-avatar-result-meta strong { font-size: 13px; }
#view-resources .resource-avatar-result-meta small { color: var(--text-muted); }
#view-resources .resource-avatar-result-card label { display: grid; gap: 5px; color: var(--text-muted); font-size: 12px; }
#view-resources .resource-avatar-result-card input[type="url"] { min-height: 36px; }
#view-resources .resource-avatar-actions { display: flex; gap: 7px; }
@media (max-width: 1100px) {
    #view-resources .resource-country-coverage { flex-wrap: wrap; }
    #view-resources .resource-coverage-track { order: 3; flex-basis: 100%; max-width: none; }
    #view-resources .resource-country-actions { margin-left: auto; }
    #view-resources .avatar-default-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #view-resources .resource-avatar-result-card { grid-template-columns: 96px minmax(0, 1fr); }
    #view-resources .resource-avatar-result-card > label, #view-resources .resource-avatar-actions { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
    #view-resources .resource-page-head { flex-direction: column; gap: 10px; }
    #view-resources .resource-page-tabs { width: 100%; }
    #view-resources .resource-page-tabs button { flex: 1 1 0; }
    #view-resources .resource-country-head { align-items: stretch; flex-direction: column; }
    #view-resources .resource-country-tools { flex-wrap: wrap; }
    #view-resources .resource-country-tools .lobby-country-search { width: min(100%, 260px); }
    #view-resources .resource-country-actions { width: 100%; justify-content: space-between; margin-left: 0; }
    #view-resources .avatar-default-grid { grid-template-columns: minmax(0, 1fr); }
    #view-resources .resource-avatar-result-card { grid-template-columns: 80px minmax(0, 1fr); margin-inline: 12px; }
    #view-resources .resource-avatar-picture { width: 80px; height: 80px; }
    #view-resources .resource-avatar-picture img { width: 72px; height: 72px; }
    #view-resources #avatar-default-form { padding-inline: 12px; }
    #view-resources .resource-avatar-heading, #view-resources .resource-inline-status, #view-resources .resource-scope-bar, #view-resources .resource-avatar-query-bar { padding-inline: 12px; }
}

/* 2026-09-24 原型对齐：机器人管理页面。数据与控制逻辑沿用现有脚本。 */
#view-robots #demo-robot-panel { border: 0; background: transparent; box-shadow: none; }
#view-robots #demo-robot-panel > .panel-heading { display: none; }
#view-robots .demo-robot-statusbar { display: flex; align-items: center; gap: 24px; margin-bottom: 14px; padding: 12px 20px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
#view-robots .demo-robot-statusbar > div { display: flex; align-items: baseline; gap: 7px; white-space: nowrap; }
#view-robots .demo-robot-statusbar strong { color: var(--green); font-size: 20px; line-height: 1; }
#view-robots .demo-robot-statusbar span { color: var(--text-muted); font-size: 12px; }
#view-robots .demo-robot-statusbar p { margin-left: auto; color: var(--text-muted); font-size: 12px; }
#view-robots .demo-robot-layout { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 6fr); gap: 14px; align-items: stretch; padding: 0; background: transparent; }
#view-robots .demo-robot-groups-pane, #view-robots .demo-robot-editor-pane { min-width: 0; margin-bottom: 0; border-radius: 10px; }
#view-robots .demo-pane-heading { min-height: 0; align-items: flex-start; padding: 14px 16px 10px; }
#view-robots .demo-pane-heading h3 { margin: 0; font-size: 15px; }
#view-robots .demo-pane-heading p { margin: 3px 0 0; color: var(--text-muted); font-size: 12px; }
#view-robots .demo-robot-groups-pane .demo-group-list { grid-template-columns: minmax(0, 1fr); max-height: clamp(240px, calc(100vh - 470px), 620px); overflow-y: auto; scrollbar-gutter: stable; padding: 12px 14px 16px; }
#view-robots .demo-robot-groups-pane .demo-group-card { border-radius: 9px; }
#view-robots .demo-group-card[aria-pressed="true"] { border-color: var(--green); box-shadow: 0 0 0 1px var(--green) inset; background: #fbfdfc; }
#view-robots .demo-group-card:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
#view-robots .demo-group-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px 16px 0; }
#view-robots .demo-group-filters label { display: grid; min-width: 0; gap: 5px; color: var(--text-muted); font-size: 12px; }
#view-robots .demo-group-filters input, #view-robots .demo-group-filters select { width: 100%; min-width: 0; min-height: 34px; padding: 6px 9px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text); }
#view-robots .demo-group-search, #view-robots .demo-group-by-row, #view-robots #demo-group-filter-status { grid-column: 1 / -1; }
#view-robots .demo-group-by-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--text-muted); font-size: 12px; }
#view-robots #demo-group-filter-status { margin: 0; color: var(--text-muted); font-size: 12px; }
#view-robots .demo-group-section { display: grid; min-width: 0; gap: 10px; }
#view-robots .demo-group-section h4 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin: 0; color: var(--text); font-size: 13px; overflow-wrap: anywhere; }
#view-robots .demo-group-section h4 span { color: var(--text-muted); font-size: 12px; font-weight: 400; }
#view-robots .demo-group-empty { margin: 0; padding: 18px 12px; border: 1px dashed var(--border-strong); border-radius: 8px; color: var(--text-muted); font-size: 12px; text-align: center; }
#view-robots .demo-robot-editor-pane #demo-robot-form { padding: 14px 16px 16px; }
#view-robots .demo-robot-editor-pane #demo-robot-form .demo-enable-row { margin-bottom: 14px; }
#view-robots .demo-robot-editor-pane #demo-robot-groups { display: none; }
@media (max-width: 1100px) {
    #view-robots .demo-robot-layout { grid-template-columns: minmax(0, 1fr); }
    #view-robots .demo-robot-statusbar { flex-wrap: wrap; gap: 14px; }
}
@media (max-width: 760px) {
    #view-robots .demo-robot-statusbar { align-items: flex-start; flex-wrap: wrap; padding: 12px; }
    #view-robots .demo-robot-statusbar p { flex-basis: 100%; margin-left: 0; }
    #view-robots .demo-robot-layout { grid-template-columns: minmax(0, 1fr); padding: 0; }
    #view-robots .demo-robot-groups-pane .demo-group-list { max-height: none; }
}

/* 原型双栏：仅使用后台已有配置、状态及控制能力。 */
#view-robots .robot-category-header { padding: 0; margin-bottom: 14px; border-bottom: 0; align-items: flex-start; }
#view-robots .robot-category-header h1 { font-size: 22px; font-weight: 600; }
#view-robots .robot-category-tabs { display: flex; flex-wrap: wrap; gap: 6px; width: auto; min-width: 0; padding: 0; margin-top: 6px; border: 0; background: transparent; overflow: visible; }
#view-robots .robot-category-tabs button { width: 116px; min-width: 0; min-height: 36px; padding: 7px 0; border: 1px solid transparent; border-radius: 8px; color: var(--text-muted); background: transparent; font-size: 14px; font-weight: 400; }
#view-robots .robot-category-tabs button.is-active, #view-robots .robot-category-tabs button.robot-category-danger.is-active { background: #fff; border-color: #e3e8ee; box-shadow: 0 1px 2px rgba(23,33,43,.06); font-weight: 600; }
#view-robots .robot-category-tabs button.is-active { color: var(--text); }
#view-robots .robot-category-tabs button.robot-category-danger { color: var(--red); }
#view-robots .robot-category-tabs button:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
#view-robots .robot-demo-badge[hidden] { display: none; }
#view-robots .demo-robot-editor-pane .demo-fieldset { border: 0; border-top: 1px solid var(--border); border-radius: 0; padding: 12px 0 4px; margin-bottom: 12px; }
#view-robots .demo-robot-editor-pane .demo-fieldset legend { padding-left: 0; }
#view-robots .demo-robot-editor-pane .demo-fieldset input, #view-robots .demo-robot-editor-pane .demo-fieldset select:not([multiple]) { height: 34px; padding: 6px 9px; }
#view-robots .demo-group-filters { grid-template-columns: minmax(0, 1fr); }
#view-robots .demo-group-filters > label { display: flex; align-items: center; gap: 10px; }
#view-robots .demo-group-filters select { width: min(230px, calc(100% - 42px)); }
#view-robots .demo-group-filters .demo-group-search input { width: min(300px, calc(100% - 42px)); }
#view-robots .demo-robot-editor-pane .demo-form-footer { border-top: 1px solid var(--border); padding-top: 12px; }
/* GLM 原型：四段编辑器、滚动分组列表与逐笔历史。 */
#view-robots .demo-robot-groups-pane { display: flex; flex-direction: column; max-height: max(660px, calc(100vh - 230px)); }
#view-robots .demo-robot-groups-pane .demo-group-list { flex: 1; min-height: 180px; max-height: none; align-content: start; padding: 12px 18px 16px; }
#view-robots .demo-group-list-note { margin: auto 0 0; padding: 0 18px 14px; color: var(--text-muted); font-size: 12px; }
#view-robots .demo-group-card { gap: 10px; padding: 12px 14px; }
#view-robots .demo-group-card:hover { border-color: #b9c6d2; }
#view-robots .demo-group-card-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
#view-robots .demo-group-card-title > strong { flex: 1; min-width: 100px; font-size: 13px; overflow-wrap: anywhere; }
#view-robots .demo-group-game-tag { padding: 2px 8px; border-radius: 6px; background: #233040; color: #fff; font-size: 12px; font-weight: 600; }
#view-robots .demo-group-card-title > .status { margin-left: auto; }
#view-robots .demo-group-card-fields { gap: 6px 14px; }
#view-robots .demo-group-card-field > span { font-size: 12px; }
#view-robots .demo-group-card-field > strong { font-size: 13px; }
#view-robots .demo-group-edit-hint { justify-self: start; padding: 4px 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); font-size: 12px; }
#view-robots .demo-pane-heading { align-items: center; gap: 12px; }
#view-robots .demo-editor-context { min-width: 0; color: var(--text-muted); font-size: 12px; text-align: right; overflow-wrap: anywhere; }
#view-robots .demo-robot-editor-pane #demo-robot-form { padding: 4px 18px 16px; }
#view-robots .demo-robot-editor-pane .demo-fieldset { gap: 10px; margin-bottom: 10px; }
#view-robots .demo-robot-editor-pane .demo-fieldset:first-of-type { border-top: 0; }
#view-robots .demo-legend-hint { color: var(--text-muted); font-size: 12px; font-weight: 400; margin-left: 6px; }
#view-robots #demo-robot-form .demo-all-halls-row { grid-column: 1 / -1; display: flex; align-items: center; gap: 7px; margin: 0; }
#view-robots #demo-robot-form .demo-bet-fieldset { grid-template-columns: repeat(12, minmax(0, 1fr)); }
#view-robots #demo-robot-form .demo-bet-fieldset > label { grid-column: span 3; }
#view-robots #demo-robot-form .demo-bet-fieldset > .demo-picker-field { grid-column: span 4; }
#view-robots #demo-robot-form .demo-random-toggle { align-self: end; min-height: 34px; font-weight: 400; }
#view-robots #demo-robot-form input[type=checkbox] { width: 16px; height: 16px; padding: 0; margin: 0; flex: 0 0 16px; }
#view-robots #demo-robot-form .demo-picker > summary { display: flex; align-items: center; gap: 4px; height: 34px; padding: 4px 25px 4px 8px; border-radius: 8px; font-size: 12px; }
#view-robots .demo-picker-chip { min-width: 0; overflow: hidden; text-overflow: ellipsis; padding: 1px 6px; border: 1px solid #d9e3ec; border-radius: 6px; background: #eef3f8; color: #3d4b59; }
#view-robots .demo-picker-count { flex: none; color: var(--text-muted); font-size: 11px; }
#view-robots #demo-robot-form .demo-switch-fieldset { display: block; }
#view-robots #demo-robot-form .demo-enable-row { justify-content: flex-start; flex-wrap: wrap; gap: 8px 14px; padding: 10px 14px; margin-bottom: 0; background: #f6faf7; border-color: #dcebe1; }
#view-robots #demo-robot-form .demo-enable-row p { flex: 1 1 180px; }
#view-robots #demo-robot-form .demo-master-toggle { position: relative; }
#view-robots #demo-robot-form .demo-master-toggle input[role=switch] { position: absolute; opacity: 0; width: 44px; height: 24px; }
#view-robots .demo-switch-track { position: relative; display: inline-block; width: 44px; height: 24px; flex: 0 0 44px; border-radius: 999px; background: #a6b0b9; }
#view-robots .demo-switch-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; }
#view-robots input:checked + .demo-switch-track { background: var(--green); }
#view-robots input:checked + .demo-switch-track::after { left: 23px; }
#view-robots input:focus-visible + .demo-switch-track { outline: 2px solid var(--green); outline-offset: 3px; }
#view-robots #demo-history-panel { min-height: calc(100vh - 260px); display: flex; flex-direction: column; border-radius: 10px; }
#view-robots #demo-history-panel.is-hidden, #view-robots #demo-history-panel[hidden] { display: none; }
#view-robots .demo-history-query { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 18px; }
#view-robots .demo-history-query > label { width: 140px; max-width: 100%; }
#view-robots .demo-history-query input, #view-robots .demo-history-query select { height: 34px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 13px; }
#view-robots .demo-history-query-actions, #view-robots .demo-history-custom-range { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
#view-robots .demo-history-custom-range { flex-basis: 100%; font-size: 12px; }
#view-robots .demo-history-custom-range[hidden] { display: none; }
#view-robots #demo-robot-records { flex: 1; min-width: 0; width: calc(100% - 36px); max-width: calc(100% - 36px); margin: 0 18px; box-sizing: border-box; align-self: stretch; overflow-x: auto; border-top: 1px solid var(--border); }
#view-robots .demo-prototype-history { min-width: 1180px; }
#view-robots .demo-prototype-history > thead > tr > th, #view-robots .demo-prototype-history > tbody > .round-row > td { padding: 8px 12px; white-space: nowrap; }
#view-robots .demo-prototype-history > thead > tr > th:nth-child(-n+3), #view-robots .demo-prototype-history > tbody > tr:not(.demo-history-detail) > td:nth-child(-n+3) { position: static; width: auto; min-width: 0; box-shadow: none; }
#view-robots .demo-prototype-history > thead > tr > th { background: #f7f9fa; color: #5b6873; font-size: 12px; }
#view-robots .demo-prototype-history .round-detail-toggle { padding: 0; border: 0; background: transparent; color: #2878c8; font-size: 13px; }
#view-robots .demo-prototype-history .round-detail-row > td { padding: 12px 18px; background: #f9fbfc; white-space: normal; }
#view-robots .demo-round-box { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); overflow: hidden; }
#view-robots .demo-round-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 20px; padding: 12px 14px; font-size: 12px; color: var(--text-muted); }
#view-robots .demo-round-head strong { color: var(--text); }
#view-robots .demo-round-bets { width: 100%; min-width: 780px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
#view-robots .demo-prototype-history .demo-round-bets td, #view-robots .demo-prototype-history .demo-round-bets th { padding: 8px 12px; background: var(--surface); font-size: 12px; }
#view-robots .demo-prototype-history .demo-round-bets th { background: #f7f9fa; }
#view-robots .demo-round-foot { margin: 0; padding: 10px 14px; color: var(--text-muted); font-size: 12px; }
#view-robots .demo-net-win { color: #1c7a4d; }
#view-robots .demo-net-lose { color: #c53b3b; }
#view-robots .demo-history-note { margin: 0; padding: 10px 18px 4px; color: var(--text-muted); font-size: 12px; }
#view-robots .demo-history-summary { margin: 0; padding: 4px 18px; font-size: 12px; color: var(--text-muted); }
#view-robots .demo-history-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; padding: 10px 18px; font-size: 12px; }
#view-robots .robot-agent-notice { margin: 8px 18px; padding: 10px 12px; border: 1px solid #efe0bb; border-radius: 8px; background: #fdf7ea; color: #9a6b13; font-size: 12px; }
#view-robots .robot-agent-notice[hidden] { display: none; }
@media (max-width: 1100px) {
    #view-robots .demo-robot-groups-pane { max-height: 640px; }
}
@media (max-width: 720px) {
    #view-robots #demo-robot-form .demo-scope-fieldset, #view-robots #demo-robot-form .demo-count-fieldset { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #view-robots #demo-robot-form .demo-bet-fieldset > label { grid-column: span 6; }
    #view-robots #demo-robot-form .demo-bet-fieldset > .demo-picker-field { grid-column: 1 / -1; }
    #view-robots .demo-form-footer { flex-wrap: wrap; }
    #view-robots .demo-legend-hint { display: block; margin-left: 0; }
    #view-robots .demo-history-query { padding: 12px; }
    #view-robots .demo-history-query > label { flex: 1 1 130px; }
}
#view-robots .robot-live-layout { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 6fr); align-items: start; gap: 14px; margin-bottom: 14px; }
#view-robots .robot-live-layout > .panel { margin: 0; border-radius: 10px; }
#view-robots .robot-live-layout .panel-heading { min-height: 0; padding: 14px 18px 10px; border-bottom: 0; }
#view-robots .robot-live-layout .panel-heading h2 { margin: 0; font-size: 15px; font-weight: 600; }
#view-robots .robot-live-filters { display: grid; gap: 8px; padding: 4px 18px 12px; }
#view-robots .robot-live-filters label, #view-robots .robot-live-group-by { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0; color: var(--text-muted); font-size: 12px; }
#view-robots .robot-live-filters select { width: min(230px, calc(100% - 42px)); min-width: 0; height: 34px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text); }
#view-robots .robot-live-group-list { display: grid; gap: 16px; max-height: clamp(260px, calc(100vh - 410px), 760px); overflow-y: auto; scrollbar-gutter: stable; padding: 0 18px 14px; }
#view-robots .robot-card-section { display: grid; gap: 10px; min-width: 0; }
#view-robots .robot-card-section > h3 { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin: 0; font-size: 13.5px; color: var(--text); }
#view-robots .robot-card-section > h3 small { font-size: 12px; font-weight: 400; color: var(--text-muted); }
#view-robots .robot-group-card { min-width: 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
#view-robots .robot-group-card.is-selected { border-color: var(--green); box-shadow: 0 0 0 1px var(--green) inset; background: #fbfdfc; }
#view-robots .robot-card-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; font-size: 13px; overflow-wrap: anywhere; }
#view-robots .robot-card-head > strong { min-width: 0; }
#view-robots .robot-card-head > .status { margin-left: auto; }
#view-robots .robot-card-game { padding: 2px 8px; border-radius: 6px; color: #fff; background: #233040; font-weight: 600; font-size: 12px; }
#view-robots .robot-card-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 14px; margin: 0 0 10px; }
#view-robots .robot-card-facts > div { min-width: 0; }
#view-robots .robot-card-facts dt { margin-bottom: 3px; color: var(--text-muted); font-size: 12px; }
#view-robots .robot-card-facts dd { margin: 0; font-size: 12.5px; font-weight: 600; overflow-wrap: anywhere; }
#view-robots .robot-group-card .robot-row-actions { display: flex; gap: 8px; flex-wrap: wrap; width: auto; }
#view-robots .robot-live-list-note { margin: 0; padding: 0 18px 14px; color: var(--text-muted); font-size: 12px; }
#view-robots .robot-live-editor > summary { padding: 14px 18px 10px; background: var(--surface); font-size: 15px; }
#view-robots .robot-live-editor > summary::marker { content: ''; }
#view-robots .robot-editor-meta { display: grid; gap: 3px; min-width: 0; text-align: right; font-size: 12px; font-weight: 400; color: var(--text-muted); overflow-wrap: anywhere; }
#view-robots .robot-live-editor #robots-form { border-top: 0; }
#view-robots .robot-live-editor #robots-form-fields { padding: 4px 18px 16px; }
#view-robots .robot-config-section { padding: 12px 0; border-top: 1px solid var(--border); }
#view-robots .robot-config-section:first-child { border-top: 0; }
#view-robots .robot-config-section h3 { margin: 0 0 10px; font-size: 13px; font-weight: 600; }
#view-robots .robot-config-section h3 small { margin-left: 6px; font-size: 12px; font-weight: 400; color: var(--text-muted); }
#view-robots .robot-live-editor .robot-form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
#view-robots .robot-live-editor .robot-form-grid input:not([type="checkbox"]), #view-robots .robot-live-editor .robot-form-grid select:not([multiple]) { height: 34px; padding: 6px 9px; border-radius: 8px; }
#view-robots .robot-live-editor .robot-strategy-card { padding: 0; border: 0; background: transparent; }
#view-robots .robot-live-editor .robot-strategy-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
#view-robots .robot-live-editor .robot-budget-section { margin-top: 4px; padding: 12px; border: 1px solid #efe0bb; border-radius: 8px; background: #fdf7ea; }
#view-robots .robot-budget-section .robot-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#view-robots .robot-budget-section .robot-enabled-field { grid-column: 1 / -1; }
#view-robots .robot-guard-note { margin: 0 0 10px; color: #9a6b13; font-size: 12px; }
#view-robots .robot-metrics { gap: 0; padding: 8px 4px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
#view-robots .robot-metrics .metric-card { min-height: 0; padding: 6px 14px; border: 0; background: transparent; box-shadow: none; }
#view-robots .robot-metrics .metric-card > strong { font-size: 20px; }
#view-robots .robot-metrics .metric-card p { margin: 4px 0 0; font-size: 11px; }
#view-robots .robot-metrics .metric-head { margin-bottom: 4px; }
#view-robots .robot-metrics .metric-head > [data-lucide] { display: none; }
@media (max-width: 1200px) {
    #view-robots .robot-card-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #view-robots .robot-live-editor .robot-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
    #view-robots .robot-live-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
    #view-robots .robot-category-tabs { width: 100%; }
    #view-robots .robot-category-tabs button { flex: 1; width: auto; font-size: 12px; }
    #view-robots .robot-live-group-list { max-height: 420px; padding-inline: 12px; }
    #view-robots .robot-live-editor .robot-form-grid, #view-robots .robot-live-editor .robot-strategy-grid { grid-template-columns: minmax(0, 1fr); }
    #view-robots .robot-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #view-robots .robot-live-editor > summary { align-items: flex-start; flex-direction: column; gap: 6px; }
    #view-robots .robot-editor-meta { text-align: left; }
}

/* 20260927 GLM 玩家／加密卡：逐区块对照原型，统一紧凑密度。 */
:is(#view-players, #view-card-gateway) { color: #17212b; }
:is(#view-players, #view-card-gateway) .page-heading { margin-bottom: 14px; gap: 16px; }
:is(#view-players, #view-card-gateway) .page-heading h1 { font-size: 22px; font-weight: 600; }
:is(#view-players, #view-card-gateway) .page-heading p { font-size: 13px; margin-top: 3px; }
:is(#view-players, #view-card-gateway) .panel { background: #fff; border: 1px solid #e3e8ee; border-radius: 10px; box-shadow: 0 1px 2px #17212b0a; }
:is(#view-players, #view-card-gateway) .panel-heading { min-height: 0; padding: 14px 18px 10px; margin: 0; border: 0; align-items: center; gap: 12px; }
:is(#view-players, #view-card-gateway) .panel-heading > div:first-child { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; min-width: 0; }
:is(#view-players, #view-card-gateway) .panel-heading h2 { margin: 0; font-size: 15px; font-weight: 600; }
:is(#view-players, #view-card-gateway) .panel-heading p { margin: 0; font-size: 12.5px; color: #8a95a1; }
:is(#view-players, #view-card-gateway) .status { border-radius: 999px; font-size: 12px; padding: 2px 10px; }
:is(#view-players, #view-card-gateway) .button { border-radius: 8px; font-size: 13px; min-height: 34px; padding: 6px 14px; }
:is(#view-players, #view-card-gateway) .button-small { min-height: 30px; padding: 4px 10px; font-size: 12px; }
:is(#view-players, #view-card-gateway) .button-primary { background: #216a48; border-color: #216a48; }
:is(#view-players, #view-card-gateway) .text-button { color: #216a48; font-weight: 400; font-size: 13px; }
:is(#view-players, #view-card-gateway) [hidden], .prototype-tab-panel[hidden], .card-detail-drawer[hidden] { display: none !important; }
.prototype-page-tabs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; width: fit-content; max-width: 100%; padding: 2px; margin-bottom: 14px; background: #eef1f3; border-radius: 6px; }
.prototype-page-tabs .button { min-height: 30px !important; padding: 4px 16px !important; color: #6b7885; background: transparent; border: 0; border-radius: 4px !important; font-size: 12.5px; }
.prototype-page-tabs [aria-selected="true"] { color: #17212b; background: #fff; box-shadow: 0 1px 3px #121c231f; font-weight: 600; }
.prototype-page-tabs .button[aria-selected="true"] { color: #17212b; background: #fff; box-shadow: 0 1px 3px #121c231f; font-weight: 600; }
.prototype-page-tabs .button[aria-selected="false"] { background: transparent; box-shadow: none; font-weight: 400; }
.prototype-tab-panel { min-width: 0; }
.prototype-scope { border-radius: 6px; padding: 2px 9px; background: #eef3f8; color: #3d4b59; font-size: 12px; }
#view-players .player-overview { margin-bottom: 14px; }
#view-players #player-metrics { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); padding: 6px 18px 12px; margin: 0; gap: 0; background: transparent; border: 0; border-radius: 0; overflow: visible; }
#view-players #player-metrics .metric-card { display: flex; flex-direction: column; min-height: 0; padding: 6px 18px; border: 0; border-left: 1px solid #eef1f4; border-radius: 0; box-shadow: none; background: transparent; }
#view-players #player-metrics .metric-card:first-child { padding-left: 0; border-left: 0; }
#view-players #player-metrics .metric-card > strong { order: -1; font-size: 24px; margin: 0 0 2px; }
#view-players #player-metrics .metric-head { font-size: 13px; color: #46525e; font-weight: 600; }
#view-players #player-metrics .metric-head :is(svg,i) { display: none; }
#view-players .player-online-metric > strong { color: #1c7a4d; }
#player-online-scope { font-size: 10.5px; color: #8a95a1; margin-top: 3px; }
#view-players .player-search-panel { padding: 0 18px 14px; margin-bottom: 14px; }
#view-players .player-search-panel .panel-heading { padding: 14px 0 10px; }
#view-players .player-filter-toolbar { display: grid; grid-template-columns: minmax(110px,.8fr) minmax(150px,1.2fr) minmax(110px,1fr) minmax(150px,1.2fr) minmax(110px,1fr) minmax(110px,.8fr); align-items: end; gap: 10px; margin: 0; padding: 0; border: 0; }
#view-players .player-filter-field :is(input,select) { height: 35px; min-width: 0; width: 100%; border: 1px solid #d6dde4; border-radius: 8px; background: #fff; font-size: 13px; }
#view-players .player-filter-actions { grid-column: 1 / -1; gap: 8px; }
#view-players .player-filter-field > span { text-align: left; }
.player-quick-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; font-size: 12px; color: #8a95a1; }
#view-players .player-quick-filters .button { min-height: 26px; border-radius: 999px; padding: 3px 10px; border: 1px solid #e0e7ec; background: #f4f7f9; font-size: 12px; }
#view-players .player-quick-filters .button:disabled { opacity: .65; cursor: not-allowed; }
#view-players .player-quick-filters [aria-pressed="true"] { background: #e6f4ec; color: #1c5c3c; border-color: #bcdccb; }
#view-players .player-quick-filters .player-risk-chip { background: #fdf0f0; border-color: #ecd2d2; color: #9c3535; }
#view-players .player-results { border-top: 1px solid #e3e8ee; }
#view-players .player-query-summary { background: transparent; padding: 0 18px 10px; margin: 0; font-size: 12.5px; color: #6b7885; }
:is(#view-players,#view-card-gateway) table { border-collapse: collapse; }
:is(#view-players,#view-card-gateway) table th { background: #f7f9fa; font-size: 12.5px; font-weight: 500; color: #5b6873; padding: 8px 12px; border-bottom: 1px solid #e3e8ee; }
:is(#view-players,#view-card-gateway) table td { padding: 9px 12px; border-bottom: 1px solid #f0f3f5; vertical-align: middle; font-size: 13px; }
#view-players .players-table { min-width: 1030px; table-layout: auto; }
#view-players .players-table th { width: auto; }
#view-players .players-table th:first-child { width: 220px; }
#view-players .players-table td:first-child { display: table-cell; }
#view-players .player-who-cell { display: flex; align-items: center; gap: 10px; }
#view-players .player-who-copy { min-width: 0; max-width: 170px; }
#view-players .player-who-copy > strong { font-family: inherit; font-size: 13px; font-weight: 600; }
#view-players .player-who-copy .player-identifier-copy { color: #8a95a1; font-size: 11.5px; }
#view-players .player-avatar-thumb { width: 32px; height: 32px; border: 0; font-size: 13px; }
:is(#view-players,#view-card-gateway) .table-pager { padding: 12px 18px; font-size: 12.5px; color: #6b7885; flex-wrap: wrap; gap: 10px; }
:is(#view-players,#view-card-gateway) .players-table-note { margin: 0; padding: 0 18px 14px; background: transparent; color: #8a95a1; font-size: 12px; }
#players-panel-analysis { display: block; }
.player-analysis-shell > .panel-heading .prototype-page-tabs { margin: 0; }
.player-analysis-shell .analysis-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 18px; color: #8a95a1; font-size: 12px; }
.analysis-meta h2 { display: none; }
.analysis-meta p { margin: 0; }
#view-players .player-comparison-panel, #view-players .player-retention-panel { margin: 0; padding: 0; border: 0; }
#view-players .player-game-comparison { padding: 0 18px 16px; }
#view-players .player-comparison-row { display: grid; grid-template-columns: minmax(180px,1fr) minmax(100px,420px) 75px; gap: 16px; padding: 12px 0; border-bottom: 1px solid #f0f3f5; border-radius: 0; box-shadow: none; }
#view-players .player-comparison-track { height: 6px; background: #eef1f4; border-radius: 99px; }
#view-players .player-comparison-track span { background: #216a48; }
#view-players .player-comparison-value { font-size: 18px; text-align: right; }
#view-players .player-retention-summary { padding: 8px 18px 14px; gap: 14px; }
#view-players .player-retention-summary > div { border: 1px solid #eef1f4; border-radius: 8px; background: #fff; padding: 10px 14px; }
#view-card-gateway .card-gateway-overview { margin: 0 0 14px; }
#view-card-gateway .infra-card-statusbar { display: flex; flex-wrap: wrap; padding: 14px 20px; gap: 18px; border: 0; background: #fff; }
#view-card-gateway .infra-card-kpis { display: flex; flex: 1; flex-wrap: wrap; min-width: 0; gap: 18px; border: 0; background: transparent; }
#view-card-gateway .infra-card-kpis > div { display: flex; flex: 1; flex-direction: column; min-width: 100px; padding: 0; border: 0; background: transparent; }
#view-card-gateway .infra-card-kpis dd { order: -1; font-size: 16px; margin: 0 0 3px; }
#view-card-gateway .infra-card-kpis dt { font-size: 12px; color: #8a95a1; }
#view-card-gateway .card-gateway-layout { display: grid; grid-template-columns: minmax(0,1fr); gap: 14px; }
#view-card-gateway .infra-card-workspace { padding: 0; overflow: hidden; }
#view-card-gateway .infra-card-workspace-head { padding: 14px 18px 10px; margin: 0; border: 0; align-items: center; gap: 12px; }
#view-card-gateway .infra-card-workspace-head > div:first-child { min-width: 0; }
#view-card-gateway .infra-card-workspace-head strong { font-size: 15px; }
#view-card-gateway .infra-card-workspace-head small { color: #8a95a1; font-size: 12px; }
#view-card-gateway .infra-card-workspace-actions { display: flex; flex-wrap: wrap; flex-shrink: 0; }
#view-card-gateway .infra-card-filterbar { display: flex; flex-direction: row; flex-wrap: wrap; gap: 10px; margin: 0; padding: 4px 18px 12px; }
#view-card-gateway .infra-card-game-field { display: block; }
#view-card-gateway .infra-card-game-field > span { display: none; }
#view-card-gateway .infra-card-filterbar :is(select,input) { height: 35px; border: 1px solid #d6dde4; border-radius: 8px; background: #fff; font-size: 13px; }
#view-card-gateway .infra-card-filterbar .filter-search { flex: 0 1 210px; margin: 0; }
#view-card-gateway .card-parameter-batch-toolbar { padding: 9px 18px; margin: 0; background: #f7f9fa; border-block: 1px solid #eef1f4; gap: 12px; }
#view-card-gateway .card-parameter-batch-toolbar small { font-size: 11px; color: #98a2ad; }
#view-card-gateway #open-card-parameter-batch { margin-left: auto; }
#view-card-gateway .infra-card-table-wrap { border: 0; border-radius: 0; margin: 0; }
#view-card-gateway .infra-card-table { table-layout: auto; min-width: 940px; }
#view-card-gateway .infra-card-table th, #view-card-gateway .infra-card-table td { display: table-cell; width: auto; }
#view-card-gateway .infra-card-table th:first-child { width: 38px; }
#view-card-gateway .infra-card-table th:nth-child(2) { width: 160px; }
#view-card-gateway .infra-card-table th:last-child { width: 115px; }
#view-card-gateway .infra-card-table td { font-size: 13px; }
#view-card-gateway .infra-card-actions { justify-content: flex-start; }
#view-card-gateway #infra-card-list-summary { margin: 0; padding: 10px 18px 0; background: transparent; }
.card-list-pager > div, .card-list-pages { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.card-list-pages [aria-current="page"] { background: #216a48; color: #fff; border-color: #216a48; }
#view-card-gateway .infra-card-summary { padding: 0; position: static; width: auto; background: #fff; }
.card-diagnostic-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); padding: 14px 18px; border-top: 1px solid #eef1f4; gap: 12px; }
.card-diagnostic-metrics > div { min-width: 0; border: 1px solid #eef1f4; border-radius: 8px; padding: 11px 13px; }
.card-diagnostic-metrics span { font-size: 12px; color: #8a95a1; }
.card-diagnostic-metrics strong { display: block; font-size: 15px; font-weight: 600; margin-top: 4px; overflow-wrap: anywhere; }
.card-diagnostic-metrics small { display: block; font-size: 11px; color: #a2abb4; margin-top: 4px; overflow-wrap: anywhere; }
.card-diagnostic-bottom { padding: 12px 18px 16px; border-top: 1px dashed #eef1f4; }
.card-diagnostic-bottom h3 { font-size: 13px; color: #46525e; margin: 0 0 8px; }
#view-card-gateway .infra-card-error-block { margin: 0 0 14px; padding: 10px 12px; background: #fdf7ea; border: 1px solid #f0e2bd; border-radius: 8px; color: #7a5c12; font-size: 12px; }
.card-command-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.card-command-chips span { background: #e6f4ec; color: #1c5c3c; border-radius: 6px; padding: 2px 9px; font-size: 12px; }
.card-count-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
/* 通信证书采用参考原型字体和原生文件控件，不继承旧抽屉的尺寸。 */
#cards-panel-cert { font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif; font-size: 14px; line-height: 1.5; color: #17212b; }
#cards-panel-cert .mono { font-family: Consolas, monospace; font-size: 12.5px; }
#cards-panel-cert .status { font-weight: 500; border: 0; line-height: 1.5; }
#cards-panel-cert .status-success { background: #e6f4ec; color: #1c7a4d; }
#cards-panel-cert .status-neutral { background: #eef1f4; color: #8a95a1; }
#cards-panel-cert .status-warning { background: #faf3e3; color: #9a6b13; }
#cards-panel-cert .status-danger { background: #fdf0f0; color: #b03a3a; }
#cards-panel-cert .certificate-validity-dates strong { background: transparent; }
#view-card-gateway:has(#cards-tab-cert[aria-selected="true"]) > .card-page-tabs-row { border-bottom: 1px solid #e3e8ee; padding-bottom: 12px; margin-bottom: 14px; }
#view-card-gateway:has(#cards-tab-cert[aria-selected="true"]) > .card-page-tabs-row .prototype-page-tabs { margin-bottom: 0; }
#cards-panel-cert .button { min-height: 0; padding: 7px 16px; font-size: 13.5px; font-weight: 400; line-height: normal; gap: 4px; }
#cards-panel-cert .button-secondary { background: #fff; color: #34404b; border-color: #d6dde4; }
#cards-panel-cert input[type="file"]::file-selector-button { all: revert; }
#cards-panel-cert .certificate-pager button { min-width: 30px; height: 30px; padding: 0 9px; font-size: 13px; border-radius: 6px; }
#cards-panel-cert .certificate-pager button:disabled { opacity: .45; cursor: default; }
#view-card-gateway .card-gateway-certificates { border: 0; border-radius: 0; overflow: visible; }
#view-card-gateway .card-gateway-cert-body { display: flex; flex-direction: column; gap: 14px; padding: 0; max-height: none; overflow: visible; }
.card-certificate-hero { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; padding: 18px 22px; }
.certificate-identity { display: flex; align-items: center; gap: 14px; flex: 0 1 auto; min-width: 0; max-width: 100%; padding-right: 24px; border-right: 1px solid #e3e8ee; }
.certificate-icon { width: 52px; height: 52px; display: grid; place-items: center; flex-shrink: 0; border-radius: 12px; background: #e6f4ec; color: #1c7a4d; font-size: 24px; }
.certificate-identity > div { min-width: 0; }
.certificate-identity h2 { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 17px; font-weight: 700; margin: 0; }
.certificate-identity p { margin: 2px 0 0; font-size: 12px; color: #8a95a1; overflow-wrap: anywhere; }
.certificate-identity strong { display: block; margin-top: 2px; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.certificate-validity { flex: 1; min-width: 320px; }
.certificate-validity-dates { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.certificate-validity-dates strong { font-size: 14px; white-space: nowrap; background: transparent; }
.certificate-validity small { display: block; color: #a2abb4; font-size: 11.5px; margin-top: 6px; }
.certificate-lifetime-track { position: relative; height: 8px; background: #eef1f4; border-radius: 99px; }
.certificate-lifetime-track progress { display: block; width: 100%; height: 8px; border: 0; border-radius: inherit; overflow: hidden; accent-color: #216a48; }
.certificate-lifetime-track progress::-webkit-progress-bar { background: #eef1f4; }
.certificate-lifetime-track progress::-webkit-progress-value { background: #216a48; }
#card-certificate-marker { position: absolute; top: -3px; width: 2px; height: 14px; background: #17212b; border-radius: 2px; }
.certificate-lifetime-track [hidden] { display: none; }
.certificate-hero-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.certificate-hero-actions small { max-width: 210px; text-align: right; font-size: 11.5px; color: #a2abb4; }
#view-card-gateway .card-certificate-versions { min-width: 0; overflow: hidden; }
#view-card-gateway .card-gateway-cert-table-wrap { max-height: none; margin: 0; border: 0; border-radius: 0; }
#view-card-gateway .card-gateway-cert-table { table-layout: auto; min-width: 760px; }
#view-card-gateway .card-gateway-cert-table th { width: auto; padding: 8px 12px; font-size: 12.5px; color: #5b6873; background: #f7f9fa; border-bottom: 1px solid #e3e8ee; }
#view-card-gateway .card-gateway-cert-table td { height: auto; padding: 9px 12px; font-size: 13px; border-bottom: 1px solid #f0f3f5; }
#view-card-gateway .card-gateway-cert-table td.mono { font-size: 12.5px; }
#view-card-gateway .card-gateway-cert-table tr:last-child td { border-bottom: none; }
#view-card-gateway .card-gateway-cert-table th:last-child { width: 120px; }
#view-card-gateway .card-gateway-cert-table .is-current td { background: #f6fbf8; }
#view-card-gateway .card-gateway-cert-table .is-current td:first-child { border-left: 3px solid #216a48; font-weight: 600; }
#view-card-gateway .card-gateway-cert-table .is-expired td { color: #a2abb4; }
#view-card-gateway .card-gateway-cert-table .cert-version-actions { display: flex; gap: 8px; flex-wrap: wrap; }
#view-card-gateway .card-gateway-cert-table .cert-version-actions .text-button { font-size: 13px; padding: 0; min-height: 0; }
.certificate-time-cell { white-space: nowrap; }
.card-certificate-note { padding: 10px 18px 14px; font-size: 12.5px; color: #8a95a1; margin: 0; }
#view-card-gateway .card-gateway-cert-upload { padding: 0; gap: 0; background: #fff; }
#view-card-gateway .card-gateway-cert-section-heading { display: flex; gap: 8px; padding: 14px 18px 10px; }
#view-card-gateway .card-gateway-cert-section-heading > div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
#view-card-gateway .card-gateway-cert-section-heading h2 { font-size: 15px; margin: 0; }
#view-card-gateway .card-gateway-cert-section-heading small { font-size: 12.5px; color: #8a95a1; }
#view-card-gateway .card-gateway-cert-upload-fields { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; padding: 4px 18px 12px; }
#view-card-gateway .card-gateway-cert-upload-fields label { display: flex; flex-direction: column; gap: 4px; }
#view-card-gateway .card-gateway-cert-upload-fields input { min-height: 0; width: 100%; border: 1px solid #d6dde4; border-radius: 8px; padding: 7px 10px; font: inherit; font-size: 13.5px; line-height: normal; }
#view-card-gateway .card-gateway-cert-upload-fields label > span { font-size: 12px; font-weight: 400; color: #6b7885; }
#cards-panel-cert .certificate-upload-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 0 18px 16px; }
#cards-panel-cert .certificate-upload-foot .form-hint { flex: 1; min-width: 320px; margin: 0; padding: 10px 18px 14px; font-size: 12.5px; color: #8a95a1; }
#cards-panel-cert #card-gateway-cert-error { margin: 0 18px 16px; }
.prototype-page-numbers, .card-audit-pager > div { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.round-search { align-items: end; gap: 12px; flex-wrap: wrap; }
.round-search .round-search-field { display: flex; flex-direction: column; gap: 5px; color: #64748b; font-size: 12px; }
.round-search .round-search-field input, .round-search .round-search-field select { width: 170px; max-width: 100%; height: 36px; border: 1px solid #d6dde4; border-radius: 6px; padding: 6px 10px; font: inherit; background: #fff; color: #334155; }
.round-search #round-room-filter-summary { flex-basis: 100%; font-size: 12px; }
#round-pager > div { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
#round-pager .prototype-page-numbers button:disabled { cursor: default; }
@media (max-width: 640px) { .round-search { flex-direction: row; align-items: flex-end; } .round-search > .filter-select { flex-basis: 100%; } .round-search .round-search-field { flex: 1 1 140px; min-width: 0; } .round-search .round-search-field input, .round-search .round-search-field select { width: 100%; } #round-pager { flex-wrap: wrap; gap: 10px; } }
.prototype-page-numbers button { border: 1px solid #d6dde4; border-radius: 6px; background: #fff; color: #46525e; min-width: 29px; height: 30px; padding: 0 9px; font: inherit; font-size: 12px; cursor: pointer; }
.prototype-page-numbers button[aria-current="page"] { background: #216a48; color: #fff; border-color: #216a48; font-weight: 600; }
.card-service-logs { margin-bottom: 14px; overflow: hidden; }
#cards-panel-cert .certificate-pager { padding: 12px 18px; }
@media(max-width:900px) {
 #view-card-gateway .card-gateway-cert-upload-fields { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media(max-width:640px) {
 #cards-panel-cert .certificate-validity { min-width: 0; flex-basis: 100%; }
 #cards-panel-cert .certificate-hero-actions { align-items: flex-start; max-width: none; }
 #cards-panel-cert .certificate-hero-actions small { text-align: left; }
 #cards-panel-cert .certificate-upload-foot .form-hint { min-width: 0; flex-basis: 100%; }
}
.card-detail-drawer { position: fixed; inset: 0 0 0 auto; z-index: 1200; width: min(620px,100vw); display: flex; flex-direction: column; background: #fff; border-left: 1px solid #e3e8ee; box-shadow: -8px 0 24px #17212b14; }
.card-detail-drawer > .infra-cc-head { display: flex; flex-wrap: wrap; padding: 18px 20px 14px; margin: 0; gap: 10px; border-bottom: 1px solid #eef1f4; }
#card-detail-close { margin-left: auto; }
.card-detail-drawer > .prototype-page-tabs { flex-shrink: 0; width: 100%; padding: 0 20px; margin: 0; border-bottom: 1px solid #e3e8ee; border-radius: 0; background: transparent; }
.card-detail-drawer > .prototype-page-tabs .button { border-radius: 0 !important; padding: 9px 12px !important; border-bottom: 2px solid transparent; box-shadow: none; }
.card-detail-drawer > .prototype-page-tabs [aria-selected="true"] { border-bottom-color: #216a48; }
.card-detail-body { flex: 1; min-height: 0; overflow: auto; padding: 16px 20px; }
.card-detail-quick-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 20px; }
.card-detail-section-title { margin: 0 0 12px; font-size: 13px; color: #46525e; }
.card-detail-section-title small { color: #a2abb4; font-weight: 400; margin-left: 8px; }
.certificate-pager > div { display: flex; gap: 6px; align-items: center; }
#view-card-gateway .card-detail-body .card-room-parameter-grid { display: grid; grid-template-columns: minmax(0,1fr); border: 0; gap: 5px; padding: 0 0 16px; }
#view-card-gateway .card-detail-body .card-room-parameter-grid > div { display: grid; grid-template-columns: 130px minmax(0,1fr); gap: 14px; border: 0; padding: 0; font-size: 13px; }
#view-card-gateway .card-detail-body .card-room-parameter-grid dt, #view-card-gateway .card-detail-body .card-room-parameter-grid dd { margin: 0; font-size: 13px; }
#view-card-gateway .card-detail-body .card-room-parameter-grid dt { color: #8a95a1; }
#view-card-gateway .card-detail-body .card-params-form { border: 0; padding: 0; margin: 0 0 18px; background: transparent; }
.card-detail-body .card-params-form fieldset { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 14px; padding: 0; }
.card-detail-body .card-params-form label { font-size: 12.5px; color: #5b6873; }
.card-detail-body .card-params-form input, .card-detail-body .card-params-form select { border: 1px solid #d6dde4; border-radius: 8px; padding: 6px 9px; font-size: 13px; }
.card-detail-body .infra-card-room-actions { display: grid; grid-template-columns: minmax(0,1fr); }
.card-detail-body .infra-card-reset-action { padding: 16px; border: 1px solid #ecd2d2; border-radius: 8px; }
.card-detail-scrim { display: none; position: fixed; inset: 0; z-index: 1190; width: 100%; height: 100%; border: 0; background: #17212b59; }
#view-card-gateway:has(.card-detail-drawer:not([hidden])) > .card-detail-scrim { display: block; }
body:has(#view-card-gateway.is-active .card-detail-drawer:not([hidden])) { overflow: hidden; }
#player-drawer .player-drawer-panel { width: min(560px,100vw); }
#player-drawer .player-info-list { display: grid; grid-template-columns: minmax(0,1fr); gap: 5px; padding: 0; border: 0; border-radius: 0; background: transparent; }
#player-drawer .player-info-list > div { display: grid; grid-template-columns: 130px minmax(0,1fr); gap: 14px; padding: 0; }
#player-drawer .player-info-list dd { margin: 0; font-size: 13px; font-weight: 400; }
#player-drawer .player-info-list dt { color: #8a95a1; font-size: 13px; }
@media(max-width:1280px) {
 #view-players .player-filter-toolbar { grid-template-columns: repeat(2,minmax(0,1fr)); }
 #view-players .player-filter-actions { grid-column: 1 / -1; }
}
@media(max-width:768px) {
 #view-players #player-metrics { grid-template-columns: repeat(3,minmax(0,1fr)); }
 #view-players #player-metrics .metric-card { padding: 10px; }
 #view-players .player-comparison-row { grid-template-columns: minmax(120px,1fr) minmax(50px,1fr) 50px; }
 .card-diagnostic-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media(max-width:640px) {
 :is(#view-players,#view-card-gateway) .page-heading { flex-direction: column; }
 :is(#view-players,#view-card-gateway) .heading-actions { flex-wrap: wrap; }
 :is(#view-players,#view-card-gateway) .panel-heading { flex-wrap: wrap; }
 #view-players .player-filter-toolbar { grid-template-columns: minmax(0,1fr); }
 #view-players .player-filter-search { grid-column: auto; }
 #view-players #player-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
 #view-players .player-retention-summary { grid-template-columns: minmax(0,1fr); }
 #view-card-gateway .infra-card-workspace-head { flex-wrap: wrap; }
 #view-card-gateway .infra-card-kpis { flex-basis: 100%; }
 #view-card-gateway .card-gateway-cert-upload-fields { grid-template-columns: minmax(0,1fr); }
 .certificate-validity, .certificate-identity { min-width: 0; width: 100%; flex-basis: 100%; }
 .certificate-hero-actions { flex-direction: row; flex-wrap: wrap; }
 .card-detail-body { padding: 14px; }
 #player-drawer .player-info-list > div { grid-template-columns: 100px minmax(0,1fr); }
}

/* 玩家原型补齐：主导航底线、分析密度、四页签详情。 */
#view-players .page-heading { align-items: flex-start; }
#view-players .page-heading h1 { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
#view-players .player-heading-badge { background: #eef3f8; color: #3d4b59; border: 1px solid #d9e3ec; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 500; }
#view-players .heading-actions { flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
#view-players .player-refresh-note { color: #8a95a1; font-size: 12px; }
#view-players > .prototype-page-tabs { width: 100%; gap: 14px; background: transparent; border-radius: 0; border-bottom: 1px solid #e3e8ee; padding: 0 0 12px; margin-bottom: 14px; }
#view-players .player-overview > .panel-heading { padding-bottom: 8px; }
#view-players #player-metrics .metric-head { margin: 0; }
#view-players .player-filter-field > span { font-size: 12px; color: #6b7885; font-weight: 400; }
#view-players .player-quick-filters .button { font-size: 12.5px; padding: 4px 13px; min-height: 28px; }
#view-players .player-analysis-shell > .panel-heading { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; }
#view-players .player-analysis-shell > .panel-heading > div:first-child { flex: 1; }
#view-players .player-game-comparison { padding: 14px 18px 0; }
#view-players .player-comparison-row { align-items: center; padding: 10px 0; gap: 12px; }
#view-players .player-comparison-label strong { font-size: 13.5px; }
#view-players .player-comparison-label small { font-size: 12px; color: #8a95a1; }
#view-players .player-comparison-value small { display: block; font-size: 11.5px; font-weight: 400; color: #8a95a1; }
#view-players .player-analysis-note { margin: 10px 18px 16px; color: #8a95a1; font-size: 12.5px; }
#view-players .player-retention-summary strong { font-size: 22px; }
#view-players .player-retention-summary small { font-size: 11.5px; }
#view-players .player-retention-table-wrap { margin: 0 18px 16px; border: 0; }
#player-drawer .player-drawer-head { padding: 18px 20px 14px; align-items: center; gap: 14px; }
#player-drawer .player-drawer-avatar { width: 52px; height: 52px; }
#player-drawer .player-drawer-head h2 { font-size: 17px; margin: 0 0 2px; }
#player-drawer .player-drawer-avatar-source { font-size: 12px; margin: 2px 0 0; }
#player-drawer .player-drawer-quick-actions { padding: 10px 20px 12px; border: 0; background: #fff; }
#player-drawer .player-drawer-quick-actions .button { min-height: 28px; padding: 3px 10px; font-size: 12.5px; border-radius: 8px; }
#player-drawer #player-ban-button { color: #c53b3b; border-color: #ecd2d2; }
#player-drawer .player-drawer-tabs { padding: 0 20px; gap: 4px; flex-shrink: 0; min-height: 40px; }
#player-drawer .player-drawer-tabs button { font-size: 13.5px; padding: 9px 12px; }
#player-drawer .player-drawer-tabs button.is-active { color: #17212b; border-bottom-color: #216a48; font-weight: 600; }
#player-drawer .player-drawer-body { padding: 16px 20px; }
#player-drawer .player-profile-heading, #player-drawer .player-section-title { margin: 18px 0 8px; font-size: 13px; color: #46525e; }
#player-drawer .player-profile-heading:first-child { margin-top: 0; }
#player-drawer .player-profile-heading span { margin-left: 6px; font-size: 12px; color: #a2abb4; font-weight: 400; }
#player-drawer .player-info-list > div { padding: 0; border: 0; }
#player-drawer .player-info-list dd { font-weight: 500; line-height: 1.5; overflow-wrap: anywhere; }
#player-drawer .player-connection-details { margin: 8px 0 12px; font-size: 12px; color: #8a95a1; }
#player-drawer .player-connection-details summary { cursor: pointer; }
#player-drawer .player-connection-details[open] .player-info-list { margin-top: 8px; }
#player-drawer .player-tab-empty-hint { background: transparent; border: 0; padding: 0; color: #8a95a1; margin-bottom: 10px; font-size: 12.5px; }
#player-drawer .table-wrap { border: 0; border-radius: 0; }
#player-drawer :is(.player-rounds-table,.player-wallet-table) { width: 100%; min-width: 0; table-layout: fixed; }
#player-drawer :is(.player-rounds-table,.player-wallet-table) :is(th,td) { width: auto; padding: 9px 8px; font-size: 12px; white-space: normal; overflow-wrap: anywhere; }
#player-drawer :is(.player-rounds-table,.player-wallet-table) th { background: #f7f9fa; color: #5b6873; }
#player-drawer :is(.player-rounds-table,.player-wallet-table) th:first-child { width: 25%; }
#player-drawer .player-cell-secondary { display: block; font-size: 11px; font-weight: 400; color: #8a95a1; margin-top: 2px; }
#player-drawer .player-net-win { color: #1c7a4d; }
#player-drawer .player-net-loss { color: #b03a3a; }
#player-drawer .player-rounds-toolbar #pd-rounds-total { margin-left: auto; margin-right: 0; font-size: 12px; }
#player-drawer .table-pager { padding: 12px 0; }
#player-drawer .player-wallet-filter { padding: 0; border: 0; background: transparent; gap: 8px; grid-template-columns: repeat(2,minmax(0,1fr)); }
#player-drawer .player-wallet-filter > label:first-child { grid-column: 1 / -1; }
#player-drawer .player-wallet-filter .player-filter-actions { grid-column: 1 / -1; }
#player-drawer #pd-wallet-status { font-size: 12px; color: #8a95a1; }
#player-drawer .player-notes-list, #player-drawer .player-audit-list { padding: 0; list-style: none; }
#player-drawer .player-notes-list li { display: grid; grid-template-columns: 120px minmax(0,1fr); gap: 14px; background: transparent; border: 0; border-radius: 0; padding: 4px 0; }
#player-drawer .player-notes-list .note-meta { color: #8a95a1; font-size: 12px; }
#player-drawer .player-notes-list p { margin: 0; font-size: 13px; }
#player-drawer .player-audit-list li { background: transparent; border: 0; padding: 5px 0; font-size: 12px; }
#player-drawer .player-note-form { margin-top: 18px; border-top: 1px dashed #e8edf1; padding-top: 12px; }
@media(max-width:1180px) {
 #view-players .page-heading { flex-wrap: wrap; }
 #view-players .heading-actions { justify-content: flex-start; }
}
@media(max-width:640px) {
 #view-players .page-heading h1 { gap: 6px; }
 #view-players .player-refresh-note { flex-basis: 100%; }
 #player-drawer .player-drawer-head, #player-drawer .player-drawer-body { padding: 14px; }
 #player-drawer .player-drawer-tabs { padding: 0 8px; gap: 0; }
 #player-drawer .player-drawer-tabs button { padding: 9px 8px; font-size: 12.5px; }
 #player-drawer .player-drawer-quick-actions { padding: 10px 14px; }
 #player-drawer .player-notes-list li { grid-template-columns: 90px minmax(0,1fr); gap: 8px; }
}


/* 灰度发布工作区：真实状态、明确下一步、技术参数按需展开。 */
#view-gray-release { min-width: 0; }
#view-gray-release [hidden] { display: none !important; }
#view-gray-release .gray-summary { display: grid; grid-template-columns: minmax(0,1fr) minmax(220px,300px); gap: 24px; padding: 24px; border-top: 3px solid var(--green); }
#view-gray-release .gray-summary h2 { margin: 4px 0 10px; font-size: 23px; }
#view-gray-release .gray-summary p { margin: 8px 0; color: var(--text-muted); line-height: 1.7; }
#view-gray-release #gray-release-gate { margin: 8px 0 0; padding: 0; border: 0; background: transparent; font-size: 13px; }
#view-gray-release .gray-next { display: grid; align-content: center; gap: 12px; padding-left: 24px; border-left: 1px solid var(--border); }
#view-gray-release .gray-next > span { font-size: 12px; color: var(--text-muted); }
#view-gray-release .gray-next .button { justify-self: start; }
#view-gray-release .gray-workspace-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 20px 0; padding: 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
#view-gray-release .gray-workspace-tabs button { border: 0; border-radius: 7px; padding: 10px 15px; font: inherit; color: var(--text-muted); background: transparent; cursor: pointer; }
#view-gray-release .gray-workspace-tabs button[aria-selected=true] { background: #e7f3ed; color: #1e6249; font-weight: 600; }
#view-gray-release .gray-workspace-tabs button:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
#view-gray-release .gray-workspace { display: grid; min-width: 0; gap: 18px; }
#view-gray-release .gray-scope-cards { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
#view-gray-release .gray-scope-cards .panel { display: grid; align-content: start; padding: 20px; min-width: 0; }
#view-gray-release .gray-scope-cards h2 { font-size: 19px; margin: 6px 0; }
#view-gray-release .gray-scope-cards p:not(.eyebrow) { color: var(--text-muted); font-size: 13px; line-height: 1.7; min-height: 46px; }
#view-gray-release .gray-scope-cards .button { justify-self: start; margin-top: 10px; }
#view-gray-release .gray-guide { padding: 20px; }
#view-gray-release .gray-steps { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); padding: 0; margin: 20px 0 0; gap: 16px; list-style: none; }
#view-gray-release .gray-steps li { display: grid; grid-template-columns: 30px 1fr; gap: 6px 10px; min-width: 0; }
#view-gray-release .gray-steps b { grid-row: span 2; width: 30px; height: 30px; border-radius: 50%; background: #e7f3ed; color: #1e6249; display: grid; place-items: center; }
#view-gray-release .gray-steps span { font-size: 12px; color: var(--text-muted); line-height: 1.6; }
#view-gray-release .gray-details { min-width: 0; padding: 16px 20px; }
#view-gray-release .gray-details > summary { cursor: pointer; font-weight: 600; }
#view-gray-release .gray-details > summary small { margin-left: 10px; font-weight: 400; color: var(--text-muted); }
#view-gray-release .gray-details[open] > summary { margin-bottom: 18px; }
#view-gray-release .gray-metric-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
#view-gray-release .gray-metric-grid .metric-card { min-width: 0; }
#view-gray-release .gray-workspace > .panel, #view-gray-release .gray-details > .panel { min-width: 0; max-width: 100%; }
#view-gray-release .panel-heading { display: flex; flex-wrap: wrap; gap: 12px; }
#view-gray-release .panel-heading > div { min-width: 0; }
#view-gray-release .table-wrap { width: 100%; max-width: 100%; min-width: 0; overflow-x: auto; }
#view-gray-release table { min-width: 620px; white-space: normal; }
#view-gray-release td { overflow-wrap: anywhere; vertical-align: top; }
#view-gray-release .mono { overflow-wrap: anywhere; word-break: break-word; font-size: 12px; }
#view-gray-release .gray-release-version-form, #view-gray-release .gray-release-rollout-form, #view-gray-release .gray-release-form { padding: 18px; gap: 14px; }
#view-gray-release form label, #view-gray-release .gray-release-form label { display: grid; gap: 6px; min-width: 0; color: var(--text-muted); font-size: 12px; }
#view-gray-release input, #view-gray-release select { width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; height: 38px; border: 1px solid var(--border-strong); border-radius: 7px; padding: 8px 10px; color: var(--text); background: var(--surface); font: inherit; }
#view-gray-release .gray-action-hint { padding: 12px 16px; background: #fff8e9; border: 1px solid #f0dfb9; border-radius: 8px; line-height: 1.7; font-size: 13px; margin: 0; }
#view-gray-release .gray-action-hint:empty, #view-gray-release #gray-release-message:empty { display: none; }
#view-gray-release #gray-hold-body { margin: 0; padding: 12px 22px 20px 40px; line-height: 1.8; }
#view-gray-release .gray-release-topology { padding: 18px; margin: 0; }
#view-gray-release .gray-release-topology dd, #view-gray-release #gray-release-state { overflow-wrap: anywhere; }
#view-gray-release .button:disabled { cursor: not-allowed; }
@media (max-width:1100px) { #view-gray-release .gray-scope-cards { grid-template-columns: minmax(0,1fr); } #view-gray-release .gray-scope-cards p:not(.eyebrow) { min-height: 0; } }
@media (max-width:760px) { #view-gray-release .gray-summary { grid-template-columns: minmax(0,1fr); padding: 18px; } #view-gray-release .gray-next { border-left: 0; padding: 16px 0 0; border-top: 1px solid var(--border); } #view-gray-release .gray-steps, #view-gray-release .gray-metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } #view-gray-release .gray-workspace-tabs button { flex: 1 1 125px; padding: 9px; } }
@media (max-width:440px) { #view-gray-release .gray-steps, #view-gray-release .gray-metric-grid { grid-template-columns: minmax(0,1fr); } #view-gray-release .gray-summary h2 { font-size: 20px; } }

/* 游戏灰度工作区：版本与房间操作随选中游戏隔离。 */
#view-gray-release .gray-game-picker-controls { display:flex; align-items:end; flex-wrap:wrap; gap:12px; padding:0 20px 14px; }
#view-gray-release .gray-game-picker-controls label { display:grid; gap:7px; flex:1 1 240px; max-width:460px; min-width:0; font-size:13px; color:var(--text-muted); }
#view-gray-release #gray-games-message { margin:0; padding:0 20px 12px; overflow-wrap:anywhere; }
#view-gray-release .gray-game-tabs { display:flex; flex-wrap:wrap; gap:6px; padding:10px 20px; border-top:1px solid var(--border); }
#view-gray-release .gray-game-tabs button { border:0; border-radius:7px; padding:9px 16px; font:inherit; color:var(--text-muted); background:transparent; cursor:pointer; }
#view-gray-release .gray-game-tabs button[aria-selected=true] { color:#1e6249; background:#e7f3ed; font-weight:600; }
#view-gray-release .gray-game-tabs button:focus-visible { outline:2px solid var(--green); outline-offset:2px; }
#view-gray-release .gray-game-tabs button:disabled { opacity:.55; cursor:not-allowed; }
#view-gray-release .gray-game-pane { display:grid; gap:18px; min-width:0; }
#view-gray-release .gray-game-pane[hidden], #view-gray-release .gray-game-empty[hidden] { display:none !important; }
#view-gray-release .gray-game-empty { padding:22px; }
#view-gray-release .gray-game-empty p { line-height:1.8; color:var(--text-muted); overflow-wrap:anywhere; }
#view-gray-release #gray-game-name { overflow-wrap:anywhere; }

#view-gray-release .gray-check-filter { margin: 0; padding: 0 18px 14px; }

/* 加密卡规则编辑范围内的布局。 */
.card-rule-editor { grid-column: 1 / -1; min-width: 0; border: 1px solid #d9e2ed; padding: 16px; border-radius: 8px; }
.card-rule-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.card-rule-scroll { overflow-x: auto; max-width: 100%; }
.card-rule-scroll table { min-width: 680px; width: 100%; }
.card-rule-scroll select { min-width: 230px; max-width: 100%; }
.card-rule-scroll input { min-width: 130px; width: 100%; }
.card-rule-scroll td { vertical-align: top; }
.card-rule-preview { margin-top: 16px; }
.card-rule-preview label { display: grid; gap: 6px; margin: 12px 0; }
.card-rule-preview textarea { width: 100%; box-sizing: border-box; font-family: monospace; }
#game-award-internal-presets { grid-column: 1 / -1; min-width: 0; }
#game-award-internal-presets > summary { cursor: pointer; padding: 8px 0; }
#card-rule-preview-result { white-space: pre-wrap; overflow-wrap: anywhere; }

.round-source-cell { white-space: pre-line; min-width: 100px; font-variant-numeric: tabular-nums; }

/* 通用规则为折叠表单；不沿用旧卡码表格的680px最小宽度。 */
.card-rule-scroll table.award-rules-generic { min-width: 0; table-layout: fixed; }
.card-rule-scroll table.award-rules-generic thead { display: none; }
.award-rules-generic td { padding: 8px; white-space: normal; overflow-wrap: anywhere; }
.card-rule-scroll .award-rules-generic input,
.card-rule-scroll .award-rules-generic select { min-width: 0; width: 100%; max-width: 100%; box-sizing: border-box; }
.award-rules-generic summary { cursor: pointer; padding: 8px 0; white-space: normal; }

/* Multiple wallet currencies must wrap within the account header. */
#view-wallet .wallet-scope-detail { min-width: 0; overflow-wrap: anywhere; white-space: normal; }
#view-wallet .wallet-current-account-facts { min-width: 0; }
#view-wallet .wallet-current-account-facts span:first-child { white-space: normal; overflow-wrap: anywhere; }

/* 钱包币种预设：完整列表优先展示，编辑按需展开。 */
#view-exchange > .currency-presets-panel,
#view-exchange > section[aria-labelledby="exchange-preview-title"] { grid-column: 1 / -1; }
#view-exchange .currency-presets-table { width: 100%; table-layout: auto; }
#view-exchange .currency-presets-table th { white-space: nowrap; background: #f5f8fa; }
#view-exchange .currency-presets-table td { padding: 15px 16px; vertical-align: middle; }
#view-exchange .currency-presets-table td:first-child strong,
#view-exchange .currency-presets-table td:first-child small { display: block; }
#view-exchange .currency-presets-table td:first-child small { color: #65758a; margin-top: 4px; }
#view-exchange .currency-rate-value { font-weight: 650; color: #155f49; font-variant-numeric: tabular-nums; white-space: nowrap; }
#view-exchange .currency-rate-example { font-variant-numeric: tabular-nums; white-space: nowrap; }
#view-exchange .currency-rate-state { color: #65758a; white-space: nowrap; }
#view-exchange .currency-rate-editor { margin: auto; width: min(580px, calc(100vw - 40px)); max-height: 85vh; overflow: auto; border: 1px solid #d8e3e8; border-radius: 12px; padding: 24px; }
#view-exchange .currency-rate-editor::backdrop { background: #102d4270; }
#view-exchange .currency-view-tabs { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
#view-exchange .currency-view-tabs [aria-pressed="true"] { background: #216a4f; color: white; }
#view-exchange .currency-unused-presets { margin-top: 20px; padding-top: 16px; border-top: 1px solid #d8e3e8; }
#view-exchange .currency-unused-presets > summary { cursor: pointer; color: #596e7e; padding-bottom: 12px; }
#view-exchange .currency-unused-presets .table-wrap { overflow-x: auto; }
#view-exchange > section[hidden] { display: none !important; }
#view-wallet .wallet-status-strip { margin-bottom: 16px; }
#view-exchange .currency-rate-editor > summary { cursor: pointer; font-weight: 600; }
#view-exchange .currency-rate-editor[open] > summary { margin-bottom: 20px; }
#view-exchange #exchange-rate-form [hidden] { display: none; }
#view-exchange .currency-presets-panel > .table-wrap { overflow-x: auto; }
@media (max-width: 620px) {
 #view-exchange .currency-presets-table { min-width: 690px; }
 #view-exchange .currency-presets-panel { min-width: 0; }
 #view-exchange .currency-presets-table td { padding: 12px; }
}
/* 钱包与对账：2026-10-12 原型结构，所有选择器限定本页。 */
#view-wallet.wallet-layout-v2 { --wallet-line:#dde2e7; --wallet-ink:#17212b; --wallet-muted:#66717d; }
#view-wallet.wallet-layout-v2 .wallet-scope-panel { position:static; display:flex; flex-wrap:wrap; align-items:center; gap:14px; padding:18px 18px 0; border:1px solid #dde2e7; border-radius:10px; background:#fff; box-shadow:0 2px 8px #17212b08; }
#view-wallet.wallet-layout-v2 .wallet-scope-copy { display:flex; justify-content:space-between; align-items:center; width:100%; }
#view-wallet.wallet-layout-v2 .wallet-scope-copy h2 { font-size:13px; color:#66717d; }
#view-wallet.wallet-layout-v2 .wallet-scope-list { width:100%; display:flex; flex-wrap:wrap; overflow:visible; gap:12px; }
#view-wallet.wallet-layout-v2 .wallet-scope-button { flex:0 1 260px; min-height:62px; padding:12px 16px; border:1px solid #dde2e7; border-radius:8px; font-size:14px; box-shadow:none; }
#view-wallet.wallet-layout-v2 .wallet-scope-button.is-active { border-color:#1f6f4a; color:#1f6f4a; background:#e8f5ee; box-shadow:none; }
#view-wallet.wallet-layout-v2 .wallet-scope-badge { width:34px; height:34px; font-size:13px; margin-right:12px; }
#view-wallet.wallet-layout-v2 .wallet-account-select { display:flex; flex-direction:column; align-items:stretch; gap:5px; min-width:min(340px,100%); margin:0; font-size:12px; color:#66717d; }
#view-wallet.wallet-layout-v2 .wallet-account-select select { width:100%; min-height:36px; }
#view-wallet.wallet-layout-v2 .wallet-scope-detail { flex:1; font-size:12px; }
#view-wallet.wallet-layout-v2 .wallet-status-strip { width:calc(100% + 36px); flex:0 0 calc(100% + 36px); margin:0 -18px; padding:12px 18px; border:0; border-top:1px solid #dde2e7; border-radius:0 0 10px 10px; background:#f8fafb; box-shadow:none; display:flex; flex-wrap:wrap; align-items:center; gap:10px 20px; }
#view-wallet.wallet-layout-v2 .wallet-status-strip > .panel-heading { padding:0; margin:0; flex:0 1 auto; gap:12px; }
#view-wallet.wallet-layout-v2 .wallet-status-strip h2 { font-size:12px; color:#66717d; }
#view-wallet.wallet-layout-v2 #wallet-overview-generated { font-size:11px; margin:3px 0 0; }
#view-wallet.wallet-layout-v2 #wallet-deployment-state { flex:1 1 260px; margin:0; font-size:12px; overflow-wrap:anywhere; }
#view-wallet.wallet-layout-v2 #wallet-overview-metrics { order:2; display:flex; flex-wrap:wrap; flex:1 1 70%; gap:0; margin:0; }
#view-wallet.wallet-layout-v2 #wallet-overview-metrics .metric-card { min-width:130px; min-height:0; flex:1; border:0; border-left:1px solid #dde2e7; border-radius:0; padding:4px 16px; background:none; box-shadow:none; }
#view-wallet.wallet-layout-v2 #wallet-overview-metrics .metric-card:first-child { border-left:0; padding-left:0; }
#view-wallet.wallet-layout-v2 #wallet-overview-metrics .metric-head { font-size:12px; margin:0 0 3px; }
#view-wallet.wallet-layout-v2 #wallet-overview-metrics .metric-card strong { font-size:20px; line-height:1.3; }
#view-wallet.wallet-layout-v2 #wallet-overview-metrics .metric-card p { display:none; }
#view-wallet.wallet-layout-v2 .wallet-freeze-disclosure { order:3; flex:0 1 auto; font-size:12px; }
#view-wallet.wallet-layout-v2 .wallet-freeze-disclosure summary { cursor:pointer; color:#a74336; padding:8px; }
#view-wallet.wallet-layout-v2 .wallet-freeze-disclosure[open] { flex-basis:100%; }
#view-wallet.wallet-layout-v2 .wallet-freeze-disclosure form { margin-top:10px; }
#view-wallet.wallet-layout-v2 .wallet-pane-tabs { position:static; display:flex; gap:4px; margin:18px 0 14px; padding:0; border:0; border-bottom:1px solid #dde2e7; background:none; border-radius:0; }
#view-wallet.wallet-layout-v2 .wallet-pane-tabs button { min-height:42px; padding:8px 18px; border:0; border-bottom:2px solid transparent; border-radius:0; background:none; color:#66717d; }
#view-wallet.wallet-layout-v2 .wallet-pane-tabs button.is-active { color:#1f6f4a; border-bottom-color:#1f6f4a; background:none; }
#view-wallet.wallet-layout-v2 > .workspace-section-heading { display:none; }
#view-wallet.wallet-layout-v2 .panel { border-radius:10px; box-shadow:0 2px 8px #17212b08; }
#view-wallet.wallet-layout-v2 .wallet-player-flow-panel > .panel-heading { margin-bottom:12px; }
#view-wallet.wallet-layout-v2 .wallet-flow-search { grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; padding:16px; border:0; background:none; }
#view-wallet.wallet-layout-v2 .wallet-flow-search > label:first-child { grid-column:span 2; }
#view-wallet.wallet-layout-v2 .wallet-heading-copy { min-width:0; }
#view-wallet.wallet-layout-v2 .wallet-status-strip > .panel-heading { border-bottom:0; }
#view-wallet.wallet-layout-v2 .wallet-status-strip #wallet-overview-generated { max-width:220px; }
#view-wallet.wallet-layout-v2 .wallet-period-buttons { display:flex; flex-wrap:wrap; gap:0; }
#view-wallet.wallet-layout-v2 .wallet-period-buttons button { min-height:36px; padding:6px 12px; border:1px solid #dde2e7; background:#fff; color:#66717d; cursor:pointer; }
#view-wallet.wallet-layout-v2 .wallet-period-buttons button:first-child { border-radius:6px 0 0 6px; }
#view-wallet.wallet-layout-v2 .wallet-period-buttons button:last-child { border-radius:0 6px 6px 0; }
#view-wallet.wallet-layout-v2 .wallet-period-buttons button[aria-pressed="true"] { background:#e8f5ee; color:#1f6f4a; border-color:#1f6f4a; }
#view-wallet.wallet-layout-v2 #wallet-money-buckets { margin:0 0 16px; }
#view-wallet.wallet-layout-v2 .wallet-settings-grid { gap:16px; }
#view-wallet.wallet-layout-v2 .wallet-settings-card { border:1px solid #dde2e7; border-radius:8px; background:#fff; }
#view-wallet.wallet-layout-v2 #wallet-page-state.notice { padding:8px 12px; margin-bottom:12px; font-size:12px; }
@media(max-width:700px) {
 #view-wallet.wallet-layout-v2 .wallet-flow-search { grid-template-columns:minmax(0,1fr); }
 #view-wallet.wallet-layout-v2 .wallet-flow-search > label:first-child { grid-column:auto; }
 #view-wallet.wallet-layout-v2 .wallet-scope-button { flex:1 1 140px; min-width:0; }
 #view-wallet.wallet-layout-v2 .wallet-account-select { width:100%; min-width:0; }
 #view-wallet.wallet-layout-v2 .wallet-scope-detail { flex-basis:100%; }
 #view-wallet.wallet-layout-v2 .wallet-pane-tabs { overflow-x:auto; flex-wrap:nowrap; }
 #view-wallet.wallet-layout-v2 .wallet-pane-tabs button { flex:0 0 auto; padding:8px 12px; }
 #view-wallet.wallet-layout-v2 #wallet-overview-metrics .metric-card { min-width:110px; padding:6px 10px; }
 #view-wallet.wallet-layout-v2 .wallet-freeze-disclosure { flex-basis:100%; }
 #view-wallet.wallet-layout-v2 .wallet-period-buttons button { padding:6px 8px; }
}

/* 币种与游戏分数：2026-10-12 原型结构，21法币＋USDT自动配置。 */
#view-exchange.currency-layout-v2 { --currency-line:#dde2e7; --currency-ink:#17212b; --currency-muted:#66717d; }
#view-exchange.currency-layout-v2 > .page-heading { margin-bottom:12px; }
#view-exchange.currency-layout-v2 > #exchange-state { margin:0 0 12px; padding:9px 13px; border:1px solid #d7e7f5; border-radius:8px; color:#35566e; background:#eaf3fb; font-size:12px; }
#view-exchange.currency-layout-v2 .currency-wallet-panel-v2 { padding:0; border:1px solid var(--currency-line); border-radius:10px; background:#fff; box-shadow:0 2px 8px #17212b08; }
#view-exchange.currency-layout-v2 .currency-wallet-panel-v2 > .panel-heading { padding:14px 18px 10px; }
#view-exchange.currency-layout-v2 .currency-wallet-panel-v2 > .exchange-field { margin:0; padding:0 18px 14px; }
#view-exchange.currency-layout-v2 .currency-wallet-panel-v2 #exchange-provider { min-height:42px; font-weight:600; }
#view-exchange.currency-layout-v2 .exchange-base-list { margin:0; padding:0 18px 16px; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px 14px; }
#view-exchange.currency-layout-v2 .exchange-base-list > div { padding:10px 12px; border-radius:7px; background:#f8fafb; }
#view-exchange.currency-layout-v2 .exchange-base-list dt { font-size:11px; color:#8b96a2; }
#view-exchange.currency-layout-v2 .exchange-base-list dd { margin-top:3px; font-size:13px; font-weight:600; overflow-wrap:anywhere; }
#view-exchange.currency-layout-v2 .currency-view-tabs { display:flex; gap:2px; margin:18px 0 14px; padding:0; border-bottom:1px solid var(--currency-line); }
#view-exchange.currency-layout-v2 .currency-view-tabs button { min-height:42px; padding:7px 18px; border:0; border-bottom:2px solid transparent; border-radius:0; color:var(--currency-muted); background:none; box-shadow:none; }
#view-exchange.currency-layout-v2 .currency-view-tabs button[aria-selected="true"] { color:#1f6f4a; border-bottom-color:#1f6f4a; background:none; font-weight:700; }
#view-exchange.currency-layout-v2 .currency-presets-panel { padding:0; overflow:hidden; border:1px solid var(--currency-line); border-radius:10px; box-shadow:0 2px 8px #17212b08; }
#view-exchange.currency-layout-v2 .currency-presets-panel > .panel-heading { padding:16px 18px 12px; }
#view-exchange.currency-layout-v2 .currency-presets-panel > .infra-note { margin:0 18px 12px; padding:9px 12px; border-radius:7px; color:#35566e; background:#eaf3fb; }
#view-exchange.currency-layout-v2 .currency-auto-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:0; margin:0 18px 14px; border:1px solid var(--currency-line); border-radius:8px; background:#f8fafb; }
#view-exchange.currency-layout-v2 .currency-auto-summary > div { display:flex; align-items:baseline; gap:8px; min-width:0; padding:12px 16px; border-left:1px solid var(--currency-line); }
#view-exchange.currency-layout-v2 .currency-auto-summary > div:first-child { border-left:0; }
#view-exchange.currency-layout-v2 .currency-auto-summary strong { color:#1f6f4a; font-size:22px; font-variant-numeric:tabular-nums; }
#view-exchange.currency-layout-v2 .currency-auto-summary span { color:var(--currency-muted); font-size:12px; }
#view-exchange.currency-layout-v2 .currency-presets-panel > .table-wrap { margin:0 18px 18px; border:1px solid var(--currency-line); border-radius:8px; }
#view-exchange.currency-layout-v2 .currency-presets-table th { padding:10px 14px; background:#f8fafb; font-size:12px; }
#view-exchange.currency-layout-v2 .currency-presets-table td { padding:12px 14px; }
#view-exchange.currency-layout-v2 .currency-configured-badge { display:inline-block; padding:3px 8px; border-radius:999px; color:#1f6f4a; background:#e8f5ee; font-size:12px; font-weight:700; }
#view-exchange.currency-layout-v2 .currency-rate-state small { display:block; margin-top:4px; color:#8b96a2; }
#view-exchange.currency-layout-v2 .currency-rate-row .button { min-height:30px; padding:4px 11px; }
#view-exchange.currency-layout-v2 .exchange-points-panel,
#view-exchange.currency-layout-v2 .exchange-rates-panel { border:1px solid var(--currency-line); border-radius:10px; box-shadow:0 2px 8px #17212b08; }
#view-exchange.currency-layout-v2 .exchange-rates-panel > details > summary { padding:16px 18px; font-weight:700; cursor:pointer; }
#view-exchange.currency-layout-v2 .currency-rate-editor { box-shadow:0 18px 55px #102d4230; }
#view-exchange.currency-layout-v2 .currency-rate-editor > h2 { display:inline-block; margin:0 0 18px; }
#view-exchange.currency-layout-v2 .currency-rate-editor > .button { float:right; }
@media(max-width:700px) {
 #view-exchange.currency-layout-v2 .exchange-base-list { grid-template-columns:minmax(0,1fr); }
 #view-exchange.currency-layout-v2 .currency-auto-summary { grid-template-columns:minmax(0,1fr); }
 #view-exchange.currency-layout-v2 .currency-auto-summary > div { border-left:0; border-top:1px solid var(--currency-line); }
 #view-exchange.currency-layout-v2 .currency-auto-summary > div:first-child { border-top:0; }
 #view-exchange.currency-layout-v2 .currency-view-tabs { overflow-x:auto; flex-wrap:nowrap; }
 #view-exchange.currency-layout-v2 .currency-view-tabs button { flex:0 0 auto; padding:7px 12px; }
 #view-exchange.currency-layout-v2 .currency-presets-panel > .table-wrap { margin:0 12px 12px; }
 #view-exchange.currency-layout-v2 .currency-presets-table { min-width:720px; }
}

/* 钱包接入与全局币种预设：表单控件不依赖所在 view 的层级。 */
#view-wallet .wallet-config-dialog .wallet-config-form input.sr-only { display: none; }
#view-wallet .wallet-config-dialog .wallet-config-form input[type="checkbox"] { appearance: auto; min-height: 16px; width: 16px; height: 16px; padding: 0; margin: 0; }
#view-wallet .wallet-config-dialog .wallet-inheritance label { display: flex; align-items: center; gap: 8px; }
#view-wallet .wallet-config-dialog .wallet-config-form { grid-template-columns: repeat(3,minmax(0,1fr)); background: #fff; }
.wallet-config-dialog { width: min(1000px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid #dbe5e8; border-radius: 18px; overflow: auto; }
.wallet-config-dialog .wallet-config-form { padding: 24px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; background: #fff; }
.wallet-config-dialog .wallet-config-form > * { min-width: 0; }
.wallet-config-dialog input:not([type="checkbox"]):not([type="radio"]), .wallet-config-dialog select,
#view-currency-presets input:not([type="checkbox"]), .wallet-pagination input, .wallet-pagination select {
    box-sizing: border-box; width: 100%; min-width: 0; border: 1px solid #cbd9e2; border-radius: 8px; padding: 10px 12px; background: #fff; color: #19374c; font: inherit;
}
.wallet-config-dialog input:focus, #view-currency-presets input:focus { outline: 2px solid #8bc6b1; outline-offset: 1px; }
.wallet-config-dialog input:disabled { background: #f4f7f8; color: #526879; }
.wallet-config-dialog .wallet-inheritance { padding: 16px; border: 1px solid #d6e9e2; border-radius: 10px; background: #f2f9f6; }
.wallet-config-dialog .wallet-inheritance label { display: flex; align-items: center; gap: 8px; margin: 4px 0 10px; }
.wallet-config-dialog input[type="checkbox"] { width: 16px; height: 16px; accent-color: #217455; }
.wallet-inheritance p { margin: 8px 0 0; color: #62798a; font-size: 12px; }
.wallet-currency-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.wallet-currency-card { border: 1px solid #dbe5e8; border-radius: 12px; padding: 16px; background: #fff; min-width: 0; }
.wallet-currency-card h4 { margin: 0 0 14px; color: #19374c; font-size: 14px; }
.wallet-currency-fields { display: grid; grid-template-columns: minmax(0,2fr) minmax(0,1fr); gap: 12px; }
.wallet-currency-card label { display: grid; gap: 7px; font-size: 12px; color: #526879; }
.wallet-currency-card details { margin: 12px 0; font-size: 12px; color: #526879; }
.wallet-currency-card details label { margin: 10px 0; }
.wallet-config-dialog .wallet-dialog-actions { position: sticky; bottom: -24px; background: #fff; padding: 16px 0; border-top: 1px solid #e2e9ef; z-index: 2; }
.wallet-config-dialog [hidden], #view-currency-presets [hidden] { display: none !important; }
.wallet-preset-toolbar, .wallet-preset-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 20px; }
.wallet-preset-toolbar label { display: flex; align-items: center; gap: 12px; }
#currency-presets-result { padding: 0 20px 20px; color: #426276; }
#currency-presets-body input { max-width: 220px; }
#view-currency-presets .table-wrap { margin: 0; width: 100%; overflow-x: auto; }
.wallet-pagination { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.wallet-pagination label { display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.wallet-pagination input, .wallet-pagination select { width: 75px; padding: 7px; }
#wallet-page-numbers { display: flex; gap: 4px; align-items: center; }
#wallet-page-numbers [aria-current="page"] { background: #22694d; color: #fff; border-color: #22694d; }
@media (max-width: 640px) {
    .wallet-config-dialog .wallet-config-form { padding: 16px; grid-template-columns: minmax(0,1fr); }
    #view-wallet .wallet-config-dialog .wallet-config-form { grid-template-columns: minmax(0,1fr); }
    .wallet-currency-grid { grid-template-columns: minmax(0,1fr); }
    .wallet-preset-toolbar, .wallet-preset-actions { align-items: stretch; flex-direction: column; }
    #wallet-page-label { width: 100%; }
}

/* 全局币种预设作为币种页的完整宽度页签。 */
#view-exchange .currency-global-presets { grid-column: 1 / -1; order: 4; min-width: 0; width: 100%; }
#view-exchange.show-global-presets > .exchange-base-panel,
#view-exchange.show-global-presets > #exchange-state,
#view-exchange.show-global-presets > [aria-labelledby="exchange-demo-title"] { display: none !important; }
#view-exchange .currency-global-presets [hidden] { display: none !important; }
#view-exchange .currency-global-presets > .page-heading { margin: 0 0 16px; }
#view-exchange .currency-global-presets input:not([type="checkbox"]) { box-sizing: border-box; width: 100%; min-width: 0; border: 1px solid #cbd9e2; border-radius: 8px; padding: 10px 12px; background: #fff; color: #19374c; font: inherit; }
#view-exchange .currency-global-presets .table-wrap { margin: 0; width: 100%; overflow-x: auto; }
#view-exchange .currency-global-presets .wallet-preset-toolbar label { white-space: nowrap; }
#view-exchange .currency-global-presets .wallet-preset-actions label { display: flex; align-items: center; gap: 8px; }
#view-exchange .currency-global-presets input[type="checkbox"] { appearance: auto; width: 16px; height: 16px; min-width: 16px; padding: 0; margin: 0; flex: 0 0 16px; accent-color: #217455; }

.currency-table-pagination { padding: 16px 20px; border-top: 1px solid #e2e9ef; }
#view-exchange tr[hidden] { display: none !important; }
/* 分页条独立于币种页通用表单和导航样式。 */
#view-exchange .currency-table-pagination { display:flex; flex-direction:row; align-items:center; justify-content:flex-end; gap:8px; flex-wrap:wrap; }
#view-exchange .currency-table-pagination > span:first-child { margin-right:auto; white-space:nowrap; }
#view-exchange .currency-table-pagination select { width:120px; min-width:120px; max-width:120px; flex:0 0 120px; height:36px; margin:0; padding:6px 10px; }
#view-exchange .currency-table-pagination .wallet-pagination { display:flex; flex-direction:row; align-items:center; gap:6px; flex-wrap:nowrap; margin:0; }
#view-exchange .currency-table-pagination button { height:36px; min-height:36px; margin:0; padding:6px 12px; white-space:nowrap; }
#view-exchange .currency-table-pagination button[aria-current="page"] { background:#22694d; border-color:#22694d; color:#fff; font-weight:700; }
@media (max-width:640px) { #view-exchange .currency-table-pagination { padding:12px; gap:6px; } #view-exchange .currency-table-pagination > span:first-child { flex:1 0 calc(100% - 134px); } }


/* 页码组不继承旧流水分页的12px顶部内边距。 */
#view-exchange .currency-table-pagination .wallet-pagination { padding:0; height:36px; box-sizing:border-box; }


/* 陪玩配置与兼容固定模式共用原页面。 */
#view-robots #demo-robot-form label[hidden] { display:none !important; }
#view-robots #demo-robot-form .demo-preview { min-width:0; margin:0 0 14px; padding:12px; border:1px solid var(--border-color, #dbe2e8); border-radius:8px; display:grid; grid-template-columns: minmax(0,2fr) minmax(0,1fr); gap:12px; }
#view-robots .demo-preview label { display:grid; gap:6px; min-width:0; }
#view-robots .demo-preview select, #view-robots .demo-preview input { width:100%; min-width:0; }
#view-robots .demo-preview p { grid-column:1/-1; margin:0; }
#view-robots #demo-history-scope { margin:12px 18px; overflow-wrap:anywhere; }
#view-robots .demo-save-footer { align-items:flex-end; }
#view-robots .demo-save-feedback { display:grid; gap:6px; flex:1 1 180px; min-width:0; }
#view-robots .demo-save-feedback p { margin:0; overflow-wrap:anywhere; }
#view-robots .demo-save-footer .robot-form-actions { flex:0 0 auto; margin-top:0; }
#view-robots #demo-service-status { margin:0; padding:14px 18px; }
#view-robots #demo-runtime-panel { min-width:0; padding:18px; }
#view-robots #demo-runtime-panel[hidden] { display:none; }
#view-robots .demo-runtime-filters { display:flex; flex-direction:row; flex-wrap:wrap; gap:12px; margin:14px 0; }
#view-robots .demo-runtime-filters label { display:grid; gap:6px; flex:1 1 150px; min-width:0; }
#view-robots .demo-runtime-filters input, #view-robots .demo-runtime-filters select { min-width:0; width:100%; }
#view-robots .demo-runtime-table { min-width:1150px; table-layout:fixed; }
#view-robots .demo-runtime-table td { white-space:pre-line; overflow-wrap:anywhere; vertical-align:top; }
#view-robots .demo-runtime-table th:first-child { width:220px; }
#view-robots .demo-unsaved-dialog { width:min(480px,calc(100vw - 32px)); max-width:100%; padding:24px; border:1px solid #dbe2e8; border-radius:12px; color:var(--text-color, #172b3a); }
#view-robots .demo-unsaved-dialog::backdrop { background:rgba(15,25,35,.35); }
@media(max-width:600px) { #view-robots #demo-robot-form .demo-preview { grid-template-columns:minmax(0,1fr); } #view-robots .demo-save-footer { align-items:stretch; } #view-robots .demo-save-feedback, #view-robots #demo-robot-form .demo-enable-row p { flex-basis:auto; } #view-robots .demo-unsaved-dialog .heading-actions { flex-wrap:wrap; } }
#view-robots #demo-robot-form .demo-companion-fieldset { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
#view-robots .demo-companion-fieldset .form-hint { grid-column:1/-1; }
#view-robots #demo-runtime-panel { overflow:auto; }
@media(max-width:900px) { #view-robots #demo-robot-form .demo-companion-fieldset { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:600px) { #view-robots #demo-robot-form .demo-companion-fieldset { grid-template-columns:minmax(0,1fr); } }

/* 选桌角色库与默认状态图在同一区域管理。 */
.seat-avatar-library { margin-top:20px; }
#seat-avatar-list { grid-template-columns:repeat(auto-fill,minmax(170px,1fr)); gap:12px; }
#seat-avatar-list .avatar-default-card { min-width:0; padding:12px; gap:10px; }
#seat-avatar-list .avatar-default-picture { height:108px; }
#seat-avatar-list .avatar-default-picture img { width:92px; height:92px; object-fit:contain; }
#seat-avatar-list input:not([type=checkbox]):not([type=file]) { width:100%; min-width:0; }
#seat-avatar-list summary { cursor:pointer; color:var(--muted,#64748b); font-size:12px; }
#seat-avatar-list details input { margin-top:8px; }
.seat-avatar-library .panel-heading { display:flex; gap:12px; flex-wrap:wrap; justify-content:space-between; }

#view-resources #seat-avatar-list { grid-template-columns:repeat(auto-fill,minmax(170px,1fr)); }
#view-resources .avatar-default-picture img { border-radius:10px; object-fit:contain; }
#view-resources #seat-avatar-list .avatar-default-picture img { width:92px; height:92px; border-radius:10px; }
#view-resources #seat-avatar-list label:has(input[type=checkbox]) { display:flex; flex-direction:row; align-items:center; gap:6px; }

/* P0：只限定确认抽屉与机器人／灰度内容区。 */
.admin-confirm {position:fixed;inset:0 0 0 auto;margin:0;width:min(520px,100vw);max-width:100vw;height:100dvh;max-height:100dvh;border:0;padding:0;background:#fff;color:#172027;box-shadow:-12px 0 40px #17202733;}
.admin-confirm::backdrop {background:#101b2b77;}
.admin-confirm-panel {display:flex;flex-direction:column;gap:20px;padding:28px;min-height:100%;box-sizing:border-box;}
.admin-confirm-panel h2 {font-size:24px;margin:0;}
.admin-confirm-panel ul {margin:0;padding:16px 16px 16px 32px;background:#f4f6f8;border-radius:10px;overflow-wrap:anywhere;}
.admin-confirm-panel li {margin:8px 0;line-height:1.6;}
.admin-confirm-panel label {display:grid;gap:8px;font-weight:600;}
.admin-confirm-panel textarea {resize:vertical;min-height:100px;width:100%;box-sizing:border-box;padding:12px;border:1px solid #cbd5df;border-radius:8px;font:inherit;}
.admin-confirm-panel footer {margin-top:auto;display:flex;justify-content:flex-end;gap:12px;padding-top:20px;}
#view-robots .robot-live-gate[hidden],#view-robots #robots-live-panel[hidden],#view-gray-release .gray-summary-compat[hidden] {display:none!important;}
#view-robots .robot-live-gate {border-top:3px solid #b83d43;padding:28px;}
#view-robots .robot-live-gate h2 {font-size:26px;}
#view-robots .robot-live-checks {display:grid;gap:14px;padding:20px 28px;background:#fff5f3;border-radius:10px;}
#view-robots .robot-live-ack {display:flex;align-items:flex-start;gap:10px;margin:22px 0;line-height:1.6;}
#view-robots .robot-live-ack input {width:auto;flex:0 0 auto;margin-top:5px;}
#view-robots .robot-live-warning {flex-wrap:wrap;}
#view-robots #robots-live-exit {margin-left:auto;}
#view-gray-release .gray-readiness {padding:24px;margin-bottom:20px;}
#view-gray-release .gray-readiness-grid {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-top:20px;}
#view-gray-release .gray-readiness-grid article {display:flex;flex-direction:column;align-items:flex-start;gap:10px;padding:16px;border:1px solid #dce2e7;border-radius:10px;min-width:0;}
#view-gray-release .gray-readiness-grid small {font-size:12px;color:#526975;overflow-wrap:anywhere;line-height:1.6;}
@media(max-width:900px){#view-gray-release .gray-readiness-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:540px){#view-gray-release .gray-readiness-grid{grid-template-columns:1fr;}#view-gray-release .gray-readiness .panel-heading{flex-wrap:wrap;}#view-robots .robot-live-gate{padding:18px;}.admin-confirm-panel{padding:20px;}}
/* P1：紧凑分组与表单列内保存。 */
#view-robots .demo-robot-groups-pane {height:calc(100dvh - 292px);min-height:480px;max-height:none;}
#view-robots .demo-robot-groups-pane .demo-pane-heading {padding:12px 14px;flex-wrap:nowrap;}
#view-robots .demo-pane-heading h3 {font-size:15px;white-space:nowrap;}
#view-robots .demo-robot-groups-pane .demo-group-filters {display:flex;flex-direction:row;flex-wrap:nowrap;gap:6px;padding:0 12px;align-items:center;}
#view-robots .demo-group-filters>label {display:block;min-width:0;margin:0;}
#view-robots .demo-group-filters .demo-group-search {flex:1;}
#view-robots .demo-group-filters .demo-group-search input {width:100%;min-width:0;height:32px;}
#view-robots .demo-group-filters select {height:32px;max-width:110px;font-size:12px;padding:4px;}
#view-robots .demo-group-filters>label:nth-child(2) {flex:0 0 90px;}
#view-robots .demo-group-filters>label:nth-child(2) select {width:90px;max-width:90px;}
#view-robots .demo-filter-popover {position:relative;flex:none;}
#view-robots .demo-filter-popover summary {cursor:pointer;padding:6px;font-size:12px;}
#view-robots .demo-filter-popover>div {position:absolute;z-index:6;right:0;top:100%;display:grid;gap:10px;width:230px;padding:14px;background:#fff;border:1px solid #dce2e7;border-radius:8px;box-shadow:0 8px 24px #17202722;}
#view-robots .demo-filter-popover label {display:grid;grid-template-columns:50px 1fr;align-items:center;gap:8px;}
#view-robots #demo-group-filter-status {font-size:11px;margin:5px 14px;}
#view-robots .demo-robot-groups-pane .demo-group-list {display:block;min-height:0;padding:0 8px 8px;overflow:auto;}
#view-robots .demo-group-section {display:block;margin:0;padding:0;}
#view-robots .demo-group-section h4 {position:sticky;top:0;z-index:1;height:22px;box-sizing:border-box;margin:0;padding:3px 6px;background:#f3f6f8;font-size:11px;line-height:16px;}
#view-robots .demo-group-card {display:block;width:100%;height:44px;min-height:44px;box-sizing:border-box;padding:5px 6px;gap:0;border:0;border-bottom:1px solid #edf0f3;border-radius:0;background:white;text-align:left;}
#view-robots .demo-group-card[aria-pressed=true] {background:#edf7f3;box-shadow:inset 3px 0 #207852;}
#view-robots .demo-group-card.is-disabled {filter:saturate(.2);opacity:.68;}
#view-robots .demo-group-row-top {display:flex;align-items:center;gap:5px;height:16px;font-size:12px;line-height:16px;}
#view-robots .demo-group-row-top i {height:6px;width:6px;border-radius:50%;background:#9ca8b2;flex:none;}
#view-robots .demo-group-row-top i.is-enabled {background:#26805b;}
#view-robots .demo-group-row-top strong {overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;}
#view-robots .demo-group-code,#view-robots .demo-group-mode,#view-robots .demo-group-row-top small {flex:none;font-size:11px;}
#view-robots .demo-group-code {padding:0 3px;border-radius:3px;background:#eef1f4;}
#view-robots .demo-group-row-bottom {display:flex;gap:5px;font-size:11px;line-height:16px;height:16px;color:#435563;}
#view-robots .demo-group-row-bottom>span {overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;}
#view-robots .demo-group-row-bottom>b {font-weight:400;white-space:nowrap;font-size:11px;}
#view-robots .demo-group-row-bottom>b.is-pending {color:#a86505;font-weight:700;}
#view-robots .demo-save-footer {position:sticky;bottom:0;background:#fff;z-index:3;box-sizing:border-box;max-width:100%;}
#view-robots .demo-save-footer[hidden] {display:none!important;}
#view-robots .demo-group-list-note {font-size:11px;line-height:16px;padding:8px 12px;}
@media(max-width:900px){#view-robots .demo-robot-groups-pane{height:550px;min-height:0;}}
#release-registry{padding:20px;margin-bottom:20px;}#release-registry td{vertical-align:top;}#release-registry td button{font-size:12px;text-align:left;overflow-wrap:anywhere;}
.release-register-form{display:grid;gap:12px;padding:14px 0;}.release-register-form label{display:grid;gap:6px;}.release-register-form textarea{max-width:100%;font:inherit;}
/* 机器人方案 R-C / R-D：表单与真实回执独立展示，窄屏按阅读顺序排列。 */
#view-robots .demo-robot-layout {grid-template-columns:360px minmax(0,1fr);align-items:start;}
#view-robots .rg-editor {display:grid;grid-template-columns:minmax(0,1fr) 252px;grid-template-rows:auto auto auto minmax(0,1fr);align-items:start;height:calc(100dvh - 292px);min-height:480px;}
#view-robots .rg-editor>.panel-heading,#view-robots .rg-editor>.robot-agent-notice,#view-robots .rg-editor>.demo-form-footer {grid-column:1/-1;}
#view-robots .rg-editor .rg-form {grid-column:1;grid-row:4;min-width:0;max-height:100%;overflow:auto;box-sizing:border-box;scroll-padding-bottom:70px;}
#view-robots .rg-delivery {grid-column:2;grid-row:4;padding:12px 12px 56px;border-left:1px solid #dde4e8;font-size:12px;color:#354b58;position:sticky;top:16px;max-height:100%;overflow:auto;box-sizing:border-box;}
#view-robots .rg-delivery h3 {font-size:14px;margin:0 0 14px;}
#view-robots .rg-delivery ol {padding:0;list-style:none;display:grid;gap:20px;}
#view-robots .rg-delivery li {display:grid;gap:6px;border-left:3px solid #bcc7cf;padding-left:10px;line-height:1.6;}
#view-robots .rg-delivery li.is-ready {border-color:#207852;}
#view-robots .rg-delivery-warning {color:#8a4d00;line-height:1.6;}
#view-robots .rg-snapshots {margin:16px 0;max-width:100%;}
#view-robots .rg-snapshots>button {display:block;font-size:11px;white-space:normal;text-align:left;}
#view-robots .rg-field-inactive {color:#52616c;}
#view-robots .rg-field-reason {font-size:11px;line-height:1.5;color:#52616c;grid-column:1/-1;}
#view-robots .rg-field-inactive input,#view-robots .rg-field-inactive select {background:#edf0f3;color:#52616c;opacity:1;}
#view-robots .rg-form .demo-bet-fieldset {opacity:1;}
#view-robots .rg-form .robot-form-actions {display:flex;flex-wrap:wrap;gap:8px;}
#view-robots .rg-history-more {position:relative;padding:8px 10px;font-size:12px;}
#view-robots .rg-history-more>div {display:grid;gap:10px;position:absolute;right:0;top:100%;z-index:6;width:260px;padding:14px;background:#fff;border:1px solid #dce2e7;box-shadow:0 8px 24px #17202722;}
#view-robots .demo-runtime-table {min-width:0;width:100%;table-layout:fixed;font-size:12px;}
#view-robots .demo-runtime-table th:first-child {width:28%;}
#view-robots .demo-runtime-table th:nth-child(2) {width:30%;}
#view-robots .demo-runtime-table td {height:36px;box-sizing:border-box;padding:7.5px 12px;white-space:normal;vertical-align:top;line-height:20px;}
#view-robots .demo-runtime-table details>summary {cursor:pointer;white-space:normal;}
#view-robots .demo-runtime-table details>p {font-size:11px;line-height:1.6;margin:6px 0;color:#435563;overflow-wrap:anywhere;}
#view-robots .rg-row-changed {background:#fff4cf;}
.wallet-canary-panel {padding:18px;}
.wallet-canary-panel>summary {cursor:pointer;font-weight:600;}
.wallet-canary-panel .heading-actions,#view-robots .rg-room-canary .heading-actions {flex-wrap:wrap;}
.wallet-canary-metrics {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;font-size:12px;}
.wallet-canary-metrics>div {padding:12px;border:1px solid #dce2e7;border-radius:8px;}
.wallet-canary-metrics dd {margin:6px 0 0;font-weight:600;overflow-wrap:anywhere;}
.wallet-canary-panel pre {white-space:pre-wrap;overflow-wrap:anywhere;max-height:350px;overflow:auto;font-size:11px;}
#view-robots .rg-room-canary {padding:14px;margin-top:18px;}
#view-robots .rg-room-canary summary {cursor:pointer;font-weight:600;}
#view-robots .rg-room-canary>label {display:flex;gap:12px;align-items:center;margin-top:14px;font-size:12px;}
#view-robots .rg-room-canary pre {font-size:11px;white-space:pre-wrap;overflow-wrap:anywhere;max-height:300px;overflow:auto;}
@media(max-width:540px){.wallet-canary-metrics{grid-template-columns:minmax(0,1fr);}}
@media(max-width:540px){#view-robots .rg-history-more>div{left:0;right:auto;width:min(260px,calc(100vw - 56px));}}
@media(max-width:1250px){#view-robots .demo-robot-layout{grid-template-columns:320px minmax(0,1fr);}#view-robots .rg-editor{grid-template-columns:minmax(0,1fr);height:auto;grid-template-rows:none;}#view-robots .rg-editor .rg-form{max-height:600px;}#view-robots .rg-delivery{grid-column:1;grid-row:auto;position:static;border-left:0;border-top:1px solid #dde4e8;}}
@media(max-width:900px){#view-robots .demo-robot-layout{grid-template-columns:minmax(0,1fr);}#view-robots .rg-editor .rg-form{grid-row:auto;}#view-robots .demo-runtime-table td{padding:8px 5px;}#view-robots .demo-runtime-table{font-size:11px;}}
.release-manifest{width:min(760px,calc(100vw - 24px));max-height:90dvh;border:1px solid #dce2e7;border-radius:12px;padding:20px;}.release-manifest header{display:flex;align-items:center;justify-content:space-between;gap:16px;}.release-manifest pre{white-space:pre-wrap;overflow-wrap:anywhere;background:#f4f6f8;padding:16px;font-size:12px;}.release-manifest-actions{display:flex;gap:10px;}

/* 2026-10-20：以用户提供的机器人管理／多游戏版本与服务灰度原型为准。
   只覆盖两个视图；不修改全站导航、其他模块及数据语义。 */
#view-robots,#view-gray-release {--prototype-line:#dde2e7;--prototype-muted:#5d6a76;--prototype-green:#198754;font-size:13.5px;line-height:1.55;}
#view-robots .panel,#view-gray-release .panel {border-color:var(--prototype-line);border-radius:10px;box-shadow:0 1px 2px #1118270a,0 4px 14px #11182709;}
#view-robots h1,#view-gray-release h1 {font-size:28px;font-weight:750;line-height:1.3;}
#view-robots h2,#view-robots h3,#view-gray-release h2 {font-size:15px;line-height:1.4;}
#view-robots .button,#view-gray-release .button {min-height:34px;padding:6px 12px;border-radius:8px;font-size:12px;}
#view-robots .button-small,#view-gray-release .button-small {min-height:29px;padding:4px 9px;}
#view-robots .robot-category-header {display:grid;grid-template-columns:minmax(0,1fr) auto;gap:16px 24px;margin:0 0 18px;padding:0;border:0;}
#view-robots .robot-category-heading-copy {grid-column:1;min-width:0;}
#view-robots .robot-category-heading-copy>.eyebrow {font-size:11px;color:var(--prototype-muted);margin:0 0 5px;}
#view-robots .robot-category-heading-copy>p:last-child {font-size:12.5px;line-height:1.6;max-width:760px;margin:6px 0 0;}
#view-robots .robot-category-title-line {gap:10px;}
#view-robots .robot-demo-badge {font-size:11px;padding:2px 6px;border-radius:3px;}
#view-robots .robot-prototype-actions {grid-column:2;grid-row:1;display:flex;align-items:flex-start;gap:8px;max-width:285px;}
#view-robots .robot-prototype-actions #demo-service-status {margin:0;padding:0;background:none;border:0;font-size:11px;color:var(--prototype-muted);line-height:1.6;}
#view-robots .robot-category-tabs,#view-gray-release .gray-workspace-tabs {display:flex;grid-column:1/-1;flex-wrap:nowrap;gap:2px;padding:0;margin:0;border:0;border-bottom:1px solid var(--prototype-line);background:transparent;border-radius:0;overflow-x:auto;box-shadow:none;}
#view-robots .robot-category-tabs>button,#view-gray-release .gray-workspace-tabs>button {position:relative;flex:0 0 auto;min-height:42px;padding:8px 13px;border:0;border-radius:0;background:transparent;box-shadow:none;color:var(--prototype-muted);font-size:13.5px;font-weight:600;white-space:nowrap;}
#view-robots .robot-category-tabs>button.is-active,#view-gray-release .gray-workspace-tabs>button[aria-selected=true] {color:#131c24;background:transparent;box-shadow:inset 0 -2px var(--prototype-green);}
#view-robots .robot-category-tabs>.robot-category-danger {color:#9d2929;margin-left:14px;}
#view-robots #demo-robot-panel {padding:0;border:0;background:transparent;box-shadow:none;}
#view-robots #demo-robot-panel>.panel-heading {display:none;}
#view-robots .demo-robot-statusbar {display:flex;align-items:stretch;gap:0;margin:0 0 16px;padding:0;background:#fff;border:1px solid var(--prototype-line);border-radius:10px;box-shadow:0 1px 2px #1118270a,0 4px 14px #11182709;}
#view-robots .demo-robot-statusbar>div:not(.demo-health-master) {display:flex;flex:1 1 150px;min-width:0;flex-direction:column;justify-content:center;gap:2px;padding:13px 18px;border-right:1px solid var(--prototype-line);}
#view-robots .demo-robot-statusbar>div>span {order:-1;font-size:11.5px;font-weight:600;color:var(--prototype-muted);}
#view-robots .demo-robot-statusbar>div>strong {font-size:21px;line-height:1.2;}
#view-robots .demo-robot-statusbar>p {display:none;}
#view-robots .demo-health-master {display:flex;flex:1.4 1 260px;align-items:center;justify-content:flex-end;gap:10px;min-width:0;padding:12px 16px;margin:0;border:0;}
#view-robots .demo-health-master #demo-master-status {font-size:11.5px;order:-1;text-align:right;max-width:250px;}
#view-robots .demo-robot-layout {grid-template-columns:360px minmax(0,1fr);gap:14px;}
#view-robots .demo-robot-groups-pane {position:sticky;top:88px;min-height:520px;height:calc(100dvh - 380px);}
#view-robots .demo-pane-heading {min-height:48px;padding:9px 12px;border-bottom:1px solid var(--prototype-line);}
#view-robots .demo-group-filters {padding:7px 9px 6px;gap:6px;}
#view-robots .demo-group-filters input,#view-robots .demo-group-filters select {min-height:32px;font-size:12px;}
#view-robots .demo-group-card {border-radius:6px;}
#view-robots .demo-group-card.is-selected {background:#f2f8fd;border-color:#bfdcf5;box-shadow:inset 3px 0 #2878c8;}
#view-robots .demo-group-list-note {padding:6px 12px 8px;border-top:1px solid var(--prototype-line);}
#view-robots .rg-editor {display:block;height:auto;min-height:0;overflow:visible;}
#view-robots .rg-editor>.demo-pane-heading {padding:14px 18px;min-height:58px;flex-wrap:wrap;gap:6px;}
#view-robots .demo-editor-context {font-size:11px;text-align:left;}
#view-robots .demo-prototype-editor-body {display:grid;grid-template-columns:minmax(0,1fr) 252px;gap:16px;padding:16px 18px 24px;align-items:start;}
#view-robots .rg-editor .rg-form {display:grid;grid-column:auto;grid-row:auto;gap:12px;max-height:none;overflow:visible;padding:0;margin:0;}
#view-robots .rg-form>.demo-fieldset {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:14px;margin:0;border:1px solid var(--prototype-line);border-radius:10px;background:#fff;min-width:0;}
#view-robots .rg-form>.demo-fieldset>legend {float:left;display:block;grid-column:1/-1;width:calc(100% + 28px);box-sizing:border-box;margin:-14px -14px 0;padding:12px 14px;background:#f8fafb;border-bottom:1px solid var(--prototype-line);border-radius:10px 10px 0 0;font-size:12.5px;font-weight:700;}
#view-robots .demo-legend-hint {display:none;}
#view-robots .rg-form label {min-width:0;font-size:12px;color:var(--prototype-muted);gap:5px;}
#view-robots .rg-form input:not([type=checkbox]),#view-robots .rg-form select {box-sizing:border-box;width:100%;min-width:0;min-height:36px;border-radius:8px;font-size:12px;}
#view-robots .rg-form .demo-count-fieldset>.form-hint,#view-robots .rg-form .demo-preview {grid-column:1/-1;}
#view-robots .rg-form .demo-preview {margin:0;padding:12px;background:#f8fafb;min-width:0;}
#view-robots .rg-delivery {grid-column:auto;grid-row:auto;position:sticky;top:88px;max-height:none;overflow:visible;padding:14px;border:1px solid var(--prototype-line);border-radius:10px;font-size:12px;background:#fff;}
#view-robots .rg-delivery>h3 {font-size:13px;margin:-14px -14px 14px;padding:12px 14px;border-bottom:1px solid var(--prototype-line);}
#view-robots .rg-delivery ol {gap:0;}
#view-robots .rg-delivery li {position:relative;border-left:1px solid var(--prototype-line);padding:0 0 18px 16px;margin-left:5px;gap:3px;}
#view-robots .rg-delivery li::before {content:'';position:absolute;left:-6px;top:4px;width:10px;height:10px;border:2px solid #b26a00;border-radius:50%;background:#fff;}
#view-robots .rg-delivery li.is-ready::before {border-color:#198754;background:#198754;}
#view-robots .rg-delivery li>span {font-size:11px;color:var(--prototype-muted);overflow-wrap:anywhere;}
#view-robots .demo-prototype-changes,#view-robots .demo-prototype-rules,#view-robots .demo-config-help {border-top:1px solid var(--prototype-line);margin:14px -14px 0;padding:12px 14px;}
#view-robots .demo-prototype-changes h3,#view-robots .demo-prototype-rules summary {font-size:13px;font-weight:600;margin:0 0 10px;}
#view-robots .demo-config-help .robot-agent-notice {display:grid;padding:8px 0;border:0;}
#view-robots .demo-save-footer {grid-column:1/-1;padding:12px;border:1px solid var(--prototype-line);border-radius:8px;bottom:12px;}
#view-gray-release>.page-heading {margin-bottom:18px;align-items:flex-start;}
#view-gray-release>.page-heading p:not(.eyebrow) {max-width:760px;font-size:12.5px;}
#view-gray-release .gray-readiness {display:grid;grid-template-columns:minmax(210px,1.1fr) minmax(0,1.9fr) 220px;gap:0;padding:0;margin-bottom:16px;border-left:3px solid #b26a00;overflow:hidden;}
#view-gray-release .gray-prototype-gate-copy {display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:6px;padding:16px 18px;border-right:1px solid var(--prototype-line);margin:0;}
#view-gray-release .gray-prototype-gate-copy h2 {font-size:19px;line-height:1.3;}
#view-gray-release .gray-prototype-gate-copy p {font-size:12px;color:var(--prototype-muted);}
#view-gray-release .gray-readiness-grid {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0;margin:0;padding:14px 0;}
#view-gray-release .gray-readiness-grid article {display:flex;gap:6px;padding:8px 12px;border:0;border-right:1px solid var(--prototype-line);border-radius:0;font-size:12px;}
#view-gray-release .gray-readiness-grid small {font-size:11px;line-height:1.5;}
#view-gray-release .gray-readiness-grid .status {padding:0;background:transparent;font-size:12px;white-space:normal;}
#view-gray-release .gray-prototype-gate-actions {display:flex;flex-direction:column;justify-content:center;gap:7px;padding:14px 16px;background:#f8fafb;}
#view-gray-release .gray-workspace-tabs {margin-bottom:18px;}
#view-gray-release .gray-prototype-services {display:flex;gap:4px;padding:3px;margin-bottom:16px;background:#eef1f3;border-radius:8px;}
#view-gray-release .gray-prototype-services>button {border:0;background:transparent;padding:5px 12px;border-radius:6px;font-size:12.5px;}
#view-gray-release .gray-prototype-services>button[aria-selected=true] {background:#fff;box-shadow:0 1px 3px #121c2324;}
#view-gray-release .gray-prototype-services[hidden] {display:none;}
#view-gray-release .gray-prototype-cockpit {display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:14px;align-items:start;}
#view-gray-release .gray-prototype-main,#view-gray-release .gray-prototype-rail {display:grid;gap:14px;min-width:0;}
#view-gray-release .gray-guide,#view-gray-release .gray-prototype-rail>.panel {padding:16px;}
#view-gray-release .gray-guide>h2 {margin:0 0 20px;padding-bottom:14px;border-bottom:1px solid var(--prototype-line);}
#view-gray-release .gray-steps {gap:12px;}
#view-gray-release .gray-steps li {background:transparent;padding:0;border:0;font-size:12px;min-width:0;}
#view-gray-release .gray-steps b {width:22px;height:22px;border:2px solid #c7d0d8;border-radius:50%;background:#fff;color:#5d6a76;font-size:11px;}
#view-gray-release .gray-prototype-train {padding:0;overflow:hidden;}
#view-gray-release .gray-prototype-train>.panel-heading {padding:16px;border-bottom:1px solid var(--prototype-line);}
#view-gray-release .gray-prototype-train>.panel {border:0;border-radius:0;box-shadow:none;padding:16px;margin:0;border-bottom:1px solid var(--prototype-line);}
#view-gray-release .gray-prototype-train>.panel h2 {font-size:13px;}
#view-gray-release .gray-prototype-train>.panel p {font-size:12px;margin:4px 0;}
#view-gray-release .gray-prototype-rail>.panel h2 {font-size:14px;}
#view-gray-release .gray-prototype-rail>.panel p {font-size:12px;overflow-wrap:anywhere;}
@media(max-width:1250px){
 #view-robots .demo-robot-layout {grid-template-columns:320px minmax(0,1fr);}
 #view-robots .demo-prototype-editor-body {grid-template-columns:minmax(0,1fr);}
 #view-robots .rg-delivery {position:static;}
 #view-gray-release .gray-readiness {grid-template-columns:1fr;}
 #view-gray-release .gray-prototype-gate-copy {border-right:0;border-bottom:1px solid var(--prototype-line);}
 #view-gray-release .gray-prototype-gate-actions {flex-direction:row;}
 #view-gray-release .gray-prototype-cockpit {grid-template-columns:minmax(0,1fr);}
}
@media(max-width:900px){
 #view-robots .demo-robot-layout {grid-template-columns:minmax(0,1fr);}
 #view-robots .demo-robot-groups-pane {position:static;height:550px;min-height:0;}
 #view-robots .robot-category-header {grid-template-columns:minmax(0,1fr);}
 #view-robots .robot-prototype-actions {grid-column:1;grid-row:auto;max-width:none;}
 #view-robots .robot-category-tabs {grid-row:3;}
 #view-robots .demo-robot-statusbar {flex-wrap:wrap;}
 #view-robots .demo-health-master {flex-basis:100%;}
}
@media(max-width:540px){
 #view-robots .demo-prototype-editor-body {padding:12px;}
 #view-robots .rg-form>.demo-fieldset {grid-template-columns:minmax(0,1fr);}
 #view-robots .demo-robot-statusbar>div:not(.demo-health-master) {padding:12px;flex-basis:90px;}
 #view-robots .robot-category-tabs>button,#view-gray-release .gray-workspace-tabs>button {padding:8px 10px;}
 #view-gray-release .gray-readiness-grid {grid-template-columns:repeat(2,minmax(0,1fr));}
 #view-gray-release .gray-prototype-gate-actions {flex-wrap:wrap;}
}
/* 清除旧版按十二栏排表单和固定页签宽度的局部规则。 */
#view-robots .robot-category-header h1 {font-size:28px;font-weight:750;}
#view-robots .robot-category-tabs button {width:auto;}
#view-robots .robot-prototype-actions>.button {flex:none;white-space:nowrap;}
#view-robots .demo-robot-statusbar>div {white-space:normal;align-items:flex-start;}
#view-robots .demo-robot-statusbar strong {color:#131c24;}
#view-robots .demo-robot-statusbar>.demo-health-master {align-items:center;}
#view-robots .demo-health-master #demo-master-status {white-space:normal;overflow-wrap:anywhere;}
#view-robots .demo-health-master>.button {flex:none;}
#view-robots .demo-robot-editor-pane #demo-robot-form {padding:0;}
#view-robots #demo-robot-form>.demo-fieldset {grid-template-columns:repeat(2,minmax(0,1fr));border:1px solid var(--prototype-line);margin:0;}
#view-robots #demo-robot-form .demo-bet-fieldset>label,#view-robots #demo-robot-form .demo-bet-fieldset>.demo-picker-field {grid-column:auto;}
#view-robots #demo-robot-form .demo-scope-fieldset>.demo-picker-field:nth-of-type(3) {grid-column:1/-1;}
#view-robots #demo-robot-form .demo-switch-fieldset {display:grid;}
#view-robots #demo-robot-form .demo-enable-row {grid-column:1/-1;}
@media(max-width:540px){#view-robots #demo-robot-form>.demo-fieldset{grid-template-columns:minmax(0,1fr);}#view-robots .demo-health-master{flex-wrap:wrap;}#view-robots .demo-health-master #demo-master-status{max-width:100%;}}
#view-robots .demo-robot-statusbar>.demo-health-cell {flex:1 1 130px;}
#view-robots .demo-health-cell small {font-size:11px;color:var(--prototype-muted);}
#view-robots .demo-robot-statusbar>.demo-health-master {flex:1.4 1 260px;}
#view-robots .demo-robot-statusbar>div:not(.demo-health-master) {flex-basis:130px;padding:13px 18px;}
#view-robots .demo-prototype-modes {grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;gap:10px;}
#view-robots .demo-mode-choice {display:flex;flex-direction:column;gap:5px;padding:12px;text-align:left;border:1px solid #c7d0d8;border-radius:8px;background:#fff;color:#34424e;font:inherit;font-size:12px;}
#view-robots .demo-mode-choice[aria-pressed=true] {background:#f4fbf7;border-color:#198754;box-shadow:inset 0 0 0 1px #198754;}
#view-robots .demo-mode-choice span {font-size:11.5px;color:#5d6a76;line-height:1.45;}
#view-robots .demo-prototype-modes .demo-mode-choice:disabled {opacity:.65;}
#view-robots .robot-prototype-actions #demo-service-status {max-width:230px;}
#view-gray-release .gray-readiness-grid small {overflow-wrap:anywhere;}
#view-gray-release .gray-steps {grid-template-columns:repeat(5,minmax(0,1fr));}
#view-gray-release .gray-steps li {display:flex;flex-direction:column;align-items:flex-start;gap:6px;}
#view-gray-release .gray-steps li:not(:last-child) {position:relative;}
#view-gray-release .gray-steps li:not(:last-child)::after {content:'';position:absolute;left:24px;right:-12px;top:10px;border-top:1px solid #dde2e7;}
@media(max-width:540px){#view-robots .demo-prototype-modes{grid-template-columns:1fr;}#view-gray-release .gray-steps{grid-template-columns:1fr;}#view-gray-release .gray-steps li:not(:last-child)::after{display:none;}}
/* 原型完整工作区：独立侧栏卡片、发布列车、矩阵与四服务子页。 */
#view-robots .rg-delivery {border:0;background:transparent;padding:0;display:grid;gap:12px;}
#view-robots .demo-state-card,#view-robots .demo-prototype-changes,#view-robots .demo-prototype-rules,#view-robots .demo-config-help {margin:0;padding:14px;border:1px solid #dde2e7;border-radius:10px;background:#fff;box-shadow:0 1px 2px #1118270a;min-width:0;}
#view-robots .demo-state-card>h3,#view-robots .demo-prototype-changes>h3 {margin:-14px -14px 12px;padding:12px 14px;border-bottom:1px solid #dde2e7;font-size:13px;}
#view-robots .demo-change-list {list-style:none;margin:0;padding:0;}
#view-robots .demo-change-list li {display:grid;gap:3px;border-top:1px solid #dde2e7;padding:9px 0;overflow-wrap:anywhere;font-size:11.5px;}
#view-robots .demo-change-list li span {color:#5d6a76;}
#view-robots .demo-editor-tools {display:flex;gap:8px;margin-left:auto;}
#view-robots .demo-prototype-changes>p {font-size:11.5px;color:#5d6a76;}
#view-robots .demo-prototype-rules p {font-size:12px;line-height:1.65;}
#view-robots .demo-health-master #demo-master-status {max-width:155px;font-size:11.5px;}
#view-robots .demo-group-card.is-active {background:#f2f8fd;border-color:#bfdcf5;box-shadow:inset 3px 0 #2878c8;}
#view-gray-release .gray-prototype-candidate {display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 12px;padding:12px 14px;margin-top:16px;border:1px solid #dde2e7;border-radius:8px;background:#f8fafb;}
#view-gray-release .gray-prototype-candidate>.eyebrow {grid-column:1;font-size:11px;}
#view-gray-release .gray-prototype-candidate>h2 {grid-column:1;font-size:13px;margin:0;}
#view-gray-release .gray-prototype-candidate>p:not(.eyebrow) {grid-column:1;font-size:11px;overflow-wrap:anywhere;}
#view-gray-release .gray-prototype-candidate>button {grid-column:2;grid-row:1/4;align-self:center;}
#view-gray-release .gray-train-rows {padding:0 16px;}
#view-gray-release .gray-train-row {display:grid;grid-template-columns:145px minmax(0,1fr) auto;align-items:center;gap:14px;padding:14px 0;border-bottom:1px solid #dde2e7;font-size:12px;}
#view-gray-release .gray-train-row:last-child {border-bottom:0;}
#view-gray-release .gray-train-row>div {display:grid;gap:4px;min-width:0;overflow-wrap:anywhere;}
#view-gray-release .gray-train-row small {font-size:11px;color:#5d6a76;}
#view-gray-release .gray-version-matrix,#view-gray-release .gray-service-matrix {padding:0;overflow:hidden;}
#view-gray-release .gray-version-matrix>.panel-heading,#view-gray-release .gray-service-matrix>.panel-heading {padding:14px 16px;border-bottom:1px solid #dde2e7;margin:0;}
#view-gray-release .gray-version-matrix>[role=status] {padding:10px 16px;margin:0;font-size:11px;color:#5d6a76;}
#view-gray-release .gray-matrix-row {display:flex;align-items:center;flex-wrap:wrap;gap:6px;padding:10px 16px;border-top:1px solid #edf0f3;}
#view-gray-release .gray-matrix-row>strong {width:100%;font-size:12px;}
#view-gray-release .gray-version-chip {display:inline-block;max-width:100%;overflow-wrap:anywhere;background:#eaf3fb;border:1px solid #bfdcf5;border-radius:3px;padding:2px 5px;font-size:11px;}
#view-gray-release .gray-service-row {display:flex;width:calc(100% - 32px);align-items:center;justify-content:space-between;gap:10px;margin:0 16px;padding:16px 0;border:0;border-bottom:1px solid #dde2e7;background:#fff;text-align:left;font-size:12px;color:#131c24;}
#view-gray-release .gray-service-row>span {font-size:11px;color:#5d6a76;}
#view-gray-release .gray-service-row:last-child {border:0;}
#view-gray-release .gray-overview-sources[hidden] {display:none!important;}
#view-gray-release #release-registry {padding:16px;}
#view-gray-release #release-registry .panel-heading {padding:0 0 12px;border-bottom:1px solid #dde2e7;}
#view-gray-release #release-registry th,#view-gray-release #release-registry td {font-size:12px;padding:10px 12px;}
#view-gray-release .gray-service-banner {padding:18px 20px;margin:0 0 14px;border:1px solid #dde2e7;border-radius:10px;background:#fff;}
#view-gray-release .gray-service-banner h2 {font-size:18px;margin:0 0 6px;}
#view-gray-release .gray-service-banner p {font-size:12px;color:#5d6a76;margin:0;}
#view-gray-release .gray-strategies {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:14px;}
#view-gray-release .gray-strategies>div {padding:14px 16px;border:1px solid #dde2e7;border-radius:8px;background:#fff;}
#view-gray-release .gray-strategies p {font-size:12px;color:#5d6a76;margin:6px 0 0;}
#view-gray-release .gray-service-split {display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:14px;align-items:start;}
#view-gray-release .gray-service-main,#view-gray-release .gray-service-rail>.panel {padding:16px;min-width:0;}
#view-gray-release .gray-service-main>h3,#view-gray-release .gray-service-rail h3 {font-size:14px;margin:0 0 14px;}
#view-gray-release .gray-service-rail {display:grid;gap:14px;min-width:0;}
#view-gray-release .gray-service-rail p {font-size:12px;line-height:1.7;}
#view-gray-release #wallet-canary-control {padding:0;background:transparent;border:0;box-shadow:none;}
#view-gray-release #wallet-canary-control>summary {font-size:14px;margin-bottom:14px;}
#view-gray-release .wallet-canary-metrics dd {font-size:15px;}
#view-gray-release .rg-room-canary {padding:18px;}
#view-gray-release .rg-room-canary>summary {font-size:18px;font-weight:700;}
#view-gray-release .rg-room-canary>label {display:flex;align-items:center;gap:10px;margin:16px 0;}
#view-gray-release .rg-room-canary .heading-actions {display:flex;flex-wrap:wrap;gap:8px;}
#view-gray-release .rg-room-canary pre {white-space:pre-wrap;overflow-wrap:anywhere;max-height:400px;overflow:auto;}
.gray-robot-metrics {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;}
.gray-robot-metrics>div {padding:14px;border:1px solid #dde2e7;border-radius:8px;}
.gray-robot-metrics dt {font-size:12px;color:#5d6a76;}
.gray-robot-metrics dd {margin:8px 0 0;font-size:16px;font-weight:600;overflow-wrap:anywhere;}
@media(max-width:1100px){#view-gray-release .gray-service-split{grid-template-columns:minmax(0,1fr);}#view-gray-release .gray-train-row{grid-template-columns:95px minmax(0,1fr) auto;}}
@media(max-width:640px){#view-gray-release .gray-strategies,.gray-robot-metrics{grid-template-columns:minmax(0,1fr);}#view-gray-release .gray-prototype-candidate{grid-template-columns:minmax(0,1fr);}#view-gray-release .gray-prototype-candidate>button{grid-column:1;grid-row:auto;justify-self:start;}#view-gray-release .gray-train-row{grid-template-columns:minmax(0,1fr) auto;}#view-gray-release .gray-train-row>strong{grid-column:1/-1;}#view-robots .demo-editor-tools{margin-left:0;}}

/* 与原型保持内容边距和紧凑卡片；诊断正文完整保留。 */
@media(min-width:1251px){#view-robots,#view-gray-release{margin-left:-20px;margin-right:-20px;}}
#view-gray-release .gray-readiness{grid-template-columns:minmax(190px,.9fr) minmax(0,2.1fr) 190px;}
#view-gray-release .gray-readiness-grid article{gap:4px;padding:4px 10px;}
#view-gray-release .gray-prototype-gate-copy{padding:12px 16px;}
#view-gray-release .gray-prototype-gate-copy h2{font-size:17px;}
#view-gray-release .gray-prototype-gate-actions{padding:12px;}
#view-gray-release .gray-game-picker{padding:14px 16px;}
#view-gray-release .gray-game-picker .panel-heading{margin-bottom:10px;}
#view-gray-release .gray-game-picker-controls{margin:8px 0;}
#view-gray-release .gray-game-tabs{margin-top:10px;}
#view-gray-release #gray-workspace-public>.panel,#view-gray-release #gray-workspace-lobby>.panel{padding:16px;}
#view-gray-release #gray-writer-panel{padding-bottom:16px;margin-bottom:16px;border-bottom:1px solid #dde2e7;}
#view-gray-release #gray-workspace-lobby .metric-grid{grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;}
#view-gray-release #gray-workspace-lobby .metric-card{min-height:100px;padding:12px;}
#view-gray-release #gray-workspace-lobby .metric-card>strong{font-size:20px;}
#view-gray-release .rg-room-canary>label{white-space:nowrap;}
#view-gray-release .rg-room-canary>label>select{flex:1;min-width:0;}
@media(max-width:1250px){#view-gray-release .gray-readiness{grid-template-columns:minmax(0,1fr);}}
@media(max-width:900px){#view-gray-release #gray-workspace-lobby .metric-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:540px){#view-gray-release #gray-workspace-lobby .metric-grid{grid-template-columns:minmax(0,1fr);}}

/* 六页面方案：玩家抽屉与上传历史，限定各自容器。 */
#player-drawer .player-drawer-panel{width:720px;max-width:92vw;top:72px;height:calc(100dvh - 72px);}
#player-drawer .player-drawer-head{min-height:60px;padding:10px 18px;}
#player-drawer .player-drawer-head h2{font-size:16px;line-height:1.35;}
#player-drawer .player-drawer-tabs{min-height:44px;padding:0 18px;gap:24px;}
#player-drawer .player-drawer-body{padding:16px 18px;overflow:auto;}
#player-drawer :is(.player-rounds-table,.player-wallet-table){min-width:800px;table-layout:auto;}
#player-drawer :is(.player-rounds-table,.player-wallet-table) th{font-size:11px;height:40px;padding:0 12px;background:#fafbfc;}
#player-drawer :is(.player-rounds-table,.player-wallet-table) td{font-size:13px;height:44px;padding:8px 12px;max-width:220px;overflow-wrap:anywhere;font-variant-numeric:tabular-nums;}
#player-drawer :is(.player-rounds-table,.player-wallet-table) td[colspan="7"]{height:120px;text-align:center;}
#upload-task-history-dialog .upload-task-history-item{display:grid;grid-template-columns:minmax(0,1fr) 120px 96px;gap:12px;padding:10px 12px;border-bottom:1px solid #edf0f2;}
#upload-task-history-dialog .upload-task-history-item strong{font-size:13px;font-weight:600;overflow-wrap:anywhere;}
#upload-task-history-dialog .upload-task-history-item small{font-size:11px;color:#8b96a2;display:block;overflow-wrap:anywhere;}
#upload-task-history-dialog .upload-task-history-item time{font-size:11px;text-align:right;font-variant-numeric:tabular-nums;}
#upload-task-history-dialog .upload-history-date{position:sticky;top:0;background:#fff;font-size:12px;color:#697580;margin:14px 0 6px;padding:6px 0;z-index:1;}
#upload-task-history-dialog .upload-history-badge{font-size:11px;font-weight:700;border-radius:9px;padding:2px 8px;align-self:start;justify-self:end;background:#eef3f0;}
#upload-task-history-dialog .upload-history-message{grid-column:1/-1;display:-webkit-box!important;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
#upload-task-history-dialog .upload-task-history-failed .upload-history-message{color:#b42318;}
#upload-task-history-dialog .upload-history-skeleton{height:56px;background:#f3f5f6;border-radius:6px;margin:8px 0;}
#upload-task-history-dialog .upload-history-error{min-height:120px;display:grid;place-content:center;text-align:center;}
@media(max-width:640px){#upload-task-history-dialog .upload-task-history-item{grid-template-columns:minmax(0,1fr) 65px 60px;gap:8px;}#player-drawer .player-drawer-panel{max-width:100vw;}}

/* 视觉审查：任务入口占据正常布局，不压住表格操作；展开面板仍锚定入口。 */
.topbar-actions>.upload-task-center,body:has(#view-lobby.is-active) .topbar-actions>.upload-task-center{position:relative;inset:auto;display:flex;margin:0;z-index:25}
.topbar-actions>.upload-task-center[hidden]{display:none}
.topbar-actions>.upload-task-center .upload-task-panel{top:calc(100% + 8px);bottom:auto;right:0}
#view-robots .demo-robot-statusbar>.demo-health-master{flex-direction:column;align-items:flex-start;justify-content:center;gap:6px;background:#fff;border-radius:0;padding:13px 18px}
#view-robots .demo-health-master #demo-master-status{max-width:none;text-align:left;white-space:nowrap;overflow-wrap:normal;font-size:11.5px}

@media(max-width:640px){.topbar-actions .upload-task-toggle{min-height:32px;padding:5px}.topbar-actions #upload-task-summary,.topbar-actions .upload-task-toggle-chevron{display:none}.topbar-actions .upload-task-panel{position:fixed;top:var(--topbar-height,72px);right:8px;width:calc(100vw - 16px)}}

/* 供应商钱包独立版面 */
#view-supplier-wallet { min-width: 0; }
#view-supplier-wallet [hidden] { display: none !important; }
#view-supplier-wallet .page-heading { flex-wrap: wrap; gap: 14px; }
#view-supplier-wallet .supplier-eyebrow { font-size: 11px; color: #66808d; margin-bottom: 5px; }
#view-supplier-wallet .supplier-notice { padding: 14px 18px; border: 1px solid #cfe3d8; border-radius: 8px; background: #edf7f0; color: #285f43; margin-bottom: 18px; }
#view-supplier-wallet .supplier-notice p { margin: 5px 0 0; font-size: 13px; }
#view-supplier-wallet .supplier-tabs { display: flex; overflow-x: auto; border-bottom: 1px solid #dce3e7; gap: 4px; margin-bottom: 20px; }
#view-supplier-wallet .supplier-tabs button { flex: 0 0 auto; padding: 12px 14px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #647382; font: inherit; cursor: pointer; }
#view-supplier-wallet .supplier-tabs button[aria-selected="true"] { border-bottom-color: #28744e; color: #216a48; font-weight: 700; }
#view-supplier-wallet .supplier-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin-bottom: 20px; }
#view-supplier-wallet .metric-card strong { display: block; margin: 10px 0; font-size: 28px; }
#view-supplier-wallet .metric-card p { color: #75818d; font-size: 12px; }
#view-supplier-wallet .supplier-columns { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(0,1fr); gap: 18px; }
#view-supplier-wallet .panel { min-width: 0; }
#view-supplier-wallet .panel-heading { gap: 12px; flex-wrap: wrap; }
#view-supplier-wallet .panel-heading p { color: #74808b; font-size: 12px; margin-top: 5px; }
#view-supplier-wallet .supplier-links { padding: 6px 18px; }
#view-supplier-wallet .supplier-workspace-link { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 16px; padding: 13px 0; border: 0; border-bottom: 1px solid #edf0f2; background: transparent; text-align: left; font: inherit; color: #263a46; cursor: pointer; }
#view-supplier-wallet .supplier-workspace-link:last-child { border-bottom: 0; }
#view-supplier-wallet .supplier-workspace-link:hover { color: #216a48; }
#view-supplier-wallet .supplier-workspace-link small { display: block; color: #75818d; margin-top: 4px; }
#view-supplier-wallet .supplier-empty { text-align: center; padding: 46px 20px; white-space: normal; color: #657581; }
#view-supplier-wallet .supplier-empty p { font-size: 12px; margin-top: 9px; line-height: 1.7; }
#view-supplier-wallet .supplier-preview-note { margin-top: 18px; }
#view-supplier-wallet .table-wrap { width: 100%; margin: 0; overflow-x: auto; }
#view-supplier-wallet table { min-width: 680px; }
#view-supplier-wallet button:focus-visible { outline: 2px solid #216a48; outline-offset: -2px; }
@media(max-width: 900px) { #view-supplier-wallet .supplier-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); } #view-supplier-wallet .supplier-columns { grid-template-columns: minmax(0,1fr); } }

/* 2026-10-21 机器人新布局：左分组、右配置；保持真实表单与回执合同。 */
#view-robots.demo-layout-v2 {--prototype-line:#e5e9f0;--prototype-muted:#778399;}
#view-robots.demo-layout-v2 [hidden] {display:none!important;}
#view-robots.demo-layout-v2 .demo-robot-layout {grid-template-columns:310px minmax(0,1fr);gap:16px;}
#view-robots.demo-layout-v2 .demo-robot-statusbar {flex-wrap:wrap;align-items:center;min-height:65px;box-shadow:none;margin-bottom:16px;}
#view-robots.demo-layout-v2 .demo-robot-statusbar>div:not(.demo-health-master) {flex:0 1 auto;flex-direction:row;align-items:baseline;gap:7px;padding:8px 16px;border:0;}
#view-robots.demo-layout-v2 .demo-robot-statusbar>div>span {order:0;font-size:11px;font-weight:400;}
#view-robots.demo-layout-v2 .demo-robot-statusbar>div>strong {font-size:22px;font-variant-numeric:tabular-nums;}
#view-robots.demo-layout-v2 .demo-health-cell small {display:none;}
#view-robots.demo-layout-v2 .demo-robot-statusbar>.demo-health-master {flex:1 1 220px;flex-direction:row-reverse;align-items:center;justify-content:flex-start;margin:0;padding:8px 14px;gap:10px;}
#view-robots.demo-layout-v2 .demo-health-master #demo-master-status {white-space:normal;font-size:11px;}
#view-robots.demo-layout-v2 .demo-robot-groups-pane {position:sticky;top:84px;height:740px;max-height:calc(100dvh - 100px);min-height:420px;display:flex;flex-direction:column;overflow:visible;}
#view-robots.demo-layout-v2 .demo-group-filters {display:grid;grid-template-columns:minmax(0,1fr) auto;padding:12px;}
#view-robots.demo-layout-v2 .demo-group-search {grid-column:1/-1;}
#view-robots.demo-layout-v2 .demo-group-by-row {grid-column:1/-1;}
#view-robots.demo-layout-v2 .demo-group-by-row .segmented {width:100%;display:flex;}
#view-robots.demo-layout-v2 .demo-group-by-row button {flex:1;}
#view-robots.demo-layout-v2 #demo-robot-groups {flex:1;min-height:0;overflow:auto;max-height:none;padding:0 8px 10px;}
#view-robots.demo-layout-v2 .demo-group-card {height:auto;min-height:66px;margin:4px 0;padding:10px;border:1px solid transparent;box-shadow:none;}
#view-robots.demo-layout-v2 .demo-group-card[aria-pressed=true] {background:#f0f2ff;border-color:#d6dcff;box-shadow:inset 3px 0 #5866bd;}
#view-robots.demo-layout-v2 .demo-group-row-top {display:flex;gap:6px;}
#view-robots.demo-layout-v2 .demo-group-row-top strong {font-size:12px;flex:1;}
#view-robots.demo-layout-v2 .demo-group-code,#view-robots.demo-layout-v2 .demo-group-mode {display:none;}
#view-robots.demo-layout-v2 .demo-group-row-bottom {font-size:10.5px;margin-top:6px;display:flex;flex-wrap:wrap;gap:4px;}
#view-robots.demo-layout-v2 .demo-group-row-bottom span {white-space:normal;}
#view-robots.demo-layout-v2 .demo-group-list-note {display:none;}
#view-robots.demo-layout-v2 #demo-group-filter-status {border-top:1px solid #e5e9f0;padding:10px 12px;margin:0;font-size:11px;}
#view-robots.demo-layout-v2 .demo-prototype-editor-body {display:block;padding:0;}
#view-robots.demo-layout-v2 .rg-editor .rg-form {display:block;padding:0;}
#view-robots.demo-layout-v2 .rg-form>.demo-fieldset {border:0;border-bottom:1px solid #e5e9f0;border-radius:0;padding:18px 20px;display:grid;grid-template-columns:minmax(0,1fr);gap:12px;}
#view-robots.demo-layout-v2 .rg-form>.demo-fieldset>legend {float:left;width:100%;margin:0 0 4px;padding:0;border:0;background:none;border-radius:0;font-size:13px;}
#view-robots.demo-layout-v2 .rg-form label:not(.sr-only),#view-robots.demo-layout-v2 .demo-scope-fieldset>.demo-picker-field {display:grid;grid-template-columns:128px minmax(0,1fr);align-items:start;gap:10px;font-size:12px;}
#view-robots.demo-layout-v2 .rg-form label>span:first-child,#view-robots.demo-layout-v2 .demo-picker-field>span {padding-top:7px;}
#view-robots.demo-layout-v2 .rg-form input:not([type=checkbox]),#view-robots.demo-layout-v2 .rg-form select {min-height:33px;}
#view-robots.demo-layout-v2 .rg-form input[type=number] {max-width:150px;}
#view-robots.demo-layout-v2 .demo-scope-fieldset>.demo-all-halls-row {display:flex;margin-left:138px;align-items:center;}
#view-robots.demo-layout-v2 .demo-scope-fieldset>.demo-all-halls-row span {padding:0;}
#view-robots.demo-layout-v2 .demo-prototype-modes {margin:0 0 4px;gap:10px;}
#view-robots.demo-layout-v2 .demo-mode-choice {padding:12px;text-align:left;border-radius:10px;}
#view-robots.demo-layout-v2 .demo-mode-choice[aria-pressed=true] {background:#f1f3ff;border-color:#6674c5;box-shadow:inset 0 0 0 1px #6674c5;}
#view-robots.demo-layout-v2 .demo-mode-choice strong {font-size:13px;}
#view-robots.demo-layout-v2 .demo-mode-choice span {font-size:11px;}
#view-robots.demo-layout-v2 .demo-preview {border-radius:9px;display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:12px;}
#view-robots.demo-layout-v2 .demo-preview legend {font-size:11px;padding:0 5px;}
#view-robots.demo-layout-v2 .demo-preview label {display:flex;flex-direction:column;gap:4px;}
#view-robots.demo-layout-v2 #demo-preview-result {grid-column:1/-1;font-size:11px;line-height:1.65;margin:0;}
#view-robots.demo-layout-v2 .demo-seat-advanced {grid-column:1/-1;font-size:12px;color:#778399;}
#view-robots.demo-layout-v2 .demo-seat-advanced summary {padding:7px 0;cursor:pointer;}
#view-robots.demo-layout-v2 .demo-seat-grid {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;border-top:1px dashed #e5e9f0;padding-top:12px;}
#view-robots.demo-layout-v2 .demo-seat-grid label {display:flex;flex-direction:column;gap:4px;}
#view-robots.demo-layout-v2 .demo-seat-grid small {font-size:10px;}
#view-robots.demo-layout-v2 .demo-section-toggle {display:flex;align-items:center;gap:12px;width:100%;border:0;background:none;text-align:left;padding:0;font:inherit;color:inherit;cursor:pointer;}
#view-robots.demo-layout-v2 .demo-section-summary {flex:1;text-align:right;font-size:11px;font-weight:400;color:#778399;}
#view-robots.demo-layout-v2 .demo-section-toggle>span:last-child {font-size:11px;color:#5866bd;}
#view-robots.demo-layout-v2 .demo-section-fields {grid-column:1/-1;display:grid;gap:12px;min-width:0;}
#view-robots.demo-layout-v2 .demo-section-fields>.demo-picker-field {display:grid;grid-template-columns:128px minmax(0,1fr);gap:10px;}
#view-robots.demo-layout-v2 .demo-picker {position:relative;min-width:0;}
#view-robots.demo-layout-v2 .demo-picker summary {min-height:33px;padding:6px 10px;border:1px solid #dce2eb;border-radius:8px;font-size:12px;}
#view-robots.demo-layout-v2 .demo-picker-panel {position:absolute;inset:calc(100% + 6px) 0 auto auto;z-index:40;width:min(460px,100%);min-width:0;max-height:340px;overflow:auto;background:#fff;border:1px solid #dce2eb;border-radius:10px;padding:10px;box-shadow:0 12px 32px #16253b26;}
#view-robots.demo-layout-v2 .demo-picker-options {max-height:240px;overflow:auto;}
#view-robots.demo-layout-v2 .demo-picker-options label {display:flex;flex-direction:row;align-items:center;padding:7px;gap:6px;}
#view-robots.demo-layout-v2 [data-picker=roomIds] .demo-picker-options {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;}
#view-robots.demo-layout-v2 [data-picker=roomIds] .demo-picker-options>label:first-child {grid-column:1/-1;}
#view-robots.demo-layout-v2 .demo-game-search .demo-picker-options button {display:block;width:100%;border:0;background:#fff;text-align:left;padding:9px;font:inherit;color:inherit;}
#view-robots.demo-layout-v2 .demo-game-search .demo-picker-options button[aria-pressed=true] {background:#f1f3ff;color:#5866bd;}
#view-robots.demo-layout-v2 .demo-save-footer {position:sticky;bottom:0;background:#fcfdff;border-top:1px solid #e5e9f0;padding:12px 18px;margin:0;z-index:5;display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;}
#view-robots.demo-layout-v2 #demo-unsaved-count {font-size:11px;color:#8a6416;}
#view-robots.demo-layout-v2 .robot-form-actions {gap:7px;flex-wrap:wrap;}
#view-robots.demo-layout-v2 .demo-extra-feedback {padding:14px 18px;font-size:12px;border-top:1px solid #e5e9f0;}
#view-robots.demo-layout-v2 .demo-extra-feedback>summary {cursor:pointer;color:#778399;}
#view-robots.demo-layout-v2 .rg-delivery {position:static;display:grid;grid-template-columns:1fr 1fr;padding:12px 0 0;border:0;gap:12px;}
#view-robots.demo-layout-v2 .demo-enable-row {grid-column:1/-1;}
#view-robots.demo-layout-v2 .demo-enable-row label {display:flex;align-items:center;}
@media(max-width:1180px){#view-robots.demo-layout-v2 .demo-robot-layout{grid-template-columns:minmax(0,1fr);}#view-robots.demo-layout-v2 .demo-robot-groups-pane{position:static;height:auto;max-height:400px;min-height:260px;}}
@media(max-width:700px){#view-robots.demo-layout-v2 .rg-form>.demo-fieldset{padding:14px;}#view-robots.demo-layout-v2 .rg-form label:not(.sr-only),#view-robots.demo-layout-v2 .demo-scope-fieldset>.demo-picker-field,#view-robots.demo-layout-v2 .demo-section-fields>.demo-picker-field{grid-template-columns:minmax(0,1fr);gap:5px;}#view-robots.demo-layout-v2 .demo-scope-fieldset>.demo-all-halls-row{margin-left:0;display:flex;}#view-robots.demo-layout-v2 .demo-seat-grid{grid-template-columns:1fr 1fr;}#view-robots.demo-layout-v2 .rg-delivery{grid-template-columns:minmax(0,1fr);}#view-robots.demo-layout-v2 .demo-preview{grid-template-columns:1fr;}#view-robots.demo-layout-v2 .demo-section-toggle{flex-wrap:wrap;gap:6px;}#view-robots.demo-layout-v2 .demo-section-summary{font-size:10px;}#view-robots.demo-layout-v2 .demo-picker-options label{display:flex;}#view-robots.demo-layout-v2 .demo-robot-statusbar>div:not(.demo-health-master){padding:8px 12px;}#view-robots.demo-layout-v2 .demo-enable-row label{display:flex;}}

#view-robots.demo-layout-v2 #demo-robot-form>.demo-fieldset {grid-template-columns:minmax(0,1fr);}
#view-robots.demo-layout-v2 .demo-bet-fieldset.is-demo-disabled .demo-section-toggle {pointer-events:auto;}
#view-robots.demo-layout-v2 .demo-seat-grid label {display:flex;flex-direction:column;}
#view-robots.demo-layout-v2 .demo-preview label {display:flex;flex-direction:column;}
#view-robots.demo-layout-v2 .demo-picker-field {grid-column:1/-1;}
#view-robots.demo-layout-v2 .robot-prototype-actions {flex-wrap:wrap;max-width:440px;justify-content:flex-end;}
#view-robots.demo-layout-v2 #demo-robot-new {background:#5866bd;color:white;border-color:#5866bd;}
#view-robots.demo-layout-v2 .demo-save-footer {position:static;}
#view-robots.demo-layout-v2 .demo-save-footer #demo-robot-status {flex-basis:100%;margin:0;font-size:11px;}
#view-robots.demo-layout-v2 #demo-robot-form .demo-seat-grid>label,#view-robots.demo-layout-v2 #demo-robot-form .demo-preview>label {display:flex;flex-direction:column;align-items:stretch;}
#view-robots.demo-layout-v2 .demo-robot-statusbar>.demo-health-cell>span {order:1;}
@media(max-width:700px){#view-robots.demo-layout-v2 .demo-save-footer .robot-form-actions{display:flex;flex-direction:row;justify-content:flex-start;}#view-robots.demo-layout-v2 .demo-save-footer .robot-form-actions .button{width:auto;flex:0 1 auto;}}

/* 新原型逐项校正：1560px内容边界、330px分组栏、独立分区与行内选择。 */
main:has(>#view-robots.demo-layout-v2.is-active){max-width:1560px;margin:0;padding:20px 24px 60px;}
#view-robots.demo-layout-v2{margin:0;color:#0e1524;}
#view-robots.demo-layout-v2 .robot-category-header{gap:10px 16px;margin-bottom:12px;}
#view-robots.demo-layout-v2 .robot-category-header h1{font-size:24px;line-height:1.25;}
#view-robots.demo-layout-v2 .robot-category-heading-copy>p:last-child{font-size:12.5px;}
#view-robots.demo-layout-v2 .robot-prototype-actions{align-self:center;align-items:center;max-width:none;}
#view-robots.demo-layout-v2 #demo-service-status{display:none;}
#view-robots.demo-layout-v2 .robot-category-tabs{margin:0;min-height:34px;}
#view-robots.demo-layout-v2 .robot-category-tabs button{padding:7px 12px;}
#view-robots.demo-layout-v2 .demo-robot-statusbar{min-height:48px;margin-bottom:12px;border-radius:14px;}
#view-robots.demo-layout-v2 .demo-robot-statusbar>div:not(.demo-health-master){padding:10px 18px;position:relative;}
#view-robots.demo-layout-v2 .demo-robot-statusbar>div:not(:first-child):not(.demo-health-master):before{content:'';position:absolute;left:0;top:13px;bottom:13px;width:1px;background:#e3e7ee;}
#view-robots.demo-layout-v2 .demo-robot-statusbar>div>strong{font-size:19px;}
#view-robots.demo-layout-v2 #demo-robot-enabled-count{color:#0e7c5a;}
#view-robots.demo-layout-v2 .demo-robot-statusbar>.demo-health-master{flex:0 1 auto;margin:4px 10px 4px auto;padding:8px 12px;border:1px solid #efd3a6;border-radius:9px;background:#fdf3e2;}
#view-robots.demo-layout-v2 .demo-health-master #demo-master-status{color:#7a4e05;}
#view-robots.demo-layout-v2 .demo-robot-layout{grid-template-columns:minmax(0,330px) minmax(0,1fr);gap:12px;align-items:stretch;}
#view-robots.demo-layout-v2 .demo-robot-groups-pane{position:static;height:auto;max-height:none;min-height:0;border-radius:14px;overflow:hidden;}
#view-robots.demo-layout-v2 #demo-robot-groups{max-height:940px;padding:6px 10px 10px;}
#view-robots.demo-layout-v2 .demo-pane-heading{padding:13px 16px;min-height:46px;}
#view-robots.demo-layout-v2 .demo-robot-groups-pane>.demo-pane-heading>div{display:flex;align-items:center;gap:8px;}
#view-robots.demo-layout-v2 .demo-group-filters{display:flex;gap:6px;padding:10px 16px;border-bottom:1px solid #e3e7ee;flex-wrap:wrap;}
#view-robots.demo-layout-v2 .demo-group-search{flex:1 1 130px;min-width:0;}
#view-robots.demo-layout-v2 .demo-group-by-row{flex:0 0 auto;}
#view-robots.demo-layout-v2 .demo-group-by-row button{font-size:11px;padding:5px 8px;min-height:28px;}
#view-robots.demo-layout-v2 .demo-filter-popover{margin-left:auto;font-size:10px;}
#view-robots.demo-layout-v2 .demo-group-card{position:relative;min-height:56px;height:auto;padding:10px 68px 10px 20px;opacity:1;border-radius:9px;margin:4px 0;background:white;}
#view-robots.demo-layout-v2 .demo-group-row-top{position:static;}
#view-robots.demo-layout-v2 .demo-group-row-top i{position:absolute;left:8px;top:24px;}
#view-robots.demo-layout-v2 .demo-group-row-top strong{color:#0e1524;font-size:12.5px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;}
#view-robots.demo-layout-v2 .demo-group-row-top small{display:none;}
#view-robots.demo-layout-v2 .demo-group-row-bottom{margin:3px 0 0;font-size:10.5px;display:block;color:#8a93a6;}
#view-robots.demo-layout-v2 .demo-group-row-bottom span{display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;}
#view-robots.demo-layout-v2 .demo-group-row-bottom b{position:absolute;right:9px;top:20px;border-radius:99px;font-size:10px;font-weight:500;padding:1px 7px;background:#f1f3f7;color:#7a8394;}
#view-robots.demo-layout-v2 .demo-group-card:not(.is-disabled) .demo-group-row-bottom b{background:#fdf3e2;color:#a96400;}
#view-robots.demo-layout-v2 .demo-group-section h4{background:none;font-size:11px;color:#5b6777;padding:7px 6px;}
#view-robots.demo-layout-v2 .rg-editor{border-radius:14px;overflow:visible;display:flex;flex-direction:column;}
#view-robots.demo-layout-v2 .rg-editor>.demo-pane-heading{padding:13px 18px;min-height:68px;background:linear-gradient(#fcfdff,#fff);border-radius:14px 14px 0 0;}
#view-robots.demo-layout-v2 .demo-ref-identity{flex:1;min-width:0;}
#view-robots.demo-layout-v2 .demo-ref-identity h3{font-size:14.5px;}
#view-robots.demo-layout-v2 .demo-ref-identity .demo-editor-context{display:block;margin-top:4px;font-size:11.5px;}
#view-robots.demo-layout-v2 .demo-ref-badge{display:inline-flex;align-items:center;font-size:10.5px;padding:2px 8px;border-radius:99px;background:#eef1fe;color:#3b4ab8;border:1px solid #c9d0f7;white-space:nowrap;}
#view-robots.demo-layout-v2 .demo-ref-editor-badges{display:flex;gap:8px;}
#view-robots.demo-layout-v2 #demo-ref-revision{background:#f4f6f9;color:#79869a;border-color:#e4e9f0;}
#view-robots.demo-layout-v2 #demo-robot-form{padding:16px 18px 0;}
#view-robots.demo-layout-v2 #demo-robot-form>.demo-fieldset:not(.demo-switch-fieldset){display:grid;grid-template-columns:minmax(0,1fr);border:1px solid #e3e7ee;border-radius:12px;padding:14px;margin:0 0 10px;gap:14px;background:#fff;}
#view-robots.demo-layout-v2 #demo-robot-form>.demo-fieldset>legend{display:flex;align-items:center;float:left;width:calc(100% + 28px);margin:-14px -14px 0;padding:11px 14px;background:#fbfcfe;border-radius:12px 12px 0 0;border-bottom:1px solid #e3e7ee;gap:9px;font-size:13px;}
#view-robots.demo-layout-v2 .demo-ref-number{display:inline-grid;place-items:center;flex:none;width:19px;height:19px;border-radius:50%;background:#eef1fe;color:#3b4ab8;font-size:10.5px;}
#view-robots.demo-layout-v2 legend small{font-size:11px;color:#8a93a6;font-weight:400;}
#view-robots.demo-layout-v2 .demo-section-toggle>strong{display:flex;align-items:center;gap:9px;}
#view-robots.demo-layout-v2 #demo-robot-form>.demo-bet-fieldset,#view-robots.demo-layout-v2 #demo-robot-form>.demo-lifecycle-fieldset{gap:0;}
#view-robots.demo-layout-v2 .demo-section-fields{padding-top:14px;}
#view-robots.demo-layout-v2 #demo-robot-form .demo-count-fieldset>label:not(.sr-only),#view-robots.demo-layout-v2 #demo-robot-form .demo-scope-fieldset>label:not(.demo-all-halls-row),#view-robots.demo-layout-v2 .demo-scope-fieldset>.demo-picker-field{grid-template-columns:104px minmax(0,1fr);gap:12px;}
#view-robots.demo-layout-v2 #demo-robot-form .demo-count-fieldset>label{margin-bottom:6px;}
#view-robots.demo-layout-v2 #demo-robot-form input[type=number]{max-width:120px;text-align:center;}
#view-robots.demo-layout-v2 .demo-ref-chips{display:flex;gap:6px;align-items:center;flex-wrap:wrap;min-width:0;font-size:11.5px;color:#7a8394;}
#view-robots.demo-layout-v2 .demo-ref-chip{border:1px solid #d3dae6;background:#fff;color:#5b6577;border-radius:99px;padding:5px 10px;font:inherit;font-size:11.5px;cursor:pointer;}
#view-robots.demo-layout-v2 .demo-ref-chip[aria-pressed=true]{background:#eef1fe;color:#3b4ab8;border-color:#c9d0f7;}
#view-robots.demo-layout-v2 .demo-ref-chip:disabled{opacity:.6;cursor:default;}
#view-robots.demo-layout-v2 .demo-ref-picker-hint{grid-column:2/-1;font-size:10.5px;color:#8a93a6;margin-top:-7px;}
#view-robots.demo-layout-v2 .demo-scope-fieldset>[data-picker=roomIds]{grid-template-columns:104px minmax(0,1fr) auto;}
#view-robots.demo-layout-v2 [data-picker=roomIds]>span{grid-column:1;grid-row:1;}
#view-robots.demo-layout-v2 [data-picker=roomIds]>.demo-ref-chips{grid-column:2;grid-row:1;}
#view-robots.demo-layout-v2 [data-picker=roomIds]>.demo-picker{grid-column:3;grid-row:1;}
#view-robots.demo-layout-v2 [data-picker=roomIds] summary{border:1px dashed #d3dae6;white-space:nowrap;font-size:11.5px;min-height:30px;}
#view-robots.demo-layout-v2 [data-picker=roomIds] .demo-picker-panel{width:420px;max-width:calc(100vw - 60px);}
#view-robots.demo-layout-v2 .demo-scope-fieldset>.demo-all-halls-row{margin-left:116px;font-size:10.5px;}
#view-robots.demo-layout-v2 .demo-prototype-modes{gap:9px;margin:0;}
#view-robots.demo-layout-v2 .demo-mode-choice{position:relative;padding:11px 28px 11px 12px;min-height:60px;border:1px solid #d3dae6;}
#view-robots.demo-layout-v2 .demo-mode-choice:after{content:'';position:absolute;right:10px;top:10px;width:14px;height:14px;border:1px solid #c8d0dc;border-radius:50%;}
#view-robots.demo-layout-v2 .demo-mode-choice[aria-pressed=true]:after{content:'✓';font-size:10px;text-align:center;line-height:14px;background:#4c5fd5;border-color:#4c5fd5;color:#fff;}
#view-robots.demo-layout-v2 #demo-robot-form .demo-preview{display:flex;align-items:center;flex-wrap:wrap;gap:14px;padding:11px 14px;border:1px solid #e3e7ee;border-radius:10px;background:#f7f9fc;}
#view-robots.demo-layout-v2 .demo-ref-preview-count,#view-robots.demo-layout-v2 .demo-ref-preview-target{flex:none;font-size:11px;color:#8a93a6;}
#view-robots.demo-layout-v2 .demo-ref-preview-count strong,#view-robots.demo-layout-v2 .demo-ref-preview-target strong{display:block;font-size:15px;color:#0e1524;line-height:1.2;}
#view-robots.demo-layout-v2 #demo-robot-form .demo-preview>label{display:flex;flex-direction:row;align-items:center;gap:6px;flex:none;font-size:11px;}
#view-robots.demo-layout-v2 #demo-robot-form #demo-preview-real{width:56px;min-height:30px;}
#view-robots.demo-layout-v2 #demo-ref-preview-note{flex:1 1 180px;font-size:10.5px;color:#8a93a6;}
#view-robots.demo-layout-v2 .demo-seat-advanced summary{font-size:11.5px;padding:2px 0;}
#view-robots.demo-layout-v2 .demo-ref-preview-room{margin-top:12px;}
#view-robots.demo-layout-v2 #demo-robot-form>.demo-switch-fieldset{padding:0 0 12px;margin:0;border:0;display:block;}
#view-robots.demo-layout-v2 .demo-enable-row{padding:0;background:none;border:0;border-radius:0;gap:10px;}
#view-robots.demo-layout-v2 .demo-enable-row p{font-size:10.5px;color:#8a93a6;}
#view-robots.demo-layout-v2 .demo-save-footer{margin:0 -18px;padding:11px 18px;border-top:1px solid #e3e7ee;background:#fcfdfe;}
#view-robots.demo-layout-v2 .demo-save-footer .button{font-size:12px;padding:7px 12px;border-radius:9px;}
#view-robots.demo-layout-v2 .demo-save-footer .button-primary{background:#4c5fd5;border-color:#4c5fd5;}
#view-robots.demo-layout-v2 .demo-extra-feedback{padding:10px 18px;}
@media(max-width:1180px){#view-robots.demo-layout-v2 .demo-robot-layout{grid-template-columns:minmax(0,1fr);}#view-robots.demo-layout-v2 .demo-robot-groups-pane{max-height:460px;}#view-robots.demo-layout-v2 #demo-robot-groups{max-height:320px;}}
@media(max-width:700px){main:has(>#view-robots.demo-layout-v2.is-active){padding:14px 12px 60px;}#view-robots.demo-layout-v2 #demo-robot-form{padding:12px 12px 0;}#view-robots.demo-layout-v2 #demo-robot-form .demo-count-fieldset>label:not(.sr-only),#view-robots.demo-layout-v2 #demo-robot-form .demo-scope-fieldset>label:not(.demo-all-halls-row),#view-robots.demo-layout-v2 .demo-scope-fieldset>.demo-picker-field{grid-template-columns:minmax(0,1fr);gap:6px;}#view-robots.demo-layout-v2 .demo-scope-fieldset>.demo-all-halls-row{margin-left:0;}#view-robots.demo-layout-v2 [data-picker=roomIds]>.demo-ref-chips{grid-column:1;grid-row:2;}#view-robots.demo-layout-v2 [data-picker=roomIds]>.demo-picker{grid-column:1;grid-row:3;}#view-robots.demo-layout-v2 .demo-ref-picker-hint{grid-column:1;margin-top:0;}#view-robots.demo-layout-v2 legend small{display:none;}#view-robots.demo-layout-v2 .demo-save-footer{margin:0 -12px;}#view-robots.demo-layout-v2 .demo-robot-statusbar>.demo-health-master{margin-left:10px;}#view-robots.demo-layout-v2 [data-picker=roomIds] .demo-picker-panel{width:100%;}}

#view-robots.demo-layout-v2 #demo-robot-form legend.sr-only{display:none!important;}
#view-robots.demo-layout-v2 .rg-editor>.demo-pane-heading,#view-robots.demo-layout-v2 .demo-prototype-editor-body,#view-robots.demo-layout-v2 .demo-extra-feedback{width:100%;box-sizing:border-box;}
#view-robots.demo-layout-v2 .demo-game-search summary{display:flex;align-items:center;gap:8px;}
#view-robots.demo-layout-v2 .demo-game-search summary b{font-size:10.5px;padding:1px 10px;background:#eef1fe;border:1px solid #c9d0f7;border-radius:4px;color:#3b4ab8;}
#view-robots.demo-layout-v2 .demo-ref-game-hint,#view-robots.demo-layout-v2 .demo-ref-field-hint{display:block;font-size:10.5px;color:#8a93a6;margin-top:4px;}
#view-robots.demo-layout-v2 .demo-ref-field-hint{grid-column:2;margin-top:-8px;}
#view-robots.demo-layout-v2 #demo-robot-groups .demo-group-card[aria-pressed=true]{background:#eef1fe;border-color:#c9d0f7;box-shadow:inset 3px 0 #4c5fd5;}
#view-robots.demo-layout-v2 #demo-robot-form>.demo-fieldset:has(>.demo-section-fields[hidden]){padding-bottom:0;}
#view-robots.demo-layout-v2 .demo-ref-preview-count{position:relative;padding-right:12px;}
#view-robots.demo-layout-v2 .demo-ref-preview-count:after{content:'→';position:absolute;right:-7px;top:12px;color:#b4becd;}
@media(max-width:700px){#view-robots.demo-layout-v2 .demo-ref-field-hint{grid-column:1;margin-top:0;}}
#view-robots.demo-layout-v2 .demo-group-card.is-disabled{filter:none;}
#view-robots.demo-layout-v2 .demo-ref-game-hint{grid-column:2;}
#view-robots.demo-layout-v2 #demo-robot-form>.demo-fieldset:has(>.demo-section-fields[hidden]){padding-bottom:14px;}
#view-robots.demo-layout-v2 #demo-robot-form>.demo-fieldset:has(>.demo-section-fields[hidden])>legend{border-bottom:0;border-radius:12px;}
@media(max-width:700px){#view-robots.demo-layout-v2 .demo-ref-game-hint{grid-column:1;}}

/* 机器人布局诊断稿：只限定展示，原字段、提交与状态合同不变。 */
#view-robots.demo-layout-v3{--prototype-line:var(--border);--prototype-muted:var(--text-muted);}
#view-robots.demo-layout-v3 .demo-robot-statusbar{display:grid;grid-template-columns:repeat(5,minmax(0,1fr)) auto;align-items:stretch;border-radius:8px;overflow:hidden;margin-bottom:16px;}
#view-robots.demo-layout-v3 .demo-robot-statusbar>div:not(.demo-health-master){display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:2px;padding:12px 16px;border-left:1px solid var(--border);}
#view-robots.demo-layout-v3 .demo-robot-statusbar>div:first-child{border-left:0;}
#view-robots.demo-layout-v3 .demo-robot-statusbar>div:before{content:none;}
#view-robots.demo-layout-v3 .demo-robot-statusbar>div>strong{order:0;font-size:19px;font-weight:700;line-height:1.2;font-variant-numeric:tabular-nums;}
#view-robots.demo-layout-v3 .demo-robot-statusbar>div>span,#view-robots.demo-layout-v3 .demo-robot-statusbar>.demo-health-cell>span{order:1;font-size:11.5px;color:var(--text-muted);white-space:nowrap;}
#view-robots.demo-layout-v3 #demo-prototype-rooms em{font-size:12px;color:var(--text-muted);font-style:normal;font-weight:500;}
#view-robots.demo-layout-v3 .demo-robot-statusbar>.demo-health-master{display:flex;flex-direction:column;justify-content:center;align-items:flex-end;padding:10px 12px;margin:0;border:0;border-left:1px solid var(--border);border-radius:0;background:var(--surface-muted);gap:5px;}
#view-robots.demo-layout-v3 .demo-health-master #demo-master-status{color:var(--text-muted);font-size:11px;}
#view-robots.demo-layout-v3 .demo-robot-layout{grid-template-columns:minmax(240px,280px) minmax(0,1fr);gap:16px;align-items:start;}
#view-robots.demo-layout-v3 .demo-robot-groups-pane,#view-robots.demo-layout-v3 .rg-editor{border-radius:8px;}
#view-robots.demo-layout-v3 #demo-robot-groups{max-height:520px;}
#view-robots.demo-layout-v3 .demo-pane-heading,#view-robots.demo-layout-v3 .rg-editor>.demo-pane-heading{padding:14px 16px;border-radius:8px 8px 0 0;}
#view-robots.demo-layout-v3 .demo-group-filters{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;padding:12px 14px;}
#view-robots.demo-layout-v3 .demo-group-search{grid-column:1/-1;}
#view-robots.demo-layout-v3 .demo-group-by-row{grid-column:1;}
#view-robots.demo-layout-v3 #demo-robot-groups .demo-group-card{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:3px 8px;padding:10px 11px;min-height:56px;border-radius:7px;}
#view-robots.demo-layout-v3 .demo-group-row-top,#view-robots.demo-layout-v3 .demo-group-row-bottom{display:contents;}
#view-robots.demo-layout-v3 .demo-group-row-top i{display:none;}
#view-robots.demo-layout-v3 .demo-group-row-top strong{grid-column:1;grid-row:1;min-width:0;font-size:13px;}
#view-robots.demo-layout-v3 .demo-group-row-bottom b{position:static;grid-column:2;grid-row:1;align-self:center;white-space:nowrap;}
#view-robots.demo-layout-v3 .demo-group-row-bottom span{grid-column:1/-1;grid-row:2;font-size:11.5px;color:var(--text-muted);font-variant-numeric:tabular-nums;}
#view-robots.demo-layout-v3 #demo-robot-groups .demo-group-card[aria-pressed=true]{border-color:#bfd8c9;background:var(--green-soft);box-shadow:inset 3px 0 var(--green-deep);}
#view-robots.demo-layout-v3 #demo-robot-form{padding:16px 16px 0;}
#view-robots.demo-layout-v3 #demo-robot-form>.demo-fieldset:not(.demo-switch-fieldset){border-radius:8px;padding:16px;gap:18px;margin-bottom:14px;}
#view-robots.demo-layout-v3 #demo-robot-form>.demo-fieldset>legend{width:calc(100% + 32px);margin:-16px -16px 0;padding:14px 16px;border-radius:8px 8px 0 0;}
#view-robots.demo-layout-v3 #demo-robot-form>.demo-fieldset:has(>.demo-section-fields[hidden]){padding-bottom:16px;}
#view-robots.demo-layout-v3 .demo-ref-number{background:var(--green-soft);color:var(--green-deep);}
#view-robots.demo-layout-v3 .demo-ref-badge{background:var(--green-soft);border-color:#bfd8c9;color:var(--green-deep);}
#view-robots.demo-layout-v3 #demo-robot-form .demo-scope-fieldset>label:not(.demo-all-halls-row),#view-robots.demo-layout-v3 .demo-scope-fieldset>.demo-picker-field{display:grid;grid-template-columns:88px minmax(0,1fr);gap:4px 14px;align-items:start;}
#view-robots.demo-layout-v3 .demo-scope-fieldset>label>span:first-child,#view-robots.demo-layout-v3 .demo-picker-field>span{padding-top:9px;font-size:12.5px;}
#view-robots.demo-layout-v3 .demo-ref-game-hint,#view-robots.demo-layout-v3 .demo-ref-picker-hint{grid-column:2;margin:0;font-size:11.5px;line-height:1.5;color:var(--text-muted);}
#view-robots.demo-layout-v3 .demo-ref-chips{gap:6px;}
#view-robots.demo-layout-v3 .demo-ref-chip{height:30px;padding:0 12px;border-radius:99px;}
#view-robots.demo-layout-v3 .demo-ref-chip[aria-pressed=true]{background:var(--green-soft);color:var(--green-deep);border-color:var(--green-deep);}
#view-robots.demo-layout-v3 #demo-robot-form .demo-picker-field>.demo-all-halls-row{grid-column:2;display:flex;flex-direction:row;align-items:center;gap:7px;margin:4px 0 0;font-size:12px;}
#view-robots.demo-layout-v3 #demo-robot-form .demo-all-halls-row>span{padding:0;}
#view-robots.demo-layout-v3 .demo-room-row{grid-column:2;grid-row:1;display:flex;flex-wrap:wrap;align-items:center;gap:8px;min-width:0;}
#view-robots.demo-layout-v3 .demo-room-row>.demo-ref-chips{flex:0 1 auto;}
#view-robots.demo-layout-v3 .demo-room-row>.demo-picker{flex:0 0 auto;}
#view-robots.demo-layout-v3 [data-picker=roomIds] summary{height:30px;min-height:30px;border:1px solid var(--border);border-radius:6px;padding:5px 10px;color:var(--blue);}
#view-robots.demo-layout-v3 [data-picker=roomIds] .demo-ref-chip{height:28px;padding:0 10px;border-radius:6px;background:var(--surface-muted);color:var(--text);border-color:var(--border);}
#view-robots.demo-layout-v3 .rg-form input:not([type=checkbox]),#view-robots.demo-layout-v3 .rg-form select,#view-robots.demo-layout-v3 .demo-game-search summary{min-height:38px;border-radius:6px;}
#view-robots.demo-layout-v3 .demo-game-search summary b{background:var(--blue-soft);color:var(--blue);border-color:#c7def0;}
#view-robots.demo-layout-v3 .demo-game-search .demo-picker-options button[aria-pressed=true]{background:var(--green-soft);color:var(--green-deep);}
#view-robots.demo-layout-v3 .demo-prototype-modes{align-items:start;gap:12px;}
#view-robots.demo-layout-v3 .demo-mode-choice{display:grid;grid-template-columns:18px minmax(0,1fr);gap:4px 10px;align-content:start;padding:14px;min-height:0;border-radius:8px;text-align:left;font:inherit;}
#view-robots.demo-layout-v3 .demo-mode-choice strong{grid-column:2;grid-row:1;}
#view-robots.demo-layout-v3 .demo-mode-choice>span{grid-column:2;grid-row:2;font-size:11.5px;line-height:1.55;}
#view-robots.demo-layout-v3 .demo-mode-choice:after{position:static;grid-column:1;grid-row:1;content:'';width:16px;height:16px;margin-top:2px;border:1.5px solid var(--border);background:white;}
#view-robots.demo-layout-v3 .demo-mode-choice[aria-pressed=true]{background:#f6fbf8;border-color:#8fc3a6;box-shadow:0 0 0 3px rgba(33,106,72,.07);}
#view-robots.demo-layout-v3 .demo-mode-choice[aria-pressed=true]:after{content:'';border-color:var(--green-deep);background:var(--green-deep);box-shadow:inset 0 0 0 3px white;}
#view-robots.demo-layout-v3 .demo-number-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;min-width:0;}
#view-robots.demo-layout-v3 #demo-robot-form .demo-number-grid>label{display:grid;grid-template-columns:minmax(0,1fr);gap:6px;min-width:0;font-size:12.5px;align-content:start;}
#view-robots.demo-layout-v3 #demo-robot-form .demo-number-input{display:flex;align-items:center;height:38px;border:1px solid var(--border);border-radius:6px;overflow:hidden;padding:0;}
#view-robots.demo-layout-v3 #demo-robot-form .demo-number-input>input{flex:1;width:100%;min-width:0;max-width:none;height:36px;min-height:36px;border:0;border-radius:0;text-align:right;font-variant-numeric:tabular-nums;padding:0 10px;box-shadow:none;}
#view-robots.demo-layout-v3 .demo-number-suffix{align-self:stretch;display:flex;align-items:center;padding:0 10px;border-left:1px solid var(--border);background:var(--surface-muted);font-size:11.5px;color:var(--text-muted);}
#view-robots.demo-layout-v3 .demo-number-grid .demo-ref-field-hint{grid-column:1;margin:0;font-size:11.5px;}
#view-robots.demo-layout-v3 #demo-robot-form .demo-preview{border:1px solid var(--border);background:var(--surface-muted);padding:12px 14px;border-radius:7px;}
#view-robots.demo-layout-v3 .demo-ref-preview-count{padding:0;}
#view-robots.demo-layout-v3 .demo-ref-preview-count:after{content:none;}
#view-robots.demo-layout-v3 .demo-ref-preview-count strong{font-size:16px;font-weight:700;}
#view-robots.demo-layout-v3 #demo-ref-preview-note{font-size:12px;margin-left:auto;flex:0 1 auto;}
#view-robots.demo-layout-v3 .demo-section-toggle>span:last-child{color:var(--green-deep);}
#view-robots.demo-layout-v3 #demo-robot-new,#view-robots.demo-layout-v3 .demo-save-footer .button-primary{background:var(--green-deep);border-color:var(--green-deep);}
#view-robots.demo-layout-v3 .demo-save-footer{margin:0 -16px;border-radius:0 0 8px 8px;}
#view-robots.demo-layout-v3 :is(button,summary,input,select):focus-visible{outline:2px solid var(--green-deep);outline-offset:2px;}
#view-robots.demo-layout-v3 .demo-number-input:focus-within{outline:2px solid var(--green-deep);outline-offset:2px;}
@media(max-width:1360px){#view-robots.demo-layout-v3 .demo-robot-statusbar{grid-template-columns:repeat(5,minmax(0,1fr));}#view-robots.demo-layout-v3 .demo-robot-statusbar>.demo-health-master{grid-column:1/-1;border-left:0;border-top:1px solid var(--border);flex-direction:row;align-items:center;justify-content:flex-end;gap:10px;}}
@media(max-width:1280px){#view-robots.demo-layout-v3 .demo-robot-layout{grid-template-columns:minmax(0,1fr);}#view-robots.demo-layout-v3 .demo-robot-groups-pane{max-height:none;}#view-robots.demo-layout-v3 #demo-robot-groups{max-height:260px;}}
@media(max-width:900px){main:has(>#view-robots.demo-layout-v3.is-active){padding:16px;}#view-robots.demo-layout-v3 .demo-number-grid{grid-template-columns:minmax(0,1fr);}#view-robots.demo-layout-v3 #demo-robot-form .demo-scope-fieldset>label:not(.demo-all-halls-row),#view-robots.demo-layout-v3 .demo-scope-fieldset>.demo-picker-field{grid-template-columns:minmax(0,1fr);gap:6px;}#view-robots.demo-layout-v3 .demo-ref-game-hint,#view-robots.demo-layout-v3 .demo-ref-picker-hint,#view-robots.demo-layout-v3 #demo-robot-form .demo-picker-field>.demo-all-halls-row{grid-column:1;}#view-robots.demo-layout-v3 .demo-room-row{grid-column:1;grid-row:2;}#view-robots.demo-layout-v3 .demo-robot-statusbar{grid-template-columns:repeat(2,minmax(0,1fr));}#view-robots.demo-layout-v3 .demo-robot-statusbar>.demo-health-master{flex-wrap:wrap;}#view-robots.demo-layout-v3 .demo-prototype-modes{grid-template-columns:minmax(0,1fr);}}

#view-robots.demo-layout-v3{--green-deep:#216a48;}
#view-robots.demo-layout-v3 .demo-robot-statusbar>div:not(:first-child):not(.demo-health-master):before{content:none;}
