:root {
  --bg: #edf8ec;
  --card: #ffffff;
  --card-soft: rgba(255, 255, 255, 0.72);
  --text: #203025;
  --muted: #738176;
  --line: rgba(61, 96, 71, 0.12);
  --primary: #4aa55f;
  --primary-deep: #2d8a46;
  --primary-soft: #dff3e2;
  --danger: #e85c54;
  --shadow: 0 18px 44px rgba(89, 124, 96, 0.11);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", sans-serif;
  background: linear-gradient(180deg, #effaf0 0%, #e8f6e7 100%);
  color: var(--text);
}

body {
  -webkit-font-smoothing: antialiased;
}

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

button,
input,
textarea {
  font: inherit;
}

button {
  border: none;
  background: none;
}

img {
  display: block;
  max-width: 100%;
}

.page {
  min-height: 100vh;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 20px 16px 40px;
  box-sizing: border-box;
}

#contactPage {
  padding-bottom: 156px;
}

.page-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0 18px;
  background: linear-gradient(180deg, rgba(239, 250, 240, 0.95) 0%, rgba(239, 250, 240, 0.82) 72%, rgba(239, 250, 240, 0) 100%);
  backdrop-filter: blur(12px);
}

.page-title {
  display: grid;
  gap: 2px;
  margin: 0;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.page-title-main {
  font-size: 24px;
}

.page-title-sub {
  font-size: 18px;
}

.page-subtitle {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.header-side {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wallet-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 12px 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 28px rgba(89, 124, 96, 0.1);
}

.wallet-pill:active {
  transform: scale(0.98);
}

.wallet-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.wallet-value {
  color: #8b5a00;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.wallet-notice-dot {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ff4d4f;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.96);
}

.icon-button,
.text-button,
.ghost-button,
.primary-button,
.secondary-button {
  appearance: none;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}

.icon-button:active,
.text-button:active,
.ghost-button:active,
.primary-button:active,
.secondary-button:active {
  transform: scale(0.98);
}

.icon-button,
.text-button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--primary-deep);
  box-shadow: 0 10px 28px rgba(89, 124, 96, 0.1);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  padding: 0 12px;
}

.text-button {
  font-size: 14px;
  font-weight: 600;
}

.primary-button,
.secondary-button,
.ghost-button {
  width: 100%;
  min-height: 50px;
  border-radius: 16px;
  font-weight: 700;
}

.primary-button {
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, #65bf78 100%);
  box-shadow: 0 16px 26px rgba(74, 165, 95, 0.24);
}

#createButton {
  border-radius: 999px;
}

.secondary-button {
  color: var(--primary-deep);
  background: rgba(223, 243, 226, 0.96);
}

.ghost-button {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
}

.primary-button[disabled],
.secondary-button[disabled],
.ghost-button[disabled],
.icon-button[disabled],
.text-button[disabled] {
  opacity: 0.56;
  cursor: not-allowed;
  box-shadow: none;
}

.stack {
  display: grid;
  gap: 14px;
}

.contact-list {
  display: grid;
  gap: 14px;
}

.contact-item,
.empty-card,
.info-card,
.form-card,
.token-card {
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow);
}

.contact-item,
.empty-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px;
  text-align: left;
}

.contact-item {
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.contact-item:active {
  transform: scale(0.985);
}

.contact-avatar,
.empty-avatar,
.profile-avatar {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(135deg, #dceadf 0%, #cddfd1 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.78);
}

.contact-avatar {
  display: block;
  object-fit: cover;
  object-position: center;
}

.empty-avatar,
.profile-avatar.placeholder {
  display: grid;
  place-items: center;
  color: #94a396;
  font-size: 24px;
  font-weight: 700;
}

.contact-meta {
  min-width: 0;
  flex: 1;
}

.contact-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.contact-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 0;
  font-size: 12px;
  font-weight: 700;
}

.contact-status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: currentColor;
}

.contact-status.online {
  color: var(--primary-deep);
}

.contact-status.offline {
  color: #cccecc;
}

.contact-name,
.empty-title,
.form-title,
.info-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.empty-title,
.empty-desc {
  display: block;
}

.empty-desc,
.info-desc,
.helper-text,
.field-note,
.status-pill,
.token-hint,
.form-tip {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}


