:root {
    --bg: #f8fafc; --elev: #ffffff; --soft: #f1f5f9; --soft2: #eef2ff;
    --bd: #e2e8f0; --bd-soft: #eef2f6; --hover: #f8fafc;
    --tx: #0f172a; --tx2: #475569; --tx3: #94a3b8;
    --pri: #4f46e5; --pri2: #6366f1; --pri-soft: #eef2ff; --pri-ring: rgba(99,102,241,.35);
    --ok: #059669; --ok2: #10b981; --ok-soft: #ecfdf5;
    --warn: #d97706; --warn2: #f59e0b; --warn-soft: #fffbeb;
    --bad: #e11d44; --bad2: #f43f5e; --bad-soft: #fff1f2;
    --vio: #7c3aed; --vio2: #8b5cf6; --vio-soft: #f5f3ff;
    --info: #0284c7; --info2: #0ea5e9; --info-soft: #e0f2fe;
    --sh1: 0 1px 2px rgba(15,23,42,.05);
    --sh2: 0 1px 3px rgba(15,23,42,.07), 0 6px 20px -8px rgba(15,23,42,.12);
    --sh3: 0 12px 40px -8px rgba(15,23,42,.22);
    --primary: #4f46e5; --primary-dark: #4338ca;
    --success: #10b981; --warning: #f59e0b; --danger: #f43f5e;
    --text: #0f172a; --text-2: #475569; --text-3: #94a3b8;
    --line: #e2e8f0; --line-2: #e2e8f0; --fill: #f1f5f9;
    --shadow: 0 1px 3px rgba(15,23,42,.07), 0 6px 20px -8px rgba(15,23,42,.12);
    --sidebar-w: 225px;
    --header-h: 60px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
    --scrollbar-thumb: #e2e8f0;
    --scrollbar-thumb-hover: #94a3b8;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--tx);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 99px;
    border: 3px solid transparent;
    background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); background-clip: content-box; }
::-webkit-scrollbar-corner { background: transparent; }
* { scrollbar-width: thin; scrollbar-color: var(--scrollbar-thumb) transparent; }
button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; }
button:disabled, button[disabled] { cursor: not-allowed; }
.users-page .header-cell,
.users-page .table-header-row,
table.data th:not(.is-sortable),
.games-container .games-table thead th { cursor: default; }

a { color: inherit; text-decoration: none; }
.ico { width: 1em; height: 1em; display: block; flex: 0 0 auto; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: var(--elev);
    border-right: 1px solid var(--bd);
    z-index: 20;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    transition: width .18s cubic-bezier(.4, 0, .2, 1);
}
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 73.2px;
    padding: 0 14px 0 16px;
    border-bottom: 1px solid var(--bd-soft);
}
.logo h2 {
    margin: 0;
    flex: 1;
    min-width: 0;
    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--tx);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 10px 10px 14px;
}
.menu { list-style: none; margin: 0; padding: 0; }
.menu > li { margin: 0; }
.menu > li.grp-start::before {
    content: "";
    display: block;
    height: 1px;
    background: var(--bd);
    margin: 11px 6px;
}
.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 10px;
    border-radius: 9px;
    color: var(--tx2);
    font-size: 13.5px;
    font-weight: 550;
    transition: .12s;
    position: relative;
    width: 100%;
}
.menu-item .ico { width: 18px; height: 18px; flex: none; }
.menu-item span {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: inherit;
}
.menu-item:hover { background: var(--soft); color: var(--tx); }
.menu-item.is-active { background: var(--pri-soft); color: var(--pri); font-weight: 650; }
.menu-item.is-active .ico { color: var(--pri); }
.menu-item.is-active span { font-weight: 650; color: var(--pri); }
.menu-item .chev { width: 15px; height: 15px; color: var(--tx3); transition: transform .16s; margin-left: auto; }
.menu-item.grp.shut .chev { transform: rotate(-90deg); }
.menu-sub { margin: 2px 0 6px 20px; padding-left: 11px; border-left: 1px solid var(--bd-soft); display: flex; flex-direction: column; gap: 1px; }
.menu-sub.shut { display: none; }
.menu-item.sub { padding: 9px 10px; font-size: 13px; }
body.is-folded .menu-sub { display: none; }
/* hide role menus until Agent.applyShell grants .is-allowed (no flash) */
.menu > li[data-need] { display: none; }
.menu > li[data-need].is-allowed { display: list-item; }
.side-foot { border-top: 1px solid var(--bd-soft); padding: 10px; }
.side-collapse {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px;
    border-radius: 9px;
    border: 0;
    background: none;
    color: var(--tx2);
    font-size: 13.5px;
    font-weight: 550;
    transition: .12s;
}
.side-collapse:hover { background: var(--soft); color: var(--tx); }
.side-collapse .ico { width: 18px; height: 18px; }
body.is-folded { --sidebar-w: 68px; }
body.is-folded .logo { justify-content: center; padding: 0; }
body.is-folded .logo h2,
body.is-folded .menu-item span,
body.is-folded .side-collapse span { display: none; }
body.is-folded .menu-item { justify-content: center; padding: 9px 0; }
body.is-folded .side-collapse { justify-content: center; padding: 10px 0; }

