:root {
  color-scheme: dark;
  --page: #0a0b0d;
  --panel: #171819;
  --panel-2: #1f2022;
  --panel-3: #25272a;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.22);
  --text: #f4f5f6;
  --muted: #a8adb4;
  --faint: #747b84;
  --accent: #159bff;
  --accent-soft: rgba(21, 155, 255, 0.14);
  --success: #58d68d;
  --danger: #ff6b6b;
  font-family: Inter, "MiSans", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--page);
  color: var(--text);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
  background: var(--page);
  scroll-behavior: smooth;
}

body {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  background: var(--page);
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.wallet-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 50px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 0 max(24px, calc((100vw - 1440px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(7, 8, 10, 0.96);
  backdrop-filter: blur(16px);
}

.wallet-brand,
.wallet-nav,
.wallet-user,
.invoice-strip,
.invoice-strip > div,
.panel-title,
.custom-row,
.payment-method,
.coupon-row,
.recharge-actions {
  display: flex;
  align-items: center;
}

.wallet-brand {
  gap: 9px;
  font-size: 15px;
  font-weight: 850;
}

.wallet-brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.wallet-nav {
  justify-content: center;
  gap: 28px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.wallet-nav a:hover,
.wallet-back:hover {
  color: var(--text);
}

.wallet-user {
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.wallet-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #25263f;
  color: #f4f5ff;
  font-family: "Arial Narrow", "Roboto Condensed", Inter, Arial, system-ui, sans-serif;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  transform: scaleX(0.84) scaleY(1.05);
}

.wallet-page {
  width: min(1280px, calc(100vw - 88px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.wallet-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.wallet-kicker {
  margin: 0 0 6px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wallet-hero h1 {
  margin: 0;
  font-size: 23px;
  line-height: 1.1;
  letter-spacing: 0;
}

.wallet-back,
.invoice-strip button,
.panel-ghost,
.coupon-row button,
.primary-action,
.secondary-action,
.wallet-plan button {
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  cursor: pointer;
  font-weight: 850;
}

.wallet-back {
  padding: 8px 14px;
  font-size: 13px;
  color: var(--muted);
  background: #121315;
}

.notice-bar {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #191a1c;
  color: var(--muted);
}

.notice-bar p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
}

.notice-icon {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--text);
  font-size: 11px;
  font-weight: 900;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #111214;
}

.stat-card {
  min-height: 96px;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 15px 18px;
  border-right: 1px solid var(--line);
}

.stat-card:last-child {
  border-right: 0;
}

.stat-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stat-card strong {
  font-size: 24px;
  line-height: 1;
}

.stat-card small {
  color: var(--faint);
  font-size: 12px;
}

.invoice-strip {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #121315;
}

.invoice-strip > div {
  gap: 12px;
}

.strip-icon,
.panel-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #202226;
  color: #e8eaee;
  font-size: 12px;
  font-weight: 900;
}

.invoice-strip strong {
  display: block;
  font-size: 15px;
}

.invoice-strip p,
.panel-title p,
.wallet-plan p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.invoice-strip button {
  min-height: 36px;
  padding: 0 15px;
  font-size: 13px;
  background: #f1f3f5;
  color: #141517;
}

.invoice-strip button:disabled {
  cursor: not-allowed;
  opacity: 0.8;
}

.wallet-panel {
  overflow: hidden;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
}

.panel-title {
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.panel-title h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.15;
}

.panel-title .panel-ghost {
  margin-left: auto;
}

.panel-ghost {
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
  background: #202225;
  color: var(--text);
}

.panel-body {
  padding: 20px;
}

.field-label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.amount-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.amount-card {
  position: relative;
  min-height: 106px;
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--panel-3);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.amount-card:hover,
.amount-card.active {
  border-color: rgba(21, 155, 255, 0.82);
  background: #292b2f;
  box-shadow: inset 0 0 0 1px rgba(21, 155, 255, 0.22);
}

.amount-card span,
.amount-card small,
.amount-card em {
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

.amount-card strong {
  font-size: 24px;
  line-height: 1;
}

.amount-card em {
  position: absolute;
  right: 14px;
  top: 14px;
  padding: 5px 11px;
  border-radius: 999px;
  background: #f4f5f6;
  color: #111214;
  font-size: 12px;
}

.custom-row {
  gap: 10px;
  margin-top: 22px;
}

.custom-row label,
.coupon-row label {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.custom-row input,
.coupon-row input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #282a2e;
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

.custom-row input:focus,
.coupon-row input:focus {
  border-color: rgba(21, 155, 255, 0.78);
}

.payable-box {
  width: 204px;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  align-self: end;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #202225;
  color: var(--muted);
  font-size: 12px;
}

.payable-box strong {
  color: var(--text);
  font-size: 14px;
}

.payment-block {
  margin-top: 22px;
}

.payment-method {
  width: min(460px, 100%);
  min-height: 38px;
  gap: 9px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #282a2e;
  color: var(--text);
  cursor: pointer;
}

.alipay-mark {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #0878ff;
  color: white;
  font-size: 13px;
  font-weight: 900;
}

.coupon-row {
  gap: 9px;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.coupon-row button {
  align-self: end;
  min-height: 38px;
  padding: 0 16px;
  font-size: 13px;
  background: #2a2d31;
  color: var(--text);
}

.recharge-actions {
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.primary-action,
.secondary-action,
.wallet-plan button {
  min-height: 38px;
  padding: 0 16px;
  font-size: 13px;
}

.primary-action {
  border-color: transparent;
  background: #f3f5f7;
  color: #111315;
}

.secondary-action {
  background: #22252a;
  color: var(--text);
}

.primary-action:disabled,
.secondary-action:disabled,
.wallet-plan button:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 20px;
}

.wallet-plan {
  min-height: 310px;
  display: grid;
  align-content: start;
  gap: 15px;
  padding: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: #1b1d20;
}

.wallet-plan[hidden] {
  display: none !important;
}

.wallet-plan.starter {
  border-color: rgba(88, 214, 141, 0.34);
}

.wallet-plan.recommended {
  border-color: rgba(21, 155, 255, 0.54);
  background: linear-gradient(180deg, #20262d, #1a1c20);
}

.wallet-plan.premium {
  border-color: rgba(255, 216, 105, 0.36);
}

.wallet-plan span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.wallet-plan h3 {
  margin: 8px 0 0;
  font-size: 21px;
}

.wallet-plan > strong {
  font-size: 29px;
  line-height: 1;
}

.wallet-plan > strong::after {
  content: "/ 月";
  margin-left: 8px;
  color: var(--muted);
  font-size: 12px;
}

.wallet-plan.starter > strong::after {
  content: "";
}

.wallet-plan ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  color: #d7dbe0;
  font-size: 13px;
  list-style: none;
}

.wallet-plan li::before {
  content: "✓";
  margin-right: 8px;
  color: var(--success);
}

.wallet-plan button {
  margin-top: auto;
  background: #f4f5f6;
  color: #111214;
}

.order-table {
  padding: 0 20px 20px;
}

.order-head,
.order-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.35fr) 0.8fr 0.7fr 0.75fr 0.85fr 0.8fr;
  gap: 12px;
  align-items: center;
}

.order-head {
  min-height: 36px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 900;
}

.order-row {
  min-height: 46px;
  border-top: 1px solid var(--line);
  color: #d9dde2;
  font-size: 13px;
}

.order-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.order-status {
  width: max-content;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(88, 214, 141, 0.13);
  color: var(--success);
  font-size: 12px;
  font-weight: 900;
}

.order-status.pending {
  background: rgba(21, 155, 255, 0.14);
  color: #69bdff;
}

.order-status.expired {
  background: rgba(255, 107, 107, 0.13);
  color: var(--danger);
}

.order-pay-link {
  width: max-content;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid rgba(21, 155, 255, 0.42);
  border-radius: 999px;
  background: rgba(21, 155, 255, 0.12);
  color: #8dccff;
  font-size: 12px;
  font-weight: 900;
}

.order-pay-link:hover {
  border-color: rgba(21, 155, 255, 0.72);
  color: #d6ecff;
}

.order-action-muted {
  color: var(--faint);
  font-size: 12px;
  font-weight: 800;
}

.empty-orders {
  padding: 18px 0 2px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 13px;
}

.wallet-toast {
  position: fixed;
  right: 24px;
  top: 78px;
  z-index: 80;
  max-width: min(360px, calc(100vw - 32px));
  padding: 12px 14px;
  border: 1px solid rgba(21, 155, 255, 0.34);
  border-radius: 12px;
  background: #15181c;
  color: var(--text);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.48);
  font-size: 13px;
  font-weight: 800;
}

.wallet-toast[hidden] {
  display: none !important;
}

@media (max-width: 980px) {
  .wallet-header {
    grid-template-columns: 1fr auto;
  }

  .wallet-nav {
    display: none;
  }

  .wallet-page {
    width: min(100vw - 28px, 720px);
    padding-top: 24px;
  }

  .stats-grid,
  .amount-grid,
  .plan-grid {
    grid-template-columns: 1fr;
  }

  .stat-card {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .stat-card:last-child {
    border-bottom: 0;
  }

  .custom-row,
  .coupon-row,
  .recharge-actions,
  .wallet-hero,
  .invoice-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .payable-box {
    width: 100%;
  }

  .order-head {
    display: none;
  }

  .order-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 14px 0;
  }
}

@media (max-width: 560px) {
  .wallet-header {
    padding: 0 14px;
  }

  .wallet-user span {
    display: none;
  }

  .panel-title {
    align-items: flex-start;
  }

  .panel-title .panel-ghost {
    display: none;
  }
}
