:root {
  color-scheme: light;
  --bg: #ffffff;
  --page: #f7f7f7;
  --card: #f5f5f5;
  --text: #111111;
  --muted: #8b8b8b;
  --line: #eeeeee;
  --green: #1f7a16;
  --green-2: #35a853;
  --red: #e85d6a;
  --black: #050505;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.06);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: #f1f1f1;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
}

button,
input,
select {
  font: inherit;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

button,
a,
[role="button"],
.select-trigger,
.form-select-trigger,
.picker-panel button,
.language-options button {
  -webkit-tap-highlight-color: transparent;
}

button {
  appearance: none;
  cursor: pointer;
}

button:focus,
button:focus-visible,
a:focus,
a:focus-visible,
[role="button"]:focus,
[role="button"]:focus-visible,
.select-trigger:focus,
.select-trigger:focus-visible,
.form-select-trigger:focus,
.form-select-trigger:focus-visible {
  outline: none;
}

select {
  appearance: none;
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.phone-page {
  min-height: 100vh;
  max-width: 430px;
  margin: 0 auto;
  padding: 18px 18px 92px;
  background: var(--bg);
}

.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--black);
}

.icon-button svg {
  width: 21px;
  height: 21px;
}

.segmented-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  padding: 3px;
  border-radius: 18px;
  background: #f4f4f4;
}

.segmented-tabs span,
.segmented-tabs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 15px;
  color: #555555;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.segmented-tabs .active {
  background: #ffffff;
  color: var(--black);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.muted {
  color: var(--muted);
}

.green {
  color: var(--green-2);
}

.red {
  color: var(--red);
}

.is-loading {
  color: transparent !important;
  border-radius: 6px;
  background: linear-gradient(90deg, #eeeeee 25%, #f7f7f7 50%, #eeeeee 75%);
  background-size: 200% 100%;
  animation: value-loading 1.1s linear infinite;
}

[data-asset-total].is-loading {
  display: inline-block;
  min-width: 150px;
}

[data-asset-change].is-loading {
  display: inline-block;
  min-width: 128px;
}

[data-asset-total-card].is-loading,
[data-holding-value].is-loading {
  display: inline-block;
  min-width: 86px;
}

[data-holding-price].is-loading {
  display: inline-block;
  min-width: 74px;
  min-height: 14px;
}

@keyframes value-loading {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 28px 0 14px;
}

.section-title h2 {
  margin: 0;
  font-size: 21px;
  letter-spacing: 0;
}

.small-link {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 0;
  background: transparent;
  color: #222222;
  font-size: 13px;
  text-decoration: none;
}

.primary-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 0;
  border-radius: 22px;
  background: var(--green);
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
}

.outline-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 0;
  border-radius: 22px;
  background: #f2f2f2;
  color: #111111;
  font-weight: 800;
  text-decoration: none;
}

.max-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  min-height: 34px;
  border: 0;
  border-radius: 12px;
  background: #111111;
  color: #ffffff;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 900;
}

.field-hint {
  color: #777777;
  font-size: 12px;
}

.select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 14px;
  background: #f7f7f7;
  color: #111111;
  padding: 0 14px;
  font-weight: 900;
}

.select-trigger.compact {
  background: #ffffff;
}

.select-trigger svg {
  width: 18px;
  height: 18px;
  transition: transform 180ms ease;
}

.picker-sheet {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
}

.picker-sheet.open {
  display: block;
}

.picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.22);
  opacity: 0;
  animation: picker-fade 160ms ease forwards;
}

.picker-panel {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(430px, 100vw);
  padding: 18px;
  border-radius: 22px 22px 0 0;
  background: #ffffff;
  transform: translate(-50%, 100%);
  animation: picker-up 200ms ease forwards;
}

.picker-panel h2 {
  margin: 0 0 12px;
  font-size: 19px;
}

.picker-panel button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  background: #f7f7f7;
  color: #111111;
  padding: 0 14px;
  margin-top: 8px;
  font-weight: 900;
}

.picker-panel .picker-coin-option {
  justify-content: flex-start;
  gap: 12px;
}