.shell {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    transition: margin-left .18s cubic-bezier(.4, 0, .2, 1);
    background: var(--bg);
}
.topbar {
    position: sticky;
    top: 0;
    z-index: 15;
    height: var(--header-h);
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, .82);
    background: color-mix(in srgb, var(--elev) 82%, transparent);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--bd);
}
.top-title { min-width: 0; }
.top-title h2 {
    margin: 0;
    font-size: 16px;
    line-height: 1.25;
    font-weight: 650;
    letter-spacing: -.01em;
    color: var(--tx);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.top-title p {
    margin: 0;
    font-size: 11.5px;
    color: var(--tx3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.header-right { display: flex; align-items: center; margin-left: auto; }
.header-toolbar { display: flex; align-items: center; gap: 8px; padding-right: 4px; }
.balance-info {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 11px;
    border-radius: 9px;
    border: 1px solid var(--bd);
    background: var(--elev);
    font-size: 12.5px;
    font-weight: 500;
    color: var(--tx2);
    white-space: nowrap;
}
.balance-text {
    color: var(--tx);
    font-weight: 600;
    font-family: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", monospace;
}
.userbox { position: relative; }
.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 10px;
    border: 1px solid var(--bd);
    background: var(--elev);
    font-size: 13px;
    font-weight: 550;
    color: var(--tx);
    transition: .12s;
}
.user-info:hover { background: var(--soft); border-color: var(--pri); }
.avatar {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 12px;
    color: #fff;
    background: linear-gradient(140deg, #4f46e5, #7c3aed);
    flex: none;
}
.username {
    font-size: 13px;
    font-weight: 550;
    color: var(--tx);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-info .chev { width: 14px; height: 14px; color: var(--tx3); }
.dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 180px;
    background: var(--elev);
    border: 1px solid var(--bd);
    border-radius: 12px;
    box-shadow: var(--sh3);
    padding: 6px;
    display: none;
    z-index: 40;
}
.dropdown.is-open { display: block; }
.dropdown-head {
    padding: 8px 10px 4px;
    font-size: 10.5px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--tx3);
    font-weight: 700;
}
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 0;
    background: none;
    font-size: 13px;
    color: var(--tx2);
    text-align: left;
    transition: .12s;
}
.dropdown-item:hover { background: var(--soft); color: var(--tx); }
.dropdown-item .ico { width: 15px; height: 15px; flex: none; }
.dropdown-divider { height: 1px; background: var(--bd-soft); margin: 5px 2px; }
.icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    color: var(--tx2);
    border: 1px solid transparent;
    background: none;
    transition: .12s;
}
.icon-btn:hover { background: var(--soft); color: var(--tx); border-color: var(--bd); }
.icon-btn .ico { width: 16px; height: 16px; }
.main {
    padding: 22px 24px 40px;
    min-height: calc(100vh - var(--header-h));
    background: var(--bg);
}
.main-narrow .page-block { max-width: 960px; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.page-head h1 { margin: 0; font-size: 22px; font-weight: 650; line-height: 1.3; }
.page-head p { margin: 4px 0 0; color: var(--text-2); font-size: 13px; }
.head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.home-page { padding: 0; color: var(--text); }
.home-page .section-head {
    display: flex;
    justify-content: flex-start;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 12px;
}
.home-page .page-title {
    margin: 0;
    font-size: 28px;
    font-weight: 800;
    color: var(--tx);
}
.home-page .page-sub {
    margin: 8px 0 0;
    color: var(--tx2);
    font-size: 14px;
    line-height: 1.6;
}
.home-boards {
    display: flex;
    flex-wrap: nowrap;
    gap: 14px;
    margin-bottom: 16px;
}
.home-boards .card {
    flex: 1 1 0;
    min-width: 0;
    background: var(--elev);
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}
.home-notice h3,
.home-ad h3 {
    margin: 8px 0 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--tx);
}
.home-board-body {
    white-space: normal;
    color: var(--tx2);
    line-height: 1.7;
    font-size: 14px;
    max-height: 420px;
    overflow-x: hidden;
    overflow-y: auto;
}
.home-board-body img {
    max-width: 100%;
    height: auto;
}
.home-ad-img {
    max-width: 100%;
    max-height: 240px;
    object-fit: contain;
    border-radius: 8px;
    display: block;
    margin: 8px 0;
    background: var(--soft);
}
@media (max-width: 900px) {
    .home-boards { flex-wrap: wrap; }
    .home-boards .card { flex: 1 1 100%; }
}
.dashboard { padding: 0; color: var(--text); }
.dashboard-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}
.dashboard-header h1 { margin: 0 0 4px; font-size: 22px; font-weight: 650; }
.dashboard-header p { margin: 0; color: var(--text-2); font-size: 13px; }
.header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.seg-ctrl {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 2px;
    background: var(--soft);
    border-radius: 4px;
}
.seg-ctrl button {
    height: 28px;
    padding: 0 11px;
    border: 0;
    background: transparent;
    color: var(--tx2);
    font-size: 14px;
    border-radius: 2px;
}
.seg-ctrl button.is-active {
    background: var(--info);
    color: #fff;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 15px;
    border-radius: 10px;
    border: 1px solid var(--bd);
    background: var(--elev);
    color: var(--tx);
    font-weight: 600;
    font-size: 13px;
    transition: .15s;
    white-space: nowrap;
    height: auto;
}
.btn:hover { background: var(--soft); border-color: var(--tx3); color: var(--tx); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--pri); border-color: var(--pri); color: #fff; box-shadow: 0 6px 16px -8px rgba(79,70,229,.8); }
.btn-primary:hover { background: #4338ca; border-color: #4338ca; color: #fff; }
.btn-success { background: var(--ok2); border-color: var(--ok2); color: #fff; }
.btn-success:hover { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-warning { background: var(--warn2); border-color: var(--warn2); color: #fff; }
.btn-warning:hover { background: var(--warn); border-color: var(--warn); color: #fff; }
.btn-danger { background: var(--bad2); border-color: var(--bad2); color: #fff; }
.btn-danger:hover { filter: brightness(.92); color: #fff; }
.btn-info { background: #909399; border-color: #909399; color: #fff; }
.btn-info:hover { background: #a6a9ad; border-color: #a6a9ad; color: #fff; }
.btn-text, .btn-link { background: transparent; border-color: transparent; color: var(--tx2); }
.btn-text:hover, .btn-link:hover { background: var(--soft); color: var(--tx); }
.btn-circle { width: 36px; height: 36px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; height: auto; }
.btn .ico { font-size: 14px; width: 14px; height: 14px; }

.input, .select, .field input, .field select, .field textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--bd);
    border-radius: 10px;
    background: var(--bg);
    color: var(--tx);
    font-size: 13px;
    outline: none;
    transition: .15s;
    height: auto;
}
.input:focus, .select:focus, .field input:focus, .field select:focus, .field textarea:focus {
    border-color: var(--pri);
    box-shadow: 0 0 0 3px var(--pri-ring);
    background: var(--elev);
}
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 15px; color: var(--tx2); font-size: 12.5px; font-weight: 600; }
.field input, .field select, .field textarea { width: 100%; }
.field textarea { height: auto; min-height: 88px; padding: 9px 12px; resize: vertical; line-height: 1.55; }
.field input:disabled { background: var(--soft); color: var(--tx3); }

.page-header-simple {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.page-header-simple h1 {
    margin: 0;
    color: var(--text);
    font-size: 22px;
    font-weight: 500;
}
.page-header-simple {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.page-header-simple h1 {
    margin: 0;
    color: var(--text);
    font-size: 22px;
    font-weight: 500;
}
.filter-bar {
    background: var(--elev);
    border: 1px solid var(--line-2);
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
    padding: 18px 20px 2px;
    display: flex;
    align-items: center;
    gap: 12px 18px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.filter-item { display: flex; align-items: center; gap: 8px; color: var(--text); margin-bottom: 16px; }
.filter-item .input, .filter-item .select { width: 200px; }
.filter-bar .btn { margin-bottom: 16px; }
.toolbar { display: flex; gap: 6px; margin-bottom: 8px; }
.advanced {
    display: none;
    width: 100%;
    padding-top: 8px;
    border-top: 1px dashed var(--line);
}
.advanced.is-open { display: flex; gap: 12px; flex-wrap: wrap; }

.panel {
    background: var(--elev);
    border: 1px solid var(--line-2);
    border-radius: 8px;
    padding: 16px;
    min-height: 100%;
}
.table-wrap { width: 100%; overflow: auto; }
table.data.wide { min-width: 1100px; }
table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    border: 1px solid var(--bd);
}
table.data th {
    background: var(--soft);
    color: var(--text-3);
    font-weight: 500;
    text-align: left;
    padding: 12px 10px;
    border-bottom: 1px solid var(--bd);
    border-right: 1px solid var(--bd);
    white-space: nowrap;
}
table.data th:last-child { border-right: 0; }
table.data td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--bd);
    border-right: 1px solid var(--bd);
    color: var(--text);
    white-space: nowrap;
}
table.data td:last-child { border-right: 0; }
table.flow td:nth-child(2) {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
}
table.data tr:hover td { background: var(--soft); }
.linkish { color: var(--primary); background: none; border: 0; padding: 0; font-size: 13px; }
.money-red { color: var(--danger); font-weight: 600; }
.money-green { color: var(--success); font-weight: 600; }
.money-orange { color: var(--warning); font-weight: 600; }
.muted { color: var(--text-3); }
.ops { display: flex; gap: 6px; }

.tag {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: 4px;
    border: 1px solid transparent;
    font-size: 12px;
    line-height: 1;
}
.tag-success { color: var(--ok2); background: var(--ok-soft); border-color: var(--bd); }
.tag-warning { color: var(--warn2); background: var(--warn-soft); border-color: var(--bd); }
.tag-danger { color: var(--bad2); background: var(--bad-soft); border-color: var(--bd); }
.tag-primary { color: var(--info2); background: var(--info-soft); border-color: var(--bd); }
.tag-info { color: var(--tx3); background: var(--soft); border-color: var(--bd); }

.pager {
    position: fixed;
    right: 24px;
    bottom: 16px;
    z-index: 12;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--elev);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .08);
    color: var(--text-2);
    font-size: 14px;
}
.pager > .pager-nav,
.pager > .pager-num {
    margin: 0;
}
.pager-total { color: var(--tx2); font-weight: 500; white-space: nowrap; }
.pager-sizes {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin: 0 8px;
}
.pager-size-select {
    appearance: none;
    -webkit-appearance: none;
    height: 32px;
    min-width: 110px;
    padding: 0 28px 0 12px;
    border: 0;
    border-radius: 4px;
    background: var(--elev);
    box-shadow: 0 0 0 1px var(--bd) inset;
    color: var(--tx2);
    font-size: 14px;
    cursor: pointer;
    outline: none;
}
.pager-size-select:hover { box-shadow: 0 0 0 1px var(--tx3) inset; }
.pager-size-select:focus { box-shadow: 0 0 0 1px var(--primary) inset; }
.pager-size-caret {
    position: absolute;
    right: 8px;
    pointer-events: none;
    color: var(--tx3);
    display: inline-flex;
}
.pager-size-caret .ico { width: 12px; height: 12px; }
.pager-sizes-dropup { position: relative; }
.pager-size-menu {
    position: absolute;
    left: 0;
    min-width: 100%;
    bottom: calc(100% + 4px);
    z-index: 100;
    margin: 0;
    padding: 4px 0;
    background: var(--elev);
    border: 1px solid var(--bd);
    border-radius: 4px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .12);
    box-sizing: border-box;
}
.pager-size-menu-item {
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 8px 12px;
    font-size: 14px;
    color: var(--tx2);
    cursor: pointer;
    box-sizing: border-box;
}
.pager-size-menu-item:hover,
.pager-size-menu-item.is-active {
    background: var(--info);
    color: #fff;
}

.pager-size, .pager-num, .pager-nav {
    height: 32px;
    min-width: 32px;
    padding: 0 4px;
    border: 1px solid var(--bd);
    background: var(--elev);
    border-radius: 4px;
    color: var(--tx2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 14px;
    cursor: pointer;
    box-sizing: border-box;
    transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.pager-nav {
    background: var(--elev);
    border-radius: 4px;
    color: var(--tx2);
}
.pager-nav:disabled, .pager-nav[disabled] {
    opacity: .45;
    cursor: not-allowed;
    color: var(--tx3);
    background: var(--elev);
    border-color: var(--bd);
}
.pager-num.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.pager-num:hover:not(:disabled),
.pager-nav:hover:not(:disabled):not([disabled]) {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.pager-num.is-active:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
/* page number buttons: spacing like fn */
.pager [id$="-pager-nums"],
.pager [id$="pager-nums"],
#ck-pager-nums,
#aa-pager-nums,
#game-pager-nums,
#user-pager-nums {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.pager-gap { color: var(--tx3); padding: 0 2px; }
.pager-jump {
    display: inline-flex;
    align-items: center;
    margin-left: 16px;
    gap: 0;
    color: var(--tx2);
    white-space: nowrap;
}
.pager-input {
    width: 50px;
    height: 32px;
    border: 1px solid var(--line-2);
    border-radius: 4px;
    text-align: center;
    margin: 0 8px;
    color: var(--tx2);
}
.pager-next .ico { transform: rotate(180deg); }
.pager .ico { font-size: 12px; width: 14px; height: 14px; }

.stats-row,
.section-row { display: grid; gap: 12px; margin-bottom: 12px; }
.stats-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.section-row.ratio-16-8 { grid-template-columns: minmax(0, 16fr) minmax(0, 8fr); }
.section-row.ratio-14-10 { grid-template-columns: minmax(0, 14fr) minmax(0, 10fr); }
.section-row.ratio-12-12 { grid-template-columns: minmax(0, 12fr) minmax(0, 12fr); }

.metric-tile {
    min-height: 86px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--elev);
    border: 1px solid var(--line-2);
    border-radius: 8px;
}
.tile-icon {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    flex-shrink: 0;
}
.tile-icon .ico { width: 22px; height: 22px; }
.user-icon { background: #2563eb; }
.key-icon { background: #0f766e; }
.active-icon { background: #16a34a; }
.money-icon { background: #9333ea; }
.tile-value { font-size: 24px; font-weight: 700; line-height: 1.1; }
.tile-value.money { font-size: 21px; }
.tile-label { margin-top: 4px; color: var(--text-2); font-size: 13px; }

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}
.panel-header.compact { margin-bottom: 10px; }
.panel-header h2 { margin: 0; font-size: 16px; font-weight: 650; }
.panel-header span { display: block; margin-top: 3px; color: var(--text-2); font-size: 12px; }

.operation-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.operation-item {
    min-height: 86px;
    padding: 12px;
    border: 1px solid var(--line-2);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.operation-item .ico { color: var(--primary); font-size: 19px; width: 19px; height: 19px; }
.operation-item span,
.today-list span,
.inventory-grid span { color: var(--text-2); font-size: 12px; }
.operation-item strong { font-size: 18px; }
.operation-item.emphasis {
    border-color: rgba(64, 158, 255, .45);
    background: rgba(64, 158, 255, .06);
}

.today-list,
.inventory-grid { display: grid; gap: 8px; }
.today-list div,
.inventory-grid div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--line-2);
    padding: 8px 0;
}
.today-list div:last-child,
.inventory-grid div:last-child { border-bottom: 0; }
.today-list strong,
.inventory-grid strong { font-size: 15px; }
.inventory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; }

.trend-list { display: grid; gap: 10px; }
.trend-row {
    display: grid;
    grid-template-columns: 52px 1fr 86px;
    gap: 10px;
    align-items: center;
}
.trend-date { font-size: 12px; color: var(--text-2); }
.trend-bars { display: grid; gap: 5px; }
.bar-line {
    display: grid;
    grid-template-columns: 36px 1fr 34px;
    gap: 8px;
    align-items: center;
}
.bar-line span,
.bar-line b,
.trend-money { font-size: 12px; }
.bar-line > div {
    height: 8px;
    background: var(--soft);
    border-radius: 4px;
    overflow: hidden;
}
.generate-bar,
.activate-bar {
    display: block;
    height: 8px;
    border-radius: 4px;
}
.generate-bar { background: #2563eb; }
.activate-bar { background: #16a34a; }
.trend-money { text-align: right; font-weight: 650; }

.empty {
    padding: 28px 12px;
    text-align: center;
    color: var(--text-3);
}

@media (max-width: 1200px) {
    .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .section-row.ratio-16-8,
    .section-row.ratio-14-10,
    .section-row.ratio-12-12 { grid-template-columns: 1fr; }
    .operation-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .dashboard-header { flex-direction: column; }
    .operation-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .inventory-grid { grid-template-columns: 1fr; }
}

.soon-page { padding: 0; }
.page-header { margin: 0 0 24px; }
.page-header h1 {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.45;
}
.page-header p {
    margin: 0;
    font-size: 14px;
    color: var(--text-2);
}
.development-notice {
    display: flex;
    justify-content: center;
    align-items: center;
}
.notice-card {
    width: 100%;
    max-width: 600px;
    background: var(--elev);
    border: 1px solid var(--line);
    border-radius: 4px;
    box-shadow: var(--shadow);
    text-align: center;
}
.notice-content { padding: 40px 20px; }
.notice-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: 0 0 20px;
    color: var(--warning);
    font-size: 64px;
    line-height: 64px;
}
.notice-icon .ico { width: 64px; height: 64px; }
.notice-content h2 {
    margin: 0 0 16px;
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
}
.notice-content > p {
    margin: 0 0 24px;
    font-size: 16px;
    color: var(--text-2);
}
.el-divider {
    display: block;
    height: 1px;
    margin: 24px 0;
    background: var(--line);
    border: 0;
}
.planned-features {
    margin: 20px 0 0;
    text-align: left;
}
.planned-features h3 {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}
.planned-features ul {
    margin: 0;
    padding: 0 0 0 20px;
    list-style: disc;
}
.planned-features li {
    margin: 0 0 8px;
    font-size: 14px;
    color: var(--text-2);
}

.soon {
    max-width: 640px;
    margin: 48px auto;
    background: var(--elev);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 36px 32px;
    text-align: center;
}
.soon h1 { margin: 0 0 8px; font-size: 22px; }
.soon .lead { color: var(--text-3); margin: 0 0 18px; }
.soon h2 { margin: 0 0 8px; font-size: 18px; color: var(--warning); }
.soon ul { text-align: left; display: inline-block; color: var(--text-2); line-height: 1.9; }

.stack { display: flex; flex-direction: column; gap: 20px; max-width: 960px; }
.settings-page {
    padding: 20px;
    max-width: 1000px;
    margin: 0 auto;
}
.settings-header { margin: 0 0 20px; }
.settings-header h1 {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 600;
}
.page-description {
    margin: 0;
    font-size: 16px;
    color: var(--text-3);
}
.api-key-card { margin-bottom: 20px; }
.api-key-content { min-height: 200px; }
.api-key-exists { display: flex; flex-direction: column; gap: 20px; }
.card-header h3 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
}
.card-description {
    margin: 0;
    font-size: 14px;
    color: var(--text-2);
}
.key-display { display: flex; flex-direction: column; gap: 8px; }
.key-label { font-weight: 600; color: var(--text); }
.key-input-group {
    display: flex;
    width: 100%;
    max-width: 100%;
}
.key-input-group .key-input {
    flex: 1;
    height: 40px;
    border: 1px solid var(--line-2);
    border-right: 0;
    border-radius: 4px 0 0 4px;
    padding: 0 12px;
    background: var(--elev);
}
.toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 40px;
    padding: 0 16px;
    border: 1px solid var(--line-2);
    border-radius: 0 4px 4px 0;
    background: var(--fill);
    color: var(--text-2);
    white-space: nowrap;
}
.toggle-btn .ico { width: 14px; height: 14px; }
.key-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.key-actions .btn .ico { width: 14px; height: 14px; margin-right: 4px; }
.security-alert {
    margin-top: 0;
    padding: 12px 16px;
    background: var(--warn-soft);
    border: 1px solid var(--bd);
    border-radius: 4px;
    color: var(--warn2);
}
.el-alert__title {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--warn2);
    margin-bottom: 6px;
}
.el-alert__description p {
    margin: 4px 0;
    font-size: 13px;
    color: var(--warn2);
    line-height: 1.5;
}
.api-permissions {
    padding: 16px;
    background: var(--soft);
    border: 1px solid var(--bd);
    border-radius: 6px;
}
.api-permissions h4 {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}
.permission-list { display: flex; flex-wrap: wrap; gap: 10px; }
.el-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 30px;
    padding: 0 12px;
    border-radius: 15px;
    font-size: 12px;
    border: 1px solid transparent;
}
.el-tag .ico { width: 14px; height: 14px; }
.el-tag--success {
    background: var(--ok-soft);
    border-color: var(--bd);
    color: var(--ok2);
}
.api-docs-card { margin-bottom: 20px; }
.api-docs-content { display: flex; flex-direction: column; gap: 20px; }
.api-docs-content h4,
.doc-h {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}
.api-endpoint {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--fill);
    border-radius: 4px;
    border: 1px solid var(--line);
}
.api-endpoint b { color: var(--primary); }
.api-endpoint span { flex: 1; word-break: break-all; color: var(--primary); }
.block-hd h3 { margin: 0; font-size: 18px; font-weight: 600; }
.block {
    background: var(--elev);
    border: 1px solid var(--line);
    border-radius: 4px;
    box-shadow: var(--shadow);
}
.block-hd { padding: 16px 20px 0; }
.block-hd h2 { margin: 0; font-size: 16px; }
.block-hd p { margin: 6px 0 0; color: var(--text-3); font-size: 13px; }
.block-bd { padding: 16px 20px 20px; }
.key-line { display: flex; align-items: center; gap: 8px; margin: 8px 0 14px; }
.key-line span { white-space: nowrap; font-weight: 600; }
.key-line input { flex: 1; letter-spacing: 1px; }
.alert {
    background: var(--warn-soft);
    border: 1px solid var(--bd);
    color: var(--warn2);
    border-radius: 4px;
    padding: 12px 16px;
    margin-bottom: 16px;
}
.alert b { display: block; margin-bottom: 6px; }
.alert ul { margin: 0; padding-left: 18px; }
.perm {
    background: var(--soft);
    border-radius: 4px;
    padding: 12px 14px;
}
.perm h3 { margin: 0 0 8px; font-size: 14px; }
.perm-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs button {
    height: 40px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-2);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.tabs button.is-active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-pane { display: none; }
.tab-pane.is-active { display: block; }
.doc-h { margin: 16px 0 8px; font-size: 14px; }
.codebox {
    position: relative;
    background: var(--fill);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 12px 72px 12px 14px;
    overflow: auto;
}
.codebox pre { margin: 0; font-family: Consolas, "Courier New", monospace; font-size: 13px; line-height: 1.55; white-space: pre-wrap; }
.codebox .btn { position: absolute; top: 8px; right: 8px; }
.method {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--fill);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 8px 12px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
}
.method { position: relative; padding-right: 72px; }
.method b { color: var(--primary); }
.method .btn { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }

.mask {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .5);
    backdrop-filter: blur(2px);
    z-index: 70;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: sa3fade .16s;
}
@keyframes sa3fade { from { opacity: 0; } }
@keyframes sa3pop { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.mask[hidden] { display: none; }
.field[hidden] { display: none !important; }
.dialog {
    background: var(--elev);
    border: 1px solid var(--bd);
    border-radius: 16px;
    box-shadow: var(--sh3);
    width: min(520px, 100%);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    animation: sa3pop .18s;
}
.dialog-pwd { width: min(400px, 100%); }
.dialog-sm { width: min(420px, 100%); }
.dialog-batch { width: min(600px, 100%); max-width: calc(100vw - 32px); }
.dialog-hd, .dialog-ft { display: flex; align-items: center; padding: 18px 20px 14px; }
.dialog-hd { justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--bd-soft); }
.dialog-hd-plain { border-bottom: 1px solid var(--bd-soft); padding-bottom: 14px; }
.dialog-hd h3 { margin: 0; font-size: 15.5px; font-weight: 650; color: var(--tx); }
.dialog-bd { padding: 18px 20px; overflow-y: auto; }
.dialog-ft { justify-content: flex-end; gap: 9px; padding: 14px 20px; border-top: 1px solid var(--bd-soft); background: var(--soft); border-radius: 0 0 16px 16px; }
.dialog-ft-plain { border-top: 1px solid var(--bd-soft); padding: 14px 20px; }