.empty-card {
  background: rgba(255, 255, 255, 0.72);
}

.list-footer {
  position: fixed;
  left: 50%;
  bottom: 20px;
  width: calc(100vw - 32px);
  max-width: 520px;
  transform: translateX(-50%);
  padding: 0 16px 0;
}

@supports (width: min(520px, calc(100vw - 32px))) {
  .list-footer {
    width: min(520px, calc(100vw - 32px));
  }
}

@supports (padding: 0 16px env(safe-area-inset-bottom)) {
  .list-footer {
    padding: 0 16px env(safe-area-inset-bottom);
  }
}

.info-card,
.token-card,
.form-card {
  padding: 18px;
}

.info-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(250, 255, 250, 0.98) 100%);
}

.account-card {
  display: flex;
  align-items: stretch;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(241, 251, 243, 0.98) 100%);
  box-shadow: var(--shadow);
}

.account-visual {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border-radius: 22px;
  background: linear-gradient(135deg, #dff3e2 0%, #bfe4c7 100%);
  color: var(--primary-deep);
  font-size: 28px;
  font-weight: 700;
}

.account-body {
  flex: 1;
  min-width: 0;
}

.account-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.account-title-text {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
}

.account-badge {
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef7ee;
  color: var(--primary-deep);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.account-badge.offline {
  background: rgba(115, 129, 118, 0.12);
  color: var(--muted);
}

.account-description {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.account-actions {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.loading-list {
  display: grid;
  gap: 14px;
}

.skeleton-card {
  height: 90px;
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.86) 20%, rgba(240, 248, 240, 0.95) 50%, rgba(255, 255, 255, 0.86) 80%);
  background-size: 240% 100%;
  animation: shimmer 1.6s infinite;
  box-shadow: var(--shadow);
}

@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.status-pill {
  margin: 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-deep);
  white-space: nowrap;
}

.form-card {
  display: grid;
  gap: 18px;
}

#tabHeader {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: #eef7ee;
}

#tabHeader .tab-button {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  color: var(--muted);
  font-weight: 700;
}

#tabHeader .tab-button.active {
  background: #fff;
  color: var(--primary-deep);
  box-shadow: 0 10px 18px rgba(89, 124, 96, 0.08);
}

.tab-panel {
  display: none;
  gap: 14px;
}

.tab-panel.active {
  display: grid;
}

.field-group {
  display: grid;
  gap: 8px;
}

.switch-field {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid rgba(61, 96, 71, 0.12);
  border-radius: 18px;
  background: #f8fcf8;
  cursor: pointer;
}

.switch-copy {
  display: grid;
  gap: 6px;
}

.switch-copy .field-note {
  margin: 0;
}

.switch-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 32px;
}

.switch-input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
}

.switch-slider {
  position: relative;
  width: 52px;
  height: 32px;
  border-radius: 999px;
  background: rgba(115, 129, 118, 0.2);
  box-shadow: inset 0 0 0 1px rgba(61, 96, 71, 0.08);
  transition: background 0.18s ease, box-shadow 0.18s ease;
}

.switch-slider::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 6px 14px rgba(61, 96, 71, 0.18);
  transition: transform 0.18s ease;
}

