/* 推广中心与分站分销共用布局，仅作用于这两个账户页面。 */
body.account-promotion-page {
  --promotion-ink: #29252a;
  --promotion-muted: #817780;
  --promotion-line: #eeebef;
  --promotion-paper: #fff;
  --promotion-soft: #f6f6f8;
  --promotion-accent: #006bd6;
  --promotion-accent-soft: #edf4ff;
  --promotion-action: #0071e3;
  --promotion-action-text: #fff;
}

html.front-night body.account-promotion-page {
  --promotion-ink: #f1f3f5;
  --promotion-muted: #a4acb7;
  --promotion-line: #373d46;
  --promotion-paper: #24282e;
  --promotion-soft: #1d2025;
  --promotion-accent: #8ebfff;
  --promotion-accent-soft: #25364b;
  --promotion-action: #8ebfff;
  --promotion-action-text: #162333;
}

html.front-night body.account-promotion-page .account-page-topbar {
  background: var(--promotion-paper);
  color: var(--promotion-ink);
}

html.front-night body.account-promotion-page .account-page-topbar [data-front-announcement] {
  border-color: var(--promotion-line);
  background: var(--promotion-paper);
}

body.account-promotion-page .user-page-shell {
  min-height: calc(100dvh - 58px);
  padding: 10px 12px calc(32px + env(safe-area-inset-bottom));
  border: 0;
  box-shadow: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.75;
}

/* 主导航使用可横向浏览的轻量标签，不挤压字号或叠加大外框。 */
body.account-promotion-page :is(.user-invite-tabs, .subsite-view-tabs) {
  display: flex;
  gap: 6px;
  margin: 0 0 14px;
  padding: 0 0 2px;
  overflow-x: auto;
  border: 0;
  border-bottom: 0 !important;
  border-radius: 0;
  background: transparent;
  scrollbar-width: none;
}

body.account-promotion-page :is(.user-invite-tabs, .subsite-view-tabs) > button {
  position: relative;
  flex: 1 0 auto;
  min-width: 60px;
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--promotion-line);
  border-radius: 999px;
  background: var(--promotion-paper);
  color: var(--promotion-muted);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: none;
}

body.account-promotion-page :is(.user-invite-tabs, .subsite-view-tabs) > button.active {
  border-color: transparent;
  background: var(--promotion-accent-soft);
  color: var(--promotion-accent);
  font-weight: 600;
  box-shadow: none;
}

body.account-promotion-page :is(.user-invite-tabs, .subsite-view-tabs) > button.active::after {
  display: none;
}

body.account-promotion-page :is(.user-form-section, .user-invite-card, .user-invite-income, .user-withdraw-card) {
  min-width: 0;
  gap: 16px;
  margin: 0 0 14px;
  padding: 18px 16px !important;
  border: 0;
  border-radius: 14px !important;
  background: var(--promotion-paper) !important;
  box-shadow: none !important;
}

body.account-promotion-page :is(.promotion-section-heading, .subsite-section-heading, .user-invite-income-head-copy) {
  display: grid;
  gap: 4px;
  min-width: 0;
}

body.account-promotion-page :is(.promotion-section-heading h2, .subsite-section-heading h2, .user-invite-income h2, .user-withdraw-card-head h2) {
  margin: 0;
  color: var(--promotion-ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

body.account-promotion-page :is(.promotion-section-heading p, .subsite-section-heading p, .user-withdraw-card-head p) {
  margin: 4px 0 0;
  color: var(--promotion-muted);
  font-size: 11px;
  line-height: 1.7;
}

body.account-promotion-page .subsite-inner-tabs {
  gap: 5px;
  padding: 0 0 12px;
  border: 0;
  border-bottom: 1px solid var(--promotion-line);
  border-radius: 0;
  background: transparent;
}

body.account-promotion-page .subsite-inner-tabs button {
  height: 32px;
  padding: 0 7px;
  border-radius: 7px;
  color: var(--promotion-muted);
  font-size: 11px;
  font-weight: 500;
  box-shadow: none;
}

body.account-promotion-page .subsite-inner-tabs button.active {
  background: var(--promotion-soft);
  color: var(--promotion-accent);
  box-shadow: none;
}

body.account-promotion-page :is(.subsite-inner-panel, .user-form-grid) { gap: 14px; }
body.account-promotion-page .subsite-inner-panel h3 { margin: 0; color: var(--promotion-ink); font-size: 12px; font-weight: 600; line-height: 1.6; }
body.account-promotion-page .subsite-guide-copy {
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--promotion-muted);
  font-size: 12px;
  line-height: 1.85;
}

body.account-promotion-page :is(.field, .subsite-guide-link) { display: grid; min-width: 0; gap: 7px; }
body.account-promotion-page :is(.field > span, .promotion-link-label, .subsite-guide-link > span, .subsite-mode-field legend) {
  color: var(--promotion-ink);
  font-size: 11px;
  font-weight: 500;
}

body.account-promotion-page :is(.field-tip, .subsite-panel-tip, .subsite-code-quota-tip, .subsite-files-tip) {
  margin: 0;
  color: var(--promotion-muted);
  font-size: 11px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

body.account-promotion-page :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]), select, textarea) {
  min-width: 0;
  border: 1px solid var(--promotion-line);
  border-radius: 9px;
  background: var(--promotion-soft);
  color: var(--promotion-ink);
  box-shadow: none;
}

