:root {
  --bg: #030611;
  --panel: #1a1b25;
  --panel-2: #12131b;
  --line: #2a2c38;
  --text: #f7f7ff;
  --muted: #9aa3b8;
  --purple: #7c3aed;
  --purple-2: #6d5dfc;
  --blue: #3b82f6;
  --red: #fb7185;
  --green: #34d399;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, "Microsoft YaHei", Arial, sans-serif;
}

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

button,
input {
  font: inherit;
}

button {
  border: 0;
}

.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 20px;
  background:
    radial-gradient(circle at 50% 0%, rgba(124, 58, 237, .08), transparent 32%),
    #030611;
}

.choice-screen {
  align-items: center;
}

.auth-card,
.form-card,
.profile-card {
  width: min(100%, 430px);
  text-align: center;
}

.brand-mark {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  font-size: 26px;
  font-weight: 800;
  background: linear-gradient(135deg, #823cf4, #6257f6);
}

h1 {
  margin: 0;
  font-size: 27px;
  letter-spacing: 0;
  color: #b9a9ff;
}

.subtitle {
  margin: 10px 0 30px;
  color: var(--muted);
  font-size: 14px;
}

.choice-item,
.wallet-link {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 82px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  text-align: left;
  margin-bottom: 14px;
}

.choice-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 22px;
}

.wallet-icon {
  color: #f87171;
  background: rgba(239, 68, 68, .2);
}

.mail-icon {
  color: #d8b4fe;
  background: rgba(126, 34, 206, .45);
}

.choice-copy {
  flex: 1;
  display: grid;
  gap: 5px;
}

.choice-copy strong {
  font-size: 16px;
}

.choice-copy small {
  color: var(--muted);
  font-size: 13px;
}

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

.wallet-cube-icon,
.external-link-icon {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

svg.lucide {
  display: block;
  flex: 0 0 auto;
}

.wallet-cube-icon {
  width: 24px;
  height: 24px;
  stroke-width: 1.5;
}

.external-icon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
}

.external-link-icon {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 42px;
  margin: 0 0 20px;
  border: 1px solid var(--line);
  border-radius: 15px;
  overflow: hidden;
  background: var(--panel);
}

.segmented button {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
  background: transparent;
  cursor: pointer;
}

.segmented button.active {
  color: white;
  background: linear-gradient(135deg, #853df4, #635af7);
}

.auth-form {
  display: grid;
  gap: 10px;
  text-align: left;
}

label {
  color: #aeb7cb;
  font-size: 13px;
}

input {
  width: 100%;
  height: 43px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  color: var(--text);
  background: #11131c;
  padding: 0 14px;
}

input::placeholder {
  color: #737b8f;
}

.password-field {
  position: relative;
}

.password-field span {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: #7a8296;
  pointer-events: none;
}

.code-row {
  display: grid;
  grid-template-columns: 1fr 92px;
  gap: 8px;
}

.send-code-btn,
.primary-btn {
  border: 0;
  border-radius: 11px;
  color: white;
  background: linear-gradient(135deg, #7c3aed, #4f46a8);
  cursor: pointer;
  font-weight: 700;
}

.send-code-btn {
  height: 43px;
  font-size: 12px;
  padding: 0 8px;
}

.primary-btn {
  width: 100%;
  height: 43px;
  margin-top: 4px;
  font-size: 15px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--muted);
  font-size: 13px;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  background: var(--line);
  flex: 1;
}

.wallet-link {
  justify-content: center;
  min-height: 48px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
}

.account-login-link {
  margin-bottom: 0;
}

.message {
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 13px;
  text-align: left;
}

.message.error {
  color: #fecdd3;
  background: rgba(251, 113, 133, .14);
  border: 1px solid rgba(251, 113, 133, .25);
}

.message.success {
  color: #bbf7d0;
  background: rgba(52, 211, 153, .12);
  border: 1px solid rgba(52, 211, 153, .22);
}

.hidden-form {
  display: none;
}

.is-hidden {
  display: none !important;
}

.profile-panel {
  display: grid;
  gap: 10px;
  margin: 24px 0;
  text-align: left;
}

.profile-panel div {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 14px;
}

.profile-panel span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.profile-panel strong {
  font-size: 15px;
  word-break: break-all;
}

@media (max-width: 480px) {
  .auth-screen {
    align-items: flex-start;
    padding-top: 72px;
  }
}

.sunx-page {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 16%, rgba(124, 58, 237, .10), transparent 24%),
    radial-gradient(circle at 78% 6%, rgba(30, 41, 59, .35), transparent 28%),
    #000;
}

