/* ============================================================
   v6 — credits / billing UI
   ============================================================ */

/* ---- Page head shared between v6 pages ---- */
.page-head { margin-bottom: var(--s-6); max-width: 760px; }
.page-head__title {
  font-size: 24px; font-weight: 600;
  margin: 6px 0 4px; letter-spacing: -.005em;
}
.page-head__sub { color: var(--ink-3); margin: 0; font-size: 13.5px; }
.page-head .crumb { color: var(--ink-3); transition: color .12s var(--ease); }
.page-head .crumb:hover { color: var(--accent); }

.pcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  margin-bottom: 16px;
}
.pcard__head {
  display: flex; align-items: baseline; gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}
.pcard__num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-4);
  letter-spacing: .08em;
}
.pcard__title { margin: 0; font-size: 14px; font-weight: 600; }
.pcard__body { padding: 20px; }

/* ============================================================
   PAGE: /credits — wallet dashboard
   ============================================================ */
.credits { max-width: 760px; margin: 0 auto; }
.credits__skel {
  padding: 32px;
  text-align: center;
  color: var(--ink-3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
}

.bal-card {
  position: relative;
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--accent) 96%, transparent) 0%,
      color-mix(in srgb, var(--accent) 78%, var(--ink) 22%) 100%);
  color: #fff;
  border-radius: var(--r-3);
  padding: 28px 32px;
  margin-bottom: 24px;
  overflow: hidden;
  box-shadow: 0 14px 36px rgba(15, 22, 60, .14);
}
.bal-card__main { position: relative; z-index: 2; }
.bal-card__eyebrow {
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .7;
  font-weight: 500;
}
.bal-card__amount {
  display: flex; align-items: baseline; gap: 10px;
  margin: 8px 0 6px;
  font-variant-numeric: tabular-nums;
}
.bal-card__num {
  font-size: 48px;
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1;
}
.bal-card__unit {
  font-size: 16px;
  opacity: .85;
  font-weight: 500;
}
.bal-card__sub {
  font-size: 13px;
  opacity: .82;
  margin-bottom: 22px;
}
.bal-card__sigil {
  position: absolute;
  right: -10px; top: -28px;
  font-size: 240px;
  font-weight: 600;
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", serif;
  color: rgba(255,255,255,.06);
  line-height: 1;
  pointer-events: none;
  z-index: 1;
  user-select: none;
}
.bal-card__actions {
  position: relative; z-index: 2;
  display: flex; gap: 10px; flex-wrap: wrap;
}
.bal-card__actions .btn {
  background: rgba(255,255,255,.94);
  color: var(--accent-ink);
  border-color: transparent;
}
.bal-card__actions .btn:hover { background: #fff; }
.bal-card__actions .btn--primary {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.bal-card__actions .btn--primary:hover { background: var(--ink-2); border-color: var(--ink-2); }

/* recent tx list */
.tx-recent { margin-bottom: 32px; }
.tx-recent__more {
  font-size: 12px;
  color: var(--accent) !important;
  letter-spacing: 0;
  text-transform: none;
}
.tx-recent__more:hover { text-decoration: underline; }

.tx-list { list-style: none; margin: 0; padding: 0; }
.tx-list--recent .tx-row { border-bottom: 1px solid var(--line); }
.tx-list--recent .tx-row:last-child { border-bottom: 0; }

.tx-row {
  display: flex; align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 4px;
  font-size: 13px;
  color: var(--ink-2);
}
.tx-row__time {
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  min-width: 132px;
}
.tx-row__sep { color: var(--ink-4); }
.tx-row__type {
  font-weight: 500;
  color: var(--ink);
  letter-spacing: .02em;
  min-width: 60px;
}
.tx-row__type--topup        { color: var(--ok); }
.tx-row__type--refund       { color: var(--warn); }
.tx-row__type--signup_bonus { color: var(--accent); }
.tx-row__type--consume      { color: var(--ink-2); }

.tx-row__amt {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  min-width: 110px;
}
.tx-row__amt--pos { color: var(--ok); }
.tx-row__amt--neg { color: var(--err); }

.tx-row__rel {
  color: var(--ink-3);
  display: inline-flex; align-items: center; gap: 6px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.tx-row__rel--link {
  color: var(--ink-2);
  border-bottom: 1px dashed transparent;
}
.tx-row__rel--link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* footnote */
.tx-foot {}
.tx-foot__copy {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.7;
  max-width: 640px;
}
.tx-foot__hint {
  font-size: 12px;
  color: var(--ink-4);
}

/* ============================================================
   Top-nav balance badge
   ============================================================ */
.bal-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: border-color .15s var(--ease), color .15s var(--ease), background .15s var(--ease);
  text-decoration: none;
  font-weight: 500;
  letter-spacing: .01em;
}
.bal-badge:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.bal-badge__sigil {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 600;
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  flex-shrink: 0;
}
.bal-badge:hover .bal-badge__sigil {
  background: #fff;
}
.bal-badge__num { font-weight: 600; }
.bal-badge__unit { color: var(--ink-3); font-size: 11.5px; }
.bal-badge:hover .bal-badge__unit { color: var(--accent); }
.bal-badge.is-pulse { animation: balPulse .6s var(--ease); }
@keyframes balPulse {
  0% { box-shadow: 0 0 0 0 var(--accent-soft); }
  60% { box-shadow: 0 0 0 6px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* User dropdown — credits item */
.user-dd__credits-bal {
  margin-left: auto;
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.user-dd__item:hover .user-dd__credits-bal { color: var(--accent); }

/* ============================================================
   PAGE: /credits/charge — top-up flow
   ============================================================ */
.charge { max-width: 760px; margin: 0 auto; }

.tier-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.tier {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 6px;
  padding: 18px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  cursor: pointer;
  text-align: left;
  transition: border-color .15s var(--ease), background .15s var(--ease), transform .15s var(--ease);
}
.tier:hover { border-color: var(--ink-3); background: var(--surface-2); }
.tier.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.tier__cny {
  display: flex; align-items: baseline; gap: 2px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.tier__sym { font-size: 14px; color: var(--ink-3); font-weight: 500; }
.tier__num { font-size: 26px; font-weight: 600; letter-spacing: -.01em; }
.tier__credits {
  font-size: 12.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.tier.is-active .tier__credits { color: var(--accent-ink); }
.tier__check {
  position: absolute;
  top: 10px; right: 10px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 11px; font-weight: 700;
  display: none;
  align-items: center; justify-content: center;
}
.tier.is-active .tier__check { display: inline-flex; }

.custom-wrap {
  margin-top: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-3);
  background: var(--surface-2);
}
.custom-toggle {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  background: transparent;
  border: 0;
  padding: 12px 16px;
  font-size: 13px; font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  text-align: left;
}
.custom-toggle__chev {
  display: inline-block;
  font-size: 10px; color: var(--ink-3);
  transition: transform .15s var(--ease);
}
.custom-toggle.is-open .custom-toggle__chev { transform: rotate(90deg); }
.custom-body {
  padding: 0 16px 14px;
}
.custom-label {
  display: block;
  font-size: 12px;
  color: var(--ink-3);
  margin-bottom: 6px;
  letter-spacing: .02em;
}
.custom-input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--surface);
  font: inherit; font-size: 14px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.custom-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.custom-live {
  margin-top: 8px;
  font-size: 13px;
  color: var(--ink-2);
  min-height: 18px;
}
.custom-live strong { color: var(--accent); font-weight: 600; }
.custom-live__err { color: var(--err); }

.method-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.method {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  cursor: pointer;
  text-align: left;
  position: relative;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.method:hover { border-color: var(--ink-3); background: var(--surface-2); }
.method.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.method__disc {
  width: 40px; height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.method__disc::before {
  content: '';
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: rgba(255,255,255,.7);
}
.method__disc::after {
  content: '';
  position: absolute;
  inset: 13px;
  border-radius: 50%;
  background: currentColor;
  opacity: .85;
}
.method__disc--wechat {
  background: linear-gradient(135deg, #2bb673 0%, #1f9e60 100%);
  color: #2bb673;
}
.method__disc--alipay {
  background: linear-gradient(135deg, #2c80ff 0%, #1565d8 100%);
  color: #2c80ff;
}
.method__meta { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.method__label { font-size: 14px; font-weight: 500; color: var(--ink); }
.method__sub { font-size: 12px; color: var(--ink-3); }
.method__check {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; color: transparent;
  flex-shrink: 0;
}
.method.is-active .method__check {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
}

/* Submit bar (sticky-feeling card at bottom of /credits/charge) */
.submit-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  padding: 18px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  margin-top: 20px;
}
.submit-bar__summary {
  display: flex; flex-direction: column; gap: 2px;
}
.submit-bar__line {
  display: flex; align-items: baseline; gap: 12px;
  font-size: 13px;
}
.submit-bar__lab {
  color: var(--ink-3);
  font-size: 12px;
  letter-spacing: .04em;
  min-width: 56px;
}
.submit-bar__cny {
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}
.submit-bar__credits {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.submit-bar__line--sub .submit-bar__cny { font-size: 13px; }
.submit-bar__btn { min-width: 160px; }

/* ---- Pay modal --------------------------------------------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(15, 18, 25, .42);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadein .15s var(--ease);
}
.modal {
  background: var(--surface);
  border-radius: var(--r-3);
  box-shadow: 0 24px 64px rgba(15, 22, 60, .22);
  max-width: 100%;
  animation: rise .2s var(--ease);
}
.modal--pay {
  width: min(420px, calc(100vw - 32px));
  padding: 0;
  overflow: hidden;
}
.pay-modal__body {
  padding: 22px 28px 24px;
  display: flex; flex-direction: column;
  align-items: stretch;
  gap: 14px;
}
.pay-modal__summary {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px;
}
.pay-modal__amt {
  display: flex; align-items: baseline;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.pay-modal__amt-sym { font-size: 18px; color: var(--ink-3); }
.pay-modal__amt-num { font-size: 36px; font-weight: 600; letter-spacing: -.01em; }
.pay-modal__credits {
  font-size: 12.5px;
  color: var(--ink-3);
}
.pay-modal__qr {
  width: 200px; height: 200px;
  align-self: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: 12px 12px 28px;
  position: relative;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink);
}
.pay-modal__qr-img {
  width: 100%; height: 100%;
  display: block;
}
.pay-modal__qr.is-loading::after {
  content: '';
  position: absolute; inset: 16px;
  border: 2px solid var(--bg-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .9s linear infinite;
  width: 26px; height: 26px;
  margin: auto;
}
.pay-modal__qr-skel {
  width: 70%; height: 70%;
  background:
    repeating-linear-gradient(45deg, var(--bg-soft) 0 6px, var(--surface-2) 6px 12px);
  border-radius: var(--r-2);
  font-size: 11px;
  color: var(--ink-4);
  display: flex; align-items: center; justify-content: center;
}
.pay-modal__qr-ribbon {
  position: absolute;
  bottom: 6px; left: 12px; right: 12px;
  text-align: center;
  font-size: 10.5px;
  letter-spacing: .04em;
  color: var(--ink-3);
}
.pay-modal__qr--wechat {
  border-color: color-mix(in srgb, #2bb673 30%, var(--line));
}
.pay-modal__qr--wechat .pay-modal__qr-ribbon { color: #1f9e60; }
.pay-modal__qr--alipay {
  border-color: color-mix(in srgb, #2c80ff 30%, var(--line));
}
.pay-modal__qr--alipay .pay-modal__qr-ribbon { color: #1565d8; }

.pay-modal__qr.is-pulse::before {
  content: '';
  position: absolute; inset: -1px;
  border-radius: var(--r-3);
  border: 2px solid var(--accent);
  opacity: 0;
  animation: qrPulse 1.6s ease-in-out infinite;
}
@keyframes qrPulse {
  0%   { opacity: .55; transform: scale(.99); }
  60%  { opacity: 0;   transform: scale(1.04); }
  100% { opacity: 0;   transform: scale(1.04); }
}

.pay-modal__order {
  text-align: center;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-4);
  letter-spacing: .04em;
}
.pay-modal__status {
  align-self: center;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
}
.pay-modal__status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.pay-modal__status--pending {
  background: var(--bg-soft); color: var(--ink-3);
}
.pay-modal__status--pending .pay-modal__status-dot { animation: dotPulse 1.2s ease-in-out infinite; }
.pay-modal__status--scanned {
  background: var(--accent-soft); color: var(--accent-ink);
}
.pay-modal__status--paid {
  background: var(--ok-soft); color: var(--ok);
}
.pay-modal__status--failed {
  background: var(--err-soft); color: var(--err);
}
.pay-modal__note {
  text-align: center;
  font-size: 12px;
  color: var(--ink-4);
}
.pay-modal__actions {
  display: flex; justify-content: center;
  margin-top: 4px;
}

.modal--pay.pay-modal--paid .pay-modal__qr {
  border-color: var(--ok);
}
.modal--pay.pay-modal--paid .pay-modal__qr-img {
  filter: grayscale(.4) opacity(.5);
}
.modal--pay.pay-modal--paid .pay-modal__qr::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 48px;
  font-weight: 700;
  color: var(--ok);
  background: rgba(255,255,255,.85);
  border-radius: var(--r-3);
  animation: rise .25s var(--ease);
}

/* ============================================================
   PAGE: /credits/history — transaction log
   ============================================================ */
.history { max-width: 1080px; margin: 0 auto; }

.flt {
  display: flex; flex-wrap: wrap; align-items: flex-end;
  gap: 14px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  margin-bottom: 16px;
}
.flt__field { display: flex; flex-direction: column; gap: 6px; }
.flt__lab {
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
}
.flt__sel,
.flt__date,
.flt__q {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--surface);
  font: inherit; font-size: 13px;
  color: var(--ink);
}
.flt__sel { min-width: 120px; padding-right: 26px; cursor: pointer; }
.flt__q { min-width: 240px; }
.flt__sel:focus,
.flt__date:focus,
.flt__q:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.flt__range { display: flex; align-items: center; gap: 6px; }
.flt__rng-sep { color: var(--ink-4); }
.flt__reset { margin-left: auto; align-self: flex-end; }

/* Table */
.tx-table-host { position: relative; }
.tx-table-host.is-loading { opacity: .55; }
.tx-table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  overflow: hidden;
}
.tx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tx-th {
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 12px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.tx-th--time { width: 152px; }
.tx-th--type { width: 100px; }
.tx-th--amt  { width: 140px; }
.tx-th--bal  { width: 110px; text-align: right; }
.tx-tr { transition: background .12s var(--ease); }
.tx-tr:hover { background: var(--surface-2); }
.tx-td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  color: var(--ink-2);
}
.tx-tr:last-child .tx-td { border-bottom: 0; }
.tx-td--time {
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  white-space: nowrap;
}
.tx-td--bal {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  font-weight: 500;
}
.tx-td__amt {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.tx-td__amt--pos { color: var(--ok); }
.tx-td__amt--neg { color: var(--err); }

.tx-badge {
  display: inline-flex; align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .02em;
  border: 1px solid transparent;
}
.tx-badge--topup        { background: var(--ok-soft);     color: var(--ok); }
.tx-badge--consume      { background: var(--bg-soft);     color: var(--ink-2); border-color: var(--line); }
.tx-badge--refund       { background: var(--warn-soft);   color: var(--warn); }
.tx-badge--signup_bonus { background: var(--accent-soft); color: var(--accent-ink); }

.tx-rel {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--ink-2);
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tx-rel--link {
  border-bottom: 1px dashed transparent;
  cursor: pointer;
}
.tx-rel--link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.tx-rel--text { color: var(--ink-3); }

/* payment dot — used in row "关联" cells */
.pay-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}
.pay-dot--wechat { background: #2bb673; box-shadow: 0 0 0 2px color-mix(in srgb, #2bb673 22%, transparent); }
.pay-dot--alipay { background: #2c80ff; box-shadow: 0 0 0 2px color-mix(in srgb, #2c80ff 22%, transparent); }

/* Pager */
.pager { margin-top: 16px; }
.pager__row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.pager__inner { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pager__btn,
.pager__num {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: 6px 12px;
  font-size: 12.5px;
  cursor: pointer;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  transition: border-color .12s var(--ease), color .12s var(--ease);
}
.pager__num { min-width: 32px; padding: 6px 10px; }
.pager__btn:hover,
.pager__num:hover { border-color: var(--accent); color: var(--accent); }
.pager__btn:disabled {
  opacity: .4; cursor: not-allowed;
}
.pager__btn:disabled:hover { border-color: var(--line); color: var(--ink-2); }
.pager__num.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.pager__num.is-active:hover { color: #fff; }
.pager__gap { color: var(--ink-4); padding: 0 4px; }
.pager__meta { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ============================================================
   Cost preview + insufficient-balance gate
   ============================================================ */
.cost-preview {
  margin-top: 16px;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  border-radius: var(--r-3);
  font-size: 13px;
  color: var(--accent-ink);
  animation: fadein .25s var(--ease);
}
.cost-preview__sigil {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600;
  font-size: 12px;
  flex-shrink: 0;
}
.cost-preview__credits { font-weight: 600; font-variant-numeric: tabular-nums; }
.cost-preview__sub { color: var(--ink-3); font-size: 12px; margin-left: auto; }

/* Company-info fill (Phase 1) — company-profile picker in the confirm
   card (below the cost line, above 开始生成 / 取消). Mirrors the
   公司资料-confirm.html spec: a custom dropdown (pf-dd) with avatar +
   name + meta, a popup listbox, and full keyboard nav. */
/* Constrain the confirm content (cost line + 公司资料 picker) to a
   centered column; the dropzone's pink panel stays full-width behind it. */
.confirm { max-width: 600px; margin: 0 auto; }
.confirm__cta { margin-top: 18px; }

/* 已上传 file head — icon inline next to the title (not a stacked block),
   so the top gap to the title equals the bottom gap below the CTA. */
.dropzone__filehead {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: var(--s-2);
}
.dropzone__filehead .dropzone__title { margin: 0; }
.dropzone__fileicon {
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  flex-shrink: 0;
}
.dropzone__fileicon svg { width: 20px; height: 20px; }

.confirm-field {
  margin-top: 14px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  text-align: left;
  animation: fadein .25s var(--ease);
}
.confirm-field__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.confirm-field__label { font-size: 14px; font-weight: 600; color: var(--ink); }
.confirm-field__help {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.6;
}

/* ── custom dropdown ─────────────────────────────────────────────── */
.pf-dd { position: relative; }
.pf-dd__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  cursor: pointer;
  text-align: left;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.pf-dd__trigger:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.pf-dd.is-open .pf-dd__trigger {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.pf-dd__current { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.pf-dd__chev {
  display: inline-flex;
  color: var(--ink-3);
  flex-shrink: 0;
  transition: transform .18s var(--ease);
}
.pf-dd.is-open .pf-dd__chev { transform: rotate(90deg); }

.pf-dd__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}
.pf-dd__avatar--ghost {
  background: transparent;
  border: 1px dashed var(--line-strong);
  color: var(--ink-3);
}
.pf-dd__avatar--ghost svg { width: 16px; height: 16px; }
.pf-dd__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pf-dd__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pf-dd__name--muted { color: var(--ink-2); font-weight: 500; }
.pf-dd__meta {
  font-size: 12px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pf-dd__menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .14);
  padding: 6px;
  display: none;
  max-height: 320px;
  overflow-y: auto;
}
.pf-dd.is-open .pf-dd__menu { display: block; animation: fadein .14s var(--ease); }
.pf-dd__group {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-4);
  letter-spacing: .03em;
  padding: 6px 10px 4px;
}
.pf-dd__opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-2);
  cursor: pointer;
  transition: background .12s var(--ease);
}
.pf-dd__opt:hover, .pf-dd__opt:focus {
  background: var(--bg-soft);
  outline: none;
}
.pf-dd__opt.is-active { background: var(--accent-soft); }
.pf-dd__check {
  margin-left: auto;
  color: var(--accent);
  display: inline-flex;
  flex-shrink: 0;
}
.pf-dd__check svg { width: 16px; height: 16px; }
.pf-dd__sep { height: 1px; background: var(--line); margin: 6px 8px; }
.pf-dd__create {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 10px;
  border-radius: var(--r-2);
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}
.pf-dd__create:hover { background: var(--accent-soft); }
.pf-dd__create svg { width: 15px; height: 15px; flex-shrink: 0; }

.modal--gate {
  width: min(420px, calc(100vw - 32px));
  padding: 24px 28px;
}
.gate__title {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}
.gate__body {
  margin: 0 0 18px;
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.7;
}
.gate__body strong { color: var(--ink); font-weight: 600; }
.gate__body .gate__cost { color: var(--err); font-weight: 600; }
.gate__numbers {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin: 0 0 18px;
}
.gate__num {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: 10px 12px;
  text-align: center;
}
.gate__num-lab { font-size: 11px; color: var(--ink-3); margin-bottom: 4px; letter-spacing: .04em; }
.gate__num-val {
  font-size: 18px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.gate__num--cost .gate__num-val { color: var(--ink); }
.gate__num--bal .gate__num-val { color: var(--ink); }
.gate__num--need .gate__num-val { color: var(--err); }

.gate__actions {
  display: flex; gap: 10px; justify-content: flex-end;
}

/* ============================================================
   Job page — credit-deducted line + consumed strip
   ============================================================ */
.proc-credit {
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 6px;
}
.proc-credit__sigil {
  display: inline-block;
  margin-right: 4px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 10px; font-weight: 600;
  text-align: center; line-height: 14px;
  vertical-align: -2px;
}

.detail-credit {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--ink-3);
}

/* C-3: consolidated processing card — 总体进度 + 进度条 + 已运行/预计总耗时
   meta + 预扣积分 + 取消 button, all in one .card instead of scattered. */
.processing-card { margin-top: var(--s-3); padding: 20px 24px; }
.processing-card__header {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 10px;
}
.processing-card__meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 12px;
  font-size: 13px; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.processing-card__meta .sep { color: var(--ink-4); }
.processing-card__meta .proc-eta { color: var(--ink-2); }
.processing-card__credits { margin-top: 12px; }
.processing-card__actions { display: flex; justify-content: flex-end; margin-top: 16px; }

/* ============================================================
   Processing page — stage line + tip card
   ============================================================ */
.proc-stage {
  display: flex; align-items: center; gap: 10px;
  margin: 14px 0 6px;
  font-size: 14px;
  color: var(--ink-2);
}
.proc-stage__pulse {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(0, 102, 204, 0.55);
  animation: procStagePulse 1.6s ease-out infinite;
}
.proc-stage__label { color: var(--ink); font-weight: 500; }
@keyframes procStagePulse {
  0%   { box-shadow: 0 0 0 0   rgba(0, 102, 204, 0.55); }
  70%  { box-shadow: 0 0 0 10px rgba(0, 102, 204, 0);   }
  100% { box-shadow: 0 0 0 0   rgba(0, 102, 204, 0);   }
}

.progress.is-failed, .processing-card.is-failed { opacity: 0.55; }
.progress.is-failed .progress__fill,
.processing-card.is-failed .progress__fill { background: var(--err); }

.proc-tip {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  margin-top: 16px;
  transition: opacity 0.2s ease;
  opacity: 1;
}
.proc-tip.is-fading { opacity: 0; }
.proc-tip__icon {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  display: inline-flex; align-items: center; justify-content: center;
}
.proc-tip__icon svg { width: 16px; height: 16px; }
.proc-tip__body { flex: 1 1 auto; min-width: 0; }
.proc-tip__title {
  font-size: 14px; font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
}
.proc-tip__text {
  font-size: 13px; line-height: 1.55;
  color: var(--ink-2);
}
.proc-tip--err .proc-tip__icon {
  background: rgba(220, 76, 76, 0.12);
  color: var(--err);
}
@media (max-width: 480px) {
  .proc-tip { padding: 12px 14px; }
  .proc-tip__title { font-size: 13.5px; }
  .proc-tip__text  { font-size: 12.5px; }
}

/* ============================================================
   /account — balance section
   ============================================================ */
.acc-bal-row {
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
}
.acc-bal-row__main { display: flex; flex-direction: column; gap: 2px; }
.acc-bal-row__amt {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.acc-bal-row__amt-unit {
  font-size: 13px;
  color: var(--ink-3);
  font-weight: 500;
  margin-left: 4px;
}
.acc-bal-row__sub {
  font-size: 12px;
  color: var(--ink-3);
}
.acc-bal-row__sub a { color: var(--accent); }
.acc-bal-row__sub a:hover { text-decoration: underline; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 720px) {
  .bal-card { padding: 22px 22px; }
  .bal-card__num { font-size: 38px; }
  .bal-card__sigil { font-size: 180px; right: -20px; }
  .tier-grid { grid-template-columns: repeat(2, 1fr); }
  .method-grid { grid-template-columns: 1fr; }
  .submit-bar { flex-direction: column; align-items: stretch; gap: 12px; }
  .submit-bar__btn { width: 100%; }
  .flt { gap: 10px; }
  .flt__q { min-width: 0; width: 100%; }
  .flt__field { flex: 1 1 100%; }
  .flt__reset { width: 100%; }

  .tx-table { display: block; }
  .tx-table thead { display: none; }
  .tx-table tbody, .tx-table tr, .tx-table td { display: block; width: auto; }
  .tx-tr {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    display: grid !important;
    grid-template-columns: 1fr auto;
    gap: 4px 12px;
  }
  .tx-tr:last-child { border-bottom: 0; }
  .tx-td {
    padding: 0;
    border-bottom: 0;
  }
  .tx-td--time { grid-column: 1; color: var(--ink-3); font-size: 12px; }
  .tx-td--bal  { grid-column: 2; text-align: right; font-size: 12px; color: var(--ink-3); font-weight: 500; }
  .tx-td:nth-child(2) { grid-column: 1; }
  .tx-td:nth-child(3) { grid-column: 2; text-align: right; }
  .tx-td:nth-child(4) {
    grid-column: 1 / -1;
    color: var(--ink-3);
    font-size: 12.5px;
    overflow: hidden; text-overflow: ellipsis;
  }

  /* Top-nav badge collapses to icon-only on narrow viewports */
  .bal-badge { padding: 4px 6px; }
  .bal-badge__num,
  .bal-badge__unit { display: none; }
}

/* ============================================================
   Tweaks panel — credits dev controls
   ============================================================ */
.tweak-credit-row {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
}
.tweak-credit-input {
  flex: 1;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  background: var(--surface);
  font: inherit; font-size: 12px;
  font-variant-numeric: tabular-nums;
}
