:root {
  color-scheme: light;
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --canvas: #f2f3f9;
  --surface: #fafbff;
  --surface-high: #ffffff;
  --sunk: rgba(20, 22, 43, 0.04);
  --ink: #14161f;
  --ink-soft: #343a4d;
  --muted: rgba(20, 22, 43, 0.58);
  --faint: rgba(20, 22, 43, 0.38);
  --hair: rgba(20, 22, 43, 0.08);
  --edge: rgba(20, 22, 43, 0.07);
  --brand: #6a4bff;
  --brand-ink: #4b33cc;
  --brand-soft: #eeeaff;
  --spark: #38bdf8;
  --wash: linear-gradient(95deg, #a9b6ff 0%, #b9a3ff 48%, #8fd4ff 100%);
  --ok: #0ea67a;
  --ok-soft: #e4f7f1;
  --danger: #d9434c;
  --danger-soft: #fdedee;
  --warn: #b06a12;
  --warn-soft: #fdf3e4;
  --shadow-card:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 1px 2px rgba(20, 22, 43, 0.04),
    0 18px 44px -30px rgba(20, 22, 43, 0.28);
  --shadow-lift:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 1px 2px rgba(20, 22, 43, 0.05),
    0 28px 60px -28px rgba(20, 22, 43, 0.32);
  --shadow-brand:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 10px 24px -12px rgba(106, 75, 255, 0.75);
  --shadow-pill: 0 1px 2px rgba(20, 22, 43, 0.05);
  --shadow-float:
    0 2px 6px rgba(20, 22, 43, 0.06),
    0 40px 80px -32px rgba(20, 22, 43, 0.45);
  --mono: "DM Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-ui: cubic-bezier(0.4, 0, 0.2, 1);
  --radius: 16px;
  --radius-card: 20px;
  --radius-row: 14px;
  --content: 1440px;
  /* 旧规则沿用的别名：改版前的选择器很多还在用这些名字，保留它们就不用改每一条 */
  --line: var(--hair);
  --line-strong: var(--edge);
  --white: var(--surface-high);
  --soft: var(--sunk);
  --mist: var(--sunk);
  --violet: var(--brand);
  --brand-deep: var(--brand-ink);
  --brand-gradient: var(--wash);
  --chip-indigo-bg: var(--brand-soft);
  --chip-indigo-text: var(--brand-ink);
  --chip-violet-bg: var(--brand-soft);
  --chip-violet-text: var(--brand-ink);
  --chip-green-bg: var(--ok-soft);
  --chip-green-text: var(--ok);
  --chip-red-bg: var(--danger-soft);
  --chip-red-text: var(--danger);
  --chip-amber-bg: var(--warn-soft);
  --chip-amber-text: var(--warn);
  --aurora-1: rgba(169, 182, 255, 0.22);
  --aurora-2: rgba(201, 187, 252, 0.2);
  --aurora-3: rgba(143, 201, 255, 0.18);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--canvas);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.6;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

body,
button,
a,
input,
textarea,
select {
  font-family: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: var(--brand-ink);
  text-decoration: none;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

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

.app-shell::before {
  content: "";
  position: fixed;
  inset: -22%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(42% 36% at 12% 8%, var(--aurora-1), transparent 70%),
    radial-gradient(38% 34% at 88% 4%, var(--aurora-2), transparent 70%),
    radial-gradient(46% 40% at 80% 88%, var(--aurora-3), transparent 70%),
    radial-gradient(34% 30% at 6% 90%, var(--aurora-2), transparent 70%);
  animation: aurora-drift 28s var(--ease-out) infinite alternate;
}

@keyframes aurora-drift {
  from { transform: translate3d(-1.2%, -0.8%, 0) scale(1); }
  to { transform: translate3d(1.2%, 1.6%, 0) scale(1.04); }
}

.site-header__inner {
  width: min(calc(100% - 48px), var(--content));
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

body.is-desk .site-header__inner {
  width: 100%;
  max-width: none;
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  align-items: center;
  padding: 0;
  gap: 0;
}

body.is-desk .brand {
  padding-left: 24px;
}

body.is-desk #logout-btn {
  justify-self: end;
  margin-right: 32px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand::before {
  content: "";
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--wash);
  box-shadow: var(--shadow-pill), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.brand__name {
  color: var(--ink);
  font-size: 16px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.admin-login {
  width: min(100%, 420px);
  animation: rise-in 380ms var(--ease-out) both;
}

.admin-login__icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 20px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--brand-soft);
  color: var(--brand-ink);
}

.admin-login h1,
.card h2,
.workspace-head h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.card h2 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.admin-login > p,
.card > .lead,
.workspace-head p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.6;
}

.admin-login form,
.card form {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.admin-login label,
.field-label,
.card label {
  font-size: 0.82rem;
  font-weight: 600;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.admin-login input,
.card input,
.card textarea,
.card select,
.field {
  min-height: 44px;
  width: 100%;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--white);
  color: inherit;
  font: inherit;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
}

.card select,
select.field {
  padding-right: 36px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 18px, calc(100% - 12px) 18px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.card textarea {
  min-height: 140px;
  resize: vertical;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
}

.card textarea.session-input {
  min-height: 200px;
}

.admin-login input:focus,
.card input:focus,
.card textarea:focus,
.card select:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14);
}

.btn,
.admin-primary-button,
.admin-secondary-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: box-shadow 200ms var(--ease-out), transform 160ms var(--ease-out), filter 200ms var(--ease-out), background 180ms var(--ease-out);
}

.admin-primary-button:active:not(:disabled),
.btn-primary:active:not(:disabled),
.admin-secondary-button:active:not(:disabled),
.btn-ghost:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.admin-primary-button:hover:not(:disabled),
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26), 0 16px 32px -14px rgba(106, 75, 255, 0.85);
}

.admin-secondary-button,
.btn-ghost {
  min-height: 38px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: var(--surface-high);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-pill);
  transition: transform 250ms var(--ease-out), box-shadow 250ms var(--ease-out), color 250ms var(--ease-ui);
}

.admin-secondary-button:hover:not(:disabled),
.btn-ghost:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 1px 2px rgba(20, 22, 43, 0.05), 0 14px 28px -18px rgba(20, 22, 43, 0.4);
}

.admin-icon-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: var(--surface-high);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-pill);
  transition: transform 250ms var(--ease-out), box-shadow 250ms var(--ease-out), color 250ms var(--ease-ui);
}

.admin-icon-button:hover {
  transform: translateY(-1px);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(20, 22, 43, 0.05), 0 14px 28px -18px rgba(20, 22, 43, 0.4);
}

.admin-icon-button:active {
  transform: scale(0.98);
}

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

.workspace-head {
  padding: 28px 32px;
  border-radius: var(--radius-card);
  background: var(--white);
  box-shadow: 0 4px 16px rgba(60, 64, 130, 0.065);
}

.workspace-head > div > p {
  margin: 0;
}

.workspace-head > div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.workspace-head .linkish {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
  transition: color 250ms var(--ease-ui);
}

.workspace-head .linkish::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: 1px;
  border-left: 1.75px solid currentColor;
  border-bottom: 1.75px solid currentColor;
  transform: rotate(45deg);
}

.workspace-head .linkish:hover {
  color: var(--ink);
}

.workspace-head .linkish:active {
  transform: scale(0.98);
}

.workspace-head h1.code-line {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

.list-search {
  margin: 0 0 14px;
}

.card .list-search input {
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: var(--surface-high);
  font-size: 14px;
  box-shadow: var(--shadow-pill);
}

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

.card-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.card-title h1,
.card-title h2 {
  margin: 0;
}

.card-title h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.card-title p {
  color: var(--muted);
  font-size: 14px;
}

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

.card-title--queue {
  justify-content: flex-start;
  gap: 12px;
}

.card-title__lead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.card-title--queue .queue-sort {
  margin-left: auto;
}

.card-title__actions .admin-secondary-button {
  min-height: 36px;
  padding: 0 14px;
  font-size: 0.82rem;
}

.pick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.pick input {
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  accent-color: var(--brand);
  cursor: pointer;
}

.card .pick input,
.card .pick-col input {
  width: 16px;
  min-width: 16px;
  max-width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  border: 1px solid #e1e3ef;
  border-radius: 4px;
  background-color: transparent;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px 16px;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.card .pick input:hover:not(:checked):not(:indeterminate),
.card .pick-col input:hover:not(:checked):not(:indeterminate) {
  border-color: #d3d6e6;
}

.card .pick input:checked,
.card .pick-col input:checked {
  border-color: var(--brand);
  background-color: var(--brand);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.2 6.7 10.8 12 5.2' fill='none' stroke='%23ffffff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.card .pick input:indeterminate,
.card .pick-col input:indeterminate {
  border-color: var(--brand);
  background-color: var(--brand);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.2 8h7.6' fill='none' stroke='%23ffffff' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
}

.card .pick input:focus:not(:checked):not(:indeterminate),
.card .pick-col input:focus:not(:checked):not(:indeterminate) {
  border-color: #d3d6e6;
  box-shadow: none;
}

.card .pick input:focus:checked,
.card .pick-col input:focus:checked,
.card .pick input:focus:indeterminate,
.card .pick-col input:focus:indeterminate {
  border-color: var(--brand);
  box-shadow: none;
}

.cdk-table th.pick-col,
.cdk-table td.pick-col {
  width: 36px;
  padding-right: 4px;
  padding-left: 0;
}

.workspace-head--bar {
  align-items: center;
}

.workspace-head--bar h1 {
  font-size: 22px;
}

.workspace-head--bar h1.code-line {
  font-size: 1.05rem;
}

.workspace-head__actions {
  display: flex;
  gap: 10px;
}

/* 页头按钮旁边的小下拉（续费任务页「送去自动充值」挑卡台）。标签压成小字，
   下拉只占内容宽度，不跟按钮抢高度。 */
.head-pick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.head-pick select.field {
  width: auto;
  height: 36px;
  min-height: 36px;
  padding: 0 32px 0 12px;
  font-size: 13px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.row .grow {
  flex: 1 1 200px;
  min-width: 0;
}

.generate-line {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.generate-plan,
.generate-kind,
.generate-count,
.generate-remark {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  gap: 6px;
}

.generate-plan .field-label,
.generate-kind .field-label,
.generate-count .field-label,
.generate-remark .field-label {
  margin: 0;
  line-height: 16px;
}

.kind-switch {
  display: inline-flex;
  align-items: stretch;
  box-sizing: border-box;
  height: 46px;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--sunk);
}

.kind-switch__btn {
  min-height: 0;
  height: auto;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 250ms var(--ease-ui), color 250ms var(--ease-ui), box-shadow 250ms var(--ease-ui);
}

.kind-switch__btn.is-selected {
  background: var(--surface-high);
  color: var(--ink);
  box-shadow: var(--shadow-pill);
}

.generate-plan[hidden] {
  display: none;
}

.generate-line + .generate-line {
  margin-top: 12px;
}

.generate-line__name {
  min-width: 72px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.generate-line__name--rebind,
.kind-mark--rebind,
.generate-toolbar .lead--rebind {
  color: #0e4d56;
}

.kind-mark {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 10px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.workspace-head--rebind {
  background: #f3f8f8;
  box-shadow: inset 3px 0 0 #0e4d56, 0 4px 16px rgba(60, 64, 130, 0.065);
}

.card--rebind {
  border-color: rgba(176, 106, 18, 0.26);
}

.generate-line .admin-primary-button {
  margin-left: auto;
}

.generate-plan {
  flex: 0 0 132px;
}

.generate-count {
  flex: 0 1 120px;
}

.generate-remark {
  flex: 1 1 220px;
}

.generate-remark .field::placeholder {
  font-size: 12px;
  color: var(--faint);
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--sunk);
}

.filter-pills button {
  min-height: 32px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 250ms var(--ease-ui), color 250ms var(--ease-ui), box-shadow 250ms var(--ease-ui);
}

.filter-pills button:hover {
  color: var(--ink);
}

.filter-pills button:active {
  transform: scale(0.98);
}

.filter-pills button[aria-selected="true"] {
  background: var(--surface-high);
  color: var(--ink);
  box-shadow: var(--shadow-pill);
}

/* 标签上那个小数字：这一档有几条。 */
.filter-pills__count {
  margin-left: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.filter-pills button[aria-selected="true"] .filter-pills__count {
  color: var(--brand-ink);
}

.code-list {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.cdk-table {
  width: 100%;
  min-width: 860px;
  border-collapse: separate;
}

.cdk-table th {
  padding: 4px 14px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
}

.cdk-table td {
  padding: 14px;
  background: var(--surface-high);
  box-shadow: var(--shadow-pill);
  color: var(--ink);
  font-size: 14px;
  vertical-align: middle;
}

.cdk-table th.remark-col,
.cdk-table td.remark-col {
  width: 200px;
}

.cdk-table td.remark-col span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

.cdk-table tbody tr {
  transition: transform 260ms var(--ease-out);
}

.cdk-table tr[data-open]:hover,
.cdk-table tr[data-user]:hover {
  background: #f7f4fe;
}

.cdk-table code {
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.cdk-table button.linkish,
.auto-done button.linkish {
  white-space: nowrap;
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand-ink);
  font: inherit;
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
  transition: color 250ms var(--ease-ui);
}

.cdk-table button.linkish:hover,
.auto-done button.linkish:hover {
  color: var(--ink);
}

.cdk-table button.linkish:active,
.auto-done button.linkish:active {
  transform: scale(0.98);
}

.cdk-table--banded {
  border-spacing: 0 6px;
}

.queue-band__label td {
  padding: 18px 14px 2px;
  background: none;
  box-shadow: none;
}

.queue-band:first-child .queue-band__label td {
  padding-top: 2px;
}

.queue-band__label strong {
  margin-right: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.queue-band__label .chip {
  display: inline-flex;
  vertical-align: middle;
}

.queue-band__count {
  margin-left: 8px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.queue-status td {
  padding: 22px 14px 6px;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
}

.queue-status.is-split td {
  margin-top: 0;
  padding-top: 28px;
  border-top: 1px solid var(--hair);
}

.queue-band__label + .queue-status td {
  padding-top: 6px;
  border-top: 0;
}

.state,
.admin-feedback,
.admin-loading {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.admin-feedback--error,
.state--error {
  color: var(--danger);
}

.admin-feedback--ok {
  color: var(--ok);
}

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  overflow: auto;
  background: rgba(27, 29, 51, 0.32);
  backdrop-filter: blur(6px);
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  width: min(560px, 100%);
  display: flex;
  flex-direction: column;
  border-radius: 24px 0 0 24px;
  background: var(--surface);
  box-shadow: var(--shadow-float);
  animation: drawer-in 380ms var(--ease-out) both;
}

.drawer__header,
.drawer__footer {
  padding: 20px 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.drawer__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 18px 32px;
  background: var(--surface-high);
  box-shadow: 0 -1px 0 var(--hair);
  border-radius: 0 0 0 24px;
}

.drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
}

.dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.dl div {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-row);
  background: var(--surface-high);
  box-shadow: var(--shadow-pill);
}

.dl dt {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 2;
}

.dl dd {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.session-pre {
  max-height: 220px;
  overflow: auto;
  margin: 0;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--sunk);
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
}

.drawer__body h3 {
  margin: 28px 0 12px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.drawer__body h3:first-child {
  margin-top: 0;
}

.mark-block {
  margin-top: 24px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--sunk);
}

.mark-block h3 {
  margin: 0 0 12px;
}

.mark-block form {
  display: grid;
  gap: 12px;
}

.generate-toolbar {
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
}

.generate-toolbar .lead {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.reasons {
  display: grid;
  gap: 8px;
}

.reasons label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
}

[hidden] {
  display: none !important;
}

@media (max-width: 720px) {
  .site-header__inner,
  .admin-page {
    width: calc(100% - 32px);
  }

  .admin-page {
    padding: 24px 0 64px;
  }

  .admin-login,
  .workspace-head,
  .card,
  .drawer__header,
  .drawer__body,
  .drawer__footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .workspace-head,
  .drawer__header,
  .drawer__footer {
    flex-direction: column;
    align-items: stretch;
  }

  .workspace-head.workspace-head--bar {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
  }

  .card {
    padding: 20px 18px;
  }

  .cdk-table thead {
    display: none;
  }

  .cdk-table,
  .cdk-table tbody,
  .cdk-table tr,
  .cdk-table td {
    display: block;
    width: 100%;
  }

  .cdk-table tr {
    padding: 12px 0;
    border-top: 1px solid var(--line);
  }

  .cdk-table td {
    padding: 4px 0;
    border: 0;
  }

  .cdk-table td.pick-col {
    width: auto;
    padding: 0 0 8px;
  }

  .cdk-table td.pick-col::before {
    display: none;
  }

  .cdk-table td.remark-col,
  .cdk-table td.remark-col span {
    width: auto;
  }

  .cdk-table td::before {
    content: attr(data-label);
    display: block;
    color: var(--faint);
    font-size: 11px;
    font-weight: 700;
  }

  .queue-band__label td {
    padding: 14px 0 0;
  }

  .queue-band__label td::before,
  .queue-status td::before {
    display: none;
  }

  .queue-band__label + tr {
    border-top: 0;
  }

  .dl div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

}

body.is-desk .admin-page {
  width: 100%;
  max-width: none;
  padding: 0;
}

.desk {
  min-height: calc(100dvh - 64px);
}

.side button {
  width: 100%;
  min-height: 40px;
  margin-top: 4px;
  padding: 0 12px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background 180ms var(--ease-out), color 180ms var(--ease-out);
}

.side button:hover {
  background: rgba(79, 93, 255, 0.08);
  color: var(--ink);
}

.side button[aria-current="page"] {
  background: var(--brand);
  color: #fff;
  box-shadow: var(--shadow-brand);
}

.side-label {
  margin: 2px 0 4px;
  padding: 0 14px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.desk-main > * {
  animation: rise-in 420ms var(--ease-out) both;
}

.desk-main > *:nth-child(2) {
  animation-delay: 40ms;
}

.desk-main > *:nth-child(3) {
  animation-delay: 80ms;
}

@keyframes rise-in {
  from { opacity: 0; transform: translate3d(0, 10px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

.code-line,
.code-line code {
  font-family: var(--mono);
  font-weight: 600;
}

.copy-btn {
  flex: 0 0 auto;
  height: 26px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: var(--sunk);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 250ms var(--ease-ui), color 250ms var(--ease-ui);
}

.copy-btn:hover {
  background: var(--brand-soft);
  color: var(--brand-ink);
}

.copy-btn.is-copied {
  background: var(--ok-soft);
  color: var(--ok);
}

.code-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-row);
  background: var(--surface-high);
  box-shadow: var(--shadow-pill);
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink);
}

.stack {
  display: grid;
  gap: 12px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.account-actions {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.invoice-slot:empty {
  display: none;
}

.invoice-slot .doc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.invoice-slot a.tone {
  font-weight: 500;
}

.invoice-slot .hint,
.invoice-slot .empty {
  margin-top: 8px;
}

#desk-dialog[hidden],
#desk-toast[hidden] {
  display: none !important;
}

/* 弹窗里贴 Session 的输入框（更换 Session）：弹窗不在 .card 里，卡片那套输入框样式套不上，这里照着写一份。 */
.dialog textarea.dialog-session {
  display: block;
  width: 100%;
  min-height: 170px;
  margin: 12px 0;
  padding: 10px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--white);
  color: inherit;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  outline: none;
  resize: vertical;
  transition: border-color 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
}

.dialog textarea.dialog-session:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14);
}

.dialog {
  width: min(460px, 100%);
  padding: 32px;
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-float);
  animation: rise-in 320ms var(--ease-out) both;
}

.dialog h2 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.dialog p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
}

.dialog .doc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dialog .doc-actions a.tone {
  text-decoration: none;
}

.dialog .hint {
  margin-top: 12px;
}

.dialog .rebind-server {
  margin-top: 0;
}

.dialog .rebind-server.is-busy {
  color: var(--danger);
  font-size: 14px;
  font-weight: 600;
}

.dialog .field {
  margin-bottom: 8px;
}

#dialog-body .field-label {
  display: block;
  margin-bottom: 8px;
}

#dialog-body .field-label:first-child {
  margin-top: 0;
}

.dialog-link {
  padding: 14px 16px;
  border-radius: var(--radius-row);
  background: var(--sunk);
  font-family: var(--mono);
  font-size: 13px;
  word-break: break-all;
}

.dialog-link a {
  color: var(--brand-ink);
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.dialog-actions .admin-primary-button,
.dialog-actions .admin-secondary-button {
  width: auto;
  min-width: 88px;
}

#desk-toast.is-ok {
  background: var(--ok);
}

#desk-toast.is-bad {
  background: var(--danger);
}

#cancel-toast {
  position: fixed;
  left: 50%;
  top: 24px;
  right: auto;
  bottom: auto;
  transform: translateX(-50%);
  z-index: 71;
  width: min(340px, calc(100% - 48px));
  padding: 20px 22px;
  border: 1px solid var(--edge);
  border-radius: var(--radius-card);
  background: var(--surface-high);
}

.cancel-toast__title,
.cancel-toast__text {
  margin: 0;
  color: var(--danger);
}

.cancel-toast__title {
  font-weight: 650;
}

.cancel-toast__text {
  margin-top: 8px;
  white-space: pre-line;
}

#cancel-toast .admin-secondary-button {
  margin-top: 14px;
}

#arrival-toast {
  position: fixed;
  left: 50%;
  top: 24px;
  right: auto;
  bottom: auto;
  transform: translateX(-50%);
  z-index: 70;
  width: min(340px, calc(100% - 48px));
  padding: 20px 22px;
  border: 1px solid var(--edge);
  border-radius: var(--radius-card);
  background: var(--surface-high);
  box-shadow: var(--shadow-float);
  animation: arrival-in 420ms var(--ease-out) both;
}

#arrival-toast::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--brand-gradient);
}

.arrival__badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.arrival__title {
  margin: 12px 0 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.arrival__text {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  white-space: pre-line;
}

.arrival__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.arrival__actions .admin-primary-button,
.arrival__actions .admin-secondary-button {
  min-height: 36px;
  padding: 0 16px;
}

@keyframes arrival-in {
  from { opacity: 0; transform: translate3d(-50%, 14px, 0); }
  to { opacity: 1; transform: translate3d(-50%, 0, 0); }
}

@media (max-width: 720px) {
  #arrival-toast,
  #cancel-toast {
    top: 76px;
    width: min(340px, calc(100% - 28px));
  }
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.card form.result-pane {
  gap: 12px;
}

.result-pane h3 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
}

.result-pane .tone {
  font-size: 13px;
}

.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choices--stack {
  flex-direction: column;
}

.choices label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
}

.choices input {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  max-width: 18px;
  margin: 0;
  padding: 0;
  flex: 0 0 18px;
  border: 1.5px solid #c5c8dc;
  border-radius: 50%;
  background: #fff;
  box-shadow: none;
  cursor: pointer;
  transition: border-color 160ms var(--ease-out), background 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}

.choices label:hover input {
  border-color: #8d93b8;
}

