/* VIP接码 次数制 (user page). Uses the site theme variables from styles.css (dark and light). */
/* Service picker; purchase then claim (natural-height tools, no stretched invoice);
   指定号码 full width (+86 field); 我的号码; records. Each way of paying shows one 3-step line. */
body.user-view .vipc-page { display: grid; gap: 14px; width: min(1120px, 100%); margin: 0 auto; }
.vipc-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.vipc-head .label { margin: 0 0 4px; }
.vipc-head h2 { margin: 0; font-size: 20px; line-height: 1.25; letter-spacing: -.01em; }

/* Service picker */
.vipc-services { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.vipc-service {
  position: relative;
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line-soft); background: var(--panel);
  color: var(--text); text-align: left; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.vipc-service img { width: 34px; height: 34px; border-radius: 9px; }
.vipc-service:hover { border-color: color-mix(in srgb, var(--blue) 40%, var(--line-soft)); }
.vipc-service.active { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 7%, var(--panel)); box-shadow: 0 0 0 1px var(--blue) inset; }
.vipc-service-name { min-width: 0; }
.vipc-service-compact { display: none; }
.vipc-service .vipc-hot-badge { position: absolute; top: 4px; right: 6px; min-height: 14px; padding: 0 4px; font-size: 9px; line-height: 14px; }
.vipc-service-name strong { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; font-size: 14.5px; }
.vipc-hot-badge { display: inline-flex; align-items: center; min-height: 18px; padding: 1px 6px; border: 1px solid color-mix(in srgb, var(--warning-text, #f2b84b) 38%, transparent); border-radius: 999px; color: var(--warning-text, #f2b84b); background: color-mix(in srgb, var(--warning-text, #f2b84b) 10%, transparent); font-size: 10.5px; font-style: normal; font-weight: 650; line-height: 1.35; white-space: nowrap; }
.vipc-service-name small { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.vipc-service-name small span { color: var(--muted); }
.vipc-service-count { text-align: right; line-height: 1.15; }
.vipc-service-count b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.vipc-service-count small { color: var(--muted); font-size: 11.5px; }
.vipc-service-count em { display: block; margin-top: 2px; font-style: normal; font-size: 11px; color: var(--warning-text, #f2b84b); }

/* Cards */
.vipc-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
body.user-view .panel-card.vipc-card { display: grid; gap: 14px; align-content: start; min-width: 0; padding: 18px 20px; border-radius: 16px; }
.vipc-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.vipc-card-heading { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.vipc-step { display: grid; place-items: center; flex: 0 0 26px; width: 26px; height: 26px; border-radius: 6px; background: color-mix(in srgb, var(--blue) 12%, var(--panel)); color: var(--blue); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.vipc-card-title { display: grid; gap: 2px; min-width: 0; }
.vipc-card-title strong { font-size: 15.5px; font-weight: 700; letter-spacing: -.005em; }
.vipc-card-title small { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.vipc-card-meta { flex: 0 0 auto; padding-top: 2px; color: var(--muted); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.vipc-pane-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 0 2px; }
.vipc-pane-head > strong { font-size: 15px; }
.vipc-pane-head > span { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

/* 取号 */
.vipc-counter { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr); border: 1px solid var(--line-soft); border-radius: 12px; background: var(--panel2); overflow: hidden; }
.vipc-counter > div { display: grid; align-content: end; gap: 3px; min-width: 0; padding: 12px 14px; }
.vipc-counter > div + div { border-left: 1px solid var(--line-soft); }
.vipc-counter b { font-size: 20px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.vipc-counter .vipc-counter-main b { font-size: 34px; color: var(--blue); letter-spacing: -.02em; }
.vipc-counter span { color: var(--muted); font-size: 12px; }
.vipc-batch { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.vipc-batch > span, .vipc-batch > small { color: var(--muted); font-size: 12.5px; }
.vipc-chips.vipc-seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: minmax(46px, auto); gap: 2px; padding: 3px; border-radius: 11px; background: var(--panel2); border: 1px solid var(--line-soft); }
.vipc-chips.vipc-seg button { min-width: 0; min-height: 30px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--soft, var(--text)); }
.vipc-chips.vipc-seg button.active { background: var(--blue); color: #fff; }
.vipc-chips.vipc-seg button:disabled { opacity: .55; cursor: not-allowed; }
.vipc-claim-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.vipc-claim-row.is-running { grid-template-columns: minmax(0, 1fr) auto; }
body.user-view .vipc-claim-btn { min-height: 46px; font-size: 15px; border-radius: 12px; }
body.user-view .vipc-batch-stop { min-height: 46px; border-radius: 12px; }
.vipc-hint { margin: 0; color: var(--warning-text, #f2b84b); font-size: 12.5px; }
.vipc-batch-progress { height: 4px; overflow: hidden; border-radius: 999px; background: var(--line-soft); }
.vipc-batch-progress i { display: block; height: 100%; background: var(--blue); transition: width .3s ease; }
.vipc-batch-result { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: baseline; gap: 2px 10px; padding: 8px 10px; border-radius: 10px; font-size: 12.5px; }
.vipc-batch-result.all-ok { background: color-mix(in srgb, #34c77b 10%, transparent); border: 1px solid color-mix(in srgb, #34c77b 35%, transparent); }
.vipc-batch-result.has-missing { background: var(--warning-bg); border: 1px solid var(--warning-border); }
.vipc-batch-result strong { font-variant-numeric: tabular-nums; }
.vipc-batch-result span { min-width: 0; color: var(--soft); }
.vipc-batch-result small { grid-column: 1 / 3; color: var(--muted); font-size: 11.5px; }
.vipc-batch-result .linkbtn { grid-column: 3; grid-row: 1; font-size: 12px; }

/* How a take is paid: 取号时 / 收到短信 / 没收到或放弃 (same layout for 次数 and 指定号码). */
.vipc-flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; border: 1px solid var(--line-soft); border-radius: 12px; overflow: hidden; }
.vipc-flow li { display: grid; align-content: start; gap: 3px; min-width: 0; padding: 9px 12px; }
.vipc-flow li + li { border-left: 1px solid var(--line-soft); }
.vipc-flow small { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11.5px; line-height: 1.3; }
.vipc-flow small::before { content: ""; flex: 0 0 auto; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.vipc-flow .is-hold small::before { background: var(--blue); }
.vipc-flow .is-spent small::before { background: #34c77b; }
.vipc-flow .is-back small::before { background: #f2b84b; }
.vipc-flow b { font-size: 13px; font-weight: 650; line-height: 1.35; color: var(--text); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

/* 购买次数 */
body.user-view .panel-card.vipc-buy { grid-template-rows: auto; align-content: start; }
.vipc-included { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-left: 3px solid var(--blue); background: color-mix(in srgb, var(--blue) 9%, transparent); }
.vipc-included-icon { display: flex; flex: 0 0 20px; color: var(--blue); margin-top: 2px; }
.vipc-included-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.vipc-included > div { display: grid; gap: 4px; min-width: 0; }
.vipc-included strong { font-size: 15px; line-height: 1.35; color: var(--text); }
.vipc-included span:not(.vipc-included-icon) { font-size: 13px; line-height: 1.45; color: var(--text); overflow-wrap: anywhere; }
.vipc-qty-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px; align-items: center; }
body.user-view .vipc-qty-row .input { min-height: 36px; height: 36px; padding: 4px 10px; font-variant-numeric: tabular-nums; }
.vipc-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.vipc-chips button {
  min-width: 50px; min-height: 34px; padding: 0 10px; border-radius: 9px; cursor: pointer; font-size: 13px;
  border: 1px solid var(--line-soft); background: var(--panel2); color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums;
  transition: border-color .15s ease, color .15s ease;
}
.vipc-chips button:hover { border-color: color-mix(in srgb, var(--blue) 45%, var(--line-soft)); }
.vipc-chips button.active { border-color: var(--blue); color: var(--blue); background: color-mix(in srgb, var(--blue) 8%, var(--panel2)); }
/* Compact invoice row: total and unit calculation stay together at every viewport. */
.vipc-total {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label amount" "line amount"; align-content: center; align-items: center; gap: 4px 12px;
  min-height: 64px; padding: 12px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
}
.vipc-total > span { grid-area: line; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.vipc-total > small { grid-area: label; color: var(--soft); font-size: 12.5px; }
.vipc-total strong { grid-area: amount; font-size: 24px; font-weight: 750; line-height: 1.2; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.vipc-buy-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-self: end; }
body.user-view .vipc-buy-btn { min-height: 46px; min-width: 160px; font-size: 15px; border-radius: 12px; }
.vipc-balance { margin: 0; color: var(--muted); font-size: 12.5px; }
.vipc-balance b { color: var(--text); font-variant-numeric: tabular-nums; }
.vipc-balance.low b { color: #ff7a7a; }

/* 指定号码 (full width): left = fixed +86 field, button, recent numbers; right = how it is paid. */
.vipc-specific-body { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 14px 22px; align-items: start; }
.vipc-specific-main { display: grid; gap: 10px; min-width: 0; }
.vipc-specific-price { flex: 0 0 auto; text-align: right; line-height: 1.15; }
.vipc-specific-price b { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--blue); }
.vipc-specific-price small { margin-left: 3px; color: var(--muted); font-size: 12px; }
.vipc-specific-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: stretch; }
.vipc-phone-field {
  display: flex; align-items: stretch; min-width: 0; margin: 0; overflow: hidden; cursor: text;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel2); transition: border-color .15s ease, box-shadow .15s ease;
}
.vipc-phone-field:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 18%, transparent); }
.vipc-cc {
  display: flex; align-items: center; padding: 0 12px; border-right: 1px solid var(--line-soft); user-select: none;
  color: var(--text); background: color-mix(in srgb, var(--blue) 8%, transparent); font: 700 14px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
}
body.user-view .vipc-phone-field .input {
  flex: 1 1 auto; min-width: 0; height: 44px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 0; background: transparent; box-shadow: none;
  font: 600 15px/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .04em;
}
body.user-view .vipc-phone-field .input:focus, body.user-view .vipc-phone-field .input:focus-visible { outline: none; box-shadow: none; border: 0; }
body.user-view .vipc-phone-field .input::placeholder { font-family: Inter, "Segoe UI", Arial, "Microsoft YaHei", sans-serif; font-size: 14px; letter-spacing: 0; font-weight: 400; color: var(--muted); }
body.user-view .vipc-specific-row .btn { min-height: 46px; padding-inline: 22px; border-radius: 12px; white-space: nowrap; }
.vipc-specific-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.vipc-specific-chips small { color: var(--muted); font-size: 12px; margin-right: 2px; }
.vipc-specific-chips button {
  min-height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line-soft); background: var(--panel2);
  color: var(--text); font: 600 12.5px/1 ui-monospace, SFMono-Regular, Consolas, monospace; cursor: pointer; white-space: nowrap;
}
.vipc-specific-chips button:hover { border-color: color-mix(in srgb, var(--blue) 45%, var(--line-soft)); }
.vipc-specific-chips button.active { border-color: var(--blue); color: var(--blue); }
.vipc-specific-chips button:disabled { opacity: .5; cursor: not-allowed; }
.vipc-specific-empty { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.vipc-specific-msg { margin: 0; padding: 7px 10px; border-radius: 9px; font-size: 12.5px; line-height: 1.45; }
.vipc-specific-msg.bad { color: var(--error-text); background: var(--error-bg); border: 1px solid var(--error-border); }
.vipc-specific-msg.ok { color: #34c77b; background: color-mix(in srgb, #34c77b 10%, transparent); border: 1px solid color-mix(in srgb, #34c77b 35%, transparent); }
.vipc-tag {
  display: inline-block; flex: 0 0 auto; margin-left: 6px; padding: 1px 7px; border-radius: 999px; vertical-align: 1px; white-space: nowrap;
  font-style: normal; font-size: 11px; font-weight: 600; line-height: 1.5; color: var(--blue);
  background: color-mix(in srgb, var(--blue) 12%, transparent); border: 1px solid color-mix(in srgb, var(--blue) 30%, transparent);
}

/* 指定号码 confirm */
.vipc-confirm .vipc-confirm-phone {
  margin: 2px 0 10px; padding: 12px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line-soft);
  font: 700 22px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .5px; text-align: center; overflow-wrap: anywhere;
}
.vipc-confirm .vipc-flow { margin: 12px 0 0; }
.vipc-confirm-note { margin: 8px 0 2px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.vipc-confirm .vipc-rmb { display: block; margin-top: 2px; color: var(--muted); font-size: 11.5px; font-weight: 500; }
@media (min-width: 761px) {
  .vipc-confirm .confirm-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* 我的号码 */
.vipc-active { display: grid; gap: 10px; }
.vipc-active.is-empty .compact-empty { padding: 14px; font-size: 13px; }
.vipc-numbers { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.vipc-number { display: grid; gap: 10px; align-content: start; padding: 14px 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line-soft); }
.vipc-number.is-received { border-color: color-mix(in srgb, #34c77b 45%, var(--line-soft)); }
.vipc-number.is-specific { border-color: color-mix(in srgb, var(--blue) 30%, var(--line-soft)); }
.vipc-number.is-specific.is-received { border-color: color-mix(in srgb, #34c77b 45%, var(--line-soft)); }
.vipc-number-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.vipc-number-service { display: inline-flex; flex-wrap: wrap; row-gap: 2px; align-items: center; gap: 8px; min-width: 0; font-weight: 600; }
.vipc-number-service img { border-radius: 6px; }
.vipc-number-head .pill { flex: 0 0 auto; white-space: nowrap; }
.vipc-phone { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.vipc-phone strong { font: 700 20px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .3px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.vipc-wait { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 2px 10px; padding: 10px 12px; border-radius: 10px; background: var(--panel2); }
.vipc-wait > span { color: var(--muted); font-size: 12.5px; }
.vipc-wait b { justify-self: end; font: 700 20px/1 ui-monospace, SFMono-Regular, Consolas, monospace; font-variant-numeric: tabular-nums; }
.vipc-wait small { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.vipc-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.vipc-actions.is-single { grid-template-columns: 1fr; }
.vipc-actions .vipc-check-sms { grid-column: 1 / -1; min-height: 38px; }
.vipc-actions .btn { min-width: 0; white-space: nowrap; font-variant-numeric: tabular-nums; }
.vipc-code { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; align-items: center; gap: 2px 10px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, #34c77b 12%, var(--panel2)); }
.vipc-code > span { grid-column: 1; grid-row: 1; color: var(--muted); font-size: 12px; }
.vipc-code strong { grid-column: 1; grid-row: 2; min-width: 0; font: 800 26px/1.1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: 2px; color: #34c77b; overflow-wrap: anywhere; }
.vipc-code .btn { grid-column: 2; grid-row: 1 / span 2; }
.vipc-sms { display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 10px; }
.vipc-sms p { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--panel2); color: var(--soft); font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.vipc-foot { margin: 0; color: var(--muted); font-size: 12px; }

/* SMS record (vipc4): all SMS of one number, newest first; "still receiving" countdown. */
.vipc-receiving { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 2px 10px; margin: 0; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--blue) 8%, var(--panel2)); }
.vipc-receiving span { color: var(--soft); font-size: 12.5px; }
.vipc-receiving b { justify-self: end; font: 700 15px/1 ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--blue); }
.vipc-receiving small { grid-column: 1 / -1; color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.vipc-sms-log { display: grid; gap: 4px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-soft); }
.vipc-sms-log-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.vipc-sms-log-head strong { font-size: 12.5px; }
.vipc-sms-log-head small { color: var(--muted); font-size: 11.5px; }
.vipc-sms-log-row { display: grid; grid-template-columns: 88px 70px minmax(0, 1fr) 32px; align-items: center; gap: 8px; padding: 4px 0; border-top: 1px solid var(--line-soft); font-size: 12px; }
.vipc-sms-log-row:first-of-type { border-top: 0; }
.vipc-sms-log-time { color: var(--muted); font-variant-numeric: tabular-nums; }
.vipc-sms-log-time em { font-style: normal; color: #34c77b; font-weight: 700; }
.vipc-sms-log-row b { font: 700 13px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; }
.vipc-sms-log-row.is-latest b { color: #34c77b; }
.vipc-sms-log-row p { margin: 0; color: var(--soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vipc-sms-log-row .btn { min-height: 28px; padding: 0 6px; }

/* Records */
.vipc-records { display: grid; gap: 8px; }
body.user-view .panel-card.vipc-records { padding: 14px 18px; border-radius: 16px; }
.vipc-records .compact-empty { padding: 12px; font-size: 13px; }
.vipc-records-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.vipc-record-tabs { width: auto; }
.vipc-rows { display: grid; }
.vipc-row {
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.2fr) minmax(0, .8fr) auto 40px; align-items: center; gap: 10px;
  padding: 9px 4px; border-bottom: 1px solid var(--line-soft); font-size: 13px;
}
.vipc-row:last-child { border-bottom: 0; }
.vipc-row-main strong { display: block; }
.vipc-row-main small { color: var(--muted); font-size: 12px; }
.vipc-row-phone, .vipc-row-code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.vipc-row-code { font-weight: 700; color: #34c77b; }
.vipc-row-log { grid-column: 1 / -1; justify-self: start; font-size: 12px; }
.vipc-row-msgs { padding: 0 4px 8px; }
.vipc-ledger-row { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 70px minmax(0, 1fr) 90px; }
.vipc-delta { font-weight: 700; font-variant-numeric: tabular-nums; }
.vipc-delta.up { color: #34c77b; }
.vipc-delta.down { color: var(--muted); }
.vipc-row-note { color: var(--muted); }
.vipc-row-after { text-align: right; font-variant-numeric: tabular-nums; }
.vipc-row-after small { color: var(--muted); }

/* Light theme */
html[data-theme="light"] .vipc-code strong, html[data-theme="light"] .vipc-row-code, html[data-theme="light"] .vipc-delta.up,
html[data-theme="light"] .vipc-sms-log-time em, html[data-theme="light"] .vipc-sms-log-row.is-latest b, html[data-theme="light"] .vipc-specific-msg.ok { color: #15803d; }
html[data-theme="light"] .vipc-code { background: #ecfdf3; }
html[data-theme="light"] .vipc-service-count em, html[data-theme="light"] .vipc-hint { color: #b45309; }
html[data-theme="light"] .vipc-balance.low b { color: #c62828; }
html[data-theme="light"] .vipc-flow .is-spent small::before { background: #15803d; }
html[data-theme="light"] .vipc-flow .is-back small::before { background: #d97706; }
html[data-theme="light"] .vipc-service.active { background: color-mix(in srgb, var(--blue) 6%, #fff); }

@media (max-width: 860px) {
  .vipc-grid { grid-template-columns: 1fr; }
  body.user-view .panel-card.vipc-buy { grid-template-rows: none; }
  .vipc-specific-body { grid-template-columns: 1fr; }
  .vipc-row { grid-template-columns: minmax(0, 1fr) auto 40px; }
  .vipc-row-phone, .vipc-row-code { grid-row: 2; }
  .vipc-row-phone { grid-column: 1; }
  .vipc-row-code { grid-column: 2 / -1; text-align: right; }
  .vipc-ledger-row { grid-template-columns: minmax(0, 1fr) 60px 80px; }
  .vipc-ledger-row > span:nth-child(2), .vipc-ledger-row .vipc-row-note { display: none; }
}

/* Wallet: USDT (TRC20) top-up tab */
.usdt-form { display: grid; gap: 12px; max-width: 520px; }
.usdt-order { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: start; padding: 16px; border-radius: 14px; border: 1px solid var(--line-soft); background: var(--panel2); }
.usdt-order-main { display: grid; gap: 12px; min-width: 0; }
.usdt-pay { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.usdt-pay > span { flex: 1 0 100%; color: var(--muted); font-size: 12.5px; }
.usdt-pay strong { font: 800 28px/1.1 ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--blue); }
.usdt-address { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; }
.usdt-address > span { grid-column: 1 / -1; color: var(--muted); font-size: 12.5px; }
.usdt-address code { padding: 8px 10px; border-radius: 9px; background: var(--panel); border: 1px dashed var(--line-soft); overflow-wrap: anywhere; font-size: 13px; }
.usdt-meta { margin: 0; color: var(--soft); font-size: 13px; }
.usdt-txid { display: grid; gap: 10px; }
.usdt-txid .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.usdt-waiting { display: grid; gap: 6px; padding: 12px; border-radius: 12px; border: 1px solid color-mix(in srgb, #f2b84b 45%, var(--line-soft)); }
.usdt-waiting code { overflow-wrap: anywhere; font-size: 12px; color: var(--soft); }
.usdt-waiting > span { color: var(--muted); font-size: 12.5px; }
.usdt-qr { width: 168px; height: 168px; object-fit: contain; border-radius: 12px; background: #fff; padding: 6px; border: 1px solid var(--line-soft); }
.usdt-history { margin-top: 16px; display: grid; gap: 6px; }
.usdt-history h4 { margin: 0 0 4px; font-size: 14px; }
.usdt-history-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.usdt-history-row small { color: var(--muted); text-align: right; }
@media (max-width: 640px) {
  .usdt-order { grid-template-columns: 1fr; }
  .usdt-qr { justify-self: center; }
  .usdt-history-row { grid-template-columns: 1fr auto; }
  .usdt-history-row small { grid-column: 1 / -1; text-align: left; }
}

/* Wallet tabs: five tabs (USDT added) stay on one row on desktop. */
body:not(.admin-view):not(.agent-view) .wallet-tabs { grid-template-columns: repeat(5, minmax(0, 1fr)); }
/* Wallet panel heading icons are outline icons (they rendered as filled boxes). */
body:not(.admin-view):not(.agent-view) .wallet-tab-heading > svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 900px) {
  body:not(.admin-view):not(.agent-view) .wallet-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* "USDT 充值" wraps at the space, never inside the Chinese word. */
  body:not(.admin-view):not(.agent-view) .wallet-tab-btn span { word-break: keep-all; text-align: center; }
}

/* Phones: "我的号码 N · 查看号码" jumps to the number list below the forms; services one per row;
   the three counters in one row; all five quantity chips in one row; 36px+ touch targets. */
.vipc-jump { display: none; }
#vip-credit-active { scroll-margin-top: 64px; }
@media (max-width: 860px) {
  .vipc-jump {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 42px;
    padding: 0 12px; border-radius: 10px; cursor: pointer; font: inherit; font-size: 13px; text-align: left;
    color: var(--text); background: color-mix(in srgb, #34c77b 10%, var(--panel2)); border: 1px solid color-mix(in srgb, #34c77b 35%, var(--line-soft));
  }
  .vipc-jump b { font-variant-numeric: tabular-nums; }
  .vipc-jump em { font-style: normal; font-weight: 600; color: #34c77b; }
  .vipc-jump em::after { content: " \2193"; }
  html[data-theme="light"] .vipc-jump em { color: #15803d; }
}
@media (max-width: 520px) {
  body.user-view .vipc-page { gap: 12px; }
  .vipc-head h2 { font-size: 17px; }
  .vipc-services { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .vipc-service { padding: 10px 12px; }
  body.user-view .panel-card.vipc-card { gap: 12px; padding: 14px; border-radius: 14px; }
  .vipc-counter > div { padding: 10px; }
  .vipc-counter b { font-size: 17px; }
  .vipc-counter .vipc-counter-main b { font-size: 28px; }
  .vipc-chips.vipc-seg button { min-height: 34px; padding: 0 10px; }
  .vipc-flow li { padding: 8px 9px; }
  .vipc-flow b { font-size: 12.5px; }
  .vipc-qty-row { grid-template-columns: 74px minmax(0, 1fr); gap: 6px; }
  .vipc-qty-row .vipc-chips { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  .vipc-qty-row .vipc-chips button { min-width: 0; min-height: 36px; padding: 0 2px; }
  .vipc-total { min-height: 0; }
  .vipc-total strong { font-size: 24px; }
  .vipc-buy-foot { flex-wrap: nowrap; }
  body.user-view .vipc-buy-btn { min-width: 128px; }
  .vipc-specific-price b { font-size: 18px; }
  .vipc-specific-chips button { min-height: 34px; }
  .vipc-numbers { grid-template-columns: 1fr; }
  .vipc-sms-log-row { grid-template-columns: 74px 60px minmax(0, 1fr) 30px; gap: 6px; }
  .vipc-batch-result { grid-template-columns: auto minmax(0, 1fr); }
  .vipc-batch-result .linkbtn { grid-column: 1 / -1; grid-row: auto; justify-self: start; }
  /* Number cards: long (English) button labels wrap instead of running out of the button. */
  body.user-view .vipc-actions .btn { padding-inline: 8px; line-height: 1.2; text-align: center; white-space: normal; }
  body.user-view .vipc-actions .btn span { white-space: normal; }
}
/* Very narrow phones: the +86 field full width, the button below it. */
@media (max-width: 380px) {
  .vipc-specific-row { grid-template-columns: 1fr; }
  body.user-view .vipc-specific-row .btn { width: 100%; }
}

/* Direct checkout: compact tools above a paginated order list. */
.vipc-bundle { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 8px 0; font-size: 12px; color: var(--muted); }
.vipc-bundle b { color: var(--text); font-variant-numeric: tabular-nums; }
.vipc-bundle .btn { white-space: normal; max-width: 100%; }
.vipc-rows > .vipc-bundle { border-bottom: 1px solid var(--line-soft); padding-bottom: 12px; margin-top: -4px; }
.vipc-history-search { display: flex; gap: 6px; min-width: 0; max-width: 100%; }
.vipc-history-search .input { min-width: 0; max-width: 220px; }
.vipc-history-filters { display: grid; grid-template-columns: minmax(210px,1fr) 100px minmax(200px,1.2fr); gap: 10px; align-items: end; }
.vipc-history-field { display: grid; gap: 6px; min-width: 0; font-size: 12px; color: var(--muted); }
.vipc-history-field .input { width: 100%; min-width: 0; height: 38px; min-height: 38px; padding: 6px 10px; }
.vipc-history-filters .vipc-history-search { align-items: center; }
.vipc-history-filters .vipc-history-search .input { width: 100%; max-width: none; height: 38px; min-height: 38px; }
.vipc-history-search .btn { flex: 0 0 auto; min-height: 38px; }
.vipc-history-dates { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; max-width: 480px; }
.vipc-history-dates[hidden] { display: none; }
.vipc-history-status { margin: 0; min-height: 18px; color: var(--muted); font-size: 12px; }
.vipc-records[aria-busy="true"] .vipc-records-body { opacity: .6; }
.vipc-records-head { flex-wrap: wrap; }
.vipc-page { letter-spacing: 0; }
.vipc-services { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.vipc-head h2, .vipc-card-title strong { letter-spacing: 0; }
.vipc-direct-grid .vipc-specific-body { grid-template-columns: 1fr; gap: 12px; }
.vipc-purchase-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.vipc-copy-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-block: 4px; }
.vipc-copy-toolbar label { display: flex; align-items: center; gap: 6px; margin: 0 auto 0 0; font-size: 13px; }
.vipc-copy-toolbar .input { width: auto; max-width: 180px; min-height: 36px; padding: 5px 9px; }
.vipc-number-service input, .vipc-copy-toolbar input { width: 16px; height: 16px; margin: 0; accent-color: var(--blue); flex-shrink: 0; }
.vipc-order-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; border-top: 1px solid var(--line-soft); padding-top: 10px; min-width: 0; }
.vipc-order-links small { flex-basis: 100%; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.vipc-order-links code { font-size: 11px; }
.vipc-order-links a { color: var(--blue); font-size: 12px; text-decoration: none; }
.vipc-order-links .btn { margin-left: auto; white-space: normal; }
@media (max-width: 760px) {
  .vipc-route-row { display: none; }
  .vipc-history-filters { grid-template-columns: minmax(0,1fr) 84px; }
  .vipc-history-filters .vipc-history-search { grid-column: 1 / -1; }
  .vipc-history-field .input, .vipc-history-filters .vipc-history-search .input { min-height: 44px; height: 44px; }
  .vipc-history-search .btn { min-height: 44px; }
  .vipc-services {
    grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px;
    max-height: 238px; overflow-y: auto; overscroll-behavior-y: contain;
    padding: 2px; scroll-padding: 2px; scrollbar-width: thin;
  }
  .vipc-service {
    position: relative; grid-template-columns: minmax(0, 1fr); justify-items: center;
    align-content: start; gap: 4px; min-height: 108px; min-width: 0;
    padding: 8px 5px; border-radius: 8px; text-align: center;
  }
  .vipc-service img { width: 28px; height: 28px; border-radius: 7px; }
  .vipc-service-name { width: 100%; }
  .vipc-service-name strong {
    display: flex; align-items: center; justify-content: center; min-height: 32px;
    font-size: 12px; line-height: 16px; overflow-wrap: anywhere;
  }
  .vipc-service-title { display: none; }
  .vipc-service-compact { display: block; }
  .vipc-service-name small { font-size: 11px; line-height: 16px; }
  .vipc-service-count { width: 100%; text-align: center; }
  .vipc-service-count small { display: block; font-size: 10px; line-height: 13px; }
  .vipc-service-count em { font-size: 0; margin: 0; }
  .vipc-service.active .vipc-service-count em::after {
    content: '✓'; position: absolute; bottom: 5px; right: 5px; font-size: 12px; color: var(--blue);
  }
  .vipc-direct-grid { grid-template-columns: minmax(0, 1fr); }
  .vipc-qty-row .vipc-chips { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.user-view .vipc-copy-toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vipc-copy-toolbar label { min-height: 44px; min-width: 0; margin: 0; }
  body.user-view .vipc-copy-toolbar .input { width: 100%; min-width: 0; max-width: none; min-height: 44px; }
  body.user-view .vipc-copy-toolbar .btn { width: 100%; min-width: 0; min-height: 44px; white-space: normal; }
  body.user-view .vipc-buy-btn { min-width: 130px; white-space: normal; }
}