body.account-promotion-page :is(.input, .select, .user-copy-row input, .user-withdraw-form input, .user-withdraw-form select, .subsite-code-search input) {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  font-size: 13px;
}

body.account-promotion-page .user-copy-row { gap: 6px; align-items: center; padding: 4px; border-radius: 9px; background: var(--promotion-soft); }
body.account-promotion-page .user-copy-row input { height: 34px; padding-inline: 8px; border: 0; background: transparent; font-size: 11px; }
body.account-promotion-page .user-copy-row button {
  min-width: 54px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 7px;
  background: var(--promotion-paper);
  color: var(--promotion-accent);
  font-size: 11px;
  font-weight: 500;
  box-shadow: none;
  cursor: pointer;
}

body.account-promotion-page :is(.user-form-submit, .subsite-copy-latest, .subsite-guide-action, .subsite-code-search button, .user-withdraw-form button, .subsite-installation-actions button.primary) {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--promotion-action);
  color: var(--promotion-action-text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

body.account-promotion-page :is(.user-invite-poster-button, .user-withdraw-form button.secondary, .subsite-code-toolbar button, .subsite-code-bulk button, .subsite-code-actions button, #uploadSubsiteLogoBtn) {
  min-height: 36px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid var(--promotion-line);
  border-radius: 8px;
  background: var(--promotion-soft);
  color: var(--promotion-ink);
  font-size: 11px;
  font-weight: 500;
  box-shadow: none;
}

body.account-promotion-page :is(input, select, textarea):focus-visible {
  border-color: var(--promotion-muted);
  outline: 2px solid var(--promotion-line);
  outline-offset: 1px;
  box-shadow: none;
}

body.account-promotion-page :is(button, a):focus-visible { outline: 2px solid var(--promotion-muted); outline-offset: 3px; }
body.account-promotion-page .user-info-note { margin: 0; padding: 12px; border: 0; border-radius: 9px; background: var(--promotion-soft); color: var(--promotion-muted); font-size: 11px; line-height: 1.85; }
body.account-promotion-page .promotion-link-label { margin-bottom: -9px; }
body.account-promotion-page .user-invite-poster-button { min-height: 40px; border: 0; background: var(--promotion-accent-soft); color: var(--promotion-accent); }

/* 收入统计直接排在外层卡片内，用细线分组，避免重复底板和大面积留白。 */
body.account-promotion-page .user-invite-income { gap: 14px; }
body.account-promotion-page .user-invite-income-head-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  width: 100%;
}
body.account-promotion-page .user-invite-income-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}
body.account-promotion-page .user-invite-income-stats > div {
  min-width: 0;
  align-content: start;
  justify-items: start;
  gap: 7px;
  padding: 12px 0;
}
body.account-promotion-page .user-invite-income-stats > div:nth-child(n + 3) { border-top: 1px solid var(--promotion-line); }
body.account-promotion-page .user-invite-income-stats > div::after { display: none; }
body.account-promotion-page .user-invite-income-stats strong {
  color: var(--promotion-ink);
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  letter-spacing: -.3px;
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
}
body.account-promotion-page #inviteTotalIncome { color: var(--promotion-accent); }
body.account-promotion-page .user-invite-income-stats > div:nth-child(n + 3) strong { font-size: 20px; }
body.account-promotion-page .user-invite-income-stats span { color: var(--promotion-muted); font-size: 11px; }
body.account-promotion-page .user-invite-income-stats span { order: -1; }
body.account-promotion-page .user-invite-income-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--promotion-line); }
body.account-promotion-page .user-invite-income-title strong { color: var(--promotion-ink); font-size: 12px; font-weight: 600; }
body.account-promotion-page .user-invite-income-title > span { color: var(--promotion-muted); font-size: 10px; }
body.account-promotion-page .user-invite-income-head-copy > span { color: var(--promotion-muted); font-size: 11px; }
body.account-promotion-page :is(.user-invite-income-list, .subsite-code-list) { gap: 0; }
body.account-promotion-page .user-invite-income-item { padding: 14px 0; border: 0; border-bottom: 1px solid var(--promotion-line) !important; border-radius: 0; background: transparent; }
body.account-promotion-page .user-invite-income-item:last-child { border-bottom: 0 !important; }
body.account-promotion-page .user-invite-income-item > div strong { color: var(--promotion-ink); font-size: 12px; font-weight: 500; }
body.account-promotion-page .user-invite-income-item > i { width: 28px; height: 28px; font-size: 10px; font-weight: 500; }
body.account-promotion-page .user-invite-income-item > b { font-size: 12px; font-weight: 600; }
body.account-promotion-page .user-invite-income-item > div span, body.account-promotion-page .user-invite-income-item time { color: var(--promotion-muted); font-size: 10px; line-height: 1.8; }
body.account-promotion-page :is(.user-invite-income-empty, .subsite-code-empty) { padding: 32px 12px; border: 0; color: var(--promotion-muted); font-size: 12px; }
body.account-promotion-page .user-invite-income-empty { padding: 20px 0; }

