:root {
  color-scheme: light;
  font-family: Inter, "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  color: #121212;
  background: #f7f8fd;
  font-size: 14px;
  --accent: #5557f7;
  --accent-hover: #4547e0;
  --muted: #626977;
  --line: #e9eaf3;
  --surface: #f6f5fc;
  --danger: #d7274f;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100dvh;
  background:
    linear-gradient(90deg, transparent 30%, #e2eeff4d 100%),
    linear-gradient(180deg, #f8f9fd 0%, #e7e8fd 100%);
}

button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
a { color: inherit; }
img { display: block; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }

.page-header {
  height: 91px;
  background: #fff;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 12px 32px;
}
.page-header::after {
  content: "";
  position: absolute;
  inset: 40px 0 auto;
  border-top: 1px solid #e5e5eb;
}
.header-note { color: #6b7184; font-size: 12px; display: flex; align-items: center; gap: 6px; }
.header-note span { width: 6px; height: 6px; background: #6d6bf8; border-radius: 50%; }

.workspace {
  max-width: 912px;
  margin: 0 auto;
  padding: 10px 0 50px;
  display: grid;
  grid-template-columns: 204px minmax(0, 700px);
  gap: 8px;
}
@media (min-width: 1150px) { .workspace { transform: translateX(70px); } }
.sidebar { padding-top: 14px; }
.nav-label {
  margin: 0 0 15px;
  padding-left: 24px;
  font-size: 13px;
  color: #686e81;
}
.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  height: 42px;
  margin: 0 0 6px;
  padding: 0 20px 0 40px;
  border-radius: 23px;
  text-decoration: none;
  white-space: nowrap;
}
.nav-link img { width: 18px; height: 18px; }
.nav-link:hover { background: #e4e7fc; }
.nav-link[aria-current="page"] { background: #d0d6f9; }
.nav-link + .nav-label { margin-top: 14px; }
.settings-link::after {
  content: "";
  position: absolute;
  right: 0;
  width: 8px;
  height: 8px;
  background: #f36166;
  border-radius: 50%;
}

.panel {
  min-height: 857px;
  padding: 20px 32px 35px;
  border-radius: 20px;
  background: #fff;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 32px;
  margin-bottom: 20px;
}
h1 { font-size: 20px; line-height: 1.4; font-weight: 750; }
h2 { font-size: 17px; line-height: 1.4; }
.actions, .tabs { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.tabs { margin: 0 0 20px 3px; }
.button, .tab {
  min-height: 33px;
  border: 0;
  border-radius: 5px;
  padding: 6px 15px;
  background: transparent;
  color: inherit;
}
.button:hover, .tab:hover { background: #f0f0f8; }
.button:disabled { opacity: .56; }
.button-primary { background: var(--accent); color: #fff; }
.button-primary:hover { background: var(--accent-hover); }
.button-dark { background: #121212; color: #fff; border-radius: 20px; min-width: 80px; }
.button-dark:hover { background: #333; }
.button-dark:disabled { opacity: 1; background: #121212; }
.button-outline { border: 1px solid #dedfed; }
.tab { min-width: 86px; border-radius: 18px; }
.tab[aria-pressed="true"] { background: var(--accent); color: white; box-shadow: 0 2px 4px #5153c420; }

.card-shelf {
  min-height: 180px;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 35px;
}
.new-card {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 7px;
  flex: 0 0 67px;
  border: 0;
  border-radius: 13px;
  background: #f5f5f5;
  color: var(--accent);
  font-size: 12px;
}
.new-card:hover { background: #eeedff; }
.new-card::before {
  content: "+";
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  font-size: 15px;
  line-height: 1;
  border: 1px solid currentColor;
  border-radius: 50%;
}
.credit-card {
  width: min(266px, calc(100% - 74px));
  height: 166px;
  position: relative;
  overflow: hidden;
  border: 1px solid #dce2f1;
  border-radius: 10px;
  color: #090b0c;
  font-size: 13px;
  font-weight: 700;
  background: #f0f4fa;
}
.card-face {
  display: block;
  height: 124px;
  width: 100%;
  text-align: left;
  border: 0;
  padding: 15px 10px;
  background:
    radial-gradient(ellipse at 41% -11%, #c4a1ec 2%, #d3c2ef55 37%, transparent 52%),
    radial-gradient(ellipse at 68% 47%, #b5eff8, transparent 49%),
    radial-gradient(ellipse at 77% 107%, #c1e3e4, transparent 36%),
    #eef3f9;
  color: inherit;
}
.card-face:focus-visible { outline-offset: -3px; }
.card-face span { display: block; }
.card-name { max-width: min(118px, 60%); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-number { margin-top: 6px; letter-spacing: .3px; }
.card-balance { margin-top: 13px; font-size: 21px; }
.card-brand { position: absolute; top: 26px; right: 18px; width: 37px; height: 23px; pointer-events: none; }
.card-brand::before, .card-brand::after {
  content: "";
  position: absolute;
  top: 0;
  width: 23px;
  height: 23px;
  border-radius: 50%;
}
.card-brand::before { left: 0; background: #eb143c; }
.card-brand::after { right: 0; background: #ffae0c; mix-blend-mode: multiply; }
.card-brand span { position: absolute; z-index: 1; inset: 7px 0 auto; color: white; text-align: center; font-size: 5.7px; letter-spacing: -.25px; }
.card-meta { height: 40px; display: flex; align-items: center; gap: 9px; padding: 0 10px; background: #fff; }
.card-meta .cvv { color: var(--accent); }
.expiry-label { font-size: 7px; font-weight: 500; line-height: 1; margin-left: clamp(6px, 4vw, 56px); }
.rename { position: absolute; inset: 16px auto auto 117px; }
.icon-button {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: transparent;
}
.icon-button:hover { background: #eaeaf4; }
.icon-button img { width: 15px; height: 15px; }
.rename img { width: 12px; height: 12px; }

.empty-state, .card-detail {
  min-height: 480px;
  border-radius: 18px;
  background: var(--surface);
}
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 22px;
}
.empty-state .info-icon {
  position: relative;
  width: 69px;
  height: 69px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  margin: 0 0 20px;
  background: #1d80eb;
  color: #fff;
}
.info-icon::before, .info-icon::after {
  content: "";
  position: absolute;
  inset-inline-start: 46%;
  width: 8%;
  border-radius: 999px;
  background: currentColor;
}
.info-icon::before { inset-block-start: 20%; aspect-ratio: 1; }
.info-icon::after { inset-block-start: 39%; height: 41%; }
.empty-state h2 { font-size: 32px; font-weight: 450; line-height: 1.35; }
.empty-state p { margin-top: 8px; font-size: 13px; }
.empty-state .button { margin-top: 25px; }
.card-detail { padding: 25px; }
.card-detail .detail-empty { margin-top: 25px; color: var(--muted); }

.wallet-summary {
  border: 1px solid #e8e9f9;
  border-radius: 16px;
  background: linear-gradient(120deg, #f7f5ff, #eff9fd);
  padding: 28px 22px 24px;
  text-align: center;
  margin-bottom: 29px;
}
.wallet-summary .total-label { color: var(--muted); font-weight: 500; }
.wallet-total {
  margin: 4px 0 17px;
  font-size: 42px;
  font-weight: 750;
  letter-spacing: -1.5px;
  font-variant-numeric: tabular-nums;
}
.wallet-summary .button { min-width: 82px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 13px; }
.section-heading a { color: var(--accent); font-size: 13px; text-decoration: none; }
.order-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.order {
  min-width: 0;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: start;
  gap: 13px;
  background: var(--surface);
  border-radius: 12px;
  padding: 16px;
}
.order p { font-size: 13px; overflow-wrap: anywhere; line-height: 1.65; }
.order p:first-child { margin-bottom: 3px; }
.order dl { margin: 0; }
.order dl div { display: flex; flex-wrap: wrap; gap: 4px; font-size: 13px; line-height: 1.6; }
.order dt { color: #444857; }
.order dd { margin: 0; font-weight: 550; overflow-wrap: anywhere; }
.order .order-right { display: grid; justify-items: end; gap: 8px; }
.status { padding: 3px 7px; border-radius: 5px; white-space: nowrap; font-size: 12px; }
.status-paid { background: #e0f3ec; color: #157759; }
.status-pending { background: #eeedff; color: #4847d1; }
.status-expired, .status-closed { background: #eeedf2; color: #595b66; }
.order .button { min-height: 28px; padding: 3px 8px; font-size: 12px; }
.demo-note { font-size: 13px; line-height: 1.6; color: var(--muted); }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px; border-radius: 12px; background: var(--surface); }
.settings-row p { margin-top: 4px; }

.dialog {
  width: min(464px, calc(100% - 26px));
  max-height: calc(100dvh - 28px);
  overflow-y: auto;
  border: 0;
  border-radius: 20px;
  padding: 20px;
  background: white;
  color: #292c30;
  box-shadow: 0 12px 35px #11121a1a;
}
.dialog::backdrop { background: #17192370; }
.dialog .modal-heading {
  position: relative;
  min-height: 40px;
  padding: 5px 48px 4px 0;
  display: flex;
  align-items: center;
}
.modal-heading h2 { font-size: 20px; font-weight: 750; }
.modal-heading .close-dialog {
  position: absolute;
  right: -5px;
  top: 0;
  width: 40px;
  height: 40px;
  background: #ededee;
}
.modal-heading .close-dialog:hover { background: #e1e2e7; }
.modal-heading .close-dialog img { width: 23px; height: 23px; }
.modal-form { display: grid; gap: 16px; padding-top: 16px; }
.modal-form label { display: grid; gap: 7px; font-weight: 600; }
.modal-form input, .modal-form select {
  width: 100%;
  border: 1px solid #d9dce8;
  border-radius: 8px;
  min-height: 42px;
  color: inherit;
  background: #fff;
  padding: 8px 12px;
}
.modal-form .button { justify-self: end; }
.form-error { color: var(--danger); font-size: 13px; }
.pay-dialog { margin-block: auto; inset-block-start: 30px; padding: 22px 20px 20px; }
.pay-dialog .modal-heading { margin-left: -5px; }
.payment { text-align: center; padding-top: 34px; }
.token {
  position: relative;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: #169d7c;
  color: #fff;
}
.token-letter {
  font-family: Arial, sans-serif;
  font-weight: 900;
  font-size: 26px;
  line-height: 1;
}
.token-letter::after {
  content: "";
  display: block;
  position: absolute;
  width: 66%;
  height: 13%;
  border: 1px solid white;
  border-radius: 50%;
  inset: 40% 17% auto;
}
.token-small { width: 35px; height: 35px; }
.payment .token { width: 80px; height: 80px; margin: 0 auto 10px; }
.payment .token-letter { font-size: 65px; }
.payment .token-letter::after { border-width: 2px; }
.network-badge {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border: 3px solid white;
  border-radius: 50%;
  color: #454d73;
  background: #f2f2f5;
  font-size: 18px;
}
.countdown {
  display: block;
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 32px;
  line-height: 1.25;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.payment p { line-height: 1.5; font-size: 15px; }
.pay-amount { margin-top: 8px; }
.pay-amount strong { font-weight: 800; }
.pay-amount .amount { color: var(--danger); font-size: 19px; }
.payment .qr { width: min(210px, 100%); height: auto; margin: 6px auto 7px; image-rendering: pixelated; }
.payment .expired-qr { opacity: .25; }
.payment .address-label { font-weight: 700; }
.address {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3px;
  margin-top: 5px;
  overflow-wrap: anywhere;
}
.address code { color: inherit; font: inherit; font-weight: 750; }
.address .icon-button { flex: 0 0 28px; }
.payment-notice { text-align: left; color: var(--danger); margin-top: 5px; }
.payment-notice h3 { padding-bottom: 6px; font-size: 17px; }
.payment-notice p + p { margin-top: 5px; }
.payment-feedback {
  position: absolute;
  inset: auto 20px 20px;
  padding: 9px 12px;
  border-radius: 8px;
  background: #292b38;
  color: #fff;
  font-size: 13px;
}
.toast {
  position: fixed;
  z-index: 2;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  background: #1c1d29;
  color: white;
  border-radius: 9px;
  padding: 10px 16px;
  box-shadow: 0 4px 18px #11121a25;
}

@media (max-width: 1000px) {
  .workspace { margin-inline: 20px; grid-template-columns: 180px minmax(0, 700px); }
}
@media (max-width: 650px) {
  .page-header { height: 43px; padding: 12px 16px; }
  .page-header::after { inset-block-start: auto; bottom: 0; }
  .workspace { padding: 8px 0 16px; margin-inline: 10px; display: block; }
  .sidebar { padding: 0; }
  .sidebar nav { display: flex; gap: 4px; overflow-x: auto; padding: 4px 2px 10px; }
  .nav-label, .settings-link::after { display: none; }
  .nav-link { height: 39px; margin: 0; padding: 0 11px; gap: 6px; font-size: 13px; }
  .nav-link img { width: 16px; height: 16px; }
  .panel { min-height: calc(100dvh - 116px); padding: 17px 14px 22px; border-radius: 16px; }
  .page-heading { margin-bottom: 15px; }
  .tabs { margin-left: 0; }
  .tab { min-width: 0; }
  .card-shelf { margin-bottom: 23px; }
  .empty-state, .card-detail { min-height: 310px; }
  .empty-state h2 { font-size: 27px; }
  .empty-state .info-icon { width: 58px; height: 58px; font-size: 43px; margin-bottom: 14px; }
  .order { padding: 12px; column-gap: 8px; }
  .order .order-right { grid-column: 2; justify-items: start; grid-auto-flow: column; justify-content: start; align-items: center; }
  .pay-dialog { inset-block-start: 0; }
  .payment { padding-top: 22px; }
}
@media (max-width: 355px) {
  .card-brand { right: 8px; }
  .rename { left: 86px; }
  .card-name { max-width: 77px; }
  .card-shelf .new-card { flex-basis: 50px; }
  .credit-card { width: calc(100% - 57px); }
  .pay-dialog { padding-inline: 14px; }
}