.msgbox-mask {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .5);
    backdrop-filter: blur(2px);
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: sa3fade .16s;
}
.msgbox-mask[hidden] { display: none; }
.msgbox {
    background: var(--elev);
    border: 1px solid var(--bd);
    border-radius: 16px;
    box-shadow: var(--sh3);
    width: min(420px, 100%);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    animation: sa3pop .18s;
}
.msgbox-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--bd-soft);
}
.msgbox-title { font-size: 15.5px; font-weight: 650; color: var(--tx); }
.msgbox-close {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    color: var(--tx2);
    border: 1px solid transparent;
    background: none;
    transition: .12s;
}
.msgbox-close:hover { background: var(--soft); color: var(--tx); border-color: var(--bd); }
.msgbox-close .ico { width: 16px; height: 16px; }
.msgbox-bd { padding: 18px 20px; overflow-y: auto; }
.msgbox-bd .msgbox-status {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    margin: 0 auto 12px;
}
.msgbox-bd .msgbox-status .ico { width: 24px; height: 24px; }
.msgbox-warning { color: var(--warn2); background: var(--warn-soft); }
.msgbox-message { text-align: center; color: var(--tx2); font-size: 13.5px; }
.msgbox-message p { margin: 0; }
.msgbox-ft {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    padding: 14px 20px;
    border-top: 1px solid var(--bd-soft);
    background: var(--soft);
    border-radius: 0 0 16px 16px;
}
.msgbox-ft .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dt-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 220px;
}
.dt-trigger .dt-prefix {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--tx3);
    pointer-events: none;
    z-index: 1;
    display: inline-flex;
}
.dt-trigger .dt-prefix .ico { width: 14px; height: 14px; }
.dt-trigger .dt-input {
    width: 100%;
    padding-left: 30px;
    cursor: pointer;
    background: var(--elev);
}
.dt-trigger.is-open .dt-input { border-color: var(--primary); }
.dt-panel {
    position: absolute;
    z-index: 60;
    background: var(--elev);
    border: 1px solid var(--bd);
    border-radius: 4px;
    box-shadow: 0 0 12px rgba(0, 0, 0, .12);
    padding: 8px 12px 4px;
    display: none;
}
.dt-panel.is-open { display: block; }
.dt-panel-inner {
    display: flex;
    align-items: stretch;
}
.dt-cal {
    width: 280px;
    padding-right: 8px;
}
.dt-cal-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 32px;
    margin-bottom: 4px;
}
.dt-ym {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 500;
    color: var(--tx);
    cursor: pointer;
    border: 0;
    background: transparent;
    padding: 0;
}
.dt-ym .ico { width: 12px; height: 12px; color: var(--tx2); }
.dt-nav {
    display: inline-flex;
    flex-direction: column;
    gap: 0;
}
.dt-nav button {
    width: 20px;
    height: 14px;
    border: 0;
    background: transparent;
    color: var(--tx2);
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.dt-nav button:hover { color: var(--primary); }
.dt-nav .ico { width: 12px; height: 12px; }
.dt-weeks, .dt-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
}
.dt-weeks span {
    height: 30px;
    line-height: 30px;
    font-size: 12px;
    color: var(--tx2);
}
.dt-days button {
    height: 28px;
    margin: 2px 0;
    border: 1px solid transparent;
    border-radius: 2px;
    background: transparent;
    color: var(--tx2);
    font-size: 12px;
    padding: 0;
}
.dt-days button:hover { color: var(--primary); }
.dt-days button.is-other { color: var(--tx3); }
.dt-days button.is-selected {
    background: var(--primary);
    color: #fff;
    border: 2px solid #1d39c4;
    font-weight: 600;
}
.dt-days button.is-today:not(.is-selected) {
    color: var(--primary);
    font-weight: 600;
}
.dt-cal-ft {
    display: flex;
    justify-content: space-between;
    padding: 6px 0 4px;
    border-top: 1px solid var(--bd);
    margin-top: 4px;
}
.dt-cal-ft button {
    border: 0;
    background: transparent;
    color: var(--primary);
    font-size: 12px;
    padding: 0;
    height: 24px;
}
.dt-cal-ft button:hover { color: var(--primary-dark); }
.dt-time {
    display: flex;
    border-left: 1px solid var(--bd);
    padding-left: 8px;
    width: 110px;
}
.dt-time-col {
    flex: 1;
    height: 224px;
    overflow-y: auto;
    text-align: center;
}
.dt-time-col button {
    display: block;
    width: 100%;
    height: 28px;
    border: 0;
    background: transparent;
    color: var(--tx2);
    font-size: 12px;
    padding: 0;
    border-radius: 2px;
}
.dt-time-col button:hover { background: var(--soft); }
.dt-time-col button.is-selected {
    background: var(--primary);
    color: #fff;
}
.dt-time-col::-webkit-scrollbar { width: 4px; }
.dt-time-col::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 2px;
}
.field-h {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0;
    margin-bottom: 18px;
}
.field-h .field-label {
    flex: 0 0 auto;
    width: 100px;
    text-align: right;
    padding-right: 12px;
    line-height: 32px;
    color: var(--tx2);
    font-size: 14px;
    box-sizing: border-box;
}
.field-h.is-required .field-label::before {
    content: "*";
    color: var(--bad2);
    margin-right: 4px;
}
.field-h .field-content { flex: 1 1 auto; min-width: 0; }
.field-h .field-content input,
.field-h .field-content select,
.field-h .field-content textarea { width: 100%; }

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #409eff 0%, #ffffff 100%);
    font-family: Avenir, Helvetica, Arial, sans-serif;
}
.login-box {
    width: 400px;
    max-width: 100%;
    background: var(--elev);
    border: 1px solid var(--bd);
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, .12);
    padding: 40px;
    color: var(--tx);
    position: relative;
}
.login-header { margin-bottom: 32px; text-align: center; }
.login-box h1 { margin: 0 0 8px; font-size: 24px; font-weight: 600; line-height: normal; color: var(--tx); }
.login-box .hello { margin: 0; color: var(--tx2); font-size: 14px; }
.login-form { margin-bottom: 24px; }
.login-item { position: relative; margin: 0 0 18px; width: 100%; }
.login-field {
    display: flex;
    align-items: center;
    width: 100%;
    height: 64px;
    margin: 0;
    padding: 12px 16px;
    background: var(--soft);
    border: 1px solid var(--bd);
    border-radius: 4px;
    box-sizing: border-box;
    box-shadow: none;
    transition: border-color .3s, box-shadow .3s, background-color .3s;
}
.login-field:hover { border-color: var(--info2); }
.login-field:focus-within {
    background: var(--soft);
    border-color: var(--info2);
    box-shadow: rgba(102, 192, 244, 0.2) 0 0 0 2px;
}
.login-item.is-error .login-field,
.login-item.is-error .login-field:hover,
.login-item.is-error .login-field:focus-within {
    background: var(--soft);
    border-color: var(--bad2) !important;
    box-shadow: none !important;
}
.login-field-error {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin: 0;
    padding: 2px 0 0;
    color: var(--bad2) !important;
    font-size: 12px;
    line-height: 12px;
    text-align: left;
    display: none;
    pointer-events: none;
    box-sizing: border-box;
}
.login-item.is-error .login-field-error { display: block !important; }
.login-field .affix {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 14px;
    color: var(--tx3);
    border: 0;
    background: transparent;
    padding: 0;
}
.login-field .affix svg { width: 14px; height: 14px; display: block; }
.login-field input {
    flex: 1;
    width: 0;
    height: 40px;
    margin: 0 0 0 8px;
    padding: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--tx);
    font-size: 14px;
    line-height: 40px;
    font-family: inherit;
}
.login-field input::placeholder { color: var(--tx3); }
.login-field .affix-eye { visibility: hidden; }
.login-field:focus-within .affix-eye { visibility: visible; }
.login-submit {
    display: block;
    width: 100%;
    height: 48px;
    margin: 0 0 18px;
    border: 0;
    border-radius: 4px;
    background: var(--info);
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
}
.login-submit:hover { background: #66b1ff; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(102, 192, 244, .3); }
.login-submit:disabled,
.login-submit.is-loading {
  pointer-events: none;
  cursor: wait;
  transform: none;
  box-shadow: none;
}
.login-foot { margin: 0; padding-top: 20px; border-top: 1px solid var(--bd); text-align: center; }
.login-foot p { margin: 0; color: var(--tx3); font-size: 12px; line-height: normal; }

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    body.nav-open .sidebar { transform: none; width: 280px; }
    .shell { margin-left: 0; }
}

/* === USERS PAGE (from reference) === */
.users-page { height: 100vh; overflow: hidden; position: relative; }

.users-container { position: fixed; top: 64px; right: 0px; bottom: 0px; padding: 20px; background-color: var(--bg); transition: left 0.3s; display: flex; flex-direction: column; overflow: hidden; }

.users-page .page-header { flex-shrink: 0; display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }

.users-page .page-header h1 { margin: 0px; color: var(--tx); font-size: 22px; }

.users-page .search-card { border: 1px solid var(--bd); box-shadow: rgba(0, 0, 0, 0.1) 0px 2px 8px; }

.users-page .search-section { flex-shrink: 0; margin-bottom: 8px; }

.users-page .table-actions-section { display: flex; justify-content: space-between; align-items: center; padding: 6px 0px; margin-bottom: 8px; }

.users-page .table-actions { display: flex; gap: 6px; }

.users-page .sort-status { display: flex; align-items: center; font-size: 14px; color: var(--tx2); }

.users-page .account-open-cost-tip { margin-top: 6px; font-size: 12px; line-height: 18px; color: var(--tx2); }

.users-page .table-section { flex: 1 1 0%; display: flex; flex-direction: column; overflow: hidden; margin-bottom: 80px; margin-top: 0px; padding: 0px; }

.users-page .table-container { flex: 1 1 0%; background-color: var(--elev); border-radius: 0px; border-width: medium; border-style: none; border-color: currentcolor; border-image: initial; box-shadow: none; overflow: auto; display: flex; flex-direction: column; margin: 0px; padding: 0px; }

.users-page .unified-table { display: grid; grid-template-columns: 80px 140px 110px 90px 120px 120px 100px 90px 120px 120px 140px 180px; border-collapse: collapse; border: 1px solid var(--bd); margin: 0px; padding: 0px; min-height: min-content; }

.users-page .unified-table.agent-users-table { grid-template-columns: 100px 140px 110px 110px 100px 100px 90px minmax(200px, 1fr); width: 100%; }

.users-page .table-row { display: contents; }

.users-page #users-table-body { display: contents; }

.users-page .table-header-row .table-cell { background-color: var(--bg); font-weight: 600; color: var(--tx); border-top: 1px solid var(--bd); }

.users-page .data-row .table-cell { background-color: var(--elev); }

.users-page .data-row:hover .table-cell { background-color: var(--soft); }

.users-page .table-cell { padding: 2px 6px; border-right: 1px solid var(--bd); border-bottom: 1px solid var(--bd); display: flex; align-items: center; min-height: 34px; max-height: 34px; height: 34px; box-sizing: border-box; font-size: 13px; color: var(--tx); line-height: 1; margin: 0px; overflow: hidden; }

.users-page .table-cell:first-child { border-left: 1px solid var(--bd); }

.users-page .table-cell:last-child { border-right: 1px solid var(--bd); }

.users-page .data-row:last-child .table-cell { border-bottom: 1px solid var(--bd); }

.users-page .empty-row .table-cell { grid-column: 1 / -1; justify-content: center; min-height: 80px; border-bottom: 1px solid var(--bd); }

.users-page .header-cell { cursor: default; user-select: none; transition: background-color 0.2s; }

.users-page .header-cell:hover { background-color: var(--soft) !important; }

.users-page .col-id .cell-wrapper, .users-page .col-parent-id .cell-wrapper, .users-page .col-status .cell-wrapper, .users-page .col-steam-id .cell-wrapper { justify-content: center; }

.users-page .col-username .cell-wrapper, .users-page .col-account-type .cell-wrapper, .users-page .col-balance .cell-wrapper, .users-page .col-pregenerate-quota .cell-wrapper, .users-page .col-refund-count .cell-wrapper, .users-page .col-last-login-time .cell-wrapper, .users-page .col-last-login-ip .cell-wrapper, .users-page .col-actions .cell-wrapper { justify-content: flex-start; }

.users-page .cell-wrapper { display: flex; align-items: center; width: 100%; gap: 4px; height: 100%; }

.users-page .cell-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1; font-size: 13px; }

/* ═══════════ 下级管理：工具栏 + 树形表格，对齐 sa3 #/users 的版式 ═══════════ */
.users-page .sub-toolbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin: 0 0 14px; }
.users-page .sub-toolbar .sub-sp { flex: 1 1 auto; }
.users-page .sub-inp { display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 11px; border: 1px solid var(--bd); border-radius: 10px; background: var(--elev); transition: border-color .15s, box-shadow .15s; }
.users-page .sub-inp:focus-within { border-color: var(--info2); box-shadow: 0 0 0 3px rgba(64, 158, 255, .18); }
.users-page .sub-inp .ico { width: 15px; height: 15px; flex: none; color: var(--tx3); }
.users-page .sub-inp input { flex: 1 1 auto; min-width: 0; border: 0; outline: none; background: none; font: inherit; font-size: 13px; color: var(--tx); }
.users-page .unified-table.agent-users-table { grid-template-columns: 34px 60px 150px 170px 120px 100px 140px 160px 80px minmax(300px, 1fr); }
.users-page .agent-users-table .table-cell { height: 48px; min-height: 48px; max-height: 48px; font-size: 15px; }
.users-page .agent-users-table .cell-wrapper { justify-content: center; }
.users-page .agent-users-table .cell-text { font-size: 15px; }
/* 除「代理」左对齐外，其余列一律居中；数字与时间用等宽，整列同字号 */
.users-page .agent-users-table .col-username .cell-wrapper { justify-content: flex-start; }
.users-page .mono { font-family: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", monospace; font-variant-numeric: tabular-nums; }
.users-page .strong { font-weight: 650; }
.users-page .mut { color: var(--tx3); }
.users-page .tree-ic { width: 15px; height: 15px; flex: none; color: var(--tx3); cursor: pointer; transition: transform .15s; transform: rotate(-90deg); }
.users-page .tree-row.open .tree-ic { transform: rotate(0deg); }
/* 列宽按 sa3 定死，容器不够宽时横向滚动，而不是把操作列挤出可视区 */
.users-page .table-container { overflow-x: auto; }
.users-page .unified-table.agent-users-table { min-width: 1314px; }

.users-page .sort-indicators { display: flex; flex-direction: column; align-items: center; gap: 0px; width: 12px; height: 16px; flex-shrink: 0; padding: 0px; border-radius: 1px; transition: background-color 0.2s; }

.users-page .header-cell:hover .sort-indicators { background-color: rgba(64, 158, 255, .1); }

.users-page .sort-placeholder { width: 12px; height: 16px; flex-shrink: 0; }

.users-page .sort-arrow { font-size: 7px; color: var(--tx3); transition: 0.2s; cursor: default; line-height: 1; height: 7px; display: flex; align-items: center; justify-content: center; }

.users-page .sort-arrow.active { color: var(--info2); font-weight: 700; text-shadow: 0 0 1px #409eff; }

.users-page .sort-arrow:hover { color: var(--info2); }

.users-page .header-cell:hover .sort-arrow { color: var(--tx2); }

.users-page .header-cell:hover .sort-arrow.active { color: var(--info2); }

.users-page .pagination-footer-fixed { position: fixed; left: 0 !important; right: 0 !important; bottom: 0; z-index: 1000; padding: 15px 20px; background-color: var(--elev); box-shadow: 0 -2px 8px rgba(0, 0, 0, .1); border: 0; border-radius: 0; display: flex; justify-content: center; align-items: center; }

.users-page .desktop-table { display: grid; }

.users-page .mobile-card-list { display: none; }

.users-page .desktop-actions { display: flex; align-items: center; }

.users-page .mobile-actions { display: none; }

.users-page .mobile-actions-content { padding: 20px 0px; }

.users-page .mobile-actions-content .user-info { text-align: center; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid var(--bd); }

.users-page .mobile-actions-content .user-info h4 { margin: 0px 0px 8px; color: var(--tx); font-size: 18px; }

.users-page .mobile-actions-content .action-buttons { display: flex; flex-direction: column; gap: 12px; }

.users-page .mobile-actions-content .action-buttons .el-button { height: 48px; font-size: 16px; justify-content: flex-start; padding-left: 20px; }

.users-page .mobile-actions-content .action-buttons .el-button .el-icon { margin-right: 8px; }

.users-page .user-card { background-color: var(--elev); border: 1px solid var(--bd); border-radius: 8px; padding: 12px; box-shadow: rgba(0, 0, 0, 0.1) 0px 2px 4px; }

.users-page .card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--bd); }