.picker-panel .picker-coin-option b {
  font-size: 16px;
}

.confirm-dialog {
  width: min(370px, calc(100vw - 36px));
  border: 0;
  border-radius: 18px;
  padding: 18px;
  background: #ffffff;
  color: #111111;
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.22);
}

.confirm-dialog::backdrop {
  background: rgba(0, 0, 0, 0.28);
}

.confirm-dialog h2 {
  margin: 0 0 10px;
  font-size: 21px;
}

.confirm-dialog p {
  margin: 0 0 18px;
  color: #555555;
  line-height: 1.6;
}

.result-dialog {
  width: min(360px, calc(100vw - 36px));
  max-width: calc(100vw - 32px);
  max-height: min(78vh, 560px);
  box-sizing: border-box;
  border: 0;
  border-radius: 20px;
  padding: 22px 18px 18px;
  background: #ffffff;
  color: #111111;
  text-align: center;
  overflow: hidden;
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.22);
}

.result-dialog[open] {
  position: fixed;
  inset: 50% auto auto 50%;
  margin: 0;
  transform: translate(-50%, -50%);
}

.result-dialog::backdrop {
  background: rgba(0, 0, 0, 0.28);
}

.result-dialog-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: #eaf8ee;
  color: var(--green);
}

.result-dialog[data-type="error"] .result-dialog-icon {
  background: #fff0f1;
  color: var(--red);
}

.result-dialog-icon svg {
  width: 27px;
  height: 27px;
  stroke-width: 3;
}

.result-dialog h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.result-dialog p {
  max-height: 220px;
  margin: 0 auto 18px;
  color: #666666;
  line-height: 1.55;
  font-size: 14px;
  overflow-y: auto;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  text-align: center;
}

.kyc-required-dialog {
  width: min(360px, calc(100vw - 40px));
  padding: 22px 18px 18px;
}

.kyc-required-dialog .result-dialog-icon {
  width: 54px;
  height: 54px;
  margin-bottom: 16px;
  background: #eaf8ee;
  color: var(--green);
}

.kyc-required-dialog h2 {
  margin-bottom: 10px;
  font-size: 23px;
}

.kyc-required-dialog p {
  max-width: 270px;
  margin-bottom: 18px;
}

.kyc-required-dialog [data-kyc-required-close] {
  width: 100%;
  min-height: 42px;
  border-radius: 22px;
}

[data-trade-status],
[data-withdraw-status] {
  display: none !important;
}

.dialog-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.home-popup {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
}

.home-popup.open {
  pointer-events: auto;
  opacity: 1;
}

.home-popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 17, 17, 0.46);
}

.home-popup-panel {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 28px;
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(17, 17, 17, 0.22);
}

.home-popup-close {
  justify-self: end;
}

.home-popup-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 14px;
  background: #f1f1f1;
  color: #111111;
  font-size: 12px;
  font-weight: 800;
}

.home-popup-panel h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.35;
}

.home-popup-panel p {
  margin: 0;
  color: #555555;
  font-size: 14px;
  line-height: 1.6;
}

.home-popup-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.home-popup-actions a,
.home-popup-actions button {
  width: 100%;
  text-decoration: none;
}

@keyframes picker-fade {
  to {
    opacity: 1;
  }
}

@keyframes picker-up {
  to {
    transform: translate(-50%, 0);
  }
}

.soft-card {
  border-radius: 16px;
  background: var(--card);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  width: min(430px, 100vw);
  min-height: 72px;
  padding: 7px 12px calc(6px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  transform: translateX(-50%);
  backdrop-filter: blur(14px);
}

.bottom-nav a {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  min-width: 0;
  color: #888888;
  font-size: 11px;
  text-decoration: none;
}

.bottom-nav svg {
  width: 21px;
  height: 21px;
}

.bottom-nav a.active {
  color: var(--black);
  font-weight: 800;
}

.bottom-nav .trade-fab {
  width: 60px;
  height: 60px;
  margin-top: -28px;
  border-radius: 50%;
  background: var(--black);
  color: #ffffff;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
}

.bottom-nav .trade-fab svg {
  width: 24px;
  height: 24px;
}

.bottom-nav .trade-fab span {
  margin-top: -2px;
  color: #ffffff;
  font-size: 10px;
  line-height: 1;
}

.side-drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: #f7f7f7;
}