.choices input:checked {
  border-color: var(--brand);
  background: radial-gradient(circle at center, var(--brand) 0 3.5px, #fff 4px);
  box-shadow: 0 0 0 3px rgba(79, 93, 255, 0.16);
}

.choices input:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

.choices label:has(input:checked) {
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  box-shadow: none;
}

/* 去换绑：和账单那一排放在一起，用青色区分开，不抢主按钮。 */
.tone--rebind {
}

.tone--pay:hover:not(:disabled) {
  filter: brightness(1.06);
}

.result-pane .tone--off {
  background: #fff;
  color: var(--danger);
  box-shadow: inset 0 0 0 1.5px rgba(189, 63, 48, 0.38);
}

.result-pane .tone--off:hover:not(:disabled) {
  background: var(--danger-soft);
  filter: none;
}

.pay-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.card select.field--country {
  width: 168px;
  flex: 0 0 168px;
  height: 40px;
  min-height: 40px;
  border-radius: 999px;
  padding-left: 14px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.link-box {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f7f4fe;
}

.cdk-table tr[data-open],
.cdk-table tr[data-user] {
  cursor: pointer;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric {
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  background: #f7f4fe;
}

.metric--copy {
  cursor: pointer;
}

.metric--copy:hover {
  background: #eef0fb;
}

.metric--copy:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.metric--copy.is-copied .metric__label::after,
.metric--copy.is-copy-failed .metric__label::after {
  margin-left: 6px;
  font-weight: 600;
}

.metric--copy.is-copied .metric__label::after {
  content: "已复制";
  color: var(--chip-green-text);
}

.metric--copy.is-copy-failed .metric__label::after {
  content: "没复制上";
  color: var(--chip-red-text);
}

.metric__label {
  margin: 0;
  flex: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
}

.metric__value {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin: 8px 0 0;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.metric__value--accent {
  color: #c2410c;
}

.account-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.account-head h2,
.card h2 {
  margin: 0;
}

.banner {
  margin-top: 16px;
  min-height: 48px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  border-radius: 14px;
  background: var(--chip-green-bg);
  color: var(--chip-green-text);
  font-size: 14px;
  font-weight: 700;
}

.banner--bad {
  background: var(--chip-red-bg);
  color: var(--chip-red-text);
}

.metric__value--tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.metric__aside {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.banner--alert {
  flex-direction: column;
  align-items: flex-start;
  border: 1px solid #f3b4b4;
  background: #fff6f6;
  color: #e11d48;
}

.banner__title,
.banner__note {
  margin: 0;
}

.banner__note {
  color: #d97706;
  font-size: 13px;
  font-weight: 600;
}

.name-alert {
  margin: 0 0 16px;
  border-radius: 16px;
  background: #fff4e5;
  box-shadow: inset 0 0 0 2px #e07a2f;
}

.name-alert.is-changed {
  background: var(--danger-soft);
  box-shadow: inset 0 0 0 2px var(--danger);
}

.name-alert__flag {
  margin: 0 0 8px;
  color: var(--danger);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.4;
}

.name-alert__label {
  margin: 0;
  color: #9a4d12;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.name-alert.is-changed .name-alert__label {
  color: var(--danger);
}

.name-alert__name {
  margin: 6px 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0.02em;
}

.name-alert__name span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.copy-btn--icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.copy-btn--icon svg {
  display: block;
}

.name-mark {
  color: #9a3412;
  font-weight: 800;
}

.payment-row {
  margin-top: 12px;
  min-height: 72px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  border-radius: 14px;
  background: #f7f4fe;
}

.payment-row p {
  margin: 6px 0 0;
  font-size: 15px;
  font-weight: 700;
}

.meta {
  display: grid;
  margin: 0;
}

.meta div {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
}

.meta dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.meta dd {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.session-box {
  max-height: 240px;
  margin: 12px 0 0;
  padding: 12px 14px;
  overflow: auto;
  border-radius: 14px;
  background: #f7f4fe;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.desk-main > .empty {
  padding: 22px 24px;
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 4px 16px rgba(60, 64, 130, 0.065);
}

.empty.pending::before,
.admin-loading.pending::before {
  content: "";
  display: block;
  width: min(42%, 160px);
  height: 8px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e7e9f6 0%, #ffffff 45%, #e7e9f6 100%);
  background-size: 200% 100%;
  animation: shimmer 1.1s ease-in-out infinite;
}

@keyframes shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

.admin-secondary-button--danger {
  color: var(--danger);
}

#billing-url {
  overflow-wrap: anywhere;
}

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

  .side {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .side-label {
    width: 100%;
    margin: 8px 4px 0;
  }

  .side button {
    width: auto;
  }

  .metric-grid,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .desk-main {
    padding: 20px 16px 48px;
  }

  body.is-desk .site-header__inner {
    display: flex;
    width: calc(100% - 28px);
    padding: 0;
    gap: 10px 16px;
  }

  body.is-desk .brand {
    padding-left: 0;
  }

  body.is-desk #logout-btn {
    margin-right: 0;
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

}

/* ===== 新增：改版带来的新部件 ===== */

/* 充值管理后台 · 样式
   视觉规范见 docs/design-system.md，和 GPT 前台同一套：冷灰底、柔光卡片、
   大圆角、Plus Jakarta Sans + DM Mono。后台内容宽、信息密，所以不放极光背景。 */

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("./shared/fonts/PlusJakartaSans-var.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DM Mono";
  src: url("./shared/fonts/DMMono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ---------- 顶栏 ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 64px;
  background: rgba(242, 243, 249, 0.82);
  backdrop-filter: blur(18px) saturate(170%);
  box-shadow: 0 1px 0 var(--hair);
}

.admin-icon-button svg {
  flex: 0 0 auto;
}

/* ---------- 页面骨架 ---------- */

.admin-page {
  width: min(calc(100% - 48px), var(--content));
  margin: 0 auto;
  padding: 32px 0 80px;
}

.admin-loading {
  margin: 0;
  padding: 28px 32px;
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  color: var(--muted);
  font-size: 15px;
}

.admin-loading.pending::before {
  content: "";
  display: block;
  width: min(42%, 170px);
  height: 8px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(20, 22, 43, 0.07) 0%, rgba(255, 255, 255, 0.9) 45%, rgba(20, 22, 43, 0.07) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
}

/* ---------- 登录 ---------- */

.admin-login {
  max-width: 420px;
  margin: 72px auto 0;
  padding: 40px;
  border: 1px solid var(--edge);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  text-align: center;
}

.admin-login h1 {
  margin: 0;
  color: var(--ink);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.admin-login > p {
  margin: 10px 0 24px;
  font-size: 15px;
}

.admin-login form {
  display: grid;
  gap: 12px;
  text-align: left;
}

/* ---------- 工作台：侧栏 + 主区 ---------- */

.desk {
}

.side__switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  margin-bottom: 10px;
  padding: 3px;
  border-radius: 999px;
  background: var(--sunk);
}

.side__switch button {
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 250ms var(--ease-ui), color 250ms var(--ease-ui), box-shadow 250ms var(--ease-ui);
}

.side__switch button:hover {
  color: var(--ink);
}

.side__switch button[aria-selected="true"] {
  background: var(--surface-high);
  color: var(--ink);
  box-shadow: var(--shadow-pill);
}

.side__nav {
  display: grid;
  gap: 16px;
}

.side__group {
  display: grid;
  gap: 4px;
}

.side__group + .side__group {
  padding-top: 14px;
  box-shadow: inset 0 1px 0 var(--hair);
}

.side button[data-view] {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 250ms var(--ease-ui), color 250ms var(--ease-ui);
}

.side button[data-view]:hover {
  background: var(--sunk);
  color: var(--ink);
}

/* ---------- 页头 ---------- */

.workspace-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.workspace-head h1 {
  margin: 0;
  color: var(--ink);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.03em;
}

.workspace-head > div > p,
.workspace-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.workspace-head h1.code-line,
.workspace-head--bar h1.code-line {
  font-family: var(--mono);
  font-size: 24px;
  letter-spacing: 0.01em;
}

/* ---------- 卡片 ---------- */

.card {
  border: 1px solid var(--edge);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition: box-shadow 320ms var(--ease-out);
}

.card:hover {
  box-shadow: var(--shadow-lift);
}

.actions,
.account-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

/* ---------- 表单 ---------- */

.card form {
  display: grid;
  gap: 14px;
}

.card label,
.field-label {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.field,
.card textarea,
.card select,
.card input[type="text"],
.card input[type="password"],
.card input[type="number"],
.admin-login input {
  width: 100%;
  min-height: 46px;
  padding: 12px 16px;
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: var(--surface-high);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  outline: none;
  box-shadow: inset 0 1px 2px rgba(20, 22, 43, 0.04);
  transition: border-color 250ms var(--ease-ui), box-shadow 250ms var(--ease-ui);
}

.field::placeholder,
.card textarea::placeholder {
  color: var(--faint);
}

.field:focus,
.card textarea:focus,
.card select:focus,
.admin-login input:focus {
  border-color: var(--brand);
  box-shadow: inset 0 1px 2px rgba(20, 22, 43, 0.03), 0 0 0 3px var(--brand-soft);
}

select.field,
.card select {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%236b7083' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
}

.list-search,
.card .list-search input {
  width: 100%;
}

/* ---------- 按钮 ---------- */

.admin-primary-button,
.btn-primary {
  min-height: 44px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-brand);
  transition: transform 250ms var(--ease-out), box-shadow 250ms var(--ease-out), opacity 250ms var(--ease-ui);
}

.admin-primary-button:disabled,
.admin-secondary-button:disabled,
.btn-primary:disabled,
.btn-ghost:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
  box-shadow: none;
}

.admin-primary-button:active:not(:disabled),
.admin-secondary-button:active:not(:disabled) {
  transform: scale(0.99);
}

/* ---------- 生成卡密 ---------- */

.generate-toolbar {
  display: grid;
  gap: 10px;
}

.generate-toolbar .lead--rebind {
  color: var(--warn);
}

.kind-switch__btn:hover {
  color: var(--ink);
}

.generate-plan,
.generate-count {
  min-width: 140px;
  flex: 0 1 180px;
}

.generate-remark .field {
  width: 100%;
}

.workspace-head--rebind h1 {
  color: var(--warn);
}

/* ---------- 徽章与筛选 ---------- */

.chip {
  width: fit-content;
  min-height: 24px;
  padding: 3px 11px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---------- 列表（白色胶囊行） ---------- */

.table-wrap {
  overflow-x: auto;
  margin-top: 6px;
}

.cdk-table td:first-child {
  border-radius: var(--radius-row) 0 0 var(--radius-row);
}

.cdk-table td:last-child {
  border-radius: 0 var(--radius-row) var(--radius-row) 0;
}

.cdk-table tbody tr:hover td {
  background: var(--surface);
}

.cdk-table tr[data-user] {
  cursor: pointer;
}

.cdk-table tr[data-user]:hover {
  transform: translateY(-1px);
}

.cdk-table td.remark-col {
  max-width: 220px;
}

.card .pick-col input {
  width: 17px;
  height: 17px;
  min-height: 17px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  box-shadow: none;
  accent-color: var(--brand);
  cursor: pointer;
}

.cdk-table td.pick-col {
  width: 44px;
  text-align: center;
}

/* ---------- 卡密与复制 ---------- */

.code-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

/* 大号卡密只出现在详情页页头；列表里的由 .cdk-table code 管 */
.workspace-head .code-line code,
.workspace-head--bar h1.code-line span {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.cdk-table .code-line code {
  font-size: 13px;
  font-weight: 500;
}

/* ---------- 空态与反馈 ---------- */

.empty {
  margin: 0;
  padding: 28px 32px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  color: var(--muted);
  font-size: 14px;
}

.empty.pending::before {
  content: "";
  display: block;
  width: min(42%, 170px);
  height: 8px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(20, 22, 43, 0.07) 0%, rgba(255, 255, 255, 0.9) 45%, rgba(20, 22, 43, 0.07) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
}

.admin-feedback,
.state--error {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
}

/* ---------- 抽屉（卡密详情） ---------- */

.backdrop,
.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(20, 22, 43, 0.32);
  backdrop-filter: blur(3px);
  animation: fade-in 260ms var(--ease-ui) both;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes drawer-in {
  from { opacity: 0; transform: translate3d(24px, 0, 0); }
  to { opacity: 1; transform: none; }
}

.reasons label,
.choices label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-row);
  background: var(--surface-high);
  box-shadow: var(--shadow-pill);
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  cursor: pointer;
  transition: transform 250ms var(--ease-out), box-shadow 250ms var(--ease-out);
}

.reasons label:hover,
.choices label:hover {
  transform: translateY(-1px);
  box-shadow: 0 1px 2px rgba(20, 22, 43, 0.05), 0 12px 24px -18px rgba(20, 22, 43, 0.4);
}

.reasons input,
.choices input {
  margin-top: 4px;
  accent-color: var(--brand);
}

/* ---------- 发票与结果 ---------- */

.invoice-slot {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

/* ---------- 对话框 ---------- */

#desk-dialog {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
}

#desk-dialog .dialog-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
}

#desk-dialog .dialog {
  position: relative;
  z-index: 1;
  width: min(460px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  animation: fade-in 200ms var(--ease-ui) both;
}

#recharge-drawer {
  position: fixed;
  inset: 0;
  z-index: 180;
}

#recharge-drawer[hidden] {
  display: none !important;
}

#recharge-drawer .backdrop {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  margin: 0;
}

/* ---------- 提示条 ---------- */

#desk-toast {
  position: fixed;
  left: 50%;
  top: 24px;
  bottom: auto;
  z-index: 70;
  transform: translateX(-50%);
  padding: 14px 22px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-float);
  animation: desk-toast-in 320ms var(--ease-out) both;
}

@keyframes desk-toast-in {
  from { opacity: 0; transform: translate3d(-50%, 10px, 0); }
  to { opacity: 1; transform: translate3d(-50%, 0, 0); }
}

#desk-toast[hidden] {
  display: none !important;
}

/* ---------- 窄屏 ---------- */

@media (max-width: 1080px) {
  .desk {
    grid-template-columns: 1fr;
  }

  .side {
    position: static;
  grid-template-columns: 1fr;
  }

  .side__nav {
    display: grid;
  gap: 6px;
  }

  .side__group {
    display: flex;
  flex-wrap: wrap;
  align-items: center;
  }

  .side__group + .side__group {
    padding-top: 12px;
  }

  .side__group .side-label {
    width: 100%;
    margin: 0 0 2px;
    padding: 0 4px;
  }

  .side button[data-view] {
    flex: 0 1 auto;
    justify-content: center;
    text-align: center;
  }
}

/* ---------- Toast ---------- */

.toast-stack {
  position: fixed;
  left: 50%;
  top: 84px;
  z-index: 80;
  display: grid;
  gap: 10px;
  justify-items: center;
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  max-width: min(420px, calc(100vw - 32px));
  padding: 13px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  box-shadow: 0 2px 6px rgba(20, 22, 43, 0.06), 0 24px 48px -20px rgba(20, 22, 43, 0.6);
  pointer-events: auto;
  cursor: pointer;
  animation: toast-in 320ms var(--ease-out) both;
}

.toast--ok {
  background: var(--ok);
}

.toast--bad {
  background: var(--danger);
}

.toast.is-out {
  animation: toast-out 280ms var(--ease-ui) both;
}

@keyframes toast-in {
  from { opacity: 0; transform: translate3d(0, -14px, 0) scale(0.98); }
  to { opacity: 1; transform: none; }
}

@keyframes toast-out {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translate3d(0, -8px, 0); }
}

@media (max-width: 720px) {
  .workspace-head h1 {
    font-size: 22px;
  }

  .drawer {
    width: 100%;
    border-radius: 24px 24px 0 0;
    top: 56px;
  }

  .drawer__body,
  .drawer__footer {
    padding: 22px 18px;
  }

  .drawer__footer {
    border-radius: 0;
  }

  .generate-line .admin-primary-button {
    margin-left: 0;
    width: 100%;
  }

}


/* ===== 收尾：把被后面通用规则压掉的修饰类重新声明一遍 =====
   合并新旧样式时，.chip / .card / .empty 这类通用规则排在了修饰类后面，
   同等优先级 下后者生效，状态色就全变成了品牌紫。这里按来源顺序补回。 */

.chip--violet { background: var(--brand-soft); color: var(--brand-ink); }
.chip--green { background: var(--ok-soft); color: var(--ok); }
.chip--red { background: var(--danger-soft); color: var(--danger); }
.chip--amber { background: var(--warn-soft); color: var(--warn); }
.chip--muted { background: var(--sunk); color: var(--muted); }
.chip--tag { padding: 4px 12px; }
.chip--plan { padding: 4px 12px; background: var(--brand-soft); color: var(--brand-ink); }

.kind-mark { background: var(--warn-soft); color: var(--warn); }
.kind-mark--rebind { background: var(--brand-soft); color: var(--brand-ink); }

.invoice-slot .empty { padding: 16px 18px; font-size: 13px; }

/* 渠道、时间这类短字段不要折成多行 */
.cdk-table td[data-label="渠道"],
.cdk-table td[data-label="当前会员"],
.cdk-table td[data-label="提交时间"],
.cdk-table td[data-label="完成时间"],
.cdk-table td[data-label="操作"] {
  white-space: nowrap;
}

/* ===== 工作台骨架：沿用旧版的通栏结构，侧栏贴边、内容区自己留白 =====
   新样式当初按「居中卡片」写，和 body.is-desk 的通栏规则叠在一起，
   内容区会被撑出视口。这里把几何关系统一回通栏。 */

.desk {
  display: grid;
  grid-template-columns: 228px minmax(0, 1080px);
  justify-content: start;
  gap: 0;
  align-items: stretch;
  min-height: calc(100dvh - 64px);
}

/* 规则：侧栏不贴屏幕边。做成和边缘留距的浮起面板。 */
.side {
  position: sticky;
  top: 88px;
  align-self: start;
  max-height: calc(100dvh - 112px);
  overflow-y: auto;
  display: grid;
  gap: 6px;
  align-content: start;
  margin: 24px 0 24px 24px;
  padding: 16px 14px 20px;
  border: 1px solid var(--edge);
  border-right: 1px solid var(--edge);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.desk-main {
  min-width: 0;
  display: grid;
  /* 不加 minmax(0,1fr) 的话，宽表格的 max-content 会把这一列撑出视口 */
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
}

/* 查询订阅和卡密详情：整列一个宽度，上下块的左右边界对齐。
   之前上面的块 760、下面的块 1040、九宫格又单独 716，三个右边界
   错开，九宫格右边还空出一大条。 */
.desk-main.is-measure {
  width: min(100%, 1040px);
}

.desk-main.is-measure > *,
.desk-main.is-measure > .desk-foot {
  width: 100%;
}

/* 最底下那一块和卡片边缘留出内边距 */
.desk-main.is-measure > section.desk-foot,
#session-desk.desk-foot > .card,
#admin-batch.desk-foot > .card {
  padding: 32px 36px 36px;
}

.side button[data-view] {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

@media (max-width: 1080px) {
  .desk {
    grid-template-columns: 1fr;
  }

  .side {
    position: static;
    max-height: none;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--hair);
  }

  .desk-main {
    padding: 22px 20px 64px;
  }
}

@media (max-width: 720px) {
  .desk-main {
    padding: 18px 16px 56px;
  }
}

/* 当前项必须排在 .side button[data-view] 之后，否则被它的 transparent 盖掉 */
.side button[data-view][aria-current="page"] {
  background: var(--brand);
  color: #fff;
  box-shadow: var(--shadow-brand);
}

.side button[data-view][aria-current="page"]:hover {
  background: var(--brand);
  color: #fff;
}

/* 页头：标题占剩余宽度，操作区保持一行 */
.workspace-head > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.workspace-head__actions {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  align-items: center;
}

/* ===== tone 按钮：找回基础样式，配色换到新 token =====
   改版时我只留了一句 color，把整套按钮外壳（圆角、内边距、字重）删掉了，
   结果它们在页面上变成了纯文字链接。 */

.tone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--sunk);
  color: var(--ink-soft);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 200ms var(--ease-out), background 200ms var(--ease-ui),
    color 200ms var(--ease-ui), box-shadow 200ms var(--ease-out);
}

.tone:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: none;
  box-shadow: 0 1px 2px rgba(20, 22, 43, 0.05), 0 12px 24px -16px rgba(20, 22, 43, 0.45);
}

.tone:active:not(:disabled) {
  transform: translateY(0) scale(0.99);
}

.tone:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.tone--query { background: var(--brand-soft); color: var(--brand-ink); }
.tone--token { background: var(--brand-soft); color: var(--brand-ink); }
/* 用 Refresh Token 换出来的那一份，旁边多一个复制 Session。 */
.tone--copy { background: var(--sunk); color: var(--ink); }
.tone--copy.is-copied { background: var(--ok-soft); color: var(--ok); }
.tone--on { background: var(--ok-soft); color: var(--ok); }
.tone--off { background: var(--danger-soft); color: var(--danger); }
.tone--bill { background: var(--warn-soft); color: var(--warn); }
.tone--rebind { background: rgba(13, 148, 136, 0.14); color: #0d9488; }
.tone--invoice {
  background: #1c1d2e;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(28, 29, 46, 0.2);
}

/* 主操作：实色紫 + 光晕，和主按钮一致 */
.tone--pay {
  background: var(--brand);
  color: #fff;
  font-weight: 500;
  box-shadow: var(--shadow-brand);
}

.tone--pay:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26), 0 16px 32px -14px rgba(106, 75, 255, 0.85);
}

.generate-form textarea.field {
  min-height: 96px;
  padding: 12px 13px;
  resize: vertical;
  line-height: 1.5;
}

.generate-form .choice-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 8px;
  color: var(--ink);
}

.generate-form .choices input[type="checkbox"] {
  border-radius: 5px;
}

.generate-form .choices input[type="checkbox"]:checked {
  border-color: var(--brand);
  background: var(--brand);
  box-shadow: inset 0 0 0 3px #fff;
}

/* 一屏多看几行：收紧卡片内边距，次要列缩小并改成浅色。 */

.desk-main {
  gap: 10px;
  padding: 16px 20px 40px;
}

.card {
  padding: 14px 16px;
}

.card-title {
  gap: 8px;
  margin-bottom: 8px;
}

.card-title p {
  margin: 0;
}

.desk-main .card + .card,
.desk-main .workspace-head + .card {
  margin-top: 10px;
}

.cdk-table {
  border-spacing: 0 4px;
}

.cdk-table th,
.cdk-table td {
  padding: 7px 10px;
}

.cdk-table td[data-label="邮箱"],
.cdk-table td[data-label="渠道"],
.cdk-table td[data-label="当前会员"],
.cdk-table td[data-label="提交时间"],
.cdk-table td[data-label="完成时间"] {
  color: var(--muted);
  font-size: 12px;
  font-weight: 450;
}

.cdk-table td[data-label="提交时间"],
.cdk-table td[data-label="完成时间"] {
  font-variant-numeric: tabular-nums;
}

.workspace-head.workspace-head--bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  padding: 10px 14px;
}

.workspace-head .linkish {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.workspace-head .linkish::before {
  display: inline-block;
  flex: none;
}

.workspace-head__main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.workspace-head__tags {
  display: flex;
  align-items: center;
  gap: 8px;
}

.workspace-head.workspace-head--bar h1.code-line,
.workspace-head .code-line code,
.workspace-head--bar h1.code-line span {
  font-size: 18px;
}

.metric-grid {
  gap: 8px;
}

.metric {
  min-height: 0;
  padding: 8px 10px;
}

.metric__value {
  min-height: 0;
  margin-top: 2px;
  font-size: 14px;
}

.name-alert {
  margin-bottom: 10px;
  padding: 10px 12px;
}

.name-alert__name {
  font-size: 20px;
}

.meta {
  gap: 4px;
}

.actions,
.account-actions {
  margin-top: 10px;
}

.account-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.account-actions .actions {
  margin-top: 0;
}

/* 订阅九宫格跟前台同一套尺寸。上面那组收紧规则只留给列表，不压这张卡。 */
#subscription-card {
  padding: 22px;
}

#subscription-card .account-head {
  margin-bottom: 16px;
}

#subscription-card .metric-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

#subscription-card .metric {
  min-height: 88px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--surface-high);
  box-shadow: var(--shadow-pill);
}

#subscription-card .metric__label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.5;
}

#subscription-card .metric__value {
  min-height: 28px;
  margin: 8px 0 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

#subscription-card .metric .chip {
  min-height: 28px;
  padding: 4px 12px;
  font-size: 13px;
  letter-spacing: 0.04em;
}

#subscription-card .account-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--hair);
}

#subscription-card .account-actions .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 0;
}

#subscription-card .account-actions .tone {
  width: auto;
  min-height: 34px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1;
}

/* 记下结果跟上面的操作按钮不是同一套格子。单选和四位卡号保持原来的小尺寸。 */
.result-pane .choices label {
  display: inline-flex;
  align-items: center;
  width: auto;
  min-height: 28px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.result-pane .choice-block + .choice-block {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--hair);
}

.result-pane .choice-block .field-label {
  margin: 0 0 8px;
}

.result-pane .choices--stack {
  align-items: flex-start;
  gap: 6px;
}

.result-pane .choices label:hover {
  transform: none;
  box-shadow: none;
}

.result-pane .choices input {
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  max-width: 16px;
  margin: 0;
  flex: 0 0 16px;
}

.result-pane .field {
  width: min(100%, 220px);
  min-height: 36px;
  padding: 6px 12px;
  justify-self: start;
}

.result-pane .tone,
.result-pane .tone--off {
  width: auto;
  min-height: 36px;
  justify-self: start;
}

@media (max-width: 720px) {
  #subscription-card .metric-grid {
    grid-template-columns: 1fr;
  }

  .desk-main.is-measure > section.desk-foot,
  #session-desk.desk-foot > .card,
  #admin-batch.desk-foot > .card {
    padding: 20px 18px 28px;
  }
}

.account-head {
  margin-bottom: 8px;
}

.card form.generate-form .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card form.generate-form .admin-primary-button,
.card form.generate-form .admin-secondary-button {
  width: auto;
}

.renew-tabs {
  height: 36px;
}

.renew-plans {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.renew-plan {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--sunk);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.renew-plan:has(input:checked) {
  background: var(--brand-soft);
  color: var(--brand-ink);
}

.generate-form [data-name-editor] {
  margin-top: 12px;
}

.generate-form textarea.renew-names {
  min-height: 88px;
}

.renew-plan input {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  appearance: auto;
  -webkit-appearance: auto;
  accent-color: var(--brand);
  box-shadow: none;
}

.renew-default {
  flex: 0 1 220px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.workspace-head.workspace-head--bar h1.page-name {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.cdk-table td.is-quiet {
  color: var(--muted);
  font-size: 12px;
  font-weight: 450;
}

/* 通栏覆盖写在媒体查询后面，会把窄屏侧栏按钮和表格最小宽度重新撑满。这里再压回去。 */
@media (max-width: 1080px) {
  .side button[data-view] {
    width: auto;
  }
}

@media (max-width: 720px) {
  .table-wrap .cdk-table,
  .cdk-table {
    min-width: 0;
  }
}

/* 侧栏和内容都不贴屏幕边。内容区跟着变宽，卡密表要能放下整行。 */
@media (min-width: 1081px) {
  body.is-desk .site-header__inner,
  body.is-desk .admin-page {
    width: min(calc(100% - 48px), 1720px);
    max-width: 1720px;
    margin-right: auto;
    margin-left: auto;
  }

  body.is-desk .site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    gap: 16px;
  }

  body.is-desk .brand {
    padding-left: 2px;
  }

  body.is-desk #logout-btn {
    margin-right: 0;
    justify-self: auto;
  }

  body.is-desk .admin-page {
    padding-top: 20px;
  }

  .desk {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 20px;
    justify-content: stretch;
    align-items: start;
    min-height: 0;
  }

  .side {
    top: 84px;
    max-height: calc(100dvh - 108px);
    padding: 14px 12px 18px;
    border: 1px solid var(--edge);
    border-radius: var(--radius-card);
    background: var(--surface);
    box-shadow: var(--shadow-card);
  }

  .desk-main {
    padding: 0 0 48px;
  }

  .cdk-table {
    width: 100%;
    min-width: 0;
  }

  .cdk-table td[data-label="卡密"] .code-line,
  .cdk-table td[data-label="邮箱"] {
    white-space: nowrap;
  }
}

.recharge-main,
.recharge-split {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.recharge-split {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.recharge-step {
  justify-content: flex-start;
  gap: 10px;
}

.recharge-step p {
  margin: 0;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
}

.card textarea.recharge-card-input {
  min-height: 40px;
  max-height: 40px;
  resize: none;
}

.recharge-step .admin-secondary-button {
  margin-left: auto;
}

.plan-pick small {
  margin-top: auto;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.plan-pick.is-selected small {
  color: rgba(247, 248, 251, 0.72);
}

#detail-recharge {
  margin-left: auto;
  flex: 0 0 auto;
}

.recharge-queue tr {
  cursor: pointer;
}

.recharge-queue tr.is-open td {
  background: var(--brand-soft);
}

#recharge-drawer .backdrop {
  z-index: 80;
}

#recharge-drawer .drawer {
  z-index: 90;
  top: 96px;
  right: 24px;
  bottom: auto;
  height: auto;
  max-height: calc(100vh - 128px);
  width: min(360px, calc(100vw - 48px));
  border-radius: 20px;
}

#recharge-drawer .drawer__header {
  padding: 16px 16px 8px;
}

#recharge-drawer .drawer__body {
  display: grid;
  align-content: start;
  gap: 10px;
  flex: 0 1 auto;
  padding: 0 16px 12px;
}

#recharge-drawer .drawer__footer {
  padding: 12px 16px;
  border-radius: 0 0 20px 20px;
}

.recharge-drawer__clock {
  margin-left: auto;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.recharge-queue__strong.recharge-plan--plus { color: var(--ink); }
.recharge-queue__strong.recharge-plan--pro5 { color: #2563eb; }
.recharge-queue__strong.recharge-plan--pro20 { color: var(--brand-ink); }
.recharge-queue__strong.recharge-plan--max { color: var(--ok); }

.recharge-timeline-scroll {
  max-height: 220px;
  overflow: auto;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(20, 22, 43, 0.28) transparent;
}

.recharge-timeline-scroll::-webkit-scrollbar {
  width: 8px;
  height: 8px;
  background: transparent;
  border: 0;
}

.recharge-timeline-scroll::-webkit-scrollbar-track,
.recharge-timeline-scroll::-webkit-scrollbar-corner {
  background: transparent;
  border: 0;
}

.recharge-timeline-scroll::-webkit-scrollbar-thumb {
  background: rgba(20, 22, 43, 0.22);
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

.recharge-timeline {
  display: grid;
  margin: 4px 0 0;
  padding: 0 4px 0 0;
  list-style: none;
}

.recharge-timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 10px;
  min-height: 36px;
  padding-bottom: 10px;
}

.recharge-timeline li::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 999px;
  background: var(--edge);
  justify-self: center;
}

.recharge-timeline li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 16px;
  bottom: 0;
  width: 2px;
  background: var(--edge);
}

.recharge-timeline li div {
  display: grid;
  gap: 2px;
}

.recharge-timeline strong {
  font-size: 13px;
  font-weight: 600;
}

.recharge-timeline__meta {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
}

.recharge-timeline .is-done::before,
.recharge-timeline .is-done:not(:last-child)::after {
  background: var(--ok);
}

.recharge-timeline .is-running::before {
  background: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}

.recharge-timeline .is-failed::before,
.recharge-timeline .is-failed:not(:last-child)::after {
  background: var(--danger);
}

/* 自动充值的过程都是已经发生的事，点全部填实，不留灰点。 */
.recharge-timeline--done li::before,
.recharge-timeline--done li:not(:last-child)::after {
  background: var(--brand);
}

/* 横着的三段进度：已受理 → 充值中 → 充值完成。 */
.auto-stage {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 6px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.auto-stage__step {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.auto-stage__step::before {
  content: "";
  height: 4px;
  border-radius: 999px;
  background: var(--edge);
}

.auto-stage__step.is-done {
  color: var(--ink);
}

.auto-stage__step.is-done::before {
  background: var(--ok);
}

.auto-stage__step.is-now {
  color: var(--brand);
}

.auto-stage__step.is-now::before {
  background: var(--brand);
  animation: auto-stage-pulse 1.4s ease-in-out infinite;
}

.auto-stage__step.is-bad {
  color: var(--danger);
}

.auto-stage__step.is-bad::before {
  background: var(--danger);
}

@keyframes auto-stage-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
  .auto-stage__step.is-now::before {
    animation: none;
  }
}

#recharge-drawer .drawer__header h2,
#recharge-drawer .drawer__header p,
#recharge-drawer .drawer__body p {
  margin: 0;
}

#recharge-drawer .drawer__header p {
  color: var(--muted);
  font-size: 13px;
}

.recharge-queue__task {
  display: grid;
  gap: 2px;
}