.users-page .user-basic-info { display: flex; align-items: center; gap: 8px; }

.users-page .username { font-weight: 600; font-size: 16px; color: var(--tx); }

.users-page .card-content { margin-bottom: 12px; }

.users-page .info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.users-page .info-item { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }

.users-page .info-item .label { color: var(--tx2); font-weight: 500; }

.users-page .info-item .value { color: var(--tx); font-weight: 600; }

.users-page .info-item .value.balance { font-weight: 700; }

.users-page .card-actions { display: flex; gap: 8px; justify-content: flex-end; }

.users-page .card-actions .el-button { flex: 1 1 0%; }

.users-page .empty-state { padding: 40px 20px; text-align: center; }

.users-page .recharge-target-info { background-color: var(--bg); border: 1px solid var(--bd); border-radius: 8px; padding: 16px; margin-bottom: 16px; }

.users-page .target-header h4 { margin: 0px 0px 12px; color: var(--tx); font-size: 16px; font-weight: 600; }

.users-page .target-details { display: flex; flex-direction: column; gap: 8px; }

.users-page .detail-row { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }

.users-page .detail-row .label { color: var(--tx2); font-weight: 500; min-width: 80px; }

.users-page .detail-row .value { color: var(--tx); font-weight: 600; }

.users-page .detail-row .balance-amount { font-weight: 700; font-size: 16px; }

.users-page .recharge-preview { background-color: rgba(var(--success-rgb),.1); border: 1px solid rgba(var(--success-rgb),.3); border-radius: 6px; padding: 12px; margin-top: 16px; }

.users-page .preview-item { display: flex; justify-content: space-between; align-items: center; font-size: 15px; }

.users-page .preview-label { color: var(--tx2); font-weight: 500; }

.users-page .preview-value.success { color: var(--success-color); font-weight: 700; font-size: 16px; }

.users-page .dialog-footer { display: flex; justify-content: flex-end; gap: 12px; }

@media (max-width: 768px) {
  .users-container { padding: 15px; left: 0px !important; }

.users-page .pagination-footer-fixed { bottom: 0; padding: 10px 14px; right: 0 !important; left: 0 !important; }

.users-page .page-header h1 { font-size: 20px; }

.users-page .desktop-table { display: none; }

.users-page .mobile-card-list { display: flex; flex-direction: column; gap: 12px; padding: 0px; }

.users-page .desktop-actions { display: none; }

.users-page .mobile-actions { display: flex; justify-content: center; align-items: center; }

.users-page .search-section .el-form { flex-direction: column; gap: 8px; }

.users-page .search-section .el-form-item { margin-bottom: 8px; margin-right: 0px; }

.users-page .search-section .el-input, .users-page .search-section .el-select { width: 100% !important; }

.users-page .table-actions { flex-direction: column; gap: 8px; }

.users-page .table-actions .el-button { width: 100%; }

.users-page .recharge-target-info { padding: 12px; margin-bottom: 12px; }

.users-page .target-details { gap: 6px; }

.users-page .detail-row { font-size: 13px; }

.users-page .detail-row .label { min-width: 70px; }

.users-page .recharge-preview { padding: 10px; margin-top: 12px; }

.users-page .preview-item { font-size: 14px; }

.users-page .dialog-footer { flex-direction: column; gap: 8px; }

.users-page .dialog-footer .el-button { width: 100%; }

.users-page .table-actions-section { padding: 8px 0px; }

.users-page .unified-table { grid-template-columns: 60px 110px 90px 70px 100px 100px 80px 70px 100px 100px 110px 140px; }

.users-page .unified-table.agent-users-table { grid-template-columns: 28px 48px 100px 120px 90px 80px 90px 120px 64px minmax(160px, 1fr); min-width: 890px; }

.users-page .table-cell { padding: 2px 4px; font-size: 12px; min-height: 32px; max-height: 32px; height: 32px; }

.users-page .cell-text { font-size: 12px; }

}

.users-page .table-container::-webkit-scrollbar { width: 6px; height: 6px; }
.users-page .table-container::-webkit-scrollbar-track { background: var(--soft); }
.users-page .table-container::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; transition: background 0.3s; }
.users-page .table-container::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }
.users-page .table-container::-webkit-scrollbar-corner { background: transparent; }

.users-page .pagination-footer-fixed .el-pagination { display: flex; align-items: center; justify-content: center; }

.users-page .pagination-footer-fixed .el-pagination__sizes { display: flex; align-items: center; }

.users-page .pagination-footer-fixed .el-select .el-input .el-input__inner { text-align: center; }

.users-page .pagination-footer-fixed .el-pagination__sizes .el-select { margin: 0px 8px; }

.users-page .pagination-footer-fixed .el-pagination__total { font-weight: 500; }

.users-page .pagination-footer-fixed .el-pagination__jump { display: flex; align-items: center; margin-left: 16px; }

.users-page .pagination-footer-fixed .el-pagination__jump .el-input { width: 50px; margin: 0px 8px; }

.main:has(.users-page) { padding: 0; overflow: hidden; min-height: calc(100vh - 64px); }
.users-container { left: var(--sidebar-w); }
body.is-folded .users-container { left: 64px; }
.users-page .filter-form { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.users-page .filter-form .filter-item { margin-bottom: 0; height: 32px; }
.users-page .filter-form .input,
.users-page .filter-form .btn {
  height: 32px;
  box-sizing: border-box;
  margin: 0;
  vertical-align: middle;
}
.users-page .search-card .block-bd { padding: 16px 20px; }
.users-page .pagination-footer-fixed .pager { position: static; right: auto; bottom: auto; margin: 0; border: 0; box-shadow: none; padding: 0; background: transparent; }
.users-page .money-red { color: var(--bad2); }
.users-page .money-green { color: var(--ok2); }
.users-page .money-blue { color: var(--info2); }
.users-page .money-orange { color: var(--warn2); }
.users-page .page-header { margin-bottom: 8px; }
.users-page .page-header h1 { margin: 0; font-size: 22px; font-weight: 400; }

/* ===== cdkeys page ===== */
.main:has(.cdkeys-page) { padding: 0; }
.cdkeys-page { padding: 20px; min-height: 100vh; max-width: 100%; overflow-x: hidden; display: flex; flex-direction: column; }
.cdkeys-container { flex: 1 1 0%; display: flex; flex-direction: column; min-height: 0; background: transparent; padding-bottom: 80px; }
.cdkeys-page .page-header { margin-bottom: 20px; }
.cdkeys-page .page-header h1 { margin: 0; color: var(--tx); font-size: 24px; font-weight: 600; }
.cdkeys-page .stats-section { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 20px; }
.cdkeys-page .stat-card { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; border-radius: 12px; padding: 24px; text-align: center; cursor: default; transition: .3s; box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.cdkeys-page .stat-card:hover { transform: translateY(-4px); box-shadow: 0 8px 25px rgba(0,0,0,.15); }
.cdkeys-page .stat-card:nth-child(2) { background: linear-gradient(135deg, #f093fb, #f5576c); }
.cdkeys-page .stat-card:nth-child(3) { background: linear-gradient(135deg, #4facfe, #00f2fe); }
.cdkeys-page .stat-number { font-size: 36px; font-weight: 700; margin-bottom: 8px; text-shadow: 0 2px 4px rgba(0,0,0,.1); }
.cdkeys-page .stat-label { font-size: 14px; opacity: .9; }
.cdkeys-page .search-section { display: flex; gap: 15px; margin-bottom: 20px; align-items: center; flex-wrap: wrap; }
.cdkeys-page .advanced-toggle {
  color: var(--tx3);
  height: 32px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  cursor: pointer;
  box-sizing: border-box;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.cdkeys-page .advanced-toggle .ico { width: 14px; height: 14px; }
.cdkeys-page .advanced-toggle.is-open { color: var(--info2); }
.cdkeys-page .advanced-toggle:hover {
  color: var(--info2);
  border-color: var(--info2);
  background: var(--elev);
}
.cdkeys-page .ck-ops-wrap {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin-bottom: 0;
  transition: max-height .35s ease, opacity .28s ease, margin-bottom .35s ease;
}
.cdkeys-page .ck-ops-wrap.is-open {
  max-height: 120px;
  opacity: 1;
  margin-bottom: 16px;
}
.cdkeys-page .ck-ops-overview {
  display: flex !important;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 48px;
  padding: 14px 18px;
  background: var(--soft);
  border: 1px solid var(--bd);
  border-radius: 8px;
  box-sizing: border-box;
  width: 100%;
}
.cdkeys-page .ck-ops-periods {
  position: relative;
  display: inline-flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0;
  background: var(--elev);
  border: 1px solid var(--bd);
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
}
.cdkeys-page .ck-ops-pill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0;
  background: var(--info);
  border-radius: 3px;
  transition: transform .28s cubic-bezier(.4,0,.2,1), width .28s cubic-bezier(.4,0,.2,1);
  z-index: 0;
  pointer-events: none;
}
.cdkeys-page .ck-ops-period {
  position: relative;
  z-index: 1;
  border: 0;
  background: transparent !important;
  color: var(--tx2);
  height: 32px;
  padding: 0 14px;
  font-size: 13px;
  cursor: pointer;
  line-height: 32px;
  white-space: nowrap;
  transition: color .2s ease;
}
.cdkeys-page .ck-ops-period + .ck-ops-period { border-left: 1px solid transparent; }
.cdkeys-page .ck-ops-period:hover { color: var(--info2); }
.cdkeys-page .ck-ops-period.is-active { color: #fff; }
.cdkeys-page .ck-ops-period.is-active:hover { color: #fff; }
.cdkeys-page .ck-ops-head {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 280px;
}
.cdkeys-page .ck-ops-title {
  font-size: 16px;
  font-weight: 400;
  color: var(--tx);
  line-height: 1.35;
}
.cdkeys-page .ck-ops-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--tx3);
  line-height: 1.4;
}
.cdkeys-page .ck-ops-cards {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap;
  align-items: center;
  gap: 16px;
  margin-left: 0;
  flex-shrink: 0;
}
.cdkeys-page .ck-ops-card {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 10px;
  min-width: 200px;
  width: 200px;
  padding: 12px 22px;
  background: var(--elev);
  border: 1px solid var(--bd);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  box-sizing: border-box;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.cdkeys-page .ck-ops-card:hover {
  border-color: var(--info2);
  box-shadow: 0 2px 8px rgba(64,158,255,.18);
  transform: translateY(-1px);
}
.cdkeys-page .ck-ops-ico {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--info2);
  background: var(--info-soft);
  flex-shrink: 0;
}
.cdkeys-page .ck-ops-ico .ico { width: 14px; height: 14px; }
.cdkeys-page .ck-ops-label { color: var(--tx3); font-size: 13px; white-space: nowrap; }
.cdkeys-page .ck-ops-num { color: var(--tx); font-size: 20px; font-weight: 700; margin-left: 8px; }
.cdkeys-page .search-input-group {
    display: flex;
    gap: 0;
    align-items: center;
    background: var(--elev);
    border: 1px solid var(--bd);
    border-radius: 6px;
    padding: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
    height: 42px;
    box-sizing: border-box;
}
.cdkeys-page .el-select {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 32px;
    width: 120px;
    vertical-align: middle;
}
.cdkeys-page .el-select__wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 32px;
    padding: 0 8px 0 12px;
    margin: 0;
    border: 0;
    border-radius: 4px;
    background: var(--elev);
    color: var(--tx);
    font-size: 14px;
    line-height: 32px;
    cursor: pointer;
    outline: none;
    box-shadow: 0 0 0 1px var(--bd) inset;
    box-sizing: border-box;
    text-align: left;
    font-family: inherit;
}
.cdkeys-page .el-select__wrapper:hover { box-shadow: 0 0 0 1px var(--tx3) inset; }
.cdkeys-page .el-select.is-focused .el-select__wrapper,
.cdkeys-page .el-select.is-open .el-select__wrapper {
    box-shadow: 0 0 0 1px var(--primary) inset;
}
.cdkeys-page .el-select__selected-item {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--tx);
}
.cdkeys-page .el-select__placeholder {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--tx3);
}
.cdkeys-page .el-select-caret {
    flex: 0 0 auto;
    margin-left: 6px;
    color: var(--tx3);
    display: inline-flex;
    transition: transform .2s;
}
.cdkeys-page .el-select.is-open .el-select-caret { transform: rotate(180deg); }
.cdkeys-page .el-select-caret .ico { width: 12px; height: 12px; }
.cdkeys-page .search-type-select {
    width: 120px;
    flex: 0 0 120px;
}
.cdkeys-page .search-type-select .el-select__wrapper {
    background: var(--elev);
    box-shadow: 0 0 0 1px var(--bd) inset;
    border-radius: 4px;
}
.cdkeys-page .search-type-select .el-select__wrapper:hover {
    box-shadow: 0 0 0 1px var(--tx3) inset;
}
.cdkeys-page .search-type-select.is-focused .el-select__wrapper,
.cdkeys-page .search-type-select.is-open .el-select__wrapper {
    box-shadow: 0 0 0 1px var(--primary) inset;
    background: var(--elev);
}
.cdkeys-page .status-select { width: 120px; }
.cdkeys-page .el-select-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    z-index: 2000;
    min-width: 100%;
    padding: 6px 0;
    background: var(--elev);
    border: 1px solid var(--bd);
    border-radius: 4px;
    box-shadow: 0 0 12px rgba(0, 0, 0, .12);
    box-sizing: border-box;
}
.cdkeys-page .el-select-dropdown[hidden] { display: none !important; }
.cdkeys-page .el-popper__arrow {
    position: absolute;
    top: -5px;
    left: 50%;
    width: 10px;
    height: 10px;
    margin-left: -5px;
    z-index: 1;
}
.cdkeys-page .el-popper__arrow::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--elev);
    border: 1px solid var(--bd);
    border-bottom-color: transparent;
    border-right-color: transparent;
    transform: rotate(45deg);
}
.cdkeys-page .el-select-dropdown__list {
    margin: 0;
    padding: 0;
    list-style: none;
}
.cdkeys-page .el-select-dropdown__item {
    height: 34px;
    line-height: 34px;
    padding: 0 32px 0 20px;
    font-size: 14px;
    color: var(--tx2);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}