.sunx-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, .78) 0 1px, transparent 1.4px),
    radial-gradient(circle, rgba(255, 255, 255, .38) 0 1px, transparent 1.6px);
  background-size: 148px 92px, 211px 137px;
  background-position: 12px 16px, 61px 42px;
  opacity: .72;
}

.sunx-shell,
.security-shell {
  position: relative;
  z-index: 1;
  width: min(100% - 32px, 960px);
  margin: 0 auto;
}

.sunx-shell {
  min-height: 100vh;
  padding: 14px 0 16px;
}

.sunx-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 44px;
}

.sunx-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.sunx-logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #060606;
  background: #facc15;
  font-size: 19px;
  box-shadow: 0 0 18px rgba(250, 204, 21, .24);
}

.language-menu {
  position: relative;
}

.language-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  color: #c9cbd3;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
}

.globe-icon {
  color: #d8d9df;
  width: 16px;
  height: 16px;
}

.language-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  display: none;
  width: 140px;
  padding: 12px 0;
  border: 1px solid #252837;
  border-radius: 10px;
  background: #11111b;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .42);
  z-index: 5;
}

.language-popover.open {
  display: grid;
}

.language-popover button {
  height: 36px;
  padding: 0 16px;
  color: #c7c9d4;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-weight: 650;
}

.language-popover button.active,
.language-popover button:hover {
  color: #a78bfa;
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 4px 0 22px;
}

.profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #6f45ea;
  color: #fff;
  font-size: 20px;
  font-weight: 800;
}

.profile-identity h1 {
  margin: 0 0 5px;
  color: #f7f7ff;
  font-size: 18px;
  line-height: 1;
}

.profile-identity p {
  margin: 0;
  color: #8d92a4;
  font-size: 13px;
}

.asset-card,
.records-panel,
.menu-row,
.security-card {
  border: 1px solid rgba(255, 255, 255, .10);
  background: rgba(24, 24, 25, .96);
  box-shadow: 0 14px 36px rgba(89, 58, 189, .10);
}

.asset-card {
  min-height: 148px;
  display: grid;
  align-content: center;
  gap: 18px;
  padding: 22px 20px;
  border-radius: 16px;
}

.asset-total {
  display: grid;
  gap: 5px;
}

.asset-total span,
.asset-metrics span {
  color: #8f94a3;
  font-size: 14px;
}

.asset-total strong {
  font-size: 26px;
}

.asset-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.asset-metrics div {
  display: grid;
  gap: 4px;
}

.asset-metrics strong {
  font-size: 14px;
}

.metric-energy {
  color: #facc15 !important;
}

.energy-value {
  color: #facc15;
}

.trx-value {
  color: #00e58a;
}

.records-panel {
  margin-top: 16px;
  min-height: 162px;
  border-radius: 8px;
  overflow: hidden;
}

.record-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  min-height: 38px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  scrollbar-width: none;
}

.record-tabs::-webkit-scrollbar {
  display: none;
}

.record-tabs a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #868c9b;
  background: transparent;
  font-size: 11px;
  white-space: nowrap;
}

.record-tabs a > svg {
  width: 14px;
  height: 14px;
}

.record-tabs a.active {
  color: #a855f7;
}

.record-tabs a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: #8b5cf6;
}

.empty-records {
  min-height: 118px;
  display: grid;
  place-items: center;
  color: #8b91a1;
  font-size: 14px;
}