.drawer-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: min(430px, 100vw);
  padding: 18px 18px 22px;
  overflow-y: auto;
  background: #f7f7f7;
  transform: translateX(-50%);
  scrollbar-width: none;
}

.drawer-panel::-webkit-scrollbar {
  display: none;
}

.side-drawer.open {
  display: block;
}

.drawer-status {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 48px;
}

.drawer-status .language-menu {
  display: none;
}

.language-menu {
  position: relative;
}

.language-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  background: #ffffff;
  padding: 0 12px;
  color: #111111;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.language-trigger svg {
  width: 16px;
  height: 16px;
  transition: transform 180ms ease;
}

.language-menu.open .language-trigger svg {
  transform: rotate(180deg);
}

.language-options {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 10;
  display: grid;
  min-width: 132px;
  padding: 8px;
  border: 1px solid #ebebeb;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.08);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top right;
  transition: opacity 180ms ease, transform 180ms ease;
}

.language-menu.open .language-options {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.language-options button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  padding: 0 10px;
  color: #555555;
  font-size: 13px;
  font-weight: 700;
  transition: background-color 160ms ease, color 160ms ease;
}

.language-options button:hover,
.language-options button.active {
  background: #f4f4f4;
  color: #111111;
}

.settings-language-menu {
  position: relative;
  width: 100%;
  margin-bottom: 2px;
}

.settings-language-menu .language-trigger {
  justify-content: space-between;
  width: 100%;
  min-height: 58px;
  border: 0;
  border-radius: 14px;
  background: #ffffff;
  padding: 0 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.03);
}

.settings-language-menu .language-options {
  left: 0;
  right: 0;
  min-width: 0;
  transform-origin: top center;
}

.drawer-profile {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: center;
  padding: 24px 0 18px;
}

.avatar-photo {
  display: block;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  background:
    radial-gradient(circle at 24% 30%, rgba(255, 255, 255, 0.25), transparent 18%),
    linear-gradient(135deg, #17100c, #d66b05 48%, #27130a);
}

.avatar-upload input {
  display: none;
}

.guest-avatar {
  background:
    radial-gradient(circle at 24% 30%, rgba(255, 255, 255, 0.2), transparent 18%),
    linear-gradient(135deg, #dfe5ef, #a8b2c6 52%, #e8edf5);
}

.drawer-profile h2 {
  margin: 0 0 6px;
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: 0;
}

.drawer-profile span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #b57920;
  font-size: 12px;
}

.drawer-profile span i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c97919;
}

.drawer-uid {
  display: block;
  margin-top: 6px;
  color: #777777;
  font-size: 12px;
  font-weight: 700;
}

.drawer-profile-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.drawer-profile-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border: 0;
  border-radius: 15px;
  background: #eeeeee;
  color: #555555;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
}

.drawer-profile-actions button:last-child {
  width: 30px;
  padding: 0;
}

.account-settings-sheet {
  position: fixed;
  inset: 0;
  z-index: 65;
  display: none;
}

.account-settings-sheet.open {
  display: block;
}

.account-settings-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.24);
  opacity: 0;
  animation: picker-fade 160ms ease forwards;
}

.account-settings-panel {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: min(430px, 100vw);
  padding: 18px 18px 28px;
  overflow-y: auto;
  background: #f7f7f7;
  transform: translateX(-50%) translateY(18px);
  opacity: 0;
  animation: settings-in 180ms ease forwards;
  scrollbar-width: none;
}

.account-settings-panel::-webkit-scrollbar {
  display: none;
}

.account-settings-header {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  min-height: 48px;
  margin-bottom: 18px;
}

.account-settings-header h2 {
  margin: 0;
  text-align: center;
  font-size: 20px;
}

