:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #172033;
  background: #f4f7ff;
  font-synthesis: none;
  --blue: #4b83f5;
  --blue-dark: #326bdf;
  --ink: #172033;
  --muted: #747e91;
  --soft: #f4f6fb;
  --line: #e4e9f2;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #f4f7ff;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 50% -8%, rgba(110, 154, 246, 0.14), transparent 42%),
    linear-gradient(180deg, #f4f7ff 0%, #f8faff 62%, #fff 100%);
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

.device-message {
  display: grid;
  min-height: 100vh;
  margin: 0;
  padding: 24px;
  place-items: center;
  color: #172033;
  font-size: 18px;
  font-weight: 650;
  text-align: center;
}

.page-shell {
  width: min(100%, 402px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(32px, env(safe-area-inset-bottom));
}

.profile-card,
.rental-card,
.account-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 7px 22px rgba(66, 94, 146, 0.065);
}

.profile-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 90px;
  padding: 14px 15px;
  border-radius: 14px;
}

.profile-main {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 13px;
}

.avatar-frame {
  position: relative;
  display: grid;
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  overflow: hidden;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #ffd271, #ffad48);
  border: 3px solid #ffda7c;
  border-radius: 50%;
  box-shadow: 0 5px 14px rgba(255, 174, 67, 0.24);
}

.avatar-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #fff;
}

.avatar-initials {
  font-size: 23px;
  font-weight: 500;
  line-height: 1;
}

.user-copy {
  min-width: 0;
}

.user-name-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
}

.user-name {
  overflow: hidden;
  margin: 0;
  color: #11182a;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.premium-badge {
  flex: 0 0 auto;
  font-size: 17px;
  line-height: 1;
}

.user-id {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  margin: 7px 0 0;
  color: #717b8e;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.user-id > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.id-label {
  flex: 0 0 auto;
  padding: 2px 6px;
  color: #788295;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0;
  background: #f0f3f9;
  border-radius: 5px;
}

.quick-actions {
  display: flex;
  width: 100px;
  align-items: flex-start;
  justify-content: center;
  justify-self: center;
  gap: 8px;
  transform: translateX(-5px);
}

.quick-button {
  display: flex;
  width: 42px;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 0;
  color: #6d7688;
  font-size: 11px;
  font-weight: 500;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.quick-icon {
  position: relative;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #717b8d;
  background: #f1f4fa;
  border-radius: 50%;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.quick-icon--gift::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 8px;
  width: 11px;
  height: 9px;
  background: linear-gradient(90deg, transparent 45%, #737d8e 45%, #737d8e 55%, transparent 55%);
  border: 1.5px solid #737d8e;
  border-radius: 1px;
}

.quick-icon--gift::after {
  content: "";
  position: absolute;
  top: 8px;
  left: 7px;
  width: 13px;
  height: 5px;
  background: #f1f4fa;
  border: 1.5px solid #737d8e;
  border-radius: 2px;
}

.quick-icon--support::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 7px;
  width: 13px;
  height: 14px;
  border: 1.5px solid #737d8e;
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
}

.quick-icon--support::after {
  content: "";
  position: absolute;
  top: 16px;
  left: 6px;
  width: 3px;
  height: 7px;
  border: 1.5px solid #737d8e;
  border-radius: 3px;
  box-shadow: 14px 0 0 -1px #f1f4fa, 14px 0 0 0.5px #737d8e;
}

.quick-button:active .quick-icon {
  color: var(--blue-dark);
  background: #e8effd;
  transform: scale(0.96);
}

.account-cards {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.34fr);
  gap: 10px;
  margin-top: 12px;
}

.account-card {
  display: flex;
  min-width: 0;
  min-height: 77px;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  border-radius: 14px;
}

.channel-card {
  gap: 9px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.97), rgba(255, 249, 239, 0.97));
}

.account-icon {
  position: relative;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  box-shadow: 0 5px 13px rgba(57, 112, 226, 0.16);
}

.free-icon {
  background: linear-gradient(145deg, #6096fb, #3274ef);
}

.free-icon::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 13px;
  width: 15px;
  height: 6px;
  border: 1.7px solid #fff;
  border-radius: 1px;
  transform: rotate(-45deg);
}

.free-icon::after {
  content: "";
  position: absolute;
  right: 10px;
  bottom: 11px;
  width: 20px;
  height: 1.7px;
  background: #fff;
  border-radius: 2px;
}

.channel-icon {
  background: linear-gradient(145deg, #ffb34e, #ff8d17);
  box-shadow: 0 5px 13px rgba(255, 148, 27, 0.18);
}

.channel-icon::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 12px;
  width: 17px;
  height: 16px;
  border: 1.7px solid #fff;
  border-radius: 8px 8px 7px 7px;
}