.profile-records { padding: 0 14px; }
.profile-record { min-height: 54px; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; border-bottom: 1px solid rgba(255,255,255,.06); padding: 8px 0; }
.profile-record.recharge-entry { min-height: 64px; }
.profile-record-main, .profile-record-result, .recharge-record-main, .recharge-record-result { display: grid; gap: 2px; }
.profile-record-main strong, .recharge-record-main strong { font-size: 12px; line-height: 1.2; }
.profile-record-main time, .recharge-record-main span, .recharge-record-main time { color: #777d8a; font-size: 10px; line-height: 1.25; }
.record-card-number { font-family: "JetBrains Mono", Consolas, monospace; }
.profile-record-result, .recharge-record-result { justify-items: end; flex: 0 0 auto; }
.profile-record-result strong, .recharge-record-result strong { font-size: 12px; line-height: 1.2; }
.record-status { border-radius: 3px; padding: 1px 5px; font-size: 9px; line-height: 1.35; }
.record-status.success { color: #86efac; background: rgba(22,101,52,.32); }
.record-status.failed { color: #ff737d; background: rgba(127,29,29,.32); }
.record-status.pending { color: #facc55; background: rgba(133,77,14,.3); }
.change-record { min-height: 62px; }
.change-positive, .signed-value.positive { color: #40d98b; }
.change-negative, .signed-value.negative { color: #ff6574; }
.record-detail { color: #737987; font-size: 10px; line-height: 1.25; }
.record-detail b { color: inherit; font-weight: 600; }
.signed-value { flex: 0 0 auto; padding-top: 2px; font-size: 10px; white-space: nowrap; }
.record-footer { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 14px; color: #8b91a1; font-size: 10px; }
.record-footer b { color: #d7d9e0; }
.record-pagination { display: flex; align-items: center; gap: 9px; }
.record-pagination a { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 4px; color: #d7d9e0; background: rgba(255,255,255,.025); }
.record-pagination a.disabled { opacity: .35; pointer-events: none; }

.profile-menu {
  display: grid;
  gap: 4px;
  margin-top: 16px;
}

.menu-row {
  width: 100%;
  min-height: 54px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 18px;
  border-radius: 14px;
  color: #f4f4fb;
  font-weight: 700;
  text-align: left;
}

.profile-menu form {
  margin: 0;
}

.profile-menu button.menu-row {
  cursor: pointer;
}

.menu-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.menu-icon,
.chevron {
  color: #8d94a5;
}

.menu-icon {
  width: 18px;
  height: 18px;
}

.chevron {
  width: 17px;
  height: 17px;
}

.logout-row {
  color: #ff5b63;
  background: rgba(24, 24, 25, .96);
}

.security-shell {
  max-width: 384px;
  padding: 28px 0 56px;
}

.security-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.security-header h1 {
  color: #fff;
  font-size: 24px;
}

.back-link {
  color: #c9ced8;
  font-size: 36px;
  line-height: 1;
}

.back-link svg {
  width: 28px;
  height: 28px;
}

.security-card {
  padding: 20px;
  border-radius: 14px;
  margin-bottom: 16px;
}

.security-card h2 {
  margin: 0;
  color: #fff;
  font-size: 15px;
}

.security-form {
  display: grid;
  gap: 9px;
  margin-top: 16px;
}

.security-input {
  position: relative;
}

.security-input input {
  height: 47px;
  border-radius: 14px;
  background: #222224;
  border-color: rgba(255, 255, 255, .13);
  padding-right: 42px;
}

.security-input > svg {
  position: absolute;
  right: 14px;
  top: 50%;
  width: 17px;
  height: 17px;
  color: #7f8595;
  transform: translateY(-50%);
}

.security-submit {
  height: 44px;
  margin-top: 4px;
  border-radius: 14px;
  background: linear-gradient(135deg, #833df1, #5d65f6);
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.transaction-password-badge {
  min-width: 50px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 750;
}

.transaction-password-badge.unset {
  color: #fbbf24;
  background: rgba(146, 88, 12, .42);
}

.transaction-password-badge.configured {
  color: #72e6a8;
  background: rgba(31, 133, 78, .38);
}

@media (max-width: 720px) {
  .sunx-shell {
    width: min(100% - 28px, 520px);
  }

  .record-tabs {
    overflow-x: auto;
    grid-template-columns: repeat(5, minmax(122px, 1fr));
  }

}
