:root {
    --ink-950: #081522;
    --ink-900: #0d1d2f;
    --ink-800: #142a43;
    --ink-700: #213a56;
    --blue-600: #2563eb;
    --blue-500: #3478f6;
    --blue-100: #eaf1ff;
    --cyan-500: #16b8c8;
    --cyan-100: #e2f8f8;
    --green-600: #078b6f;
    --green-100: #e3f6f0;
    --amber-600: #a8680b;
    --amber-100: #fff3d8;
    --red-600: #c33e48;
    --red-100: #fdebed;
    --paper: #ffffff;
    --canvas: #f4f7fb;
    --line: #dce4ee;
    --line-soft: #eaf0f5;
    --text: #14233b;
    --muted: #718099;
    --sidebar-width: 232px;
    --topbar-height: 64px;
    --radius: 10px;
    --shadow: 0 10px 32px rgba(16, 36, 62, .07);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
    color: var(--text);
    background: var(--canvas);
    font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans SC", sans-serif;
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: none; }
img { display: block; max-width: 100%; }
.hidden { display: none !important; }
.text-muted { color: var(--muted) !important; }
.text-center { text-align: center; }
.mono, code, .cell-link, .cell-muted {
    font-family: "Cascadia Mono", Consolas, monospace;
    font-variant-numeric: tabular-nums;
}
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { border-radius: 8px; background: #c5d0dc; }
::-webkit-scrollbar-thumb:hover { background: #aab8c7; }

:focus-visible {
    outline: 3px solid rgba(52, 120, 246, .22);
    outline-offset: 2px;
}

/* Shell */
.layout { min-height: 100vh; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 100;
    display: flex;
    width: var(--sidebar-width);
    flex-direction: column;
    overflow-y: auto;
    color: #fff;
    background:
        radial-gradient(circle at 10% 0, rgba(42, 117, 202, .2), transparent 32%),
        var(--ink-900);
}
.sidebar-logo {
    display: flex;
    min-height: var(--topbar-height);
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.sidebar-logo img {
    width: 34px;
    height: 34px;
    padding: 5px;
    border-radius: 9px;
    background: #fff;
}
.sidebar-logo .logo-title {
    color: #fff;
    font-size: 16px;
    font-weight: 750;
    letter-spacing: .02em;
}
.sidebar-nav {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 4px;
    padding: 24px 14px;
}
.sidebar-nav::before {
    content: "管理菜单";
    padding: 0 12px 9px;
    color: rgba(214, 228, 244, .4);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .18em;
}
.nav-item {
    position: relative;
    display: flex;
    min-height: 46px;
    align-items: center;
    gap: 12px;
    padding: 0 14px;
    border-radius: 8px;
    color: rgba(230, 239, 249, .72);
    font-weight: 550;
    transition: color .16s ease, background .16s ease;
}
.nav-item:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.nav-item.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(52, 120, 246, .42), rgba(52, 120, 246, .24));
    box-shadow: inset 0 0 0 1px rgba(108, 169, 255, .14);
}
.nav-item.active::before {
    content: "";
    position: absolute;
    left: -14px;
    width: 4px;
    height: 26px;
    border-radius: 0 4px 4px 0;
    background: #39d2dc;
}
.nav-icon {
    display: inline-flex;
    width: 20px;
    height: 20px;
    align-items: center;
    justify-content: center;
    flex: 0 0 20px;
}
.nav-icon svg { width: 19px; height: 19px; stroke: currentColor; }
.sidebar-footer {
    margin: 0 20px;
    padding: 14px 0 20px;
    border-top: 1px solid rgba(255, 255, 255, .09);
}
.sidebar-footer .nav-item { padding: 0 10px; }

.main {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
}
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    height: var(--topbar-height);
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(12px);
}
.page-title { color: #7a879a; font-size: 12px; font-weight: 600; }
.topbar-right, .user-chip { display: flex; align-items: center; }
.topbar-right { gap: 12px; }
.user-chip {
    gap: 9px;
    padding: 5px 11px 5px 5px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}
.user-avatar {
    display: inline-flex;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 7px;
    color: #fff;
    background: var(--blue-600);
    font-size: 12px;
    font-weight: 700;
}
.user-avatar svg { width: 16px; height: 16px; stroke: currentColor; }
.username-text { color: #4e5d73; font-size: 13px; }
.sidebar-toggle {
    display: none;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    background: #fff;
}
.content {
    width: min(100%, 1480px);
    margin: 0 auto;
    padding: 32px 36px 52px;
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 26px;
}
.page-heading h1 {
    margin: 0 0 6px;
    color: #102139;
    font-size: 24px;
    font-weight: 760;
    line-height: 1.25;
    letter-spacing: -.02em;
}
.page-heading p {
    margin: 0;
    color: #7a8799;
    font-size: 13px;
}

/* Surfaces and dashboard */
.card, .panel, .table-wrap {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    box-shadow: none;
}
.card { padding: 24px; }
.card-title, .section-title {
    margin-bottom: 20px;
    color: #162640;
    font-size: 16px;
    font-weight: 750;
}
.stat-grid {
    display: grid;
    grid-template-columns: repeat(var(--stat-columns, 3), minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
}
.stat-card {
    display: flex;
    min-height: 96px;
    align-items: center;
    gap: 18px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}
.stat-card:last-child { border-right: 1px solid var(--line); }
.stat-icon {
    display: inline-flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    border-radius: 8px;
    color: #52677f;
    background: #eef2f6;
}
.stat-icon svg { width: 20px; height: 20px; stroke: currentColor; }
.stat-icon.used, .stat-icon.unused, .stat-icon.failed { color: #52677f; background: #eef2f6; }
.stat-label { margin-bottom: 3px; color: var(--muted); font-size: 12px; }
.stat-value {
    color: #12203a;
    font-family: Bahnschrift, "Cascadia Mono", Consolas, monospace;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

/* Tools, forms and buttons */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: -1px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius) var(--radius) 0 0;
    background: #fff;
}
.toolbar-left, .toolbar-right, .form-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.toolbar-left { flex: 0 1 auto; flex-wrap: nowrap; }
.toolbar-right { flex: 0 1 auto; flex-wrap: nowrap; justify-content: flex-end; margin-left: auto; }
.toolbar .search-box { width: 240px; flex: 0 0 240px; }
.action-toolbar .toolbar-right { min-width: 330px; }
.action-toolbar .toolbar-left .btn-secondary {
    border-color: transparent;
    color: #40516a;
    background: #f1f4f8;
}
.action-toolbar .toolbar-left .btn-secondary:hover:not(:disabled) {
    border-color: transparent;
    color: #1d3552;
    background: #e8edf3;
}
.action-toolbar .toolbar-left .btn-danger {
    border-color: transparent;
    color: #a34b53;
    background: transparent;
}
.action-toolbar .toolbar-left .btn-danger:hover:not(:disabled) {
    border-color: transparent;
    color: #c33e48;
    background: #fff4f5;
}
.search-box { position: relative; }
.search-box .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    color: #8c99aa;
    transform: translateY(-50%);
}
.search-box .search-icon svg { width: 17px; height: 17px; stroke: currentColor; }
.search-box input { padding-left: 36px; }
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    margin-bottom: 7px;
    color: #4c5d74;
    font-size: 12px;
    font-weight: 650;
}
.form-row { display: flex; gap: 14px; }
.form-row > * { flex: 1; }
.form-control, .form-group input, .form-group textarea, .form-group select,
.search-box input, select {
    width: 100%;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid #d6dfe9;
    border-radius: 7px;
    outline: 0;
    color: var(--text);
    background: #fff;
    transition: border .15s ease, box-shadow .15s ease;
}
.search-box input { padding-left: 38px; }
.form-group textarea { min-height: 110px; resize: vertical; }
.form-control:focus, .form-group input:focus, .form-group textarea:focus,
.form-group select:focus, .search-box input:focus, select:focus {
    border-color: #5b91f2;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .11);
}
.help-text { margin-top: 6px; color: var(--muted); font-size: 12px; }
.input-with-icon { position: relative; }
.input-with-icon .input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    z-index: 1;
    display: inline-flex;
    color: #7d8ca0;
    transform: translateY(-50%);
}
.input-with-icon .input-icon svg { width: 18px; height: 18px; stroke: currentColor; }
.input-with-icon input { padding-left: 40px; }

