:root {
  --bg: #f1f3f8;
  --card: #ffffff;
  --soft: #f2f4f8;
  --text: #303236;
  --muted: #a0a4ad;
  --line: #edf0f5;
  --blue: #2f83f6;
  --green: #16b47b;
  --shadow: 0 18px 48px rgba(38, 49, 67, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

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

.phone {
  position: relative;
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 16px 96px;
  background: var(--bg);
}

.tabs {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 22px;
  align-items: center;
  padding: 0 4px 18px;
}

.tab {
  position: relative;
  padding: 0 0 12px;
  color: var(--muted);
  font-size: 20px;
  font-weight: 700;
}

.tab.active {
  color: #3f4248;
}

.tab.active::after {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 0;
  height: 3px;
  border-radius: 999px;
  background: #3f4248;
}

.wallet-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 6px 12px 6px 8px;
  border-radius: 999px;
  background: #fff;
  color: #4a4d53;
  font-weight: 700;
}

.wallet-chip span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: #f0f2f6;
}

.wallet-chip b {
  max-width: 56px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.swap-card,
.record-empty {
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.swap-card {
  padding: 20px 16px 18px;
}

.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  font-style: italic;
  font-weight: 900;
}

.tools {
  display: flex;
  gap: 14px;
}

.tools button {
  width: 34px;
  height: 34px;
  color: #343840;
  font-size: 28px;
  line-height: 1;
}

.token-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: -8px 0 22px;
  padding: 5px;
  border-radius: 14px;
  background: var(--soft);
}

.token-switch button {
  min-height: 38px;
  border-radius: 11px;
  color: #9298a2;
  font-weight: 800;
}

.token-switch button.active {
  background: #fff;
  color: #303236;
  box-shadow: 0 6px 18px rgba(38, 49, 67, 0.08);
}

.field-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0 4px 10px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
}

.field-head small {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
}

.field-head button {
  color: var(--blue);
  font-weight: 700;
}

.asset-box {
  display: grid;
  grid-template-columns: minmax(0, 155px) 1fr;
  align-items: center;
  min-height: 82px;
  padding: 12px 16px;
  border-radius: 18px;
  background: var(--soft);
}

.asset-select {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 9px 12px;
  border-radius: 17px;
  background: #fff;
}

.chain-badge {
  position: absolute;
  left: 39px;
  bottom: 9px;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  overflow: hidden;
  background: #111827;
}

.chain-badge svg {
  width: 18px;
  height: 18px;
}

.coin {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
}

.coin svg {
  display: block;
  width: 42px;
  height: 42px;
}

.coin.aix {
  background: #080808;
}

.coin.bsc {
  background: #111827;
}

.coin.eth {
  background: #f4f6fb;
}

.coin.usdt {
  background: #26a17b;
}

.asset-select strong,
.asset-select small {
  display: block;
}

.asset-select strong {
  font-size: 22px;
}

.asset-select small {
  margin-top: 2px;
  color: #9da2aa;
  font-size: 13px;
}

.asset-select::after {
  content: "";
  width: 0;
  height: 0;
  margin-left: 2px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #363a40;
}

.asset-select select {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.amount-input,
.receive-amount {
  display: grid;
  justify-items: end;
  min-width: 0;
}

.amount-input input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #303236;
  font-size: 28px;
  font-weight: 700;
  text-align: right;
}

.amount-input small,
.receive-amount small {
  color: var(--muted);
  font-size: 14px;
}

.receive-amount strong {
  overflow: hidden;
  max-width: 100%;
  color: #303236;
  font-size: 26px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.swap-float {
  display: grid;
  width: 38px;
  height: 38px;
  margin: 12px auto;
  place-items: center;
  color: var(--blue);
  font-size: 26px;
  font-weight: 900;
  line-height: 0.8;
}

.receive {
  margin-top: 0;
}

.address-field {
  display: grid;
  gap: 8px;
  margin: 16px 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.address-field input {
  min-height: 46px;
  padding: 0 14px;
  border: 0;
  border-radius: 15px;
  outline: 0;
  background: var(--soft);
}

.confirm {
  width: 100%;
  min-height: 58px;
  border-radius: 15px;
  background: var(--blue);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
}

.details {
  display: grid;
  gap: 14px;
  margin-top: 22px;
  padding: 18px 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
}

.details p {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 16px;
}

.details strong {
  color: #3b3e45;
  text-align: right;
}

.details em {
  display: inline-flex;
  align-items: center;
  margin-left: 5px;
  padding: 2px 7px;
  border: 1px solid var(--blue);
  border-radius: 6px;
  color: var(--blue);
  font-style: normal;
  font-weight: 500;
}

.details i {
  display: inline-grid;
  width: 18px;
  height: 18px;
  margin-right: 4px;
  place-items: center;
  border-radius: 50%;
  background: #185ee8;
  color: #fff;
  font-size: 10px;
  font-style: normal;
}

.green {
  color: var(--green) !important;
}

.records {
  margin-top: 30px;
}

.record-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 4px 14px;
}

.record-head h2 {
  font-size: 22px;
}

.record-head button {
  color: var(--muted);
  font-size: 17px;
}

.record-empty {
  display: grid;
  min-height: 112px;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: #c2c7cf;
}

.record-empty span {
  font-size: 34px;
}

.record-row {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 20px;
  background: #fff;
}

.record-row + .record-row {
  margin-top: 10px;
}

.record-row div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.record-row code {
  overflow: hidden;
  color: #8f96a1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-row b {
  color: #3b3e45;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  max-width: 430px;
  min-height: 74px;
  margin: 0 auto;
  border-top: 1px solid #e7eaf0;
  background: #fff;
}

.bottom-nav a {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  color: #a0a3aa;
  font-size: 13px;
  font-weight: 700;
}

.bottom-nav span {
  font-size: 28px;
  line-height: 1;
}

.bottom-nav .active {
  color: var(--blue);
}

@media (min-width: 760px) {
  body {
    display: grid;
    place-items: start center;
    background: #dfe5ee;
  }

  .phone {
    min-height: 900px;
    margin-top: 18px;
    border-radius: 28px;
    box-shadow: 0 24px 70px rgba(17, 24, 39, 0.18);
  }
}

@media (max-width: 390px) {
  .phone {
    padding-right: 12px;
    padding-left: 12px;
  }

  .tab {
    font-size: 18px;
  }

  .asset-box {
    grid-template-columns: minmax(0, 145px) 1fr;
    padding: 10px;
  }

  .asset-select {
    gap: 8px;
    padding: 8px;
  }

  .asset-select strong {
    font-size: 19px;
  }

  .amount-input input,
  .receive-amount strong {
    font-size: 24px;
  }
}
