
/* PC desktop shell — theme tokens from theme.css; dark defaults here */
:root {
  color-scheme: dark;
  --bg: #151a22;
  --card: #1e2530;
  --sf2: #243041;
  --bd: rgba(255,255,255,.12);
  --tx: #eef1f5;
  --mut: #a3afbe;
  --dim: #94a3b8;
  --acc: #2dd4a0;
  --acc2: #14b88a;
  --hlf: #2dd4a0;
  --hlb: rgba(45,212,160,.13);
  --gold: #f4c04e;
  --danger: #f6465d;
  --divider: rgba(255,255,255,.08);
  --hover: #293443;
  --button-bg: #23bf90;
  --button-tx: #07291f;
  --success-bg: rgba(45,212,160,.13);
  --danger-bg: rgba(246,70,93,.12);
  --warning-bg: rgba(244,192,78,.12);
  --overlay: rgba(0,0,0,.55);
  --field-ring: rgba(255,255,255,.10);
  --shadow: 0 18px 48px rgba(0,0,0,.35);
  --sidebar: 220px;
  --topbar: 56px;
  --r: 12px;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Inter, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--tx);
  font-size: 14px;
  line-height: 1.5;
}
a { color: var(--acc); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.muted { color: var(--mut); font-size: 12px; }
.center { text-align: center; }
.mono { font-family: ui-monospace, Consolas, monospace; word-break: break-all; }
.row { display: flex; align-items: center; }
.gap { gap: 10px; }
.err {
  color: var(--danger);
  background: var(--danger-bg);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 10px 0 0;
  font-size: 13px;
}
.warn {
  color: var(--gold);
  background: var(--warning-bg);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0 0 12px;
  font-size: 13px;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 0 14px; border-radius: 9px;
  border: 1px solid var(--bd); background: var(--sf2); color: var(--tx);
}
.btn:hover { background: var(--hover); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--button-bg); color: var(--button-tx); border-color: transparent; font-weight: 650; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; }
.btn.danger { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.btn.sm { min-height: 30px; padding: 0 10px; font-size: 12px; }
.btn.block { width: 100%; min-height: 44px; }

/* Fields */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; color: var(--mut); }
input, select, textarea {
  min-height: 40px; padding: 8px 12px; border-radius: 9px; border: 0;
  background: var(--sf2); box-shadow: inset 0 0 0 1px var(--field-ring); outline: none;
}
input:focus, select:focus, textarea:focus { box-shadow: inset 0 0 0 1px var(--acc); }
.inline-field { display: inline-flex; align-items: center; gap: 8px; color: var(--mut); font-size: 12px; }
.inline-field select { min-height: 34px; }
.inline-check { display: inline-flex; align-items: center; gap: 6px; color: var(--mut); font-size: 12px; }

/* Card / layout */
.card {
  background: var(--card);
  border: 1px solid var(--divider);
  border-radius: var(--r);
  padding: 16px 18px;
}
.card-title { font-weight: 650; margin-bottom: 12px; }

.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--topbar);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px; background: var(--card); border-bottom: 1px solid var(--divider); z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--tx); font-weight: 700; font-size: 16px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--acc); color: var(--button-tx); font-size: 14px;
}
.badge-edition {
  font-size: 11px; font-weight: 500; padding: 2px 6px; border-radius: 5px;
  background: var(--hlb); color: var(--hlf);
}
.topbar-right { display: flex; align-items: center; gap: 14px; }
.theme-field { display: flex; align-items: center; gap: 8px; color: var(--mut); font-size: 12px; }
.theme-field select { min-height: 34px; min-width: 110px; }
.link-pill {
  font-size: 12px; color: var(--mut); border: 1px solid var(--bd);
  border-radius: 8px; padding: 7px 10px;
}
.link-pill:hover { color: var(--tx); background: var(--hover); }

/* Login */
.view-login {
  min-height: 100vh; display: grid; place-items: center; padding: calc(var(--topbar) + 24px) 16px 40px;
}
.login-card { width: min(400px, 100%); }
.login-hero { text-align: center; margin-bottom: 18px; }
.login-hero .logo {
  width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 14px;
  display: grid; place-items: center; background: var(--acc); color: var(--button-tx); font-weight: 700; font-size: 20px;
}
.login-hero h1 { margin: 0 0 6px; font-size: 22px; }