body.account-promotion-page .user-invite-withdraw-panel { display: grid; gap: 14px; padding-bottom: 0; }
body.account-promotion-page .user-withdraw-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 0; padding: 4px; border-radius: 14px; background: var(--promotion-paper); }
body.account-promotion-page .user-withdraw-balance { gap: 7px; padding: 14px 12px; border-radius: 0; background: transparent; }
body.account-promotion-page .user-withdraw-balance.featured { background: transparent; }
body.account-promotion-page .user-withdraw-balance strong { color: var(--promotion-ink); font-size: 21px; font-weight: 600; font-variant-numeric: tabular-nums; }
body.account-promotion-page .user-withdraw-balance.featured strong { color: var(--promotion-accent); }
body.account-promotion-page .user-withdraw-balance :is(span, small) { color: var(--promotion-muted); font-weight: 400; }
body.account-promotion-page .user-withdraw-balance small { font-size: 10px; white-space: normal; }
body.account-promotion-page .user-withdraw-card { margin: 0; }
body.account-promotion-page .user-withdraw-card-head { flex-wrap: wrap; gap: 8px; }
body.account-promotion-page .user-withdraw-status { background: var(--promotion-soft); color: var(--promotion-muted); font-size: 10px; font-weight: 400; }
body.account-promotion-page .user-withdraw-notice { padding: 12px; background: var(--promotion-soft); color: var(--promotion-muted); font-size: 11px; line-height: 1.8; }
body.account-promotion-page .user-withdraw-notice svg { fill: var(--promotion-muted); }
body.account-promotion-page .user-withdraw-form { gap: 14px; }
body.account-promotion-page .user-withdraw-form label { gap: 7px; color: var(--promotion-ink); font-size: 11px; font-weight: 500; }
body.account-promotion-page .user-withdraw-upload { border-color: var(--promotion-line); border-radius: 8px; background: var(--promotion-soft); color: var(--promotion-muted); }
body.account-promotion-page .user-withdraw-row { padding: 14px 0; border-color: var(--promotion-line); }
body.account-promotion-page .user-withdraw-row strong { color: var(--promotion-ink); font-size: 13px; font-weight: 600; }
body.account-promotion-page .user-withdraw-row :is(span, time) { color: var(--promotion-muted); font-size: 10px; }
body.account-promotion-page .user-withdraw-notes { gap: 6px; margin: 0; padding: 4px 4px 0; background: transparent; }
body.account-promotion-page .user-withdraw-notes :is(h2, p) { color: var(--promotion-muted); font-size: 11px; line-height: 1.9; }

