/* 零叩 Locod · 导航用户组件 */
.wx-nav-user-host {
  display: flex;
  align-items: center;
}

.wx-nav-login-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.08);
  color: #047857;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  transition: background 0.2s, border-color 0.2s;
}

.wx-nav-login-btn:hover {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.55);
}

.wx-nav-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.25rem 0.5rem 0.25rem 0.25rem;
  border-radius: 9999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #1d2129;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.wx-nav-user-btn:hover {
  border-color: rgba(16, 185, 129, 0.45);
}

.wx-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  object-fit: cover;
  flex-shrink: 0;
}

.wx-user-avatar--fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ecfdf5;
  color: #059669;
}

.wx-nav-user-name {
  max-width: 6rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wx-nav-user-caret {
  font-size: 0.75rem;
  color: #6b7280;
}

.wx-nav-user-menu {
  min-width: 11rem;
}

.wx-nav-logout-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.65rem 1rem;
  border: 0;
  background: transparent;
  color: #374151;
  font-size: 0.875rem;
  cursor: pointer;
}

.wx-nav-logout-btn:hover {
  background: #f9fafb;
  color: #b91c1c;
}

.wx-mobile-user-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.75rem;
  border-radius: 0.65rem;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #374151;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.wx-mobile-user-link:hover {
  border-color: rgba(16, 185, 129, 0.45);
  color: #047857;
}

@media (max-width: 767px) {
  .wx-nav-user-host {
    display: none;
  }
}

/* 账户页 */
.account-page {
  padding-top: 5.5rem;
  padding-bottom: 3rem;
}

.account-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  padding: 1.25rem;
}

.account-profile {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.account-profile .wx-user-avatar,
.account-profile .wx-user-avatar--fallback {
  width: 64px;
  height: 64px;
  font-size: 1.5rem;
}

.account-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.account-stat {
  border: 1px solid #f3f4f6;
  border-radius: 0.75rem;
  padding: 0.75rem;
  text-align: center;
}

.account-stat strong {
  display: block;
  font-size: 1.25rem;
  color: #047857;
}

.account-list-item {
  border: 1px solid #f3f4f6;
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
}

@media (max-width: 640px) {
  .account-stat-grid {
    grid-template-columns: 1fr;
  }
}

/* 登录面板 / 弹窗 */
.wx-login-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.wx-login-modal.hidden {
  display: none !important;
}

.wx-login-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.wx-login-modal-body {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  max-height: 90vh;
  overflow-y: auto;
}

.wx-login-panel {
  position: relative;
  background: #fff;
  border-radius: 1rem;
  border: 1px solid #e5e7eb;
  padding: 1.25rem 1.25rem 1rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.wx-login-inline .wx-login-panel {
  box-shadow: none;
  padding: 0;
  border: 0;
}

.wx-login-inline .wx-login-close {
  display: none;
}

.wx-login-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  border: 0;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  color: #9ca3af;
  cursor: pointer;
}

.wx-login-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.wx-login-lead {
  font-size: 0.875rem;
  color: #4b5563;
  margin: 0 0 1rem;
  line-height: 1.5;
}

.wx-login-code-hint {
  margin: 0 0 0.35rem;
  font-size: 0.9375rem;
  color: #374151;
  text-align: center;
}

.wx-login-code-num {
  font-size: 1.5rem;
  letter-spacing: 0.15em;
  color: #047857;
}

.wx-login-code-note {
  margin: 0 0 0.85rem;
  padding: 0.5rem 0.65rem;
  border-radius: 0.5rem;
  background: #fffbeb;
  border: 1px solid #fde68a;
  font-size: 0.75rem;
  color: #92400e;
  line-height: 1.5;
}

.wx-login-oauth-btn {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  border: 0;
  border-radius: 0.75rem;
  background: #059669;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 0.75rem;
}

.wx-login-divider {
  text-align: center;
  color: #9ca3af;
  font-size: 0.75rem;
  margin: 0.5rem 0 0.75rem;
}

.wx-login-qr-wrap {
  text-align: center;
  margin-bottom: 0.75rem;
}

.wx-login-qr {
  width: 200px;
  height: 200px;
  object-fit: contain;
  border-radius: 0.75rem;
  border: 1px solid #f3f4f6;
}

.wx-login-steps {
  margin: 0 0 1rem 1.1rem;
  padding: 0;
  font-size: 0.8125rem;
  color: #374151;
  line-height: 1.6;
}

.wx-login-code-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.wx-login-code-input {
  flex: 1 1 120px;
  min-width: 0;
  padding: 0.55rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.65rem;
  font-size: 1rem;
  text-transform: uppercase;
}

.wx-login-code-btn {
  padding: 0.55rem 1rem;
  border: 0;
  border-radius: 0.65rem;
  background: #10b981;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.wx-login-status {
  margin: 0.75rem 0 0;
  font-size: 0.8125rem;
  color: #6b7280;
}

.wx-login-status.is-ok {
  color: #047857;
}

.wx-login-status.is-err {
  color: #b91c1c;
}

.wx-nav-verified-btn {
  background: rgba(16, 185, 129, 0.12);
}

body.wx-login-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .wx-login-code-row {
    flex-direction: column;
  }

  .wx-login-code-btn {
    width: 100%;
  }
}