.recharge-queue__id {
  font-family: var(--mono);
  font-size: 12px;
  white-space: nowrap;
}

.recharge-queue__time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.recharge-queue__strong {
  color: var(--ink);
  font-weight: 600;
}

.recharge-queue td,
.recharge-queue th {
  white-space: nowrap;
}

.recharge-status {
  letter-spacing: 0;
  text-transform: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.task-detail {
  margin: 0;
  padding: 14px;
  border-radius: 16px;
  background: var(--sunk);
}

.task-detail header {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.task-detail header .chip {
  justify-self: start;
}

.task-detail h3,
.task-detail p {
  margin: 0;
}

.task-detail p {
  color: var(--muted);
  font-size: 12px;
}

.task-steps {
  display: grid;
  gap: 8px;
  margin: 12px 0 8px;
  padding: 0;
  list-style: none;
}

.task-steps li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 14px;
  background: var(--surface-high);
}

.task-steps li span {
  flex: 1;
}

.task-steps li em,
.task-steps li time {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.task-steps .is-done {
  box-shadow: inset 3px 0 0 var(--ok);
}

.task-steps .is-running {
  box-shadow: inset 3px 0 0 var(--brand);
}

.task-steps .is-failed {
  box-shadow: inset 3px 0 0 var(--danger);
}

.recharge-bill-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: end;
}

.recharge-bill-line label {
  grid-column: 1 / -1;
}

.plan-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.plan-pick {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 108px;
  padding: 14px 14px 12px;
  border: 1px solid var(--edge);
  border-radius: 16px;
  background: var(--surface-high);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.plan-pick strong {
  font-size: 15px;
  letter-spacing: -0.01em;
}

.plan-pick span,
.plan-pick em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  line-height: 1.4;
}

.plan-pick em {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.plan-pick__badge {
  margin-top: auto;
  color: var(--brand-ink);
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
}

.plan-pick {
  position: relative;
}

.plan-pick__check {
  position: absolute;
  top: 10px;
  right: 12px;
  color: transparent;
  font-size: 14px;
  font-weight: 700;
}

.plan-pick.is-selected {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--ink);
  box-shadow: 0 0 0 3px rgba(106, 75, 255, 0.12);
}

.plan-pick.is-selected .plan-pick__check {
  color: var(--brand-ink);
}

.plan-pick.is-selected span,
.plan-pick.is-selected em,
.plan-pick.is-selected small,
.plan-pick.is-selected .plan-pick__badge {
  color: var(--brand-ink);
}

.plan-pick:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.promo-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin: 0 0 12px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.promo-chip.is-yes {
  background: var(--ok-soft);
  color: var(--ok);
}

.promo-chip.is-no {
  background: var(--danger-soft);
  color: var(--danger);
}

.promo-chip.is-unknown {
  background: var(--warn-soft);
  color: var(--warn);
}

.recharge-note {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.recharge-card-meta dd {
  font-family: var(--mono);
  font-size: 13px;
}

.card-mask {
  margin: 8px 0 0;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
}

.order-card {
  position: sticky;
  top: 88px;
  padding: 18px 18px 16px;
  border: 1px solid var(--edge);
  border-radius: 20px;
  background: var(--surface-high);
  color: var(--ink);
  box-shadow: var(--shadow-card);
}

.order-card h2 {
  margin: 0 0 14px;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.order-card__rows {
  display: grid;
  gap: 10px;
  margin: 0;
}

.order-card__rows div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--hair);
}

.order-card__rows dt {
  color: var(--muted);
  font-size: 12px;
}

.order-card__rows dd {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}

.order-card__note,
.order-card__status,
.order-card__hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.order-card__status {
  color: var(--ok);
  font-weight: 700;
}

.order-card__submit {
  width: 100%;
  min-height: 44px;
  margin-top: 14px;
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.order-card__submit:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

@media (max-width: 1100px) {
  .recharge-layout,
  .recharge-split,
  .recharge-bill-line {
    grid-template-columns: 1fr;
  }

  .order-card {
    position: static;
  }
}

@media (max-width: 1080px) {
  body.is-desk .site-header__inner,
  body.is-desk .admin-page {
    width: calc(100% - 32px);
    max-width: none;
    margin-right: auto;
    margin-left: auto;
  }

  .side {
    border: 1px solid var(--edge);
    border-radius: var(--radius-card);
    background: var(--surface);
    box-shadow: var(--shadow-card);
  }
}

.recharge-queue-card {
  grid-column: 1 / -1;
}

.recharge-work {
  display: grid;
  gap: 16px;
  align-content: start;
}

.recharge-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.recharge-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--sunk);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: help;
}

.recharge-tip__bubble {
  display: none;
  position: absolute;
  z-index: 5;
  top: calc(100% + 6px);
  left: 0;
  width: 220px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.45;
  white-space: normal;
}

.recharge-tip:hover .recharge-tip__bubble,
.recharge-tip:focus .recharge-tip__bubble {
  display: block;
}

.recharge-slot {
  min-height: 22px;
}

.recharge-slot--bill {
  min-height: 40px;
}

.recharge-account,
.recharge-slot__text {
  margin: 0;
  min-height: 20px;
  font-size: 13px;
  line-height: 20px;
}

.recharge-slot__text.is-muted {
  color: var(--muted);
}

#recharge-queue {
  min-height: 44px;
}

.recharge-session-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: end;
}

.recharge-session-row .field-label,
.recharge-session-row__error {
  grid-column: 1 / -1;
}

.recharge-work .field-label,
.recharge-queue-card .field-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
}

.recharge-session-row__error {
  margin: 0;
}

.recharge-work textarea.field,
.recharge-work .recharge-inline .field {
  width: 100%;
  margin: 0;
  min-height: 40px;
  height: 40px;
  padding: 8px 12px;
  line-height: 22px;
  resize: none;
}

.recharge-work textarea.recharge-session {
  height: 64px;
  min-height: 64px;
}

.recharge-session-row .admin-primary-button,
.recharge-inline .admin-secondary-button {
  width: auto;
  height: 40px;
  min-height: 40px;
  margin: 0;
  white-space: nowrap;
}

.recharge-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.recharge-block .admin-feedback {
  margin: 8px 0 0;
}

.recharge-layout .plan-pick strong,
.recharge-layout .plan-pick span,
.recharge-layout .plan-pick small {
  white-space: nowrap;
}

.recharge-layout .plan-pick .plan-pick__check {
  color: var(--brand-ink);
}

.order-card {
  height: auto;
  align-self: start;
}

.recharge-layout .plan-pick__local,
.recharge-layout .plan-pick__usd,
.recharge-layout .plan-pick.is-selected .plan-pick__local,
.recharge-layout .plan-pick.is-selected .plan-pick__usd {
  display: block;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.01em;
}

@media (max-width: 1100px) {
  .recharge-layout .plan-grid,
  .recharge-pair {
    grid-template-columns: 1fr 1fr;
  }

  .recharge-layout .plan-pick:last-child {
    grid-column: 1 / -1;
  }
}

.recharge-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}

.recharge-layout > .card:not(.recharge-summary) {
  grid-column: 1;
}

.recharge-layout > .card.recharge-plans,
.recharge-layout > .card.recharge-pay {
  grid-row: 2;
  align-self: stretch;
}

.recharge-layout > .card.recharge-pay {
  grid-column: 2;
  height: 0;
  min-height: 100%;
  overflow: auto;
}

.recharge-layout > .card.recharge-queue-card {
  grid-column: 1 / -1;
}

.recharge-check,
.recharge-summary {
  grid-row: 1;
  align-self: stretch;
  height: auto;
}

.recharge-summary {
  grid-column: 2;
}

.desk-main .recharge-layout > .card {
  margin-top: 0;
}

.recharge-summary .meta {
  gap: 0;
}

.recharge-summary .meta div {
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--edge);
}

.recharge-summary .meta div:first-child {
  padding-top: 0;
}

.recharge-summary .meta dt {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}