body.account-promotion-page .subsite-logo-editor { gap: 12px; padding: 0; border: 0; background: transparent; }
body.account-promotion-page .subsite-logo-editor img { width: 54px; height: 54px; flex-basis: 54px; border-color: var(--promotion-line); }
body.account-promotion-page .subsite-logo-editor small { color: var(--promotion-muted); font-size: 11px; }
body.account-promotion-page .subsite-mode-options label > span { gap: 6px; min-height: 80px; padding: 12px 10px; border-color: var(--promotion-line); border-radius: 9px; background: var(--promotion-soft); box-shadow: none; }
body.account-promotion-page .subsite-mode-options strong { color: var(--promotion-ink); font-size: 12px; font-weight: 500; }
body.account-promotion-page .subsite-mode-options small { color: var(--promotion-muted); font-size: 11px; line-height: 1.7; }
body.account-promotion-page .subsite-mode-options input:checked + span { border-color: var(--promotion-accent); background: var(--promotion-accent-soft); box-shadow: none; }
body.account-promotion-page .subsite-mode-options input:checked + span strong { color: var(--promotion-accent); }
body.account-promotion-page .subsite-mode-options input:focus-visible + span { outline: 2px solid var(--promotion-muted); outline-offset: 3px; }
body.account-promotion-page .subsite-code-stats { padding: 14px 0; border: 0; border-radius: 9px; background: var(--promotion-soft); }
body.account-promotion-page .subsite-code-stats > div { gap: 6px; }
body.account-promotion-page .subsite-code-stats > div + div { border: 0; }
body.account-promotion-page .subsite-code-stats strong { order: -1; color: var(--promotion-ink); font-size: 18px; font-weight: 600; }
body.account-promotion-page .subsite-code-stats span { color: var(--promotion-muted); font-size: 10px; }
body.account-promotion-page .subsite-code-form { grid-template-columns: minmax(0, 1fr) 104px; gap: 13px 10px; }
body.account-promotion-page .subsite-code-form > :is(input, button) { align-self: end; }
body.account-promotion-page .subsite-code-quota-tip { text-align: left; }
body.account-promotion-page .subsite-code-toolbar .select { width: 140px; }
body.account-promotion-page .subsite-code-bulk { flex-wrap: wrap; gap: 8px; padding: 0; }
body.account-promotion-page .subsite-code-bulk > label { min-height: 36px; color: var(--promotion-muted); font-size: 11px; font-weight: 400; }
body.account-promotion-page input[type="checkbox"] { accent-color: var(--promotion-accent); }
body.account-promotion-page .subsite-code-item { padding: 16px 0; border: 0; border-bottom: 1px solid var(--promotion-line); border-radius: 0; background: transparent; }
body.account-promotion-page .subsite-code-item:last-child { border-bottom: 0; }
body.account-promotion-page .subsite-code-item code { color: var(--promotion-ink); font-size: 11px; font-weight: 500; }
body.account-promotion-page .subsite-code-item span { color: var(--promotion-muted); font-size: 11px; line-height: 1.7; }
body.account-promotion-page :is(.subsite-code-bulk, .subsite-code-actions) button.danger { color: #c65761; }
body.account-promotion-page .subsite-file-item { gap: 18px; padding: 4px 0 20px; border-color: var(--promotion-line); }
body.account-promotion-page .subsite-file-item h3 { color: var(--promotion-ink); font-size: 12px; font-weight: 600; }
body.account-promotion-page .subsite-file-item p { color: var(--promotion-muted); font-size: 11px; line-height: 1.8; }
body.account-promotion-page .subsite-file-item > a { padding: 0 12px; background: var(--promotion-accent-soft); color: var(--promotion-accent); font-weight: 500; }

@media (min-width: 600px) {
  body.account-promotion-page .user-page-shell { padding-inline: 12px; }
  body.account-promotion-page :is(.user-form-section, .user-invite-card, .user-invite-income, .user-withdraw-card) { padding: 20px 18px !important; }
  body.account-promotion-page .user-withdraw-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.account-promotion-page .user-withdraw-form > :is(label:nth-of-type(3), p, div) { grid-column: 1 / -1; }
}

@media (max-width: 599px) {
  body.account-promotion-page .user-invite-income-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.account-promotion-page :is(.user-form-grid, .subsite-code-form, .user-withdraw-form) :is(input:not([readonly]), select, textarea) { font-size: 16px; }
}

@media (max-width: 359px) {
  body.account-promotion-page .user-page-shell { padding-inline: 12px; }
  body.account-promotion-page :is(.user-form-section, .user-invite-card, .user-invite-income, .user-withdraw-card) { padding: 16px 14px !important; }
  body.account-promotion-page .subsite-inner-tabs button { padding-inline: 4px; font-size: 11px; }
  body.account-promotion-page .subsite-file-item { grid-template-columns: 1fr; gap: 12px; }
  body.account-promotion-page .subsite-file-item > a { justify-self: start; }
  body.account-promotion-page .subsite-code-form { grid-template-columns: minmax(0, 1fr) 96px; }
  body.account-promotion-page .user-invite-income-stats { column-gap: 16px; }
  body.account-promotion-page .user-invite-income-stats strong { font-size: 20px; }
}

/* 推广中心独立使用两页布局，不影响分站分销和独立提现页。 */
body.user-invite-page.account-promotion-page #inviteViewTabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

body.user-invite-page.account-promotion-page #inviteViewTabs > button {
  height: 44px;
  padding-inline: 18px;
  font-size: 13px;
}