.btn {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 7px 14px;
    border: 1px solid transparent;
    border-radius: 7px;
    color: #fff;
    background: var(--blue-600);
    font-size: 13px;
    font-weight: 650;
    line-height: 1;
    transition: background .15s ease, border .15s ease, transform .15s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:disabled { cursor: not-allowed; opacity: .55; }
.btn-primary { background: var(--blue-600); border-color: var(--blue-600); }
.btn-primary:hover:not(:disabled) { background: #1e55cf; border-color: #1e55cf; }
.btn-secondary, .btn-outline {
    color: #405069;
    background: #fff;
    border-color: #d4dde7;
}
.btn-secondary:hover:not(:disabled), .btn-outline:hover:not(:disabled) {
    color: var(--blue-600);
    background: #f6f9ff;
    border-color: #a9c2ef;
}
.btn-danger { color: #a54850; background: #fff; border-color: #e3c9cc; }
.btn-danger:hover:not(:disabled) { color: var(--red-600); background: #fff7f8; border-color: #dcaeb3; }
.btn-success { background: var(--green-600); border-color: var(--green-600); }
.btn-info { background: var(--cyan-500); border-color: var(--cyan-500); }
.btn-link {
    min-height: 0;
    padding: 2px 0;
    border: 0;
    outline: 0;
    color: #3566a8;
    background: transparent;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: none;
}
.btn-link:hover { color: #174b93; text-decoration: underline; transform: none; }
.btn-link.danger { color: #a34b53; }
.btn-link.danger:hover { color: #c33e48; }
.btn-link + .btn-link { margin-left: 10px; }
.table-actions { display: flex; min-width: 54px; align-items: center; flex-direction: column; gap: 5px; }
.table-actions .btn-link { width: 54px; margin-left: 0; text-align: center; }
.btn-sm { min-height: 32px; padding: 6px 10px; font-size: 12px; }
.btn-lg { min-height: 48px; padding: 12px 20px; }
.btn-block { width: 100%; }

/* Tables and pagination */
.table-wrap { overflow: hidden; border-radius: 0 0 var(--radius) var(--radius); }
.table-scroll { width: 100%; overflow-x: auto; }
.data-table, table { width: 100%; border-collapse: collapse; }
thead th {
    height: 48px;
    padding: 0 15px;
    border-bottom: 1px solid var(--line);
    color: #56657c;
    background: #f7f9fc;
    font-size: 12px;
    font-weight: 650;
    text-align: left;
    white-space: nowrap;
}
tbody td {
    min-height: 54px;
    padding: 13px 15px;
    border-bottom: 1px solid var(--line-soft);
    color: #2d3c53;
    vertical-align: middle;
}
tbody .empty-row { height: 170px; }

#btnSearch {
    min-width: 58px;
    min-height: 40px;
    padding-right: 13px;
    padding-left: 13px;
    white-space: nowrap;
    color: #fff;
    border-color: #20364f;
    background: #20364f;
}
#btnSearch:hover:not(:disabled) { border-color: #14273c; background: #14273c; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f8fbff; }
.row-check { width: 16px; height: 16px; accent-color: var(--blue-600); }
.cell-link {
    display: block;
    max-width: 560px;
    color: #38516e;
    font-size: 12px;
}
.cell-link input {
    display: block;
    width: 100%;
    padding: 3px 0;
    overflow: hidden;
    border: 0;
    outline: 0;
    color: #38516e;
    background: transparent;
    font: inherit;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: none;
}
.cell-link input:focus {
    border: 0;
    outline: 0;
    background: #f3f7fb;
    box-shadow: none;
}
.cell-muted { color: #7b899c; font-size: 12px; }
.empty-row { padding: 42px !important; color: var(--muted); text-align: center; }
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.badge-success, .badge-used { color: var(--green-600); background: var(--green-100); }
.badge-pending, .badge-unused { color: var(--amber-600); background: var(--amber-100); }
.badge-failed, .badge-expired { color: var(--red-600); background: var(--red-100); }
.badge-reserved { color: #285998; background: var(--blue-100); }

.nowrap { white-space: nowrap; }
.xiaomi-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:24px; }
.eyebrow { display:block; margin-bottom:8px; color:#8a96a7; font:700 9px/1 Bahnschrift,sans-serif; letter-spacing:.18em; }
.pool-card { padding:0; overflow:hidden; }
.pool-counts { display:flex; margin-left:auto; gap:20px; color:var(--muted); font-size:12px; }
.pool-counts b { margin-right:4px; color:var(--ink-800); font:750 15px/1 Bahnschrift,sans-serif; }
.mono { font-family:"Cascadia Mono",Consolas,monospace; }
.strong { color:var(--ink-800); font-weight:650; }
.muted { color:var(--muted); font-size:12px; }
.error-cell { max-width:260px; overflow:hidden; color:#8a5960; text-overflow:ellipsis; white-space:nowrap; }
.account-modal { width:min(680px,calc(100vw - 28px)); }
.field-label { display:block; margin-bottom:8px; color:var(--ink-800); font-size:12px; font-weight:700; }
.account-input { min-height:190px; font:13px/1.7 "Cascadia Mono",Consolas,monospace; }
.format-guide { display:grid; gap:6px; margin-top:14px; padding:14px 16px; border-left:3px solid #1f2937; color:var(--muted); background:#f5f7fa; font-size:12px; }
.format-guide b { color:var(--ink-800); }
.format-guide code { overflow-wrap:anywhere; color:#33465e; }
.binding-note { margin-bottom:18px; padding:12px 14px; border-left:3px solid var(--blue-600); color:#45617f; background:#f3f7fc; font-size:13px; line-height:1.6; }
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border-top: 1px solid var(--line-soft);
    background: #fbfcfe;
}
.page-list, .page-buttons { display: flex; align-items: center; gap: 5px; list-style: none; }
.page-btn, .page-num {
    display: inline-flex;
    min-width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: #54637a;
    background: #fff;
}
.page-btn.active, .page-num.active { color: #fff; border-color: var(--blue-600); background: var(--blue-600); }
.page-btn:disabled { cursor: not-allowed; opacity: .45; }
.page-info { color: var(--muted); font-size: 12px; }
.page-size-wrap { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.page-size-select { width: auto; min-width: 96px; }

/* Dialogs and feedback */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(4, 16, 29, .58);
    backdrop-filter: blur(4px);
}
.modal-overlay.show { display: flex; }
.modal-box {
    width: min(100%, 560px);
    max-height: calc(100vh - 40px);
    overflow: auto;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 28px 90px rgba(5, 18, 32, .28);
}
.modal-header, .modal-footer { display: flex; align-items: center; padding: 16px 20px; }
.modal-header { justify-content: space-between; border-bottom: 1px solid var(--line); }
.modal-title { font-size: 16px; font-weight: 750; }
.modal-close { border: 0; color: #738198; background: none; font-size: 24px; }
.modal-body { padding: 20px; }
.modal-footer { justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); background: #fafcff; }
.toast-container { position: fixed; z-index: 1200; top: 20px; right: 20px; display: grid; gap: 10px; }
.toast {
    display: flex;
    min-width: 290px;
    align-items: center;
    gap: 10px;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    box-shadow: var(--shadow);
}
.toast-icon { display: inline-flex; width: 24px; height: 24px; align-items: center; justify-content: center; border-radius: 50%; }
.toast-success .toast-icon { color: var(--green-600); background: var(--green-100); }
.toast-error .toast-icon { color: var(--red-600); background: var(--red-100); }
.toast-info .toast-icon { color: var(--blue-600); background: var(--blue-100); }
.toast-msg { flex: 1; }
.toast-close { border: 0; color: #8290a2; background: none; font-size: 18px; }
.toast-out { opacity: 0; transform: translateX(10px); transition: .2s ease; }
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #cbd8e5;
    border-top-color: var(--blue-600);
    border-radius: 50%;
    animation: spin .8s linear infinite;
    vertical-align: -3px;
}

.subnav {
    display: flex;
    gap: 22px;
    margin: -6px 0 22px;
    border-bottom: 1px solid var(--line);
}
.subnav a {
    position: relative;
    padding: 0 2px 12px;
    color: #748299;
    font-size: 13px;
    font-weight: 600;
}
.subnav a:hover { color: #263851; }
.subnav a.active { color: #172a45; }
.subnav a.active::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 2px;
    background: #172a45;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Login */
.login-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    overflow: hidden;
    padding: 28px 18px;
    background:
        radial-gradient(circle at 56% 20%, rgba(31, 86, 161, .58), transparent 38%),
        var(--ink-950);
}
.login-page::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 12% 22%, #65dfff 0 2px, transparent 3px),
        radial-gradient(circle at 75% 16%, #65dfff 0 2px, transparent 3px),
        radial-gradient(circle at 47% 76%, #24d3a5 0 3px, transparent 4px),
        radial-gradient(circle at 85% 68%, #65dfff 0 2px, transparent 3px),
        linear-gradient(rgba(92, 155, 218, .19) 1px, transparent 1px),
        linear-gradient(90deg, rgba(92, 155, 218, .19) 1px, transparent 1px);
    background-size: auto, auto, auto, auto, 72px 72px, 72px 72px;
}
.login-page::after {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 0 100%, transparent 0 220px, rgba(75, 157, 232, .28) 221px 222px, transparent 223px),
        radial-gradient(circle at 92% 3%, transparent 0 305px, rgba(75, 157, 232, .23) 306px 307px, transparent 308px);
}
.login-card {
    position: relative;
    z-index: 1;
    width: min(100%, 430px);
    padding: 38px 38px 34px;
    border: 1px solid #2a4f76;
    border-radius: 18px;
    background: rgba(9, 31, 56, .97);
    box-shadow: 0 30px 90px rgba(0, 8, 20, .48);
}
.login-logo { width: 44px; height: 44px; margin-bottom: 28px; padding: 6px; border-radius: 9px; background: #fff; }
.login-title { margin-bottom: 7px; color: #eff6ff; font-size: 28px; font-weight: 780; }
.login-subtitle { margin-bottom: 28px; color: #8fa8c2; }
.login-card .form-group label { color: #b8cce0; }
.login-card .form-group input {
    min-height: 50px;
    border-color: #294a6b;
    color: #eef7ff;
    background: #071a30;
}
.login-card .form-group input:focus { border-color: #4d98ff; box-shadow: 0 0 0 3px rgba(66, 143, 247, .22); }
.login-card .btn { min-height: 50px; margin-top: 4px; }
.login-error { display: none; margin-bottom: 16px; padding: 10px 12px; border: 1px solid rgba(242, 113, 124, .4); border-radius: 7px; color: #ffb2b8; background: rgba(195, 62, 72, .16); }
.login-error.show { display: block; }

/* Public redemption flow */
.customer-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 28px 16px;
    background:
        radial-gradient(circle at 18% 10%, rgba(52, 120, 246, .13), transparent 28%),
        radial-gradient(circle at 88% 82%, rgba(22, 184, 200, .12), transparent 30%),
        #eef3f8;
}
.customer-card {
    position: relative;
    width: min(100%, 530px);
    min-height: 560px;
    padding: 42px 44px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(22, 45, 76, .13);
}
.customer-card::before {
    content: "WPS MEMBER";
    position: absolute;
    top: 24px;
    right: 26px;
    color: #98a7ba;
    font: 700 9px/1 Bahnschrift, sans-serif;
    letter-spacing: .17em;
}
.customer-logo { float: left; width: 48px; height: 48px; margin: 0 13px 0 0; padding: 6px; border-radius: 11px; background: #fff; box-shadow: 0 8px 22px rgba(37, 99, 235, .14); }
.customer-title { min-height: 48px; color: #14233b; font-size: 27px; font-weight: 780; line-height: 48px; }
.customer-subtitle { clear: both; padding-top: 8px; color: var(--muted); }
.completion-hero .customer-title { min-height: 0; line-height: 1.3; }
.completion-hero .customer-subtitle { padding-top: 3px; }
.card-key-box { margin: 22px 0 30px; padding: 12px 14px; border: 1px solid #cfe0f7; border-radius: 7px; color: #315d94; background: #f2f7ff; font-family: "Cascadia Mono", Consolas, monospace; }
.steps { display: flex; align-items: flex-start; margin: 0 0 30px; }
.step { display: grid; min-width: 82px; place-items: center; gap: 7px; color: #8b98a9; font-size: 11px; text-align: center; }
.step-num { display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; border: 1px solid #cad4df; border-radius: 50%; color: #718099; background: #fff; font-weight: 700; }
.step.active, .step.done { color: var(--blue-600); }
.step.active .step-num, .step.done .step-num { color: #fff; border-color: var(--blue-600); background: var(--blue-600); box-shadow: 0 0 0 4px var(--blue-100); }
.step-line { flex: 1; height: 1px; margin-top: 15px; background: #dbe3ec; }
.step-line.done { background: var(--blue-600); }
.step-panel { display: none; }
.step-panel.active { display: block; }
.processing-status { display: flex; margin-top: 16px; align-items: center; justify-content: center; gap: 10px; color: #4771a8; font-size: 13px; }
.processing-status[hidden] { display: none; }
.completion-hero { margin: 8px 0 28px; text-align: center; }
.completion-check { display: inline-flex; width: 58px; height: 58px; margin-bottom: 15px; align-items: center; justify-content: center; border-radius: 50%; color: #fff; background: var(--green-600); box-shadow: 0 8px 24px rgba(22, 163, 74, .22); font-size: 31px; font-weight: 800; }
.completion-details { overflow: hidden; border: 1px solid #dce7e1; border-radius: 12px; background: #fbfefc; }
.completion-details > div { display: flex; min-height: 50px; padding: 12px 16px; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid #e7eee9; }
.completion-details > div:last-child { border-bottom: 0; }
.completion-details span { color: var(--muted); font-size: 13px; }
.completion-details strong { color: #203044; text-align: right; overflow-wrap: anywhere; }
.completion-details .completion-status { color: var(--green-600); }
.processing-orbit { width: 18px; height: 18px; border: 2px solid #cfe0f7; border-top-color: var(--blue-600); border-radius: 50%; animation: processing-spin .8s linear infinite; }
@keyframes processing-spin { to { transform: rotate(360deg); } }
.code-row, .phone-row { display: flex; gap: 10px; }
.code-row input, .phone-row input { flex: 1; }
.result-panel { padding: 28px 20px; border-radius: 10px; text-align: center; }
.result-panel.loading { color: #285998; background: var(--blue-100); }
.result-panel.success { color: var(--green-600); background: var(--green-100); }
.result-panel.error, .result-panel.failed { color: var(--red-600); background: var(--red-100); }
.result-icon { margin-bottom: 8px; font-size: 34px; }
.result-title { margin-bottom: 5px; font-size: 17px; font-weight: 750; }
.result-desc { opacity: .78; }
.tutorial-fab { position: fixed; right: 22px; bottom: 22px; z-index: 20; display: inline-flex; width: 54px; height: 54px; align-items: center; justify-content: center; border-radius: 50%; color: #fff; background: var(--ink-800); box-shadow: var(--shadow); }

.region-row, .region-table { width: 100%; }
.region-dot { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: var(--cyan-500); }

.sidebar-backdrop { display: none; }
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
    .sidebar.show { transform: translateX(0); }
    .main { margin-left: 0; }
    .sidebar-toggle { display: inline-flex; align-items: center; justify-content: center; margin-right: 8px; }
    .sidebar-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(4, 15, 27, .48); }
    .sidebar-backdrop.show { display: block; }
    .content { width: 100%; padding: 26px 22px 42px; }
    .stat-grid { --stat-columns: 2 !important; }
    .toolbar { align-items: stretch; flex-direction: column; }
    .toolbar-left, .toolbar-right { width: 100%; flex-basis: auto; }
    .toolbar-left, .toolbar-right { flex-wrap: wrap; }
    .toolbar-right { min-width: 0; margin-left: 0; justify-content: flex-start; }
    .toolbar .search-box { width: min(100%, 280px); flex-basis: 280px; }
}
@media (max-width: 700px) {
    .stat-grid { --stat-columns: 1 !important; }
    .stat-card, .stat-card:last-child { border: 1px solid var(--line); }
    .toolbar { align-items: stretch; flex-direction: column; }
    .toolbar-left, .toolbar-right { width: 100%; }
    .search-box { flex: 1; }
    .form-row { flex-direction: column; gap: 0; }
    .pagination { align-items: flex-start; flex-direction: column; }
	.xiaomi-heading { align-items:flex-start; flex-direction:column; }
	.pool-counts { width:100%; margin-left:0; }
}
@media (max-width: 520px) {
    :root { --topbar-height: 64px; }
    .topbar { padding: 0 14px; }
    .username-text { display: none; }
    .content { padding: 22px 12px 32px; }
    .toolbar .search-box { width: 100%; flex: 1 1 100%; }
    .page-heading { margin-bottom: 20px; }
    .page-heading h1 { font-size: 21px; }
    .card { padding: 18px 14px; }
    .login-card { padding: 32px 24px 28px; }
    .customer-page { padding: 10px; }
    .customer-card { min-height: calc(100vh - 20px); padding: 36px 22px; border-radius: 14px; }
    .customer-card::before { top: 18px; right: 18px; }
    .step { min-width: 70px; }
    .code-row { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