.recharge-summary .meta dd {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

.recharge-summary .recharge-cancel {
  margin-top: 14px;
  color: var(--ink);
}

.recharge-summary .actions {
  margin-top: 14px;
}

.recharge-check__title {
  flex-wrap: nowrap;
  align-items: center;
  gap: 12px;
}

.card form.recharge-key {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 0 auto;
}

.recharge-key input.field {
  width: 168px;
  height: 32px;
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.recharge-key__state {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.recharge-key__state.is-on {
  color: var(--ok);
}

.recharge-key .admin-secondary-button {
  height: 32px;
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
}

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

.recharge-facts div {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  min-height: 76px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--surface-high);
  box-shadow: var(--shadow-pill);
}

.recharge-facts dt {
  margin: 0;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.recharge-facts dd {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.recharge-facts dd.is-on {
  color: var(--ok);
}

.recharge-facts dd.is-plan {
  color: var(--brand-ink);
}

.recharge-facts dd.is-origin {
  color: var(--ok);
}

.recharge-facts dd.is-currency {
  color: #2563eb;
}

.recharge-facts dd.is-expiry {
  color: #c2410c;
}

.recharge-card-read {
  display: flex;
  align-items: baseline;
  margin: 10px 0 0;
  min-height: 24px;
}

.recharge-card-read__bin,
.recharge-card-read__dots {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.recharge-card-read__dots {
  margin: 0 1px 0 4px;
}

.recharge-last4 {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.recharge-card-read__balance,
.recharge-card-read__warn {
  margin-left: 14px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
}

.recharge-summary .recharge-last4 {
  font-size: 14px;
}

.recharge-card-read__label {
  margin-right: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.card textarea.recharge-session {
  min-height: 72px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
}

.recharge-layout textarea.recharge-card {
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  padding: 9px 12px;
  overflow: hidden;
  resize: none;
  line-height: 20px;
  font-size: 13px;
}

.recharge-layout .field::placeholder,
.recharge-layout textarea::placeholder {
  color: var(--faint);
  font-size: 12px;
}

.recharge-layout textarea.recharge-session::placeholder {
  font-family: var(--mono);
  font-size: 11px;
}

#recharge-account.recharge-slot {
  min-height: 36px;
}

.recharge-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.recharge-layout .plan-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.recharge-layout .plan-pick {
  min-height: 0;
  height: auto;
  gap: 6px;
  justify-content: flex-start;
  align-items: flex-start;
  padding: 10px 12px 9px;
  border: 1px solid var(--edge);
  border-radius: 16px;
  background: var(--surface-high);
  box-shadow: var(--shadow-card);
  color: var(--ink);
}

.recharge-layout .plan-pick strong {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.recharge-layout .plan-pick__prices {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.recharge-layout .plan-pick small {
  margin-top: 0;
}

.recharge-layout .plan-pick .plan-pick__local,
.recharge-layout .plan-pick .plan-pick__usd,
.recharge-layout .plan-pick.is-selected .plan-pick__local,
.recharge-layout .plan-pick.is-selected .plan-pick__usd {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0;
}

.recharge-layout .plan-pick .plan-pick__check {
  top: 10px;
  right: 8px;
  font-size: 12px;
  line-height: 1;
}

.recharge-layout .plan-pick.is-selected {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: var(--shadow-pill);
  color: var(--ink);
}

.recharge-check .card-title {
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

@media (max-width: 1100px) {
  .recharge-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .recharge-check,
  .recharge-summary,
  .recharge-layout > .card.recharge-plans,
  .recharge-layout > .card.recharge-pay,
  .recharge-layout > .card.recharge-queue-card,
  .recharge-layout > .card:not(.recharge-summary) {
    grid-column: 1;
    grid-row: auto;
    height: auto;
    min-height: 0;
  }
}

.recharge-layout .card-title {
  margin-bottom: 16px;
}

.side .side-collapse {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-height: 36px;
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: var(--sunk);
  color: var(--ink-soft);
  text-align: center;
  cursor: pointer;
}

.side-collapse:hover {
  background: var(--brand-soft);
  color: var(--brand-ink);
}

body.is-side-collapsed .desk {
  grid-template-columns: 72px minmax(0, 1080px);
}

body.is-side-collapsed .side__switch,
body.is-side-collapsed .side__nav {
  display: none;
}

body.is-side-collapsed .side {
  padding: 10px;
  overflow: hidden;
}

body.is-side-collapsed .side-collapse svg {
  transform: scaleX(-1);
}

#admin-txt-dialog {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  pointer-events: none;
}

#admin-txt-dialog[hidden] {
  display: none !important;
}

.admin-txt-panel {
  pointer-events: auto;
  width: min(520px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  margin: 0;
  padding: 22px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.admin-txt-dialog__head {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.admin-txt-dialog__head h2 {
  margin: 0;
  font-size: 20px;
}

.admin-txt-dialog__head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.admin-txt-dialog__head .admin-secondary-button {
  margin-left: auto;
}

.admin-txt-dialog__tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-txt-list {
  max-height: 280px;
  overflow: auto;
}

.admin-txt-file {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  border-top: 1px solid var(--edge);
}

.admin-txt-file__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-txt-file__note {
  margin-left: auto;
  color: var(--danger);
  font-size: 12px;
  white-space: nowrap;
}

.admin-txt-file__remove {
  min-height: 44px;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.admin-batch-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-batch-bar p {
  margin: 0;
  color: var(--muted);
}

.admin-batch-item {
  border-top: 1px solid var(--edge);
}

.admin-batch-line {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 8px 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.admin-batch-line__file,
.admin-batch-line__email {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-batch-line__file {
  flex: 1.1 1 120px;
  font-weight: 700;
}

.admin-batch-line__email {
  flex: 1.4 1 140px;
}

.admin-batch-line__plan,
.admin-batch-line__currency,
.admin-batch-line__until {
  flex: 0 1 auto;
  white-space: nowrap;
}

.admin-batch-line__currency {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}

.admin-batch-line__currency span {
  color: var(--muted);
  font-size: 12px;
}

.admin-batch-bar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-batch-detail .metric-grid {
  margin-top: 4px;
}

.admin-batch-detail .account-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  padding: 14px 0 8px;
  border-top: 1px solid var(--hair);
}

.admin-batch-detail .account-actions .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 0;
}

.admin-batch-detail .account-actions .hint {
  margin: 0;
}

.admin-batch-detail .account-actions .tone {
  width: auto;
  min-height: 34px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1;
}

@media (max-width: 720px) {
  #admin-txt-dialog {
    padding: 12px;
  }

  .admin-txt-panel {
    width: 100%;
    max-height: calc(100vh - 24px);
    padding: 16px;
  }

  .admin-txt-dialog__head {
    flex-wrap: wrap;
  }

  .admin-txt-dialog__head .admin-secondary-button,
  .admin-txt-panel .actions .admin-primary-button,
  .admin-batch-bar .admin-secondary-button {
    width: 100%;
    margin-left: 0;
  }

  .admin-batch-bar {
    flex-wrap: wrap;
  }

  .admin-batch-line {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 8px;
    row-gap: 6px;
  }

  .admin-batch-line__file,
  .admin-batch-line__email {
    grid-column: 1 / -1;
    white-space: normal;
  }

  .admin-txt-file__note {
    white-space: normal;
    text-align: right;
  }
}

/* ===== 执行中 =====
   setBusy() 一直在换文案、置 aria-busy，但没有配套样式，
   按钮只是变灰，看着像点卡了。给它一个转圈，并把灰度收回来。 */

button[aria-busy="true"],
button[aria-busy="true"]:disabled {
  cursor: progress;
  opacity: 0.88;
}

button[aria-busy="true"]::before {
  content: "";
  flex: none;
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  opacity: 0.85;
  animation: spin 720ms linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  button[aria-busy="true"]::before {
    animation-duration: 2.4s;
  }
}

.queue-sort {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.queue-sort select.field {
  width: auto;
  height: 36px;
  min-height: 36px;
  padding: 0 32px 0 12px;
  font-size: 13px;
}

/* 已换绑标签可以点，用来人工改成已续费。 */
.chip--switch {
  border: 0;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 200ms var(--ease-ui), transform 200ms var(--ease-out);
}

.chip--switch:hover {
  filter: brightness(0.96);
}

.chip--switch:active {
  transform: scale(0.97);
}

.renew-status-menu {
  position: relative;
  display: inline-flex;
  z-index: 1;
}

.renew-status-menu.is-open {
  z-index: 30;
}

.cdk-table tr:has(.renew-status-menu.is-open) {
  position: relative;
  z-index: 6;
}

.renew-status-menu__list {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 31;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--edge);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(20, 22, 43, 0.12);
}

.renew-status-menu.is-open .renew-status-menu__list {
  display: flex;
}

.table-wrap:has(.renew-status-menu.is-open) {
  overflow: visible;
}

.chip--blue {
  background: #dbeafe;
  color: #2563eb;
}

/* 自动选卡充值 */
.auto-layout { display: grid; gap: 18px; }
.auto-switch { display: inline-flex; align-items: center; gap: 10px; }
.auto-switch__state {
  font-size: 12px; padding: 3px 9px; border-radius: 999px;
  background: var(--chip-bg, #efeafa); color: var(--muted, #6b6b76);
}
.auto-switch__state.is-on { background: #e8f3ec; color: #1f7a45; }
.auto-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.auto-grid--providers { margin-top: 10px; }
.auto-provider { display: flex; flex-direction: column; gap: 4px; }
.auto-provider__act { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.auto-stat {
  display: grid; gap: 4px; padding: 10px 12px; border-radius: 12px;
  background: var(--chip-bg, #f7f4fe);
}
.auto-stat.is-bad { background: #fdf1f1; }
.auto-stat__label { font-size: 12px; color: var(--muted, #6b6b76); }
.auto-stat strong { font-size: 14px; font-weight: 600; }
.card form.auto-inline, .auto-inline { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.auto-inline .field { flex: 1 1 auto; min-width: 0; }
.auto-inline button { flex: 0 0 auto; white-space: nowrap; }
/* 点按钮打开的弹窗不加蒙版，页面和按钮都还能点。 */
#desk-dialog.is-plain .dialog-backdrop { background: transparent; backdrop-filter: none; pointer-events: none; }
#desk-dialog.is-plain.is-blur .dialog-backdrop { background: rgba(20, 22, 43, 0.28); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); pointer-events: auto; }
.peek-note { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.peek-note input { flex: 1 1 auto; min-width: 0; height: 40px; padding: 0 14px; border: 1px solid var(--hair); border-radius: 12px; background: var(--surface, #fff); color: var(--ink); font: inherit; font-size: 14px; outline: none; }
.peek-note input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.peek-note__save { flex: 0 0 auto; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 12px; background: var(--brand); color: #fff; cursor: pointer; }
.peek-note__save:disabled { opacity: 0.45; cursor: progress; }
#renew-peek-actions { align-items: center; }
#renew-peek-actions .hint { flex: 1 0 100%; margin: 0; }
#desk-dialog.is-wide .dialog { width: min(760px, 100%); }
.account-cell { position: relative; display: grid; gap: 2px; justify-items: start; }
button.record-email { border: 0; padding: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.account-note { border: 0; padding: 0; background: none; color: var(--faint); font: inherit; font-size: 12px; line-height: 1.3; text-align: left; cursor: text; }
.account-note.is-empty { position: absolute; left: 0; top: 100%; width: 140px; height: 0; margin: 0; overflow: hidden; opacity: 0; pointer-events: none; }
.account-cell:hover .account-note.is-empty { height: 14px; opacity: 1; pointer-events: auto; overflow: visible; border-bottom: 1px solid var(--hair); z-index: 2; background: var(--surface, #fff); }
.account-cell:focus-within .account-note.is-empty { height: auto; min-height: 16px; opacity: 1; pointer-events: auto; overflow: visible; z-index: 2; background: var(--surface, #fff); }
.account-note__input { width: min(220px, 100%); border: 0; border-bottom: 1px solid var(--hair); background: transparent; color: var(--ink); font: inherit; font-size: 12px; outline: none; }
tr[data-renew-peek] { cursor: pointer; }
.auto-rows { display: grid; gap: 8px; }
.auto-row {
  display: grid; gap: 4px; padding: 11px 13px; border-radius: 12px;
  background: var(--chip-bg, #f7f4fe);
}
.auto-rows--jobs .auto-row {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1.6fr) auto auto;
  align-items: center; column-gap: 12px;
}
.auto-row__main { font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
.auto-row__sub { font-size: 12px; color: var(--muted, #6b6b76); min-width: 0; overflow-wrap: anywhere; }
.auto-row__state { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: #e8e3f6; justify-self: start; }
.auto-row__state.is-ok { background: #e8f3ec; color: #1f7a45; }
.auto-row__state.is-bad { background: #fbe9e9; color: #9a3838; }
.auto-row__state.is-run { background: #e9eefb; color: #3b53a6; }
.auto-row__state.is-wait { background: #fbf3e4; color: #8a6418; }
.auto-row__act { display: inline-flex; gap: 8px; flex-wrap: wrap; justify-self: end; }
.auto-row--card { grid-template-columns: 1fr auto; align-items: start; }
.auto-row--card > .auto-row__main, .auto-row--card > .auto-row__sub { grid-column: 1; }
.auto-row--card > .auto-row__act { grid-column: 2; grid-row: 1 / span 4; align-self: center; }
.auto-row__tag { font-size: 11px; padding: 2px 7px; border-radius: 999px; background: #e8e3f6; color: #55555f; white-space: nowrap; }
.auto-row__tag.is-marked { background: #e8f3ec; color: #1f7a45; }
.auto-row__idle { color: #8a6418; }
.auto-row__idle.is-ok { color: #1f7a45; }
@media (max-width: 640px) {
  .auto-row--card { grid-template-columns: 1fr; }
  .auto-row--card > .auto-row__act { grid-column: 1; grid-row: auto; justify-self: start; }
}
.auto-row__note { grid-column: 1 / -1; font-size: 12px; color: #9a3838; }
.auto-row__trail { grid-column: 1 / -1; font-size: 12px; color: var(--muted, #6b6b76); font-family: var(--mono); overflow-wrap: anywhere; }
.auto-rows--jobs .auto-stage { grid-column: 1 / -1; }
/* 卡头策略：两个卡台各一列，窄屏叠成一列。 */
.bin-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 14px; align-items: start; }
.bin-col { min-width: 0; }
.bin-col__title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; font-weight: 700; }
.bin-col__role { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #e8e3f6; color: var(--muted, #6b6b76); }
.bin-col__role.is-first { background: var(--brand-soft, #eeeaff); color: var(--brand, #5b47e0); }
.bin-col__role.is-off { background: var(--danger-soft, #fdecec); color: var(--danger, #c0392b); }
.bin-col__switch { margin-left: auto; font: inherit; font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line, #dcdce4); background: transparent; color: var(--ink, #1c1c22); cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s; }
.bin-col__switch:hover { color: var(--danger, #c0392b); border-color: currentColor; background: var(--danger-soft, #fdecec); }
.bin-col.is-off .bin-col__switch { color: var(--brand, #5b47e0); border-color: currentColor; }
.bin-col.is-off .bin-col__switch:hover { background: var(--brand-soft, #eeeaff); }
.bin-col__switch:disabled { opacity: 0.5; cursor: default; }
.bin-col__switch:focus-visible { outline: 2px solid var(--brand, #5b47e0); outline-offset: 2px; }
.bin-col__off { margin: 8px 0 0; color: var(--danger, #c0392b); }
.bin-col.is-off .bin-rows { opacity: 0.55; }
.idle-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line, #dcdce4); border-radius: 12px; }
.idle-bar.is-on { border-color: var(--brand, #5b47e0); background: var(--brand-soft, #eeeaff); }
.idle-bar__main { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; min-width: 0; font-size: 13px; }
.idle-bar__title { font-weight: 700; font-size: 14px; }
.idle-bar__count b { font-weight: 600; }
.idle-bar__count.is-bad { color: var(--danger, #c0392b); }
.idle-bar__refresh { font: inherit; font-size: 12px; padding: 0; border: 0; background: none; color: var(--muted, #6b6b76); text-decoration: underline; cursor: pointer; }
.idle-bar__refresh:hover { color: var(--ink, #1c1c22); }
.idle-bar__refresh:focus-visible { outline: 2px solid var(--brand, #5b47e0); outline-offset: 2px; }
.idle-bar__side { display: flex; align-items: center; gap: 10px; font-size: 13px; white-space: nowrap; }
.idle-bar__state { font-weight: 600; }
.idle-bar .bin-col__switch { margin-left: 0; }
.idle-bar.is-on .bin-col__switch, .idle-bar:not(.is-on) .bin-col__switch { color: var(--brand, #5b47e0); border-color: currentColor; }
.idle-bar .bin-col__switch:hover { background: var(--brand-soft, #eeeaff); color: var(--brand, #5b47e0); }
.idle-bar__hint { grid-column: 1 / -1; margin: 0; }
@media (max-width: 720px) { .idle-bar { grid-template-columns: minmax(0, 1fr); } }
.bin-col .bin-row { grid-template-columns: 24px minmax(0, 1fr) auto; }
.bin-col .bin-row.is-off { grid-template-columns: 24px minmax(0, 1fr); }
.bin-col .bin-row__health { grid-column: 2 / -1; grid-row: 2; text-align: left; }
@media (max-width: 1100px) { .bin-cols { grid-template-columns: minmax(0, 1fr); } }
/* 卡头策略：一行一个卡头，↑↓ 排优先顺序。 */
.bin-rows { display: grid; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; counter-reset: none; }
.bin-rows--off { margin-top: 6px; }
.bin-row {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) minmax(0, auto) auto;
  align-items: center; gap: 12px; padding: 9px 13px; border-radius: 12px;
  background: var(--chip-bg, #f7f4fe);
}
.bin-row.is-cold { background: #fbf3e4; }
.bin-row.is-blocked { background: var(--danger-soft); opacity: 0.85; }
.bin-flag {
  min-width: 40px; height: 30px; padding: 0 10px;
  border: 0; border-radius: 10px;
  background: var(--sunk); color: var(--muted, #6b6b76);
  font: inherit; font-size: 12px; cursor: pointer;
  transition: color 200ms var(--ease-ui), background 200ms var(--ease-ui), transform 200ms var(--ease-out);
}
.bin-flag:hover { color: var(--danger); background: var(--danger-soft); }
.bin-flag:active { transform: scale(0.94); }
.bin-row.is-blocked .bin-flag:hover { color: var(--ink); background: var(--surface-high); }
.bin-row.is-off { grid-template-columns: 28px minmax(0, 1fr); opacity: 0.65; }
.bin-row__no { font-size: 12px; color: var(--muted, #6b6b76); font-variant-numeric: tabular-nums; }
.bin-row__main { display: grid; gap: 2px; min-width: 0; font-family: var(--mono); font-size: 14px; }
.bin-row__sub { font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 12px; color: var(--muted, #6b6b76); overflow-wrap: anywhere; }
.bin-row__health { font-size: 12px; color: var(--muted, #6b6b76); text-align: right; overflow-wrap: anywhere; }
.bin-row__act { display: inline-flex; gap: 6px; justify-self: end; }
/* ↑↓ 用后台自己的按钮样子：浅底、圆角、没有浏览器默认那圈灰边。 */
.bin-move {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0;
  border: 0; border-radius: 10px;
  background: var(--surface-high, #fff); color: var(--muted, #6b6b76);
  font: inherit; font-size: 14px; line-height: 1; cursor: pointer;
  box-shadow: var(--shadow-pill);
  transition: color 200ms var(--ease-ui), background 200ms var(--ease-ui), transform 200ms var(--ease-out);
}
.bin-move:hover:not(:disabled) { color: var(--ink, #14161f); background: var(--brand-soft, #eeeaff); }
.bin-move:active:not(:disabled) { transform: scale(0.94); }
.bin-move:disabled { opacity: 0.35; cursor: not-allowed; box-shadow: none; background: transparent; }
@media (max-width: 640px) {
  .bin-row { grid-template-columns: 24px minmax(0, 1fr) auto; }
  .bin-row__health { grid-column: 2 / -1; text-align: left; }
}

.price-table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 13px; }
.price-table th {
  text-align: left; font-weight: 500; font-size: 12px; color: var(--muted, #6b6b76);
  padding: 0 10px 6px 0; border-bottom: 1px solid var(--edge, #e8e8ee);
}
.price-table td { padding: 7px 10px 7px 0; border-bottom: 1px solid var(--edge, #e8e8ee); }
.price-table tr:last-child td { border-bottom: 0; }
.price-table .price-local, .price-table .price-usd { font-family: var(--mono); white-space: nowrap; }
.price-table .price-usd { color: var(--muted, #6b6b76); }
.price-table tr.is-here td { background: var(--brand-soft, #eeeaff); font-weight: 600; }
.price-table tr.is-here .price-usd { color: var(--ink, #14161f); }
.price-note { margin: 8px 0 0; font-size: 12px; color: var(--muted, #6b6b76); }

.auto-group { margin: 14px 0 6px; font-size: 12px; color: var(--muted, #6b6b76); }
.auto-group:first-child { margin-top: 0; }
.auto-dones { display: grid; gap: 2px; }
.auto-done {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center; gap: 10px; padding: 7px 13px; border-radius: 9px; font-size: 13px;
}
.auto-done:nth-child(odd) { background: var(--chip-bg, #f7f4fe); }
.auto-done button.linkish { font-size: 13px; }
.auto-done__main { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 一行放不下时先截邮箱那段，金额尽量留全。 */
.auto-done__main:has(.auto-done__who) { display: flex; }
.auto-done__who { flex: 0 100 auto; min-width: 3em; overflow: hidden; text-overflow: ellipsis; }
.auto-done__money { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.auto-done__when { font-size: 12px; color: var(--muted, #6b6b76); font-family: var(--mono); }
.auto-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 12px; }
.auto-pager__at { font-size: 12px; color: var(--muted, #6b6b76); }
.auto-pager button[disabled] { opacity: 0.45; cursor: not-allowed; }
@media (max-width: 860px) {
  .auto-done { grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; }
}
.auto-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 13px; }
.dialog-copy { display: flex; gap: 10px; align-items: center; overflow-wrap: anywhere; }
@media (max-width: 860px) {
  .auto-rows--jobs .auto-row { grid-template-columns: 1fr; }
  .auto-row__act, .auto-row__state { justify-self: start; }
}

/* 自动换绑这一页：表单沿用 .field / .pick，只补网格和过程列表。 */
.rebind-form { display: grid; gap: 12px; }
.rebind-form textarea.field { width: 100%; font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace); font-size: 13px; }
.rebind-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.rebind-grid .field { width: 100%; }
.rebind-checks { display: flex; flex-wrap: wrap; gap: 14px; }
.rebind-launch { margin: 12px 0 6px; }
.hint.is-bad { color: var(--danger); }
#rebind-window-out:not(:empty) { margin-top: 14px; border-top: 1px solid var(--line, #e5e7eb); padding-top: 14px; }
.rebind-window-steps { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 4px; font-size: 13px; color: var(--muted, #6b7280); }
.rebind-steps { margin: 8px 0 14px; padding-left: 18px; display: grid; gap: 4px; font-size: 13px; line-height: 1.5; }
.rebind-steps li { color: var(--text-soft, #555); }
.rebind-steps li span { display: inline-block; min-width: 68px; color: var(--text-dim, #999); font-variant-numeric: tabular-nums; }

/* 插件密钥：新发的那一串只显示一次，所以让它显眼、好选、好复制。 */
.ext-key-new {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 6px 0 14px;
}

.ext-key-new code {
  flex: 1 1 320px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface-sunken, #f7f4fe);
  border: 1px solid var(--line, #dcdfe4);
  font-size: 13px;
  word-break: break-all;
  user-select: all;
}

/* 删除撞上自动充值时的第二个弹窗：列出挡住的卡密 */
.blocked-list {
  margin: 8px 0;
  padding: 10px 12px 10px 28px;
  max-height: 180px;
  overflow: auto;
  border-radius: 10px;
  background: rgba(20, 22, 43, 0.04);
  font-size: 13px;
  line-height: 1.7;
}
.blocked-list .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ====================================================================
   后台的视觉系统（2026-11-21 定稿，方向记在仓库根目录的 DESIGN.md）
   参照 Stripe 后台：浅灰底、白色内容面板、不画边框、靠一层很淡的阴影分层；
   紫色只在主按钮、当前选中项和链接上；表格密而清爽，只留行与行之间的细线。
   这一段排在文件最后，整体盖掉前面各页的旧外观；前面的规则只负责结构。
   窄屏（1080 以下）沿用旧的单列排法，只换颜色和控件外观。
   ==================================================================== */
body.is-desk {
  /* 中性色：都带紫，不带蓝。从深到浅 */
  --ink: #1c1830;
  --ink-soft: #35304d;
  --muted: #615b7c;
  --faint: #6e6889;
  --quiet: #615b7c;
  --quieter: #6e6889;
  --edge: #ddd6f0;
  --hair: #f1eef9;
  --page: #f8f6fd;
  --well: #f7f4fe;
  --paper: #ffffff;
  --row-hover: #fbf9ff;
  /* 旧规则用到的名字，指到同一套值上 */
  --canvas: var(--page);
  --surface: var(--paper);
  --surface-high: var(--paper);
  --sunk: #efeafa;
  --head: var(--paper);
  --side-bg: transparent;
  /* 品牌紫：原来那支梦幻紫 */
  --brand: #6a4bff;
  --brand-ink: #4f35d6;
  --brand-soft: #f0ebff;
  --ok: #0b6b4b;
  --ok-soft: #d9f5e8;
  --danger: #b4232f;
  --danger-soft: #ffe4e6;
  --warn: #8a5200;
  --warn-soft: #fff1d6;
  /* 阴影也带紫，面板像浮在一层淡紫的光上；控件一圈很淡的环；聚焦一圈紫环 */
  --lift: 0 1px 2px rgba(79, 53, 214, 0.05), 0 10px 28px -14px rgba(79, 53, 214, 0.22);
  --ring: 0 0 0 1px var(--edge), 0 1px 2px rgba(79, 53, 214, 0.05);
  --ring-focus: 0 0 0 1px var(--brand), 0 0 0 4px rgba(106, 75, 255, 0.18);
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(169, 150, 255, 0.2), transparent 62%),
    radial-gradient(760px 460px at 96% 4%, rgba(143, 212, 255, 0.14), transparent 60%),
    radial-gradient(700px 500px at 60% 108%, rgba(214, 170, 255, 0.12), transparent 62%),
    var(--page);
  background-attachment: fixed;
  color: var(--ink);
}

/* 滚动条：轨道透明、没有边线，滑块是和底色一个色系的半透明灰 */
body.is-desk,
body.is-desk * {
  scrollbar-width: thin;
}

body.is-desk ::-webkit-scrollbar {
  width: 10px;
  height: 10px;
  background: transparent;
}

body.is-desk ::-webkit-scrollbar-track,
body.is-desk ::-webkit-scrollbar-corner {
  background: transparent;
  border: 0;
  box-shadow: none;
}

body.is-desk ::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: rgba(79, 53, 214, 0.2);
  background-clip: content-box;
}

body.is-desk ::-webkit-scrollbar-thumb:hover {
  background: rgba(79, 53, 214, 0.36);
  background-clip: content-box;
}

body.is-desk ::selection {
  background: #ddd4ff;
  color: var(--ink);
}

body.is-desk :focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ------------------------------------------------------------ 侧栏 */
.side__brand,
.side__logout {
  display: none;
}

.side__areas,
body.is-desk .side .side__switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0;
  padding: 2px;
  background: var(--sunk);
}

body.is-desk .side .side__switch[hidden] {
  display: none;
}

body.is-desk .side .side__areas button,
body.is-desk .side .side__switch button {
  min-height: 0;
  padding: 5px 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  justify-content: center;
  cursor: pointer;
}

body.is-desk .side .side__areas button[aria-selected="true"],
body.is-desk .side .side__switch button[aria-selected="true"] {
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(79, 53, 214, 0.16);
}

.side-count {
  float: right;
  min-width: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-style: normal;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

@media (min-width: 1081px) {
  body.is-desk .site-header {
    display: none;
  }

  body.is-desk .admin-page {
    max-width: none;
    margin: 0;
    padding: 0;
  }

  body.is-desk .desk {
    grid-template-columns: 208px minmax(0, 1fr);
    max-width: none;
    min-height: 100dvh;
  }

  body.is-desk .side {
    position: sticky;
    top: 0;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 16px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    border: 0;
    border-radius: 0;
    background: var(--side-bg);
    box-shadow: none;
  }

  .side__brand {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 4px 0 8px;
  }

  .side__brand-name {
    margin-right: auto;
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
  }

  .side__brand::before {
    content: "";
    width: 18px;
    height: 18px;
    border-radius: 5px;
    background: var(--brand);
  }

  body.is-desk .side .side-collapse {
    width: 26px;
    height: 26px;
    min-height: 26px;
    margin: 0;
    border-radius: 6px;
    background: none;
    color: var(--faint);
  }

  body.is-desk .side .side-collapse:hover {
    background: var(--sunk);
    color: var(--ink);
  }

  body.is-desk .side .side__nav {
    gap: 16px;
  }

  body.is-desk .side .side__group {
    gap: 1px;
  }

  /* 分组之间只靠留白，不画线 */
  body.is-desk .side .side__group + .side__group {
    padding-top: 0;
    box-shadow: none;
  }

  body.is-desk .side .side-label {
    margin: 0 0 4px;
    padding: 0 8px;
    color: var(--faint);
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
  }

  body.is-desk .side button[data-view] {
    display: block;
    min-height: 30px;
    padding: 5px 8px;
    border-radius: 6px;
    background: none;
    box-shadow: none;
    color: var(--ink-soft);
    font-size: 13.5px;
    font-weight: 500;
  }

  body.is-desk .side button[data-view]:hover {
    background: rgba(106, 75, 255, 0.07);
    color: var(--ink);
  }

  body.is-desk .side button[data-view][aria-current="page"],
  body.is-desk .side button[data-view][aria-current="page"]:hover {
    background: rgba(106, 75, 255, 0.11);
    color: var(--brand-ink);
    font-weight: 600;
    box-shadow: none;
  }

  .side__foot {
    display: grid;
    gap: 6px;
    margin-top: auto;
  }

  body.is-desk .side .side__logout {
    display: block;
    min-height: 28px;
    padding: 5px 8px;
    border: 0;
    border-radius: 6px;
    background: none;
    color: var(--muted);
    font: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
  }

  body.is-desk .side .side__logout:hover {
    background: rgba(106, 75, 255, 0.07);
    color: var(--ink);
  }

  body.is-desk .desk-main {
    padding: 20px 24px 48px 12px;
    gap: 14px;
  }

  body.is-side-collapsed.is-desk .desk {
    grid-template-columns: 50px minmax(0, 1fr);
  }

  body.is-side-collapsed.is-desk .side {
    padding: 16px 6px;
    align-items: center;
  }

  body.is-side-collapsed .side__brand-name,
  body.is-side-collapsed .side__brand::before,
  body.is-side-collapsed .side__areas,
  body.is-side-collapsed .side__foot {
    display: none;
  }

  body.is-side-collapsed .side__brand {
    padding: 0;
  }
}

/* ------------------------------------------------------------ 面板和字 */
body.is-desk .desk-main .card,
body.is-desk .desk-main .workspace-head {
  padding: 16px 18px 18px;
  border: 0;
  border-radius: 16px;
  background: var(--paper);
  box-shadow: var(--lift);
}

body.is-desk .desk-main h1,
body.is-desk .desk-main .workspace-head h1,
body.is-desk .desk-main .card-title h1 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.3;
}

body.is-desk .desk-main .card h2,
body.is-desk .desk-main .card-title h2 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
}

body.is-desk .desk-main .card > .lead,
body.is-desk .desk-main .card-title p,
body.is-desk .desk-main .hint {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

body.is-desk .desk-main .card form {
  margin-top: 10px;
  gap: 8px;
}

body.is-desk .desk-main .card-title {
  margin-bottom: 10px;
}

body.is-desk .desk-main .card label,
body.is-desk .desk-main .field-label {
  color: var(--muted);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

body.is-desk .desk-main .empty {
  color: var(--muted);
  font-size: 13.5px;
}

/* ------------------------------------------------------------ 控件 */
body.is-desk .desk-main .card input:not([type="checkbox"]):not([type="radio"]),
body.is-desk .desk-main .card textarea,
body.is-desk .desk-main .card select,
body.is-desk .desk-main .field {
  border: 0;
  border-radius: 8px;
  background-color: var(--paper);
  box-shadow: var(--ring);
  color: var(--ink);
  font-size: 13.5px;
}

body.is-desk .desk-main .card input:not([type="checkbox"]):not([type="radio"]),
body.is-desk .desk-main .card select,
body.is-desk .desk-main input.field,
body.is-desk .desk-main select.field {
  min-height: 0;
  height: 34px;
  padding-top: 0;
  padding-bottom: 0;
}

body.is-desk .desk-main .card input:not([type="checkbox"]):not([type="radio"]):focus,
body.is-desk .desk-main .card textarea:focus,
body.is-desk .desk-main .card select:focus,
body.is-desk .desk-main .field:focus {
  outline: none;
  box-shadow: var(--ring-focus);
}

body.is-desk .desk-main ::placeholder {
  color: #8d87a8;
}

body.is-desk .desk-main input[type="checkbox"],
body.is-desk .desk-main input[type="radio"] {
  accent-color: var(--brand);
}

body.is-desk .desk-main .card textarea.session-input {
  min-height: 108px;
}

/* 次要按钮：白底、一圈细环，所有页面一个样 */
body.is-desk .admin-secondary-button,
body.is-desk .desk-main .copy-btn,
body.is-desk .desk-main .bin-col__switch,
body.is-desk .desk-main .bin-flag,
body.is-desk .cm-drawer .admin-secondary-button {
  min-height: 32px;
  height: auto;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--ring);
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  text-decoration: none;
  transition: background 150ms var(--ease-ui), box-shadow 150ms var(--ease-ui), color 150ms var(--ease-ui);
}

body.is-desk .desk-main .copy-btn,
body.is-desk .desk-main .bin-flag,
body.is-desk .desk-main .bin-col__switch {
  min-height: 26px;
  padding: 0 9px;
  font-size: 12px;
}

body.is-desk .admin-secondary-button:hover:not(:disabled),
body.is-desk .desk-main .copy-btn:hover,
body.is-desk .desk-main .bin-flag:hover,
body.is-desk .desk-main .bin-col__switch:hover {
  background: var(--row-hover);
  box-shadow: 0 0 0 1px #cbc2ea, 0 1px 2px rgba(79, 53, 214, 0.08);
  color: var(--ink);
  transform: none;
}

body.is-desk .admin-secondary-button:disabled {
  background: var(--well);
  box-shadow: 0 0 0 1px var(--hair);
  color: #9d98b6;
}

body.is-desk .admin-secondary-button--danger:not(:disabled) {
  color: var(--danger);
}

body.is-desk .admin-secondary-button--danger:hover:not(:disabled) {
  background: #fff5f6;
  box-shadow: 0 0 0 1px #f0b6bc, 0 1px 2px rgba(79, 53, 214, 0.06);
  color: var(--danger);
}

/* 主按钮：页面上唯一的实色紫 */
body.is-desk .desk-main .admin-primary-button {
  width: auto;
  min-height: 34px;
  height: auto;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  transform: none;
}

body.is-desk .desk-main .admin-primary-button:hover:not(:disabled) {
  color: #fff;
}

body.is-desk .desk-main .admin-primary-button:disabled {
  background: #bfb2ff;
  box-shadow: none;
}

body.is-desk .desk-main button.linkish {
  min-height: 24px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand-ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}

body.is-desk .desk-main button.linkish:hover {
  text-decoration: underline;
}

/* 两选一的开关（充值 / 换绑这类） */
body.is-desk .desk-main .kind-switch {
  padding: 2px;
  border: 0;
  border-radius: 8px;
  background: var(--sunk);
  box-shadow: none;
}

body.is-desk .desk-main .kind-switch__btn {
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  background: none;
  box-shadow: none;
  color: var(--muted);
  font-size: 13px;
}

body.is-desk .desk-main .kind-switch__btn.is-selected {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(79, 53, 214, 0.16);
}

/* ------------------------------------------------------------ 面板里的格子 */
body.is-desk .desk-main .metric,
body.is-desk .desk-main .auto-stat,
body.is-desk .desk-main .auto-row,
body.is-desk .desk-main .bin-row,
body.is-desk .desk-main .link-box,
body.is-desk .desk-main .session-box,
body.is-desk .desk-main .payment-row,
body.is-desk .desk-main .idle-bar {
  border: 0;
  border-radius: 8px;
  background: var(--well);
  box-shadow: none;
}

body.is-desk .desk-main .auto-stat.is-bad,
body.is-desk .desk-main .bin-row.is-blocked {
  background: #fff1f2;
}

body.is-desk .desk-main .bin-row.is-cold {
  background: #fff7e6;
}

body.is-desk .desk-main .metric__label,
body.is-desk .desk-main .auto-stat__label {
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}

body.is-desk .desk-main .auto-stat {
  align-content: start;
  padding: 8px 12px;
}

body.is-desk .desk-main .auto-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

body.is-desk .desk-main .bin-rows {
  gap: 4px;
  margin-top: 8px;
}

body.is-desk .desk-main .bin-row,
body.is-desk .desk-main .auto-row {
  padding-top: 7px;
  padding-bottom: 7px;
}

body.is-desk .desk-main .bin-cols {
  gap: 16px;
  margin-top: 10px;
}

body.is-desk .desk-main .bin-col__role,
body.is-desk .desk-main .auto-row__tag,
body.is-desk .desk-main .auto-row__state:not(.is-ok):not(.is-bad):not(.is-run):not(.is-wait),
body.is-desk .desk-main .auto-switch__state:not(.is-on) {
  background: var(--sunk);
  color: var(--ink-soft);
}

body.is-desk .desk-main .chip,
body.is-desk .desk-main .kind-mark,
body.is-desk .desk-main .bin-col__role,
body.is-desk .desk-main .auto-row__tag,
body.is-desk .desk-main .auto-row__state,
body.is-desk .desk-main .auto-switch__state {
  border-radius: 6px;
  font-family: inherit;
  letter-spacing: 0;
  text-transform: none;
}

body.is-desk .desk-main .kind-mark {
  font-size: 12px;
}

body.is-desk .desk-main .kind-mark:not(.kind-mark--rebind) {
  color: var(--warn);
}

body.is-desk .desk-main .name-alert {
  border: 0;
  border-radius: 10px;
  box-shadow: var(--lift);
}

body.is-desk .desk-main .banner {
  border: 0;
  border-radius: 8px;
}

/* 提交充值页的套餐格 */
body.is-desk .desk-main .plan-pick {
  border: 0;
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--ring);
}

body.is-desk .desk-main .plan-pick.is-selected,
body.is-desk .desk-main .plan-pick[aria-pressed="true"],
body.is-desk .desk-main .plan-pick[aria-checked="true"] {
  background: #f6f2ff;
  box-shadow: 0 0 0 2px var(--brand);
}

/* ------------------------------------------------------------ 表格 */
@media (min-width: 721px) {
  /* 只有「标题 + 一张表」的面板：标题在上，表格直接顶到面板两边 */
  body.is-desk .desk-main .table-wrap {
    border: 0;
    border-radius: 0;
    background: none;
    overflow-x: auto;
  }

  body.is-desk .desk-main .card > .table-wrap,
  body.is-desk .desk-main .card > [data-list-body],
  body.is-desk .desk-main .card > [data-live-list] {
    margin: 0 -18px -18px;
  }

  body.is-desk .desk-main .cdk-table {
    border-collapse: collapse;
    border-spacing: 0;
    font-size: 13.5px;
  }

  body.is-desk .desk-main .cdk-table th {
    padding: 8px 12px;
    border-bottom: 1px solid var(--hair);
    background: none;
    color: var(--faint);
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
  }

  body.is-desk .desk-main .cdk-table td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--hair);
    border-radius: 0;
    background: none;
    box-shadow: none;
    color: var(--ink);
    font-size: 13.5px;
  }

  body.is-desk .desk-main .cdk-table th:first-child,
  body.is-desk .desk-main .cdk-table td:first-child {
    padding-left: 18px;
  }

  body.is-desk .desk-main .cdk-table th:last-child,
  body.is-desk .desk-main .cdk-table td:last-child {
    padding-right: 18px;
  }

  body.is-desk .desk-main .cdk-table tbody tr:last-child td {
    border-bottom: 0;
  }

  body.is-desk .desk-main .cdk-table tbody tr:hover td {
    background: var(--row-hover);
  }

  body.is-desk .desk-main .cdk-table code {
    color: var(--ink-soft);
    font-size: 13px;
  }

  /* 续费队列：每个客户、每个状态上面那一行小标题不是数据行 */
  body.is-desk .desk-main .cdk-table .queue-band__label td {
    padding-top: 16px;
    padding-bottom: 4px;
    border-bottom: 0;
  }

  body.is-desk .desk-main .cdk-table tbody tr.queue-band__label:hover td {
    background: none;
  }
}

body.is-desk .desk-main .list-search {
  margin-bottom: 12px;
}

/* ------------------------------------------------------------ 卡密管理 */
body.is-desk .desk-main .card.cm {
  padding: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

.card.cm.is-loading .cm-wrap {
  opacity: 0.6;
}

.cm-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
}

body.is-desk .desk-main .cm-top h1 {
  margin-right: auto;
}

.cm-tabs {
  display: flex;
  gap: 20px;
  margin: 0 0 12px;
  overflow-x: auto;
}

.cm-tabs button {
  padding: 8px 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}

.cm-tabs button:hover {
  color: var(--ink);
}

.cm-tabs button b {
  margin-left: 6px;
  font-weight: 500;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  color: var(--faint);
}

.cm-tabs button[aria-selected="true"] {
  border-bottom-color: var(--brand);
  color: var(--brand-ink);
  font-weight: 600;
}

.cm-tabs button[aria-selected="true"] b {
  color: var(--brand-ink);
}

.cm-tabs button.is-alert b {
  color: var(--danger);
  font-weight: 600;
}

.cm-facets {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
}

.cm-facets > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.cm-facets__label {
  width: 32px;
  font-size: 12px;
  color: var(--faint);
}

.cm-facet {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: var(--sunk);
  color: var(--ink-soft);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.cm-facet b {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* 选中的那一格：一圈同色的环，是状态不是装饰 */
.cm-facet[aria-pressed="true"] {
  box-shadow: 0 0 0 1.5px currentColor;
  font-weight: 600;
}

.cm-facet:not([class*="cm-tag--"])[aria-pressed="true"] {
  background: var(--brand-soft);
  color: var(--brand-ink);
}

.cm-facet em {
  font-style: normal;
  font-weight: 600;
  font-size: 12px;
  color: var(--danger);
}

.cm-facet em::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #df1b41;
  vertical-align: 1px;
}

.cm-facet em:not(:empty)::before {
  margin-right: 5px;
}

/* 套餐标签：按档位分色的小方角标签 */
.cm-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  background: #f0edf8;
  color: #615b7c;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.cm-tag--pro100 { background: #e0edff; color: #1d4fa8; }
.cm-tag--pro20x { background: #ebe6ff; color: #4b33cc; }
.cm-tag--pro500 { background: #d9f5e8; color: #0b6b4b; }
.cm-tag--plus,
.cm-tag--plushalf { background: #e8e3f6; color: #35304d; }
.cm-tag--go { background: #f0edf8; color: #615b7c; }
.cm-tag--rebind { background: #ffedd1; color: #8a4f06; }
.cm-tag--gemplus,
.cm-tag--gemplusy { background: #e3ecff; color: #2346a8; }
.cm-tag--gempro,
.cm-tag--gemproy { background: #ece8ff; color: #4b33cc; }
.cm-tag--gemultra20,
.cm-tag--gemultra30 { background: #e6e3ff; color: #3a2fa8; font-weight: 700; }

/* 状态：淡底、同色深字、前面一个圆点 */
.cm-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px 2px 7px;
  border-radius: 6px;
  color: #615b7c;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.cm-chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.cm-chip--recharging { color: #8a5200; }
.cm-chip--completed { color: #0b6b4b; }
.cm-chip--failed,
.cm-chip--void { color: #b4232f; }

.cm-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 12px;
}

body.is-desk .desk-main .card.cm .cm-filters input,
body.is-desk .desk-main .card.cm .cm-filters select,
body.is-desk .desk-main .card.cm .cm-pager select {
  width: auto;
  min-width: 0;
  height: 32px;
  margin: 0;
  padding: 0 10px;
  font-size: 13px;
}

body.is-desk .desk-main .card.cm .cm-filters input[type="search"] {
  flex: 0 1 340px;
}

body.is-desk .desk-main .card.cm .cm-filters select,
body.is-desk .desk-main .card.cm .cm-pager select {
  padding-right: 28px;
}

.card.cm .cm-filters select[hidden] {
  display: none;
}

.cm-reset {
  min-height: 28px;
  padding: 0 6px;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.cm-reset:hover {
  color: var(--brand-ink);
}

.cm-picked {
  margin-left: auto;
  font-size: 13px;
  font-weight: 500;
  color: var(--brand-ink);
}

/* 表格放在一块白面板上，不画外框；一行最多两层 */
.cm-wrap {
  border-radius: 16px;
  background: var(--paper);
  box-shadow: var(--lift);
  overflow: hidden;
  transition: opacity 160ms var(--ease-ui);
}

.cm-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13.5px;
}

.cm-table th {
  padding: 9px 10px;
  border-bottom: 1px solid var(--hair);
  color: var(--faint);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

.cm-table td {
  position: relative;
  height: 50px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--hair);
  vertical-align: middle;
  box-sizing: border-box;
}

.cm-table th:first-child,
.cm-table td:first-child {
  padding-left: 16px;
}

.cm-table th:last-child,
.cm-table td:last-child {
  padding-right: 16px;
}

.cm-table tbody tr {
  cursor: pointer;
}

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

.cm-table tbody tr:hover {
  background: var(--row-hover);
}

.cm-table tbody tr.is-open {
  background: #f4f0ff;
}

.cm-table tbody tr:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.cm-l1,
.cm-l2 {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cm-l1 {
  color: var(--ink);
}

.cm-l2 {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.cm-l2.is-bad,
.cm-bad {
  color: var(--danger);
}

.cm-table code {
  padding: 0;
  background: none;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 400;
  user-select: all;
}

.cm-num {
  font-family: var(--mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.cm-lab {
  margin-right: 5px;
  font-size: 12px;
  color: var(--faint);
}

.cm-dash {
  color: #a8a2c2;
}

.cm-remark {
  font-weight: 500;
}

.cm-copy {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.cm-table tr:hover .cm-copy,
.cm-copy:focus-visible,
.cm-copy.is-copied {
  opacity: 1;
}

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

.cm-ops button {
  min-height: 28px;
  padding: 4px 2px;
  border: 0;
  background: none;
  color: var(--brand-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}

.cm-ops button:hover {
  text-decoration: underline;
}

.card.cm .empty {
  margin: 0;
  padding: 40px 0;
  text-align: center;
}

.cm-pager {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 2px 0;
  font-size: 13px;
  color: var(--muted);
}

.cm-pager span:first-child {
  margin-right: auto;
}

.cm-pager button {
  min-width: 30px;
  min-height: 30px;
  padding: 0 9px;
  border: 0;
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--ring);
  color: var(--ink-soft);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.cm-pager button:disabled {
  background: none;
  box-shadow: none;
  color: #a8a2c2;
  cursor: default;
}

.cm-pager button[aria-current="page"] {
  background: var(--brand-soft);
  box-shadow: none;
  color: var(--brand-ink);
  font-weight: 600;
}

/* 右侧抽屉：贴着浏览器右边、通高。只改透明度进场。 */
.cm-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  width: 420px;
  max-width: 100vw;
  background: var(--paper);
  box-shadow: -1px 0 0 rgba(79, 53, 214, 0.06), -16px 0 40px -20px rgba(79, 53, 214, 0.3);
  animation: cm-fade 160ms var(--ease-ui);
}

.cm-drawer[hidden] {
  display: none;
}

@keyframes cm-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.cm-drawer header {
  padding: 16px 18px 14px;
}

.cm-drawer header > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cm-drawer header code {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink);
  user-select: all;
}

.cm-drawer header p {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 0;
}

.cm-close {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.cm-close:hover {
  background: var(--sunk);
  color: var(--ink);
}

.cm-drawer__body {
  display: grid;
  gap: 18px;
  align-content: start;
  padding: 16px 18px 20px;
  overflow-y: auto;
}

.cm-drawer h3 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.cm-kv {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 7px 12px;
  margin: 0;
  font-size: 13.5px;
}

.cm-kv dt {
  color: var(--muted);
}

.cm-kv dd {
  margin: 0;
  color: var(--ink);
  word-break: break-all;
}

.cm-kv code {
  font-family: var(--mono);
  font-size: 13px;
}

.cm-steps3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.cm-steps3 span {
  padding: 5px 0;
  border-radius: 6px;
  background: var(--well);
  color: #8d87a8;
  font-size: 12.5px;
  text-align: center;
}

.cm-steps3 span.is-done { background: var(--brand-soft); color: var(--brand-ink); font-weight: 500; }
.cm-steps3 span.is-ok { background: #d9f5e8; color: #0b6b4b; font-weight: 600; }
.cm-steps3 span.is-bad { background: #ffe4e6; color: #b4232f; font-weight: 600; }

.cm-upbox {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--well);
  font-size: 13.5px;
}

.cm-upbox div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.cm-upbox b {
  font-family: var(--mono);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.cm-upbox div:last-child {
  padding-top: 7px;
  box-shadow: inset 0 1px 0 var(--edge);
  font-weight: 600;
}

.cm-line {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
}

.cm-line li {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 10px;
  color: var(--ink-soft);
}

.cm-line time {
  padding-top: 1px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
}

.cm-drawer footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 18px;
}

/* ------------------------------------------------------------ 两页的宽屏排法 */
body.is-desk .desk-main.is-measure {
  width: min(100%, 1040px);
}

/* 查询订阅：左边窄窄一栏贴 Session，右边整块是结果 */
@media (min-width: 1280px) {
  body.is-desk .desk-main.is-measure:has(#session-query-form) {
    width: 100%;
    grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
    column-gap: 14px;
    align-items: start;
  }

  body.is-desk .desk-main:has(#session-query-form) > .card:first-child {
    grid-column: 1;
    grid-row: 1 / span 3;
    position: sticky;
    top: 20px;
  }

  body.is-desk .desk-main:has(#session-query-form) > #session-desk,
  body.is-desk .desk-main:has(#session-query-form) > #admin-batch {
    grid-column: 2;
    max-width: 1040px;
  }

  body.is-desk .desk-main:has(#session-query-form) textarea.session-input {
    min-height: 220px;
  }

  /* 卡密详情、续费任务详情：分两栏，各块自己往上靠；页头和账单名称提醒横跨两栏。
     Gemini 详情没有订阅九宫格，同一套容器接着用：宽于 1280 等宽两栏，窄了退回一整列。 */
  body.is-desk .desk-main:has(> #subscription-card),
  body.is-desk .desk-main.is-measure:not(:has(> #subscription-card)):not(:has(#session-query-form)) {
    display: block;
    width: min(100%, 1480px);
    columns: 2;
    column-gap: 14px;
  }

  body.is-desk .desk-main:has(> #subscription-card) > *,
  body.is-desk .desk-main.is-measure:not(:has(> #subscription-card)):not(:has(#session-query-form)) > * {
    margin: 0 0 14px;
    break-inside: avoid;
  }

  body.is-desk .desk-main:has(> #subscription-card) > :not(.card),
  body.is-desk .desk-main.is-measure:not(:has(> #subscription-card)):not(:has(#session-query-form)) > :not(.card) {
    column-span: all;
  }

  /* 左栏是基本信息和记下结果。右栏从对账 / 自动充值 / 提交记录 / 同一批里最先出现的那一块开始，
     后面的块跟着留在右栏，不按高度再匀回去。 */
  body.is-desk .desk-main.is-measure:not(:has(> #subscription-card)):not(:has(#session-query-form)) {
    column-fill: auto;
  }

  body.is-desk .desk-main.is-measure:not(:has(> #subscription-card)):not(:has(#session-query-form)) > section.card:has(#detail-charge-box, #detail-steps-box, #detail-subs-box, #detail-mates-box) {
    break-before: column;
  }

  body.is-desk .desk-main.is-measure:not(:has(> #subscription-card)):not(:has(#session-query-form)) > section.card:has(#detail-charge-box, #detail-steps-box, #detail-subs-box, #detail-mates-box) ~ section.card:has(#detail-charge-box, #detail-steps-box, #detail-subs-box, #detail-mates-box) {
    break-before: auto;
  }
}

body.is-desk .desk-main.is-measure > section.desk-foot,
body.is-desk #session-desk.desk-foot > .card,
body.is-desk #admin-batch.desk-foot > .card {
  padding: 16px 18px 18px;
}

body.is-desk .desk-main #session-desk > .empty {
  margin: 0;
  padding: 36px 16px;
  border-radius: 16px;
  background: var(--paper);
  box-shadow: var(--lift);
  text-align: center;
}

@media (max-width: 1080px) {
  .cm-wrap {
    overflow-x: auto;
  }

  .cm-table {
    min-width: 1080px;
  }

  .cm-top {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cm-drawer {
    animation: none;
  }
}

/* 九宫格的格子：尺寸不动（规则），只把白底加阴影换成浅灰底 */
body.is-desk .desk-main .metric-grid .metric,
body.is-desk .desk-main #subscription-card .metric,
body.is-desk #desk-dialog .metric {
  border: 0;
  background: var(--well);
  box-shadow: none;
}

body.is-desk .desk-main .metric__value {
  font-size: 14.5px;
  overflow-wrap: anywhere;
}

/* 到账提示左边那条彩色竖条去掉：提示本身有标题和按钮，不需要再加一条色带 */
body.is-desk #arrival-toast::before {
  display: none;
}

body.is-desk .desk-main .auto-row__state.is-run {
  color: #2f4594;
}

body.is-desk .desk-main .idle-bar__refresh {
  min-height: 24px;
}

/* ------------------------------------------------------------------
   轻盈感（2026-11-21）：线更淡、角更圆、动一下有回应。
   ------------------------------------------------------------------ */
/* 标签回到胶囊形 */
.cm-tag,
.cm-chip,
.cm-facet,
body.is-desk .desk-main .chip,
body.is-desk .desk-main .kind-mark,
body.is-desk .desk-main .bin-col__role,
body.is-desk .desk-main .auto-row__tag,
body.is-desk .desk-main .auto-row__state,
body.is-desk .desk-main .auto-switch__state {
  border-radius: 999px;
}

.cm-tag,
.cm-chip {
  padding: 3px 10px;
}

.cm-chip {
  padding-left: 9px;
}

/* 控件圆一点 */
body.is-desk .admin-secondary-button,
body.is-desk .desk-main .admin-primary-button,
body.is-desk .desk-main .card input:not([type="checkbox"]):not([type="radio"]),
body.is-desk .desk-main .card textarea,
body.is-desk .desk-main .card select,
body.is-desk .desk-main .field,
.cm-pager button {
  border-radius: 10px;
}

body.is-desk .desk-main .metric,
body.is-desk .desk-main .auto-stat,
body.is-desk .desk-main .auto-row,
body.is-desk .desk-main .bin-row,
body.is-desk .desk-main .plan-pick,
body.is-desk .desk-main .idle-bar,
.cm-upbox {
  border-radius: 12px;
}

body.is-desk .side button[data-view],
body.is-desk .side .side__logout {
  border-radius: 9px;
}

.side__areas,
body.is-desk .side .side__switch {
  border-radius: 11px;
}

body.is-desk .side .side__areas button,
body.is-desk .side .side__switch button {
  border-radius: 9px;
}

/* 主按钮：一层很柔的紫色渐变，底下一圈淡紫的光 */
body.is-desk .desk-main .admin-primary-button {
  background: linear-gradient(180deg, #7457ff 0%, #6243f5 100%);
  box-shadow: 0 1px 1px rgba(79, 53, 214, 0.2), 0 6px 16px -6px rgba(106, 75, 255, 0.6);
  transition: transform 180ms var(--ease-out), box-shadow 180ms var(--ease-out), filter 180ms var(--ease-out);
}

body.is-desk .desk-main .admin-primary-button:hover:not(:disabled) {
  background: linear-gradient(180deg, #7457ff 0%, #6243f5 100%);
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 1px 1px rgba(79, 53, 214, 0.2), 0 10px 22px -8px rgba(106, 75, 255, 0.7);
}

body.is-desk .desk-main .admin-primary-button:active:not(:disabled) {
  transform: translateY(0);
  filter: brightness(0.98);
}

.side__brand::before {
  background: linear-gradient(135deg, #8f7bff, #6a4bff 55%, #8fd4ff);
}

/* 表格：行线淡到几乎只是一点提示，表头不压线；悬停时整行浮起一层淡紫 */
body.is-desk .desk-main .cdk-table th,
.cm-table th {
  border-bottom-color: transparent;
  color: var(--faint);
  font-weight: 500;
}

body.is-desk .desk-main .cdk-table td,
.cm-table td {
  border-bottom-color: var(--hair);
  transition: background 140ms var(--ease-ui);
}

.cm-table tbody tr {
  transition: background 140ms var(--ease-ui);
}

body.is-desk .desk-main .cdk-table tbody tr:hover td,
.cm-table tbody tr:hover {
  background: #f8f5ff;
}

.cm-tabs {
  box-shadow: inset 0 -1px 0 var(--hair);
}

.cm-drawer header {
  box-shadow: inset 0 -1px 0 var(--hair);
}

.cm-drawer footer {
  box-shadow: inset 0 1px 0 var(--hair);
}

/* 菜单项、页签、筛选格：悬停和选中都有一点过渡 */
body.is-desk .side button[data-view],
.cm-tabs button,
.cm-facet,
.cm-pager button {
  transition: background 160ms var(--ease-ui), color 160ms var(--ease-ui), box-shadow 160ms var(--ease-ui), transform 160ms var(--ease-out);
}

.cm-facet:hover {
  filter: none;
  transform: translateY(-1px);
}

body.is-desk .admin-secondary-button:hover:not(:disabled),
body.is-desk .desk-main .tone:hover:not(:disabled) {
  transform: translateY(-1px);
}

/* 抽屉从右边轻轻滑进来一点（只动 8px，不抵消定位） */
@keyframes cm-fade {
  from { opacity: 0; transform: translateX(8px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  body.is-desk .desk-main .admin-primary-button,
  body.is-desk .admin-secondary-button,
    .cm-facet {
    transition: none;
    transform: none !important;
  }
}

/* ------------------------------------------------------------------
   2026-11-21 列表细节
   ------------------------------------------------------------------ */
/* 列宽：每一列都有自己的宽度，表格有最小宽度。窗口窄了横向滚，不再把「兑换账号」挤成 0、
   和时间叠在一起。 */
.cm-wrap {
  overflow-x: auto;
}

.cm-table {
  min-width: 1216px;
}

/* 都给像素宽度，多出来的空间按比例分；卡密那一列要放得下完整卡号 */
.cm-c-pick { width: 40px; }
.cm-c-code { width: 268px; }
.cm-c-plan { width: 128px; }
.cm-c-remark { width: 80px; }
.cm-c-status { width: 104px; }
.cm-c-job { width: 140px; }
.cm-c-mail { width: 164px; }
.cm-c-time { width: 156px; }
.cm-c-up { width: 96px; }
.cm-c-ops { width: 62px; }

/* Gemini 卡密管理：最长套餐名「AI Ultra 30TB 月付」、最长前缀 GEM-ULTRA30-MONTH-
   都要完整落在格子里。没有「升级抵扣」列，1440 宽（侧栏 208 + 主体内边距）不再横向滚动。
   上面的列宽和 min-width 留给 GPT，这里不改。 */
.card.cm.is-gemini .cm-table {
  min-width: 0;
  width: 100%;
}

.card.cm.is-gemini .cm-c-code { width: 188px; }
.card.cm.is-gemini .cm-c-plan { width: 168px; }

.card.cm.is-gemini .cm-facet {
  flex: 0 0 auto;
  max-width: none;
  overflow: visible;
  white-space: nowrap;
  text-overflow: clip;
}

.card.cm.is-gemini .cm-table td {
  height: auto;
  min-height: 50px;
}

.card.cm.is-gemini .cm-table td.cm-code .cm-l1,
.card.cm.is-gemini .cm-table td:nth-child(3) .cm-l1 {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.card.cm.is-gemini .cm-l1 > .cm-tag {
  max-width: none;
  overflow: visible;
  text-overflow: clip;
}

.card.cm.is-gemini .cm-code__gem {
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
}

.card.cm.is-gemini .cm-code__pre,
.card.cm.is-gemini .cm-code__body {
  white-space: nowrap;
}

/* 选中框：平时一圈淡灰，看得见但不抢眼；选中是品牌紫 */
body.is-desk .card .pick-col input,
body.is-desk .card .pick input {
  border: 1.5px solid #cfc8e2;
  border-radius: 5px;
  background-color: #fff;
  box-shadow: none;
}

body.is-desk .card .pick-col input:hover:not(:checked):not(:indeterminate),
body.is-desk .card .pick input:hover:not(:checked):not(:indeterminate) {
  border-color: #a99fd0;
}

body.is-desk .card .pick-col input:checked,
body.is-desk .card .pick-col input:indeterminate,
body.is-desk .card .pick input:checked,
body.is-desk .card .pick input:indeterminate {
  border-color: var(--brand);
  background-color: var(--brand);
}

/* 卡密后面的复制：一个小图标，平时不显示，悬停这一行时半透明，指到它才清楚 */
.cm-table td.cm-code {
  padding-right: 30px;
}

.cm-copy {
  right: 4px;
  display: grid;
  place-items: center;
  width: 24px;
  min-height: 24px;
  height: 24px;
  padding: 0;
  border-radius: 7px;
  background: none;
  box-shadow: none;
  color: var(--faint);
  opacity: 0;
  transition: opacity 140ms var(--ease-ui), background 140ms var(--ease-ui), color 140ms var(--ease-ui);
}

.cm-table tr:hover .cm-copy {
  opacity: 0.5;
}

.cm-table tr .cm-copy:hover,
.cm-copy:focus-visible {
  background: var(--sunk);
  color: var(--brand-ink);
  opacity: 1;
}

.cm-copy.is-copied {
  color: var(--ok);
  opacity: 1;
}

/* 批次号和时间是辅助信息：小一号、淡一点 */
.cm-batch {
  margin-top: 1px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: #77718f;
}

.cm-when {
  font-size: 12px;
  color: var(--muted);
}

.cm-when .cm-num {
  font-size: 12px;
  color: var(--ink-soft);
}

.cm-l2.cm-when,
.cm-l2.cm-when .cm-num {
  font-size: 11.5px;
  color: #77718f;
}

.cm-when .cm-lab {
  font-size: 11.5px;
}

/* 邮箱：点一下就复制，长得还是一行字 */
.cm-mail {
  display: block;
  max-width: 100%;
  min-height: 24px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: copy;
}

.cm-mail:hover {
  color: var(--brand-ink);
}

.cm-mail.is-copied {
  color: var(--ok);
}

/* ------------------------------------------------------------ 生成卡密 */
/* 价目表就是选择器：点一行选档位和地区 */
body.is-desk .desk-main .price-table--pick {
  margin-top: 12px;
  font-size: 13.5px;
}

body.is-desk .desk-main .price-table--pick th {
  padding: 6px 12px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
}

body.is-desk .desk-main .price-table--pick td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--hair);
  transition: background 140ms var(--ease-ui);
}

body.is-desk .desk-main .price-table--pick tbody tr {
  cursor: pointer;
}

body.is-desk .desk-main .price-table--pick tbody tr:hover td {
  background: #f8f5ff;
}

body.is-desk .desk-main .price-table--pick tr.is-here td {
  background: var(--brand-soft);
  font-weight: 600;
}

body.is-desk .desk-main .price-table--pick tr td:first-child {
  width: 34px;
  border-radius: 10px 0 0 10px;
}

body.is-desk .desk-main .price-table--pick tr td:last-child {
  border-radius: 0 10px 10px 0;
}

body.is-desk .desk-main .price-table--pick tbody tr:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
  border-radius: 10px;
}

.price-dot {
  display: block;
  width: 14px;
  height: 14px;
  border: 1.5px solid #cfc8e2;
  border-radius: 50%;
  background: #fff;
  box-sizing: border-box;
}

tr.is-here .price-dot {
  border: 4.5px solid var(--brand);
}

.price-stock {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}

.price-stock.is-low {
  color: var(--danger);
  font-weight: 600;
}

body.is-desk .desk-main .card form .generate-line {
  align-items: end;
}

.generate-confirm {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}

/* 刚生成的卡密：一个文本框，一行一张 */
.generated {
  margin-top: 16px;
}

body.is-desk .desk-main .card textarea.generated__box {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 10px 12px;
  background-color: var(--well);
  box-shadow: none;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  resize: vertical;
  white-space: pre;
}

body.is-desk .desk-main .card textarea.generated__box:focus {
  box-shadow: var(--ring-focus);
}

body.is-desk .desk-main .generate-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

body.is-desk .desk-main .generate-toolbar .lead {
  margin: 0 auto 0 0;
  color: var(--ink);
  font-weight: 600;
}

/* ------------------------------------------------------------------
   2026-11-21 确认生成的弹窗、同一批、状态标签
   ------------------------------------------------------------------ */
/* 确认窗：数量、档位、地区、类型、备注一项一格，每一格都能改 */
body.is-desk #desk-dialog .dialog {
  width: min(480px, 100%);
  max-height: calc(100dvh - 32px);
  padding: 24px;
  border-radius: 18px;
  overflow-y: auto;
}

body.is-desk #desk-dialog .dialog h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0;
}

.gen-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.gen-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 10px 12px 12px;
  border-radius: 12px;
  background: var(--well);
}

.gen-field--wide {
  grid-column: 1 / -1;
}

.gen-field > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.gen-field input,
.gen-field select {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background-color: var(--paper);
  box-shadow: var(--ring);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
}

.gen-field #gen-remark {
  font-size: 14px;
  font-weight: 500;
}

.gen-field input:focus,
.gen-field select:focus {
  outline: none;
  box-shadow: var(--ring-focus);
}

.gen-field.is-off {
  opacity: 0.5;
}

.gen-field .kind-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 40px;
  padding: 3px;
  border-radius: 10px;
  background: var(--sunk);
}

.gen-field .kind-switch__btn {
  min-height: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  box-shadow: none;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.gen-field .kind-switch__btn.is-selected {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(79, 53, 214, 0.16);
}

body.is-desk #desk-dialog .dialog p.gen-sum {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: 15px;
  font-weight: 700;
  text-align: center;
}

body.is-desk #desk-dialog .dialog p.gen-sum.is-bad {
  background: var(--danger-soft);
  color: var(--danger);
}

@media (max-width: 520px) {
  #desk-dialog {
    padding: 12px;
    align-items: end;
  }

  body.is-desk #desk-dialog .dialog {
    padding: 18px 16px 16px;
  }

  .gen-field input,
  .gen-field select,
  .gen-field .kind-switch {
    height: 44px;
  }

  #desk-dialog .dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  #desk-dialog .dialog-actions .admin-primary-button,
  #desk-dialog .dialog-actions .admin-secondary-button {
    width: 100%;
    min-height: 44px;
  }
}

/* 筛选条上「正在只看这一批」的标签 */
.cm-batchchip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 4px 0 12px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.cm-batchchip[hidden] {
  display: none;
}

.cm-batchchip button {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: inherit;
  cursor: pointer;
}

.cm-batchchip button:hover {
  background: rgba(106, 75, 255, 0.16);
}

/* 抽屉里同一批的消耗情况 */
.cm-mates {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
}

.cm-mates div {
  display: grid;
  gap: 2px;
  padding: 8px 0;
  border-radius: 10px;
  background: var(--well);
  text-align: center;
}

.cm-mates b {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.cm-mates span {
  font-size: 11.5px;
  color: var(--muted);
}

/* 状态标签再淡一档：底色更浅，字色不变（保证看得清） */
.cm-chip { background: #f5f3fb; }
.cm-chip--recharging { background: #fff7e8; }
.cm-chip--completed { background: #eaf9f2; }
.cm-chip--failed,
.cm-chip--void { background: #fff1f2; }

.cm-chip::before {
  opacity: 0.75;
}

/* ------------------------------------------------------------------
   2026-11-21 手机和窄窗口（1080 以下）
   导航收成一条能横向滑的胶囊，不再占掉一整屏；面板两边留白收窄。
   ------------------------------------------------------------------ */
@media (max-width: 1080px) {
  body.is-desk .admin-page {
    margin: 0;
    padding: 0 12px 32px;
  }

  body.is-desk .side {
    position: static;
    display: grid;
    gap: 8px;
    margin: 12px 0;
    padding: 10px;
    border: 0;
    border-radius: 16px;
    background: var(--paper);
    box-shadow: var(--lift);
    max-height: none;
    overflow: visible;
  }

  body.is-desk .side .side-collapse {
    display: none;
  }

  body.is-desk .side .side__nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  body.is-desk .side .side__nav::-webkit-scrollbar {
    display: none;
  }

  body.is-desk .side .side__nav[hidden] {
    display: none;
  }

  body.is-desk .side .side__group {
    display: flex;
    flex: none;
    gap: 6px;
  }

  body.is-desk .side .side__group + .side__group {
    margin-left: 0;
    padding-top: 0;
    box-shadow: none;
  }

  body.is-desk .side .side-label {
    display: none;
  }

  body.is-desk .side button[data-view] {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: auto;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--well);
    box-shadow: none;
    color: var(--ink-soft);
    font-size: 13.5px;
    white-space: nowrap;
  }

  body.is-desk .side button[data-view][aria-current="page"],
  body.is-desk .side button[data-view][aria-current="page"]:hover {
    background: var(--brand-soft);
    color: var(--brand-ink);
    font-weight: 600;
    box-shadow: none;
  }

  .side-count {
    float: none;
  }

  body.is-desk .side .side__foot {
    display: block;
  }

  body.is-desk .desk-main {
    padding: 0 0 40px;
    gap: 12px;
  }

  body.is-desk .desk-main .card,
  body.is-desk .desk-main .workspace-head {
    padding: 14px 14px 16px;
  }

  .cm-top {
    flex-wrap: wrap;
  }

  .cm-filters > input[type="search"] {
    flex: 1 1 100%;
  }
}

@media (max-width: 640px) {
  /* 价目表：手机上不放「折美元」那一列，一屏放得下 */
  body.is-desk .desk-main .price-table--pick th:nth-child(5),
  body.is-desk .desk-main .price-table--pick td:nth-child(5) {
    display: none;
  }

  body.is-desk .desk-main .price-table--pick th,
  body.is-desk .desk-main .price-table--pick td {
    padding: 9px 6px;
  }

  body.is-desk .desk-main .price-table--pick tr td:first-child {
    width: 26px;
    padding-left: 8px;
  }

  #plan-prices {
    overflow-x: auto;
  }

  body.is-desk .desk-main .generate-line > * {
    flex: 1 1 100%;
  }

  body.is-desk .desk-main .generate-line .admin-primary-button {
    width: 100%;
    min-height: 44px;
  }

  body.is-desk .desk-main .generate-toolbar .lead {
    flex: 1 1 100%;
  }

  .cm-drawer {
    width: 100vw;
  }

  .cm-pager {
    flex-wrap: wrap;
  }
}

/* 确认窗改回只读：每一项一格，值用大字，只给人核对 */
.gen-field > b {
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.gen-field > b.is-soft {
  color: var(--faint);
  font-size: 14px;
  font-weight: 500;
}

/* 未使用的数量：少了红字，够了绿字 */
.cm-facet em.is-low,
.cm-facet b.is-low,
.price-stock.is-low {
  color: #c2212f;
  font-weight: 600;
  opacity: 1;
}

.cm-facet em.is-ok,
.cm-facet b.is-ok,
.price-stock.is-ok {
  color: #0b7a55;
  font-weight: 600;
  opacity: 1;
}

.cm-facet em.is-ok::before {
  background: #1fa97a;
}

/* 已作废：中性灰，不算失败 */
.cm-chip--void {
  background: #f5f3fb;
  color: #6e6889;
}

/* 已置换（2026-11-22）：作废并换成了新卡密。和已作废同属失效的灰调，带一点蓝紫好一眼分开（白底上字 5.7:1） */
.cm-chip.cm-chip--swapped,
.chip.chip--swapped {
  background: #eceef9;
  color: #525a8c;
}

/* 抽屉「换成了」后面的「打开」：进新卡密的完整详情 */
.cm-open-new {
  margin-left: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand-ink, #4f35d6);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}

.cm-open-new:hover {
  text-decoration: underline;
}

/* 抽屉里的提交记录：一次一条，新的在上 */
.cm-subs {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cm-subs li {
  display: grid;
  gap: 3px;
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--well);
  font-size: 13px;
}

.cm-subs__top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cm-subs__top b {
  font-weight: 600;
  color: var(--ink);
}

.cm-subs__top time {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
}

.cm-subs__res {
  font-size: 12px;
  font-weight: 600;
  color: #8a5200;
}

.cm-subs__res.is-ok { color: #0b7a55; }
.cm-subs__res.is-bad { color: #b4232f; }

.cm-subs__mail {
  color: var(--ink-soft);
  word-break: break-all;
}

.cm-subs__why {
  color: #b4232f;
  font-size: 12.5px;
}

/* 失败那次提交的最后一行：余额 + 复制卡信息 + 现在转出（2026-11-25） */
.cm-subs__card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px 72px 78px;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding-top: 7px;
  border-top: 1px solid var(--line, rgba(0, 0, 0, 0.08));
}

.cm-subs__card > span {
  color: var(--ink-soft);
}

.cm-subs__card b {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--ink);
}

.cm-subs__card em {
  margin-left: 8px;
  font-style: normal;
  font-size: 12px;
  color: var(--faint);
}

.cm-subs__card .admin-secondary-button {
  min-height: 28px;
  padding: 0;
  font-size: 12.5px;
  white-space: nowrap;
}

/* 三个按钮各占固定一列、同一行（2026-11-28 加「锁定」，用户：「三个一行不行吗」）：
   没有「锁定」「现在转出」的行，「复制卡信息」也停在同一列 */
.cm-subs__card [data-sub-card-copy] { grid-column: 2; }
.cm-subs__card [data-sub-card-lock] { grid-column: 3; }
.cm-subs__card [data-sub-card-release] { grid-column: 4; }

/* 抽屉、窄屏放不下一行：说明独占一行，两个按钮在下面一行靠右，列位不变 */
.cm-subs li { container-type: inline-size; }
@container (max-width: 400px) {
  .cm-subs__card > span { grid-column: 1 / -1; }
}

.cm-mates {
  grid-template-columns: repeat(auto-fit, minmax(56px, 1fr));
}

/* 自动充值页「同时在跑」那一格：数字旁边一个小下拉改上限 */
.auto-parallel {
  position: relative;
}

.auto-parallel.is-busy strong {
  color: #8a5200;
}

.auto-parallel__cap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

body.is-desk .desk-main .card .auto-parallel__cap select {
  width: auto;
  height: 26px;
  padding: 0 22px 0 8px;
  border-radius: 8px;
  font-size: 12.5px;
}

/* 抽屉里的卡密：点一下就复制 */
.cm-codecopy {
  min-height: 28px;
  padding: 2px 8px;
  margin-left: -8px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 14px;
  text-align: left;
  cursor: copy;
  transition: background 140ms var(--ease-ui), color 140ms var(--ease-ui);
}

.cm-codecopy:hover {
  background: var(--brand-soft);
  color: var(--brand-ink);
}

.cm-codecopy.is-copied {
  color: #0b7a55;
}

.cm-codecopy--row {
  min-height: 24px;
  margin: -2px 0 -2px -8px;
  font-size: 13px;
}

/* 同一批的统计：每个数按含义上色，是 0 的淡下去 */
.cm-mates .is-unused b { color: #5a43e6; }
.cm-mates .is-ok b { color: #0b7a55; }
.cm-mates .is-bad b { color: #c2212f; }
.cm-mates .is-void b { color: #6e6889; }

.cm-mates .is-unused { background: #f1edff; }
.cm-mates .is-wait { background: #fff6e3; }
.cm-mates .is-ok { background: #e8f8f0; }
.cm-mates .is-bad { background: #fff0f1; }

.cm-mates .is-zero {
  background: var(--well);
}

/* 详情页那一排操作按钮恢复各自的颜色（重新查询、Token、历史账单、支付链接、查看账单、自动续费），
   只把形状收成和别的按钮一样高 */
body.is-desk .desk-main .tone {
  min-height: 32px;
  font-size: 13px;
}

/* ------------------------------------------------------------------
   2026-11-21 滚动条平时隐去，滚动时才出现
   轨道一直透明、没有边线；滑块平时也透明，正在滚的那个容器（脚本挂 is-scrolling）
   才显出紫调的半透明滑块，停下来不到一秒再淡掉。
   ------------------------------------------------------------------ */
body.is-desk,
body.is-desk * {
  scrollbar-color: transparent transparent;
}

html:has(body.is-desk) {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

html.is-scrolling:has(body.is-desk),
body.is-desk .is-scrolling {
  scrollbar-color: rgba(79, 53, 214, 0.28) transparent;
}

body.is-desk ::-webkit-scrollbar-thumb,
body.is-desk ::-webkit-scrollbar-thumb:hover {
  background: transparent;
  background-clip: content-box;
}

body.is-desk .is-scrolling::-webkit-scrollbar-thumb,
html.is-scrolling:has(body.is-desk)::-webkit-scrollbar-thumb {
  background: rgba(79, 53, 214, 0.28);
  background-clip: content-box;
}

/* 入口设置：链接点一下就复制，长得还是一行字 */
.link-copy {
  max-width: 100%;
  min-height: 28px;
  padding: 2px 8px;
  margin-left: -8px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ink-soft);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  word-break: break-all;
  cursor: copy;
  transition: background 140ms var(--ease-ui), color 140ms var(--ease-ui);
}

.link-copy:hover {
  background: var(--brand-soft);
  color: var(--brand-ink);
}

.link-copy.is-copied {
  color: #0b7a55;
}

.link-copy.is-copied::after {
  content: "  已复制";
  font-weight: 600;
}

.link-copy.is-copy-failed::after {
  content: "  没复制上";
  color: var(--danger);
}

body.is-desk .desk-main .cdk-table td.portal-ops {
  text-align: right;
  white-space: nowrap;
}

/* ------------------------------------------------------------------
   2026-11-21 提交充值页
   不用选卡了，「选择套餐」和「任务队列」一样占满整行；上面一行是检验账号和确认提交。
   ------------------------------------------------------------------ */
@media (min-width: 1101px) {
  body.is-desk .desk-main .recharge-layout > .card.recharge-plans {
    grid-column: 1 / -1;
    grid-row: auto;
  }
}

/* 两级选择器在视觉系统这一层覆盖旧的平铺网格。侧栏分段类依赖 .side，不能直接复用。 */
.recharge-layout #recharge-plans {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  container: recharge-picker / inline-size;
}

#recharge-plans .recharge-kinds {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 3px;
  border-radius: 11px;
  background: #efeafa;
}

#recharge-plans .recharge-kind {
  min-width: 0;
  min-height: 36px;
  padding: 7px 2px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  box-shadow: none;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 160ms ease-out, box-shadow 160ms ease-out;
}

#recharge-plans .recharge-kind[aria-checked="true"] {
  background: #fff;
  box-shadow: 0 1px 3px rgba(79, 53, 214, .16);
}

#recharge-plans .recharge-kind:hover:not([aria-checked="true"]) {
  background: #f7f4fe;
}

#recharge-plans .recharge-regions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.recharge-layout #recharge-plans .plan-pick {
  grid-column: auto;
  min-width: 0;
  padding-right: 26px;
  border: 0;
  transition: background-color 160ms ease-out;
}

.recharge-layout #recharge-plans .plan-pick:disabled {
  opacity: 1;
  background: #f7f4fe;
  box-shadow: none;
  color: #615b7c;
  cursor: not-allowed;
}

.recharge-layout #recharge-plans .plan-pick:disabled strong,
.recharge-layout #recharge-plans .plan-pick:disabled small {
  color: #615b7c;
}

.recharge-plan--go,
#recharge-plans .recharge-plan--go,
body.is-desk .desk-main .cdk-table .recharge-plan--go { color: #5f6274; }
#recharge-plans .recharge-plan--plus { color: #30313d; }
#recharge-plans .recharge-plan--pro5 { color: #1d4fa8; }
#recharge-plans .recharge-plan--pro20 { color: #4b33cc; }
#recharge-plans .recharge-plan--max { color: #0b6b4b; }

@container recharge-picker (max-width: 620px) {
  #recharge-plans .recharge-regions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  #recharge-plans .recharge-regions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  #recharge-plans .recharge-kind,
  .recharge-layout #recharge-plans .plan-pick { transition: none; transform: none; }
}

/* 任务队列里：下面那块老任务空着的时候不再多写一句「还没有任务」 */
#recharge-queue:has(> .empty:only-child) {
  display: none;
}

#recharge-queue:not(:has(> .empty:only-child)) {
  margin-top: 14px;
}

.auto-done.is-live {
  box-shadow: inset 0 0 0 1px rgba(106, 75, 255, 0.25);
}

.manual-pager {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.manual-pager span {
  margin-right: auto;
}

/* ------------------------------------------------------------------
   2026-11-21 充值历史（原「用户续费」）和自动充值的已结束记录
   都用卡密管理那一套表格：白面板、淡行线、套餐和状态带颜色。
   ------------------------------------------------------------------ */
.hs-table {
}
.hs-c-last { width: 22%; }

.hs-hint {
  color: var(--faint);
  font-size: 12.5px;
}

.hs-row {
  cursor: pointer;
}

.hs-row.is-open {
  background: #f8f5ff;
}

.hs-counts span {
  margin-right: 10px;
  font-size: 13px;
  font-weight: 600;
}

.hs-ok { color: #0b7a55; }
.hs-run { color: #a86200; }

/* 行尾的小箭头：展开时转过来 */
.hs-caret {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 4px;
  border-right: 1.6px solid var(--faint);
  border-bottom: 1.6px solid var(--faint);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 160ms var(--ease-ui);
}

.hs-row.is-open .hs-caret {
  transform: rotate(225deg) translate(-2px, -2px);
}

/* 展开后的那一块：这个账号每一次充值 */
.cm-table tr.hs-sub,
.cm-table tr.hs-sub:hover {
  background: #fbfaff;
  cursor: default;
}

.cm-table tr.hs-sub > td {
  height: auto;
  padding: 4px 16px 14px 10px;
}

.hs-records {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.hs-records th {
  padding: 6px 10px;
  color: var(--faint);
  font-size: 11.5px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

.hs-records td {
  height: auto;
  padding: 7px 10px;
  border-bottom: 1px solid var(--hair);
  white-space: nowrap;
  vertical-align: middle;
}

.hs-records tr:last-child td {
  border-bottom: 0;
}

.hs-src {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: #f0edf8;
  color: #615b7c;
  font-size: 12px;
  font-weight: 600;
}

.hs-src--manual { background: #e0edff; color: #1d4fa8; }
.hs-src--vip { background: #fff1d6; color: #8a5200; }

.hs-seq {
  margin-left: 8px;
  color: var(--faint);
  font-size: 12px;
}

.hs-why {
  display: inline-block;
  max-width: 220px;
  margin-left: 8px;
  overflow: hidden;
  color: #b4232f;
  font-size: 12px;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.hs-code {
  min-height: 24px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand-ink);
  font-family: var(--mono);
  font-size: 12.5px;
  cursor: pointer;
}

.hs-code:hover {
  text-decoration: underline;
}

/* 自动充值已结束的记录、提交充值页的任务队列：一张表 */
.auto-table {
}

.auto-table td {
  height: 44px;
}

.auto-table tbody tr {
  cursor: default;
}

.auto-table tr.is-live {
  background: #faf8ff;
}

.auto-table .cm-ops button + button {
  margin-left: 8px;
}

body.is-desk .desk-main .auto-group {
  margin: 14px 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

/* 这两张表在面板里：不要再套一层阴影 */
body.is-desk .desk-main .card:not(.cm) .cm-wrap {
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px var(--hair);
}

/* ------------------------------------------------------------------
   2026-11-21 收尾：充值历史减色单行、生成卡密的快捷项、自动充值表格列宽
   ------------------------------------------------------------------ */
/* 充值历史：一格一行字，颜色只留给状态和失败次数 */
.hs-table {
  min-width: 1180px;
}

.hs-c-mail { width: 232px; }
.hs-c-name { width: 132px; }
.hs-c-plan { width: 176px; }
.hs-c-state { width: 112px; }
.hs-c-count { width: 112px; }
.hs-c-card { width: 84px; }
.hs-c-caret { width: 40px; }

.hs-table td {
  height: 42px;
}

.hs-bad {
  color: #c2212f;
  font-weight: 600;
}

.hs-quiet {
  color: var(--muted);
}

.hs-records td {
  color: var(--ink-soft);
}

/* 展开的那一块淡入，不跳 */
.cm-table tr.hs-sub > td {
  animation: hs-reveal 180ms var(--ease-out);
}

@keyframes hs-reveal {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

/* 自动充值的表：套餐一列够用就行，账号那一列要放得下邮箱 */
.at-c-plan { width: 178px; }
.at-c-mail { width: auto; }
.at-c-card { width: 84px; }
.at-c-money { width: 104px; }
.at-c-state { width: 104px; }
.at-c-ops { width: 96px; }

/* 栅格的那一列不许被里面的表格撑宽：表格自己在 .cm-wrap 里横向滚 */
.auto-layout {
  grid-template-columns: minmax(0, 1fr);
}

.auto-layout > * {
  min-width: 0;
}

/* 生成卡密：先选套餐，下面一行是类型、数量、备注和生成按钮 */
body.is-desk .desk-main #generate-card #plan-prices {
  margin-bottom: 4px;
}

body.is-desk .desk-main #generate-card .price-note {
  margin: 8px 0 0;
  color: var(--faint);
  font-size: 12.5px;
}

body.is-desk .desk-main #generate-card form {
  margin-top: 14px;
  padding-top: 14px;
  box-shadow: inset 0 1px 0 var(--hair);
}

body.is-desk .desk-main #generate-card .generate-line {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
}

body.is-desk .desk-main #generate-card .generate-remark {
  flex: 1 1 360px;
  min-width: 0;
}

/* 数量那一格按内容撑开：点了「自选」多出一个数字框，不能溢进备注那一格 */
body.is-desk .desk-main #generate-card .generate-count,
body.is-desk .desk-main .card form .generate-line > .generate-count {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  max-width: 100%;
}

.quick-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

body.is-desk .desk-main .quick-count {
  display: inline-flex;
  flex: none;
}

body.is-desk .desk-main .quick-count .kind-switch__btn {
  min-width: 34px;
  padding: 0 10px;
}

/* 生成卡密那一行：类型、数量两个开关和旁边的备注框、生成按钮一样高（34px），
   原来是 46px，比同一行的输入框高出一截（2026-11-28 用户：「类型和数量的框小一点 这样比例正常一些」）。 */
body.is-desk .desk-main .generate-line .kind-switch {
  height: 34px;
}

body.is-desk .desk-main .generate-line .kind-switch__btn {
  min-height: 0;
  padding: 0 12px;
  font-size: 12.5px;
}

body.is-desk .desk-main .generate-line .quick-count .kind-switch__btn {
  min-width: 30px;
  padding: 0 8px;
}

body.is-desk .desk-main .card input.quick-count__box {
  width: 76px;
}

body.is-desk .desk-main .card input.quick-count__box[hidden] {
  display: none;
}

.quick-prefix {
  display: inline-flex;
  flex: none;
  gap: 4px;
}

.quick-chip {
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: var(--sunk);
  color: var(--ink-soft);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 150ms var(--ease-ui), color 150ms var(--ease-ui), transform 150ms var(--ease-out);
}

.quick-chip:hover {
  transform: translateY(-1px);
}

.quick-chip:active {
  transform: scale(0.96);
}

.quick-chip.is-selected {
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-weight: 600;
  box-shadow: 0 0 0 1.5px currentColor;
}

body.is-desk .desk-main #generate-card .generate-remark input {
  flex: 1 1 auto;
  min-width: 0;
}

@media (max-width: 640px) {
  .quick-row {
    flex-wrap: wrap;
  }

  .quick-prefix {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cm-table tr.hs-sub > td {
    animation: none;
  }

  .quick-chip,
  .quick-chip:hover,
  .quick-chip:active {
    transform: none;
    transition: none;
  }
}

/* 窄屏面板内边距收到 14 / 16，出血的表格跟着收，不然会戳出面板 4px */
@media (min-width: 721px) and (max-width: 1080px) {
  body.is-desk .desk-main .card > .table-wrap,
  body.is-desk .desk-main .card > [data-list-body],
  body.is-desk .desk-main .card > [data-live-list] {
    margin: 0 -14px -16px;
  }
}

/* ------------------------------------------------------------------
   2026-11-21 版面复检：只修缺陷（重叠、溢出、被挤扁、对不齐、对比度不够），
   配色方向、圆角、间距体系、文案都不动。
   ------------------------------------------------------------------ */

/* 根上的 --chip-*-text 是在 :root 按旧的状态色算好的（#0ea67a 这类），
   body.is-desk 改了 --ok / --danger / --warn 也传不到它们身上。
   「剩余 N 天」的绿条字只有 2.8:1，这里在后台里按现行的状态色重算一遍。 */
body.is-desk {
  --chip-green-text: var(--ok);
  --chip-red-text: var(--danger);
  --chip-amber-text: var(--warn);
}

/* 卡密管理档位筛选格里的数字：原来 0.75 透明，淡紫、淡蓝、淡绿底上只有 3.3–3.9:1 */
.cm-facet b {
  opacity: 1;
}

/* 批次号和第二行时间：悬停行、抽屉打开的那一行底色变深后只有 4.1–4.3:1，换成「弱说明」那支色 */
.cm-batch,
.cm-l2.cm-when,
.cm-l2.cm-when .cm-num {
  color: #6e6889;
}

/* 抽屉里同一批的「待处理」数字：琥珀字在淡琥珀底上 4.4:1，换成状态色里的琥珀 */
.cm-mates .is-wait b {
  color: #8a5200;
}

/* 去换绑：青字在淡青底上只有 3.2:1；底色不动，字压深一档 */
body.is-desk .tone--rebind {
  color: #0f766e;
}

/* 套餐标签是 inline-block，格子的省略号管不到它，「Pro 200 美区（卡付）」在窄列里直接被切掉半个字。
   标签自己截断加省略号，悬停那一格有 title 看全。 */
.cm-l1 > .cm-tag,
.cm-l1 > .cm-chip {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: top;
}

/* 记下结果：两栏一样高，矮的那一栏被网格拉开，按钮被拉成 50px 高、单选之间多出空档。
   改成竖排，按钮压到这一栏底部，两栏的按钮落在同一条线上。 */
body.is-desk .desk-main .card form.result-pane {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

body.is-desk .desk-main .card form.result-pane > .tone {
  align-self: flex-start;
  margin-top: auto;
}

/* 续费队列：长邮箱把「套餐」挤成一字一行、「提交」被推出面板。
   套餐不折行；邮箱、备注、报销名太长时自己折，账号那一列留够 200px，短邮箱不被折断。 */
@media (min-width: 721px) {
  body.is-desk .desk-main .cdk-table--banded td[data-label="套餐"] {
    white-space: nowrap;
  }

  body.is-desk .desk-main .cdk-table--banded td[data-label="账号"] {
    min-width: 200px;
  }

  body.is-desk .desk-main .cdk-table--banded .record-email,
  body.is-desk .desk-main .cdk-table--banded .account-note,
  body.is-desk .desk-main .cdk-table--banded td[data-label="报销名字"] {
    overflow-wrap: anywhere;
  }
}

/* 详情页页头：标题是长邮箱时戳出页头，右边的按钮被挤成两行（「去换\n绑」） */
body.is-desk .desk-main .workspace-head h1.page-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

body.is-desk .desk-main .workspace-head > .admin-secondary-button,
body.is-desk .desk-main .workspace-head > .admin-primary-button {
  flex: none;
  white-space: nowrap;
}

/* 提交充值的确认区：「没有 sessionToken，不能取消续费」跟在勾选后面不换行，戳出面板 70px。改成换到下一行。 */
body.is-desk .desk-main label.recharge-cancel {
  display: flex;
  flex-wrap: wrap;
  white-space: normal;
  row-gap: 2px;
}

body.is-desk .desk-main label.recharge-cancel .hint {
  flex: 1 1 100%;
  margin: 0 0 0 24px;
}

/* 上传 txt：文件名很长时「删除」被挤成上下两个字 */
.admin-txt-file__remove {
  flex: none;
  white-space: nowrap;
}

/* 批量查询的结果：每行各排各的，状态标签长短不一时后面几列左右错开。
   宽屏下查成的行用固定列宽，套餐、货币、状态、到期在每一行都对在同一条竖线上。 */
@media (min-width: 721px) {
  .admin-batch-line:has(.admin-batch-line__plan) {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr) 76px 76px 104px 150px;
    justify-items: start;
    column-gap: 12px;
  }

  /* 文件名和邮箱要撑满自己那一列，省略号才起作用 */
  .admin-batch-line:has(.admin-batch-line__plan) .admin-batch-line__file,
  .admin-batch-line:has(.admin-batch-line__plan) .admin-batch-line__email {
    justify-self: stretch;
  }

  .admin-batch-line:has(.admin-batch-line__plan) .admin-batch-line__bound {
    grid-column: 3 / -1;
  }
}

/* 自动换绑页头：「开个窗口」夹在标题和「重连本机」中间悬着，和右边的按钮靠在一起 */
#rebind-window {
  margin-left: auto;
}

/* 生成卡密（GPT、Gemini）那一行：类型、数量、备注的小标题高低差了 6–18px。
   数量那格多出的 6px 上边距去掉；备注那一排和分段开关一样高（34px，2026-11-28 从 46px 调小），内容居中。 */
body.is-desk .desk-main .card form .generate-line > .generate-count > .quick-row,
body.is-desk .desk-main .card form .generate-line > .generate-remark > .quick-row {
  margin-top: 0;
  min-height: 34px;
}

/* 入口设置的新建表单也借用了这一行：右边一格下面多一行说明，左边那格被底对齐压低了 18px */
body.is-desk .desk-main .card form .generate-line:has(> .generate-remark > .hint) {
  align-items: flex-start;
}

/* 入口详情：链接和「复制链接」贴在一起；「送去自动充值时」两个勾选项首尾相接 */
.hint > .copy-btn {
  margin-left: 8px;
}

/* 第二轮复检改：原来给第二个勾选项加左边距，窄屏折到第二行时它缩进 20px、还戳出面板。
   改成给第一个加右边距，折行时多出来的空白落在第一行末尾，看不出来。 */
label.pick:has(> [data-portal-auto]):has(+ label.pick) {
  margin-right: 20px;
}

/* 充值历史展开的记录：账单名称、VIP 备注很长时整张小表被撑宽，戳出外面那一行 500px。
   这两格限宽、截断加省略号，悬停看全（title）。 */
.hs-records td.hs-clip {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 展开记录里的每一行点了没有动作（要开卡密点卡号按钮），别继承外层表格行的小手光标 */
.cm-table .hs-records tr {
  cursor: default;
}

/* 窄屏（720 以下）页头放不下「返回 + 标题 + 两个按钮」：标题被挤到 20px 宽、整段戳出页头。
   这时让按钮换到第二行，返回和标题占第一行。 */
@media (max-width: 720px) {
  body.is-desk .desk-main .workspace-head.workspace-head--bar {
    flex-wrap: wrap;
  }

  body.is-desk .desk-main .workspace-head--bar > .workspace-head__main {
    flex: 1 1 calc(100% - 92px);
  }

  /* 标题和下面一排标签（「充值 · Pro 200 美区（卡付）」+ 状态）也不许比这一栏宽 */
  body.is-desk .desk-main .workspace-head--bar .workspace-head__main > * {
    max-width: 100%;
  }

  body.is-desk .desk-main .workspace-head--bar .workspace-head__tags {
    flex-wrap: wrap;
  }
}

/* 提交充值页右上的充值密钥：窄屏下「保存」被挤成上下两个字（按钮 42px 高、旁边输入框 34px） */
body.is-desk .desk-main .recharge-key > .admin-secondary-button {
  flex: none;
  white-space: nowrap;
}

body.is-desk .desk-main .card form.recharge-key {
  min-width: 0;
}

body.is-desk .desk-main .recharge-key > input.field {
  flex: 0 1 168px;
  width: auto;
  min-width: 0;
}

/* ------------------------------------------------------------------
   2026-11-21 版面复检第二轮：只修缺陷。
   ------------------------------------------------------------------ */

/* 1080 以下：上面那段把外边距清成 0、两边各留 12px，可是更早那条 calc(100% - 32px) 的宽度还在，
   面板左边留 12px、右边留 44px，375 和 900 下每一页都往左偏。宽度跟着撑满，两边都是 12px。 */
@media (max-width: 1080px) {
  body.is-desk .admin-page {
    width: 100%;
  }
}

/* 续费队列点行弹出的订阅窗：标题换成长邮箱后没有地方断行，戳出弹窗右边被裁掉 */
#desk-dialog .dialog h2 {
  overflow-wrap: anywhere;
}

/* 订阅窗带 is-wide，本该 760 宽；后加的 body.is-desk #desk-dialog .dialog（480）把它盖住了，
   九宫格挤在 480 里，账户邮箱一格折成七行。把宽窗的宽度放回来。 */
body.is-desk #desk-dialog.is-wide .dialog {
  width: min(760px, 100%);
}

/* 空状态里会原样回显搜的词（查卡「卡台上没有备注 长邮箱 的卡」）：长邮箱不断行，375 下把整页撑出 120px 横向滚动 */
body.is-desk .desk-main .empty {
  overflow-wrap: anywhere;
}

/* 「这些卡头不会用来充值」那几行整行压到 0.65 透明，说明「HK 发卡，充值只用 US」只剩 2.8:1。
   行照样淡，说明字换成正文色，淡完还有 5:1。 */
body.is-desk .desk-main .bin-row.is-off .bin-row__sub {
  color: var(--ink);
}

/* 自动充值「进行中」的任务行：进度条下面那句「开始于 …」借的是过程弹窗的 .dialog-note，行里没有它的样式，
   落成浏览器默认的 15px 正文色段落、上下各 15px 外边距，只占第一格，比行标题还大一号、行距忽然拉开。
   和下面那条最后一步一样，占满一行、小字淡色。 */
body.is-desk .desk-main .auto-rows--jobs .dialog-note {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

/* 删除时「有 N 条还挂着自动充值」：列表里的长邮箱不断行，戳出灰底框、被弹窗右边裁掉。
   弹窗正文里回显的邮箱、入口代码都按需断行。 */
#desk-dialog .blocked-list li,
#desk-dialog #dialog-body > p {
  overflow-wrap: anywhere;
}

/* 入口详情「送去自动充值时」：「充完删掉这次扣款的卡（只有备用协议 Pro20x 支持）」不许折行，375 下比面板宽 12px。
   窄屏下让这两个勾选项的字自己折。 */
@media (max-width: 720px) {
  label.pick:has(> [data-portal-auto]) {
    white-space: normal;
  }
}

/* 到账提示、客户取消提示：一行写「客户 · 套餐 · 邮箱」，长邮箱没有断点，戳出提示框右边 140px */
.arrival__text,
.cancel-toast__text {
  overflow-wrap: anywhere;
}

/* 顶部提示条：报错原话里带长邮箱时没有断点，375 下提示条比屏幕还宽、两头都出了屏幕。
   宽度按一行字算、最多到屏幕宽减两边 16px，放不下就折行。 */
#desk-toast {
  width: max-content;
  max-width: calc(100vw - 32px);
  overflow-wrap: anywhere;
}

/* 卡密抽屉「同一批生成的卡密」：是 0 的那一格数字淡到 #a8a2c2，只有 2.2:1。
   还是比有数的那几格淡（不上色），换成「弱说明」那支色，够 4.5:1。 */
.cm-mates .is-zero b {
  color: #6e6889;
}

/* 续费队列：上一轮只在 721 以上让长邮箱、备注、报销名自己折行；720 以下表格改成一条一张卡片，
   长邮箱和备注照样不折，戳出卡片 155px（被表格外层的横向滚动裁掉）。窄屏也让它们折。 */
@media (max-width: 720px) {
  body.is-desk .desk-main .cdk-table--banded .record-email,
  body.is-desk .desk-main .cdk-table--banded .account-note,
  body.is-desk .desk-main .cdk-table--banded td[data-label="报销名字"] {
    overflow-wrap: anywhere;
  }
}

/* 1080 以下外壳是一列：上面菜单面板、下面内容。外壳有最小高度（一屏），内容短的页（生成 Gemini 卡密、入口列表、
   空列表）多出来的高度被网格平分给两行，菜单面板下面空出 160px 才是内容。行从顶上排，空白留在最下面。 */
@media (max-width: 1080px) {
  body.is-desk .desk {
    align-content: start;
  }
}

/* 提交充值「检验账号」：上一轮让右边的充值密钥框不再挤扁「保存」，375 下改成标题被挤到 73px，折成「检验账 / 号」。
   标题不许缩，密钥输入框自己让（它本来就能缩到 0）。 */
body.is-desk .desk-main .recharge-check__title > h1 {
  flex: none;
  white-space: nowrap;
}

/* 生成卡密价目表，640 以下：「档位」一列只差 1px，「Pro 200」「Pro 500」折成上下两行，「未使用」表头折成「未使 / 用」，
   同一张表里一半的行忽然高出一截。这两列不折行，宽度从「地区」那一列让出来（地区本来就会按中文折）。 */
@media (max-width: 640px) {
  .price-table--pick td:nth-child(2),
  .price-table--pick th:nth-child(2),
  .price-table--pick th.price-stock,
  .price-table--pick th:last-child {
    white-space: nowrap;
  }
}

/* 登录页（退出后）：「输入管理密钥。」用的是根上的 --muted（0.58 透明），在登录卡的浅底上只有 4.3:1。压深一点到 4.5 以上。 */
.admin-login > p {
  color: rgba(20, 22, 43, 0.66);
}

/* 自动充值已结束的表：1264 宽的窗口里面板只有 905，原来最小 980，邮箱被截、「过程」要横向滚才看得到。
   各列收到内容实际要的宽度，省下来的全给账号那一列；表最小 900，1264 下不用横向滚。 */
.auto-table {
  min-width: 900px;
}

.auto-table .at-c-plan { width: 156px; }
.auto-table .at-c-card { width: 72px; }
.auto-table .at-c-money { width: 100px; }
.auto-table .cm-c-time { width: 128px; }
.auto-table .at-c-state { width: 92px; }
.auto-table .at-c-ops { width: 64px; }

/* ------------------------------------------------------------------
   2026-11-21 版面复检第三轮：只修缺陷。
   ------------------------------------------------------------------ */

/* 1081 以上同一个毛病：更早那条 min(calc(100% - 48px), 1720px) 的宽度还在，外边距却被清成 0，
   主体右边比设计多空出 48px（面板离侧栏 32px、离右边 72px），每一页都往左偏。宽度跟着撑满。 */
@media (min-width: 1081px) {
  body.is-desk .admin-page {
    width: 100%;
  }
}

/* 记下结果的报错挪进各自那一栏以后只有 300 来宽：提交被拒的原话里带长邮箱时没有断点，
   戳出这一栏、压在旁边那栏的选项上。报错行按需断行。 */
body.is-desk .admin-feedback {
  overflow-wrap: anywhere;
}

/* 520 以下弹窗按钮排成两格；只有一个「关闭」的窗（订阅、过程、账单、验证链接）它只占左边半格，右边空着。
   确认按钮藏起来时这一个占满。 */
@media (max-width: 520px) {
  #desk-dialog .dialog-actions:has(> #dialog-confirm[hidden]) {
    grid-template-columns: 1fr;
  }
}

/* 安全验证链接窗：链接能按需断行，旁边的「复制」就被挤成 37px、折成「复 / 制」两行（宽窄屏都一样）。按钮不缩不折。 */
.dialog-copy > button {
  flex: none;
  white-space: nowrap;
}

/* ------------------------------------------------------------------
   2026-11-21 版面复检第四轮：只修缺陷。
   ------------------------------------------------------------------ */

/* 弹窗打开时脚本把焦点放到窗框上（tabindex=-1），好让 Tab 从窗里第一个控件开始。窗框本身不是能点的东西，不画聚焦环。 */
body.is-desk #desk-dialog .dialog:focus,
body.is-desk #desk-dialog .dialog:focus-visible {
  outline: none;
}

/* 提交充值「已结束」的翻页：笔数和页数一长（已结束 99999 笔，第 1 / 10000 页），375 宽下两个按钮被压成 61px、
   「上一页」「下一页」折成两行。按钮不缩不折，让左边那句自己换行。 */
.manual-pager > button {
  flex: none;
  white-space: nowrap;
}

.manual-pager > span {
  min-width: 0;
}

/* 提交充值的进度抽屉：头部那行是「套餐 / 任务号 · 邮箱」、计时、关闭三样并排。邮箱一长没有断点，
   把计时和「关闭」挤出抽屉右边（1264 宽下「关闭」到了 1449，屏幕外）。左边那块可以缩、邮箱按需断行，计时和按钮不缩。 */
#recharge-drawer .drawer__header > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
}

#recharge-drawer .drawer__header p {
  overflow-wrap: anywhere;
}

#recharge-drawer .drawer__header > .recharge-drawer__clock,
#recharge-drawer .drawer__header > button {
  flex: none;
}

/* ------------------------------------------------------------------
   2026-11-21 复检第六轮
   ------------------------------------------------------------------ */

/* 不盖蒙版的结果窗（过程、查看账单、历史账单、支付链接、最新 Token 等，is-plain 且不带 is-blur）：规范是「点开就能操作、
   不盖蒙版」，页面还能点。原来只让透明蒙版不吃点击，可 #desk-dialog 自己 fixed 铺满视口，窗外的侧栏、按钮、表格行
   一样点不到、滚轮也滚不动页面。外层不吃点击，窗本体照常能点。带蒙版的确认窗、虚化的订阅窗不变（点蒙版仍然等于取消）。 */
#desk-dialog.is-plain:not(.is-blur) {
  pointer-events: none;
}

#desk-dialog.is-plain:not(.is-blur) .dialog {
  pointer-events: auto;
}


/* ------------------------------------------------------------------
   2026-11-22 生成卡密：档位字跟档位色、预计扣款单独一个颜色；确认窗每一格的值各带一点颜色
   ------------------------------------------------------------------ */
/* 价目表里只有档位那一格的字上色（和卡密管理的套餐标签一个色），别的格子不跟着变 */
body.is-desk .desk-main .price-table--pick td.price-plan {
  font-weight: 600;
}

body.is-desk .desk-main .price-table--pick td.price-plan--pro100 { color: #1d4fa8; }
body.is-desk .desk-main .price-table--pick td.price-plan--pro20x { color: #4b33cc; }
body.is-desk .desk-main .price-table--pick td.price-plan--pro500 { color: #0b6b4b; }
body.is-desk .desk-main .price-table--pick td.price-plan--gemini { color: #1a56d6; }
body.is-desk .desk-main .price-table--pick td.price-plan--plus,
body.is-desk .desk-main .price-table--pick td.price-plan--plushalf { color: #35304d; }
body.is-desk .desk-main .price-table--pick td.price-plan--go { color: #615b7c; }

/* 预计扣款是这张表里最要看的数：暖色、加粗，和档位的冷色、未使用的红绿都分得开 */
body.is-desk .desk-main .price-table--pick td.price-card,
body.is-desk .desk-main .price-table--pick tr.is-here td.price-card {
  color: #a2470a;
  font-weight: 600;
}

body.is-desk .desk-main .price-table--pick td.price-local {
  color: var(--muted);
}

/* 手机上放不下两列价钱：留预计扣款，收起本币标价（原来收的是折美元那一列） */
@media (max-width: 640px) {
  body.is-desk .desk-main .price-table--pick th:nth-child(5),
  body.is-desk .desk-main .price-table--pick td:nth-child(5) {
    display: table-cell;
  }

  body.is-desk .desk-main .price-table--pick th:nth-child(4),
  body.is-desk .desk-main .price-table--pick td:nth-child(4) {
    display: none;
  }
}

/* Gemini 生成页选择表：面额是主信息（不灰），手机上留面额、收起备款，和 GPT 表反过来 */
body.is-desk .desk-main .price-table--gemini td.price-local {
  color: var(--ink, #14161f);
}

@media (max-width: 640px) {
  body.is-desk .desk-main .price-table--gemini th:nth-child(4),
  body.is-desk .desk-main .price-table--gemini td:nth-child(4) {
    display: table-cell;
  }

  body.is-desk .desk-main .price-table--gemini th:nth-child(5),
  body.is-desk .desk-main .price-table--gemini td:nth-child(5) {
    display: none;
  }
}

/* 确认窗 */
.gen-field > b.gen-tone--count { color: var(--brand-ink); }
.gen-field > b.gen-tone--region { color: #0b6672; }
.gen-field > b.gen-tone--recharge { color: #0b7a55; }
.gen-field > b.gen-tone--rebind { color: #8a4f06; }
.gen-field > b.gen-tone--plan-pro100 { color: #1d4fa8; }
.gen-field > b.gen-tone--plan-pro20x { color: #4b33cc; }
.gen-field > b.gen-tone--plan-pro500 { color: #0b6b4b; }
.gen-field > b.gen-tone--plan-plus,
.gen-field > b.gen-tone--plan-plushalf { color: #35304d; }
.gen-field > b.gen-tone--plan-go { color: #615b7c; }
.gen-field > b.gen-tone--plan-gemplus,
.gen-field > b.gen-tone--plan-gemplusy { color: #2346a8; }
.gen-field > b.gen-tone--plan-gempro,
.gen-field > b.gen-tone--plan-gemproy { color: #4b33cc; }
.gen-field > b.gen-tone--plan-gemultra20,
.gen-field > b.gen-tone--plan-gemultra30 { color: #3a2fa8; font-weight: 700; }

/* ------------------------------------------------------------------
   2026-11-22 配置参数：一项一行，左边是名字和说明，右边是输入框、单位和默认值
   ------------------------------------------------------------------ */
body.is-desk .desk-main .set {
  max-width: 980px;
}

.set-top h1 {
  margin: 0;
}

.set-top .hint {
  margin: 4px 0 0;
}

.set-group {
  margin-top: 18px;
}

.set-group__name {
  margin: 0 0 4px;
  color: var(--brand-ink);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.set-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 232px;
  gap: 8px 28px;
  align-items: start;
  padding: 12px 0;
  box-shadow: inset 0 1px 0 var(--hair);
}

.set-row__label {
  display: block;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.set-row__hint {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.set-input {
  display: flex;
  align-items: center;
  gap: 8px;
}

body.is-desk .desk-main .card .set-input input.field {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.set-input__unit {
  flex: none;
  min-width: 34px;
  color: var(--muted);
  font-size: 12.5px;
}

/* 开关类参数：设计系统里的分段开关（凹槽底，选中那一段是白色滑块加一点投影），高度和输入框一样是 34px。 */
.set-switch {
  display: inline-flex;
  box-sizing: border-box;
  height: 34px;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--sunk);
}

.set-switch__btn {
  min-width: 56px;
  min-height: 0;
  height: auto;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 180ms var(--ease-ui), color 180ms var(--ease-ui), box-shadow 180ms var(--ease-ui);
}

.set-switch__btn:hover {
  color: var(--ink);
}

.set-switch__btn.is-selected {
  background: var(--surface-high);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-pill);
}

.set-switch__btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

/* 改了还没保存：和输入框一样描一圈紫边 */
.set-row.is-edited .set-switch {
  box-shadow: 0 0 0 1.5px var(--brand);
}

@media (prefers-reduced-motion: reduce) {
  .set-switch__btn {
    transition: none;
  }
}

.set-row__meta {
  margin: 5px 0 0;
  color: var(--faint);
  font-size: 12px;
}

.set-reset {
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand-ink);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.set-reset[hidden] {
  display: none;
}

/* 已经不是默认值的：名字后面点一个小紫点；改了还没保存的：输入框描紫边 */
.set-row.is-changed .set-row__label::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 7px;
  border-radius: 50%;
  background: var(--brand);
  vertical-align: middle;
}

body.is-desk .desk-main .card .set-row.is-edited .set-input input.field {
  box-shadow: 0 0 0 1.5px var(--brand);
  background: var(--brand-soft);
}

.set-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 0;
  box-shadow: inset 0 -1px 0 var(--hair);
  /* 吸顶（2026-11-26 用户确认）：往下滚着改参数时，保存一直贴在顶上。底色要实心，不然下面的字透上来。 */
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--surface);
}

/* 窗口窄于 1081 时顶上有一条 64 高的站头，也是吸顶的：保存这一排贴在它下面，不然被它盖住。 */
@media (max-width: 1080px) {
  .set-actions {
    top: 64px;
  }
}

.set-actions__note {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
}

.set-actions [hidden] {
  display: none;
}

@media (max-width: 720px) {
  .set-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .set-actions {
    flex-wrap: wrap;
  }

  .set-actions__note {
    flex-basis: 100%;
  }
}

/* 卡密管理：表格上面也放一条翻页，和下面那条内容一样 */
.cm-pager--top {
  padding: 2px 2px 10px;
}

/* ------------------------------------------------------------------
   2026-11-22 代理密钥：上面一行名字 + 生成，刚生成的明文单独一块白面板，下面一张 cm-table
   ------------------------------------------------------------------ */
body.is-desk .desk-main .card.ak {
  max-width: 1040px;
}

.ak-lead {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

body.is-desk .desk-main .card.cm form.ak-new {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

body.is-desk .desk-main .card.cm .ak-new input[type="text"] {
  flex: 0 1 300px;
  width: auto;
}

body.is-desk .desk-main .card.cm .ak-new .admin-primary-button {
  flex: none;
  width: auto;
}

.ak-new #ak-feedback {
  flex-basis: 100%;
  margin: 0;
}

.ak-issued {
  margin: 0 0 14px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--paper);
  box-shadow: var(--lift);
}

.ak-issued[hidden] {
  display: none;
}

.ak-issued__lead {
  margin: 0 0 8px;
  color: var(--ink-soft);
  font-size: 13px;
}

.ak-issued__lead strong {
  color: #8a5200;
}

.ak-issued__key {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
}

.ak-issued__key code {
  flex: 1 1 320px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f7f4fe;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  word-break: break-all;
  user-select: all;
}

.cm-table.ak-table {
  min-width: 720px;
}

.ak-table[hidden] {
  display: none;
}

.ak-c-time { width: 150px; }
.ak-c-num { width: 104px; }
.ak-c-state { width: 96px; }
.ak-c-ops { width: 92px; }

.cm-table.ak-table tbody tr {
  cursor: default;
}

.ak-table td.ak-time {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.ak-table td.cm-num {
  text-align: left;
}

/* 已吊销的行淡下去 */
.ak-table tr.is-revoked td {
  opacity: 0.55;
}

.ak-table tr.is-revoked:hover {
  background: none;
}

.ak #ak-empty {
  margin: 0;
  padding: 28px 16px;
}

.ak #ak-empty[hidden] {
  display: none;
}

.ak #ak-empty.is-bad {
  color: var(--danger);
}

/* 生成记录（2026-11-22）：复制过的批次，和卡密管理一样的表格，一批一行 */
body.is-desk .desk-main .gen-history {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

body.is-desk .desk-main .gen-history__title {
  margin: 0 0 8px;
  color: var(--ink);
  font-weight: 600;
}

body.is-desk .desk-main .gen-history__title span {
  margin-left: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

body.is-desk .desk-main .gen-history__batch,
body.is-desk .desk-main .gen-history__codes {
  font-family: var(--mono);
  font-size: 13px;
}

body.is-desk .desk-main .gen-history__codes {
  color: var(--muted);
}

body.is-desk .desk-main .gen-history__actions,
body.is-desk .desk-main .gen-history__nowrap {
  white-space: nowrap;
}

body.is-desk .desk-main .gen-history__actions .linkish + .linkish {
  margin-left: 12px;
}

/* ------------------------------------------------------------ 记账（2026-11-22） */
.lg-top {
  flex-wrap: wrap;
  gap: 10px 14px;
}

body.is-desk .desk-main .lg-top h1 {
  margin-right: 4px;
}

.lg-periods {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: var(--paper);
  box-shadow: var(--ring);
}

.lg-periods button {
  min-width: 40px;
  height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.lg-periods button[aria-pressed="true"] {
  background: var(--brand-soft);
  color: var(--brand-ink);
}

.lg-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: auto;
}

.lg-step {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--ring);
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.lg-step:disabled {
  opacity: 0.4;
  cursor: default;
}

.lg-nav__label {
  min-width: 132px;
  font-size: 15px;
  font-weight: 650;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.lg-today:disabled {
  opacity: 0.5;
}

.lg-actions {
  display: inline-flex;
  gap: 8px;
}

.lg-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  transition: opacity 160ms var(--ease-ui);
}

.lg-body.is-loading {
  opacity: 0.55;
}

.lg-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.lg-kpi {
  padding: 14px 18px 16px;
  border-radius: 16px;
  background: var(--paper);
  box-shadow: var(--lift);
}

.lg-kpi__label {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

.lg-kpi__value {
  margin: 6px 0 0;
  color: var(--ink);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.lg-kpi__sub {
  margin: 6px 0 0;
  color: var(--faint);
  font-size: 12px;
}

.lg-kpi--total {
  background: linear-gradient(135deg, #f3efff 0%, #ffffff 70%);
}

.lg-kpi--total .lg-kpi__value {
  color: var(--brand-ink);
  font-size: 30px;
}

.lg-kpi--spend .lg-kpi__label::before,
.lg-kpi--open .lg-kpi__label::before,
.lg-kpi--loss .lg-kpi__label::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 2px;
  vertical-align: 0;
}

.lg-kpi--spend .lg-kpi__label::before,
.lg-seg--spend { background: #7c5cff; }
.lg-kpi--open .lg-kpi__label::before,
.lg-seg--open { background: #f0a43a; }
.lg-kpi--loss .lg-kpi__label::before,
.lg-seg--loss { background: #e2626b; }
.lg-seg--other { background: #9aa0b8; }

.lg-two {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

body.is-desk .desk-main .lg-panel {
  margin: 0;
}

body.is-desk .desk-main .desk-main .lg-panel + .lg-panel,
body.is-desk .desk-main .lg .card + .card {
  margin-top: 0;
}

.lg-panel__head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-bottom: 12px;
}

body.is-desk .desk-main .lg-panel__head h2 {
  margin: 0;
}

.lg-panel__meta {
  color: var(--faint);
  font-size: 12px;
}

.lg-panel__head .admin-secondary-button {
  margin-left: auto;
}

.lg-panel .empty {
  margin: 4px 0 0;
}

.lg-plans {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lg-plan__line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 14px;
}

.lg-plan__name {
  font-weight: 600;
}

.lg-plan__count {
  color: var(--brand-ink);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.lg-plan__sum {
  margin-left: auto;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.lg-plan__bar {
  height: 6px;
  margin-top: 6px;
  border-radius: 99px;
  background: var(--well);
  overflow: hidden;
}

.lg-plan__bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #a48bff, #7c5cff);
}

.lg-plan__avg {
  margin: 4px 0 0;
  color: var(--faint);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.lg-plats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.lg-plat {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--well);
}

.lg-plat__name {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 13.5px;
  font-weight: 650;
}

.lg-plat__name b {
  font-variant-numeric: tabular-nums;
}

.lg-plat__kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 10px;
  margin: 0;
  font-size: 13px;
}

.lg-plat__kv dt {
  color: var(--muted);
}

.lg-plat__kv dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.lg-dim {
  color: var(--faint);
  font-size: 12px;
}

.lg-legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.lg-legend i {
  width: 9px;
  height: 9px;
  margin-left: 8px;
  border-radius: 2px;
}

.lg-chart {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  height: 230px;
}

.lg-chart__axis {
  position: relative;
  margin-bottom: 22px;
}

.lg-chart__axis span {
  position: absolute;
  right: 8px;
  transform: translateY(50%);
  color: var(--faint);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.lg-chart__plot {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.lg-chart__plot::before {
  content: "";
  position: absolute;
  inset: 0 0 22px;
  background: repeating-linear-gradient(to bottom, var(--hair) 0 1px, transparent 1px 25%);
  box-shadow: inset 0 -1px 0 var(--edge);
  pointer-events: none;
}

.lg-chart.is-many .lg-chart__plot {
  gap: 3px;
}

.lg-col {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
}

.lg-col__sum {
  position: absolute;
  left: 50%;
  transform: translate(-50%, -3px);
  color: var(--muted);
  font-size: 10.5px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.lg-col__stack {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column-reverse;
  justify-content: flex-start;
  border-radius: 6px 6px 0 0;
}

.lg-col__stack .lg-seg:last-of-type {
  border-radius: 4px 4px 0 0;
}

.lg-col:hover .lg-col__stack {
  background: rgba(124, 92, 255, 0.06);
}

.lg-seg {
  display: block;
  flex: none;
  transition: filter 120ms var(--ease-ui);
}

.lg-col:hover .lg-seg {
  filter: brightness(1.08);
}

.lg-col__label {
  height: 22px;
  padding-top: 5px;
  color: var(--faint);
  font-size: 11px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}

.lg-chart.is-many .lg-col:nth-child(even) .lg-col__label {
  visibility: hidden;
}

.lg-col.is-current .lg-col__label {
  color: var(--brand-ink);
  font-weight: 700;
}

.lg-col.is-current .lg-col__stack {
  background: rgba(124, 92, 255, 0.07);
}

.lg-col:focus-visible {
  outline: none;
  box-shadow: var(--ring-focus);
  border-radius: 6px;
}

body.is-desk .desk-main .lg-panel--table .cm-wrap {
  margin: 0 -18px -18px;
  border-radius: 0 0 16px 16px;
  box-shadow: none;
}

.lg-table {
  min-width: 900px;
}

.lg-table--small {
  min-width: 520px;
}

.lg-table--small td:not(.lg-note) {
  overflow: visible;
  text-overflow: clip;
}

.lg-two > * {
  min-width: 0;
}

body.is-desk .desk-main .lg-panel--table .cm-wrap {
  overflow-x: auto;
}

.lg-table tr[data-lg-row] {
  cursor: pointer;
}

.lg-table tr.is-open td {
  background: var(--brand-soft);
}

.lg-c-time { width: 136px; }
.lg-c-mail { width: 230px; }
.lg-c-card { width: 150px; }
.lg-c-plan { width: 170px; }
.lg-c-amt { width: 110px; }
.lg-c-src { width: 210px; }

.lg-r {
  text-align: right !important;
}

.lg-table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lg-note {
  max-width: 260px;
  color: var(--muted);
}

.lg-amt {
  font-weight: 650;
}

.lg-amt.is-est {
  color: var(--muted);
  font-weight: 500;
}

.lg-src {
  color: var(--muted);
}

.lg-flag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 99px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 11.5px;
}

.lg-loss {
  color: var(--danger);
}

.lg-drawer__amt {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.lg-drawer header p {
  color: var(--muted);
  font-size: 13.5px;
}

.lg-note-edit {
  display: flex;
  gap: 8px;
}

.lg-note-edit input,
.lg-form input[type="text"],
.lg-form input[type="number"],
.lg-form input[type="datetime-local"] {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 11px;
  border: 0;
  border-radius: 9px;
  background: var(--paper);
  box-shadow: var(--ring);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}

.lg-note-edit input:focus,
.lg-form input:focus {
  outline: none;
  box-shadow: var(--ring-focus);
}

.lg-form {
  display: grid;
  gap: 12px;
  min-width: min(420px, 80vw);
}

.lg-field {
  display: grid;
  gap: 5px;
}

.lg-field > span:first-child {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

.lg-field-row {
  display: grid;
  grid-template-columns: 1fr 96px;
  gap: 10px;
}

.lg-input-unit {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lg-input-unit i {
  color: var(--faint);
  font-size: 12.5px;
  font-style: normal;
}

.lg-seg-pick {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lg-seg-pick label {
  position: relative;
  cursor: pointer;
}

.lg-seg-pick input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.lg-seg-pick span {
  display: inline-block;
  padding: 7px 13px;
  border-radius: 9px;
  background: var(--paper);
  box-shadow: var(--ring);
  color: var(--ink-soft, var(--ink));
  font-size: 13.5px;
}

.lg-seg-pick input:checked + span {
  background: var(--brand-soft);
  box-shadow: 0 0 0 1px var(--brand);
  color: var(--brand-ink);
  font-weight: 600;
}

.lg-seg-pick input:focus-visible + span {
  box-shadow: var(--ring-focus);
}

.lg-preview {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.lg-preview b {
  color: var(--ink);
}

@media (max-width: 1080px) {
  .lg-two {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .lg-nav {
    order: 3;
    width: 100%;
    margin-right: 0;
  }

  .lg-nav__label {
    flex: 1;
  }

  .lg-actions {
    margin-left: auto;
  }

  .lg-kpis {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .lg-kpi--total {
    grid-column: 1 / -1;
  }

  .lg-kpi__value {
    font-size: 21px;
  }

  .lg-plats {
    grid-template-columns: 1fr;
  }

  .lg-chart {
    grid-template-columns: 40px minmax(0, 1fr);
    height: 190px;
  }

  .lg-chart__plot {
    gap: 2px;
  }

  .lg-col:nth-child(even) .lg-col__label {
    visibility: hidden;
  }

  .lg-col__label {
    overflow: visible;
    font-size: 10px;
  }

  .lg-col__sum {
    display: none;
  }

  .lg-legend {
    margin-left: 0;
  }
}



.lg-sync {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: -4px 0 -2px;
  color: var(--faint);
  font-size: 12.5px;
}

.lg-sync__lead {
  color: var(--muted);
  font-weight: 600;
}

.lg-sync i {
  font-style: normal;
}

.lg-sync__bad {
  color: var(--danger);
}

.lg-sync .linkish {
  margin-left: 4px;
  font-size: 12.5px;
}

.lg-flag--soft {
  background: var(--warn-soft);
  color: var(--warn);
}

.lg-auto {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 99px;
  background: var(--well);
  color: var(--muted);
  font-size: 11.5px;
}

/* 备注联想的下拉（2026-11-22）：页面里自己画的，跟着备注框，不用浏览器自带的 datalist */
.remark-box {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

.remark-box > .field {
  width: 100%;
}

.remark-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  max-height: 300px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 12px 32px rgba(20, 22, 43, 0.14);
}

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

.remark-menu__head {
  margin: 6px 8px 4px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}

.remark-menu__head:first-child {
  margin-top: 2px;
}

.remark-menu__item {
  display: block;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.remark-menu__item:hover,
.remark-menu__item.is-active {
  background: var(--brand-soft);
  color: var(--brand-ink);
}

body.is-desk .desk-main .gen-history__remark {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.is-desk .desk-main .gen-history__copied {
  color: var(--muted);
}

body.is-desk .desk-main .gen-history__fresh {
  color: #b45309;
}

.lg-amt--back {
  color: var(--ok);
}

.lg-flag--refund {
  background: var(--ok-soft);
  color: var(--ok);
}

.lg-flag--refunded,
.lg-flag--reversed {
  background: var(--well);
  color: var(--muted);
}

.lg-flag--refund_pending {
  background: var(--warn-soft);
  color: var(--warn);
}

/* 记账：子页签、服务商筛选、概览两栏（2026-11-22 改版） */
.lg-tabs {
  margin: 0 0 10px;
}

.lg-bar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin: 0 0 14px;
}

.lg-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lg-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 99px;
  background: var(--paper);
  box-shadow: var(--ring);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.lg-chip b {
  color: var(--faint);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.lg-chip[aria-pressed="true"] {
  background: var(--brand-soft);
  box-shadow: 0 0 0 1px var(--brand);
  color: var(--brand-ink);
  font-weight: 600;
}

.lg-chip[aria-pressed="true"] b {
  color: var(--brand-ink);
}

.lg-bar-row .lg-sync {
  margin: 0;
}

.lg-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 14px;
  align-items: start;
}

.lg-col-main,
.lg-col-side {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.lg-col-side .lg-plats {
  grid-template-columns: 1fr;
}

.lg-table--plans {
  min-width: 520px;
}

.lg-table--plans td:first-child {
  white-space: nowrap;
}

.lg-bar {
  display: inline-block;
  width: 64px;
  height: 5px;
  margin-left: 10px;
  border-radius: 99px;
  background: var(--well);
  vertical-align: middle;
  overflow: hidden;
}

.lg-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #a48bff, #7c5cff);
}

.lg-more {
  display: block;
  margin: 10px auto 0;
  font-size: 13px;
}

.lg-head-link {
  margin-left: auto;
  font-size: 13px;
}

.lg-provs {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lg-prov {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 10px;
  background: var(--well);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.lg-prov:hover {
  background: var(--brand-soft);
}

.lg-prov__name {
  font-size: 14px;
  font-weight: 650;
}

.lg-prov b {
  font-size: 14px;
}

.lg-prov__sub {
  grid-column: 1 / -1;
  color: var(--faint);
  font-size: 12px;
  line-height: 1.45;
}

.lg-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.lg-filters input[type="search"],
.lg-filters select {
  height: 34px;
  padding: 0 11px;
  border: 0;
  border-radius: 9px;
  background: var(--paper);
  box-shadow: var(--ring);
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
}

.lg-filters input[type="search"] {
  flex: 1 1 260px;
  max-width: 420px;
}

.lg-pager {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  color: var(--muted);
  font-size: 12.5px;
}

.lg-pager--foot {
  display: flex;
  justify-content: center;
  margin: 12px 0 0;
}

@media (max-width: 1180px) {
  .lg-grid {
    grid-template-columns: 1fr;
  }
}

.lg-c-pname { width: 40%; }
.lg-c-psrc { width: 20%; }
.lg-c-pnum { width: 10%; }
.lg-c-pamt { width: 15%; }

.lg-stack {
  display: grid;
  gap: 14px;
}

/* 记账页和它的抽屉里的文字按钮。通用的 button.linkish 只给了颜色，去框去底色是挂在各个
   表格容器下面的，记账页的这些不在那些容器里，会露出浏览器默认的灰底凸边按钮。 */
.lg button.linkish,
.lg-drawer button.linkish {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: none;
  box-shadow: none;
  color: var(--brand-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
}

.lg button.linkish:hover,
.lg-drawer button.linkish:hover {
  text-decoration: underline;
}

.lg button.linkish:focus-visible,
.lg-drawer button.linkish:focus-visible {
  outline: none;
  box-shadow: var(--ring-focus);
}

.lg button.linkish[data-lg-del-deposit] {
  color: var(--danger);
}

/* 明细页看一天时：这一天的套餐（2026-11-22） */
.lg-day {
  margin-bottom: 14px;
}

.lg-share {
  display: flex;
  height: 12px;
  margin: 0 0 14px;
  border-radius: 99px;
  background: var(--well);
  overflow: hidden;
}

.lg-share i {
  display: block;
  height: 100%;
  box-shadow: inset -2px 0 0 #fff;
}

.lg-dtiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}

.lg-dtile {
  padding: 12px 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--tier, #b7aee0) 9%, #fff);
  box-shadow: inset 3px 0 0 var(--tier, #b7aee0);
}

.lg-dtile--minus {
  --tier: #8a879a;
  background: var(--well);
}

.lg-dtile__name {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 650;
}

.lg-dtile__name i {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--tier, #b7aee0);
}

.lg-dtile__count {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin: 8px 0 0;
}

.lg-dtile__count b {
  color: var(--tier, var(--ink));
  font-size: 28px;
  font-weight: 750;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.lg-dtile--minus .lg-dtile__count b {
  color: var(--ink-soft, var(--ink));
}

.lg-dtile__count span {
  color: var(--muted);
  font-size: 12.5px;
}

.lg-dtile__count em {
  margin-left: auto;
  color: var(--ink);
  font-size: 16px;
  font-style: normal;
  font-weight: 700;
}

.lg-dtile__bar {
  display: block;
  height: 4px;
  margin-top: 9px;
  border-radius: 99px;
  background: rgba(20, 22, 43, 0.06);
  overflow: hidden;
}

.lg-dtile__bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--tier, #b7aee0);
}

.lg-dtile__sub {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.lg-hours-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 16px 0 6px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

.lg-hours {
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  gap: 3px;
  height: 110px;
}

.lg-hour {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.lg-hour__stack {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column-reverse;
  border-radius: 4px 4px 0 0;
  box-shadow: inset 0 -1px 0 var(--edge);
}

.lg-hour__stack i {
  display: block;
  flex: none;
}

.lg-hour__stack i:last-of-type {
  border-radius: 3px 3px 0 0;
}

.lg-hour__stack b {
  position: absolute;
  left: 0;
  right: 0;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 14px;
  text-align: center;
}

.lg-hour:hover .lg-hour__stack {
  background: rgba(124, 92, 255, 0.06);
}

.lg-hour.is-future .lg-hour__stack {
  opacity: 0.35;
}

.lg-hour__label {
  height: 16px;
  padding-top: 3px;
  color: var(--faint);
  font-size: 10.5px;
  text-align: left;
  font-variant-numeric: tabular-nums;
}

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

  .lg-dtile__count b {
    font-size: 24px;
  }

  .lg-hours {
    gap: 1px;
    height: 90px;
  }
}

/* 走势图：今天那根换成蓝紫色，选中的照旧是淡紫底加粗字；还没到的日子淡掉、点不了（2026-11-22） */
.lg-col.is-today .lg-seg--spend {
  background: #8c96ee;
}

.lg-col.is-today .lg-col__label {
  color: #5560d8;
  font-weight: 700;
}

.lg-col.is-today.is-current .lg-col__label {
  color: var(--brand-ink);
}

.lg-col.is-future {
  cursor: default;
}

.lg-col.is-future .lg-col__label {
  opacity: 0.45;
}

.lg-col.is-future:hover .lg-col__stack {
  background: none;
}

.lg-legend .lg-seg--today {
  background: #8c96ee;
}

/* 后台作废并换新的结果表（2026-11-22） */
body.is-desk #desk-dialog .replace-table s {
  color: var(--muted);
}

body.is-desk #desk-dialog .replace-table code {
  font-family: var(--mono);
}

body.is-desk #desk-dialog .replace-fail {
  color: #b45309;
}

/* 详情「换成了 / 已换发」那一行的新卡密：链接按钮原来露出浏览器默认的灰底凸框（2026-11-22），
   上面 button.linkish 补了复位；卡密用等宽字，和旁边的「复制」留点距离。 */
body.is-desk .desk-main .meta dd button.linkish[data-open-code] {
  font-family: var(--mono);
  font-size: 13px;
  margin-right: 6px;
}

/* 自动充值过程：每次提交的开头紫色、没成的那一行琥珀色（2026-11-23） */
body.is-desk .cm-line li.is-submit span,
body.is-desk .recharge-timeline li.is-submit strong {
  color: var(--brand-ink);
  font-weight: 600;
}

body.is-desk .cm-line li.is-miss span,
body.is-desk .recharge-timeline li.is-miss strong {
  color: #b45309;
  font-weight: 600;
}

/* 提交充值页的收据名称（2026-11-23） */
body.is-desk .desk-main .recharge-bill {
  display: grid;
  gap: 6px;
  margin: 12px 0 4px;
  max-width: 420px;
}

body.is-desk .desk-main .recharge-bill .hint {
  color: #b45309;
}

/* 卡头策略：LuminalPay 那一列底下的共享卡头（2026-11-23） */
body.is-desk .desk-main .bin-shared {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

body.is-desk .desk-main .bin-shared__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  font-size: 14px;
  color: var(--ink);
}


/* 卡头策略·共享卡头：列表长了在框里滚动；不用的折起来（2026-11-24） */
body.is-desk .desk-main .bin-shared .bin-scroll {
  max-height: 320px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

body.is-desk .desk-main .bin-off-fold {
  margin-top: 12px;
}

body.is-desk .desk-main .bin-off-fold > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  margin: 0;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

body.is-desk .desk-main .bin-off-fold > summary::-webkit-details-marker { display: none; }

body.is-desk .desk-main .bin-off-fold > summary::before {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s ease-out;
}

body.is-desk .desk-main .bin-off-fold[open] > summary::before { transform: rotate(45deg); }

body.is-desk .desk-main .bin-off-fold > summary:hover { color: var(--ink); }

body.is-desk .desk-main .bin-off-fold > summary:focus-visible {
  outline: 2px solid var(--brand, #6a4bff);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ------------------------------------------------------------------
   2026-11-25 失败留底：只读排查页。上面一行搜索，下面一张 cm-table，一次提交一行；
   完整 Session 折叠在这一行下面，点开才取、才显示。
   ------------------------------------------------------------------ */
body.is-desk .desk-main .card.sb {
  max-width: 1280px;
}

.sb .cm-top {
  align-items: baseline;
  gap: 10px;
}

.sb-count {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.sb-count[hidden] {
  display: none;
}

.sb-lead {
  max-width: 72ch;
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

body.is-desk .desk-main .card.cm form.sb-find {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

body.is-desk .desk-main .card.cm .sb-find input[type="search"] {
  flex: 0 1 360px;
  width: auto;
  font-family: var(--mono);
}

body.is-desk .desk-main .card.cm .sb-find .admin-primary-button {
  flex: none;
  width: auto;
}

.cm-table.sb-table {
  min-width: 980px;
}

.sb-table[hidden] {
  display: none;
}

.sb-c-time { width: 148px; }
.sb-c-who { width: 216px; }
.sb-c-token { width: 230px; }
.sb-c-login { width: 200px; }
.sb-c-ops { width: 104px; }

.cm-table.sb-table tbody tr {
  cursor: default;
}

.sb-table td {
  vertical-align: top;
}

.sb-mono {
  font-family: var(--mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.sb-none {
  color: var(--muted);
}

.sb-code {
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 6px;
  background: #f7f4fe;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
}

.sb-msg {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sb-table td.sb-ops {
  text-align: right;
}

.sb-table td.sb-ops .admin-secondary-button {
  white-space: nowrap;
}

.sb-table tr.is-open td {
  background: #faf8ff;
}

.cm-table.sb-table tr.sb-detail:hover {
  background: none;
}

.sb-table tr.sb-detail > td {
  padding-top: 0;
  background: #faf8ff;
}

.sb-session {
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 1px 2px rgba(79, 53, 214, 0.05), 0 6px 18px -12px rgba(79, 53, 214, 0.25);
  overflow: hidden;
}

.sb-session__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px 8px 14px;
  color: #8a5200;
  font-size: 12.5px;
}

.sb-session__wait {
  margin: 0;
  padding: 14px;
  color: var(--muted);
  font-size: 12.5px;
}

.sb-session__raw {
  max-height: 360px;
  margin: 0;
  padding: 10px 14px 14px;
  overflow: auto;
  background: #f7f4fe;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-all;
}

.sb-session__raw::selection,
.sb-code::selection {
  background: #e3dbff;
}

.sb #sb-empty {
  margin: 0;
  padding: 28px 16px;
}

.sb #sb-empty[hidden] {
  display: none;
}

.sb #sb-empty.is-bad {
  color: var(--danger);
}

/* 人工处理卡密的对账（2026-11-25） */
.cm-pend {
  color: var(--warn);
  font-weight: 600;
}

.charge-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.charge-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

body button.linkish.charge-clear {
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: var(--danger);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

body button.linkish.charge-clear:hover {
  text-decoration: underline;
}

.charge-form {
  display: grid;
  gap: 12px;
}

.charge-lead,
.charge-none {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.charge-list {
  display: grid;
  gap: 6px;
  max-height: min(46vh, 420px);
  overflow-y: auto;
  padding: 2px;
}

.charge-pick {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--paper);
  box-shadow: var(--ring);
  cursor: pointer;
}

.charge-pick:hover {
  background: var(--row-hover, #fbf9ff);
}

.charge-pick:has(input:checked) {
  background: var(--brand-soft);
  box-shadow: 0 0 0 1px var(--brand);
}

.charge-pick input[type="radio"] {
  margin: 3px 0 0;
  accent-color: var(--brand);
}

.charge-pick__main {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 2px 12px;
  flex: 1;
  min-width: 0;
}

.charge-pick__main > b {
  color: var(--ink);
  font-size: 15px;
}

.charge-pick__meta {
  color: var(--ink-soft, var(--ink));
  font-size: 12.5px;
  text-align: right;
}

.charge-pick__sub {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.charge-pick__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  grid-column: 1 / -1;
  margin-top: 4px;
}

.charge-tag {
  padding: 1px 7px;
  border-radius: 99px;
  background: var(--well);
  color: var(--muted);
  font-size: 11.5px;
  font-style: normal;
}

.charge-tag--on {
  background: var(--brand);
  color: #fff;
}

.charge-tag--far {
  background: var(--warn-soft);
  color: var(--warn);
}

.charge-amount {
  display: flex;
  align-items: center;
  gap: 8px;
  grid-column: 1 / -1;
  margin-top: 6px;
}

.charge-amount input,
.charge-note input {
  width: 100%;
  max-width: 220px;
  height: 34px;
  padding: 0 11px;
  border: 0;
  border-radius: 9px;
  background: var(--paper);
  box-shadow: var(--ring);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}

.charge-note {
  display: grid;
  gap: 5px;
}

.charge-note span {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

.charge-note input {
  max-width: none;
}

.charge-amount input:focus,
.charge-note input:focus {
  outline: none;
  box-shadow: var(--ring-focus);
}

.charge-amount i {
  color: var(--faint);
  font-size: 12.5px;
  font-style: normal;
}

.charge-pick:has(input:focus-visible) {
  box-shadow: var(--ring-focus);
}

body button.linkish.charge-clear {
  min-height: 24px;
}

.charge-proto {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--well);
  font-size: 12.5px;
}

.charge-proto b {
  color: var(--ink);
  font-size: 12.5px;
}

.charge-proto p {
  margin: 0;
  color: var(--ink-soft, var(--ink));
}

.charge-tag--proto {
  background: var(--ok-soft);
  color: var(--ok);
}

/* ------------------------------------------------------------ 快捷卡台（2026-11-25） */
.qc-top {
  flex-wrap: wrap;
  gap: 10px 18px;
}

.qc-wallets {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin-left: 6px;
  color: var(--muted);
  font-size: 13px;
}

.qc-wallet b {
  color: var(--ink);
  font-weight: 650;
}

.qc-refresh {
  margin-left: auto;
}

.qc-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

body.is-desk .desk-main .qc-panel {
  margin: 0;
}

.qc-panel__head {
  display: flex;
  align-items: center;
  gap: 6px 12px;
  margin-bottom: 12px;
}

body.is-desk .desk-main .qc-panel__head h2 {
  margin: 0;
}

.qc-panel__head .admin-secondary-button {
  margin-left: auto;
}

.qc-dim {
  color: var(--muted);
}

.qc-bad,
.qc-error {
  color: var(--danger);
}

.qc-error {
  margin: 0 0 8px;
  font-size: 13px;
}

.qc-hint {
  margin: 4px 0 0;
  min-height: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.qc-hint:empty {
  display: none;
}

.qc-hint--bad {
  color: var(--danger);
}

.qc-more {
  margin-top: 10px;
}

/* 备一张卡：一行排开，窄了换行 */
.qc-form {
  display: grid;
  grid-template-columns: auto minmax(170px, 1.1fr) minmax(120px, 0.55fr) minmax(200px, 1.2fr) auto;
  gap: 12px 16px;
  align-items: start;
}

.qc-field {
  display: grid;
  gap: 5px;
  min-width: 0;
  align-content: start;
}

.qc-field > span:first-child {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

.qc-field input[type="text"],
.qc-field select,
.qc-search input[type="search"] {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 11px;
  border: 0;
  border-radius: 9px;
  background-color: var(--paper);
  box-shadow: var(--ring);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}

.qc-field select {
  padding-right: 28px;
}

.qc-field input:focus,
.qc-field select:focus,
.qc-search input:focus {
  outline: none;
  box-shadow: var(--ring-focus);
}

.qc-field input::placeholder,
.qc-search input::placeholder {
  color: var(--muted);
}

.qc-field--go .admin-primary-button {
  height: 36px;
}

.qc-form-feedback {
  grid-column: 1 / -1;
  margin: 0;
}

.qc-seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.qc-seg label {
  position: relative;
  cursor: pointer;
}

.qc-seg label.is-off {
  cursor: not-allowed;
  opacity: 0.55;
}

.qc-seg input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.qc-seg span {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 13px;
  border-radius: 9px;
  background: var(--paper);
  box-shadow: var(--ring);
  color: var(--ink-soft, var(--ink));
  font-size: 13.5px;
  white-space: nowrap;
}

.qc-seg input:checked + span {
  background: var(--brand-soft);
  box-shadow: 0 0 0 1px var(--brand);
  color: var(--brand-ink);
  font-weight: 600;
}

.qc-seg input:focus-visible + span {
  box-shadow: var(--ring-focus);
}

@media (max-width: 1180px) {
  .qc-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 搜索 */
.qc-search {
  display: flex;
  gap: 8px;
  margin: 0 0 12px;
}

.qc-search input[type="search"] {
  flex: 1 1 260px;
  max-width: 420px;
  height: 34px;
  font-size: 13.5px;
}

/* 表格 */
body.is-desk .desk-main .qc-panel .cm-wrap {
  overflow-x: auto;
}

.qc-list.is-loading {
  opacity: 0.55;
  transition: opacity 160ms var(--ease-ui);
}

.qc-table {
  min-width: 860px;
}

.qc-c-card { width: 214px; }
.qc-c-bal { width: 100px; }
.qc-c-st { width: 190px; }
.qc-c-time { width: 140px; }
.qc-c-ops { width: 112px; }

.qc-table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qc-table tbody tr {
  cursor: pointer;
}

.qc-table tr.is-open td {
  background: var(--brand-soft);
}

.qc-r {
  text-align: right !important;
}

.qc-bal--has {
  color: var(--ink);
  font-weight: 650;
}

.qc-remark {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
}

.qc-mailrow {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.qc-plat {
  margin-right: 2px;
}

/* 两个卡台的标签各一种颜色，一眼分得开（2026-11-25）。 */
.qc-plat--luminal { background: #e6f0fd; color: #1f56a8; box-shadow: none; }
.qc-plat--alink { background: #fdeedd; color: #94480a; box-shadow: none; }

.qc-group + .qc-group { margin-top: 18px; }

body.is-desk .desk-main .qc-group__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
}

.qc-mark {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px var(--hair);
  color: var(--muted);
  font-size: 11.5px;
}

.qc-chip--ok { color: #0b6b4b; }
.qc-chip--warn { color: #8a5200; }
.qc-chip--bad { color: #b4232f; }

.qc-ops {
  white-space: nowrap;
}

.qc-ops .qc-link + .qc-link {
  margin-left: 12px;
}

.qc button.linkish,
.qc-drawer button.linkish {
  min-height: 24px;
  padding: 0 2px;
  border: 0;
  border-radius: 4px;
  background: none;
  box-shadow: none;
  color: var(--brand-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.qc button.linkish:hover:not(:disabled),
.qc-drawer button.linkish:hover:not(:disabled) {
  text-decoration: underline;
}

.qc button.linkish:focus-visible,
.qc-drawer button.linkish:focus-visible {
  outline: none;
  box-shadow: var(--ring-focus);
}

.qc button.linkish:disabled {
  color: var(--muted);
  cursor: not-allowed;
}

/* 新开的那张卡亮几秒 */
@keyframes qc-new {
  from { background: var(--brand-soft); }
  to { background: transparent; }
}

.qc-row--new td {
  animation: qc-new 3.6s var(--ease-out) 1;
}

/* 抽屉 */
.qc-drawer {
  width: 540px;
}

.qc-drawer .cm-drawer__body {
  flex: 1;
  min-height: 0;
}

.qc-drawer__bal {
  font-size: 24px;
  font-weight: 700;
}

.qc-drawer header p {
  flex-wrap: wrap;
}

.qc-drawer .qc-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.qc-meta > span:first-child {
  min-width: 32px;
}

.qc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
}

.qc-note {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.qc-note--warn {
  color: #8a5200;
}

.qc-total {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.qc-accounts {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.qc-accounts li {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 10px;
}

.qc-accounts .qc-dim {
  font-size: 12px;
}

.qc-mini {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.qc-mini th {
  padding: 4px 8px 6px 0;
  border-bottom: 1px solid var(--hair);
  color: var(--faint);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

.qc-mini td {
  padding: 6px 8px 6px 0;
  border-bottom: 1px solid var(--hair);
  vertical-align: top;
  word-break: break-word;
}

.qc-mini tr:last-child td {
  border-bottom: 0;
}

.qc-mini .cm-num {
  font-size: 12px;
  white-space: nowrap;
}

.qc-mini th.qc-r:last-child,
.qc-mini td.qc-r:last-child {
  padding-right: 0;
}

.qc-mini td.qc-owner {
  min-width: 96px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.qc-st--ok { color: #0b6b4b; }
.qc-st--warn { color: #8a5200; }
.qc-st--bad { color: var(--danger); }

/* 确认窗里 */
.qc-kv {
  margin: 0 0 12px;
}

.qc-pickrow {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.qc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.qc-chip-btn {
  min-height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--ring);
  color: var(--ink-soft, var(--ink));
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}

.qc-chip-btn:hover {
  background: var(--brand-soft);
  color: var(--brand-ink);
}

.qc-chip-btn:focus-visible {
  outline: none;
  box-shadow: var(--ring-focus);
}

#qc-dlg .qc-unknown {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--warn-soft);
  color: #8a5200;
  font-size: 13.5px;
  line-height: 1.55;
}

#qc-dlg .qc-actions {
  margin-top: 10px;
}

@media (prefers-reduced-motion: reduce) {
  .qc-row--new td {
    animation: none;
    background: var(--brand-soft);
  }
}

/* 全局的 .card form 是单列网格、间距 8px，盖过上面的 .qc-form / .qc-search；这里用同样的层级压回来 */
body.is-desk .desk-main .card .qc-form {
  display: grid;
  gap: 12px 16px;
  margin-top: 0;
}

body.is-desk .desk-main .card .qc-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
}

body.is-desk .desk-main .card .qc-search .admin-secondary-button {
  flex: none;
}

/* 自动充值页头：标题在左，开关和「刷新」靠右挨在一起（开关那一块重画时整块换掉，所以「刷新」放在它外面）。 */
.auto-head .auto-switch {
  margin-left: auto;
}

/* ---------- Gemini 用卡（2026-11-28 第二轮） ---------- */

.gb-lead {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.gb-table .gb-c-card { width: 190px; }
.gb-table .gb-c-time { width: 140px; }
.gb-table .gb-c-n { width: 96px; }
.gb-table .gb-c-last { width: 150px; }

.gb-mono,
.gc-id code {
  font-family: var(--mono, "DM Mono", ui-monospace, monospace);
  font-size: 12px;
  color: var(--muted);
}

.gb-n {
  font-variant-numeric: tabular-nums;
}

.gb-none {
  color: var(--muted);
}

/* 绑定的卡：卡 ID 小号等宽字，旁边一个复制 */
.gc-id {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  vertical-align: baseline;
}

.gc-none {
  margin: 0;
}

/* 查卡结果里每张卡给谁用过：GPT 一行、Gemini 一行 */
.auto-row__owners b {
  font-weight: 600;
  color: var(--ink);
}

/* Gemini 卡密详情：三格预检记录 */
.meta .precheck-ok { color: #0b7a55; font-weight: 600; }
.meta .precheck-bad { color: #b42318; font-weight: 600; }
.meta .precheck-note {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted, #6b6b76);
  word-break: break-all;
}

/* ------------------------------------------------------------ 侧栏两级（2026-11-28）
   一级：会员服务 GPT / Gemini，侧栏最上面，凹槽分段开关，字重一点。
   二级：GPT 下面的卡密后台 / VIP 通道，不要凹槽底，选中和菜单当前项同一种淡紫，字小一号，
   一眼看得出是挂在一级下面的。Gemini 没有二级。 */
body.is-desk .side .side__switch {
  margin: 0;
}

body.is-desk .side .side__switch button {
  padding: 6px 0;
  font-size: 13.5px;
}

body.is-desk .side .side__switch button[aria-selected="true"] {
  font-weight: 700;
}

body.is-desk .side .side__areas {
  gap: 0;
  margin: 4px 0 6px;
  padding: 0;
  background: none;
}

body.is-desk .side .side__areas[hidden] {
  display: none;
}

/* 二级用下划线页签：不和下面菜单的当前项（淡紫底）抢，一眼是「一级下面的两页」 */
body.is-desk .side .side__areas button {
  padding: 6px 0 5px;
  border-radius: 0;
  border-bottom: 2px solid rgba(106, 75, 255, 0.12);
  font-size: 12.5px;
  color: var(--muted);
}

body.is-desk .side .side__areas button:hover {
  background: none;
  color: var(--ink);
}

body.is-desk .side .side__areas button[aria-selected="true"],
body.is-desk .side .side__areas button[aria-selected="true"]:hover {
  border-bottom-color: var(--brand, #6a4bff);
  background: none;
  color: var(--brand-ink);
  font-weight: 600;
  box-shadow: none;
}

/* Gemini 查询订阅：宽屏左右两栏（左边贴 Cookie，右边结果），和 GPT 查询订阅一样的排法 */
.gq-desk {
  display: grid;
  gap: 14px;
  align-items: start;
}

@media (min-width: 1280px) {
  .gq-desk {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.gq-desk .session-input {
  min-height: 140px;
}

.gq-result .card-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gq-result--empty {
  display: grid;
  place-items: center;
  min-height: 160px;
}

.gq-sub {
  margin: 16px 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft, #35304d);
}

.gq-mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.gq-warn {
  color: #8a5200;
  font-weight: 600;
}

.gq-note {
  font-size: 12.5px;
  color: var(--muted, #615b7c);
  word-break: break-all;
}

.gq-result .gc-none {
  margin: 0;
}

.gq-foot {
  margin: 14px 0 0;
  padding-top: 12px;
  box-shadow: inset 0 1px 0 var(--line, #f1eef9);
}

/* 留着余额的卡锁定后（2026-11-28）：说明文字和按钮用琥珀色，提醒这张卡的钱被人工按住了 */
.cm-subs__card em.is-locked {
  color: #8a5200;
  font-weight: 600;
}

/* 「锁定」单独一种颜色（琥珀，和「充值中」同一组色），锁上之后底色再深一档 */
.cm-subs__card .admin-secondary-button[data-sub-card-lock],
body.is-desk .desk-main .cm-subs__card .admin-secondary-button[data-sub-card-lock] {
  background: #fff1d6;
  color: #8a5200;
  box-shadow: none;
}

.cm-subs__card .admin-secondary-button[data-sub-card-lock]:hover,
body.is-desk .desk-main .cm-subs__card .admin-secondary-button[data-sub-card-lock]:hover {
  background: #ffe6b3;
}

.cm-subs__card .admin-secondary-button[data-sub-card-lock].is-locked,
body.is-desk .desk-main .cm-subs__card .admin-secondary-button[data-sub-card-lock].is-locked {
  background: #ffdc99;
  color: #6b3f00;
  font-weight: 600;
}


/* ---------------------------------------------------------- 上游商品（2026-11-29） */

.up .up-mono {
  font-family: "DM Mono", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}

.up .up-muted {
  color: var(--faint);
}

.up .up-warn {
  color: var(--warn);
  font-weight: 600;
}

.up .up-strong {
  color: var(--ink);
  font-weight: 700;
}

.up-sup {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--well);
}

.up-sup__one {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.up-sup__bal {
  color: var(--muted);
}

.up-sup .admin-secondary-button {
  margin-left: auto;
}

.up-table .up-c-dot { width: 34px; }
.up-c-chip { width: 92px; }
.up-c-n { width: 86px; }
.up-c-code { width: 260px; }
.up-c-prod { width: 130px; }
.up-c-prod2 { width: 190px; }
.up-c-state { width: 150px; }
.up-c-bind { width: 120px; }
.up-c-acct { width: 160px; }
.up-c-time { width: 150px; }
.card.cm.up td.up-mono { white-space: nowrap; }
.up-c-sup { width: 110px; }
.up-c-cap { width: 120px; }
.up-c-ops { width: 190px; }

.up-row {
  cursor: pointer;
  transition: background-color 160ms ease;
}

.up-row.is-off {
  cursor: default;
  color: var(--faint);
}

.up-row.is-picked {
  background: var(--brand-soft);
}

.up-row:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--brand);
}

.up-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--edge);
  vertical-align: middle;
}

.up-row.is-picked .up-dot {
  box-shadow: inset 0 0 0 4px var(--brand);
}

.up-gen {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.up-gen #up-remark {
  flex: 1 1 220px;
}

.up-count {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: var(--sunk);
}

.up-count button {
  min-width: 34px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.up-count button[aria-pressed="true"] {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(79, 53, 214, 0.12);
}

body.is-desk .desk-main .card.cm .up-count input {
  width: 64px;
  height: 28px;
}

.up-out {
  margin-top: 14px;
  padding: 14px;
  border-radius: 12px;
  background: var(--well);
}

.up-out__lead {
  margin: 0 0 8px;
  font-size: 13px;
}

.up-out__codes {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: var(--paper);
  box-shadow: var(--ring);
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
}

.up-out__ops {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.up-ops {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.up-click {
  cursor: pointer;
}

.up-confirm {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}

.up-confirm div {
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--well);
}

.up-confirm dt {
  color: var(--faint);
  font-size: 12px;
}

.up-confirm dd {
  margin: 2px 0 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.up-job {
  margin-top: 12px;
}

.up-job__head {
  margin: 0 0 6px;
  font-weight: 600;
  font-size: 13px;
}

.up-steps {
  margin: 0;
  padding-left: 18px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.up-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.up-check input {
  accent-color: var(--brand);
}

.up-ratio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

body.is-desk .desk-main .card.cm .up-ratio input {
  width: 72px;
}

.up-set input[type="text"] {
  width: 100%;
  box-sizing: border-box;
}

/* 侧栏一级多了「上游商品」，三项一排（GPT、Gemini 字少，上游商品四个字宽一点）。 */
body.is-desk .side .side__switch {
  grid-template-columns: 0.8fr 1fr 1.35fr;
}

body.is-desk .desk-main .card.cm form.up-gen {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

body.is-desk .desk-main .card.cm form.up-gen .admin-primary-button {
  flex: none;
  width: auto;
}

body.is-desk .desk-main .card.cm form#up-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

body.is-desk .desk-main .card.cm form#up-search input[type="search"] {
  flex: 0 1 320px;
}

/* 卡密表的 1216px 下限是 GPT 卡密列表的；上游商品的表按自己的列宽来，窄屏再横向滚。 */
.card.cm.up .cm-table {
  min-width: 860px;
  width: 100%;
}