body.user-invite-page.account-promotion-page #inviteCard {
  display: grid;
  gap: 14px;
}

body.user-invite-page.account-promotion-page #inviteCard .user-copy-row {
  min-height: 44px;
  gap: 6px;
}

body.user-invite-page.account-promotion-page #inviteLink {
  height: 36px;
  font-size: 12px;
}

body.user-invite-page.account-promotion-page #copyInviteBtn {
  min-width: 72px;
  min-height: 36px;
  font-size: 12px;
}

body.user-invite-page.account-promotion-page :is(.user-page-shell, #inviteCard, #inviteDetails > section) {
  border: 0 !important;
  box-shadow: none !important;
}

body.account-promotion-page :is(#inviteViewTabs, #subsiteViewTabs) > button { border: 0 !important; outline: 0 !important; box-shadow: none !important; -webkit-tap-highlight-color: transparent; }
body.account-promotion-page :is(#inviteViewTabs, #subsiteViewTabs) > button:focus-visible { text-decoration: underline; text-underline-offset: 4px; }
body.user-invite-page .invite-promotion-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 5px 0 2px; }
body.user-invite-page .invite-promotion-actions > button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; min-height: 61px; padding: 6px 0; border: 0 !important; border-radius: 0; outline: 0 !important; box-shadow: none !important; background: transparent !important; color: var(--promotion-ink); font: inherit; font-size: 12px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
body.user-invite-page .invite-promotion-actions > button:disabled { opacity: .5; cursor: wait; }
body.user-invite-page .invite-promotion-actions img { display: block; width: 27px; height: 27px; object-fit: contain; }

body.user-invite-page.account-promotion-page :is(.invite-link-note, .invite-withdraw-note) {
  margin: 0;
  color: var(--promotion-muted);
  font-size: 10px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

body.user-invite-page.account-promotion-page #inviteDetails {
  gap: 12px;
}

body.user-invite-page.account-promotion-page #inviteDetails > :is(.user-invite-income, .user-withdraw-summary, .user-withdraw-card) {
  margin: 0;
  padding: 16px 14px !important;
  border: 0;
  border-radius: 14px;
  background: var(--promotion-paper);
  box-shadow: none;
}

body.user-invite-page.account-promotion-page .user-invite-overview-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(var(--invite-stat-column-min, 100px), 1fr));
  gap: 12px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

body.user-invite-page.account-promotion-page .user-invite-overview-stats > div {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0;
  min-width: 0;
  white-space: nowrap;
}

/* 收益与余额均以同字号、同一水平线显示名称和数值，不叠成上下两行。 */
body.user-invite-page.account-promotion-page :is(.user-invite-overview-stats, .user-withdraw-balance) :is(span, strong) {
  flex: 0 0 auto;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}

body.user-invite-page.account-promotion-page .user-invite-overview-stats span { color: var(--promotion-muted); }
body.user-invite-page.account-promotion-page .user-invite-overview-stats strong {
  color: var(--promotion-ink);
  font-variant-numeric: tabular-nums;
}

body.user-invite-page.account-promotion-page #inviteDetails .user-withdraw-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(var(--invite-stat-column-min, 100px), 1fr));
  align-items: center;
  gap: 12px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

body.user-invite-page.account-promotion-page #inviteDetails .user-withdraw-balance {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0;
  border: 0 !important;
  box-shadow: none !important;
  white-space: nowrap;
}

body.user-invite-page.account-promotion-page #inviteDetails .user-withdraw-balance strong {
  min-width: 0;
  max-width: none;
  overflow: visible;
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
  white-space: nowrap;
}

body.user-invite-page.account-promotion-page #withdrawForm {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 10px;
}

body.user-invite-page.account-promotion-page #withdrawForm > :is(.user-withdraw-qr-field, p, div) {
  grid-column: 1 / -1;
}

body.user-invite-page.account-promotion-page #withdrawForm .user-withdraw-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

body.user-invite-page.account-promotion-page #withdrawForm .user-withdraw-upload {
  justify-self: start;
  width: 128px;
  height: 128px;
  min-height: 0;
  aspect-ratio: 1;
  box-sizing: border-box;
}