.channel-icon::after {
  content: "";
  position: absolute;
  top: 9px;
  left: 15px;
  width: 11px;
  height: 6px;
  border: 1.7px solid #fff;
  border-radius: 4px 4px 2px 2px;
}

.account-copy {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 3px;
}

.account-value,
.account-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-value {
  color: #151c2e;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
}

.account-label {
  color: #7a8394;
  font-size: 12px;
  line-height: 1.25;
}

.follow-button {
  flex: 0 0 auto;
  min-width: 48px;
  height: 30px;
  padding: 0 11px;
  color: #e58a1c;
  font-size: 12px;
  font-weight: 650;
  background: #fffaf2;
  border: 1px solid #f0c47e;
  border-radius: 16px;
  box-shadow: 0 3px 9px rgba(227, 145, 40, 0.1);
  cursor: pointer;
}

.follow-button:active {
  transform: scale(0.97);
}

.rental-card {
  margin-top: 14px;
  padding: 24px 17px 22px;
  border-radius: 14px;
}

.form-label {
  display: block;
  margin: 0 0 13px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 650;
  line-height: 1.25;
}

.input-shell {
  display: flex;
  min-height: 48px;
  align-items: center;
  padding: 0 20px;
  background: var(--soft);
  border: 1.5px solid transparent;
  border-radius: 11px;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.input-shell:focus-within {
  background: #fff;
  border-color: #86abf8;
  box-shadow: 0 0 0 4px rgba(75, 131, 245, 0.1);
}

.input-shell input {
  width: 100%;
  min-width: 0;
  padding: 14px 0;
  color: #27334a;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  background: transparent;
  border: 0;
  outline: 0;
}

.input-shell input::placeholder {
  color: #a6afbf;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
}

.input-shell input:disabled {
  cursor: not-allowed;
}

.input-shell:has(input:disabled) {
  opacity: 0.62;
}

.submit-button,
.primary-button,
.secondary-button {
  border: 0;
  cursor: pointer;
}

.submit-button {
  width: 100%;
  min-height: 50px;
  margin-top: 31px;
  padding: 0 20px;
  color: #fff;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.06em;
  background: linear-gradient(135deg, #5a91fb, #3d76ef);
  border-radius: 11px;
  box-shadow: 0 8px 18px rgba(62, 117, 232, 0.22);
  transition: transform 150ms ease, opacity 150ms ease, box-shadow 150ms ease;
}

.submit-button:not(:disabled):active {
  transform: translateY(1px) scale(0.995);
  box-shadow: 0 8px 18px rgba(62, 117, 232, 0.22);
}

.submit-button:disabled {
  cursor: wait;
  opacity: 0.62;
  box-shadow: none;
}

.progress-panel,
.usage-note {
  padding: 12px 13px;
  background: #f0f5ff;
  border: 1px solid #e0eafd;
  border-radius: 10px;
}

.progress-panel {
  margin-top: 14px;
}

.usage-note {
  margin-top: 24px;
  color: #536887;
  font-size: 12px;
  line-height: 1.6;
}

.usage-note strong {
  display: block;
  margin-bottom: 5px;
  color: #3e5577;
  font-size: 13px;
  font-weight: 700;
}

.usage-note p {
  margin: 0;
}

.usage-note p + p {
  margin-top: 3px;
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  color: #536887;
  font-size: 12px;
  font-weight: 650;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  background: #dbe6fa;
  border-radius: 999px;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #5d94fa, #3874ec);
  border-radius: inherit;
  box-shadow: 0 0 12px rgba(63, 128, 251, 0.25);
}

.status-message {
  margin-top: 14px;
  padding: 13px 14px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.5;
  border-radius: 10px;
}

.status-message.is-success {
  color: #087552;
  background: #e8f8f1;
  border: 1px solid #bcebd7;
}

.status-message.is-error {
  color: #b33746;
  background: #fff0f2;
  border: 1px solid #f4cbd1;
}

.dialog-backdrop {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  padding: 20px;
  place-items: center;
  background: rgba(22, 36, 64, 0.43);
  backdrop-filter: blur(5px);
}

.dialog {
  position: relative;
  width: min(86%, 344px);
  overflow: hidden;
  padding: 0;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 28px 75px rgba(29, 49, 87, 0.24);
}

.dialog-close {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  padding: 0;
  color: #fff;
  font-size: 20px;
  line-height: 26px;
  background: rgba(255, 255, 255, 0.17);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.invite-header {
  position: relative;
  overflow: hidden;
  padding: 22px 20px 19px;
  color: #fff;
  text-align: center;
  background: linear-gradient(135deg, #6097ff, #3b79f1);
}

.invite-header::before,
.invite-header::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  pointer-events: none;
}

.invite-header::before {
  width: 105px;
  height: 105px;
  top: -64px;
  right: -31px;
}

.invite-header::after {
  width: 68px;
  height: 68px;
  bottom: -43px;
  left: -22px;
}

.invite-header-icon {
  position: relative;
  z-index: 1;
  display: grid;
  width: 48px;
  height: 48px;
  margin: 0 auto 10px;
  place-items: center;
  background: rgba(255, 255, 255, 0.17);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
}

.gift-line-icon {
  position: relative;
  width: 23px;
  height: 20px;
  margin-top: 4px;
  background: linear-gradient(90deg, transparent 45%, #fff 45%, #fff 55%, transparent 55%);
  border: 2px solid #fff;
  border-radius: 2px;
}

.gift-line-icon::before {
  content: "";
  position: absolute;
  top: -7px;
  left: -3px;
  width: 25px;
  height: 7px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid #fff;
  border-radius: 3px;
}

.invite-header h2 {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0;
}

.invite-header p {
  position: relative;
  z-index: 1;
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 12px;
}

.invite-content {
  padding: 18px;
}

.invite-stats {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin-bottom: 18px;
  padding: 13px 34px 13px 8px;
  background: #f5f8fd;
  border-radius: 11px;
}

.invite-stat {
  min-width: 0;
  padding: 0 7px;
  text-align: center;
}

.invite-stat + .invite-stat {
  border-left: 1px solid #e4eaf3;
}

.invite-stat strong,
.invite-stat span {
  display: block;
}

.invite-stat strong {
  margin-bottom: 4px;
  color: var(--blue-dark);
  font-size: 21px;
  font-weight: 700;
}

.invite-stat span {
  color: var(--muted);
  font-size: 11px;
}

.refresh-button {
  position: absolute;
  top: 50%;
  right: 7px;
  width: 27px;
  height: 27px;
  padding: 0;
  color: #6680a6;
  font-size: 17px;
  line-height: 25px;
  background: #e9eff8;
  border: 0;
  border-radius: 50%;
  transform: translateY(-50%);
  cursor: pointer;
}

.invite-link-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.invite-link-label {
  margin: 0;
  color: #34425c;
  font-size: 13px;
  font-weight: 650;
}

.invite-reward-tag {
  padding: 3px 7px;
  color: #3572e8;
  font-size: 10px;
  font-weight: 600;
  background: #eaf2ff;
  border-radius: 6px;
}

.invite-link-box {
  padding: 0 12px;
  background: #f7f9fc;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.invite-link {
  width: 100%;
  height: 42px;
  padding: 0;
  overflow: hidden;
  color: #40506d;
  font-size: 12px;
  text-overflow: ellipsis;
  background: transparent;
  border: 0;
  outline: 0;
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 9px;
  margin-top: 16px;
}

.primary-button,
.secondary-button {
  min-height: 42px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 650;
  border-radius: 10px;
}

.primary-button {
  color: #fff;
  background: linear-gradient(135deg, #5b92fb, #3d78ef);
}

.secondary-button {
  color: var(--blue-dark);
  background: #fff;
  border: 1px solid #8db1f6;
}

.toast {
  position: fixed;
  z-index: 40;
  top: max(22px, env(safe-area-inset-top));
  left: 50%;
  max-width: calc(100% - 40px);
  padding: 10px 15px;
  color: #fff;
  font-size: 13px;
  font-weight: 650;
  text-align: center;
  background: rgba(20, 31, 52, 0.94);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(20, 33, 61, 0.2);
  transform: translateX(-50%);
}

@media (max-width: 380px) {
  .page-shell {
    padding-right: 12px;
    padding-left: 12px;
  }

  .profile-card {
    padding-right: 12px;
    padding-left: 12px;
  }

  .avatar-frame {
    flex-basis: 52px;
    width: 52px;
    height: 52px;
  }

  .user-name {
    font-size: 16px;
  }

  .quick-button {
    width: 40px;
  }

  .quick-icon {
    width: 30px;
    height: 30px;
  }

  .account-card {
    gap: 8px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .account-icon {
    flex-basis: 38px;
    width: 38px;
    height: 38px;
  }

  .free-icon::before {
    top: 11px;
    left: 12px;
  }

  .free-icon::after {
    right: 8px;
    bottom: 9px;
  }

  .channel-icon::before {
    top: 12px;
    left: 10px;
  }

  .channel-icon::after {
    top: 7px;
    left: 13px;
  }

  .account-value {
    font-size: 16px;
  }

  .follow-button {
    min-width: 44px;
    padding: 0 9px;
  }

  .rental-card {
    padding-right: 16px;
    padding-left: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