.cdkeys-page .el-select-dropdown__item:hover,
.cdkeys-page .el-select-dropdown__item.is-hovering {
    background: var(--soft);
}
.cdkeys-page .el-select-dropdown__item.is-selected {
    color: var(--info2);
    font-weight: 400;
}
.cdkeys-page .search-input-wrap {
    display: flex;
    align-items: center;
    border-left: 1px solid var(--bd);
    padding-left: 8px;
    height: 32px;
    flex: 1;
}
.cdkeys-page .search-prefix { color: var(--tx3); display: inline-flex; margin-right: 6px; }
.cdkeys-page .search-prefix .ico { width: 14px; height: 14px; }
.cdkeys-page .search-input-wrap .search-input {
    border: 0;
    box-shadow: none;
    background: transparent;
    height: 32px;
    padding-left: 0;
    outline: none;
}
.cdkeys-page .search-actions { display: flex; gap: 8px; margin-left: auto; }
.cdkeys-page .search-actions .btn {
    height: 32px;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
}
.cdkeys-page .search-actions .btn .ico { width: 14px; height: 14px; color: inherit; }
.cdkeys-page .search-actions .btn-success {
    background: #67c23a;
    border-color: #67c23a;
    color: #fff;
}
.cdkeys-page .search-actions .btn-success:hover {
    background: #85ce61;
    border-color: #85ce61;
    color: #fff;
}
.cdkeys-page .search-actions .btn-danger,
.cdkeys-page .search-actions .btn-batch-recycle {
    background: #f56c6c;
    border-color: var(--bad2);
    color: #fff;
}
.cdkeys-page .search-actions .btn-danger:hover,
.cdkeys-page .search-actions .btn-batch-recycle:hover {
    background: #f78989;
    border-color: #f78989;
    color: #fff;
}
.batch-recycle-content { padding: 0 4px; }
.batch-recycle-content .el-alert {
    margin-bottom: 16px;
    padding: 8px 16px;
    border-radius: 4px;
    background: var(--warn-soft);
    color: var(--warn2);
}
.batch-recycle-content .el-alert__title {
    display: block;
    font-size: 16px;
    line-height: 24px;
    font-weight: 400;
    color: var(--warn2);
    margin-bottom: 4px;
}
.batch-recycle-content .el-alert__description {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--warn2);
}
.batch-recycle-content .el-alert__description p {
    margin: 0;
}
.batch-recycle-field {
    align-items: flex-start;
    margin: 0;
}
.batch-recycle-field .field-label {
    line-height: 32px;
    color: var(--tx2);
    padding-right: 12px;
}
.batch-recycle-field .field-content { flex: 1; min-width: 0; }
.batch-recycle-content .el-textarea__inner {
    display: block;
    width: 100%;
    min-height: 220px;
    padding: 5px 11px;
    border: 1px solid var(--bd);
    border-radius: 4px;
    background: var(--elev);
    color: var(--tx2);
    font-size: 14px;
    line-height: 1.5;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
    outline: none;
}
.batch-recycle-content .el-textarea__inner:hover { border-color: var(--tx3); }
.batch-recycle-content .el-textarea__inner:focus { border-color: var(--info2); }
.dialog-batch .dialog-footer { gap: 12px; }
.dialog-batch #batch-recycle-confirm:disabled,
.dialog-batch #batch-recycle-confirm.is-disabled {
    background: #f56c6c;
    border-color: var(--bad2);
    color: #fff;
    opacity: .5;
    cursor: not-allowed;
}
.cdkeys-page .search-section > .btn-primary {
    height: 32px;
    padding: 8px 15px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.cdkeys-page .search-section > .btn-primary .ico { width: 14px; height: 14px; }
.cdkeys-page .table-section { flex: 1 1 0%; min-height: 400px; background: var(--elev); border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.1); overflow: hidden; display: flex; flex-direction: column; }
.cdkeys-page .table-wrap { overflow: auto; flex: 1; }
.cdkeys-page .cdkeys-table { width: 100%; border-collapse: collapse; border: 1px solid var(--bd); }
.cdkeys-page .cdkeys-table th {
    background: var(--bg);
    color: var(--tx2);
    font-weight: 600;
    border-bottom: 1px solid var(--bd);
    border-right: 1px solid var(--bd);
    padding: 12px 8px;
    font-size: 13px;
    white-space: nowrap;
}
.cdkeys-page .cdkeys-table th:last-child { border-right: 0; }
.cdkeys-page .cdkeys-table td {
    padding: 12px 8px;
    border-bottom: 1px solid var(--bd);
    border-right: 1px solid var(--bd);
    font-size: 13px;
    color: var(--tx);
    vertical-align: middle;
}
.cdkeys-page .cdkeys-table td:last-child { border-right: 0; }
.cdkeys-page .cdkeys-table tbody tr:nth-child(even) { background-color: var(--soft); }
.cdkeys-page .cdkeys-table tbody tr:hover { background-color: var(--bg); }
.cdkeys-page .price-text { font-weight: 600; color: var(--warn2); font-size: 14px; }
.cdkeys-page .cdkey-container { display: flex; align-items: center; gap: 8px; justify-content: flex-start; min-width: 0; width: 100%; }
.cdkeys-page .cdkey-code {
    font-family: "Courier New", Consolas, monospace;
    background: var(--bg);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 400;
    color: var(--tx2);
    border: 1px solid var(--bd);
    display: inline-block;
    flex: 0 1 auto;
    width: fit-content;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cdkeys-page .copy-btn,
.cdkeys-page .generate-btn {
    opacity: 0;
    transition: opacity .2s;
    margin-left: 0;
    padding: 0 4px;
    height: 24px;
    background: transparent;
    border: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    position: relative;
}
.cdkeys-page .copy-btn { color: var(--info2); }
.cdkeys-page .generate-btn { color: var(--ok2); }
.cdkeys-page .cdkey-container:hover .copy-btn,
.cdkeys-page .cdkey-container:hover .generate-btn { opacity: 1; }
.cdkeys-page .copy-btn .ico,
.cdkeys-page .generate-btn .ico { width: 14px; height: 14px; }
.cdkeys-page .has-tip::after {
    content: attr(data-tip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 6px);
    top: auto;
    transform: translateX(-50%);
    background: #303133;
    color: #fff;
    border: 1px solid #303133;
    font-size: 12px;
    line-height: 20px;
    padding: 5px 11px;
    border-radius: 4px;
    white-space: nowrap;
    box-shadow: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .12s ease;
    z-index: 50;
}
.cdkeys-page .has-tip::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: calc(100% - 2px);
    top: auto;
    width: 8px;
    height: 8px;
    border: 0;
    background: #303133;
    transform: translateX(-50%) rotate(45deg);
    opacity: 0;
    visibility: hidden;
    transition: opacity .12s ease;
    z-index: 49;
}
.cdkeys-page .has-tip:hover::after,
.cdkeys-page .has-tip:hover::before,
.cdkeys-page .has-tip:focus::after,
.cdkeys-page .has-tip:focus::before,
.cdkeys-page .has-tip.is-tip-copied::after,
.cdkeys-page .has-tip.is-tip-copied::before {
    opacity: 1;
    visibility: visible;
}
.cdkeys-page .has-tip.is-tip-copied::after { content: "复制成功"; }
.el-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    max-width: 340px;
    padding: 12px 16px;
    background: var(--elev);
    border: 1px solid var(--bd);
    border-radius: 12px;
    box-shadow: var(--sh3);
    pointer-events: none;
    animation: sa3pop .18s;
}
.el-message .ico { width: 17px; height: 17px; margin-top: 1px; flex: none; }
.el-message b { font-weight: 650; font-size: 13px; color: var(--tx); line-height: 1.5; }
.el-message.is-success .ico { color: var(--ok); }
.el-message.is-error .ico { color: var(--bad); }
.el-message.is-warning .ico { color: var(--warn); }
.el-message.is-leaving { opacity: 0; transition: opacity .2s ease; }
.cdkeys-page .game-id { font-size: 14px; color: var(--tx); font-weight: 500; font-family: Monaco, Consolas, monospace; }
.cdkeys-page .user-info { color: var(--tx2); font-size: 14px; }
.cdkeys-page .steam-id {
    font-family: "Courier New", monospace;
    font-size: 13px;
    color: var(--tx3);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
}
.cdkeys-page .time-text { color: var(--tx2); white-space: nowrap; }
.cdkeys-page .tag {
    border-radius: 12px;
    padding: 0 8px;
    font-size: 12px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    height: 22px;
    line-height: 1;
    border: 1px solid;
    box-sizing: border-box;
}
.cdkeys-page .tag-primary { color: var(--info2); background: var(--info-soft); border-color: var(--bd); }
.cdkeys-page .tag-ck-success { background: var(--ok-soft); color: #10b981; border-color: #10b981; }
.cdkeys-page .tag-ck-warning { background: var(--warn-soft); color: #f59e0b; border-color: #f59e0b; }
.cdkeys-page .tag-ck-void {
  background: var(--elev);
  color: var(--warn2);
  border: 1px solid #e6a23c;
}
.cdkeys-page .btn-recycle { min-width: 50px; height: 26px; font-size: 12px; padding: 4px 8px; }
.cdkeys-page .notes-container { width: 100%; min-height: 40px; display: flex; align-items: center; justify-content: center; }
.cdkeys-page .notes-display {
    width: 100%;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: default;
    padding: 4px 8px;
    border-radius: 4px;
    transition: .2s;
}
.cdkeys-page .notes-display:hover { background-color: var(--soft); }
.cdkeys-page .notes-text {
    flex: 1 1 0%;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--tx3);
    font-size: 13px;
    font-style: italic;
    text-align: center;
}
.cdkeys-page .edit-icon { color: var(--tx3); opacity: 0; transition: opacity .2s; display: inline-flex; }
.cdkeys-page .edit-icon .ico { width: 12px; height: 12px; }
.cdkeys-page .notes-display:hover .edit-icon { opacity: 1; }
.cdkeys-page .data th.is-center, .cdkeys-page .data td.is-center { text-align: center; }
.cdkeys-page .pagination-footer-fixed,
.auto-auth-page .pagination-footer-fixed,
.games-container .pagination-footer-fixed {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px 20px;
    background: var(--elev);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, .1);
}
.cdkeys-page .pagination-footer-fixed .pager,
.auto-auth-page .pagination-footer-fixed .pager,
.games-container .pagination-footer-fixed .pager {
    position: static;
    right: auto;
    bottom: auto;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}
.cdkeys-page.cdkeys-page,
.auto-auth-page { padding-bottom: 80px; }

/* ===== games page ===== */
.main:has(.games-container) { padding: 0; }
.games-container { padding: 20px 20px 80px; min-height: calc(100vh - 120px); position: relative; }
.games-container .games-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.games-container .games-title { margin: 0; font-size: 20px; font-weight: 600; color: var(--tx); }
.games-container .games-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 16px; }
.games-container .games-search { display: flex; align-items: stretch; flex: 0 1 360px; min-width: 220px; }
.games-container .games-search .input { flex: 1 1 auto; min-width: 0; height: 34px; border: 1px solid var(--line-2); border-right: 0; border-radius: 6px 0 0 6px; }
.games-container .games-search:focus-within .input { border-color: var(--primary); }
.games-container .games-go { flex: none; width: 44px; display: inline-flex; align-items: center; justify-content: center; background: var(--primary); border: 1px solid var(--primary); border-radius: 0 6px 6px 0; color: #fff; cursor: pointer; }
.games-container .games-go:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.games-container .games-go .ico { width: 15px; height: 15px; }
.games-container .games-go.is-loading { pointer-events: none; }
.games-container .games-go.is-loading > .ico { display: none; }
.games-container .games-go .btn-loading-icon { display: inline-flex; width: 15px; height: 15px; }
.games-container .games-go .btn-loading-icon .circular { width: 15px; height: 15px; animation: ck-loading-rotate 2s linear infinite; }
.games-container .games-go .btn-loading-icon .path { stroke: #fff; stroke-width: 3px; stroke-linecap: round; fill: none; stroke-dasharray: 90, 150; animation: ck-loading-dash 1.5s ease-in-out infinite; }
.games-container tr.is-focused td { background: var(--info-soft); }
.games-container .games-table-wrap { background: var(--elev); border: 1px solid var(--bd); border-radius: 14px; }
.games-container table.games-table { border: 0; }
.games-container .games-table thead th { font-size: 15px; color: var(--tx3); background: var(--soft); text-align: center; padding: 13px 10px; border-bottom: 1px solid var(--bd); white-space: nowrap; }
.games-container .games-table tbody td { font-size: 15px; color: var(--tx); text-align: center; padding: 12px 10px; vertical-align: middle; }
.games-container .games-table th.col-cover, .games-container .games-table td.col-cover { width: 150px; }
.games-container .games-table th.col-name, .games-container .games-table td.col-name { width: 300px; min-width: 240px; text-align: left; }
.games-container .games-table th.col-appid, .games-container .games-table td.col-appid { width: 150px; }
.games-container .games-table th.col-drm, .games-container .games-table td.col-drm { width: 80px; }
.games-container .games-table th.col-time, .games-container .games-table td.col-time { width: 150px; }
.games-container .games-table th.col-act, .games-container .games-table td.col-act { width: 220px; white-space: nowrap; }
.games-container .games-table .g-cover { display: block; width: 96px; height: 45px; margin: 0 auto; object-fit: cover; border-radius: 4px; background: var(--soft); }
.games-container .games-table .g-zh { font-weight: 600; line-height: 1.35; }
.games-container .games-table .g-en { color: var(--tx3); font-size: 15px; font-weight: 400; line-height: 1.35; }
.games-container .games-table .g-id { font-family: Consolas, Menlo, monospace; font-variant-numeric: tabular-nums; }
.games-container .games-table .g-copy { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin-left: 6px; padding: 0; background: none; border: 0; border-radius: 4px; color: var(--tx3); cursor: pointer; vertical-align: middle; }
.games-container .games-table .g-copy:hover { background: var(--info-soft); color: var(--primary); }
.games-container .games-table .g-copy .ico { width: 14px; height: 14px; }
.games-container .games-table .g-drm { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 99px; font-size: 15px; font-weight: 600; color: var(--ok2); background: var(--ok-soft); }
.games-container .games-table .g-drm.is-yes { color: var(--bad2); background: var(--bad-soft); }
.advanced.is-hidden { display: none !important; }
.games-container .games-grid { min-height: 400px; }
.games-container .action-btn { flex: 1 1 0%; min-width: 0; font-size: 12px !important; padding: 4px 8px !important; height: 26px !important; line-height: 18px !important; min-height: 26px !important; border-radius: 6px !important; font-weight: 500; }
.games-container .pager { margin-top: 16px; }

/* ===== auto-auth page ===== */
.auto-auth-card {
    background: var(--elev);
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}
.auto-auth-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    padding: 8px 10px;
    background: var(--soft);
    border: 1px solid var(--bd);
}
.auto-auth-toolbar-left,
.auto-auth-toolbar-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.auto-auth-toolbar-left > span { color: var(--tx2); font-size: 14px; white-space: nowrap; }
.auto-auth-table-wrap { overflow: auto; max-height: calc(100vh - 220px); }
.auto-auth-table { width: 100%; border-collapse: collapse; }
.auto-auth-table th {
    background: var(--soft) !important;
    color: var(--tx);
    font-weight: 600;
    white-space: nowrap;
}
.auto-auth-table td { white-space: nowrap; }
.auto-auth-table tbody tr.row-selected td { background: var(--soft2); }
.auto-auth-table tbody tr.row-selected:hover td { background: var(--bd); }
.auto-auth-page .data th.is-center, .auto-auth-page .data td.is-center { text-align: center; }

.check-inline { display: inline-flex; align-items: center; gap: 6px; color: var(--tx2); font-size: 14px; }
/* ===== settings home template ===== */
.settings-home-page { padding: 0; }
.settings-home-page .page-title {
    margin: 0 0 14px;
    font-size: 28px;
    font-weight: 800;
    color: var(--tx);
}
.settings-home-card {
    background: var(--elev);
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
    margin-bottom: 14px;
}
.settings-home-card > h3 {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--tx);
}
.home-edit-welcome { margin: 12px 0 56px; }
.home-edit-boards {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 22px;
    margin-bottom: 16px;
}
.home-edit-col { min-width: 0; }
.home-edit-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
}
.home-edit-head .input { flex: 0 0 50%; width: 50%; max-width: 50%; }
.rich-editor {
    width: 100%;
    border: 1px solid var(--bd);
    border-radius: 4px;
    background: var(--elev);
    overflow: hidden;
}
.rich-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    padding: 4px 6px;
    background: var(--soft);
    border-bottom: 1px solid var(--bd);
}
.rich-tb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 4px;
    font-size: 12px;
    color: var(--tx2);
    border-radius: 2px;
    cursor: default;
    user-select: none;
}
.rich-body {
    padding: 8px 10px;
    min-height: 70px;
    color: var(--tx2);
    font-size: 14px;
    line-height: 1.6;
    outline: none;
}
.rich-body-lg { min-height: 260px; }
.rich-upload { margin-top: 8px; }
.btn-outline-primary {
    background: var(--elev);
    border: 1px solid var(--info2);
    color: var(--info2);
    height: 32px;
    padding: 0 15px;
}
.btn-outline-primary:hover {
    background: var(--info-soft);
    border-color: var(--info2);
    color: var(--info2);
}
.el-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 20px;
    cursor: pointer;
}
.el-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.el-switch__core {
    width: 40px;
    height: 20px;
    border-radius: 10px;
    background: var(--bd);
    border: 1px solid var(--bd);
    position: relative;
    transition: .2s;
    box-sizing: border-box;
}
.el-switch__core::after {
    content: "";
    position: absolute;
    top: 1px;
    left: 1px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--elev);
    transition: .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.el-switch.is-checked .el-switch__core {
    background: var(--info);
    border-color: var(--info2);
}
.el-switch.is-checked .el-switch__core::after { left: 21px; }
@media (max-width: 900px) {
    .home-edit-boards { grid-template-columns: 1fr; }
}