body.user-invite-page.account-promotion-page #withdrawQRPreview {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
}

/* 分站分销使用三个主页面，文档和设置在各自的一张外层卡片中顺序展开。 */
body.user-subsite-page.account-promotion-page #subsiteViewTabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
  margin-bottom: 14px;
  overflow: visible;
}

body.user-subsite-page.account-promotion-page #subsiteViewTabs > button {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 6px;
  font-size: 13px;
}

body.user-subsite-page.account-promotion-page :is(.subsite-document-block, .subsite-binding-fields, .subsite-whitelist-fields, .subsite-code-info, .subsite-code-list-panel) {
  display: grid;
  min-width: 0;
  gap: 12px;
}

body.user-subsite-page.account-promotion-page :is(.subsite-document-block, .subsite-code-info, .subsite-code-list-panel) h2 {
  margin: 0;
  color: var(--promotion-ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

body.user-subsite-page.account-promotion-page .subsite-document-block + .subsite-document-block {
  padding-top: 18px;
  border-top: 1px solid var(--promotion-line);
}

body.user-subsite-page.account-promotion-page .subsite-whitelist-fields h3 {
  margin: 0;
  color: var(--promotion-ink);
  font-size: 11px;
  font-weight: 500;
}

body.user-subsite-page.account-promotion-page .subsite-guide-action {
  display: inline-flex;
  justify-self: start;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--promotion-accent-soft);
  color: var(--promotion-accent);
  text-decoration: none;
}

body.user-subsite-page.account-promotion-page .subsite-binding-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

body.user-subsite-page.account-promotion-page .subsite-binding-actions button {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: var(--promotion-accent-soft);
  color: var(--promotion-accent);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

body.user-subsite-page.account-promotion-page .subsite-ip-textarea {
  min-height: 96px;
  font-weight: 400;
}

body.user-subsite-page.account-promotion-page :is(.subsite-installation-actions button.primary, #userSubsiteForm > .user-form-submit) {
  width: 100%;
  border-radius: 999px;
}

body.user-subsite-page.account-promotion-page :is(button, input, textarea):disabled { opacity: .45; cursor: not-allowed; }
body.user-subsite-page.account-promotion-page .subsite-mode-field { margin: 0; padding: 0; border: 0; }
body.user-subsite-page.account-promotion-page .subsite-mode-options { margin-top: 8px; }

body.user-subsite-page.account-promotion-page .subsite-file-drawer {
  padding-top: 16px;
  border-top: 1px solid var(--promotion-line);
  color: var(--promotion-ink);
}

body.user-subsite-page.account-promotion-page .subsite-file-drawer summary {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}

body.user-subsite-page.account-promotion-page .subsite-file-drawer summary::-webkit-details-marker { display: none; }
body.user-subsite-page.account-promotion-page .subsite-file-drawer summary span { margin-left: auto; color: var(--promotion-muted); font-size: 11px; font-weight: 400; }
body.user-subsite-page.account-promotion-page .subsite-file-drawer summary::after { content: "⌄"; color: var(--promotion-muted); }
body.user-subsite-page.account-promotion-page .subsite-file-drawer[open] summary { margin-bottom: 18px; }

/* 卡密信息与列表参考证书站，保留商城原有分类、备注、复制及安全删除能力。 */
body.user-subsite-page.account-promotion-page .subsite-code-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 12px 0 4px;
  border: 0;
  background: transparent;
}

body.user-subsite-page.account-promotion-page .subsite-code-stats strong {
  color: var(--promotion-ink);
  font-size: 22px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

body.user-subsite-page.account-promotion-page .subsite-code-stats span { font-size: 11px; }
body.user-subsite-page.account-promotion-page .subsite-code-list-panel { padding-top: 18px; border-top: 1px solid var(--promotion-line); }
body.user-subsite-page.account-promotion-page .subsite-code-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
body.user-subsite-page.account-promotion-page .subsite-code-list-tools { display: flex; align-items: center; gap: 5px; }

body.user-subsite-page.account-promotion-page .subsite-code-list-tools > :is(button, label) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: var(--promotion-accent-soft);
  color: var(--promotion-accent);
  font: inherit;
  font-size: 11px;
  white-space: nowrap;
  cursor: pointer;
}

body.user-subsite-page.account-promotion-page .subsite-select-all input {
  width: 12px;
  height: 12px;
  margin: 0;
}

body.user-subsite-page.account-promotion-page .subsite-code-search { grid-template-columns: minmax(0, 1fr) 48px; gap: 6px; }
body.user-subsite-page.account-promotion-page .subsite-code-search-input { display: flex; align-items: center; gap: 7px; min-width: 0; padding: 0 12px; border-radius: 999px; background: var(--promotion-soft); }
body.user-subsite-page.account-promotion-page .subsite-code-search-input img { width: 16px; height: 16px; flex: 0 0 16px; opacity: .6; }
body.user-subsite-page.account-promotion-page .subsite-code-search-input input { height: 42px; padding: 0; border: 0 !important; outline: 0; background: transparent; box-shadow: none; }
body.user-subsite-page.account-promotion-page .subsite-code-search-input:focus-within { outline: 1px solid var(--promotion-muted); }
body.user-subsite-page.account-promotion-page .subsite-code-search button { min-height: 42px; padding: 0; border-radius: 999px; background: var(--promotion-accent-soft); color: var(--promotion-accent); font-size: 11px; }
body.user-subsite-page.account-promotion-page .subsite-code-toolbar { padding: 0; }
body.user-subsite-page.account-promotion-page .subsite-code-toolbar .select { height: 34px; font-size: 12px; }

body.user-subsite-page.account-promotion-page .subsite-code-item {
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 16px 0;
}

body.user-subsite-page.account-promotion-page .subsite-code-check { margin-top: 3px; }
body.user-subsite-page.account-promotion-page .subsite-code-check input { width: 17px; height: 17px; margin: 0; }
body.user-subsite-page.account-promotion-page .subsite-code-body { display: grid; gap: 8px; }
body.user-subsite-page.account-promotion-page .subsite-code-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
body.user-subsite-page.account-promotion-page .subsite-code-value { flex: 1; min-width: 0; padding: 0; border: 0; background: transparent; text-align: left; cursor: pointer; }
body.user-subsite-page.account-promotion-page .subsite-code-value code { color: var(--promotion-ink); font-size: 13px; font-weight: 650; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
body.user-subsite-page.account-promotion-page .subsite-code-item.is-used code { color: var(--color-danger-text, #d9363e); }
body.user-subsite-page.account-promotion-page .subsite-code-copy { display: grid; place-items: center; width: 27px; height: 27px; flex: 0 0 27px; padding: 6px; border: 0; border-radius: 7px; background: var(--promotion-accent-soft); cursor: pointer; }
body.user-subsite-page.account-promotion-page .subsite-code-copy img { width: 15px; height: 15px; }
body.user-subsite-page.account-promotion-page .subsite-code-chips { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; }
body.user-subsite-page.account-promotion-page .subsite-code-chips span { display: inline-flex; max-width: 100%; margin: 0; padding: 3px 7px; border-radius: 4px; background: var(--promotion-soft); color: var(--promotion-muted); font-size: 10px; line-height: 1.4; overflow-wrap: anywhere; }
body.user-subsite-page.account-promotion-page .subsite-code-chips .subsite-code-category { background: var(--promotion-accent-soft); color: var(--promotion-accent); }
body.user-subsite-page.account-promotion-page .subsite-code-chips .subsite-code-status.used { background: var(--color-danger-bg, #fff1f0); color: var(--color-danger-text, #d9363e); }
body.user-subsite-page.account-promotion-page .subsite-code-product { margin: 0; padding: 5px 8px; border-radius: 6px; background: var(--promotion-soft); color: var(--promotion-muted); font-size: 11px; overflow-wrap: anywhere; }
body.user-subsite-page.account-promotion-page .subsite-code-meta { display: flex; align-items: center; gap: 10px; min-width: 0; }
body.user-subsite-page.account-promotion-page .subsite-code-note { flex: 1; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.user-subsite-page.account-promotion-page .subsite-code-meta button { min-height: 24px; padding: 0; border: 0; background: transparent; color: var(--color-danger-text, #d9363e); font: inherit; font-size: 11px; cursor: pointer; }
body.user-subsite-page.account-promotion-page .subsite-code-bulk { min-height: 32px; padding-top: 8px; border-top: 1px solid var(--promotion-line); color: var(--promotion-muted); font-size: 11px; }
body.user-subsite-page.account-promotion-page .subsite-code-toolbar-actions { display: flex; gap: 8px; }
body.user-subsite-page.account-promotion-page .subsite-code-toolbar button { border-color: var(--promotion-line); background: transparent; color: var(--promotion-ink); font: inherit; font-size: 12px; }
body.user-subsite-page.account-promotion-page .subsite-code-toolbar button.danger { color: var(--color-danger-text, #d9363e); }
body.user-subsite-page.account-promotion-page .subsite-code-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
body.user-subsite-page.account-promotion-page .subsite-code-pagination button { padding: 0 9px; border-color: var(--promotion-line); background: transparent; color: var(--promotion-ink); font: inherit; font-size: 11px; }
body.user-subsite-page.account-promotion-page .subsite-code-pagination span { font-variant-numeric: tabular-nums; }

/* 使用原生弹窗提供焦点约束和退出键关闭，内容长时只滚动弹窗内部。 */
body.user-subsite-page.account-promotion-page .subsite-code-sheet {
  box-sizing: border-box;
  inset: auto 0 0;
  width: min(var(--front-device-width, 430px), 100%);
  max-width: 100%;
  height: auto;
  min-height: 0;
  max-height: calc(100vh - 24px - env(safe-area-inset-top));
  max-height: calc(100dvh - 24px - env(safe-area-inset-top));
  overflow: hidden;
  margin: 0 auto;
  padding: 0 0 env(safe-area-inset-bottom);
  border: 0;
  border-radius: 20px 20px 0 0;
  background: var(--promotion-paper);
  color: var(--promotion-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 12px;
  overscroll-behavior: contain;
}

body.user-subsite-page.account-promotion-page .subsite-code-sheet[open] { display: flex; flex-direction: column; animation: subsite-sheet-enter .18s ease-out; }
body.user-subsite-page.account-promotion-page .subsite-code-sheet::backdrop { background: var(--front-theme-overlay, rgba(20, 25, 30, .4)); }
body.user-subsite-page.account-promotion-page .subsite-sheet-handle { flex: 0 0 4px; width: 30px; height: 4px; margin: 10px auto 0; border-radius: 4px; background: var(--promotion-line); }
body.user-subsite-page.account-promotion-page .subsite-sheet-heading { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; }
body.user-subsite-page.account-promotion-page .subsite-sheet-heading h2 { margin: 0; font-size: 14px; font-weight: 600; }
body.user-subsite-page.account-promotion-page .subsite-sheet-heading button { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: var(--promotion-soft); color: var(--promotion-muted); font-size: 20px; cursor: pointer; }
/* 内容按自然高度排列，避免手机弹窗尺寸变化时将空白分摊给表单和按钮。 */
body.user-subsite-page.account-promotion-page .subsite-sheet-content { display: flex; flex: 0 1 auto; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto; padding: 4px 18px 20px; }
body.user-subsite-page.account-promotion-page .subsite-code-sheet .subsite-code-form { flex: 0 0 auto; grid-template-columns: minmax(0, 1fr); grid-auto-rows: max-content; align-content: start; gap: 14px; margin: 0; }
body.user-subsite-page.account-promotion-page .subsite-code-sheet .field { display: grid; grid-auto-rows: max-content; align-content: start; min-width: 0; gap: 6px; margin: 0; }
body.user-subsite-page.account-promotion-page .subsite-code-sheet :is(input, select) { box-sizing: border-box; width: 100%; min-width: 0; height: 44px; padding: 0 12px; font-size: 16px; border-color: var(--promotion-line); background: var(--promotion-soft); color: var(--promotion-ink); }
body.user-subsite-page.account-promotion-page .subsite-code-sheet .user-form-submit { height: 44px; min-height: 44px; max-height: 44px; margin: 4px 0 0; }
body.user-subsite-page.account-promotion-page .subsite-generated-codes { flex: 0 0 auto; width: 100%; max-width: 100%; min-height: 110px; max-height: 220px; font-weight: 500; }
body.user-subsite-page.account-promotion-page .subsite-code-sheet .subsite-copy-latest { flex: 0 0 44px; height: 44px; min-height: 44px; max-height: 44px; margin: 0; padding: 0 12px; }
body.user-subsite-page.account-promotion-page :is(.subsite-sheet-content .user-form-submit, .subsite-copy-latest) { border-radius: 999px; }
body.user-subsite-page.account-promotion-page.subsite-code-sheet-open { overflow: hidden; }
html.front-night body.user-subsite-page.account-promotion-page :is(.subsite-code-search-input, .subsite-code-copy) img { filter: brightness(0) invert(.85); }

@keyframes subsite-sheet-enter { from { transform: translateY(18px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { body.user-subsite-page.account-promotion-page .subsite-code-sheet[open] { animation: none; } }

body.user-invite-page.account-promotion-page #withdrawQRPlaceholder {
  color: var(--promotion-muted);
  font-size: 12px;
}