.switch-input:checked + .switch-slider {
  background: linear-gradient(135deg, var(--primary) 0%, #65bf78 100%);
  box-shadow: 0 10px 18px rgba(74, 165, 95, 0.18);
}

.switch-input:checked + .switch-slider::after {
  transform: translateX(20px);
}

.switch-input:focus-visible + .switch-slider {
  box-shadow: 0 0 0 4px rgba(74, 165, 95, 0.14);
}

.field-label {
  font-size: 14px;
  font-weight: 700;
}

.text-input,
.text-area {
  width: 100%;
  border: 1px solid rgba(61, 96, 71, 0.12);
  border-radius: 16px;
  background: #f8fcf8;
  padding: 14px 16px;
  color: var(--text);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.text-input::placeholder,
.text-area::placeholder {
  color: #9aa79d;
}

.text-input:focus,
.text-area:focus {
  border-color: rgba(74, 165, 95, 0.4);
  box-shadow: 0 0 0 4px rgba(74, 165, 95, 0.12);
  background: #fff;
}

.text-area {
  min-height: 118px;
  resize: vertical;
}

.gender-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chip-button {
  min-width: 86px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  background: #f3f8f3;
  color: var(--muted);
  font-weight: 700;
  border: 1px solid transparent;
}

.chip-button.active {
  background: var(--primary-soft);
  color: var(--primary-deep);
  border-color: rgba(74, 165, 95, 0.22);
}

.form-actions {
  display: grid;
  gap: 10px;
}

.login-page {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  width: 100%;
  max-width: min(520px, 100vw);
  overflow-x: clip;
  padding-top: 24px;
  padding-bottom: calc(40px + env(safe-area-inset-bottom));
}

.login-page-header {
  position: relative;
  display: flex; /* override block */
  align-items: center;
  justify-content: center;
  padding-bottom: 16px;
  background: transparent;
  backdrop-filter: none;
}

html.momood-from-momoodapp .page {
  padding-top: 85px;
}

html.momood-from-momoodapp .page-header:not(.login-page-header) {
  top: 85px;
}

.login-shell,
.login-form-card {
  display: grid;
  gap: 14px;
}

.login-shell {
  width: min(100%, 420px);
  max-width: 100%;
  min-width: 0;
  margin: 0 auto;
}

.login-loading {
  display: grid;
  place-items: center;
  min-height: 120px;
}

.login-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid rgba(74, 165, 95, 0.16);
  border-top-color: var(--primary);
  animation: login-spin 0.8s linear infinite;
}

.login-form-card {
  padding: 22px 18px;
  max-width: 100%;
  min-width: 0;
}

@keyframes login-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.top-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
  font-size: 13px;
}

.token-mask {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  color: var(--primary-deep);
}

.modal-mask {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  min-height: 100%;
  background: rgba(20, 37, 24, 0.24);
  padding: 20px 16px 16px;
}

@supports (padding: 20px 16px calc(16px + env(safe-area-inset-bottom))) {
  .modal-mask {
    padding: 20px 16px calc(16px + env(safe-area-inset-bottom));
  }
}

.modal-mask.open {
  display: flex;
}

.token-sheet {
  width: 100%;
  max-width: 520px;
  padding: 18px;
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 20px 40px rgba(39, 65, 44, 0.18);
}

.token-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.sheet-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.sheet-actions {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.captcha-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.captcha-row .text-input {
  min-width: 0;
}

.captcha-button {
  width: auto;
  min-width: 118px;
  justify-content: center;
  white-space: nowrap;
}

.login-sheet {
  padding-bottom: 18px;
}

.wallet-info-sheet {
  padding-bottom: 18px;
}

@supports (padding-bottom: calc(18px + env(safe-area-inset-bottom))) {
  .login-sheet,
  .wallet-info-sheet {
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }
}

.wallet-info-text {
  margin-top: 6px;
  white-space: pre-line;
  line-height: 1.8;
}

.bottom-share-entry {
  position: fixed;
  left: 50%;
  bottom: 84px;
  z-index: 35;
  transform: translateX(-50%);
}

@supports (bottom: calc(84px + env(safe-area-inset-bottom))) {
  .bottom-share-entry {
    bottom: calc(84px + env(safe-area-inset-bottom));
  }
}

.share-friend-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 0;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #245132;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  cursor: pointer;
  appearance: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.share-friend-button:active {
  transform: scale(0.98);
  background: rgba(255, 255, 255, 0.28);
  box-shadow: 0 8px 20px rgba(65, 90, 71, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.36);
}

.share-sheet {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.56);
  box-shadow: 0 22px 48px rgba(39, 65, 44, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.56);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.share-sheet-text {
  margin: 6px 0 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.8;
  white-space: pre-line;
  word-break: break-word;
}

.status-loading-mask {
  position: fixed;
  inset: 0;
  z-index: 54;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 18, 16, 0.42);
}

.status-loading-mask.open {
  display: flex;
}

.status-loading-card {
  min-width: 188px;
  max-width: min(280px, calc(100vw - 48px));
  padding: 22px 20px;
  border-radius: 22px;
  background: rgba(33, 37, 35, 0.86);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: grid;
  justify-items: center;
  gap: 12px;
}