/* agent logic UI */
.login-error {
  color: var(--bad2);
  font-size: 13px;
  margin: 0 0 10px;
  text-align: left;
}
.recharge-blocked {
  color: var(--bad2);
  font-size: 13px;
  margin: 8px 0 0;
}
.agent-users-table .table-empty {
  padding: 28px;
  text-align: center;
  color: var(--tx3);
}
.agent-users-table .desktop-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-start;
}
.users-page .detail-row.my-balance-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--tx2);
}
.users-page .detail-row .label { color: var(--tx3); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.ck-ops { display: inline-flex; gap: 6px; align-items: center; }
.auth-tabs, .auth-actions, .auth-inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.auth-tabs { justify-content: center; margin-bottom: 16px; }
.auth-tabs .btn.is-active { background: var(--info); border-color: var(--info2); color: #fff; }
.auth-layout { display: flex; gap: 16px; }
.auth-modes { width: 88px; display: flex; flex-direction: column; gap: 16px; }
.auth-modes label { display: flex; align-items: center; gap: 6px; }
.auth-fields { flex: 1; min-width: 0; }
.auth-addon { display: flex; width: 100%; }
.auth-addon input, .auth-addon select { flex: 1; min-width: 0; }
.auth-addon .btn { border-radius: 0 4px 4px 0; flex-shrink: 0; }
.auth-actions { justify-content: center; margin: 12px 0; }
.auth-note { margin: 0; color: var(--bad2); text-align: center; font-size: 13px; }
.auth-banner { margin-top: 12px; padding: 8px 12px; border-radius: 4px; color: #fff; line-height: 1.4; }
.auth-banner.is-ok { background: #4c934c; }
.auth-banner.is-error { background: #f56c6c; }
#auth-wh-body tr { cursor: pointer; }
#auth-wh-body tr.is-selected { background: var(--info-soft); }
/* auth-wh-overlay-20261101 */
#dlg-auth-wh.mask { z-index: 2000; }
#dlg-auth-wh .dialog {
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#dlg-auth-wh .dialog-bd {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
#dlg-auth-wh #auth-wh-pager.pager {
  position: static;
  right: auto;
  bottom: auto;
  z-index: auto;
  margin: 12px 0 0;
  padding: 8px 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
#cdkeys-page.is-auth-wh-open .pagination-footer-fixed {
  display: none !important;
}


#dlg-auth.mask {
  pointer-events: none;
  background: transparent;
}
#dlg-auth .auth-card {
  width: 520px;
  max-width: calc(100vw - 32px);
  padding: 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--elev);
  pointer-events: auto;
  box-shadow: 0 12px 32px rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.06);
}
#dlg-auth .auth-card-hd {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  margin: 0;
  border-bottom: 1px solid var(--bd);
  background: linear-gradient(135deg, #f0f7ff, #e8f3ff);
}
#dlg-auth .auth-card-hd-left {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--tx);
  font-size: 15px;
  font-weight: 600;
  flex-shrink: 0;
}
#dlg-auth .auth-card-ico { width: 18px; height: 18px; color: var(--info2); }
#dlg-auth .auth-card-cdk {
  flex: 1;
  min-width: 0;
  text-align: right;
  color: var(--tx3);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#dlg-auth .auth-card-close { margin-left: 4px; color: var(--tx3); }
#dlg-auth .auth-card-bd { padding: 4px 24px 20px; }
#dlg-auth .auth-game { text-align: center; margin-bottom: 8px; }
#dlg-auth .auth-cover-wrap {
  position: relative;
  width: 220px;
  height: 100px;
  margin: 0 auto 12px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--soft);
}
#dlg-auth .auth-cover-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
}
#dlg-auth .auth-cover-placeholder .ico { width: 40px; height: 40px; opacity: .9; }
#dlg-auth .auth-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}
#dlg-auth .auth-zh {
  font-size: 16px;
  font-weight: 700;
  color: var(--tx);
  line-height: 1.4;
  word-break: break-word;
}
#dlg-auth .auth-en {
  margin-top: 4px;
  font-size: 13px;
  color: var(--tx3);
  line-height: 1.3;
  word-break: break-word;
}
#dlg-auth .auth-bar {
  height: 6px;
  margin: 0;
  border-radius: 3px;
  background: #4f46e5;
  max-width: 100%;
}
#dlg-auth .auth-mid {
  margin: 14px 0 16px;
}
#dlg-auth .auth-mid .auth-banner {
  margin: 0;
  padding: 8px 12px;
  border-radius: 4px;
  text-align: center;
  font-size: 13px;
  line-height: 1.4;
  word-break: break-word;
}
#dlg-auth .auth-channels {
  display: flex;
  justify-content: center;
  gap: 36px;
  margin-bottom: 16px;
}
#dlg-auth .auth-channel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--tx2);
  font-size: 14px;
  user-select: none;
}
#dlg-auth .auth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}
#dlg-auth .auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}
#dlg-auth .auth-label { color: var(--tx2); font-size: 13px; }
#dlg-auth .auth-field input,
#dlg-auth .auth-field select {
  width: 100%;
  height: 36px;
  box-sizing: border-box;
  border: 1px solid var(--bd);
  border-radius: 4px;
  padding: 0 10px;
  color: var(--tx);
  background: var(--elev);
  outline: none;
}
#dlg-auth .auth-field input:focus,
#dlg-auth .auth-field select:focus { border-color: var(--info2); }
#dlg-auth .auth-addon input { border-radius: 4px 0 0 4px; }
#dlg-auth .auth-addon .btn {
  height: 36px;
  border: 1px solid var(--bd);
  border-left: 0;
  background: var(--soft);
  color: var(--tx2);
}
#dlg-auth .auth-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
}
#dlg-auth .auth-btn {
  height: 40px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
}
#dlg-auth .auth-btn-submit {
  background: linear-gradient(180deg, #6366f1 0%, #4f46e5 100%);
}
#dlg-auth .auth-btn-submit:hover { filter: brightness(1.03); }
#dlg-auth .auth-btn-cancel {
  background: linear-gradient(180deg, #6366f1 0%, #4f46e5 100%);
}
#dlg-auth .auth-btn-cancel:hover { filter: brightness(1.03); }



#cdkeys-page table.data th.is-sortable { cursor: pointer; user-select: none; }
#cdkeys-page table.data th .cell { display: inline-flex; align-items: center; gap: 0; white-space: nowrap; justify-content: center; }
#cdkeys-page table.data th.is-sortable:not(.is-center) .cell { justify-content: flex-start; }
#cdkeys-page table.data .caret-wrapper {
  appearance: none; border: none; outline: none; margin: 0; padding: 0;
  background: transparent; cursor: pointer; vertical-align: middle;
  width: 24px; height: 14px; overflow: initial;
  display: inline-flex; flex-direction: column; align-items: center; position: relative;
}
#cdkeys-page table.data .sort-caret {
  border: 5px solid transparent; width: 0; height: 0; position: absolute; left: 7px;
}
#cdkeys-page table.data .sort-caret.ascending { border-bottom-color: #c0c4cc; top: -5px; }
#cdkeys-page table.data .sort-caret.descending { border-top-color: #c0c4cc; bottom: -3px; }
#cdkeys-page table.data th.ascending .sort-caret.ascending { border-bottom-color: #409eff; }
#cdkeys-page table.data th.descending .sort-caret.descending { border-top-color: #409eff; }

.auto-auth-page table.data th.is-sortable { cursor: pointer; user-select: none; }
.auto-auth-page table.data th .cell { display: inline-flex; align-items: center; gap: 0; white-space: nowrap; justify-content: center; }
.auto-auth-page table.data .caret-wrapper {
  appearance: none; border: none; outline: none; margin: 0; padding: 0;
  background: transparent; cursor: pointer; vertical-align: middle;
  width: 24px; height: 14px; overflow: initial;
  display: inline-flex; flex-direction: column; align-items: center; position: relative;
}
.auto-auth-page table.data .sort-caret {
  border: 5px solid transparent; width: 0; height: 0; position: absolute; left: 7px;
}
.auto-auth-page table.data .sort-caret.ascending { border-bottom-color: #c0c4cc; top: -5px; }
.auto-auth-page table.data .sort-caret.descending { border-top-color: #c0c4cc; bottom: -3px; }
.auto-auth-page table.data th.ascending .sort-caret.ascending { border-bottom-color: #409eff; }
.auto-auth-page table.data th.descending .sort-caret.descending { border-top-color: #409eff; }

#cdkeys-page .table-wrap { position: relative; }
#cdkeys-page .table-section { position: relative; }
.btn.is-loading {
  pointer-events: none;
  position: relative;
}
.btn.is-loading > .ico { display: none; }
.btn .btn-loading-icon {
  display: inline-flex;
  width: 14px;
  height: 14px;
  margin-right: 2px;
  vertical-align: middle;
}
.btn .btn-loading-icon .circular {
  width: 14px;
  height: 14px;
  animation: ck-loading-rotate 2s linear infinite;
}
.btn .btn-loading-icon .path {
  stroke: #fff;
  stroke-width: 3px;
  stroke-linecap: round;
  fill: none;
  stroke-dasharray: 90, 150;
  stroke-dashoffset: 0;
  animation: ck-loading-dash 1.5s ease-in-out infinite;
}
.wanzi-loading-host,
.login-box,
#cdkeys-page .table-section,
.auto-auth-table-wrap,
.games-container .games-grid,
#users-page .table-section {
  position: relative;
}
.wanzi-loading-host > .el-loading-mask,
.login-box > .el-loading-mask,
#cdkeys-page .table-section > .el-loading-mask,
.auto-auth-table-wrap > .el-loading-mask,
.games-container .games-grid > .el-loading-mask,
#users-page .table-section > .el-loading-mask {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.72);
  margin: 0;
}
.wanzi-loading-host > .el-loading-mask .el-loading-spinner,
.login-box > .el-loading-mask .el-loading-spinner,
#cdkeys-page .table-section > .el-loading-mask .el-loading-spinner,
.auto-auth-table-wrap > .el-loading-mask .el-loading-spinner,
.games-container .games-grid > .el-loading-mask .el-loading-spinner,
#users-page .table-section > .el-loading-mask .el-loading-spinner {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  text-align: center;
  margin-top: -21px;
}
.wanzi-loading-host > .el-loading-mask .circular,
.login-box > .el-loading-mask .circular,
#cdkeys-page .table-section > .el-loading-mask .circular,
.auto-auth-table-wrap > .el-loading-mask .circular,
.games-container .games-grid > .el-loading-mask .circular,
#users-page .table-section > .el-loading-mask .circular {
  width: 42px;
  height: 42px;
  display: inline;
  animation: ck-loading-rotate 2s linear infinite;
}
.wanzi-loading-host > .el-loading-mask .path,
.login-box > .el-loading-mask .path,
#cdkeys-page .table-section > .el-loading-mask .path,
.auto-auth-table-wrap > .el-loading-mask .path,
.games-container .games-grid > .el-loading-mask .path,
#users-page .table-section > .el-loading-mask .path {
  stroke: var(--info2);
  stroke-width: 2px;
  stroke-linecap: round;
  fill: none;
  stroke-dasharray: 90, 150;
  stroke-dashoffset: 0;
  animation: ck-loading-dash 1.5s ease-in-out infinite;
}
@keyframes ck-loading-rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes ck-loading-dash {
  0% { stroke-dasharray: 1, 200; stroke-dashoffset: 0; }
  50% { stroke-dasharray: 90, 150; stroke-dashoffset: -40px; }
  100% { stroke-dasharray: 90, 150; stroke-dashoffset: -120px; }
}
#cdkeys-page .cdkeys-table { table-layout: fixed; }
#cdkeys-page .cdkeys-table col.col-channel { width: 122px; }
#cdkeys-page .cdkeys-table col.col-appid { width: 81px; }
#cdkeys-page .cdkeys-table col.col-type { width: 81px; }
#cdkeys-page .cdkeys-table th { position: relative; overflow: hidden; }
#cdkeys-page .cdkeys-table td { overflow: hidden; text-overflow: ellipsis; }
#cdkeys-page .cdkeys-table td:nth-child(2) { overflow: visible; }
#cdkeys-page .cdkeys-table tbody tr:hover { position: relative; z-index: 3; }
#cdkeys-page .cdkeys-col-resize-proxy {
  display: none;
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 1px solid var(--bd);
  z-index: 20;
  pointer-events: none;
}