.settings-action-list,
.settings-form {
  display: grid;
  gap: 10px;
}

.settings-action-list {
  margin-bottom: 18px;
}

.settings-action-list button {
  display: grid;
  grid-template-columns: 28px 1fr 22px;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  border: 0;
  border-radius: 14px;
  background: #ffffff;
  color: #111111;
  padding: 0 14px;
  text-align: left;
  font-weight: 900;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.03);
}

.settings-action-list button svg {
  width: 21px;
  height: 21px;
}

.settings-action-list button.danger {
  color: #d94c58;
}

.settings-form {
  padding: 14px;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.03);
}

.settings-form label {
  display: grid;
  gap: 8px;
  color: #666666;
  font-size: 13px;
  font-weight: 800;
}

.settings-form input {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  background: #f5f5f5;
  color: #111111;
  padding: 0 13px;
  font-size: 15px;
  font-weight: 800;
}

.settings-status {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #eef8f0;
  color: var(--green);
  font-size: 13px;
  line-height: 1.45;
}

.settings-status[data-type="error"] {
  background: #fff0f1;
  color: var(--red);
}

@keyframes settings-in {
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.drawer-profile-actions a.drawer-auth-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border-radius: 15px;
  background: #eeeeee;
  color: #555555;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.drawer-profile-actions a.drawer-auth-link.primary {
  background: var(--green);
  color: #ffffff;
}

.drawer-account-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 14px;
}

.drawer-account-status article {
  min-width: 0;
  padding: 12px 8px;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.03);
}

.drawer-account-status span {
  display: block;
  margin-bottom: 7px;
  color: #8a8a8a;
  font-size: 11px;
  line-height: 1.2;
}

.drawer-account-status strong {
  display: block;
  color: #111111;
  font-size: 15px;
  line-height: 1.2;
  word-break: keep-all;
}

.drawer-account-status strong.is-ok {
  color: var(--green);
}

.drawer-account-status strong.is-warn {
  color: #b57920;
}

.vip-card,
.drawer-card,
.drawer-about {
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.03);
}

.vip-card {
  position: relative;
  margin-bottom: 14px;
  padding: 15px 14px 13px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(196, 151, 83, 0.14), transparent 42%),
    #ffffff;
}

.vip-card > button {
  position: absolute;
  right: 10px;
  top: 10px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  color: #999999;
}

.vip-card h3 {
  display: flex;
  align-items: center;
  gap: 3px;
  margin: 0 0 14px;
  color: #b48a4a;
  font-size: 17px;
}

.vip-card div {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  color: #7b633c;
  font-size: 11px;
}

.vip-card span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
}

.drawer-card {
  margin-bottom: 14px;
  padding: 16px 14px 18px;
}

.drawer-card h3,
.drawer-section-head h3 {
  margin: 0;
  font-size: 18px;
}

.drawer-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.drawer-card > h3 {
  margin-bottom: 18px;
}

.drawer-grid {
  display: grid;
  gap: 24px 12px;
}

.drawer-grid.four {
  grid-template-columns: repeat(4, 1fr);
}

.drawer-grid a {
  display: grid;
  place-items: center;
  gap: 9px;
  min-width: 0;
  color: #151515;
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.drawer-grid svg {
  width: 22px;
  height: 22px;
  stroke-width: 2.4;
}

.drawer-about {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 0 14px;
  color: #202020;
  font-size: 14px;
}

.drawer-about span,
.drawer-about b {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.coin-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
}

.coin-icon.teal {
  background: #17a49a;
}

.coin-icon.orange {
  background: #f5a524;
}

.coin-icon.blue {
  background: #5f89ff;
}

.coin-icon.black {
  background: #111111;
}

.coin-icon.line {
  border: 2px solid #104538;
  background: #c8f3dd;
  color: #104538;
}

@media (min-width: 760px) {
  body {
    background: #ededed;
  }

  .phone-page {
    min-height: calc(100vh - 28px);
    margin-top: 14px;
    margin-bottom: 14px;
    border-radius: 28px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.14);
  }
}