/* Main shell */
.view-main {
  display: flex; min-height: 100vh; padding-top: var(--topbar);
}
.sidebar {
  position: fixed; top: var(--topbar); left: 0; bottom: 0; width: var(--sidebar);
  background: var(--card); border-right: 1px solid var(--divider);
  display: flex; flex-direction: column; padding: 18px 12px 14px; z-index: 30; overflow: auto;
}
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-sep { height: 1px; margin: 10px 10px; background: var(--divider); pointer-events: none; }
.side-link {
  min-height: 42px; border: 0; border-radius: 9px; background: transparent;
  color: var(--mut); text-align: left; padding: 0 14px; display: flex; align-items: center; gap: 8px;
}
.side-link:hover { background: var(--hover); color: var(--tx); }
.side-link.active { background: var(--hlb); color: var(--hlf); font-weight: 650; }
.side-link .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--danger); margin-left: auto;
}
.offline-banner {
  margin: 0 0 14px; padding: 10px 14px; border-radius: 9px;
  background: var(--danger); color: #fff; font-weight: 600; cursor: pointer;
}
.side-foot { margin-top: auto; padding: 16px 10px 4px; }
.side-user { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot .muted { margin: 8px 0 12px; line-height: 1.6; }

.main {
  margin-left: var(--sidebar);
  flex: 1; min-width: 0;
  width: calc(100% - var(--sidebar));
  padding: 22px 28px 40px;
  max-width: none; /* grow with window */
}
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  margin-bottom: 16px;
}
.page-header h2 { margin: 0 0 4px; font-size: 24px; }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tool-inline { gap: 14px; }

/* Accept switch */
.accept-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 16px;
}
.accept-title { font-weight: 650; margin-bottom: 4px; }
.switch { position: relative; width: 48px; height: 28px; flex: 0 0 auto; }
.switch input { opacity: 0; position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; z-index: 2; margin: 0; }
.switch-ui {
  position: absolute; inset: 0; border-radius: 999px; background: var(--bd);
  transition: .15s background;
}
.switch-ui::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  border-radius: 50%; background: #fff; transition: .15s transform;
}
.switch input:checked + .switch-ui { background: var(--acc); }
.switch input:checked + .switch-ui::after { transform: translateX(20px); }

/* KPI */
.kpi-row {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px;
}
.kpi {
  background: var(--card); border: 1px solid var(--divider); border-radius: var(--r); padding: 16px 18px;
}
.kpi .k { font-size: 12px; color: var(--mut); margin-bottom: 8px; }
.kpi .v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi .s { margin-top: 6px; font-size: 12px; color: var(--mut); }

.quick-row {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px;
}
.quick {
  text-align: left; border: 1px solid var(--divider); border-radius: 12px;
  background: var(--sf2); padding: 16px; min-height: 78px;
  display: flex; flex-direction: column; gap: 6px;
}
.quick:hover { background: var(--hover); border-color: var(--bd); }
.quick strong { font-size: 14px; }
.quick span { font-size: 12px; color: var(--mut); }

/* Filter / seg / chips */
.filter-bar { margin-bottom: 12px; display: flex; flex-direction: column; gap: 12px; }
.filter-grid {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; align-items: center;
}
.seg { display: inline-flex; background: var(--sf2); border-radius: 10px; padding: 3px; width: fit-content; }
.seg-btn {
  border: 0; background: transparent; color: var(--mut); min-height: 34px; padding: 0 16px; border-radius: 8px;
}
.seg-btn.active { background: var(--card); color: var(--tx); font-weight: 650; box-shadow: 0 1px 0 var(--divider); }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 0; border-radius: 999px; min-height: 30px; padding: 0 12px;
  background: var(--sf2); color: var(--mut);
}
.chip.active, .chip.on {
  background: var(--hlb); color: var(--hlf); box-shadow: inset 0 0 0 1px var(--acc);
}