#dlg-recycle .el-message-box {
  width: 420px;
  max-width: calc(100vw - 32px);
  padding: 12px;
  border-radius: 4px;
  background: var(--elev);
  box-shadow: 0 12px 32px 4px rgba(0,0,0,.04), 0 8px 20px rgba(0,0,0,.08);
}
#dlg-recycle .el-message-box__header {
  position: relative;
  padding: 0 28px 12px 0;
}
#dlg-recycle .el-message-box__title {
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
  color: var(--tx);
}
#dlg-recycle .el-message-box__headerbtn {
  position: absolute;
  top: 0;
  right: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  color: var(--tx3);
}
#dlg-recycle .el-message-box__headerbtn:hover { color: var(--info2); }
#dlg-recycle .el-message-box__close {
  display: inline-flex;
  width: 16px;
  height: 16px;
}
#dlg-recycle .el-message-box__close svg { width: 16px; height: 16px; }
#dlg-recycle .el-message-box__content {
  color: var(--tx2);
  font-size: 14px;
}
#dlg-recycle .el-message-box__container {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
#dlg-recycle .el-message-box__status {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: var(--tx3);
}
#dlg-recycle .el-message-box__status svg { width: 24px; height: 24px; }
#dlg-recycle .el-message-box__message {
  margin: 0;
  color: var(--tx2);
  font-size: 14px;
  line-height: 1.6;
  padding-top: 2px;
}
#dlg-recycle .el-message-box__message p { margin: 0; white-space: pre-wrap; }
#dlg-recycle .el-message-box__btns {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
}
#dlg-recycle .el-message-box__btns .btn { min-width: 80px; }
#dlg-batch-recycle-confirm.mask {
  z-index: 60;
  background: rgba(0, 0, 0, .45);
}
#dlg-batch-recycle-confirm .el-message-box {
  width: 420px;
  max-width: calc(100vw - 32px);
  padding: 12px;
  border-radius: 4px;
  background: var(--elev);
  box-shadow: 0 12px 32px 4px rgba(0,0,0,.04), 0 8px 20px rgba(0,0,0,.08);
}
#dlg-batch-recycle-confirm .el-message-box__header {
  position: relative;
  padding: 0 28px 12px 0;
}
#dlg-batch-recycle-confirm .el-message-box__title {
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
  color: var(--tx);
}
#dlg-batch-recycle-confirm .el-message-box__headerbtn {
  position: absolute;
  top: 0;
  right: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  color: var(--tx3);
}
#dlg-batch-recycle-confirm .el-message-box__headerbtn:hover { color: var(--info2); }
#dlg-batch-recycle-confirm .el-message-box__close {
  display: inline-flex;
  width: 16px;
  height: 16px;
}
#dlg-batch-recycle-confirm .el-message-box__close svg { width: 16px; height: 16px; }
#dlg-batch-recycle-confirm .el-message-box__content {
  color: var(--tx2);
  font-size: 13px;
}
#dlg-batch-recycle-confirm .el-message-box__container {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
#dlg-batch-recycle-confirm .el-message-box__status {
  flex: 0 0 auto;
  color: var(--warn2);
}
#dlg-batch-recycle-confirm .el-message-box__status svg { width: 24px; height: 24px; }
#dlg-batch-recycle-confirm .el-message-box__message {
  flex: 1 1 auto;
  line-height: 1.7;
  padding-top: 2px;
  font-size: 13px;
  color: var(--tx2);
}
#dlg-batch-recycle-confirm .el-message-box__message p {
  margin: 0;
  white-space: normal;
  font-size: 13px;
  line-height: 1.7;
  color: var(--tx2);
  font-weight: 400;
}
#dlg-batch-recycle-confirm .el-message-box__btns {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
}
#dlg-batch-recycle-confirm .el-message-box__btns .btn {
  min-width: 80px;
  font-size: 13px;
}
.batch-recycle-detect {
  margin-top: 10px;
  color: var(--tx2);
  font-size: 13px;
  line-height: 1.5;
}
.batch-recycle-detect[hidden] { display: none; }
.batch-recycle-detect-num {
  display: inline;
  margin: 0 2px;
  padding: 0;
  min-width: 0;
  height: auto;
  border-radius: 0;
  background: transparent;
  color: var(--bad2);
  font-size: inherit;
  font-weight: 700;
  line-height: inherit;
  vertical-align: baseline;
}
.batch-recycle-confirm-num {
  display: inline;
  margin: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font-size: 13px;
  font-weight: 400;
  line-height: inherit;
  vertical-align: baseline;
}
#dlg-batch-recycle.mask:not([hidden]),
#dlg-batch-recycle-confirm.mask:not([hidden]),
#dlg-batch-recycle-result.mask:not([hidden]) {
  animation: batch-mask-in .22s ease;
}
#dlg-batch-recycle.mask:not([hidden]) > .dialog,
#dlg-batch-recycle-confirm.mask:not([hidden]) > .dialog,
#dlg-batch-recycle-result.mask:not([hidden]) > .dialog {
  animation: batch-dialog-in .22s ease;
}
@keyframes batch-mask-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes batch-dialog-in {
  from { opacity: 0; transform: translateY(-12px) scale(.96); }
  to { opacity: 1; transform: none; }
}
.batch-recycle-result-summary {
  margin-bottom: 12px;
  color: var(--tx);
  font-size: 14px;
  font-weight: 600;
}
.batch-recycle-result-block {
  margin-bottom: 12px;
  border: 1px solid var(--bd);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--elev);
}
.batch-recycle-result-block h4 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--tx);
}
.batch-recycle-result-block.is-ok h4 { color: var(--ok2); }
.batch-recycle-result-block.is-over h4 { color: var(--warn2); }
.batch-recycle-result-block.is-err h4 { color: var(--bad2); }
.batch-recycle-result-list {
  max-height: 160px;
  overflow: auto;
  font-family: Consolas, Monaco, monospace;
  font-size: 12px;
  line-height: 1.6;
  color: var(--tx2);
  word-break: break-all;
}
.batch-recycle-fail-reason {
  margin-left: 8px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 400;
  color: var(--bad2);
}

#dlg-gxyx .dialog { overflow: hidden; border-radius: 8px; }
#dlg-gxyx .dialog-hd {
    margin: 0;
    padding: 16px 20px;
    border-bottom: 1px solid var(--bd);
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
}
#dlg-gxyx .dialog-hd h3 { font-size: 16px; font-weight: 600; color: var(--tx); }
#dlg-gxyx .auth-game { text-align: center; margin: 8px 0 4px; }
#dlg-gxyx .auth-cover-wrap {
  position: relative;
  width: 220px;
  height: 100px;
  margin: 0 auto 12px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--soft);
}
#dlg-gxyx .auth-cover-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
}
#dlg-gxyx .auth-cover-placeholder .ico { width: 40px; height: 40px; opacity: .9; }
#dlg-gxyx .auth-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}
#dlg-gxyx .auth-zh {
  font-size: 16px;
  font-weight: 700;
  color: var(--tx);
  line-height: 1.4;
  word-break: break-word;
}
#dlg-gxyx .auth-en {
  margin-top: 4px;
  font-size: 13px;
  color: var(--tx3);
  line-height: 1.3;
  word-break: break-word;
}
#dlg-gxyx .gxyx-steam-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}
#dlg-gxyx .gxyx-steam-row .field {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}
#dlg-gen .gen-dialog { width: min(638px, 100%); }
#dlg-gen .dialog-hd { align-items: flex-start; }
#dlg-gen .gen-hd-txt { flex: 1; min-width: 0; }
#dlg-gen .dialog-hd p { font-size: 12px; color: var(--tx3); margin-top: 3px; white-space: pre-line; }
#dlg-gen .gen-wrap { display: flex; gap: 18px; align-items: stretch; }
#dlg-gen .gen-left { flex: 0 0 300px; min-width: 0; }
#dlg-gen .gen-info { display: flex; align-items: center; gap: 16px; padding: 16px; background: var(--soft); border-radius: 8px; margin-bottom: 16px; }
#dlg-gen .gen-cover { width: 120px; height: 56px; object-fit: cover; border-radius: 4px; background: #ddd; flex: none; display: block; }
#dlg-gen .gen-info-txt { flex: 1; min-width: 0; }
#dlg-gen .gen-name { font-size: 16px; font-weight: 600; margin-bottom: 4px; color: var(--tx); }
#dlg-gen .gen-appid-line { font-size: 13px; }
#dlg-gen .mut { color: var(--tx3); }
#dlg-gen .mono { font-family: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", monospace; font-variant-ligatures: none; }
#dlg-gen .row { margin-bottom: 15px; }
#dlg-gen .row > label { display: block; font-size: 12.5px; font-weight: 600; color: var(--tx2); margin-bottom: 6px; }
#dlg-gen .gen-qty-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#dlg-gen .gen-stepper { display: flex; align-items: center; border: 1px solid var(--bd); border-radius: 6px; overflow: hidden; flex: none; background: var(--elev); }
#dlg-gen .gen-stepper button { padding: 8px 12px; background: var(--soft); border: none; cursor: pointer; font-size: 18px; color: var(--tx2); line-height: 1; }
#dlg-gen .gen-stepper button.is-disabled { color: var(--tx3); cursor: not-allowed; }
#dlg-gen .gen-stepper input { width: 100px; text-align: center; border: none; outline: none; padding: 8px 4px; background: var(--bg); color: var(--tx); font-size: 13px; -moz-appearance: textfield; appearance: textfield; }
#dlg-gen .gen-stepper:focus-within, #dlg-gen .gen-stepper.is-focus { border-color: var(--pri); }
#dlg-gen .gen-quick { display: flex; gap: 6px; flex: 1 0 100%; }
#dlg-gen .qty-btn { padding: 6px 12px; border: 1px solid var(--bd); border-radius: 6px; background: var(--elev); cursor: pointer; font-size: 13px; color: var(--tx); }
#dlg-gen .gen-hint { font-size: 11.5px; color: var(--warn); margin-top: 8px; line-height: 1.45; }
#dlg-gen .gen-quota { margin-top: 12px; padding: 12px; background: var(--soft); border-radius: 6px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
#dlg-gen .gen-quota .qv { color: var(--pri); background: var(--pri-soft); padding: 2px 8px; border-radius: 5px; font-weight: 600; }
#dlg-gen .gen-out { flex: 0 0 280px; min-width: 0; display: flex; flex-direction: column; border: 1px solid var(--bd); border-radius: 12px; background: var(--elev); box-shadow: var(--sh2); }
#dlg-gen .gen-out-h { display: flex; align-items: center; gap: 8px; padding: 12px 14px; background: var(--soft); border-bottom: 1px solid var(--bd-soft); border-radius: 11px 11px 0 0; font-size: 13.5px; font-weight: 650; }
#dlg-gen .gen-out-h .ico { width: 18px; height: 18px; color: var(--pri); }
#dlg-gen .gen-out textarea { flex: 1; width: auto; height: auto; min-height: 210px; margin: 14px 14px 0; padding: 12px 14px; resize: none; outline: none; border: 1px solid rgba(59, 130, 246, .55); border-radius: 8px; background: var(--elev); font-size: 13px; line-height: 1.75; color: var(--tx); }
#dlg-gen .gen-out textarea:focus { border-color: rgba(59, 130, 246, .75); box-shadow: 0 0 0 3px rgba(59, 130, 246, .16); }
#dlg-gen .gen-out-f { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; font-size: 12px; color: var(--tx3); }
@media (max-width: 700px) {
  #dlg-gen .gen-wrap { flex-direction: column; }
  #dlg-gen .gen-left, #dlg-gen .gen-out { flex: 1 1 auto; }
  #dlg-gen .gen-out textarea { min-height: 160px; }
}

#dlg-user-limit .dialog,
#dlg-auto-auth .dialog,
#dlg-aa-del .dialog { overflow: hidden; border-radius: 8px; }
#dlg-user-limit .dialog-hd,
#dlg-auto-auth .dialog-hd,
#dlg-aa-del .dialog-hd {
  margin: 0;
  padding: 16px 20px;
  border-bottom: 1px solid var(--bd);
  background: linear-gradient(135deg, #f0f7ff, #e8f3ff);
}
#dlg-user-limit .dialog-hd h3,
#dlg-auto-auth .dialog-hd h3,
#dlg-aa-del .dialog-hd h3 { font-size: 16px; font-weight: 600; color: var(--tx); }

.agent-msg-mask {
  display: flex !important;
  align-items: center;
  justify-content: center;
  z-index: 5000;
}
.agent-msg-mask[hidden] { display: none !important; }
.agent-msg-dialog { margin: 0; }
.agent-msg-text {
  text-align: center;
  font-size: 15px;
  line-height: 1.6;
  margin: 8px 0 4px;
  color: var(--tx);
}
.agent-msg-text.is-error {
  color: var(--bad2);
  font-weight: 600;
}
.agent-msg-text.is-success {
  color: var(--ok2);
  font-weight: 600;
}

/* 新增渠道: empty form => gray OK, no click; logic unchanged when enabled */
#btn-user-ok:disabled,
#btn-user-ok[disabled] {
  background: #c0c4cc;
  border-color: var(--tx3);
  color: #fff;
  opacity: 1;
  cursor: not-allowed;
  box-shadow: none;
  pointer-events: none;
}
#btn-user-ok:disabled:hover,
#btn-user-ok[disabled]:hover {
  background: #c0c4cc;
  border-color: var(--tx3);
  color: #fff;
}