.status-loading-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: rgba(255, 255, 255, 0.95);
  animation: status-loading-spin 0.8s linear infinite;
}

.status-loading-text {
  margin: 0;
  color: rgba(255, 255, 255, 0.96);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
}

@keyframes status-loading-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.custom-confirm-modal {
  z-index: 55;
  align-items: center;
  padding-top: 24px;
  padding-bottom: 24px;
}

.custom-confirm-sheet {
  max-width: 360px;
}

.custom-confirm-header {
  margin-bottom: 8px;
}

.custom-confirm-message {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-line;
}

.custom-confirm-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.primary-button.danger {
  background: linear-gradient(135deg, var(--danger) 0%, #ff7a70 100%);
  box-shadow: 0 16px 26px rgba(232, 92, 84, 0.22);
}

.action-menu {
  width: min(420px, 100%);
  padding: 18px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 50px rgba(39, 65, 44, 0.2);
}

.action-menu-header {
  margin-bottom: 14px;
}

.action-menu-kicker {
  margin: 0 0 8px;
  color: var(--primary-deep);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.action-menu-desc {
  margin-top: 8px;
}

.action-menu-actions {
  display: grid;
  gap: 10px;
}

.action-menu-button {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 16px;
  background: #f6fbf6;
  color: var(--text);
  font-weight: 700;
  text-align: left;
}

.action-menu-button.danger {
  background: rgba(232, 92, 84, 0.08);
  color: var(--danger);
}

.action-menu-cancel {
  margin-top: 14px;
}

.wechat-sheet {
  background: #EBEEEB;
  padding-bottom: 18px;
}

@supports (padding-bottom: calc(18px + env(safe-area-inset-bottom))) {
  .wechat-sheet {
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }
}

.wechat-connect-success {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: min(72vh, 520px);
  padding: 26px 6px 10px;
  text-align: center;
}

.wechat-success-title {
  margin: 0;
  color: #111;
  font-size: 34px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.wechat-success-desc {
  max-width: 320px;
  margin: 18px auto 0;
  color: #222;
  font-size: 15px;
  line-height: 1.75;
}

.wechat-success-button {
  width: auto;
  margin-top: 34px;
  padding: 0 80px;
  border-radius: 999px;
  min-height: 54px;
  font-size: 17px;
  box-shadow: 0 14px 28px rgba(74, 165, 95, 0.24);
}

.wechat-sheet-subtitle {
  margin-top: 6px;
}

.wechat-status-card {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.wechat-status-pill {
  justify-self: flex-start;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(74, 165, 95, 0.12);
  color: var(--primary-deep);
  font-size: 13px;
  font-weight: 700;
}

.wechat-status-pill.pending {
  background: rgba(255, 183, 77, 0.18);
  color: #9b6b00;
}

.wechat-status-pill.error {
  background: rgba(232, 92, 84, 0.12);
  color: var(--danger);
}

.wechat-status-text {
  margin: 0;
}

.wechat-qr-card {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  min-height: 260px;
  margin-top: 14px;
  border-radius: 22px;
  background: linear-gradient(180deg, #f8fcf8 0%, #f3faf4 100%);
  border: 1px solid rgba(61, 96, 71, 0.08);
  overflow: hidden;
}

.wechat-qr-image {
  width: 280px;
  height: 280px;
  max-width: 82vw;
  max-height: 82vw;
  aspect-ratio: 1;
  object-fit: contain;
}

.wechat-qr-placeholder {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.wechat-flow-tip {
  margin-top: 14px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  max-width: calc(100vw - 40px);
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(30, 43, 34, 0.92);
  color: #fff;
  font-size: 14px;
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

@supports (bottom: calc(24px + env(safe-area-inset-bottom))) {
  .toast {
    bottom: calc(24px + env(safe-area-inset-bottom));
  }
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.error {
  background: rgba(186, 53, 53, 0.94);
}

/* Settings dropdown */
.settings-dropdown-wrapper {
  position: relative;
}

.settings-dropdown,
.contact-action-popover {
  position: absolute;
  min-width: 148px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.13), 0 2px 8px rgba(0, 0, 0, 0.06);
  z-index: 50;
  overflow: hidden;
  animation: dropdown-in 0.16s ease;
}

.settings-dropdown {
  top: calc(100% + 8px);
  right: 0;
}

.contact-action-popover {
  position: fixed;
  min-width: 160px;
}

@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

.settings-menu-item {
  display: block;
  width: 100%;
  padding: 13px 18px;
  text-align: left;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.12s ease;
}

.settings-menu-item:active {
  background: #f2f2f2;
}

.settings-menu-item.danger {
  color: var(--danger);
}

.settings-menu-divider {
  height: 1px;
  background: var(--line);
  margin: 2px 12px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary-deep);
  font-size: 14px;
  font-weight: 700;
}

.hidden {
  display: none !important;
}

@media (max-width: 420px) {
  .page {
    padding-left: 14px;
    padding-right: 14px;
  }

  .page-title-main {
    font-size: 22px;
  }

  .page-title-sub {
    font-size: 17px;
  }

  .contact-item,
  .empty-card,
  .account-card,
  .info-card,
  .token-card,
  .form-card {
    border-radius: 22px;
  }

  .bottom-share-entry {
    bottom: 76px;
  }

  @supports (bottom: calc(76px + env(safe-area-inset-bottom))) {
    .bottom-share-entry {
      bottom: calc(76px + env(safe-area-inset-bottom));
    }
  }

  .account-card {
    flex-direction: column;
  }

  .account-visual {
    width: 58px;
    height: 58px;
    border-radius: 20px;
  }

  .captcha-row {
    grid-template-columns: 1fr;
  }

  .captcha-button {
    width: 100%;
  }

  .minimal-card {
    padding: 24px 16px;
    border-radius: 22px;
  }
}

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

  .minimal-card {
    padding: 20px 14px;
    border-radius: 20px;
  }

  .minimal-captcha-btn {
    padding: 0 12px;
    font-size: 13px;
  }
}

/* Minimalist Login Redesign Additions */
.minimal-back {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text);
  padding: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transition: background 0.2s;
}
.minimal-back:active {
  background: rgba(255, 255, 255, 0.8);
}
.minimal-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.editor-page-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.login-shell {
  margin-top: 20px;
}
.minimal-card {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.04);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 28px;
  padding: clamp(20px, 6vw, 32px) clamp(14px, 5vw, 24px);
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.field-group-minimal {
  position: relative;
  min-width: 0;
}
.minimal-input {
  min-width: 0;
  max-width: 100%;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  padding: 16px clamp(14px, 4vw, 20px);
  font-size: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02) inset;
  transition: all 0.2s ease;
}
.minimal-input:focus {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}
.minimal-input::placeholder {
  color: #a0aab2;
  font-weight: 500;
}
.captcha-row-minimal {
  display: flex;
  gap: 12px;
  min-width: 0;
}
.captcha-row-minimal .minimal-input {
  flex: 1;
  min-width: 0;
  width: auto;
}
.minimal-captcha-btn {
  white-space: nowrap;
  width: auto;
  padding: 0 16px;
  border-radius: 16px;
  font-size: 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
  color: var(--text);
  flex-shrink: 0;
  min-height: 54px;
}
.minimal-captcha-btn:active {
  background: #f0f0f0;
}
.minimal-btn {
  border-radius: 16px;
  min-height: 54px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-top: 12px;
  box-shadow: 0 8px 24px rgba(74, 165, 95, 0.2);
}

@media (max-width: 420px) {
  .login-page {
    max-width: 100vw;
    padding-left: 12px;
    padding-right: 12px;
  }

  .minimal-card {
    border-radius: 22px;
    padding: 24px 14px;
  }
}

@media (max-width: 360px) {
  .login-page {
    padding-left: 10px;
    padding-right: 10px;
  }

  .minimal-card {
    border-radius: 20px;
    padding: 20px 12px;
  }

  .captcha-row-minimal {
    gap: 10px;
  }

  .minimal-captcha-btn {
    padding: 0 12px;
    font-size: 13px;
  }
}

@media (max-width: 320px) {
  .captcha-row-minimal {
    flex-direction: column;
  }

  .captcha-row-minimal .minimal-input,
  .minimal-captcha-btn {
    width: 100%;
  }
}