/* Table */
.table-hint { margin: 0 0 8px; }
.table-wrap { padding: 0; overflow: auto; }
.pc-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.pc-table thead th {
  position: sticky; top: 0; z-index: 1;
  text-align: left; font-weight: 600; color: var(--mut); font-size: 12px;
  background: var(--card); border-bottom: 1px solid var(--divider);
  padding: 12px 16px; white-space: nowrap;
}
.pc-table tbody td {
  padding: 14px 16px; border-bottom: 1px solid var(--divider);
  vertical-align: middle; font-variant-numeric: tabular-nums;
}
.pc-table tbody tr:hover td { background: var(--hover); }
.pc-table tbody tr:last-child td { border-bottom: 0; }
.col-actions { text-align: right; white-space: nowrap; }
.col-actions .btn { margin-left: 6px; }
.amt-cell { font-size: 16px; font-weight: 700; }
.sub-cell { color: var(--mut); font-size: 12px; margin-top: 4px; line-height: 1.45; }
.empty {
  text-align: center; color: var(--mut); padding: 48px 16px;
  border-top: 1px dashed var(--bd);
}
.table-foot, .page-bar {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 12px 16px; border-top: 1px solid var(--divider); flex-wrap: wrap;
}
.page-bar-nums { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.page-bar-num, .page-bar-nav {
  min-height: 32px; min-width: 32px; padding: 4px 10px;
  border-radius: 8px; border: 1px solid var(--bd, var(--divider));
  background: var(--card); color: var(--tx); font-size: 13px;
  font-variant-numeric: tabular-nums; cursor: pointer;
}
.page-bar-num.is-active {
  background: var(--acc); border-color: var(--acc); color: #fff; font-weight: 700;
}
.page-bar-num:disabled, .page-bar-nav:disabled { opacity: 0.4; cursor: not-allowed; }
.page-bar-ellipsis { min-width: 18px; text-align: center; color: var(--mut); user-select: none; }
.page-sum {
  margin: 0; padding: 10px 16px; color: var(--mut); font-size: 12px; line-height: 1.5;
  font-variant-numeric: tabular-nums; white-space: pre-line;
}
.range-custom { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.range-custom input[type="date"] { max-width: 150px; }


/* Badge */
.badge {
  display: inline-flex; align-items: center; border-radius: 999px;
  padding: 2px 8px; font-size: 12px; background: var(--sf2); color: var(--mut);
}
.badge.success, .badge.b-ok { background: var(--success-bg); color: var(--hlf); }
.badge.warn, .badge.b-wait, .badge.grabbed { background: var(--warning-bg); color: var(--gold); }
.badge.danger, .badge.b-bad { background: var(--danger-bg); color: var(--danger); }
.count.warn { color: var(--danger); font-weight: 650; }

/* Form grid */
.form-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; max-width: 960px;
}
.totp-box { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }

/* Modal */
.modal-root {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center; padding: 24px;
}
.modal-backdrop { position: absolute; inset: 0; background: var(--overlay); }
.modal {
  position: relative; z-index: 1; width: min(640px, 100%);
  max-height: calc(100vh - 48px); overflow: auto;
  padding: 0; box-shadow: var(--shadow);
}
.modal.wide { width: min(760px, 100%); }
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 18px; border-bottom: 1px solid var(--divider); position: sticky; top: 0; background: var(--card); z-index: 2;
}
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-body { padding: 16px 18px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap;
  padding: 12px 18px 16px; border-top: 1px solid var(--divider);
}
.dd-sec { border: 1px solid var(--divider); border-radius: 10px; overflow: hidden; }
.dd-row {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 12px 14px; border-top: 1px solid var(--divider); font-size: 13px;
}
.dd-row:first-child { border-top: 0; }
.dd-row span { color: var(--mut); flex: 0 0 120px; }
.dd-row b { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.order-amount { font-size: 28px; font-weight: 750; margin: 0 0 12px; font-variant-numeric: tabular-nums; }
.detail-note { color: var(--mut); font-size: 12px; margin: 0 0 12px; line-height: 1.6; }
.qr-preview { max-width: 180px; border-radius: 10px; display: block; margin-top: 8px; }
.check-row { display: flex; align-items: flex-start; gap: 8px; margin: 10px 0 14px; font-size: 13px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tone-in { color: var(--hlf); }
.tone-out { color: var(--danger); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  z-index: 90; min-width: 220px; max-width: 460px;
  background: var(--card); border: 1px solid var(--bd); border-radius: 10px;
  padding: 12px 16px; box-shadow: var(--shadow); text-align: center;
}
.toast.ok { color: var(--hlf); }
.toast.err { color: var(--danger); }

@media (max-width: 1200px) {
  .kpi-row, .quick-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  :root { --sidebar: 0px; }
  .sidebar {
    position: static; width: auto; height: auto;
    border-right: 0; border-bottom: 1px solid var(--divider);
    flex-direction: column;
  }
  .view-main { flex-direction: column; }
  .main { margin-left: 0; padding: 16px; }
  .side-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .side-sep { display: none; }
  .side-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 10px; }
  .side-foot p { display: none; }
  .kpi-row, .quick-row, .filter-grid, .two-col { grid-template-columns: 1fr 1fr; }
  .page-header { flex-direction: column; }
}

/* Prevent login flash on refresh when session token exists (must beat [hidden]) */
html.authed-boot #view-login { display: none !important; }
html.authed-boot #view-main[hidden],
html.authed-boot #view-main { display: flex !important; }


/* iOS accept switch (codes table) */
.ios-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
  vertical-align: middle;
}
.ios-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
  min-height: 0;
}
.ios-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--divider, #d1d5db);
  border-radius: 999px;
  transition: background .2s;
}
.ios-slider::before {
  content: "";
  position: absolute;
  height: 22px;
  width: 22px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .2s;
}
.ios-switch input:checked + .ios-slider { background: var(--acc, #2563eb); }
.ios-switch input:checked + .ios-slider::before { transform: translateX(18px); }
.ios-switch input:disabled + .ios-slider { opacity: .45; cursor: not-allowed; }
.pc-table .ios-switch { margin: 0 auto; }
.pc-table td.col-switch { text-align: center; width: 64px; }
.pc-table .site-link { color: var(--acc); text-decoration: none; display: inline-block; max-width: 14em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.pc-table .site-link:hover { text-decoration: underline; }
.code-money-cell strong { font-variant-numeric: tabular-nums; }

/* 代充账户列表 */
.pc-table .col-switch { width: 64px; text-align: center; }
.trial-cell { min-width: 220px; }
.trial-row { display: flex; gap: 6px; align-items: center; }
.trial-amount { width: 120px; height: 30px; }
.trial-result { margin-top: 4px; }
.pc-table .code-money-cell { white-space: nowrap; }
.pc-table .site-link { color: var(--acc, #2563eb); text-decoration: none; display: inline-block; max-width: 14em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.pc-table .site-link:hover { text-decoration: underline; }
.pc-table tr.is-limited td { opacity: .85; }
.pc-table tr.is-limited .code-money-cell strong { color: var(--warn, #d97706); }
.ios-switch input:checked + .ios-slider { background: #34c759; }
.ios-switch input:disabled + .ios-slider { opacity: .45; cursor: not-allowed; }
.ios-switch input:checked + .ios-slider::before { transform: translateX(18px); }
.code-remark-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.plat-chip {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
  padding: 2px 8px; border-radius: 999px; line-height: 1.4;
  background: color-mix(in srgb, var(--acc, #2563eb) 14%, transparent);
  color: var(--acc, #2563eb);
}
.plat-chip.plat-wg { background: #e0f2fe; color: #0369a1; }
.plat-chip.plat-bb { background: #fef3c7; color: #b45309; }
html[data-theme="dark"] .plat-chip.plat-wg { background: #0c4a6e; color: #7dd3fc; }
html[data-theme="dark"] .plat-chip.plat-bb { background: #78350f; color: #fcd34d; }
.pc-table .col-seq { width: 40px; text-align: center; color: var(--muted, #94a3b8); font-variant-numeric: tabular-nums; }
.pc-table .progress-sep { opacity: .55; margin: 0 2px; }

/* Codes page: fluid table + fill remaining viewport height */
.page-codes {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--topbar) - 44px);
  width: 100%;
}
.page-codes .page-header,
.page-codes .filter-bar { flex: 0 0 auto; }
.page-codes .codes-table-wrap {
  flex: 1 1 auto;
  width: 100%;
  min-height: 240px;
  max-height: calc(100vh - var(--topbar) - 200px);
  overflow: auto;
}
.page-codes .codes-table-fluid {
  width: 100%;
  min-width: 100%;
  table-layout: auto;
}
/* 收款账户表：固定列宽、单行省略、行高固定，内容变化时行和列都不跳 */
.page-codes .codes-table-fluid { table-layout: fixed; min-width: 1100px; }
.page-codes .codes-table-fluid th[data-col="seq"] { width: 44px; }
.page-codes .codes-table-fluid th[data-col="remark"] { width: 200px; }
.page-codes .codes-table-fluid th[data-col="status"] { width: 140px; }
.page-codes .codes-table-fluid th[data-col="progress"] { width: 180px; }
.page-codes .codes-table-fluid th[data-col="balance"] { width: 150px; }
.page-codes .codes-table-fluid th[data-col="rate"] { width: 130px; }
.page-codes .codes-table-fluid th[data-col="last"] { width: 140px; }
.page-codes .codes-table-fluid th[data-col="channels"] { width: 130px; }
.page-codes .codes-table-fluid th[data-col="accept"] { width: 64px; }
.page-codes .codes-table-fluid th[data-col="actions"] { width: 170px; }
.ch-cell-link { display: block; width: 100%; text-align: left; padding: 6px 8px; margin: -6px -8px; border: 0; border-radius: 6px; background: transparent; color: var(--acc, #2563eb); cursor: pointer; font: inherit; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-cell-link:hover { background: var(--hover, rgba(0,0,0,.05)); }
.ch-cell-link.warn { color: var(--warn, #d97706); }
.code-site-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.page-codes .codes-table-fluid tbody td { padding: 8px 12px; min-height: 58px; overflow: hidden; }
.page-codes .codes-table-fluid thead th { padding: 10px 12px; }
.page-codes .codes-table-fluid td > div,
.page-codes .codes-table-fluid td .sub-cell,
.page-codes .codes-table-fluid td .probe-status { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-codes .codes-table-fluid td .sub-cell { margin-top: 2px; }
.page-codes .codes-table-fluid .code-remark-row { flex-wrap: nowrap; min-width: 0; }
.page-codes .codes-table-fluid .code-remark-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.page-codes .codes-table-fluid .code-status-reason { max-width: none; }
.page-codes .codes-table-fluid .site-link { max-width: 100%; }
.page-codes .codes-table-fluid .col-actions { white-space: nowrap; }
.page-codes .codes-table-fluid .col-actions .btn { margin-left: 4px; }
.page-codes .codes-table-fluid td[data-col="channels"] .btn { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.page-codes .codes-table-fluid th[hidden],
.page-codes .codes-table-fluid td[hidden] { display: none !important; }
.probe-cell { min-width: 110px; }
.probe-cell .probe-status { font-weight: 650; font-size: 13px; }
.probe-cell .probe-status.is-ok { color: var(--hlf); }
.probe-cell .probe-status.is-bad { color: var(--danger); }
.probe-cell .probe-status.is-run { color: var(--gold); }
.probe-cell .probe-status.is-idle { color: var(--mut); font-weight: 500; }
.balance-cell { font-variant-numeric: tabular-nums; white-space: nowrap; }
.balance-cell strong { font-size: 15px; }
.cols-pick {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px;
}
.cols-pick label {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
  padding: 6px 0; cursor: pointer;
}
.page-codes .page-actions { flex-wrap: wrap; justify-content: flex-end; }


/* code dispatch status */
.code-status-cell .badge { font-weight: 650; }
.badge.info { background: rgba(59,130,246,.15); color: #60a5fa; }
.pc-table tr.is-status-warn td { background: rgba(244,192,78,.06); }
.pc-table tr.is-status-bad td { background: rgba(246,70,93,.06); }
.pc-table tr.is-status-info td { background: rgba(59,130,246,.06); }
.status-inflight-chip {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 999px;
  font-size: 11px; background: var(--sf2); color: var(--mut); border: 1px solid var(--bd);
}
.code-status-reason { margin-top: 4px; font-size: 12px; color: var(--mut); max-width: 12em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ch-group-side { display: flex; align-items: center; gap: 12px; }
.ch-bigscan { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 400; cursor: pointer; }
.ch-rulebar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; margin-bottom: 10px; border: 1px solid var(--bd); border-radius: 10px; font-size: 13px; }
.ch-rulebar .sub-cell { font-size: 12px; color: var(--mut); }
.ch-amt-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.ch-amt-chip { height: 30px; padding: 0 12px; border: 1px solid var(--bd); border-radius: 8px; background: transparent; color: inherit; cursor: pointer; font-variant-numeric: tabular-nums; }
.ch-amt-chip.is-on { border-color: var(--acc, #2563eb); background: var(--acc, #2563eb); color: #fff; }
.ch-native { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 999px; font-size: 11px; line-height: 18px; color: #fff; background: #16a34a; vertical-align: 1px; }
.ch-group-note { margin: 0; padding: 10px 12px; border-top: 1px solid var(--bd); font-size: 12px; color: var(--mut); }
.ch-toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.ch-toolbar .input { height: 32px; }
#ch-search { flex: 1; min-width: 160px; }
#ch-sort { width: 140px; }
.ch-chips { display: flex; gap: 4px; }
.ch-chip { height: 32px; padding: 0 12px; border: 1px solid var(--bd); border-radius: 999px; background: transparent; color: var(--mut); cursor: pointer; }
.ch-chip.is-on { background: var(--sf2); color: inherit; border-color: var(--fg, var(--bd)); }
.ch-summary { margin: 0 0 10px; font-size: 12px; color: var(--mut); }
.ch-group { margin-bottom: 14px; border: 1px solid var(--bd); border-radius: 10px; overflow: hidden; }
.ch-group-head { display: flex; align-items: baseline; justify-content: space-between; padding: 8px 12px; background: var(--sf2); font-weight: 600; }
.modal.ch-modal { width: min(980px, 100%); }
.ch-item { border-top: 1px solid var(--bd); }
.ch-item.is-on { background: var(--sf); }
.ch-row { display: grid; grid-template-columns: 200px minmax(0, 1fr) 128px 132px 60px; align-items: center; gap: 10px; padding: 7px 12px; }
.ch-amt { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.ch-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-state { font-size: 12px; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-act { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.ch-ntype { width: 120px; height: 28px; padding: 2px 6px; font-size: 12px; }
.ch-ntype.is-missing { border-color: var(--gold); }
.ch-row > .btn { justify-self: end; }
.ch-kind { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 400; color: var(--mut); border: 1px solid var(--bd); vertical-align: 1px; }
.ch-kind.is-fixed { color: var(--warn, #d97706); border-color: currentColor; }
.ch-expand { display: flex; flex-direction: column; gap: 8px; padding: 4px 12px 12px; }
.ch-expand .sub-cell { margin: 0; }
.ch-expand .trial-row { flex-wrap: wrap; }
@media (max-width: 640px) {
  .ch-row { grid-template-columns: minmax(0, 1fr) auto auto; }
  .ch-amt { grid-column: 1 / -1; }
  .ch-state { display: none; }
}
.ch-detail { display: flex; flex-direction: column; gap: 8px; }
.ch-detail-amt { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ch-remark { white-space: pre-wrap; line-height: 1.6; padding: 10px 12px; border-radius: 8px; background: var(--sf2); }

/* 收款账户：异常条 / 批量条 / 行选择 / 变化高亮 / 详情抽屉 */
.codes-alerts { display: flex; align-items: center; gap: 12px; margin: 0 0 10px; padding: 9px 14px; border-radius: 9px; background: rgba(246,70,93,.1); border: 1px solid rgba(246,70,93,.35); }
.codes-alerts-main { flex: 1; font-weight: 600; color: var(--danger); }
.codes-batch { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; padding: 8px 14px; position: sticky; top: 0; z-index: 3; }
.codes-batch #codes-batch-count { font-weight: 600; margin-right: 6px; }
.row-pick { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.row-pick input { margin: 0; }
.page-codes .codes-table-fluid th[data-col="seq"] { width: 64px; }
.pc-table tr.is-picked td { background: rgba(37,99,235,.07); }
.pc-table tr.is-changed td { animation: rowflash 1.2s ease-out; }
@keyframes rowflash { from { background: rgba(250,204,21,.28); } to { background: transparent; } }
.code-name-link { border: 0; padding: 0; background: none; font: inherit; font-weight: 700; color: inherit; cursor: pointer; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.code-name-link:hover { color: var(--acc, #2563eb); text-decoration: underline; }
.code-drawer { position: fixed; inset: 0; z-index: 70; }
.code-drawer-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.18); }
.code-drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 100%); border-radius: 0; display: flex; flex-direction: column; animation: drawerin .18s ease-out; }
@keyframes drawerin { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.code-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--divider); }
.code-drawer-head h3 { margin: 0; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-drawer-body { flex: 1; overflow: auto; padding: 12px 18px 18px; }
.dr-sec { padding: 10px 0; border-bottom: 1px solid var(--divider); }
.dr-sec h4 { margin: 0 0 8px; font-size: 13px; color: var(--mut); font-weight: 600; }
.dr-kv { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 13px; }
.dr-kv > span:first-child { color: var(--mut); flex: none; }
.dr-kv > span:last-child { text-align: right; min-width: 0; }
.dr-kv .sub-cell { margin-top: 0; }
.dr-table td { padding: 6px 4px !important; height: auto !important; }
.dr-actions { display: flex; gap: 8px; padding-top: 12px; }

/* USDT 充值页 */
.page-topup { --tp-acc: var(--acc, #2dd4a0); --tp-acc-bg: rgba(45,212,160,.12); --tp-gold: var(--gold, #f4c04e); }
.tp-hero { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  margin-bottom: 14px; padding: 22px 26px; border-radius: 16px; border: 1px solid rgba(45,212,160,.25);
  background: radial-gradient(120% 140% at 0% 0%, rgba(45,212,160,.22), transparent 55%), radial-gradient(90% 120% at 100% 100%, rgba(244,192,78,.14), transparent 60%), var(--card); }
.tp-hero-main { display: flex; align-items: center; gap: 16px; }
.tp-hero-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; font-size: 28px; font-weight: 800; color: #062b20;
  background: linear-gradient(135deg, #34e3b0, #1fae84); box-shadow: 0 8px 22px rgba(45,212,160,.35); }
.tp-hero h2 { margin: 0 0 4px; font-size: 22px; }
.tp-hero p { margin: 0; color: var(--mut); font-size: 13px; }
.tp-hero-rate { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; padding: 10px 16px; border-radius: 12px; background: rgba(0,0,0,.18); border: 1px solid rgba(255,255,255,.06); }
.tp-hero-rate-k { font-size: 12px; color: var(--mut); }
.tp-hero-rate-v { font-size: 20px; font-weight: 750; color: var(--tp-acc); font-variant-numeric: tabular-nums; }
.tp-hero-rate.is-bad .tp-hero-rate-v { color: var(--danger); }
.tp-closed { display: flex; align-items: center; gap: 14px; padding: 22px 24px; }
.tp-closed p { margin: 4px 0 0; }
.tp-closed-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: rgba(244,192,78,.15); color: var(--tp-gold); font-weight: 800; }
.tp-grid { display: grid; grid-template-columns: minmax(340px, 1fr) minmax(400px, 1.2fr); gap: 14px; align-items: stretch; }
@media (max-width: 1000px) { .tp-grid { grid-template-columns: 1fr; } }
.tp-form, .tp-pay { padding: 22px 24px; display: flex; flex-direction: column; gap: 16px; border-radius: 16px; }
.tp-pay { transition: border-color .2s, box-shadow .2s; }
.tp-pay.is-live { border-color: rgba(45,212,160,.45); box-shadow: 0 0 0 1px rgba(45,212,160,.15), 0 12px 32px rgba(0,0,0,.18); }
.tp-step { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 15px; }
.tp-num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--tp-acc); color: #062b20; font-size: 12px; font-weight: 800; }
.tp-amount-box { display: flex; align-items: center; gap: 10px; padding: 8px 18px; border: 1.5px solid var(--bd, var(--divider)); border-radius: 14px; background: var(--sf2); cursor: text; transition: border-color .15s, box-shadow .15s; }
.tp-amount-box:focus-within { border-color: var(--tp-acc); box-shadow: 0 0 0 4px rgba(45,212,160,.14); }
.tp-cur { font-size: 26px; font-weight: 700; color: var(--mut); }
.tp-amount-box input, .tp-amount-box input:focus { flex: 1; min-width: 0; border: 0 !important; outline: 0; box-shadow: none !important; background: transparent !important; height: auto;
  color: inherit; font-size: 34px; font-weight: 750; font-variant-numeric: tabular-nums; padding: 8px 0; }
.tp-unit { font-size: 12px; font-weight: 700; color: var(--mut); padding: 3px 8px; border-radius: 6px; background: rgba(255,255,255,.06); }
.tp-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tp-quick button { height: 40px; border: 1px solid var(--bd, var(--divider)); border-radius: 10px; background: transparent; color: inherit; cursor: pointer; font-weight: 600; font-variant-numeric: tabular-nums; transition: all .15s; }
.tp-quick button:hover { border-color: var(--tp-acc); color: var(--tp-acc); }
.tp-quick button.is-on { border-color: var(--tp-acc); background: var(--tp-acc-bg); color: var(--tp-acc); }
.tp-est { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: 12px; background: var(--sf2); }
.tp-est-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--mut); }
.tp-est-row strong { font-size: 24px; color: var(--tp-acc); font-variant-numeric: tabular-nums; }
.tp-est-usdt { color: inherit; font-weight: 650; font-variant-numeric: tabular-nums; }
.tp-est-hint { font-size: 12px; color: var(--mut); padding-top: 6px; border-top: 1px dashed var(--bd, var(--divider)); }
.tp-submit { height: 48px; font-size: 16px; font-weight: 700; border-radius: 12px; }
.tp-tips { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; color: var(--mut); font-size: 12px; }
.tp-tips li { position: relative; padding-left: 16px; line-height: 1.6; }
.tp-tips li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 5px; height: 5px; border-radius: 50%; background: var(--tp-gold); }
.tp-tips strong { color: inherit; }
.tp-flow { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.tp-flow-item { display: flex; gap: 14px; align-items: flex-start; padding: 14px 4px; position: relative; }
.tp-flow-item:not(:last-child)::after { content: ""; position: absolute; left: 22px; top: 54px; bottom: -6px; width: 2px; background: linear-gradient(var(--tp-acc), transparent); opacity: .35; }
.tp-flow-ic { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--tp-acc-bg); color: var(--tp-acc); font-size: 18px; font-weight: 800; }
.tp-flow-item strong { font-size: 14px; }
.tp-flow-item p { margin: 4px 0 0; font-size: 12px; color: var(--mut); }
.tp-order-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; }
.tp-order-head .tp-count { margin-left: auto; }
.tp-count { font-size: 22px; font-weight: 750; font-variant-numeric: tabular-nums; padding: 2px 10px; border-radius: 8px; background: var(--sf2); }
.tp-count.is-low { color: var(--danger); background: rgba(246,70,93,.12); }
.tp-pay-amt { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 14px; border-radius: 14px; text-align: center;
  background: linear-gradient(180deg, rgba(45,212,160,.12), rgba(45,212,160,.03)); border: 1px solid rgba(45,212,160,.22); }
.tp-pay-k { font-size: 12px; color: var(--mut); letter-spacing: .5px; }
.tp-big { border: 0; background: none; color: var(--tp-acc); font-size: 40px; font-weight: 800; font-variant-numeric: tabular-nums; cursor: copy; line-height: 1.1; }
.tp-big small { font-size: 16px; margin-left: 6px; color: var(--mut); font-weight: 650; }
.tp-credit { font-size: 13px; color: var(--mut); }
.tp-credit strong { color: inherit; font-size: 15px; }
.tp-credit i { margin: 0 8px; font-style: normal; opacity: .5; }
.tp-copy-amt { margin-top: 2px; }
.tp-pay-body { display: flex; gap: 20px; align-items: stretch; flex-wrap: wrap; }
.tp-qr-wrap { flex: none; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.tp-qr { padding: 10px; border-radius: 14px; background: #fff; width: 188px; height: 188px; box-shadow: 0 6px 18px rgba(0,0,0,.2); }
.tp-net { font-size: 11px; font-weight: 700; color: var(--tp-acc); padding: 2px 10px; border-radius: 999px; background: var(--tp-acc-bg); }
.tp-pay-info { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.tp-addr { width: 100%; padding: 12px 14px; border-radius: 10px; background: var(--sf2); border: 1px solid var(--bd, var(--divider));
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 15px; line-height: 1.5; word-break: break-all; }
.tp-addr-end { color: var(--tp-gold); font-weight: 800; font-size: 17px; background: rgba(244,192,78,.12); border-radius: 4px; padding: 0 3px; }
.tp-addr-mid { color: var(--mut); padding: 0 2px; }
.tp-addr-hint { margin: 0; font-size: 12px; color: var(--mut); }
.tp-addr-hint b { color: var(--tp-gold); }
.tp-watch { display: flex; align-items: center; gap: 8px; margin-top: auto; font-size: 12px; color: var(--mut); }
.tp-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tp-acc); box-shadow: 0 0 0 0 rgba(45,212,160,.6); animation: tppulse 1.6s infinite; }
@keyframes tppulse { 0% { box-shadow: 0 0 0 0 rgba(45,212,160,.55); } 70% { box-shadow: 0 0 0 8px rgba(45,212,160,0); } 100% { box-shadow: 0 0 0 0 rgba(45,212,160,0); } }
.tp-pay-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--divider); }
.tp-check { height: 40px; padding: 0 18px; font-weight: 650; border-color: var(--tp-acc) !important; color: var(--tp-acc); }
.tp-pay-foot .muted { font-size: 12px; }
.tp-hist-card { margin-top: 14px; border-radius: 16px; overflow: hidden; }
.tp-hist-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 8px; }
.tp-tz { font-size: 12px; }
.tp-hist td strong { font-variant-numeric: tabular-nums; }
.tp-hash { font-family: ui-monospace, monospace; font-size: 12px; color: var(--tp-acc); }
.tp-none { padding: 30px 0; text-align: center; color: var(--mut); }

.tp-watch { padding: 8px 10px; border-radius: 8px; background: var(--sf2); line-height: 1.5; }
.tp-watch.is-ok { color: var(--tp-acc); background: var(--tp-acc-bg); }
.tp-watch.is-warn { color: var(--tp-gold); background: rgba(244,192,78,.1); }
.tp-watch b { font-variant-numeric: tabular-nums; }
.tp-check { height: 44px; padding: 0 22px; font-size: 15px; font-weight: 700; color: #062b20 !important; }
.tp-spin { display: inline-block; width: 12px; height: 12px; margin-right: 8px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; vertical-align: -1px; animation: tpspin .7s linear infinite; }
@keyframes tpspin { to { transform: rotate(360deg); } }

.ch-id { margin-left: 8px; font-size: 11px; font-weight: 400; color: var(--mut); font-family: ui-monospace, monospace; }
.ch-block-btn { margin-left: 8px; color: var(--danger) !important; }
.ch-row.ch-row-bl { grid-template-columns: minmax(0, 1fr) auto auto; }

.trial-fail { display: inline-flex; flex-direction: column; gap: 2px; padding: 6px 10px; border-radius: 8px; background: rgba(246,70,93,.08); border: 1px solid rgba(246,70,93,.25); max-width: 100%; }
.trial-fail .warn { word-break: break-all; }
.trial-fail .sub-cell { margin: 0; font-size: 12px; }

.ch-pm { display: inline-flex; align-items: center; gap: 4px; margin-right: 10px; cursor: pointer; }