/* ═══ 深色主题 tokens（对齐 sa3） ═══ */
:root[data-theme="dark"] {
    --bg: #0b0d12; --elev: #12151c; --soft: #151922; --soft2: #1a1e2b;
    --bd: #242a37; --bd-soft: #1b2029; --hover: #171c26;
    --tx: #f8fafc; --tx2: #94a3b8; --tx3: #64748b;
    --pri: #6366f1; --pri2: #818cf8; --pri-soft: #1b1e33; --pri-ring: rgba(129,140,248,.4);
    --ok: #34d399; --ok2: #10b981; --ok-soft: #0f2118;
    --warn: #fbbf24; --warn2: #f59e0b; --warn-soft: #241d0f;
    --bad: #fb7185; --bad2: #f43f5e; --bad-soft: #2a1319;
    --vio: #a78bfa; --vio2: #8b5cf6; --vio-soft: #1e1830;
    --info: #38bdf8; --info2: #0ea5e9; --info-soft: #0c2436;
    --sh1: 0 1px 2px rgba(0,0,0,.4);
    --sh2: 0 1px 3px rgba(0,0,0,.45), 0 8px 24px -12px rgba(0,0,0,.6);
    --sh3: 0 24px 60px -20px rgba(0,0,0,.75);
    --primary: #6366f1; --primary-dark: #818cf8;
    --success: #10b981; --warning: #f59e0b; --danger: #f43f5e;
    --text: #f8fafc; --text-2: #94a3b8; --text-3: #64748b;
    --line: #242a37; --line-2: #242a37; --fill: #151922;
    --shadow: 0 1px 3px rgba(0,0,0,.45), 0 8px 24px -12px rgba(0,0,0,.6);
    --scrollbar-thumb: #242a37; --scrollbar-thumb-hover: #64748b;
    color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }
html[data-theme="dark"] .cdkeys-page .has-tip::after { border-color: var(--bd); }

/* ═══ 顶栏主题/语言控件（对齐 sa3） ═══ */
.env-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: 10px;
    border: 1px solid var(--bd); background: var(--elev);
    color: var(--tx); font-size: 13px; font-weight: 500;
    cursor: pointer; white-space: nowrap; box-shadow: var(--sh1);
    transition: background .15s, border-color .15s;
}
.env-pill:hover { background: var(--hover); border-color: var(--tx3); }
.env-pill .ico { width: 16px; height: 16px; flex: none; }
.env-pill .chev { width: 12px; height: 12px; color: var(--tx2); }
.lang-wrap { position: relative; }
.lang-menu {
    position: absolute; top: calc(100% + 6px); right: 0; z-index: 120;
    min-width: 148px; background: var(--elev); border: 1px solid var(--bd);
    border-radius: 10px; box-shadow: var(--sh2); padding: 4px;
}
.lang-menu button {
    display: flex; align-items: center; gap: 8px; width: 100%;
    padding: 8px 12px; border: 0; background: none; border-radius: 7px;
    font-size: 13px; color: var(--tx); cursor: pointer; text-align: left;
}
.lang-menu button:hover { background: var(--soft); }
.lang-menu .tick { width: 14px; height: 14px; flex: none; color: var(--pri); }
.lang-menu .tick-sp { width: 14px; flex: none; }
@media (max-width: 640px) {
    .env-pill .lbl { display: none; }
    .env-pill { padding: 6px 9px; }
}
html[data-theme="dark"] #dlg-auth .auth-card-hd,
html[data-theme="dark"] #dlg-aa-del .dialog-hd { background: linear-gradient(135deg, var(--info-soft), var(--soft)); }
html[data-theme="dark"] #dlg-gxyx .dialog-hd { background: var(--soft); }
html[data-theme="dark"] #dlg-gen .gen-out textarea { border-color: rgba(56, 189, 248, .45); }

/* hover lift: buttons 2px, nav 1px */
.btn,
.games-go,
.ck-search-go,
.icon-btn,
.pager-num,
.pager-nav,
.auth-btn,
.qty-btn,
.user-info,
.msgbox-close,
.g-copy {
    transition: transform .22s ease, box-shadow .22s ease, background-color .16s ease, background .16s ease, border-color .16s ease, color .16s ease, filter .16s ease, opacity .16s ease;
}
.btn:hover:not(:disabled):not([disabled]):not(.is-disabled),
.games-go:hover:not(:disabled):not([disabled]),
.ck-search-go:hover:not(:disabled):not([disabled]),
.icon-btn:hover:not(:disabled):not([disabled]),
.pager-num:hover:not(:disabled):not([disabled]),
.pager-nav:hover:not(:disabled):not([disabled]),
.auth-btn:hover:not(:disabled):not([disabled]),
.qty-btn:hover:not(:disabled):not([disabled]),
.user-info:hover:not(:disabled):not([disabled]),
.msgbox-close:hover:not(:disabled):not([disabled]),
.g-copy:hover:not(:disabled):not([disabled]) {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px -6px rgba(15, 23, 42, .22);
}
.btn-primary:hover:not(:disabled):not([disabled]):not(.is-disabled),
.auth-btn:hover:not(:disabled):not([disabled]) {
    box-shadow: 0 6px 14px -8px rgba(79, 70, 229, .38);
}
.btn-success:hover:not(:disabled):not([disabled]):not(.is-disabled) {
    box-shadow: 0 6px 14px -8px rgba(5, 150, 105, .34);
}
.btn-danger:hover:not(:disabled):not([disabled]):not(.is-disabled) {
    box-shadow: 0 6px 14px -8px rgba(225, 29, 68, .32);
}
.btn-warning:hover:not(:disabled):not([disabled]):not(.is-disabled) {
    box-shadow: 0 6px 14px -8px rgba(217, 119, 6, .32);
}
.btn:active:not(:disabled):not([disabled]):not(.is-disabled),
.games-go:active:not(:disabled):not([disabled]),
.ck-search-go:active:not(:disabled):not([disabled]),
.icon-btn:active:not(:disabled):not([disabled]),
.pager-num:active:not(:disabled):not([disabled]),
.pager-nav:active:not(:disabled):not([disabled]),
.auth-btn:active:not(:disabled):not([disabled]),
.qty-btn:active:not(:disabled):not([disabled]),
.user-info:active:not(:disabled):not([disabled]),
.msgbox-close:active:not(:disabled):not([disabled]),
.g-copy:active:not(:disabled):not([disabled]) {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
}
.method .btn:hover:not(:disabled):not([disabled]):not(.is-disabled) {
    transform: translateY(calc(-50% - 2px));
}
.method .btn:active:not(:disabled):not([disabled]):not(.is-disabled) {
    transform: translateY(-50%);
}
.menu-item,
.side-collapse {
    transition: transform .22s ease, box-shadow .22s ease, background-color .16s ease, color .16s ease;
}
.menu-item:hover,
.side-collapse:hover:not(:disabled):not([disabled]) {
    transform: translateY(-1px);
    box-shadow: 0 2px 7px -4px rgba(15, 23, 42, .2);
}
.side-collapse:active:not(:disabled):not([disabled]) {
    transform: translateY(0);
    box-shadow: none;
}
:root[data-theme="dark"] .btn:hover:not(:disabled):not([disabled]):not(.is-disabled),
:root[data-theme="dark"] .games-go:hover:not(:disabled):not([disabled]),
:root[data-theme="dark"] .ck-search-go:hover:not(:disabled):not([disabled]),
:root[data-theme="dark"] .icon-btn:hover:not(:disabled):not([disabled]),
:root[data-theme="dark"] .pager-num:hover:not(:disabled):not([disabled]),
:root[data-theme="dark"] .pager-nav:hover:not(:disabled):not([disabled]),
:root[data-theme="dark"] .auth-btn:hover:not(:disabled):not([disabled]),
:root[data-theme="dark"] .qty-btn:hover:not(:disabled):not([disabled]),
:root[data-theme="dark"] .user-info:hover:not(:disabled):not([disabled]),
:root[data-theme="dark"] .msgbox-close:hover:not(:disabled):not([disabled]),
:root[data-theme="dark"] .g-copy:hover:not(:disabled):not([disabled]),
:root[data-theme="dark"] .menu-item:hover,
:root[data-theme="dark"] .side-collapse:hover:not(:disabled):not([disabled]) {
    box-shadow: 0 5px 12px -6px rgba(0, 0, 0, .55);
}
@media (prefers-reduced-motion: reduce) {
    .btn:hover,
    .games-go:hover,
    .ck-search-go:hover,
    .icon-btn:hover,
    .pager-num:hover,
    .pager-nav:hover,
    .auth-btn:hover,
    .qty-btn:hover,
    .user-info:hover,
    .msgbox-close:hover,
    .g-copy:hover,
    .menu-item:hover,
    .side-collapse:hover {
        transform: none;
    }
}

/* settings submenu only while on settings */
.menu-sub[data-g="settings"] { display: none; }
.menu-item.grp[data-g="settings"] .chev { transform: rotate(-90deg); }
html[data-settings-sub="open"] .menu-sub[data-g="settings"] { display: flex; }
html[data-settings-sub="open"] .menu-item.grp[data-g="settings"] .chev { transform: none; }

.logo h2 {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 3px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.1;
}
.logo-brand {
    align-self: stretch;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--tx);
    line-height: 1.1;
}
.logo-sub {
    align-self: stretch;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0;
    color: var(--tx2);
    line-height: 1.15;
}




/* 后台页面底：参考色 #eef2ff 再浅一点，轻玻璃感 */
:root:not([data-theme="dark"]) {
    --bg: #f3f6ff;
}
:root:not([data-theme="dark"]) body:not(.login) {
    background-color: #f2f5ff;
    background-image:
        radial-gradient(1100px 520px at 8% -12%, rgba(255,255,255,.55), rgba(255,255,255,0) 56%),
        radial-gradient(820px 460px at 100% -6%, rgba(255,255,255,.34), rgba(255,255,255,0) 50%),
        linear-gradient(180deg, #f7f9ff 0%, #eef2ff 100%);
}
:root:not([data-theme="dark"]) .shell,
:root:not([data-theme="dark"]) main {
    background: transparent;
}
:root:not([data-theme="dark"]) .sidebar {
    background: rgba(255,255,255,.66);
    -webkit-backdrop-filter: blur(18px) saturate(1.35);
    backdrop-filter: blur(18px) saturate(1.35);
}
:root:not([data-theme="dark"]) .topbar {
    background: rgba(255,255,255,.52);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    backdrop-filter: blur(16px) saturate(1.4);
}

.settings-home-page .rich-toolbar {
  gap: 6px;
  padding: 6px 8px;
  background: #fff;
  border-bottom: 1px solid #e6e8ee;
}
.settings-home-page .rich-toolbar button {
  appearance: none;
  border: 0;
  background: transparent;
  min-width: 22px;
  height: 24px;
  padding: 0 4px;
  font-size: 13px;
  line-height: 24px;
  color: #222;
  cursor: pointer;
  border-radius: 4px;
}
.settings-home-page .rich-toolbar button:hover {
  background: #f2f4f8;
}
.settings-home-page .rich-toolbar select {
  height: 24px;
  max-width: 92px;
  border: 1px solid #e1e4ea;
  border-radius: 4px;
  background: #fff;
  font-size: 12px;
  color: #333;
  padding: 0 4px;
}
.settings-home-page .rich-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  font-size: 12px;
  color: #333;
  cursor: pointer;
}
.settings-home-page .rich-toolbar input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid #d0d4dc;
  border-radius: 2px;
  background: none;
  cursor: pointer;
}
.settings-home-page .rich-toolbar input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.settings-home-page .rich-toolbar input[type="color"]::-webkit-color-swatch { border: 0; }

.nav-open-btn{display:none;width:36px;height:36px;border:1px solid var(--bd);border-radius:8px;background:var(--elev);color:var(--tx);align-items:center;justify-content:center;flex:none;cursor:pointer;padding:0}
.nav-open-btn .ico{width:18px;height:18px}
.nav-mask{display:none}
@media (max-width:768px){
.nav-open-btn{display:inline-flex}
.nav-mask{position:fixed;inset:0;background:rgba(15,23,42,.45);z-index:25}
body.nav-open .nav-mask{display:block}
body.nav-open .sidebar{z-index:30}
.topbar{padding-left:12px;padding-right:12px}
.top-title{flex:1;min-width:0}
.header-right{min-width:0}
.games-toolbar,.sub-toolbar,.users-page .sub-toolbar{flex-wrap:wrap}
.users-page .sub-toolbar .sub-inp{width:100%;max-width:none}
.games-container .games-search{flex:1 1 100%;min-width:0}
.users-page .users-container{padding-bottom:96px}
.users-page .desktop-table{display:flex !important;flex-direction:column;min-width:0 !important;width:100% !important}
.users-page .unified-table.agent-users-table{min-width:0 !important;width:100% !important}
.users-page #users-table-body{display:flex;flex-direction:column;gap:12px}
.users-page .table-header-row{display:none !important}
.users-page .data-row{display:flex;flex-direction:column;border:1px solid var(--bd);border-radius:12px;padding:4px 12px;background:var(--elev)}
.users-page .agent-users-table .data-row .table-cell{height:auto !important;min-height:0 !important;max-height:none !important;display:flex;justify-content:space-between;align-items:center;gap:10px;padding:8px 0;border:0;border-bottom:1px solid var(--bd-soft)}
.users-page .data-row .table-cell::before{content:attr(data-label);color:var(--tx3);font-size:12px;font-weight:600;flex:none}
.users-page .data-row .table-cell[data-label=""]::before{content:none}
.users-page .data-row .col-tree{order:-1;border-bottom:0;justify-content:flex-start;padding-bottom:0}
.users-page .data-row .desktop-actions{display:flex;flex-wrap:wrap;gap:8px;width:100%;justify-content:flex-end}
.users-page .data-row .col-actions .cell-wrapper .btn{width:auto;min-width:72px;flex:1 1 72px}
main table{display:block !important;min-width:0 !important;width:100% !important}
main table thead{display:none !important}
main table tbody{display:block !important}
main table tr{display:block !important;margin:0 0 12px;padding:4px 12px;border:1px solid var(--bd);border-radius:12px;background:var(--elev)}
main table td{display:flex !important;justify-content:space-between;align-items:center;gap:10px;width:auto !important;min-width:0 !important;padding:8px 0 !important;border:0 !important;border-bottom:1px solid var(--bd-soft) !important;text-align:right !important;white-space:normal !important}
main table td::before{content:attr(data-label);color:var(--tx3);font-size:12px;font-weight:600;text-align:left;flex:none}
main table td[data-label=""]::before{content:none}
main table td[hidden]{display:none !important}
main table td img{max-width:72px;max-height:40px}
.table-wrap,.games-table-wrap{overflow:visible}
.mask .dialog,#dlg-user .dialog{width:calc(100vw - 24px);max-width:calc(100vw - 24px)}
#dlg-user.create-mode .dialog-bd{grid-template-columns:1fr !important}
#dlg-user.create-mode #user-name-wrap,#dlg-user.create-mode #user-parent-select-wrap,#dlg-user.create-mode #user-parent-locked-wrap,#dlg-user.create-mode #user-password-wrap,#dlg-user.create-mode #user-quota-wrap{grid-column:1 !important;grid-row:auto !important}
.pager,.pagination-footer-fixed,.users-page .pagination-footer-fixed{flex-wrap:wrap;gap:8px}
.settings-home-page,.settings-popup-page,.card{max-width:100%}
.rich-toolbar{flex-wrap:wrap}
}
